/* Copyright (C) 1998-2002 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

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

#include <gtkmm/widget.h>
#include <gtkmm/orientable.h>

namespace Gtk
{

/** A container for packing widgets in a single row or column.
 *
 * The %Gtk::Box widget arranges child widgets into a single row or column,
 * depending upon the value of its Gtk::Orientable::property_orientation() property.
 * Within the other dimension, all children are allocated the same size. Of course,
 * Gtk::Widget::set_halign() and Gtk::Widget::set_valign() can be used on
 * the children to influence their allocation.
 *
 * Use repeated calls to append() to pack widgets into a %Gtk::Box
 * from start to end. Use remove() to remove widgets from the %Gtk::Box.
 * insert_child_after() can be used to add a child at a particular position.
 *
 * Use set_homogeneous() to specify whether or not all children
 * of the %Gtk::Box are forced to get the same amount of space.
 *
 * Use set_spacing() to determine how much space will be
 * minimally placed between all children in the %Gtk::Box. Note that
 * spacing is added between the children.
 *
 * Use reorder_child_after() and reorder_child_at_start() to move a child to
 * a different place in the box.
 */
class GTKMM_API Box
  : public Widget,
    public Orientable
{
  _CLASS_GTKOBJECT(Box, GtkBox, GTK_BOX, Gtk::Widget, GtkWidget, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Orientable)
public:

  //Note that we try to use the same default parameter value as the default property value.
  /** Creates a new box.
   * @param orientation The box's orientation.
   * @param spacing Determines the space in pixels between child widgets.
   */
  _WRAP_CTOR(Box(Orientation orientation = Orientation::HORIZONTAL, int spacing = 0), gtk_box_new)

  _WRAP_METHOD(void set_homogeneous(bool homogeneous = true), gtk_box_set_homogeneous)
  _WRAP_METHOD(bool get_homogeneous() const, gtk_box_get_homogeneous)

  _WRAP_METHOD(void set_spacing(int spacing), gtk_box_set_spacing)
  _WRAP_METHOD(int get_spacing() const, gtk_box_get_spacing)

  _WRAP_METHOD(void set_baseline_position(BaselinePosition position), gtk_box_set_baseline_position)
  _WRAP_METHOD(BaselinePosition get_baseline_position() const, gtk_box_get_baseline_position)

  _WRAP_METHOD(void set_baseline_child(int child), gtk_box_set_baseline_child)
  _WRAP_METHOD(int get_baseline_child() const, gtk_box_get_baseline_child)

  _WRAP_METHOD(void append(Gtk::Widget& child), gtk_box_append)
  _WRAP_METHOD(void prepend(Gtk::Widget& child), gtk_box_prepend)
  _WRAP_METHOD(void remove(Gtk::Widget& child), gtk_box_remove)

  /** Inserts @a child in the position after @a sibling in the list of children.
   *
   * @param child The Gtk::Widget to insert.
   * @param sibling The sibling to move @a child after.
   */
  _WRAP_METHOD(void insert_child_after(Widget& child, const Widget& sibling), gtk_box_insert_child_after)

  /** Inserts @a child in the first position in the list of children.
   *
   * @param child The Gtk::Widget to insert.
   */
  void insert_child_at_start(Widget& child);

  /** Moves @a child to the position after @a sibling in the list of children.
   *
   * @param child The Gtk::Widget to move. Must be a child of the %Box.
   * @param sibling The sibling to move @a child after.
   */
  _WRAP_METHOD(void reorder_child_after(Widget& child, const Widget& sibling), gtk_box_reorder_child_after)

  /** Moves @a child to the first position in the list of children.
   *
   * @param child The Gtk::Widget to move. Must be a child of the %Box.
   */
  void reorder_child_at_start(Widget& child);

  _WRAP_PROPERTY("spacing", int)
  _WRAP_PROPERTY("homogeneous", bool)
  _WRAP_PROPERTY("baseline-child", int)
  _WRAP_PROPERTY("baseline-position", BaselinePosition)
};

} // namespace Gtk
