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  = GEmblemedIcon.html
27  * outPack = gio
28  * outFile = EmblemedIcon
29  * strct   = GEmblemedIcon
30  * realStrct=
31  * ctorStrct=GIcon
32  * clss    = EmblemedIcon
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- IconIF
40  * prefixes:
41  * 	- g_emblemed_icon_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.ListG
48  * 	- gio.Emblem
49  * 	- gio.Icon
50  * 	- gio.IconIF
51  * 	- gio.IconT
52  * structWrap:
53  * 	- GEmblem* -> Emblem
54  * 	- GIcon* -> IconIF
55  * 	- GList* -> ListG
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gio.EmblemedIcon;
62 
63 public  import gtkc.giotypes;
64 
65 private import gtkc.gio;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 private import glib.ListG;
70 private import gio.Emblem;
71 private import gio.Icon;
72 private import gio.IconIF;
73 private import gio.IconT;
74 
75 
76 private import gobject.ObjectG;
77 
78 /**
79  * GEmblemedIcon is an implementation of GIcon that supports
80  * adding an emblem to an icon. Adding multiple emblems to an
81  * icon is ensured via g_emblemed_icon_add_emblem().
82  *
83  * Note that GEmblemedIcon allows no control over the position
84  * of the emblems. See also GEmblem for more information.
85  */
86 public class EmblemedIcon : ObjectG, IconIF
87 {
88 	
89 	/** the main Gtk struct */
90 	protected GEmblemedIcon* gEmblemedIcon;
91 	
92 	
93 	/** Get the main Gtk struct */
94 	public GEmblemedIcon* getEmblemedIconStruct()
95 	{
96 		return gEmblemedIcon;
97 	}
98 	
99 	
100 	/** the main Gtk struct as a void* */
101 	protected override void* getStruct()
102 	{
103 		return cast(void*)gEmblemedIcon;
104 	}
105 	
106 	/**
107 	 * Sets our main struct and passes it to the parent class
108 	 */
109 	public this (GEmblemedIcon* gEmblemedIcon)
110 	{
111 		super(cast(GObject*)gEmblemedIcon);
112 		this.gEmblemedIcon = gEmblemedIcon;
113 	}
114 	
115 	protected override void setStruct(GObject* obj)
116 	{
117 		super.setStruct(obj);
118 		gEmblemedIcon = cast(GEmblemedIcon*)obj;
119 	}
120 	
121 	// add the Icon capabilities
122 	mixin IconT!(GEmblemedIcon);
123 	
124 	/**
125 	 */
126 	
127 	/**
128 	 * Creates a new emblemed icon for icon with the emblem emblem.
129 	 * Since 2.18
130 	 * Params:
131 	 * icon = a GIcon
132 	 * emblem = a GEmblem, or NULL. [allow-none]
133 	 * Throws: ConstructionException GTK+ fails to create the object.
134 	 */
135 	public this (IconIF icon, Emblem emblem)
136 	{
137 		// GIcon * g_emblemed_icon_new (GIcon *icon,  GEmblem *emblem);
138 		auto p = g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct());
139 		if(p is null)
140 		{
141 			throw new ConstructionException("null returned by g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct())");
142 		}
143 		this(cast(GEmblemedIcon*) p);
144 	}
145 	
146 	/**
147 	 * Gets the main icon for emblemed.
148 	 * Since 2.18
149 	 * Returns: a GIcon that is owned by emblemed. [transfer none]
150 	 */
151 	public IconIF getIcon()
152 	{
153 		// GIcon * g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
154 		auto p = g_emblemed_icon_get_icon(gEmblemedIcon);
155 		
156 		if(p is null)
157 		{
158 			return null;
159 		}
160 		
161 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
162 	}
163 	
164 	/**
165 	 * Gets the list of emblems for the icon.
166 	 * Since 2.18
167 	 * Returns: a GList of GEmblem s that is owned by emblemed. [element-type Gio.Emblem][transfer none]
168 	 */
169 	public ListG getEmblems()
170 	{
171 		// GList * g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
172 		auto p = g_emblemed_icon_get_emblems(gEmblemedIcon);
173 		
174 		if(p is null)
175 		{
176 			return null;
177 		}
178 		
179 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
180 	}
181 	
182 	/**
183 	 * Adds emblem to the GList of GEmblem s.
184 	 * Since 2.18
185 	 * Params:
186 	 * emblem = a GEmblem
187 	 */
188 	public void addEmblem(Emblem emblem)
189 	{
190 		// void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,  GEmblem *emblem);
191 		g_emblemed_icon_add_emblem(gEmblemedIcon, (emblem is null) ? null : emblem.getEmblemStruct());
192 	}
193 	
194 	/**
195 	 * Removes all the emblems from icon.
196 	 * Since 2.28
197 	 */
198 	public void clearEmblems()
199 	{
200 		// void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
201 		g_emblemed_icon_clear_emblems(gEmblemedIcon);
202 	}
203 }