/* Copyright (C) 1998-2002 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
{

/** Create widgets with a discrete toggle button.
 *
 * A %Gtk::CheckButton places a label next to an indicator.
 *
 * The CheckButton widget looks like this:
 * @image html checkbutton1.png
 *
 * @see Button, ToggleButton
 * @ingroup Widgets
 */
class GTKMM_API CheckButton : public Widget, public Actionable
{
  _CLASS_GTKOBJECT(CheckButton, GtkCheckButton, GTK_CHECK_BUTTON, Gtk::Widget, GtkWidget,,,GTKMM_API)
  _IMPLEMENTS_INTERFACE(Actionable)
public:

  /** Create an empty check button.
   *
   * If you wish to add a Gtk::Label, you may want to use the
   * Gtk::CheckButton(const Glib::ustring& label, bool mnemonic)
   * constructor directly instead.
   */
  _CTOR_DEFAULT

  /** Create a check button with a label.
   */
  explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);

  _WRAP_METHOD(void set_inconsistent(bool inconsistent = true), gtk_check_button_set_inconsistent)
  _WRAP_METHOD(bool get_inconsistent() const, gtk_check_button_get_inconsistent)
  _WRAP_METHOD(void set_active(bool setting = true),gtk_check_button_set_active)
  _WRAP_METHOD(bool get_active() const,gtk_check_button_get_active)
  _WRAP_METHOD(void set_label(const Glib::ustring& label), gtk_check_button_set_label)
  _WRAP_METHOD(Glib::ustring get_label() const, gtk_check_button_get_label)
  _WRAP_METHOD(void set_use_underline(bool setting = true), gtk_check_button_set_use_underline)
  _WRAP_METHOD(bool get_use_underline() const, gtk_check_button_get_use_underline)

  _WRAP_METHOD(void set_child(Widget& child), gtk_check_button_set_child)
  void unset_child();
  _WRAP_METHOD(Widget* get_child(), gtk_check_button_get_child)
  _WRAP_METHOD(const Widget* get_child() const, gtk_check_button_get_child, constversion)

  _WRAP_METHOD(void set_group(CheckButton& group), gtk_check_button_set_group)
  void unset_group();

  _WRAP_SIGNAL(void toggled(), "toggled")
  _IGNORE_SIGNAL("activate")dnl // Action signal

  _WRAP_PROPERTY("active", bool)
  _WRAP_PROPERTY("group", CheckButton*)
  _WRAP_PROPERTY("label", Glib::ustring)
  _WRAP_PROPERTY("inconsistent", bool)
  _WRAP_PROPERTY("use-underline", bool)
  _WRAP_PROPERTY("child", Widget*)
};

} //namespace Gtk
