Top |
GdaTree * | gda_tree_new () |
void | gda_tree_add_manager () |
void | gda_tree_clean () |
gboolean | gda_tree_update_all () |
gboolean | gda_tree_update_part () |
gboolean | gda_tree_update_children () |
GSList * | gda_tree_get_nodes_in_path () |
GdaTreeNode * | gda_tree_get_node () |
gchar * | gda_tree_get_node_path () |
GdaTreeManager * | gda_tree_get_node_manager () |
void | gda_tree_set_attribute () |
void | gda_tree_dump () |
void | node-changed | Run Last |
void | node-deleted | Run Last |
void | node-has-child-toggled | Run Last |
void | node-inserted | Run Last |
The GdaTree is the top level object representing hierarchically structured data. From this object it is also possible (depending on the tree managers it uses), to clean (remove all the nodes) the whole tree, or to request a complete or partial update of the nodes.
It is also possible to set attributes to the tree itself (as it is possible to do for tree nodes), or to dump the whole or part of a tree in an indented and easy to read fashion.
void gda_tree_add_manager (GdaTree *tree
,GdaTreeManager *manager
);
Sets manager
as a top GdaTreeManager object, which will be responsible for creating top level nodes in tree
.
Since: 4.2
gboolean gda_tree_update_all (GdaTree *tree
,GError **error
);
Requests that tree
be populated with nodes. If an error occurs, then tree
's contents is left
unchanged, and otherwise tree
's previous contents is completely replaced by the new one.
Since: 4.2
gboolean gda_tree_update_part (GdaTree *tree
,GdaTreeNode *node
,GError **error
);
Requests that tree
be populated with nodes, starting from node
tree |
a GdaTree object |
|
node |
a GdaTreeNode node in |
|
error |
a place to store errors, or |
[allow-none] |
Since: 4.2
gboolean gda_tree_update_children (GdaTree *tree
,GdaTreeNode *node
,GError **error
);
Update the children of node
in tree
(not recursively, to update recursively, use
gda_tree_update_part()
). If node
is NULL
then the top level nodes are updated.
tree |
a GdaTree object |
|
node |
a GdaTreeNode node in |
[allow-none] |
error |
a place to store errors, or |
[allow-none] |
Since: 4.2.8
GSList * gda_tree_get_nodes_in_path (GdaTree *tree
,const gchar *tree_path
,gboolean use_names
);
The returned list is a list of all the GdaTreeNode nodes below the node at the specified path.
As a corner case if tree_path
is NULL
, then the returned list contains all the top level nodes.
tree |
a GdaTree object |
|
tree_path |
full path to the required nodes (if |
[allow-none] |
use_names |
if |
a new list of GdaTreeNode pointers, free it with g_slist_free()
.
[transfer container][element-type GdaTreeNode]
Since: 4.2
GdaTreeNode * gda_tree_get_node (GdaTree *tree
,const gchar *tree_path
,gboolean use_names
);
Locates a GdaTreeNode using the tree_path
path.
tree |
a GdaTree object |
|
tree_path |
full path to the required nodes (if |
|
use_names |
if |
Since: 4.2
gchar * gda_tree_get_node_path (GdaTree *tree
,GdaTreeNode *node
);
Get the path associated to node
in tree
.
Since: 4.2
GdaTreeManager * gda_tree_get_node_manager (GdaTree *tree
,GdaTreeNode *node
);
Get the GdaTreeManager which created node
in tree
Since: 4.2
void gda_tree_set_attribute (GdaTree *tree
,const gchar *attribute
,const GValue *value
,GDestroyNotify destroy
);
Sets an attribute to tree
, which will be accessible to any node in it.
Since: 4.2
void gda_tree_dump (GdaTree *tree
,GdaTreeNode *node
,FILE *stream
);
Dumps the contents of tree
to stream
, using a hierarchical view.
tree |
a GdaTree |
|
node |
a GdaTreeNode to start the dump from, or |
[allow-none] |
stream |
a stream to send the dump to, or |
[allow-none] |
Since: 4.2
“is-list”
property“is-list” gboolean
Tells if the GdaTree is a list or a tree.
Owner: GdaTree
Flags: Read
Default value: FALSE
“node-changed”
signalvoid user_function (GdaTree *tree, GdaTreeNode *node, gpointer user_data)
Gets emitted when a node
has changed in tree
tree |
the GdaTree |
|
node |
the GdaTreeNode which has changed |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 4.2
“node-deleted”
signalvoid user_function (GdaTree *tree, char *node_path, gpointer user_data)
Gets emitted when a node
has been removed from tree
tree |
the GdaTree |
|
node_path |
the position the node held in |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 4.2
“node-has-child-toggled”
signalvoid user_function (GdaTree *tree, GdaTreeNode *node, gpointer user_data)
Gets emitted when a node
has has a child when it did not have any or when it
does not have a ny children anymore when it had some
tree |
the GdaTree |
|
node |
the GdaTreeNode which changed from having children to being a leaf or the other way around |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 4.2
“node-inserted”
signalvoid user_function (GdaTree *tree, GdaTreeNode *node, gpointer user_data)
Gets emitted when a node
has been inserted in tree
tree |
the GdaTree |
|
node |
the GdaTreeNode which has inserted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 4.2