IdeContextAddin: Builder SDK Reference

## IdeContextAddin IdeContextAddin |

## Functions

void | ide_context_addin_load_project_async ()
gboolean | ide_context_addin_load_project_finish ()
void | ide_context_addin_load ()
void | ide_context_addin_unload ()
void | ide_context_addin_project_loaded ()

## Signals

void | project-loaded | Run Last

## Types and Values

#define | IDE_TYPE_CONTEXT_ADDIN
struct | IdeContextAddinInterface
| IdeContextAddin

## Object Hierarchy

        GInterface
        ╰── IdeContextAddin

## Prerequisites

IdeContextAddin requires GObject.

## Description

## Functions

### ide_context_addin_load_project_async ()

    void
    ide_context_addin_load_project_async (IdeContextAddin *self,
                                          IdeContext *context,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Requests to load a project with the IdeContextAddin.

This function is called when the IdeContext requests loading a project.

#### Parameters

self | an IdeContextAddin |
context | an IdeContext |
cancellable | a GCancellable or `NULL`. | [nullable]
callback | a callback to execute upon completion |
user_data | closure data for `callback` |

Since: 3.32

### ide_context_addin_load_project_finish ()

    gboolean
    ide_context_addin_load_project_finish (IdeContextAddin *self,
                                           GAsyncResult *result,
                                           GError **error);

Completes a request to load a project with the IdeContextAddin.

This function will be called from the callback provided to `ide_context_addin_load_project_async()`.

#### Parameters

self | an IdeContextAddin |
result | a GAsyncResult |
error | a location for a GError, or `NULL` |

#### Returns

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

Since: 3.32

### ide_context_addin_load ()

    void
    ide_context_addin_load (IdeContextAddin *self,
                            IdeContext *context);

Requests that the IdeContextAddin loads any necessary runtime features.

This is called when the IdeContext is created. If you would rather wait until a project is loaded, then use “project-loaded” to load runtime features.

#### Parameters

self | an IdeContextAddin |
context | an IdeContext |

Since: 3.32

### ide_context_addin_unload ()

    void
    ide_context_addin_unload (IdeContextAddin *self,
                              IdeContext *context);

Requests that the IdeContextAddin unloads any previously loaded resources.

#### Parameters

self | an IdeContextAddin |
context | an IdeContext |

Since: 3.32

### ide_context_addin_project_loaded ()

    void
    ide_context_addin_project_loaded (IdeContextAddin *self,
                                      IdeContext *context);

Emits the “project-loaded” signal.

This is called when the context has completed loading a project.

#### Parameters

self | an IdeContextAddin |
context | an IdeContext |

Since: 3.32

## Types and Values

### IDE_TYPE_CONTEXT_ADDIN

    #define IDE_TYPE_CONTEXT_ADDIN (ide_context_addin_get_type())

### struct IdeContextAddinInterface

    struct IdeContextAddinInterface {
      GTypeInterface parent_iface;

      void     (*load)                (IdeContextAddin      *self,
                                       IdeContext           *context);
      void     (*unload)              (IdeContextAddin      *self,
                                       IdeContext           *context);
      void     (*load_project_async)  (IdeContextAddin      *self,
                                       IdeContext           *context,
                                       GCancellable         *cancellable,
                                       GAsyncReadyCallback   callback,
                                       gpointer              user_data);
      gboolean (*load_project_finish) (IdeContextAddin      *self,
                                       GAsyncResult         *result,
                                       GError              **error);
      void     (*project_loaded)      (IdeContextAddin      *self,
                                       IdeContext           *context);
    };

### IdeContextAddin

    typedef struct _IdeContextAddin IdeContextAddin;

## Signal Details

### The `“project-loaded”` signal

    void
    user_function (IdeContextAddin *self,
                   IdeContext      *context,
                   gpointer         user_data)

The "project-loaded" signal is emitted after a project has been loaded in the IdeContext.

You might use this to setup any runtime features that rely on the project being successfully loaded first. Every addin's `ide_context_addin_load_project_async()` will have been called and completed before this signal is emitted.

#### Parameters

self | an IdeContextAddin |
context | an IdeContext |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.32