| 1 |
/* Copyright (C) 2009 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 |
#include <gtkmm/container.h> |
| 18 |
#include <gtkmm/toolitem.h> |
| 19 |
#include <gtkmm/toolshell.h> |
| 20 |
_DEFS(gtkmm,gtk) |
| 21 |
_PINCLUDE(gtkmm/private/container_p.h) |
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
/** A ToolItemGroup is used together with ToolPalette to add ToolItems to a |
| 27 |
* palette-like container with different categories and drag and drop support. |
| 28 |
* |
| 29 |
* @newin{2,20} |
| 30 |
* @ingroup Widgets |
| 31 |
* @ingroup Containers |
| 32 |
*/ |
| 33 |
class GTKMM_API ToolItemGroup |
| 34 |
: public Container, |
| 35 |
public ToolShell |
| 36 |
{ |
| 37 |
_CLASS_GTKOBJECT(ToolItemGroup, GtkToolItemGroup, GTK_TOOL_ITEM_GROUP, Gtk::Container, GtkContainer, , , GTKMM_API) |
| 38 |
_IMPLEMENTS_INTERFACE(ToolShell) |
| 39 |
public: |
| 40 |
_WRAP_CTOR(ToolItemGroup(const Glib::ustring& label = Glib::ustring()), gtk_tool_item_group_new) |
| 41 |
|
| 42 |
_WRAP_METHOD(void set_label(const Glib::ustring& label), gtk_tool_item_group_set_label) |
| 43 |
_WRAP_METHOD(void set_label_widget(Widget& label_widget), gtk_tool_item_group_set_label_widget) |
| 44 |
_WRAP_METHOD(void set_collapsed(bool collapsed = true), gtk_tool_item_group_set_collapsed) |
| 45 |
_WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode ellipsize), gtk_tool_item_group_set_ellipsize) |
| 46 |
_WRAP_METHOD(void set_header_relief(ReliefStyle style), gtk_tool_item_group_set_header_relief) |
| 47 |
|
| 48 |
_WRAP_METHOD(Glib::ustring get_label() const, gtk_tool_item_group_get_label) |
| 49 |
|
| 50 |
_WRAP_METHOD(Widget* get_label_widget(), gtk_tool_item_group_get_label_widget) |
| 51 |
_WRAP_METHOD(const Widget* get_label_widget() const, gtk_tool_item_group_get_label_widget, constversion) |
| 52 |
|
| 53 |
_WRAP_METHOD(bool get_collapsed() const, gtk_tool_item_group_get_collapsed) |
| 54 |
_WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const, gtk_tool_item_group_get_ellipsize) |
| 55 |
_WRAP_METHOD(ReliefStyle get_header_relief() const, gtk_tool_item_group_get_header_relief) |
| 56 |
|
| 57 |
_WRAP_METHOD(void insert(ToolItem& item, int position), gtk_tool_item_group_insert) |
| 58 |
|
| 59 |
/** Inserts @a item at the end of the list of children of the group. |
| 60 |
* |
| 61 |
* @param item The ToolItem to insert into the group. |
| 62 |
*/ |
| 63 |
void insert(ToolItem& item); |
| 64 |
|
| 65 |
_WRAP_METHOD(void set_item_position(ToolItem& item, int position), gtk_tool_item_group_set_item_position) |
| 66 |
_WRAP_METHOD(int get_item_position(const ToolItem& item) const, gtk_tool_item_group_get_item_position) |
| 67 |
|
| 68 |
_WRAP_METHOD(guint get_n_items() const, gtk_tool_item_group_get_n_items) |
| 69 |
|
| 70 |
_WRAP_METHOD(ToolItem* get_nth_item(guint index), gtk_tool_item_group_get_nth_item) |
| 71 |
_WRAP_METHOD(const ToolItem* get_nth_item(guint index) const, gtk_tool_item_group_get_nth_item, constversion) |
| 72 |
|
| 73 |
_WRAP_METHOD(ToolItem* get_drop_item(int x, int y), gtk_tool_item_group_get_drop_item) |
| 74 |
_WRAP_METHOD(ToolItem* get_drop_item(int x, int y) const, gtk_tool_item_group_get_drop_item, constversion) |
| 75 |
|
| 76 |
_WRAP_PROPERTY("label", Glib::ustring) |
| 77 |
_WRAP_PROPERTY("label-widget", Gtk::Widget*) |
| 78 |
_WRAP_PROPERTY("collapsed", bool) |
| 79 |
_WRAP_PROPERTY("ellipsize", Pango::EllipsizeMode) |
| 80 |
_WRAP_PROPERTY("header-relief", ReliefStyle) |
| 81 |
|
| 82 |
_WRAP_CHILD_PROPERTY("homogeneous", bool) |
| 83 |
_WRAP_CHILD_PROPERTY("expand", bool) |
| 84 |
_WRAP_CHILD_PROPERTY("fill", bool) |
| 85 |
_WRAP_CHILD_PROPERTY("new-row", bool) |
| 86 |
_WRAP_CHILD_PROPERTY("position", int) |
| 87 |
}; |
| 88 |
|
| 89 |
} // namespace Gtk |