ide-tree-model

ide-tree-model

Functions

Properties

gchar * kind Read / Write
IdeTreeNode * root Read / Write
IdeTree * tree Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── IdeObject
        ╰── IdeTreeModel

Implemented Interfaces

IdeTreeModel implements GtkTreeModel, GtkTreeDragDest and GtkTreeDragSource.

Description

Functions

ide_tree_model_get_tree ()

IdeTree *
ide_tree_model_get_tree (IdeTreeModel *self);

Parameters

self

a IdeTreeModel

 

Returns

an IdeTree.

[transfer none]

Since: 3.32


ide_tree_model_get_root ()

IdeTreeNode *
ide_tree_model_get_root (IdeTreeModel *self);

Gets the root IdeTreeNode. This node is never visualized in the tree, but is used to build the immediate children which are displayed in the tree.

Parameters

self

a IdeTreeModel

 

Returns

an IdeTreeNode.

[transfer none][not nullable]

Since: 3.32


ide_tree_model_set_root ()

void
ide_tree_model_set_root (IdeTreeModel *self,
                         IdeTreeNode *root);

ide_tree_model_get_kind ()

const gchar *
ide_tree_model_get_kind (IdeTreeModel *self);

Gets the kind of model that is being generated. See “kind” for more information.

Parameters

self

a IdeTreeModel

 

Returns

a string containing the kind, or NULL.

[nullable]

Since: 3.32


ide_tree_model_set_kind ()

void
ide_tree_model_set_kind (IdeTreeModel *self,
                         const gchar *kind);

Sets the kind of model that is being created. This determines what plugins are used to generate the tree contents.

This should be set before adding the IdeTreeModel to an IdeObject to ensure the tree builds the proper contents.

Parameters

self

a IdeTreeModel

 

kind

a string describing the kind of model

 

Since: 3.32


ide_tree_model_get_node ()

IdeTreeNode *
ide_tree_model_get_node (IdeTreeModel *self,
                         GtkTreeIter *iter);

Gets the IdeTreeNode found at iter .

Parameters

self

a IdeTreeModel

 

iter

a GtkTreeIter

 

Returns

an IdeTreeNode or NULL.

[transfer none][nullable]

Since: 3.32


ide_tree_model_get_path_for_node ()

GtkTreePath *
ide_tree_model_get_path_for_node (IdeTreeModel *self,
                                  IdeTreeNode *node);

Gets the GtkTreePath pointing at node .

Parameters

self

an IdeTreeModel

 

node

an IdeTreeNode

 

Returns

a new GtkTreePath.

[transfer full][nullable]

Since: 3.32


ide_tree_model_get_iter_for_node ()

gboolean
ide_tree_model_get_iter_for_node (IdeTreeModel *self,
                                  GtkTreeIter *iter,
                                  IdeTreeNode *node);

Gets a GtkTreeIter that points at node .

Parameters

self

an IdeTreeModel

 

iter

a GtkTreeIter.

[out]

node

an IdeTreeNode

 

Returns

TRUE if iter was set; otherwise FALSE

Since: 3.32


ide_tree_model_invalidate ()

void
ide_tree_model_invalidate (IdeTreeModel *self,
                           IdeTreeNode *node);

Invalidates model starting from node so that those items are rebuilt using the configured tree addins.

If node is NULL, the root of the tree is invalidated.

Parameters

self

a IdeTreeModel

 

node

an IdeTreeNode or NULL.

[nullable]

Since: 3.32


ide_tree_model_expand_async ()

void
ide_tree_model_expand_async (IdeTreeModel *self,
                             IdeTreeNode *node,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

ide_tree_model_expand_finish ()

gboolean
ide_tree_model_expand_finish (IdeTreeModel *self,
                              GAsyncResult *result,
                              GError **error);

Types and Values

IDE_TYPE_TREE_MODEL

#define IDE_TYPE_TREE_MODEL (ide_tree_model_get_type())

IdeTreeModel

typedef struct _IdeTreeModel IdeTreeModel;

Property Details

The “kind” property

  “kind”                     gchar *

The "kind" property is used to determine what IdeTreeAddin plugins to load. Only plugins which match the "kind" will be loaded to extend the tree contents.

For example, to extend the project-tree, plugins should set "X-Tree-Kind=project-tree" in their .plugin manifest.

Owner: IdeTreeModel

Flags: Read / Write

Default value: NULL

Since: 3.32


The “root” property

  “root”                     IdeTreeNode *

The "root" property contains the root IdeTreeNode that is used to build the tree. It should contain an object for the “item” property so that IdeTreeAddin's may use it to build the node and any children.

Owner: IdeTreeModel

Flags: Read / Write

Since: 3.32


The “tree” property

  “tree”                     IdeTree *

The tree the model belongs to.

Owner: IdeTreeModel

Flags: Read / Write / Construct Only