## KolabMailSideCache KolabMailSideCache — read/write offline cache for PIM folders and PIM emails |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    struct              KolabMailSideCacheClass;
    gboolean            kolab_mail_side_cache_bringup       (KolabMailSideCache *self,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_configure     (KolabMailSideCache *self,
                                                             KolabSettingsHandler *ksettings,
                                                             KolabMailMimeBuilder *mimebuilder,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_delete        (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_delete_by_uid (KolabMailSideCache *self,
                                                             const gchar *uid,
                                                             const gchar *foldername,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_delete_folder (KolabMailSideCache *self,
                                                             const gchar *foldername,
                                                             GError **err);
    GList *             kolab_mail_side_cache_query_foldernames
                                                            (KolabMailSideCache *self,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_retrieve      (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_shutdown      (KolabMailSideCache *self,
                                                             GError **err);
    gboolean            kolab_mail_side_cache_store         (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             const gchar *foldername,
                                                             GError **err);

## Description

This class holds functionality to temporarily cache PIM emails (message parts) and not-yet-existing IMAP folders which will be generated by book/cal when new entries are created while in KolabMailAccess offline mode. It is essential that those mails be cached separate from the KolabMailImapClient offline cache for sync reasons (they must not be deleted from or directly uploaded to the Kolab server upon IMAP reconnect, since we need to be able to intercept PIM data collisions (sync conflicts)).

The initial implementation of this class works without user interaction.

This means that for resolving true sync conflicts, a user prefs file must be honoured. This shall be a GLib key file, and the options shall be "newer", "server", "local" (or something similar), to denote that in case of an object being changed on both, local and server side, the newer object, that of the server or the local copy, respectively, should survive the conflict resolution. It should be possible, however, to read this preference from Evolution settings later on, and to even add an "ask" option so the user can resolve the conflict manually. A KolabSettingsHandler instance is used for that matter.

## Details

### struct KolabMailSideCacheClass

    struct KolabMailSideCacheClass {
    	GObjectClass parent_class;
    };

### kolab_mail_side_cache_bringup ()

    gboolean            kolab_mail_side_cache_bringup       (KolabMailSideCache *self,
                                                             GError **err);

### kolab_mail_side_cache_configure ()

    gboolean            kolab_mail_side_cache_configure     (KolabMailSideCache *self,
                                                             KolabSettingsHandler *ksettings,
                                                             KolabMailMimeBuilder *mimebuilder,
                                                             GError **err);

### kolab_mail_side_cache_delete ()

    gboolean            kolab_mail_side_cache_delete        (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             GError **err);

### kolab_mail_side_cache_delete_by_uid ()

    gboolean            kolab_mail_side_cache_delete_by_uid (KolabMailSideCache *self,
                                                             const gchar *uid,
                                                             const gchar *foldername,
                                                             GError **err);

### kolab_mail_side_cache_delete_folder ()

    gboolean            kolab_mail_side_cache_delete_folder (KolabMailSideCache *self,
                                                             const gchar *foldername,
                                                             GError **err);

### kolab_mail_side_cache_query_foldernames ()

    GList *             kolab_mail_side_cache_query_foldernames
                                                            (KolabMailSideCache *self,
                                                             GError **err);

### kolab_mail_side_cache_retrieve ()

    gboolean            kolab_mail_side_cache_retrieve      (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             GError **err);

### kolab_mail_side_cache_shutdown ()

    gboolean            kolab_mail_side_cache_shutdown      (KolabMailSideCache *self,
                                                             GError **err);

### kolab_mail_side_cache_store ()

    gboolean            kolab_mail_side_cache_store         (KolabMailSideCache *self,
                                                             KolabMailHandle *kmailhandle,
                                                             const gchar *foldername,
                                                             GError **err);

## See Also

KolabMailAccess, KolabMailSynchronizer, KolabSettingsHandler