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  = GtkToolItemGroup.html
27  * outPack = gtk
28  * outFile = ToolItemGroup
29  * strct   = GtkToolItemGroup
30  * realStrct=
31  * ctorStrct=GtkWidget
32  * clss    = ToolItemGroup
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- ToolShellIF
40  * prefixes:
41  * 	- gtk_tool_item_group_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gtk.ToolItem
49  * 	- gtk.Widget
50  * 	- gtk.ToolShellIF
51  * 	- gtk.ToolShellT
52  * structWrap:
53  * 	- GtkToolItem* -> ToolItem
54  * 	- GtkWidget* -> Widget
55  * module aliases:
56  * local aliases:
57  * overrides:
58  */
59 
60 module gtk.ToolItemGroup;
61 
62 public  import gtkc.gtktypes;
63 
64 private import gtkc.gtk;
65 private import glib.ConstructionException;
66 private import gobject.ObjectG;
67 
68 private import glib.Str;
69 private import gtk.ToolItem;
70 private import gtk.Widget;
71 private import gtk.ToolShellIF;
72 private import gtk.ToolShellT;
73 
74 
75 private import gtk.Container;
76 
77 /**
78  * A GtkToolItemGroup is used together with GtkToolPalette to add
79  * GtkToolItems to a palette like container with different
80  * categories and drag and drop support.
81  */
82 public class ToolItemGroup : Container, ToolShellIF
83 {
84 	
85 	/** the main Gtk struct */
86 	protected GtkToolItemGroup* gtkToolItemGroup;
87 	
88 	
89 	/** Get the main Gtk struct */
90 	public GtkToolItemGroup* getToolItemGroupStruct()
91 	{
92 		return gtkToolItemGroup;
93 	}
94 	
95 	
96 	/** the main Gtk struct as a void* */
97 	protected override void* getStruct()
98 	{
99 		return cast(void*)gtkToolItemGroup;
100 	}
101 	
102 	/**
103 	 * Sets our main struct and passes it to the parent class
104 	 */
105 	public this (GtkToolItemGroup* gtkToolItemGroup)
106 	{
107 		super(cast(GtkContainer*)gtkToolItemGroup);
108 		this.gtkToolItemGroup = gtkToolItemGroup;
109 	}
110 	
111 	protected override void setStruct(GObject* obj)
112 	{
113 		super.setStruct(obj);
114 		gtkToolItemGroup = cast(GtkToolItemGroup*)obj;
115 	}
116 	
117 	// add the ToolShell capabilities
118 	mixin ToolShellT!(GtkToolItemGroup);
119 	
120 	/**
121 	 * Retrieves the current orientation for the tool shell. Tool items must not
122 	 * call this function directly, but rely on gtk_tool_item_get_orientation()
123 	 * instead.
124 	 * Since 2.14
125 	 * Returns: the current orientation of shell
126 	 */
127 	public GtkOrientation getOrientation()
128 	{
129 		// GtkOrientation gtk_tool_shell_get_orientation (GtkToolShell *shell);
130 		return gtk_tool_shell_get_orientation(getToolShellTStruct());
131 	}
132 	
133 	/**
134 	 */
135 	
136 	/**
137 	 * Gets whether group is collapsed or expanded.
138 	 * Since 2.20
139 	 * Returns: TRUE if group is collapsed, FALSE if it is expanded
140 	 */
141 	public int getCollapsed()
142 	{
143 		// gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group);
144 		return gtk_tool_item_group_get_collapsed(gtkToolItemGroup);
145 	}
146 	
147 	/**
148 	 * Gets the tool item at position (x, y).
149 	 * Since 2.20
150 	 * Params:
151 	 * x = the x position
152 	 * y = the y position
153 	 * Returns: the GtkToolItem at position (x, y). [transfer none]
154 	 */
155 	public ToolItem getDropItem(int x, int y)
156 	{
157 		// GtkToolItem * gtk_tool_item_group_get_drop_item (GtkToolItemGroup *group,  gint x,  gint y);
158 		auto p = gtk_tool_item_group_get_drop_item(gtkToolItemGroup, x, y);
159 		
160 		if(p is null)
161 		{
162 			return null;
163 		}
164 		
165 		return ObjectG.getDObject!(ToolItem)(cast(GtkToolItem*) p);
166 	}
167 	
168 	/**
169 	 * Gets the ellipsization mode of group.
170 	 * Since 2.20
171 	 * Returns: the PangoEllipsizeMode of group
172 	 */
173 	public PangoEllipsizeMode getEllipsize()
174 	{
175 		// PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group);
176 		return gtk_tool_item_group_get_ellipsize(gtkToolItemGroup);
177 	}
178 	
179 	/**
180 	 * Gets the position of item in group as index.
181 	 * Since 2.20
182 	 * Params:
183 	 * item = a GtkToolItem
184 	 * Returns: the index of item in group or -1 if item is no child of group
185 	 */
186 	public int getItemPosition(ToolItem item)
187 	{
188 		// gint gtk_tool_item_group_get_item_position  (GtkToolItemGroup *group,  GtkToolItem *item);
189 		return gtk_tool_item_group_get_item_position(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct());
190 	}
191 	
192 	/**
193 	 * Gets the number of tool items in group.
194 	 * Since 2.20
195 	 * Returns: the number of tool items in group
196 	 */
197 	public uint getNItems()
198 	{
199 		// guint gtk_tool_item_group_get_n_items (GtkToolItemGroup *group);
200 		return gtk_tool_item_group_get_n_items(gtkToolItemGroup);
201 	}
202 	
203 	/**
204 	 * Gets the label of group.
205 	 * Since 2.20
206 	 * Returns: the label of group. The label is an internal string of group and must not be modified. Note that NULL is returned if a custom label has been set with gtk_tool_item_group_set_label_widget()
207 	 */
208 	public string getLabel()
209 	{
210 		// const gchar * gtk_tool_item_group_get_label (GtkToolItemGroup *group);
211 		return Str.toString(gtk_tool_item_group_get_label(gtkToolItemGroup));
212 	}
213 	
214 	/**
215 	 * Gets the label widget of group.
216 	 * See gtk_tool_item_group_set_label_widget().
217 	 * Since 2.20
218 	 * Returns: the label widget of group. [transfer none]
219 	 */
220 	public Widget getLabelWidget()
221 	{
222 		// GtkWidget * gtk_tool_item_group_get_label_widget  (GtkToolItemGroup *group);
223 		auto p = gtk_tool_item_group_get_label_widget(gtkToolItemGroup);
224 		
225 		if(p is null)
226 		{
227 			return null;
228 		}
229 		
230 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
231 	}
232 	
233 	/**
234 	 * Gets the tool item at index in group.
235 	 * Since 2.20
236 	 * Params:
237 	 * index = the index
238 	 * Returns: the GtkToolItem at index. [transfer none]
239 	 */
240 	public ToolItem getNthItem(uint index)
241 	{
242 		// GtkToolItem * gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group,  guint index);
243 		auto p = gtk_tool_item_group_get_nth_item(gtkToolItemGroup, index);
244 		
245 		if(p is null)
246 		{
247 			return null;
248 		}
249 		
250 		return ObjectG.getDObject!(ToolItem)(cast(GtkToolItem*) p);
251 	}
252 	
253 	/**
254 	 * Gets the relief mode of the header button of group.
255 	 * Since 2.20
256 	 * Returns: the GtkReliefStyle
257 	 */
258 	public GtkReliefStyle getHeaderRelief()
259 	{
260 		// GtkReliefStyle gtk_tool_item_group_get_header_relief  (GtkToolItemGroup *group);
261 		return gtk_tool_item_group_get_header_relief(gtkToolItemGroup);
262 	}
263 	
264 	/**
265 	 * Inserts item at position in the list of children of group.
266 	 * Since 2.20
267 	 * Params:
268 	 * item = the GtkToolItem to insert into group
269 	 * position = the position of item in group, starting with 0.
270 	 * The position -1 means end of list.
271 	 */
272 	public void insert(ToolItem item, int position)
273 	{
274 		// void gtk_tool_item_group_insert (GtkToolItemGroup *group,  GtkToolItem *item,  gint position);
275 		gtk_tool_item_group_insert(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct(), position);
276 	}
277 	
278 	/**
279 	 * Creates a new tool item group with label label.
280 	 * Since 2.20
281 	 * Params:
282 	 * label = the label of the new group
283 	 * Throws: ConstructionException GTK+ fails to create the object.
284 	 */
285 	public this (string label)
286 	{
287 		// GtkWidget * gtk_tool_item_group_new (const gchar *label);
288 		auto p = gtk_tool_item_group_new(Str.toStringz(label));
289 		if(p is null)
290 		{
291 			throw new ConstructionException("null returned by gtk_tool_item_group_new(Str.toStringz(label))");
292 		}
293 		this(cast(GtkToolItemGroup*) p);
294 	}
295 	
296 	/**
297 	 * Sets whether the group should be collapsed or expanded.
298 	 * Since 2.20
299 	 * Params:
300 	 * collapsed = whether the group should be collapsed or expanded
301 	 */
302 	public void setCollapsed(int collapsed)
303 	{
304 		// void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,  gboolean collapsed);
305 		gtk_tool_item_group_set_collapsed(gtkToolItemGroup, collapsed);
306 	}
307 	
308 	/**
309 	 * Sets the ellipsization mode which should be used by labels in group.
310 	 * Since 2.20
311 	 * Params:
312 	 * ellipsize = the PangoEllipsizeMode labels in group should use
313 	 */
314 	public void setEllipsize(PangoEllipsizeMode ellipsize)
315 	{
316 		// void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,  PangoEllipsizeMode ellipsize);
317 		gtk_tool_item_group_set_ellipsize(gtkToolItemGroup, ellipsize);
318 	}
319 	
320 	/**
321 	 * Sets the position of item in the list of children of group.
322 	 * Since 2.20
323 	 * Params:
324 	 * item = the GtkToolItem to move to a new position, should
325 	 * be a child of group.
326 	 * position = the new position of item in group, starting with 0.
327 	 * The position -1 means end of list.
328 	 */
329 	public void setItemPosition(ToolItem item, int position)
330 	{
331 		// void gtk_tool_item_group_set_item_position  (GtkToolItemGroup *group,  GtkToolItem *item,  gint position);
332 		gtk_tool_item_group_set_item_position(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct(), position);
333 	}
334 	
335 	/**
336 	 * Sets the label of the tool item group. The label is displayed in the header
337 	 * of the group.
338 	 * Since 2.20
339 	 * Params:
340 	 * label = the new human-readable label of of the group
341 	 */
342 	public void setLabel(string label)
343 	{
344 		// void gtk_tool_item_group_set_label (GtkToolItemGroup *group,  const gchar *label);
345 		gtk_tool_item_group_set_label(gtkToolItemGroup, Str.toStringz(label));
346 	}
347 	
348 	/**
349 	 * Sets the label of the tool item group.
350 	 * The label widget is displayed in the header of the group, in place
351 	 * of the usual label.
352 	 * Since 2.20
353 	 * Params:
354 	 * labelWidget = the widget to be displayed in place of the usual label
355 	 */
356 	public void setLabelWidget(Widget labelWidget)
357 	{
358 		// void gtk_tool_item_group_set_label_widget  (GtkToolItemGroup *group,  GtkWidget *label_widget);
359 		gtk_tool_item_group_set_label_widget(gtkToolItemGroup, (labelWidget is null) ? null : labelWidget.getWidgetStruct());
360 	}
361 	
362 	/**
363 	 * Set the button relief of the group header.
364 	 * See gtk_button_set_relief() for details.
365 	 * Since 2.20
366 	 * Params:
367 	 * style = the GtkReliefStyle
368 	 */
369 	public void setHeaderRelief(GtkReliefStyle style)
370 	{
371 		// void gtk_tool_item_group_set_header_relief  (GtkToolItemGroup *group,  GtkReliefStyle style);
372 		gtk_tool_item_group_set_header_relief(gtkToolItemGroup, style);
373 	}
374 }