Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / toolitem.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOOLITEM_H
4 #define _GTKMM_TOOLITEM_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* box.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/bin.h>
30 #include <gtkmm/tooltips.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkToolItem GtkToolItem;
35 typedef struct _GtkToolItemClass GtkToolItemClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class ToolItem_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** 
45  *
46  * @ingroup Widgets
47  */
48
49 class ToolItem : public Bin
50 {
51   public:
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53   typedef ToolItem CppObjectType;
54   typedef ToolItem_Class CppClassType;
55   typedef GtkToolItem BaseObjectType;
56   typedef GtkToolItemClass BaseClassType;
57 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
58
59   virtual ~ToolItem();
60
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62
63 private:
64   friend class ToolItem_Class;
65   static CppClassType toolitem_class_;
66
67   // noncopyable
68   ToolItem(const ToolItem&);
69   ToolItem& operator=(const ToolItem&);
70
71 protected:
72   explicit ToolItem(const Glib::ConstructParams& construct_params);
73   explicit ToolItem(GtkToolItem* 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   GtkToolItem*       gobj()       { return reinterpret_cast<GtkToolItem*>(gobject_); }
85
86   ///Provides access to the underlying C GtkObject.
87   const GtkToolItem* gobj() const { return reinterpret_cast<GtkToolItem*>(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 bool on_create_menu_proxy();
98   virtual void on_toolbar_reconfigured();
99
100
101 private:
102
103 public:
104   ToolItem();
105
106   
107   /** Sets whether @a tool_item  is to be allocated the same size as other
108    * homogeneous items. The effect is that all homogeneous items will have
109    * the same width as the widest of the items.
110    * 
111    * Since: 2.4
112    * @param homogeneous Whether @a tool_item  is the same size as other homogeneous items.
113    */
114   void set_homogeneous(bool homogeneous = true);
115   
116   /** Returns whether @a tool_item  is the same size as other homogeneous
117    * items. See set_homogeneous().
118    * @return <tt>true</tt> if the item is the same size as other homogeneous
119    * item.s
120    * 
121    * Since: 2.4.
122    */
123   bool get_homogeneous() const;
124
125   
126   /** Sets whether @a tool_item  is allocated extra space when there
127    * is more room on the toolbar then needed for the items. The
128    * effect is that the item gets bigger when the toolbar gets bigger
129    * and smaller when the toolbar gets smaller.
130    * 
131    * Since: 2.4
132    * @param expand Whether @a tool_item  is allocated extra space.
133    */
134   void set_expand(bool expand = true);
135   
136   /** Returns whether @a tool_item  is allocated extra space.
137    * See set_expand().
138    * @return <tt>true</tt> if @a tool_item  is allocated extra space.
139    * 
140    * Since: 2.4.
141    */
142   bool get_expand() const;
143
144   
145   /** Sets the Gtk::Tooltips object to be used for @a tool_item , the
146    * text to be displayed as tooltip on the item and the private text
147    * to be used. See Gtk::Tooltips::set_tip().
148    * 
149    * Since: 2.4
150    * @param tooltips The Gtk::Tooltips object to be used.
151    * @param tip_text Text to be used as tooltip text for @a tool_item .
152    * @param tip_private Text to be used as private tooltip text.
153    */
154   void set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private = Glib::ustring());
155   
156   
157   /** Sets whether @a toolitem  has a drag window. When <tt>true</tt> the
158    * toolitem can be used as a drag source through gtk_drag_source_set().
159    * When @a toolitem  has a drag window it will intercept all events,
160    * even those that would otherwise be sent to a child of @a toolitem .
161    * 
162    * Since: 2.4
163    * @param use_drag_window Whether @a toolitem  has a drag window.
164    */
165   void set_use_drag_window(bool use_drag_window = true);
166   
167   /** Returns whether @a toolitem  has a drag window. See
168    * set_use_drag_window().
169    * @return <tt>true</tt> if @a toolitem  uses a drag window.
170    * 
171    * Since: 2.4.
172    */
173   bool get_use_drag_window() const;
174
175   
176   /** Sets whether @a toolitem  is visible when the toolbar is docked horizontally.
177    * 
178    * Since: 2.4
179    * @param visible_horizontal Whether @a toolitem  is visible when in horizontal mode.
180    */
181   void set_visible_horizontal(bool visible_horizontal = true);
182   
183   /** Returns whether the @a toolitem  is visible on toolbars that are
184    * docked horizontally.
185    * @return <tt>true</tt> if @a toolitem  is visible on toolbars that are
186    * docked horizontally.
187    * 
188    * Since: 2.4.
189    */
190   bool get_visible_horizontal() const;
191
192   
193   /** Sets whether @a toolitem  is visible when the toolbar is docked
194    * vertically. Some tool items, such as text entries, are too wide to be
195    * useful on a vertically docked toolbar. If @a visible_vertical  is <tt>false</tt>
196    *  @a toolitem  will not appear on toolbars that are docked vertically.
197    * 
198    * Since: 2.4
199    * @param visible_vertical Whether @a toolitem  is visible when the toolbar
200    * is in vertical mode.
201    */
202   void set_visible_vertical(bool visible_vertical = true);
203   
204   /** Returns whether @a toolitem  is visible when the toolbar is docked vertically.
205    * See set_visible_vertical().
206    * @return Whether @a toolitem  is visible when the toolbar is docked vertically
207    * 
208    * Since: 2.4.
209    */
210   bool get_visible_vertical() const;
211
212   
213   /** Returns whether @a tool_item  is considered important. See
214    * set_is_important()
215    * @return <tt>true</tt> if @a tool_item  is considered important.
216    * 
217    * Since: 2.4.
218    */
219   bool get_is_important() const;
220   
221   /** Sets whether @a tool_item  should be considered important. The Gtk::ToolButton
222    * class uses this property to determine whether to show or hide its label
223    * when the toolbar style is Gtk::TOOLBAR_BOTH_HORIZ. The result is that
224    * only tool buttons with the "is_important" property set have labels, an
225    * effect known as "priority text"
226    * 
227    * Since: 2.4
228    * @param is_important Whether the tool item should be considered important.
229    */
230   void set_is_important(bool is_important = true);
231
232   
233   /** Returns the icon size used for @a tool_item . Custom subclasses of
234    * Gtk::ToolItem should call this function to find out what size icons
235    * they should use.
236    * @return A Gtk::IconSize indicating the icon size used for @a tool_item 
237    * 
238    * Since: 2.4.
239    */
240   IconSize get_icon_size () const;
241   
242   /** Returns the orientation used for @a tool_item . Custom subclasses of
243    * Gtk::ToolItem should call this function to find out what size icons
244    * they should use.
245    * @return A Gtk::Orientation indicating the orientation
246    * used for @a tool_item 
247    * 
248    * Since: 2.4.
249    */
250   Orientation get_orientation() const;
251   
252   /** Returns the toolbar style used for @a tool_item . Custom subclasses of
253    * Gtk::ToolItem should call this function in the handler of the
254    * GtkToolItem::toolbar_reconfigured signal to find out in what style
255    * the toolbar is displayed and change themselves accordingly 
256    * 
257    * Possibilities are:
258    * &lt;itemizedlist&gt;
259    * &lt;listitem&gt; GTK_TOOLBAR_BOTH, meaning the tool item should show
260    * both an icon and a label, stacked vertically &lt;/listitem&gt;
261    * &lt;listitem&gt; GTK_TOOLBAR_ICONS, meaning the toolbar shows
262    * only icons &lt;/listitem&gt;
263    * &lt;listitem&gt; GTK_TOOLBAR_TEXT, meaning the tool item should only
264    * show text&lt;/listitem&gt;
265    * &lt;listitem&gt; GTK_TOOLBAR_BOTH_HORIZ, meaning the tool item should show
266    * both an icon and a label, arranged horizontally (however, note the 
267    * Gtk::ToolButton::has_text_horizontally that makes tool buttons not
268    * show labels when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ.
269    * &lt;/listitem&gt;
270    * &lt;/itemizedlist&gt;
271    * @return A Gtk::ToolbarStyle indicating the toolbar style used
272    * for @a tool_item .
273    * 
274    * Since: 2.4.
275    */
276   ToolbarStyle get_toolbar_style() const;
277   
278   /** Returns the relief style of @a tool_item . See gtk_button_set_relief_style().
279    * Custom subclasses of Gtk::ToolItem should call this function in the handler
280    * of the Gtk::ToolItem::toolbar_reconfigured signal to find out the
281    * relief style of buttons.
282    * @return A Gtk::ReliefStyle indicating the relief style used
283    * for @a tool_item .
284    * 
285    * Since: 2.4.
286    */
287   ReliefStyle get_relief_style() const;
288
289   
290   /** Returns the Gtk::MenuItem that was last set by
291    * set_proxy_menu_item(), ie. the Gtk::MenuItem
292    * that is going to appear in the overflow menu.
293    * @return The Gtk::MenuItem that is going to appear in the
294    * overflow menu for @a tool_item .
295    * 
296    * Since: 2.4.
297    */
298   Widget* retrieve_proxy_menu_item();
299   
300   /** Returns the Gtk::MenuItem that was last set by
301    * set_proxy_menu_item(), ie. the Gtk::MenuItem
302    * that is going to appear in the overflow menu.
303    * @return The Gtk::MenuItem that is going to appear in the
304    * overflow menu for @a tool_item .
305    * 
306    * Since: 2.4.
307    */
308   const Widget* retrieve_proxy_menu_item() const;
309   
310   /** If @a menu_item_id  matches the string passed to
311    * set_proxy_menu_item() return the corresponding Gtk::MenuItem.
312    * 
313    * Custom subclasses of Gtk::ToolItem should use this function to update
314    * their menu item when the Gtk::ToolItem changes. That the
315    *  @a menu_item_id &lt;!-- --&gt;s must match ensures that a Gtk::ToolItem will not
316    * inadvertently change a menu item that they did not create.
317    * @param menu_item_id A string used to identify the menu item.
318    * @return The Gtk::MenuItem passed to
319    * set_proxy_menu_item(), if the @a menu_item_id &lt;!-- --&gt;s match.
320    * 
321    * Since: 2.4.
322    */
323   Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id);
324   
325   /** If @a menu_item_id  matches the string passed to
326    * set_proxy_menu_item() return the corresponding Gtk::MenuItem.
327    * 
328    * Custom subclasses of Gtk::ToolItem should use this function to update
329    * their menu item when the Gtk::ToolItem changes. That the
330    *  @a menu_item_id &lt;!-- --&gt;s must match ensures that a Gtk::ToolItem will not
331    * inadvertently change a menu item that they did not create.
332    * @param menu_item_id A string used to identify the menu item.
333    * @return The Gtk::MenuItem passed to
334    * set_proxy_menu_item(), if the @a menu_item_id &lt;!-- --&gt;s match.
335    * 
336    * Since: 2.4.
337    */
338   const Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id) const;
339   
340   /** Sets the Gtk::MenuItem used in the toolbar overflow menu. The
341    *  @a menu_item_id  is used to identify the caller of this function and
342    * should also be used with get_proxy_menu_item().
343    * 
344    * Since: 2.4
345    * @param menu_item_id A string used to identify @a menu_item .
346    * @param menu_item A Gtk::MenuItem to be used in the overflow menu.
347    */
348   void set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item);
349
350   
351   /** Calling this function signals to the toolbar that the
352    * overflow menu item for @a tool_item  has changed. If the
353    * overflow menu is visible when this function it called,
354    * the menu will be rebuilt.
355    * 
356    * The function must be called when the tool item
357    * changes what it will do in response to the "create_menu_proxy"
358    * signal.
359    * 
360    * Since: 2.6
361    */
362   void rebuild_menu();
363   
364   
365   Glib::SignalProxy0< bool > signal_create_menu_proxy();
366
367   
368   Glib::SignalProxy0< void > signal_toolbar_reconfigured();
369
370
371   //We use no_default_handler for this, because we can not add a new vfunc to 2.5 without breaking ABI.
372   //TODO: Remove no_default_handler when we do an ABI-break-with-parallel-install.
373   
374
375   Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > signal_set_tooltip();
376
377   
378   /** Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
379    *
380    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
381    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
382    * the value of the property changes.
383    */
384   Glib::PropertyProxy<bool> property_visible_horizontal() ;
385
386 /** Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
387    *
388    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
389    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
390    * the value of the property changes.
391    */
392   Glib::PropertyProxy_ReadOnly<bool> property_visible_horizontal() const;
393
394   /** Whether the toolbar item is visible when the toolbar is in a vertical orientation.
395    *
396    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
397    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
398    * the value of the property changes.
399    */
400   Glib::PropertyProxy<bool> property_visible_vertical() ;
401
402 /** Whether the toolbar item is visible when the toolbar is in a vertical orientation.
403    *
404    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
405    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
406    * the value of the property changes.
407    */
408   Glib::PropertyProxy_ReadOnly<bool> property_visible_vertical() const;
409
410   /** Whether the toolbar item is considered important. When TRUE
411    *
412    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
413    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
414    * the value of the property changes.
415    */
416   Glib::PropertyProxy<bool> property_is_important() ;
417
418 /** Whether the toolbar item is considered important. When TRUE
419    *
420    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
421    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
422    * the value of the property changes.
423    */
424   Glib::PropertyProxy_ReadOnly<bool> property_is_important() const;
425
426
427 };
428
429 } // namespace Gtk
430
431
432 namespace Glib
433 {
434   /** @relates Gtk::ToolItem
435    * @param object The C instance
436    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
437    * @result A C++ instance that wraps this C instance.
438    */
439   Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy = false);
440 }
441 #endif /* _GTKMM_TOOLITEM_H */
442