1 // -*- c++ -*- 2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY! 3 #ifndef _GTKMM_CELLRENDERERTOGGLE_H 4 #define _GTKMM_CELLRENDERERTOGGLE_H 5 6 7 #include <glibmm/ustring.h> 8 #include <sigc++/sigc++.h> 9 10 /* $Id: cellrenderertoggle.hg,v 1.5 2006/05/10 20:59:27 murrayc Exp $ */ 11 12 /* cellrenderertoggle.h 13 * 14 * Copyright (C) 1998-2002 The gtkmm Development Team 15 * 16 * This library is free software; you can redistribute it and/or 17 * modify it under the terms of the GNU Lesser General Public 18 * License as published by the Free Software Foundation; either 19 * version 2.1 of the License, or (at your option) any later version. 20 * 21 * This library is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 * Lesser General Public License for more details. 25 * 26 * You should have received a copy of the GNU Lesser General Public 27 * License along with this library; if not, write to the Free 28 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 */ 30 31 #include <gtkmm/cellrenderer.h> 32 33 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 35 typedef struct _GtkCellRendererToggle GtkCellRendererToggle; 36 typedef struct _GtkCellRendererToggleClass GtkCellRendererToggleClass; 37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 38 39 40 namespace Gtk 41 { class CellRendererToggle_Class; } // namespace Gtk 42 namespace Gtk 43 { 44 45 /** Renders a toggle button in a cell. 46 * The button is drawn as a radio- or checkbutton, depending on the radio property. When activated, it 47 * emits the toggled signal. 48 * 49 * @ingroup TreeView 50 */ 51 52 class CellRendererToggle : public CellRenderer 53 { 54 public: 55 #ifndef DOXYGEN_SHOULD_SKIP_THIS 56 typedef CellRendererToggle CppObjectType; 57 typedef CellRendererToggle_Class CppClassType; 58 typedef GtkCellRendererToggle BaseObjectType; 59 typedef GtkCellRendererToggleClass BaseClassType; 60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 61 62 virtual ~CellRendererToggle(); 63 64 #ifndef DOXYGEN_SHOULD_SKIP_THIS 65 66 private: 67 friend class CellRendererToggle_Class; 68 static CppClassType cellrenderertoggle_class_; 69 70 // noncopyable 71 CellRendererToggle(const CellRendererToggle&); 72 CellRendererToggle& operator=(const CellRendererToggle&); 73 74 protected: 75 explicit CellRendererToggle(const Glib::ConstructParams& construct_params); 76 explicit CellRendererToggle(GtkCellRendererToggle* castitem); 77 78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 79 80 public: 81 #ifndef DOXYGEN_SHOULD_SKIP_THIS 82 static GType get_type() G_GNUC_CONST; 83 84 85 static GType get_base_type() G_GNUC_CONST; 86 #endif 87 88 ///Provides access to the underlying C GtkObject. gobj()89 GtkCellRendererToggle* gobj() { return reinterpret_cast<GtkCellRendererToggle*>(gobject_); } 90 91 ///Provides access to the underlying C GtkObject. gobj()92 const GtkCellRendererToggle* gobj() const { return reinterpret_cast<GtkCellRendererToggle*>(gobject_); } 93 94 95 public: 96 //C++ methods used to invoke GTK+ virtual functions: 97 98 protected: 99 //GTK+ Virtual Functions (override these to change behaviour): 100 101 //Default Signal Handlers:: 102 /// This is a default handler for the signal signal_toggled(). 103 virtual void on_toggled(const Glib::ustring& path); 104 105 106 private: 107 108 public: 109 110 CellRendererToggle(); 111 112 113 /** Returns whether we're rendering radio toggles rather than checkboxes. 114 * 115 * @return <tt>true</tt> if we're rendering radio toggles rather than checkboxes. 116 */ 117 bool get_radio() const; 118 119 /** If @a radio is <tt>true</tt>, the cell renderer renders a radio toggle 120 * (i.e.\ a toggle in a group of mutually-exclusive toggles). 121 * If <tt>false</tt>, it renders a check toggle (a standalone boolean option). 122 * This can be set globally for the cell renderer, or changed just 123 * before rendering each cell in the model (for Gtk::TreeView, you set 124 * up a per-row setting using Gtk::TreeViewColumn to associate model 125 * columns with cell renderer properties). 126 * 127 * @param radio <tt>true</tt> to make the toggle look like a radio button. 128 */ 129 void set_radio(bool radio = true); 130 131 /** Returns whether the cell renderer is active. See 132 * set_active(). 133 * 134 * @return <tt>true</tt> if the cell renderer is active. 135 */ 136 bool get_active() const; 137 138 /** Activates or deactivates a cell renderer. 139 * 140 * @param setting The value to set. 141 */ 142 void set_active(bool setting = true); 143 144 /** Returns whether the cell renderer is activatable. See 145 * set_activatable(). 146 * 147 * @newin{2,18} 148 * 149 * @return <tt>true</tt> if the cell renderer is activatable. 150 */ 151 bool get_activatable() const; 152 153 /** Makes the cell renderer activatable. 154 * 155 * @newin{2,18} 156 * 157 * @param setting The value to set. 158 */ 159 void set_activatable(bool setting = true); 160 161 162 //TODO: Maybe the parameter should be a TreePath. 163 164 /** The toggled signal is emitted when the cell is toggled. 165 * 166 * @param path string representation of TreePath describing the event location 167 * 168 * @par Slot Prototype: 169 * <tt>void on_my_%toggled(const Glib::ustring& path)</tt> 170 * 171 */ 172 173 Glib::SignalProxy1< void,const Glib::ustring& > signal_toggled(); 174 175 176 /** The toggle button can be activated. 177 * 178 * @return A PropertyProxy that allows you to get or set the value of the property, 179 * or receive notification when the value of the property changes. 180 */ 181 Glib::PropertyProxy< bool > property_activatable() ; 182 183 /** The toggle button can be activated. 184 * 185 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 186 * or receive notification when the value of the property changes. 187 */ 188 Glib::PropertyProxy_ReadOnly< bool > property_activatable() const; 189 190 /** The toggle state of the button. 191 * 192 * @return A PropertyProxy that allows you to get or set the value of the property, 193 * or receive notification when the value of the property changes. 194 */ 195 Glib::PropertyProxy< bool > property_active() ; 196 197 /** The toggle state of the button. 198 * 199 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 200 * or receive notification when the value of the property changes. 201 */ 202 Glib::PropertyProxy_ReadOnly< bool > property_active() const; 203 204 /** The inconsistent state of the button. 205 * 206 * @return A PropertyProxy that allows you to get or set the value of the property, 207 * or receive notification when the value of the property changes. 208 */ 209 Glib::PropertyProxy< bool > property_inconsistent() ; 210 211 /** The inconsistent state of the button. 212 * 213 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 214 * or receive notification when the value of the property changes. 215 */ 216 Glib::PropertyProxy_ReadOnly< bool > property_inconsistent() const; 217 218 /** Draw the toggle button as a radio button. 219 * 220 * @return A PropertyProxy that allows you to get or set the value of the property, 221 * or receive notification when the value of the property changes. 222 */ 223 Glib::PropertyProxy< bool > property_radio() ; 224 225 /** Draw the toggle button as a radio button. 226 * 227 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 228 * or receive notification when the value of the property changes. 229 */ 230 Glib::PropertyProxy_ReadOnly< bool > property_radio() const; 231 232 /** Size of check or radio indicator. 233 * 234 * @return A PropertyProxy that allows you to get or set the value of the property, 235 * or receive notification when the value of the property changes. 236 */ 237 Glib::PropertyProxy< int > property_indicator_size() ; 238 239 /** Size of check or radio indicator. 240 * 241 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 242 * or receive notification when the value of the property changes. 243 */ 244 Glib::PropertyProxy_ReadOnly< int > property_indicator_size() const; 245 246 247 virtual Glib::PropertyProxy_Base _property_renderable(); 248 249 250 }; 251 252 } /* namespace Gtk */ 253 254 255 namespace Glib 256 { 257 /** A Glib::wrap() method for this object. 258 * 259 * @param object The C instance. 260 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 261 * @result A C++ instance that wraps this C instance. 262 * 263 * @relates Gtk::CellRendererToggle 264 */ 265 Gtk::CellRendererToggle* wrap(GtkCellRendererToggle* object, bool take_copy = false); 266 } //namespace Glib 267 268 269 #endif /* _GTKMM_CELLRENDERERTOGGLE_H */ 270 271