1 /* === S Y N F I G ========================================================= */
2 /*!	\file trees/metadatatree.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) 2010 Carlos López
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_METADATATREE_H
27 #define __SYNFIG_STUDIO_METADATATREE_H
28 
29 /* === H E A D E R S ======================================================= */
30 
31 #include <gtkmm/treeview.h>
32 #include <gtkmm/treestore.h>
33 #include <synfigapp/canvasinterface.h>
34 #include "trees/metadatatreestore.h"
35 
36 /* === M A C R O S ========================================================= */
37 
38 /* === T Y P E D E F S ===================================================== */
39 
40 /* === C L A S S E S & S T R U C T S ======================================= */
41 
42 namespace studio {
43 
44 class MetaDataTree : public Gtk::TreeView
45 {
46 public:
47 	MetaDataTree();
48 	virtual ~MetaDataTree();
49 	MetaDataTreeStore::Model model;
50 
51 private:
52 	Glib::RefPtr<MetaDataTreeStore> metadata_tree_store_;
53 	Gtk::CellRendererText *cell_renderer_key;
54 	Gtk::CellRendererText *cell_renderer_data;
55 	sigc::signal<void,synfig::String> signal_edited_;
56 	sigc::signal<void,synfig::String,synfig::String> signal_edited_data_;
57 	bool editable_;
58 
59 private:
60 	void on_edited_key(const Glib::ustring&path_string,synfig::String key);
61 	void on_edited_data(const Glib::ustring&path_string,synfig::String data);
62 
63 public:
64 	void set_model(Glib::RefPtr<MetaDataTreeStore> metadata_tree_store_);
65 	void set_editable(bool x=true);
get_editable()66 	bool get_editable()const { return editable_; }
67 	//! Signal called when a metadata has been edited in any way
signal_edited()68 	sigc::signal<void,synfig::String>& signal_edited() { return signal_edited_; }
69 	//! Signal called when data has been edited.
signal_edited_data()70 	sigc::signal<void,synfig::String,synfig::String>& signal_edited_data() { return signal_edited_data_; }
71 }; // END of MetaDataTree
72 
73 }; // END of namespace studio
74 
75 /* === E N D =============================================================== */
76 
77 #endif
78