Top |
GObject ╰── GdaTreeManager ├── GdaTreeMgrColumns ├── GdaTreeMgrLabel ├── GdaTreeMgrSchemas ├── GdaTreeMgrSelect ╰── GdaTreeMgrTables
A GdaTreeManager object is responsible for creating nodes in the tree(s) for which it operates.
When creating nodes, a GdaTreeManager object can (depending on its implementation), get some
named attributes from the node below which it has to create nodes, using the gda_tree_node_fetch_attribute()
or gda_tree_node_get_node_attribute()
. For example the GdaTreeMgrColumns manager (which creates a node for each column
of a table) needs the table name and the schema in which the table is; both can be specified using an
object's property, or, if not specified that way, are fetched as attributes.
The GdaTreeManager itself is an abstract type (which can't be instantiated). Use an existing sub class or subclass it yourself.
GSList * (*GdaTreeManagerNodesFunc) (GdaTreeManager *manager
,GdaTreeNode *node
,const GSList *children_nodes
,gboolean *out_error
,GError **error
);
GdaTreeManager *
gda_tree_manager_new_with_func (GdaTreeManagerNodesFunc update_func
);
Use this method to create a new GdaTreeManager if it's more convenient than subclassing; all is needed
is the update_func
function which is responsible for creating or updating the children nodes of a specified GdaTreeNode.
update_func |
the function to call when the manager object is requested to create or update its list of GdaTreeNode nodes. |
[scope call] |
Since: 4.2
void gda_tree_manager_add_manager (GdaTreeManager *manager
,GdaTreeManager *sub
);
Adds a sub manager to manager
. Use this method to create the skeleton structure
of a GdaTree. Note that a single GdaTreeManager can be used by several GdaTree objects
or several times in the same GdaTree's structure.
Please note that it's possible for mgr
and sub
to be the same object, but beware of the possible
infinite recursive behaviour in this case when creating children nodes
(depending on the actual implementation of the GdaTreeManager).
Since: 4.2
const GSList *
gda_tree_manager_get_managers (GdaTreeManager *manager
);
Get the list of sub managers which have already been added using gda_tree_manager_add_manager()
a list of GdaTreeMenager which should not be modified.
[transfer none][element-type Gda.TreeManager]
Since: 4.2
void gda_tree_manager_add_new_node_attribute (GdaTreeManager *manager
,const gchar *attribute
,const GValue *value
);
Requests that for any new node managed (eg. created) by manager
, a new attribute will be set. This allows
one to customize the attributes of new nodes created by an existing GdaTreeManager.
As a side effect, if value
is NULL
, then the corresponding attribute, if it was set, is unset.
Since: 4.2
GdaTreeNode * (*GdaTreeManagerNodeFunc) (GdaTreeManager *manager
,GdaTreeNode *parent
,const gchar *name
);
void gda_tree_manager_set_node_create_func (GdaTreeManager *manager
,GdaTreeManagerNodeFunc func
);
Sets the function to be called when a new node is being created by manager
. If func
is NULL
then each created node will be a GdaTreeNode object.
Specifying a custom GdaTreeManagerNodeFunc function for example allows one to use specialized sub-classed GdaTreeNode objects.
manager |
a GdaTreeManager tree manager object |
|
func |
a GdaTreeManagerNodeFunc function pointer, or |
[allow-none][scope call] |
Since: 4.2
GdaTreeManagerNodeFunc
gda_tree_manager_get_node_create_func (GdaTreeManager *manager
);
Get the function used by manager
when creating new GdaTreeNode nodes
[skip]
Since: 4.2
GdaTreeNode * gda_tree_manager_create_node (GdaTreeManager *manager
,GdaTreeNode *parent
,const gchar *name
);
Requests that manager
creates a new GdaTreeNode. The new node is not in any
way linked to manager
yet, consider this method as a GdaTreeNode factory.
This method is usually used when implementing a GdaTreeManagerNodesFunc function (to create nodes), or when subclassing the GdaTreeManager.
manager |
||
parent |
the parent the new node may have, or |
[allow-none] |
name |
name given to the new node, or |
[allow-none] |
Since: 4.2
“func”
property“func” gpointer
This property specifies the function which needs to be called when the list of GdaTreeNode nodes managed has to be updated
Owner: GdaTreeManager
Flags: Read / Write / Construct
“recursive”
property“recursive” gboolean
This property specifies if, when initially creating nodes or updating the list of nodes, the tree manager shoud also request that each node it has created or updated also initially create or update their children.
This property can typically set to FALSE if the process of creating children nodes is lenghty and needs to be postponed while an event occurs.
Owner: GdaTreeManager
Flags: Read / Write / Construct
Default value: TRUE