1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOGGLETOOLBUTTON_H
4 #define _GTKMM_TOGGLETOOLBUTTON_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: toggletoolbutton.hg,v 1.5 2004/03/07 14:35:47 murrayc Exp $ */
11 
12 /* box.h
13  *
14  * Copyright (C) 2003 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/toolbutton.h>
32 
33 
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkToggleToolButton GtkToggleToolButton;
36 typedef struct _GtkToggleToolButtonClass GtkToggleToolButtonClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38 
39 
40 namespace Gtk
41 { class ToggleToolButton_Class; } // namespace Gtk
42 namespace Gtk
43 {
44 
45 /** A Gtk::ToolItem containing a toggle button.
46  *
47  * A ToggleToolButton is a Gtk::ToolItem that contains a toggle button.
48  *
49  * A ToggleToolButton widget looks like this:
50  * @image html toggletoolbutton1.png
51  *
52  * @ingroup Widgets
53  */
54 
55 class ToggleToolButton : public ToolButton
56 {
57   public:
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
59   typedef ToggleToolButton CppObjectType;
60   typedef ToggleToolButton_Class CppClassType;
61   typedef GtkToggleToolButton BaseObjectType;
62   typedef GtkToggleToolButtonClass BaseClassType;
63 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
64 
65   virtual ~ToggleToolButton();
66 
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68 
69 private:
70   friend class ToggleToolButton_Class;
71   static CppClassType toggletoolbutton_class_;
72 
73   // noncopyable
74   ToggleToolButton(const ToggleToolButton&);
75   ToggleToolButton& operator=(const ToggleToolButton&);
76 
77 protected:
78   explicit ToggleToolButton(const Glib::ConstructParams& construct_params);
79   explicit ToggleToolButton(GtkToggleToolButton* castitem);
80 
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 
83 public:
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85   static GType get_type()      G_GNUC_CONST;
86 
87 
88   static GType get_base_type() G_GNUC_CONST;
89 #endif
90 
91   ///Provides access to the underlying C GtkObject.
gobj()92   GtkToggleToolButton*       gobj()       { return reinterpret_cast<GtkToggleToolButton*>(gobject_); }
93 
94   ///Provides access to the underlying C GtkObject.
gobj()95   const GtkToggleToolButton* gobj() const { return reinterpret_cast<GtkToggleToolButton*>(gobject_); }
96 
97 
98 public:
99   //C++ methods used to invoke GTK+ virtual functions:
100 
101 protected:
102   //GTK+ Virtual Functions (override these to change behaviour):
103 
104   //Default Signal Handlers::
105   /// This is a default handler for the signal signal_toggled().
106   virtual void on_toggled();
107 
108 
109 private:
110 
111 public:
112 
113   /** Creates a new ToggleToolButton.
114    */
115   ToggleToolButton();
116 
117   /** Creates a new ToggleToolButton from a StockID.
118    *
119    * The ToggleToolButton will be created according to the @a stock_id properties.
120    *
121    * @param stock_id The StockID which determines the look of the ToggleToolButton.
122    */
123     explicit ToggleToolButton(const Gtk::StockID& stock_id);
124 
125 
126   /** Creates a new ToggleToolButton with a label.
127    *
128    * The ToggleToolButton will have the label @a label.
129    *
130    * @param label The string used to display the label for this ToggleToolButton.
131    */
132   explicit ToggleToolButton(const Glib::ustring& label);
133 
134   /** Creates a new ToggleToolButton with an image.
135    *
136    * The ToggleToolButton will have the label @a label and an image widget @a icon_widget.
137    *
138    * @param icon_widget The widget placed as the ToggleToolButton's icon.
139    * @param label The string used to display the label for this ToggleToolButton.
140    */
141   explicit ToggleToolButton(Widget& icon_widget, const Glib::ustring& label = Glib::ustring());
142 
143 
144   /** Sets the status of the toggle tool button. Set to <tt>true</tt> if you
145    * want the GtkToggleButton to be 'pressed in', and <tt>false</tt> to raise it.
146    * This action causes the toggled signal to be emitted.
147    *
148    * @newin{2,4}
149    *
150    * @param is_active Whether @a button should be active.
151    */
152   void set_active(bool is_active =  true);
153 
154   /** Queries a Gtk::ToggleToolButton and returns its current state.
155    * Returns <tt>true</tt> if the toggle button is pressed in and <tt>false</tt> if it is raised.
156    *
157    * @newin{2,4}
158    *
159    * @return <tt>true</tt> if the toggle tool button is pressed in, <tt>false</tt> if not.
160    */
161   bool get_active() const;
162 
163 
164   /**
165    * @par Slot Prototype:
166    * <tt>void on_my_%toggled()</tt>
167    *
168    */
169 
170   Glib::SignalProxy0< void > signal_toggled();
171 
172 
173   /** If the toggle button should be pressed in or not.
174    *
175    * @return A PropertyProxy that allows you to get or set the value of the property,
176    * or receive notification when the value of the property changes.
177    */
178   Glib::PropertyProxy< bool > property_active() ;
179 
180 /** If the toggle button should be pressed in or not.
181    *
182    * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
183    * or receive notification when the value of the property changes.
184    */
185   Glib::PropertyProxy_ReadOnly< bool > property_active() const;
186 
187 
188 };
189 
190 } // namespace Gtk
191 
192 
193 namespace Glib
194 {
195   /** A Glib::wrap() method for this object.
196    *
197    * @param object The C instance.
198    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
199    * @result A C++ instance that wraps this C instance.
200    *
201    * @relates Gtk::ToggleToolButton
202    */
203   Gtk::ToggleToolButton* wrap(GtkToggleToolButton* object, bool take_copy = false);
204 } //namespace Glib
205 
206 
207 #endif /* _GTKMM_TOGGLETOOLBUTTON_H */
208 
209