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

_DEFS(gtkmm,gtk)
_CONFIGINCLUDE(gtkmmconfig.h)
_IS_DEPRECATED // The entire file is deprecated.

#include <gtkmm/cellrenderer.h>

_PINCLUDE(gtkmm/private/cellrenderer_p.h)

#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
#undef GTK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#m4 _POP()

namespace Gtk
{

/** Renders a toggle button in a cell.
 * The button is drawn as a radio- or checkbutton, depending on the radio property. When activated, it
 * emits the toggled signal.
 *
 * @ingroup TreeView
 * @deprecated 4.10: List views use widgets to display their contents.
 *   You should use Gtk::ToggleButton instead.
 */
class GTKMM_API CellRendererToggle : public CellRenderer
{
  _CLASS_GTKOBJECT(CellRendererToggle,GtkCellRendererToggle,GTK_CELL_RENDERER_TOGGLE,Gtk::CellRenderer,GtkCellRenderer, , , GTKMM_API)
public:

  _CTOR_DEFAULT

  _WRAP_METHOD(bool get_radio() const, gtk_cell_renderer_toggle_get_radio)
  _WRAP_METHOD(void set_radio(bool radio = true), gtk_cell_renderer_toggle_set_radio)
  _WRAP_METHOD(bool get_active() const, gtk_cell_renderer_toggle_get_active)
  _WRAP_METHOD(void set_active(bool setting = true), gtk_cell_renderer_toggle_set_active)
  _WRAP_METHOD(bool get_activatable() const, gtk_cell_renderer_toggle_get_activatable)
  _WRAP_METHOD(void set_activatable(bool setting = true), gtk_cell_renderer_toggle_set_activatable)

#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
  // no_default_handler because GtkCellRendererToggleClass is private.
  _WRAP_SIGNAL(void toggled(const Glib::ustring& path), "toggled", no_default_handler)

  _WRAP_PROPERTY("activatable", bool)
  _WRAP_PROPERTY("active", bool)
  _WRAP_PROPERTY("inconsistent", bool)
  _WRAP_PROPERTY("radio", bool)

  Glib::PropertyProxy_Base _property_renderable() override;
};

} //namespace Gtk
