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  * Description
77  */
78 public class DataModelList : DataModel
79 {
80 	
81 	/** the main Gtk struct */
82 	protected GdaDataModelList* gdaDataModelList;
83 	
84 	
85 	public GdaDataModelList* getDataModelListStruct()
86 	{
87 		return gdaDataModelList;
88 	}
89 	
90 	
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)gdaDataModelList;
95 	}
96 	
97 	/**
98 	 * Sets our main struct and passes it to the parent class
99 	 */
100 	public this (GdaDataModelList* gdaDataModelList)
101 	{
102 		super(cast(GdaDataModel*)gdaDataModelList);
103 		this.gdaDataModelList = gdaDataModelList;
104 	}
105 	
106 	protected override void setStruct(GObject* obj)
107 	{
108 		super.setStruct(obj);
109 		gdaDataModelList = cast(GdaDataModelList*)obj;
110 	}
111 	
112 	/**
113 	 */
114 	
115 	/**
116 	 * Throws: ConstructionException GTK+ fails to create the object.
117 	 */
118 	public this ()
119 	{
120 		// GdaDataModel* gda_data_model_list_new (void);
121 		auto p = gda_data_model_list_new();
122 		if(p is null)
123 		{
124 			throw new ConstructionException("null returned by gda_data_model_list_new()");
125 		}
126 		this(cast(GdaDataModelList*) p);
127 	}
128 	
129 	/**
130 	 * Params:
131 	 * list = a list of strings.
132 	 * Throws: ConstructionException GTK+ fails to create the object.
133 	 */
134 	public this (ListG list)
135 	{
136 		// GdaDataModel* gda_data_model_list_new_from_string_list  (const GList *list);
137 		auto p = gda_data_model_list_new_from_string_list((list is null) ? null : list.getListGStruct());
138 		if(p is null)
139 		{
140 			throw new ConstructionException("null returned by gda_data_model_list_new_from_string_list((list is null) ? null : list.getListGStruct())");
141 		}
142 		this(cast(GdaDataModelList*) p);
143 	}
144 	
145 	/**
146 	 * Inserts a row in the model, using value.
147 	 * Params:
148 	 * value = a GdaValue which will be used to fill the row.
149 	 * Returns: the GdaRow which has been inserted, or NULL on failure.
150 	 */
151 	public Row appendValue(Value value)
152 	{
153 		// const GdaRow* gda_data_model_list_append_value (GdaDataModelList *model,  const GdaValue *value);
154 		auto p = gda_data_model_list_append_value(gdaDataModelList, (value is null) ? null : value.getValueStruct());
155 		
156 		if(p is null)
157 		{
158 			return null;
159 		}
160 		
161 		return ObjectG.getDObject!(Row)(cast(GdaRow*) p);
162 	}
163 }