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

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

namespace Gtk
{

/** A centering container.
 *
 * The %CenterBox widget arranges three children in a horizontal
 * or vertical arrangement, keeping the middle child centered as well
 * as possible.
 *
 * To add children to a %CenterBox, use set_start_widget(),
 * set_center_widget() and set_end_widget().
 *
 * The sizing and positioning of children can be influenced with the
 * align and expand properties of the children.
 *
 * In horizontal orientation, the nodes of the children are always arranged
 * from left to right regardless of text direction. In vertical orientation,
 * the nodes of the children are arranged from top to bottom.
 *
 * @newin{3,92}
 *
 * @see Box
 * @ingroup Widgets
 * @ingroup Containers
 */
class GTKMM_API CenterBox : public Widget, public Orientable
{
  _CLASS_GTKOBJECT(CenterBox, GtkCenterBox, GTK_CENTER_BOX, Widget, GtkWidget, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Orientable)

public:
  _CTOR_DEFAULT

  _WRAP_METHOD(void set_start_widget(Widget& child), gtk_center_box_set_start_widget)
  _WRAP_METHOD(Widget* get_start_widget(), gtk_center_box_get_start_widget)
  _WRAP_METHOD(const Widget* get_start_widget() const, gtk_center_box_get_start_widget, constversion)
  /** Removes the start widget.
   * @newin{3,92}
   */
  void unset_start_widget();

  _WRAP_METHOD(void set_center_widget(Widget& child), gtk_center_box_set_center_widget)
  _WRAP_METHOD(Widget* get_center_widget(), gtk_center_box_get_center_widget)
  _WRAP_METHOD(const Widget* get_center_widget() const, gtk_center_box_get_center_widget, constversion)
  /** Removes the center widget.
   * @newin{3,92}
   */
  void unset_center_widget();

  _WRAP_METHOD(void set_end_widget(Widget& child), gtk_center_box_set_end_widget)
  _WRAP_METHOD(Widget* get_end_widget(), gtk_center_box_get_end_widget)
  _WRAP_METHOD(const Widget* get_end_widget() const, gtk_center_box_get_end_widget, constversion)
  /** Removes the end widget.
   * @newin{3,92}
   */
  void unset_end_widget();

  _WRAP_METHOD(void set_baseline_position(BaselinePosition position), gtk_center_box_set_baseline_position)
  _WRAP_METHOD(BaselinePosition get_baseline_position(), gtk_center_box_get_baseline_position)

  _WRAP_METHOD(void set_shrink_center_last(bool shrink_center_last = true), gtk_center_box_set_shrink_center_last)
  _WRAP_METHOD(bool get_shrink_center_last() const, gtk_center_box_get_shrink_center_last)

  _WRAP_PROPERTY("start-widget", Widget*)
  _WRAP_PROPERTY("center-widget", Widget*)
  _WRAP_PROPERTY("end-widget", Widget*)
  _WRAP_PROPERTY("baseline-position", BaselinePosition)
  _WRAP_PROPERTY("shrink-center-last", bool)

  // There are no signals or vfuncs.
};

} // namespace Gtk
