IdeWorkbenchAddin: Builder SDK Reference

## IdeWorkbenchAddin IdeWorkbenchAddin |

## Functions

void | ide_workbench_addin_load ()
void | ide_workbench_addin_unload ()
void | ide_workbench_addin_load_project_async ()
gboolean | ide_workbench_addin_load_project_finish ()
void | ide_workbench_addin_unload_project_async ()
gboolean | ide_workbench_addin_unload_project_finish ()
void | ide_workbench_addin_project_loaded ()
void | ide_workbench_addin_workspace_added ()
void | ide_workbench_addin_workspace_removed ()
gboolean | ide_workbench_addin_can_open ()
void | ide_workbench_addin_open_async ()
void | ide_workbench_addin_open_at_async ()
gboolean | ide_workbench_addin_open_finish ()
void | ide_workbench_addin_vcs_changed ()
IdeWorkbenchAddin * | ide_workbench_addin_find_by_module_name ()

## Types and Values

#define | IDE_TYPE_WORKBENCH_ADDIN
struct | IdeWorkbenchAddinInterface
| IdeWorkbenchAddin

## Object Hierarchy

        GInterface
        ╰── IdeWorkbenchAddin

## Prerequisites

IdeWorkbenchAddin requires GObject.

## Description

## Functions

### ide_workbench_addin_load ()

    void
    ide_workbench_addin_load (IdeWorkbenchAddin *self,
                              IdeWorkbench *workbench);

### ide_workbench_addin_unload ()

    void
    ide_workbench_addin_unload (IdeWorkbenchAddin *self,
                                IdeWorkbench *workbench);

### ide_workbench_addin_load_project_async ()

    void
    ide_workbench_addin_load_project_async
                                   (IdeWorkbenchAddin *self,
                                    IdeProjectInfo *project_info,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

### ide_workbench_addin_load_project_finish ()

    gboolean
    ide_workbench_addin_load_project_finish
                                   (IdeWorkbenchAddin *self,
                                    GAsyncResult *result,
                                    GError **error);

### ide_workbench_addin_unload_project_async ()

    void
    ide_workbench_addin_unload_project_async
                                   (IdeWorkbenchAddin *self,
                                    IdeProjectInfo *project_info,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

### ide_workbench_addin_unload_project_finish ()

    gboolean
    ide_workbench_addin_unload_project_finish
                                   (IdeWorkbenchAddin *self,
                                    GAsyncResult *result,
                                    GError **error);

### ide_workbench_addin_project_loaded ()

    void
    ide_workbench_addin_project_loaded (IdeWorkbenchAddin *self,
                                        IdeProjectInfo *project_info);

This function is called after the project has been loaded.

It is useful for situations where you do not need to influence the project loading, but do need to perform operations after it has completed.

#### Parameters

self | an IdeWorkbenchAddin |
project_info | an IdeProjectInfo |

Since: 3.32

### ide_workbench_addin_workspace_added ()

    void
    ide_workbench_addin_workspace_added (IdeWorkbenchAddin *self,
                                         IdeWorkspace *workspace);

### ide_workbench_addin_workspace_removed ()

    void
    ide_workbench_addin_workspace_removed (IdeWorkbenchAddin *self,
                                           IdeWorkspace *workspace);

### ide_workbench_addin_can_open ()

    gboolean
    ide_workbench_addin_can_open (IdeWorkbenchAddin *self,
                                  GFile *file,
                                  const gchar *content_type,
                                  gint *priority);

### ide_workbench_addin_open_async ()

    void
    ide_workbench_addin_open_async (IdeWorkbenchAddin *self,
                                    GFile *file,
                                    const gchar *content_type,
                                    IdeBufferOpenFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

### ide_workbench_addin_open_at_async ()

    void
    ide_workbench_addin_open_at_async (IdeWorkbenchAddin *self,
                                       GFile *file,
                                       const gchar *content_type,
                                       gint at_line,
                                       gint at_line_offset,
                                       IdeBufferOpenFlags flags,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

### ide_workbench_addin_open_finish ()

    gboolean
    ide_workbench_addin_open_finish (IdeWorkbenchAddin *self,
                                     GAsyncResult *result,
                                     GError **error);

### ide_workbench_addin_vcs_changed ()

    void
    ide_workbench_addin_vcs_changed (IdeWorkbenchAddin *self,
                                     IdeVcs *vcs);

This function notifies an IdeWorkbenchAddin that the version control system has changed. This happens when `ide_workbench_set_vcs()` is called or after an addin is loaded.

This is helpful for plugins that want to react to VCS changes such as changing branches, or tracking commits.

#### Parameters

self | a IdeWorkbenchAddin |
vcs | an IdeVcs. | [nullable]

Since: 3.32

### ide_workbench_addin_find_by_module_name ()

    IdeWorkbenchAddin *
    ide_workbench_addin_find_by_module_name
                                   (IdeWorkbench *workbench,
                                    const gchar *module_name);

Finds the addin (if any) matching the plugin's `module_name` .

#### Parameters

workbench | an IdeWorkbench |
module_name | the name of the addin module |

#### Returns

an IdeWorkbenchAddin or `NULL`.

[transfer none][nullable]

Since: 3.32

## Types and Values

### IDE_TYPE_WORKBENCH_ADDIN

    #define IDE_TYPE_WORKBENCH_ADDIN (ide_workbench_addin_get_type ())

### struct IdeWorkbenchAddinInterface

    struct IdeWorkbenchAddinInterface {
      GTypeInterface parent;

      void     (*load)                  (IdeWorkbenchAddin     *self,
                                         IdeWorkbench          *workbench);
      void     (*unload)                (IdeWorkbenchAddin     *self,
                                         IdeWorkbench          *workbench);
      void     (*load_project_async)    (IdeWorkbenchAddin     *self,
                                         IdeProjectInfo        *project_info,
                                         GCancellable          *cancellable,
                                         GAsyncReadyCallback    callback,
                                         gpointer               user_data);
      gboolean (*load_project_finish)   (IdeWorkbenchAddin     *self,
                                         GAsyncResult          *result,
                                         GError               **error);
      void     (*unload_project_async)  (IdeWorkbenchAddin     *self,
                                         IdeProjectInfo        *project_info,
                                         GCancellable          *cancellable,
                                         GAsyncReadyCallback    callback,
                                         gpointer               user_data);
      gboolean (*unload_project_finish) (IdeWorkbenchAddin     *self,
                                         GAsyncResult          *result,
                                         GError               **error);
      void     (*project_loaded)        (IdeWorkbenchAddin     *self,
                                         IdeProjectInfo        *project_info);
      void     (*workspace_added)       (IdeWorkbenchAddin     *self,
                                         IdeWorkspace          *workspace);
      void     (*workspace_removed)     (IdeWorkbenchAddin     *self,
                                         IdeWorkspace          *workspace);
      gboolean (*can_open)              (IdeWorkbenchAddin     *self,
                                         GFile                 *file,
                                         const gchar           *content_type,
                                         gint                  *priority);
      void     (*open_async)            (IdeWorkbenchAddin     *self,
                                         GFile                 *file,
                                         const gchar           *content_type,
                                         IdeBufferOpenFlags     flags,
                                         GCancellable          *cancellable,
                                         GAsyncReadyCallback    callback,
                                         gpointer               user_data);
      void     (*open_at_async)         (IdeWorkbenchAddin     *self,
                                         GFile                 *file,
                                         const gchar           *content_type,
                                         gint                   at_line,
                                         gint                   at_line_offset,
                                         IdeBufferOpenFlags     flags,
                                         GCancellable          *cancellable,
                                         GAsyncReadyCallback    callback,
                                         gpointer               user_data);
      gboolean (*open_finish)           (IdeWorkbenchAddin     *self,
                                         GAsyncResult          *result,
                                         GError               **error);
      void     (*vcs_changed)           (IdeWorkbenchAddin     *self,
                                         IdeVcs                *vcs);
    };

### IdeWorkbenchAddin

    typedef struct _IdeWorkbenchAddin IdeWorkbenchAddin;