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