## IdeTreeAddin IdeTreeAddin |

## Functions

void | ide_tree_addin_load ()
void | ide_tree_addin_unload ()
void | ide_tree_addin_build_node ()
void | ide_tree_addin_build_children_async ()
gboolean | ide_tree_addin_build_children_finish ()
gboolean | ide_tree_addin_node_activated ()
void | ide_tree_addin_selection_changed ()
void | ide_tree_addin_node_expanded ()
void | ide_tree_addin_node_collapsed ()
gboolean | ide_tree_addin_node_draggable ()
gboolean | ide_tree_addin_node_droppable ()
void | ide_tree_addin_node_dropped_async ()
gboolean | ide_tree_addin_node_dropped_finish ()
void | ide_tree_addin_cell_data_func ()

## Types and Values

#define | IDE_TYPE_TREE_ADDIN
struct | IdeTreeAddinInterface
| IdeTreeAddin

## Object Hierarchy

        GInterface
        ╰── IdeTreeAddin

## Prerequisites

IdeTreeAddin requires GObject.

## Description

## Functions

### ide_tree_addin_load ()

    void
    ide_tree_addin_load (IdeTreeAddin *self,
                         IdeTree *tree,
                         IdeTreeModel *model);

### ide_tree_addin_unload ()

    void
    ide_tree_addin_unload (IdeTreeAddin *self,
                           IdeTree *tree,
                           IdeTreeModel *model);

### ide_tree_addin_build_node ()

    void
    ide_tree_addin_build_node (IdeTreeAddin *self,
                               IdeTreeNode *node);

This function is called when preparing a node for display in the tree.

Addins should adjust any state on the node that makes sense based on the addin.

You may want to use `ide_tree_node_holds()` to determine if the node contains an item that you are interested in.

#### Parameters

self | a IdeTreeAddin |
node | a IdeTreeNode |

Since: 3.32

### ide_tree_addin_build_children_async ()

    void
    ide_tree_addin_build_children_async (IdeTreeAddin *self,
                                         IdeTreeNode *node,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

This function is called when building the children of a node. This happens when expanding an node that might have children, or building the root node.

You may want to use `ide_tree_node_holds()` to determine if the node contains an item that you are interested in.

This function will call the synchronous form of IdeTreeAddin.build_children() if no asynchronous form is available.

#### Parameters

self | a IdeTreeAddin |
node | a IdeTreeNode |
cancellable | a GCancellable or `NULL`. | [nullable]
callback | a GAsyncReadyCallback or `NULL` |
user_data | user data for `callback` |

Since: 3.32

### ide_tree_addin_build_children_finish ()

    gboolean
    ide_tree_addin_build_children_finish (IdeTreeAddin *self,
                                          GAsyncResult *result,
                                          GError **error);

Completes an asynchronous request to `ide_tree_addin_build_children_async()`.

#### Parameters

self | a IdeTreeAddin |
result | result given to callback in `ide_tree_addin_build_children_async()` |
error | a location for a GError, or `NULL` |

#### Returns

`TRUE` if successful; otherwise `FALSE` and `error` is set.

Since: 3.32

### ide_tree_addin_node_activated ()

    gboolean
    ide_tree_addin_node_activated (IdeTreeAddin *self,
                                   IdeTree *tree,
                                   IdeTreeNode *node);

### ide_tree_addin_selection_changed ()

    void
    ide_tree_addin_selection_changed (IdeTreeAddin *self,
                                      IdeTreeNode *selection);

### ide_tree_addin_node_expanded ()

    void
    ide_tree_addin_node_expanded (IdeTreeAddin *self,
                                  IdeTreeNode *node);

### ide_tree_addin_node_collapsed ()

    void
    ide_tree_addin_node_collapsed (IdeTreeAddin *self,
                                   IdeTreeNode *node);

### ide_tree_addin_node_draggable ()

    gboolean
    ide_tree_addin_node_draggable (IdeTreeAddin *self,
                                   IdeTreeNode *node);

### ide_tree_addin_node_droppable ()

    gboolean
    ide_tree_addin_node_droppable (IdeTreeAddin *self,
                                   IdeTreeNode *drag_node,
                                   IdeTreeNode *drop_node,
                                   GtkSelectionData *selection);

### ide_tree_addin_node_dropped_async ()

    void
    ide_tree_addin_node_dropped_async (IdeTreeAddin *self,
                                       IdeTreeNode *drag_node,
                                       IdeTreeNode *drop_node,
                                       GtkSelectionData *selection,
                                       GdkDragAction actions,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

### ide_tree_addin_node_dropped_finish ()

    gboolean
    ide_tree_addin_node_dropped_finish (IdeTreeAddin *self,
                                        GAsyncResult *result,
                                        GError **error);

### ide_tree_addin_cell_data_func ()

    void
    ide_tree_addin_cell_data_func (IdeTreeAddin *self,
                                   IdeTreeNode *node,
                                   GtkCellRenderer *cell);

## Types and Values

### IDE_TYPE_TREE_ADDIN

    #define IDE_TYPE_TREE_ADDIN (ide_tree_addin_get_type ())

### struct IdeTreeAddinInterface

    struct IdeTreeAddinInterface {
      GTypeInterface parent;

      void     (*load)                  (IdeTreeAddin         *self,
                                         IdeTree              *tree,
                                         IdeTreeModel         *model);
      void     (*unload)                (IdeTreeAddin         *self,
                                         IdeTree              *tree,
                                         IdeTreeModel         *model);
      void     (*build_node)            (IdeTreeAddin         *self,
                                         IdeTreeNode          *node);
      void     (*build_children)        (IdeTreeAddin         *self,
                                         IdeTreeNode          *node);
      void     (*build_children_async)  (IdeTreeAddin         *self,
                                         IdeTreeNode          *node,
                                         GCancellable         *cancellable,
                                         GAsyncReadyCallback   callback,
                                         gpointer              user_data);
      gboolean (*build_children_finish) (IdeTreeAddin         *self,
                                         GAsyncResult         *result,
                                         GError              **error);
      void     (*cell_data_func)        (IdeTreeAddin         *self,
                                         IdeTreeNode          *node,
                                         GtkCellRenderer      *cell);
      gboolean (*node_activated)        (IdeTreeAddin         *self,
                                         IdeTree              *tree,
                                         IdeTreeNode          *node);
      void     (*selection_changed)     (IdeTreeAddin         *self,
                                         IdeTreeNode          *selection);
      void     (*node_expanded)         (IdeTreeAddin         *self,
                                         IdeTreeNode          *node);
      void     (*node_collapsed)        (IdeTreeAddin         *self,
                                         IdeTreeNode          *node);
      gboolean (*node_draggable)        (IdeTreeAddin         *self,
                                         IdeTreeNode          *node);
      gboolean (*node_droppable)        (IdeTreeAddin         *self,
                                         IdeTreeNode          *drag_node,
                                         IdeTreeNode          *drop_node,
                                         GtkSelectionData     *selection);
      void     (*node_dropped_async)    (IdeTreeAddin         *self,
                                         IdeTreeNode          *drag_node,
                                         IdeTreeNode          *drop_node,
                                         GtkSelectionData     *selection,
                                         GdkDragAction         actions,
                                         GCancellable         *cancellable,
                                         GAsyncReadyCallback   callback,
                                         gpointer              user_data);
      gboolean (*node_dropped_finish)   (IdeTreeAddin         *self,
                                         GAsyncResult         *result,
                                         GError              **error);
    };

### IdeTreeAddin

    typedef struct _IdeTreeAddin IdeTreeAddin;