EDataCal.CalMetaBackend
Description: Reference for EDataCal.CalMetaBackend

### Class

# EDataCalCalMetaBackend

since: 3.26

#### Description

    abstract class EDataCal.CalMetaBackend : EDataCal.CalBackendSync
      implements ECal.TimezoneCache {
      /* No available fields */
    }

No description available.

Available since: 3.26

#### Hierarchy

#### Ancestors

- ECalBackendSync
- ECalBackend
- EBackend
- GObject

#### Implements

- ETimezoneCache

#### Instance methods

###### e_cal_meta_backend_connect_sync

This is called always before any operation which requires a connection to the remote side. It can fail with an #E_CLIENT_ERROR_REPOSITORY_OFFLINE error to indicate that the remote side cannot be currently reached. Other errors are propagated to the caller/client side. This method is not called when the backend is offline.

since: 3.26

###### e_cal_meta_backend_disconnect_sync

This is called when the backend goes into offline mode or when the disconnect is required. The implementation should not report any error when it is called and the `meta_backend` is not connected.

since: 3.26

###### e_cal_meta_backend_dup_sync_tag

Returns the last known synchronization tag, the same as used to call e_cal_meta_backend_get_changes_sync().

since: 3.28

###### e_cal_meta_backend_empty_cache_sync

Empties the local cache by removing all known components from it and notifies about such removal any opened views. It removes also all known time zones.

since: 3.26

###### e_cal_meta_backend_ensure_connected_sync

Ensures that the `meta_backend` is connected to its destination.

since: 3.26

###### e_cal_meta_backend_gather_timezones_sync

Extracts all VTIMEZONE components from the `vcalendar` and adds them to the memory cache, thus they are available when needed. The function does nothing when the `vcalendar` doesn’t hold a VCALENDAR component.

since: 3.26

###### e_cal_meta_backend_get_capabilities

No description available.

since: 3.26

###### e_cal_meta_backend_get_changes_sync

Gathers the changes since the last check which had been done on the remote side.

since: 3.26

###### e_cal_meta_backend_get_connected_writable

This value has meaning only if `e_cal_meta_backend_get_ever_connected()` is `TRUE`.

since: 3.26

###### e_cal_meta_backend_get_ever_connected

No description available.

since: 3.26

###### e_cal_meta_backend_get_ssl_error_details

It is optional to implement this virtual method by the descendants. It is used to receive SSL error details when any online operation returns E_CLIENT_ERROR, E_CLIENT_ERROR_TLS_NOT_AVAILABLE error.

since: 3.28

###### e_cal_meta_backend_inline_local_attachments_sync

Changes all URL attachments which point to a local file in `component` to inline attachments, aka adds the file content into the `component`. It also populates FILENAME parameter on the attachment. This is called automatically before e_cal_meta_backend_save_component_sync().

since: 3.26

###### e_cal_meta_backend_list_existing_sync

Used to get list of all existing objects on the remote side. The descendant can optionally provide `out_new_sync_tag`, which will be stored on success, if not `NULL`. The descendant can populate also ECalMetaBackendInfo::object of the `out_existing_objects`, if known, in which case this will be used instead of loading it with e_cal_meta_backend_load_component_sync().

since: 3.26

###### e_cal_meta_backend_load_component_sync

Loads a component from the remote side. Any detached instances should be returned together with the master object. The `out_component` can be either a VCALENDAR component, which would contain the master object and all of its detached instances, eventually also used time zones, or the requested component of type VEVENT, VJOURNAL or VTODO.

since: 3.26

###### e_cal_meta_backend_merge_instances

Merges all the instances provided in `instances` list into one VCALENDAR object, which would eventually contain also all the used timezones. The `instances` list should contain the master object and eventually all the detached instances for one component (they all have the same UID).

since: 3.26

###### e_cal_meta_backend_process_changes_sync

Processes given changes by updating local cache content accordingly. The `meta_backend` processes the changes like being online and particularly requires to be online to load created and modified objects when needed.

since: 3.26

###### e_cal_meta_backend_ref_cache

No description available.

since: 3.26

###### e_cal_meta_backend_refresh_sync

Refreshes the `meta_backend` immediately. To just schedule refresh operation call e_cal_meta_backend_schedule_refresh().

since: 3.26

###### e_cal_meta_backend_remove_component_sync

Removes a component from the remote side, with all its detached instances. The `object` is not `NULL` when it’s removing locally deleted object in offline mode. Being it `NULL`, the descendant can obtain the object from the `ECalCache`.

since: 3.26

###### e_cal_meta_backend_requires_reconnect

Determines, whether current source content requires reconnect of the backend.

since: 3.26

###### e_cal_meta_backend_save_component_sync

Saves one component into the remote side. The `instances` contain the master object and all the detached instances of the same component (all have the same UID). When the `overwrite_existing` is `TRUE`, then the descendant can overwrite an object with the same UID on the remote side (usually used for modify). The `conflict_resolution` defines what to do when the remote side had made any changes to the object since the last update.

since: 3.26

###### e_cal_meta_backend_schedule_refresh

Schedules refresh of the content of the `meta_backend`. If there’s any already scheduled, then the function does nothing.

since: 3.26

###### e_cal_meta_backend_search_components_sync

Searches `meta_backend` with given expression `expr` and returns found components as a `GSList` of `ECalComponent` `out_components`. Free the returned `out_components` with g_slist_free_full (components, g_object_unref); when no longer needed. When the `expr` is `NULL`, all objects are returned. To get iCal strings instead, call e_cal_meta_backend_search_sync().

since: 3.26

###### e_cal_meta_backend_search_sync

Searches `meta_backend` with given expression `expr` and returns found components as a `GSList` of iCal strings `out_icalstrings`. Free the returned `out_icalstrings` with g_slist_free_full (icalstrings, g_free); when no longer needed. When the `expr` is `NULL`, all objects are returned. To get `ECalComponent`-s instead, call e_cal_meta_backend_search_components_sync().

since: 3.26

###### e_cal_meta_backend_set_cache

Sets the `cache` as the cache to be used by the `meta_backend`. By default, a cache.db in ECalBackend::cache-dir is created in the constructed method. This function can be used to override the default.

since: 3.26

###### e_cal_meta_backend_set_connected_writable

Sets whether the `meta_backend` connected to a writable destination. This value has meaning only if `e_cal_meta_backend_get_ever_connected()` is `TRUE`.

since: 3.26

###### e_cal_meta_backend_set_ever_connected

Sets whether the `meta_backend` ever made a successful connection to its destination.

since: 3.26

###### e_cal_meta_backend_set_sync_tag

Sets the `sync_tag` for the `meta_backend`.

since: 3.50

###### e_cal_meta_backend_split_changes_sync

Splits `objects` into created/modified/removed lists according to current local cache content. Only the `out_removed_objects` can be `NULL`, others cannot. The function modifies `objects` by moving its ‘data’ to corresponding out lists and sets the `objects` ‘data’ to `NULL`.

since: 3.26

###### e_cal_meta_backend_store_inline_attachments_sync

Changes all inline attachments to URL attachments in `component`, which will point to a local file instead. The function expects FILENAME parameter to be set on the attachment as the file name of it. This is called automatically after e_cal_meta_backend_load_component_sync().

since: 3.26

##### Methods inherited from ECalBackendSync (14)

###### e_cal_backend_sync_add_timezone

Calls the add_timezone_sync method on the given backend.

###### e_cal_backend_sync_create_objects

Calls the create_objects_sync method on the given backend.

since: 3.6

###### e_cal_backend_sync_discard_alarm

Calls the discard_alarm_sync method on the given backend.

###### e_cal_backend_sync_get_attachment_uris

Calls the get_attachment_uris_sync method on the given backend.

since: 3.2

###### e_cal_backend_sync_get_free_busy

Calls the get_free_busy_sync method on the given backend.

###### e_cal_backend_sync_get_object

Calls the get_object_sync method on the given backend.

###### e_cal_backend_sync_get_object_list

Calls the get_object_list_sync method on the given backend.

###### e_cal_backend_sync_get_timezone

Calls the get_timezone_sync method on the given backend. This method is not mandatory on the backend, because here is used internal_get_timezone call to fetch timezone from it and that is transformed to a string. In other words, any object deriving from ECalBackendSync can implement only internal_get_timezone and can skip implementation of get_timezone_sync completely.

###### e_cal_backend_sync_modify_objects

Calls the modify_objects_sync method on the given backend.

since: 3.6

###### e_cal_backend_sync_open

Calls the open_sync method on the given backend.

###### e_cal_backend_sync_receive_objects

Calls the receive_objects_sync method on the given backend.

###### e_cal_backend_sync_refresh

Calls the refresh_sync method on the given backend.

since: 2.30

###### e_cal_backend_sync_remove_objects

Calls the remove_objects_sync method on the given backend.

since: 3.6

###### e_cal_backend_sync_send_objects

Calls the send_objects_sync method on the given backend.

##### Methods inherited from ECalBackend (70)

Please see ECalBackend 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.

##### Methods inherited from ETimezoneCache (3)

###### e_timezone_cache_add_timezone

Adds a copy of `zone` to `cache` and emits an `ETimezoneCache::timezone-added` signal. The `cache` will use the TZID string returned by `i_cal_timezone_get_tzid()` as the lookup key, which can be passed to `e_timezone_cache_get_timezone()` to obtain `zone` again.

###### e_timezone_cache_get_timezone

Obtains an `ICalTimezone` by its TZID string. If no match is found, the function returns `NULL`. The returned `ICalTimezone` is owned by the `cache` and should not be modified or freed.

###### e_timezone_cache_list_timezones

Returns a list of `ICalTimezone` instances that were explicitly added to the `cache` through e_timezone_cache_add_timezone(). In particular, any built-in time zone data that `e_timezone_cache_get_timezone()` may use to match a TZID string is excluded from the returned list.

#### Properties

###### EDataCal.CalMetaBackend:cache

The `ECalCache` being used for this meta backend.

##### Properties inherited from ECalBackend (5)

###### EDataCal.CalBackend:cache-dir

The backend’s cache directory.

###### EDataCal.CalBackend:kind

The kind of iCalendar components this backend manages.

###### EDataCal.CalBackend:proxy-resolver

The proxy resolver for this backend.

###### EDataCal.CalBackend:registry

Data source registry.

###### EDataCal.CalBackend: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

###### EDataCal.CalMetaBackend::refresh-completed

No description available.

###### EDataCal.CalMetaBackend::source-changed

This signal is emitted whenever the underlying backend `ESource` changes. Unlike the `ESource`‘s ‘changed’ signal this one is tight to the `ECalMetaBackend` itself and is emitted from a dedicated thread, thus it doesn’t block the main thread.

since: 3.26

##### Signals inherited from ECalBackend (2)

###### ECalBackend::closed

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

since: 3.10

###### ECalBackend::shutdown

Emitted when the last client destroys its `ECalClient` 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.

##### Signals inherited from ETimezoneCache (1)

###### ETimezoneCache::timezone-added

Emitted when a new #icaltimezone is added to `cache`.

#### Class structure

    struct EDataCalCalMetaBackendClass {
      gboolean (* connect_sync) (
        ECalMetaBackend* meta_backend,
        const ENamedParameters* credentials,
        ESourceAuthenticationResult* out_auth_result,
        gchar** out_certificate_pem,
        GTlsCertificateFlags* out_certificate_errors,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* disconnect_sync) (
        ECalMetaBackend* meta_backend,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* get_changes_sync) (
        ECalMetaBackend* meta_backend,
        const gchar* last_sync_tag,
        gboolean is_repeat,
        gchar** out_new_sync_tag,
        gboolean* out_repeat,
        GSList** out_created_objects,
        GSList** out_modified_objects,
        GSList** out_removed_objects,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* list_existing_sync) (
        ECalMetaBackend* meta_backend,
        gchar** out_new_sync_tag,
        GSList** out_existing_objects,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* load_component_sync) (
        ECalMetaBackend* meta_backend,
        const gchar* uid,
        const gchar* extra,
        ICalComponent** out_component,
        gchar** out_extra,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* save_component_sync) (
        ECalMetaBackend* meta_backend,
        gboolean overwrite_existing,
        EConflictResolution conflict_resolution,
        const GSList* instances,
        const gchar* extra,
        ECalOperationFlags opflags,
        gchar** out_new_uid,
        gchar** out_new_extra,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* remove_component_sync) (
        ECalMetaBackend* meta_backend,
        EConflictResolution conflict_resolution,
        const gchar* uid,
        const gchar* extra,
        const gchar* object,
        ECalOperationFlags opflags,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* search_sync) (
        ECalMetaBackend* meta_backend,
        const gchar* expr,
        GSList** out_icalstrings,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* search_components_sync) (
        ECalMetaBackend* meta_backend,
        const gchar* expr,
        GSList** out_components,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* requires_reconnect) (
        ECalMetaBackend* meta_backend
      );
      void (* source_changed) (
        ECalMetaBackend* meta_backend
      );
      gboolean (* get_ssl_error_details) (
        ECalMetaBackend* meta_backend,
        gchar** out_certificate_pem,
        GTlsCertificateFlags* out_certificate_errors
      );

    }

Class structure for the `ECalMetaBackend` class.

###### Class members

`connect_sync: gboolean (* connect_sync) ( ECalMetaBackend* meta_backend, const ENamedParameters* credentials, ESourceAuthenticationResult* out_auth_result, gchar** out_certificate_pem, GTlsCertificateFlags* out_certificate_errors, GCancellable* cancellable, GError** error )`

  No description available.

`disconnect_sync: gboolean (* disconnect_sync) ( ECalMetaBackend* meta_backend, GCancellable* cancellable, GError** error )`

  No description available.

`get_changes_sync: gboolean (* get_changes_sync) ( ECalMetaBackend* meta_backend, const gchar* last_sync_tag, gboolean is_repeat, gchar** out_new_sync_tag, gboolean* out_repeat, GSList** out_created_objects, GSList** out_modified_objects, GSList** out_removed_objects, GCancellable* cancellable, GError** error )`

  No description available.

`list_existing_sync: gboolean (* list_existing_sync) ( ECalMetaBackend* meta_backend, gchar** out_new_sync_tag, GSList** out_existing_objects, GCancellable* cancellable, GError** error )`

  No description available.

`load_component_sync: gboolean (* load_component_sync) ( ECalMetaBackend* meta_backend, const gchar* uid, const gchar* extra, ICalComponent** out_component, gchar** out_extra, GCancellable* cancellable, GError** error )`

  No description available.

`save_component_sync: gboolean (* save_component_sync) ( ECalMetaBackend* meta_backend, gboolean overwrite_existing, EConflictResolution conflict_resolution, const GSList* instances, const gchar* extra, ECalOperationFlags opflags, gchar** out_new_uid, gchar** out_new_extra, GCancellable* cancellable, GError** error )`

  No description available.

`remove_component_sync: gboolean (* remove_component_sync) ( ECalMetaBackend* meta_backend, EConflictResolution conflict_resolution, const gchar* uid, const gchar* extra, const gchar* object, ECalOperationFlags opflags, GCancellable* cancellable, GError** error )`

  No description available.

`search_sync: gboolean (* search_sync) ( ECalMetaBackend* meta_backend, const gchar* expr, GSList** out_icalstrings, GCancellable* cancellable, GError** error )`

  No description available.

`search_components_sync: gboolean (* search_components_sync) ( ECalMetaBackend* meta_backend, const gchar* expr, GSList** out_components, GCancellable* cancellable, GError** error )`

  No description available.

`requires_reconnect: gboolean (* requires_reconnect) ( ECalMetaBackend* meta_backend )`

  No description available.

`source_changed: void (* source_changed) ( ECalMetaBackend* meta_backend )`

  No description available.

`get_ssl_error_details: gboolean (* get_ssl_error_details) ( ECalMetaBackend* meta_backend, gchar** out_certificate_pem, GTlsCertificateFlags* out_certificate_errors )`

  No description available.

#### Virtual methods

###### EDataCal.CalMetaBackendClass.connect_sync

This is called always before any operation which requires a connection to the remote side. It can fail with an #E_CLIENT_ERROR_REPOSITORY_OFFLINE error to indicate that the remote side cannot be currently reached. Other errors are propagated to the caller/client side. This method is not called when the backend is offline.

since: 3.26

###### EDataCal.CalMetaBackendClass.disconnect_sync

This is called when the backend goes into offline mode or when the disconnect is required. The implementation should not report any error when it is called and the `meta_backend` is not connected.

since: 3.26

###### EDataCal.CalMetaBackendClass.get_changes_sync

Gathers the changes since the last check which had been done on the remote side.

since: 3.26

###### EDataCal.CalMetaBackendClass.get_ssl_error_details

It is optional to implement this virtual method by the descendants. It is used to receive SSL error details when any online operation returns E_CLIENT_ERROR, E_CLIENT_ERROR_TLS_NOT_AVAILABLE error.

since: 3.28

###### EDataCal.CalMetaBackendClass.list_existing_sync

Used to get list of all existing objects on the remote side. The descendant can optionally provide `out_new_sync_tag`, which will be stored on success, if not `NULL`. The descendant can populate also ECalMetaBackendInfo::object of the `out_existing_objects`, if known, in which case this will be used instead of loading it with e_cal_meta_backend_load_component_sync().

since: 3.26

###### EDataCal.CalMetaBackendClass.load_component_sync

Loads a component from the remote side. Any detached instances should be returned together with the master object. The `out_component` can be either a VCALENDAR component, which would contain the master object and all of its detached instances, eventually also used time zones, or the requested component of type VEVENT, VJOURNAL or VTODO.

since: 3.26

###### EDataCal.CalMetaBackendClass.remove_component_sync

Removes a component from the remote side, with all its detached instances. The `object` is not `NULL` when it’s removing locally deleted object in offline mode. Being it `NULL`, the descendant can obtain the object from the `ECalCache`.

since: 3.26

###### EDataCal.CalMetaBackendClass.requires_reconnect

Determines, whether current source content requires reconnect of the backend.

since: 3.26

###### EDataCal.CalMetaBackendClass.save_component_sync

Saves one component into the remote side. The `instances` contain the master object and all the detached instances of the same component (all have the same UID). When the `overwrite_existing` is `TRUE`, then the descendant can overwrite an object with the same UID on the remote side (usually used for modify). The `conflict_resolution` defines what to do when the remote side had made any changes to the object since the last update.

since: 3.26

###### EDataCal.CalMetaBackendClass.search_components_sync

Searches `meta_backend` with given expression `expr` and returns found components as a `GSList` of `ECalComponent` `out_components`. Free the returned `out_components` with g_slist_free_full (components, g_object_unref); when no longer needed. When the `expr` is `NULL`, all objects are returned. To get iCal strings instead, call e_cal_meta_backend_search_sync().

since: 3.26

###### EDataCal.CalMetaBackendClass.search_sync

Searches `meta_backend` with given expression `expr` and returns found components as a `GSList` of iCal strings `out_icalstrings`. Free the returned `out_icalstrings` with g_slist_free_full (icalstrings, g_free); when no longer needed. When the `expr` is `NULL`, all objects are returned. To get `ECalComponent`-s instead, call e_cal_meta_backend_search_components_sync().

since: 3.26

###### EDataCal.CalMetaBackendClass.source_changed

No description available.