/* Copyright (C) 2020 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/widget.h>
#include <gtkmm/enums.h>

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

namespace Gtk
{

/** A widget displaying window buttons.
 *
 * %Gtk::WindowControls shows window frame controls, such as minimize, maximize
 * and close buttons, and the window icon.
 *
 * %Gtk::WindowControls only displays start or end side of the controls (see
 * property_side()), so it's intended to be always used in pair with
 * another %Gtk::WindowControls using the opposite side, for example:
 *
 * @code
 * <object class="GtkBox">
 *   <child>
 *     <object class="GtkWindowControls">
 *       <property name="side">start</property>
 *     </object>
 *   </child>
 *
 *   ...
 *
 *   <child>
 *     <object class="GtkWindowControls">
 *       <property name="side">end</property>
 *     </object>
 *   </child>
 * </object>
 * @endcode
 *
 * @see Gtk::HeaderBar
 *
 * @ingroup Widgets
 * @newin{3,98}
 */
class GTKMM_API WindowControls : public Widget
{
  _CLASS_GTKOBJECT(WindowControls, GtkWindowControls, GTK_WINDOW_CONTROLS, Gtk::Widget, GtkWidget, , , GTKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GtkWindowControls is a final type
  _ABI_AS_WITH_DERIVED_GTYPE dnl// Remove when we can break ABI
  _STRUCT_NOT_HIDDEN

public:
  /** Create a new %WindowControls widget.
   */
  _WRAP_CTOR(WindowControls(PackType side), gtk_window_controls_new)

  _WRAP_METHOD(void set_side(PackType side), gtk_window_controls_set_side)
  _WRAP_METHOD(PackType get_side() const, gtk_window_controls_get_side)

  /** Sets the decoration layout for the title buttons, overriding
   * the Gtk::Settings::property_gtk_decoration_layout() setting.
   *
   * The format of the string is button names, separated by commas.
   * A colon separates the buttons that should appear on the left
   * from those on the right. Recognized button names are minimize,
   * maximize, close and icon (the window icon).
   *
   * For example, “icon:minimize,maximize,close” specifies an icon
   * on the left, and minimize, maximize and close buttons on the right.
   *
   * If the property_side() value is @a Gtk::PackType::START, this %WindowControls
   * will display the part before the colon, otherwise after that.
   *
   * To unset the layout, call unset_decoration_layout().
   *
   * @param layout A decoration layout.
   */
  _WRAP_METHOD(void set_decoration_layout(const Glib::ustring& layout), gtk_window_controls_set_decoration_layout)

  /** Unset the decoration layout.
   * See set_decoration_layout().
   */
  void unset_decoration_layout();

  _WRAP_METHOD(Glib::ustring get_decoration_layout() const, gtk_window_controls_get_decoration_layout)

  _WRAP_METHOD(bool get_use_native_controls() const, gtk_window_controls_get_use_native_controls)
  _WRAP_METHOD(void set_use_native_controls(bool setting = true), gtk_window_controls_set_use_native_controls)

  _WRAP_METHOD(bool get_empty() const, gtk_window_controls_get_empty)

  _WRAP_PROPERTY("side", PackType)
  _WRAP_PROPERTY("decoration-layout", Glib::ustring)
  _WRAP_PROPERTY("use-native-controls", bool)
  _WRAP_PROPERTY("empty", bool)

  // Gtk::WindowControls has no signals nor vfuncs.
};

} // namespace Gtk
