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

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

namespace Gtk
{

/** Layout manager for grid-like widgets.
 *
 * %Gtk::GridLayout is a layout manager which arranges child widgets in
 * rows and columns, with arbitrary positions and horizontal/vertical spans.
 *
 * Children have an "attach point" defined by the horizontal and vertical
 * index of the cell they occupy; children can span multiple rows or columns.
 * The layout properties for setting the attach points and spans are set
 * using the Gtk::GridLayoutChild associated to each child widget.
 *
 * The behaviour of Gtk::Grid when several children occupy the same grid cell
 * is undefined.
 *
 * %Gtk::GridLayout can be used like a Gtk::BoxLayout if all children are attached
 * to the same row or column; however, if you only ever need a single row or
 * column, you should consider using Gtk::BoxLayout.
 *
 * @newin{3,96}
 */
class GTKMM_API GridLayout : public LayoutManager
{
  _CLASS_GOBJECT(GridLayout, GtkGridLayout, GTK_GRID_LAYOUT, LayoutManager, GtkLayoutManager, , , GTKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GtkGridLayout is a final type
  _ABI_AS_WITH_DERIVED_GTYPE dnl// Remove when we can break ABI
  _STRUCT_NOT_HIDDEN

protected:
  _CTOR_DEFAULT

public:
  _WRAP_CREATE()

  _WRAP_METHOD(void set_row_homogeneous(bool homogeneous = true), gtk_grid_layout_set_row_homogeneous)
  _WRAP_METHOD(bool get_row_homogeneous() const, gtk_grid_layout_get_row_homogeneous)
  _WRAP_METHOD(void set_row_spacing(guint spacing), gtk_grid_layout_set_row_spacing)
  _WRAP_METHOD(guint get_row_spacing() const, gtk_grid_layout_get_row_spacing)
  _WRAP_METHOD(void set_column_homogeneous(bool homogeneous = true), gtk_grid_layout_set_column_homogeneous)
  _WRAP_METHOD(bool get_column_homogeneous() const, gtk_grid_layout_get_column_homogeneous)
  _WRAP_METHOD(void set_column_spacing(guint spacing), gtk_grid_layout_set_column_spacing)
  _WRAP_METHOD(guint get_column_spacing() const, gtk_grid_layout_get_column_spacing)
  _WRAP_METHOD(void set_row_baseline_position(int row, BaselinePosition pos), gtk_grid_layout_set_row_baseline_position)
  _WRAP_METHOD(BaselinePosition get_row_baseline_position(int row) const, gtk_grid_layout_get_row_baseline_position)
  _WRAP_METHOD(void set_baseline_row(int row), gtk_grid_layout_set_baseline_row)
  _WRAP_METHOD(int get_baseline_row() const, gtk_grid_layout_get_baseline_row)

  _WRAP_PROPERTY("row-spacing", int)
  _WRAP_PROPERTY("column-spacing", int)
  _WRAP_PROPERTY("row-homogeneous", bool)
  _WRAP_PROPERTY("column-homogeneous", bool)
  _WRAP_PROPERTY("baseline-row", int)

  // There are no signals or vfuncs.
};

} // namespace Gtk
