/* Copyright (C) 2013 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see .
*/
#include
#include
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/container_p.h)
namespace Gtk
{
_CC_INCLUDE(gtk/gtk.h)
/** A container that shows only one child at a time.
*
* Gtk::Stack does not provide a means for users to change the visible
* child. Instead, the Gtk::StackSwitcher or Gtk::StackSidebar widget can be used with
* Gtk::Stack to provide this functionality.
*
* @ingroup Widgets
* @ingroup Containers
* @newin{3,10}
*/
class GTKMM_API Stack
: public Container
{
_CLASS_GTKOBJECT(Stack,GtkStack,GTK_STACK,Gtk::Container,GtkContainer,,,GTKMM_API)
public:
_CTOR_DEFAULT
_WRAP_METHOD(void add(Widget& child, const Glib::ustring& name), gtk_stack_add_named)
_WRAP_METHOD(void add(Widget& child, const Glib::ustring& name, const Glib::ustring& title), gtk_stack_add_titled)
//TODO: Remove this method overload when we can break ABI and API, and Container::add()
//has been made non-virtual. It's not very useful in Stack. It's needed only to
//avoid a compilation error when compiling with -Woverloaded-virtual -Werror.
//See https://bugzilla.gnome.org/show_bug.cgi?id=724732
/** Adds a child.
*
* @newin{3,14}
*
* @deprecated Use one of the other add() methods instead. This method was added only to avoid a compilation error.
*/
void add(Widget& child) override;
_WRAP_METHOD(void set_visible_child(Widget& child), gtk_stack_set_visible_child)
_WRAP_METHOD(Widget* get_visible_child(), gtk_stack_get_visible_child)
_WRAP_METHOD(const Widget* get_visible_child() const, gtk_stack_get_visible_child, constversion)
_WRAP_METHOD(void set_visible_child(const Glib::ustring& name), gtk_stack_set_visible_child_name)
_WRAP_METHOD(void set_visible_child(const Glib::ustring& name, StackTransitionType transition), gtk_stack_set_visible_child_full)
_WRAP_METHOD(Glib::ustring get_visible_child_name() const, gtk_stack_get_visible_child_name)
_WRAP_METHOD(void set_homogeneous(bool homogeneous = true), gtk_stack_set_homogeneous)
_WRAP_METHOD(bool get_homogeneous() const, gtk_stack_get_homogeneous)
_WRAP_METHOD(void set_hhomogeneous(bool hhomogeneous = true), gtk_stack_set_hhomogeneous)
_WRAP_METHOD(bool get_hhomogeneous() const, gtk_stack_get_hhomogeneous)
_WRAP_METHOD(void set_vhomogeneous(bool vhomogeneous = true), gtk_stack_set_vhomogeneous)
_WRAP_METHOD(bool get_vhomogeneous() const, gtk_stack_get_vhomogeneous)
_WRAP_METHOD(void set_transition_duration(guint duration), gtk_stack_set_transition_duration)
_WRAP_METHOD(guint get_transition_duration() const, gtk_stack_get_transition_duration)
_WRAP_METHOD(void set_transition_type(StackTransitionType transition), gtk_stack_set_transition_type)
_WRAP_METHOD(StackTransitionType get_transition_type(), gtk_stack_get_transition_type, deprecated "Use the const method instead.")
_WRAP_METHOD(StackTransitionType get_transition_type() const, gtk_stack_get_transition_type)
_WRAP_METHOD(bool get_transition_running() const, gtk_stack_get_transition_running)
_WRAP_METHOD(Widget* get_child_by_name(const Glib::ustring& name), gtk_stack_get_child_by_name)
_WRAP_METHOD(const Widget* get_child_by_name(const Glib::ustring& name) const, gtk_stack_get_child_by_name, constversion)
_WRAP_METHOD(void set_interpolate_size(bool interpolate_size), gtk_stack_set_interpolate_size, newin "3,20")
_WRAP_METHOD(bool get_interpolate_size() const, gtk_stack_get_interpolate_size, newin "3,20")
_WRAP_PROPERTY("homogeneous", bool)
_WRAP_PROPERTY("hhomogeneous", bool)
_WRAP_PROPERTY("transition-duration", unsigned int)
_WRAP_PROPERTY("transition-running", bool)
_WRAP_PROPERTY("transition-type", StackTransitionType)
_WRAP_PROPERTY("vhomogeneous", bool)
_WRAP_PROPERTY("visible-child", Widget*)
_WRAP_PROPERTY("visible-child-name", Glib::ustring)
_WRAP_PROPERTY("interpolate-size", bool, newin "3,20")
_WRAP_CHILD_PROPERTY("name", Glib::ustring)
_WRAP_CHILD_PROPERTY("title", Glib::ustring)
_WRAP_CHILD_PROPERTY("icon-name", Glib::ustring)
_WRAP_CHILD_PROPERTY("position", int)
_WRAP_CHILD_PROPERTY("needs-attention", bool)
// There are no signals or vfuncs.
};
} //namespace Gtk