1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
5 ** $Id: selectionmanager.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SYNFIG_APP_SELECTIONMANAGER_H
25 #define __SYNFIG_APP_SELECTIONMANAGER_H
27 /* === H E A D E R S ======================================================= */
32 #include <synfig/layer.h>
33 #include <synfig/valuenode.h>
34 #include "value_desc.h"
36 /* === M A C R O S ========================================================= */
38 /* === T Y P E D E F S ===================================================== */
40 /* === C L A S S E S & S T R U C T S ======================================= */
44 class SelectionManager : public etl::shared_object
47 typedef std::pair<synfig::Layer::Handle,synfig::String> LayerParam;
48 typedef std::list<LayerParam> LayerParamList;
50 typedef std::list<synfig::Layer::Handle> LayerList;
51 typedef std::list<ValueDesc> ChildrenList;
52 //typedef std::list<synfig::ValueNode::Handle> ValueNodeList;
54 virtual ~SelectionManager() { }
56 //! Returns the number of layers selected.
57 virtual int get_selected_layer_count()const=0;
59 //! Returns a list of the currently selected layers.
60 virtual LayerList get_selected_layers()const=0;
62 //! Returns the first layer selected or an empty handle if none are selected.
63 virtual synfig::Layer::Handle get_selected_layer()const=0;
65 //! Sets which layers should be selected
66 virtual void set_selected_layers(const LayerList &layer_list)=0;
68 //! Sets which layer should be selected. Empty handle if none.
69 virtual void set_selected_layer(const synfig::Layer::Handle &layer)=0;
71 //! Clears the layer selection list
72 virtual void clear_selected_layers()=0;
76 //! Returns the number of childrens selected.
77 virtual int get_selected_children_count()const=0;
79 //! Returns a list of the currently selected childrens.
80 virtual ChildrenList get_selected_children()const=0;
82 //! Returns the first children selected or an empty handle if none are selected.
83 virtual ChildrenList::value_type get_selected_child()const=0;
85 //! Sets which childrens should be selected
86 virtual void set_selected_children(const ChildrenList &children_list)=0;
88 //! Sets which children should be selected. Empty handle if none.
89 virtual void set_selected_child(const ChildrenList::value_type &children)=0;
91 //! Clears the children selection list
92 virtual void clear_selected_children()=0;
95 //! Returns the number of layer parameters selected.
96 virtual int get_selected_layer_parameter_count()const=0;
98 //! Returns a list of the currently selected layer parameters.
99 virtual LayerParamList get_selected_layer_parameters()const=0;
101 //! Returns the first layer parameter selected or an empty handle if none are selected.
102 virtual LayerParam get_selected_layer_parameter()const=0;
104 //! Sets which layer parameters should be selected
105 virtual void set_selected_layer_parameters(const LayerParamList &layer_param_list)=0;
107 //! Sets which layer parameter should be selected. Empty handle if none.
108 virtual void set_selected_layer_param(const LayerParam &layer_param)=0;
110 //! Clears the layer parameter selection list
111 virtual void clear_selected_layer_parameters()=0;
112 }; // END of class SelectionManager
114 //! A place holding selection manager that does nothing
115 class NullSelectionManager : public SelectionManager
118 int get_selected_layer_count()const { return 0; }
119 LayerList get_selected_layers()const { return LayerList(); }
120 synfig::Layer::Handle get_selected_layer()const { return 0; }
121 void set_selected_layers(const LayerList &layer_list) { return; }
122 void set_selected_layer(const synfig::Layer::Handle &layer) { return; }
123 void clear_selected_layers() { return; }
126 int get_selected_children_count()const { return 0; }
127 ChildrenList get_selected_children()const { return ChildrenList(); }
128 ChildrenList::value_type get_selected_child()const { return ChildrenList::value_type(); }
129 void set_selected_children(const ChildrenList &children_list) { return; }
130 void set_selected_child(const ChildrenList::value_type &child) { return; }
131 void clear_selected_children() { return; }
133 int get_selected_layer_parameter_count()const { return 0; }
134 LayerParamList get_selected_layer_parameters()const { return LayerParamList(); }
135 LayerParam get_selected_layer_parameter()const { return LayerParam(); }
136 void set_selected_layer_parameters(const LayerParamList &layer_param_list) { return; }
137 void set_selected_layer_param(const LayerParam &layer_param) { return; }
138 void clear_selected_layer_parameters() { return; }
140 }; // END of class NullSelectionManager
142 }; // END of namespace synfigapp
144 /* === E N D =============================================================== */