add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / checkmenuitem.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_CHECKMENUITEM_H
4 #define _GTKMM_CHECKMENUITEM_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* checkmenuitem.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/menuitem.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkCheckMenuItem GtkCheckMenuItem;
35 typedef struct _GtkCheckMenuItemClass GtkCheckMenuItemClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class CheckMenuItem_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A menu item that maintains the state of a boolean value in addition to a Gtk::MenuItem's usual role in activating application code.
45  * A check box indicating the state of the boolean value is displayed at the left side of the Gtk::MenuItem.
46  * Activating the Gtk::MenuItem toggles the value.
47  * @ingroup Widgets
48  * @ingroup Menus
49  */
50
51 class CheckMenuItem : public MenuItem
52 {
53   public:
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55   typedef CheckMenuItem CppObjectType;
56   typedef CheckMenuItem_Class CppClassType;
57   typedef GtkCheckMenuItem BaseObjectType;
58   typedef GtkCheckMenuItemClass BaseClassType;
59 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60
61   virtual ~CheckMenuItem();
62
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64
65 private:
66   friend class CheckMenuItem_Class;
67   static CppClassType checkmenuitem_class_;
68
69   // noncopyable
70   CheckMenuItem(const CheckMenuItem&);
71   CheckMenuItem& operator=(const CheckMenuItem&);
72
73 protected:
74   explicit CheckMenuItem(const Glib::ConstructParams& construct_params);
75   explicit CheckMenuItem(GtkCheckMenuItem* 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   GtkCheckMenuItem*       gobj()       { return reinterpret_cast<GtkCheckMenuItem*>(gobject_); }
87
88   ///Provides access to the underlying C GtkObject.
89   const GtkCheckMenuItem* gobj() const { return reinterpret_cast<GtkCheckMenuItem*>(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   
111 public:
112
113   CheckMenuItem();
114   explicit CheckMenuItem(const Glib::ustring& label, bool mnemonic = false);
115   
116
117   void set_active(bool state = true);
118   
119   /** Return value: <tt>true</tt> if the menu item is checked.
120    * @return <tt>true</tt> if the menu item is checked.
121    */
122   bool get_active() const;
123
124   
125   void toggled();
126
127   
128   /** If the user has selected a range of elements (such as some text or
129    * spreadsheet cells) that are affected by a boolean setting, and the
130    * current values in that range are inconsistent, you may want to
131    * display the check in an "in between" state. This function turns on
132    * "in between" display.  Normally you would turn off the inconsistent
133    * state again if the user explicitly selects a setting. This has to be
134    * done manually, set_inconsistent() only affects
135    * visual appearance, it doesn't affect the semantics of the widget.
136    * @param setting <tt>true</tt> to display an "inconsistent" third state check.
137    */
138   void set_inconsistent(bool setting = true);
139   
140   /** Retrieves the value set by set_inconsistent().
141    * @return <tt>true</tt> if inconsistent.
142    */
143   bool get_inconsistent() const;
144
145   
146   /** Sets whether @a check_menu_item  is drawn like a Gtk::RadioMenuItem
147    * 
148    * @newin2p4
149    * @param draw_as_radio Whether @a check_menu_item  is drawn like a Gtk::RadioMenuItem.
150    */
151   void set_draw_as_radio(bool draw_as_radio = true);
152   
153   /** Return value: Whether @a check_menu_item  looks like a Gtk::RadioMenuItem
154    * @return Whether @a check_menu_item  looks like a Gtk::RadioMenuItem
155    * 
156    * @newin2p4.
157    */
158   bool get_draw_as_radio() const;
159   
160   /** Triggered when the item changes state
161    * (Note : changing the item's state with set_active() will also trigger
162    * this signal)
163    *
164    * @par Prototype:
165    * <tt>void on_my_%toggled()</tt>
166    */
167
168   Glib::SignalProxy0< void > signal_toggled();
169
170
171   #ifdef GLIBMM_PROPERTIES_ENABLED
172 /** Whether the menu item is checked.
173    *
174    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
175    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
176    * the value of the property changes.
177    */
178   Glib::PropertyProxy<bool> property_active() ;
179 #endif //#GLIBMM_PROPERTIES_ENABLED
180
181 #ifdef GLIBMM_PROPERTIES_ENABLED
182 /** Whether the menu item is checked.
183    *
184    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
185    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
186    * the value of the property changes.
187    */
188   Glib::PropertyProxy_ReadOnly<bool> property_active() const;
189 #endif //#GLIBMM_PROPERTIES_ENABLED
190
191   #ifdef GLIBMM_PROPERTIES_ENABLED
192 /** Whether to display an inconsistent state.
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_inconsistent() ;
199 #endif //#GLIBMM_PROPERTIES_ENABLED
200
201 #ifdef GLIBMM_PROPERTIES_ENABLED
202 /** Whether to display an inconsistent state.
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_inconsistent() const;
209 #endif //#GLIBMM_PROPERTIES_ENABLED
210
211   #ifdef GLIBMM_PROPERTIES_ENABLED
212 /** Whether the menu item looks like a radio menu item.
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_draw_as_radio() ;
219 #endif //#GLIBMM_PROPERTIES_ENABLED
220
221 #ifdef GLIBMM_PROPERTIES_ENABLED
222 /** Whether the menu item looks like a radio menu item.
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_draw_as_radio() const;
229 #endif //#GLIBMM_PROPERTIES_ENABLED
230
231
232 protected:
233   /** Triggered when the item is redrawn (e.g.after being toggled)
234    * Overload this signal if you want to implement your own check item
235    * look. Otherwise, you most likely don't care about it.
236    * The GdkRectangle specifies the area of the widget which will get
237    * redrawn.
238    */
239   #ifdef GLIBMM_VFUNCS_ENABLED
240   virtual void draw_indicator_vfunc(GdkRectangle* area);
241 #endif //GLIBMM_VFUNCS_ENABLED
242
243
244 };
245
246 } /* namespace Gtk */
247
248
249 namespace Glib
250 {
251   /** A Glib::wrap() method for this object.
252    * 
253    * @param object The C instance.
254    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
255    * @result A C++ instance that wraps this C instance.
256    *
257    * @relates Gtk::CheckMenuItem
258    */
259   Gtk::CheckMenuItem* wrap(GtkCheckMenuItem* object, bool take_copy = false);
260 } //namespace Glib
261
262
263 #endif /* _GTKMM_CHECKMENUITEM_H */
264