/* 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 . */ #include #include _DEFS(gtkmm,gtk) _PINCLUDE(gtkmm/private/widget_p.h) namespace Gtk { //TODO: Derive from (and implement) Actionable when we can break ABI. /** 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 Activatable { _CLASS_GTKOBJECT(Switch, GtkSwitch, GTK_SWITCH, Gtk::Widget, GtkWidget, , , GTKMM_API) _IMPLEMENTS_INTERFACE(Activatable) 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") _WRAP_SIGNAL(bool state_set(bool state), "state-set") }; } // namespace Gtk