/* Copyright (C) 2010 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/combobox.h>

_PINCLUDE(gtkmm/private/combobox_p.h)

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

namespace Gtk
{

/** This is a simple variant of ComboBox that hides the model-view complexity for simple text-only use cases.
 * You can add items to a ComboBoxText with append(), insert() or prepend() and remove items with remove_text().
 *
 * If the ComboBoxText contains an entry (via the 'has_entry' property), its contents can be retrieved using
 * get_active_text(). The entry itself can be accessed by calling ComboBox::get_entry() or ComboBox::get_entry_text().
 *
 * You should not call set_model() or attempt to pack more cells into this combo box via its CellLayout base class.
 *
 * @ingroup Widgets
 * @deprecated 4.10: Use Gtk::DropDown with a Gtk::StringList instead.
 */
class GTKMM_API ComboBoxText
: public ComboBox
{
  _CLASS_GTKOBJECT(ComboBoxText, GtkComboBoxText, GTK_COMBO_BOX_TEXT, ComboBox, GtkComboBox, , , GTKMM_API)
public:

  /** Creates a new empty ComboBoxText, optionally with an entry.
   * @param has_entry If this is true then this will have an Entry widget.
   */
  explicit ComboBoxText(bool has_entry = false);
  _IGNORE(gtk_combo_box_text_new_with_entry)

  _WRAP_METHOD(void append(const Glib::ustring& text), gtk_combo_box_text_append_text)
  _WRAP_METHOD(void append(const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_append)
  _WRAP_METHOD(void insert(int position, const Glib::ustring& text), gtk_combo_box_text_insert_text)
  _WRAP_METHOD(void insert(int position, const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_insert)
  _WRAP_METHOD(void prepend(const Glib::ustring& text), gtk_combo_box_text_prepend_text)
  _WRAP_METHOD(void prepend(const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_prepend)

  _WRAP_METHOD(void remove_text(int position), gtk_combo_box_text_remove)
  _WRAP_METHOD(Glib::ustring get_active_text() const, gtk_combo_box_text_get_active_text)

  _WRAP_METHOD(void remove_all(), gtk_combo_box_text_remove_all)

  /** Sets the active item of the combo box.
   *
   * If @a text is one of the strings in the combo box, set that item as active,
   * else set no item as active.
   */
  void set_active_text(const Glib::ustring& text);
};

} // namespace Gtk
