Initial revision
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / cellrenderertoggle.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_CELLRENDERERTOGGLE_H
4 #define _GTKMM_CELLRENDERERTOGGLE_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* cellrenderertoggle.h
11  * 
12  * Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28
29 #include <gtkmm/cellrenderer.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkCellRendererToggle GtkCellRendererToggle;
34 typedef struct _GtkCellRendererToggleClass GtkCellRendererToggleClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class CellRendererToggle_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** Renders a toggle button in a cell.
44  * The button is drawn as a radio- or checkbutton, depending on the radio property. When activated, it 
45  * emits the toggled signal.
46  *
47  * @ingroup TreeView
48  */
49
50 class CellRendererToggle : public CellRenderer
51 {
52   public:
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54   typedef CellRendererToggle CppObjectType;
55   typedef CellRendererToggle_Class CppClassType;
56   typedef GtkCellRendererToggle BaseObjectType;
57   typedef GtkCellRendererToggleClass BaseClassType;
58 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59
60   virtual ~CellRendererToggle();
61
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63
64 private:
65   friend class CellRendererToggle_Class;
66   static CppClassType cellrenderertoggle_class_;
67
68   // noncopyable
69   CellRendererToggle(const CellRendererToggle&);
70   CellRendererToggle& operator=(const CellRendererToggle&);
71
72 protected:
73   explicit CellRendererToggle(const Glib::ConstructParams& construct_params);
74   explicit CellRendererToggle(GtkCellRendererToggle* castitem);
75
76 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
77
78 public:
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80   static GType get_type()      G_GNUC_CONST;
81   static GType get_base_type() G_GNUC_CONST;
82 #endif
83
84   ///Provides access to the underlying C GtkObject.
85   GtkCellRendererToggle*       gobj()       { return reinterpret_cast<GtkCellRendererToggle*>(gobject_); }
86
87   ///Provides access to the underlying C GtkObject.
88   const GtkCellRendererToggle* gobj() const { return reinterpret_cast<GtkCellRendererToggle*>(gobject_); }
89
90
91 public:
92   //C++ methods used to invoke GTK+ virtual functions:
93
94 protected:
95   //GTK+ Virtual Functions (override these to change behaviour):
96
97   //Default Signal Handlers::
98   virtual void on_toggled(const Glib::ustring& path);
99
100
101 private:
102
103 public:
104
105   CellRendererToggle();
106   
107
108   /** Returns wether we're rendering radio toggles rather than checkboxes.
109    * @return <tt>true</tt> if we're rendering radio toggles rather than checkboxes.
110    */
111   bool get_radio() const;
112   
113   /** If @a radio  is <tt>true</tt>, the cell renderer renders a radio toggle
114    * (i.e.\ a toggle in a group of mutually-exclusive toggles).
115    * If <tt>false</tt>, it renders a check toggle (a standalone boolean option).
116    * This can be set globally for the cell renderer, or changed just
117    * before rendering each cell in the model (for Gtk::TreeView, you set
118    * up a per-row setting using Gtk::TreeViewColumn to associate model
119    * columns with cell renderer properties).
120    * @param radio <tt>true</tt> to make the toggle look like a radio button.
121    */
122   void set_radio(bool radio = true);
123   
124   /** Returns whether the cell renderer is active. See
125    * set_active().
126    * @return <tt>true</tt> if the cell renderer is active.
127    */
128   bool get_active() const;
129   
130   /** Activates or deactivates a cell renderer.
131    * @param setting The value to set.
132    */
133   void set_active(bool setting = true);
134
135
136   Glib::SignalProxy1< void,const Glib::ustring& > signal_toggled();
137
138
139   /** The toggle button can be activated.
140    *
141    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
142    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
143    * the value of the property changes.
144    */
145   Glib::PropertyProxy<bool> property_activatable() ;
146
147 /** The toggle button can be activated.
148    *
149    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
150    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
151    * the value of the property changes.
152    */
153   Glib::PropertyProxy_ReadOnly<bool> property_activatable() const;
154
155   /** The toggle state of the button.
156    *
157    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
158    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
159    * the value of the property changes.
160    */
161   Glib::PropertyProxy<bool> property_active() ;
162
163 /** The toggle state of the button.
164    *
165    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
166    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
167    * the value of the property changes.
168    */
169   Glib::PropertyProxy_ReadOnly<bool> property_active() const;
170
171   /** Draw the toggle button as a radio button.
172    *
173    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
174    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
175    * the value of the property changes.
176    */
177   Glib::PropertyProxy<bool> property_radio() ;
178
179 /** Draw the toggle button as a radio button.
180    *
181    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
182    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
183    * the value of the property changes.
184    */
185   Glib::PropertyProxy_ReadOnly<bool> property_radio() const;
186
187
188   virtual Glib::PropertyProxy_Base _property_renderable(); //override
189
190
191 };
192
193 } /* namespace Gtk */
194
195
196 namespace Glib
197 {
198   /** @relates Gtk::CellRendererToggle
199    * @param object The C instance
200    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
201    * @result A C++ instance that wraps this C instance.
202    */
203   Gtk::CellRendererToggle* wrap(GtkCellRendererToggle* object, bool take_copy = false);
204 }
205 #endif /* _GTKMM_CELLRENDERERTOGGLE_H */
206