2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_COLORBUTTON_H
4 #define _GTKMM_COLORBUTTON_H
13 * Copyright (C) 2003 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/button.h>
31 #include <gdkmm/color.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkColorButton GtkColorButton;
36 typedef struct _GtkColorButtonClass GtkColorButtonClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class ColorButton_Class; } // namespace Gtk
45 /** A button to launch a color selection dialog.
47 * The GtkColorButton is a button which displays the currently selected color an allows to
48 * open a color selection dialog to change the color. It is suitable widget for selecting a
49 * color in a preference dialog.
54 class ColorButton : public Button
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58 typedef ColorButton CppObjectType;
59 typedef ColorButton_Class CppClassType;
60 typedef GtkColorButton BaseObjectType;
61 typedef GtkColorButtonClass BaseClassType;
62 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
64 virtual ~ColorButton();
66 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69 friend class ColorButton_Class;
70 static CppClassType colorbutton_class_;
73 ColorButton(const ColorButton&);
74 ColorButton& operator=(const ColorButton&);
77 explicit ColorButton(const Glib::ConstructParams& construct_params);
78 explicit ColorButton(GtkColorButton* castitem);
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
83 #ifndef DOXYGEN_SHOULD_SKIP_THIS
84 static GType get_type() G_GNUC_CONST;
85 static GType get_base_type() G_GNUC_CONST;
88 ///Provides access to the underlying C GtkObject.
89 GtkColorButton* gobj() { return reinterpret_cast<GtkColorButton*>(gobject_); }
91 ///Provides access to the underlying C GtkObject.
92 const GtkColorButton* gobj() const { return reinterpret_cast<GtkColorButton*>(gobject_); }
96 //C++ methods used to invoke GTK+ virtual functions:
97 #ifdef GLIBMM_VFUNCS_ENABLED
98 #endif //GLIBMM_VFUNCS_ENABLED
101 //GTK+ Virtual Functions (override these to change behaviour):
102 #ifdef GLIBMM_VFUNCS_ENABLED
103 #endif //GLIBMM_VFUNCS_ENABLED
105 //Default Signal Handlers::
106 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
107 virtual void on_color_set();
108 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
115 /** Creates a new color button.
117 * This creates a widget in the form of a small button containing a swatch representing
118 * the current selected color. When the button is clicked, a color-selection dialog will
119 * open, allowing the user to select a color. The swatch will be updated to reflect the
120 * new color when the user finishes.
127 /** Creates a new color button with a predefined color.
129 * Same as Gtk::ColorButton::ColorButton(). Additionally takes a Gdk::Color and
130 * initializes the button with this color. Equivalent to calling set_color(@a color)
131 * after the default constructor.
133 * @param color A Gdk::Color to set the current color with.
137 explicit ColorButton(const Gdk::Color& color);
140 /** Sets the current color to be @a color .
143 * @param color A Gdk::Color to set the current color with.
145 void set_color(const Gdk::Color& color);
147 /** Sets the current opacity to be @a alpha .
150 * @param alpha An integer between 0 and 65535.
152 void set_alpha(guint16 alpha);
154 /** Returns a copy of the the current color.
156 * Changes to the return value will have no effect on the Gtk::ColorButton.
158 * @return A Gdk::Color representing the current internal color of the Gtk::ColorButton.
162 Gdk::Color get_color() const;
165 /** Return value: an integer between 0 and 65535.
166 * @return An integer between 0 and 65535.
170 guint16 get_alpha() const;
172 /** Sets whether or not the color button should use the alpha channel.
175 * @param use_alpha <tt>true</tt> if color button should use alpha channel, <tt>false</tt> if not.
177 void set_use_alpha(bool use_alpha = true);
179 /** Does the color selection dialog use the alpha channel?
180 * @return <tt>true</tt> if the color sample uses alpha channel, <tt>false</tt> if not.
184 bool get_use_alpha() const;
186 /** Sets the title for the color selection dialog.
189 * @param title String containing new window title.
191 void set_title(const Glib::ustring& title);
193 /** Gets the title of the color selection dialog.
198 Glib::ustring get_title() const;
200 #ifdef GLIBMM_PROPERTIES_ENABLED
201 /** Whether or not to give the color an alpha value.
203 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
204 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
205 * the value of the property changes.
207 Glib::PropertyProxy<bool> property_use_alpha() ;
208 #endif //#GLIBMM_PROPERTIES_ENABLED
210 #ifdef GLIBMM_PROPERTIES_ENABLED
211 /** Whether or not to give the color an alpha value.
213 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
214 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
215 * the value of the property changes.
217 Glib::PropertyProxy_ReadOnly<bool> property_use_alpha() const;
218 #endif //#GLIBMM_PROPERTIES_ENABLED
220 #ifdef GLIBMM_PROPERTIES_ENABLED
221 /** The title of the color selection dialog.
223 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
224 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
225 * the value of the property changes.
227 Glib::PropertyProxy<Glib::ustring> property_title() ;
228 #endif //#GLIBMM_PROPERTIES_ENABLED
230 #ifdef GLIBMM_PROPERTIES_ENABLED
231 /** The title of the color selection dialog.
233 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
234 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
235 * the value of the property changes.
237 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
238 #endif //#GLIBMM_PROPERTIES_ENABLED
240 #ifdef GLIBMM_PROPERTIES_ENABLED
241 /** The selected color.
243 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
244 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
245 * the value of the property changes.
247 Glib::PropertyProxy<Gdk::Color> property_color() ;
248 #endif //#GLIBMM_PROPERTIES_ENABLED
250 #ifdef GLIBMM_PROPERTIES_ENABLED
251 /** The selected color.
253 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
254 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
255 * the value of the property changes.
257 Glib::PropertyProxy_ReadOnly<Gdk::Color> property_color() const;
258 #endif //#GLIBMM_PROPERTIES_ENABLED
260 #ifdef GLIBMM_PROPERTIES_ENABLED
261 /** The selected opacity value (0 fully transparent, 65535 fully opaque).
263 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
264 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
265 * the value of the property changes.
267 Glib::PropertyProxy<guint16> property_alpha() ;
268 #endif //#GLIBMM_PROPERTIES_ENABLED
270 #ifdef GLIBMM_PROPERTIES_ENABLED
271 /** The selected opacity value (0 fully transparent, 65535 fully opaque).
273 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
274 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
275 * the value of the property changes.
277 Glib::PropertyProxy_ReadOnly<guint16> property_alpha() const;
278 #endif //#GLIBMM_PROPERTIES_ENABLED
281 /** The color_set signal is emitted when the user selects a color. When handling this signal,
282 * use get_color() and get_alpha() to find out which color
286 * <tt>void on_my_%color_set()</tt>
289 Glib::SignalProxy0< void > signal_color_set();
300 /** A Glib::wrap() method for this object.
302 * @param object The C instance.
303 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
304 * @result A C++ instance that wraps this C instance.
306 * @relates Gtk::ColorButton
308 Gtk::ColorButton* wrap(GtkColorButton* object, bool take_copy = false);
312 #endif /* _GTKMM_COLORBUTTON_H */