/* Copyright (C) 2003 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gdkmm/pixbuf.h>
#include <gdkmm/screen.h>

#include <gtkmm/iconinfo.h>
 
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)


namespace Gtk
{

_WRAP_ENUM(IconLookupFlags, GtkIconLookupFlags, NO_GTYPE)

/** Exception class for Gdk::IconTheme errors.
 */
_WRAP_GERROR(IconThemeError,GtkIconThemeError,GTK_ICON_THEME_ERROR)
  
class IconTheme : public Glib::Object
{
  _CLASS_GOBJECT(IconTheme, GtkIconTheme, GTK_ICON_THEME, Glib::Object, GObject)
  _IGNORE(gtk_icon_theme_set_search_path, gtk_icon_theme_get_search_path)

protected:
  _CTOR_DEFAULT()
public:
  _WRAP_CREATE()
  _WRAP_METHOD(static Glib::RefPtr<IconTheme> get_default(), gtk_icon_theme_get_default, refreturn)
  _WRAP_METHOD(static Glib::RefPtr<IconTheme> get_for_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_icon_theme_get_for_screen, refreturn)
  _WRAP_METHOD(void set_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_icon_theme_set_screen)
  void set_search_path(const Glib::ArrayHandle<Glib::ustring>& path);
  Glib::ArrayHandle<Glib::ustring> get_search_path() const;
  _WRAP_METHOD(void append_search_path(const Glib::ustring& path), gtk_icon_theme_append_search_path)
  _WRAP_METHOD(void prepend_search_path(const Glib::ustring& path), gtk_icon_theme_prepend_search_path)
  _WRAP_METHOD(void set_custom_theme(const Glib::ustring& theme_name), gtk_icon_theme_set_custom_theme)
  _WRAP_METHOD(bool has_icon(const Glib::ustring& icon_name) const, gtk_icon_theme_has_icon)

  Glib::ArrayHandle<int> get_icon_sizes(const Glib::ustring& icon_name) const;
  _IGNORE(gtk_icon_theme_get_icon_sizes)

  _WRAP_METHOD(IconInfo lookup_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags) const, gtk_icon_theme_lookup_icon)

  #m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar*[]',`const_cast<const gchar**>(($3).data())')
  _WRAP_METHOD(IconInfo choose_icon(const Glib::StringArrayHandle& icon_names, int size, IconLookupFlags flags), gtk_icon_theme_choose_icon)

  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_icon(const Glib::ustring& icon_name, int size, IconLookupFlags flags) const, gtk_icon_theme_load_icon, errthrow)

  _WRAP_METHOD(Glib::ListHandle<Glib::ustring> list_icons(const Glib::ustring& context) const, gtk_icon_theme_list_icons)

  /** Lists the icons in the current icon theme.
   *
   * @return A list holding the names of all the
   * icons in the theme.
   * 
   * @newin2p10.
   */
   Glib::ListHandle<Glib::ustring> list_icons() const;

  _WRAP_METHOD(Glib::ListHandle<Glib::ustring> list_contexts() const, gtk_icon_theme_list_contexts)

  _WRAP_METHOD(Glib::ustring get_example_icon_name() const, gtk_icon_theme_get_example_icon_name)
  _WRAP_METHOD(bool rescan_if_needed(), gtk_icon_theme_rescan_if_needed)
  _WRAP_METHOD(static void add_builtin_icon(const Glib::ustring& icon_name, int size, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_icon_theme_add_builtin_icon)

  _WRAP_SIGNAL(void changed(), "changed")
};

} // namespace Gtk

