## IdeConfigurationProvider IdeConfigurationProvider |

## Functions

void | ide_configuration_provider_emit_added ()
void | ide_configuration_provider_emit_removed ()
void | ide_configuration_provider_load_async ()
gboolean | ide_configuration_provider_load_finish ()
void | ide_configuration_provider_save_async ()
gboolean | ide_configuration_provider_save_finish ()
void | ide_configuration_provider_delete ()
void | ide_configuration_provider_duplicate ()
void | ide_configuration_provider_unload ()

## Signals

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

## Types and Values

#define | IDE_TYPE_CONFIGURATION_PROVIDER
struct | IdeConfigurationProviderInterface
| IdeConfigurationProvider

## Object Hierarchy

        GInterface
        ╰── IdeConfigurationProvider

## Prerequisites

IdeConfigurationProvider requires IdeObject.

## Description

## Functions

### ide_configuration_provider_emit_added ()

    void
    ide_configuration_provider_emit_added (IdeConfigurationProvider *self,
                                           IdeConfiguration *config);

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

#### Parameters

self | an IdeConfigurationProvider |
config | an IdeConfiguration |

Since: 3.28

### ide_configuration_provider_emit_removed ()

    void
    ide_configuration_provider_emit_removed
                                   (IdeConfigurationProvider *self,
                                    IdeConfiguration *config);

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

#### Parameters

self | an IdeConfigurationProvider |
config | an IdeConfiguration |

Since: 3.28

### ide_configuration_provider_load_async ()

    void
    ide_configuration_provider_load_async (IdeConfigurationProvider *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_configuration_provider_emit_added()` before completing the asynchronous function so that the configuration manager may be made aware of the configurations.

#### Parameters

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

Since: 3.28

### ide_configuration_provider_load_finish ()

    gboolean
    ide_configuration_provider_load_finish
                                   (IdeConfigurationProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Completes an asynchronous request to `ide_configuration_provider_load_async()`.

#### Parameters

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

#### Returns

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

### ide_configuration_provider_save_async ()

    void
    ide_configuration_provider_save_async (IdeConfigurationProvider *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 IdeConfigurationProvider |
cancellable | a GCancellable or `NULL`. | [nullable]
callback | a callback to execute upon completion |
user_data | closure data for `callback` |

### ide_configuration_provider_save_finish ()

    gboolean
    ide_configuration_provider_save_finish
                                   (IdeConfigurationProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Completes an asynchronous request to `ide_configuration_provider_save_async()`.

#### Parameters

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

#### Returns

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

### ide_configuration_provider_delete ()

    void
    ide_configuration_provider_delete (IdeConfigurationProvider *self,
                                       IdeConfiguration *config);

Requests that the configuration provider delete the configuration.

ide_configuration_provider_save_async() will be called by the IdeConfigurationManager after calling this function.

#### Parameters

self | a IdeConfigurationProvider |
config | an IdeConfiguration owned by the provider |

Since: 3.28

### ide_configuration_provider_duplicate ()

    void
    ide_configuration_provider_duplicate (IdeConfigurationProvider *self,
                                          IdeConfiguration *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_configuration_provider_save_async()` will be called afterwards to persist configurations to disk.

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

#### Parameters

self | an IdeConfigurationProvider |
config | an IdeConfiguration |

Since: 3.28

### ide_configuration_provider_unload ()

    void
    ide_configuration_provider_unload (IdeConfigurationProvider *self);

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

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

#### Parameters

self | a IdeConfigurationProvider |

## Types and Values

### IDE_TYPE_CONFIGURATION_PROVIDER

    #define IDE_TYPE_CONFIGURATION_PROVIDER (ide_configuration_provider_get_type ())

### struct IdeConfigurationProviderInterface

    struct IdeConfigurationProviderInterface {
      GTypeInterface parent_iface;

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

### IdeConfigurationProvider

    typedef struct _IdeConfigurationProvider IdeConfigurationProvider;

## Signal Details

### The `“added”` signal

    void
    user_function (IdeConfigurationProvider *ideconfigurationprovider,
                   IdeConfiguration         *arg1,
                   gpointer                  user_data)

Flags: Run Last

### The `“removed”` signal

    void
    user_function (IdeConfigurationProvider *ideconfigurationprovider,
                   IdeConfiguration         *arg1,
                   gpointer                  user_data)

Flags: Run Last