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 module glib.TreeNode;
26 
27 private import glib.c.functions;
28 public  import glib.c.types;
29 
30 
31 /**
32  * An opaque type which identifies a specific node in a #GTree.
33  *
34  * Since: 2.68
35  */
36 public class TreeNode
37 {
38 	/** the main Gtk struct */
39 	protected GTreeNode* gTreeNode;
40 	protected bool ownedRef;
41 
42 	/** Get the main Gtk struct */
43 	public GTreeNode* getTreeNodeStruct(bool transferOwnership = false)
44 	{
45 		if (transferOwnership)
46 			ownedRef = false;
47 		return gTreeNode;
48 	}
49 
50 	/** the main Gtk struct as a void* */
51 	protected void* getStruct()
52 	{
53 		return cast(void*)gTreeNode;
54 	}
55 
56 	/**
57 	 * Sets our main struct and passes it to the parent class.
58 	 */
59 	public this (GTreeNode* gTreeNode, bool ownedRef = false)
60 	{
61 		this.gTreeNode = gTreeNode;
62 		this.ownedRef = ownedRef;
63 	}
64 
65 
66 	/**
67 	 * Gets the key stored at a particular tree node.
68 	 *
69 	 * Returns: the key at the node.
70 	 *
71 	 * Since: 2.68
72 	 */
73 	public void* key()
74 	{
75 		return g_tree_node_key(gTreeNode);
76 	}
77 
78 	/**
79 	 * Returns the next in-order node of the tree, or %NULL
80 	 * if the passed node was already the last one.
81 	 *
82 	 * Returns: the next node in the tree
83 	 *
84 	 * Since: 2.68
85 	 */
86 	public TreeNode next()
87 	{
88 		auto __p = g_tree_node_next(gTreeNode);
89 
90 		if(__p is null)
91 		{
92 			return null;
93 		}
94 
95 		return new TreeNode(cast(GTreeNode*) __p);
96 	}
97 
98 	/**
99 	 * Returns the previous in-order node of the tree, or %NULL
100 	 * if the passed node was already the first one.
101 	 *
102 	 * Returns: the previous node in the tree
103 	 *
104 	 * Since: 2.68
105 	 */
106 	public TreeNode previous()
107 	{
108 		auto __p = g_tree_node_previous(gTreeNode);
109 
110 		if(__p is null)
111 		{
112 			return null;
113 		}
114 
115 		return new TreeNode(cast(GTreeNode*) __p);
116 	}
117 
118 	/**
119 	 * Gets the value stored at a particular tree node.
120 	 *
121 	 * Returns: the value at the node.
122 	 *
123 	 * Since: 2.68
124 	 */
125 	public void* value()
126 	{
127 		return g_tree_node_value(gTreeNode);
128 	}
129 }