/* 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, see <https://www.gnu.org/licenses/>.
 */

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

#include <gtkmm/cellrenderertext.h>
#include <gtkmm/accelkey.h>

_PINCLUDE(gtkmm/private/cellrenderertext_p.h)

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

namespace Gtk
{

/**
 * 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.
 *
 * Key values are the codes which are sent whenever a key is pressed or released.
 * The complete list of key values can be found in the
 * <a href="https://gitlab.gnome.org/GNOME/gtk/tree/main/gdk/gdkkeysyms.h">gdk/gdkkeysyms.h</a>
 * header file. They are prefixed with <tt>GDK_KEY_</tt>.
 *
 * @ingroup TreeView
 * @deprecated 4.10: Applications editing keyboard accelerators should
 *   provide their own implementation according to platform design guidelines.
 */
class GTKMM_API CellRendererAccel : public CellRendererText
{
  _CLASS_GTKOBJECT(CellRendererAccel, GtkCellRendererAccel, GTK_CELL_RENDERER_ACCEL, Gtk::CellRendererText, GtkCellRendererText, , , GTKMM_API)
public:

  _WRAP_ENUM(Mode, GtkCellRendererAccelMode, decl_prefix GTKMM_API)

  _CTOR_DEFAULT

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

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

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

  Glib::PropertyProxy_Base _property_renderable() override;
};

} //namespace Gtk
