Top | ![]() |
![]() |
![]() |
![]() |
ICalComponent *
e_cal_util_new_top_level (void
);
Creates a new VCALENDAR component. Free it with g_object_unref()
,
when no longer needed.
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.
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.
Since: 3.34
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.
a newly created ICalComponent, or NULL
,
if the string isn't a valid iCalendar string.
[transfer full][nullable]
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.
a newly created ICalComponent, or NULL
,
if the file doesn't contain a valid iCalendar object.
[transfer full][nullable]
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.
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. |
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.
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. |
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).
gint
e_cal_util_priority_from_string (const gchar *string
);
Converts a translated priority string to an iCalendar priority value.
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.
a newly allocated string with localized description of the given time in seconds.
[transfer full]
Since: 3.30
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
.
gboolean e_cal_util_property_has_parameter (ICalProperty *prop
,ICalParameterKind param_kind
);
Returns, whether the prop
has a parameter of param_kind
.
Since: 3.34
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()
.
Since: 3.34
gboolean
e_cal_util_component_is_instance (ICalComponent *icalcomp
);
Checks whether an ICalComponent is an instance of a recurring appointment.
gboolean
e_cal_util_component_has_alarms (ICalComponent *icalcomp
);
Checks whether an ICalComponent has any alarm.
gboolean
e_cal_util_component_has_organizer (ICalComponent *icalcomp
);
Checks whether an ICalComponent has an organizer.
gboolean
e_cal_util_component_has_recurrences (ICalComponent *icalcomp
);
Checks if an ICalComponent has recurrence dates or rules.
gboolean
e_cal_util_component_has_rdates (ICalComponent *icalcomp
);
Checks if an ICalComponent has recurrence dates.
gboolean
e_cal_util_component_has_rrules (ICalComponent *icalcomp
);
Checks if an ICalComponent has recurrence rules.
gboolean
e_cal_util_component_has_attendee (ICalComponent *icalcomp
);
Checks if an ICalComponent has any attendees.
gchar *
e_cal_util_component_get_recurid_as_string
(ICalComponent *icalcomp
);
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
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.
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
.
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.
icalcomp |
A (recurring) ICalComponent |
|
rid |
The base RECURRENCE-ID to remove |
|
master_dtstart |
The DTSTART of the master object. |
[nullable] |
Since: 3.16
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.
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 |
[closure] |
Since: 3.38
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.
icalcomp |
A (recurring) ICalComponent |
|
rid |
The base RECURRENCE-ID to remove |
|
mod |
How to interpret |
|
tz_cb |
The ECalRecurResolveTimezoneCb to call. |
[closure tz_cb_data][scope call] |
tz_cb_data |
User data to be passed to the |
[closure] |
Since: 3.38
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.
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 |
[closure] |
Since: 3.38
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
.
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 |
[closure] |
Since: 3.16
gchar *
e_cal_util_get_system_timezone_location
(void
);
Fetches system timezone localtion string.
Since: 2.28
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.
The ICalTimezone object of the system timezone, or NULL
on an error.
[transfer none][nullable]
Since: 2.28
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.
comp |
||
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 |
[closure] |
default_timezone |
The default timezone |
|
kind |
the type of component, indicated with an ICalComponentKind |
Since: 2.32
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()
.
Since: 3.34
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.
Since: 3.34
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.
Newly allocated value of the first x_name
X property in icalcomp
, or NULL
, if not found.
[nullable][transfer full]
Since: 3.34
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.
icalcomp |
an ICalComponent |
|
x_name |
name of the X property |
|
value |
a value to set, or |
[nullable] |
Since: 3.34
gboolean e_cal_util_component_remove_x_property (ICalComponent *icalcomp
,const gchar *x_name
);
Removes the first X property named x_name
in icalcomp
.
Since: 3.34
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
.
Since: 3.30
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.
vtodo |
a VTODO component |
|
cal_client |
an ECalClient to which the |
[type ECalClient] |
cancellable |
optional GCancellable object, or |
|
error |
Since: 3.30
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.
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 |
[type ECalClient] |
cancellable |
optional GCancellable object, or |
|
error |
Since: 3.30
EConflictResolution
e_cal_util_operation_flags_to_conflict_resolution
(guint32 flags
);
Decodes the EConflictResolution from the bit-or of ECalOperationFlags.
Since: 3.34
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.
component |
an ICalComponent to work with |
|
cancellable |
optional GCancellable object, or |
|
error |
Since: 3.40
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.
component |
||
auid |
an alarm UID to modify |
|
when |
a time, in UTC, when to set the acknowledged property, or 0 for the current time |
Since: 3.40
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
.
vtimezone |
a VTIMEZONE component to modify. |
[inout] |
from |
an ICalTime for the minimum time |
|
to |
until which time to clamp, or |
[nullable] |
Since: 3.40
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
.
vtimezone |
a VTIMEZONE component to modify. |
[inout] |
component |
an ICalComponent to read the times from |
Since: 3.40
ICalProperty * e_cal_util_component_find_property_for_locale (ICalComponent *icalcomp
,ICalPropertyKind prop_kind
,const gchar *locale
);
Searches properties of kind prop_kind
in the icalcomp
and returns
one, which is usable for the locale
. When locale
is NULL
,
the current locale is assumed. If no such property for the locale
exists either the one with no language parameter or the first
found is returned.
Free the returned non-NULL ICalProperty with g_object_unref()
,
when no longer needed.
icalcomp |
an ICalComponent |
|
prop_kind |
an ICalPropertyKind to traverse |
|
locale |
a locale identifier, or |
[nullable] |
a property of kind prop_kind
for the locale
,
NULL
if no such property is set on the comp
.
[transfer full][nullable]
Since: 3.46
#define E_CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT "no-alarm-repeat"
#define E_CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS "no-audio-alarms"
#define E_CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS "no-display-alarms"
#define E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS "no-email-alarms"
#define E_CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS "no-procedure-alarms"
#define E_CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT "no-task-assignment"
#define E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE "no-thisandfuture"
#define E_CAL_STATIC_CAPABILITY_NO_THISANDPRIOR "no-thisandprior"
#define E_CAL_STATIC_CAPABILITY_NO_TRANSPARENCY "no-transparency"
#define E_CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE "no-memo-start-date"
#define E_CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION "alarm-description"
Flag indicating that the backend supports alarm description
Since: 3.8
#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
#define E_CAL_STATIC_CAPABILITY_BULK_ADDS "bulk-adds"
Flag indicating that the backend supports bulk additions.
Since: 3.6
#define E_CAL_STATIC_CAPABILITY_BULK_MODIFIES "bulk-modifies"
Flag indicating that the backend supports bulk modifications.
Since: 3.6
#define E_CAL_STATIC_CAPABILITY_BULK_REMOVES "bulk-removes"
Flag indicating that the backend supports bulk removals.
Since: 3.6
#define E_CAL_STATIC_CAPABILITY_REMOVE_ONLY_THIS "remove-only-this"
FIXME: Document me.
Since: 3.2
#define E_CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY "one-alarm-only"
#define E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND "organizer-must-attend"
#define E_CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS "organizer-not-email-address"
#define E_CAL_STATIC_CAPABILITY_CREATE_MESSAGES "create-messages"
Since: 2.26
#define E_CAL_STATIC_CAPABILITY_SAVE_SCHEDULES "save-schedules"
#define E_CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK "no-conv-to-assign-task"
#define E_CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR "no-conv-to-recur"
#define E_CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS "no-general-options"
#define E_CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS "require-send-options"
#define E_CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER "recurrences-no-master-object"
#define E_CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT "organizer-must-accept"
#define E_CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED "delegate-support"
#define E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY "delegate-to-many"
#define E_CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING "has-unaccepted-meeting"
#define E_CAL_STATIC_CAPABILITY_REFRESH_SUPPORTED "refresh-supported"
Since: 2.30
#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
#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
#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
#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
#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
#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
#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
#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
#define E_CAL_STATIC_CAPABILITY_TASK_ESTIMATED_DURATION "task-estimated-duration"
Set, when the backend supports ESTIMATED-DURATION property for tasks.
Since: 3.44