## KolabUtilCalendarCache KolabUtilCalendarCache — Utility methods for Evolution-Kolab calendar backend implementation with ECalBackendCache side effects. |

## Synopsis

    struct              KolabUtilCalendarCacheClass;
    gboolean            kolab_util_calendar_cache_assure_uid_on_ecalcomponent
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             ECalComponent *ecalcomp,
                                                             const gchar *uri,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);
    ECalComponent *     kolab_util_calendar_cache_get_object
                                                            (ECalBackendCache *cal_cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *uri,
                                                             const gchar *uid,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);
    ECalComponent *     kolab_util_calendar_cache_get_tz    (ECalBackendCache *cache,
                                                             ECalComponent *comp);
    ECalComponent *     kolab_util_calendar_cache_get_tz_by_id
                                                            (ECalBackendCache *cache,
                                                             const gchar *tzid);
    ECalComponent *     kolab_util_calendar_cache_remove_instance
                                                            (ECalBackendCache *cal_cache,
                                                             CalObjModType mod,
                                                             ECalComponent *ecalcomp,
                                                             const gchar *uid,
                                                             const gchar *rid);
    gboolean            kolab_util_calendar_cache_update_object
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *uri,
                                                             const gchar *uid,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);
    gboolean            kolab_util_calendar_cache_update_on_query
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *query,
                                                             const gchar *uri,
                                                             GCancellable *cancellable,
                                                             GError **error);

## Description

The methods in KolabUtilCalendarCache are supposed to update the ECalBackendCache as a side effect to their primary task or retrieve data from the cache to fulfill its task.

## Details

### struct KolabUtilCalendarCacheClass

    struct KolabUtilCalendarCacheClass {
    	GObjectClass parent_class;
    };

### kolab_util_calendar_cache_assure_uid_on_ecalcomponent ()

    gboolean            kolab_util_calendar_cache_assure_uid_on_ecalcomponent
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             ECalComponent *ecalcomp,
                                                             const gchar *uri,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);

Sets a new uid to ecalcomp and assures, that it is not used in `koma`, so far.

`cache` : | An ECalBackendCache.
`koma` : | A KolabMailAccess instance.
`uri` : | An ECalComponent uri string.
`ecalcomp` : | An ECalComponent.
`bulk` : | Whether or not this is a mass operation.
`cancellable` : | A cancellation stack.
`error` : | A GError placeholder.
Returns : | On Success TRUE is returned.

### kolab_util_calendar_cache_get_object ()

    ECalComponent *     kolab_util_calendar_cache_get_object
                                                            (ECalBackendCache *cal_cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *uri,
                                                             const gchar *uid,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);

Retrieves the the object referenced by `uid` from the given `cal_cache`. If none is found, NULL is returned.

`cal_cache` : | A Cache.
`koma` : | A KolabMailAccess object.
`uri` : | An ECalComponent uri string.
`uid` : | The uid to search for.
`bulk` : | Whether or not this is a mass operation.
`cancellable` : | A cancellation stack.
`error` : | GError placeholder.
Returns : | A new ECalComponent containing the object. Unref if no longer needed.

### kolab_util_calendar_cache_get_tz ()

    ECalComponent *     kolab_util_calendar_cache_get_tz    (ECalBackendCache *cache,
                                                             ECalComponent *comp);

`cache` : | A Cache.
`comp` : | An ECalComponent (Some calendar entry). . The tzid of the ECalComponent DTSTART property is used to extract timezone information from the supplied backend cache. The ECalComponent returned should be freed, using `g_object_unref()`, once no longer needed. Note: Events may not provide a timezone/TZID (like UTC)!
Returns : | An ECalComponent containing a timezone or NULL if none is found..

### kolab_util_calendar_cache_get_tz_by_id ()

    ECalComponent *     kolab_util_calendar_cache_get_tz_by_id
                                                            (ECalBackendCache *cache,
                                                             const gchar *tzid);

### kolab_util_calendar_cache_remove_instance ()

    ECalComponent *     kolab_util_calendar_cache_remove_instance
                                                            (ECalBackendCache *cal_cache,
                                                             CalObjModType mod,
                                                             ECalComponent *ecalcomp,
                                                             const gchar *uid,
                                                             const gchar *rid);

Removes an instance of an event with recurrence.

`cal_cache` : | An ECalBackendCache.
`mod` : | CalObjModType to apply to the remove request.
`oldcomp` : | The object before the removal took place.
`uid` : | The UID of the recurring event.
`rid` : | The recurrence ID of the recurrence.
Returns : | The modified component.

### kolab_util_calendar_cache_update_object ()

    gboolean            kolab_util_calendar_cache_update_object
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *uri,
                                                             const gchar *uid,
                                                             gboolean bulk,
                                                             GCancellable *cancellable,
                                                             GError **error);

### kolab_util_calendar_cache_update_on_query ()

    gboolean            kolab_util_calendar_cache_update_on_query
                                                            (ECalBackendCache *cache,
                                                             KolabMailAccess *koma,
                                                             const gchar *query,
                                                             const gchar *uri,
                                                             GCancellable *cancellable,
                                                             GError **error);