my log
[synfig.git] / synfig-studio / trunk / src / gtkmm / dockable.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dockable.h
3 **      \brief Template Header
4 **
5 **      $Id: dockable.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 __SYNFIG_STUDIO_DOCKABLE_H
25 #define __SYNFIG_STUDIO_DOCKABLE_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/stockid.h>
30 #include <gtkmm/button.h>
31 #include "dialogsettings.h"
32 #include <synfig/string.h>
33 #include <gtkmm/table.h>
34 #include <gtkmm/tooltips.h>
35 #include <gtkmm/label.h>
36 #include <gtkmm/frame.h>
37 #include <gtkmm/handlebox.h>
38 #include <gtkmm/box.h>
39 #include <gtkmm/scrolledwindow.h>
40 #include <gtkmm/toolbar.h>
41 #include <gtkmm/toolbutton.h>
42
43 /* === M A C R O S ========================================================= */
44
45 /* === T Y P E D E F S ===================================================== */
46
47 /* === C L A S S E S & S T R U C T S ======================================= */
48
49 namespace studio {
50         
51 class DockManager;
52 class DockBook;
53         
54 class Dockable : public Gtk::Table
55 {
56         friend class DockManager;
57         friend class DockBook;
58
59         
60         sigc::signal<void> signal_stock_id_changed_;
61         SigC::Connection prev_widget_delete_connection;
62 protected:
63         
64 //      DialogSettings dialog_settings;
65
66
67 private:
68
69         Gtk::Toolbar *toolbar_;
70
71         synfig::String name_;
72         synfig::String local_name_;
73         Gtk::Tooltips tooltips_;
74         Gtk::Frame frame_;
75         Gtk::Label title_label_;
76         //Gtk::HBox button_box_;
77         Gtk::HBox header_box_;
78         //Gtk::VBox vbox_;
79         
80         //Gtk::HandleBox handle_box_;
81         Gtk::ScrolledWindow *scrolled_;
82         Gtk::Widget *prev_widget_;
83
84         bool use_scrolled_;
85         
86         Gtk::StockID stock_id_;
87
88         DockBook* parent_;
89
90         bool dnd_success_;
91
92 public:
93         //Gtk::VBox* get_vbox() { return &vbox_; }
94
95         void set_toolbar(Gtk::Toolbar& toolbar);
96
97         void set_use_scrolled(bool x) { use_scrolled_=x; }
98         
99         Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
100         ~Dockable();
101
102         sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }
103
104         const synfig::String& get_name()const { return name_; }
105         const synfig::String& get_local_name()const { return local_name_; }
106
107         const Gtk::StockID& get_stock_id()const { return stock_id_; }
108         void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
109         
110         void set_local_name(const synfig::String&);
111
112         void clear();
113         
114         Gtk::Tooltips& get_tooltips() { return tooltips_; }
115         
116         //DialogSettings& settings() { return dialog_settings; }
117         //const DialogSettings& settings()const { return dialog_settings; }
118         
119         void add(Gtk::Widget& x);
120         
121         Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip=synfig::String());      
122         
123         void detach();
124
125         void present();
126         
127         void attach_dnd_to(Gtk::Widget& widget);
128
129         bool clear_previous();
130         virtual Gtk::Widget* create_tab_label();
131
132 private:
133         
134         void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, Gtk::SelectionData& selection_data, guint info, guint time);
135         void on_drag_end(const Glib::RefPtr<Gdk::DragContext>&context);
136         void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>&context);
137         void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
138
139 }; // END of studio::Dockable
140
141 }; // END of namespace studio
142
143 /* === E N D =============================================================== */
144
145 #endif