Debian Codegraph @

gtk/src/toolitem.hg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 // This is for including the config header before any code (such as
18 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
19 _CONFIGINCLUDE(gtkmmconfig.h)
20
21 #include <gtkmm/bin.h>
22 #include <gtkmm/activatable.h>
23 #include <gtkmm/sizegroup.h>
24
25 _DEFS(gtkmm,gtk)
26 _PINCLUDE(gtkmm/private/bin_p.h)
27
28 namespace Gtk
29 {
30
31 /** The base class of widgets that can be added to ToolShell.
32 * ToolItem<!-- -->s are widgets that can appear on a toolbar. To
33 * create a toolbar item that contains something else than a button, use
34 * a ToolItem. Use Container::add() to add a child widget to the tool item.
35 *
36 * For toolbar items that contain buttons, see the ToolButton,
37 * ToggleToolButton and RadioToolButton classes.
38 *
39 * See the Toolbar class for a description of the toolbar widget, and
40 * ToolShell for a description of the tool shell interface.
41 *
42 * @ingroup Widgets
43 */
44 class GTKMM_API ToolItem
45 : public Bin,
46 public Activatable
47 {
48 _CLASS_GTKOBJECT(ToolItem, GtkToolItem, GTK_TOOL_ITEM, Gtk::Bin, GtkBin, , , GTKMM_API)
49 _IMPLEMENTS_INTERFACE(Activatable)
50 public:
51 _CTOR_DEFAULT
52
53 _WRAP_METHOD(void set_homogeneous(bool homogeneous = true), gtk_tool_item_set_homogeneous)
54 _WRAP_METHOD(bool get_homogeneous() const, gtk_tool_item_get_homogeneous)
55
56 _WRAP_METHOD(void set_expand(bool expand = true), gtk_tool_item_set_expand)
57 _WRAP_METHOD(bool get_expand() const, gtk_tool_item_get_expand)
58
59 _WRAP_METHOD(void set_tooltip_text(const Glib::ustring& text), gtk_tool_item_set_tooltip_text)
60 _WRAP_METHOD(void set_tooltip_markup(const Glib::ustring& markup), gtk_tool_item_set_tooltip_markup)
61
62 _WRAP_METHOD(void set_use_drag_window(bool use_drag_window = true), gtk_tool_item_set_use_drag_window)
63 _WRAP_METHOD(bool get_use_drag_window() const, gtk_tool_item_get_use_drag_window)
64
65 _WRAP_METHOD(void set_visible_horizontal(bool visible_horizontal = true), gtk_tool_item_set_visible_horizontal)
66 _WRAP_METHOD(bool get_visible_horizontal() const, gtk_tool_item_get_visible_horizontal)
67
68 _WRAP_METHOD(void set_visible_vertical(bool visible_vertical = true), gtk_tool_item_set_visible_vertical)
69 _WRAP_METHOD(bool get_visible_vertical() const, gtk_tool_item_get_visible_vertical)
70
71 _WRAP_METHOD(bool get_is_important() const, gtk_tool_item_get_is_important)
72 _WRAP_METHOD(void set_is_important(bool is_important = true), gtk_tool_item_set_is_important)
73
74 _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize_mode() const, gtk_tool_item_get_ellipsize_mode)
75 _WRAP_METHOD(IconSize get_icon_size () const, gtk_tool_item_get_icon_size)
76 _WRAP_METHOD(Orientation get_orientation() const, gtk_tool_item_get_orientation)
77 _WRAP_METHOD(ToolbarStyle get_toolbar_style() const, gtk_tool_item_get_toolbar_style)
78 _WRAP_METHOD(ReliefStyle get_relief_style() const, gtk_tool_item_get_relief_style)
79
80 _WRAP_METHOD(float get_text_alignment() const, gtk_tool_item_get_text_alignment)
81 _WRAP_METHOD(Orientation get_text_orientation() const, gtk_tool_item_get_text_orientation)
82 _WRAP_METHOD(Glib::RefPtr<SizeGroup> get_text_size_group(), gtk_tool_item_get_text_size_group, refreturn)
83 _WRAP_METHOD(Glib::RefPtr<const SizeGroup> get_text_size_group() const, gtk_tool_item_get_text_size_group, refreturn, constversion)
84
85 _WRAP_METHOD(Widget* retrieve_proxy_menu_item(), gtk_tool_item_retrieve_proxy_menu_item)
86 _WRAP_METHOD(const Widget* retrieve_proxy_menu_item() const, gtk_tool_item_retrieve_proxy_menu_item, constversion)
87 _WRAP_METHOD(Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id), gtk_tool_item_get_proxy_menu_item)
88 _WRAP_METHOD(const Widget* get_proxy_menu_item(const Glib::ustring& menu_item_id) const, gtk_tool_item_get_proxy_menu_item, constversion)
89 _WRAP_METHOD(void set_proxy_menu_item(const Glib::ustring& menu_item_id, Widget& menu_item), gtk_tool_item_set_proxy_menu_item)
90
91 /** Removes the MenuItem used in the toolbar overflow menu, if any.
92 * The @a menu_item_id is used to identify the caller of this function and
93 * should also be used with get_proxy_menu_item().
94 *
95 * @newin{3,12}
96 *
97 * @param menu_item_id A string used to identify the MenuItem.
98 */
99 void unset_proxy_menu_item(const Glib::ustring& menu_item_id);
100
101 _WRAP_METHOD(void rebuild_menu(), gtk_tool_item_rebuild_menu)
102
103 _WRAP_METHOD(void toolbar_reconfigured(), gtk_tool_item_toolbar_reconfigured)
104
105 _WRAP_SIGNAL(bool create_menu_proxy(), create_menu_proxy)
106
107 _WRAP_SIGNAL(void toolbar_reconfigured(), toolbar_reconfigured)
108
109 _WRAP_PROPERTY("visible_horizontal", bool)
110 _WRAP_PROPERTY("visible_vertical", bool)
111 _WRAP_PROPERTY("is_important", bool)
112 };
113
114 } // namespace Gtk