initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / layergrouptree.h
1 /* === S I N F G =========================================================== */
2 /*!     \file layergrouptree.h
3 **      \brief Template Header
4 **
5 **      $Id: layergrouptree.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
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.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_STUDIO_LAYERGROUPTREE_H
25 #define __SINFG_STUDIO_LAYERGROUPTREE_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/treeview.h>
30 #include <gtkmm/treestore.h>
31 #include <sinfgapp/canvasinterface.h>
32 #include <sinfgapp/value_desc.h>
33 #include "layergrouptreestore.h"
34
35 /* === M A C R O S ========================================================= */
36
37 /* === T Y P E D E F S ===================================================== */
38
39 /* === C L A S S E S & S T R U C T S ======================================= */
40
41 namespace sinfg { class Layer; }
42
43 namespace studio {
44
45 class LayerGroupTree : public Gtk::TreeView
46 {
47         /*
48  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
49         */
50
51 public:
52
53         typedef std::list<sinfg::Layer::Handle> LayerList;
54
55         /*
56  -- ** -- P U B L I C  D A T A ------------------------------------------------
57         */
58
59 public:
60         
61         LayerGroupTreeStore::Model model;
62         
63         /*
64  -- ** -- P R I V A T E   D A T A ---------------------------------------------
65         */
66
67 private:
68
69         Glib::RefPtr<LayerGroupTreeStore> layer_group_tree_store_;
70
71         Gtk::CellRendererText *cell_renderer_description;
72
73         bool editable_;
74
75
76         sigc::signal<void,etl::handle<sinfg::Layer> > signal_popup_layer_menu_;
77
78 //      sigc::signal<void,LayerList> signal_select_layers_;
79         Gtk::TreeView::Column* label_column;
80
81         /*
82  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
83         */
84
85 private:
86         
87         /*
88  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
89         */
90
91 private:
92
93         bool on_event(GdkEvent *event);
94
95         /*
96  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
97         */
98
99 public:
100         
101         LayerGroupTree();
102         ~LayerGroupTree();
103         void set_cursor(const Gtk::TreeModel::Path& path, bool start_editing=false);
104
105         Glib::RefPtr<LayerGroupTreeStore> get_model() { return layer_group_tree_store_; }
106
107         sigc::signal<void,etl::handle<sinfg::Layer> >& signal_popup_layer_menu() { return signal_popup_layer_menu_; }
108
109 //      sigc::signal<void,LayerList>& signal_select_layers() { return signal_select_layers_; }
110
111         void set_model(Glib::RefPtr<LayerGroupTreeStore> layer_group_tree_store_);
112
113         void set_editable(bool x=true);
114         
115         bool get_editable()const { return editable_; }
116         
117         std::list<sinfg::String> get_selected_groups()const;
118
119         LayerList get_selected_layers()const;   
120 }; // END of LayerGroupTree
121
122 }; // END of namespace studio
123
124 /* === E N D =============================================================== */
125
126 #endif