## e-cal-util

e-cal-util

## Functions

ICalComponent * | e_cal_util_new_top_level ()
ICalComponent * | e_cal_util_new_component ()
ICalTimezone * | e_cal_util_copy_timezone ()
ICalComponent * | e_cal_util_parse_ics_string ()
ICalComponent * | e_cal_util_parse_ics_file ()
ECalComponentAlarms * | e_cal_util_generate_alarms_for_comp ()
gint | e_cal_util_generate_alarms_for_list ()
const gchar * | e_cal_util_priority_to_string ()
gint | e_cal_util_priority_from_string ()
gchar * | e_cal_util_seconds_to_string ()
void | e_cal_util_add_timezones_from_component ()
gboolean | e_cal_util_property_has_parameter ()
gboolean | e_cal_util_component_has_property ()
gboolean | e_cal_util_component_is_instance ()
gboolean | e_cal_util_component_has_alarms ()
gboolean | e_cal_util_component_has_organizer ()
gboolean | e_cal_util_component_has_recurrences ()
gboolean | e_cal_util_component_has_rdates ()
gboolean | e_cal_util_component_has_rrules ()
gboolean | e_cal_util_component_has_attendee ()
gchar * | e_cal_util_component_get_recurid_as_string ()
ICalComponent * | e_cal_util_construct_instance ()
void | e_cal_util_remove_instances ()
ICalComponent * | e_cal_util_split_at_instance ()
void | e_cal_util_normalize_rrule_until_value ()
void | e_cal_util_remove_instances_ex ()
ICalComponent * | e_cal_util_split_at_instance_ex ()
gboolean | e_cal_util_is_first_instance ()
gchar * | e_cal_util_get_system_timezone_location ()
ICalTimezone * | e_cal_util_get_system_timezone ()
void | e_cal_util_get_component_occur_times ()
gboolean | e_cal_util_component_has_x_property ()
ICalProperty * | e_cal_util_component_find_x_property ()
gchar * | e_cal_util_component_dup_x_property ()
void | e_cal_util_component_set_x_property ()
gboolean | e_cal_util_component_remove_x_property ()
guint | e_cal_util_component_remove_property_by_kind ()
gboolean | e_cal_util_init_recur_task_sync ()
gboolean | e_cal_util_mark_task_complete_sync ()
EConflictResolution | e_cal_util_operation_flags_to_conflict_resolution ()
gboolean | e_cal_util_inline_local_attachments_sync ()
gboolean | e_cal_util_set_alarm_acknowledged ()
void | e_cal_util_clamp_vtimezone ()
void | e_cal_util_clamp_vtimezone_by_component ()

## Types and Values

#define | E_CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT
#define | E_CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS
#define | E_CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS
#define | E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS
#define | E_CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS
#define | E_CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT
#define | E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE
#define | E_CAL_STATIC_CAPABILITY_NO_THISANDPRIOR
#define | E_CAL_STATIC_CAPABILITY_NO_TRANSPARENCY
#define | E_CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE
#define | E_CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION
#define | E_CAL_STATIC_CAPABILITY_NO_ALARM_AFTER_START
#define | E_CAL_STATIC_CAPABILITY_BULK_ADDS
#define | E_CAL_STATIC_CAPABILITY_BULK_MODIFIES
#define | E_CAL_STATIC_CAPABILITY_BULK_REMOVES
#define | E_CAL_STATIC_CAPABILITY_REMOVE_ONLY_THIS
#define | E_CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY
#define | E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND
#define | E_CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS
#define | E_CAL_STATIC_CAPABILITY_REMOVE_ALARMS
#define | E_CAL_STATIC_CAPABILITY_CREATE_MESSAGES
#define | E_CAL_STATIC_CAPABILITY_SAVE_SCHEDULES
#define | E_CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK
#define | E_CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR
#define | E_CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS
#define | E_CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS
#define | E_CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER
#define | E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT
#define | E_CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED
#define | E_CAL_STATIC_CAPABILITY_NO_ORGANIZER
#define | E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY
#define | E_CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING
#define | E_CAL_STATIC_CAPABILITY_REFRESH_SUPPORTED
#define | E_CAL_STATIC_CAPABILITY_ALL_DAY_EVENT_AS_TIME
#define | E_CAL_STATIC_CAPABILITY_TASK_DATE_ONLY
#define | E_CAL_STATIC_CAPABILITY_TASK_CAN_RECUR
#define | E_CAL_STATIC_CAPABILITY_TASK_NO_ALARM
#define | E_CAL_STATIC_CAPABILITY_COMPONENT_COLOR
#define | E_CAL_STATIC_CAPABILITY_TASK_HANDLE_RECUR
#define | E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO
#define | E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO_WITH_SUMMARY
#define | E_CAL_STATIC_CAPABILITY_TASK_ESTIMATED_DURATION

## Description

## Functions

### e_cal_util_new_top_level ()

    ICalComponent *
    e_cal_util_new_top_level (void);

Creates a new VCALENDAR component. Free it with `g_object_unref()`, when no longer needed.

#### Returns

the newly created top level component.

[transfer full]

### e_cal_util_new_component ()

    ICalComponent *
    e_cal_util_new_component (ICalComponentKind kind);

Creates a new ICalComponent of the specified kind. Free it with `g_object_unref()`, when no longer needed.

#### Parameters

kind | Kind of the component to create, as ICalComponentKind. |

#### Returns

the newly created component.

[transfer full]

### e_cal_util_copy_timezone ()

    ICalTimezone *
    e_cal_util_copy_timezone (const ICalTimezone *zone);

Copies the `zone` together with its inner component and returns it as a new ICalTimezone object. Free it with `g_object_unref()`, when no longer needed.

#### Parameters

zone | an ICalTimezone |

#### Returns

a copy of the `zone` .

[transfer full]

Since: 3.34

### e_cal_util_parse_ics_string ()

    ICalComponent *
    e_cal_util_parse_ics_string (const gchar *string);

Parses an iCalendar string and returns a new ICalComponent representing that string. Note that this function deals with multiple VCALENDAR's in the string, something that Mozilla used to do and which libical does not support.

Free the returned non-NULL component with `g_object_unref()`, when no longer needed.

#### Parameters

string | iCalendar string to be parsed. |

#### Returns

a newly created ICalComponent, or `NULL`, if the string isn't a valid iCalendar string.

[transfer full][nullable]

### e_cal_util_parse_ics_file ()

    ICalComponent *
    e_cal_util_parse_ics_file (const gchar *filename);

Parses the given file, and, if it contains a valid iCalendar object, parse it and return a new ICalComponent.

Free the returned non-NULL component with `g_object_unref()`, when no longer needed.

#### Parameters

filename | Name of the file to be parsed. |

#### Returns

a newly created ICalComponent, or `NULL`, if the file doesn't contain a valid iCalendar object.

[transfer full][nullable]

### e_cal_util_generate_alarms_for_comp ()

    ECalComponentAlarms *
    e_cal_util_generate_alarms_for_comp (ECalComponent *comp,
                                         time_t start,
                                         time_t end,
                                         ECalComponentAlarmAction *omit,
                                         ECalRecurResolveTimezoneCb resolve_tzid,
                                         gpointer user_data,
                                         ICalTimezone *default_timezone);

Generates alarm instances for a calendar component. Returns the instances structure, or `NULL` if no alarm instances occurred in the specified time range. Free the returned structure with `e_cal_component_alarms_free()`, when no longer needed.

#### Parameters

comp | The ECalComponent to generate alarms from |
start | Start time |
end | End time |
omit | Alarm types to omit |
resolve_tzid | Callback for resolving timezones. | [closure user_data][scope call]
user_data | Data to be passed to the resolve_tzid callback. | [closure]
default_timezone | The timezone used to resolve DATE and floating DATE-TIME values. |

#### Returns

a list of all the alarms found for the given component in the given time range.

[transfer full][nullable]

### e_cal_util_generate_alarms_for_list ()

    gint
    e_cal_util_generate_alarms_for_list (GList *comps,
                                         time_t start,
                                         time_t end,
                                         ECalComponentAlarmAction *omit,
                                         GSList **comp_alarms,
                                         ECalRecurResolveTimezoneCb resolve_tzid,
                                         gpointer user_data,
                                         ICalTimezone *default_timezone);

Iterates through all the components in the `comps` list and generates alarm instances for them; putting them in the `comp_alarms` list. Free the `comp_alarms` with g_slist_free_full (comp_alarms, e_cal_component_alarms_free);, when no longer neeed.

#### Parameters

comps | List of ECalComponents. | [element-type ECalComponent]
start | Start time |
end | End time |
omit | Alarm types to omit |
comp_alarms | List to be returned. | [out][transfer full][element-type ECalComponentAlarms]
resolve_tzid | Callback for resolving timezones. | [closure user_data][scope call]
user_data | Data to be passed to the resolve_tzid callback. | [closure]
default_timezone | The timezone used to resolve DATE and floating DATE-TIME values. |

#### Returns

the number of elements it added to the list

### e_cal_util_priority_to_string ()

    const gchar *
    e_cal_util_priority_to_string (gint priority);

Converts an iCalendar PRIORITY value to a translated string. Any unknown priority value (i.e. not 0-9) will be returned as "" (undefined).

#### Parameters

priority | Priority value. |

#### Returns

a string representing the PRIORITY value. This value is a constant, so it should never be freed.

### e_cal_util_priority_from_string ()

    gint
    e_cal_util_priority_from_string (const gchar *string);

Converts a translated priority string to an iCalendar priority value.

#### Parameters

string | A string representing the PRIORITY value. |

#### Returns

the priority (0-9) or -1 if the priority string is not valid.

### e_cal_util_seconds_to_string ()

    gchar *
    e_cal_util_seconds_to_string (gint64 seconds);

Converts time, in seconds, into a string representation readable by humans and localized into the current locale. This can be used to convert event duration to string or similar use cases.

Free the returned string with `g_free()`, when no longer needed.

#### Parameters

seconds | actual time, in seconds |

#### Returns

a newly allocated string with localized description of the given time in seconds.

[transfer full]

Since: 3.30

### e_cal_util_add_timezones_from_component ()

    void
    e_cal_util_add_timezones_from_component
                                   (ICalComponent *vcal_comp,
                                    ICalComponent *icalcomp);

Adds VTIMEZONE components to a VCALENDAR for all tzid's in the given `icalcomp` .

#### Parameters

vcal_comp | A VCALENDAR component. |
icalcomp | An iCalendar component, of any type. |

### e_cal_util_property_has_parameter ()

    gboolean
    e_cal_util_property_has_parameter (ICalProperty *prop,
                                       ICalParameterKind param_kind);

Returns, whether the `prop` has a parameter of `param_kind` .

#### Parameters

prop | an ICalProperty |
param_kind | a parameter kind to look for, as an `ICalParameterKind` |

#### Returns

whether the `prop` has a parameter of `prop_kind`

Since: 3.34

### e_cal_util_component_has_property ()

    gboolean
    e_cal_util_component_has_property (ICalComponent *icalcomp,
                                       ICalPropertyKind prop_kind);

Returns, whether the `icalcomp` has a property of `prop_kind` . To check for a specific X property use `e_cal_util_component_has_x_property()`.

#### Parameters

icalcomp | an ICalComponent |
prop_kind | a property kind to look for, as an `ICalPropertyKind` |

#### Returns

whether the `icalcomp` has a property of `prop_kind`

Since: 3.34

### e_cal_util_component_is_instance ()

    gboolean
    e_cal_util_component_is_instance (ICalComponent *icalcomp);

Checks whether an ICalComponent is an instance of a recurring appointment.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if it is an instance, FALSE if not.

### e_cal_util_component_has_alarms ()

    gboolean
    e_cal_util_component_has_alarms (ICalComponent *icalcomp);

Checks whether an ICalComponent has any alarm.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if it has alarms, FALSE otherwise.

### e_cal_util_component_has_organizer ()

    gboolean
    e_cal_util_component_has_organizer (ICalComponent *icalcomp);

Checks whether an ICalComponent has an organizer.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if there is an organizer, FALSE if not.

### e_cal_util_component_has_recurrences ()

    gboolean
    e_cal_util_component_has_recurrences (ICalComponent *icalcomp);

Checks if an ICalComponent has recurrence dates or rules.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if there are recurrence dates/rules, FALSE if not.

### e_cal_util_component_has_rdates ()

    gboolean
    e_cal_util_component_has_rdates (ICalComponent *icalcomp);

Checks if an ICalComponent has recurrence dates.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if there are recurrence dates, FALSE if not.

### e_cal_util_component_has_rrules ()

    gboolean
    e_cal_util_component_has_rrules (ICalComponent *icalcomp);

Checks if an ICalComponent has recurrence rules.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if there are recurrence rules, FALSE if not.

### e_cal_util_component_has_attendee ()

    gboolean
    e_cal_util_component_has_attendee (ICalComponent *icalcomp);

Checks if an ICalComponent has any attendees.

#### Parameters

icalcomp | An ICalComponent. |

#### Returns

TRUE if there are attendees, FALSE if not.

### e_cal_util_component_get_recurid_as_string ()

    gchar *
    e_cal_util_component_get_recurid_as_string
                                   (ICalComponent *icalcomp);

#### Parameters

icalcomp | an ICalComponent |

#### Returns

a RECURRENCEID property as string, or `NULL`, when the `icalcomp` is not an instance. Free the returned string with `g_free()`, when no longer needed.

[transfer full][nullable]

Since: 3.34

### e_cal_util_construct_instance ()

    ICalComponent *
    e_cal_util_construct_instance (ICalComponent *icalcomp,
                                   const ICalTime *rid);

This checks that `rid` indicates a valid recurrence of `icalcomp` , and if so, generates a copy of `icalcomp` containing a RECURRENCE-ID of `rid` .

Free the returned non-NULL component with `g_object_unref()`, when no longer needed.

#### Parameters

icalcomp | A recurring ICalComponent |
rid | The RECURRENCE-ID to construct a component for |

#### Returns

the instance as a new ICalComponent, or `NULL`.

[transfer full][nullable]

### e_cal_util_remove_instances ()

    void
    e_cal_util_remove_instances (ICalComponent *icalcomp,
                                 const ICalTime *rid,
                                 ECalObjModType mod);

`e_cal_util_remove_instances` has been deprecated since version 3.38 and should not be used in newly-written code.

Use `e_cal_util_remove_instances_ex()` instead, with provided timezone resolve function.

Removes one or more instances from `icalcomp` according to `rid` and `mod` .

#### Parameters

icalcomp | A (recurring) ICalComponent |
rid | The base RECURRENCE-ID to remove |
mod | How to interpret `rid` |

### e_cal_util_split_at_instance ()

    ICalComponent *
    e_cal_util_split_at_instance (ICalComponent *icalcomp,
                                  const ICalTime *rid,
                                  const ICalTime *master_dtstart);

`e_cal_util_split_at_instance` has been deprecated since version 3.38 and should not be used in newly-written code.

Use `e_cal_util_split_at_instance_ex()` instead, with provided timezone resolve function.

Splits a recurring `icalcomp` into two at time `rid` . The returned ICalComponent is modified `icalcomp` which contains recurrences beginning at `rid` , inclusive. The instance identified by `rid` should exist. The `master_dtstart` can be a null time, then it is read from the `icalcomp` .

Use `e_cal_util_remove_instances_ex()` with E_CAL_OBJ_MOD_THIS_AND_FUTURE mode on the `icalcomp` to remove the overlapping interval from it, if needed.

Free the returned non-NULL component with `g_object_unref()`, when done with it.

#### Parameters

icalcomp | A (recurring) ICalComponent |
rid | The base RECURRENCE-ID to remove |
master_dtstart | The DTSTART of the master object. | [nullable]

#### Returns

the split `icalcomp` , or `NULL`.

[transfer full][nullable]

Since: 3.16

### e_cal_util_normalize_rrule_until_value ()

    void
    e_cal_util_normalize_rrule_until_value
                                   (ICalComponent *icalcomp,
                                    ICalTime *ttuntil,
                                    ECalRecurResolveTimezoneCb tz_cb,
                                    gpointer tz_cb_data);

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

Makes sure the `ttuntil` value matches the value type with the DTSTART value, as required by RFC 5545 section 3.3.10. Uses `tz_cb` with `tz_cb_data` to resolve time zones when needed.

#### Parameters

icalcomp | An ICalComponent |
ttuntil | An UNTIL value to validate |
tz_cb | The ECalRecurResolveTimezoneCb to call. | [closure tz_cb_data][scope call]
tz_cb_data | User data to be passed to the `tz_cb` callback. | [closure]

Since: 3.38

### e_cal_util_remove_instances_ex ()

    void
    e_cal_util_remove_instances_ex (ICalComponent *icalcomp,
                                    const ICalTime *rid,
                                    ECalObjModType mod,
                                    ECalRecurResolveTimezoneCb tz_cb,
                                    gpointer tz_cb_data);

Removes one or more instances from `icalcomp` according to `rid` and `mod` . Uses `tz_cb` with `tz_cb_data` to resolve time zones when needed.

#### Parameters

icalcomp | A (recurring) ICalComponent |
rid | The base RECURRENCE-ID to remove |
mod | How to interpret `rid` |
tz_cb | The ECalRecurResolveTimezoneCb to call. | [closure tz_cb_data][scope call]
tz_cb_data | User data to be passed to the `tz_cb` callback. | [closure]

Since: 3.38

### e_cal_util_split_at_instance_ex ()

    ICalComponent *
    e_cal_util_split_at_instance_ex (ICalComponent *icalcomp,
                                     const ICalTime *rid,
                                     const ICalTime *master_dtstart,
                                     ECalRecurResolveTimezoneCb tz_cb,
                                     gpointer tz_cb_data);

Splits a recurring `icalcomp` into two at time `rid` . The returned ICalComponent is modified `icalcomp` which contains recurrences beginning at `rid` , inclusive. The instance identified by `rid` should exist. The `master_dtstart` can be a null time, then it is read from the `icalcomp` .

Uses `tz_cb` with `tz_cb_data` to resolve time zones when needed.

Use `e_cal_util_remove_instances_ex()` with E_CAL_OBJ_MOD_THIS_AND_FUTURE mode on the `icalcomp` to remove the overlapping interval from it, if needed.

Free the returned non-NULL component with `g_object_unref()`, when done with it.

#### Parameters

icalcomp | A (recurring) ICalComponent |
rid | The base RECURRENCE-ID to remove |
master_dtstart | The DTSTART of the master object. | [nullable]
tz_cb | The ECalRecurResolveTimezoneCb to call. | [closure tz_cb_data][scope call]
tz_cb_data | User data to be passed to the `tz_cb` callback. | [closure]

#### Returns

the split `icalcomp` , or `NULL`.

[transfer full][nullable]

Since: 3.38

### e_cal_util_is_first_instance ()

    gboolean
    e_cal_util_is_first_instance (ECalComponent *comp,
                                  const ICalTime *rid,
                                  ECalRecurResolveTimezoneCb tz_cb,
                                  gpointer tz_cb_data);

Returns whether the given `rid` is the first instance of the recurrence defined in the `comp` .

Return: Whether the `rid` identifies the first instance of `comp` .

#### Parameters

comp | an ECalComponent instance |
rid | a recurrence ID |
tz_cb | The ECalRecurResolveTimezoneCb to call. | [closure tz_cb_data][scope call]
tz_cb_data | User data to be passed to the `tz_cb` callback. | [closure]

Since: 3.16

### e_cal_util_get_system_timezone_location ()

    gchar *
    e_cal_util_get_system_timezone_location
                                   (void);

Fetches system timezone localtion string.

#### Returns

system timezone location string, `NULL` on an error.

[transfer full][nullable]

Since: 2.28

### e_cal_util_get_system_timezone ()

    ICalTimezone *
    e_cal_util_get_system_timezone (void);

Fetches system timezone ICalTimezone object.

The returned pointer is part of the built-in timezones and should not be freed.

#### Returns

The ICalTimezone object of the system timezone, or `NULL` on an error.

[transfer none][nullable]

Since: 2.28

### e_cal_util_get_component_occur_times ()

    void
    e_cal_util_get_component_occur_times (ECalComponent *comp,
                                          time_t *out_start,
                                          time_t *out_end,
                                          ECalRecurResolveTimezoneCb tz_cb,
                                          gpointer tz_cb_data,
                                          const ICalTimezone *default_timezone,
                                          ICalComponentKind kind);

Find out when the component starts and stops, being careful about recurrences.

#### Parameters

comp | an ECalComponent |
out_start | Location to store the start time. | [out]
out_end | Location to store the end time. | [out]
tz_cb | The ECalRecurResolveTimezoneCb to call. | [closure tz_cb_data][scope call]
tz_cb_data | User data to be passed to the `tz_cb` callback. | [closure]
default_timezone | The default timezone |
kind | the type of component, indicated with an ICalComponentKind |

Since: 2.32

### e_cal_util_component_has_x_property ()

    gboolean
    e_cal_util_component_has_x_property (ICalComponent *icalcomp,
                                         const gchar *x_name);

Returns, whether the `icalcomp` contains X property named `x_name` . To check for standard property use `e_cal_util_component_has_property()`.

#### Parameters

icalcomp | an ICalComponent |
x_name | name of the X property |

#### Returns

whether the `icalcomp` contains X property named `x_name`

Since: 3.34

### e_cal_util_component_find_x_property ()

    ICalProperty *
    e_cal_util_component_find_x_property (ICalComponent *icalcomp,
                                          const gchar *x_name);

Searches for an X property named `x_name` within X properties of `icalcomp` and returns it. Free the non-NULL object with `g_object_unref()`, when no longer needed.

#### Parameters

icalcomp | an ICalComponent |
x_name | name of the X property |

#### Returns

the first X ICalProperty named `x_name` , or `NULL`, when none found.

[transfer full][nullable]

Since: 3.34

### e_cal_util_component_dup_x_property ()

    gchar *
    e_cal_util_component_dup_x_property (ICalComponent *icalcomp,
                                         const gchar *x_name);

Searches for an X property named `x_name` within X properties of `icalcomp` and returns its value as a newly allocated string. Free it with `g_free()`, when no longer needed.

#### Parameters

icalcomp | an ICalComponent |
x_name | name of the X property |

#### Returns

Newly allocated value of the first `x_name` X property in `icalcomp` , or `NULL`, if not found.

[nullable][transfer full]

Since: 3.34

### e_cal_util_component_set_x_property ()

    void
    e_cal_util_component_set_x_property (ICalComponent *icalcomp,
                                         const gchar *x_name,
                                         const gchar *value);

Sets a value of the first X property named `x_name` in `icalcomp` , if any such already exists, or adds a new property with this name and value. As a special case, if `value` is `NULL`, then removes the first X property named `x_name` from `icalcomp` instead.

#### Parameters

icalcomp | an ICalComponent |
x_name | name of the X property |
value | a value to set, or `NULL`. | [nullable]

Since: 3.34

### e_cal_util_component_remove_x_property ()

    gboolean
    e_cal_util_component_remove_x_property
                                   (ICalComponent *icalcomp,
                                    const gchar *x_name);

Removes the first X property named `x_name` in `icalcomp` .

#### Parameters

icalcomp | an ICalComponent |
x_name | name of the X property |

#### Returns

`TRUE`, when any such had been found and removed, `FALSE` otherwise.

Since: 3.34

### e_cal_util_component_remove_property_by_kind ()

    guint
    e_cal_util_component_remove_property_by_kind
                                   (ICalComponent *icalcomp,
                                    ICalPropertyKind kind,
                                    gboolean all);

Removes all or only the first property of kind `kind` in `icalcomp` .

#### Parameters

icalcomp | an ICalComponent |
kind | the kind of the property to remove |
all | `TRUE` to remove all, or `FALSE` to remove only the first property of the `kind` |

#### Returns

How many properties had been removed.

Since: 3.30

### e_cal_util_init_recur_task_sync ()

    gboolean
    e_cal_util_init_recur_task_sync (ICalComponent *vtodo,
                                     struct _ECalClient *cal_client,
                                     GCancellable *cancellable,
                                     GError **error);

Initializes properties of a recurring `vtodo` , like normalizing the Due date and eventually the Start date. The function does nothing when the `vtodo` is not recurring.

The function doesn't change LAST-MODIFIED neither the SEQUENCE property, it's up to the caller to do it.

Note the `cal_client` , `cancellable` and `error` is used only for timezone resolution. The function doesn't store the `vtodo` to the `cal_client` , it only updates the `vtodo` component.

#### Parameters

vtodo | a VTODO component |
cal_client | an ECalClient to which the `vtodo` belongs. | [type ECalClient]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.30

### e_cal_util_mark_task_complete_sync ()

    gboolean
    e_cal_util_mark_task_complete_sync (ICalComponent *vtodo,
                                        time_t completed_time,
                                        struct _ECalClient *cal_client,
                                        GCancellable *cancellable,
                                        GError **error);

Marks the `vtodo` as complete with eventual update of other properties. This is useful also for recurring tasks, for which it moves the `vtodo` into the next occurrence according to the recurrence rule.

When the `vtodo` is marked as completed, then the existing COMPLETED date-time is preserved if exists, otherwise it's set either to `completed_time` , or to the current time, when the `completed_time` is (time_t) -1.

The function doesn't change LAST-MODIFIED neither the SEQUENCE property, it's up to the caller to do it.

Note the `cal_client` , `cancellable` and `error` is used only for timezone resolution. The function doesn't store the `vtodo` to the `cal_client` , it only updates the `vtodo` component.

#### Parameters

vtodo | a VTODO component |
completed_time | completed time to set, or (time_t) -1 to use current time |
cal_client | an ECalClient to which the `vtodo` belongs. | [type ECalClient]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.30

### e_cal_util_operation_flags_to_conflict_resolution ()

    EConflictResolution
    e_cal_util_operation_flags_to_conflict_resolution
                                   (guint32 flags);

Decodes the EConflictResolution from the bit-or of ECalOperationFlags.

#### Parameters

flags | bit-or of ECalOperationFlags |

#### Returns

an EConflictResolution as stored in the `flags`

Since: 3.34

### e_cal_util_inline_local_attachments_sync ()

    gboolean
    e_cal_util_inline_local_attachments_sync
                                   (ICalComponent *component,
                                    GCancellable *cancellable,
                                    GError **error);

Changes all URL attachments which point to a local file in `component` to inline attachments, aka adds the file content into the `component` . It also populates FILENAME parameter on the attachment.

#### Parameters

component | an ICalComponent to work with |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

Whether succeeded.

Since: 3.40

### e_cal_util_set_alarm_acknowledged ()

    gboolean
    e_cal_util_set_alarm_acknowledged (ECalComponent *component,
                                       const gchar *auid,
                                       gint64 when);

Sets the ACKNOWLEDGED property on the `component` 's alarm with UID `auid` to the time `when` (in UTC), or to the current time, when the `when` is 0.

#### Parameters

component | an ECalComponent |
auid | an alarm UID to modify |
when | a time, in UTC, when to set the acknowledged property, or 0 for the current time |

#### Returns

Whether succeeded.

Since: 3.40

### e_cal_util_clamp_vtimezone ()

    void
    e_cal_util_clamp_vtimezone (ICalComponent *vtimezone,
                                const ICalTime *from,
                                const ICalTime *to);

Modifies the `vtimezone` to include only subcomponents influencing the passed-in time interval between `from` and `to` .

#### Parameters

vtimezone | a VTIMEZONE component to modify. | [inout]
from | an ICalTime for the minimum time |
to | until which time to clamp, or `NULL` for infinity. | [nullable]

Since: 3.40

### e_cal_util_clamp_vtimezone_by_component ()

    void
    e_cal_util_clamp_vtimezone_by_component
                                   (ICalComponent *vtimezone,
                                    ICalComponent *component);

Similar to `e_cal_util_clamp_vtimezone()`, only reads the clamp times from the `component` .

#### Parameters

vtimezone | a VTIMEZONE component to modify. | [inout]
component | an ICalComponent to read the times from |

Since: 3.40

## Types and Values

### E_CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT

    #define E_CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT		"no-alarm-repeat"

### E_CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS

    #define E_CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS		"no-audio-alarms"

### E_CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS

    #define E_CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS "no-display-alarms"

### E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS

    #define E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS		"no-email-alarms"

### E_CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS

    #define E_CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS "no-procedure-alarms"

### E_CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT

    #define E_CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT "no-task-assignment"

### E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE

    #define E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE "no-thisandfuture"

### E_CAL_STATIC_CAPABILITY_NO_THISANDPRIOR

    #define E_CAL_STATIC_CAPABILITY_NO_THISANDPRIOR		"no-thisandprior"

### E_CAL_STATIC_CAPABILITY_NO_TRANSPARENCY

    #define E_CAL_STATIC_CAPABILITY_NO_TRANSPARENCY		"no-transparency"

### E_CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE

    #define E_CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE "no-memo-start-date"

### E_CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION

    #define E_CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION "alarm-description"

Flag indicating that the backend supports alarm description

Since: 3.8

### E_CAL_STATIC_CAPABILITY_NO_ALARM_AFTER_START

    #define E_CAL_STATIC_CAPABILITY_NO_ALARM_AFTER_START "no-alarm-after-start"

Flag indicating that the backend does not support alarm after start the event

Since: 3.8

### E_CAL_STATIC_CAPABILITY_BULK_ADDS

    #define E_CAL_STATIC_CAPABILITY_BULK_ADDS		"bulk-adds"

Flag indicating that the backend supports bulk additions.

Since: 3.6

### E_CAL_STATIC_CAPABILITY_BULK_MODIFIES

    #define E_CAL_STATIC_CAPABILITY_BULK_MODIFIES		"bulk-modifies"

Flag indicating that the backend supports bulk modifications.

Since: 3.6

### E_CAL_STATIC_CAPABILITY_BULK_REMOVES

    #define E_CAL_STATIC_CAPABILITY_BULK_REMOVES		"bulk-removes"

Flag indicating that the backend supports bulk removals.

Since: 3.6

### E_CAL_STATIC_CAPABILITY_REMOVE_ONLY_THIS

    #define E_CAL_STATIC_CAPABILITY_REMOVE_ONLY_THIS "remove-only-this"

FIXME: Document me.

Since: 3.2

### E_CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY

    #define E_CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY		"one-alarm-only"

### E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND

    #define E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND "organizer-must-attend"

### E_CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS

    #define E_CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS "organizer-not-email-address"

### E_CAL_STATIC_CAPABILITY_REMOVE_ALARMS

    #define E_CAL_STATIC_CAPABILITY_REMOVE_ALARMS		"remove-alarms"

### E_CAL_STATIC_CAPABILITY_CREATE_MESSAGES

    #define E_CAL_STATIC_CAPABILITY_CREATE_MESSAGES		"create-messages"

Since: 2.26

### E_CAL_STATIC_CAPABILITY_SAVE_SCHEDULES

    #define E_CAL_STATIC_CAPABILITY_SAVE_SCHEDULES		"save-schedules"

### E_CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK

    #define E_CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK "no-conv-to-assign-task"

### E_CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR

    #define E_CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR "no-conv-to-recur"

### E_CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS

    #define E_CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS		"no-general-options"

### E_CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS

    #define E_CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS "require-send-options"

### E_CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER

    #define E_CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER "recurrences-no-master-object"

### E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT

    #define E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT "organizer-must-accept"

### E_CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED

    #define E_CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED "delegate-support"

### E_CAL_STATIC_CAPABILITY_NO_ORGANIZER

    #define E_CAL_STATIC_CAPABILITY_NO_ORGANIZER		"no-organizer"

### E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY

    #define E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY "delegate-to-many"

### E_CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING

    #define E_CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING "has-unaccepted-meeting"

### E_CAL_STATIC_CAPABILITY_REFRESH_SUPPORTED

    #define E_CAL_STATIC_CAPABILITY_REFRESH_SUPPORTED "refresh-supported"

Since: 2.30

### E_CAL_STATIC_CAPABILITY_ALL_DAY_EVENT_AS_TIME

    #define E_CAL_STATIC_CAPABILITY_ALL_DAY_EVENT_AS_TIME "all-day-event-as-time"

Let the client know that it should store All Day event times as time with a time zone, rather than as a date.

Since: 3.18

### E_CAL_STATIC_CAPABILITY_TASK_DATE_ONLY

    #define E_CAL_STATIC_CAPABILITY_TASK_DATE_ONLY		"task-date-only"

Let the client know that the Task Start date, Due date and Completed date can be entered only as dates. When the capability is not set, then these can be date and time.

Since: 3.24

### E_CAL_STATIC_CAPABILITY_TASK_CAN_RECUR

    #define E_CAL_STATIC_CAPABILITY_TASK_CAN_RECUR		"task-can-recur"

When the capability is set, the client can store and provide recurring tasks, otherwise it cannot.

Since: 3.30

### E_CAL_STATIC_CAPABILITY_TASK_NO_ALARM

    #define E_CAL_STATIC_CAPABILITY_TASK_NO_ALARM		"task-no-alarm"

When the capability is set, the client cannot store reminders on tasks, otherwise it can.

Since: 3.30

### E_CAL_STATIC_CAPABILITY_COMPONENT_COLOR

    #define E_CAL_STATIC_CAPABILITY_COMPONENT_COLOR		"component-color"

When the capability is set, the client supports storing color for individual components.

Since: 3.30

### E_CAL_STATIC_CAPABILITY_TASK_HANDLE_RECUR

    #define E_CAL_STATIC_CAPABILITY_TASK_HANDLE_RECUR "task-handle-recur"

When the capability is set, the backend handles task recurrence completion on its own. This does not imply E_CAL_STATIC_CAPABILITY_TASK_CAN_RECUR.

Since: 3.34

### E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO

    #define E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO		"simple-memo"

When the capability is set, the backend handles only simple memos, which means it stores only memo description. The summary can be changed by the backend, if needed.

Since: 3.38

### E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO_WITH_SUMMARY

    #define E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO_WITH_SUMMARY "simple-memo-with-summary"

Similar to the `E_CAL_STATIC_CAPABILITY_SIMPLE_MEMO`, except the backend stores the description and the summary separately.

Since: 3.42

### E_CAL_STATIC_CAPABILITY_TASK_ESTIMATED_DURATION

    #define E_CAL_STATIC_CAPABILITY_TASK_ESTIMATED_DURATION "task-estimated-duration"

Set, when the backend supports ESTIMATED-DURATION property for tasks.

Since: 3.44