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 = libgda-GdaDataModelList.html 27 * outPack = gda 28 * outFile = DataModelList 29 * strct = GdaDataModelList 30 * realStrct= 31 * ctorStrct=GdaDataModel 32 * clss = DataModelList 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = GdaDataModel 38 * implements: 39 * prefixes: 40 * - gda_data_model_list_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.ListG 47 * - gda.Value 48 * - gda.Row 49 * structWrap: 50 * - GList* -> ListG 51 * - GdaRow* -> Row 52 * - GdaValue* -> Value 53 * module aliases: 54 * local aliases: 55 * overrides: 56 */ 57 58 module gda.DataModelList; 59 60 public import gdac.gdatypes; 61 62 private import gdac.gda; 63 private import glib.ConstructionException; 64 private import gobject.ObjectG; 65 66 67 private import glib.ListG; 68 private import gda.Value; 69 private import gda.Row; 70 71 72 73 private import gda.DataModel; 74 75 /** 76 */ 77 public class DataModelList : DataModel 78 { 79 80 /** the main Gtk struct */ 81 protected GdaDataModelList* gdaDataModelList; 82 83 84 public GdaDataModelList* getDataModelListStruct() 85 { 86 return gdaDataModelList; 87 } 88 89 90 /** the main Gtk struct as a void* */ 91 protected override void* getStruct() 92 { 93 return cast(void*)gdaDataModelList; 94 } 95 96 /** 97 * Sets our main struct and passes it to the parent class 98 */ 99 public this (GdaDataModelList* gdaDataModelList) 100 { 101 super(cast(GdaDataModel*)gdaDataModelList); 102 this.gdaDataModelList = gdaDataModelList; 103 } 104 105 protected override void setStruct(GObject* obj) 106 { 107 super.setStruct(obj); 108 gdaDataModelList = cast(GdaDataModelList*)obj; 109 } 110 111 /** 112 */ 113 114 /** 115 * Throws: ConstructionException GTK+ fails to create the object. 116 */ 117 public this () 118 { 119 // GdaDataModel* gda_data_model_list_new (void); 120 auto p = gda_data_model_list_new(); 121 if(p is null) 122 { 123 throw new ConstructionException("null returned by gda_data_model_list_new()"); 124 } 125 this(cast(GdaDataModelList*) p); 126 } 127 128 /** 129 * Params: 130 * list = a list of strings. 131 * Throws: ConstructionException GTK+ fails to create the object. 132 */ 133 public this (ListG list) 134 { 135 // GdaDataModel* gda_data_model_list_new_from_string_list (const GList *list); 136 auto p = gda_data_model_list_new_from_string_list((list is null) ? null : list.getListGStruct()); 137 if(p is null) 138 { 139 throw new ConstructionException("null returned by gda_data_model_list_new_from_string_list((list is null) ? null : list.getListGStruct())"); 140 } 141 this(cast(GdaDataModelList*) p); 142 } 143 144 /** 145 * Inserts a row in the model, using value. 146 * Params: 147 * value = a GdaValue which will be used to fill the row. 148 * Returns: the GdaRow which has been inserted, or NULL on failure. 149 */ 150 public Row appendValue(Value value) 151 { 152 // const GdaRow* gda_data_model_list_append_value (GdaDataModelList *model, const GdaValue *value); 153 auto p = gda_data_model_list_append_value(gdaDataModelList, (value is null) ? null : value.getValueStruct()); 154 155 if(p is null) 156 { 157 return null; 158 } 159 160 return ObjectG.getDObject!(Row)(cast(GdaRow*) p); 161 } 162 }