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 
70 private import glib.ListG;
71 private import gio.Emblem;
72 private import gio.Icon;
73 private import gio.IconIF;
74 private import gio.IconT;
75 
76 
77 
78 private import gobject.ObjectG;
79 
80 /**
81  * GEmblemedIcon is an implementation of GIcon that supports
82  * adding an emblem to an icon. Adding multiple emblems to an
83  * icon is ensured via g_emblemed_icon_add_emblem().
84  *
85  * Note that GEmblemedIcon allows no control over the position
86  * of the emblems. See also GEmblem for more information.
87  */
88 public class EmblemedIcon : ObjectG, IconIF
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GEmblemedIcon* gEmblemedIcon;
93 	
94 	
95 	public GEmblemedIcon* getEmblemedIconStruct()
96 	{
97 		return gEmblemedIcon;
98 	}
99 	
100 	
101 	/** the main Gtk struct as a void* */
102 	protected override void* getStruct()
103 	{
104 		return cast(void*)gEmblemedIcon;
105 	}
106 	
107 	/**
108 	 * Sets our main struct and passes it to the parent class
109 	 */
110 	public this (GEmblemedIcon* gEmblemedIcon)
111 	{
112 		super(cast(GObject*)gEmblemedIcon);
113 		this.gEmblemedIcon = gEmblemedIcon;
114 	}
115 	
116 	protected override void setStruct(GObject* obj)
117 	{
118 		super.setStruct(obj);
119 		gEmblemedIcon = cast(GEmblemedIcon*)obj;
120 	}
121 	
122 	// add the Icon capabilities
123 	mixin IconT!(GEmblemedIcon);
124 	
125 	/**
126 	 */
127 	
128 	/**
129 	 * Creates a new emblemed icon for icon with the emblem emblem.
130 	 * Since 2.18
131 	 * Params:
132 	 * icon = a GIcon
133 	 * emblem = a GEmblem, or NULL. [allow-none]
134 	 * Throws: ConstructionException GTK+ fails to create the object.
135 	 */
136 	public this (IconIF icon, Emblem emblem)
137 	{
138 		// GIcon * g_emblemed_icon_new (GIcon *icon,  GEmblem *emblem);
139 		auto p = g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct());
140 		if(p is null)
141 		{
142 			throw new ConstructionException("null returned by g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct())");
143 		}
144 		this(cast(GEmblemedIcon*) p);
145 	}
146 	
147 	/**
148 	 * Gets the main icon for emblemed.
149 	 * Since 2.18
150 	 * Returns: a GIcon that is owned by emblemed. [transfer none]
151 	 */
152 	public IconIF getIcon()
153 	{
154 		// GIcon * g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
155 		auto p = g_emblemed_icon_get_icon(gEmblemedIcon);
156 		
157 		if(p is null)
158 		{
159 			return null;
160 		}
161 		
162 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
163 	}
164 	
165 	/**
166 	 * Gets the list of emblems for the icon.
167 	 * Since 2.18
168 	 * Returns: a GList of GEmblem s that is owned by emblemed. [element-type Gio.Emblem][transfer none]
169 	 */
170 	public ListG getEmblems()
171 	{
172 		// GList * g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
173 		auto p = g_emblemed_icon_get_emblems(gEmblemedIcon);
174 		
175 		if(p is null)
176 		{
177 			return null;
178 		}
179 		
180 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
181 	}
182 	
183 	/**
184 	 * Adds emblem to the GList of GEmblem s.
185 	 * Since 2.18
186 	 * Params:
187 	 * emblem = a GEmblem
188 	 */
189 	public void addEmblem(Emblem emblem)
190 	{
191 		// void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,  GEmblem *emblem);
192 		g_emblemed_icon_add_emblem(gEmblemedIcon, (emblem is null) ? null : emblem.getEmblemStruct());
193 	}
194 	
195 	/**
196 	 * Removes all the emblems from icon.
197 	 * Since 2.28
198 	 */
199 	public void clearEmblems()
200 	{
201 		// void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
202 		g_emblemed_icon_clear_emblems(gEmblemedIcon);
203 	}
204 }