/* 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 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 <vector>

#include <gtkmm/stylecontext.h>
#include <gdkmm/rectangle.h>
#include <gdkmm/pixbuf.h>
#include <gdkmm/rgba.h>
#include <gdkmm/types.h>
#include <giomm/asyncresult.h>
#include <giomm/cancellable.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{
class Texture;
}

namespace Gtk
{

class IconTheme;

class IconInfo : public Glib::Object
{
  _CLASS_GOBJECT(IconInfo, GtkIconInfo, GTK_ICON_INFO, Glib::Object, GObject)

protected:
  // Can't use _WRAP_CTOR(), because there are no properties that correspond
  // to the constructor's parameters.
  IconInfo(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
  _IGNORE(gtk_icon_info_new_for_pixbuf)

public:
  /** Creates an %IconInfo for a Gdk::Pixbuf.
   *
   * @newin{3,92}
   *
   * @param icon_theme A Gtk::IconTheme.
   * @param pixbuf The pixbuf to wrap in an %IconInfo.
   * @return A RefPtr to a new %IconInfo.
   */
  _WRAP_CREATE(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)

  _WRAP_METHOD(int get_base_size() const, gtk_icon_info_get_base_size)
  _WRAP_METHOD(int get_base_scale() const, gtk_icon_info_get_base_scale)

  _WRAP_METHOD(Glib::ustring get_filename() const, gtk_icon_info_get_filename)
  _WRAP_METHOD(bool is_symbolic() const, gtk_icon_info_is_symbolic)

  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_icon() const, gtk_icon_info_load_icon, errthrow)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> load_texture() const, gtk_icon_info_load_texture)

  _WRAP_METHOD(void load_icon_async(const Gio::SlotAsyncReady& slot{callback}, const Glib::RefPtr<Gio::Cancellable>& cancellable{.?}) const,
    gtk_icon_info_load_icon_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_icon_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const,
    gtk_icon_info_load_icon_finish, errthrow)


  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color,
    const Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic{>>}) const,
    gtk_icon_info_load_symbolic, errthrow)

  // In gtk_icon_info_load_symbolic_async(), each GdkRGBA* can be NULL, but we do not want that many method overloads.
  _WRAP_METHOD(void load_symbolic_async(const Gdk::RGBA& fg, const Gdk::RGBA& success_color,
    const Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, const Gio::SlotAsyncReady& slot{callback},
    const Glib::RefPtr<Gio::Cancellable>& cancellable{.?}) const,
    gtk_icon_info_load_symbolic_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_symbolic_finish(const Glib::RefPtr<Gio::AsyncResult>& result,
    bool& was_symbolic{>>}) const, gtk_icon_info_load_symbolic_finish, errthrow)


  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_symbolic_for_context(const Glib::RefPtr<StyleContext>& context,
    bool& was_symbolic{>>}) const, gtk_icon_info_load_symbolic_for_context, errthrow)

  _WRAP_METHOD(void load_symbolic_for_context_async(const Glib::RefPtr<StyleContext>& context,
    const Gio::SlotAsyncReady& slot{callback}, const Glib::RefPtr<Gio::Cancellable>& cancellable{.?}) const,
    gtk_icon_info_load_symbolic_for_context_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
 _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_symbolic_for_context_finish(const Glib::RefPtr<Gio::AsyncResult>& result,
   bool& was_symbolic{>>}) const, gtk_icon_info_load_symbolic_for_context_finish, errthrow)
};

} // namespace Gtk
