## ECalBackendSync ECalBackendSync — Base class for synchronous backends. |

## Synopsis

                        ECalBackendSync;
    ECalBackendSync *   (*ECalBackendSyncFactoryFn)         (void);
    void                e_cal_backend_sync_set_lock         (ECalBackendSync *backend,
                                                             gboolean lock);
    void                e_cal_backend_sync_is_read_only     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gboolean *read_only,
                                                             GError **error);
    void                e_cal_backend_sync_get_cal_address  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **address,
                                                             GError **error);
    void                e_cal_backend_sync_get_alarm_email_address
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **address,
                                                             GError **error);
    void                e_cal_backend_sync_get_ldap_attribute
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **attribute,
                                                             GError **error);
    void                e_cal_backend_sync_get_static_capabilities
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **capabiliites,
                                                             GError **error);
    void                e_cal_backend_sync_open             (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gboolean only_if_exists,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             GError **error);
    void                e_cal_backend_sync_refresh          (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GError **error);
    void                e_cal_backend_sync_remove           (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GError **error);
    void                e_cal_backend_sync_create_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **calobj,
                                                             gchar **uid,
                                                             GError **error);
    void                e_cal_backend_sync_modify_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             CalObjModType mod,
                                                             gchar **old_object,
                                                             gchar **new_object,
                                                             GError **error);
    void                e_cal_backend_sync_remove_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             CalObjModType mod,
                                                             gchar **old_object,
                                                             gchar **object,
                                                             GError **error);
    void                e_cal_backend_sync_get_attachment_list
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             GSList **attachments,
                                                             GError **error);
    void                e_cal_backend_sync_discard_alarm    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *auid,
                                                             GError **error);
    void                e_cal_backend_sync_receive_objects  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             GError **error);
    void                e_cal_backend_sync_send_objects     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             GList **users,
                                                             gchar **modified_calobj,
                                                             GError **error);
    void                e_cal_backend_sync_get_default_object
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **object,
                                                             GError **error);
    void                e_cal_backend_sync_get_object       (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             gchar **object,
                                                             GError **error);
    void                e_cal_backend_sync_get_object_list  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *sexp,
                                                             GList **objects,
                                                             GError **error);
    void                e_cal_backend_sync_get_timezone     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzid,
                                                             gchar **object,
                                                             GError **error);
    void                e_cal_backend_sync_add_timezone     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzobj,
                                                             GError **error);
    void                e_cal_backend_sync_set_default_zone (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzobj,
                                                             GError **error);
    void                e_cal_backend_sync_get_changes      (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *change_id,
                                                             GList **adds,
                                                             GList **modifies,
                                                             GList **deletes,
                                                             GError **error);
    void                e_cal_backend_sync_get_free_busy    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GList *users,
                                                             time_t start,
                                                             time_t end,
                                                             GList **freebusy,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----ECalBackend
             +----ECalBackendSync

## Description

## Details

### ECalBackendSync

    typedef struct _ECalBackendSync ECalBackendSync;

### ECalBackendSyncFactoryFn ()

    ECalBackendSync *   (*ECalBackendSyncFactoryFn)         (void);

Returns : |

### e_cal_backend_sync_set_lock ()

    void                e_cal_backend_sync_set_lock         (ECalBackendSync *backend,
                                                             gboolean lock);

Sets the lock mode on the ECalBackendSync object. If TRUE, the backend will create a locking mutex for every operation, so that only one can happen at a time. If FALSE, no lock would be done and many operations can happen at the same time.

`backend` : | An ECalBackendSync object.
`lock` : | Lock mode.

### e_cal_backend_sync_is_read_only ()

    void                e_cal_backend_sync_is_read_only     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gboolean *read_only,
                                                             GError **error);

Calls the is_read_only method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`read_only` : | Return value for read-only status.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_cal_address ()

    void                e_cal_backend_sync_get_cal_address  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **address,
                                                             GError **error);

Calls the get_cal_address method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`address` : | Return value for the address.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_alarm_email_address ()

    void                e_cal_backend_sync_get_alarm_email_address
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **address,
                                                             GError **error);

Calls the get_alarm_email_address method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`address` : | Return value for the address.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_ldap_attribute ()

    void                e_cal_backend_sync_get_ldap_attribute
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **attribute,
                                                             GError **error);

Calls the get_ldap_attribute method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`attribute` : | Return value for LDAP attribute.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_static_capabilities ()

    void                e_cal_backend_sync_get_static_capabilities
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **capabiliites,
                                                             GError **error);

Calls the get_capabilities method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`capabiliites` : |
`error` : | Out parameter for a GError.

### e_cal_backend_sync_open ()

    void                e_cal_backend_sync_open             (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gboolean only_if_exists,
                                                             const gchar *username,
                                                             const gchar *password,
                                                             GError **error);

Calls the open method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`only_if_exists` : | Whether to open the calendar if and only if it already exists or just create it when it does not exist.
`username` : | User name to use for authentication.
`password` : | Password to use for authentication.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_refresh ()

    void                e_cal_backend_sync_refresh          (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GError **error);

Calls the refresh method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`error` : | Out parameter for a GError.

Since 2.30

### e_cal_backend_sync_remove ()

    void                e_cal_backend_sync_remove           (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GError **error);

Calls the remove method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_create_object ()

    void                e_cal_backend_sync_create_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **calobj,
                                                             gchar **uid,
                                                             GError **error);

Calls the create_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`calobj` : | The object to be added.
`uid` : | Placeholder for server-generated UID.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_modify_object ()

    void                e_cal_backend_sync_modify_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             CalObjModType mod,
                                                             gchar **old_object,
                                                             gchar **new_object,
                                                             GError **error);

Calls the modify_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`calobj` : | Object to be modified.
`mod` : | Type of modification to be done.
`old_object` : | Placeholder for returning the old object as it was stored on the backend.
`new_object` : | Placeholder for returning the new object as it has been stored on the backend.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_remove_object ()

    void                e_cal_backend_sync_remove_object    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             CalObjModType mod,
                                                             gchar **old_object,
                                                             gchar **object,
                                                             GError **error);

Calls the remove_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`uid` : | UID of the object to remove.
`rid` : | Recurrence ID of the instance to remove, or NULL if removing the whole object.
`mod` : | Type of removal.
`old_object` : | Placeholder for returning the old object as it was stored on the backend.
`object` : | Placeholder for returning the object after it has been modified (when removing individual instances). If removing the whole object, this will be NULL.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_attachment_list ()

    void                e_cal_backend_sync_get_attachment_list
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             GSList **attachments,
                                                             GError **error);

Calls the get_attachment_list method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`uid` : | Unique id of the calendar object.
`rid` : | Recurrence id of the calendar object.
`attachments` : | Placeholder for list of returned attachment uris.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_discard_alarm ()

    void                e_cal_backend_sync_discard_alarm    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *auid,
                                                             GError **error);

Calls the discard_alarm method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`uid` : | UID of the object to discard the alarm from.
`auid` : | UID of the alarm to be discarded.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_receive_objects ()

    void                e_cal_backend_sync_receive_objects  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             GError **error);

Calls the receive_objects method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`calobj` : | iCalendar object to receive.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_send_objects ()

    void                e_cal_backend_sync_send_objects     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *calobj,
                                                             GList **users,
                                                             gchar **modified_calobj,
                                                             GError **error);

Calls the send_objects method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`calobj` : | The iCalendar object to send.
`users` : | List of users to send notifications to.
`modified_calobj` : | Placeholder for the iCalendar object after being modified.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_default_object ()

    void                e_cal_backend_sync_get_default_object
                                                            (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             gchar **object,
                                                             GError **error);

Calls the get_default_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`object` : | Placeholder for returned object.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_object ()

    void                e_cal_backend_sync_get_object       (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             gchar **object,
                                                             GError **error);

Calls the get_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`uid` : | UID of the object to get.
`rid` : | Recurrence ID of the specific instance to get, or NULL if getting the master object.
`object` : | Placeholder for returned object.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_object_list ()

    void                e_cal_backend_sync_get_object_list  (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *sexp,
                                                             GList **objects,
                                                             GError **error);

Calls the get_object_list method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`sexp` : | Search query.
`objects` : | Placeholder for list of returned objects.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_timezone ()

    void                e_cal_backend_sync_get_timezone     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzid,
                                                             gchar **object,
                                                             GError **error);

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.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`tzid` : | ID of the timezone to retrieve.
`object` : | Placeholder for the returned timezone.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_add_timezone ()

    void                e_cal_backend_sync_add_timezone     (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzobj,
                                                             GError **error);

Calls the add_timezone method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`tzobj` : | VTIMEZONE object to be added.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_set_default_zone ()

    void                e_cal_backend_sync_set_default_zone (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *tzobj,
                                                             GError **error);

Calls the set_default_zone method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`tzobj` : |
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_changes ()

    void                e_cal_backend_sync_get_changes      (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             const gchar *change_id,
                                                             GList **adds,
                                                             GList **modifies,
                                                             GList **deletes,
                                                             GError **error);

Calls the get_changes method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`change_id` : | ID of the change to use as base.
`adds` : | Placeholder for list of additions.
`modifies` : | Placeholder for list of modifications.
`deletes` : | Placeholder for list of deletions.
`error` : | Out parameter for a GError.

### e_cal_backend_sync_get_free_busy ()

    void                e_cal_backend_sync_get_free_busy    (ECalBackendSync *backend,
                                                             EDataCal *cal,
                                                             GList *users,
                                                             time_t start,
                                                             time_t end,
                                                             GList **freebusy,
                                                             GError **error);

Calls the get_free_busy method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`users` : | List of users to get F/B info from.
`start` : | Time range start.
`end` : | Time range end.
`freebusy` : | Placeholder for F/B information.
`error` : | Out parameter for a GError.