/* $Id: cellrendereraccel.hg,v 1.2 2006/05/11 11:40:24 murrayc Exp $ */

/* cellrendereraccel.h
 * 
 * Copyright (C) 2005 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/cellrenderertext.h>
#include <gtkmm/accelkey.h>

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


namespace Gtk
{

_WRAP_ENUM(CellRendererAccelMode, GtkCellRendererAccelMode)

/**  .
 * Renders a keyboard accelerator in a cell
 *
 * Gtk::CellRendererAccel displays a keyboard accelerator 
 * (i.e. a key combination like <Control>-a).
 * If the cell renderer is editable, the accelerator can be changed by 
 * simply typing the new combination.
 *
 * @ingroup TreeView
 * @newin{2,10}
 */
class CellRendererAccel : public CellRendererText
{
  _CLASS_GTKOBJECT(CellRendererAccel, GtkCellRendererAccel, GTK_CELL_RENDERER_ACCEL, Gtk::CellRendererText, GtkCellRendererText)
public:

  _CTOR_DEFAULT

#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)

  //TODO: Wrap accel_key and accel_mods in an AccelKey?
  _WRAP_SIGNAL(void accel_edited(const Glib::ustring& path_string, guint accel_key, Gdk::ModifierType accel_mods, guint hardware_keycode), "accel_edited")
  _WRAP_SIGNAL(void accel_cleared(const Glib::ustring& path_string), "accel_cleared")

  _WRAP_PROPERTY("accel-key", guint)
  _WRAP_PROPERTY("accel-mods", Gdk::ModifierType)
  _WRAP_PROPERTY("keycode", guint)
  _WRAP_PROPERTY("accel-mode", CellRendererAccelMode)

  virtual Glib::PropertyProxy_Base _property_renderable(); //override
};

} /* namespace Gtk */

