Evolution-Data-Server Manual: Backend Utilities (libebackend) | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
Synopsis
#include <libebackend/libebackend.h> struct EDataFactory; EBackend * e_data_factory_ref_backend (EDataFactory *data_factory
,const gchar *hash_key
,ESource *source
); EBackend * e_data_factory_ref_initable_backend (EDataFactory *data_factory
,const gchar *hash_key
,ESource *source
,GCancellable *cancellable
,GError **error
); EBackendFactory * e_data_factory_ref_backend_factory (EDataFactory *data_factory
,const gchar *hash_key
);
Details
struct EDataFactory
struct EDataFactory;
Contains only private data that should be read and manipulated using the functions below.
Since 3.4
e_data_factory_ref_backend ()
EBackend * e_data_factory_ref_backend (EDataFactory *data_factory
,const gchar *hash_key
,ESource *source
);
Returns either a newly-created or existing EBackend for ESource.
The returned EBackend is referenced for thread-safety and must be
unreferenced with g_object_unref()
when finished with it.
The data_factory
retains a weak reference to backend
so it can return
the same instance while backend
is in use. When the last strong reference
to backend
is dropped, data_factory
will lose its weak reference and will
have to create a new EBackend instance the next time the same hash_key
and source
are requested.
If no suitable EBackendFactory exists, the function returns NULL
.
|
an EDataFactory |
|
hash key for an EBackendFactory |
|
an ESource |
Returns : |
an EBackend for source , or NULL
|
Since 3.6
e_data_factory_ref_initable_backend ()
EBackend * e_data_factory_ref_initable_backend (EDataFactory *data_factory
,const gchar *hash_key
,ESource *source
,GCancellable *cancellable
,GError **error
);
Similar to e_data_factory_ref_backend()
, but allows for backends that
implement the GInitable interface so they can fail gracefully if they
are unable to initialize critical resources, such as a cache database.
Returns either a newly-created or existing EBackend for ESource.
The returned EBackend is referenced for thread-safety and must be
unreferenced with g_object_unref()
when finished with it.
If the newly-created backend implements the GInitable interface, then
g_initable_init()
is also called on it using cancellable
and error
.
The data_factory
retains a weak reference to backend
so it can return
the same instance while backend
is in use. When the last strong reference
to backend
is dropped, data_factory
will lose its weak reference and will
have to create a new EBackend instance the next time the same hash_key
and source
are requested.
If no suitable EBackendFactory exists, or if the EBackend fails to
initialize, the function sets error
and returns NULL
.
|
an EDataFactory |
|
hash key for an EBackendFactory |
|
an ESource |
|
optional GCancellable object, or NULL
|
|
return location for a GError, or NULL
|
Returns : |
an EBackend for source , or NULL
|
Since 3.8
e_data_factory_ref_backend_factory ()
EBackendFactory * e_data_factory_ref_backend_factory (EDataFactory *data_factory
,const gchar *hash_key
);
Returns the EBackendFactory for hash_key
, or NULL
if no such factory
is registered.
The returned EBackendFactory is referenced for thread-safety.
Unreference the EBackendFactory with g_object_unref()
when finished
with it.
|
an EDataFactory |
|
hash key for an EBackendFactory |
Returns : |
the EBackendFactory for hash_key , or NULL
|
Since 3.6
Signal Details
The "backend-created"
signal
void user_function (EDataFactory *data_factory,
EBackend *backend,
gpointer user_data) : Run Last
Emitted when a new EBackend is instantiated by way of
e_data_factory_ref_backend()
. Extensions can connect to this
signal to perform additional initialization on the EBackend.
|
the EDataFactory which emitted the signal |
|
the newly-created EBackend |
|
user data set when the signal handler was connected. |
Since 3.8