/* 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, see <https://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/object.h>
#include <gdkmm/paintable.h>
#include <giomm/file.h>
#include <gtk/gtk.h>

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

namespace Gtk
{

//TODO: Derive from (and implement) SymbolicPaintable when we can break ABI.
/** An icon, used with Gtk::IconTheme.
 */
class GTKMM_API IconPaintable : public Glib::Object, public Gdk::Paintable
{
  _CLASS_GOBJECT(IconPaintable, GtkIconPaintable, GTK_ICON_PAINTABLE, Glib::Object, GObject, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Gdk::Paintable)
  _DO_NOT_DERIVE_GTYPE dnl// GtkIconPaintable is a final type
  _ABI_AS_WITH_DERIVED_GTYPE dnl// Remove when we can break ABI
  _STRUCT_NOT_HIDDEN

public:
  // gtk_icon_paintable_new_for_file() does more than call g_object_new().
  _WRAP_METHOD(static Glib::RefPtr<IconPaintable> create(const Glib::RefPtr<Gio::File>& file,
    int size, int scale = 1), gtk_icon_paintable_new_for_file)

  // The const get_file() can return a non-const Gio::File.
  // gtk_icon_paintable_get_file() returns a newly created GFile.
  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_file() const, gtk_icon_paintable_get_file)
  _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_icon_paintable_get_icon_name,
    deprecated "4.20: There is no replacement.")
  _WRAP_METHOD(bool is_symbolic() const, gtk_icon_paintable_is_symbolic,
    deprecated "4.20: There is no replacement.")

  _WRAP_PROPERTY("file", Glib::RefPtr<Gio::File>)
  _WRAP_PROPERTY("icon-name", Glib::ustring, deprecated "4.20: There is no replacement.")
  _WRAP_PROPERTY("is-symbolic", bool, deprecated "4.20: There is no replacement.")
};

} // namespace Gtk
