1 /** \file
2 * \brief
3 *
4 * Authors:
5 * Ralf Stephan <ralf@ark.in-berlin.de>
6 *
7 * Copyright (C) 2005 Authors
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_WIDGET_REGISTERED_WIDGET__H_
13 #define INKSCAPE_UI_WIDGET_REGISTERED_WIDGET__H_
15 #include <gtkmm/box.h>
16 #include <gtkmm/adjustment.h>
18 class SPUnit;
20 namespace Gtk {
21 class HScale;
22 class RadioButton;
23 class SpinButton;
24 class ToggleButton;
25 }
27 namespace Inkscape {
28 namespace UI {
29 namespace Widget {
31 class ColorPicker;
32 class Registry;
33 class ScalarUnit;
34 class UnitMenu;
36 class RegisteredCheckButton {
37 public:
38 RegisteredCheckButton();
39 ~RegisteredCheckButton();
40 void init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL);
41 void setActive (bool);
43 Gtk::ToggleButton *_button;
45 protected:
46 Gtk::Tooltips _tt;
47 sigc::connection _toggled_connection;
48 Registry *_wr;
49 Glib::ustring _key;
50 void on_toggled();
51 Inkscape::XML::Node *repr;
52 };
54 class RegisteredUnitMenu {
55 public:
56 RegisteredUnitMenu();
57 ~RegisteredUnitMenu();
58 void init (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in=NULL);
59 void setUnit (const SPUnit*);
60 Gtk::Label *_label;
61 UnitMenu *_sel;
62 sigc::connection _changed_connection;
64 protected:
65 void on_changed();
66 Registry *_wr;
67 Glib::ustring _key;
68 Inkscape::XML::Node *repr;
69 };
71 class RegisteredScalarUnit {
72 public:
73 RegisteredScalarUnit();
74 ~RegisteredScalarUnit();
75 void init (const Glib::ustring& label,
76 const Glib::ustring& tip,
77 const Glib::ustring& key,
78 const RegisteredUnitMenu &rum,
79 Registry& wr,
80 Inkscape::XML::Node* repr_in=NULL);
81 ScalarUnit* getSU();
82 void setValue (double);
84 protected:
85 ScalarUnit *_widget;
86 sigc::connection _value_changed_connection;
87 UnitMenu *_um;
88 Registry *_wr;
89 Glib::ustring _key;
90 void on_value_changed();
91 Inkscape::XML::Node *repr;
92 };
94 class RegisteredColorPicker {
95 public:
96 RegisteredColorPicker();
97 ~RegisteredColorPicker();
98 void init (const Glib::ustring& label,
99 const Glib::ustring& title,
100 const Glib::ustring& tip,
101 const Glib::ustring& ckey,
102 const Glib::ustring& akey,
103 Registry& wr,
104 Inkscape::XML::Node* repr_in=NULL);
105 void setRgba32 (guint32);
106 void closeWindow();
108 Gtk::Label *_label;
109 ColorPicker *_cp;
111 protected:
112 Glib::ustring _ckey, _akey;
113 Registry *_wr;
114 void on_changed (guint32);
115 sigc::connection _changed_connection;
116 Inkscape::XML::Node *repr;
117 };
119 class RegisteredSuffixedInteger {
120 public:
121 RegisteredSuffixedInteger();
122 ~RegisteredSuffixedInteger();
123 void init (const Glib::ustring& label1,
124 const Glib::ustring& label2,
125 const Glib::ustring& key,
126 Registry& wr,
127 Inkscape::XML::Node* repr_in=NULL);
128 void setValue (int);
129 Gtk::Label *_label;
130 Gtk::HBox _hbox;
132 protected:
133 Gtk::SpinButton *_sb;
134 Gtk::Adjustment _adj;
135 Gtk::Label *_suffix;
136 Glib::ustring _key;
137 Registry *_wr;
138 sigc::connection _changed_connection;
139 void on_value_changed();
140 Inkscape::XML::Node *repr;
141 };
143 class RegisteredRadioButtonPair {
144 public:
145 RegisteredRadioButtonPair();
146 ~RegisteredRadioButtonPair();
147 void init (const Glib::ustring& label,
148 const Glib::ustring& label1,
149 const Glib::ustring& label2,
150 const Glib::ustring& tip1,
151 const Glib::ustring& tip2,
152 const Glib::ustring& key,
153 Registry& wr,
154 Inkscape::XML::Node* repr_in=NULL);
155 void setValue (bool second);
156 Gtk::HBox *_hbox;
158 protected:
159 Gtk::RadioButton *_rb1, *_rb2;
160 Gtk::Tooltips _tt;
161 Glib::ustring _key;
162 Registry *_wr;
163 sigc::connection _changed_connection;
164 void on_value_changed();
165 Inkscape::XML::Node *repr;
166 };
170 } // namespace Widget
171 } // namespace UI
172 } // namespace Inkscape
174 #endif // INKSCAPE_UI_WIDGET_REGISTERED_WIDGET__H_
176 /*
177 Local Variables:
178 mode:c++
179 c-file-style:"stroustrup"
180 c-file-offsets:((innamespace . 0)(inline-open . 0))
181 indent-tabs-mode:nil
182 fill-column:99
183 End:
184 */
185 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :