/* $Id: cellrenderertoggle.hg,v 1.5 2006/05/10 20:59:27 murrayc Exp $ */

/* cellrenderertoggle.h
 * 
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtkmm/cellrenderer.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/cellrenderer_p.h)


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
 */
class CellRendererToggle : public CellRenderer
{
  _CLASS_GTKOBJECT(CellRendererToggle,GtkCellRendererToggle,GTK_CELL_RENDERER_TOGGLE,Gtk::CellRenderer,GtkCellRenderer)
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)
   //TODO: Maybe the parameter should be a TreePath.
  /** The toggled signal is emitted when the cell is toggled.
   *
   * @param path string representation of TreePath describing the event location
   */
  _WRAP_SIGNAL(void toggled(const Glib::ustring& path), "toggled")

  _WRAP_PROPERTY("activatable", bool)
  _WRAP_PROPERTY("active", bool)
  _WRAP_PROPERTY("inconsistent", bool)
  _WRAP_PROPERTY("radio", bool)
  _WRAP_PROPERTY("indicator-size", int)

  virtual Glib::PropertyProxy_Base _property_renderable();
};

} /* namespace Gtk */

