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  = GtkTreeStore.html
27  * outPack = gtk
28  * outFile = TreeStore
29  * strct   = GtkTreeStore
30  * realStrct=
31  * ctorStrct=
32  * clss    = TreeStore
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- BuildableIF
40  * 	- TreeModelIF
41  * 	- TreeDragSourceIF
42  * 	- TreeDragDestIF
43  * 	- TreeSortableIF
44  * prefixes:
45  * 	- gtk_tree_store_
46  * omit structs:
47  * omit prefixes:
48  * omit code:
49  * 	- gtk_tree_store_set
50  * omit signals:
51  * imports:
52  * 	- glib.Str
53  * 	- gtk.TreeIter
54  * 	- gobject.Value
55  * 	- gtk.TreeNode
56  * 	- gdk.Pixbuf;
57  * 	- gobject.Value;
58  * 	- gtk.BuildableIF
59  * 	- gtk.BuildableT
60  * 	- gtk.TreeModelT
61  * 	- gtk.TreeModelIF
62  * 	- gtk.TreeDragSourceT
63  * 	- gtk.TreeDragSourceIF
64  * 	- gtk.TreeDragDestT
65  * 	- gtk.TreeDragDestIF
66  * 	- gtk.TreeSortableT
67  * 	- gtk.TreeSortableIF
68  * structWrap:
69  * 	- GValue* -> Value
70  * 	- GtkTreeIter* -> TreeIter
71  * module aliases:
72  * local aliases:
73  * overrides:
74  */
75 
76 module gtk.TreeStore;
77 
78 public  import gtkc.gtktypes;
79 
80 private import gtkc.gtk;
81 private import glib.ConstructionException;
82 private import gobject.ObjectG;
83 
84 
85 private import glib.Str;
86 private import gtk.TreeIter;
87 private import gobject.Value;
88 private import gtk.TreeNode;
89 private import gdk.Pixbuf;;
90 private import gobject.Value;;
91 private import gtk.BuildableIF;
92 private import gtk.BuildableT;
93 private import gtk.TreeModelT;
94 private import gtk.TreeModelIF;
95 private import gtk.TreeDragSourceT;
96 private import gtk.TreeDragSourceIF;
97 private import gtk.TreeDragDestT;
98 private import gtk.TreeDragDestIF;
99 private import gtk.TreeSortableT;
100 private import gtk.TreeSortableIF;
101 
102 
103 
104 private import gobject.ObjectG;
105 
106 /**
107  * The GtkTreeStore object is a list model for use with a GtkTreeView
108  * widget. It implements the GtkTreeModel interface, and consequentialy,
109  * can use all of the methods available there. It also implements the
110  * GtkTreeSortable interface so it can be sorted by the view. Finally,
111  * it also implements the tree
112  * drag and drop
113  * interfaces.
114  *
115  * GtkTreeStore as GtkBuildable
116  *
117  * The GtkTreeStore implementation of the GtkBuildable interface allows
118  * to specify the model columns with a <columns> element that may
119  * contain multiple <column> elements, each specifying one model
120  * column. The "type" attribute specifies the data type for the column.
121  *
122  * $(DDOC_COMMENT example)
123  */
124 public class TreeStore : ObjectG, BuildableIF, TreeModelIF, TreeDragSourceIF, TreeDragDestIF, TreeSortableIF
125 {
126 	
127 	/** the main Gtk struct */
128 	protected GtkTreeStore* gtkTreeStore;
129 	
130 	
131 	public GtkTreeStore* getTreeStoreStruct()
132 	{
133 		return gtkTreeStore;
134 	}
135 	
136 	
137 	/** the main Gtk struct as a void* */
138 	protected override void* getStruct()
139 	{
140 		return cast(void*)gtkTreeStore;
141 	}
142 	
143 	/**
144 	 * Sets our main struct and passes it to the parent class
145 	 */
146 	public this (GtkTreeStore* gtkTreeStore)
147 	{
148 		super(cast(GObject*)gtkTreeStore);
149 		this.gtkTreeStore = gtkTreeStore;
150 	}
151 	
152 	protected override void setStruct(GObject* obj)
153 	{
154 		super.setStruct(obj);
155 		gtkTreeStore = cast(GtkTreeStore*)obj;
156 	}
157 	
158 	// add the Buildable capabilities
159 	mixin BuildableT!(GtkTreeStore);
160 	
161 	// add the TreeModel capabilities
162 	mixin TreeModelT!(GtkTreeStore);
163 	
164 	// add the TreeDragSource capabilities
165 	mixin TreeDragSourceT!(GtkTreeStore);
166 	
167 	// add the TreeDragDest capabilities
168 	mixin TreeDragDestT!(GtkTreeStore);
169 	
170 	// add the TreeSortable capabilities
171 	mixin TreeSortableT!(GtkTreeStore);
172 	
173 	/**
174 	 * Creates a top level iteractor.
175 	 * I don't think lists have but the top level iteractor
176 	 */
177 	TreeIter createIter(TreeIter parent=null)
178 	{
179 		GtkTreeIter* iter = new GtkTreeIter;
180 		gtk_tree_store_append(getTreeStoreStruct(), iter, (parent is null) ? null : parent.getTreeIterStruct());
181 		return new TreeIter(iter);
182 	}
183 	
184 	/**
185 	 * Sets one value into one cells.
186 	 * \todo confirm we need to destroy the Value instance
187 	 * Params:
188 	 *  iter = the tree iteractor, effectivly the row
189 	 *  column = to column number to set
190 	 *  value = the value
191 	 */
192 	void setValue(TreeIter iter, int column, string value)
193 	{
194 		gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, Str.toStringz(value) , -1);
195 	}
196 	
197 	/** ditto */
198 	void setValue(TreeIter iter, int column, int value)
199 	{
200 		gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, value, -1);
201 	}
202 	
203 	/** ditto */
204 	//TODO: confirm we need to destroy the Value instance
205 	void setValue(TreeIter iter, int column, Pixbuf pixbuf)
206 	{
207 		Value v = new Value(pixbuf);
208 		gtk_tree_store_set_value(gtkTreeStore, iter.getTreeIterStruct(), column, v.getValueStruct());
209 	}
210 	
211 	/**
212 	 * sets the values for one row
213 	 * Params:
214 	 *  iter = the row iteractor
215 	 *  columns = an arrays with the columns to set
216 	 *  values = an arrays with the values
217 	 */
218 	void set(TreeIter iter, int[] columns, char*[] values)
219 	{
220 		for ( int i=0 ; i<columns.length && i<values.length; i++ )
221 		{
222 			gtk_tree_store_set(
223 			gtkTreeStore,
224 			iter.getTreeIterStruct(),
225 			columns[i],
226 			values[i],-1);
227 		}
228 	}
229 	
230 	/** ditto */
231 	void set(TreeIter iter, int[] columns, string[] values)
232 	{
233 		for ( int i=0 ; i<columns.length && i<values.length; i++ )
234 		{
235 			gtk_tree_store_set(
236 			gtkTreeStore,
237 			iter.getTreeIterStruct(),
238 			columns[i],
239 			Str.toStringz(values[i]),-1);
240 		}
241 	}
242 	
243 	/**
244 	 * Sets an iteractor values from a tree node.
245 	 * This is the way to add a new row to the tree,
246 	 * the iteractor is either a top level iteractor created from createIter()
247 	 * or a nested iteractor created from append()
248 	 * Params:
249 	 *  iter = the iteractor to set
250 	 *  treeNode = the tree node
251 	 * See_Also: createIter(), append()
252 	 */
253 	void set(TreeIter iter, TreeNode treeNode)
254 	{
255 		int[] cols;
256 		string[] vals;
257 		for ( int i=0 ; i<treeNode.columnCount() ; i++ )
258 		{
259 			//printf(">>>>>>>>>>>>> requesting value for %d\n",i);
260 			cols ~= i;
261 			string value = treeNode.getNodeValue(i);
262 			if ( value  is  null )
263 			{
264 				vals ~= "";
265 			}
266 			else
267 			{
268 				vals ~= value;
269 			}
270 		}
271 		set(iter, cols, vals);
272 	}
273 	
274 	
275 	/**
276 	 * Creates and prepends a new row to tree_store. If parent is non-NULL, then it will prepend
277 	 * the new row before the first child of parent, otherwise it will prepend a row
278 	 * to the top level. iter will be changed to point to this new row. The row
279 	 * will be empty after this function is called. To fill in values, you need to
280 	 * call gtk_tree_store_set() or gtk_tree_store_set_value().
281 	 * Params:
282 	 *  parent = A valid GtkTreeIter, or NULL
283 	 */
284 	public TreeIter prepend(TreeIter parent)
285 	{
286 		TreeIter iter = new TreeIter();
287 		// void gtk_tree_store_prepend (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
288 		gtk_tree_store_prepend(gtkTreeStore, iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
289 		return iter;
290 	}
291 	
292 	/**
293 	 * Creates and appends a new row to tree_store. If parent is non-NULL, then it will append the
294 	 * new row after the last child of parent, otherwise it will append a row to
295 	 * the top level. iter will be changed to point to this new row. The row will
296 	 * be empty after this function is called. To fill in values, you need to call
297 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
298 	 * Params:
299 	 *  parent = A valid GtkTreeIter, or NULL
300 	 */
301 	public TreeIter append(TreeIter parent)
302 	{
303 		TreeIter iter = new TreeIter();
304 		// void gtk_tree_store_append (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
305 		gtk_tree_store_append(gtkTreeStore,
306 		iter.getTreeIterStruct(),
307 		(parent is null) ? null : parent.getTreeIterStruct());
308 		return iter;
309 	}
310 	
311 	/**
312 	 */
313 	
314 	/**
315 	 * Non vararg creation function. Used primarily by language bindings.
316 	 * Params:
317 	 * types = an array of GType types for the columns, from first to last. [array length=n_columns]
318 	 * Throws: ConstructionException GTK+ fails to create the object.
319 	 */
320 	public this (GType[] types)
321 	{
322 		// GtkTreeStore * gtk_tree_store_newv (gint n_columns,  GType *types);
323 		auto p = gtk_tree_store_newv(cast(int) types.length, types.ptr);
324 		if(p is null)
325 		{
326 			throw new ConstructionException("null returned by gtk_tree_store_newv(cast(int) types.length, types.ptr)");
327 		}
328 		this(cast(GtkTreeStore*) p);
329 	}
330 	
331 	/**
332 	 * This function is meant primarily for GObjects that inherit from
333 	 * GtkTreeStore, and should only be used when constructing a new
334 	 * GtkTreeStore. It will not function after a row has been added,
335 	 * or a method on the GtkTreeModel interface is called.
336 	 * Params:
337 	 * types = An array of GType types, one for each column. [array length=n_columns]
338 	 */
339 	public void setColumnTypes(GType[] types)
340 	{
341 		// void gtk_tree_store_set_column_types (GtkTreeStore *tree_store,  gint n_columns,  GType *types);
342 		gtk_tree_store_set_column_types(gtkTreeStore, cast(int) types.length, types.ptr);
343 	}
344 	
345 	/**
346 	 * Sets the data in the cell specified by iter and column.
347 	 * The type of value must be convertible to the type of the
348 	 * column.
349 	 * Params:
350 	 * iter = A valid GtkTreeIter for the row being modified
351 	 * column = column number to modify
352 	 * value = new value for the cell
353 	 */
354 	public void setValue(TreeIter iter, int column, Value value)
355 	{
356 		// void gtk_tree_store_set_value (GtkTreeStore *tree_store,  GtkTreeIter *iter,  gint column,  GValue *value);
357 		gtk_tree_store_set_value(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), column, (value is null) ? null : value.getValueStruct());
358 	}
359 	
360 	/**
361 	 * See gtk_tree_store_set(); this version takes a va_list for
362 	 * use by language bindings.
363 	 * Params:
364 	 * iter = A valid GtkTreeIter for the row being modified
365 	 * varArgs = va_list of column/value pairs
366 	 */
367 	public void setValist(TreeIter iter, void* varArgs)
368 	{
369 		// void gtk_tree_store_set_valist (GtkTreeStore *tree_store,  GtkTreeIter *iter,  va_list var_args);
370 		gtk_tree_store_set_valist(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), varArgs);
371 	}
372 	
373 	/**
374 	 * A variant of gtk_tree_store_set_valist() which takes
375 	 * the columns and values as two arrays, instead of varargs. This
376 	 * function is mainly intended for language bindings or in case
377 	 * the number of columns to change is not known until run-time.
378 	 * Since 2.12
379 	 * Params:
380 	 * iter = A valid GtkTreeIter for the row being modified
381 	 * columns = an array of column numbers. [array length=n_values]
382 	 * values = an array of GValues. [array length=n_values]
383 	 */
384 	public void setValuesv(TreeIter iter, int[] columns, GValue[] values)
385 	{
386 		// void gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,  GtkTreeIter *iter,  gint *columns,  GValue *values,  gint n_values);
387 		gtk_tree_store_set_valuesv(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), columns.ptr, values.ptr, cast(int) columns.length);
388 	}
389 	
390 	/**
391 	 * Removes iter from tree_store. After being removed, iter is set to the
392 	 * next valid row at that level, or invalidated if it previously pointed to the
393 	 * last one.
394 	 * Params:
395 	 * iter = A valid GtkTreeIter
396 	 * Returns: TRUE if iter is still valid, FALSE if not.
397 	 */
398 	public int remove(TreeIter iter)
399 	{
400 		// gboolean gtk_tree_store_remove (GtkTreeStore *tree_store,  GtkTreeIter *iter);
401 		return gtk_tree_store_remove(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
402 	}
403 	
404 	/**
405 	 * Creates a new row at position. If parent is non-NULL, then the row will be
406 	 * made a child of parent. Otherwise, the row will be created at the toplevel.
407 	 * If position is -1 or is larger than the number of rows at that level, then
408 	 * the new row will be inserted to the end of the list. iter will be changed
409 	 * to point to this new row. The row will be empty after this function is
410 	 * called. To fill in values, you need to call gtk_tree_store_set() or
411 	 * gtk_tree_store_set_value().
412 	 * Params:
413 	 * iter = An unset GtkTreeIter to set to the new row. [out]
414 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
415 	 * position = position to insert the new row, or -1 for last
416 	 */
417 	public void insert(TreeIter iter, TreeIter parent, int position)
418 	{
419 		// void gtk_tree_store_insert (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  gint position);
420 		gtk_tree_store_insert(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), position);
421 	}
422 	
423 	/**
424 	 * Inserts a new row before sibling. If sibling is NULL, then the row will
425 	 * be appended to parent 's children. If parent and sibling are NULL, then
426 	 * the row will be appended to the toplevel. If both sibling and parent are
427 	 * set, then parent must be the parent of sibling. When sibling is set,
428 	 * parent is optional.
429 	 * iter will be changed to point to this new row. The row will be empty after
430 	 * this function is called. To fill in values, you need to call
431 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
432 	 * Params:
433 	 * iter = An unset GtkTreeIter to set to the new row. [out]
434 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
435 	 * sibling = A valid GtkTreeIter, or NULL. [allow-none]
436 	 */
437 	public void insertBefore(TreeIter iter, TreeIter parent, TreeIter sibling)
438 	{
439 		// void gtk_tree_store_insert_before (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  GtkTreeIter *sibling);
440 		gtk_tree_store_insert_before(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), (sibling is null) ? null : sibling.getTreeIterStruct());
441 	}
442 	
443 	/**
444 	 * Inserts a new row after sibling. If sibling is NULL, then the row will be
445 	 * prepended to parent 's children. If parent and sibling are NULL, then
446 	 * the row will be prepended to the toplevel. If both sibling and parent are
447 	 * set, then parent must be the parent of sibling. When sibling is set,
448 	 * parent is optional.
449 	 * iter will be changed to point to this new row. The row will be empty after
450 	 * this function is called. To fill in values, you need to call
451 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
452 	 * Params:
453 	 * iter = An unset GtkTreeIter to set to the new row. [out]
454 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
455 	 * sibling = A valid GtkTreeIter, or NULL. [allow-none]
456 	 */
457 	public void insertAfter(TreeIter iter, TreeIter parent, TreeIter sibling)
458 	{
459 		// void gtk_tree_store_insert_after (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  GtkTreeIter *sibling);
460 		gtk_tree_store_insert_after(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), (sibling is null) ? null : sibling.getTreeIterStruct());
461 	}
462 	
463 	/**
464 	 * A variant of gtk_tree_store_insert_with_values() which takes
465 	 * the columns and values as two arrays, instead of varargs. This
466 	 * function is mainly intended for language bindings.
467 	 * Since 2.10
468 	 * Params:
469 	 * iter = An unset GtkTreeIter to set the new row, or NULL. [out][allow-none]
470 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
471 	 * position = position to insert the new row, or -1 for last
472 	 * columns = an array of column numbers. [array length=n_values]
473 	 * values = an array of GValues. [array length=n_values]
474 	 */
475 	public void insertWithValuesv(TreeIter iter, TreeIter parent, int position, int[] columns, GValue[] values)
476 	{
477 		// void gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  gint position,  gint *columns,  GValue *values,  gint n_values);
478 		gtk_tree_store_insert_with_valuesv(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), position, columns.ptr, values.ptr, cast(int) columns.length);
479 	}
480 	
481 	/**
482 	 * Prepends a new row to tree_store. If parent is non-NULL, then it will prepend
483 	 * the new row before the first child of parent, otherwise it will prepend a row
484 	 * to the top level. iter will be changed to point to this new row. The row
485 	 * will be empty after this function is called. To fill in values, you need to
486 	 * call gtk_tree_store_set() or gtk_tree_store_set_value().
487 	 * Params:
488 	 * iter = An unset GtkTreeIter to set to the prepended row. [out]
489 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
490 	 */
491 	public void prepend(TreeIter iter, TreeIter parent)
492 	{
493 		// void gtk_tree_store_prepend (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
494 		gtk_tree_store_prepend(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
495 	}
496 	
497 	/**
498 	 * Appends a new row to tree_store. If parent is non-NULL, then it will append the
499 	 * new row after the last child of parent, otherwise it will append a row to
500 	 * the top level. iter will be changed to point to this new row. The row will
501 	 * be empty after this function is called. To fill in values, you need to call
502 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
503 	 * Params:
504 	 * iter = An unset GtkTreeIter to set to the appended row. [out]
505 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
506 	 */
507 	public void append(TreeIter iter, TreeIter parent)
508 	{
509 		// void gtk_tree_store_append (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
510 		gtk_tree_store_append(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
511 	}
512 	
513 	/**
514 	 * Returns TRUE if iter is an ancestor of descendant. That is, iter is the
515 	 * parent (or grandparent or great-grandparent) of descendant.
516 	 * Params:
517 	 * iter = A valid GtkTreeIter
518 	 * descendant = A valid GtkTreeIter
519 	 * Returns: TRUE, if iter is an ancestor of descendant
520 	 */
521 	public int isAncestor(TreeIter iter, TreeIter descendant)
522 	{
523 		// gboolean gtk_tree_store_is_ancestor (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *descendant);
524 		return gtk_tree_store_is_ancestor(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (descendant is null) ? null : descendant.getTreeIterStruct());
525 	}
526 	
527 	/**
528 	 * Returns the depth of iter. This will be 0 for anything on the root level, 1
529 	 * for anything down a level, etc.
530 	 * Params:
531 	 * iter = A valid GtkTreeIter
532 	 * Returns: The depth of iter
533 	 */
534 	public int iterDepth(TreeIter iter)
535 	{
536 		// gint gtk_tree_store_iter_depth (GtkTreeStore *tree_store,  GtkTreeIter *iter);
537 		return gtk_tree_store_iter_depth(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
538 	}
539 	
540 	/**
541 	 * Removes all rows from tree_store
542 	 */
543 	public void clear()
544 	{
545 		// void gtk_tree_store_clear (GtkTreeStore *tree_store);
546 		gtk_tree_store_clear(gtkTreeStore);
547 	}
548 	
549 	/**
550 	 * WARNING: This function is slow. Only use it for debugging and/or testing
551 	 * purposes.
552 	 * Checks if the given iter is a valid iter for this GtkTreeStore.
553 	 * Since 2.2
554 	 * Params:
555 	 * iter = A GtkTreeIter.
556 	 * Returns: TRUE if the iter is valid, FALSE if the iter is invalid.
557 	 */
558 	public int iterIsValid(TreeIter iter)
559 	{
560 		// gboolean gtk_tree_store_iter_is_valid (GtkTreeStore *tree_store,  GtkTreeIter *iter);
561 		return gtk_tree_store_iter_is_valid(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
562 	}
563 	
564 	/**
565 	 * Reorders the children of parent in tree_store to follow the order
566 	 * indicated by new_order. Note that this function only works with
567 	 * unsorted stores.
568 	 * Since 2.2
569 	 * Params:
570 	 * parent = A GtkTreeIter.
571 	 * newOrder = an array of integers mapping the new position of each child
572 	 * to its old position before the re-ordering,
573 	 * i.e. new_order[newpos] = oldpos. [array]
574 	 */
575 	public void reorder(TreeIter parent, int[] newOrder)
576 	{
577 		// void gtk_tree_store_reorder (GtkTreeStore *tree_store,  GtkTreeIter *parent,  gint *new_order);
578 		gtk_tree_store_reorder(gtkTreeStore, (parent is null) ? null : parent.getTreeIterStruct(), newOrder.ptr);
579 	}
580 	
581 	/**
582 	 * Swaps a and b in the same level of tree_store. Note that this function
583 	 * only works with unsorted stores.
584 	 * Since 2.2
585 	 * Params:
586 	 * a = A GtkTreeIter.
587 	 * b = Another GtkTreeIter.
588 	 */
589 	public void swap(TreeIter a, TreeIter b)
590 	{
591 		// void gtk_tree_store_swap (GtkTreeStore *tree_store,  GtkTreeIter *a,  GtkTreeIter *b);
592 		gtk_tree_store_swap(gtkTreeStore, (a is null) ? null : a.getTreeIterStruct(), (b is null) ? null : b.getTreeIterStruct());
593 	}
594 	
595 	/**
596 	 * Moves iter in tree_store to the position before position. iter and
597 	 * position should be in the same level. Note that this function only
598 	 * works with unsorted stores. If position is NULL, iter will be
599 	 * moved to the end of the level.
600 	 * Since 2.2
601 	 * Params:
602 	 * iter = A GtkTreeIter.
603 	 * position = A GtkTreeIter or NULL. [allow-none]
604 	 */
605 	public void moveBefore(TreeIter iter, TreeIter position)
606 	{
607 		// void gtk_tree_store_move_before (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *position);
608 		gtk_tree_store_move_before(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (position is null) ? null : position.getTreeIterStruct());
609 	}
610 	
611 	/**
612 	 * Moves iter in tree_store to the position after position. iter and
613 	 * position should be in the same level. Note that this function only
614 	 * works with unsorted stores. If position is NULL, iter will be moved
615 	 * to the start of the level.
616 	 * Since 2.2
617 	 * Params:
618 	 * iter = A GtkTreeIter.
619 	 * position = A GtkTreeIter. [allow-none]
620 	 */
621 	public void moveAfter(TreeIter iter, TreeIter position)
622 	{
623 		// void gtk_tree_store_move_after (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *position);
624 		gtk_tree_store_move_after(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (position is null) ? null : position.getTreeIterStruct());
625 	}
626 }