Top | ![]() |
![]() |
![]() |
![]() |
|
e_backend_get_online () |
|
e_backend_set_online () |
|
e_backend_ensure_online_state_updated () |
ESource * | e_backend_get_source () |
|
e_backend_ref_connectable () |
|
e_backend_set_connectable () |
|
e_backend_ref_main_context () |
|
e_backend_credentials_required_sync () |
|
e_backend_credentials_required () |
|
e_backend_credentials_required_finish () |
|
e_backend_schedule_credentials_required () |
|
e_backend_schedule_authenticate () |
|
e_backend_ensure_source_status_connected () |
struct _EUserPrompter * | e_backend_get_user_prompter () |
ETrustPromptResponse | e_backend_trust_prompt_sync () |
|
e_backend_trust_prompt () |
ETrustPromptResponse | e_backend_trust_prompt_finish () |
|
e_backend_get_destination_address () |
|
e_backend_is_destination_reachable () |
|
e_backend_prepare_shutdown () |
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.
gboolean e_backend_get_online (EBackend *backend
);
Returns the online state of backend
: TRUE
backend
is online,
FALSE
If the NULL
backend
will
automatically determine whether the network service should be reachable,
and hence whether the backend
is
Since: 3.4
void e_backend_set_online (EBackend *backend
,);
gboolean online
Sets the online state of backend
: TRUE
backend
is online,
FALSE
if offline.
If the NULL
backend
will
automatically determine whether the network service should be reachable,
and hence whether the backend
is
Since: 3.4
void e_backend_ensure_online_state_updated (EBackend *backend
,);
GCancellable *cancellable
Makes sure that the "online" property is updated, that is, if there is any destination reachability test pending, it'll be done immediately and the only state will be updated as well.
Since: 3.18
ESource *
e_backend_get_source (EBackend *backend
);
Returns the ESource to which backend
is paired.
Since: 3.4
GSocketConnectable * e_backend_ref_connectable (EBackend *backend
);
Returns the socket endpoint for the network service to which backend
is a client, or NULL
backend
does not use network sockets.
The initial value of the backend
's
The returned g_object_unref()
Since: 3.8
void e_backend_set_connectable (EBackend *backend
,);
GSocketConnectable *connectable
Sets the socket endpoint for the network service to which backend
is
a client. This can be NULL
backend
does not use network sockets.
The initial value of the backend
's
Since: 3.8
GMainContext * e_backend_ref_main_context (EBackend *backend
);
Returns the backend
are to
be attached.
The returned g_main_context_unref()
Since: 3.8
gboolean e_backend_credentials_required_sync (EBackend *backend
,ESourceCredentialsReason reason
,const
,gchar *certificate_pem,
GTlsCertificateFlags certificate_errorsconst
,GError *op_error,
GCancellable *cancellable);
GError **error
Synchronously lets the clients know that the backned requires credentials to be
properly opened. It's a proxy function for e_source_invoke_credentials_required_sync()
,
where can be found more information about actual parameters meaning.
The provided credentials are received through EBackend::authenticate_sync()
If an error occurs, the function sets error
and returns FALSE
backend |
an EBackend |
|
reason |
an ESourceCredentialsReason, why the credentials are required |
|
certificate_pem |
PEM-encoded secure connection certificate, or an empty string |
|
certificate_errors |
a bit-or of |
|
op_error |
a |
[allow-none] |
cancellable |
optional |
|
error |
return location for a |
Since: 3.16
void e_backend_credentials_required (EBackend *backend
,ESourceCredentialsReason reason
,const
,gchar *certificate_pem,
GTlsCertificateFlags certificate_errorsconst
,GError *op_error,
GCancellable *cancellable,
GAsyncReadyCallback callback);
gpointer user_data
Asynchronously calls the e_backend_credentials_required_sync()
on the backend
,
to inform clients that credentials are required.
When the operation is finished, callback
will be called. You can then
call e_backend_credentials_required_finish()
to get the result of the operation.
backend |
an EBackend |
|
reason |
an ESourceCredentialsReason, why the credentials are required |
|
certificate_pem |
PEM-encoded secure connection certificate, or an empty string |
|
certificate_errors |
a bit-or of |
|
op_error |
a |
[allow-none] |
cancellable |
optional |
|
callback |
a |
[closure user_data][scope async] |
user_data |
data to pass to the callback function |
Since: 3.16
gboolean e_backend_credentials_required_finish (EBackend *backend
,,
GAsyncResult *result);
GError **error
Finishes the operation started with e_backend_credentials_required()
.
If an error occurs, the function sets error
and returns FALSE
Since: 3.16
void e_backend_schedule_credentials_required (EBackend *backend
,ESourceCredentialsReason reason
,const
,gchar *certificate_pem,
GTlsCertificateFlags certificate_errorsconst
,GError *op_error,
GCancellable *cancellableconst
);gchar *who_calls
Asynchronously invokes e_backend_credentials_required()
, but installs its
own callback which only prints a runtime warning on the console when
the call fails. The who_calls
is a prefix of the console message.
This is useful when the caller just wants to start the operation
without having actual place where to show the operation result.
backend |
an EBackend |
|
reason |
an ESourceCredentialsReason, why the credentials are required |
|
certificate_pem |
PEM-encoded secure connection certificate, or an empty string |
|
certificate_errors |
a bit-or of |
|
op_error |
a |
[allow-none] |
cancellable |
optional |
|
who_calls |
an identification who calls this. |
[allow-none] |
Since: 3.16
void e_backend_schedule_authenticate (EBackend *backend
,const ENamedParameters *credentials
);
Schedules a new authenticate session, cancelling any previously run.
This is usually done automatically, when an 'authenticate' signal is
received for the associated ESource. With NULL
credentials
an attempt
without it is run.
backend |
an EBackend |
|
credentials |
a credentials to use to authenticate, or |
[allow-none] |
Since: 3.16
void e_backend_ensure_source_status_connected (EBackend *backend
);
Makes sure that the associated ESource::connection-status is connected. This is
useful in cases when the backend can connect to the destination without invoking
EBackend::authenticate_sync, possibly through e_backend_schedule_authenticate()
.
Since: 3.18
struct _EUserPrompter *
e_backend_get_user_prompter (EBackend *backend
);
Gets an instance of EUserPrompter, associated with this backend
.
The returned instance is owned by the backend
.
Since: 3.8
ETrustPromptResponse e_backend_trust_prompt_sync (EBackend *backend
,const ENamedParameters *parameters
,,
GCancellable *cancellable);
GError **error
Asks a user a trust prompt with given parameters
, and returns what
user responded. This blocks until the response is delivered.
backend |
an EBackend |
|
parameters |
an ENamedParameters with values for the trust prompt |
|
cancellable |
optional |
[allow-none] |
error |
return location for a |
an ETrustPromptResponse what user responded
Note: The function can return also E_TRUST_PROMPT_RESPONSE_UNKNOWN
,
it's on error or if user closes the trust prompt dialog with other
than the offered buttons. Usual behaviour in such case is to treat
it as a temporary reject.
Since: 3.8
void e_backend_trust_prompt (EBackend *backend
,const ENamedParameters *parameters
,,
GCancellable *cancellable,
GAsyncReadyCallback callback);
gpointer user_data
Initiates a user trust prompt with given parameters
.
When the operation is finished, callback
will be called. You can then
call e_backend_trust_prompt_finish()
to get the result of the operation.
backend |
an EBackend |
|
parameters |
an ENamedParameters with values for the trust prompt |
|
cancellable |
optional |
[allow-none] |
callback |
a |
[closure user_data][scope async] |
user_data |
data to pass to the callback function |
Since: 3.8
ETrustPromptResponse e_backend_trust_prompt_finish (EBackend *backend
,,
GAsyncResult *result);
GError **error
Finishes the operation started with e_backend_trust_prompt()
.
If an error occurred, the function will set error
and return
E_TRUST_PROMPT_RESPONSE_UNKNOWN
.
an ETrustPromptResponse what user responded
Note: The function can return also E_TRUST_PROMPT_RESPONSE_UNKNOWN
,
it's on error or if user closes the trust prompt dialog with other
than the offered buttons. Usual behaviour in such case is to treat
it as a temporary reject.
Since: 3.8
gboolean e_backend_get_destination_address (EBackend *backend
,,
gchar **host);
guint16 *port
Provides destination server host name and port to which
the backend connects. This is used to determine required
connection point for e_backend_destination_is_reachable()
host
is a newly allocated string, which will be freed
with g_free()
backend
sets both host
and port
, then
it should return TRUE
FALSE
backend |
an EBackend instance |
|
host |
destination server host name. |
[out] |
port |
destination server port. |
[out] |
Since: 3.8
gboolean e_backend_is_destination_reachable (EBackend *backend
,,
GCancellable *cancellable);
GError **error
Checks whether the backend
's destination server, as returned
by e_backend_get_destination_address()
, is reachable.
If the e_backend_get_destination_address()
returns FALSE
TRUE
g_network_monitor_can_reach()
backend |
an EBackend instance |
|
cancellable |
a |
|
error |
a |
TRUE
FALSE
Since: 3.8
struct EBackend { };
Contains only private data that should be read and manipulated using the functions below.
Since: 3.4
struct EBackendClass { /* Methods */ gboolean (*get_destination_address) (EBackend *backend, gchar **host, guint16 *port); void (*prepare_shutdown) (EBackend *backend); ESourceAuthenticationResult (*authenticate_sync) (EBackend *backend, const ENamedParameters *credentials, gchar **out_certificate_pem, GTlsCertificateFlags *out_certificate_errors, GCancellable *cancellable, GError **error); };
Base class structure for the EBackend class
Since: 3.4