initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / metadatatreestore.h
1 /* === S I N F G =========================================================== */
2 /*!     \file metadatatreestore.h
3 **      \brief Template Header
4 **
5 **      $Id: metadatatreestore.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_METADATATREESTORE_H
25 #define __SINFG_STUDIO_METADATATREESTORE_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/treestore.h>
30 #include <sinfgapp/canvasinterface.h>
31 #include <gdkmm/pixbuf.h>
32 #include <sinfgapp/action.h>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace sinfgapp { class CanvasInterface; }
41
42 namespace studio {
43         
44 class MetaDataTreeStore : virtual public Gtk::TreeStore
45 {
46         /*
47  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
48         */
49
50 public:
51
52         class Model : public Gtk::TreeModel::ColumnRecord
53         {
54         public:
55         public:
56                 Gtk::TreeModelColumn<Glib::ustring> key;
57                 Gtk::TreeModelColumn<Glib::ustring> data;
58
59                 Model()
60                 {
61                         add(key);
62                         add(data);
63                 }
64         };
65
66         /*
67  -- ** -- P U B L I C  D A T A ------------------------------------------------
68         */
69
70 public:
71         
72         const Model model;
73
74         /*
75  -- ** -- P R I V A T E   D A T A ---------------------------------------------
76         */
77
78 private:
79
80         etl::loose_handle<sinfgapp::CanvasInterface> canvas_interface_;
81
82         /*
83  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
84         */
85
86 private:
87         
88         /*
89  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
90         */
91
92 private:
93
94         void meta_data_changed(sinfg::String key);
95
96         /*
97  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
98         */
99
100 public:
101         
102         ~MetaDataTreeStore();
103
104         etl::loose_handle<sinfgapp::CanvasInterface> get_canvas_interface() { return canvas_interface_; }
105         etl::loose_handle<const sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
106         sinfg::Canvas::Handle get_canvas()const { return canvas_interface_->get_canvas(); }
107         sinfg::Canvas::Handle get_canvas() { return canvas_interface_->get_canvas(); }
108
109         void rebuild();
110
111         void refresh() { rebuild(); }
112
113         /*
114  -- ** -- P R O T E C T E D   M E T H O D S -----------------------------------
115         */
116
117 protected:
118         MetaDataTreeStore(etl::loose_handle<sinfgapp::CanvasInterface>);
119         void get_value_vfunc (const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value)const;
120         void set_value_impl(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
121
122 public:
123
124         static Glib::RefPtr<MetaDataTreeStore> create(etl::loose_handle<sinfgapp::CanvasInterface>);
125         
126 }; // END of class MetaDataTreeStore
127
128 }; // END of namespace studio
129
130 /* === E N D =============================================================== */
131
132 #endif