/* 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/widget.h>
#include <gtkmm/actionable.h>

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

namespace Gtk
{

/** A "light switch"-style toggle.
 *
 * The Switch widget has two states: on or off. The user can control
 * which state should be active by clicking the empty area, or by dragging the
 * handle.
 *
 * @ingroup Widgets
 * @newin{3,0}
 */
class GTKMM_API Switch
  : public Widget,
    public Actionable
{
  _CLASS_GTKOBJECT(Switch, GtkSwitch, GTK_SWITCH, Gtk::Widget, GtkWidget, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Actionable)
public:

  _CTOR_DEFAULT

  _WRAP_METHOD(void set_active(bool is_active = true), gtk_switch_set_active)
  _WRAP_METHOD(bool get_active() const, gtk_switch_get_active)

  _WRAP_METHOD(void set_state(bool state = true), gtk_switch_set_state)
  _WRAP_METHOD(bool get_state() const, gtk_switch_get_state)

  _WRAP_PROPERTY("active", bool)
  _WRAP_PROPERTY("state", bool)

  //activate is an action signal that's documented as not for use by applications.
  _IGNORE_SIGNAL("activate")

  // no_default_handler because GtkSwitchClass is private.
  _WRAP_SIGNAL(bool state_set(bool state), "state-set", no_default_handler)
};

} // namespace Gtk
