EDataBook.BookBackendSync
Description: Reference for EDataBook.BookBackendSync

### Class

# EDataBookBookBackendSync

#### Description [src]

    class EDataBook.BookBackendSync : EDataBook.BookBackend
    {
      /* No available fields */
    }

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

#### Hierarchy

#### Ancestors

- EBookBackend
- EBackend
- GObject

#### Descendants

- EBookMetaBackend

#### Instance methods

###### e_book_backend_sync_contains_email

Checks whether contains an `email_address`. When the `email_address` contains multiple addresses, then returns `TRUE` when at least one address exists in the address book.

since: 3.44

###### e_book_backend_sync_create_contacts

Creates one or more new contacts from `vcards`, and deposits an `EContact` instance for each newly-created contact in `out_contacts`.

since: 3.34

###### e_book_backend_sync_get_contact

Obtains an `EContact` for `uid`.

since: 3.34

###### e_book_backend_sync_get_contact_list

Obtains a set of `EContact` instances which satisfy the criteria specified in `query`, and deposits them in `out_contacts`.

since: 3.34

###### e_book_backend_sync_get_contact_list_uids

Obtains a set of ID strings for contacts which satisfy the criteria specified in `query`, and deposits them in `out_uids`.

since: 3.34

###### e_book_backend_sync_modify_contacts

Modifies one or more contacts according to `vcards`.

since: 3.34

###### e_book_backend_sync_open

“Opens” the `backend`. Opening a backend is something of an outdated concept, but the operation is hanging around for a little while longer. This usually involves some custom initialization logic, and testing of remote authentication if applicable.

since: 3.34

###### e_book_backend_sync_refresh

Initiates a refresh for `backend`, if the `backend` supports refreshing. The actual refresh operation completes on its own time. This function merely initiates the operation.

since: 3.34

###### e_book_backend_sync_remove_contacts

Removes one or more contacts according to `uids`.

since: 3.34

##### Methods inherited from EBookBackend (70)

Please see EBookBackend for a full list of methods.

##### Methods inherited from EBackend (21)

###### e_backend_credentials_required

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

###### e_backend_credentials_required_finish

Finishes the operation started with e_backend_credentials_required().

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

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

###### 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().

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

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

###### e_backend_get_online

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

###### e_backend_get_source

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

###### e_backend_get_user_prompter

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

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

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

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

###### e_backend_ref_main_context

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

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

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

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

###### e_backend_set_online

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

###### e_backend_trust_prompt

Initiates a user trust prompt with given `parameters`.

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

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

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

Please see GObject for a full list of methods.

#### Properties

##### Properties inherited from EBookBackend (4)

###### EDataBook.BookBackend:cache-dir

The backend’s cache directory.

###### EDataBook.BookBackend:proxy-resolver

The proxy resolver for this backend.

###### EDataBook.BookBackend:registry

Data source registry.

###### EDataBook.BookBackend:writable

Whether the backend will accept changes.

##### Properties inherited from EBackend (5)

###### 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 EBookBackend (2)

###### EBookBackend::closed

Emitted when a client destroys its `EBookClient` for `backend`.

since: 3.10

###### EBookBackend::shutdown

Emitted when the last client destroys its `EBookClient` for `backend`. This signals the `backend` to begin final cleanup tasks such as synchronizing data to permanent storage.

since: 3.10

##### 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 EDataBookBookBackendSyncClass {
      gboolean (* open_sync) (
        EBookBackendSync* backend,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* refresh_sync) (
        EBookBackendSync* backend,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* create_contacts_sync) (
        EBookBackendSync* backend,
        const gchar* const* vcards,
        guint32 opflags,
        GSList** out_contacts,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* modify_contacts_sync) (
        EBookBackendSync* backend,
        const gchar* const* vcards,
        guint32 opflags,
        GSList** out_contacts,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* remove_contacts_sync) (
        EBookBackendSync* backend,
        const gchar* const* uids,
        guint32 opflags,
        GSList** out_removed_uids,
        GCancellable* cancellable,
        GError** error
      );
      EContact* (* get_contact_sync) (
        EBookBackendSync* backend,
        const gchar* uid,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* get_contact_list_sync) (
        EBookBackendSync* backend,
        const gchar* query,
        GSList** out_contacts,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* get_contact_list_uids_sync) (
        EBookBackendSync* backend,
        const gchar* query,
        GSList** out_uids,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* contains_email_sync) (
        EBookBackendSync* backend,
        const gchar* email_address,
        GCancellable* cancellable,
        GError** error
      );
      gpointer reserved_padding;

    }

Class structure for the `EBookBackendSync` class.

These virtual methods must be implemented when writing an addressbook backend.

###### Class members

`open_sync: gboolean (* open_sync) ( EBookBackendSync* backend, GCancellable* cancellable, GError** error )`

  Open the backend.

`refresh_sync: gboolean (* refresh_sync) ( EBookBackendSync* backend, GCancellable* cancellable, GError** error )`

  Refresh the backend.

`create_contacts_sync: gboolean (* create_contacts_sync) ( EBookBackendSync* backend, const gchar* const* vcards, guint32 opflags, GSList** out_contacts, GCancellable* cancellable, GError** error )`

  Add and store the passed vcards.

`modify_contacts_sync: gboolean (* modify_contacts_sync) ( EBookBackendSync* backend, const gchar* const* vcards, guint32 opflags, GSList** out_contacts, GCancellable* cancellable, GError** error )`

  Modify the existing contacts using the passed vcards.

`remove_contacts_sync: gboolean (* remove_contacts_sync) ( EBookBackendSync* backend, const gchar* const* uids, guint32 opflags, GSList** out_removed_uids, GCancellable* cancellable, GError** error )`

  Remove the contacts specified by the passed UIDs.

`get_contact_sync: EContact* (* get_contact_sync) ( EBookBackendSync* backend, const gchar* uid, GCancellable* cancellable, GError** error )`

  Fetch a contact by UID.

`get_contact_list_sync: gboolean (* get_contact_list_sync) ( EBookBackendSync* backend, const gchar* query, GSList** out_contacts, GCancellable* cancellable, GError** error )`

  Fetch a list of contacts based on a search expression.

`get_contact_list_uids_sync: gboolean (* get_contact_list_uids_sync) ( EBookBackendSync* backend, const gchar* query, GSList** out_uids, GCancellable* cancellable, GError** error )`

  Fetch a list of contact UIDs based on a search expression (optional).

`contains_email_sync: gboolean (* contains_email_sync) ( EBookBackendSync* backend, const gchar* email_address, GCancellable* cancellable, GError** error )`

  No description available.

`reserved_padding: gpointer`

  No description available.

#### Virtual methods

###### EDataBook.BookBackendSyncClass.contains_email_sync

No description available.

###### EDataBook.BookBackendSyncClass.create_contacts_sync

Add and store the passed vcards.

###### EDataBook.BookBackendSyncClass.get_contact_list_sync

Fetch a list of contacts based on a search expression.

###### EDataBook.BookBackendSyncClass.get_contact_list_uids_sync

Fetch a list of contact UIDs based on a search expression (optional).

###### EDataBook.BookBackendSyncClass.get_contact_sync

Fetch a contact by UID.

###### EDataBook.BookBackendSyncClass.modify_contacts_sync

Modify the existing contacts using the passed vcards.

###### EDataBook.BookBackendSyncClass.open_sync

Open the backend.

###### EDataBook.BookBackendSyncClass.refresh_sync

Refresh the backend.

###### EDataBook.BookBackendSyncClass.remove_contacts_sync

Remove the contacts specified by the passed UIDs.