![]() |
![]() |
![]() |
Evolution-Data-Server Manual: Backend Utilities (libebackend) | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <libebackend/libebackend.h> struct EBackend; gboolean e_backend_get_online (EBackend *backend
); void e_backend_set_online (EBackend *backend
,gboolean online
); ESource * e_backend_get_source (EBackend *backend
); gboolean e_backend_authenticate_sync (EBackend *backend
,ESourceAuthenticator *auth
,GCancellable *cancellable
,GError **error
); void e_backend_authenticate (EBackend *backend
,ESourceAuthenticator *auth
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean e_backend_authenticate_finish (EBackend *backend
,GAsyncResult *result
,GError **error
);
"online" gboolean : Read / Write / Construct "source" ESource* : Read / Write / Construct Only
An EBackend is paired with an ESource to facilitate performing actions on the local or remote resource described by the ESource.
In other words, whereas a certain backend type knows how to talk to a certain type of server or data store, the ESource fills in configuration details such as host name, user name, resource path, etc.
All EBackend instances are created by an EBackendFactory.
struct EBackend;
Contains only private data that should be read and manipulated using the functions below.
Since 3.4
gboolean e_backend_get_online (EBackend *backend
);
Returns the online state of backend
: TRUE
if backend
is online,
FALSE
if offline. The online state of each backend is bound to the
online state of the EDataFactory that created it.
|
an EBackend |
Returns : |
the online state |
Since 3.4
void e_backend_set_online (EBackend *backend
,gboolean online
);
Sets the online state of backend
: TRUE
if backend
is online,
FALSE
if offline. The online state of each backend is bound to
the online state of the EDataFactory that created it.
|
an EBackend |
|
the online state |
Since 3.4
ESource * e_backend_get_source (EBackend *backend
);
Returns the ESource to which backend
is paired.
Since 3.4
gboolean e_backend_authenticate_sync (EBackend *backend
,ESourceAuthenticator *auth
,GCancellable *cancellable
,GError **error
);
Convenience function providing a consistent authentication interface for backends running in either the registry service itself or a client process communicating with the registry service over D-Bus.
Authenticates backend
's "source", using auth
to handle
authentication attempts. The backend
and auth
arguments may be one
and the same if backend
implements the ESourceAuthenticator interface.
The operation loops until authentication is successful or the user aborts
further authentication attempts. If an error occurs, the function will
set error
and return FALSE
.
|
an EBackend |
|
an ESourceAuthenticator |
|
optional GCancellable object, or NULL
|
|
return location for a GError, or NULL
|
Returns : |
TRUE on success, FALSE on failure |
Since 3.6
void e_backend_authenticate (EBackend *backend
,ESourceAuthenticator *auth
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Convenience function providing a consistent authentication interface for backends running in either the registry service itself or a client process communicating with the registry service over D-Bus.
Asynchronously authenticates backend
's "source", using auth
to handle authentication attempts. The backend
and auth
arguments may
be one and the same if backend
implements the ESourceAuthenticator
interface. The operation loops until authentication is succesful or the
user aborts further authentication attempts.
When the operation is finished, callback
will be called. You can then
call e_backend_authenticate_finish()
to get the result of the operation.
|
an EBackend |
|
an ESourceAuthenticator |
|
optional GCancellable object, or NULL
|
|
a GAsyncReadyCallback to call when the request is satisfied |
|
data to pass to the callback function |
Since 3.6
gboolean e_backend_authenticate_finish (EBackend *backend
,GAsyncResult *result
,GError **error
);
Finishes the operation started with e_backend_authenticate()
. If
an error occurred, the function will set error
and return FALSE
.
|
an EBackend |
|
a GAsyncResult |
|
return location for a GError, or NULL
|
Returns : |
TRUE on success, FALSE on failure |
Since 3.6