// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* Copyright (C) 2007 The giomm 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 _DEFS(giomm,gio) _PINCLUDE(glibmm/private/interface_p.h) #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef struct _GIconIface GIconIface; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gio { /** This is a very minimal interface for icons. It provides functions for checking the equality of two icons and hashing of icons. * Glib::Icon does not provide the actual pixmap for the icon as this is out of GIO's scope. However implementations of Icon may contain the name of an * icon (see ThemedIcon), or the path to an icon (see LoadableIcon). * * To obtain a hash of an Icon instance, see hash(). * * To check if two Icon instances are equal, see equal(). * * @newin{2,16} */ class Icon : public Glib::Interface { _CLASS_INTERFACE(Icon, GIcon, G_ICON, GIconIface) public: // We can't just use a _WRAP_CREATE macro here since this is an abstract // interface class, so implement it by hand #ifdef GLIBMM_EXCEPTIONS_ENABLED static Glib::RefPtr create(const std::string& str); #else static Glib::RefPtr create(const std::string& str, std::auto_ptr& error); #endif // GLIBMM_EXCEPTIONS_ENABLED _IGNORE(g_icon_new_for_string) _WRAP_METHOD(guint hash() const, g_icon_hash) _WRAP_METHOD(std::string to_string() const, g_icon_to_string) _IGNORE(g_icon_equal) // TODO: should this, and File's equal(), be virtual, in order to // be available to derived classes? bool equal(const Glib::RefPtr& other) const; //_WRAP_VFUNC(guint hash() const, "hash") // TODO: also kind of related to equal() being virtual or not, // do we need to have equal_vfunc()? Or rather, why would we want // to have it generally... }; } // namespace Gio