EDataCal.CalCache
Description: Reference for EDataCal.CalCache

### Class

# EDataCalCalCache

since: 3.26

#### Description [src]

    class EDataCal.CalCache : EBackend.Cache
      implements ECal.TimezoneCache, EDataServer.Extensible {
      /* No available fields */
    }

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

Available since: 3.26

#### Hierarchy

#### Ancestors

- ECache
- GObject

#### Implements

- ETimezoneCache
- EExtensible

#### Constructors

###### e_cal_cache_new

Creates a new `ECalCache`.

since: 3.26

#### Functions

###### e_cal_cache_resolve_timezone_cb

An `ECalRecurResolveTimezoneCb` callback, which can be used with e_cal_recur_generate_instances_sync(). The `cal_cache` is supposed to be an `ECalCache` instance.

since: 3.26

#### Instance methods

###### e_cal_cache_contains

Checkes whether the `cal_cache` contains an object with the given `uid` and `rid`. The `rid` can be an empty string or `NULL` to search for the master object, otherwise the check is done for a detached instance, not for a recurrence instance.

since: 3.26

###### e_cal_cache_delete_attachments

Deletes all locally stored attachments beside the cache file from the disk. This doesn’t modify the `component`. It’s usually called before the `component` is being removed from the `cal_cache`.

since: 3.26

###### e_cal_cache_dup_component_revision

Returns the `icomp` revision, used to detect changes. The returned string should be freed with g_free(), when no longer needed.

since: 3.26

###### e_cal_cache_dup_timezone_as_string

Gets a timezone with given `tzid`, which had been previously put into the `cal_cache` with e_cal_cache_put_timezone(). The returned string is an iCal string for that ICalTimezone and should be freed with `g_free()` when no longer needed.

since: 3.26

###### e_cal_cache_get_component

Gets a component identified by `uid`, and optionally by the `rid`, from the `cal_cache`. The returned `out_component` should be freed with g_object_unref(), when no longer needed.

since: 3.26

###### e_cal_cache_get_component_as_string

Gets a component identified by `uid`, and optionally by the `rid`, from the `cal_cache`. The returned `out_icalstring` should be freed with g_free(), when no longer needed.

since: 3.26

###### e_cal_cache_get_component_custom_flags

Gets the custom flags previously set for `uid` and `rid`, either with e_cal_cache_set_component_custom_flags(), when adding components or when removing components in offline.

since: 3.34

###### e_cal_cache_get_component_extra

Gets the extra data previously set for `uid` and `rid`, either with `e_cal_cache_set_component_extra()` or when adding components.

since: 3.26

###### e_cal_cache_get_components_by_uid

Gets the master object and all detached instances for a component identified by the `uid`. Free the returned `GSList` with g_slist_free_full (components, g_object_unref); when no longer needed.

since: 3.26

###### e_cal_cache_get_components_by_uid_as_string

Gets the master object and all detached instances as string for a component identified by the `uid`. Free the returned `GSList` with g_slist_free_full (icalstrings, g_free); when no longer needed.

since: 3.26

###### e_cal_cache_get_components_in_range

Gets a list of components which occur in the given time range. It’s not an error if none is found.

since: 3.26

###### e_cal_cache_get_components_in_range_as_strings

Gets a list of components, as iCal strings, which occur in the given time range.

since: 3.26

###### e_cal_cache_get_ids_with_extra

Gets all the ID-s the `extra` data is set for.

since: 3.26

###### e_cal_cache_get_offline_changes

The same as e_cache_get_offline_changes(), only splits the saved UID into UID and RID and saved the data into `ECalCacheOfflineChange` structure.

since: 3.26

###### e_cal_cache_get_offline_state

This is a wrapper of e_cache_get_offline_state(), ensuring that a correct `ECache` UID will be used.

since: 3.34

###### e_cal_cache_get_timezone

Gets a timezone with given `tzid`, which had been previously put into the `cal_cache` with e_cal_cache_put_timezone(). The returned ICalTimezone is owned by the `cal_cache` and should not be freed.

since: 3.26

###### e_cal_cache_list_timezones

Gets a list of all stored timezones by the `cal_cache`. Only the returned list should be freed with `g_list_free()` when no longer needed; the `ICalTimezone`-s are owned by the `cal_cache`.

since: 3.26

###### e_cal_cache_put_component

Adds a `component` into the `cal_cache`. Any existing with the same UID and RID is replaced.

since: 3.26

###### e_cal_cache_put_components

Adds a list of `components` into the `cal_cache`. Any existing with the same UID and RID are replaced.

since: 3.26

###### e_cal_cache_put_timezone

Puts the `zone` into the `cal_cache` using its timezone ID as an identificator. The function adds a new or replaces existing, if any such already exists in the `cal_cache`. The function does nothing and returns `TRUE`, when the passed-in `zone` is libical builtin timezone.

since: 3.26

###### e_cal_cache_remove_component

Removes a component identified by `uid` and `rid` from the `cal_cache`. When the `rid` is `NULL`, or an empty string, then removes the master object only, without any detached instance.

since: 3.26

###### e_cal_cache_remove_components

Removes components identified by `uid` and `rid` from the `cal_cache` in the `ids` list. When the `rid` is `NULL`, or an empty string, then removes the master object only, without any detached instance. The `custom_flags` is used, if not `NULL`, only if the `offline_flag` is `E_CACHE_IS_OFFLINE`. Otherwise it’s ignored. The length of the `custom_flags` should match the length of `ids`, when not `NULL`.

since: 3.26

###### e_cal_cache_remove_timezone

Dereferences use count of the time zone with ID `tzid` by `dec_ref_counts` and removes the timezone from the cache when the reference count reaches zero. Special case is with `dec_ref_counts` being zero, in which case the corresponding timezone is removed regardless of the current reference count.

since: 3.30

###### e_cal_cache_remove_timezones

Removes all stored timezones from the `cal_cache`.

since: 3.26

###### e_cal_cache_search

Searches the `cal_cache` with the given `sexp` and returns those components which satisfy the search expression as a `GSList` of `ECalCacheSearchData`. The `out_data` should be freed with g_slist_free_full (data, e_cal_cache_search_data_free); when no longer needed.

since: 3.26

###### e_cal_cache_search_components

Searches the `cal_cache` with the given `sexp` and returns those components which satisfy the search expression. The `out_components` should be freed with g_slist_free_full (components, g_object_unref); when no longer needed.

since: 3.26

###### e_cal_cache_search_ids

Searches the `cal_cache` with the given `sexp` and returns ECalComponentId for those components which satisfy the search expression. The `out_ids` should be freed with g_slist_free_full (ids, (GDestroyNotify) e_cal_component_id_free); when no longer needed.

since: 3.26

###### e_cal_cache_search_with_callback

Searches the `cal_cache` with the given `sexp` and calls `func` for each row which satisfy the search expression.

since: 3.26

###### e_cal_cache_set_component_custom_flags

Sets or replaces the custom flags associated with a component identified by `uid` and optionally `rid`.

since: 3.34

###### e_cal_cache_set_component_extra

Sets or replaces the extra data associated with a component identified by `uid` and optionally `rid`.

since: 3.26

##### Methods inherited from ECache (37)

Please see ECache for a full list of methods.

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

##### Methods inherited from EExtensible (3)

###### e_extensible_list_extensions

Returns a list of `EExtension` objects bound to `extensible` whose types are ancestors of `extension_type`. For a complete list of extension objects bound to `extensible`, pass `E_TYPE_EXTENSION`.

###### e_extensible_load_extensions

Creates an instance of all instantiable subtypes of `EExtension` which target the class of `extensible`. The lifetimes of these newly created `EExtension` objects are bound to `extensible` such that they are finalized when `extensible` is finalized.

###### e_extensible_reload_extensions

Similar to e_extensible_load_extensions(), only loads newly discovered extensions again. This can help in case a new module had been loaded to the process, which provides the extensions for the `extensible`.

#### Signals

###### EDataCal.CalCache::dup-component-revision

No description available.

###### EDataCal.CalCache::get-timezone

A signal being called to get timezone when putting component into the cache. It’s used to make sure the cache contains all timezones which are needed by the component. The returned ICalTimezone will not be freed.

since: 3.30

##### Signals inherited from ECache (3)

###### ECache::before-put

No description available.

###### ECache::before-remove

No description available.

###### ECache::revision-changed

No description available.

##### 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 EDataCalCalCacheClass {
      gchar* (* dup_component_revision) (
        ECalCache* cal_cache,
        ICalComponent* icomp
      );
      ICalTimezone* (* get_timezone) (
        ECalCache* cal_cache,
        const gchar* tzid
      );

    }

Class structure for the `ECalCache` class.

###### Class members

`dup_component_revision: gchar* (* dup_component_revision) ( ECalCache* cal_cache, ICalComponent* icomp )`

  No description available.

`get_timezone: ICalTimezone* (* get_timezone) ( ECalCache* cal_cache, const gchar* tzid )`

  No description available.

#### Virtual methods

###### EDataCal.CalCacheClass.dup_component_revision

Returns the `icomp` revision, used to detect changes. The returned string should be freed with g_free(), when no longer needed.

since: 3.26

###### EDataCal.CalCacheClass.get_timezone

No description available.