## ECal

ECal — Permits access to a calendar or list of tasks.

## Synopsis

    struct              ECal;
    enum                ECalSourceType;
    enum                ECalSetModeStatus;
    enum                ECalLoadState;
    enum                EDataCalMode;
    gchar *             (*ECalAuthFunc)                     (ECal *ecal,
                                                             const gchar *prompt,
                                                             const gchar *key,
                                                             gpointer user_data);
    ECal *              e_cal_new                           (ESource *source,
                                                             ECalSourceType type);
    ECal *              e_cal_new_from_uri                  (const gchar *uri,
                                                             ECalSourceType type);
    ECal *              e_cal_new_system_calendar           (void);
    ECal *              e_cal_new_system_tasks              (void);
    ECal *              e_cal_new_system_memos              (void);
    void                e_cal_set_auth_func                 (ECal *ecal,
                                                             ECalAuthFunc func,
                                                             gpointer data);
    gboolean            e_cal_open                          (ECal *ecal,
                                                             gboolean only_if_exists,
                                                             GError **error);
    void                e_cal_open_async                    (ECal *ecal,
                                                             gboolean only_if_exists);
    gboolean            e_cal_refresh                       (ECal *ecal,
                                                             GError **error);
    gboolean            e_cal_remove                        (ECal *ecal,
                                                             GError **error);
    GList *             e_cal_uri_list                      (ECal *ecal,
                                                             CalMode mode);
    ECalSourceType      e_cal_get_source_type               (ECal *ecal);
    ECalLoadState       e_cal_get_load_state                (ECal *ecal);
    ESource *           e_cal_get_source                    (ECal *ecal);
    const gchar *       e_cal_get_uri                       (ECal *ecal);
    gboolean            e_cal_is_read_only                  (ECal *ecal,
                                                             gboolean *read_only,
                                                             GError **error);
    gboolean            e_cal_get_cal_address               (ECal *ecal,
                                                             gchar **cal_address,
                                                             GError **error);
    gboolean            e_cal_get_alarm_email_address       (ECal *ecal,
                                                             gchar **alarm_address,
                                                             GError **error);
    gboolean            e_cal_get_ldap_attribute            (ECal *ecal,
                                                             gchar **ldap_attribute,
                                                             GError **error);
    gboolean            e_cal_get_one_alarm_only            (ECal *ecal);
    gboolean            e_cal_get_organizer_must_attend     (ECal *ecal);
    gboolean            e_cal_get_save_schedules            (ECal *ecal);
    gboolean            e_cal_get_static_capability         (ECal *ecal,
                                                             const gchar *cap);
    gboolean            e_cal_get_organizer_must_accept     (ECal *ecal);
    gboolean            e_cal_get_refresh_supported         (ECal *ecal);
    gboolean            e_cal_set_mode                      (ECal *ecal,
                                                             CalMode mode);
    gboolean            e_cal_get_default_object            (ECal *ecal,
                                                             icalcomponent **icalcomp,
                                                             GError **error);
    gboolean            e_cal_get_object                    (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             icalcomponent **icalcomp,
                                                             GError **error);
    gboolean            e_cal_get_objects_for_uid           (ECal *ecal,
                                                             const gchar *uid,
                                                             GList **objects,
                                                             GError **error);
    gboolean            e_cal_get_changes                   (ECal *ecal,
                                                             const gchar *change_id,
                                                             GList **changes,
                                                             GError **error);
    void                e_cal_free_change_list              (GList *list);
    gboolean            e_cal_get_object_list               (ECal *ecal,
                                                             const gchar *query,
                                                             GList **objects,
                                                             GError **error);
    gboolean            e_cal_get_object_list_as_comp       (ECal *ecal,
                                                             const gchar *query,
                                                             GList **objects,
                                                             GError **error);
    void                e_cal_free_object_list              (GList *objects);
    gboolean            e_cal_get_free_busy                 (ECal *ecal,
                                                             GList *users,
                                                             time_t start,
                                                             time_t end,
                                                             GList **freebusy,
                                                             GError **error);
    void                e_cal_generate_instances            (ECal *ecal,
                                                             time_t start,
                                                             time_t end,
                                                             ECalRecurInstanceFn cb,
                                                             gpointer cb_data);
    void                e_cal_generate_instances_for_object (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             time_t start,
                                                             time_t end,
                                                             ECalRecurInstanceFn cb,
                                                             gpointer cb_data);
    GSList *            e_cal_get_alarms_in_range           (ECal *ecal,
                                                             time_t start,
                                                             time_t end);
    void                e_cal_free_alarms                   (GSList *comp_alarms);
    gboolean            e_cal_get_alarms_for_object         (ECal *ecal,
                                                             const ECalComponentId *id,
                                                             time_t start,
                                                             time_t end,
                                                             ECalComponentAlarms **alarms);
    gboolean            e_cal_create_object                 (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             gchar **uid,
                                                             GError **error);
    gboolean            e_cal_modify_object                 (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             CalObjModType mod,
                                                             GError **error);
    gboolean            e_cal_remove_object                 (ECal *ecal,
                                                             const gchar *uid,
                                                             GError **error);
    gboolean            e_cal_remove_object_with_mod        (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             CalObjModType mod,
                                                             GError **error);
    gboolean            e_cal_discard_alarm                 (ECal *ecal,
                                                             ECalComponent *comp,
                                                             const gchar *auid,
                                                             GError **error);
    gboolean            e_cal_receive_objects               (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             GError **error);
    gboolean            e_cal_send_objects                  (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             GList **users,
                                                             icalcomponent **modified_icalcomp,
                                                             GError **error);
    gboolean            e_cal_get_timezone                  (ECal *ecal,
                                                             const gchar *tzid,
                                                             icaltimezone **zone,
                                                             GError **error);
    gboolean            e_cal_add_timezone                  (ECal *ecal,
                                                             icaltimezone *izone,
                                                             GError **error);
    gboolean            e_cal_set_default_timezone          (ECal *ecal,
                                                             icaltimezone *zone,
                                                             GError **error);
    gboolean            e_cal_get_query                     (ECal *ecal,
                                                             const gchar *sexp,
                                                             ECalView **query,
                                                             GError **error);
    icaltimezone *      e_cal_resolve_tzid_cb               (const gchar *tzid,
                                                             gpointer data);
    gchar *             e_cal_get_component_as_string       (ECal *ecal,
                                                             icalcomponent *icalcomp);
    const gchar *       e_cal_get_error_message             (ECalendarStatus status);
    gboolean            e_cal_open_default                  (ECal **ecal,
                                                             ECalSourceType type,
                                                             ECalAuthFunc func,
                                                             gpointer data,
                                                             GError **error);
    gboolean            e_cal_set_default                   (ECal *ecal,
                                                             GError **error);
    gboolean            e_cal_set_default_source            (ESource *source,
                                                             ECalSourceType type,
                                                             GError **error);
    gboolean            e_cal_get_sources                   (ESourceList **sources,
                                                             ECalSourceType type,
                                                             GError **error);
    const gchar *       e_cal_get_local_attachment_store    (ECal *ecal);
    gboolean            e_cal_get_recurrences_no_master     (ECal *ecal);
    gboolean            e_cal_get_attachments_for_comp      (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             GSList **list,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----ECal

## Signals

      "backend-died"                                   : Run First
      "backend-error"                                  : Run First
      "cal-opened"                                     : Run First
      "cal-opened-ex"                                  : Run First
      "cal-set-mode"                                   : Run First

## Description

The old signal "cal-opened" is deprecated since 3.0 and is replaced with its equivalent "cal_opened_ex", which has a detailed GError structure as a parameter, instead of a status code only.

Represents an entire calendar or task list, not individual items within them.2

## Details

### struct ECal

    struct ECal;

### Warning

`ECal` is deprecated and should not be used in newly-written code.

### enum ECalSourceType

    typedef enum {
    	E_CAL_SOURCE_TYPE_EVENT,
    	E_CAL_SOURCE_TYPE_TODO,
    	E_CAL_SOURCE_TYPE_JOURNAL,
    	E_CAL_SOURCE_TYPE_LAST
    } ECalSourceType;

### Warning

`ECalSourceType` is deprecated and should not be used in newly-written code.

### enum ECalSetModeStatus

    typedef enum {
    	E_CAL_SET_MODE_SUCCESS,
    	E_CAL_SET_MODE_ERROR,
    	E_CAL_SET_MODE_NOT_SUPPORTED
    } ECalSetModeStatus;

### Warning

`ECalSetModeStatus` is deprecated and should not be used in newly-written code.

### enum ECalLoadState

    typedef enum {
    	E_CAL_LOAD_NOT_LOADED,
    	E_CAL_LOAD_AUTHENTICATING,
    	E_CAL_LOAD_LOADING,
    	E_CAL_LOAD_LOADED
    } ECalLoadState;

### Warning

`ECalLoadState` is deprecated and should not be used in newly-written code.

### enum EDataCalMode

    typedef enum {
    	Local = 1 << 0,
    	Remote = 1 << 1,
    	AnyMode = 0x07
    } EDataCalMode;

### Warning

`EDataCalMode` is deprecated and should not be used in newly-written code.

FIXME: Document me.

Since 3.2

### ECalAuthFunc ()

    gchar *             (*ECalAuthFunc)                     (ECal *ecal,
                                                             const gchar *prompt,
                                                             const gchar *key,
                                                             gpointer user_data);

### Warning

`ECalAuthFunc` is deprecated and should not be used in newly-written code.

### e_cal_new ()

    ECal *              e_cal_new                           (ESource *source,
                                                             ECalSourceType type);

### Warning

`e_cal_new` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new()` instead.

Creates a new calendar client. This does not open the calendar itself, for that, e_cal_open or e_cal_open_async needs to be called.

`source` : | An ESource to be used for the client.
`type` : | Type of the client.
Returns : | A newly-created calendar client, or NULL if the client could not be constructed because it could not contact the calendar server.

### e_cal_new_from_uri ()

    ECal *              e_cal_new_from_uri                  (const gchar *uri,
                                                             ECalSourceType type);

### Warning

`e_cal_new_from_uri` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new_from_uri()` instead.

Creates a new calendar client. This does not open the calendar itself, for that, e_cal_open or e_cal_open_async needs to be called.

`uri` : | The URI pointing to the calendar to open.
`type` : | Type of the client.
Returns : | A newly-created calendar client, or NULL if the client could not be constructed because it could not contact the calendar server.

### e_cal_new_system_calendar ()

    ECal *              e_cal_new_system_calendar           (void);

### Warning

`e_cal_new_system_calendar` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new_system()` instead.

Create a calendar client for the system calendar, which should always be present in all Evolution installations. This does not open the calendar itself -- for that use `e_cal_open()` or `e_cal_open_async()`.

Returns : | A newly-created calendar client, or `NULL` if the client could not be constructed.

### e_cal_new_system_tasks ()

    ECal *              e_cal_new_system_tasks              (void);

### Warning

`e_cal_new_system_tasks` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new_system()` instead.

Create a calendar client for the system task list, which should always be present in all Evolution installations. This does not open the task list itself -- for that use `e_cal_open()` or `e_cal_open_async()`.

Returns : | A newly-created calendar client, or `NULL` if the client could not be constructed.

### e_cal_new_system_memos ()

    ECal *              e_cal_new_system_memos              (void);

### Warning

`e_cal_new_system_memos` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new_system()` instead.

Create a calendar client for the system memo list, which should always be present in all Evolution installations. This does not open the memo list itself -- for that use `e_cal_open()` or `e_cal_open_async()`.

Returns : | A newly-created calendar client, or `NULL` if the client could not be constructed.

### e_cal_set_auth_func ()

    void                e_cal_set_auth_func                 (ECal *ecal,
                                                             ECalAuthFunc func,
                                                             gpointer data);

### Warning

`e_cal_set_auth_func` has been deprecated since version 3.2 and should not be used in newly-written code. Use EClient::`authenticate()` signal on an ECalClient instead.

Sets the given authentication function on the calendar client. This function will be called any time the calendar server needs a password for an operation associated with the calendar and should be supplied before any calendar is opened.

When a calendar is opened asynchronously, the open function is processed in a concurrent thread. This means that the authentication function will also be called from this thread. As such, the authentication callback cannot directly call any functions that must be called from the main thread. For example any Gtk+ related functions, which must be proxied synchronously to the main thread by the callback.

The authentication function has the following signature (ECalAuthFunc): gchar * auth_func (ECal *ecal, const gchar *prompt, const gchar *key, gpointer user_data)

`ecal` : | A calendar client.
`func` : | The authentication function
`data` : | User data to be used when calling the authentication function

### e_cal_open ()

    gboolean            e_cal_open                          (ECal *ecal,
                                                             gboolean only_if_exists,
                                                             GError **error);

### Warning

`e_cal_open` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_open_sync()` on an ECalClient object instead.

Makes a calendar client initiate a request to open a calendar. The calendar client will emit the "cal_opened" signal when the response from the server is received. Since 3.0 is emitted also "cal_opened_ex" signal, which contains a GError pointer from the open operation (NULL when no error occurred). New signal deprecates the old "cal_opened" signal.

`ecal` : | A calendar client.
`only_if_exists` : | FALSE if the calendar should be opened even if there was no storage for it, i.e. to create a new calendar or load an existing one if it already exists. TRUE if it should only try to load calendars that already exist.
`error` : | Placeholder for error information.
Returns : | TRUE on success, FALSE on failure to issue the open request.

### e_cal_open_async ()

    void                e_cal_open_async                    (ECal *ecal,
                                                             gboolean only_if_exists);

### Warning

`e_cal_open_async` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_open()`/`e_client_open_finish()` on an ECalClient object instead.

Open the calendar asynchronously. The calendar will emit the "cal_opened" signal when the operation has completed. Since 3.0 is emitted also "cal_opened_ex" signal, which contains a GError pointer from the open operation (NULL when no error occurred). New signal deprecates the old "cal_opened" signal.

Because this operation runs in another thread, any authentication callback set on the calendar will be called from this other thread. See #`e_cal_set_auth_func()` for details.

`ecal` : | A calendar client.
`only_if_exists` : | If TRUE, then only open the calendar if it already exists. If FALSE, then create a new calendar if it doesn't already exist.

### e_cal_refresh ()

    gboolean            e_cal_refresh                       (ECal *ecal,
                                                             GError **error);

### Warning

`e_cal_refresh` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_refresh_sync()` instead.

Invokes refresh on a calendar. See `e_cal_get_refresh_supported`.

`ecal` : | A calendar client.
`error` : | Placeholder for error information.
Returns : | TRUE if calendar supports refresh and it was invoked, FALSE otherwise.

Since 2.30

### e_cal_remove ()

    gboolean            e_cal_remove                        (ECal *ecal,
                                                             GError **error);

### Warning

`e_cal_remove` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_remove_sync()` on an ECalClient object instead.

Removes a calendar.

`ecal` : | A calendar client.
`error` : | Placeholder for error information.
Returns : | TRUE if the calendar was removed, FALSE if there was an error.

### e_cal_uri_list ()

    GList *             e_cal_uri_list                      (ECal *ecal,
                                                             CalMode mode);

### Warning

`e_cal_uri_list` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Retrieves a list of all calendar clients for the given mode.

`ecal` : | A calendar client.
`mode` : | Mode of the URIs to get.
Returns : | list of uris.

### e_cal_get_source_type ()

    ECalSourceType      e_cal_get_source_type               (ECal *ecal);

### Warning

`e_cal_get_source_type` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_source_type()` instead.

Gets the type of the calendar client.

`ecal` : | A calendar client.
Returns : | an ECalSourceType value corresponding to the type of the calendar client.

### e_cal_get_load_state ()

    ECalLoadState       e_cal_get_load_state                (ECal *ecal);

### Warning

`e_cal_get_load_state` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_is_opened()` on an ECalClient instead.

Queries the state of loading of a calendar client.

`ecal` : | A calendar client.
Returns : | A ECalLoadState value indicating whether the client has not been loaded with e_cal_open yet, whether it is being loaded, or whether it is already loaded.

### e_cal_get_source ()

    ESource *           e_cal_get_source                    (ECal *ecal);

### Warning

`e_cal_get_source` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_get_source()` on an ECalClient object instead.

Queries the source that is open in a calendar client.

`ecal` : | A calendar client.
Returns : | The source of the calendar that is already loaded or is being loaded, or NULL if the ecal has not started a load request yet.

### e_cal_get_uri ()

    const gchar *       e_cal_get_uri                       (ECal *ecal);

### Warning

`e_cal_get_uri` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_get_uri()` on an ECalClient object instead.

Queries the URI that is open in a calendar client.

`ecal` : | A calendar client.
Returns : | The URI of the calendar that is already loaded or is being loaded, or NULL if the client has not started a load request yet.

### e_cal_is_read_only ()

    gboolean            e_cal_is_read_only                  (ECal *ecal,
                                                             gboolean *read_only,
                                                             GError **error);

### Warning

`e_cal_is_read_only` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_is_readonly()` on an ECalClient object instead.

Queries whether the calendar client can perform modifications on the calendar or not. Whether the backend is read only or not is specified, on exit, in the `read_only` argument.

`ecal` : | A calendar client.
`read_only` : | Return value for read only status.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE if there was an error.

### e_cal_get_cal_address ()

    gboolean            e_cal_get_cal_address               (ECal *ecal,
                                                             gchar **cal_address,
                                                             GError **error);

### Warning

`e_cal_get_cal_address` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_get_backend_property_sync()` with CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS instead.

Queries the calendar address associated with a calendar client.

`ecal` : | A calendar client.
`cal_address` : | Return value for address information.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE if there was an error.

### e_cal_get_alarm_email_address ()

    gboolean            e_cal_get_alarm_email_address       (ECal *ecal,
                                                             gchar **alarm_address,
                                                             GError **error);

### Warning

`e_cal_get_alarm_email_address` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_get_backend_property_sync()` with CAL_BACKEND_PROPERTY_ALARM_EMAIL_ADDRESS instead.

Queries the address to be used for alarms in a calendar client.

`ecal` : | A calendar client.
`alarm_address` : | Return value for alarm address.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE if there was an error while contacting the backend.

### e_cal_get_ldap_attribute ()

    gboolean            e_cal_get_ldap_attribute            (ECal *ecal,
                                                             gchar **ldap_attribute,
                                                             GError **error);

### Warning

`e_cal_get_ldap_attribute` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Queries the LDAP attribute for a calendar client.

`ecal` : | A calendar client.
`ldap_attribute` : | Return value for the LDAP attribute.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE if there was an error contacting the backend.

### e_cal_get_one_alarm_only ()

    gboolean            e_cal_get_one_alarm_only            (ECal *ecal);

### Warning

`e_cal_get_one_alarm_only` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_check_one_alarm_only()` instead.

Checks if a calendar supports only one alarm per component.

`ecal` : | A calendar client.
Returns : | TRUE if the calendar allows only one alarm, FALSE otherwise.

### e_cal_get_organizer_must_attend ()

    gboolean            e_cal_get_organizer_must_attend     (ECal *ecal);

### Warning

`e_cal_get_organizer_must_attend` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_check_organizer_must_attend()` instead.

Checks if a calendar forces organizers of meetings to be also attendees.

`ecal` : | A calendar client.
Returns : | TRUE if the calendar forces organizers to attend meetings, FALSE otherwise.

### e_cal_get_save_schedules ()

    gboolean            e_cal_get_save_schedules            (ECal *ecal);

### Warning

`e_cal_get_save_schedules` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_check_save_schedules()` instead.

Checks whether the calendar saves schedules.

`ecal` : | A calendar client.
Returns : | TRUE if it saves schedules, FALSE otherwise.

### e_cal_get_static_capability ()

    gboolean            e_cal_get_static_capability         (ECal *ecal,
                                                             const gchar *cap);

### Warning

`e_cal_get_static_capability` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_check_capability()` on an ECalClient object instead.

Queries the calendar for static capabilities.

`ecal` : | A calendar client.
`cap` : | Name of the static capability to check.
Returns : | TRUE if the capability is supported, FALSE otherwise.

### e_cal_get_organizer_must_accept ()

    gboolean            e_cal_get_organizer_must_accept     (ECal *ecal);

### Warning

`e_cal_get_organizer_must_accept` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_check_organizer_must_accept()` instead.

Checks whether a calendar requires organizer to accept their attendance to meetings.

Returns : | TRUE if the calendar requires organizers to accept, FALSE otherwise.

Since 3.2

### e_cal_get_refresh_supported ()

    gboolean            e_cal_get_refresh_supported         (ECal *ecal);

### Warning

`e_cal_get_refresh_supported` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_client_check_refresh_supported()` instead.

Checks whether a calendar supports explicit refreshing (see `e_cal_refresh`).

`ecal` : | A calendar client.
Returns : | TRUE if the calendar supports refreshing, FALSE otherwise.

Since 2.30

### e_cal_set_mode ()

    gboolean            e_cal_set_mode                      (ECal *ecal,
                                                             CalMode mode);

### Warning

`e_cal_set_mode` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Switches online/offline mode on the calendar.

`ecal` : | A calendar client.
`mode` : | Mode to switch to.
Returns : | TRUE if the switch was successful, FALSE if there was an error.

### e_cal_get_default_object ()

    gboolean            e_cal_get_default_object            (ECal *ecal,
                                                             icalcomponent **icalcomp,
                                                             GError **error);

### Warning

`e_cal_get_default_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_default_object_sync()` instead.

Retrives an icalcomponent from the backend that contains the default values for properties needed.

`ecal` : | A calendar client.
`icalcomp` : | Return value for the default object.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE otherwise.

### e_cal_get_object ()

    gboolean            e_cal_get_object                    (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             icalcomponent **icalcomp,
                                                             GError **error);

### Warning

`e_cal_get_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_object_sync()` instead.

Queries a calendar for a calendar component object based on its unique identifier.

`ecal` : | A calendar client.
`uid` : | Unique identifier for a calendar component.
`rid` : | Recurrence identifier.
`icalcomp` : | Return value for the calendar component object.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE otherwise.

### e_cal_get_objects_for_uid ()

    gboolean            e_cal_get_objects_for_uid           (ECal *ecal,
                                                             const gchar *uid,
                                                             GList **objects,
                                                             GError **error);

### Warning

`e_cal_get_objects_for_uid` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_objects_for_uid_sync()` instead.

Queries a calendar for all calendar components with the given unique ID. This will return any recurring event and all its detached recurrences. For non-recurring events, it will just return the object with that ID.

`ecal` : | A calendar client.
`uid` : | Unique identifier for a calendar component.
`objects` : | Return value for the list of objects obtained from the backend.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE otherwise.

### e_cal_get_changes ()

    gboolean            e_cal_get_changes                   (ECal *ecal,
                                                             const gchar *change_id,
                                                             GList **changes,
                                                             GError **error);

### Warning

`e_cal_get_changes` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Returns a list of changes made to the calendar since a specific time. That time is identified by the `change_id` argument, which is used by the backend to compute the changes done.

`ecal` : | A calendar client.
`change_id` : | ID to use for comparing changes.
`changes` : | Return value for the list of changes.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE otherwise.

### e_cal_free_change_list ()

    void                e_cal_free_change_list              (GList *list);

### Warning

`e_cal_free_change_list` has been deprecated since version 3.2 and should not be used in newly-written code. `Use()` instead.

Free a list of changes as returned by e_cal_get_changes.

`list` : | List of changes to be freed.

### e_cal_get_object_list ()

    gboolean            e_cal_get_object_list               (ECal *ecal,
                                                             const gchar *query,
                                                             GList **objects,
                                                             GError **error);

### Warning

`e_cal_get_object_list` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_object_list_sync()` instead.

Gets a list of objects from the calendar that match the query specified by the `query` argument. The objects will be returned in the `objects` argument, which is a list of icalcomponent. When done, this list should be freed by using the e_cal_free_object_list function.

`ecal` : | A calendar client.
`query` : | Query string.
`objects` : | Return value for list of objects. [out][element-type long]
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_get_object_list_as_comp ()

    gboolean            e_cal_get_object_list_as_comp       (ECal *ecal,
                                                             const gchar *query,
                                                             GList **objects,
                                                             GError **error);

### Warning

`e_cal_get_object_list_as_comp` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_object_list_as_comps_sync()` instead.

Gets a list of objects from the calendar that match the query specified by the `query` argument. The objects will be returned in the `objects` argument, which is a list of ECalComponent.

`ecal` : | A calendar client.
`query` : | Query string.
`objects` : | Return value for list of objects.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_free_object_list ()

    void                e_cal_free_object_list              (GList *objects);

### Warning

`e_cal_free_object_list` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_free_icalcomp_slist()` instead.

Frees a list of objects as returned by e_cal_get_object_list.

`objects` : | List of objects to be freed.

### e_cal_get_free_busy ()

    gboolean            e_cal_get_free_busy                 (ECal *ecal,
                                                             GList *users,
                                                             time_t start,
                                                             time_t end,
                                                             GList **freebusy,
                                                             GError **error);

### Warning

`e_cal_get_free_busy` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_free_busy_sync()` instead.

Gets free/busy information from the calendar server.

`ecal` : | A calendar client.
`users` : | List of users to retrieve free/busy information for.
`start` : | Start time for query.
`end` : | End time for query.
`freebusy` : | Return value for VFREEBUSY objects.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_generate_instances ()

    void                e_cal_generate_instances            (ECal *ecal,
                                                             time_t start,
                                                             time_t end,
                                                             ECalRecurInstanceFn cb,
                                                             gpointer cb_data);

### Warning

`e_cal_generate_instances` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_generate_instances()` instead.

Does a combination of #`e_cal_get_object_list()` and #`e_cal_recur_generate_instances()`.

The callback function should do a `g_object_ref()` of the calendar component it gets passed if it intends to keep it around, since it will be unref'ed as soon as the callback returns.

`ecal` : | A calendar client.
`start` : | Start time for query.
`end` : | End time for query.
`cb` : | Callback for each generated instance.
`cb_data` : | Closure data for the callback.

### e_cal_generate_instances_for_object ()

    void                e_cal_generate_instances_for_object (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             time_t start,
                                                             time_t end,
                                                             ECalRecurInstanceFn cb,
                                                             gpointer cb_data);

### Warning

`e_cal_generate_instances_for_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_generate_instances_for_object()` instead.

Does a combination of #`e_cal_get_object_list()` and #`e_cal_recur_generate_instances()`, like #`e_cal_generate_instances()`, but for a single object.

The callback function should do a `g_object_ref()` of the calendar component it gets passed if it intends to keep it around, since it will be unref'ed as soon as the callback returns.

`ecal` : | A calendar client.
`icalcomp` : | Object to generate instances from.
`start` : | Start time for query.
`end` : | End time for query.
`cb` : | Callback for each generated instance.
`cb_data` : | Closure data for the callback.

### e_cal_get_alarms_in_range ()

    GSList *            e_cal_get_alarms_in_range           (ECal *ecal,
                                                             time_t start,
                                                             time_t end);

### Warning

`e_cal_get_alarms_in_range` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Queries a calendar for the alarms that trigger in the specified range of time.

`ecal` : | A calendar client.
`start` : | Start time for query.
`end` : | End time for query.
Returns : | A list of ECalComponentAlarms structures. This should be freed using the #`e_cal_free_alarms()` function, or by freeing each element separately with #`e_cal_component_alarms_free()` and then freeing the list with #`g_slist_free()`.

### e_cal_free_alarms ()

    void                e_cal_free_alarms                   (GSList *comp_alarms);

### Warning

`e_cal_free_alarms` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Frees a list of ECalComponentAlarms structures as returned by `e_cal_get_alarms_in_range()`.

`comp_alarms` : | A list of ECalComponentAlarms structures.

### e_cal_get_alarms_for_object ()

    gboolean            e_cal_get_alarms_for_object         (ECal *ecal,
                                                             const ECalComponentId *id,
                                                             time_t start,
                                                             time_t end,
                                                             ECalComponentAlarms **alarms);

### Warning

`e_cal_get_alarms_for_object` has been deprecated since version 3.2 and should not be used in newly-written code. This function has been dropped completely.

Queries a calendar for the alarms of a particular object that trigger in the specified range of time.

`ecal` : | A calendar client.
`id` : | Unique identifier for a calendar component.
`start` : | Start time for query.
`end` : | End time for query.
`alarms` : | Return value for the component's alarm instances. Will return NULL if no instances occur within the specified time range. This should be freed using the `e_cal_component_alarms_free()` function.
Returns : | TRUE on success, FALSE if the object was not found.

### e_cal_create_object ()

    gboolean            e_cal_create_object                 (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             gchar **uid,
                                                             GError **error);

### Warning

`e_cal_create_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_create_object_sync()` instead.

Requests the calendar backend to create the object specified by the `icalcomp` argument. Some backends would assign a specific UID to the newly created object, in those cases that UID would be returned in the `uid` argument.

`ecal` : | A calendar client.
`icalcomp` : | The component to create.
`uid` : | Return value for the UID assigned to the new component by the calendar backend.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_modify_object ()

    gboolean            e_cal_modify_object                 (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             CalObjModType mod,
                                                             GError **error);

### Warning

`e_cal_modify_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_modify_object_sync()` instead.

Requests the calendar backend to modify an existing object. If the object does not exist on the calendar, an error will be returned.

For recurrent appointments, the `mod` argument specifies what to modify, if all instances (CALOBJ_MOD_ALL), a single instance (CALOBJ_MOD_THIS), or a specific set of instances (CALOBJ_MOD_THISNADPRIOR and CALOBJ_MOD_THISANDFUTURE).

`ecal` : | A calendar client.
`icalcomp` : | Component to modify.
`mod` : | Type of modification.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_remove_object ()

    gboolean            e_cal_remove_object                 (ECal *ecal,
                                                             const gchar *uid,
                                                             GError **error);

### Warning

`e_cal_remove_object` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_remove_object_sync()` instead, with rid set to NULL and mod set to CALOBJ_MOD_ALL.

Asks a calendar to remove all components with the given UID. If more control of the removal is desired, then use `e_cal_remove_object_with_mod()`. If the server is able to remove the component(s), all clients will be notified and they will emit the "obj_removed" signal.

`ecal` : | A calendar client.
`uid` : | Unique identifier of the calendar component to remove.
`error` : | Placeholder for error information.
Returns : | `TRUE` if successful, `FALSE` otherwise.

### e_cal_remove_object_with_mod ()

    gboolean            e_cal_remove_object_with_mod        (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             CalObjModType mod,
                                                             GError **error);

### Warning

`e_cal_remove_object_with_mod` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_remove_object_sync()` instead.

This function allows the removal of instances of a recurrent appointment. If what you want is to remove all instances, use e_cal_remove_object instead.

By using a combination of the `uid`, `rid` and `mod` arguments, you can remove specific instances. `uid` is mandatory. Empty or NULL `rid` selects the parent appointment (the one with the recurrence rule). A non-empty `rid` selects the recurrence at the time specified in `rid`, using the same time zone as the parent appointment's start time.

The exact semantic then depends on `mod`. CALOBJ_MOD_THIS, CALOBJ_MOD_THISANDPRIOR, CALOBJ_MOD_THISANDFUTURE and CALOBJ_MOD_ALL ensure that the event does not recur at the selected instance(s). This is done by removing any detached recurrence matching the selection criteria and modifying the parent appointment (adding EXDATE, adjusting recurrence rules, etc.). It is not an error if `uid`+`rid` do not match an existing instance.

If not all instances are removed, the client will get a "obj_modified" signal for the parent appointment, while it will get an "obj_removed" signal when all instances are removed.

CALOBJ_MOD_ONLY_THIS changes the semantic of CALOBJ_MOD_THIS: `uid` and `rid` must select an existing instance. That instance is removed without modifying the parent appointment. In other words, e_cal_remove_object_with_mod(CALOBJ_MOD_ONLY_THIS) is the inverse operation for adding a detached recurrence. The client is always sent an "obj_removed" signal.

Note that not all backends support CALOBJ_MOD_ONLY_THIS. Check for the CAL_STATIC_CAPABILITY_REMOVE_ONLY_THIS capability before using it. Previous releases did not check consistently for unknown `mod` values, using it with them may have had unexpected results.

`ecal` : | A calendar client.
`uid` : | UID of the object to remove.
`rid` : | Recurrence ID of the specific recurrence to remove.
`mod` : | Type of removal.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_discard_alarm ()

    gboolean            e_cal_discard_alarm                 (ECal *ecal,
                                                             ECalComponent *comp,
                                                             const gchar *auid,
                                                             GError **error);

### Warning

`e_cal_discard_alarm` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_discard_alarm_sync()` instead.

Tells the calendar backend to get rid of the alarm identified by the `auid` argument in `comp`. Some backends might remove the alarm or update internal information about the alarm be discarded, or, like the file backend does, ignore the operation.

CALOBJ_MOD_ONLY_THIS is not supported in this call.

`ecal` : | A calendar ecal.
`comp` : | The component to discard the alarm from.
`auid` : | Unique identifier of the alarm to be discarded.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_receive_objects ()

    gboolean            e_cal_receive_objects               (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             GError **error);

### Warning

`e_cal_receive_objects` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_receive_objects_sync()` instead.

Makes the backend receive the set of iCalendar objects specified in the `icalcomp` argument. This is used for iTIP confirmation/cancellation messages for scheduled meetings.

`ecal` : | A calendar client.
`icalcomp` : | An icalcomponent.
`error` : | Placeholder for error information.
Returns : | `TRUE` if successful, `FALSE` otherwise.

### e_cal_send_objects ()

    gboolean            e_cal_send_objects                  (ECal *ecal,
                                                             icalcomponent *icalcomp,
                                                             GList **users,
                                                             icalcomponent **modified_icalcomp,
                                                             GError **error);

### Warning

`e_cal_send_objects` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_send_objects_sync()` instead.

Requests a calendar backend to send meeting information to the specified list of users.

`ecal` : | A calendar client.
`icalcomp` : | An icalcomponent.
`users` : | List of users to send the objects to.
`modified_icalcomp` : | Return value for the icalcomponent after all the operations performed.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_get_timezone ()

    gboolean            e_cal_get_timezone                  (ECal *ecal,
                                                             const gchar *tzid,
                                                             icaltimezone **zone,
                                                             GError **error);

### Warning

`e_cal_get_timezone` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_timezone_sync()` instead.

Retrieves a timezone object from the calendar backend.

`ecal` : | A calendar client.
`tzid` : | ID of the timezone to retrieve.
`zone` : | Return value for the timezone.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_add_timezone ()

    gboolean            e_cal_add_timezone                  (ECal *ecal,
                                                             icaltimezone *izone,
                                                             GError **error);

### Warning

`e_cal_add_timezone` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_add_timezone_sync()` instead.

Add a VTIMEZONE object to the given calendar.

`ecal` : | A calendar client.
`izone` : | The timezone to add.
`error` : | Placeholder for error information.
Returns : | TRUE if successful, FALSE otherwise.

### e_cal_set_default_timezone ()

    gboolean            e_cal_set_default_timezone          (ECal *ecal,
                                                             icaltimezone *zone,
                                                             GError **error);

### Warning

`e_cal_set_default_timezone` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_set_default_timezone()` instead.

Sets the default timezone on the calendar. This should be called before opening the calendar.

`ecal` : | A calendar client.
`zone` : | A timezone object.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_get_query ()

    gboolean            e_cal_get_query                     (ECal *ecal,
                                                             const gchar *sexp,
                                                             ECalView **query,
                                                             GError **error);

### Warning

`e_cal_get_query` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_view_sync()` instead.

Creates a live query object from a loaded calendar.

`ecal` : | A calendar client.
`sexp` : | S-expression representing the query.
`query` : | Return value for the new query. [out]
`error` : | Placeholder for error information.
Returns : | A query object that will emit notification signals as calendar components are added and removed from the query in the server.

### e_cal_resolve_tzid_cb ()

    icaltimezone *      e_cal_resolve_tzid_cb               (const gchar *tzid,
                                                             gpointer data);

### Warning

`e_cal_resolve_tzid_cb` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_resolve_tzid_cb()` instead.

Resolves TZIDs for the recurrence generator.

`tzid` : | ID of the timezone to resolve.
`data` : | Closure data for the callback.
Returns : | The timezone identified by the `tzid` argument, or `NULL` if it could not be found.

### e_cal_get_component_as_string ()

    gchar *             e_cal_get_component_as_string       (ECal *ecal,
                                                             icalcomponent *icalcomp);

### Warning

`e_cal_get_component_as_string` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_component_as_string()` instead.

Gets a calendar component as an iCalendar string, with a toplevel VCALENDAR component and all VTIMEZONEs needed for the component.

`ecal` : | A calendar client.
`icalcomp` : | A calendar component object.
Returns : | the component as a complete iCalendar string, or NULL on failure. The string should be freed after use.

### e_cal_get_error_message ()

    const gchar *       e_cal_get_error_message             (ECalendarStatus status);

### Warning

`e_cal_get_error_message` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_error_to_string()` instead.

Gets an error message for the given status code.

`status` : | A status code.
Returns : | the error message.

### e_cal_open_default ()

    gboolean            e_cal_open_default                  (ECal **ecal,
                                                             ECalSourceType type,
                                                             ECalAuthFunc func,
                                                             gpointer data,
                                                             GError **error);

### Warning

`e_cal_open_default` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_new_default_calendar()` instead and open it on your own.

Opens the default calendar.

`ecal` : | A calendar client.
`type` : | Type of the calendar.
`func` : | Authentication function.
`data` : | Closure data for the authentication function.
`error` : | Placeholder for error information.
Returns : | TRUE if it opened correctly, FALSE otherwise.

### e_cal_set_default ()

    gboolean            e_cal_set_default                   (ECal *ecal,
                                                             GError **error);

### Warning

`e_cal_set_default` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_set_default()` instead.

Sets the ESource in `ecal` as default.

`ecal` : | an ECal
`error` : | return location for a GError, or `NULL`
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_set_default_source ()

    gboolean            e_cal_set_default_source            (ESource *source,
                                                             ECalSourceType type,
                                                             GError **error);

### Warning

`e_cal_set_default_source` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_set_default_source()` instead.

Sets `source` as the default source for the specified `type`.

`source` : | an ESource
`type` : | type of the source
`error` : | return location for a GError, or `NULL`
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_get_sources ()

    gboolean            e_cal_get_sources                   (ESourceList **sources,
                                                             ECalSourceType type,
                                                             GError **error);

### Warning

`e_cal_get_sources` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_sources()` instead.

Gets the list of sources defined in the configuration for the given `type`.

`sources` : | Return value for list of sources.
`type` : | Type of the sources to get.
`error` : | Placeholder for error information.
Returns : | TRUE if the operation was successful, FALSE otherwise.

### e_cal_get_local_attachment_store ()

    const gchar *       e_cal_get_local_attachment_store    (ECal *ecal);

### Warning

`e_cal_get_local_attachment_store` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_local_attachment_store()` instead.

Queries the URL where the calendar attachments are serialized in the local filesystem. This enable clients to operate with the reference to attachments rather than the data itself unless it specifically uses the attachments for open/sending operations.

`ecal` : | A calendar client.
Returns : | The URL where the attachments are serialized in the local filesystem.

### e_cal_get_recurrences_no_master ()

    gboolean            e_cal_get_recurrences_no_master     (ECal *ecal);

### Warning

`e_cal_get_recurrences_no_master` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_check_recurrences_no_master()` instead.

Checks if the calendar has a master object for recurrences.

`ecal` : | A calendar client.
Returns : | TRUE if the calendar has a master object for recurrences, FALSE otherwise.

### e_cal_get_attachments_for_comp ()

    gboolean            e_cal_get_attachments_for_comp      (ECal *ecal,
                                                             const gchar *uid,
                                                             const gchar *rid,
                                                             GSList **list,
                                                             GError **error);

### Warning

`e_cal_get_attachments_for_comp` has been deprecated since version 3.2 and should not be used in newly-written code. Use `e_cal_client_get_attachment_uris_sync()` instead.

Queries a calendar for a calendar component object based on its unique identifier and gets the attachments for the component.

`ecal` : | A calendar client.
`uid` : | Unique identifier for a calendar component.
`rid` : | Recurrence identifier.
`list` : | Return the list of attachment uris.
`error` : | Placeholder for error information.
Returns : | TRUE if the call was successful, FALSE otherwise.

## Signal Details

### The `"backend-died"` signal

    void                user_function                      (ECal    *ecal,
                                                            gpointer user_data)      : Run First

`ecal` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"backend-error"` signal

    void                user_function                      (ECal    *ecal,
                                                            gchar   *arg1,
                                                            gpointer user_data)      : Run First

`ecal` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"cal-opened"` signal

    void                user_function                      (ECal    *ecal,
                                                            gint     arg1,
                                                            gpointer user_data)      : Run First

`ecal` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"cal-opened-ex"` signal

    void                user_function                      (ECal    *ecal:,
                                                            gpointer error,
                                                            gpointer user_data)      : Run First

`ecal:` : | self
`error` : | . [type glong]
`user_data` : | user data set when the signal handler was connected.

### The `"cal-set-mode"` signal

    void                user_function                      (ECal                 *ecal,
                                                            ECalSetModeStatusEnum arg1,
                                                            CalModeEnum           arg2,
                                                            gpointer              user_data)      : Run First

`ecal` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

## See Also

e-cal-listener, e-cal-view