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 change21 // find conversion definition on APILookup.txt22 // implement new conversion functionalities on the wrap.utils pakage23 24 /*
25 * Conversion parameters:
26 * inFile = libgda-gda-parameter.html
27 * outPack = gda
28 * outFile = Parameter
29 * strct = GdaParameter
30 * realStrct=
31 * ctorStrct=
32 * clss = Parameter
33 * interf =
34 * class Code: No
35 * interface Code: No
36 * template for:
37 * extend =
38 * implements:
39 * prefixes:
40 * - gda_parameter_
41 * omit structs:
42 * omit prefixes:
43 * - gda_parameter_list_
44 * omit code:
45 * omit signals:
46 * imports:
47 * - glib.Str
48 * - gobject.ObjectG
49 * - gda.Value
50 * structWrap:
51 * - GObject* -> ObjectG
52 * - GdaParameter* -> Parameter
53 * - GdaValue* -> Value
54 * module aliases:
55 * local aliases:
56 * overrides:
57 */58 59 modulegda.Parameter;
60 61 publicimportgdac.gdatypes;
62 63 privateimportgdac.gda;
64 privateimportglib.ConstructionException;
65 privateimportgobject.ObjectG;
66 67 68 privateimportglib.Str;
69 privateimportgobject.ObjectG;
70 privateimportgda.Value;
71 72 73 74 75 /**
76 * Description
77 * Parameters are the way clients have to send an unlimited number
78 * of arguments to the providers.
79 */80 publicclassParameter81 {
82 83 /** the main Gtk struct */84 protectedGdaParameter* gdaParameter;
85 86 87 publicGdaParameter* getParameterStruct()
88 {
89 returngdaParameter;
90 }
91 92 93 /** the main Gtk struct as a void* */94 protectedvoid* getStruct()
95 {
96 returncast(void*)gdaParameter;
97 }
98 99 /**
100 * Sets our main struct and passes it to the parent class
101 */102 publicthis (GdaParameter* gdaParameter)
103 {
104 this.gdaParameter = gdaParameter;
105 }
106 107 /**
108 */109 110 /**
111 * Returns:
112 */113 publicstaticGTypegetType()
114 {
115 // GType gda_parameter_get_type (void);116 returngda_parameter_get_type();
117 }
118 119 /**
120 * Creates a new GdaParameter object, which is usually used
121 * with GdaParameterList.
122 * Params:
123 * name = name for the parameter being created.
124 * value = a GdaValue for this parameter.
125 * Throws: ConstructionException GTK+ fails to create the object.
126 */127 publicthis (stringname, Valuevalue)
128 {
129 // GdaParameter* gda_parameter_new_from_value (const gchar *name, const GdaValue *value);130 autop = gda_parameter_new_from_value(Str.toStringz(name), (valueisnull) ? null : value.getValueStruct());
131 if(pisnull)
132 {
133 thrownewConstructionException("null returned by gda_parameter_new_from_value(Str.toStringz(name), (value is null) ? null : value.getValueStruct())");
134 }
135 this(cast(GdaParameter*) p);
136 }
137 138 /**
139 * Creates a new GdaParameter from a gboolean value.
140 * Params:
141 * name = name for the parameter being created.
142 * value = a boolean value.
143 * Throws: ConstructionException GTK+ fails to create the object.
144 */145 publicthis (stringname, intvalue)
146 {
147 // GdaParameter* gda_parameter_new_boolean (const gchar *name, gboolean value);148 autop = gda_parameter_new_boolean(Str.toStringz(name), value);
149 if(pisnull)
150 {
151 thrownewConstructionException("null returned by gda_parameter_new_boolean(Str.toStringz(name), value)");
152 }
153 this(cast(GdaParameter*) p);
154 }
155 156 /**
157 * Creates a new GdaParameter from a gdouble value.
158 * Params:
159 * name = name for the parameter being created.
160 * value = a gdouble value.
161 * Throws: ConstructionException GTK+ fails to create the object.
162 */163 publicthis (stringname, doublevalue)
164 {
165 // GdaParameter* gda_parameter_new_double (const gchar *name, gdouble value);166 autop = gda_parameter_new_double(Str.toStringz(name), value);
167 if(pisnull)
168 {
169 thrownewConstructionException("null returned by gda_parameter_new_double(Str.toStringz(name), value)");
170 }
171 this(cast(GdaParameter*) p);
172 }
173 174 /**
175 * Creates a new GdaParameter from a GObject.
176 * Params:
177 * name = name for the parameter being created.
178 * value = a GObject value.
179 * Throws: ConstructionException GTK+ fails to create the object.
180 */181 publicthis (stringname, ObjectGvalue)
182 {
183 // GdaParameter* gda_parameter_new_gobject (const gchar *name, const GObject *value);184 autop = gda_parameter_new_gobject(Str.toStringz(name), (valueisnull) ? null : value.getObjectGStruct());
185 if(pisnull)
186 {
187 thrownewConstructionException("null returned by gda_parameter_new_gobject(Str.toStringz(name), (value is null) ? null : value.getObjectGStruct())");
188 }
189 this(cast(GdaParameter*) p);
190 }
191 192 /**
193 * Creates a new GdaParameter from a string.
194 * Params:
195 * name = name for the parameter being created.
196 * value = string value.
197 * Throws: ConstructionException GTK+ fails to create the object.
198 */199 publicthis (stringname, stringvalue)
200 {
201 // GdaParameter* gda_parameter_new_string (const gchar *name, const gchar *value);202 autop = gda_parameter_new_string(Str.toStringz(name), Str.toStringz(value));
203 if(pisnull)
204 {
205 thrownewConstructionException("null returned by gda_parameter_new_string(Str.toStringz(name), Str.toStringz(value))");
206 }
207 this(cast(GdaParameter*) p);
208 }
209 210 /**
211 * Creates a new GdaParameter from an existing one.
212 * Returns: a newly allocated GdaParameter with a copy of the data in param.
213 */214 publicParametercopy()
215 {
216 // GdaParameter* gda_parameter_copy (GdaParameter *param);217 autop = gda_parameter_copy(gdaParameter);
218 219 if(pisnull)
220 {
221 returnnull;
222 }
223 224 returnObjectG.getDObject!(Parameter)(cast(GdaParameter*) p);
225 }
226 227 /**
228 * Releases all memory occupied by the given GdaParameter.
229 */230 publicvoidfree()
231 {
232 // void gda_parameter_free (GdaParameter *param);233 gda_parameter_free(gdaParameter);
234 }
235 236 /**
237 * Returns: the name of the given GdaParameter.
238 */239 publicstringgetName()
240 {
241 // const gchar* gda_parameter_get_name (GdaParameter *param);242 returnStr.toString(gda_parameter_get_name(gdaParameter));
243 }
244 245 /**
246 * Sets the name of the given GdaParameter.
247 * Params:
248 * name = new name for the parameter.
249 */250 publicvoidsetName(stringname)
251 {
252 // void gda_parameter_set_name (GdaParameter *param, const gchar *name);253 gda_parameter_set_name(gdaParameter, Str.toStringz(name));
254 }
255 256 /**
257 * Returns: the value stored in the given param.
258 */259 publicValuegetValue()
260 {
261 // const GdaValue* gda_parameter_get_value (GdaParameter *param);262 autop = gda_parameter_get_value(gdaParameter);
263 264 if(pisnull)
265 {
266 returnnull;
267 }
268 269 returnObjectG.getDObject!(Value)(cast(GdaValue*) p);
270 }
271 272 /**
273 * Stores the given value in the given param.
274 * Params:
275 * value = a GdaValue.
276 */277 publicvoidsetValue(Valuevalue)
278 {
279 // void gda_parameter_set_value (GdaParameter *param, GdaValue *value);280 gda_parameter_set_value(gdaParameter, (valueisnull) ? null : value.getValueStruct());
281 }
282 }