ECalBackendSync: Evolution-Data-Server Reference Manual

## ECalBackendSync ECalBackendSync — A convenience subclass of ECalBackend |

## Functions

void | e_cal_backend_sync_open ()
void | e_cal_backend_sync_refresh ()
void | e_cal_backend_sync_get_object ()
void | e_cal_backend_sync_get_object_list ()
void | e_cal_backend_sync_get_free_busy ()
void | e_cal_backend_sync_create_objects ()
void | e_cal_backend_sync_modify_objects ()
void | e_cal_backend_sync_remove_objects ()
void | e_cal_backend_sync_receive_objects ()
void | e_cal_backend_sync_send_objects ()
void | e_cal_backend_sync_get_attachment_uris ()
void | e_cal_backend_sync_discard_alarm ()
void | e_cal_backend_sync_get_timezone ()
void | e_cal_backend_sync_add_timezone ()

## Types and Values

struct | ECalBackendSync
struct | ECalBackendSyncClass

## Object Hierarchy

        GObject
        ╰── EBackend
            ╰── ECalBackend
                ╰── ECalBackendSync
                    ╰── ECalMetaBackend

## Implemented Interfaces

ECalBackendSync implements ETimezoneCache.

## Includes

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

## Description

This class can be subclassed in place of the ECalBackend abstract backend for easier implementation of calendar backends.

## Functions

### e_cal_backend_sync_open ()

    void
    e_cal_backend_sync_open (ECalBackendSync *backend,
                             EDataCal *cal,
                             GCancellable *cancellable,
                             GError **error);

Calls the open_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation or just create it when it does not exist. |
error | Out parameter for a GError. |

### e_cal_backend_sync_refresh ()

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

Calls the refresh_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
error | Out parameter for a GError. |

Since: 2.30

### e_cal_backend_sync_get_object ()

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

Calls the get_object_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
uid | UID of the object to get. |
rid | Recurrence ID of the specific instance to get, or `NULL` if getting the master object. | [nullable]
calobj | Placeholder for returned object. | [out][transfer full]
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,
                                        GCancellable *cancellable,
                                        const gchar *sexp,
                                        GSList **calobjs,
                                        GError **error);

Calls the get_object_list_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
sexp | Search query. |
calobjs | Placeholder for list of returned objects. | [out][transfer full][element-type utf8]
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,
                                      GCancellable *cancellable,
                                      const GSList *users,
                                      time_t start,
                                      time_t end,
                                      GSList **freebusyobjects,
                                      GError **error);

Calls the get_free_busy_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
users | List of users to get F/B info from. | [element-type utf8]
start | Time range start. |
end | Time range end. |
freebusyobjects | Placeholder for F/B information. | [out][transfer full][element-type utf8]
error | Out parameter for a GError. |

### e_cal_backend_sync_create_objects ()

    void
    e_cal_backend_sync_create_objects (ECalBackendSync *backend,
                                       EDataCal *cal,
                                       GCancellable *cancellable,
                                       const GSList *calobjs,
                                       ECalOperationFlags opflags,
                                       GSList **uids,
                                       GSList **new_components,
                                       GError **error);

Calls the create_objects_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
calobjs | The objects to be added. | [element-type utf8]
opflags | bit-or of ECalOperationFlags |
uids | Placeholder for server-generated UIDs. | [out][transfer full][element-type utf8]
new_components | Placeholder for returned ECalComponent objects. | [out][transfer full][element-type ECalComponent]
error | Out parameter for a GError. |

Since: 3.6

### e_cal_backend_sync_modify_objects ()

    void
    e_cal_backend_sync_modify_objects (ECalBackendSync *backend,
                                       EDataCal *cal,
                                       GCancellable *cancellable,
                                       const GSList *calobjs,
                                       ECalObjModType mod,
                                       ECalOperationFlags opflags,
                                       GSList **old_components,
                                       GSList **new_components,
                                       GError **error);

Calls the modify_objects_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
calobjs | Objects to be modified. | [element-type utf8]
mod | Type of modification to be done. |
opflags | bit-or of ECalOperationFlags |
old_components | Placeholder for returning the old components as they were stored on the backend. | [out][transfer full][element-type ECalComponent]
new_components | Placeholder for returning the new components as they have been stored on the backend. | [out][transfer full][element-type ECalComponent]
error | Out parameter for a GError. |

Since: 3.6

### e_cal_backend_sync_remove_objects ()

    void
    e_cal_backend_sync_remove_objects (ECalBackendSync *backend,
                                       EDataCal *cal,
                                       GCancellable *cancellable,
                                       const GSList *ids,
                                       ECalObjModType mod,
                                       ECalOperationFlags opflags,
                                       GSList **old_components,
                                       GSList **new_components,
                                       GError **error);

Calls the remove_objects_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
ids | List of ECalComponentId objects identifying the objects to remove. | [element-type ECalComponentId]
mod | Type of removal. |
opflags | bit-or of ECalOperationFlags |
old_components | Placeholder for returning the old components as they were stored on the backend. | [out][transfer full][element-type ECalComponent]
new_components | Placeholder for returning the new components as they have been stored on the backend (when removing individual instances). If removing whole objects, they will be set to `NULL`. | [out][transfer full][element-type ECalComponent]
error | Out parameter for a GError. |

Since: 3.6

### e_cal_backend_sync_receive_objects ()

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

Calls the receive_objects_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
opflags | bit-or of ECalOperationFlags |
cancellable | a GCancellable for the operation |
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,
                                     GCancellable *cancellable,
                                     const gchar *calobj,
                                     ECalOperationFlags opflags,
                                     GSList **users,
                                     gchar **modified_calobj,
                                     GError **error);

Calls the send_objects_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
calobj | The iCalendar object to send. |
opflags | bit-or of ECalOperationFlags |
users | List of users to send notifications to. | [element-type utf8]
modified_calobj | Placeholder for the iCalendar object after being modified. | [out][transfer full]
error | Out parameter for a GError. |

### e_cal_backend_sync_get_attachment_uris ()

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

Calls the get_attachment_uris_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
uid | Unique id of the calendar object. |
rid | Recurrence id of the calendar object. |
attachments | Placeholder for list of returned attachment uris. | [element-type utf8]
error | Out parameter for a GError. |

Since: 3.2

### e_cal_backend_sync_discard_alarm ()

    void
    e_cal_backend_sync_discard_alarm (ECalBackendSync *backend,
                                      EDataCal *cal,
                                      GCancellable *cancellable,
                                      const gchar *uid,
                                      const gchar *rid,
                                      const gchar *auid,
                                      ECalOperationFlags opflags,
                                      GError **error);

Calls the discard_alarm_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
uid | Unique id of the calendar object. |
rid | Recurrence id of the calendar object. |
auid | Alarm ID to remove. |
opflags | bit-or of ECalOperationFlags |
error | Out parameter for a GError. |

### e_cal_backend_sync_get_timezone ()

    void
    e_cal_backend_sync_get_timezone (ECalBackendSync *backend,
                                     EDataCal *cal,
                                     GCancellable *cancellable,
                                     const gchar *tzid,
                                     gchar **tzobject,
                                     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.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
tzid | ID of the timezone to retrieve. |
tzobject | 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,
                                     GCancellable *cancellable,
                                     const gchar *tzobject,
                                     GError **error);

Calls the add_timezone_sync method on the given backend.

#### Parameters

backend | An ECalBackendSync object. |
cal | An EDataCal object. |
cancellable | a GCancellable for the operation |
tzobject | VTIMEZONE object to be added. |
error | Out parameter for a GError. |

## Types and Values

### struct ECalBackendSync

    struct ECalBackendSync;

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

### struct ECalBackendSyncClass

    struct ECalBackendSyncClass {
    	/* Virtual methods */
    	void		(*open_sync)		(ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 GError **error);
    	void		(*refresh_sync)		(ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 GError **error);

    	void		(*get_object_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *uid,
    						 const gchar *rid,
    						 gchar **calobj,
    						 GError **error);
    	void		(*get_object_list_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *sexp,
    						 GSList **calobjs,
    						 GError **error);
    	void		(*get_free_busy_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const GSList *users,
    						 time_t start,
    						 time_t end,
    						 GSList **freebusyobjs,
    						 GError **error);
    	void		(*create_objects_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const GSList *calobjs,
    						 ECalOperationFlags opflags,
    						 GSList **uids,
    						 GSList **new_components,
    						 GError **error);
    	void		(*modify_objects_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const GSList *calobjs,
    						 ECalObjModType mod,
    						 ECalOperationFlags opflags,
    						 GSList **old_components,
    						 GSList **new_components,
    						 GError **error);
    	void		(*remove_objects_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const GSList *ids,
    						 ECalObjModType mod,
    						 ECalOperationFlags opflags,
    						 GSList **old_components,
    						 GSList **new_components,
    						 GError **error);
    	void		(*receive_objects_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *calobj,
    						 ECalOperationFlags opflags,
    						 GError **error);
    	void		(*send_objects_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *calobj,
    						 ECalOperationFlags opflags,
    						 GSList **users,
    						 gchar **modified_calobj,
    						 GError **error);
    	void		(*get_attachment_uris_sync)
    						(ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *uid,
    						 const gchar *rid,
    						 GSList **attachments,
    						 GError **error);
    	void		(*discard_alarm_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *uid,
    						 const gchar *rid,
    						 const gchar *auid,
    						 ECalOperationFlags opflags,
    						 GError **error);
    	void		(*get_timezone_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *tzid,
    						 gchar **tzobject,
    						 GError **error);
    	void		(*add_timezone_sync) (ECalBackendSync *backend,
    						 EDataCal *cal,
    						 GCancellable *cancellable,
    						 const gchar *tzobject,
    						 GError **error);

    	/* Padding for future expansion */
    	gpointer reserved_padding[20];
    };

Base class structure for the ECalBackendSync class

#### Members

`open_sync` () | Open the calendar |
`refresh_sync` () | Refresh the calendar |
`get_object_sync` () | Get single object |
`get_object_list_sync` () | Get multiple objects at once |
`get_free_busy_sync` () | Get Free/Busy objects |
`create_objects_sync` () | Create objects |
`modify_objects_sync` () | Modify objects |
`remove_objects_sync` () | Remove objects |
`receive_objects_sync` () | Receive objects |
`send_objects_sync` () | Send objects |
`get_attachment_uris_sync` () | Get attachments uris for given object |
`discard_alarm_sync` () | Discard alarm |
`get_timezone_sync` () | Get specified timezone |
`add_timezone_sync` () | Add specified timezone |
gpointer `reserved_padding`[20]; |  |

Since: 3.4