Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / toolbutton.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOOLBUTTON_H
4 #define _GTKMM_TOOLBUTTON_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* box.h
11  * 
12  * Copyright (C) 2003 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/toolitem.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkToolButton GtkToolButton;
34 typedef struct _GtkToolButtonClass GtkToolButtonClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class ToolButton_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** A Gtk::ToolItem subclass that displays buttons.
44  * 
45  * A ToolButton is are Gtk::ToolItem containing a button.
46  * @ingroup Widgets
47  */
48
49 class ToolButton : public ToolItem
50 {
51   public:
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53   typedef ToolButton CppObjectType;
54   typedef ToolButton_Class CppClassType;
55   typedef GtkToolButton BaseObjectType;
56   typedef GtkToolButtonClass BaseClassType;
57 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
58
59   virtual ~ToolButton();
60
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62
63 private:
64   friend class ToolButton_Class;
65   static CppClassType toolbutton_class_;
66
67   // noncopyable
68   ToolButton(const ToolButton&);
69   ToolButton& operator=(const ToolButton&);
70
71 protected:
72   explicit ToolButton(const Glib::ConstructParams& construct_params);
73   explicit ToolButton(GtkToolButton* castitem);
74
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76
77 public:
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79   static GType get_type()      G_GNUC_CONST;
80   static GType get_base_type() G_GNUC_CONST;
81 #endif
82
83   ///Provides access to the underlying C GtkObject.
84   GtkToolButton*       gobj()       { return reinterpret_cast<GtkToolButton*>(gobject_); }
85
86   ///Provides access to the underlying C GtkObject.
87   const GtkToolButton* gobj() const { return reinterpret_cast<GtkToolButton*>(gobject_); }
88
89
90 public:
91   //C++ methods used to invoke GTK+ virtual functions:
92
93 protected:
94   //GTK+ Virtual Functions (override these to change behaviour):
95
96   //Default Signal Handlers::
97   virtual void on_clicked();
98
99
100 private:
101
102 public:
103
104   /** Creates a new ToolButton.
105    */
106   ToolButton();
107   
108   /** Creates a new ToolButton from a StockID.
109    *
110    * The ToolButton will be created according to the @a stock_id properties.
111    * 
112    * @param stock_id The StockID which determines the look of the ToolButton.
113    */
114   explicit ToolButton(const Gtk::StockID& stock_id);
115   
116   /** Creates a new ToolButton with a label.
117    *
118    * The ToolButton will have the label @a label.
119    *
120    * @param label The string used to display the label for this ToolButton.
121    */
122   explicit ToolButton(const Glib::ustring& label);
123   
124   /** Creates a new ToolButton with an image.
125    *
126    * The ToolButton will have the label @a label and an image widget @a icon_widget.
127    *
128    * @param icon_widget The widget placed as the ToolButton's icon.
129    * @param label The string used to display the label for this ToolButton.
130    */
131   explicit ToolButton(Widget& icon_widget, const Glib::ustring& label = Glib::ustring());
132
133   
134   /** Sets @a label  as the label used for the tool button. The "label" property
135    * only has an effect if not overridden by a non-<tt>0</tt> "label_widget" property.
136    * If both the "label_widget" and "label" properties are <tt>0</tt>, the label
137    * is determined by the "stock_id" property. If the "stock_id" property is also
138    * <tt>0</tt>, @a button  will not have a label.
139    * 
140    * Since: 2.4
141    * @param label A string that will be used as label, or <tt>0</tt>.
142    */
143   void set_label(const Glib::ustring& label);
144   
145   /** Returns the label used by the tool button, or <tt>0</tt> if the tool button
146    * doesn't have a label. or uses a the label from a stock item. The returned
147    * string is owned by GTK+, and must not be modified or freed.
148    * @return The label, or <tt>0</tt>
149    * 
150    * Since: 2.4.
151    */
152   Glib::ustring get_label() const;
153   
154   /** If set, an underline in the label property indicates that the next character
155    * should be used for the mnemonic accelerator key in the overflow menu. For
156    * example, if the label property is "_Open" and @a use_underline  is <tt>true</tt>,
157    * the label on the tool button will be "Open" and the item on the overflow
158    * menu will have an underlined 'O'.
159    * 
160    * Labels shown on tool buttons never have mnemonics on them; this property
161    * only affects the menu item on the overflow menu.
162    * 
163    * Since: 2.4
164    * @param use_underline Whether the button label has the form "_Open".
165    */
166   void set_use_underline(bool use_underline = true);
167   
168   /** Returns whether underscores in the label property are used as mnemonics
169    * on menu items on the overflow menu. See set_use_underline().
170    * @return <tt>true</tt> if underscores in the label property are used as
171    * mnemonics on menu items on the overflow menu.
172    * 
173    * Since: 2.4.
174    */
175   bool get_use_underline() const;
176   
177   /** Sets the name of the stock item. See new_from_stock().
178    * The stock_id property only has an effect if not
179    * overridden by non-<tt>0</tt> "label" and "icon_widget" properties.
180    * 
181    * Since: 2.4
182    * @param stock_id A name of a stock item, or <tt>0</tt>.
183    */
184   void set_stock_id(const Gtk::StockID& stock_id);
185   
186   /** Returns the name of the stock item. See set_stock_id().
187    * The returned string is owned by GTK+ and must not be freed or modifed.
188    * @return The name of the stock item for @a button .
189    * 
190    * Since: 2.4.
191    */
192   Glib::ustring get_stock_id() const;
193   
194   /** Sets @a icon  as the widget used as icon on @a button . If @a icon_widget  is
195    * <tt>0</tt> the icon is determined by the "stock_id" property. If the
196    * "stock_id" property is also <tt>0</tt>, @a button  will not have an icon.
197    * 
198    * Since: 2.4
199    * @param icon_widget The widget used as icon, or <tt>0</tt>.
200    */
201   void set_icon_widget(Widget& icon_widget);
202   
203   /** Return the widget used as icon widget on @a button . See
204    * set_icon_widget().
205    * @return The widget used as icon on @a button , or <tt>0</tt>.
206    * 
207    * Since: 2.4.
208    */
209   Widget* get_icon_widget();
210   
211   /** Return the widget used as icon widget on @a button . See
212    * set_icon_widget().
213    * @return The widget used as icon on @a button , or <tt>0</tt>.
214    * 
215    * Since: 2.4.
216    */
217   const Widget* get_icon_widget() const;
218   
219   /** Sets @a label_widget  as the widget that will be used as the label
220    * for @a button . If @a label_widget  is <tt>0</tt> the "label" property is used
221    * as label. If "label" is also <tt>0</tt>, the label in the stock item
222    * determined by the "stock_id" property is used as label. If
223    * "stock_id" is also <tt>0</tt>, @a button  does not have a label.
224    * 
225    * Since: 2.4
226    * @param label_widget The widget used as label, or <tt>0</tt>.
227    */
228   void set_label_widget(Widget& label_widget);
229   
230   /** Returns the widget used as label on @a button . See
231    * set_label_widget().
232    * @return The widget used as label on @a button , or <tt>0</tt>.
233    * 
234    * Since: 2.4.
235    */
236   Widget* get_label_widget();
237   
238   /** Returns the widget used as label on @a button . See
239    * set_label_widget().
240    * @return The widget used as label on @a button , or <tt>0</tt>.
241    * 
242    * Since: 2.4.
243    */
244   const Widget* get_label_widget() const;
245
246   
247   Glib::SignalProxy0< void > signal_clicked();
248
249
250   /** Text to show in the item.
251    *
252    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
253    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
254    * the value of the property changes.
255    */
256   Glib::PropertyProxy<Glib::ustring> property_label() ;
257
258 /** Text to show in the item.
259    *
260    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
261    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
262    * the value of the property changes.
263    */
264   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_label() const;
265
266   /** If set
267    *
268    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
269    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
270    * the value of the property changes.
271    */
272   Glib::PropertyProxy<bool> property_use_underline() ;
273
274 /** If set
275    *
276    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
277    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
278    * the value of the property changes.
279    */
280   Glib::PropertyProxy_ReadOnly<bool> property_use_underline() const;
281
282   /** Widget to use as the item label.
283    *
284    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
285    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
286    * the value of the property changes.
287    */
288   Glib::PropertyProxy<Gtk::Widget*> property_label_widget() ;
289
290 /** Widget to use as the item label.
291    *
292    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
293    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
294    * the value of the property changes.
295    */
296   Glib::PropertyProxy_ReadOnly<Gtk::Widget*> property_label_widget() const;
297
298   /** The stock icon displayed on the item.
299    *
300    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
301    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
302    * the value of the property changes.
303    */
304   Glib::PropertyProxy<Glib::ustring> property_stock_id() ;
305
306 /** The stock icon displayed on the item.
307    *
308    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
309    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
310    * the value of the property changes.
311    */
312   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock_id() const;
313
314   /** Icon widget to display in the item.
315    *
316    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
317    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
318    * the value of the property changes.
319    */
320   Glib::PropertyProxy<Gtk::Widget> property_icon_widget() ;
321
322 /** Icon widget to display in the item.
323    *
324    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
325    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
326    * the value of the property changes.
327    */
328   Glib::PropertyProxy_ReadOnly<Gtk::Widget> property_icon_widget() const;
329               
330
331 };
332
333 } // namespace Gtk
334
335
336 namespace Glib
337 {
338   /** @relates Gtk::ToolButton
339    * @param object The C instance
340    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
341    * @result A C++ instance that wraps this C instance.
342    */
343   Gtk::ToolButton* wrap(GtkToolButton* object, bool take_copy = false);
344 }
345 #endif /* _GTKMM_TOOLBUTTON_H */
346