/* $Id: iconset.hg,v 1.3 2006/07/30 20:49:50 murrayc Exp $ */

/* iconset.h
 *
 * Copyright(C) 1998-2002 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

//#include <gtkmm/style.h>
#include <gdkmm/pixbuf.h>
#include <gtkmm/iconsource.h>
//#include <gtkmm/widget.h>
#include <gtkmm/stockid.h>
#include <glibmm/arrayhandle.h>

_DEFS(gtkmm,gtk)

namespace Gtk
{

class Style;
class Widget;

//TODO_API: Is _CLASS_BOXEDTYPE the appropriate thing to use here.
//This seems to be reference-counted, not copied.

// TODO: Documentation, thought the C API has no documentation for this either.
// See http://bugzilla.gnome.org/show_bug.cgi?id=575537
class IconSet
{
  _CLASS_BOXEDTYPE(IconSet, GtkIconSet, gtk_icon_set_new, gtk_icon_set_ref, gtk_icon_set_unref)
  _IGNORE(gtk_icon_set_ref, gtk_icon_set_unref, gtk_icon_set_get_sizes)
public:
  explicit IconSet(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);

  _WRAP_METHOD(IconSet copy() const, gtk_icon_set_copy)

  //Note that we use Gtk::StateType here instead of StateType, because there is an Atk::StateType too, and doxygen gets confused.
  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> render_icon(const Glib::RefPtr<Style>& style, TextDirection direction,
                                          Gtk::StateType state, IconSize size,
                                          Widget& widget, const Glib::ustring& detail), gtk_icon_set_render_icon)

  _WRAP_METHOD(void add_source(const IconSource& source), gtk_icon_set_add_source)

  Glib::ArrayHandle<IconSize> get_sizes() const;

  /** Looks for an icon in the list of default icon factories.
   * @param stock_id StockID to search for
   *
   * For display to the user, you should use Style::lookup_icon_set() on the Style 
   * for the widget that will display the icon, instead of using this function directly, 
   * so that themes are taken into account
   *
   * @returns an IconSet
   */
  static IconSet lookup_default(const Gtk::StockID& stock_id);
};

} /* namespace Gtk */


