Upgrade gtkmm to 2.10.8, glibmm to 2.13.3 and add cairomm 1.2.4
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / togglebutton.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOGGLEBUTTON_H
4 #define _GTKMM_TOGGLEBUTTON_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* togglebutton.h
12  * 
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
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.
19  *
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.
24  *
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.
28  */
29
30 #include <gtkmm/button.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkToggleButton GtkToggleButton;
35 typedef struct _GtkToggleButtonClass GtkToggleButtonClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class ToggleButton_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A Gtk::ToggleButton will remain 'pressed-in' when clicked. Clicking again will cause the toggle button to return to it's normal state.
45  * The state of a Gtk::ToggleButton can be set specifically using set_active(), and retrieved using get_active().
46  * To simply switch the state of a toggle button, use toggled().
47  *
48  * @ingroup Widgets
49  */
50
51 class ToggleButton : public Button
52 {
53   public:
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55   typedef ToggleButton CppObjectType;
56   typedef ToggleButton_Class CppClassType;
57   typedef GtkToggleButton BaseObjectType;
58   typedef GtkToggleButtonClass BaseClassType;
59 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60
61   virtual ~ToggleButton();
62
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64
65 private:
66   friend class ToggleButton_Class;
67   static CppClassType togglebutton_class_;
68
69   // noncopyable
70   ToggleButton(const ToggleButton&);
71   ToggleButton& operator=(const ToggleButton&);
72
73 protected:
74   explicit ToggleButton(const Glib::ConstructParams& construct_params);
75   explicit ToggleButton(GtkToggleButton* castitem);
76
77 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
78
79 public:
80 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81   static GType get_type()      G_GNUC_CONST;
82   static GType get_base_type() G_GNUC_CONST;
83 #endif
84
85   ///Provides access to the underlying C GtkObject.
86   GtkToggleButton*       gobj()       { return reinterpret_cast<GtkToggleButton*>(gobject_); }
87
88   ///Provides access to the underlying C GtkObject.
89   const GtkToggleButton* gobj() const { return reinterpret_cast<GtkToggleButton*>(gobject_); }
90
91
92 public:
93   //C++ methods used to invoke GTK+ virtual functions:
94 #ifdef GLIBMM_VFUNCS_ENABLED
95 #endif //GLIBMM_VFUNCS_ENABLED
96
97 protected:
98   //GTK+ Virtual Functions (override these to change behaviour):
99 #ifdef GLIBMM_VFUNCS_ENABLED
100 #endif //GLIBMM_VFUNCS_ENABLED
101
102   //Default Signal Handlers::
103 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
104   virtual void on_toggled();
105 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
106
107
108 private:
109
110 public:
111
112   /** Create an empty toggle button.
113    * With an empty button, you can Gtk::Button::add() a widget such as a
114    * Gtk::Pixmap or Gtk::Box.
115    *
116    * If you just wish to add a Gtk::Label, you may want to use the
117    * Gtk::ToggleButton(const Glib::ustring &label) constructor directly
118    * instead.
119    */
120   ToggleButton();
121
122   /** Create a toggle button with a label.
123    * You won't be able
124    * to add a widget to this button since it already contains a Gtk::Label
125    */
126   explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);
127
128   /** Creates a toggle button containing the image and text from a stock item.
129    * Stock ids have identifiers like Gtk::Stock::OK and Gtk::Stock::APPLY.
130    * @param stock_id The stock item.
131    */
132   explicit ToggleButton(const StockID& stock_id);
133   
134   
135   /** Sets whether the button is displayed as a separate indicator and label.
136    * You can call this function on a checkbutton or a radiobutton with
137    *  @a draw_indicator  = <tt>false</tt> to make the button look like a normal button
138    * 
139    * This function only affects instances of classes like Gtk::CheckButton
140    * and Gtk::RadioButton that derive from Gtk::ToggleButton,
141    * not instances of Gtk::ToggleButton itself.
142    * @param draw_indicator If <tt>true</tt>, draw the button as a separate indicator
143    * and label; if <tt>false</tt>, draw the button like a normal button.
144    */
145   void set_mode(bool draw_indicator = true);
146   
147   /** Retrieves whether the button is displayed as a separate indicator
148    * and label. See set_mode().
149    * @return <tt>true</tt> if the togglebutton is drawn as a separate indicator
150    * and label.
151    */
152   bool get_mode() const;
153
154   
155   void set_active(bool is_active = true);
156   
157   bool get_active() const;
158
159   
160   /** If the user has selected a range of elements (such as some text or
161    * spreadsheet cells) that are affected by a toggle button, and the
162    * current values in that range are inconsistent, you may want to
163    * display the toggle in an "in between" state. This function turns on
164    * "in between" display.  Normally you would turn off the inconsistent
165    * state again if the user toggles the toggle button. This has to be
166    * done manually, set_inconsistent() only affects
167    * visual appearance, it doesn't affect the semantics of the button.
168    * @param setting <tt>true</tt> if state is inconsistent.
169    */
170   void set_inconsistent(bool setting = true);
171   
172   /** Gets the value set by set_inconsistent().
173    * @return <tt>true</tt> if the button is displayed as inconsistent, <tt>false</tt> otherwise.
174    */
175   bool get_inconsistent() const;
176
177   
178   void toggled();
179
180   /** Emitted whenever the toggle tool button changes state.
181    */
182   
183 /**
184    * @par Prototype:
185    * <tt>void %toggled()</tt>
186    */
187
188   Glib::SignalProxy0< void > signal_toggled();
189
190
191   #ifdef GLIBMM_PROPERTIES_ENABLED
192 /** If the toggle button should be pressed in or not.
193    *
194    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
195    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
196    * the value of the property changes.
197    */
198   Glib::PropertyProxy<bool> property_active() ;
199 #endif //#GLIBMM_PROPERTIES_ENABLED
200
201 #ifdef GLIBMM_PROPERTIES_ENABLED
202 /** If the toggle button should be pressed in or not.
203    *
204    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
205    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
206    * the value of the property changes.
207    */
208   Glib::PropertyProxy_ReadOnly<bool> property_active() const;
209 #endif //#GLIBMM_PROPERTIES_ENABLED
210
211   #ifdef GLIBMM_PROPERTIES_ENABLED
212 /** If the toggle button is in an in between state.
213    *
214    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
215    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
216    * the value of the property changes.
217    */
218   Glib::PropertyProxy<bool> property_inconsistent() ;
219 #endif //#GLIBMM_PROPERTIES_ENABLED
220
221 #ifdef GLIBMM_PROPERTIES_ENABLED
222 /** If the toggle button is in an in between state.
223    *
224    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
225    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
226    * the value of the property changes.
227    */
228   Glib::PropertyProxy_ReadOnly<bool> property_inconsistent() const;
229 #endif //#GLIBMM_PROPERTIES_ENABLED
230
231   #ifdef GLIBMM_PROPERTIES_ENABLED
232 /** If the toggle part of the button is displayed.
233    *
234    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
235    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
236    * the value of the property changes.
237    */
238   Glib::PropertyProxy<bool> property_draw_indicator() ;
239 #endif //#GLIBMM_PROPERTIES_ENABLED
240
241 #ifdef GLIBMM_PROPERTIES_ENABLED
242 /** If the toggle part of the button is displayed.
243    *
244    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
245    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
246    * the value of the property changes.
247    */
248   Glib::PropertyProxy_ReadOnly<bool> property_draw_indicator() const;
249 #endif //#GLIBMM_PROPERTIES_ENABLED
250
251
252 };
253
254 } /* namespace Gtk */
255
256
257 namespace Glib
258 {
259   /** @relates Gtk::ToggleButton
260    * @param object The C instance
261    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
262    * @result A C++ instance that wraps this C instance.
263    */
264   Gtk::ToggleButton* wrap(GtkToggleButton* object, bool take_copy = false);
265 } //namespace Glib
266
267
268 #endif /* _GTKMM_TOGGLEBUTTON_H */
269