- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# selectionmanager.h

Go to the documentation of this file.

    00001 /* === S Y N F I G ========================================================= */
    00021 /* ========================================================================= */
    00022
    00023 /* === S T A R T =========================================================== */
    00024
    00025 #ifndef __SYNFIG_APP_SELECTIONMANAGER_H
    00026 #define __SYNFIG_APP_SELECTIONMANAGER_H
    00027
    00028 /* === H E A D E R S ======================================================= */
    00029
    00030 #include <list>
    00031 #include <set>
    00032 #include <ETL/handle>
    00033 #include <synfig/layer.h>
    00034 #include <synfig/valuenode.h>
    00035 #include "value_desc.h"
    00036
    00037 /* === M A C R O S ========================================================= */
    00038
    00039 /* === T Y P E D E F S ===================================================== */
    00040
    00041 /* === C L A S S E S & S T R U C T S ======================================= */
    00042
    00043 namespace synfigapp {
    00044
    00045 class SelectionManager : public etl::shared_object
    00046 {
    00047 public:
    00048     typedef std::pair<synfig::Layer::Handle,synfig::String> LayerParam;
    00049     typedef std::list<LayerParam> LayerParamList;
    00050
    00051     typedef std::list<synfig::Layer::Handle> LayerList;
    00052     typedef std::list<ValueDesc> ChildrenList;
    00053     //typedef std::list<synfig::ValueNode::Handle> ValueNodeList;
    00054
    00055     virtual ~SelectionManager() { }
    00056
    00058     virtual int get_selected_layer_count()const=0;
    00059
    00061     virtual LayerList get_selected_layers()const=0;
    00062
    00064     virtual synfig::Layer::Handle get_selected_layer()const=0;
    00065
    00067     virtual void set_selected_layers(const LayerList &layer_list)=0;
    00068
    00070     virtual void set_selected_layer(const synfig::Layer::Handle &layer)=0;
    00071
    00073     virtual void clear_selected_layers()=0;
    00074
    00075
    00076
    00078     virtual int get_selected_children_count()const=0;
    00079
    00081     virtual ChildrenList get_selected_children()const=0;
    00082
    00084     virtual ChildrenList::value_type get_selected_child()const=0;
    00085
    00087     virtual void set_selected_children(const ChildrenList &children_list)=0;
    00088
    00090     virtual void set_selected_child(const ChildrenList::value_type &children)=0;
    00091
    00093     virtual void clear_selected_children()=0;
    00094
    00095
    00097     virtual int get_selected_layer_parameter_count()const=0;
    00098
    00100     virtual LayerParamList get_selected_layer_parameters()const=0;
    00101
    00103     virtual LayerParam get_selected_layer_parameter()const=0;
    00104
    00106     virtual void set_selected_layer_parameters(const LayerParamList &layer_param_list)=0;
    00107
    00109     virtual void set_selected_layer_param(const LayerParam &layer_param)=0;
    00110
    00112     virtual void clear_selected_layer_parameters()=0;
    00113 }; // END of class SelectionManager
    00114
    00116 class NullSelectionManager : public SelectionManager
    00117 {
    00118 public:
    00119     int get_selected_layer_count()const { return 0; }
    00120     LayerList get_selected_layers()const { return LayerList(); }
    00121     synfig::Layer::Handle get_selected_layer()const { return 0; }
    00122     void set_selected_layers(const LayerList &/*layer_list*/) { return; }
    00123     void set_selected_layer(const synfig::Layer::Handle &/*layer*/) { return; }
    00124     void clear_selected_layers() { return; }
    00125
    00126
    00127     int get_selected_children_count()const { return 0; }
    00128     ChildrenList get_selected_children()const { return ChildrenList(); }
    00129     ChildrenList::value_type get_selected_child()const { return ChildrenList::value_type(); }
    00130     void set_selected_children(const ChildrenList &/*children_list*/) { return; }
    00131     void set_selected_child(const ChildrenList::value_type &/*child*/) { return; }
    00132     void clear_selected_children() { return; }
    00133
    00134     int get_selected_layer_parameter_count()const { return 0; }
    00135     LayerParamList get_selected_layer_parameters()const { return LayerParamList(); }
    00136     LayerParam get_selected_layer_parameter()const { return LayerParam(); }
    00137     void set_selected_layer_parameters(const LayerParamList &/*layer_param_list*/) { return; }
    00138     void set_selected_layer_param(const LayerParam &/*layer_param*/) { return; }
    00139     void clear_selected_layer_parameters() { return; }
    00140
    00141 }; // END of class NullSelectionManager
    00142
    00143 }; // END of namespace synfigapp
    00144
    00145 /* === E N D =============================================================== */
    00146
    00147 #endif