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  = GtkRadioToolButton.html
27  * outPack = gtk
28  * outFile = RadioToolButton
29  * strct   = GtkRadioToolButton
30  * realStrct=
31  * ctorStrct=GtkToolItem
32  * clss    = RadioToolButton
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_radio_tool_button_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gtk.ToolItem
49  * 	- glib.ListSG
50  * structWrap:
51  * 	- GSList* -> ListSG
52  * 	- GtkRadioToolButton* -> RadioToolButton
53  * 	- GtkToolItem* -> ToolItem
54  * module aliases:
55  * local aliases:
56  * overrides:
57  */
58 
59 module gtk.RadioToolButton;
60 
61 public  import gtkc.gtktypes;
62 
63 private import gtkc.gtk;
64 private import glib.ConstructionException;
65 private import gobject.ObjectG;
66 
67 
68 private import glib.Str;
69 private import gtk.ToolItem;
70 private import glib.ListSG;
71 
72 
73 
74 private import gtk.ToggleToolButton;
75 
76 /**
77  * Description
78  * A GtkRadioToolButton is a GtkToolItem that contains a radio button,
79  * that is, a button that is part of a group of toggle buttons where only
80  * one button can be active at a time.
81  * Use gtk_radio_tool_button_new() to create a new
82  * GtkRadioToolButton. use gtk_radio_tool_button_new_from_widget() to
83  * create a new GtkRadioToolButton that is part of the same group as an
84  * existing GtkRadioToolButton. Use
85  * gtk_radio_tool_button_new_from_stock() or
86  * gtk_radio_tool_button_new_from_widget_with_stock() to create a new
87  * GtkRAdioToolButton containing a stock item.
88  */
89 public class RadioToolButton : ToggleToolButton
90 {
91 	
92 	/** the main Gtk struct */
93 	protected GtkRadioToolButton* gtkRadioToolButton;
94 	
95 	
96 	public GtkRadioToolButton* getRadioToolButtonStruct()
97 	{
98 		return gtkRadioToolButton;
99 	}
100 	
101 	
102 	/** the main Gtk struct as a void* */
103 	protected override void* getStruct()
104 	{
105 		return cast(void*)gtkRadioToolButton;
106 	}
107 	
108 	/**
109 	 * Sets our main struct and passes it to the parent class
110 	 */
111 	public this (GtkRadioToolButton* gtkRadioToolButton)
112 	{
113 		super(cast(GtkToggleToolButton*)gtkRadioToolButton);
114 		this.gtkRadioToolButton = gtkRadioToolButton;
115 	}
116 	
117 	protected override void setStruct(GObject* obj)
118 	{
119 		super.setStruct(obj);
120 		gtkRadioToolButton = cast(GtkRadioToolButton*)obj;
121 	}
122 	
123 	/**
124 	 */
125 	
126 	/**
127 	 * Creates a new GtkRadioToolButton, adding it to group.
128 	 * Since 2.4
129 	 * Params:
130 	 * group = An existing radio button group, or NULL if you are creating a new group. [allow-none]
131 	 * Throws: ConstructionException GTK+ fails to create the object.
132 	 */
133 	public this (ListSG group)
134 	{
135 		// GtkToolItem * gtk_radio_tool_button_new (GSList *group);
136 		auto p = gtk_radio_tool_button_new((group is null) ? null : group.getListSGStruct());
137 		if(p is null)
138 		{
139 			throw new ConstructionException("null returned by gtk_radio_tool_button_new((group is null) ? null : group.getListSGStruct())");
140 		}
141 		this(cast(GtkRadioToolButton*) p);
142 	}
143 	
144 	/**
145 	 * Creates a new GtkRadioToolButton, adding it to group.
146 	 * The new GtkRadioToolButton will contain an icon and label from the
147 	 * stock item indicated by stock_id.
148 	 * Since 2.4
149 	 * Params:
150 	 * group = an existing radio button group, or NULL if you are creating a new group. [allow-none]
151 	 * stockId = the name of a stock item
152 	 * Throws: ConstructionException GTK+ fails to create the object.
153 	 */
154 	public this (ListSG group, string stockId)
155 	{
156 		// GtkToolItem * gtk_radio_tool_button_new_from_stock  (GSList *group,  const gchar *stock_id);
157 		auto p = gtk_radio_tool_button_new_from_stock((group is null) ? null : group.getListSGStruct(), Str.toStringz(stockId));
158 		if(p is null)
159 		{
160 			throw new ConstructionException("null returned by gtk_radio_tool_button_new_from_stock((group is null) ? null : group.getListSGStruct(), Str.toStringz(stockId))");
161 		}
162 		this(cast(GtkRadioToolButton*) p);
163 	}
164 	
165 	/**
166 	 * Creates a new GtkRadioToolButton adding it to the same group as gruup
167 	 * Since 2.4
168 	 * Params:
169 	 * group = An existing GtkRadioToolButton
170 	 * Throws: ConstructionException GTK+ fails to create the object.
171 	 */
172 	public this (RadioToolButton group)
173 	{
174 		// GtkToolItem * gtk_radio_tool_button_new_from_widget  (GtkRadioToolButton *group);
175 		auto p = gtk_radio_tool_button_new_from_widget((group is null) ? null : group.getRadioToolButtonStruct());
176 		if(p is null)
177 		{
178 			throw new ConstructionException("null returned by gtk_radio_tool_button_new_from_widget((group is null) ? null : group.getRadioToolButtonStruct())");
179 		}
180 		this(cast(GtkRadioToolButton*) p);
181 	}
182 	
183 	/**
184 	 * Creates a new GtkRadioToolButton adding it to the same group as group.
185 	 * The new GtkRadioToolButton will contain an icon and label from the
186 	 * stock item indicated by stock_id.
187 	 * Since 2.4
188 	 * Params:
189 	 * group = An existing GtkRadioToolButton.
190 	 * stockId = the name of a stock item
191 	 * Throws: ConstructionException GTK+ fails to create the object.
192 	 */
193 	public this (RadioToolButton group, string stockId)
194 	{
195 		// GtkToolItem * gtk_radio_tool_button_new_with_stock_from_widget  (GtkRadioToolButton *group,  const gchar *stock_id);
196 		auto p = gtk_radio_tool_button_new_with_stock_from_widget((group is null) ? null : group.getRadioToolButtonStruct(), Str.toStringz(stockId));
197 		if(p is null)
198 		{
199 			throw new ConstructionException("null returned by gtk_radio_tool_button_new_with_stock_from_widget((group is null) ? null : group.getRadioToolButtonStruct(), Str.toStringz(stockId))");
200 		}
201 		this(cast(GtkRadioToolButton*) p);
202 	}
203 	
204 	/**
205 	 * Returns the radio button group button belongs to.
206 	 * Since 2.4
207 	 * Returns: The group button belongs to. [transfer none]
208 	 */
209 	public ListSG getGroup()
210 	{
211 		// GSList * gtk_radio_tool_button_get_group (GtkRadioToolButton *button);
212 		auto p = gtk_radio_tool_button_get_group(gtkRadioToolButton);
213 		
214 		if(p is null)
215 		{
216 			return null;
217 		}
218 		
219 		return ObjectG.getDObject!(ListSG)(cast(GSList*) p);
220 	}
221 	
222 	/**
223 	 * Adds button to group, removing it from the group it belonged to before.
224 	 * Since 2.4
225 	 * Params:
226 	 * group = an existing radio button group
227 	 */
228 	public void setGroup(ListSG group)
229 	{
230 		// void gtk_radio_tool_button_set_group (GtkRadioToolButton *button,  GSList *group);
231 		gtk_radio_tool_button_set_group(gtkRadioToolButton, (group is null) ? null : group.getListSGStruct());
232 	}
233 }