Added copyright lines for files I've edited this year.
[synfig.git] / synfig-studio / trunk / src / gtkmm / childrentree.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file childrentree.h
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2008 Chris Moore
10 **
11 **      This package is free software; you can redistribute it and/or
12 **      modify it under the terms of the GNU General Public License as
13 **      published by the Free Software Foundation; either version 2 of
14 **      the License, or (at your option) any later version.
15 **
16 **      This package is distributed in the hope that it will be useful,
17 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
18 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 **      General Public License for more details.
20 **      \endlegal
21 */
22 /* ========================================================================= */
23
24 /* === S T A R T =========================================================== */
25
26 #ifndef __SYNFIG_STUDIO_CHILDRENTREE_H
27 #define __SYNFIG_STUDIO_CHILDRENTREE_H
28
29 /* === H E A D E R S ======================================================= */
30
31 #include <gtkmm/treeview.h>
32 #include <gtkmm/treestore.h>
33 #include <gtkmm/tooltips.h>
34 #include <gtkmm/table.h>
35 #include <gtkmm/box.h>
36 #include <gtkmm/adjustment.h>
37 #include <gtkmm/scale.h>
38 #include <gtkmm/button.h>
39
40 #include <synfigapp/canvasinterface.h>
41 #include <synfigapp/value_desc.h>
42 #include "childrentreestore.h"
43 #include <synfig/valuenode_animated.h>
44
45 #include "widget_value.h"
46
47 /* === M A C R O S ========================================================= */
48
49 /* === T Y P E D E F S ===================================================== */
50
51 /* === C L A S S E S & S T R U C T S ======================================= */
52
53 namespace studio {
54
55 class CellRenderer_TimeTrack;
56 class CellRenderer_ValueBase;
57
58 class ChildrenTree : public Gtk::Table
59 {
60         /*
61  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
62         */
63
64 public:
65
66         typedef studio::ColumnID ColumnID;
67
68         /*
69  -- ** -- P U B L I C  D A T A ------------------------------------------------
70         */
71
72 public:
73
74         ChildrenTreeStore::Model model;
75
76         /*
77  -- ** -- P R I V A T E   D A T A ---------------------------------------------
78         */
79
80 private:
81
82         Gtk::Tooltips tooltips_;
83
84         Gtk::TreePath last_tooltip_path;
85
86         Gtk::TreeView tree_view;
87
88         Gtk::HBox *hbox;
89
90         Glib::RefPtr<ChildrenTreeStore> children_tree_store_;
91
92         CellRenderer_TimeTrack *cellrenderer_time_track;
93
94         Gtk::TreeView::Column* column_time_track;
95
96         CellRenderer_ValueBase *cellrenderer_value;
97
98         sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase> signal_edited_value_;
99
100         sigc::signal<bool, int, Gtk::TreeRow, ColumnID> signal_user_click_;
101
102         sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side> signal_waypoint_clicked_childrentree_;
103
104         Gtk::Button *button_raise;
105         Gtk::Button *button_lower;
106         Gtk::Button *button_duplicate;
107         Gtk::Button *button_delete;
108
109         Widget_ValueBase blend_method_widget;
110
111         /*
112  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
113         */
114
115 private:
116
117         /*
118  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
119         */
120
121 private:
122
123         void on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
124
125         void on_waypoint_clicked_childrentree(const etl::handle<synfig::Node>& node,const synfig::Time&,const synfig::Time&,int button,synfig::Waypoint::Side side);
126
127         bool on_tree_event(GdkEvent *event);
128
129         void on_selection_changed();
130
131         void on_dirty_preview();
132
133         void on_raise_pressed();
134
135         void on_lower_pressed();
136
137         void on_duplicate_pressed();
138
139         void on_delete_pressed();
140
141         /*
142  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
143         */
144
145 public:
146
147         Gtk::HBox& get_hbox() { return *hbox; }
148
149         Gtk::TreeView& get_tree_view() { return tree_view; }
150
151         Glib::RefPtr<Gtk::TreeSelection> get_selection() { return tree_view.get_selection(); }
152         Glib::SignalProxy1< bool,GdkEvent* >  signal_event () { return tree_view.signal_event(); }
153
154         ChildrenTree();
155         ~ChildrenTree();
156
157         void set_model(Glib::RefPtr<ChildrenTreeStore> children_tree_store_);
158
159         void set_time_adjustment(Gtk::Adjustment &adjustment);
160
161         void set_show_timetrack(bool x=true);
162
163         //! Signal called with a value has been edited.
164         sigc::signal<void,synfigapp::ValueDesc,synfig::ValueBase>& signal_edited_value() { return signal_edited_value_; }
165
166         sigc::signal<bool,int, Gtk::TreeRow, ColumnID>& signal_user_click() { return signal_user_click_; }
167
168         sigc::signal<void,synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >,int,synfig::Waypoint::Side>& signal_waypoint_clicked_childrentree() { return signal_waypoint_clicked_childrentree_; }
169
170         etl::handle<synfigapp::SelectionManager> get_selection_manager() { return children_tree_store_->canvas_interface()->get_selection_manager(); }
171
172 }; // END of ChildrenTree
173
174 }; // END of namespace studio
175
176 /* === E N D =============================================================== */
177
178 #endif