/* Copyright (C) 2020 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 <http://www.gnu.org/licenses/>.
 */

#include <gtkmm/editable.h>
#include <gtkmm/widget.h>

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

namespace Gtk
{

/** A label that can be edited.
 *
 * A %Gtk::EditableLabel is a Gtk::Label that allows users to
 * edit the text by switching the widget to an “edit mode”.
 *
 * %Gtk::EditableLabel does not have API of its own, but it
 * implements the Gtk::Editable interface.
 *
 * The default bindings for activating the edit mode is
 * to click or press the Enter key. The default bindings
 * for leaving the edit mode are the Enter key (to save
 * the results) or the Escape key (to cancel the editing).
 *
 * @see Editable, Label, Entry
 *
 * @ingroup Widgets
 *
 * @newin{3,98}
 */
class GTKMM_API EditableLabel : public Widget, public Editable
{
  _CLASS_GTKOBJECT(EditableLabel, GtkEditableLabel, GTK_EDITABLE_LABEL, Gtk::Widget, GtkWidget, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Editable)
  _STRUCT_NOT_HIDDEN

public:
  _CTOR_DEFAULT
  // The str parameter is renamed to text because that is the property name.
  _WRAP_CTOR(EditableLabel(const Glib::ustring& text), gtk_editable_label_new)

  _WRAP_METHOD(bool get_editing() const, gtk_editable_label_get_editing)
  _WRAP_METHOD(void start_editing(), gtk_editable_label_start_editing)
  _WRAP_METHOD(void stop_editing(bool commit), gtk_editable_label_stop_editing)

  _WRAP_PROPERTY("editing", bool)

  // EditableLabel has no signals nor vfuncs.
};

} //namespace Gtk
