/* Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
 */

#include <gtkmm/popover.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/popover_p.h)

namespace Gtk
{
/** A Popover to use as a menu.
 *
 * PopoverMenu is a subclass of Popover that treats its
 * childen like menus and allows switching between them. It is
 * meant to be used primarily together with ModelButton, but
 * any widget can be used, such as SpinButton or Scale.
 * In this respect, PopoverMenu is more flexible than popovers
 * that are created from a Gio::MenuModel.
 *
 * To add a child as a submenu, set the child_property_submenu()
 * to the name of the submenu. To let the user open
 * this submenu, add a ModelButton whose ModelButton::property_menu_name()
 * is set to the name you've given to the submenu.
 *
 * By convention, the first child of a submenu should be a ModelButton
 * to switch back to the parent menu. Such a button should use
 * ModelButton::property_inverted() and ModelButton::property_centered()
 * to achieve a title-like appearance and place the submenu indicator
 * at the opposite side. To switch back to the main menu, use "main"
 * as the menu name.
 *
 * @newin{3,18}
 *
 * @ingroup Widgets
 * @ingroup Containers
 * @ingroup Menus
 */
class PopoverMenu : public Popover
{
  _CLASS_GTKOBJECT(PopoverMenu, GtkPopoverMenu, GTK_POPOVER_MENU, Gtk::Popover, GtkPopover)

public:
  _CTOR_DEFAULT

  _WRAP_METHOD(void open_submenu(const Glib::ustring& name), gtk_popover_menu_open_submenu)

  _WRAP_PROPERTY("visible-submenu", Glib::ustring)

  _WRAP_CHILD_PROPERTY("submenu", Glib::ustring)
  _WRAP_CHILD_PROPERTY("position", int)

  // PopoverMenu has no signals nor vfuncs.
};

} //namespace Gtk
