![]() |
![]() |
![]() |
Evolution-Data-Server Manual: Backend Utilities (libebackend) | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <libebackend/libebackend.h> struct ECollectionBackend; ESource * e_collection_backend_new_child (ECollectionBackend *backend
,const gchar *resource_id
); struct _ESourceRegistryServer * e_collection_backend_ref_server (ECollectionBackend *backend
); const gchar * e_collection_backend_get_cache_dir (ECollectionBackend *backend
); GList * e_collection_backend_list_calendar_sources (ECollectionBackend *backend
); GList * e_collection_backend_list_contacts_sources (ECollectionBackend *backend
); GList * e_collection_backend_list_mail_sources (ECollectionBackend *backend
);
ECollectionBackend is an abstract base class for backends which manage a collection of data sources which collectively represent the resources on a remote server. The resources can include any number of private and shared email stores, calendars and address books.
The backend's job is to synchronize local representations of remote resources by adding and removing EServerSideSource instances in an ESourceRegistryServer. If possible the backend should also listen for notifications of newly-added or deleted resources on the remote server or else poll the remote server at regular intervals and then update the data source collection accordingly.
As most remote servers require authentication, the backend may also wish to implement the ESourceAuthenticator interface so it can submit its own EAuthenticationSession instances to the ESourceRegistryServer.
struct ECollectionBackend;
Contains only private data that should be read and manipulated using the functions below.
Since 3.6
ESource * e_collection_backend_new_child (ECollectionBackend *backend
,const gchar *resource_id
);
Creates a new EServerSideSource as a child of the collection
"source" owned by backend
. If possible, the EServerSideSource
is drawn from a cache of previously used sources indexed by resource_id
so that locally cached data from previous sessions can be reused.
The returned data source should be passed to
e_source_registry_server_add_source()
to export it over D-Bus.
Return: a newly-created data source
|
an ECollectionBackend |
|
a stable and unique resource ID |
Since 3.6
struct _ESourceRegistryServer * e_collection_backend_ref_server
(ECollectionBackend *backend
);
Returns the ESourceRegistryServer to which backend
belongs.
The returned ESourceRegistryServer is referenced for thread-safety.
Unreference the ESourceRegistryServer with g_object_unref()
when
finished with it.
|
an ECollectionBackend |
Returns : |
the ESourceRegisterServer for backend
|
Since 3.6
const gchar * e_collection_backend_get_cache_dir (ECollectionBackend *backend
);
Returns the private cache directory path for backend
, which is named
after the "uid" of backend
's collection "source".
The cache directory is meant to store key files for backend-created
data sources. See also: e_server_side_source_set_write_directory()
|
an ECollectionBackend |
Returns : |
the cache directory for backend
|
Since 3.6
GList * e_collection_backend_list_calendar_sources
(ECollectionBackend *backend
);
Returns a list of calendar sources belonging to the data source
collection managed by backend
.
The sources returned in the list are referenced for thread-safety.
They must each be unreferenced with g_object_unref()
when finished
with them. Free the returned GList itself with g_list_free()
.
An easy way to free the list properly in one step is as follows:
1 |
g_list_free_full (list, g_object_unref); |
|
an ECollectionBackend |
Returns : |
a list of calendar sources |
Since 3.6
GList * e_collection_backend_list_contacts_sources
(ECollectionBackend *backend
);
Returns a list of address book sources belonging to the data source
collection managed by backend
.
The sources returned in the list are referenced for thread-safety.
They must each be unreferenced with g_object_unref()
when finished
with them. Free the returned GList itself with g_list_free()
.
An easy way to free the list properly in one step is as follows:
1 |
g_list_free_full (list, g_object_unref); |
|
an ECollectionBackend |
Returns : |
a list of address book sources |
Since 3.6
GList * e_collection_backend_list_mail_sources
(ECollectionBackend *backend
);
Returns a list of mail sources belonging to the data source collection
managed by backend
.
The sources returned in the list are referenced for thread-safety.
They must each be unreferenced with g_object_unref()
when finished
with them. Free the returned GList itself with g_list_free()
.
An easy way to free the list properly in one step is as follows:
1 |
g_list_free_full (list, g_object_unref); |
|
an ECollectionBackend |
Returns : |
a list of mail sources |
Since 3.6
"server"
property"server" ESourceRegistryServer* : Read / Write / Construct Only
The server to which the backend belongs.
"child-added"
signalvoid user_function (ECollectionBackend *backend,
EServerSideSource *child_source,
gpointer user_data) : Run Last
Emitted when an EServerSideSource is added to backend
's
"server" as a child of backend
's collection
"source".
You can think of this as a filtered version of
ESourceRegistryServer's "source-added"
signal which only lets through sources relevant to backend
.
|
the ECollectionBackend which emitted the signal |
|
the newly-added child EServerSideSource |
|
user data set when the signal handler was connected. |
"child-removed"
signalvoid user_function (ECollectionBackend *backend,
EServerSideSource *child_source,
gpointer user_data) : Run Last
Emitted when an EServerSideSource that is a child of
backend
's collection "source" is removed from
backend
's "server".
You can think of this as a filtered version of
ESourceRegistryServer's "source-removed"
signal which only lets through sources relevant to backend
.
|
the ECollectionBackend which emitted the signal |
|
the child EServerSideSource that got removed |
|
user data set when the signal handler was connected. |