## IdeConfigProvider IdeConfigProvider |

## Functions

void | ide_config_provider_emit_added ()
void | ide_config_provider_emit_removed ()
void | ide_config_provider_load_async ()
gboolean | ide_config_provider_load_finish ()
void | ide_config_provider_save_async ()
gboolean | ide_config_provider_save_finish ()
void | ide_config_provider_delete ()
void | ide_config_provider_duplicate ()
void | ide_config_provider_unload ()

## Signals

void | added | Run Last
void | removed | Run Last

## Types and Values

#define | IDE_TYPE_CONFIG_PROVIDER
struct | IdeConfigProviderInterface
| IdeConfigProvider

## Object Hierarchy

        GInterface
        ╰── IdeConfigProvider

## Prerequisites

IdeConfigProvider requires IdeObject.

## Description

## Functions

### ide_config_provider_emit_added ()

    void
    ide_config_provider_emit_added (IdeConfigProvider *self,
                                    IdeConfig *config);

IdeConfigProvider implementations should call this function with a `config` when it has discovered a new configuration.

#### Parameters

self | an IdeConfigProvider |
config | an IdeConfig |

Since: 3.32

### ide_config_provider_emit_removed ()

    void
    ide_config_provider_emit_removed (IdeConfigProvider *self,
                                      IdeConfig *config);

IdeConfigProvider implementations should call this function with a `config` when it has discovered it was removed.

#### Parameters

self | an IdeConfigProvider |
config | an IdeConfig |

Since: 3.32

### ide_config_provider_load_async ()

    void
    ide_config_provider_load_async (IdeConfigProvider *self,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

This function is called to initialize the configuration provider after the plugin instance has been created. The provider should locate any build configurations within the project and call `ide_config_provider_emit_added()` before completing the asynchronous function so that the configuration manager may be made aware of the configurations.

#### Parameters

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

Since: 3.32

### ide_config_provider_load_finish ()

    gboolean
    ide_config_provider_load_finish (IdeConfigProvider *self,
                                     GAsyncResult *result,
                                     GError **error);

Completes an asynchronous request to `ide_config_provider_load_async()`.

#### Parameters

self | a IdeConfigProvider |
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_config_provider_save_async ()

    void
    ide_config_provider_save_async (IdeConfigProvider *self,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

This function is called to request that the configuration provider persist any changed configurations back to disk.

This function will be called before unloading the configuration provider so that it has a chance to persist any outstanding changes.

#### Parameters

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

Since: 3.32

### ide_config_provider_save_finish ()

    gboolean
    ide_config_provider_save_finish (IdeConfigProvider *self,
                                     GAsyncResult *result,
                                     GError **error);

Completes an asynchronous request to `ide_config_provider_save_async()`.

#### Parameters

self | a IdeConfigProvider |
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_config_provider_delete ()

    void
    ide_config_provider_delete (IdeConfigProvider *self,
                                IdeConfig *config);

Requests that the configuration provider delete the configuration.

ide_config_provider_save_async() will be called by the IdeConfigManager after calling this function.

#### Parameters

self | a IdeConfigProvider |
config | an IdeConfig owned by the provider |

Since: 3.32

### ide_config_provider_duplicate ()

    void
    ide_config_provider_duplicate (IdeConfigProvider *self,
                                   IdeConfig *config);

Requests that the configuration provider duplicate the configuration.

This is useful when the user wants to experiment with alternate settings without breaking a previous configuration.

The configuration provider does not need to persist the configuration in this function, `ide_config_provider_save_async()` will be called afterwards to persist configurations to disk.

It is expected that the IdeConfigProvider will emit “added” with the new configuration.

#### Parameters

self | an IdeConfigProvider |
config | an IdeConfig |

Since: 3.32

### ide_config_provider_unload ()

    void
    ide_config_provider_unload (IdeConfigProvider *self);

Requests that the configuration provider unload any state. This is called shortly before the configuration provider is finalized.

Implementations of IdeConfigProvider should emit removed for every configuration they have registered so that the IdeConfigManager has correct information.

#### Parameters

self | a IdeConfigProvider |

Since: 3.32

## Types and Values

### IDE_TYPE_CONFIG_PROVIDER

    #define IDE_TYPE_CONFIG_PROVIDER (ide_config_provider_get_type ())

### struct IdeConfigProviderInterface

    struct IdeConfigProviderInterface {
      GTypeInterface parent_iface;

      void     (*added)          (IdeConfigProvider  *self,
                                  IdeConfig          *config);
      void     (*removed)        (IdeConfigProvider  *self,
                                  IdeConfig          *config);
      void     (*load_async)     (IdeConfigProvider  *self,
                                  GCancellable              *cancellable,
                                  GAsyncReadyCallback        callback,
                                  gpointer                   user_data);
      gboolean (*load_finish)    (IdeConfigProvider  *self,
                                  GAsyncResult              *result,
                                  GError                   **error);
      void     (*save_async)     (IdeConfigProvider  *self,
                                  GCancellable              *cancellable,
                                  GAsyncReadyCallback        callback,
                                  gpointer                   user_data);
      gboolean (*save_finish)    (IdeConfigProvider  *self,
                                  GAsyncResult              *result,
                                  GError                   **error);
      void     (*delete)         (IdeConfigProvider  *self,
                                  IdeConfig          *config);
      void     (*duplicate)      (IdeConfigProvider  *self,
                                  IdeConfig          *config);
      void     (*unload)         (IdeConfigProvider  *self);
    };

### IdeConfigProvider

    typedef struct _IdeConfigProvider IdeConfigProvider;

## Signal Details

### The `“added”` signal

    void
    user_function (IdeConfigProvider *ideconfigprovider,
                   IdeConfig         *arg1,
                   gpointer           user_data)

Flags: Run Last

### The `“removed”` signal

    void
    user_function (IdeConfigProvider *ideconfigprovider,
                   IdeConfig         *arg1,
                   gpointer           user_data)

Flags: Run Last