summaryrefslogtreecommitdiff
path: root/gio/src/icon.hg
blob: b6d78e6790b907d4bce6a68188f1c501f35613cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// -*- 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 <glibmm/interface.h>

_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
  static Glib::RefPtr<Icon> create(const std::string& str);
  _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<Icon>& 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