1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GIcon.html
27  * outPack = gio
28  * outFile = IconIF
29  * strct   = GIcon
30  * realStrct=
31  * ctorStrct=
32  * clss    = IconT
33  * interf  = IconIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_icon_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * 	- g_icon_new_for_string
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- glib.ErrorG
49  * 	- glib.GException
50  * 	- glib.Variant
51  * 	- gio.IconIF
52  * 	- gio.Icon
53  * structWrap:
54  * 	- GIcon* -> IconIF
55  * 	- GVariant* -> Variant
56  * module aliases:
57  * local aliases:
58  * overrides:
59  * 	- toString
60  */
61 
62 module gio.IconIF;
63 
64 public  import gtkc.giotypes;
65 
66 private import gtkc.gio;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 private import glib.Str;
71 private import glib.ErrorG;
72 private import glib.GException;
73 private import glib.Variant;
74 private import gio.IconIF;
75 private import gio.Icon;
76 
77 
78 
79 /**
80  * GIcon is a very minimal interface for icons. It provides functions
81  * for checking the equality of two icons, hashing of icons and
82  * serializing an icon to and from strings.
83  *
84  * GIcon does not provide the actual pixmap for the icon as this is out
85  * of GIO's scope, however implementations of GIcon may contain the name
86  * of an icon (see GThemedIcon), or the path to an icon (see GLoadableIcon).
87  *
88  * To obtain a hash of a GIcon, see g_icon_hash().
89  *
90  * To check if two GIcons are equal, see g_icon_equal().
91  *
92  * For serializing a GIcon, use g_icon_serialize() and
93  * g_icon_deserialize().
94  *
95  * If you want to consume GIcon (for example, in a toolkit) you must
96  * be prepared to handle at least the three following cases:
97  * GLoadableIcon, GThemedIcon and GEmblemedIcon. It may also make
98  * sense to have fast-paths for other cases (like handling GdkPixbuf
99  * directly, for example) but all compliant GIcon implementations
100  * outside of GIO must implement GLoadableIcon.
101  *
102  * If your application or library provides one or more GIcon
103  * implementations you need to ensure that your new implementation also
104  * implements GLoadableIcon. Additionally, you must provide an
105  * implementation of g_icon_serialize() that gives a result that is
106  * understood by g_icon_deserialize(), yielding one of the built-in icon
107  * types.
108  */
109 public interface IconIF
110 {
111 	
112 	
113 	/** Get the main Gtk struct */
114 	public GIcon* getIconTStruct();
115 	
116 	/** the main Gtk struct as a void* */
117 	protected void* getStruct();
118 	
119 	
120 	/**
121 	 */
122 	
123 	/**
124 	 * Gets a hash for an icon.
125 	 * Virtual: hash
126 	 * Params:
127 	 * icon = gconstpointer to an icon object.
128 	 * Returns: a guint containing a hash for the icon, suitable for use in a GHashTable or similar data structure.
129 	 */
130 	public static uint hash(void* icon);
131 	
132 	/**
133 	 * Checks if two icons are equal.
134 	 * Params:
135 	 * icon2 = pointer to the second GIcon. [allow-none]
136 	 * Returns: TRUE if icon1 is equal to icon2. FALSE otherwise.
137 	 */
138 	public int equal(IconIF icon2);
139 	
140 	/**
141 	 * Generates a textual representation of icon that can be used for
142 	 * serialization such as when passing icon to a different process or
143 	 * saving it to persistent storage. Use g_icon_new_for_string() to
144 	 * get icon back from the returned string.
145 	 * The encoding of the returned string is proprietary to GIcon except
146 	 * in the following two cases
147 	 *  If icon is a GFileIcon, the returned string is a native path
148 	 *  (such as /path/to/my icon.png) without escaping
149 	 *  if the GFile for icon is a native file. If the file is not
150 	 *  native, the returned string is the result of g_file_get_uri()
151 	 *  (such as sftp://path/to/my%20icon.png).
152 	 *  If icon is a GThemedIcon with exactly one name, the encoding is
153 	 *  simply the name (such as network-server).
154 	 * Virtual: to_tokens
155 	 * Since 2.20
156 	 * Returns: An allocated NUL-terminated UTF8 string or NULL if icon can't be serialized. Use g_free() to free.
157 	 */
158 	public string toString();
159 	
160 	/**
161 	 * Serializes a GIcon into a GVariant. An equivalent GIcon can be retrieved
162 	 * back by calling g_icon_deserialize() on the returned value.
163 	 * As serialization will avoid using raw icon data when possible, it only
164 	 * makes sense to transfer the GVariant between processes on the same machine,
165 	 * (as opposed to over the network), and within the same file system namespace.
166 	 * Since 2.38
167 	 * Returns: a GVariant, or NULL when serialization fails. [transfer full]
168 	 */
169 	public Variant serialize();
170 	
171 	/**
172 	 * Deserializes a GIcon previously serialized using g_icon_serialize().
173 	 * Since 2.38
174 	 * Params:
175 	 * value = a GVariant created with g_icon_serialize()
176 	 * Returns: a GIcon, or NULL when deserialization fails. [transfer full]
177 	 */
178 	public static IconIF deserialize(Variant value);
179 }