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

#include <gtkmm/enums.h>
#include <vector>

_DEFS(gtkmm,gtk)


namespace Gtk
{

//TODO: Add all of the C documentation, including translating the code examples to C++.
/** This represents a widget hierarchy from the topmost widget, typically a toplevel, to any child.
 * This widget path abstraction is used in StyleContext on behalf of the real
 * widget in order to query style information.
 *
 * If you are using gtkmm widgets, you probably will not need to use
 * this API directly, as there is Widget::get_path(), and the style
 * context returned by Widget::get_style_context() will be automatically
 * updated on widget hierarchy changes.
 *
 * @newin{3,0}
 */
class GTKMM_API WidgetPath
{
  _CLASS_BOXEDTYPE(WidgetPath, GtkWidgetPath, gtk_widget_path_new, gtk_widget_path_copy, gtk_widget_path_free, , , GTKMM_API)
  _IGNORE(gtk_widget_path_new, gtk_widget_path_copy, gtk_widget_path_free)
public:

  _WRAP_METHOD(Glib::ustring to_string() const, gtk_widget_path_to_string)
  _WRAP_METHOD(int path_length() const, gtk_widget_path_length)

  _WRAP_METHOD(int path_append_type(GType type), gtk_widget_path_append_type)
  _WRAP_METHOD(void prepend_type(GType type), gtk_widget_path_prepend_type)

  _WRAP_METHOD(GType iter_get_object_type(int pos) const, gtk_widget_path_iter_get_object_type)
  _WRAP_METHOD(void iter_set_object_type(int pos, GType type), gtk_widget_path_iter_set_object_type)

  _WRAP_METHOD(Glib::ustring iter_get_name(int pos) const, gtk_widget_path_iter_get_name)
  _WRAP_METHOD(void iter_set_name(int pos, const Glib::ustring& name), gtk_widget_path_iter_set_name)
  _WRAP_METHOD(bool iter_has_name(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_name)
  //TODO: _WRAP_METHOD(bool iter_has_qname(int pos, GQuark qname) const, gtk_widget_path_iter_has_qname)


  _WRAP_METHOD(WidgetPath iter_get_siblings(int pos = -1) const, gtk_widget_path_iter_get_siblings)
  _WRAP_METHOD(guint get_sibling_index(int pos = -1), gtk_widget_path_iter_get_sibling_index)

  _WRAP_METHOD(void iter_add_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_add_class)
  _WRAP_METHOD(void iter_remove_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_class)
  _WRAP_METHOD(void iter_clear_classes(int pos = -1), gtk_widget_path_iter_clear_classes)

#m4 _CONVERSION(`GSList*',`std::vector<Glib::ustring>',`Glib::SListHandler<Glib::ustring>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector<Glib::ustring> iter_list_classes(int pos = -1) const, gtk_widget_path_iter_list_classes)

  _WRAP_METHOD(bool iter_has_class(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_class)
  //TODOL_WRAP_METHOD(bool iter_has_qclass(int pos, GQuark qname) const, gtk_widget_path_iter_has_qclass)

  _WRAP_METHOD(void iter_add_region(int pos, const Glib::ustring& name,  RegionFlags flags), gtk_widget_path_iter_add_region, deprecated "The use of regions is deprecated.")
  _WRAP_METHOD(void iter_remove_region(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_region, deprecated "The use of regions is deprecated.")
  _WRAP_METHOD(void iter_clear_regions(int pos = -1), gtk_widget_path_iter_clear_regions, deprecated "The use of regions is deprecated.")

  _WRAP_METHOD(std::vector<Glib::ustring> iter_list_regions(int pos = -1) const, gtk_widget_path_iter_list_regions, deprecated "The use of regions is deprecated.")

  _WRAP_METHOD(bool iter_has_region(int pos, const Glib::ustring& name, RegionFlags& flags) const, gtk_widget_path_iter_has_region, deprecated "The use of regions is deprecated.")
  _IGNORE(gtk_widget_path_iter_has_qregion) //deprecated

  _WRAP_METHOD(GType get_object_type() const,  gtk_widget_path_get_object_type)

  _WRAP_METHOD(bool is_type(GType type) const, gtk_widget_path_is_type)
  _WRAP_METHOD(bool has_parent(GType type) const, gtk_widget_path_has_parent)

};

} //namespace Gtk
