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