EBackend.Backend
Description: Reference for EBackend.Backend

### Class

# EBackendBackend

since: 3.4

#### Description [src]

    abstract class EBackend.Backend : GObject.Object
    {
      /* No available fields */
    }

Contains only private data that should be read and manipulated using the functions below.

Available since: 3.4

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- ECollectionBackend

#### Instance methods

###### e_backend_credentials_required

Asynchronously calls the `e_backend_credentials_required_sync()` on the `backend`, to inform clients that credentials are required.

since: 3.16

###### e_backend_credentials_required_finish

Finishes the operation started with e_backend_credentials_required().

since: 3.16

###### e_backend_credentials_required_sync

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.

since: 3.16

###### e_backend_ensure_online_state_updated

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

###### e_backend_ensure_source_status_connected

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 `EBackendClass`.authenticate_sync(), possibly through e_backend_schedule_authenticate().

since: 3.18

###### e_backend_get_destination_address

Provides destination server host name and port to which the backend connects. This is used to determine required connection point for e_backend_is_destination_reachable(). The `host` is a newly allocated string, which will be freed with g_free(). When `backend` sets both `host` and `port`, then it should return `TRUE`, indicating it’s a remote backend. Default implementation returns `FALSE`, which is treated like the backend is local, no checking for server reachability is possible.

since: 3.8

###### e_backend_get_network_monitor

Returns a `GNetworkMonitor` used to check whether the backend can access the remote server. The instance is owned by the `backend`.

since: 3.50

###### e_backend_get_online

Returns the online state of `backend`: `TRUE` if `backend` is online, `FALSE` if offline.

since: 3.4

###### e_backend_get_source

Returns the `ESource` to which `backend` is paired.

since: 3.4

###### e_backend_get_user_prompter

Gets an instance of `EUserPrompter`, associated with this `backend`.

since: 3.8

###### e_backend_is_destination_reachable

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`, this function returns `TRUE`, meaning the destination is always reachable. This uses `GNetworkMonitor`‘s `g_network_monitor_can_reach()` for reachability tests.

since: 3.8

###### e_backend_prepare_shutdown

Let’s the `backend` know that it’ll be shut down shortly, no client connects to it anymore. The `backend` can free any resources which reference it, for example the opened views.

since: 3.16

###### e_backend_ref_connectable

Returns the socket endpoint for the network service to which `backend` is a client, or `NULL` if `backend` does not use network sockets.

since: 3.8

###### e_backend_ref_main_context

Returns the `GMainContext` on which event sources for `backend` are to be attached.

since: 3.8

###### e_backend_schedule_authenticate

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.

since: 3.16

###### e_backend_schedule_credentials_required

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.

since: 3.16

###### e_backend_set_connectable

Sets the socket endpoint for the network service to which `backend` is a client. This can be `NULL` if `backend` does not use network sockets.

since: 3.8

###### e_backend_set_online

Sets the online state of `backend`: `TRUE` if `backend` is online, `FALSE` if offline.

since: 3.4

###### e_backend_trust_prompt

Initiates a user trust prompt with given `parameters`.

since: 3.8

###### e_backend_trust_prompt_finish

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`.

since: 3.8

###### e_backend_trust_prompt_sync

Asks a user a trust prompt with given `parameters`, and returns what user responded. This blocks until the response is delivered.

since: 3.8

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### EBackend.Backend:connectable

Socket endpoint of a network service.

###### EBackend.Backend:main-context

The main loop context on which to attach event sources.

###### EBackend.Backend:online

Whether the backend is online.

###### EBackend.Backend:source

The data source being acted upon.

###### EBackend.Backend:user-prompter

User prompter instance.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct EBackendBackendClass {
      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.

###### Class members

`get_destination_address: gboolean (* get_destination_address) ( EBackend* backend, gchar** host, guint16* port )`

  Fetch the destination address.

`prepare_shutdown: void (* prepare_shutdown) ( EBackend* backend )`

  Prepare for shutdown.

`authenticate_sync: ESourceAuthenticationResult (* authenticate_sync) ( EBackend* backend, const ENamedParameters* credentials, gchar** out_certificate_pem, GTlsCertificateFlags* out_certificate_errors, GCancellable* cancellable, GError** error )`

  Authenticate synchronously.

#### Virtual methods

###### EBackend.BackendClass.authenticate_sync

Authenticate synchronously.

###### EBackend.BackendClass.get_destination_address

Provides destination server host name and port to which the backend connects. This is used to determine required connection point for e_backend_is_destination_reachable(). The `host` is a newly allocated string, which will be freed with g_free(). When `backend` sets both `host` and `port`, then it should return `TRUE`, indicating it’s a remote backend. Default implementation returns `FALSE`, which is treated like the backend is local, no checking for server reachability is possible.

since: 3.8

###### EBackend.BackendClass.prepare_shutdown

Let’s the `backend` know that it’ll be shut down shortly, no client connects to it anymore. The `backend` can free any resources which reference it, for example the opened views.

since: 3.16