## IdeBufferAddin IdeBufferAddin — addins for IdeBuffer |

## Functions

void | ide_buffer_addin_load ()
void | ide_buffer_addin_unload ()
void | ide_buffer_addin_file_loaded ()
void | ide_buffer_addin_save_file ()
void | ide_buffer_addin_file_saved ()
void | ide_buffer_addin_language_set ()
void | ide_buffer_addin_change_settled ()
void | ide_buffer_addin_style_scheme_changed ()
void | ide_buffer_addin_settle_async ()
gboolean | ide_buffer_addin_settle_finish ()
IdeBufferAddin * | ide_buffer_addin_find_by_module_name ()

## Types and Values

#define | IDE_TYPE_BUFFER_ADDIN
struct | IdeBufferAddinInterface
| IdeBufferAddin

## Object Hierarchy

        GInterface
        ╰── IdeBufferAddin

## Prerequisites

IdeBufferAddin requires GObject.

## Description

The IdeBufferAddin allows a plugin to register an object that will be created with every IdeBuffer. It can register extra features with the buffer or extend it as necessary.

Once use of IdeBufferAddin is to add a spellchecker to the buffer that may be used by views to show the misspelled words. This is preferrable to adding a spellchecker in each view because it allows for multiple views to share one spellcheker on the underlying buffer.

## Functions

### ide_buffer_addin_load ()

    void
    ide_buffer_addin_load (IdeBufferAddin *self,
                           IdeBuffer *buffer);

This calls the load virtual function of IdeBufferAddin to request that the addin load itself.

#### Parameters

self | an IdeBufferAddin |
buffer | an IdeBuffer |

Since: 3.32

### ide_buffer_addin_unload ()

    void
    ide_buffer_addin_unload (IdeBufferAddin *self,
                             IdeBuffer *buffer);

This calls the unload virtual function of IdeBufferAddin to request that the addin unload itself.

The addin should cancel any in-flight operations and attempt to drop references to the buffer or any other machinery as soon as possible.

#### Parameters

self | an IdeBufferAddin |
buffer | an IdeBuffer |

Since: 3.32

### ide_buffer_addin_file_loaded ()

    void
    ide_buffer_addin_file_loaded (IdeBufferAddin *self,
                                  IdeBuffer *buffer,
                                  GFile *file);

This function is called for an addin after a file has been loaded from disk.

It is not guaranteed that this function will be called for addins that were loaded after the buffer already loaded a file.

#### Parameters

self | a IdeBufferAddin |
buffer | an IdeBuffer |
file | a GFile |

Since: 3.32

### ide_buffer_addin_save_file ()

    void
    ide_buffer_addin_save_file (IdeBufferAddin *self,
                                IdeBuffer *buffer,
                                GFile *file);

This function gives a chance for plugins to modify the buffer right before writing to disk.

#### Parameters

self | a IdeBufferAddin |
buffer | an IdeBuffer |
file | a GFile |

Since: 3.32

### ide_buffer_addin_file_saved ()

    void
    ide_buffer_addin_file_saved (IdeBufferAddin *self,
                                 IdeBuffer *buffer,
                                 GFile *file);

This function is called for an addin after a file has been saved to disk.

#### Parameters

self | a IdeBufferAddin |
buffer | an IdeBuffer |
file | a GFile |

Since: 3.32

### ide_buffer_addin_language_set ()

    void
    ide_buffer_addin_language_set (IdeBufferAddin *self,
                                   IdeBuffer *buffer,
                                   const gchar *language_id);

This vfunc is called when the source language in the buffer changes. This will only be delivered to addins that support multiple languages.

#### Parameters

self | an IdeBufferAddin |
buffer | an IdeBuffer |
language_id | the GtkSourceView language identifier |

Since: 3.32

### ide_buffer_addin_change_settled ()

    void
    ide_buffer_addin_change_settled (IdeBufferAddin *self,
                                     IdeBuffer *buffer);

This function is called when the buffer has settled after a number of changes provided by the user. It is a convenient way to know when you should perform more background work without having to coalesce work yourself.

#### Parameters

self | an IdeBufferAddin |
buffer | an ideBuffer |

Since: 3.32

### ide_buffer_addin_style_scheme_changed ()

    void
    ide_buffer_addin_style_scheme_changed (IdeBufferAddin *self,
                                           IdeBuffer *buffer);

This function is called when the GtkSourceStyleScheme of the IdeBuffer has changed.

#### Parameters

self | an IdeBufferAddin |
buffer | an IdeBuffer |

Since: 3.32

### ide_buffer_addin_settle_async ()

    void
    ide_buffer_addin_settle_async (IdeBufferAddin *self,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

### ide_buffer_addin_settle_finish ()

    gboolean
    ide_buffer_addin_settle_finish (IdeBufferAddin *self,
                                    GAsyncResult *result,
                                    GError **error);

### ide_buffer_addin_find_by_module_name ()

    IdeBufferAddin *
    ide_buffer_addin_find_by_module_name (IdeBuffer *buffer,
                                          const gchar *module_name);

Locates an addin attached to the IdeBuffer by the name of the module that provides the addin.

#### Parameters

buffer | an IdeBuffer |
module_name | the module name of the addin |

#### Returns

An IdeBufferAddin or `NULL`.

[transfer none][nullable]

Since: 3.32

## Types and Values

### IDE_TYPE_BUFFER_ADDIN

    #define IDE_TYPE_BUFFER_ADDIN (ide_buffer_addin_get_type())

### struct IdeBufferAddinInterface

    struct IdeBufferAddinInterface {
      GTypeInterface parent_iface;

      void     (*load)                 (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer);
      void     (*unload)               (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer);
      void     (*file_loaded)          (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer,
                                        GFile                *file);
      void     (*save_file)            (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer,
                                        GFile                *file);
      void     (*file_saved)           (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer,
                                        GFile                *file);
      void     (*language_set)         (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer,
                                        const gchar          *language_id);
      void     (*change_settled)       (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer);
      void     (*style_scheme_changed) (IdeBufferAddin       *self,
                                        IdeBuffer            *buffer);
      void     (*settle_async)         (IdeBufferAddin       *self,
                                        GCancellable         *cancellable,
                                        GAsyncReadyCallback   callback,
                                        gpointer              user_data);
      gboolean (*settle_finish)        (IdeBufferAddin       *self,
                                        GAsyncResult         *result,
                                        GError              **error);
    };

### IdeBufferAddin

    typedef struct _IdeBufferAddin IdeBufferAddin;