## ECalBackendSync

ECalBackendSync — Base class for synchronous backends.

## Synopsis

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

## Description

## Details

### ECalBackendSyncPrivate

    typedef struct _ECalBackendSyncPrivate ECalBackendSyncPrivate;

### ECalBackendSyncStatus

    typedef GNOME_Evolution_Calendar_CallStatus ECalBackendSyncStatus;

### 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 ()

    ECalBackendSyncStatus e_cal_backend_sync_is_read_only
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 gboolean *read_only);

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.
Returns : | Status code.

### e_cal_backend_sync_get_cal_address ()

    ECalBackendSyncStatus e_cal_backend_sync_get_cal_address
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **address);

Calls the get_cal_address method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`address` : | Return value for the address.
Returns : | Status code.

### e_cal_backend_sync_get_alarm_email_address ()

    ECalBackendSyncStatus e_cal_backend_sync_get_alarm_email_address
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **address);

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.
Returns : | Status code.

### e_cal_backend_sync_get_ldap_attribute ()

    ECalBackendSyncStatus e_cal_backend_sync_get_ldap_attribute
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **attribute);

Calls the get_ldap_attribute method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`attribute` : | Return value for LDAP attribute.
Returns : | Status code.

### e_cal_backend_sync_get_static_capabilities ()

    ECalBackendSyncStatus e_cal_backend_sync_get_static_capabilities
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **capabiliites);

Calls the get_capabilities method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`capabiliites` : |
Returns : | Status code.

### e_cal_backend_sync_open ()

    ECalBackendSyncStatus e_cal_backend_sync_open
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 gboolean only_if_exists,
                                                 const char *username,
                                                 const char *password);

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.
Returns : | Status code.

### e_cal_backend_sync_remove ()

    ECalBackendSyncStatus e_cal_backend_sync_remove
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal);

Calls the remove method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
Returns : | Status code.

### e_cal_backend_sync_create_object ()

    ECalBackendSyncStatus e_cal_backend_sync_create_object
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **calobj,
                                                 char **uid);

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.
Returns : | Status code.

### e_cal_backend_sync_modify_object ()

    ECalBackendSyncStatus e_cal_backend_sync_modify_object
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *calobj,
                                                 CalObjModType mod,
                                                 char **old_object,
                                                 char **new_object);

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.
Returns : | Status code.

### e_cal_backend_sync_remove_object ()

    ECalBackendSyncStatus e_cal_backend_sync_remove_object
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *uid,
                                                 const char *rid,
                                                 CalObjModType mod,
                                                 char **old_object,
                                                 char **object);

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.
Returns : | Status code.

### e_cal_backend_sync_discard_alarm ()

    ECalBackendSyncStatus e_cal_backend_sync_discard_alarm
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *uid,
                                                 const char *auid);

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.
Returns : | Status code.

### e_cal_backend_sync_receive_objects ()

    ECalBackendSyncStatus e_cal_backend_sync_receive_objects
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *calobj);

Calls the receive_objects method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`calobj` : | iCalendar object to receive.
Returns : | Status code.

### e_cal_backend_sync_send_objects ()

    ECalBackendSyncStatus e_cal_backend_sync_send_objects
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *calobj,
                                                 GList **users,
                                                 char **modified_calobj);

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.
Returns : | Status code.

### e_cal_backend_sync_get_default_object ()

    ECalBackendSyncStatus e_cal_backend_sync_get_default_object
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 char **object);

Calls the get_default_object method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`object` : | Placeholder for returned object.
Returns : | Status code.

### e_cal_backend_sync_get_object ()

    ECalBackendSyncStatus e_cal_backend_sync_get_object
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *uid,
                                                 const char *rid,
                                                 char **object);

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.
Returns : | Status code.

### e_cal_backend_sync_get_object_list ()

    ECalBackendSyncStatus e_cal_backend_sync_get_object_list
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *sexp,
                                                 GList **objects);

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.
Returns : | Status code.

### e_cal_backend_sync_get_timezone ()

    ECalBackendSyncStatus e_cal_backend_sync_get_timezone
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *tzid,
                                                 char **object);

Calls the get_timezone method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`tzid` : | ID of the timezone to retrieve.
`object` : | Placeholder for the returned timezone.
Returns : | Status code.

### e_cal_backend_sync_add_timezone ()

    ECalBackendSyncStatus e_cal_backend_sync_add_timezone
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *tzobj);

Calls the add_timezone method on the given backend.

`backend` : | An ECalBackendSync object.
`cal` : | An EDataCal object.
`tzobj` : | VTIMEZONE object to be added.
Returns : | Status code.

### e_cal_backend_sync_set_default_timezone ()

    ECalBackendSyncStatus e_cal_backend_sync_set_default_timezone
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *tzid);

`backend` : |
`cal` : |
`tzid` : |
Returns : |

### e_cal_backend_sync_get_changes ()

    ECalBackendSyncStatus e_cal_backend_sync_get_changes
                                                (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 const char *change_id,
                                                 GList **adds,
                                                 GList **modifies,
                                                 GList **deletes);

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.
Returns : | Status code.

### e_cal_backend_sync_get_free_busy ()

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

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.
Returns : | Status code.