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