[evolution-data-server/wip/mcrha/libical-glib] Split ECalComponent sub-structures into separate files
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/wip/mcrha/libical-glib] Split ECalComponent sub-structures into separate files
- Date: Thu, 17 Jan 2019 17:58:02 +0000 (UTC)
commit 2419cfa707ae926ebfb8fc85458fa4eef590d5d6
Author: Milan Crha <mcrha redhat com>
Date: Thu Jan 17 18:57:22 2019 +0100
Split ECalComponent sub-structures into separate files
src/calendar/libecal/CMakeLists.txt | 28 +-
.../libecal/e-cal-component-alarm-instance.c | 266 +++++++
.../libecal/e-cal-component-alarm-instance.h | 75 ++
.../libecal/e-cal-component-alarm-repeat.c | 244 +++++++
.../libecal/e-cal-component-alarm-repeat.h | 73 ++
.../libecal/e-cal-component-alarm-trigger.c | 562 +++++++++++++++
.../libecal/e-cal-component-alarm-trigger.h | 93 +++
src/calendar/libecal/e-cal-component-alarm.c | 359 ++++++++++
src/calendar/libecal/e-cal-component-alarm.h | 124 ++++
src/calendar/libecal/e-cal-component-alarms.c | 270 +++++++
src/calendar/libecal/e-cal-component-alarms.h | 70 ++
src/calendar/libecal/e-cal-component-attendee.c | 794 +++++++++++++++++++++
src/calendar/libecal/e-cal-component-attendee.h | 128 ++++
src/calendar/libecal/e-cal-component-datetime.c | 215 ++++++
src/calendar/libecal/e-cal-component-datetime.h | 64 ++
src/calendar/libecal/e-cal-component-id.c | 236 ++++++
src/calendar/libecal/e-cal-component-id.h | 58 ++
src/calendar/libecal/e-cal-component-organizer.c | 439 ++++++++++++
src/calendar/libecal/e-cal-component-organizer.h | 83 +++
src/calendar/libecal/e-cal-component-period.c | 368 ++++++++++
src/calendar/libecal/e-cal-component-period.h | 77 ++
src/calendar/libecal/e-cal-component-range.c | 235 ++++++
src/calendar/libecal/e-cal-component-range.h | 65 ++
src/calendar/libecal/e-cal-component-text.c | 175 +++++
src/calendar/libecal/e-cal-component-text.h | 55 ++
src/calendar/libecal/e-cal-component.c | 174 +----
src/calendar/libecal/e-cal-component.h | 459 +-----------
src/calendar/libecal/e-cal-enums.h | 188 +++++
src/calendar/libecal/e-cal-types.h | 73 --
src/calendar/libecal/libecal.h | 14 +-
30 files changed, 5371 insertions(+), 693 deletions(-)
---
diff --git a/src/calendar/libecal/CMakeLists.txt b/src/calendar/libecal/CMakeLists.txt
index 8386809ad..effb1e0e4 100644
--- a/src/calendar/libecal/CMakeLists.txt
+++ b/src/calendar/libecal/CMakeLists.txt
@@ -1,4 +1,4 @@
-glib_mkenums(e-cal-enumtypes e-cal-types.h E_CAL_ENUMTYPES_H)
+glib_mkenums(e-cal-enumtypes e-cal-enums.h E_CAL_ENUMS_H)
add_pkgconfig_file(libecal.pc.in libecal-${CAL_API_VERSION}.pc)
@@ -11,6 +11,18 @@ set(SOURCES
e-cal-client.c
e-cal-client-view.c
e-cal-component.c
+ e-cal-component-alarm.c
+ e-cal-component-alarm-instance.c
+ e-cal-component-alarm-repeat.c
+ e-cal-component-alarm-trigger.c
+ e-cal-component-alarms.c
+ e-cal-component-attendee.c
+ e-cal-component-datetime.c
+ e-cal-component-id.c
+ e-cal-component-organizer.c
+ e-cal-component-period.c
+ e-cal-component-range.c
+ e-cal-component-text.c
e-cal-recur.c
e-cal-time-util.c
e-cal-check-timezones.c
@@ -26,11 +38,23 @@ set(HEADERS
e-cal-client.h
e-cal-client-view.h
e-cal-component.h
+ e-cal-component-alarm.h
+ e-cal-component-alarm-instance.h
+ e-cal-component-alarm-repeat.h
+ e-cal-component-alarm-trigger.h
+ e-cal-component-alarms.h
+ e-cal-component-attendee.h
+ e-cal-component-datetime.h
+ e-cal-component-id.h
+ e-cal-component-organizer.h
+ e-cal-component-period.h
+ e-cal-component-range.h
+ e-cal-component-text.h
+ e-cal-enums.h
e-cal-recur.h
e-cal-time-util.h
e-cal-check-timezones.h
e-cal-system-timezone.h
- e-cal-types.h
e-cal-util.h
e-reminder-watcher.h
e-timezone-cache.h
diff --git a/src/calendar/libecal/e-cal-component-alarm-instance.c
b/src/calendar/libecal/e-cal-component-alarm-instance.c
new file mode 100644
index 000000000..a0265a67f
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-instance.c
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-alarm-instance
+ * @short_description: An ECalComponentAlarmInstance structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAlarmInstance structure.
+ **/
+
+#include "e-cal-component-alarm-instance.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAlarmInstance, e_cal_component_alarm_instance,
e_cal_component_alarm_instance_copy, e_cal_component_alarm_instance_free)
+
+struct _ECalComponentAlarmInstance {
+ /* UID of the alarm that instanceed */
+ gchar *uid;
+
+ /* Instance time, i.e. "5 minutes before the appointment" */
+ time_t instance_time;
+
+ /* Actual event occurrence to which this instance corresponds */
+ time_t occur_start;
+ time_t occur_end;
+};
+
+/**
+ * e_cal_component_alarm_instance_new_relative:
+ * @uid: (not nullable): UID of the alarm
+ * @instance_time: instance time, i.e. "5 minutes before the appointment"
+ * @occur_start: actual event occurrence start to which this instance corresponds
+ * @occur_end: actual event occurrence end to which this instance corresponds
+ *
+ * Creates a new #ECalComponentAlarmInstance structure, filled with the given values.
+ * Free the instance with e_cal_component_alarm_instance_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmInstance
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmInstance *
+e_cal_component_alarm_instance_new (ECalComponentAlarmInstanceKind kind,
+ const gchar *uid,
+ time_t instance_time,
+ time_t occur_start,
+ time_t occur_end)
+{
+ ECalComponentAlarmInstance *instance;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ instance = g_new0 (ECalComponentAlarmInstance, 1);
+ instance->uid = g_strdup (uid);
+ instance->instance_time = instance_time;
+ instance->occur_start = occur_start;
+ instance->occur_end = occur_end;
+
+ return instance;
+}
+
+/**
+ * e_cal_component_alarm_instance_copy:
+ * @instance: (not nullable): an #ECalComponentAlarmInstance
+ *
+ * Returns a newly allocated copy of @instance, which should be freed with
+ * e_cal_component_alarm_instance_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @instance
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmInstance *
+e_cal_component_alarm_instance_copy (const ECalComponentAlarmInstance *instance)
+{
+ g_return_val_if_fail (instance != NULL, NULL);
+
+ return e_cal_component_alarm_instance_new (instance->uid,
+ instance->instance_time,
+ instance->occur_start,
+ instance->occur_end);
+}
+
+/**
+ * e_cal_component_alarm_instance_free: (skip)
+ * @instance: (type ECalComponentAlarmInstance) (nullable): an #ECalComponentAlarmInstance to free
+ *
+ * Free @instance, previously created by e_cal_component_alarm_instance_new()
+ * or e_cal_component_alarm_instance_copy(). The function does nothing, if @instance
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_instance_free (gpointer instance)
+{
+ ECalComponentAlarmInstance *instnc = instance;
+
+ if (instnc) {
+ g_free (instnc->uid);
+ g_free (instnc);
+ }
+}
+
+/**
+ * e_cal_component_alarm_instance_get_uid:
+ * @instance: an #ECalComponentAlarmInstance
+ *
+ * Returns: alarm UID, to which this @instance corresponds
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_alarm_instance_get_uid (ECalComponentAlarmInstance *instance)
+{
+ g_return_val_if_fail (instance != NULL, NULL);
+
+ return instance->uid;
+}
+
+/**
+ * e_cal_component_alarm_instance_set_uid:
+ * @instance: an ECalComponentAlarmInstance
+ * @uid: (not nullable): alarm UID to set
+ *
+ * Set the alarm UID.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_instance_set_uid (ECalComponentAlarmInstance *instance,
+ const gchar *uid)
+{
+ g_return_if_fail (instance != NULL);
+ g_return_if_fail (uid != NULL);
+
+ if (g_strcmp0 (instance->uid, uid) != 0) {
+ g_free (instance->uid);
+ instance->uid = g_strdup (uid);
+ }
+}
+
+/**
+ * e_cal_component_alarm_instance_get_time:
+ * @instance: an #ECalComponentAlarmInstance
+ *
+ * Returns: alarm instance time, i.e. "5 minutes before the appointment"
+ *
+ * Since: 3.36
+ **/
+time_t
+e_cal_component_alarm_instance_get_ (ECalComponentAlarmInstance *instance)
+{
+ g_return_val_if_fail (instance != NULL, (time_t) 0);
+
+ return instance->instance_time;
+}
+
+/**
+ * e_cal_component_alarm_instance_set_time:
+ * @instance: an ECalComponentAlarmInstance
+ * @instance_time: instance time to set
+ *
+ * Set the instance time, i.e. "5 minutes before the appointment".
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_instance_set_time (ECalComponentAlarmInstance *instance,
+ time_t instance_time)
+{
+ g_return_if_fail (instance != NULL);
+
+ if (instance->instance_time != instance_time) {
+ instance->instance_time = instance_time;
+ }
+}
+
+/**
+ * e_cal_component_alarm_instance_get_occur_start:
+ * @instance: an #ECalComponentAlarmInstance
+ *
+ * Returns: actual event occurrence start to which this @instance corresponds
+ *
+ * Since: 3.36
+ **/
+time_t
+e_cal_component_alarm_instance_get_occur_start (ECalComponentAlarmInstance *instance)
+{
+ g_return_val_if_fail (instance != NULL, (time_t) 0);
+
+ return instance->occur_start;
+}
+
+/**
+ * e_cal_component_alarm_instance_set_occur_start:
+ * @instance: an ECalComponentAlarmInstance
+ * @occur_start: event occurence start to set
+ *
+ * Set the actual event occurrence start to which this @instance corresponds.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_instance_set_occur_start (ECalComponentAlarmInstance *instance,
+ time_t occur_start)
+{
+ g_return_if_fail (instance != NULL);
+
+ if (instance->occur_start != occur_start) {
+ instance->occur_start = occur_start;
+ }
+}
+
+/**
+ * e_cal_component_alarm_instance_get_occur_end:
+ * @instance: an #ECalComponentAlarmInstance
+ *
+ * Returns: actual event occurrence end to which this @instance corresponds
+ *
+ * Since: 3.36
+ **/
+time_t
+e_cal_component_alarm_instance_get_occur_end (ECalComponentAlarmInstance *instance)
+{
+ g_return_val_if_fail (instance != NULL, (time_t) 0);
+
+ return instance->occur_end;
+}
+
+/**
+ * e_cal_component_alarm_instance_set_occur_end:
+ * @instance: an ECalComponentAlarmInstance
+ * @occur_end: event occurence end to set
+ *
+ * Set the actual event occurrence end to which this @instance corresponds.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_instance_set_occur_end (ECalComponentAlarmInstance *instance,
+ time_t occur_end)
+{
+ g_return_if_fail (instance != NULL);
+
+ if (instance->occur_end != occur_end) {
+ instance->occur_end = occur_end;
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-alarm-instance.h
b/src/calendar/libecal/e-cal-component-alarm-instance.h
new file mode 100644
index 000000000..5f39d8506
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-instance.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ALARM_INSTANCE_H
+#define E_CAL_COMPONENT_ALARM_INSTANCE_H
+
+#include <glib.h>
+#include <time.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentAlarmInstance:
+ *
+ * Opaque structure, which represents an alarm occurrence, i.e. a instance instance.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAlarmInstance ECalComponentAlarmInstance;
+
+GType e_cal_component_alarm_instance_get_type
+ (void);
+ECalComponentAlarmInstance *
+ e_cal_component_alarm_instance_new
+ (const gchar *uid,
+ time_t instance_time,
+ time_t occur_start,
+ time_t occur_end);
+ECalComponentAlarmInstance *
+ e_cal_component_alarm_instance_copy
+ (const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarm_instance_free
+ (gpointer instance); /* ECalComponentAlarmInstance * */
+const gchar * e_cal_component_alarm_instance_get_uid
+ (const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarm_instance_set_uid
+ (ECalComponentAlarmInstance *instance,
+ const gchar *uid);
+time_t e_cal_component_alarm_instance_get_time
+ (const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarm_instance_set_time
+ (ECalComponentAlarmInstance *instance,
+ time_t instance_time);
+time_t e_cal_component_alarm_instance_get_occur_start
+ (const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarm_instance_set_occur_start
+ (ECalComponentAlarmInstance *instance,
+ time_t occur_start);
+time_t e_cal_component_alarm_instance_get_occur_end
+ (const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarm_instance_set_occur_end
+ (ECalComponentAlarmInstance *instance,
+ time_t occur_end);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ALARM_INSTANCE_H */
diff --git a/src/calendar/libecal/e-cal-component-alarm-repeat.c
b/src/calendar/libecal/e-cal-component-alarm-repeat.c
new file mode 100644
index 000000000..f8ae7a73a
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-repeat.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-alarm-repeat
+ * @short_description: An ECalComponentAlarmRepeat structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAlarmRepeat structure.
+ **/
+
+#include "e-cal-component-alarm-repeat.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAlarmRepeat, e_cal_component_alarm_repeat,
e_cal_component_alarm_repeat_copy, e_cal_component_alarm_repeat_free)
+
+struct _ECalComponentAlarmRepeat {
+ gint repetitions;
+ ICalDurationtype *interval;
+};
+
+/**
+ * e_cal_component_alarm_repeat_new:
+ * @repetitions: number of extra repetitions, zero for none
+ * @interval: (not nullable): interval between repetitions
+ *
+ * Creates a new #ECalComponentAlarmRepeat describing alarm repetitions.
+ * The returned structure should be freed with e_cal_component_alarm_repeat_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmRepeat
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmRepeat *
+e_cal_component_alarm_repeat_new (gint repetitions,
+ const ICalDurationType *interval)
+{
+ g_return_val_if_fail (I_CAL_IS_DURATIONTYPE (interval), NULL);
+
+ return e_cal_component_alarm_repeat_new_seconds (repetitions,
+ i_cal_duration_type_as_int ((ICalDurationType *) interval));
+}
+
+/**
+ * e_cal_component_alarm_repeat_new_seconds:
+ * @repetitions: number of extra repetitions, zero for none
+ * @interval_seconds: interval between repetitions, in seconds
+ *
+ * Creates a new #ECalComponentAlarmRepeat describing alarm repetitions.
+ * The returned structure should be freed with e_cal_component_alarm_repeat_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmRepeat
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmRepeat *
+e_cal_component_alarm_repeat_new_seconds (gint repetitions,
+ gint interval_seconds)
+{
+ ECalComponentAlarmRepeat *repeat;
+
+ g_return_val_if_fail (I_CAL_IS_DURATIONTYPE (interval), NULL);
+
+ repeat = g_new0 (ECalComponentAlarmRepeat, 1);
+ repeat->repetitions = repetitions;
+ repeat->interval = i_cal_duration_type_from_int (interval_seconds);
+
+ return repeat;
+}
+
+/**
+ * e_cal_component_alarm_repeat_copy:
+ * @repeat: (not nullable): an #ECalComponentAlarmRepeat to copy
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmRepeat, copy of @repeat.
+ * The returned structure should be freed with e_cal_component_alarm_repeat_free(),
+ * when no longer needed.
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmRepeat *
+e_cal_component_alarm_repeat_copy (const ECalComponentAlarmRepeat *repeat)
+{
+ g_return_val_if_fail (repeat != NULL, NULL);
+
+ return e_cal_component_alarm_repeat_new_seconds (repeat->repetitions,
+ i_cal_duration_type_as_int (repeat->interval));
+}
+
+/**
+ * e_cal_component_alarm_repeat_free: (skip)
+ * @repeat: (type ECalComponentAlarmRepeat) (nullable): an #ECalComponentAlarmRepeat to free
+ *
+ * Free the @repeat, previously allocated by e_cal_component_alarm_repeat_new(),
+ * e_cal_component_alarm_repeat_new_seconds() or e_cal_component_alarm_repeat_copy().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_repeat_free (gpointer repeat)
+{
+ ECalComponentAlarmRepeat *rpt = repeat;
+
+ if (rpt) {
+ g_clear_object (&rpt->interval);
+ g_free (rpt);
+ }
+}
+
+/**
+ * e_cal_component_alarm_repeat_get_repetitions:
+ * @repeat: an #ECalComponentAlarmRepeat
+ *
+ * Returns: the repetitions count of the @repeat
+ *
+ * Since: 3.36
+ **/
+gint
+e_cal_component_alarm_repeat_get_repetitions (const ECalComponentAlarmRepeat *repeat)
+{
+ g_return_val_if_fail (repeat != NULL, 0);
+
+ return repeat->repetitions;
+}
+
+/**
+ * e_cal_component_alarm_repeat_set_repetitions:
+ * @repeat: an #ECalComponentAlarmRepeat
+ * @repetitions: number of repetitions, zero for none
+ *
+ * Set the @repetitions count of the @repeat.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_repeat_set_repetitions (ECalComponentAlarmRepeat *repeat,
+ gint repetitions)
+{
+ g_return_if_fail (repeat != NULL);
+
+ if (repeat->repetitions != repetitions) {
+ repeat->repetitions = repetitions;
+ }
+}
+
+/**
+ * e_cal_component_alarm_repeat_get_interval:
+ * @repeat: an #ECalComponentAlarmRepeat
+ *
+ * Returns the interval between repetitions of the @repeat, as an #ICalDurationType
+ * object. This object is owned by @repeat and should not be freed. It's valid until
+ * the @repeat is not freed or its interval changed with either e_cal_component_alarm_repeat_set_interval()
+ * or e_cal_component_alarm_repeat_set_interval_seconds().
+ *
+ * Returns: (transfer none): the interval between repetitions of the @repeat
+ *
+ * Since: 3.36
+ **/
+ICalDurationType *
+e_cal_component_alarm_repeat_get_interval (const ECalComponentAlarmRepeat *repeat)
+{
+ g_return_val_if_fail (repeat != NULL, NULL);
+
+ return repeat->interval;
+}
+
+/**
+ * e_cal_component_alarm_repeat_set_interval:
+ * @repeat: an #ECalComponentAlarmRepeat
+ * @interval: (not nullable): interval between repetitions, as an #ICalDurationType
+ *
+ * Set the @interval between repetitions of the @repeat.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_repeat_set_interval (ECalComponentAlarmRepeat *repeat,
+ const ICalDurationType *interval)
+{
+ g_return_if_fail (repeat != NULL);
+ g_return_if_fail (interval != NULL);
+
+ if (repeat->interval != interval) {
+ e_cal_component_alarm_repeat_set_interval_seconds (repeat,
+ i_cal_duration_type_as_int ((ICalDurationType *) interval));
+ }
+}
+
+/**
+ * e_cal_component_alarm_repeat_get_interval_seconds:
+ * @repeat: an #ECalComponentAlarmRepeat
+ *
+ * Returns the interval between repetitions of the @repeat in seconds.
+ *
+ * Returns: (transfer none): the interval between repetitions of the @repeat
+ *
+ * Since: 3.36
+ **/
+gint
+e_cal_component_alarm_repeat_get_interval_seconds (const ECalComponentAlarmRepeat *repeat)
+{
+ g_return_val_if_fail (repeat != NULL, 0);
+
+ return i_cal_duration_type_as_int (repeat->interval);
+}
+
+/**
+ * e_cal_component_alarm_repeat_set_interval_seconds:
+ * @repeat: an #ECalComponentAlarmRepeat
+ * @interval_seconds: interval between repetitions, in seconds
+ *
+ * Set the @interval_seconds between repetitions of the @repeat.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_repeat_set_interval_seconds (ECalComponentAlarmRepeat *repeat,
+ gint interval_seconds)
+{
+ g_return_if_fail (repeat != NULL);
+
+ if (i_cal_duration_type_as_int (repeat->interval) != interval_seconds) {
+ g_clear_object (&repeat->interval);
+ repeat->interval = i_cal_duration_from_int (interval_seconds);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-alarm-repeat.h
b/src/calendar/libecal/e-cal-component-alarm-repeat.h
new file mode 100644
index 000000000..9b65f7c57
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-repeat.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ALARM_REPEAT_H
+#define E_CAL_COMPONENT_ALARM_REPEAT_H
+
+#include <glib.h>
+#include <libical-glib/libical-glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentAlarmRepeat:
+ *
+ * A structure holding whether and how an alarm repeats.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAlarmRepeat ECalComponentAlarmRepeat;
+
+GType e_cal_component_alarm_repeat_get_type
+ (void);
+ECalComponentAlarmRepeat *
+ e_cal_component_alarm_repeat_new
+ (gint repetitions,
+ const ICalDurationType *interval);
+ECalComponentAlarmRepeat *
+ e_cal_component_alarm_repeat_new_seconds
+ (gint repetitions,
+ gint interval_seconds);
+ECalComponentAlarmRepeat *
+ e_cal_component_alarm_repeat_copy
+ (const ECalComponentAlarmRepeat *repeat);
+void e_cal_component_alarm_repeat_free
+ (gpointer repeat); /* ECalComponentAlarmRepeat * */
+gint e_cal_component_alarm_repeat_get_repetitions
+ (const ECalComponentAlarmRepeat *repeat);
+void e_cal_component_alarm_repeat_set_repetitions
+ (ECalComponentAlarmRepeat *repeat,
+ gint repetitions);
+ICalDurationType *
+ e_cal_component_alarm_repeat_get_interval
+ (const ECalComponentAlarmRepeat *repeat);
+void e_cal_component_alarm_repeat_set_interval
+ (ECalComponentAlarmRepeat *repeat,
+ const ICalDurationType *interval);
+gint e_cal_component_alarm_repeat_get_interval_seconds
+ (const ECalComponentAlarmRepeat *repeat);
+void e_cal_component_alarm_repeat_set_interval_seconds
+ (ECalComponentAlarmRepeat *repeat,
+ gint interval_seconds);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ALARM_REPEAT_H */
diff --git a/src/calendar/libecal/e-cal-component-alarm-trigger.c
b/src/calendar/libecal/e-cal-component-alarm-trigger.c
new file mode 100644
index 000000000..9e4f2e069
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-trigger.c
@@ -0,0 +1,562 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-alarm-trigger
+ * @short_description: An ECalComponentAlarmTrigger structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAlarmTrigger structure.
+ **/
+
+#include "e-cal-component-alarm-trigger.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAlarmTrigger, e_cal_component_alarm_trigger,
e_cal_component_alarm_trigger_copy, e_cal_component_alarm_trigger_free)
+
+struct _ECalComponentAlarmTrigger {
+ ECalComponentAlarmTriggerKind kind;
+
+ /* Only one of the below can be set, depending on the 'kind' */
+ ICalDurationType *rel_duration;
+ ICalTimetype *abs_time;
+};
+
+/**
+ * e_cal_component_alarm_trigger_new_relative:
+ * @kind: an #ECalComponentAlarmTriggerKind, any but the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE
+ * @duration: (not nullable): the duration relative to @kind, as an #ICalDurationType
+ *
+ * Creates a new #ECalComponentAlarmTrigger structure, set with the given @kind
+ * and @duration. The @kind can be any but the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE.
+ * To create an absolute trigger use e_cal_component_alarm_trigger_new_absolute().
+ * Free the trigger with e_cal_component_alarm_trigger_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmTrigger
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmTrigger *
+e_cal_component_alarm_trigger_new_relative (ECalComponentAlarmTriggerKind kind,
+ const ICalDurationType *duration)
+{
+ ECalComponentAlarmTrigger *trigger;
+
+ g_return_val_if_fail (kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE, NULL);
+ g_return_val_if_fail (I_CAL_IS_DURATION_TYPE (duration), NULL);
+
+ trigger = g_new0 (ECalComponentAlarmTrigger, 1);
+
+ e_cal_component_alarm_trigger_set_relative (trigger, kind, duration);
+
+ return trigger;
+}
+
+/**
+ * e_cal_component_alarm_trigger_new_absolute:
+ * @absolute_time: (not nullable): the absolute time when to trigger the alarm, as an #ICalTimetype
+ *
+ * Creates a new #ECalComponentAlarmTrigger structure, set with
+ * the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE kind and the @absolute_time as
+ * the time of the trigger.
+ * To create a relative trigger use e_cal_component_alarm_trigger_new_relative().
+ * Free the trigger with e_cal_component_alarm_trigger_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarmTrigger
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmTrigger *
+e_cal_component_alarm_trigger_new_absolute (const ICalTimetype *absolute_time)
+{
+ ECalComponentAlarmTrigger *trigger;
+
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (absolute_time), NULL);
+
+ trigger = g_new0 (ECalComponentAlarmTrigger, 1);
+
+ e_cal_component_alarm_trigger_set_absolute (trigger, absolute_time);
+
+ return trigger;
+}
+
+/**
+ * e_cal_component_alarm_trigger_new_from_property:
+ * @property: an #ICalProperty of kind %I_CAL_TRIGGER_PROPERTY
+ *
+ * Creates a new #ECalComponentAlarmTrigger, filled with values from @property,
+ * which should be of kind %I_CAL_TRIGGER_PROPERTY. The function returns
+ * %NULL when it is not of the expected kind. Free the structure
+ * with e_cal_component_alarm_trigger_free(), when no longer needed.
+ *
+ * Returns: (transfer full) (nullable): a newly allocated #ECalComponentAlarmTrigger
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmTrigger *
+e_cal_component_alarm_trigger_new_from_property (const ICalProperty *property)
+{
+ ECalComponentAlarmTrigger *trigger;
+
+ g_return_val_if_fail (I_CAL_IS_PROPERTY (property), NULL);
+
+ if (i_cal_property_isa ((ICalProperty *) property) != I_CAL_TRIGGER_PROPERTY)
+ return NULL;
+
+ trigger = e_cal_component_alarm_trigger_new ();
+
+ e_cal_component_alarm_trigger_set_from_property (trigger, property);
+
+ return trigger;
+}
+
+/**
+ * e_cal_component_alarm_trigger_copy:
+ * @trigger: (not nullable): an #ECalComponentAlarmTrigger
+ *
+ * Returns a newly allocated copy of @trigger, which should be freed with
+ * e_cal_component_alarm_trigger_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @trigger
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmTrigger *
+e_cal_component_alarm_trigger_copy (const ECalComponentAlarmTrigger *trigger)
+{
+ g_return_val_if_fail (trigger != NULL, NULL);
+
+ if (trigger->kind == E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE)
+ return e_cal_component_alarm_trigger_new_absolute (trigger->abs_time);
+
+ return e_cal_component_alarm_trigger_new_relative (trigger->kind, trigger->rel_duration);
+}
+
+/**
+ * e_cal_component_alarm_trigger_free: (skip)
+ * @trigger: (type ECalComponentAlarmTrigger) (nullable): an #ECalComponentAlarmTrigger to free
+ *
+ * Free @trigger, previously created by e_cal_component_alarm_trigger_new_relative(),
+ * e_cal_component_alarm_trigger_new_absolute(), e_cal_component_alarm_trigger_new_from_property()
+ * or e_cal_component_alarm_trigger_copy(). The function does nothing, if @trigger
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_free (gpointer trigger)
+{
+ ECalComponentAlarmTrigger *trg = trigger;
+
+ if (trg) {
+ g_clear_object (&trg->rel_duration);
+ g_clear_object (&trg->abs_time);
+ g_free (trg);
+ }
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_from_property:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @property: an #ICalProperty
+ *
+ * Fill the @trigger structure with the information from
+ * the @property, which should be of %I_CAL_TRIGGER_PROPERTY kind.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_from_property (ECalComponentAlarmTrigger *trigger,
+ const ICalProperty *property)
+{
+ ICalProperty *prop = (ICalProperty *) property;
+ ICalTriggerType *trgtype;
+ gboolean relative;
+
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (prop) == I_CAL_TRIGGER_PROPERTY);
+
+ g_clear_object (&trigger->rel_duration);
+ g_clear_object (&trigger->abs_time);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_VALUE_PARAMETER);
+ if (param) {
+ switch (i_cal_parameter_get_value (param)) {
+ case I_CAL_VALUE_DURATION:
+ relative = TRUE;
+ break;
+
+ case I_CAL_VALUE_DATETIME:
+ relative = FALSE;
+ break;
+
+ default:
+ relative = TRUE;
+ break;
+ }
+
+ g_clear_object (¶m);
+ } else {
+ relative = TRUE;
+ }
+
+ trgtype = i_cal_property_get_trigger (prop);
+
+ if (relative) {
+ ECalComponentAlarmTriggerKind kind;
+ ICalDurationType *duration;
+ ICalParameter *param;
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_RELATED_PARAMETER);
+ if (param) {
+ switch (i_cal_parameter_get_related (param)) {
+ case I_CAL_RELATED_START:
+ kind = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
+ break;
+
+ case ICAL_RELATED_END:
+ kind = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END;
+ break;
+
+ default:
+ kind = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_NONE;
+ break;
+ }
+ } else {
+ kind = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
+ }
+
+ duration = i_cal_trigger_type_get_duration (trgtype);
+
+ e_cal_component_alarm_trigger_set_relative (trigger, kind, duration);
+
+ g_clear_object (&duration);
+ g_clear_object (¶m);
+ } else {
+ ICalTimetype *abs_time;
+
+ abs_time = i_cal_trigger_type_get_time (trgtype);
+ e_cal_component_alarm_trigger_set_absolute (trigger, abs_time);
+ g_clear_object (&abs_time);
+ }
+
+ g_clear_object (&trgtype);
+}
+
+/**
+ * e_cal_component_alarm_trigger_get_as_property:
+ * @trigger: an #ECalComponentAlarmTrigger
+ *
+ * Converts information stored in @trigger into an #ICalProperty
+ * of %I_CAL_TRIGGER_PROPERTY kind. The caller is responsible to free
+ * the returned object with g_object_unref(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly created #ICalProperty, containing
+ * information from the @trigger.
+ *
+ * Since: 3.36
+ **/
+ICalProperty *
+e_cal_component_alarm_trigger_get_as_property (const ECalComponentAlarmTrigger *trigger)
+{
+ ICalProperty *prop;
+
+ g_return_val_if_fail (trigger != NULL, NULL);
+
+ prop = i_cal_property_new (I_CAL_TRIGGER_PROPERTY);
+ g_return_val_if_fail (prop != NULL, NULL);
+
+ e_cal_component_alarm_trigger_fill_property (trigger, prop);
+
+ return prop;
+}
+
+/**
+ * e_cal_component_alarm_trigger_fill_property:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @property: (inout) (not nullable): an #ICalProperty
+ *
+ * Fill @property with information from @trigger. The @property
+ * should be of kind %I_CAL_TRIGGER_PROPERTY.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_fill_property (const ECalComponentAlarmTrigger *trigger,
+ ICalProperty *property)
+{
+ ICalParameter *param;
+ ICalParameterValue value_type;
+ ICalParameterRelated related;
+ ICalTriggerType *trgtype;
+
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (property) == I_CAL_TRIGGER_PROPERTY);
+
+ g_return_if_fail (alarm != NULL);
+ g_return_if_fail (trigger.type != E_CAL_COMPONENT_ALARM_TRIGGER_NONE);
+ g_return_if_fail (alarm->icalcomp != NULL);
+
+ related = I_CAL_RELATED_START;
+ trgtype = i_cal_trigger_type_from_int (0);
+
+ switch (trigger->kind) {
+ case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START:
+ i_cal_trigger_type_set_duration (trgtype, trigger->duration);
+ value_type = I_CAL_VALUE_DURATION;
+ related = I_CAL_RELATED_START;
+ break;
+
+ case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END:
+ i_cal_trigger_type_set_duration (trgtype, trigger->duration);
+ value_type = I_CAL_VALUE_DURATION;
+ related = I_CAL_RELATED_END;
+ break;
+
+ case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE:
+ i_cal_trigger_type_set_time (trgtype, trigger->abs_time);
+ value_type = I_CAL_VALUE_DATETIME;
+ break;
+
+ default:
+ g_return_if_reached ();
+ }
+
+ i_cal_property_set_trigger (prop, trgtype);
+
+ param = icalproperty_get_first_parameter (prop, I_CAL_VALUE_PARAMETER);
+ if (param) {
+ i_cal_parameter_set_value (param, value_type);
+ } else {
+ param = i_cal_parameter_new_value (value_type);
+ i_cal_property_set_parameter (prop, param);
+ }
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_RELATED_PARAMETER);
+ if (trigger->kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE) {
+ if (param) {
+ i_cal_parameter_set_related (param, related);
+ } else {
+ param = i_cal_parameter_new_related (related);
+ i_cal_property_add_parameter (prop, param);
+ }
+ } else if (param) {
+ i_cal_property_remove_parameter (prop, param);
+ }
+ g_clear_object (¶m);
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_relative:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @kind: an #ECalComponentAlarmTriggerKind, any but the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE
+ * @duration: (not nullable): the duration relative to @kind, as an #ICalDurationType
+ *
+ * Set the @trigegr with the given @kind and @duration. The @kind can be any but
+ * the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE.
+ * To set an absolute trigger use e_cal_component_alarm_trigger_set_absolute().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_relative (ECalComponentAlarmTrigger *trigger,
+ ECalComponentAlarmTriggerKind kind,
+ const ICalDurationType *duration)
+{
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE);
+ g_return_if_fail (I_CAL_IS_DURATION_TYPE (duration));
+
+ g_clear_object (&trigger->rel_duration);
+ g_clear_object (&trigger->abs_time);
+
+ trigger->kind = kind;
+ trigger->rel_duration = i_cal_duration_type_from_int (
+ i_cal_duration_type_as_int ((ICalDurationType *) duration));
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_absolute:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @absolute_time: (not nullable): the absolute time when to trigger the alarm, as an #ICalTimetype
+ *
+ * Set the @trigegr with the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE kind and
+ * the @absolute_time as the time of the trigger.
+ * To set a relative trigger use e_cal_component_alarm_trigger_set_relative().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_absolute (ECalComponentAlarmTrigger *trigger,
+ const ICalTimetype *absolute_time)
+{
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (absolute_time));
+
+ g_clear_object (&trigger->rel_duration);
+ g_clear_object (&trigger->abs_time);
+
+ trigger->kind = E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE;
+ trigger->absolute_time = i_cal_timetype_new_clone (absolute_time);
+}
+
+/**
+ * e_cal_component_alarm_trigger_get_kind:
+ * @trigger: an #ECalComponentAlarmTrigger
+ *
+ * Returns: the @trigger kind, one of #ECalComponentAlarmTriggerKind
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarmTriggerKind
+e_cal_component_alarm_trigger_get_kind (ECalComponentAlarmTrigger *trigger)
+{
+ g_return_val_if_fail (trigger != NULL, E_CAL_COMPONENT_ALARM_TRIGGER_NONE);
+
+ return trigger->kind;
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_kind:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @kind: the kind to set, one of #ECalComponentAlarmTriggerKind
+ *
+ * Set the @trigger kind to @kind. This works only for other than
+ * the %E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE. To change the kind
+ * from absolute to relative, or vice versa, use either
+ * e_cal_component_alarm_trigger_set_relative() or
+ * e_cal_component_alarm_trigger_set_absolute().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_kind (ECalComponentAlarmTrigger *trigger,
+ ECalComponentAlarmTriggerKind kind)
+{
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (trigger->kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE);
+ g_return_if_fail (kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE);
+
+ if (trigger->kind != kind) {
+ trigger->kind = kind;
+ }
+}
+
+/**
+ * e_cal_component_alarm_trigger_get_duration:
+ * @trigger: an #ECalComponentAlarmTrigger
+ *
+ * Returns the @trigger duration for a relative @trigger, or %NULL, when
+ * the @trigger is an absolute trigger.
+ *
+ * Returns: (transfer none) (nullable): the @trigger duration, as an #ICalDurationType, or %NULL
+ *
+ * Since: 3.36
+ **/
+ICalDurationType *
+e_cal_component_alarm_trigger_get_duration (const ECalComponentAlarmTrigger *trigger)
+{
+ g_return_val_if_fail (trigger != NULL, NULL);
+
+ if (trigger->kind == E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE)
+ return NULL;
+
+ return trigger->rel_duration;
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_duration:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @duration: duration for a relative trigger, as an #ICalDurationType
+ *
+ * Sets the @trigger duration for a relative trigger. The function does nothing, when
+ * the @trigger is an absolute trigger. The object is owned by @trigger and it's
+ * valid until the @trigger is freed or its relative duration changed.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_duration (ECalComponentAlarmTrigger *trigger,
+ const ICalDurationType *duration)
+{
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (I_CAL_IS_DURATION_TYPE (duration));
+
+ if (trigger->kind == E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE)
+ return;
+
+ if (trigger->rel_duration != duration &&
+ i_cal_duration_type_as_int (trigger->rel_duration) != i_cal_duration_type_as_int
((ICalDurationType *) duration)) {
+ g_clear_object (&trigger->rel_duration);
+ trigger->rel_duration = i_cal_duration_type_from_int (
+ i_cal_duration_type_as_int ((ICalDurationType *) duration));
+ }
+}
+
+/**
+ * e_cal_component_alarm_trigger_get_absolute_time:
+ * @trigger: an #ECalComponentAlarmTrigger
+ *
+ * Returns the @trigger absolute time for an absolute trigger, or %NULL, when
+ * the @trigger is a relative trigger. The object is owned by @trigger and it's
+ * valid until the @trigger is freed or its absolute time changed.
+ *
+ * Returns: (transfer none) (nullable): the @trigger absolute time, as an #ICalTimetype, or %NULL
+ *
+ * Since: 3.36
+ **/
+ICalTimetype *
+e_cal_component_alarm_trigger_get_absolute_time (const ECalComponentAlarmTrigger *trigger)
+{
+ g_return_val_if_fail (trigger != NULL, NULL);
+
+ if (trigger->kind != E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE)
+ return NULL;
+
+ return trigger->abs_time;
+}
+
+/**
+ * e_cal_component_alarm_trigger_set_absolute_time:
+ * @trigger: an #ECalComponentAlarmTrigger
+ * @absolute_time: absolute time for an absolute trigger, as an #ICalTimetype
+ *
+ * Sets the @trigger absolute time for an absolute trigger. The function does nothing, when
+ * the @trigger is a relative trigger.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_trigger_set_absolute_time (ECalComponentAlarmTrigger *trigger,
+ const ICalTimetype *absolute_time)
+{
+ g_return_if_fail (trigger != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (absolute_time));
+
+ if (trigger->kind == E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE)
+ return;
+
+ if (trigger->abs_time != absolute_time) {
+ g_clear_object (&trigger->abs_time);
+ trigger->abs_time = i_cal_timetype_clone (absolute_time);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-alarm-trigger.h
b/src/calendar/libecal/e-cal-component-alarm-trigger.h
new file mode 100644
index 000000000..1552006e9
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm-trigger.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ALARM_TRIGGER_H
+#define E_CAL_COMPONENT_ALARM_TRIGGER_H
+
+#include <glib.h>
+#inlcude <libical-glib/libical-glib.h>
+
+#include <libecal/e-cal-enums.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentAlarmTrigger:
+ *
+ * Opaque structure, which represents when an alarm is supposed to be triggered.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAlarmTrigger ECalComponentAlarmTrigger;
+
+GType e_cal_component_alarm_trigger_get_type
+ (void);
+ECalComponentAlarmTrigger *
+ e_cal_component_alarm_trigger_new_relative
+ (ECalComponentAlarmTriggerKind kind,
+ const ICalDurationType *duration);
+ECalComponentAlarmTrigger *
+ e_cal_component_alarm_trigger_new_absolute
+ (const ICalTimetype *absolute_time);
+ECalComponentAlarmTrigger *
+ e_cal_component_alarm_trigger_new_from_property
+ (const ICalProperty *property);
+ECalComponentAlarmTrigger *
+ e_cal_component_alarm_trigger_copy
+ (const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_trigger_free
+ (gpointer trigger); /* ECalComponentAlarmTrigger * */
+void e_cal_component_alarm_trigger_set_from_property
+ (ECalComponentAlarmTrigger *trigger,
+ const ICalProperty *property);
+ICalProperty * e_cal_component_alarm_trigger_get_as_property
+ (const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_trigger_fill_property
+ (const ECalComponentAlarmTrigger *trigger,
+ ICalProperty *property);
+void e_cal_component_alarm_trigger_set_relative
+ (ECalComponentAlarmTrigger *trigger,
+ ECalComponentAlarmTriggerKind kind,
+ const ICalDurationType *duration);
+void e_cal_component_alarm_trigger_set_absolute
+ (ECalComponentAlarmTrigger *trigger,
+ const ICalTimetype *absolute_time);
+ECalComponentAlarmTriggerKind
+ e_cal_component_alarm_trigger_get_kind
+ (const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_trigger_set_kind
+ (ECalComponentAlarmTrigger *trigger,
+ ECalComponentAlarmTriggerKind kind);
+ICalDurationType *
+ e_cal_component_alarm_trigger_get_duration
+ (const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_trigger_set_duration
+ (ECalComponentAlarmTrigger *trigger,
+ const ICalDurationType *duration);
+ICalTimetype * e_cal_component_alarm_trigger_get_absolute_time
+ (const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_trigger_set_absolute_time
+ (ECalComponentAlarmTrigger *trigger,
+ const ICalTimetype *absolute_time);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ALARM_TRIGGER_H */
diff --git a/src/calendar/libecal/e-cal-component-alarm.c b/src/calendar/libecal/e-cal-component-alarm.c
new file mode 100644
index 000000000..c923445df
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm.c
@@ -0,0 +1,359 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-alarm
+ * @short_description: An ECalComponentAlarm structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAlarm structure.
+ **/
+
+#include <libedataserver/libedataserver.h>
+
+#include "e-cal-component-alarm-repeat.h"
+#include "e-cal-component-alarm-trigger.h"
+#include "e-cal-component-attendee.h"
+#include "e-cal-component-text.h"
+#include "e-cal-enums.h"
+
+#include "e-cal-component-alarm.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAlarm, e_cal_component_alarm, e_cal_component_alarm_copy,
e_cal_component_alarm_free)
+
+struct _ECalComponentAlarm {
+ gchar *uid;
+ ECalComponentAlarmAction action;
+ ECalComponentText *description;
+ ECalComponentAlarmRepeat *repeat;
+ ECalComponentAlarmTrigger *trigger;
+ GSList *attendees; /* ECalComponentAttendee * */
+ GSList *attachments; /* ICalAttach * */
+};
+
+/**
+ * e_cal_component_alarm_new:
+ *
+ * Creates a new empty #ECalComponentAlarm structure. Free it
+ * with e_cal_component_alarm_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarm
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarm *
+e_cal_component_alarm_new (void)
+{
+ ECalComponentAlarm *alarm;
+
+ alarm = g_new0 (ECalComponentAlarm, 1);
+ alarm->uid = e_util_generate_uid ();
+ alarm->action = E_CAL_COMPONENT_ALARM_UNKNOWN;
+
+ return alarm;
+}
+
+/**
+ * e_cal_component_alarm_new_from_component:
+ * @component: an #ICalComponent of kind %I_CAL_VALARM_COMPONENT
+ *
+ * Creates a new #ECalComponentAlarm, filled with values from @component,
+ * which should be of kind %I_CAL_VALARM_COMPONENT. The function returns
+ * %NULL when it is not of the expected kind. Free the structure
+ * with e_cal_component_alarm_free(), when no longer needed.
+ *
+ * Returns: (transfer full) (nullable): a newly allocated #ECalComponentAlarm
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarm *
+e_cal_component_alarm_new_from_component (const ICalComponent *component)
+{
+ ECalComponentAlarm *alarm;
+
+ g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL);
+
+ if (i_cal_component_isa ((ICalComponent *) component) != I_CAL_VALARM_COMPONENT)
+ return NULL;
+
+ alarm = e_cal_component_alarm_new ();
+
+ e_cal_component_alarm_set_from_component (alarm, component);
+
+ return alarm;
+}
+
+/**
+ * e_cal_component_alarm_copy:
+ * @alarm: (not nullable): an #ECalComponentAlarm
+ *
+ * Returns a newly allocated copy of @alarm, which should be freed with
+ * e_cal_component_alarm_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @alarm
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarm *
+e_cal_component_alarm_copy (const ECalComponentAlarm *alarm)
+{
+ ECalComponentAlarm *alrm;
+
+ g_return_val_if_fail (alarm != NULL, NULL);
+
+ alrm = e_cal_component_alarm_new ();
+
+ g_free (alrm->uid);
+ alrm->uid = g_strdup (alarm->uid);
+ alrm->action = alarm->action;
+
+ if (alarm->description)
+ alrm->description = e_cal_component_text_copy (alarm->description);
+
+ if (alarm->repeat)
+ alrm->repeat = e_cal_component_alarm_repeat_copy (alarm->repeat);
+
+ if (alarm->trigger)
+ alrm->trigger = e_cal_component_alarm_trigger_copy (alarm->trigger);
+
+ if (alarm->attendees) {
+ GSList *link;
+
+ for (link = alarm->attendees; link; link = g_slist_next (link)) {
+ ECalComponentAttendee *attendee = link->data;
+
+ if (!attendee)
+ continue;
+
+ alrm->attendees = g_slist_prepend (alrm->attendees, e_cal_component_attendee_copy
(attendee));
+ }
+
+ alrm->attendees = g_slist_reverse (alrm->attendees);
+ }
+
+ if (alarm->attachments) {
+ GSList *link;
+
+ for (link = alarm->attachments; link; link = g_slist_next (link)) {
+ ICalAttach *src_attach = link->data, *attach = NULL;
+
+ if (!src_attach)
+ continue;
+
+ if (i_cal_attach_get_is_url (src_attach)) {
+ const gchar *url;
+
+ url = i_cal_attach_get_url (src_attach);
+ if (url)
+ attach = i_cal_attach_new_from_url (url);
+ } else {
+ const guchar *data;
+
+ data = i_cal_attach_get_data (src_attach);
+ if (data)
+ attach = i_cal_attach_new_from_data (data, NULL, NULL);
+ }
+
+ if (attach)
+ alrm->attachments = g_slist_prepend (alrm->attachments, attach);
+ }
+
+ alrm->attachments = g_slist_reverse (alrm->attachments);
+ }
+
+ return alrm;
+}
+
+/**
+ * e_cal_component_alarm_free: (skip)
+ * @alarm: (type ECalComponentAlarm) (nullable): an #ECalComponentAlarm to free
+ *
+ * Free @alarm, previously created by e_cal_component_alarm_new(),
+ * e_cal_component_alarm_new_from_component()
+ * or e_cal_component_alarm_copy(). The function does nothing, if @alarm
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_free (gpointer alarm)
+{
+ ECalComponentAlarm *alrm = alarm;
+
+ if (alrm) {
+ g_free (alrm->uid);
+ e_cal_component_text_free (alrm->description);
+ e_cal_component_alarm_repeat_free (alrm->repeat);
+ e_cal_component_alarm_trigger_free (alrm->trigger);
+ g_slist_free_full (alrm->attendees, e_cal_component_attendee_free);
+ g_slist_free_full (alrm->attachments, g_object_unref);
+ g_free (alrm);
+ }
+}
+
+/**
+ * e_cal_component_alarm_set_from_component:
+ * @alarm: an #ECalComponentAlarm
+ * @component: an #ICalComponent
+ *
+ * Fill the @alarm structure with the information from
+ * the @component, which should be of %I_CAL_VALARM_COMPONENT kind.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarm_set_from_component (ECalComponentAlarm *alarm,
+ const ICalComponent *component)
+{
+ ICalComponent *comp = (ICalComponent *) component;
+ ICalDurationType *duration = NULL;
+ ICalProperty *prop, *repeat = NULL;
+
+ g_return_if_fail (alarm != NULL);
+ g_return_if_fail (I_CAL_IS_COMPONENT (component));
+ g_return_if_fail (i_cal_component_isa ((ICalComponent *) component) == I_CAL_VALARM_COMPONENT);
+
+ g_free (alarm->uid);
+ e_cal_component_text_free (alarm->description);
+ e_cal_component_alarm_repeat_free (alarm->repeat);
+ e_cal_component_alarm_trigger_free (alarm->trigger);
+ g_slist_free_full (alarm->attendees, e_cal_component_attendee_free);
+ g_slist_free_full (alarm->attachments, g_object_unref);
+
+ alarm->uid = NULL;
+ alarm->action = E_CAL_COMPONENT_ALARM_NONE;
+ alarm->description = NULL;
+ alarm->repeat = NULL;
+ alarm->trigger = NULL;
+ alarm->attendees = NULL;
+ alarm->attachments = NULL;
+
+ for (prop = i_cal_component_get_first_property (comp, I_CAL_ANY_PROPERTY);
+ prop;
+ prop = i_cal_component_get_next_property (comp, I_CAL_ANY_PROPERTY)) {
+ ECalComponentAttendee *attendee;
+ ECalComponentText *text;
+ ICalAttach *attach;
+ const gchar *xname;
+
+ switch (i_cal_property_isa (prop)) {
+ case I_CAL_ACTION_PROPERTY:
+ switch (i_cal_property_get_action (prop)) {
+ case I_CAL_ACTION_AUDIO:
+ alarm->action = E_CAL_COMPONENT_ALARM_AUDIO;
+ break;
+
+ case I_CAL_ACTION_DISPLAY:
+ alarm->action = E_CAL_COMPONENT_ALARM_DISPLAY;
+ break;
+
+ case I_CAL_ACTION_EMAIL:
+ alarm->action = E_CAL_COMPONENT_ALARM_EMAIL;
+ break;
+
+ case I_CAL_ACTION_PROCEDURE:
+ alarm->action = E_CAL_COMPONENT_ALARM_PROCEDURE;
+ break;
+
+ case I_CAL_ACTION_NONE:
+ alarm->action = E_CAL_COMPONENT_ALARM_NONE;
+ break;
+
+ default:
+ alarm->action = E_CAL_COMPONENT_ALARM_UNKNOWN;
+ break;
+ }
+ break;
+
+ case I_CAL_ATTACH_PROPERTY:
+ attach = i_cal_property_get_attach (prop);
+ if (attach)
+ alarm->attachments = g_slist_prepend (alarm->attachments, attach);
+ break;
+
+ case I_CAL_DESCRIPTION_PROPERTY:
+ ICalParameter *param;
+
+ if (i_cal_property_get_description (prop)) {
+ param = i_cal_property_get_first_parameter (prop, I_CAL_ALTREP_PARAMETER);
+ alarm->description = e_cal_component_text_new (i_cal_property_get_description
(prop),
+ param ? i_cal_property_get_altrep (param) : NULL);
+ }
+ break;
+
+ case I_CAL_DURATION_PROPERTY:
+ g_clear_object (&duration);
+ duration = i_cal_property_get_duration (prop);
+ break;
+
+ case I_CAL_REPEAT_PROPERTY:
+ g_clear_object (&repeat);
+ repeat = g_object_ref (prop);
+ break;
+
+ case I_CAL_TRIGGER_PROPERTY:
+ alarm->trigger = e_cal_component_alarm_trigger_new_from_property (prop);
+ break;
+
+ case I_CAL_ATTENDEE_PROPERTY:
+ attendee = e_cal_component_attendee_new_from_property (prop);
+ if (attendee)
+ alarm->attendees = g_slist_prepend (alarm->attendees, attendee);
+ break;
+
+ case I_CAL_X_PROPERTY:
+ xname = i_cal_property_get_x_name (prop);
+ if (g_strcmp0 (xname, E_CAL_EVOLUTION_ALARM_UID_PROPERTY) == 0) {
+ g_free (alarm->uid);
+ alarm->uid = g_strdup (i_cal_property_get_x (prop));
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ g_object_unref (prop);
+ }
+
+ alarm->attendees = g_slist_reverse (alarm->attendees);
+ alarm->attachments = g_slist_reverse (alarm->attachments);
+
+ if (duration && repeat) {
+ alarm->repeat = e_cal_component_alarm_repeat_new (
+ i_cal_property_get_repeat (repeat),
+ duration);
+ }
+
+ g_clear_object (&duration);
+ g_clear_object (&repeat);
+}
+
+ICalComponent *
+e_cal_component_alarm_get_as_component (ECalComponentAlarm *alarm)
+{
+ xxxx
+}
+
+void
+e_cal_component_alarm_fill_component (const ECalComponentAlarm *alarm,
+ ICalComponent *component)
+{
+}
diff --git a/src/calendar/libecal/e-cal-component-alarm.h b/src/calendar/libecal/e-cal-component-alarm.h
new file mode 100644
index 000000000..8d6ea6112
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarm.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ALARM_H
+#define E_CAL_COMPONENT_ALARM_H
+
+#include <glib.h>
+#include <libical-glib/libical-glib.h>
+
+#include <libecal/e-cal-component-alarm-repeat.h>
+#include <libecal/e-cal-component-alarm-trigger.h>
+#include <libecal/e-cal-component-attendee.h>
+#include <libecal/e-cal-component-text.h>
+#include <libecal/e-cal-enums.h>
+
+/**
+ * E_CAL_EVOLUTION_ALARM_UID_PROPERTY:
+ *
+ * Extension property for alarm components so that we can reference them by UID.
+ *
+ * Since: 3.36
+ **/
+#define E_CAL_EVOLUTION_ALARM_UID_PROPERTY "X-EVOLUTION-ALARM-UID"
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentAlarm:
+ *
+ * Opaque structure, which represents alarm subcomponents.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAlarm ECalComponentAlarm;
+
+GType e_cal_component_alarm_get_type (void);
+ECalComponentAlarm *
+ e_cal_component_alarm_new (void);
+ECalComponentAlarm *
+ e_cal_component_alarm_new_from_component
+ (const ICalComponent *component);
+ECalComponentAlarm *
+ e_cal_component_alarm_copy (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_free (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_from_component
+ (ECalComponentAlarm *alarm,
+ const ICalComponent *component);
+ICalComponent * e_cal_component_alarm_get_as_component
+ (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_fill_component
+ (const ECalComponentAlarm *alarm,
+ ICalComponent *component);
+const gchar * e_cal_component_alarm_get_uid (ECalComponentAlarm *alarm);
+ECalComponentAlarmAction
+ e_cal_component_alarm_get_action(ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_action(ECalComponentAlarm *alarm,
+ ECalComponentAlarmAction action);
+ECalComponentText *
+ e_cal_component_alarm_get_description
+ (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_description
+ (ECalComponentAlarm *alarm,
+ const ECalComponentText *description);
+void e_cal_component_alarm_take_description
+ (ECalComponentAlarm *alarm,
+ ECalComponentText *description);
+ECalComponentAlarmRepeat *
+ e_cal_component_alarm_get_repeat(ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_repeat(ECalComponentAlarm *alarm,
+ const ECalComponentAlarmRepeat *repeat);
+void e_cal_component_alarm_take_repeat
+ (ECalComponentAlarm *alarm,
+ ECalComponentAlarmRepeat *repeat);
+ECalComponentAlarmTrigger *
+ e_cal_component_alarm_get_trigger
+ (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_trigger
+ (ECalComponentAlarm *alarm,
+ const ECalComponentAlarmTrigger *trigger);
+void e_cal_component_alarm_take_trigger
+ (ECalComponentAlarm *alarm,
+ ECalComponentAlarmTrigger *trigger);
+gboolean e_cal_component_alarm_has_attendees
+ (ECalComponentAlarm *alarm);
+GSList * e_cal_component_alarm_get_attendees /* ECalComponentAttendee * */
+ (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_attendees
+ (ECalComponentAlarm *alarm,
+ const GSList *attendees); /* ECalComponentAttendee * */
+void e_cal_component_alarm_take_attendees
+ (ECalComponentAlarm *alarm,
+ GSList *attendees); /* ECalComponentAttendee * */
+gboolean e_cal_component_alarm_has_attachments
+ (ECalComponentAlarm *alarm);
+GSList * e_cal_component_alarm_get_attachments /* ICalAttach * */
+ (ECalComponentAlarm *alarm);
+void e_cal_component_alarm_set_attachments
+ (ECalComponentAlarm *alarm,
+ const GSList *attachments); /* ICalAttach * */
+void e_cal_component_alarm_take_attachments
+ (ECalComponentAlarm *alarm,
+ GSList *attachments); /* ICalAttach * */
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ALARM_H */
diff --git a/src/calendar/libecal/e-cal-component-alarms.c b/src/calendar/libecal/e-cal-component-alarms.c
new file mode 100644
index 000000000..9a4e8a726
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarms.c
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-alarms
+ * @short_description: An ECalComponentAlarms structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAlarms structure.
+ **/
+
+#include "e-cal-component-alarms.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAlarms, e_cal_component_alarms, e_cal_component_alarms_copy,
e_cal_component_alarms_free)
+
+/**
+ * ECalComponentAlarms:
+ * @comp: The actual alarm component
+ * @alarms: (element-type ECalComponentAlarms): List of #ECalComponentAlarms structures
+ *
+ * Alarm trigger instances for a particular component
+ **/
+typedef struct {
+ /* The actual component */
+ ECalComponent *comp;
+
+ /* List of ECalComponentAlarms structures */
+ GSList *alarms;
+} ECalComponentAlarms;
+
+/**
+ * e_cal_component_alarms_new_relative:
+ * @comp: (not nullable): the actual alarm component, as #ECalComponent
+ *
+ * Creates a new #ECalComponentAlarms structure, associated with @comp.
+ * Free the alarms with e_cal_component_alarms_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAlarms
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarms *
+e_cal_component_alarms_new (ECalComponent *comp)
+{
+ ECalComponentAlarms *alarms;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+ g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
+
+ alarms = g_new0 (ECalComponentAlarms, 1);
+ alarms->comp = g_object_ref (comp);
+
+ return alarms;
+}
+
+/**
+ * e_cal_component_alarms_copy:
+ * @alarms: (not nullable): an #ECalComponentAlarms
+ *
+ * Returns a newly allocated copy of @alarms, which should be freed with
+ * e_cal_component_alarms_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @alarms
+ *
+ * Since: 3.36
+ **/
+ECalComponentAlarms *
+e_cal_component_alarms_copy (const ECalComponentAlarms *alarms)
+{
+ ECalComponentAlarms *alrms;
+
+ g_return_val_if_fail (alarms != NULL, NULL);
+
+ alrms = e_cal_component_alarms_new (alarms->comp);
+ alrms->instances = g_slist_copy_deep (alarms->instances, (GCopyFunc)
e_cal_component_alarm_instance_copy, NULL);
+
+ return alrms;
+}
+
+/**
+ * e_cal_component_alarms_free: (skip)
+ * @alarms: (type ECalComponentAlarms) (nullable): an #ECalComponentAlarms to free
+ *
+ * Free @alarms, previously created by e_cal_component_alarms_new()
+ * or e_cal_component_alarms_copy(). The function does nothing, if @alarms
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarms_free (gpointer alarms)
+{
+ ECalComponentAlarms *alrms = alarms;
+
+ if (alrms) {
+ g_clear_object (&alrms->uid);
+ g_slist_free_full (alrms->instances, e_cal_component_alarm_instance_free);
+ g_free (alrms);
+ }
+}
+
+/**
+ * e_cal_component_alarms_get_component:
+ * @alarms: an #ECalComponentAlarms
+ *
+ * The returned component is valid until the @alarms is freed.
+ *
+ * Returns: (transfer none): an #ECalComponent associated with the @alarms structure
+ *
+ * Since: 3.36
+ **/
+ECalComponent *
+e_cal_component_alarms_get_component (ECalComponentAlarms *alarms)
+{
+ g_return_val_if_fail (alarms != NULL, NULL);
+
+ return alarms->comp;
+}
+
+/**
+ * e_cal_component_alarms_get_instances:
+ * @alarms: an #ECalComponentAlarms
+ *
+ * The returned #GSList is owned by @alarms and should not be modified.
+ * It's valid until the @alarms is freed or the list of instances is not
+ * modified by other functions. The items are of type #ECalComponentAlarmInstance.
+ *
+ * Returns: (transfer none) (element-type ECalComponentAlarmInstance) (nullable): instances
+ * of the @alarms structure; can be %NULL, when none had been added yet
+ *
+ * Since: 3.36
+ **/
+GSList *
+e_cal_component_alarms_get_component (ECalComponentAlarms *alarms)
+{
+ g_return_val_if_fail (alarms != NULL, NULL);
+
+ return alarms->instances;
+}
+
+/**
+ * e_cal_component_alarms_set_instances:
+ * @alarms: an #ECalComponentAlarms
+ * @instances: (nullable) (element-type ECalComponentAlarmInstance): #ECalComponentAlarmInstance objects to
set
+ *
+ * Modifies the list of instances to copy of the given @instances.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarms_set_instances (ECalComponentAlarms *alarms,
+ const GSList *instances)
+{
+ GSList *copy;
+
+ g_return_if_fail (alarms != NULL);
+
+ copy = g_slist_copy_deep (instances, (GCopyFunc) e_cal_component_alarm_instance_copy, NULL);
+ g_slist_free_full (alarms->instances, e_cal_component_alarm_instance_free);
+ alarms->instances = copy;
+}
+
+/**
+ * e_cal_component_alarms_take_instances:
+ * @alarms: an #ECalComponentAlarms
+ * @instances: (nullable) (transfer full) (element-type ECalComponentAlarmInstance):
#ECalComponentAlarmInstance objects to take
+ *
+ * Replaces the list of instances with the given @instances and
+ * assumes ownership of it. Neither the #GSList, nor its items, should
+ * contain the same structures.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarms_take_instances (ECalComponentAlarms *alarms,
+ GSList *instances)
+{
+ g_return_if_fail (alarms != NULL);
+
+ g_slist_free_full (alarms->instances, e_cal_component_alarm_instance_free);
+ alarms->instances = instances;
+}
+
+/**
+ * e_cal_component_alarms_add_instance:
+ * @alarms: an #ECalComponentAlarms
+ * @instance: (not nullable): an #ECalComponentAlarmInstance
+ *
+ * Add a copy of @instance into the list of instances. It is added
+ * in no particular order.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarms_add_instance (ECalComponentAlarms *alarms,
+ const ECalComponentAlarmInstance *instance)
+{
+ g_return_if_fail (alarms != NULL);
+ g_return_if_fail (instance != NULL);
+
+ alarms->instances = g_slist_prepend (alarms->instances,
+ e_cal_component_alarm_instance_copy (instance));
+}
+
+/**
+ * e_cal_component_alarms_take_instance:
+ * @alarms: an #ECalComponentAlarms
+ * @instance: (not nullable) (transfer full): an #ECalComponentAlarmInstance
+ *
+ * Add the @instance into the list of instances and assume ownership of it.
+ * It is added in no particular order.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_alarms_take_instance (ECalComponentAlarms *alarms,
+ ECalComponentAlarmInstance *instance)
+{
+ g_return_if_fail (alarms != NULL);
+ g_return_if_fail (instance != NULL);
+
+ alarms->instances = g_slist_prepend (alarms->instances, instance);
+}
+
+/**
+ * e_cal_component_alarms_remove_instance:
+ * @alarms: an #ECalComponentAlarms
+ * @instance: (not nullable): an #ECalComponentAlarmInstance
+ *
+ * Remove the @instance from the list of instances. If found, the @instance
+ * is also freed.
+ *
+ * Returns: whether the @instance had been found and freed
+ *
+ * Since: 3.36
+ **/
+gboolean
+e_cal_component_alarms_remove_instance (ECalComponentAlarms *alarms,
+ const ECalComponentAlarmInstance *instance)
+{
+ GSList *found;
+
+ g_return_val_if_fail (alarms != NULL, FALSE);
+ g_return_val_if_fail (instance != NULL, FALSE);
+
+ found = g_slist_find (alarms->instances, instance);
+ if (found) {
+ alarms->instances = g_slist_remove (alarms->instances, instance);
+ e_cal_component_alarm_instance_free ((ECalComponentAlarmInstance *) instance);
+ }
+
+ return found != NULL;
+}
diff --git a/src/calendar/libecal/e-cal-component-alarms.h b/src/calendar/libecal/e-cal-component-alarms.h
new file mode 100644
index 000000000..d1ab6cd28
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-alarms.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ALARMS_H
+#define E_CAL_COMPONENT_ALARMS_H
+
+#include <glib.h>
+#include <libecal/e-cal-component-alarm-instance.h>
+
+G_BEGIN_DECLS
+
+/* Forward declaration */
+struct _ECalComponent;
+
+/**
+ * ECalComponentAlarms:
+ *
+ * Opaque structure, which represents alarm trigger instances for a particular component.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAlarms ECalComponentAlarms;
+
+GType e_cal_component_alarms_get_type (void);
+ECalComponentAlarms *
+ e_cal_component_alarms_new (ECalComponent *comp);
+ECalComponentAlarms *
+ e_cal_component_alarms_copy (const ECalComponentAlarms *alarms);
+void e_cal_component_alarms_free (gpointer alarms); /* ECalComponentAlarms * */
+ECalComponent * e_cal_component_alarms_get_component
+ (const ECalComponentAlarms *alarms);
+GSList * e_cal_component_alarms_get_instances /* ECalComponentAlarmInstance * */
+ (const ECalComponentAlarms *alarms);
+void e_cal_component_alarms_set_instances
+ (ECalComponentAlarms *alarms,
+ const GSList *instances); /* ECalComponentAlarmInstance * */
+void e_cal_component_alarms_take_instances
+ (ECalComponentAlarms *alarms,
+ GSList *instances); /* ECalComponentAlarmInstance * */
+void e_cal_component_alarms_add_instance
+ (ECalComponentAlarms *alarms,
+ const ECalComponentAlarmInstance *instance);
+void e_cal_component_alarms_take_instance
+ (ECalComponentAlarms *alarms,
+ ECalComponentAlarmInstance *instance);
+gboolean e_cal_component_alarms_remove_instance
+ (ECalComponentAlarms *alarms,
+ const ECalComponentAlarmInstance *instance);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ALARMS_H */
diff --git a/src/calendar/libecal/e-cal-component-attendee.c b/src/calendar/libecal/e-cal-component-attendee.c
new file mode 100644
index 000000000..a2f531620
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-attendee.c
@@ -0,0 +1,794 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-attendee
+ * @short_description: An ECalComponentAttendee structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentAttendee structure.
+ **/
+
+#include "e-cal-component-attendee.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentAttendee, e_cal_component_attendee, e_cal_component_attendee_copy,
e_cal_component_attendee_free)
+
+typedef struct {
+ gchar *value;
+
+ gchar *member;
+ ICalParameterCutype cutype;
+ ICalParameterRole role;
+ ICalParameterPartstat status;
+ gboolean rsvp;
+
+ gchar *delegatedfrom;
+ gchar *delegatedto;
+ gchar *sentby;
+ gchar *cn;
+ gchar *language;
+} ECalComponentAttendee;
+
+/**
+ * e_cal_component_attendee_new:
+ *
+ * Creates a new empty #ECalComponentAttendee structure. Free it
+ * with e_cal_component_attendee_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAttendee
+ *
+ * Since: 3.36
+ **/
+ECalComponentAttendee *
+e_cal_component_attendee_new (void)
+{
+ ECalComponentAttendee *attendee;
+
+ attendee = g_new0 (ECalComponentAttendee, 1);
+ attendee->cutype = I_CAL_CUTYPE_NONE;
+ attendee->role = I_CAL_ROLE_NONE;
+ attendee->partstat = I_CAL_PARTSTAT_NONE;
+
+ return attendee;
+}
+
+/**
+ * e_cal_component_attendee_new_full:
+ * @value: (nullable): usually a "mailto:email" of the attendee
+ * @member: (nullable): member parameter
+ * @cutype: type of the attendee, an #ICalParameterCutype
+ * @role: role of the attendee, an #ICalParameterRole
+ * @status: current status of the attendee, an #ICalParameterPartstat
+ * @rsvp: whether requires RSVP
+ * @delegatedfrom: (nullable): delegated from
+ * @delegatedto: (nullable): delegated to
+ * @sentby: (nullable): sent by
+ * @cn: (nullable): common name
+ * @language: (nullable): language
+ *
+ * Creates a new #ECalComponentAttendee structure, with all members filled
+ * with given values from the parameters. The %NULL and empty strings are
+ * treated as unset the value. Free the structure
+ * with e_cal_component_attendee_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentAttendee
+ *
+ * Since: 3.36
+ **/
+ECalComponentAttendee *
+e_cal_component_attendee_new_full (const gchar *value,
+ const gchar *member,
+ ICalParameterCutype cutype,
+ ICalParameterRole role,
+ ICalParameterPartstat status,
+ gboolean rsvp,
+ const gchar *delegatedfrom,
+ const gchar *delegatedto,
+ const gchar *sentby,
+ const gchar *cn,
+ const gchar *language)
+{
+ ECalComponentAttendee *attendee;
+
+ attendee = e_cal_component_attendee_new ();
+ attendee->value = value && *value ? g_strdup (value) : NULL;
+ attendee->member = member && *member ? g_strdup (member) : NULL;
+ attendee->cutype = cutype;
+ attendee->role = role;
+ attendee->status = status;
+ attendee->rsvp = rsvp;
+ attendee->delegatedfrom = delegatedfrom && *delegatedfrom ? g_strdup (delegatedfrom) : NULL;
+ attendee->delegateto = delegatedto && *delegatedto ? g_strdup (delegatedto) : NULL;
+ attendee->sentby = sentby && *sentby ? g_strdup (sentby) : NULL;
+ attendee->cn = cn && *cn ? g_strdup (cn) : NULL;
+ attendee->language = language && *language ? g_strdup (language) : NULL;
+
+ return attendee;
+}
+
+/**
+ * e_cal_component_attendee_new_from_property:
+ * @property: an #ICalProperty of kind %I_CAL_ATTENDEE_PROPERTY
+ *
+ * Creates a new #ECalComponentAttendee, filled with values from @property,
+ * which should be of kind %I_CAL_ATTENDEE_PROPERTY. The function returns
+ * %NULL when it is not of the expected kind. Free the structure
+ * with e_cal_component_attendee_free(), when no longer needed.
+ *
+ * Returns: (transfer full) (nullable): a newly allocated #ECalComponentAttendee
+ *
+ * Since: 3.36
+ **/
+ECalComponentAttendee *
+e_cal_component_attendee_new_from_property (const ICalProperty *property)
+{
+ ECalComponentAttendee *attendee;
+
+ g_return_val_if_fail (I_CAL_IS_PROPERTY (property), NULL);
+
+ if (i_cal_property_isa ((ICalProperty *) property) != I_CAL_ATTENDEE_PROPERTY)
+ return NULL;
+
+ attendee = e_cal_component_attendee_new ();
+
+ e_cal_component_attendee_set_from_property (attendee, property);
+
+ return attendee;
+}
+
+/**
+ * e_cal_component_attendee_copy:
+ * @attendee: (not nullable): an #ECalComponentAttendee
+ *
+ * Returns a newly allocated copy of @attendee, which should be freed with
+ * e_cal_component_attendee_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @attendee
+ *
+ * Since: 3.36
+ **/
+ECalComponentAttendee *
+e_cal_component_attendee_copy (const ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return e_cal_component_attendee_new_full (attendee->value,
+ attendee->member,
+ attendee->cutype,
+ attendee->role,
+ attendee->status,
+ attendee->rsvp,
+ attendee->delegatedfrom,
+ attendee->delegatedto,
+ attendee->sentby,
+ attendee->cn,
+ attendee->language);
+}
+
+/**
+ * e_cal_component_attendee_free: (skip)
+ * @attendee: (type ECalComponentAttendee) (nullable): an #ECalComponentAttendee to free
+ *
+ * Free @attendee, previously created by e_cal_component_attendee_new(),
+ * e_cal_component_attendee_new_full(), e_cal_component_attendee_new_from_property()
+ * or e_cal_component_attendee_copy(). The function does nothing, if @attendee
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_free (gpointer attendee)
+{
+ ECalComponentAttendee *att = attendee;
+
+ if (att) {
+ g_free (att->value);
+ g_free (att->member);
+ g_free (att->delegatedfrom);
+ g_free (att->delegatedto);
+ g_free (att->sentby);
+ g_free (att->cn);
+ g_free (att->language);
+ g_free (att);
+ }
+}
+
+/**
+ * e_cal_component_attendee_set_from_property:
+ * @attendee: an #ECalComponentAttendee
+ * @property: an #ICalProperty
+ *
+ * Fill the @attendee structure with the information from
+ * the @property, which should be of %I_CAL_ATTENDEE_PROPERTY kind.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_from_property (ECalComponentAttendee *attendee,
+ const ICalProperty *property)
+{
+ ICalProperty *prop = (ICalProperty *) property;
+ ICalParameter *param;
+
+ g_return_if_fail (attendee != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (prop) == I_CAL_ATTENDEE_PROPERTY);
+
+ e_cal_component_attendee_set_value (attendee, i_cal_property_get_attendee (property));
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_MEMBER_PARAMETER);
+ e_cal_component_attendee_set_member (attendee, param ? i_cal_parameter_get_member (param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_CUTYPE_PARAMETER);
+ e_cal_component_attendee_set_cutype (attendee, param ? i_cal_parameter_get_cutype (param) :
I_CAL_CUTYPE_UNKNOWN);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_ROLE_PARAMETER);
+ e_cal_component_attendee_set_role (attendee, param ? i_cal_parameter_get_role (param) :
I_CAL_ROLE_REQPARTICIPANT);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_PARTSTAT_PARAMETER);
+ e_cal_component_attendee_set_partstat (attendee, param ? i_cal_parameter_get_partstat (param) :
I_CAL_PARTSTAT_NEEDSACTION);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_RSVP_PARAMETER);
+ e_cal_component_attendee_set_rsvp (attendee, param && i_cal_parameter_get_rsvp (param) ==
I_CAL_RSVP_TRUE);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_DELEGATEDFROM_PARAMETER);
+ e_cal_component_attendee_set_delegatedfrom (attendee, param ? i_cal_parameter_get_delegatedfrom
(param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_DELEGATEDTO_PARAMETER);
+ e_cal_component_attendee_set_delegatedto (attendee, param ? i_cal_parameter_get_delegatedto (param) :
NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
+ e_cal_component_attendee_set_sentby (attendee, param ? i_cal_parameter_get_sentby (param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
+ e_cal_component_attendee_set_cn (attendee, param ? i_cal_parameter_get_cn (param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_LANGUAGE_PARAMETER);
+ e_cal_component_attendee_set_language (attendee, param ? i_cal_parameter_get_language (param) : NULL);
+ g_clear_object (¶m);
+}
+
+/**
+ * e_cal_component_attendee_get_as_property:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Converts information stored in @attendee into an #ICalProperty
+ * of %I_CAL_ATTENDEE_PROPERTY kind. The caller is responsible to free
+ * the returned object with g_object_unref(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly created #ICalProperty, containing
+ * information from the @attendee.
+ *
+ * Since: 3.36
+ **/
+ICalProperty *
+e_cal_component_attendee_get_as_property (const ECalComponentAttendee *attendee)
+{
+ ICalProperty *prop;
+
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ prop = i_cal_property_new (I_CAL_ATTENDEE_PROPERTY);
+ g_return_val_if_fail (prop != NULL, NULL);
+
+ e_cal_component_attendee_fill_property (attendee, prop);
+
+ return prop;
+}
+
+/**
+ * e_cal_component_attendee_fill_property:
+ * @attendee: an #ECalComponentAttendee
+ * @property: (inout) (not nullable): an #ICalProperty
+ *
+ * Fill @property with information from @attendee. The @property
+ * should be of kind %I_CAL_ATTENDEE_PROPERTY.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_fill_property (const ECalComponentAttendee *attendee,
+ ICalProperty *property)
+{
+ ICalParameter *param;
+
+ g_return_if_fail (attendee != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (property) == I_CAL_ATTENDEE_PROPERTY);
+
+ i_cal_property_set_attendee (property, attendee->value ? attendee->value : "MAILTO:");
+
+ #define fill_param(_param, _val, _filled) \
+ param = i_cal_property_get_first_parameter (prop, _param); \
+ if (_filled) { \
+ if (!param) { \
+ param = i_cal_parameter_new (_param); \
+ i_cal_property_add_parameter (property, param); \
+ } \
+ i_cal_parameter_set_ # _val (param, attendee-> _val); \
+ g_clear_object (¶m); \
+ } else if (param) { \
+ i_cal_property_remove_parameter (property, param); \
+ g_clear_object (¶m); \
+ }
+
+ fill_param (I_CAL_MEMBER_PARAMETER, member, attendee->member && *attendee->member);
+ fill_param (I_CAL_CUTYPE_PARAMETER, cutype, attendee->cutype != I_CAL_CUTYPE_NONE);
+ fill_param (I_CAL_ROLE_PARAMETER, role, attendee->role != I_CAL_ROLE_NONE);
+ fill_param (I_CAL_PARTSTAT_PARAMETER, partstat, attendee->partstat != I_CAL_PARTSTAT_NONE);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_RSVP_PARAMETER);
+ if (param) {
+ i_cal_parameter_set_rsvp (param, attendee->rsvp ? I_CAL_RSVP_TRUE : I_CAL_RSVP_FALSE);
+ g_clear_object (¶m);
+ } else {
+ param = i_cal_parameter_new (I_CAL_RSVP_PARAMETER);
+ i_cal_parameter_set_rsvp (param, attendee->rsvp ? I_CAL_RSVP_TRUE : I_CAL_RSVP_FALSE);
+ i_cal_property_take_parameter (property, param);
+ }
+
+ fill_param (I_CAL_DELEGATEDFROM_PARAMETER, delegatedfrom, attendee->delegatedfrom &&
*attendee->delegatedfrom);
+ fill_param (I_CAL_DELEGATEDTO_PARAMETER, delegatedto, attendee->delegatedto &&
*attendee->delegatedto);
+ fill_param (I_CAL_SENTBY_PARAMETER, sentby, attendee->sentby && *attendee->sentby);
+ fill_param (I_CAL_CN_PARAMETER, cn, attendee->cn && *attendee->cn);
+ fill_param (I_CAL_LANGUAGE_PARAMETER, language, attendee->language && *attendee->language);
+
+ #undef fill_param
+}
+
+/**
+ * e_cal_component_attendee_get_value:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee URI, usually of "mailto:email" form
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_value (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->value;
+}
+
+/**
+ * e_cal_component_attendee_set_value:
+ * @attendee: an #ECalComponentAttendee
+ * @value: (nullable): the value to set
+ *
+ * Set the @attendee URI, usually of "mailto:email" form. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_value (ECalComponentAttendee *attendee,
+ const gchar *value)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (value && !*value)
+ value = NULL;
+
+ if (g_strcmp0 (attendee->value, value) != 0) {
+ g_free (attendee->value);
+ attendee->value = g_strdup (value);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_member:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee member property
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_member (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->member;
+}
+
+/**
+ * e_cal_component_attendee_set_member:
+ * @attendee: an #ECalComponentAttendee
+ * @member: (nullable): the value to set
+ *
+ * Set the @attendee member parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_member (ECalComponentAttendee *attendee,
+ const gchar *member)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (member && !*member)
+ member = NULL;
+
+ if (g_strcmp0 (attendee->member, member) != 0) {
+ g_free (attendee->member);
+ attendee->member = g_strdup (member);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_cutype:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: the @attendee type, as an #ICalParameterCutype
+ *
+ * Since: 3.36
+ **/
+ICalParameterCutype
+e_cal_component_attendee_get_cutype (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, I_CAL_CUTYPE_NONE);
+
+ return attendee->cutype;
+}
+
+/**
+ * e_cal_component_attendee_set_cutype:
+ * @attendee: an #ECalComponentAttendee
+ * @cutype: the value to set, as an #ICalParameterCutype
+ *
+ * Set the @attendee type, as an #ICalParameterCutype.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_cutype (ECalComponentAttendee *attendee,
+ ICalParameterCutype cutype)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (attendee->cutype != cutype) {
+ attendee->cutype = cutype;
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_role:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: the @attendee role, as an #ICalParameterRole
+ *
+ * Since: 3.36
+ **/
+ICalParameterRole
+e_cal_component_attendee_get_role (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, I_CAL_ROLE_NONE);
+
+ return attendee->role;
+}
+
+/**
+ * e_cal_component_attendee_set_role:
+ * @attendee: an #ECalComponentAttendee
+ * @role: the value to set, as an #ICalParameterRole
+ *
+ * Set the @attendee role, as an #ICalParameterRole.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_role (ECalComponentAttendee *attendee,
+ ICalParameterRole role)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (attendee->role != role) {
+ attendee->role = role;
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_status:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: the @attendee status, as an #ICalParameterPartstat
+ *
+ * Since: 3.36
+ **/
+ICalParameterPartstat
+e_cal_component_attendee_get_status (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, I_CAL_PARTSTAT_NONE);
+
+ return attendee->status;
+}
+
+/**
+ * e_cal_component_attendee_set_status:
+ * @attendee: an #ECalComponentAttendee
+ * @status: the value to set, as an #ICalParameterPartstat
+ *
+ * Set the @attendee status, as an #ICalParameterPartstat.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_status (ECalComponentAttendee *attendee,
+ ICalParameterPartstat status)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (attendee->status != status) {
+ attendee->status = status;
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_rsvp:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: whether the @attendee requires RSVP
+ *
+ * Since: 3.36
+ **/
+gboolean
+e_cal_component_attendee_get_rsvp (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, FALSE);
+
+ return attendee->rsvp;
+}
+
+/**
+ * e_cal_component_attendee_set_rsvp:
+ * @attendee: an #ECalComponentAttendee
+ * @rsvp: the value to set
+ *
+ * Set the @attendee RSVP.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_rsvp (ECalComponentAttendee *attendee,
+ gboolean rsvp)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if ((attendee->rsvp ? 1 : 0) != (rsvp ? 1 : 0)) {
+ attendee->rsvp = rsvp;
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_delegatedfrom:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee delegatedfrom parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_delegatedfrom (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->delegatedfrom;
+}
+
+/**
+ * e_cal_component_attendee_set_delegatedfrom:
+ * @attendee: an #ECalComponentAttendee
+ * @delegatedfrom: (nullable): the value to set
+ *
+ * Set the @attendee delegatedfrom parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_delegatedfrom (ECalComponentAttendee *attendee,
+ const gchar *delegatedfrom)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (delegatedfrom && !*delegatedfrom)
+ delegatedfrom = NULL;
+
+ if (g_strcmp0 (attendee->delegatedfrom, delegatedfrom) != 0) {
+ g_free (attendee->delegatedfrom);
+ attendee->delegatedfrom = g_strdup (delegatedfrom);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_delegatedto:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee delegatedto parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_delegatedto (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->delegatedto;
+}
+
+/**
+ * e_cal_component_attendee_set_delegatedto:
+ * @attendee: an #ECalComponentAttendee
+ * @delegatedto: (nullable): the value to set
+ *
+ * Set the @attendee delegatedto parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_delegatedto (ECalComponentAttendee *attendee,
+ const gchar *delegatedto)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (delegatedto && !*delegatedto)
+ delegatedto = NULL;
+
+ if (g_strcmp0 (attendee->delegatedto, delegatedto) != 0) {
+ g_free (attendee->delegatedto);
+ attendee->delegatedto = g_strdup (delegatedto);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_sentby:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee sentby parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_sentby (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->sentby;
+}
+
+/**
+ * e_cal_component_attendee_set_sentby:
+ * @attendee: an #ECalComponentAttendee
+ * @sentby: (nullable): the value to set
+ *
+ * Set the @attendee sentby parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_sentby (ECalComponentAttendee *attendee,
+ const gchar *sentby)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (sentby && !*sentby)
+ sentby = NULL;
+
+ if (g_strcmp0 (attendee->sentby, sentby) != 0) {
+ g_free (attendee->sentby);
+ attendee->sentby = g_strdup (sentby);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_cn:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee common name (cn) parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_cn (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->cn;
+}
+
+/**
+ * e_cal_component_attendee_set_cn:
+ * @attendee: an #ECalComponentAttendee
+ * @cn: (nullable): the value to set
+ *
+ * Set the @attendee common name (cn) parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_cn (ECalComponentAttendee *attendee,
+ const gchar *cn)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (cn && !*cn)
+ cn = NULL;
+
+ if (g_strcmp0 (attendee->cn, cn) != 0) {
+ g_free (attendee->cn);
+ attendee->cn = g_strdup (cn);
+ }
+}
+
+/**
+ * e_cal_component_attendee_get_language:
+ * @attendee: an #ECalComponentAttendee
+ *
+ * Returns: (nullable): the @attendee language parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_attendee_get_language (ECalComponentAttendee *attendee)
+{
+ g_return_val_if_fail (attendee != NULL, NULL);
+
+ return attendee->language;
+}
+
+/**
+ * e_cal_component_attendee_set_language:
+ * @attendee: an #ECalComponentAttendee
+ * @language: (nullable): the value to set
+ *
+ * Set the @attendee language parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_attendee_set_language (ECalComponentAttendee *attendee,
+ const gchar *language)
+{
+ g_return_if_fail (attendee != NULL);
+
+ if (language && !*language)
+ language = NULL;
+
+ if (g_strcmp0 (attendee->language, language) != 0) {
+ g_free (attendee->language);
+ attendee->language = g_strdup (language);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-attendee.h b/src/calendar/libecal/e-cal-component-attendee.h
new file mode 100644
index 000000000..0a4425355
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-attendee.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ATTENDEE_H
+#define E_CAL_COMPONENT_ATTENDEE_H
+
+#include <glib.h>
+#include <libical-glib/libical-glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentAttendee:
+ *
+ * Describes an attendee. Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentAttendee ECalComponentAttendee;
+
+GType e_cal_component_attendee_get_type
+ (void);
+ECalComponentAttendee *
+ e_cal_component_attendee_new (void);
+ECalComponentAttendee *
+ e_cal_component_attendee_new_full
+ (const gchar *value,
+ const gchar *member,
+ ICalParameterCutype cutype,
+ ICalParameterRole role,
+ ICalParameterPartstat status,
+ gboolean rsvp,
+ const gchar *delegatedfrom,
+ const gchar *delegatedto,
+ const gchar *sentby,
+ const gchar *cn,
+ const gchar *language);
+ECalComponentAttendee *
+ e_cal_component_attendee_new_from_property
+ (const ICalProperty *property);
+ECalComponentAttendee *
+ e_cal_component_attendee_copy (const ECalComponentAttendee *attendee);
+void e_cal_component_attendee_free (gpointer attendee); /* ECalComponentAttendee * */
+void e_cal_component_attendee_set_from_property
+ (ECalComponentAttendee *attendee,
+ const ICalProperty *property);
+ICalProperty * e_cal_component_attendee_get_as_property
+ (const ECalComponentAttendee *attendee);
+void e_cal_component_attendee_fill_property
+ (const ECalComponentAttendee *attendee,
+ ICalProperty *property);
+const gchar * e_cal_component_attendee_get_value
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_value
+ (ECalComponentAttendee *attendee,
+ const gchar *value);
+const gchar * e_cal_component_attendee_get_member
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_member
+ (ECalComponentAttendee *attendee,
+ const gchar *member);
+ICalParameterCutype
+ e_cal_component_attendee_get_cutype
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_cutype
+ (ECalComponentAttendee *attendee,
+ ICalParameterCutype cutype);
+ICalParameterRole
+ e_cal_component_attendee_get_role
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_role
+ (ECalComponentAttendee *attendee,
+ ICalParameterRole role);
+ICalParameterPartstat
+ e_cal_component_attendee_get_status
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_status
+ (ECalComponentAttendee *attendee,
+ ICalParameterPartstat status);
+gboolean e_cal_component_attendee_get_rsvp
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_rsvp
+ (ECalComponentAttendee *attendee,
+ gboolean rsvp);
+const gchar * e_cal_component_attendee_get_delegatedfrom
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_delegatedfrom
+ (ECalComponentAttendee *attendee,
+ const gchar *delegatedfrom);
+const gchar * e_cal_component_attendee_get_delegatedto
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_delegatedto
+ (ECalComponentAttendee *attendee,
+ const gchar *delegatedto);
+const gchar * e_cal_component_attendee_get_sentby
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_sentby
+ (ECalComponentAttendee *attendee,
+ const gchar *sentby);
+const gchar * e_cal_component_attendee_get_cn (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_cn (ECalComponentAttendee *attendee,
+ const gchar *cn);
+const gchar * e_cal_component_attendee_get_language
+ (ECalComponentAttendee *attendee);
+void e_cal_component_attendee_set_language
+ (ECalComponentAttendee *attendee,
+ const gchar *language);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ATTENDEE_H */
diff --git a/src/calendar/libecal/e-cal-component-datetime.c b/src/calendar/libecal/e-cal-component-datetime.c
new file mode 100644
index 000000000..cf6841abe
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-datetime.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-datetime
+ * @short_description: An ECalComponentDateTime structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentDateTime structure.
+ **/
+
+#include "e-cal-component-datetime.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentDateTime, e_cal_component_datetime, e_cal_component_datetime_copy,
e_cal_component_datetime_free)
+
+struct _ECalComponentDateTime {
+ /* Actual date/time value */
+ ICalTimetype *value;
+
+ /* Timezone ID */
+ const gchar *tzid;
+};
+
+/**
+ * e_cal_component_datetime_new:
+ * @value: (not nullable): an #ICalTimetype as a value
+ * @tzid: (nullable): timezone ID for the @value, or %NULL
+ *
+ * Creates a new #ECalComponentDateTime instance, which holds
+ * the @value and @tzid. The returned structure should be freed
+ * with e_cal_component_datetime_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a new #ECalComponentDateTime
+ *
+ * Since: 3.36
+ **/
+ECalComponentDateTime *
+e_cal_component_datetime_new (const ICalTimetype *value,
+ const gchar *tzid)
+{
+ ECalComponentDateTime *dt;
+
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (value), NULL);
+
+ dt = g_new0 (ECalComponentDateTime, 1);
+ e_cal_component_datetime_set (dt, value, tzid);
+
+ return dt;
+}
+
+/**
+ * e_cal_component_datetime_copy:
+ * @dt: (not nullable): an #ECalComponentDateTime
+ *
+ * Creates a new copy of @dt. The returned structure should be freed
+ * with e_cal_component_datetime_free() when no longer needed.
+ *
+ * Returns: (transfer full): a new #ECalComponentDateTime, copy of @dt
+ *
+ * Since: 3.36
+ **/
+ECalComponentDateTime *
+e_cal_component_datetime_copy (const ECalComponentDateTime *dt)
+{
+ g_return_val_if_fail (dt != NULL, NULL);
+
+ return e_cal_component_datetime_new (
+ e_cal_component_datetime_get_value (dt),
+ e_cal_component_datetime_get_tzid (dt));
+}
+
+/**
+ * e_cal_component_datetime_free: (skip)
+ * @dt: (type ECalComponentDateTime) (nullable): an #ECalComponentDateTime to free
+ *
+ * Free @dt, previously created by e_cal_component_datetime_new() or
+ * e_cal_component_datetime_copy(). The function does nothing, if @dt
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_datetime_free (gpointer dt)
+{
+ ECalComponentDateTime *pdt = dt;
+
+ if (pdt) {
+ g_clear_objct (&pdt->value);
+ g_free (pdt->tzid);
+ g_free (pdf);
+ }
+}
+
+/**
+ * e_cal_component_datetime_set:
+ * @dt: an #ECalComponentDateTime
+ * @value: (not nullable): an #ICalTimetype as a value
+ * @tzid: (nullable): timezone ID for the @value, or %NULL
+ *
+ * Sets both @value and @tzid in one call. Use e_cal_component_datetime_set_value()
+ * and e_cal_component_datetime_set_tzid() to set them separately.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_datetime_set (ECalComponentDateTime *dt,
+ const ICalTimetype *value,
+ const gchar *tzid)
+{
+ g_return_if_fail (dt != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (value));
+
+ e_cal_component_datetime_set_value (dt, value);
+ e_cal_component_datetime_set_tzid (dt, tzid);
+}
+
+/**
+ * e_cal_component_datetime_get_value:
+ * @dt: an #ECalComponentDateTime
+ *
+ * Returns the value stored with the @dt. The object is owned by @dt and
+ * it's valid until the @dt is freed or its value overwritten.
+ *
+ * Returns: (transfer none): a value of @dt, as an #ICalTimetype
+ *
+ * Since: 3.36
+ **/
+ICalTimetype *
+e_cal_component_datetime_get_value (const ECalComponentDateTime *dt)
+{
+ g_return_val_if_fail (dt != NULL, NULL);
+
+ return dt->value;
+}
+
+/**
+ * e_cal_component_datetime_set_value:
+ * @dt: an #ECalComponentDateTime
+ * @value: (not nullable): the value to set, as an #ICalTimetype
+ *
+ * Sets the @value of the @dt. Any previously set value is freed.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_datetime_set_value (ECalComponentDateTime *dt,
+ const ICalTimetype *value)
+{
+ g_return_if_fail (dt != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (value));
+
+ g_clear_object (&dt->value);
+ dt->value = i_cal_timetype_new_clone (value);
+}
+
+/**
+ * e_cal_component_datetime_get_tzid:
+ * @dt: an #ECalComponentDateTime
+ *
+ * Returns the TZID stored with the @dt. The string is owned by @dt and
+ * it's valid until the @dt is freed or its TZID overwritten.
+ *
+ * Returns: (transfer none): a TZID of @dt
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_datetime_get_tzid (const ECalComponentDateTime *dt)
+{
+ g_return_val_if_fail (dt != NULL, NULL);
+
+ return dt->tzid;
+}
+
+/**
+ * e_cal_component_datetime_set_tzid:
+ * @dt: an #ECalComponentDateTime
+ * @tzid: (nullable): the TZID to set, or %NULL
+ *
+ * Sets the @tzid of the @dt. Any previously set TZID is freed.
+ * An empty string or a %NULL as @tzid is treated as none TZID.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_datetime_set_tzid (ECalComponentDateTime *dt,
+ const gchar *tzid)
+{
+ g_return_if_fail (dt != NULL);
+
+ if (tzid && !*tzid)
+ tzid = NULL;
+
+ if (tzid != dt->tzid) {
+ g_free (dt->tzid);
+ dt->tzid = g_strdup (tzid);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-datetime.h b/src/calendar/libecal/e-cal-component-datetime.h
new file mode 100644
index 000000000..975333e90
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-datetime.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_DATETIME_H
+#define E_CAL_COMPONENT_DATETIME_H
+
+#include <glib.h>
+#include <libical-glib/libical-glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentDateTime:
+ *
+ * An opaque structure containing an #ICalTimetype describing
+ * the date/time value and also its TZID parameter. Use the functions
+ * below to work with it.
+ **/
+typedef struct _ECalComponentDateTime ECalComponentDateTime;
+
+GType e_cal_component_datetime_get_type
+ (void);
+ECalComponentDateTime *
+ e_cal_component_datetime_new (const ICalTimetype *value,
+ const gchar *tzid);
+ECalComponentDateTime *
+ e_cal_component_datetime_copy (const ECalComponentDateTime *dt);
+void e_cal_component_datetime_free (gpointer dt); /* ECalComponentDateTime * */
+void e_cal_component_datetime_set (ECalComponentDateTime *dt,
+ const ICalTimetype *value,
+ const gchar *tzid);
+ICalTimetype * e_cal_component_datetime_get_value
+ (const ECalComponentDateTime *dt);
+void e_cal_component_datetime_set_value
+ (ECalComponentDateTime *dt,
+ const ICalTimetype *value);
+const gchar * e_cal_component_datetime_get_tzid
+ (const ECalComponentDateTime *dt);
+void e_cal_component_datetime_set_tzid
+ (ECalComponentDateTime *dt,
+ const gchar *tzid);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_DATETIME_H */
diff --git a/src/calendar/libecal/e-cal-component-id.c b/src/calendar/libecal/e-cal-component-id.c
new file mode 100644
index 000000000..d985424d4
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-id.c
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-id
+ * @short_description: An ECalComponentId structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentId structure.
+ **/
+
+#include "e-cal-component-id.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentId, e_cal_component_id, e_cal_component_id_copy, e_cal_component_id_free)
+
+struct _ECalComponentId {
+ gchar *uid;
+ gchar *rid;
+};
+
+/**
+ * e_cal_component_id_new:
+ * @uid: a unique ID string
+ * @rid: (nullable): an optional recurrence ID string
+ *
+ * Creates a new #ECalComponentId from @uid and @rid, which should be
+ * freed with e_cal_component_id_free().
+ *
+ * Returns: (transfer full): an #ECalComponentId
+ *
+ * Since: 3.10
+ **/
+ECalComponentId *
+e_cal_component_id_new (const gchar *uid,
+ const gchar *rid)
+{
+ ECalComponentId *id;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ /* Normalize an empty recurrence ID to NULL. */
+ if (rid != NULL && *rid == '\0')
+ rid = NULL;
+
+ id = g_new0 (ECalComponentId, 1);
+ id->uid = g_strdup (uid);
+ id->rid = g_strdup (rid);
+
+ return id;
+}
+
+/**
+ * e_cal_component_id_copy:
+ * @id: (not nullable): an #ECalComponentId
+ *
+ * Returns a newly allocated copy of @id, which should be freed with
+ * e_cal_component_id_free().
+ *
+ * Returns: (transfer full): a newly allocated copy of @id
+ *
+ * Since: 3.10
+ **/
+ECalComponentId *
+e_cal_component_id_copy (const ECalComponentId *id)
+{
+ g_return_val_if_fail (id != NULL, NULL);
+
+ return e_cal_component_id_new (id->uid, id->rid);
+}
+
+/**
+ * e_cal_component_id_free: (skip)
+ * @id: (transfer full): an #ECalComponentId
+ *
+ * Free the @id.
+ **/
+void
+e_cal_component_id_free (ECalComponentId *id)
+{
+ g_return_if_fail (id != NULL);
+
+ g_free (id->uid);
+ g_free (id->rid);
+ g_free (id);
+}
+
+/**
+ * e_cal_component_id_hash:
+ * @id: (type ECalComponentId): an #ECalComponentId
+ *
+ * Generates a hash value for @id.
+ *
+ * Returns: a hash value for @id
+ *
+ * Since: 3.10
+ **/
+guint
+e_cal_component_id_hash (gcontpointer id)
+{
+ const ECalComponentId *eid = id;
+ guint uid_hash;
+ guint rid_hash;
+
+ g_return_val_if_fail (id != NULL, 0);
+
+ uid_hash = g_str_hash (eid->uid);
+ rid_hash = eid->rid ? g_str_hash (eid->rid) : 0;
+
+ return uid_hash ^ rid_hash;
+}
+
+/**
+ * e_cal_component_id_equal:
+ * @id1: (type ECalComponentId): the first #ECalComponentId
+ * @id2: (type ECalComponentId): the second #ECalComponentId
+ *
+ * Compares two #ECalComponentId structs for equality.
+ *
+ * Returns: %TRUE if @id1 and @id2 are equal
+ *
+ * Since: 3.10
+ **/
+gboolean
+e_cal_component_id_equal (gconstpointer id1,
+ gconstpointer id2)
+{
+ const ECalComponentId *eid1 = id1, *eid2 = id2;
+ gboolean uids_equal;
+ gboolean rids_equal;
+
+ if (id1 == id2)
+ return TRUE;
+
+ /* Safety check before we dereference. */
+ g_return_val_if_fail (id1 != NULL, FALSE);
+ g_return_val_if_fail (id2 != NULL, FALSE);
+
+ uids_equal = (g_strcmp0 (eid1->uid, eid2->uid) == 0);
+ rids_equal = (g_strcmp0 (eid1->rid, eid2->rid) == 0);
+
+ return uids_equal && rids_equal;
+}
+
+/**
+ * e_cal_component_id_get_uid:
+ * @id: an #ECalComponentId
+ *
+ * Returns: (transfer none): The UID part of the @id. The returned
+ * string is owned by @id and it's valid until it's changed
+ * with e_cal_component_id_set_uid() or until the @id is freed.
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_id_get_uid (const ECalComponentId *id)
+{
+ g_return_val_if_fail (id != NULL, NULL);
+
+ return id->uid;
+}
+
+/**
+ * e_cal_component_id_set_uid:
+ * @id: an #ECalComponentId
+ * @uid: (not nullable): the UID to set
+ *
+ * Sets the UID part of the @id.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_id_set_uid (ECalComponentId *id,
+ const gchar *uid)
+{
+ g_return_if_fail (id != NULL);
+ g_return_if_fail (uid != NULL);
+
+ g_free (id->uid);
+ id->uid = g_strdup (uid);
+}
+
+/**
+ * e_cal_component_id_get_rid:
+ * @id: an #ECalComponentId
+ *
+ * Returns: (transfer none) (nullable): The RECURRENCE-ID part of the @id.
+ * The returned string is owned by @id and it's valid until it's
+ * changed with e_cal_component_id_set_rid() or until the @id is freed.
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_id_get_rid (const ECalComponentId *id)
+{
+ g_return_val_if_fail (id != NULL, NULL);
+
+ return id->rid;
+}
+
+/**
+ * e_cal_component_id_set_rid:
+ * @id: an #ECalComponentId
+ * @rid: (nullable): the RECURRENCE-ID to set
+ *
+ * Sets the RECURRENCE-ID part of the @id. The @rid can be %NULL
+ * or an empty string, where both are treated as %NULL, which
+ * means the @id has not RECURRENCE-ID.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_id_set_rid (ECalComponentId *id,
+ const gchar *rid)
+{
+ g_return_if_fail (id != NULL);
+
+ g_free (id->rid);
+ id->rid = (rid && *rid) ? g_strdup (rid) : NULL;
+}
diff --git a/src/calendar/libecal/e-cal-component-id.h b/src/calendar/libecal/e-cal-component-id.h
new file mode 100644
index 000000000..4574dfb29
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-id.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ID_H
+#define E_CAL_COMPONENT_ID_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentId:
+ *
+ * An opaque structure containing UID of a component and
+ * its recurrence ID (which can be %NULL). Use the functions
+ * below to work with it.
+ **/
+typedef struct _ECalComponentId ECalComponentId;
+
+GType e_cal_component_id_get_type (void);
+ECalComponentId *
+ e_cal_component_id_new (const gchar *uid,
+ const gchar *rid);
+ECalComponentId *
+ e_cal_component_id_copy (const ECalComponentId *id);
+void e_cal_component_id_free (gpointer id); /* ECalComponentId * */
+guint e_cal_component_id_hash (gconstpointer id); /* ECalComponentId * */
+gboolean e_cal_component_id_equal (gconstpointer id1, /* ECalComponentId * */
+ gconstpointer id2); /* ECalComponentId * */
+const gchar * e_cal_component_id_get_uid (const ECalComponentId *id);
+void e_cal_component_id_set_uid (ECalComponentId *id,
+ const gchar *uid);
+const gchar * e_cal_component_id_get_rid (const ECalComponentId *id);
+void e_cal_component_id_set_rid (ECalComponentId *id,
+ const gchar *rid);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ID_H */
diff --git a/src/calendar/libecal/e-cal-component-organizer.c
b/src/calendar/libecal/e-cal-component-organizer.c
new file mode 100644
index 000000000..4754ae83c
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-organizer.c
@@ -0,0 +1,439 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-organizer
+ * @short_description: An ECalComponentOrganizer structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentOrganizer structure.
+ **/
+
+#include "e-cal-component-organizer.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentOrganizer, e_cal_component_organizer, e_cal_component_organizer_copy,
e_cal_component_organizer_free)
+
+struct _ECalComponentOrganizer {
+ gchar *value;
+ gchar *sentby;
+ gchar *cn;
+ gchar *language;
+};
+
+/**
+ * e_cal_component_organizer_new:
+ *
+ * Creates a new empty #ECalComponentOrganizer structure. Free it
+ * with e_cal_component_organizer_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentOrganizer
+ *
+ * Since: 3.36
+ **/
+ECalComponentOrganizer *
+e_cal_component_organizer_new (void)
+{
+ ECalComponentOrganizer *organizer;
+
+ organizer = g_new0 (ECalComponentOrganizer, 1);
+
+ return organizer;
+}
+
+/**
+ * e_cal_component_organizer_new_full:
+ * @value: (nullable): usually a "mailto:email" of the organizer
+ * @sentby: (nullable): sent by
+ * @cn: (nullable): common name
+ * @language: (nullable): language
+ *
+ * Creates a new #ECalComponentOrganizer structure, with all members filled
+ * with given values from the parameters. The %NULL and empty strings are
+ * treated as unset the value. Free the structure
+ * with e_cal_component_organizer_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentOrganizer
+ *
+ * Since: 3.36
+ **/
+ECalComponentOrganizer *
+e_cal_component_organizer_new_full (const gchar *value,
+ const gchar *sentby,
+ const gchar *cn,
+ const gchar *language)
+{
+ ECalComponentOrganizer *organizer;
+
+ organizer = e_cal_component_organizer_new ();
+ organizer->value = value && *value ? g_strdup (value) : NULL;
+ organizer->sentby = sentby && *sentby ? g_strdup (sentby) : NULL;
+ organizer->cn = cn && *cn ? g_strdup (cn) : NULL;
+ organizer->language = language && *language ? g_strdup (language) : NULL;
+
+ return organizer;
+}
+
+/**
+ * e_cal_component_organizer_new_from_property:
+ * @property: an #ICalProperty of kind %I_CAL_ORGANIZER_PROPERTY
+ *
+ * Creates a new #ECalComponentOrganizer, filled with values from @property,
+ * which should be of kind %I_CAL_ORGANIZER_PROPERTY. The function returns
+ * %NULL when it is not of the expected kind. Free the structure
+ * with e_cal_component_organizer_free(), when no longer needed.
+ *
+ * Returns: (transfer full) (nullable): a newly allocated #ECalComponentOrganizer
+ *
+ * Since: 3.36
+ **/
+ECalComponentOrganizer *
+e_cal_component_organizer_new_from_property (const ICalProperty *property)
+{
+ ECalComponentOrganizer *organizer;
+
+ g_return_val_if_fail (I_CAL_IS_PROPERTY (property), NULL);
+
+ if (i_cal_property_isa ((ICalProperty *) property) != I_CAL_ORGANIZER_PROPERTY)
+ return NULL;
+
+ organizer = e_cal_component_organizer_new ();
+
+ e_cal_component_organizer_set_from_property (organizer, property);
+
+ return organizer;
+}
+
+/**
+ * e_cal_component_organizer_copy:
+ * @organizer: (not nullable): an #ECalComponentOrganizer
+ *
+ * Returns a newly allocated copy of @organizer, which should be freed with
+ * e_cal_component_organizer_free(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated copy of @organizer
+ *
+ * Since: 3.36
+ **/
+ECalComponentOrganizer *
+e_cal_component_organizer_copy (const ECalComponentOrganizer *organizer)
+{
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ return e_cal_component_organizer_new_full (organizer->value,
+ organizer->sentby,
+ organizer->cn,
+ organizer->language);
+}
+
+/**
+ * e_cal_component_organizer_free: (skip)
+ * @organizer: (type ECalComponentOrganizer) (nullable): an #ECalComponentOrganizer to free
+ *
+ * Free @organizer, previously created by e_cal_component_organizer_new(),
+ * e_cal_component_organizer_new_full(), e_cal_component_organizer_new_from_property()
+ * or e_cal_component_organizer_copy(). The function does nothing, if @organizer
+ * is %NULL.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_free (gpointer organizer)
+{
+ ECalComponentOrganizer *org = organizer;
+
+ if (org) {
+ g_free (org->value);
+ g_free (org->sentby);
+ g_free (org->cn);
+ g_free (org->language);
+ g_free (org);
+ }
+}
+
+/**
+ * e_cal_component_organizer_set_from_property:
+ * @organizer: an #ECalComponentOrganizer
+ * @property: an #ICalProperty
+ *
+ * Fill the @organizer structure with the information from
+ * the @property, which should be of %I_CAL_ORGANIZER_PROPERTY kind.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_set_from_property (ECalComponentOrganizer *organizer,
+ const ICalProperty *property)
+{
+ ICalProperty *prop = (ICalProperty *) property;
+ ICalParameter *param;
+
+ g_return_if_fail (organizer != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (prop) == I_CAL_ORGANIZER_PROPERTY);
+
+ e_cal_component_organizer_set_value (organizer, i_cal_property_get_organizer (prop));
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
+ e_cal_component_organizer_set_sentby (organizer, param ? i_cal_parameter_get_sentby (param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
+ e_cal_component_organizer_set_cn (organizer, param ? i_cal_parameter_get_cn (param) : NULL);
+ g_clear_object (¶m);
+
+ param = i_cal_property_get_first_parameter (prop, I_CAL_LANGUAGE_PARAMETER);
+ e_cal_component_organizer_set_language (organizer, param ? i_cal_parameter_get_language (param) :
NULL);
+ g_clear_object (¶m);
+}
+
+/**
+ * e_cal_component_organizer_get_as_property:
+ * @organizer: an #ECalComponentOrganizer
+ *
+ * Converts information stored in @organizer into an #ICalProperty
+ * of %I_CAL_ORGANIZER_PROPERTY kind. The caller is responsible to free
+ * the returned object with g_object_unref(), when no longer needed.
+ *
+ * Returns: (transfer full): a newly created #ICalProperty, containing
+ * information from the @organizer.
+ *
+ * Since: 3.36
+ **/
+ICalProperty *
+e_cal_component_organizer_get_as_property (const ECalComponentOrganizer *organizer)
+{
+ ICalProperty *prop;
+
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ prop = i_cal_property_new (I_CAL_ORGANIZER_PROPERTY);
+ g_return_val_if_fail (prop != NULL, NULL);
+
+ e_cal_component_organizer_fill_property (organizer, prop);
+
+ return prop;
+}
+
+/**
+ * e_cal_component_organizer_fill_property:
+ * @organizer: an #ECalComponentOrganizer
+ * @property: (inout) (not nullable): an #ICalProperty
+ *
+ * Fill @property with information from @organizer. The @property
+ * should be of kind %I_CAL_ORGANIZER_PROPERTY.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_fill_property (const ECalComponentOrganizer *organizer,
+ ICalProperty *property)
+{
+ ICalParameter *param;
+
+ g_return_if_fail (organizer != NULL);
+ g_return_if_fail (I_CAL_IS_PROPERTY (property));
+ g_return_if_fail (i_cal_property_isa (property) == I_CAL_ORGANIZER_PROPERTY);
+
+ i_cal_property_set_organizer (property, organizer->value ? organizer->value : "MAILTO:");
+
+ #define fill_param(_param, _val, _filled) \
+ param = i_cal_property_get_first_parameter (prop, _param); \
+ if (_filled) { \
+ if (!param) { \
+ param = i_cal_parameter_new (_param); \
+ i_cal_property_add_parameter (property, param); \
+ } \
+ i_cal_parameter_set_ # _val (param, organizer-> _val); \
+ g_clear_object (¶m); \
+ } else if (param) { \
+ i_cal_property_remove_parameter (property, param); \
+ g_clear_object (¶m); \
+ }
+
+ fill_param (I_CAL_SENTBY_PARAMETER, sentby, organizer->sentby && *organizer->sentby);
+ fill_param (I_CAL_CN_PARAMETER, cn, organizer->cn && *organizer->cn);
+ fill_param (I_CAL_LANGUAGE_PARAMETER, language, organizer->language && *organizer->language);
+
+ #undef fill_param
+}
+
+/**
+ * e_cal_component_organizer_get_value:
+ * @organizer: an #ECalComponentOrganizer
+ *
+ * Returns: (nullable): the @organizer URI, usually of "mailto:email" form
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_organizer_get_value (ECalComponentOrganizer *organizer)
+{
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ return organizer->value;
+}
+
+/**
+ * e_cal_component_organizer_set_value:
+ * @organizer: an #ECalComponentOrganizer
+ * @value: (nullable): the value to set
+ *
+ * Set the @organizer URI, usually of "mailto:email" form. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_set_value (ECalComponentOrganizer *organizer,
+ const gchar *value)
+{
+ g_return_if_fail (organizer != NULL);
+
+ if (value && !*value)
+ value = NULL;
+
+ if (g_strcmp0 (organizer->value, value) != 0) {
+ g_free (organizer->value);
+ organizer->value = g_strdup (value);
+ }
+}
+
+/**
+ * e_cal_component_organizer_get_sentby:
+ * @organizer: an #ECalComponentOrganizer
+ *
+ * Returns: (nullable): the @organizer sentby parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_organizer_get_sentby (ECalComponentOrganizer *organizer)
+{
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ return organizer->sentby;
+}
+
+/**
+ * e_cal_component_organizer_set_sentby:
+ * @organizer: an #ECalComponentOrganizer
+ * @sentby: (nullable): the value to set
+ *
+ * Set the @organizer sentby parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_set_sentby (ECalComponentOrganizer *organizer,
+ const gchar *sentby)
+{
+ g_return_if_fail (organizer != NULL);
+
+ if (sentby && !*sentby)
+ sentby = NULL;
+
+ if (g_strcmp0 (organizer->sentby, sentby) != 0) {
+ g_free (organizer->sentby);
+ organizer->sentby = g_strdup (sentby);
+ }
+}
+
+/**
+ * e_cal_component_organizer_get_cn:
+ * @organizer: an #ECalComponentOrganizer
+ *
+ * Returns: (nullable): the @organizer common name (cn) parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_organizer_get_cn (ECalComponentOrganizer *organizer)
+{
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ return organizer->cn;
+}
+
+/**
+ * e_cal_component_organizer_set_cn:
+ * @organizer: an #ECalComponentOrganizer
+ * @cn: (nullable): the value to set
+ *
+ * Set the @organizer common name (cn) parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_set_cn (ECalComponentOrganizer *organizer,
+ const gchar *cn)
+{
+ g_return_if_fail (organizer != NULL);
+
+ if (cn && !*cn)
+ cn = NULL;
+
+ if (g_strcmp0 (organizer->cn, cn) != 0) {
+ g_free (organizer->cn);
+ organizer->cn = g_strdup (cn);
+ }
+}
+
+/**
+ * e_cal_component_organizer_get_language:
+ * @organizer: an #ECalComponentOrganizer
+ *
+ * Returns: (nullable): the @organizer language parameter
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_organizer_get_language (ECalComponentOrganizer *organizer)
+{
+ g_return_val_if_fail (organizer != NULL, NULL);
+
+ return organizer->language;
+}
+
+/**
+ * e_cal_component_organizer_set_language:
+ * @organizer: an #ECalComponentOrganizer
+ * @language: (nullable): the value to set
+ *
+ * Set the @organizer language parameter. The %NULL
+ * and empty strings are treated as unset the value.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_organizer_set_language (ECalComponentOrganizer *organizer,
+ const gchar *language)
+{
+ g_return_if_fail (organizer != NULL);
+
+ if (language && !*language)
+ language = NULL;
+
+ if (g_strcmp0 (organizer->language, language) != 0) {
+ g_free (organizer->language);
+ organizer->language = g_strdup (language);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-organizer.h
b/src/calendar/libecal/e-cal-component-organizer.h
new file mode 100644
index 000000000..341e21e60
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-organizer.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_ORGANIZER_H
+#define E_CAL_COMPONENT_ORGANIZER_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentOrganizer:
+ *
+ * Describes an organizer. Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentOrganizer ECalComponentOrganizer;
+
+GType e_cal_component_organizer_get_type
+ (void);
+ECalComponentOrganizer *
+ e_cal_component_organizer_new (void);
+ECalComponentOrganizer *
+ e_cal_component_organizer_new_full
+ (const gchar *value,
+ const gchar *sentby,
+ const gchar *cn,
+ const gchar *language);
+ECalComponentOrganizer *
+ e_cal_component_organizer_new_from_property
+ (const ICalProperty *property);
+ECalComponentOrganizer *
+ e_cal_component_organizer_copy (const ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_free (gpointer organizer); /* ECalComponentOrganizer * */
+void e_cal_component_organizer_set_from_property
+ (ECalComponentOrganizer *organizer,
+ const ICalProperty *property);
+ICalProperty * e_cal_component_organizer_get_as_property
+ (const ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_fill_property
+ (const ECalComponentOrganizer *organizer,
+ ICalProperty *property);
+const gchar * e_cal_component_organizer_get_value
+ (ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_set_value
+ (ECalComponentOrganizer *organizer,
+ const gchar *value);
+const gchar * e_cal_component_organizer_get_sentby
+ (ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_set_sentby
+ (ECalComponentOrganizer *organizer,
+ const gchar *sentby);
+const gchar * e_cal_component_organizer_get_cn(ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_set_cn(ECalComponentOrganizer *organizer,
+ const gchar *cn);
+const gchar * e_cal_component_organizer_get_language
+ (ECalComponentOrganizer *organizer);
+void e_cal_component_organizer_set_language
+ (ECalComponentOrganizer *organizer,
+ const gchar *language);
+
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_ORGANIZER_H */
diff --git a/src/calendar/libecal/e-cal-component-period.c b/src/calendar/libecal/e-cal-component-period.c
new file mode 100644
index 000000000..6b988094b
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-period.c
@@ -0,0 +1,368 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-period
+ * @short_description: An ECalComponentPeriod structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentPeriod structure.
+ **/
+
+#include "e-cal-component-period.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentPeriod, e_cal_component_period, e_cal_component_period_copy,
e_cal_component_period_free)
+
+struct _ECalComponentPeriod {
+ ECalComponentPeriodKind kind;
+
+ ICalTimetype *start;
+
+ /* Only one of 'end' and 'duration' can be set, depending on the kind */
+ ICalTimetype *end;
+ ICalDurationtype *duration;
+};
+
+/**
+ * e_cal_component_period_new_datetime:
+ * @start: (not nullable): an #ICalTimetype, the start of the period
+ * @end: (not nullable): an #ICalTimetype, the end of the period
+ *
+ * Creates a new #ECalComponentPeriod of kind %E_CAL_COMPONENT_PERIOD_DATETIME.
+ * The returned structure should be freed with e_cal_component_period_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentPeriod
+ *
+ * Since: 3.36
+ **/
+ECalComponentPeriod *
+e_cal_component_period_new_datetime (const ICalTimetype *start,
+ const ICalTimetype *end)
+{
+ ECalComponentPeriod *period;
+
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (start), NULL);
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (end), NULL);
+
+ period = g_new0 (ECalComponentPeriod, 1);
+ period->kind = E_CAL_COMPONENT_PERIOD_DATETIME;
+
+ e_cal_component_period_set_datetime_full (period, start, end);
+
+ return period;
+}
+
+/**
+ * e_cal_component_period_new_duration:
+ * @start: (not nullable): an #ICalTimetype, the start of the period
+ * @duration: (not nullable): an #ICalDurationtype, the duration of the period
+ *
+ * Creates a new #ECalComponentPeriod of kind %E_CAL_COMPONENT_PERIOD_DURATION.
+ * The returned structure should be freed with e_cal_component_period_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentPeriod
+ *
+ * Since: 3.36
+ **/
+ECalComponentPeriod *
+e_cal_component_period_new_duration (const ICalTimetype *start,
+ const ICalDurationtype *duration)
+{
+ ECalComponentPeriod *period;
+
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (start), NULL);
+ g_return_val_if_fail (I_CAL_IS_TIMETYPE (end), NULL);
+
+ period = g_new0 (ECalComponentPeriod, 1);
+ period->kind = E_CAL_COMPONENT_PERIOD_DURATION;
+
+ e_cal_component_period_set_duration_full (period, start, duration);
+
+ return period;
+}
+
+/**
+ * e_cal_component_period_copy:
+ * @period: (not nullable): an #ECalComponentPeriod to copy
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentPeriod, copy of @period.
+ * The returned structure should be freed with e_cal_component_period_free(),
+ * when no longer needed.
+ *
+ * Since: 3.36
+ **/
+ECalComponentPeriod *
+e_cal_component_period_copy (const ECalComponentPeriod *period)
+{
+ ECalComponentPeriod *copy = NULL;
+
+ g_return_if_val_fail (period != NULL, NULL);
+
+ switch (e_cal_component_period_get_kind (period)) {
+ case E_CAL_COMPONENT_PERIOD_DATETIME:
+ copy = e_cal_component_period_new_datetime (
+ e_cal_component_period_get_start (period),
+ e_cal_component_period_get_end (period));
+ break;
+ case E_CAL_COMPONENT_PERIOD_DURATION:
+ copy = e_cal_component_period_new_duration (
+ e_cal_component_period_get_start (period),
+ e_cal_component_period_get_duration (period));
+ break;
+ }
+
+ return copy;
+}
+
+/**
+ * e_cal_component_period_free: (skip)
+ * @period: (type ECalComponentPeriod) (nullable): an #ECalComponentPeriod to free
+ *
+ * Free the @period, previously allocated by e_cal_component_period_new_datetime(),
+ * e_cal_component_period_new_duration() or e_cal_component_period_copy().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_free (gpointer period)
+{
+ ECalComponentPeriod *pd = period;
+
+ if (pd) {
+ g_clear_object (&pd->start);
+ g_clear_object (&pd->end);
+ g_clear_object (&pd->duration);
+ g_free (pd);
+ }
+}
+
+/**
+ * e_cal_component_period_get_kind:
+ * @period: an #ECalComponentPeriod
+ *
+ * Returns kind of the @period, one of #ECalComponentPeriodKind. Depending
+ * on it either e_cal_component_period_get_end()/e_cal_component_period_set_end()
+ * or e_cal_component_period_get_duration()/e_cal_component_period_set_duration()
+ * can be used. The kind of an existing @period canbe changed with
+ * e_cal_component_period_set_datetime_full() and e_cal_component_period_set_duration_full().
+ *
+ * Returns: kind of the period, one of #ECalComponentPeriodKind
+ *
+ * Since: 3.36
+ **/
+ECalComponentPeriodKind
+e_cal_component_period_get_kind (const ECalComponentPeriod *period)
+{
+ g_return_val_if_fail (period != NULL, E_CAL_COMPONENT_PERIOD_DATETIME);
+
+ return period->kind;
+}
+
+/**
+ * e_cal_component_period_set_datetime_full:
+ * @period: an #ECalComponentPeriod
+ * @start: (not nullable): an #ICalTimetype, the start of the @period
+ * @end: (not nullable): an #ICalTimetype, the end of the @period
+ *
+ * Set the kind of @period to be %E_CAL_COMPONENT_PERIOD_DATETIME
+ * and fills the content with @start and @end.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_set_datetime_full (ECalComponentPeriod *period,
+ const ICalTimetype *start,
+ const ICalTimetype *end)
+{
+ g_return_if_fail (period != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (start));
+ g_return_if_fail (I_CAL_IS_TIMETYPE (end));
+
+ g_clear_object (&period->duration);
+
+ period->kind = E_CAL_COMPONENT_PERIOD_DATETIME;
+
+ e_cal_component_period_set_start (period, start);
+ e_cal_component_period_set_end (period, end);
+}
+
+/**
+ * e_cal_component_period_set_duration_full:
+ * @period: an #ECalComponentPeriod
+ * @start: (not nullable): an #ICalTimetype, the start of the @period
+ * @duration: (not nullable): an #ICalDurationtype, the duration of the @period
+ *
+ * Set the kind of @period to be %E_CAL_COMPONENT_PERIOD_DURATION
+ * and fills the content with @start and @duration.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_set_duration_full (ECalComponentPeriod *period,
+ const ICalTimetype *start,
+ const ICalDurationtype *duration)
+{
+ g_return_if_fail (period != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (start));
+ g_return_if_fail (I_CAL_IS_DURATIONTYPE (duration));
+
+ g_clear_object (&period->end);
+
+ period->kind = E_CAL_COMPONENT_PERIOD_DURATION;
+
+ e_cal_component_period_set_start (period, start);
+ e_cal_component_period_set_duration (period, duration);
+}
+
+/**
+ * e_cal_component_period_get_start:
+ * @period: an #ECalComponentPeriod
+ *
+ * Returns the start of the @period. The returned #ICalTimetype object
+ * is owned by @period and should not be freed. It's valid until the @period
+ * is freed or its start time changed.
+ *
+ * Returns: (transfer none): the start of the @period, as an #ICalTimetype
+ *
+ * Since: 3.36
+ **/
+ICalTimetype *
+e_cal_component_period_get_start (const ECalComponentPeriod *period)
+{
+ g_return_val_if_fail (period != NULL, NULL);
+
+ return period->start;
+}
+
+/**
+ * e_cal_component_period_set_start:
+ * @period: an #ECalComponentPeriod
+ * @start: (not nullable): an #ICalTimetype, the start of the @period
+ *
+ * Set the @start of the @period. This can be called on any kind of the @period.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_set_start (ECalComponentPeriod *period,
+ const ICalTimetype *start)
+{
+ g_return_if_fail (period != NULL);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (start));
+
+ if (period->start != start) {
+ g_clear_object (&period->start);
+ period->start = i_cal_timetype_new_clone (start);
+ }
+}
+
+/**
+ * e_cal_component_period_get_end:
+ * @period: an #ECalComponentPeriod
+ *
+ * Returns the end of the @period. This can be called only on @period
+ * objects of kind %E_CAL_COMPONENT_PERIOD_DATETIME.
+ * The returned #ICalTimetype object is owned by @period and should not
+ * be freed. It's valid until the @period is freed or its end time changed.
+ *
+ * Returns: (transfer none): the end of the period, as an #ICalTimetype
+ *
+ * Since: 3.36
+ **/
+ICalTimetype *
+e_cal_component_period_get_end (const ECalComponentPeriod *period)
+{
+ g_return_val_if_fail (period != NULL, NULL);
+ g_return_val_if_fail (period->kind == E_CAL_COMPONENT_PERIOD_DATETIME, NULL);
+
+ return period->end;
+}
+
+/**
+ * e_cal_component_period_set_end:
+ * @period: an #ECalComponentPeriod
+ * @end: (not nullable): an #ICalTimetype, the end of the @period
+ *
+ * Set the end of the @period. This can be called only on @period
+ * objects of kind %E_CAL_COMPONENT_PERIOD_DATETIME.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_set_end (ECalComponentPeriod *period,
+ const ICalTimetype *end)
+{
+ g_return_if_fail (period != NULL);
+ g_return_if_fail (period->kind == E_CAL_COMPONENT_PERIOD_DATETIME);
+ g_return_if_fail (I_CAL_IS_TIMETYPE (end));
+
+ if (period->end != end) {
+ g_clear_object (&period->end);
+ period->end = i_cal_timetype_new_clone (end);
+ }
+}
+
+/**
+ * e_cal_component_period_get_duration:
+ * @period: an #ECalComponentPeriod
+ *
+ * Returns the duration of the @period. This can be called only on @period
+ * objects of kind %E_CAL_COMPONENT_PERIOD_DURATION.
+ * The returned #ICalDurationtype object is owned by @period and should not
+ * be freed. It's valid until the @period is freed or its duration changed.
+ *
+ * Returns: (transfer none): the duration of the period, as an #ICalDurationtype
+ *
+ * Since: 3.36
+ **/
+ICalDurationtype *
+e_cal_component_period_get_duration (const ECalComponentPeriod *period)
+{
+ g_return_val_if_fail (period != NULL, NULL);
+ g_return_val_if_fail (period->kind == E_CAL_COMPONENT_PERIOD_DURATION, NULL);
+
+ return period->duration;
+}
+
+/**
+ * e_cal_component_period_set_end:
+ * @period: an #ECalComponentPeriod
+ * @duration: (not nullable): an #ICalDurationtype, the duration of the @period
+ *
+ * Set the duration of the @period. This can be called only on @period
+ * objects of kind %E_CAL_COMPONENT_PERIOD_DURATION.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_period_set_duration (ECalComponentPeriod *period,
+ const ICalDurationtype *duration)
+{
+ g_return_if_fail (period != NULL);
+ g_return_if_fail (period->kind == E_CAL_COMPONENT_PERIOD_DURATION);
+ g_return_if_fail (I_CAL_IS_DURATIONTYPE (duration));
+
+ if (period->duration != duration) {
+ g_clear_object (&period->duration);
+ period->duration = i_cal_duration_type_from_int (i_cal_duration_type_as_int
((ICalDurationtype *) duration);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-period.h b/src/calendar/libecal/e-cal-component-period.h
new file mode 100644
index 000000000..b47af9766
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-period.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_PERIOD_H
+#define E_CAL_COMPONENT_PERIOD_H
+
+#include <glib.h>
+#include <libical-glib/libical-glib.h>
+#include <libecal/e-cal-enums.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentPeriod:
+ *
+ * Period of time, can have explicit start/end times or start/duration instead.
+ * Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentPeriod ECalComponentPeriod;
+
+GType e_cal_component_period_get_type (void);
+ECalComponentPeriod *
+ e_cal_component_period_new_datetime
+ (const ICalTimetype *start,
+ const ICalTimetype *end);
+ECalComponentPeriod *
+ e_cal_component_period_new_duration
+ (const ICalTimetype *start,
+ const ICalDurationtype *duration);
+ECalComponentPeriod *
+ e_cal_component_period_copy (const ECalComponentPeriod *period);
+void e_cal_component_period_free (gpointer period); /* ECalComponentPeriod * */
+ECalComponentPeriodKind
+ e_cal_component_period_get_kind (const ECalComponentPeriod *period);
+void e_cal_component_period_set_datetime_full
+ (ECalComponentPeriod *period,
+ const ICalTimetype *start,
+ const ICalTimetype *end);
+void e_cal_component_period_set_duration_full
+ (ECalComponentPeriod *period,
+ const ICalTimetype *start,
+ const ICalDurationtype *duration);
+ICalTimetype * e_cal_component_period_get_start(const ECalComponentPeriod *period);
+void e_cal_component_period_set_start(ECalComponentPeriod *period,
+ const ICalTimetype *start);
+ICalTimetype * e_cal_component_period_get_end (const ECalComponentPeriod *period);
+void e_cal_component_period_set_end (ECalComponentPeriod *period,
+ const ICalTimetype *end);
+ICalDurationtype *
+ e_cal_component_period_get_duration
+ (const ECalComponentPeriod *period);
+void e_cal_component_period_set_duration
+ (ECalComponentPeriod *period,
+ const ICalDurationtype *duration);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_PERIOD_H */
diff --git a/src/calendar/libecal/e-cal-component-range.c b/src/calendar/libecal/e-cal-component-range.c
new file mode 100644
index 000000000..ba0acaae2
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-range.c
@@ -0,0 +1,235 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-range
+ * @short_description: An ECalComponentRange structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentRange structure.
+ **/
+
+#include "e-cal-component-range.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentRange, e_cal_component_range, e_cal_component_range_copy,
e_cal_component_range_free)
+
+typedef struct _ECalComponentRange {
+ ECalComponentRangeKind kind;
+ ECalComponentDateTime *datetime;
+};
+
+/**
+ * e_cal_component_range_new:
+ * @kind: an #ECalComponentRangeKind
+ * @datetime: (not nullable): an #ECalComponentDateTime
+ *
+ * Creates a new #ECalComponentRange describing a range.
+ * The returned structure should be freed with e_cal_component_range_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentRange
+ *
+ * Since: 3.36
+ **/
+ECalComponentRange *
+e_cal_component_range_new (ECalComponentRangeKind kind,
+ const ECalComponentDateTime *datetime)
+{
+ ECalComponentDateTime *dt;
+
+ g_return_val_if_fail (datetime != NULL, NULL);
+
+ dt = e_cal_component_datetime_copy (datetime);
+ g_return_val_if_fail (dt != NULL, NULL);
+
+ return e_cal_component_range_new_take (kind, dt);
+}
+
+/**
+ * e_cal_component_range_new_take: (skip)
+ * @kind: an #ECalComponentRangeKind
+ * @datetime: (not nullable) (transfer full): an #ECalComponentDateTime
+ *
+ * Creates a new #ECalComponentRange describing a range, similar to
+ * e_cal_component_range_new() except is assumes ownership of @datetime.
+ * The returned structure should be freed with e_cal_component_range_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentRange
+ *
+ * Since: 3.36
+ **/
+ECalComponentRange *
+e_cal_component_range_new_take (ECalComponentRangeKind kind,
+ ECalComponentDateTime *datetime)
+{
+ ECalComponentRange *range;
+
+ g_return_val_if_fail (datetime != NULL, NULL);
+
+ range = g_new0 (ECalComponentRange, 1);
+ range->kind = kind;
+ range->datetime = datetime;
+
+ return range;
+}
+
+/**
+ * e_cal_component_range_copy:
+ * @range: (not nullable): an #ECalComponentRange to copy
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentRange, copy of @range.
+ * The returned structure should be freed with e_cal_component_range_free(),
+ * when no longer needed.
+ *
+ * Since: 3.36
+ **/
+ECalComponentRange *
+e_cal_component_range_copy (const ECalComponentRange *range)
+{
+ g_return_val_if_fail (range != NULL, NULL);
+
+ return e_cal_component_range_new (
+ e_cal_component_range_get_kind (range),
+ e_cal_component_range_get_datetime (range));
+}
+
+/**
+ * e_cal_component_range_free: (skip)
+ * @range: (type ECalComponentRange) (nullable): an #ECalComponentRange to free
+ *
+ * Free the @range, previously allocated by e_cal_component_range_new(),
+ * e_cal_component_range_new_take() or e_cal_component_range_copy().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_range_free (gpointer range)
+{
+ ECalComponentRange *rng = range;
+
+ if (rng) {
+ e_cal_component_datetime_free (rng->datetime);
+ g_free (rng);
+ }
+}
+
+/**
+ * e_cal_component_range_get_kind:
+ * @range: an #ECalComponentRange
+ *
+ * Returns: the #ECalComponentRangeKind of the @range
+ *
+ * Since: 3.36
+ **/
+ECalComponentRangeKind
+e_cal_component_range_get_kind (const ECalComponentRange *range)
+{
+ g_return_val_if_fail (range != NULL, E_CAL_COMPONENT_RANGE_SINGLE);
+
+ return range->kind;
+}
+
+/**
+ * e_cal_component_range_set_kind:
+ * @range: an #ECalComponentRange
+ * @kind: an #ECalComponentRangeKind
+ *
+ * Set the @kind of the @range.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_range_set_kind (ECalComponentRange *range,
+ ECalComponentRangeKind kind)
+{
+ g_return_if_fail (range != NULL);
+
+ range->kind = kind;
+}
+
+/**
+ * e_cal_component_range_get_datetime:
+ * @range: an #ECalComponentRange
+ *
+ * Returns the date/time of the @range. The returned #ECalComponentDateTime
+ * is owned by @range and should not be freed. It's valid until the @range
+ * is freed or its date/time changed.
+ *
+ * Returns: (transfer none): the date/time of the @range, as an #ECalComponentDateTime
+ *
+ * Since: 3.36
+ **/
+ECalComponentDateTime *
+e_cal_component_range_get_datetime (const ECalComponentRange *range)
+{
+ g_return_val_if_fail (range != NULL, NULL);
+
+ return range->datetime;
+}
+
+/**
+ * e_cal_component_range_set_datetime:
+ * @range: an #ECalComponentRange
+ * @datetime: (not nullable): an #ECalComponentDateTime
+ *
+ * Set the date/time part of the @range.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_range_set_datetime (ECalComponentRange *range,
+ const ECalComponentDateTime *datetime)
+{
+ g_return_if_fail (range != NULL);
+ g_return_if_fail (datetime != NULL);
+
+ if (range->datetime != datetime) {
+ ECalComponentDateTime *dt;
+
+ dt = e_cal_component_datetime_copy (datetime);
+ g_return_if_fail (dt != NULL);
+
+ e_cal_component_range_take_datetime (range, dt);
+ }
+}
+
+/**
+ * e_cal_component_range_take_datetime: (skip)
+ * @range: an #ECalComponentRange
+ * @datetime: (not nullable) (transfer full): an #ECalComponentDateTime
+ *
+ * Set the date/time part of the @range, similar to e_cal_component_range_set_datetime(),
+ * except it assumes ownership of the @datetime.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_range_take_datetime (ECalComponentRange *range,
+ ECalComponentDateTime *datetime)
+{
+ g_return_if_fail (range != NULL);
+ g_return_if_fail (datetime != NULL);
+
+ if (range->datetime != datetime) {
+ e_cal_component_datetime_free (range->datetime);
+ range->datetime = datetime;
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-range.h b/src/calendar/libecal/e-cal-component-range.h
new file mode 100644
index 000000000..5d9bbf554
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-range.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_RANGE_H
+#define E_CAL_COMPONENT_RANGE_H
+
+#include <glib.h>
+#include <libecal/e-cal-enums.h>
+#include <libecal/e-cal-component-datetime.h>
+
+G_BEGIN_DECLS
+
+/**
+ * ECalComponentRange:
+ *
+ * Describes a range. Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentRange ECalComponentRange;
+
+GType e_cal_component_range_get_type (void);
+ECalComponentRange *
+ e_cal_component_range_new (ECalComponentRangeKind kind,
+ const ECalComponentDateTime *datetime);
+ECalComponentRange *
+ e_cal_component_range_new_take (ECalComponentRangeKind kind,
+ ECalComponentDateTime *datetime);
+ECalComponentRange *
+ e_cal_component_range_copy (const ECalComponentRange *range);
+void e_cal_component_range_free (gpointer range); /* ECalComponentRange * */
+ECalComponentRangeKind
+ e_cal_component_range_get_kind (const ECalComponentRange *range);
+void e_cal_component_range_set_kind (ECalComponentRange *range,
+ ECalComponentRangeKind kind);
+ECalComponentDateTime *
+ e_cal_component_range_get_datetime
+ (const ECalComponentRange *range);
+void e_cal_component_range_set_datetime
+ (ECalComponentRange *range,
+ const ECalComponentDateTime *datetime);
+void e_cal_component_range_take_datetime
+ (ECalComponentRange *range,
+ ECalComponentDateTime *datetime);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_RANGE_H */
diff --git a/src/calendar/libecal/e-cal-component-text.c b/src/calendar/libecal/e-cal-component-text.c
new file mode 100644
index 000000000..616e6553c
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-text.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "evolution-data-server-config.h"
+
+/**
+ * SECTION:e-cal-component-text
+ * @short_description: An ECalComponentText structure
+ * @include: libecal/libecal.h
+ *
+ * Contains functions to work with the #ECalComponentText structure.
+ **/
+
+#include "e-cal-component-text.h"
+
+G_DEFINE_BOXED_TYPE (ECalComponentText, e_cal_component_text, e_cal_component_text_copy,
e_cal_component_text_free)
+
+struct _ECalComponentText {
+ gchar *value;
+ gchar *altrep;
+};
+
+/**
+ * e_cal_component_text_new:
+ * @value: (nullable): description text
+ * @altrep: (nullable): alternate representation URI
+ *
+ * Creates a new #ECalComponentText describing text properties.
+ * The returned structure should be freed with e_cal_component_text_free(),
+ * when no longer needed.
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentText
+ *
+ * Since: 3.36
+ **/
+ECalComponentText *
+e_cal_component_text_new (const gchar *value,
+ const gchar *altrep)
+{
+ ECalComponentText *text;
+
+ text = g_new0 (ECalComponentText, 1);
+ text->value = g_strdup (value);
+ text->altrep = g_strdup (altrep);
+
+ return text;
+}
+
+/**
+ * e_cal_component_text_copy:
+ * @text: (not nullable): an #ECalComponentText to copy
+ *
+ * Returns: (transfer full): a newly allocated #ECalComponentText, copy of @text.
+ * The returned structure should be freed with e_cal_component_text_free(),
+ * when no longer needed.
+ *
+ * Since: 3.36
+ **/
+ECalComponentText *
+e_cal_component_text_copy (const ECalComponentText *text)
+{
+ g_return_val_if_fail (text != NULL, NULL);
+
+ return e_cal_component_text_new (text->value, text->altrep);
+}
+
+/**
+ * e_cal_component_text_free: (skip)
+ * @text: (type ECalComponentText) (nullable): an #ECalComponentText to free
+ *
+ * Free the @text, previously allocated by e_cal_component_text_new() or
+ * e_cal_component_text_copy().
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_text_free (gpointer text)
+{
+ ECalComponentText *te = text;
+
+ if (te) {
+ g_free (te->value);
+ g_free (te->altrep);
+ g_free (te);
+ }
+}
+
+/**
+ * e_cal_component_text_get_value:
+ * @text: an #ECalComponentText
+ *
+ * Returns: the description string of the @text
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_text_get_value (const ECalComponentText *text)
+{
+ g_return_val_if_fail (text != NULL, NULL);
+
+ return text->value;
+}
+
+/**
+ * e_cal_component_text_set_value:
+ * @text: an #ECalComponentText
+ * @value: (nullable): description string to set
+ *
+ * Set the @value as the description string of the @text.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_text_set_value (ECalComponentText *text,
+ const gchar *value)
+{
+ g_return_if_fail (text != NULL);
+
+ if (g_strcmp0 (text->value, value) != 0) {
+ g_free (text->value);
+ text->value = g_strdup (value);
+ }
+}
+
+/**
+ * e_cal_component_text_get_altrep:
+ * @text: an #ECalComponentText
+ *
+ * Returns: the alternate representation URI of the @text
+ *
+ * Since: 3.36
+ **/
+const gchar *
+e_cal_component_text_get_altrep (const ECalComponentText *text)
+{
+ g_return_val_if_fail (text != NULL, NULL);
+
+ return text->altrep;
+}
+
+/**
+ * e_cal_component_text_set_altrep:
+ * @text: an #ECalComponentText
+ * @altrep: (nullable): alternate representation URI to set
+ *
+ * Set the @altrep as the alternate representation URI of the @text.
+ *
+ * Since: 3.36
+ **/
+void
+e_cal_component_text_set_altrep (ECalComponentText *text,
+ const gchar *altrep)
+{
+ g_return_if_fail (text != NULL);
+
+ if (g_strcmp0 (text->altrep, altrep) != 0) {
+ g_free (text->altrep);
+ text->altrep = g_strdup (altrep);
+ }
+}
diff --git a/src/calendar/libecal/e-cal-component-text.h b/src/calendar/libecal/e-cal-component-text.h
new file mode 100644
index 000000000..6bf74250f
--- /dev/null
+++ b/src/calendar/libecal/e-cal-component-text.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_COMPONENT_TEXT_H
+#define E_CAL_COMPONENT_TEXT_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+
+/**
+ * ECalComponentText:
+ *
+ * Contains description string and an alternate representation URI
+ * for text properties. Use the functions below to work with it.
+ **/
+typedef struct _ECalComponentText ECalComponentText;
+
+GType e_cal_component_text_get_type (void);
+ECalComponentText *
+ e_cal_component_text_new (const gchar *value,
+ const gchar *altrep);
+ECalComponentText *
+ e_cal_component_text_copy (const ECalComponentText *text);
+void e_cal_component_text_free (gpointer text); /* ECalComponentText * */
+const gchar * e_cal_component_text_get_value (const ECalComponentText *text);
+void e_cal_component_text_set_value (ECalComponentText *text,
+ const gchar *value);
+const gchar * e_cal_component_text_get_altrep (const ECalComponentText *text);
+void e_cal_component_text_set_altrep (ECalComponentText *text,
+ const gchar *altrep);
+
+G_END_DECLS
+
+#endif /* E_CAL_COMPONENT_TEXT_H */
diff --git a/src/calendar/libecal/e-cal-component.c b/src/calendar/libecal/e-cal-component.c
index c492b167c..36eb65e5b 100644
--- a/src/calendar/libecal/e-cal-component.c
+++ b/src/calendar/libecal/e-cal-component.c
@@ -20,7 +20,7 @@
/**
* SECTION:e-cal-component
* @short_description: A convenience interface for interacting with events
- * @include: libebook-contacts/libebook-contacts.h
+ * @include: libecal/libecal.h
*
* This is the main user facing interface used for representing an event
* or other component in a given calendar.
@@ -49,18 +49,11 @@
((obj), E_TYPE_CAL_COMPONENT, ECalComponentPrivate))
G_DEFINE_TYPE (ECalComponent, e_cal_component, G_TYPE_OBJECT)
-G_DEFINE_BOXED_TYPE (ECalComponentId,
- e_cal_component_id,
- e_cal_component_id_copy,
- e_cal_component_free_id)
G_DEFINE_BOXED_TYPE (ECalComponentAlarm,
e_cal_component_alarm,
e_cal_component_alarm_clone,
e_cal_component_alarm_free)
-/* Extension property for alarm components so that we can reference them by UID */
-#define EVOLUTION_ALARM_UID_PROPERTY "X-EVOLUTION-ALARM-UID"
-
struct attendee {
icalproperty *prop;
icalparameter *cutype_param;
@@ -191,31 +184,6 @@ struct _ECalComponentPrivate {
guint need_sequence_inc : 1;
};
-/* Private structure for alarms */
-struct _ECalComponentAlarm {
- /* Alarm icalcomponent we wrap */
- icalcomponent *icalcomp;
-
- /* Our extension UID property */
- icalproperty *uid;
-
- /* Properties */
-
- icalproperty *action;
- icalproperty *attach; /* FIXME: see scan_alarm_property () below */
-
- struct {
- icalproperty *prop;
- icalparameter *altrep_param;
- } description;
-
- icalproperty *duration;
- icalproperty *repeat;
- icalproperty *trigger;
-
- GSList *attendee_list;
-};
-
/* Does a simple g_free() of the elements of a GSList and then frees the list
* itself. Returns NULL.
*/
@@ -5029,24 +4997,6 @@ e_cal_component_free_categories_list (GSList *categ_list)
g_slist_free (categ_list);
}
-/**
- * e_cal_component_free_datetime:
- * @dt: A date/time structure.
- *
- * Frees a date/time structure.
- **/
-void
-e_cal_component_free_datetime (ECalComponentDateTime *dt)
-{
- g_return_if_fail (dt != NULL);
-
- g_free (dt->value);
- g_free ((gchar *) dt->tzid);
-
- dt->value = NULL;
- dt->tzid = NULL;
-}
-
/**
* e_cal_component_free_range:
* @range: A #ECalComponentRange.
@@ -5192,128 +5142,6 @@ e_cal_component_free_sequence (gint *sequence)
g_free (sequence);
}
-/**
- * e_cal_component_free_id:
- * @id: an #ECalComponentId
- *
- * Frees the @id.
- **/
-void
-e_cal_component_free_id (ECalComponentId *id)
-{
- g_return_if_fail (id != NULL);
-
- g_free (id->uid);
- g_free (id->rid);
-
- g_free (id);
-}
-
-/**
- * e_cal_component_id_new:
- * @uid: a unique ID string
- * @rid: (allow-none): an optional recurrence ID string
- *
- * Creates a new #ECalComponentId from @uid and @rid, which should be
- * freed with e_cal_component_free_id().
- *
- * Returns: an #ECalComponentId
- *
- * Since: 3.10
- **/
-ECalComponentId *
-e_cal_component_id_new (const gchar *uid,
- const gchar *rid)
-{
- ECalComponentId *id;
-
- g_return_val_if_fail (uid != NULL, NULL);
-
- /* Normalize an empty recurrence ID to NULL. */
- if (rid != NULL && *rid == '\0')
- rid = NULL;
-
- id = g_new0 (ECalComponentId, 1);
- id->uid = g_strdup (uid);
- id->rid = g_strdup (rid);
-
- return id;
-}
-
-/**
- * e_cal_component_id_copy:
- * @id: an #ECalComponentId
- *
- * Returns a newly-allocated copy of @id, which should be freed with
- * e_cal_component_free_id().
- *
- * Returns: a newly-allocated copy of @id
- *
- * Since: 3.10
- **/
-ECalComponentId *
-e_cal_component_id_copy (const ECalComponentId *id)
-{
- g_return_val_if_fail (id != NULL, NULL);
-
- return e_cal_component_id_new (id->uid, id->rid);
-}
-
-/**
- * e_cal_component_id_hash:
- * @id: an #ECalComponentId
- *
- * Generates a hash value for @id.
- *
- * Returns: a hash value for @id
- *
- * Since: 3.10
- **/
-guint
-e_cal_component_id_hash (const ECalComponentId *id)
-{
- guint uid_hash;
- guint rid_hash;
-
- g_return_val_if_fail (id != NULL, 0);
-
- uid_hash = g_str_hash (id->uid);
- rid_hash = (id->rid != NULL) ? g_str_hash (id->rid) : 0;
-
- return uid_hash ^ rid_hash;
-}
-
-/**
- * e_cal_component_id_equal:
- * @id1: the first #ECalComponentId
- * @id2: the second #ECalComponentId
- *
- * Compares two #ECalComponentId structs for equality.
- *
- * Returns: %TRUE if @id1 and @id2 are equal
- *
- * Since: 3.10
- **/
-gboolean
-e_cal_component_id_equal (const ECalComponentId *id1,
- const ECalComponentId *id2)
-{
- gboolean uids_equal;
- gboolean rids_equal;
-
- if (id1 == id2)
- return TRUE;
-
- /* Safety check before we dereference. */
- g_return_val_if_fail (id1 != NULL, FALSE);
- g_return_val_if_fail (id2 != NULL, FALSE);
-
- uids_equal = (g_strcmp0 (id1->uid, id2->uid) == 0);
- rids_equal = (g_strcmp0 (id1->rid, id2->rid) == 0);
-
- return uids_equal && rids_equal;
-}
-
/**
* e_cal_component_free_text_list:
* @text_list: (element-type ECalComponentText): List of #ECalComponentText
diff --git a/src/calendar/libecal/e-cal-component.h b/src/calendar/libecal/e-cal-component.h
index b63b3b8e9..43d5a7830 100644
--- a/src/calendar/libecal/e-cal-component.h
+++ b/src/calendar/libecal/e-cal-component.h
@@ -28,6 +28,20 @@
#include <glib-object.h>
#include <libical-glib/libical-glib.h>
+#include <libecal/e-cal-enums.h>
+#include <libecal/e-cal-component-alarm.h>
+#include <libecal/e-cal-component-alarm-instance.h>
+#include <libecal/e-cal-component-alarm-repeat.h>
+#include <libecal/e-cal-component-alarm-trigger.h>
+#include <libecal/e-cal-component-alarms.h>
+#include <libecal/e-cal-component-attendee.h>
+#include <libecal/e-cal-component-datetime.h>
+#include <libecal/e-cal-component-id.h>
+#include <libecal/e-cal-component-organizer.h>
+#include <libecal/e-cal-component-period.h>
+#include <libecal/e-cal-component-range.h>
+#include <libecal/e-cal-component-text.h>
+
/* Standard GObject macros */
#define E_TYPE_CAL_COMPONENT \
(e_cal_component_get_type ())
@@ -49,269 +63,6 @@
G_BEGIN_DECLS
-/**
- * ECalComponentId:
- * @uid: UID of the component
- * @rid: recurrence ID of the component; can be %NULL
- **/
-typedef struct {
- gchar *uid;
- gchar *rid;
-} ECalComponentId;
-
-/**
- * ECalComponentVType:
- * @E_CAL_COMPONENT_NO_TYPE: Unknown or unsupported component type
- * @E_CAL_COMPONENT_EVENT: vEvent type
- * @E_CAL_COMPONENT_TODO: vTodo type
- * @E_CAL_COMPONENT_JOURNAL: vJournal type
- * @E_CAL_COMPONENT_FREEBUSY: vFreeBusy type
- * @E_CAL_COMPONENT_TIMEZONE: vTimezone type
- *
- * Types of calendar components to be stored by a ECalComponent, as per RFC 2445.
- * We don't put the alarm component type here since we store alarms as separate
- * structures inside the other "real" components.
- **/
-typedef enum {
- E_CAL_COMPONENT_NO_TYPE,
- E_CAL_COMPONENT_EVENT,
- E_CAL_COMPONENT_TODO,
- E_CAL_COMPONENT_JOURNAL,
- E_CAL_COMPONENT_FREEBUSY,
- E_CAL_COMPONENT_TIMEZONE
-} ECalComponentVType;
-
-/**
- * ECalComponentField:
- * @E_CAL_COMPONENT_FIELD_CATEGORIES: Concatenation of categories
- * @E_CAL_COMPONENT_FIELD_CLASSIFICATION: Classification
- * @E_CAL_COMPONENT_FIELD_COMPLETED: Completed
- * @E_CAL_COMPONENT_FIELD_DTEND: Dtend
- * @E_CAL_COMPONENT_FIELD_DTSTART: Dtstart
- * @E_CAL_COMPONENT_FIELD_DUE: Due
- * @E_CAL_COMPONENT_FIELD_GEO: Geo
- * @E_CAL_COMPONENT_FIELD_PERCENT: Percent
- * @E_CAL_COMPONENT_FIELD_PRIORITY: Priority
- * @E_CAL_COMPONENT_FIELD_SUMMARY: Summary
- * @E_CAL_COMPONENT_FIELD_TRANSPARENCY: Transparency
- * @E_CAL_COMPONENT_FIELD_URL: URL
- * @E_CAL_COMPONENT_FIELD_HAS_ALARMS: not a real field
- * @E_CAL_COMPONENT_FIELD_ICON: not a real field
- * @E_CAL_COMPONENT_FIELD_COMPLETE: not a real field
- * @E_CAL_COMPONENT_FIELD_RECURRING: not a real field
- * @E_CAL_COMPONENT_FIELD_OVERDUE: not a real field
- * @E_CAL_COMPONENT_FIELD_COLOR: not a real field
- * @E_CAL_COMPONENT_FIELD_STATUS: Status
- * @E_CAL_COMPONENT_FIELD_COMPONENT: not a real field
- * @E_CAL_COMPONENT_FIELD_LOCATION: Location
- * @E_CAL_COMPONENT_FIELD_NUM_FIELDS: the last member
- *
- * Field identifiers for a calendar component.
- **/
-
-/*
- * NOTE: These are also used in the ETable specification, and the column
- * numbers are saved in the user settings file. So don't reorder them!
- */
-typedef enum {
- E_CAL_COMPONENT_FIELD_CATEGORIES, /* concatenation of categories */
- E_CAL_COMPONENT_FIELD_CLASSIFICATION,
- E_CAL_COMPONENT_FIELD_COMPLETED,
- E_CAL_COMPONENT_FIELD_DTEND,
- E_CAL_COMPONENT_FIELD_DTSTART,
- E_CAL_COMPONENT_FIELD_DUE,
- E_CAL_COMPONENT_FIELD_GEO,
- E_CAL_COMPONENT_FIELD_PERCENT,
- E_CAL_COMPONENT_FIELD_PRIORITY,
- E_CAL_COMPONENT_FIELD_SUMMARY,
- E_CAL_COMPONENT_FIELD_TRANSPARENCY,
- E_CAL_COMPONENT_FIELD_URL,
- E_CAL_COMPONENT_FIELD_HAS_ALARMS, /* not a real field */
- E_CAL_COMPONENT_FIELD_ICON, /* not a real field */
- E_CAL_COMPONENT_FIELD_COMPLETE, /* not a real field */
- E_CAL_COMPONENT_FIELD_RECURRING, /* not a real field */
- E_CAL_COMPONENT_FIELD_OVERDUE, /* not a real field */
- E_CAL_COMPONENT_FIELD_COLOR, /* not a real field */
- E_CAL_COMPONENT_FIELD_STATUS,
- E_CAL_COMPONENT_FIELD_COMPONENT, /* not a real field */
- E_CAL_COMPONENT_FIELD_LOCATION,
- E_CAL_COMPONENT_FIELD_NUM_FIELDS
-} ECalComponentField;
-
-/* Structures and enumerations to return properties and their parameters */
-
-/**
- * ECalComponentClassification:
- * @E_CAL_COMPONENT_CLASS_NONE: None
- * @E_CAL_COMPONENT_CLASS_PUBLIC: Public
- * @E_CAL_COMPONENT_CLASS_PRIVATE: Private
- * @E_CAL_COMPONENT_CLASS_CONFIDENTIAL: Confidential
- * @E_CAL_COMPONENT_CLASS_UNKNOWN: Unknown
- *
- * CLASSIFICATION property
- **/
-typedef enum {
- E_CAL_COMPONENT_CLASS_NONE,
- E_CAL_COMPONENT_CLASS_PUBLIC,
- E_CAL_COMPONENT_CLASS_PRIVATE,
- E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
- E_CAL_COMPONENT_CLASS_UNKNOWN
-} ECalComponentClassification;
-
-/* Properties that have time and timezone information */
-/**
- * ECalComponentDateTime:
- * @value: an icaltimetype value
- * @tzid: a timezone ID for the @value
- *
- * Time with timezone property
- **/
-typedef struct {
- /* Actual date/time value */
- struct icaltimetype *value;
-
- /* Timezone ID */
- const gchar *tzid;
-} ECalComponentDateTime;
-
-/**
- * ECalComponentPeriodType:
- * @E_CAL_COMPONENT_PERIOD_DATETIME: Date and time
- * @E_CAL_COMPONENT_PERIOD_DURATION: Duration
- *
- * Way in which a period of time is specified
- **/
-typedef enum {
- E_CAL_COMPONENT_PERIOD_DATETIME,
- E_CAL_COMPONENT_PERIOD_DURATION
-} ECalComponentPeriodType;
-
-/**
- * ECalComponentPeriod:
- * @type: An #ECalComponentPeriodType
- * @start: When the period starts
- *
- * Period of time, can have explicit start/end times or start/duration instead
- **/
-typedef struct {
- ECalComponentPeriodType type;
-
- struct icaltimetype start;
-
- union {
- struct icaltimetype end;
- struct icaldurationtype duration;
- } u;
-} ECalComponentPeriod;
-
-/**
- * ECalComponentRangeType:
- * @E_CAL_COMPONENT_RANGE_SINGLE: Single
- * @E_CAL_COMPONENT_RANGE_THISPRIOR: This and prior
- * @E_CAL_COMPONENT_RANGE_THISFUTURE: This and future
- *
- * The type of range
- **/
-typedef enum {
- E_CAL_COMPONENT_RANGE_SINGLE,
- E_CAL_COMPONENT_RANGE_THISPRIOR,
- E_CAL_COMPONENT_RANGE_THISFUTURE
-} ECalComponentRangeType;
-
-/**
- * ECalComponentRange:
- * @type: an #ECalComponentRangeType
- * @datetime: an #ECalComponentDateTime of the range
- *
- * Describes a range
- **/
-typedef struct {
- ECalComponentRangeType type;
-
- ECalComponentDateTime datetime;
-} ECalComponentRange;
-
-/**
- * ECalComponentText:
- * @value: Description string
- * @altrep: Alternate representation URI
- *
- * For the text properties
- **/
-typedef struct {
- /* Description string */
- const gchar *value;
-
- /* Alternate representation URI */
- const gchar *altrep;
-} ECalComponentText;
-
-/**
- * ECalComponentTransparency:
- * @E_CAL_COMPONENT_TRANSP_NONE: None
- * @E_CAL_COMPONENT_TRANSP_TRANSPARENT: Transparent
- * @E_CAL_COMPONENT_TRANSP_OPAQUE: Opaque
- * @E_CAL_COMPONENT_TRANSP_UNKNOWN: Unknown
- *
- * Time transparency
- **/
-typedef enum {
- E_CAL_COMPONENT_TRANSP_NONE,
- E_CAL_COMPONENT_TRANSP_TRANSPARENT,
- E_CAL_COMPONENT_TRANSP_OPAQUE,
- E_CAL_COMPONENT_TRANSP_UNKNOWN
-} ECalComponentTransparency;
-
-/**
- * ECalComponentAttendee:
- * @value: usually a "mailto:email" of the attendee
- * @member: Member
- * @cutype: Type of the attendee
- * @role: Role of the attendee
- * @status: Current status of the attendee
- * @rsvp: Whether requires RSVP
- * @delto: Delegated to
- * @delfrom: Delegated from
- * @sentby: Sent by
- * @cn: Common name
- * @language: Language
- *
- * Describes an attendee
- **/
-typedef struct {
- const gchar *value;
-
- const gchar *member;
- icalparameter_cutype cutype;
- icalparameter_role role;
- icalparameter_partstat status;
- gboolean rsvp;
-
- const gchar *delto;
- const gchar *delfrom;
- const gchar *sentby;
- const gchar *cn;
- const gchar *language;
-} ECalComponentAttendee;
-
-/**
- * ECalComponentOrganizer:
- * @value: usually a "mailto:email" of the organizer
- * @sentby: Sent by
- * @cn: Common name
- * @language: Language
- *
- * Describes an organizer
- **/
-typedef struct {
- const gchar *value;
- const gchar *sentby;
- const gchar *cn;
- const gchar *language;
-} ECalComponentOrganizer;
-
-/* Main calendar component object */
-
typedef struct _ECalComponent ECalComponent;
typedef struct _ECalComponentClass ECalComponentClass;
typedef struct _ECalComponentPrivate ECalComponentPrivate;
@@ -327,14 +78,12 @@ struct _ECalComponentClass {
GObjectClass parent_class;
};
-/* Calendar component */
-
GType e_cal_component_get_type (void);
ECalComponent * e_cal_component_new (void);
ECalComponent * e_cal_component_new_from_string (const gchar *calobj);
ECalComponent * e_cal_component_new_from_icalcomponent
- (icalcomponent *icalcomp);
+ (ICalComponent *icalcomp);
ECalComponent * e_cal_component_clone (ECalComponent *comp);
@@ -364,16 +113,6 @@ void e_cal_component_set_uid (ECalComponent *comp,
ECalComponentId *
e_cal_component_get_id (ECalComponent *comp);
-void e_cal_component_free_id (ECalComponentId *id);
-GType e_cal_component_id_get_type (void);
-ECalComponentId *
- e_cal_component_id_new (const gchar *uid,
- const gchar *rid);
-ECalComponentId *
- e_cal_component_id_copy (const ECalComponentId *id);
-guint e_cal_component_id_hash (const ECalComponentId *id);
-gboolean e_cal_component_id_equal (const ECalComponentId *id1,
- const ECalComponentId *id2);
void e_cal_component_get_categories (ECalComponent *comp,
const gchar **categories);
@@ -581,7 +320,6 @@ gboolean e_cal_component_event_dates_match
void e_cal_component_free_categories_list
(GSList *categ_list);
-void e_cal_component_free_datetime (ECalComponentDateTime *dt);
void e_cal_component_free_range (ECalComponentRange *range);
void e_cal_component_free_exdate_list
(GSList *exdate_list);
@@ -598,114 +336,6 @@ void e_cal_component_free_text_list (GSList *text_list);
void e_cal_component_free_attendee_list
(GSList *attendee_list);
-/* Alarms */
-
-/* Opaque structure used to represent alarm subcomponents */
-typedef struct _ECalComponentAlarm ECalComponentAlarm;
-
-/**
- * ECalComponentAlarmInstance:
- * @auid: UID of the alarm
- * @trigger: Trigger time, i.e. "5 minutes before the appointment"
- * @occur_start: Actual event occurrence start to which this trigger corresponds
- * @occur_end: Actual event occurrence end to which this trigger corresponds
- *
- * An alarm occurrence, i.e. a trigger instance
- **/
-typedef struct {
- /* UID of the alarm that triggered */
- gchar *auid;
-
- /* Trigger time, i.e. "5 minutes before the appointment" */
- time_t trigger;
-
- /* Actual event occurrence to which this trigger corresponds */
- time_t occur_start;
- time_t occur_end;
-} ECalComponentAlarmInstance;
-
-/**
- * ECalComponentAlarms:
- * @comp: The actual alarm component
- * @alarms: (element-type ECalComponentAlarmInstance): List of #ECalComponentAlarmInstance structures
- *
- * Alarm trigger instances for a particular component
- **/
-typedef struct {
- /* The actual component */
- ECalComponent *comp;
-
- /* List of ECalComponentAlarmInstance structures */
- GSList *alarms;
-} ECalComponentAlarms;
-
-/**
- * ECalComponentAlarmAction:
- * @E_CAL_COMPONENT_ALARM_NONE: None
- * @E_CAL_COMPONENT_ALARM_AUDIO: Audio
- * @E_CAL_COMPONENT_ALARM_DISPLAY: Display message
- * @E_CAL_COMPONENT_ALARM_EMAIL: Email
- * @E_CAL_COMPONENT_ALARM_PROCEDURE: Procedure
- * @E_CAL_COMPONENT_ALARM_UNKNOWN: Unknown
- *
- * Alarm types
- **/
-typedef enum {
- E_CAL_COMPONENT_ALARM_NONE,
- E_CAL_COMPONENT_ALARM_AUDIO,
- E_CAL_COMPONENT_ALARM_DISPLAY,
- E_CAL_COMPONENT_ALARM_EMAIL,
- E_CAL_COMPONENT_ALARM_PROCEDURE,
- E_CAL_COMPONENT_ALARM_UNKNOWN
-} ECalComponentAlarmAction;
-
-/**
- * ECalComponentAlarmTriggerType:
- * @E_CAL_COMPONENT_ALARM_TRIGGER_NONE: None
- * @E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START: Relative to the start
- * @E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: Relative to the end
- * @E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: Absolute
- *
- * Whether a trigger is relative to the start or end of an event occurrence, or
- * whether it is specified to occur at an absolute time.
- */
-typedef enum {
- E_CAL_COMPONENT_ALARM_TRIGGER_NONE,
- E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START,
- E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END,
- E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE
-} ECalComponentAlarmTriggerType;
-
-/**
- * ECalComponentAlarmTrigger:
- * @type: An #ECalComponentAlarmTriggerType
- *
- * When the alarm is supposed to be triggered
- **/
-typedef struct {
- ECalComponentAlarmTriggerType type;
-
- union {
- struct icaldurationtype rel_duration;
- struct icaltimetype abs_time;
- } u;
-} ECalComponentAlarmTrigger;
-
-/**
- * ECalComponentAlarmRepeat:
- * @repetitions: Number of extra repetitions, zero for none
- * @duration: Interval between repetitions
- *
- * Whether and how the alarm repeats.
- **/
-typedef struct {
- /* Number of extra repetitions, zero for none */
- gint repetitions;
-
- /* Interval between repetitions */
- struct icaldurationtype duration;
-} ECalComponentAlarmRepeat;
-
gboolean e_cal_component_has_alarms (ECalComponent *comp);
void e_cal_component_add_alarm (ECalComponent *comp,
ECalComponentAlarm *alarm);
@@ -719,65 +349,6 @@ ECalComponentAlarm *
e_cal_component_get_alarm (ECalComponent *comp,
const gchar *auid);
-void e_cal_component_alarms_free (ECalComponentAlarms *alarms);
-
-/* ECalComponentAlarms */
-GType e_cal_component_alarm_get_type (void);
-ECalComponentAlarm *
- e_cal_component_alarm_new (void);
-ECalComponentAlarm *
- e_cal_component_alarm_clone (ECalComponentAlarm *alarm);
-void e_cal_component_alarm_free (ECalComponentAlarm *alarm);
-
-const gchar * e_cal_component_alarm_get_uid (ECalComponentAlarm *alarm);
-
-void e_cal_component_alarm_get_action
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmAction *action);
-void e_cal_component_alarm_set_action
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmAction action);
-
-void e_cal_component_alarm_get_attach
- (ECalComponentAlarm *alarm,
- icalattach **attach);
-void e_cal_component_alarm_set_attach
- (ECalComponentAlarm *alarm,
- icalattach *attach);
-
-void e_cal_component_alarm_get_description
- (ECalComponentAlarm *alarm,
- ECalComponentText *description);
-void e_cal_component_alarm_set_description
- (ECalComponentAlarm *alarm,
- ECalComponentText *description);
-
-void e_cal_component_alarm_get_repeat
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmRepeat *repeat);
-void e_cal_component_alarm_set_repeat
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmRepeat repeat);
-
-void e_cal_component_alarm_get_trigger
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmTrigger *trigger);
-void e_cal_component_alarm_set_trigger
- (ECalComponentAlarm *alarm,
- ECalComponentAlarmTrigger trigger);
-
-void e_cal_component_alarm_get_attendee_list
- (ECalComponentAlarm *alarm,
- GSList **attendee_list);
-void e_cal_component_alarm_set_attendee_list
- (ECalComponentAlarm *alarm,
- GSList *attendee_list);
-gboolean e_cal_component_alarm_has_attendees
- (ECalComponentAlarm *alarm);
-
-icalcomponent * e_cal_component_alarm_get_icalcomponent
- (ECalComponentAlarm *alarm);
-
G_END_DECLS
#endif /* E_CAL_COMPONENT_H */
diff --git a/src/calendar/libecal/e-cal-enums.h b/src/calendar/libecal/e-cal-enums.h
new file mode 100644
index 000000000..afa350142
--- /dev/null
+++ b/src/calendar/libecal/e-cal-enums.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Federico Mena-Quintero <federico ximian com>
+ * JP Rosevear <jpr ximian com>
+ */
+
+#if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
+#error "Only <libecal/libecal.h> should be included directly."
+#endif
+
+#ifndef E_CAL_ENUMS_H
+#define E_CAL_ENUMS_H
+
+G_BEGIN_DECLS
+
+/**
+ * ECalClientSourceType:
+ * @E_CAL_CLIENT_SOURCE_TYPE_EVENTS: Events calander
+ * @E_CAL_CLIENT_SOURCE_TYPE_TASKS: Task list calendar
+ * @E_CAL_CLIENT_SOURCE_TYPE_MEMOS: Memo list calendar
+ * @E_CAL_CLIENT_SOURCE_TYPE_LAST: Artificial 'last' value of the enum
+ *
+ * Indicates the type of calendar
+ *
+ * Since: 3.2
+ **/
+typedef enum {
+ E_CAL_CLIENT_SOURCE_TYPE_EVENTS,
+ E_CAL_CLIENT_SOURCE_TYPE_TASKS,
+ E_CAL_CLIENT_SOURCE_TYPE_MEMOS,
+ E_CAL_CLIENT_SOURCE_TYPE_LAST /*< skip >*/
+} ECalClientSourceType;
+
+/**
+ * ECalObjModType:
+ * @E_CAL_OBJ_MOD_THIS: Modify this component
+ * @E_CAL_OBJ_MOD_THIS_AND_PRIOR: Modify this component and all prior occurrances
+ * @E_CAL_OBJ_MOD_THIS_AND_FUTURE: Modify this component and all future occurrances
+ * @E_CAL_OBJ_MOD_ALL: Modify all occurrances of this component
+ * @E_CAL_OBJ_MOD_ONLY_THIS: Modify only this component
+ *
+ * Indicates the type of modification made to a calendar
+ *
+ * Since: 3.8
+ **/
+typedef enum {
+ E_CAL_OBJ_MOD_THIS = 1 << 0,
+ E_CAL_OBJ_MOD_THIS_AND_PRIOR = 1 << 1,
+ E_CAL_OBJ_MOD_THIS_AND_FUTURE = 1 << 2,
+ E_CAL_OBJ_MOD_ALL = 0x07,
+ E_CAL_OBJ_MOD_ONLY_THIS = 1 << 3
+} ECalObjModType;
+
+/**
+ * ECalComponentVType:
+ * @E_CAL_COMPONENT_NO_TYPE: Unknown or unsupported component type
+ * @E_CAL_COMPONENT_EVENT: vEvent type
+ * @E_CAL_COMPONENT_TODO: vTodo type
+ * @E_CAL_COMPONENT_JOURNAL: vJournal type
+ * @E_CAL_COMPONENT_FREEBUSY: vFreeBusy type
+ * @E_CAL_COMPONENT_TIMEZONE: vTimezone type
+ *
+ * Types of calendar components to be stored by a ECalComponent, as per RFC 2445.
+ * We don't put the alarm component type here since we store alarms as separate
+ * structures inside the other "real" components.
+ **/
+typedef enum {
+ E_CAL_COMPONENT_NO_TYPE,
+ E_CAL_COMPONENT_EVENT,
+ E_CAL_COMPONENT_TODO,
+ E_CAL_COMPONENT_JOURNAL,
+ E_CAL_COMPONENT_FREEBUSY,
+ E_CAL_COMPONENT_TIMEZONE
+} ECalComponentVType;
+
+/**
+ * ECalComponentClassification:
+ * @E_CAL_COMPONENT_CLASS_NONE: None
+ * @E_CAL_COMPONENT_CLASS_PUBLIC: Public
+ * @E_CAL_COMPONENT_CLASS_PRIVATE: Private
+ * @E_CAL_COMPONENT_CLASS_CONFIDENTIAL: Confidential
+ * @E_CAL_COMPONENT_CLASS_UNKNOWN: Unknown
+ *
+ * CLASSIFICATION property
+ **/
+typedef enum {
+ E_CAL_COMPONENT_CLASS_NONE,
+ E_CAL_COMPONENT_CLASS_PUBLIC,
+ E_CAL_COMPONENT_CLASS_PRIVATE,
+ E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
+ E_CAL_COMPONENT_CLASS_UNKNOWN
+} ECalComponentClassification;
+
+/**
+ * ECalComponentPeriodKind:
+ * @E_CAL_COMPONENT_PERIOD_DATETIME: Date and time
+ * @E_CAL_COMPONENT_PERIOD_DURATION: Duration
+ *
+ * Way in which a period of time is specified
+ **/
+typedef enum {
+ E_CAL_COMPONENT_PERIOD_DATETIME,
+ E_CAL_COMPONENT_PERIOD_DURATION
+} ECalComponentPeriodKind;
+
+/**
+ * ECalComponentRangeKind:
+ * @E_CAL_COMPONENT_RANGE_SINGLE: Single
+ * @E_CAL_COMPONENT_RANGE_THISPRIOR: This and prior
+ * @E_CAL_COMPONENT_RANGE_THISFUTURE: This and future
+ *
+ * The kind of range
+ **/
+typedef enum {
+ E_CAL_COMPONENT_RANGE_SINGLE,
+ E_CAL_COMPONENT_RANGE_THISPRIOR,
+ E_CAL_COMPONENT_RANGE_THISFUTURE
+} ECalComponentRangeKind;
+
+/**
+ * ECalComponentTransparency:
+ * @E_CAL_COMPONENT_TRANSP_NONE: None
+ * @E_CAL_COMPONENT_TRANSP_TRANSPARENT: Transparent
+ * @E_CAL_COMPONENT_TRANSP_OPAQUE: Opaque
+ * @E_CAL_COMPONENT_TRANSP_UNKNOWN: Unknown
+ *
+ * Time transparency
+ **/
+typedef enum {
+ E_CAL_COMPONENT_TRANSP_NONE,
+ E_CAL_COMPONENT_TRANSP_TRANSPARENT,
+ E_CAL_COMPONENT_TRANSP_OPAQUE,
+ E_CAL_COMPONENT_TRANSP_UNKNOWN
+} ECalComponentTransparency;
+
+/**
+ * ECalComponentAlarmAction:
+ * @E_CAL_COMPONENT_ALARM_NONE: None
+ * @E_CAL_COMPONENT_ALARM_AUDIO: Audio
+ * @E_CAL_COMPONENT_ALARM_DISPLAY: Display message
+ * @E_CAL_COMPONENT_ALARM_EMAIL: Email
+ * @E_CAL_COMPONENT_ALARM_PROCEDURE: Procedure
+ * @E_CAL_COMPONENT_ALARM_UNKNOWN: Unknown
+ *
+ * Alarm types
+ **/
+typedef enum {
+ E_CAL_COMPONENT_ALARM_NONE,
+ E_CAL_COMPONENT_ALARM_AUDIO,
+ E_CAL_COMPONENT_ALARM_DISPLAY,
+ E_CAL_COMPONENT_ALARM_EMAIL,
+ E_CAL_COMPONENT_ALARM_PROCEDURE,
+ E_CAL_COMPONENT_ALARM_UNKNOWN
+} ECalComponentAlarmAction;
+
+/**
+ * ECalComponentAlarmTriggerkind:
+ * @E_CAL_COMPONENT_ALARM_TRIGGER_NONE: None
+ * @E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START: Relative to the start
+ * @E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: Relative to the end
+ * @E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: Absolute
+ *
+ * Whether a trigger is relative to the start or end of an event occurrence, or
+ * whether it is specified to occur at an absolute time.
+ */
+typedef enum {
+ E_CAL_COMPONENT_ALARM_TRIGGER_NONE,
+ E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START,
+ E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END,
+ E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE
+} ECalComponentAlarmTriggerKind;
+
+G_END_DECLS
+
+#endif /* E_CAL_ENUMS_H */
diff --git a/src/calendar/libecal/libecal.h b/src/calendar/libecal/libecal.h
index 35a0376ba..7bc156486 100644
--- a/src/calendar/libecal/libecal.h
+++ b/src/calendar/libecal/libecal.h
@@ -27,11 +27,23 @@
#include <libecal/e-cal-client-view.h>
#include <libecal/e-cal-client.h>
#include <libecal/e-cal-component.h>
+#include <libecal/e-cal-component-alarm.h>
+#include <libecal/e-cal-component-alarm-instance.h>
+#include <libecal/e-cal-component-alarm-repeat.h>
+#include <libecal/e-cal-component-alarm-trigger.h>
+#include <libecal/e-cal-component-alarms.h>
+#include <libecal/e-cal-component-attendee.h>
+#include <libecal/e-cal-component-datetime.h>
+#include <libecal/e-cal-component-id.h>
+#include <libecal/e-cal-component-organizer.h>
+#include <libecal/e-cal-component-period.h>
+#include <libecal/e-cal-component-range.h>
+#include <libecal/e-cal-component-text.h>
+#include <libecal/e-cal-enums.h>
#include <libecal/e-cal-enumtypes.h>
#include <libecal/e-cal-recur.h>
#include <libecal/e-cal-system-timezone.h>
#include <libecal/e-cal-time-util.h>
-#include <libecal/e-cal-types.h>
#include <libecal/e-cal-util.h>
#include <libecal/e-reminder-watcher.h>
#include <libecal/e-timezone-cache.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]