2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = libgda-gda-field.html
27 * outFile = FieldAttributes
28 * strct = GdaFieldAttributes
31 * clss = FieldAttributes
39 * - gda_field_attributes_
48 * - GdaConnection* -> Connection
49 * - GdaFieldAttributes* -> FieldAttributes
50 * - GdaValue* -> Value
55 module gda
.FieldAttributes
;
61 import tango
.io
.Stdout
; // use the tango loging?
65 private import gdac
.gdatypes
;
67 private import gdac
.gda
;
70 private import glib
.ListG
;
71 private import gda
.Value
;
79 public class FieldAttributes
82 /** the main Gtk struct */
83 protected GdaFieldAttributes
* gdaFieldAttributes
;
86 public GdaFieldAttributes
* getFieldAttributesStruct()
88 return gdaFieldAttributes
;
92 /** the main Gtk struct as a void* */
93 protected void* getStruct()
95 return cast(void*)gdaFieldAttributes
;
99 * Sets our main struct and passes it to the parent class
101 public this (GdaFieldAttributes
* gdaFieldAttributes
)
105 if ( gdaFieldAttributes
is null )
110 Stdout("struct gdaFieldAttributes is null on constructor").newline
;
114 printf("struct gdaFieldAttributes is null on constructor");
121 assert(gdaFieldAttributes
!is null, "struct gdaFieldAttributes is null on constructor");
123 this.gdaFieldAttributes
= gdaFieldAttributes
;
135 public static GType
getType()
137 // GType gda_field_attributes_get_type (void);
138 return gda_field_attributes_get_type();
143 * a newly allocated GdaFieldAttributes object.
147 // GdaFieldAttributes* gda_field_attributes_new (void);
148 this(cast(GdaFieldAttributes
*)gda_field_attributes_new() );
152 * Creates a new GdaFieldAttributes object from an existing one.
154 * attributes to get a copy from.
156 * a newly allocated GdaFieldAttributes with a copy of the data
159 public FieldAttributes
copy()
161 // GdaFieldAttributes* gda_field_attributes_copy (GdaFieldAttributes *fa);
162 return new FieldAttributes( gda_field_attributes_copy(gdaFieldAttributes
) );
166 * Deallocates all memory associated to the given GdaFieldAttributes object.
168 * the resource to free.
172 // void gda_field_attributes_free (GdaFieldAttributes *fa);
173 gda_field_attributes_free(gdaFieldAttributes
);
177 * Tests whether two field attributes are equal.
179 * a GdaFieldAttributes
181 * another GdaFieldAttributes
183 * TRUE if the field attributes contain the same information.
185 public int equal(FieldAttributes rhs
)
187 // gboolean gda_field_attributes_equal (const GdaFieldAttributes *lhs, const GdaFieldAttributes *rhs);
188 return gda_field_attributes_equal(gdaFieldAttributes
, (rhs
is null) ?
null : rhs
.getFieldAttributesStruct());
193 * a GdaFieldAttributes.
195 * the defined size of fa.
197 public int getDefinedSize()
199 // glong gda_field_attributes_get_defined_size (GdaFieldAttributes *fa);
200 return gda_field_attributes_get_defined_size(gdaFieldAttributes
);
204 * Sets the defined size of a GdaFieldAttributes.
206 * a GdaFieldAttributes.
208 * the defined size we want to set.
210 public void setDefinedSize(int size
)
212 // void gda_field_attributes_set_defined_size (GdaFieldAttributes *fa, glong size);
213 gda_field_attributes_set_defined_size(gdaFieldAttributes
, size
);
218 * a GdaFieldAttributes.
222 public char[] getName()
224 // const gchar* gda_field_attributes_get_name (GdaFieldAttributes *fa);
225 return Str
.toString(gda_field_attributes_get_name(gdaFieldAttributes
) );
229 * Sets the name of fa to name.
231 * a GdaFieldAttributes.
233 * the new name of fa.
235 public void setName(char[] name
)
237 // void gda_field_attributes_set_name (GdaFieldAttributes *fa, const gchar *name);
238 gda_field_attributes_set_name(gdaFieldAttributes
, Str
.toStringz(name
));
243 * a GdaFieldAttributes.
245 * the name of the table to which this field belongs.
247 public char[] getTable()
249 // const gchar* gda_field_attributes_get_table (GdaFieldAttributes *fa);
250 return Str
.toString(gda_field_attributes_get_table(gdaFieldAttributes
) );
254 * Sets the name of the table to which the given field belongs.
256 * a GdaFieldAttributes.
260 public void setTable(char[] table
)
262 // void gda_field_attributes_set_table (GdaFieldAttributes *fa, const gchar *table);
263 gda_field_attributes_set_table(gdaFieldAttributes
, Str
.toStringz(table
));
268 * a GdaFieldAttributes.
272 public char[] getCaption()
274 // const gchar* gda_field_attributes_get_caption (GdaFieldAttributes *fa);
275 return Str
.toString(gda_field_attributes_get_caption(gdaFieldAttributes
) );
281 * a GdaFieldAttributes.
285 public void setCaption(char[] caption
)
287 // void gda_field_attributes_set_caption (GdaFieldAttributes *fa, const gchar *caption);
288 gda_field_attributes_set_caption(gdaFieldAttributes
, Str
.toStringz(caption
));
293 * a GdaFieldAttributes.
295 * the number of decimals of fa.
297 public int getScale()
299 // glong gda_field_attributes_get_scale (GdaFieldAttributes *fa);
300 return gda_field_attributes_get_scale(gdaFieldAttributes
);
304 * Sets the scale of fa to scale.
306 * a GdaFieldAttributes.
308 * number of decimals.
310 public void setScale(int scale
)
312 // void gda_field_attributes_set_scale (GdaFieldAttributes *fa, glong scale);
313 gda_field_attributes_set_scale(gdaFieldAttributes
, scale
);
318 * a GdaFieldAttributes.
322 public GdaValueType
getGdatype()
324 // GdaValueType gda_field_attributes_get_gdatype (GdaFieldAttributes *fa);
325 return gda_field_attributes_get_gdatype(gdaFieldAttributes
);
329 * Sets the type of fa to type.
331 * a GdaFieldAttributes.
333 * the new type of fa.
335 public void setGdatype(GdaValueType type
)
337 // void gda_field_attributes_set_gdatype (GdaFieldAttributes *fa, GdaValueType type);
338 gda_field_attributes_set_gdatype(gdaFieldAttributes
, type
);
342 * Gets the 'allow null' flag of the given field attributes.
344 * a GdaFieldAttributes.
346 * whether the given field allows null values or not (TRUE or FALSE).
348 public int getAllowNull()
350 // gboolean gda_field_attributes_get_allow_null (GdaFieldAttributes *fa);
351 return gda_field_attributes_get_allow_null(gdaFieldAttributes
);
355 * Sets the 'allow null' flag of the given field attributes.
357 * a GdaFieldAttributes.
359 * whether the given field should allows null values or not.
361 public void setAllowNull(int allow
)
363 // void gda_field_attributes_set_allow_null (GdaFieldAttributes *fa, gboolean allow);
364 gda_field_attributes_set_allow_null(gdaFieldAttributes
, allow
);
369 * a GdaFieldAttributes.
371 * whether if the given field is a primary key (TRUE or FALSE).
373 public int getPrimaryKey()
375 // gboolean gda_field_attributes_get_primary_key (GdaFieldAttributes *fa);
376 return gda_field_attributes_get_primary_key(gdaFieldAttributes
);
380 * Sets the 'primary key' flag of the given field attributes.
382 * a GdaFieldAttributes.
384 * whether if the given field should be a primary key.
386 public void setPrimaryKey(int pk
)
388 // void gda_field_attributes_set_primary_key (GdaFieldAttributes *fa, gboolean pk);
389 gda_field_attributes_set_primary_key(gdaFieldAttributes
, pk
);
394 * a GdaFieldAttributes.
396 * whether if the given field is an unique key (TRUE or FALSE).
398 public int getUniqueKey()
400 // gboolean gda_field_attributes_get_unique_key (GdaFieldAttributes *fa);
401 return gda_field_attributes_get_unique_key(gdaFieldAttributes
);
405 * Sets the 'unique key' flag of the given field attributes.
407 * a GdaFieldAttributes.
409 * whether if the given field should be an unique key.
411 public void setUniqueKey(int uk
)
413 // void gda_field_attributes_set_unique_key (GdaFieldAttributes *fa, gboolean uk);
414 gda_field_attributes_set_unique_key(gdaFieldAttributes
, uk
);
419 * a GdaFieldAttributes.
423 public char[] getReferences()
425 // const gchar* gda_field_attributes_get_references (GdaFieldAttributes *fa);
426 return Str
.toString(gda_field_attributes_get_references(gdaFieldAttributes
) );
430 * Sets fa's references.
432 * a GdaFieldAttributes.
436 public void setReferences(char[] doref
)
438 // void gda_field_attributes_set_references (GdaFieldAttributes *fa, const gchar *ref);
439 gda_field_attributes_set_references(gdaFieldAttributes
, Str
.toStringz(doref
));
444 * a GdaFieldAttributes.
446 * whether the given field is an auto incremented one (TRUE or FALSE).
448 public int getAutoIncrement()
450 // gboolean gda_field_attributes_get_auto_increment (GdaFieldAttributes *fa);
451 return gda_field_attributes_get_auto_increment(gdaFieldAttributes
);
455 * Sets the auto increment flag for the given field.
457 * a GdaFieldAttributes.
459 * auto increment status.
461 public void setAutoIncrement(int isAuto
)
463 // void gda_field_attributes_set_auto_increment (GdaFieldAttributes *fa, gboolean is_auto);
464 gda_field_attributes_set_auto_increment(gdaFieldAttributes
, isAuto
);
469 * a GdaFieldAttributes.
471 * the position of the field the attributes refer to in the
472 * containing data model.
474 public int getPosition()
476 // gint gda_field_attributes_get_position (GdaFieldAttributes *fa);
477 return gda_field_attributes_get_position(gdaFieldAttributes
);
481 * Sets the position of the field the attributes refer to in the containing
484 * a GdaFieldAttributes.
486 * the wanted position of the field in the containing data model.
488 public void setPosition(int position
)
490 // void gda_field_attributes_set_position (GdaFieldAttributes *fa, gint position);
491 gda_field_attributes_set_position(gdaFieldAttributes
, position
);
496 * a GdaFieldAttributes.
498 * fa's default value, as a GdaValue object.
500 public Value
getDefaultValue()
502 // const GdaValue* gda_field_attributes_get_default_value (GdaFieldAttributes *fa);
503 return new Value( gda_field_attributes_get_default_value(gdaFieldAttributes
) );
507 * Sets fa's default GdaValue.
509 * a GdaFieldAttributes.
511 * default GdaValue for the field
513 public void setDefaultValue(Value defaultValue
)
515 // void gda_field_attributes_set_default_value (GdaFieldAttributes *fa, const GdaValue *default_value);
516 gda_field_attributes_set_default_value(gdaFieldAttributes
, (defaultValue
is null) ?
null : defaultValue
.getValueStruct());