/* Copyright (C) 2010 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 <https://www.gnu.org/licenses/>.
 */

#include <gtkmm/adjustment.h>
#include <gtkmm/border.h>
#include <glibmm/interface.h>
#include <gtkmm/enums.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/interface_p.h)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
typedef struct _GtkScrollableInterface GtkScrollableInterface;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

namespace Gtk
{

/** This interface is implemented by widgets with native
 * scrolling ability.
 *
 * @newin{3,0}
 */
class GTKMM_API Scrollable : public Glib::Interface
{
  _CLASS_INTERFACE(Scrollable, GtkScrollable, GTK_SCROLLABLE, GtkScrollableInterface, , , GTKMM_API)

public:
  _WRAP_ENUM(Policy, GtkScrollablePolicy, decl_prefix GTKMM_API)

  _WRAP_METHOD(Glib::RefPtr<Adjustment> get_hadjustment(), gtk_scrollable_get_hadjustment, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Adjustment> get_hadjustment() const, gtk_scrollable_get_hadjustment, refreturn, constversion)

  _WRAP_METHOD(void set_hadjustment(const Glib::RefPtr<Adjustment>& hadjustment), gtk_scrollable_set_hadjustment)

  /** This method removes the hadjustment.
   * @see set_hadjustment().
   */
  void unset_hadjustment();

  _WRAP_METHOD(Glib::RefPtr<Adjustment> get_vadjustment(), gtk_scrollable_get_vadjustment, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Adjustment> get_vadjustment() const, gtk_scrollable_get_vadjustment, refreturn, constversoin)

  _WRAP_METHOD(void set_vadjustment(const Glib::RefPtr<Adjustment>& vadjustment), gtk_scrollable_set_vadjustment)

  /** This method removes the vadjustment.
   * @see set_vadjustment().
   */
  void unset_vadjustment();

  _WRAP_METHOD(Policy get_hscroll_policy() const, gtk_scrollable_get_hscroll_policy)
  _WRAP_METHOD(void set_hscroll_policy(Policy policy), gtk_scrollable_set_hscroll_policy)
  _WRAP_METHOD(Policy get_vscroll_policy() const, gtk_scrollable_get_vscroll_policy)
  _WRAP_METHOD(void set_vscroll_policy(Policy policy), gtk_scrollable_set_vscroll_policy)
  _WRAP_METHOD(bool get_border(Border& border) const, gtk_scrollable_get_border)

  _WRAP_PROPERTY("hadjustment", Glib::RefPtr<Adjustment>)
  _WRAP_PROPERTY("vadjustment", Glib::RefPtr<Adjustment>)
  _WRAP_PROPERTY("hscroll-policy", Policy)
  _WRAP_PROPERTY("vscroll-policy", Policy)

protected:
  _WRAP_VFUNC(bool get_border(Border& border) const, get_border, custom_vfunc_callback)
};

} // namespace Gtk
