FolksBackendStore 3 FOLKS Library
FolksBackendStore Responsible for backend loading.

## Functions

void | folks_backend_store_prepare ()
void | folks_backend_store_prepare_finish ()
void | folks_backend_store_load_backends ()
void | folks_backend_store_load_backends_finish ()
void | folks_backend_store_add_backend ()
FolksBackend * | folks_backend_store_dup_backend_by_name ()
GeeCollection * | folks_backend_store_list_backends ()
void | folks_backend_store_enable_backend ()
void | folks_backend_store_enable_backend_finish ()
void | folks_backend_store_disable_backend ()
void | folks_backend_store_disable_backend_finish ()
GeeMap * | folks_backend_store_get_enabled_backends ()
gboolean | folks_backend_store_get_is_prepared ()
FolksBackendStore * | folks_backend_store_dup ()

## Types and Values

#define | FOLKS_TYPE_BACKEND_STORE
struct | FolksBackendStore
struct | FolksBackendStoreClass

## Description

The BackendStore manages the set of available Folks backends. The ``folks_backend_store_load_backends()`` function loads all compatible and enabled backends and the "backend-available" signal notifies when these backends are ready.

## Functions

### folks_backend_store_prepare ()

    void
    folks_backend_store_prepare (FolksBackendStore *self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);

Prepare the BackendStore for use.

This must only ever be called before ``folks_backend_store_load_backends()`` is called for the first time. If it isn't called explicitly, ``folks_backend_store_load_backends()`` will call it.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin between a subsequent asynchronous call beginning and finishing).

See also: ``folks_backend_store_prepare_finish()``

#### Parameters

self | the FolksBackendStore instance |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to _callback_ function. | [closure]

Since: 0.3.0

folks_backend_store_prepare

### folks_backend_store_prepare_finish ()

    void
    folks_backend_store_prepare_finish (FolksBackendStore *self,
                                        GAsyncResult *_res_);

Prepare the BackendStore for use.

This must only ever be called before ``folks_backend_store_load_backends()`` is called for the first time. If it isn't called explicitly, ``folks_backend_store_load_backends()`` will call it.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin between a subsequent asynchronous call beginning and finishing).

See also: ``folks_backend_store_prepare()``

#### Parameters

self | the FolksBackendStore instance |
_res_ | a GAsyncResult |

Since: 0.3.0

folks_backend_store_prepare_finish

### folks_backend_store_load_backends ()

    void
    folks_backend_store_load_backends (FolksBackendStore *self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);

Find, load, and prepare all backends which are not disabled.

Backends will be searched for in the path given by the `FOLKS_BACKEND_PATH` environment variable, if it's set. If it's not set, backends will be searched for in a path set at compilation time.

This method is not safe to call multiple times concurrently.

GError will be returned in error

currently unused

See also: ``folks_backend_store_load_backends_finish()``

#### Parameters

self | the FolksBackendStore instance |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to _callback_ function. | [closure]

folks_backend_store_load_backends

### folks_backend_store_load_backends_finish ()

    void
    folks_backend_store_load_backends_finish
                                   (FolksBackendStore *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Find, load, and prepare all backends which are not disabled.

Backends will be searched for in the path given by the `FOLKS_BACKEND_PATH` environment variable, if it's set. If it's not set, backends will be searched for in a path set at compilation time.

This method is not safe to call multiple times concurrently.

GError will be returned in error

currently unused

See also: ``folks_backend_store_load_backends()``

#### Parameters

self | the FolksBackendStore instance |
_res_ | a GAsyncResult |
error | location to store the error occurring, or `NULL` to ignore |

folks_backend_store_load_backends_finish

### folks_backend_store_add_backend ()

    void
    folks_backend_store_add_backend (FolksBackendStore *self,
                                     FolksBackend *backend);

Add a new FolksBackend to the BackendStore.

#### Parameters

self | the FolksBackendStore instance |
backend | . the FolksBackend to add . | [in]

folks_backend_store_add_backend

### folks_backend_store_dup_backend_by_name ()

    FolksBackend *
    folks_backend_store_dup_backend_by_name
                                   (FolksBackendStore *self,
                                    const gchar *name);

Get a backend from the store by name. If a backend is returned, its reference count is increased.

#### Parameters

self | the FolksBackendStore instance |
name | . the backend name to retrieve . | [in]

#### Returns

the backend, or `null` if none could be found

Since: 0.3.5

folks_backend_store_dup_backend_by_name

### folks_backend_store_list_backends ()

    GeeCollection *
    folks_backend_store_list_backends (FolksBackendStore *self);

List the currently loaded backends.

#### Parameters

self | the FolksBackendStore instance |

#### Returns

a list of the backends currently in the BackendStore

folks_backend_store_list_backends

### folks_backend_store_enable_backend ()

    void
    folks_backend_store_enable_backend (FolksBackendStore *self,
                                        const gchar *name,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);

Enable a backend.

Mark a backend as enabled, such that the BackendStore will always attempt to load it when ``folks_backend_store_load_backends()`` is called. This will not load the backend if it's not currently loaded.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin after a previous asynchronous call for the same backend name has begun and before it has finished).

If the backend is disallowed by the FOLKS_BACKENDS_ALLOWED and/or FOLKS_BACKENDS_DISABLED environment variables, this method will store the fact that it should be enabled in future, but will not enable it during this application run.

See also: ``folks_backend_store_enable_backend_finish()``

#### Parameters

self | the FolksBackendStore instance |
name | . the name of the backend to enable . | [in]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to _callback_ function. | [closure]

Since: 0.3.2

folks_backend_store_enable_backend

### folks_backend_store_enable_backend_finish ()

    void
    folks_backend_store_enable_backend_finish
                                   (FolksBackendStore *self,
                                    GAsyncResult *_res_);

Enable a backend.

Mark a backend as enabled, such that the BackendStore will always attempt to load it when ``folks_backend_store_load_backends()`` is called. This will not load the backend if it's not currently loaded.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin after a previous asynchronous call for the same backend name has begun and before it has finished).

If the backend is disallowed by the FOLKS_BACKENDS_ALLOWED and/or FOLKS_BACKENDS_DISABLED environment variables, this method will store the fact that it should be enabled in future, but will not enable it during this application run.

See also: ``folks_backend_store_enable_backend()``

#### Parameters

self | the FolksBackendStore instance |
_res_ | a GAsyncResult |

Since: 0.3.2

folks_backend_store_enable_backend_finish

### folks_backend_store_disable_backend ()

    void
    folks_backend_store_disable_backend (FolksBackendStore *self,
                                         const gchar *name,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);

Disable a backend.

Mark a backend as disabled, such that it won't be loaded even when the client application is restarted. This will not remove the backend if it's already loaded.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin after a previous asynchronous call for the same backend name has begun and before it has finished).

See also: ``folks_backend_store_disable_backend_finish()``

#### Parameters

self | the FolksBackendStore instance |
name | . the name of the backend to disable . | [in]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to _callback_ function. | [closure]

Since: 0.3.2

folks_backend_store_disable_backend

### folks_backend_store_disable_backend_finish ()

    void
    folks_backend_store_disable_backend_finish
                                   (FolksBackendStore *self,
                                    GAsyncResult *_res_);

Disable a backend.

Mark a backend as disabled, such that it won't be loaded even when the client application is restarted. This will not remove the backend if it's already loaded.

This method is safe to call multiple times concurrently (e.g. an asynchronous call may begin after a previous asynchronous call for the same backend name has begun and before it has finished).

See also: ``folks_backend_store_disable_backend()``

#### Parameters

self | the FolksBackendStore instance |
_res_ | a GAsyncResult |

Since: 0.3.2

folks_backend_store_disable_backend_finish

### folks_backend_store_get_enabled_backends ()

    GeeMap *
    folks_backend_store_get_enabled_backends
                                   (FolksBackendStore *self);

Get and return the current value of the "enabled-backends" property.

The list of backends visible to this store which have not been explicitly disabled.

This list will be empty before ``folks_backend_store_load_backends()`` has been called.

The backends in this list have been prepared and are ready to use.

#### Parameters

self | the FolksBackendStore instance to query |

#### Returns

the value of the "enabled-backends" property

Since: 0.5.1

folks_backend_store_get_enabled_backends

### folks_backend_store_get_is_prepared ()

    gboolean
    folks_backend_store_get_is_prepared (FolksBackendStore *self);

Get and return the current value of the "is-prepared" property.

Whether ``folks_backend_store_prepare()`` has successfully completed for this store.

#### Parameters

self | the FolksBackendStore instance to query |

#### Returns

the value of the "is-prepared" property

Since: 0.3.0

folks_backend_store_get_is_prepared

### folks_backend_store_dup ()

    FolksBackendStore *
    folks_backend_store_dup (void);

Create a new BackendStore.

folks_backend_store_dup

## Types and Values

### FOLKS_TYPE_BACKEND_STORE

    #define FOLKS_TYPE_BACKEND_STORE (folks_backend_store_get_type ())

The type for FolksBackendStore.

FOLKS_TYPE_BACKEND_STORE

### struct FolksBackendStore

    struct FolksBackendStore {
    	GObject parent_instance;
    	FolksBackendStorePrivate * priv;
    };

Responsible for backend loading.

The BackendStore manages the set of available Folks backends. The ``folks_backend_store_load_backends()`` function loads all compatible and enabled backends and the "backend-available" signal notifies when these backends are ready.

#### Members

FolksBackendStorePrivate *priv; |  |

FolksBackendStore

### struct FolksBackendStoreClass

    struct FolksBackendStoreClass {
    	GObjectClass parent_class;
    };

The class structure for `FOLKS_TYPE_BACKEND_STORE`. All the fields in this structure are private and should never be accessed directly.

#### Members

FolksBackendStoreClass