/* 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/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/object.h>
#include <glibmm/refptr.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gtk
{
class GTKMM_API LayoutManager;
class GTKMM_API Widget;

/** An object containing layout properties.
 *
 * %Gtk::LayoutChild is the base class for objects that are meant to hold
 * layout properties. If a Gtk::LayoutManager has per-child properties,
 * like their packing type, or the horizontal and vertical span, or the
 * icon name, then the layout manager should use a %Gtk::LayoutChild
 * implementation to store those properties.
 *
 * A %Gtk::LayoutChild instance is only ever valid while a widget is part
 * of a layout.
 *
 * @newin{3,96}
 */
class GTKMM_API LayoutChild : public Glib::Object
{
  _CLASS_GOBJECT(LayoutChild, GtkLayoutChild, GTK_LAYOUT_CHILD, Glib::Object, GObject, , , GTKMM_API)

protected:
  /** There is no create() method that corresponds to this constructor,
   * because only derived classes shall be created.
   */
  _CTOR_DEFAULT

public:
  // No create() because only derived classes shall be instantiated.

  _WRAP_METHOD(Glib::RefPtr<LayoutManager> get_layout_manager(),
    gtk_layout_child_get_layout_manager, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const LayoutManager> get_layout_manager() const,
    gtk_layout_child_get_layout_manager, refreturn, constversion)

  _WRAP_METHOD(Widget* get_child_widget(), gtk_layout_child_get_child_widget)
  _WRAP_METHOD(const Widget* get_child_widget() const, gtk_layout_child_get_child_widget, constversion)

  _WRAP_PROPERTY("layout-manager", Glib::RefPtr<LayoutManager>)
  _WRAP_PROPERTY("child-widget", Widget*)

  // There are no signals or vfuncs.
};

} // namespace Gtk
