2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOOLITEM_H
4 #define _GTKMM_TOOLITEM_H
12 * Copyright (C) 1998-2002 The gtkmm Development Team
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.
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.
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.
29 #include <gtkmm/bin.h>
30 #include <gtkmm/tooltips.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkToolItem GtkToolItem;
35 typedef struct _GtkToolItemClass GtkToolItemClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class ToolItem_Class; } // namespace Gtk
49 class ToolItem : public Bin
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 */
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 friend class ToolItem_Class;
65 static CppClassType toolitem_class_;
68 ToolItem(const ToolItem&);
69 ToolItem& operator=(const ToolItem&);
72 explicit ToolItem(const Glib::ConstructParams& construct_params);
73 explicit ToolItem(GtkToolItem* castitem);
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79 static GType get_type() G_GNUC_CONST;
80 static GType get_base_type() G_GNUC_CONST;
83 ///Provides access to the underlying C GtkObject.
84 GtkToolItem* gobj() { return reinterpret_cast<GtkToolItem*>(gobject_); }
86 ///Provides access to the underlying C GtkObject.
87 const GtkToolItem* gobj() const { return reinterpret_cast<GtkToolItem*>(gobject_); }
91 //C++ methods used to invoke GTK+ virtual functions:
94 //GTK+ Virtual Functions (override these to change behaviour):
96 //Default Signal Handlers::
97 virtual bool on_create_menu_proxy();
98 virtual void on_toolbar_reconfigured();
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.
112 * @param homogeneous Whether @a tool_item is the same size as other homogeneous items.
114 void set_homogeneous(bool homogeneous = true);
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
123 bool get_homogeneous() const;
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.
132 * @param expand Whether @a tool_item is allocated extra space.
134 void set_expand(bool expand = true);
136 /** Returns whether @a tool_item is allocated extra space.
138 * @return <tt>true</tt> if @a tool_item is allocated extra space.
142 bool get_expand() const;
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().
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.
154 void set_tooltip(Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private = Glib::ustring());
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 .
163 * @param use_drag_window Whether @a toolitem has a drag window.
165 void set_use_drag_window(bool use_drag_window = true);
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.
173 bool get_use_drag_window() const;
176 /** Sets whether @a toolitem is visible when the toolbar is docked horizontally.
179 * @param visible_horizontal Whether @a toolitem is visible when in horizontal mode.
181 void set_visible_horizontal(bool visible_horizontal = true);
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.
190 bool get_visible_horizontal() const;
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.
199 * @param visible_vertical Whether @a toolitem is visible when the toolbar
200 * is in vertical mode.
202 void set_visible_vertical(bool visible_vertical = true);
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
210 bool get_visible_vertical() const;
213 /** Returns whether @a tool_item is considered important. See
215 * @return <tt>true</tt> if @a tool_item is considered important.
219 bool get_is_important() const;
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"
228 * @param is_important Whether the tool item should be considered important.
230 void set_is_important(bool is_important = true);
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
236 * @return A Gtk::IconSize indicating the icon size used for @a tool_item
240 IconSize get_icon_size () const;
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
245 * @return A Gtk::Orientation indicating the orientation
246 * used for @a tool_item
250 Orientation get_orientation() const;
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
258 * <itemizedlist>
259 * <listitem> GTK_TOOLBAR_BOTH, meaning the tool item should show
260 * both an icon and a label, stacked vertically </listitem>
261 * <listitem> GTK_TOOLBAR_ICONS, meaning the toolbar shows
262 * only icons </listitem>
263 * <listitem> GTK_TOOLBAR_TEXT, meaning the tool item should only
264 * show text</listitem>
265 * <listitem> 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.
270 * </itemizedlist>
271 * @return A Gtk::ToolbarStyle indicating the toolbar style used
276 ToolbarStyle get_toolbar_style() const;
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
287 ReliefStyle get_relief_style() const;
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 .
298 Widget* retrieve_proxy_menu_item();
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 .
308 const Widget* retrieve_proxy_menu_item() const;
310 /** If @a menu_item_id matches the string passed to
311 * set_proxy_menu_item() return the corresponding Gtk::MenuItem.
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 <!-- -->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 <!-- -->s match.
323 Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id);
325 /** If @a menu_item_id matches the string passed to
326 * set_proxy_menu_item() return the corresponding Gtk::MenuItem.
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 <!-- -->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 <!-- -->s match.
338 const Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id) const;
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().
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.
348 void set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item);
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.
356 * The function must be called when the tool item
357 * changes what it will do in response to the "create_menu_proxy"
365 Glib::SignalProxy0< bool > signal_create_menu_proxy();
368 Glib::SignalProxy0< void > signal_toolbar_reconfigured();
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.
375 Glib::SignalProxy3< bool,Tooltips*,const Glib::ustring&,const Glib::ustring& > signal_set_tooltip();
378 /** Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
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.
384 Glib::PropertyProxy<bool> property_visible_horizontal() ;
386 /** Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
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.
392 Glib::PropertyProxy_ReadOnly<bool> property_visible_horizontal() const;
394 /** Whether the toolbar item is visible when the toolbar is in a vertical orientation.
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.
400 Glib::PropertyProxy<bool> property_visible_vertical() ;
402 /** Whether the toolbar item is visible when the toolbar is in a vertical orientation.
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.
408 Glib::PropertyProxy_ReadOnly<bool> property_visible_vertical() const;
410 /** Whether the toolbar item is considered important. When TRUE
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.
416 Glib::PropertyProxy<bool> property_is_important() ;
418 /** Whether the toolbar item is considered important. When TRUE
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.
424 Glib::PropertyProxy_ReadOnly<bool> property_is_important() const;
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.
439 Gtk::ToolItem* wrap(GtkToolItem* object, bool take_copy = false);
441 #endif /* _GTKMM_TOOLITEM_H */