FolksBackendStore

FolksBackendStore — Responsible for backend loading.

Synopsis

#define             FOLKS_TYPE_BACKEND_STORE
void                folks_backend_store_prepare         (FolksBackendStore *self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
void                folks_backend_store_prepare_finish  (FolksBackendStore *self,
                                                         GAsyncResult *_res_);
void                folks_backend_store_load_backends   (FolksBackendStore *self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
void                folks_backend_store_load_backends_finish
                                                        (FolksBackendStore *self,
                                                         GAsyncResult *_res_,
                                                         GError **error);
void                folks_backend_store_add_backend     (FolksBackendStore *self,
                                                         FolksBackend *backend);
FolksBackend *      folks_backend_store_dup_backend_by_name
                                                        (FolksBackendStore *self,
                                                         const gchar *name);
GeeCollection *     folks_backend_store_list_backends   (FolksBackendStore *self);
void                folks_backend_store_enable_backend  (FolksBackendStore *self,
                                                         const gchar *name,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
void                folks_backend_store_enable_backend_finish
                                                        (FolksBackendStore *self,
                                                         GAsyncResult *_res_);
void                folks_backend_store_disable_backend (FolksBackendStore *self,
                                                         const gchar *name,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
void                folks_backend_store_disable_backend_finish
                                                        (FolksBackendStore *self,
                                                         GAsyncResult *_res_);
GeeMap *            folks_backend_store_get_enabled_backends
                                                        (FolksBackendStore *self);
gboolean            folks_backend_store_get_is_prepared (FolksBackendStore *self);
FolksBackendStore * folks_backend_store_dup             (void);
struct              FolksBackendStore;

Object Hierarchy

  GObject
   +----FolksBackendStore

Properties

  "enabled-backends"         GeeMap*               : Read
  "is-prepared"              gboolean              : Read

Signals

  "backend-available"                              : Run Last

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.

Details

FOLKS_TYPE_BACKEND_STORE

#define FOLKS_TYPE_BACKEND_STORE (folks_backend_store_get_type ())

The type for FolksBackendStore.


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.

See also: folks_backend_store_prepare_finish()

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_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.

See also: folks_backend_store_prepare()

self :

the FolksBackendStore instance

_res_ :

a GAsyncResult

Since 0.3.0


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.

See also: folks_backend_store_load_backends_finish()

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_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.

See also: folks_backend_store_load_backends()

self :

the FolksBackendStore instance

_res_ :

a GAsyncResult

error :

location to store the error occuring, or NULL to ignore

folks_backend_store_add_backend ()

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

Add a new FolksBackend to the BackendStore.

self :

the FolksBackendStore instance

backend :

the FolksBackend to add. [in]

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.

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_list_backends ()

GeeCollection *     folks_backend_store_list_backends   (FolksBackendStore *self);

List the currently loaded backends.

self :

the FolksBackendStore instance

Returns :

a list of the backends currently in the BackendStore

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.

See also: folks_backend_store_enable_backend_finish()

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_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.

See also: folks_backend_store_enable_backend()

self :

the FolksBackendStore instance

_res_ :

a GAsyncResult

Since 0.3.2


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.

See also: folks_backend_store_disable_backend_finish()

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_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.

See also: folks_backend_store_disable_backend()

self :

the FolksBackendStore instance

_res_ :

a GAsyncResult

Since 0.3.2


folks_backend_store_get_enabled_backends ()

GeeMap *            folks_backend_store_get_enabled_backends
                                                        (FolksBackendStore *self);

self :

the FolksBackendStore instance to query

Returns :

the value of the "enabled-backends" property

folks_backend_store_get_is_prepared ()

gboolean            folks_backend_store_get_is_prepared (FolksBackendStore *self);

self :

the FolksBackendStore instance to query

Returns :

the value of the "is-prepared" property

folks_backend_store_dup ()

FolksBackendStore * folks_backend_store_dup             (void);

Create a new BackendStore.


struct FolksBackendStore

struct FolksBackendStore;

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.

Property Details

The "enabled-backends" property

  "enabled-backends"         GeeMap*               : Read

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.

Since 0.5.1


The "is-prepared" property

  "is-prepared"              gboolean              : Read

Whether folks_backend_store_prepare() has successfully completed for this store.

Default value: FALSE

Since 0.3.0

Signal Details

The "backend-available" signal

void                user_function                      (FolksBackendStore *backend_store,
                                                        FolksBackend      *backend,
                                                        gpointer           user_data)          : Run Last

Emitted when a backend has been added to the BackendStore.

This will not be emitted until after folks_backend_store_load_backends() has been called.

FolksBackends referenced in this signal are also included in "enabled-backends".

backend_store :

the FolksBackendStore instance that received the signal

backend :

the new FolksBackend

user_data :

user data set when the signal handler was connected.