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  = GtkToolItem.html
27  * outPack = gtk
28  * outFile = ToolItem
29  * strct   = GtkToolItem
30  * realStrct=
31  * ctorStrct=
32  * clss    = ToolItem
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- ActivatableIF
40  * prefixes:
41  * 	- gtk_tool_item_
42  * 	- gtk_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- gtk.SizeGroup
50  * 	- gtk.Tooltips
51  * 	- gtk.Widget
52  * 	- gtk.ActivatableT
53  * 	- gtk.ActivatableIF
54  * structWrap:
55  * 	- GtkSizeGroup* -> SizeGroup
56  * 	- GtkTooltips* -> Tooltips
57  * 	- GtkWidget* -> Widget
58  * module aliases:
59  * local aliases:
60  * overrides:
61  * 	- setTooltipText
62  * 	- setTooltipMarkup
63  */
64 
65 module gtk.ToolItem;
66 
67 public  import gtkc.gtktypes;
68 
69 private import gtkc.gtk;
70 private import glib.ConstructionException;
71 private import gobject.ObjectG;
72 
73 private import gobject.Signals;
74 public  import gtkc.gdktypes;
75 
76 private import glib.Str;
77 private import gtk.SizeGroup;
78 private import gtk.Tooltips;
79 private import gtk.Widget;
80 private import gtk.ActivatableT;
81 private import gtk.ActivatableIF;
82 
83 
84 
85 private import gtk.Bin;
86 
87 /**
88  * Description
89  * GtkToolItems are widgets that can appear on a toolbar. To
90  * create a toolbar item that contain something else than a button, use
91  * gtk_tool_item_new(). Use gtk_container_add() to add a child
92  * widget to the tool item.
93  * For toolbar items that contain buttons, see the GtkToolButton,
94  * GtkToggleToolButton and GtkRadioToolButton classes.
95  * See the GtkToolbar class for a description of the toolbar widget, and
96  * GtkToolShell for a description of the tool shell interface.
97  */
98 public class ToolItem : Bin, ActivatableIF
99 {
100 	
101 	/** the main Gtk struct */
102 	protected GtkToolItem* gtkToolItem;
103 	
104 	
105 	public GtkToolItem* getToolItemStruct()
106 	{
107 		return gtkToolItem;
108 	}
109 	
110 	
111 	/** the main Gtk struct as a void* */
112 	protected override void* getStruct()
113 	{
114 		return cast(void*)gtkToolItem;
115 	}
116 	
117 	/**
118 	 * Sets our main struct and passes it to the parent class
119 	 */
120 	public this (GtkToolItem* gtkToolItem)
121 	{
122 		super(cast(GtkBin*)gtkToolItem);
123 		this.gtkToolItem = gtkToolItem;
124 	}
125 	
126 	protected override void setStruct(GObject* obj)
127 	{
128 		super.setStruct(obj);
129 		gtkToolItem = cast(GtkToolItem*)obj;
130 	}
131 	
132 	// add the Activatable capabilities
133 	mixin ActivatableT!(GtkToolItem);
134 	
135 	/**
136 	 * Sets this widget tooltip
137 	 * Deprecated: Since 2.12 use setTooltipText() or setTooltipMarkup()
138 	 * Params:
139 	 *  tipText = the tooltip
140 	 *  tipPrivate = a private text
141 	 */
142 	override void setTooltip(string tipText, string tipPrivate)
143 	{
144 		Tooltips tt = new Tooltips();
145 		tt.setTip(this, tipText, tipPrivate);
146 	}
147 	
148 	/**
149 	 */
150 	int[string] connectedSignals;
151 	
152 	bool delegate(ToolItem)[] onCreateMenuProxyListeners;
153 	/**
154 	 * This signal is emitted when the toolbar needs information from tool_item
155 	 * about whether the item should appear in the toolbar overflow menu. In
156 	 * response the tool item should either
157 	 * call gtk_tool_item_set_proxy_menu_item() with a NULL
158 	 * pointer and return TRUE to indicate that the item should not appear
159 	 * in the overflow menu
160 	 *  call gtk_tool_item_set_proxy_menu_item() with a new menu
161 	 * item and return TRUE, or
162 	 *  return FALSE to indicate that the signal was not
163 	 * handled by the item. This means that
164 	 * the item will not appear in the overflow menu unless a later handler
165 	 * installs a menu item.
166 	 * The toolbar may cache the result of this signal. When the tool item changes
167 	 * how it will respond to this signal it must call gtk_tool_item_rebuild_menu()
168 	 * to invalidate the cache and ensure that the toolbar rebuilds its overflow
169 	 * menu.
170 	 * TRUE if the signal was handled, FALSE if not
171 	 */
172 	void addOnCreateMenuProxy(bool delegate(ToolItem) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
173 	{
174 		if ( !("create-menu-proxy" in connectedSignals) )
175 		{
176 			Signals.connectData(
177 			getStruct(),
178 			"create-menu-proxy",
179 			cast(GCallback)&callBackCreateMenuProxy,
180 			cast(void*)this,
181 			null,
182 			connectFlags);
183 			connectedSignals["create-menu-proxy"] = 1;
184 		}
185 		onCreateMenuProxyListeners ~= dlg;
186 	}
187 	extern(C) static gboolean callBackCreateMenuProxy(GtkToolItem* toolItemStruct, ToolItem _toolItem)
188 	{
189 		foreach ( bool delegate(ToolItem) dlg ; _toolItem.onCreateMenuProxyListeners )
190 		{
191 			if ( dlg(_toolItem) )
192 			{
193 				return 1;
194 			}
195 		}
196 		
197 		return 0;
198 	}
199 	
200 	bool delegate(Tooltips, string, string, ToolItem)[] onSetTooltipListeners;
201 	/**
202 	 * Warning
203 	 * GtkToolItem::set-tooltip has been deprecated since version 2.12 and should not be used in newly-written code. With the new tooltip API, there is no
204 	 *  need to use this signal anymore.
205 	 * This signal is emitted when the toolitem's tooltip changes.
206 	 * Application developers can use gtk_tool_item_set_tooltip() to
207 	 * set the item's tooltip.
208 	 * TRUE if the signal was handled, FALSE if not
209 	 */
210 	void addOnSetTooltip(bool delegate(Tooltips, string, string, ToolItem) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
211 	{
212 		if ( !("set-tooltip" in connectedSignals) )
213 		{
214 			Signals.connectData(
215 			getStruct(),
216 			"set-tooltip",
217 			cast(GCallback)&callBackSetTooltip,
218 			cast(void*)this,
219 			null,
220 			connectFlags);
221 			connectedSignals["set-tooltip"] = 1;
222 		}
223 		onSetTooltipListeners ~= dlg;
224 	}
225 	extern(C) static gboolean callBackSetTooltip(GtkToolItem* toolItemStruct, GtkTooltips* tooltips, gchar* tipText, gchar* tipPrivate, ToolItem _toolItem)
226 	{
227 		foreach ( bool delegate(Tooltips, string, string, ToolItem) dlg ; _toolItem.onSetTooltipListeners )
228 		{
229 			if ( dlg(ObjectG.getDObject!(Tooltips)(tooltips), Str.toString(tipText), Str.toString(tipPrivate), _toolItem) )
230 			{
231 				return 1;
232 			}
233 		}
234 		
235 		return 0;
236 	}
237 	
238 	void delegate(ToolItem)[] onToolbarReconfiguredListeners;
239 	/**
240 	 * This signal is emitted when some property of the toolbar that the
241 	 * item is a child of changes. For custom subclasses of GtkToolItem,
242 	 * the default handler of this signal use the functions
243 	 * gtk_tool_shell_get_orientation()
244 	 * gtk_tool_shell_get_style()
245 	 * gtk_tool_shell_get_icon_size()
246 	 * gtk_tool_shell_get_relief_style()
247 	 * to find out what the toolbar should look like and change
248 	 * themselves accordingly.
249 	 * See Also
250 	 * GtkToolbar
251 	 * The toolbar widget
252 	 * GtkToolButton
253 	 * A subclass of GtkToolItem that displays buttons on
254 	 *  the toolbar
255 	 * GtkSeparatorToolItem
256 	 * A subclass of GtkToolItem that separates groups of
257 	 *  items on a toolbar
258 	 */
259 	void addOnToolbarReconfigured(void delegate(ToolItem) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
260 	{
261 		if ( !("toolbar-reconfigured" in connectedSignals) )
262 		{
263 			Signals.connectData(
264 			getStruct(),
265 			"toolbar-reconfigured",
266 			cast(GCallback)&callBackToolbarReconfigured,
267 			cast(void*)this,
268 			null,
269 			connectFlags);
270 			connectedSignals["toolbar-reconfigured"] = 1;
271 		}
272 		onToolbarReconfiguredListeners ~= dlg;
273 	}
274 	extern(C) static void callBackToolbarReconfigured(GtkToolItem* toolItemStruct, ToolItem _toolItem)
275 	{
276 		foreach ( void delegate(ToolItem) dlg ; _toolItem.onToolbarReconfiguredListeners )
277 		{
278 			dlg(_toolItem);
279 		}
280 	}
281 	
282 	
283 	/**
284 	 * Creates a new GtkToolItem
285 	 * Since 2.4
286 	 * Throws: ConstructionException GTK+ fails to create the object.
287 	 */
288 	public this ()
289 	{
290 		// GtkToolItem * gtk_tool_item_new (void);
291 		auto p = gtk_tool_item_new();
292 		if(p is null)
293 		{
294 			throw new ConstructionException("null returned by gtk_tool_item_new()");
295 		}
296 		this(cast(GtkToolItem*) p);
297 	}
298 	
299 	/**
300 	 * Sets whether tool_item is to be allocated the same size as other
301 	 * homogeneous items. The effect is that all homogeneous items will have
302 	 * the same width as the widest of the items.
303 	 * Since 2.4
304 	 * Params:
305 	 * homogeneous = whether tool_item is the same size as other homogeneous items
306 	 */
307 	public void setHomogeneous(int homogeneous)
308 	{
309 		// void gtk_tool_item_set_homogeneous (GtkToolItem *tool_item,  gboolean homogeneous);
310 		gtk_tool_item_set_homogeneous(gtkToolItem, homogeneous);
311 	}
312 	
313 	/**
314 	 * Returns whether tool_item is the same size as other homogeneous
315 	 * items. See gtk_tool_item_set_homogeneous().
316 	 * Since 2.4
317 	 * Returns: TRUE if the item is the same size as other homogeneous items.
318 	 */
319 	public int getHomogeneous()
320 	{
321 		// gboolean gtk_tool_item_get_homogeneous (GtkToolItem *tool_item);
322 		return gtk_tool_item_get_homogeneous(gtkToolItem);
323 	}
324 	
325 	/**
326 	 * Sets whether tool_item is allocated extra space when there
327 	 * is more room on the toolbar then needed for the items. The
328 	 * effect is that the item gets bigger when the toolbar gets bigger
329 	 * and smaller when the toolbar gets smaller.
330 	 * Since 2.4
331 	 * Params:
332 	 * expand = Whether tool_item is allocated extra space
333 	 */
334 	public void setExpand(int expand)
335 	{
336 		// void gtk_tool_item_set_expand (GtkToolItem *tool_item,  gboolean expand);
337 		gtk_tool_item_set_expand(gtkToolItem, expand);
338 	}
339 	
340 	/**
341 	 * Returns whether tool_item is allocated extra space.
342 	 * See gtk_tool_item_set_expand().
343 	 * Since 2.4
344 	 * Returns: TRUE if tool_item is allocated extra space.
345 	 */
346 	public int getExpand()
347 	{
348 		// gboolean gtk_tool_item_get_expand (GtkToolItem *tool_item);
349 		return gtk_tool_item_get_expand(gtkToolItem);
350 	}
351 	
352 	/**
353 	 * Warning
354 	 * gtk_tool_item_set_tooltip has been deprecated since version 2.12 and should not be used in newly-written code. Use gtk_tool_item_set_tooltip_text() instead.
355 	 * Sets the GtkTooltips object to be used for tool_item, the
356 	 * text to be displayed as tooltip on the item and the private text
357 	 * to be used. See gtk_tooltips_set_tip().
358 	 * Since 2.4
359 	 * Params:
360 	 * tooltips = The GtkTooltips object to be used
361 	 * tipText = text to be used as tooltip text for tool_item. [allow-none]
362 	 * tipPrivate = text to be used as private tooltip text. [allow-none]
363 	 */
364 	public void setTooltip(Tooltips tooltips, string tipText, string tipPrivate)
365 	{
366 		// void gtk_tool_item_set_tooltip (GtkToolItem *tool_item,  GtkTooltips *tooltips,  const gchar *tip_text,  const gchar *tip_private);
367 		gtk_tool_item_set_tooltip(gtkToolItem, (tooltips is null) ? null : tooltips.getTooltipsStruct(), Str.toStringz(tipText), Str.toStringz(tipPrivate));
368 	}
369 	
370 	/**
371 	 * Sets the text to be displayed as tooltip on the item.
372 	 * See gtk_widget_set_tooltip_text().
373 	 * Since 2.12
374 	 * Params:
375 	 * text = text to be used as tooltip for tool_item
376 	 */
377 	public override void setTooltipText(string text)
378 	{
379 		// void gtk_tool_item_set_tooltip_text (GtkToolItem *tool_item,  const gchar *text);
380 		gtk_tool_item_set_tooltip_text(gtkToolItem, Str.toStringz(text));
381 	}
382 	
383 	/**
384 	 * Sets the markup text to be displayed as tooltip on the item.
385 	 * See gtk_widget_set_tooltip_markup().
386 	 * Since 2.12
387 	 * Params:
388 	 * markup = markup text to be used as tooltip for tool_item
389 	 */
390 	public override void setTooltipMarkup(string markup)
391 	{
392 		// void gtk_tool_item_set_tooltip_markup (GtkToolItem *tool_item,  const gchar *markup);
393 		gtk_tool_item_set_tooltip_markup(gtkToolItem, Str.toStringz(markup));
394 	}
395 	
396 	/**
397 	 * Sets whether tool_item has a drag window. When TRUE the
398 	 * toolitem can be used as a drag source through gtk_drag_source_set().
399 	 * When tool_item has a drag window it will intercept all events,
400 	 * even those that would otherwise be sent to a child of tool_item.
401 	 * Since 2.4
402 	 * Params:
403 	 * useDragWindow = Whether tool_item has a drag window.
404 	 */
405 	public void setUseDragWindow(int useDragWindow)
406 	{
407 		// void gtk_tool_item_set_use_drag_window (GtkToolItem *tool_item,  gboolean use_drag_window);
408 		gtk_tool_item_set_use_drag_window(gtkToolItem, useDragWindow);
409 	}
410 	
411 	/**
412 	 * Returns whether tool_item has a drag window. See
413 	 * gtk_tool_item_set_use_drag_window().
414 	 * Since 2.4
415 	 * Returns: TRUE if tool_item uses a drag window.
416 	 */
417 	public int getUseDragWindow()
418 	{
419 		// gboolean gtk_tool_item_get_use_drag_window (GtkToolItem *tool_item);
420 		return gtk_tool_item_get_use_drag_window(gtkToolItem);
421 	}
422 	
423 	/**
424 	 * Sets whether tool_item is visible when the toolbar is docked horizontally.
425 	 * Since 2.4
426 	 * Params:
427 	 * visibleHorizontal = Whether tool_item is visible when in horizontal mode
428 	 */
429 	public void setVisibleHorizontal(int visibleHorizontal)
430 	{
431 		// void gtk_tool_item_set_visible_horizontal  (GtkToolItem *tool_item,  gboolean visible_horizontal);
432 		gtk_tool_item_set_visible_horizontal(gtkToolItem, visibleHorizontal);
433 	}
434 	
435 	/**
436 	 * Returns whether the tool_item is visible on toolbars that are
437 	 * docked horizontally.
438 	 * Since 2.4
439 	 * Returns: TRUE if tool_item is visible on toolbars that are docked horizontally.
440 	 */
441 	public int getVisibleHorizontal()
442 	{
443 		// gboolean gtk_tool_item_get_visible_horizontal  (GtkToolItem *tool_item);
444 		return gtk_tool_item_get_visible_horizontal(gtkToolItem);
445 	}
446 	
447 	/**
448 	 * Sets whether tool_item is visible when the toolbar is docked
449 	 * vertically. Some tool items, such as text entries, are too wide to be
450 	 * useful on a vertically docked toolbar. If visible_vertical is FALSE
451 	 * tool_item will not appear on toolbars that are docked vertically.
452 	 * Since 2.4
453 	 * Params:
454 	 * visibleVertical = whether tool_item is visible when the toolbar
455 	 * is in vertical mode
456 	 */
457 	public void setVisibleVertical(int visibleVertical)
458 	{
459 		// void gtk_tool_item_set_visible_vertical (GtkToolItem *tool_item,  gboolean visible_vertical);
460 		gtk_tool_item_set_visible_vertical(gtkToolItem, visibleVertical);
461 	}
462 	
463 	/**
464 	 * Returns whether tool_item is visible when the toolbar is docked vertically.
465 	 * See gtk_tool_item_set_visible_vertical().
466 	 * Since 2.4
467 	 * Returns: Whether tool_item is visible when the toolbar is docked vertically
468 	 */
469 	public int getVisibleVertical()
470 	{
471 		// gboolean gtk_tool_item_get_visible_vertical (GtkToolItem *tool_item);
472 		return gtk_tool_item_get_visible_vertical(gtkToolItem);
473 	}
474 	
475 	/**
476 	 * Sets whether tool_item should be considered important. The GtkToolButton
477 	 * class uses this property to determine whether to show or hide its label
478 	 * when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ. The result is that
479 	 * only tool buttons with the "is_important" property set have labels, an
480 	 * effect known as "priority text"
481 	 * Since 2.4
482 	 * Params:
483 	 * isImportant = whether the tool item should be considered important
484 	 */
485 	public void setIsImportant(int isImportant)
486 	{
487 		// void gtk_tool_item_set_is_important (GtkToolItem *tool_item,  gboolean is_important);
488 		gtk_tool_item_set_is_important(gtkToolItem, isImportant);
489 	}
490 	
491 	/**
492 	 * Returns whether tool_item is considered important. See
493 	 * gtk_tool_item_set_is_important()
494 	 * Since 2.4
495 	 * Returns: TRUE if tool_item is considered important.
496 	 */
497 	public int getIsImportant()
498 	{
499 		// gboolean gtk_tool_item_get_is_important (GtkToolItem *tool_item);
500 		return gtk_tool_item_get_is_important(gtkToolItem);
501 	}
502 	
503 	/**
504 	 * Returns the ellipsize mode used for tool_item. Custom subclasses of
505 	 * GtkToolItem should call this function to find out how text should
506 	 * be ellipsized.
507 	 * Since 2.20
508 	 * Returns: a PangoEllipsizeMode indicating how text in tool_item should be ellipsized.
509 	 */
510 	public PangoEllipsizeMode getEllipsizeMode()
511 	{
512 		// PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item);
513 		return gtk_tool_item_get_ellipsize_mode(gtkToolItem);
514 	}
515 	
516 	/**
517 	 * Returns the icon size used for tool_item. Custom subclasses of
518 	 * GtkToolItem should call this function to find out what size icons
519 	 * they should use.
520 	 * Since 2.4
521 	 * Returns: a GtkIconSize indicating the icon size used for tool_item. [type int]
522 	 */
523 	public GtkIconSize getIconSize()
524 	{
525 		// GtkIconSize gtk_tool_item_get_icon_size (GtkToolItem *tool_item);
526 		return gtk_tool_item_get_icon_size(gtkToolItem);
527 	}
528 	
529 	/**
530 	 * Returns the orientation used for tool_item. Custom subclasses of
531 	 * GtkToolItem should call this function to find out what size icons
532 	 * they should use.
533 	 * Since 2.4
534 	 * Returns: a GtkOrientation indicating the orientation used for tool_item
535 	 */
536 	public GtkOrientation getOrientation()
537 	{
538 		// GtkOrientation gtk_tool_item_get_orientation (GtkToolItem *tool_item);
539 		return gtk_tool_item_get_orientation(gtkToolItem);
540 	}
541 	
542 	/**
543 	 * Returns the toolbar style used for tool_item. Custom subclasses of
544 	 * GtkToolItem should call this function in the handler of the
545 	 * GtkToolItem::toolbar_reconfigured signal to find out in what style
546 	 * the toolbar is displayed and change themselves accordingly
547 	 * Since 2.4
548 	 * Returns: A GtkToolbarStyle indicating the toolbar style used for tool_item.
549 	 */
550 	public GtkToolbarStyle getToolbarStyle()
551 	{
552 		// GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item);
553 		return gtk_tool_item_get_toolbar_style(gtkToolItem);
554 	}
555 	
556 	/**
557 	 * Returns the relief style of tool_item. See gtk_button_set_relief_style().
558 	 * Custom subclasses of GtkToolItem should call this function in the handler
559 	 * of the "toolbar_reconfigured" signal to find out the
560 	 * relief style of buttons.
561 	 * Since 2.4
562 	 * Returns: a GtkReliefStyle indicating the relief style used for tool_item.
563 	 */
564 	public GtkReliefStyle getReliefStyle()
565 	{
566 		// GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item);
567 		return gtk_tool_item_get_relief_style(gtkToolItem);
568 	}
569 	
570 	/**
571 	 * Returns the text alignment used for tool_item. Custom subclasses of
572 	 * GtkToolItem should call this function to find out how text should
573 	 * be aligned.
574 	 * Since 2.20
575 	 * Returns: a gfloat indicating the horizontal text alignment used for tool_item
576 	 */
577 	public float getTextAlignment()
578 	{
579 		// gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
580 		return gtk_tool_item_get_text_alignment(gtkToolItem);
581 	}
582 	
583 	/**
584 	 * Returns the text orientation used for tool_item. Custom subclasses of
585 	 * GtkToolItem should call this function to find out how text should
586 	 * be orientated.
587 	 * Since 2.20
588 	 * Returns: a GtkOrientation indicating the text orientation used for tool_item
589 	 */
590 	public GtkOrientation getTextOrientation()
591 	{
592 		// GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
593 		return gtk_tool_item_get_text_orientation(gtkToolItem);
594 	}
595 	
596 	/**
597 	 * Returns the GtkMenuItem that was last set by
598 	 * gtk_tool_item_set_proxy_menu_item(), ie. the GtkMenuItem
599 	 * that is going to appear in the overflow menu.
600 	 * Since 2.4
601 	 * Returns: The GtkMenuItem that is going to appear in the overflow menu for tool_item. [transfer none]
602 	 */
603 	public Widget retrieveProxyMenuItem()
604 	{
605 		// GtkWidget * gtk_tool_item_retrieve_proxy_menu_item  (GtkToolItem *tool_item);
606 		auto p = gtk_tool_item_retrieve_proxy_menu_item(gtkToolItem);
607 		
608 		if(p is null)
609 		{
610 			return null;
611 		}
612 		
613 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
614 	}
615 	
616 	/**
617 	 * If menu_item_id matches the string passed to
618 	 * gtk_tool_item_set_proxy_menu_item() return the corresponding GtkMenuItem.
619 	 * Custom subclasses of GtkToolItem should use this function to
620 	 * update their menu item when the GtkToolItem changes. That the
621 	 * menu_item_ids must match ensures that a GtkToolItem
622 	 * will not inadvertently change a menu item that they did not create.
623 	 * Since 2.4
624 	 * Params:
625 	 * menuItemId = a string used to identify the menu item
626 	 * Returns: The GtkMenuItem passed to gtk_tool_item_set_proxy_menu_item(), if the menu_item_ids match. [transfer none]
627 	 */
628 	public Widget getProxyMenuItem(string menuItemId)
629 	{
630 		// GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item,  const gchar *menu_item_id);
631 		auto p = gtk_tool_item_get_proxy_menu_item(gtkToolItem, Str.toStringz(menuItemId));
632 		
633 		if(p is null)
634 		{
635 			return null;
636 		}
637 		
638 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
639 	}
640 	
641 	/**
642 	 * Sets the GtkMenuItem used in the toolbar overflow menu. The
643 	 * menu_item_id is used to identify the caller of this function and
644 	 * should also be used with gtk_tool_item_get_proxy_menu_item().
645 	 * Since 2.4
646 	 * Params:
647 	 * menuItemId = a string used to identify menu_item
648 	 * menuItem = a GtkMenuItem to be used in the overflow menu
649 	 */
650 	public void setProxyMenuItem(string menuItemId, Widget menuItem)
651 	{
652 		// void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,  const gchar *menu_item_id,  GtkWidget *menu_item);
653 		gtk_tool_item_set_proxy_menu_item(gtkToolItem, Str.toStringz(menuItemId), (menuItem is null) ? null : menuItem.getWidgetStruct());
654 	}
655 	
656 	/**
657 	 * Calling this function signals to the toolbar that the
658 	 * overflow menu item for tool_item has changed. If the
659 	 * overflow menu is visible when this function it called,
660 	 * the menu will be rebuilt.
661 	 * The function must be called when the tool item changes what it
662 	 * will do in response to the "create-menu-proxy" signal.
663 	 * Since 2.6
664 	 */
665 	public void rebuildMenu()
666 	{
667 		// void gtk_tool_item_rebuild_menu (GtkToolItem *tool_item);
668 		gtk_tool_item_rebuild_menu(gtkToolItem);
669 	}
670 	
671 	/**
672 	 * Emits the signal "toolbar_reconfigured" on tool_item.
673 	 * GtkToolbar and other GtkToolShell implementations use this function
674 	 * to notify children, when some aspect of their configuration changes.
675 	 * Since 2.14
676 	 */
677 	public void toolbarReconfigured()
678 	{
679 		// void gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item);
680 		gtk_tool_item_toolbar_reconfigured(gtkToolItem);
681 	}
682 	
683 	/**
684 	 * Returns the size group used for labels in tool_item.
685 	 * Custom subclasses of GtkToolItem should call this function
686 	 * and use the size group for labels.
687 	 * Since 2.20
688 	 * Returns: a GtkSizeGroup. [transfer none]
689 	 */
690 	public SizeGroup getTextSizeGroup()
691 	{
692 		// GtkSizeGroup * gtk_tool_item_get_text_size_group (GtkToolItem *tool_item);
693 		auto p = gtk_tool_item_get_text_size_group(gtkToolItem);
694 		
695 		if(p is null)
696 		{
697 			return null;
698 		}
699 		
700 		return ObjectG.getDObject!(SizeGroup)(cast(GtkSizeGroup*) p);
701 	}
702 }