ECalCache: Evolution-Data-Server Reference Manual

## ECalCache ECalCache — An ECache descendant for calendars |

## Functions

ECalCacheOfflineChange * | e_cal_cache_offline_change_new ()
ECalCacheOfflineChange * | e_cal_cache_offline_change_copy ()
void | e_cal_cache_offline_change_free ()
ECalCacheSearchData * | e_cal_cache_search_data_new ()
ECalCacheSearchData * | e_cal_cache_search_data_copy ()
void | e_cal_cache_search_data_free ()
gboolean | (*ECalCacheSearchFunc) ()
ECalCache * | e_cal_cache_new ()
gchar * | e_cal_cache_dup_component_revision ()
gboolean | e_cal_cache_contains ()
gboolean | e_cal_cache_put_component ()
gboolean | e_cal_cache_put_components ()
gboolean | e_cal_cache_remove_component ()
gboolean | e_cal_cache_remove_components ()
gboolean | e_cal_cache_get_component ()
gboolean | e_cal_cache_get_component_as_string ()
gboolean | e_cal_cache_set_component_extra ()
gboolean | e_cal_cache_get_component_extra ()
gboolean | e_cal_cache_get_ids_with_extra ()
gboolean | e_cal_cache_get_components_by_uid ()
gboolean | e_cal_cache_get_components_by_uid_as_string ()
gboolean | e_cal_cache_get_components_in_range ()
gboolean | e_cal_cache_get_components_in_range_as_strings ()
gboolean | e_cal_cache_search ()
gboolean | e_cal_cache_search_components ()
gboolean | e_cal_cache_search_ids ()
gboolean | e_cal_cache_search_with_callback ()
GSList * | e_cal_cache_get_offline_changes ()
gboolean | e_cal_cache_delete_attachments ()
gboolean | e_cal_cache_put_timezone ()
gboolean | e_cal_cache_get_timezone ()
gboolean | e_cal_cache_dup_timezone_as_string ()
gboolean | e_cal_cache_list_timezones ()
gboolean | e_cal_cache_remove_timezone ()
gboolean | e_cal_cache_remove_timezones ()
icaltimezone * | e_cal_cache_resolve_timezone_cb ()
icaltimezone * | e_cal_cache_resolve_timezone_simple_cb ()

## Types and Values

| ECalCacheOfflineChange
| ECalCacheSearchData
struct | ECalCache
struct | ECalCacheClass

## Includes

    #include <libedata-cal/libedata-cal.h>

## Description

The ECalCache is an API for storing and looking up calendar components in an ECache.

The API is thread safe, in the similar way as the ECache is.

Any operations which can take a lot of time to complete (depending on the size of your calendar) can be cancelled using a GCancellable.

## Functions

### e_cal_cache_offline_change_new ()

    ECalCacheOfflineChange *
    e_cal_cache_offline_change_new (const gchar *uid,
                                    const gchar *rid,
                                    const gchar *revision,
                                    const gchar *object,
                                    EOfflineState state);

Creates a new ECalCacheOfflineChange with the offline `state` information for the given `uid` .

#### Parameters

uid | a unique component identifier |
rid | a Recurrence-ID of the component. | [nullable]
revision | a revision of the component. | [nullable]
object | component itself. | [nullable]
state | an EOfflineState |

#### Returns

A new ECalCacheOfflineChange. Free it with `e_cal_cache_offline_change_free()` when no longer needed.

[transfer full]

Since: 3.26

### e_cal_cache_offline_change_copy ()

    ECalCacheOfflineChange *
    e_cal_cache_offline_change_copy (const ECalCacheOfflineChange *change);

#### Parameters

change | a source ECalCacheOfflineChange to copy, or `NULL`. | [nullable]

#### Returns

Copy of the given `change` . Free it with `e_cal_cache_offline_change_free()` when no longer needed. If the `change` is `NULL`, then returns `NULL` as well.

[transfer full]

Since: 3.26

### e_cal_cache_offline_change_free ()

    void
    e_cal_cache_offline_change_free (gpointer change);

Frees the `change` structure, previously allocated with `e_cal_cache_offline_change_new()` or `e_cal_cache_offline_change_copy()`.

#### Parameters

change | an ECalCacheOfflineChange. | [nullable]

Since: 3.26

### e_cal_cache_search_data_new ()

    ECalCacheSearchData *
    e_cal_cache_search_data_new (const gchar *uid,
                                 const gchar *rid,
                                 const gchar *object,
                                 const gchar *extra);

Creates a new ECalCacheSearchData prefilled with the given values.

#### Parameters

uid | a component UID; cannot be `NULL` |
rid | a component Recurrence-ID; can be `NULL`. | [nullable]
object | the component as an iCal string; cannot be `NULL` |
extra | any extra data stored with the component, or `NULL`. | [nullable]

#### Returns

A new ECalCacheSearchData. Free it with `e_cal_cache_search_data_free()` when no longer needed.

[transfer full]

Since: 3.26

### e_cal_cache_search_data_copy ()

    ECalCacheSearchData *
    e_cal_cache_search_data_copy (const ECalCacheSearchData *data);

#### Parameters

data | a source ECalCacheSearchData to copy, or `NULL`. | [nullable]

#### Returns

Copy of the given `data` . Free it with `e_cal_cache_search_data_free()` when no longer needed. If the `data` is `NULL`, then returns `NULL` as well.

[transfer full]

Since: 3.26

### e_cal_cache_search_data_free ()

    void
    e_cal_cache_search_data_free (gpointer ptr);

Frees the `ptr` structure, previously allocated with `e_cal_cache_search_data_new()` or `e_cal_cache_search_data_copy()`.

#### Parameters

ptr | an ECalCacheSearchData. | [nullable]

Since: 3.26

### ECalCacheSearchFunc ()

    gboolean
    (*ECalCacheSearchFunc) (ECalCache *cal_cache,
                            const gchar *uid,
                            const gchar *rid,
                            const gchar *revision,
                            const gchar *object,
                            const gchar *extra,
                            EOfflineState offline_state,
                            gpointer user_data);

A callback called for each object row when using `e_cal_cache_search_with_callback()` function.

#### Parameters

cal_cache | an ECalCache |
uid | a unique object identifier |
rid | an optional Recurrence-ID of the object. | [nullable]
revision | the object revision |
object | the object itself |
extra | extra data stored with the object |
offline_state | objects offline state, one of EOfflineState |
user_data | user data, as used in `e_cal_cache_search_with_callback()` |

#### Returns

`TRUE` to continue, `FALSE` to stop walk through.

Since: 3.26

### e_cal_cache_new ()

    ECalCache *
    e_cal_cache_new (const gchar *filename,
                     GCancellable *cancellable,
                     GError **error);

Creates a new ECalCache.

#### Parameters

filename | file name to load or create the new cache |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

A new ECalCache or `NULL` on error.

[transfer full][nullable]

Since: 3.26

### e_cal_cache_dup_component_revision ()

    gchar *
    e_cal_cache_dup_component_revision (ECalCache *cal_cache,
                                        icalcomponent *icalcomp);

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

#### Parameters

cal_cache | an ECalCache |
icalcomp | an icalcomponent |

#### Returns

A newly allocated string containing revision of the `icalcomp` .

[transfer full]

Since: 3.26

### e_cal_cache_contains ()

    gboolean
    e_cal_cache_contains (ECalCache *cal_cache,
                          const gchar *uid,
                          const gchar *rid,
                          ECacheDeletedFlag deleted_flag);

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.

#### Parameters

cal_cache | an ECalCache |
uid | component UID |
rid | optional component Recurrence-ID or `NULL`. | [nullable]
deleted_flag | one of ECacheDeletedFlag enum |

#### Returns

Whether the the object had been found.

Since: 3.26

### e_cal_cache_put_component ()

    gboolean
    e_cal_cache_put_component (ECalCache *cal_cache,
                               ECalComponent *component,
                               const gchar *extra,
                               ECacheOfflineFlag offline_flag,
                               GCancellable *cancellable,
                               GError **error);

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

#### Parameters

cal_cache | an ECalCache |
component | an ECalComponent to put into the `cal_cache` |
extra | an extra data to store in association with the `component` . | [nullable]
offline_flag | one of ECacheOfflineFlag, whether putting this component in offline |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_put_components ()

    gboolean
    e_cal_cache_put_components (ECalCache *cal_cache,
                                const GSList *components,
                                const GSList *extras,
                                ECacheOfflineFlag offline_flag,
                                GCancellable *cancellable,
                                GError **error);

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

If `extras` is not `NULL`, it's length should be the same as the length of the `components` .

#### Parameters

cal_cache | an ECalCache |
components | a GSList of ECalComponent to put into the `cal_cache` . | [element-type ECalComponent]
extras | an extra data to store in association with the `components` . | [nullable][element-type utf8]
offline_flag | one of ECacheOfflineFlag, whether putting these components in offline |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_remove_component ()

    gboolean
    e_cal_cache_remove_component (ECalCache *cal_cache,
                                  const gchar *uid,
                                  const gchar *rid,
                                  ECacheOfflineFlag offline_flag,
                                  GCancellable *cancellable,
                                  GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component to remove |
rid | an optional Recurrence-ID to remove. | [nullable]
offline_flag | one of ECacheOfflineFlag, whether removing this component in offline |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_remove_components ()

    gboolean
    e_cal_cache_remove_components (ECalCache *cal_cache,
                                   const GSList *ids,
                                   ECacheOfflineFlag offline_flag,
                                   GCancellable *cancellable,
                                   GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
ids | a GSList of components to remove. | [element-type ECalComponentId]
offline_flag | one of ECacheOfflineFlag, whether removing these comonents in offline |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_component ()

    gboolean
    e_cal_cache_get_component (ECalCache *cal_cache,
                               const gchar *uid,
                               const gchar *rid,
                               ECalComponent **out_component,
                               GCancellable *cancellable,
                               GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
rid | an optional Recurrence-ID. | [nullable]
out_component | return location for an ECalComponent. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_component_as_string ()

    gboolean
    e_cal_cache_get_component_as_string (ECalCache *cal_cache,
                                         const gchar *uid,
                                         const gchar *rid,
                                         gchar **out_icalstring,
                                         GCancellable *cancellable,
                                         GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
rid | an optional Recurrence-ID. | [nullable]
out_icalstring | return location for an iCalendar string. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_set_component_extra ()

    gboolean
    e_cal_cache_set_component_extra (ECalCache *cal_cache,
                                     const gchar *uid,
                                     const gchar *rid,
                                     const gchar *extra,
                                     GCancellable *cancellable,
                                     GError **error);

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

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
rid | an optional Recurrence-ID. | [nullable]
extra | extra data to set for the component. | [nullable]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_component_extra ()

    gboolean
    e_cal_cache_get_component_extra (ECalCache *cal_cache,
                                     const gchar *uid,
                                     const gchar *rid,
                                     gchar **out_extra,
                                     GCancellable *cancellable,
                                     GError **error);

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

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
rid | an optional Recurrence-ID. | [nullable]
out_extra | return location to store the extra data. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_ids_with_extra ()

    gboolean
    e_cal_cache_get_ids_with_extra (ECalCache *cal_cache,
                                    const gchar *extra,
                                    GSList **out_ids,
                                    GCancellable *cancellable,
                                    GError **error);

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

The `out_ids` should be freed with g_slist_free_full (ids, (GDestroyNotify) e_cal_component_free_id); when no longer needed.

#### Parameters

cal_cache | an ECalCache |
extra | an extra column value to search for |
out_ids | return location to store the ids to. | [out][transfer full][element-type ECalComponentId]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_components_by_uid ()

    gboolean
    e_cal_cache_get_components_by_uid (ECalCache *cal_cache,
                                       const gchar *uid,
                                       GSList **out_components,
                                       GCancellable *cancellable,
                                       GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
out_components | return location for the components. | [out][transfer full][element-type ECalComponent]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_components_by_uid_as_string ()

    gboolean
    e_cal_cache_get_components_by_uid_as_string
                                   (ECalCache *cal_cache,
                                    const gchar *uid,
                                    GSList **out_icalstrings,
                                    GCancellable *cancellable,
                                    GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
uid | a UID of the component |
out_icalstrings | return location for the iCal strings. | [out][transfer full][element-type utf8]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_components_in_range ()

    gboolean
    e_cal_cache_get_components_in_range (ECalCache *cal_cache,
                                         time_t range_start,
                                         time_t range_end,
                                         GSList **out_components,
                                         GCancellable *cancellable,
                                         GError **error);

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

#### Parameters

cal_cache | an ECalCache |
range_start | start of the range, as time_t, inclusive |
range_end | end of the range, as time_t, exclusive |
out_components | return location for the components. | [out][transfer full][element-type ECalComponent]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_components_in_range_as_strings ()

    gboolean
    e_cal_cache_get_components_in_range_as_strings
                                   (ECalCache *cal_cache,
                                    time_t range_start,
                                    time_t range_end,
                                    GSList **out_icalstrings,
                                    GCancellable *cancellable,
                                    GError **error);

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

#### Parameters

cal_cache | an ECalCache |
range_start | start of the range, as time_t, inclusive |
range_end | end of the range, as time_t, exclusive |
out_icalstrings | return location for the iCal strings. | [out][transfer full][element-type utf8]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_search ()

    gboolean
    e_cal_cache_search (ECalCache *cal_cache,
                        const gchar *sexp,
                        GSList **out_data,
                        GCancellable *cancellable,
                        GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
sexp | search expression; use `NULL` or an empty string to list all stored components. | [nullable]
out_data | stored components, as search data, satisfied by `sexp` . | [out][transfer full][element-type ECalCacheSearchData]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_search_components ()

    gboolean
    e_cal_cache_search_components (ECalCache *cal_cache,
                                   const gchar *sexp,
                                   GSList **out_components,
                                   GCancellable *cancellable,
                                   GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
sexp | search expression; use `NULL` or an empty string to list all stored components. | [nullable]
out_components | stored components satisfied by `sexp` . | [out][transfer full][element-type ECalComponent]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_search_ids ()

    gboolean
    e_cal_cache_search_ids (ECalCache *cal_cache,
                            const gchar *sexp,
                            GSList **out_ids,
                            GCancellable *cancellable,
                            GError **error);

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_free_id); when no longer needed.

#### Parameters

cal_cache | an ECalCache |
sexp | search expression; use `NULL` or an empty string to list all stored components. | [nullable]
out_ids | IDs of stored components satisfied by `sexp` . | [out][transfer full][element-type ECalComponentId]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_search_with_callback ()

    gboolean
    e_cal_cache_search_with_callback (ECalCache *cal_cache,
                                      const gchar *sexp,
                                      ECalCacheSearchFunc func,
                                      gpointer user_data,
                                      GCancellable *cancellable,
                                      GError **error);

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

#### Parameters

cal_cache | an ECalCache |
sexp | search expression; use `NULL` or an empty string to list all stored components. | [nullable]
func | an ECalCacheSearchFunc callback to call for each row which satisfies `sexp` |
user_data | user data for `func` |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_offline_changes ()

    GSList *
    e_cal_cache_get_offline_changes (ECalCache *cal_cache,
                                     GCancellable *cancellable,
                                     GError **error);

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

#### Parameters

cal_cache | an ECalCache |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

A newly allocated list of all offline changes. Free it with g_slist_free_full (slist, e_cal_cache_offline_change_free); when no longer needed.

[transfer full][element-type ECalCacheOfflineChange]

Since: 3.26

### e_cal_cache_delete_attachments ()

    gboolean
    e_cal_cache_delete_attachments (ECalCache *cal_cache,
                                    icalcomponent *component,
                                    GCancellable *cancellable,
                                    GError **error);

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

#### Parameters

cal_cache | an ECalCache |
component | an icalcomponent |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_put_timezone ()

    gboolean
    e_cal_cache_put_timezone (ECalCache *cal_cache,
                              const icaltimezone *zone,
                              guint inc_ref_counts,
                              GCancellable *cancellable,
                              GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
zone | an icaltimezone to put |
inc_ref_counts | how many refs to add, or 0 to have it stored forever |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_get_timezone ()

    gboolean
    e_cal_cache_get_timezone (ECalCache *cal_cache,
                              const gchar *tzid,
                              icaltimezone **out_zone,
                              GCancellable *cancellable,
                              GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
tzid | a timezone ID to get |
out_zone | return location for the icaltimezone. | [out][transfer none]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_dup_timezone_as_string ()

    gboolean
    e_cal_cache_dup_timezone_as_string (ECalCache *cal_cache,
                                        const gchar *tzid,
                                        gchar **out_zone_string,
                                        GCancellable *cancellable,
                                        GError **error);

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.

#### Parameters

cal_cache | an ECalCache |
tzid | a timezone ID to get |
out_zone_string | return location for the icaltimezone as iCal string. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_list_timezones ()

    gboolean
    e_cal_cache_list_timezones (ECalCache *cal_cache,
                                GList **out_timezones,
                                GCancellable *cancellable,
                                GError **error);

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

Note: The list can contain timezones previously stored in the cache, but removed from it since they were loaded, because these are freed only when also the `cal_cache` is freed.

#### Parameters

cal_cache | an ECalCache |
out_timezones | return location for the list of stored timezones. | [out][transfer container][element-type icaltimezone]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_remove_timezone ()

    gboolean
    e_cal_cache_remove_timezone (ECalCache *cal_cache,
                                 const gchar *tzid,
                                 guint dec_ref_counts,
                                 GCancellable *cancellable,
                                 GError **error);

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.

It's not an error when the timezone doesn't exist in the cache.

#### Parameters

cal_cache | an ECalCache |
tzid | timezone ID to remove/dereference |
dec_ref_counts | reference counts to drop, 0 to remove it regardless of the current reference count |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.30

### e_cal_cache_remove_timezones ()

    gboolean
    e_cal_cache_remove_timezones (ECalCache *cal_cache,
                                  GCancellable *cancellable,
                                  GError **error);

Removes all stored timezones from the `cal_cache` .

#### Parameters

cal_cache | an ECalCache |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.26

### e_cal_cache_resolve_timezone_cb ()

    icaltimezone *
    e_cal_cache_resolve_timezone_cb (const gchar *tzid,
                                     gpointer cal_cache,
                                     GCancellable *cancellable,
                                     GError **error);

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

#### Parameters

tzid | a timezone ID |
cal_cache | an ECalCache |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

the resolved icaltimezone, or `NULL`, if not found.

[transfer none][nullable]

Since: 3.26

### e_cal_cache_resolve_timezone_simple_cb ()

    icaltimezone *
    e_cal_cache_resolve_timezone_simple_cb
                                   (const gchar *tzid,
                                    gpointer cal_cache);

An ECalRecurResolveTimezoneFn callback, which can be used with `e_cal_recur_ensure_end_dates()` and simialr functions. The `cal_cache` is supposed to be an ECalCache instance. See also `e_cal_cache_resolve_timezone_cb()`.

#### Parameters

tzid | a timezone ID |
cal_cache | an ECalCache |

#### Returns

the resolved icaltimezone, or `NULL`, if not found.

[transfer none][nullable]

Since: 3.26

## Types and Values

### ECalCacheOfflineChange

    typedef struct {
    	gchar *uid;
    	gchar *rid;
    	gchar *revision;
    	gchar *object;
    	EOfflineState state;
    } ECalCacheOfflineChange;

Holds the information about offline change for one component.

#### Members

gchar *`uid`; | UID of the component |
gchar *`rid`; | Recurrence-ID of the component |
gchar *`revision`; | stored revision of the component |
gchar *`object`; | the component itself, as iCalalendar string |
EOfflineState `state`; | an EOfflineState of the component |

Since: 3.26

### ECalCacheSearchData

    typedef struct {
    	gchar *uid;
    	gchar *rid;
    	gchar *object;
    	gchar *extra;
    } ECalCacheSearchData;

This structure is used to represent components returned by the ECalCache from various functions such as `e_cal_cache_search()`.

The `extra` parameter will contain any data which was previously passed for this component in `e_cal_cache_add_component()` or set with `e_cal_cache_set_component_extra()`.

These should be freed with `e_cal_cache_search_data_free()`.

#### Members

gchar *`uid`; | the UID of this component |
gchar *`rid`; | the Recurrence-ID of this component. | [nullable]
gchar *`object`; | the component string |
gchar *`extra`; | any extra data associated with the component |

Since: 3.26

### struct ECalCache

    struct ECalCache {
    };

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

Since: 3.26

### struct ECalCacheClass

    struct ECalCacheClass {
    };

Class structure for the ECalCache class.

Since: 3.26