| 1 |
/* Copyright (C) 2013 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 |
_DEFS(gtkmm,gtk) |
| 19 |
_PINCLUDE(gtkmm/private/container_p.h) |
| 20 |
|
| 21 |
namespace Gtk |
| 22 |
{ |
| 23 |
|
| 24 |
/** A box with a centered child. |
| 25 |
* |
| 26 |
* Gtk::HeaderBar is similar to a horizontal Gtk::Box, it allows |
| 27 |
* to place children at the start or the end. In addition, |
| 28 |
* it allows a title to be displayed. The title will be |
| 29 |
* centered with respect to the width of the box, even if the children |
| 30 |
* at either side take up different amounts of space. |
| 31 |
* |
| 32 |
* @ingroup Containers |
| 33 |
* @newin{3,10} |
| 34 |
*/ |
| 35 |
class GTKMM_API HeaderBar |
| 36 |
: public Container |
| 37 |
{ |
| 38 |
_CLASS_GTKOBJECT(HeaderBar, GtkHeaderBar, GTK_HEADER_BAR, Gtk::Container, GtkContainer, , , GTKMM_API) |
| 39 |
public: |
| 40 |
|
| 41 |
/** Create a new HeaderBar widget. |
| 42 |
*/ |
| 43 |
_CTOR_DEFAULT |
| 44 |
|
| 45 |
|
| 46 |
_WRAP_METHOD(void set_title(const Glib::ustring& title), gtk_header_bar_set_title) |
| 47 |
_WRAP_METHOD(Glib::ustring get_title() const, gtk_header_bar_get_title) |
| 48 |
|
| 49 |
_WRAP_METHOD(void set_subtitle(const Glib::ustring& subtitle), gtk_header_bar_set_subtitle) |
| 50 |
_WRAP_METHOD(Glib::ustring get_subtitle() const, gtk_header_bar_get_subtitle) |
| 51 |
|
| 52 |
_WRAP_METHOD(void set_has_subtitle(bool setting = true), gtk_header_bar_set_has_subtitle) |
| 53 |
_WRAP_METHOD(bool get_has_subtitle() const, gtk_header_bar_get_has_subtitle) |
| 54 |
|
| 55 |
_WRAP_METHOD(void set_custom_title(Gtk::Widget& title_widget), gtk_header_bar_set_custom_title) |
| 56 |
_WRAP_METHOD(Widget* get_custom_title(), gtk_header_bar_get_custom_title) |
| 57 |
_WRAP_METHOD(const Widget* get_custom_title() const, gtk_header_bar_get_custom_title, constversion) |
| 58 |
|
| 59 |
_WRAP_METHOD(void pack_start(Gtk::Widget& child), gtk_header_bar_pack_start) |
| 60 |
_WRAP_METHOD(void pack_end(Gtk::Widget& child), gtk_header_bar_pack_end) |
| 61 |
|
| 62 |
_WRAP_METHOD(void set_show_close_button(bool setting = true), gtk_header_bar_set_show_close_button) |
| 63 |
_WRAP_METHOD(bool get_show_close_button() const, gtk_header_bar_get_show_close_button) |
| 64 |
|
| 65 |
_WRAP_METHOD(void set_decoration_layout(const Glib::ustring& layout), gtk_header_bar_set_decoration_layout) |
| 66 |
|
| 67 |
/** Unset the decoration layout. |
| 68 |
* See set_decoration_layout(). |
| 69 |
*/ |
| 70 |
void unset_decoration_layout(); |
| 71 |
|
| 72 |
_WRAP_METHOD(Glib::ustring get_decoration_layout() const, gtk_header_bar_get_decoration_layout) |
| 73 |
|
| 74 |
|
| 75 |
_WRAP_PROPERTY("custom-title", Gtk::Widget*) |
| 76 |
_WRAP_PROPERTY("show-close-button", bool) |
| 77 |
_WRAP_PROPERTY("spacing", int) |
| 78 |
_WRAP_PROPERTY("subtitle", Glib::ustring) |
| 79 |
_WRAP_PROPERTY("title", Glib::ustring) |
| 80 |
_WRAP_PROPERTY("decoration-layout", Glib::ustring) |
| 81 |
_WRAP_PROPERTY("decoration-layout-set", bool) |
| 82 |
_WRAP_PROPERTY("has-subtitle", bool) |
| 83 |
|
| 84 |
_WRAP_CHILD_PROPERTY("pack-type", PackType) |
| 85 |
_WRAP_CHILD_PROPERTY("position", int) |
| 86 |
|
| 87 |
// Gtk::HeaderBar has no signals nor vfuncs as of 3.12. |
| 88 |
}; |
| 89 |
|
| 90 |
} // namespace Gtk |