folks Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
FolksBackendFolksBackend — A single backend to libfolks, such as Telepathy or evolution-data-server. Each backend provides FolksPersonas which are aggregated to form FolksIndividuals. |
#define FOLKS_TYPE_BACKEND void folks_backend_prepare (FolksBackend *self
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); void folks_backend_prepare_finish (FolksBackend *self
,GAsyncResult *_res_
,GError **error
); void folks_backend_unprepare (FolksBackend *self
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); void folks_backend_unprepare_finish (FolksBackend *self
,GAsyncResult *_res_
,GError **error
); gboolean folks_backend_get_is_prepared (FolksBackend *self
); gboolean folks_backend_get_is_quiescent (FolksBackend *self
); const gchar * folks_backend_get_name (FolksBackend *self
); GeeMap * folks_backend_get_persona_stores (FolksBackend *self
); struct FolksBackend;
"is-prepared" gboolean : Read "is-quiescent" gboolean : Read "name" gchar* : Read "persona-stores" GeeMap* : Read
After creating a Backend instance, you must connect to the "persona-store-added" and "persona-store-removed" signals, then call
, otherwise a race condition may occur between emission of "persona-store-added" and your code connecting to it.folks_backend_prepare()
#define FOLKS_TYPE_BACKEND (folks_backend_get_type ())
The type for FolksBackend.
void folks_backend_prepare (FolksBackend *self
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Prepare the Backend for use.
This connects the Backend to whichever backend-specific services it requires, and causes it to create its FolksPersonaStores. This should be called after connecting to the "persona-store-added" and "persona-store-removed" signals, or a race condition could occur, with the signals being emitted before your code has connected to them, and FolksPersonaStores getting "lost" as a result.
This is normally handled transparently by the FolksIndividualAggregator.
If this function throws an error, the Backend will not be functional.
This function is guaranteed to be idempotent (since version 0.3.0).
Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)
See also: folks_backend_prepare_finish()
|
the FolksBackend instance |
|
callback to call when the request is satisfied. [scope async] |
|
the data to pass to _callback_ function. [closure]
|
Since 0.1.11
void folks_backend_prepare_finish (FolksBackend *self
,GAsyncResult *_res_
,GError **error
);
Prepare the Backend for use.
This connects the Backend to whichever backend-specific services it requires, and causes it to create its FolksPersonaStores. This should be called after connecting to the "persona-store-added" and "persona-store-removed" signals, or a race condition could occur, with the signals being emitted before your code has connected to them, and FolksPersonaStores getting "lost" as a result.
This is normally handled transparently by the FolksIndividualAggregator.
If this function throws an error, the Backend will not be functional.
This function is guaranteed to be idempotent (since version 0.3.0).
Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)
See also: folks_backend_prepare()
|
the FolksBackend instance |
|
a GAsyncResult |
|
location to store the error occuring, or NULL to ignore |
Since 0.1.11
void folks_backend_unprepare (FolksBackend *self
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Revert the Backend to its pre-prepared state.
This will disconnect this Backend and its dependencies from their respective services and the Backend will issue "persona-store-removed" for each of its FolksPersonaStores.
Most users won't need to use this function.
If this function throws an error, the Backend will not be functional.
Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)
See also: folks_backend_unprepare_finish()
|
the FolksBackend instance |
|
callback to call when the request is satisfied. [scope async] |
|
the data to pass to _callback_ function. [closure]
|
Since 0.3.2
void folks_backend_unprepare_finish (FolksBackend *self
,GAsyncResult *_res_
,GError **error
);
Revert the Backend to its pre-prepared state.
This will disconnect this Backend and its dependencies from their respective services and the Backend will issue "persona-store-removed" for each of its FolksPersonaStores.
Most users won't need to use this function.
If this function throws an error, the Backend will not be functional.
Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)
See also: folks_backend_unprepare()
|
the FolksBackend instance |
|
a GAsyncResult |
|
location to store the error occuring, or NULL to ignore |
Since 0.3.2
gboolean folks_backend_get_is_prepared (FolksBackend *self
);
|
the FolksBackend instance to query |
Returns : |
the value of the "is-prepared" property |
gboolean folks_backend_get_is_quiescent (FolksBackend *self
);
|
the FolksBackend instance to query |
Returns : |
the value of the "is-quiescent" property |
const gchar * folks_backend_get_name (FolksBackend *self
);
|
the FolksBackend instance to query |
Returns : |
the value of the "name" property |
GeeMap * folks_backend_get_persona_stores (FolksBackend *self
);
|
the FolksBackend instance to query |
Returns : |
the value of the "persona-stores" property |
struct FolksBackend;
A single backend to libfolks, such as Telepathy or evolution-data-server. Each backend provides FolksPersonas which are aggregated to form FolksIndividuals.
After creating a Backend instance, you must connect to the "persona-store-added" and "persona-store-removed" signals, then call
, otherwise a race condition may occur between emission of "persona-store-added" and your code connecting to it.folks_backend_prepare()
"is-prepared"
property "is-prepared" gboolean : Read
Whether
has successfully completed for this backend.
folks_backend_prepare()
Default value: FALSE
Since 0.3.0
"is-quiescent"
property "is-quiescent" gboolean : Read
Whether the backend has reached a quiescent state. This will happen at some point after
has successfully completed for the backend. A backend is in a quiescent state when all the FolksPersonaStores that it originally knows about have been loaded.
folks_backend_prepare()
It's guaranteed that this property's value will only ever change after "is-prepared" has changed to `true`.
When
is called, this will be reset to `false`.folks_backend_unprepare()
Default value: FALSE
Since 0.6.2
"name"
property "name" gchar* : Read
A unique name for the backend.
This will be used to identify the backend, and should also be used as the "type-id" of the FolksPersonaStores used by the backend.
This is guaranteed to always be available; even before
is called.folks_backend_prepare()
Default value: NULL
"persona-stores"
property "persona-stores" GeeMap* : Read
The FolksPersonaStores in use by the backend.
A backend may expose FolksPersonas from multiple servers or accounts (for example), so may have a FolksPersonaStore for each.
Since 0.5.1
"persona-store-added"
signalvoid user_function (FolksBackend *backend,
FolksPersonaStore *store,
gpointer user_data) : Run Last
Emitted when a FolksPersonaStore is added to the backend.
This will not be emitted until after
has been called.folks_backend_prepare()
|
the FolksBackend instance that received the signal |
|
the FolksPersonaStore |
|
user data set when the signal handler was connected. |
"persona-store-removed"
signalvoid user_function (FolksBackend *backend,
FolksPersonaStore *store,
gpointer user_data) : Run Last
Emitted when a FolksPersonaStore is removed from the backend.
This will not be emitted until after
has been called.folks_backend_prepare()
|
the FolksBackend instance that received the signal |
|
the FolksPersonaStore |
|
user data set when the signal handler was connected. |