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-GdaTable.html
45 * - gda.FieldAttributes
47 * - GdaDataModel* -> DataModel
48 * - GdaFieldAttributes* -> FieldAttributes
49 * - GdaTable* -> Table
60 import tango
.io
.Stdout
; // use the tango loging?
64 private import gdac
.gdatypes
;
66 private import gdac
.gda
;
69 private import gda
.DataModel
;
70 private import gda
.FieldAttributes
;
81 /** the main Gtk struct */
82 protected GdaTable
* gdaTable
;
85 public GdaTable
* getTableStruct()
91 /** the main Gtk struct as a void* */
92 protected void* getStruct()
94 return cast(void*)gdaTable
;
98 * Sets our main struct and passes it to the parent class
100 public this (GdaTable
* gdaTable
)
104 if ( gdaTable
is null )
109 Stdout("struct gdaTable is null on constructor").newline
;
113 printf("struct gdaTable is null on constructor");
120 assert(gdaTable
!is null, "struct gdaTable is null on constructor");
122 this.gdaTable
= gdaTable
;
130 * Creates a new GdaTable object, which is an in-memory representation
131 * of an entire table. It is mainly used by the GdaXmlDatabase class,
132 * but you can also use it in your applications for whatever you may need
135 * name for the new table.
137 * the newly created object.
139 public this (char[] name
)
141 // GdaTable* gda_table_new (const gchar *name);
142 this(cast(GdaTable
*)gda_table_new(Str
.toStringz(name
)) );
146 * Creates a GdaTable object from the given GdaDataModel. This
147 * is very useful to maintain an in-memory copy of a given
148 * recordset obtained from a database. This is also used when
149 * exporting data to a GdaXmlDatabase object.
151 * name for the new table.
153 * model to create the table from.
155 * whether to add model's data or not.
157 * the newly created object.
159 public this (char[] name
, DataModel model
, int addData
)
161 // GdaTable* gda_table_new_from_model (const gchar *name, const GdaDataModel *model, gboolean add_data);
162 this(cast(GdaTable
*)gda_table_new_from_model(Str
.toStringz(name
), (model
is null) ?
null : model
.getDataModelStruct(), addData
) );
169 * the name of the given GdaTable.
171 public char[] getName()
173 // const gchar* gda_table_get_name (GdaTable *table);
174 return Str
.toString(gda_table_get_name(gdaTable
) );
178 * Sets the name of the given GdaTable.
182 * new name for the table.
184 public void setName(char[] name
)
186 // void gda_table_set_name (GdaTable *table, const gchar *name);
187 gda_table_set_name(gdaTable
, Str
.toStringz(name
));
191 * Adds a field to the given GdaTable.
195 * attributes for the new field.
197 public void addField(FieldAttributes fa
)
199 // void gda_table_add_field (GdaTable *table, const GdaFieldAttributes *fa);
200 gda_table_add_field(gdaTable
, (fa
is null) ?
null : fa
.getFieldAttributesStruct());
204 * Adds data in the given table from the given model.
208 * a GdaDataModel object.
210 public void addDataFromModel(DataModel model
)
212 // void gda_table_add_data_from_model (GdaTable *table, const GdaDataModel *model);
213 gda_table_add_data_from_model(gdaTable
, (model
is null) ?
null : model
.getDataModelStruct());