[evolution/wip/mcrha/eds-libical-glib] Port to libical-glib



commit ca11c140a6dc14ac81cce1c9019a9ed9d7248874
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 10 12:19:12 2019 +0200

    Port to libical-glib

 CMakeLists.txt                                     |   45 +-
 config.h.in                                        |   12 -
 src/calendar/gui/CMakeLists.txt                    |    6 +-
 src/calendar/gui/calendar-config.c                 |   31 +-
 src/calendar/gui/calendar-config.h                 |    2 +-
 src/calendar/gui/comp-util.c                       |  765 +++++------
 src/calendar/gui/comp-util.h                       |   76 +-
 src/calendar/gui/e-alarm-list.c                    |   69 +-
 src/calendar/gui/e-cal-component-preview.c         |  212 ++--
 src/calendar/gui/e-cal-component-preview.h         |    2 +-
 src/calendar/gui/e-cal-data-model-subscriber.c     |    2 +-
 src/calendar/gui/e-cal-data-model.c                |  223 ++--
 src/calendar/gui/e-cal-data-model.h                |    4 +-
 src/calendar/gui/e-cal-dialogs.c                   |  141 +--
 src/calendar/gui/e-cal-dialogs.h                   |    4 +-
 src/calendar/gui/e-cal-list-view.c                 |  158 ++-
 src/calendar/gui/e-cal-list-view.h                 |   30 +-
 src/calendar/gui/e-cal-model-calendar.c            |  169 +--
 src/calendar/gui/e-cal-model-memos.c               |   14 +-
 src/calendar/gui/e-cal-model-tasks.c               |  492 ++++----
 src/calendar/gui/e-cal-model.c                     |  638 +++++-----
 src/calendar/gui/e-cal-model.h                     |   33 +-
 src/calendar/gui/e-cal-ops.c                       |  445 ++++---
 src/calendar/gui/e-cal-ops.h                       |   16 +-
 src/calendar/gui/e-calendar-view.c                 |  584 +++++----
 src/calendar/gui/e-calendar-view.h                 |   24 +-
 src/calendar/gui/e-cell-date-edit-text.c           |  204 ++-
 src/calendar/gui/e-cell-date-edit-text.h           |   34 +-
 src/calendar/gui/e-comp-editor-event.c             |  237 ++--
 src/calendar/gui/e-comp-editor-memo.c              |    2 +-
 src/calendar/gui/e-comp-editor-page-attachments.c  |  106 +-
 src/calendar/gui/e-comp-editor-page-general.c      |  282 +++--
 src/calendar/gui/e-comp-editor-page-recurrence.c   |  529 ++++----
 src/calendar/gui/e-comp-editor-page-reminders.c    |  558 ++++----
 src/calendar/gui/e-comp-editor-page-schedule.c     |  144 ++-
 src/calendar/gui/e-comp-editor-page.c              |   16 +-
 src/calendar/gui/e-comp-editor-page.h              |    8 +-
 src/calendar/gui/e-comp-editor-property-part.c     |  393 +++---
 src/calendar/gui/e-comp-editor-property-part.h     |   70 +-
 src/calendar/gui/e-comp-editor-property-parts.c    |  259 ++--
 src/calendar/gui/e-comp-editor-task.c              |  136 +-
 src/calendar/gui/e-comp-editor.c                   |  492 ++++----
 src/calendar/gui/e-comp-editor.h                   |   16 +-
 src/calendar/gui/e-date-time-list.c                |  120 +-
 src/calendar/gui/e-date-time-list.h                |   12 +-
 src/calendar/gui/e-day-view-main-item.c            |   77 +-
 src/calendar/gui/e-day-view-time-item.c            |   66 +-
 src/calendar/gui/e-day-view-time-item.h            |    2 +-
 src/calendar/gui/e-day-view-top-item.c             |   29 +-
 src/calendar/gui/e-day-view.c                      |  764 +++++------
 src/calendar/gui/e-meeting-attendee.c              |  658 ++++------
 src/calendar/gui/e-meeting-attendee.h              |  217 ++--
 src/calendar/gui/e-meeting-list-view.c             |   65 +-
 src/calendar/gui/e-meeting-store.c                 |  477 ++++---
 src/calendar/gui/e-meeting-store.h                 |    4 +-
 src/calendar/gui/e-meeting-utils.c                 |    4 +-
 src/calendar/gui/e-memo-table.c                    |  152 +--
 src/calendar/gui/e-memo-table.h                    |   10 +-
 src/calendar/gui/e-send-options-utils.c            |  103 +-
 src/calendar/gui/e-send-options-utils.h            |    2 +-
 src/calendar/gui/e-task-table.c                    |  215 ++--
 src/calendar/gui/e-task-table.h                    |    6 -
 src/calendar/gui/e-timezone-entry.c                |   56 +-
 src/calendar/gui/e-timezone-entry.h                |   11 +-
 src/calendar/gui/e-to-do-pane.c                    |  384 +++---
 src/calendar/gui/e-week-view-event-item.c          |    6 +-
 src/calendar/gui/e-week-view-main-item.c           |   14 +-
 src/calendar/gui/e-week-view.c                     |  406 +++---
 src/calendar/gui/ea-cal-view-event.c               |    2 +-
 src/calendar/gui/itip-utils.c                      | 1004 ++++++++-------
 src/calendar/gui/itip-utils.h                      |   11 +-
 src/calendar/gui/print.c                           |  461 +++----
 src/calendar/gui/print.h                           |    2 +-
 src/calendar/gui/tag-calendar.c                    |  188 +--
 src/calendar/gui/tag-calendar.h                    |    2 +-
 src/calendar/importers/icalendar-importer.c        |  508 ++++----
 src/e-util/e-timezone-dialog.c                     |  144 ++-
 src/e-util/e-timezone-dialog.h                     |    9 +-
 src/e-util/test-source-selector.c                  |   38 +-
 src/modules/alarm-notify/alarm-notify.c            |   24 +-
 src/modules/calendar/e-cal-attachment-handler.c    |  114 +-
 src/modules/calendar/e-cal-base-shell-backend.c    |  121 +-
 src/modules/calendar/e-cal-base-shell-sidebar.c    |   25 +-
 src/modules/calendar/e-cal-shell-content.c         |  199 +--
 src/modules/calendar/e-cal-shell-view-actions.c    |  219 ++--
 src/modules/calendar/e-cal-shell-view-memopad.c    |   22 +-
 src/modules/calendar/e-cal-shell-view-private.c    |  106 +-
 src/modules/calendar/e-cal-shell-view-taskpad.c    |   30 +-
 src/modules/calendar/e-cal-shell-view.c            |   13 +-
 src/modules/calendar/e-calendar-preferences.c      |   34 +-
 src/modules/calendar/e-memo-shell-content.c        |   25 +-
 src/modules/calendar/e-memo-shell-view-actions.c   |   18 +-
 src/modules/calendar/e-task-shell-content.c        |   34 +-
 src/modules/calendar/e-task-shell-view-actions.c   |   18 +-
 src/modules/calendar/e-task-shell-view.c           |    9 +-
 .../composer-to-meeting/e-composer-to-meeting.c    |   65 +-
 .../composer-to-meeting/e-meeting-to-composer.c    |   64 +-
 src/modules/itip-formatter/itip-view.c             | 1327 +++++++++++---------
 src/modules/settings/e-settings-cal-model.c        |    8 +-
 src/modules/settings/e-settings-client-cache.c     |    8 +-
 src/modules/settings/e-settings-meeting-store.c    |    8 +-
 .../e-mail-parser-tnef-attachment.c                |    8 +-
 src/plugins/mail-to-task/mail-to-task.c            |  140 +--
 src/plugins/pst-import/pst-importer.c              |  183 +--
 src/plugins/publish-calendar/publish-format-fb.c   |   30 +-
 src/plugins/publish-calendar/publish-format-ical.c |   34 +-
 src/plugins/save-calendar/CMakeLists.txt           |    1 +
 src/plugins/save-calendar/csv-format.c             |  122 +-
 src/plugins/save-calendar/format-handler.h         |    1 +
 src/plugins/save-calendar/ical-format.c            |   34 +-
 src/plugins/save-calendar/rdf-format.c             |  120 +-
 src/shell/main.c                                   |    8 +-
 112 files changed, 8947 insertions(+), 8137 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5e24687b5..65b7f4175a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -286,7 +286,7 @@ pkg_check_modules(GNOME_PLATFORM REQUIRED
 pkg_check_modules(EVOLUTION_DATA_SERVER REQUIRED
        camel-1.2>=${eds_minimum_version}
        libebook-1.2>=${eds_minimum_version}
-       libecal-1.2>=${eds_minimum_version}
+       libecal-2.0>=${eds_minimum_version}
        libedataserver-1.2>=${eds_minimum_version}
        libedataserverui-1.2>=${eds_minimum_version}
        libebackend-1.2>=${eds_minimum_version}
@@ -589,49 +589,6 @@ set(HAVE_LIBNOTIFY ${LIBNOTIFY_FOUND})
 pkg_check_modules(LIBUNITY unity>=${libunity_minimum_version})
 set(HAVE_LIBUNITY ${LIBUNITY_FOUND})
 
-# ******************************
-# libical tweaks
-# ******************************
-
-set(CMAKE_REQUIRED_DEFINITIONS ${EVOLUTION_DATA_SERVER_CFLAGS_OTHER})
-set(CMAKE_REQUIRED_INCLUDES ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS})
-set(CMAKE_REQUIRED_LIBRARIES ${EVOLUTION_DATA_SERVER_LDFLAGS})
-
-CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
-                       int main(void) {
-                               ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN);
-                               return 0;
-                       }" HAVE_ICAL_UNKNOWN_TOKEN_HANDLING)
-
-CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
-                       int main(void) {
-                               icaltzutil_set_exact_vtimezones_support (0);
-                               return 0;
-                       }" HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT)
-
-CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
-                       int main(void) {
-                               icalparameter *param;
-                               param = icalproperty_get_first_parameter (NULL, ICAL_FILENAME_PARAMETER);
-                               icalparameter_get_filename (param);
-                               icalparameter_new_filename (NULL);
-                               return 0;
-                       }" HAVE_ICAL_FILENAME_PARAMETER)
-
-CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
-                       int main(void) {
-                               icalproperty *prop;
-                               prop = icalcomponent_get_first_property (NULL, ICAL_COLOR_PROPERTY);
-                               icalproperty_get_color (prop);
-                               icalproperty_set_color (prop, \"white\");
-                               prop = icalproperty_new_color (NULL);
-                               return 0;
-                       }" HAVE_ICAL_COLOR_PROPERTY)
-
-unset(CMAKE_REQUIRED_DEFINITIONS)
-unset(CMAKE_REQUIRED_INCLUDES)
-unset(CMAKE_REQUIRED_LIBRARIES)
-
 # ******************************
 # gspell
 # ******************************
diff --git a/config.h.in b/config.h.in
index 4a134f6b66..19bfc49cc9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -99,18 +99,6 @@
 /* Define if you have libunity */
 #cmakedefine HAVE_LIBUNITY 1
 
-/* libical provides ical_set_unknown_token_handling_setting function */
-#cmakedefine HAVE_ICAL_UNKNOWN_TOKEN_HANDLING 1
-
-/* libical provides icaltzutil_set_exact_vtimezones_support function */
-#cmakedefine HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT 1
-
-/* libical provides ICAL_FILENAME_PARAMETER */
-#cmakedefine HAVE_ICAL_FILENAME_PARAMETER 1
-
-/* libical provides ICAL_COLOR_PROPERTY */
-#cmakedefine HAVE_ICAL_COLOR_PROPERTY 1
-
 /* When defined GSpell usage is enabled */
 #cmakedefine HAVE_GSPELL 1
 
diff --git a/src/calendar/gui/CMakeLists.txt b/src/calendar/gui/CMakeLists.txt
index 09cf401d6c..dcf5fe171d 100644
--- a/src/calendar/gui/CMakeLists.txt
+++ b/src/calendar/gui/CMakeLists.txt
@@ -35,8 +35,8 @@ set(SOURCES
        e-cal-dialogs.c
        e-cal-event.c
        e-cal-list-view.c
-       e-cal-model-calendar.c
        e-cal-model.c
+       e-cal-model-calendar.c
        e-cal-model-memos.c
        e-cal-model-tasks.c
        e-cal-ops.c
@@ -55,11 +55,11 @@ set(SOURCES
        e-comp-editor-property-parts.c
        e-comp-editor-task.c
        e-date-time-list.c
+       e-day-view.c
        e-day-view-layout.c
        e-day-view-main-item.c
        e-day-view-time-item.c
        e-day-view-top-item.c
-       e-day-view.c
        e-meeting-attendee.c
        e-meeting-list-view.c
        e-meeting-store.c
@@ -73,11 +73,11 @@ set(SOURCES
        e-send-options-utils.c
        e-task-table.c
        e-to-do-pane.c
+       e-week-view.c
        e-week-view-event-item.c
        e-week-view-layout.c
        e-week-view-main-item.c
        e-week-view-titles-item.c
-       e-week-view.c
        e-weekday-chooser.c
        e-timezone-entry.c
        itip-utils.c
diff --git a/src/calendar/gui/calendar-config.c b/src/calendar/gui/calendar-config.c
index 4be9405875..d523d5f846 100644
--- a/src/calendar/gui/calendar-config.c
+++ b/src/calendar/gui/calendar-config.c
@@ -113,17 +113,17 @@ calendar_config_get_timezone (void)
        return calendar_config_get_timezone_stored ();
 }
 
-icaltimezone *
+ICalTimezone *
 calendar_config_get_icaltimezone (void)
 {
        gchar *location;
-       icaltimezone *zone = NULL;
+       ICalTimezone *zone = NULL;
 
        calendar_config_init ();
 
        location = calendar_config_get_timezone ();
        if (location) {
-               zone = icaltimezone_get_builtin_timezone (location);
+               zone = i_cal_timezone_get_builtin_timezone (location);
 
                g_free (location);
        }
@@ -228,30 +228,33 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed)
                                sexp = g_strdup ("(is-completed?)");
                } else {
                        gchar *isodate;
-                       icaltimezone *zone;
-                       struct icaltimetype tt;
+                       ICalTimezone *zone;
+                       ICalTime *tt;
                        time_t t;
 
                        /* Get the current time, and subtract the appropriate
                         * number of days/hours/minutes. */
                        zone = calendar_config_get_icaltimezone ();
-                       tt = icaltime_current_time_with_zone (zone);
+                       tt = i_cal_time_current_time_with_zone (zone);
 
                        switch (units) {
                        case E_DURATION_DAYS:
-                               icaltime_adjust (&tt, -value, 0, 0, 0);
+                               i_cal_time_adjust (tt, -value, 0, 0, 0);
                                break;
                        case E_DURATION_HOURS:
-                               icaltime_adjust (&tt, 0, -value, 0, 0);
+                               i_cal_time_adjust (tt, 0, -value, 0, 0);
                                break;
                        case E_DURATION_MINUTES:
-                               icaltime_adjust (&tt, 0, 0, -value, 0);
+                               i_cal_time_adjust (tt, 0, 0, -value, 0);
                                break;
                        default:
+                               g_clear_object (&tt);
                                g_return_val_if_reached (NULL);
                        }
 
-                       t = icaltime_as_timet_with_zone (tt, zone);
+                       t = i_cal_time_as_timet_with_zone (tt, zone);
+
+                       g_clear_object (&tt);
 
                        /* Convert the time to an ISO date string, and build
                         * the query sub-expression. */
@@ -399,14 +402,14 @@ calendar_config_get_day_second_zone (void)
 void
 calendar_config_select_day_second_zone (GtkWidget *parent)
 {
-       icaltimezone *zone = NULL;
+       ICalTimezone *zone = NULL;
        ETimezoneDialog *tzdlg;
        GtkWidget *dialog;
        gchar *second_location;
 
        second_location = calendar_config_get_day_second_zone ();
        if (second_location && *second_location)
-               zone = icaltimezone_get_builtin_timezone (second_location);
+               zone = i_cal_timezone_get_builtin_timezone (second_location);
        g_free (second_location);
 
        if (!zone)
@@ -424,10 +427,10 @@ calendar_config_select_day_second_zone (GtkWidget *parent)
                const gchar *location = NULL;
 
                zone = e_timezone_dialog_get_timezone (tzdlg);
-               if (zone == icaltimezone_get_utc_timezone ()) {
+               if (zone == i_cal_timezone_get_utc_timezone ()) {
                        location = "UTC";
                } else if (zone) {
-                       location = icaltimezone_get_location (zone);
+                       location = i_cal_timezone_get_location (zone);
                }
 
                calendar_config_set_day_second_zone (location);
diff --git a/src/calendar/gui/calendar-config.h b/src/calendar/gui/calendar-config.h
index b71aa92fa0..2df088c538 100644
--- a/src/calendar/gui/calendar-config.h
+++ b/src/calendar/gui/calendar-config.h
@@ -47,7 +47,7 @@ void calendar_config_remove_notification (CalendarConfigChangedFunc func, gpoint
  */
 
 /* The current timezone, e.g. "Europe/London". */
-icaltimezone *calendar_config_get_icaltimezone (void);
+ICalTimezone *calendar_config_get_icaltimezone (void);
 
 /* Whether we use 24-hour format or 12-hour format (AM/PM). */
 gboolean  calendar_config_get_24_hour_format   (void);
diff --git a/src/calendar/gui/comp-util.c b/src/calendar/gui/comp-util.c
index e66eaf37c2..064e44aa71 100644
--- a/src/calendar/gui/comp-util.c
+++ b/src/calendar/gui/comp-util.c
@@ -39,38 +39,38 @@
 /**
  * cal_comp_util_add_exdate:
  * @comp: A calendar component object.
- * @itt: Time for the exception.
+ * @t: Time for the exception.
+ * @zone: an #ICalTimezone
  *
  * Adds an exception date to the current list of EXDATE properties in a calendar
  * component object.
  **/
 void
 cal_comp_util_add_exdate (ECalComponent *comp,
-                          time_t t,
-                          icaltimezone *zone)
+                         time_t t,
+                         ICalTimezone *zone)
 {
-       GSList *list;
+       GSList *exdates;
        ECalComponentDateTime *cdt;
 
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
-       e_cal_component_get_exdate_list (comp, &list);
+       exdates = e_cal_component_get_exdates (comp);
+
+       cdt = e_cal_component_datetime_new_take (i_cal_time_from_timet_with_zone (t, FALSE, zone),
+               zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
 
-       cdt = g_new (ECalComponentDateTime, 1);
-       cdt->value = g_new (struct icaltimetype, 1);
-       *cdt->value = icaltime_from_timet_with_zone (t, FALSE, zone);
-       cdt->tzid = g_strdup (icaltimezone_get_tzid (zone));
+       exdates = g_slist_append (exdates, cdt);
+       e_cal_component_set_exdates (comp, exdates);
 
-       list = g_slist_append (list, cdt);
-       e_cal_component_set_exdate_list (comp, list);
-       e_cal_component_free_exdate_list (list);
+       g_slist_free_full (exdates, e_cal_component_datetime_free);
 }
 
 /* Returns TRUE if the TZIDs are equivalent, i.e. both NULL or the same. */
 static gboolean
-e_cal_component_compare_tzid (const gchar *tzid1,
-                              const gchar *tzid2)
+cal_comp_util_tzid_equal (const gchar *tzid1,
+                         const gchar *tzid2)
 {
        gboolean retval = TRUE;
 
@@ -99,35 +99,40 @@ e_cal_component_compare_tzid (const gchar *tzid1,
  **/
 gboolean
 cal_comp_util_compare_event_timezones (ECalComponent *comp,
-                                       ECalClient *client,
-                                       icaltimezone *zone)
+                                      ECalClient *client,
+                                      ICalTimezone *zone)
 {
-       ECalComponentDateTime start_datetime, end_datetime;
+       ECalComponentDateTime *start_datetime, *end_datetime;
        const gchar *tzid;
        gboolean retval = FALSE;
-       icaltimezone *start_zone = NULL;
-       icaltimezone *end_zone = NULL;
+       ICalTimezone *start_zone = NULL;
+       ICalTimezone *end_zone = NULL;
        gint offset1, offset2;
 
-       tzid = icaltimezone_get_tzid (zone);
+       tzid = i_cal_timezone_get_tzid (zone);
 
-       e_cal_component_get_dtstart (comp, &start_datetime);
-       e_cal_component_get_dtend (comp, &end_datetime);
+       start_datetime = e_cal_component_get_dtstart (comp);
+       end_datetime = e_cal_component_get_dtend (comp);
 
        /* If either the DTSTART or the DTEND is a DATE value, we return TRUE.
         * Maybe if one was a DATE-TIME we should check that, but that should
         * not happen often. */
-       if ((start_datetime.value && start_datetime.value->is_date)
-           || (end_datetime.value && end_datetime.value->is_date)) {
+       if ((start_datetime && i_cal_time_is_date (e_cal_component_datetime_get_value (start_datetime))) ||
+           (end_datetime && i_cal_time_is_date (e_cal_component_datetime_get_value (end_datetime)))) {
                retval = TRUE;
                goto out;
        }
 
+       if (!start_datetime || !end_datetime) {
+               retval = FALSE;
+               goto out;
+       }
+
        /* If the event uses UTC for DTSTART & DTEND, return TRUE. Outlook
         * will send single events as UTC, so we don't want to mark all of
         * these. */
-       if ((!start_datetime.value || icaltime_is_utc (*start_datetime.value))
-           && (!end_datetime.value || icaltime_is_utc (*end_datetime.value))) {
+       if (i_cal_time_is_utc (e_cal_component_datetime_get_value (start_datetime)) &&
+           i_cal_time_is_utc (e_cal_component_datetime_get_value (end_datetime))) {
                retval = TRUE;
                goto out;
        }
@@ -135,14 +140,15 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp,
        /* If the event uses floating time for DTSTART & DTEND, return TRUE.
         * Imported vCalendar files will use floating times, so we don't want
         * to mark all of these. */
-       if (!start_datetime.tzid && !end_datetime.tzid) {
+       if (!e_cal_component_datetime_get_tzid (start_datetime) &&
+           !e_cal_component_datetime_get_tzid (end_datetime)) {
                retval = TRUE;
                goto out;
        }
 
        /* FIXME: DURATION may be used instead. */
-       if (e_cal_component_compare_tzid (tzid, start_datetime.tzid)
-           && e_cal_component_compare_tzid (tzid, end_datetime.tzid)) {
+       if (cal_comp_util_tzid_equal (tzid, e_cal_component_datetime_get_tzid (start_datetime)) &&
+           cal_comp_util_tzid_equal (tzid, e_cal_component_datetime_get_tzid (end_datetime))) {
                /* If both TZIDs are the same as the given zone's TZID, then
                 * we know the timezones are the same so we return TRUE. */
                retval = TRUE;
@@ -150,43 +156,41 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp,
                /* If the TZIDs differ, we have to compare the UTC offsets
                 * of the start and end times, using their own timezones and
                 * the given timezone. */
-               if (start_datetime.tzid)
-                       e_cal_client_get_timezone_sync (client, start_datetime.tzid, &start_zone, NULL, NULL);
-               else
+               if (!e_cal_component_datetime_get_tzid (start_datetime) ||
+                   !e_cal_client_get_timezone_sync (client, e_cal_component_datetime_get_tzid 
(start_datetime), &start_zone, NULL, NULL))
                        start_zone = NULL;
 
                if (start_zone == NULL)
                        goto out;
 
-               if (start_datetime.value) {
-                       offset1 = icaltimezone_get_utc_offset (
+               if (e_cal_component_datetime_get_value (start_datetime)) {
+                       offset1 = i_cal_timezone_get_utc_offset (
                                start_zone,
-                               start_datetime.value,
+                               e_cal_component_datetime_get_value (start_datetime),
                                NULL);
-                       offset2 = icaltimezone_get_utc_offset (
+                       offset2 = i_cal_timezone_get_utc_offset (
                                zone,
-                               start_datetime.value,
+                               e_cal_component_datetime_get_value (start_datetime),
                                NULL);
                        if (offset1 != offset2)
                                goto out;
                }
 
-               if (end_datetime.tzid)
-                       e_cal_client_get_timezone_sync (client, end_datetime.tzid, &end_zone, NULL, NULL);
-               else
+               if (!e_cal_component_datetime_get_tzid (end_datetime) ||
+                   !e_cal_client_get_timezone_sync (client, e_cal_component_datetime_get_tzid 
(end_datetime), &end_zone, NULL, NULL))
                        end_zone = NULL;
 
                if (end_zone == NULL)
                        goto out;
 
-               if (end_datetime.value) {
-                       offset1 = icaltimezone_get_utc_offset (
+               if (e_cal_component_datetime_get_value (end_datetime)) {
+                       offset1 = i_cal_timezone_get_utc_offset (
                                end_zone,
-                               end_datetime.value,
+                               e_cal_component_datetime_get_value (end_datetime),
                                NULL);
-                       offset2 = icaltimezone_get_utc_offset (
+                       offset2 = i_cal_timezone_get_utc_offset (
                                zone,
-                               end_datetime.value,
+                               e_cal_component_datetime_get_value (end_datetime),
                                NULL);
                        if (offset1 != offset2)
                                goto out;
@@ -197,8 +201,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp,
 
  out:
 
-       e_cal_component_free_datetime (&start_datetime);
-       e_cal_component_free_datetime (&end_datetime);
+       e_cal_component_datetime_free (start_datetime);
+       e_cal_component_datetime_free (end_datetime);
 
        return retval;
 }
@@ -224,7 +228,7 @@ cal_comp_is_on_server_sync (ECalComponent *comp,
 {
        const gchar *uid;
        gchar *rid = NULL;
-       icalcomponent *icalcomp = NULL;
+       ICalComponent *icomp = NULL;
        GError *local_error = NULL;
 
        g_return_val_if_fail (comp != NULL, FALSE);
@@ -238,7 +242,7 @@ cal_comp_is_on_server_sync (ECalComponent *comp,
         * confirm and we can just delete the event.  Otherwise, we ask
         * the user.
         */
-       e_cal_component_get_uid (comp, &uid);
+       uid = e_cal_component_get_uid (comp);
 
        /* TODO We should not be checking for this here. But since
         *      e_cal_util_construct_instance does not create the instances
@@ -247,9 +251,9 @@ cal_comp_is_on_server_sync (ECalComponent *comp,
                rid = e_cal_component_get_recurid_as_string (comp);
        }
 
-       if (e_cal_client_get_object_sync (client, uid, rid, &icalcomp, cancellable, &local_error) &&
-           icalcomp != NULL) {
-               icalcomponent_free (icalcomp);
+       if (e_cal_client_get_object_sync (client, uid, rid, &icomp, cancellable, &local_error) &&
+           icomp != NULL) {
+               g_object_unref (icomp);
                g_free (rid);
 
                return TRUE;
@@ -268,10 +272,10 @@ cal_comp_is_on_server_sync (ECalComponent *comp,
 /**
  * cal_comp_is_icalcomp_on_server_sync:
  * The same as cal_comp_is_on_server_sync(), only the component parameter is
- * icalcomponent, not the ECalComponent.
+ * ICalComponent, not the ECalComponent.
  **/
 gboolean
-cal_comp_is_icalcomp_on_server_sync (icalcomponent *icalcomp,
+cal_comp_is_icalcomp_on_server_sync (ICalComponent *icomp,
                                     ECalClient *client,
                                     GCancellable *cancellable,
                                     GError **error)
@@ -279,10 +283,10 @@ cal_comp_is_icalcomp_on_server_sync (icalcomponent *icalcomp,
        gboolean on_server;
        ECalComponent *comp;
 
-       if (!icalcomp || !client || !icalcomponent_get_uid (icalcomp))
+       if (!icomp || !client || !i_cal_component_get_uid (icomp))
                return FALSE;
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        if (!comp)
                return FALSE;
 
@@ -310,21 +314,22 @@ cal_comp_event_new_with_defaults_sync (ECalClient *client,
                                       GCancellable *cancellable,
                                       GError **error)
 {
-       icalcomponent *icalcomp = NULL;
+       ICalComponent *icomp = NULL;
        ECalComponent *comp;
        ECalComponentAlarm *alarm;
-       icalproperty *icalprop;
-       ECalComponentAlarmTrigger trigger;
+       ICalProperty *prop;
+       ICalDuration *duration;
+       ECalComponentAlarmTrigger *trigger;
 
-       if (client && !e_cal_client_get_default_object_sync (client, &icalcomp, cancellable, error))
+       if (client && !e_cal_client_get_default_object_sync (client, &icomp, cancellable, error))
                return NULL;
 
-       if (icalcomp == NULL)
-               icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
+       if (!icomp)
+               icomp = i_cal_component_new (I_CAL_VEVENT_COMPONENT);
 
        comp = e_cal_component_new ();
-       if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
-               icalcomponent_free (icalcomp);
+       if (!e_cal_component_set_icalcomponent (comp, icomp)) {
+               g_clear_object (&icomp);
 
                e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
        }
@@ -338,37 +343,36 @@ cal_comp_event_new_with_defaults_sync (ECalClient *client,
         * summary when it gets committed to the server. For that, we add a
         * X-EVOLUTION-NEEDS-DESCRIPTION property to the alarm's component.
         */
-       icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
-       icalprop = icalproperty_new_x ("1");
-       icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION");
-       icalcomponent_add_property (icalcomp, icalprop);
+       prop = i_cal_property_new_x ("1");
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-NEEDS-DESCRIPTION");
+       e_cal_component_property_bag_take (e_cal_component_alarm_get_property_bag (alarm), prop);
 
        e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
 
-       trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-
-       memset (&trigger.u.rel_duration, 0, sizeof (trigger.u.rel_duration));
-
-       trigger.u.rel_duration.is_neg = TRUE;
+       duration = i_cal_duration_null_duration ();
+       i_cal_duration_set_is_neg (duration, TRUE);
 
        switch (default_reminder_units) {
        case E_DURATION_MINUTES:
-               trigger.u.rel_duration.minutes = default_reminder_interval;
+               i_cal_duration_set_minutes (duration, default_reminder_interval);
                break;
 
        case E_DURATION_HOURS:
-               trigger.u.rel_duration.hours = default_reminder_interval;
+               i_cal_duration_set_hours (duration, default_reminder_interval);
                break;
 
        case E_DURATION_DAYS:
-               trigger.u.rel_duration.days = default_reminder_interval;
+               i_cal_duration_set_days (duration, default_reminder_interval);
                break;
 
        default:
                g_warning ("wrong units %d\n", default_reminder_units);
        }
 
-       e_cal_component_alarm_set_trigger (alarm, trigger);
+       trigger = e_cal_component_alarm_trigger_new_relative (E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, 
duration);
+       g_clear_object (&duration);
+
+       e_cal_component_alarm_take_trigger (alarm, trigger);
 
        e_cal_component_add_alarm (comp, alarm);
        e_cal_component_alarm_free (alarm);
@@ -386,9 +390,9 @@ cal_comp_event_new_with_current_time_sync (ECalClient *client,
                                           GError **error)
 {
        ECalComponent *comp;
-       struct icaltimetype itt;
-       ECalComponentDateTime dt;
-       icaltimezone *zone;
+       ICalTime *itt;
+       ECalComponentDateTime *dt;
+       ICalTimezone *zone;
 
        comp = cal_comp_event_new_with_defaults_sync (
                client, all_day, use_default_reminder,
@@ -400,23 +404,22 @@ cal_comp_event_new_with_current_time_sync (ECalClient *client,
        zone = calendar_config_get_icaltimezone ();
 
        if (all_day) {
-               itt = icaltime_from_timet_with_zone (time (NULL), 1, zone);
+               itt = i_cal_time_from_timet_with_zone (time (NULL), 1, zone);
 
-               dt.value = &itt;
-               dt.tzid = icaltimezone_get_tzid (zone);
+               dt = e_cal_component_datetime_new_take (itt, zone ? g_strdup (i_cal_timezone_get_tzid (zone)) 
: NULL);
 
-               e_cal_component_set_dtstart (comp, &dt);
-               e_cal_component_set_dtend (comp, &dt);
+               e_cal_component_set_dtstart (comp, dt);
+               e_cal_component_set_dtend (comp, dt);
        } else {
-               itt = icaltime_current_time_with_zone (zone);
-               icaltime_adjust (&itt, 0, 1, -itt.minute, -itt.second);
+               itt = i_cal_time_current_time_with_zone (zone);
+               i_cal_time_adjust (itt, 0, 1, -i_cal_time_get_minute (itt), -i_cal_time_get_second (itt));
+
+               dt = e_cal_component_datetime_new_take (itt, zone ? g_strdup (i_cal_timezone_get_tzid (zone)) 
: NULL);
 
-               dt.value = &itt;
-               dt.tzid = icaltimezone_get_tzid (zone);
+               e_cal_component_set_dtstart (comp, dt);
 
-               e_cal_component_set_dtstart (comp, &dt);
-               icaltime_adjust (&itt, 0, 1, 0, 0);
-               e_cal_component_set_dtend (comp, &dt);
+               i_cal_time_adjust (e_cal_component_datetime_get_value (dt), 0, 1, 0, 0);
+               e_cal_component_set_dtend (comp, dt);
        }
 
        return comp;
@@ -428,17 +431,17 @@ cal_comp_task_new_with_defaults_sync (ECalClient *client,
                                      GError **error)
 {
        ECalComponent *comp;
-       icalcomponent *icalcomp = NULL;
+       ICalComponent *icomp = NULL;
 
-       if (client && !e_cal_client_get_default_object_sync (client, &icalcomp, cancellable, error))
+       if (client && !e_cal_client_get_default_object_sync (client, &icomp, cancellable, error))
                return NULL;
 
-       if (icalcomp == NULL)
-               icalcomp = icalcomponent_new (ICAL_VTODO_COMPONENT);
+       if (!icomp)
+               icomp = i_cal_component_new (I_CAL_VTODO_COMPONENT);
 
        comp = e_cal_component_new ();
-       if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
-               icalcomponent_free (icalcomp);
+       if (!e_cal_component_set_icalcomponent (comp, icomp)) {
+               g_object_unref (icomp);
 
                e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
        }
@@ -452,17 +455,17 @@ cal_comp_memo_new_with_defaults_sync (ECalClient *client,
                                      GError **error)
 {
        ECalComponent *comp;
-       icalcomponent *icalcomp = NULL;
+       ICalComponent *icomp = NULL;
 
-       if (client && !e_cal_client_get_default_object_sync (client, &icalcomp, cancellable, error))
+       if (client && !e_cal_client_get_default_object_sync (client, &icomp, cancellable, error))
                return NULL;
 
-       if (icalcomp == NULL)
-               icalcomp = icalcomponent_new (ICAL_VJOURNAL_COMPONENT);
+       if (!icomp)
+               icomp = i_cal_component_new (I_CAL_VJOURNAL_COMPONENT);
 
        comp = e_cal_component_new ();
-       if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
-               icalcomponent_free (icalcomp);
+       if (!e_cal_component_set_icalcomponent (comp, icomp)) {
+               g_object_unref (icomp);
 
                e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_JOURNAL);
        }
@@ -493,10 +496,10 @@ cal_comp_update_time_by_active_window (ECalComponent *comp,
                        EShellView *shell_view;
                        ECalendarView *cal_view;
                        time_t start = 0, end = 0;
-                       icaltimezone *zone;
-                       struct icaltimetype itt;
-                       icalcomponent *icalcomp;
-                       icalproperty *prop;
+                       ICalTimezone *zone;
+                       ICalTime *itt;
+                       ICalComponent *icomp;
+                       ICalProperty *prop;
 
                        shell_view = e_shell_window_peek_shell_view (shell_window, "calendar");
                        g_return_if_fail (shell_view != NULL);
@@ -508,20 +511,20 @@ cal_comp_update_time_by_active_window (ECalComponent *comp,
                        g_return_if_fail (e_calendar_view_get_visible_time_range (cal_view, &start, &end));
 
                        zone = e_cal_model_get_timezone (e_calendar_view_get_model (cal_view));
-                       itt = icaltime_from_timet_with_zone (start, FALSE, zone);
+                       itt = i_cal_time_from_timet_with_zone (start, FALSE, zone);
 
-                       icalcomp = e_cal_component_get_icalcomponent (comp);
-                       prop = icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY);
+                       icomp = e_cal_component_get_icalcomponent (comp);
+                       prop = i_cal_component_get_first_property (icomp, I_CAL_DTSTART_PROPERTY);
                        if (prop) {
-                               icalproperty_set_dtstart (prop, itt);
+                               i_cal_property_set_dtstart (prop, itt);
+                               g_object_unref (prop);
                        } else {
-                               prop = icalproperty_new_dtstart (itt);
-                               icalcomponent_add_property (icalcomp, prop);
+                               prop = i_cal_property_new_dtstart (itt);
+                               i_cal_component_take_property (icomp, prop);
                        }
 
-                       e_cal_component_rescan (comp);
-
                        g_clear_object (&cal_view);
+                       g_object_unref (itt);
                }
        }
 }
@@ -547,7 +550,7 @@ cal_comp_util_get_n_icons (ECalComponent *comp,
        g_return_val_if_fail (comp != NULL, 0);
        g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), 0);
 
-       e_cal_component_get_categories_list (comp, &categories_list);
+       categories_list = e_cal_component_get_categories_list (comp);
        for (elem = categories_list; elem; elem = elem->next) {
                const gchar *category;
                GdkPixbuf *pixbuf = NULL;
@@ -566,7 +569,7 @@ cal_comp_util_get_n_icons (ECalComponent *comp,
                        }
                }
        }
-       e_cal_component_free_categories_list (categories_list);
+       g_slist_free_full (categories_list, g_free);
 
        return num_icons;
 }
@@ -654,38 +657,39 @@ datetime_to_zone (ECalClient *client,
                   ECalComponentDateTime *date,
                   const gchar *tzid)
 {
-       icaltimezone *from, *to;
+       ICalTimezone *from, *to;
 
        g_return_if_fail (date != NULL);
 
-       if (date->tzid == NULL || tzid == NULL ||
-           date->tzid == tzid || g_str_equal (date->tzid, tzid))
+       if (!e_cal_component_datetime_get_tzid (date) || !tzid ||
+           e_cal_component_datetime_get_tzid (date) == tzid ||
+           g_str_equal (e_cal_component_datetime_get_tzid (date), tzid))
                return;
 
-       from = icaltimezone_get_builtin_timezone_from_tzid (date->tzid);
+       from = i_cal_timezone_get_builtin_timezone_from_tzid (e_cal_component_datetime_get_tzid (date));
        if (!from) {
                GError *error = NULL;
 
                e_cal_client_get_timezone_sync (
-                       client, date->tzid, &from, NULL, &error);
+                       client, e_cal_component_datetime_get_tzid (date), &from, NULL, &error);
 
                if (error != NULL) {
                        g_warning (
                                "%s: Could not get timezone '%s' from server: %s",
-                               G_STRFUNC, date->tzid ? date->tzid : "",
+                               G_STRFUNC, e_cal_component_datetime_get_tzid (date) ? 
e_cal_component_datetime_get_tzid (date) : "",
                                error->message);
                        g_error_free (error);
                }
        }
 
-       to = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+       to = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
        if (!to) {
                /* do not check failure here, maybe the zone is not available there */
                e_cal_client_get_timezone_sync (client, tzid, &to, NULL, NULL);
        }
 
-       icaltimezone_convert_time (date->value, from, to);
-       date->tzid = tzid;
+       i_cal_timezone_convert_time (e_cal_component_datetime_get_value (date), from, to);
+       e_cal_component_datetime_set_tzid (date, tzid);
 }
 
 /**
@@ -701,19 +705,19 @@ cal_comp_set_dtstart_with_oldzone (ECalClient *client,
                                    ECalComponent *comp,
                                    const ECalComponentDateTime *pdate)
 {
-       ECalComponentDateTime olddate, date;
+       ECalComponentDateTime *olddate, *date;
 
        g_return_if_fail (comp != NULL);
        g_return_if_fail (pdate != NULL);
 
-       e_cal_component_get_dtstart (comp, &olddate);
+       olddate = e_cal_component_get_dtstart (comp);
+       date = e_cal_component_datetime_copy (pdate);
 
-       date = *pdate;
+       datetime_to_zone (client, date, e_cal_component_datetime_get_tzid (olddate));
+       e_cal_component_set_dtstart (comp, date);
 
-       datetime_to_zone (client, &date, olddate.tzid);
-       e_cal_component_set_dtstart (comp, &date);
-
-       e_cal_component_free_datetime (&olddate);
+       e_cal_component_datetime_free (olddate);
+       e_cal_component_datetime_free (date);
 }
 
 /**
@@ -729,19 +733,19 @@ cal_comp_set_dtend_with_oldzone (ECalClient *client,
                                  ECalComponent *comp,
                                  const ECalComponentDateTime *pdate)
 {
-       ECalComponentDateTime olddate, date;
+       ECalComponentDateTime *olddate, *date;
 
        g_return_if_fail (comp != NULL);
        g_return_if_fail (pdate != NULL);
 
-       e_cal_component_get_dtend (comp, &olddate);
-
-       date = *pdate;
+       olddate = e_cal_component_get_dtend (comp);
+       date = e_cal_component_datetime_copy (pdate);
 
-       datetime_to_zone (client, &date, olddate.tzid);
-       e_cal_component_set_dtend (comp, &date);
+       datetime_to_zone (client, date, e_cal_component_datetime_get_tzid (olddate));
+       e_cal_component_set_dtend (comp, date);
 
-       e_cal_component_free_datetime (&olddate);
+       e_cal_component_datetime_free (olddate);
+       e_cal_component_datetime_free (date);
 }
 
 gboolean
@@ -751,199 +755,220 @@ comp_util_sanitize_recurrence_master_sync (ECalComponent *comp,
                                           GError **error)
 {
        ECalComponent *master = NULL;
-       icalcomponent *icalcomp = NULL;
-       ECalComponentRange rid;
-       ECalComponentDateTime sdt;
+       ICalComponent *icomp = NULL;
+       ECalComponentRange *rid;
+       ECalComponentDateTime *sdt, *rdt;
        const gchar *uid;
 
        /* Get the master component */
-       e_cal_component_get_uid (comp, &uid);
+       uid = e_cal_component_get_uid (comp);
 
-       if (!e_cal_client_get_object_sync (client, uid, NULL, &icalcomp, cancellable, error))
+       if (!e_cal_client_get_object_sync (client, uid, NULL, &icomp, cancellable, error))
                return FALSE;
 
-       master = e_cal_component_new_from_icalcomponent (icalcomp);
+       master = e_cal_component_new_from_icalcomponent (icomp);
        if (!master) {
                g_warn_if_reached ();
                return FALSE;
        }
 
        /* Compare recur id and start date */
-       e_cal_component_get_recurid (comp, &rid);
-       e_cal_component_get_dtstart (comp, &sdt);
+       rid = e_cal_component_get_recurid (comp);
+       sdt = e_cal_component_get_dtstart (comp);
+       rdt = rid ? e_cal_component_range_get_datetime (rid) : NULL;
 
-       if (rid.datetime.value && sdt.value &&
-           icaltime_compare_date_only (
-           *rid.datetime.value, *sdt.value) == 0) {
-               ECalComponentDateTime msdt, medt, edt;
-               gint *sequence;
+       if (rdt && sdt &&
+           i_cal_time_compare_date_only (e_cal_component_datetime_get_value (rdt), 
e_cal_component_datetime_get_value (sdt)) == 0) {
+               ECalComponentDateTime *msdt, *medt, *edt;
+               gint sequence, yy = 0, mm = 0, dd = 0;
 
-               e_cal_component_get_dtstart (master, &msdt);
-               e_cal_component_get_dtend (master, &medt);
+               msdt = e_cal_component_get_dtstart (master);
+               medt = e_cal_component_get_dtend (master);
 
-               e_cal_component_get_dtend (comp, &edt);
+               edt = e_cal_component_get_dtend (comp);
 
-               if (!msdt.value || !medt.value || !edt.value) {
+               if (!msdt || !medt || !edt) {
                        g_warn_if_reached ();
-                       e_cal_component_free_datetime (&msdt);
-                       e_cal_component_free_datetime (&medt);
-                       e_cal_component_free_datetime (&edt);
-                       e_cal_component_free_datetime (&sdt);
-                       e_cal_component_free_range (&rid);
+                       e_cal_component_datetime_free (msdt);
+                       e_cal_component_datetime_free (medt);
+                       e_cal_component_datetime_free (edt);
+                       e_cal_component_datetime_free (sdt);
+                       e_cal_component_range_free (rid);
                        g_object_unref (master);
                        return FALSE;
                }
 
-               sdt.value->year = msdt.value->year;
-               sdt.value->month = msdt.value->month;
-               sdt.value->day = msdt.value->day;
+               i_cal_time_get_date (e_cal_component_datetime_get_value (msdt), &yy, &mm, &dd);
+               i_cal_time_set_date (e_cal_component_datetime_get_value (sdt), yy, mm, dd);
 
-               edt.value->year = medt.value->year;
-               edt.value->month = medt.value->month;
-               edt.value->day = medt.value->day;
+               i_cal_time_get_date (e_cal_component_datetime_get_value (medt), &yy, &mm, &dd);
+               i_cal_time_set_date (e_cal_component_datetime_get_value (edt), yy, mm, dd);
 
-               e_cal_component_set_dtstart (comp, &sdt);
-               e_cal_component_set_dtend (comp, &edt);
+               e_cal_component_set_dtstart (comp, sdt);
+               e_cal_component_set_dtend (comp, edt);
 
-               e_cal_component_get_sequence (master, &sequence);
+               sequence = e_cal_component_get_sequence (master);
                e_cal_component_set_sequence (comp, sequence);
 
-               e_cal_component_free_datetime (&msdt);
-               e_cal_component_free_datetime (&medt);
-               e_cal_component_free_datetime (&edt);
+               e_cal_component_datetime_free (msdt);
+               e_cal_component_datetime_free (medt);
+               e_cal_component_datetime_free (edt);
        }
 
-       e_cal_component_free_datetime (&sdt);
-       e_cal_component_free_range (&rid);
        e_cal_component_set_recurid (comp, NULL);
 
+       e_cal_component_datetime_free (sdt);
+       e_cal_component_range_free (rid);
        g_object_unref (master);
 
        return TRUE;
 }
 
 gchar *
-icalcomp_suggest_filename (icalcomponent *icalcomp,
-                           const gchar *default_name)
+comp_util_suggest_filename (ICalComponent *icomp,
+                           const gchar *default_name)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *summary = NULL;
+       gchar *filename;
 
-       if (!icalcomp)
+       if (!icomp)
                return g_strconcat (default_name, ".ics", NULL);
 
-       prop = icalcomponent_get_first_property (icalcomp, ICAL_SUMMARY_PROPERTY);
+       prop = i_cal_component_get_first_property (icomp, I_CAL_SUMMARY_PROPERTY);
        if (prop)
-               summary = icalproperty_get_summary (prop);
+               summary = i_cal_property_get_summary (prop);
 
        if (!summary || !*summary)
                summary = default_name;
 
-       return g_strconcat (summary, ".ics", NULL);
+       filename = g_strconcat (summary, ".ics", NULL);
+
+       g_clear_object (&prop);
+
+       return filename;
 }
 
 void
 cal_comp_get_instance_times (ECalClient *client,
-                            icalcomponent *icalcomp,
-                            const icaltimezone *default_zone,
-                            time_t *instance_start,
-                            gboolean *start_is_date,
-                            time_t *instance_end,
-                            gboolean *end_is_date,
+                            ICalComponent *icomp,
+                            const ICalTimezone *default_zone,
+                            ICalTime **out_instance_start,
+                            ICalTime **out_instance_end,
                             GCancellable *cancellable)
 {
-       struct icaltimetype start_time, end_time;
-       const icaltimezone *zone = default_zone;
+       ICalTime *start_time, *end_time;
+       const ICalTimezone *zone = default_zone;
 
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
-       g_return_if_fail (instance_start != NULL);
-       g_return_if_fail (instance_end != NULL);
+       g_return_if_fail (icomp != NULL);
+       g_return_if_fail (out_instance_start != NULL);
+       g_return_if_fail (out_instance_end != NULL);
 
-       start_time = icalcomponent_get_dtstart (icalcomp);
-       end_time = icalcomponent_get_dtend (icalcomp);
+       start_time = i_cal_component_get_dtstart (icomp);
+       end_time = i_cal_component_get_dtend (icomp);
 
        /* Some event can have missing DTEND, then use the start_time for them */
-       if (icaltime_is_null_time (end_time))
-               end_time = start_time;
+       if (!end_time || i_cal_time_is_null_time (end_time)) {
+               g_clear_object (&end_time);
+
+               end_time = i_cal_time_new_clone (start_time);
+       }
 
-       if (start_time.zone) {
-               zone = start_time.zone;
+       if (i_cal_time_get_timezone (start_time)) {
+               zone = i_cal_time_get_timezone (start_time);
        } else {
-               icalparameter *param = NULL;
-               icalproperty *prop = icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY);
+               ICalParameter *param = NULL;
+               ICalProperty *prop = i_cal_component_get_first_property (icomp, I_CAL_DTSTART_PROPERTY);
 
                if (prop) {
-                       param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
 
                        if (param) {
                                const gchar *tzid = NULL;
-                               icaltimezone *st_zone = NULL;
+                               ICalTimezone *st_zone = NULL;
 
-                               tzid = icalparameter_get_tzid (param);
-                               if (tzid)
-                                       e_cal_client_get_timezone_sync (client, tzid, &st_zone, cancellable, 
NULL);
+                               tzid = i_cal_parameter_get_tzid (param);
+                               if (tzid && !e_cal_client_get_timezone_sync (client, tzid, &st_zone, 
cancellable, NULL))
+                                       st_zone = NULL;
 
                                if (st_zone)
                                        zone = st_zone;
+
+                               g_object_unref (param);
                        }
+
+                       g_object_unref (prop);
                }
        }
 
-       *instance_start = icaltime_as_timet_with_zone (start_time, zone);
-       if (start_is_date)
-               *start_is_date = start_time.is_date;
+       *out_instance_start = i_cal_time_new_clone (start_time);
+       i_cal_time_set_timezone (*out_instance_start, zone);
 
-       if (end_time.zone) {
-               zone = end_time.zone;
+       if (i_cal_time_get_timezone (end_time)) {
+               zone = i_cal_time_get_timezone (end_time);
        } else {
-               icalparameter *param = NULL;
-               icalproperty *prop = icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY);
+               ICalParameter *param = NULL;
+               ICalProperty *prop = i_cal_component_get_first_property (icomp, I_CAL_DTEND_PROPERTY);
+
+               if (!prop)
+                       prop = i_cal_component_get_first_property (icomp, I_CAL_DTSTART_PROPERTY);
 
                if (prop) {
-                       param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
 
                        if (param) {
                                const gchar *tzid = NULL;
-                               icaltimezone *end_zone = NULL;
+                               ICalTimezone *end_zone = NULL;
 
-                               tzid = icalparameter_get_tzid (param);
-                               if (tzid)
-                                       e_cal_client_get_timezone_sync (client, tzid, &end_zone, cancellable, 
NULL);
+                               tzid = i_cal_parameter_get_tzid (param);
+                               if (tzid && !e_cal_client_get_timezone_sync (client, tzid, &end_zone, 
cancellable, NULL))
+                                       end_zone = NULL;
 
                                if (end_zone)
                                        zone = end_zone;
+
+                               g_object_unref (param);
                        }
+
+                       g_object_unref (prop);
                }
        }
 
-       *instance_end = icaltime_as_timet_with_zone (end_time, zone);
-       if (end_is_date)
-               *end_is_date = end_time.is_date;
+       *out_instance_end = i_cal_time_new_clone (end_time);
+       i_cal_time_set_timezone (*out_instance_end, zone);
+
+       g_clear_object (&start_time);
+       g_clear_object (&end_time);
 }
 
 time_t
 cal_comp_gdate_to_timet (const GDate *date,
-                        const icaltimezone *with_zone)
+                        const ICalTimezone *with_zone)
 {
        struct tm tm;
-       struct icaltimetype tt;
+       ICalTime *tt;
+       time_t res;
 
        g_return_val_if_fail (date != NULL, (time_t) -1);
        g_return_val_if_fail (g_date_valid (date), (time_t) -1);
 
        g_date_to_struct_tm (date, &tm);
 
-       tt = tm_to_icaltimetype (&tm, TRUE);
+       tt = e_cal_util_tm_to_icaltime (&tm, TRUE);
        if (with_zone)
-               return icaltime_as_timet_with_zone (tt, with_zone);
+               res = i_cal_time_as_timet_with_zone (tt, (ICalTimezone *) with_zone);
+       else
+               res = i_cal_time_as_timet (tt);
+
+       g_clear_object (&tt);
 
-       return icaltime_as_timet (tt);
+       return res;
 }
 
 typedef struct _AsyncContext {
        ECalClient *src_client;
-       icalcomponent *icalcomp_clone;
+       ICalComponent *icomp_clone;
        gboolean do_copy;
 } AsyncContext;
 
@@ -959,21 +984,17 @@ struct ForeachTzidData
 static void
 async_context_free (AsyncContext *async_context)
 {
-       if (async_context->src_client)
-               g_object_unref (async_context->src_client);
-
-       if (async_context->icalcomp_clone)
-               icalcomponent_free (async_context->icalcomp_clone);
-
+       g_clear_object (&async_context->src_client);
+       g_clear_object (&async_context->icomp_clone);
        g_slice_free (AsyncContext, async_context);
 }
 
 static void
-add_timezone_to_cal_cb (icalparameter *param,
+add_timezone_to_cal_cb (ICalParameter *param,
                         gpointer data)
 {
        struct ForeachTzidData *ftd = data;
-       icaltimezone *tz = NULL;
+       ICalTimezone *tz = NULL;
        const gchar *tzid;
 
        g_return_if_fail (ftd != NULL);
@@ -988,7 +1009,7 @@ add_timezone_to_cal_cb (icalparameter *param,
                return;
        }
 
-       tzid = icalparameter_get_tzid (param);
+       tzid = i_cal_parameter_get_tzid (param);
        if (!tzid || !*tzid)
                return;
 
@@ -1011,7 +1032,7 @@ cal_comp_transfer_item_to_thread (GSimpleAsyncResult *simple,
        cal_comp_transfer_item_to_sync (
                async_context->src_client,
                E_CAL_CLIENT (source_object),
-               async_context->icalcomp_clone,
+               async_context->icomp_clone,
                async_context->do_copy,
                cancellable, &local_error);
 
@@ -1021,23 +1042,23 @@ cal_comp_transfer_item_to_thread (GSimpleAsyncResult *simple,
 
 void
 cal_comp_transfer_item_to (ECalClient *src_client,
-                           ECalClient *dest_client,
-                           icalcomponent *icalcomp_vcal,
-                           gboolean do_copy,
-                           GCancellable *cancellable,
-                           GAsyncReadyCallback callback,
-                           gpointer user_data)
+                          ECalClient *dest_client,
+                          ICalComponent *icomp_vcal,
+                          gboolean do_copy,
+                          GCancellable *cancellable,
+                          GAsyncReadyCallback callback,
+                          gpointer user_data)
 {
        GSimpleAsyncResult *simple;
        AsyncContext *async_context;
 
        g_return_if_fail (E_IS_CAL_CLIENT (src_client));
        g_return_if_fail (E_IS_CAL_CLIENT (dest_client));
-       g_return_if_fail (icalcomp_vcal != NULL);
+       g_return_if_fail (icomp_vcal != NULL);
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->src_client = g_object_ref (src_client);
-       async_context->icalcomp_clone = icalcomponent_new_clone (icalcomp_vcal);
+       async_context->icomp_clone = i_cal_component_new_clone (icomp_vcal);
        async_context->do_copy = do_copy;
 
        simple = g_simple_async_result_new (
@@ -1077,15 +1098,15 @@ cal_comp_transfer_item_to_finish (ECalClient *client,
 
 gboolean
 cal_comp_transfer_item_to_sync (ECalClient *src_client,
-                                ECalClient *dest_client,
-                                icalcomponent *icalcomp_vcal,
-                                gboolean do_copy,
-                                GCancellable *cancellable,
-                                GError **error)
+                               ECalClient *dest_client,
+                               ICalComponent *icomp_vcal,
+                               gboolean do_copy,
+                               GCancellable *cancellable,
+                               GError **error)
 {
-       icalcomponent *icalcomp;
-       icalcomponent *icalcomp_event, *subcomp;
-       icalcomponent_kind icalcomp_kind;
+       ICalComponent *icomp;
+       ICalComponent *icomp_event, *subcomp;
+       ICalComponentKind icomp_kind;
        const gchar *uid;
        gchar *new_uid = NULL;
        struct ForeachTzidData ftd;
@@ -1096,21 +1117,21 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
 
        g_return_val_if_fail (E_IS_CAL_CLIENT (src_client), FALSE);
        g_return_val_if_fail (E_IS_CAL_CLIENT (dest_client), FALSE);
-       g_return_val_if_fail (icalcomp_vcal != NULL, FALSE);
+       g_return_val_if_fail (icomp_vcal != NULL, FALSE);
 
-       icalcomp_event = icalcomponent_get_inner (icalcomp_vcal);
-       g_return_val_if_fail (icalcomp_event != NULL, FALSE);
+       icomp_event = i_cal_component_get_inner (icomp_vcal);
+       g_return_val_if_fail (icomp_event != NULL, FALSE);
 
        source_type = e_cal_client_get_source_type (src_client);
        switch (source_type) {
                case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
-                       icalcomp_kind = ICAL_VEVENT_COMPONENT;
+                       icomp_kind = I_CAL_VEVENT_COMPONENT;
                        break;
                case E_CAL_CLIENT_SOURCE_TYPE_TASKS:
-                       icalcomp_kind = ICAL_VTODO_COMPONENT;
+                       icomp_kind = I_CAL_VTODO_COMPONENT;
                        break;
                case E_CAL_CLIENT_SOURCE_TYPE_MEMOS:
-                       icalcomp_kind = ICAL_VJOURNAL_COMPONENT;
+                       icomp_kind = I_CAL_VJOURNAL_COMPONENT;
                        break;
                default:
                        g_return_val_if_reached (FALSE);
@@ -1120,20 +1141,20 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                e_client_get_source (E_CLIENT (src_client)), e_client_get_source (E_CLIENT (dest_client)));
        processed_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
-       icalcomp_event = icalcomponent_get_first_component (icalcomp_vcal, icalcomp_kind);
+       icomp_event = i_cal_component_get_first_component (icomp_vcal, icomp_kind);
        /*
         * This check should be removed in the near future.
         * We should be able to work properly with multiselection, which means that we always
         * will receive a component with subcomponents.
         */
-       if (icalcomp_event == NULL)
-               icalcomp_event = icalcomp_vcal;
+       if (icomp_event == NULL)
+               icomp_event = icomp_vcal;
        for (;
-            icalcomp_event;
-            icalcomp_event = icalcomponent_get_next_component (icalcomp_vcal, icalcomp_kind)) {
+            icomp_event;
+            g_object_unref (icomp_event), icomp_event = i_cal_component_get_next_component (icomp_vcal, 
icomp_kind)) {
                GError *local_error = NULL;
 
-               uid = icalcomponent_get_uid (icalcomp_event);
+               uid = i_cal_component_get_uid (icomp_event);
 
                if (g_hash_table_lookup (processed_uids, uid))
                        continue;
@@ -1141,12 +1162,12 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                if (do_copy && same_client)
                        success = FALSE;
                else
-                       success = e_cal_client_get_object_sync (dest_client, uid, NULL, &icalcomp, 
cancellable, &local_error);
+                       success = e_cal_client_get_object_sync (dest_client, uid, NULL, &icomp, cancellable, 
&local_error);
                if (success) {
                        success = e_cal_client_modify_object_sync (
-                               dest_client, icalcomp_event, E_CAL_OBJ_MOD_ALL, cancellable, error);
+                               dest_client, icomp_event, E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, 
cancellable, error);
 
-                       icalcomponent_free (icalcomp);
+                       g_clear_object (&icomp);
                        if (!success)
                                goto exit;
 
@@ -1154,12 +1175,12 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                                ECalObjModType mod_type = E_CAL_OBJ_MOD_THIS;
 
                                /* Remove the item from the source calendar. */
-                               if (e_cal_util_component_is_instance (icalcomp_event) ||
-                                   e_cal_util_component_has_recurrences (icalcomp_event))
+                               if (e_cal_util_component_is_instance (icomp_event) ||
+                                   e_cal_util_component_has_recurrences (icomp_event))
                                        mod_type = E_CAL_OBJ_MOD_ALL;
 
                                success = e_cal_client_remove_object_sync (
-                                               src_client, uid, NULL, mod_type, cancellable, error);
+                                               src_client, uid, NULL, mod_type, E_CAL_OPERATION_FLAG_NONE, 
cancellable, error);
                                if (!success)
                                        goto exit;
                        }
@@ -1173,7 +1194,7 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        g_clear_error (&local_error);
                }
 
-               if (e_cal_util_component_is_instance (icalcomp_event)) {
+               if (e_cal_util_component_is_instance (icomp_event)) {
                        GSList *ecalcomps = NULL, *eiter;
                        ECalComponent *comp;
 
@@ -1184,36 +1205,36 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        if (ecalcomps && !ecalcomps->next) {
                                /* only one component, no need for a vCalendar list */
                                comp = ecalcomps->data;
-                               icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
+                               icomp = i_cal_component_new_clone (e_cal_component_get_icalcomponent (comp));
                        } else {
-                               icalcomp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
+                               icomp = i_cal_component_new (I_CAL_VCALENDAR_COMPONENT);
                                for (eiter = ecalcomps; eiter; eiter = g_slist_next (eiter)) {
                                        comp = eiter->data;
 
-                                       icalcomponent_add_component (
-                                               icalcomp,
-                                               icalcomponent_new_clone (e_cal_component_get_icalcomponent 
(comp)));
+                                       i_cal_component_take_component (
+                                               icomp,
+                                               i_cal_component_new_clone (e_cal_component_get_icalcomponent 
(comp)));
                                }
                        }
 
-                       e_cal_client_free_ecalcomp_slist (ecalcomps);
+                       e_util_free_nullable_object_slist (ecalcomps);
                } else {
-                       icalcomp = icalcomponent_new_clone (icalcomp_event);
+                       icomp = i_cal_component_new_clone (icomp_event);
                }
 
                if (do_copy) {
                        /* Change the UID to avoid problems with duplicated UID */
                        new_uid = e_util_generate_uid ();
-                       if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
+                       if (i_cal_component_isa (icomp) == I_CAL_VCALENDAR_COMPONENT) {
                                /* in case of a vCalendar, the component might have detached instances,
                                 * thus change the UID on all of the subcomponents of it */
-                               for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
+                               for (subcomp = i_cal_component_get_first_component (icomp, icomp_kind);
                                     subcomp;
-                                    subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
-                                       icalcomponent_set_uid (subcomp, new_uid);
+                                    g_object_unref (subcomp), subcomp = i_cal_component_get_next_component 
(icomp, icomp_kind)) {
+                                       i_cal_component_set_uid (subcomp, new_uid);
                                }
                        } else {
-                               icalcomponent_set_uid (icalcomp, new_uid);
+                               i_cal_component_set_uid (icomp, new_uid);
                        }
                        g_free (new_uid);
                        new_uid = NULL;
@@ -1225,16 +1246,18 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                ftd.error = error;
                ftd.success = TRUE;
 
-               if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
+               if (i_cal_component_isa (icomp) == I_CAL_VCALENDAR_COMPONENT) {
                        /* in case of a vCalendar, the component might have detached instances,
                         * thus check timezones on all of the subcomponents of it */
-                       for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
+                       for (subcomp = i_cal_component_get_first_component (icomp, icomp_kind);
                             subcomp && ftd.success;
-                            subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
-                               icalcomponent_foreach_tzid (subcomp, add_timezone_to_cal_cb, &ftd);
+                            g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (icomp, 
icomp_kind)) {
+                               i_cal_component_foreach_tzid (subcomp, add_timezone_to_cal_cb, &ftd);
                        }
+
+                       g_clear_object (&subcomp);
                } else {
-                       icalcomponent_foreach_tzid (icalcomp, add_timezone_to_cal_cb, &ftd);
+                       i_cal_component_foreach_tzid (icomp, add_timezone_to_cal_cb, &ftd);
                }
 
                if (!ftd.success) {
@@ -1242,53 +1265,57 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        goto exit;
                }
 
-               if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
+               if (i_cal_component_isa (icomp) == I_CAL_VCALENDAR_COMPONENT) {
                        gboolean did_add = FALSE;
 
                        /* in case of a vCalendar, the component might have detached instances,
                         * thus add the master object first, and then all of the subcomponents of it */
-                       for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
+                       for (subcomp = i_cal_component_get_first_component (icomp, icomp_kind);
                             subcomp && !did_add;
-                            subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
-                               if (icaltime_is_null_time (icalcomponent_get_recurrenceid (subcomp))) {
+                            g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (icomp, 
icomp_kind)) {
+                               if (!e_cal_util_component_has_property (subcomp, 
I_CAL_RECURRENCEID_PROPERTY)) {
                                        did_add = TRUE;
                                        success = e_cal_client_create_object_sync (
-                                               dest_client, subcomp,
+                                               dest_client, subcomp, E_CAL_OPERATION_FLAG_NONE,
                                                &new_uid, cancellable, error);
                                        g_free (new_uid);
                                }
                        }
 
+                       g_clear_object (&subcomp);
+
                        if (!success) {
-                               icalcomponent_free (icalcomp);
+                               g_clear_object (&icomp);
                                goto exit;
                        }
 
                        /* deal with detached instances */
-                       for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
+                       for (subcomp = i_cal_component_get_first_component (icomp, icomp_kind);
                             subcomp && success;
-                            subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
-                               if (!icaltime_is_null_time (icalcomponent_get_recurrenceid (subcomp))) {
+                            g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (icomp, 
icomp_kind)) {
+                               if (e_cal_util_component_has_property (subcomp, I_CAL_RECURRENCEID_PROPERTY)) 
{
                                        if (did_add) {
                                                success = e_cal_client_modify_object_sync (
                                                        dest_client, subcomp,
-                                                       E_CAL_OBJ_MOD_THIS, cancellable, error);
+                                                       E_CAL_OBJ_MOD_THIS, E_CAL_OPERATION_FLAG_NONE, 
cancellable, error);
                                        } else {
                                                /* just in case there are only detached instances and no 
master object */
                                                did_add = TRUE;
                                                success = e_cal_client_create_object_sync (
-                                                       dest_client, subcomp,
+                                                       dest_client, subcomp, E_CAL_OPERATION_FLAG_NONE,
                                                        &new_uid, cancellable, error);
                                                g_free (new_uid);
                                        }
                                }
                        }
+
+                       g_clear_object (&subcomp);
                } else {
-                       success = e_cal_client_create_object_sync (dest_client, icalcomp, &new_uid, 
cancellable, error);
+                       success = e_cal_client_create_object_sync (dest_client, icomp, 
E_CAL_OPERATION_FLAG_NONE, &new_uid, cancellable, error);
                        g_free (new_uid);
                }
 
-               icalcomponent_free (icalcomp);
+               g_clear_object (&icomp);
                if (!success)
                        goto exit;
 
@@ -1296,11 +1323,11 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        ECalObjModType mod_type = E_CAL_OBJ_MOD_THIS;
 
                        /* Remove the item from the source calendar. */
-                       if (e_cal_util_component_is_instance (icalcomp_event) ||
-                           e_cal_util_component_has_recurrences (icalcomp_event))
+                       if (e_cal_util_component_is_instance (icomp_event) ||
+                           e_cal_util_component_has_recurrences (icomp_event))
                                mod_type = E_CAL_OBJ_MOD_ALL;
 
-                       success = e_cal_client_remove_object_sync (src_client, uid, NULL, mod_type, 
cancellable, error);
+                       success = e_cal_client_remove_object_sync (src_client, uid, NULL, mod_type, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error);
                        if (!success)
                                goto exit;
                }
@@ -1315,72 +1342,60 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
 }
 
 void
-cal_comp_util_update_tzid_parameter (icalproperty *prop,
-                                    const struct icaltimetype tt)
+cal_comp_util_update_tzid_parameter (ICalProperty *prop,
+                                    const ICalTime *tt)
 {
-       icalparameter *param;
+       ICalParameter *param;
        const gchar *tzid = NULL;
 
        g_return_if_fail (prop != NULL);
 
-       if (!icaltime_is_valid_time (tt) ||
-           icaltime_is_null_time (tt))
+       if (!tt || !i_cal_time_is_valid_time ((ICalTime *) tt) ||
+           i_cal_time_is_null_time ((ICalTime *) tt))
                return;
 
-       param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
-       if (tt.zone)
-               tzid = icaltimezone_get_tzid ((icaltimezone *) tt.zone);
+       param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
+       if (i_cal_time_get_timezone ((ICalTime *) tt))
+               tzid = i_cal_timezone_get_tzid (i_cal_time_get_timezone ((ICalTime *) tt));
 
-       if (tt.zone && tzid && *tzid && !icaltime_is_utc (tt) && !tt.is_date) {
+       if (i_cal_time_get_timezone ((ICalTime *) tt) && tzid && *tzid &&
+           !i_cal_time_is_utc ((ICalTime *) tt) &&
+           !i_cal_time_is_date ((ICalTime *) tt)) {
                if (param) {
-                       icalparameter_set_tzid (param, (gchar *) tzid);
+                       i_cal_parameter_set_tzid (param, (gchar *) tzid);
+                       g_object_unref (param);
                } else {
-                       param = icalparameter_new_tzid ((gchar *) tzid);
-                       icalproperty_add_parameter (prop, param);
+                       param = i_cal_parameter_new_tzid ((gchar *) tzid);
+                       i_cal_property_take_parameter (prop, param);
                }
        } else if (param) {
-               icalproperty_remove_parameter_by_kind (prop, ICAL_TZID_PARAMETER);
+               i_cal_property_remove_parameter_by_kind (prop, I_CAL_TZID_PARAMETER);
+               g_object_unref (param);
        }
 }
 
 /* Returns <0 for time before today, 0 for today, >0 for after today (future) */
 gint
-cal_comp_util_compare_time_with_today (const struct icaltimetype time_tt)
+cal_comp_util_compare_time_with_today (const ICalTime *time_tt)
 {
-       struct icaltimetype now_tt;
+       ICalTime *now_tt, *tt = (ICalTime *) time_tt;
+       gint res;
 
-       if (icaltime_is_null_time (time_tt))
+       if (!tt || i_cal_time_is_null_time (tt))
                return 0;
 
-       if (time_tt.is_date) {
-               now_tt = icaltime_today ();
-               return icaltime_compare_date_only (time_tt, now_tt);
+       if (i_cal_time_is_date (tt)) {
+               now_tt = i_cal_time_today ();
+               res = i_cal_time_compare_date_only (tt, now_tt);
        } else {
-               now_tt = icaltime_current_time_with_zone (time_tt.zone);
-               now_tt.zone = time_tt.zone;
+               now_tt = i_cal_time_current_time_with_zone (i_cal_time_get_timezone (tt));
+               i_cal_time_set_timezone (now_tt, i_cal_time_get_timezone (tt));
+               res = i_cal_time_compare (tt, now_tt);
        }
 
-       return icaltime_compare (time_tt, now_tt);
-}
-
-/* Returns whether removed any */
-gboolean
-cal_comp_util_remove_all_properties (icalcomponent *component,
-                                    icalproperty_kind kind)
-{
-       icalproperty *prop;
-       gboolean removed_any = FALSE;
-
-       g_return_val_if_fail (component != NULL, FALSE);
-
-       while (prop = icalcomponent_get_first_property (component, kind), prop) {
-               icalcomponent_remove_property (component, prop);
-               icalproperty_free (prop);
-
-               removed_any = TRUE;
-       }
+       g_clear_object (&now_tt);
 
-       return removed_any;
+       return res;
 }
 
 gboolean
@@ -1444,59 +1459,66 @@ cal_comp_util_set_added_attendees_mails (ECalComponent *comp,
        g_object_set_data_full (G_OBJECT (comp), "new-attendees", emails, free_slist_strs);
 }
 
-const gchar *
-cal_comp_util_find_parameter_xvalue (icalproperty *prop,
-                                    const gchar *name)
+gchar *
+cal_comp_util_dup_parameter_xvalue (ICalProperty *prop,
+                                   const gchar *name)
 {
-       icalparameter *param;
+       ICalParameter *param;
 
        if (!prop || !name || !*name)
                return NULL;
 
-       for (param = icalproperty_get_first_parameter (prop, ICAL_X_PARAMETER);
+       for (param = i_cal_property_get_first_parameter (prop, I_CAL_X_PARAMETER);
             param;
-            param = icalproperty_get_next_parameter (prop, ICAL_X_PARAMETER)) {
-               const gchar *xname = icalparameter_get_xname (param);
+            g_object_unref (param), param = i_cal_property_get_next_parameter (prop, I_CAL_X_PARAMETER)) {
+               const gchar *xname = i_cal_parameter_get_xname (param);
+
+               if (xname && g_ascii_strcasecmp (xname, name) == 0) {
+                       gchar *value;
+
+                       value = g_strdup (i_cal_parameter_get_xvalue (param));
+                       g_object_unref (param);
 
-               if (xname && g_ascii_strcasecmp (xname, name) == 0)
-                       return icalparameter_get_xvalue (param);
+                       return value;
+               }
        }
 
        return NULL;
 }
 
 gchar *
-cal_comp_util_get_attendee_comments (icalcomponent *icalcomp)
+cal_comp_util_get_attendee_comments (ICalComponent *icomp)
 {
        GString *comments = NULL;
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       g_return_val_if_fail (icalcomp != NULL, NULL);
+       g_return_val_if_fail (icomp != NULL, NULL);
 
-       for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
-            prop != NULL;
-            prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
+       for (prop = i_cal_component_get_first_property (icomp, I_CAL_ATTENDEE_PROPERTY);
+            prop;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (icomp, 
I_CAL_ATTENDEE_PROPERTY)) {
                gchar *guests_str = NULL;
                guint32 num_guests = 0;
-               const gchar *value;
+               gchar *value;
 
-               value = cal_comp_util_find_parameter_xvalue (prop, "X-NUM-GUESTS");
+               value = cal_comp_util_dup_parameter_xvalue (prop, "X-NUM-GUESTS");
                if (value && *value)
                        num_guests = atoi (value);
+               g_free (value);
 
-               value = cal_comp_util_find_parameter_xvalue (prop, "X-RESPONSE-COMMENT");
+               value = cal_comp_util_dup_parameter_xvalue (prop, "X-RESPONSE-COMMENT");
 
                if (num_guests)
                        guests_str = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "with one guest", "with 
%d guests", num_guests), num_guests);
 
                if (guests_str || (value && *value)) {
-                       const gchar *email = icalproperty_get_attendee (prop);
+                       const gchar *email = i_cal_property_get_attendee (prop);
                        const gchar *cn = NULL;
-                       icalparameter *cnparam;
+                       ICalParameter *cnparam;
 
-                       cnparam = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
+                       cnparam = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
                        if (cnparam) {
-                               cn = icalparameter_get_cn (cnparam);
+                               cn = i_cal_parameter_get_cn (cnparam);
                                if (!cn || !*cn)
                                        cn = NULL;
                        }
@@ -1535,9 +1557,12 @@ cal_comp_util_get_attendee_comments (icalcomponent *icalcomp)
                                if (value && *value)
                                        g_string_append (comments, value);
                        }
+
+                       g_clear_object (&cnparam);
                }
 
                g_free (guests_str);
+               g_free (value);
        }
 
        if (comments) {
diff --git a/src/calendar/gui/comp-util.h b/src/calendar/gui/comp-util.h
index a0cac726e3..b6ae7dc617 100644
--- a/src/calendar/gui/comp-util.h
+++ b/src/calendar/gui/comp-util.h
@@ -32,24 +32,28 @@
 
 struct _EShell;
 
-void cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone);
+void           cal_comp_util_add_exdate        (ECalComponent *comp,
+                                                time_t t,
+                                                ICalTimezone *zone);
 
 /* Returns TRUE if the component uses the given timezone for both DTSTART
  * and DTEND, or if the UTC offsets of the start and end times are the same
  * as in the given zone. */
-gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp,
-                                               ECalClient *client,
-                                               icaltimezone *zone);
+gboolean       cal_comp_util_compare_event_timezones
+                                               (ECalComponent *comp,
+                                                ECalClient *client,
+                                                ICalTimezone *zone);
 
 /* Returns the number of icons owned by the ECalComponent */
-gint     cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs);
+gint           cal_comp_util_get_n_icons       (ECalComponent *comp,
+                                                GSList **pixbufs);
 
 gboolean       cal_comp_is_on_server_sync      (ECalComponent *comp,
                                                 ECalClient *client,
                                                 GCancellable *cancellable,
                                                 GError **error);
 gboolean       cal_comp_is_icalcomp_on_server_sync
-                                               (icalcomponent *icalcomp,
+                                               (ICalComponent *icomp,
                                                 ECalClient *client,
                                                 GCancellable *cancellable,
                                                 GError **error);
@@ -79,13 +83,23 @@ ECalComponent *     cal_comp_memo_new_with_defaults_sync
                                                 GCancellable *cancellable,
                                                 GError **error);
 
-void cal_comp_update_time_by_active_window (ECalComponent *comp, struct _EShell *shell);
+void           cal_comp_update_time_by_active_window
+                                               (ECalComponent *comp,
+                                                struct _EShell *shell);
 
-void    cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list);
-GSList *cal_comp_selection_get_string_list (GtkSelectionData *data);
+void           cal_comp_selection_set_string_list
+                                               (GtkSelectionData *data,
+                                                GSList *str_list);
+GSList *       cal_comp_selection_get_string_list
+                                               (GtkSelectionData *data);
 
-void cal_comp_set_dtstart_with_oldzone (ECalClient *client, ECalComponent *comp, const ECalComponentDateTime 
*pdate);
-void cal_comp_set_dtend_with_oldzone (ECalClient *client, ECalComponent *comp, const ECalComponentDateTime 
*pdate);
+void           cal_comp_set_dtstart_with_oldzone
+                                               (ECalClient *client,
+                                                ECalComponent *comp,
+                                                const ECalComponentDateTime *pdate);
+void           cal_comp_set_dtend_with_oldzone (ECalClient *client,
+                                                ECalComponent *comp,
+                                                const ECalComponentDateTime *pdate);
 
 gboolean       comp_util_sanitize_recurrence_master_sync
                                                (ECalComponent *comp,
@@ -93,43 +107,39 @@ gboolean   comp_util_sanitize_recurrence_master_sync
                                                 GCancellable *cancellable,
                                                 GError **error);
 
-gchar *icalcomp_suggest_filename (icalcomponent *icalcomp, const gchar *default_name);
+gchar *                comp_util_suggest_filename      (ICalComponent *icomp,
+                                                const gchar *default_name);
 
 void           cal_comp_get_instance_times     (ECalClient *client,
-                                                icalcomponent *icalcomp,
-                                                const icaltimezone *default_zone,
-                                                time_t *instance_start,
-                                                gboolean *start_is_date,
-                                                time_t *instance_end,
-                                                gboolean *end_is_date,
+                                                ICalComponent *icomp,
+                                                const ICalTimezone *default_zone,
+                                                ICalTime **out_instance_start,
+                                                ICalTime **out_instance_end,
                                                 GCancellable *cancellable);
 time_t         cal_comp_gdate_to_timet         (const GDate *date,
-                                                const icaltimezone *with_zone);
+                                                const ICalTimezone *with_zone);
 
-void cal_comp_transfer_item_to                 (ECalClient *src_client,
+void           cal_comp_transfer_item_to       (ECalClient *src_client,
                                                 ECalClient *dest_client,
-                                                icalcomponent *icalcomp_vcal,
+                                                ICalComponent *icomp_vcal,
                                                 gboolean do_copy,
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
-gboolean cal_comp_transfer_item_to_finish      (ECalClient *client,
+gboolean       cal_comp_transfer_item_to_finish(ECalClient *client,
                                                 GAsyncResult *result,
                                                 GError **error);
-gboolean cal_comp_transfer_item_to_sync                (ECalClient *src_client,
+gboolean       cal_comp_transfer_item_to_sync  (ECalClient *src_client,
                                                 ECalClient *dest_client,
-                                                icalcomponent *icalcomp_event,
+                                                ICalComponent *icomp_event,
                                                 gboolean do_copy,
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           cal_comp_util_update_tzid_parameter
-                                               (icalproperty *prop,
-                                                const struct icaltimetype tt);
+                                               (ICalProperty *prop,
+                                                const ICalTime *tt);
 gint           cal_comp_util_compare_time_with_today
-                                               (const struct icaltimetype time_tt);
-gboolean       cal_comp_util_remove_all_properties
-                                               (icalcomponent *component,
-                                                icalproperty_kind kind);
+                                               (const ICalTime *time_tt);
 gboolean       cal_comp_util_have_in_new_attendees
                                                (const GSList *new_attendees_mails,
                                                 const gchar *eml);
@@ -139,9 +149,9 @@ void                cal_comp_util_copy_new_attendees
 void           cal_comp_util_set_added_attendees_mails
                                                (ECalComponent *comp,
                                                 GSList *emails);
-const gchar *  cal_comp_util_find_parameter_xvalue
-                                               (icalproperty *prop,
+gchar *                cal_comp_util_dup_parameter_xvalue
+                                               (ICalProperty *prop,
                                                 const gchar *name);
 gchar *                cal_comp_util_get_attendee_comments
-                                               (icalcomponent *icalcomp);
+                                               (ICalComponent *icomp);
 #endif
diff --git a/src/calendar/gui/e-alarm-list.c b/src/calendar/gui/e-alarm-list.c
index 15f60733ac..3b0d47c988 100644
--- a/src/calendar/gui/e-alarm-list.c
+++ b/src/calendar/gui/e-alarm-list.c
@@ -246,7 +246,7 @@ free_alarm (ECalComponentAlarm *alarm)
 static ECalComponentAlarm *
 copy_alarm (const ECalComponentAlarm *alarm)
 {
-       return e_cal_component_alarm_clone ((ECalComponentAlarm *) alarm);
+       return e_cal_component_alarm_copy ((ECalComponentAlarm *) alarm);
 }
 
 void
@@ -355,64 +355,63 @@ e_alarm_list_get_path (GtkTreeModel *tree_model,
 
 /* Builds a string for the duration of the alarm.  If the duration is zero, returns NULL. */
 static gchar *
-get_alarm_duration_string (struct icaldurationtype *duration)
+get_alarm_duration_string (ICalDuration *duration)
 {
        GString *string = g_string_new (NULL);
-       gchar *ret;
        gboolean have_something;
+       guint value;
 
        have_something = FALSE;
 
-       if (duration->days >= 1) {
+       value = i_cal_duration_get_days (duration);
+       if (value >= 1) {
                /* Translator: Entire string is like "Pop up an alert %d days before start" */
-               g_string_printf (string, ngettext ("%d day", "%d days", duration->days), duration->days);
+               g_string_printf (string, ngettext ("%d day", "%d days", value), value);
                have_something = TRUE;
        }
 
-       if (duration->weeks >= 1) {
+       value = i_cal_duration_get_weeks (duration);
+       if (value >= 1) {
                /* Translator: Entire string is like "Pop up an alert %d weeks before start" */
-               g_string_printf (string, ngettext ("%d week","%d weeks", duration->weeks), duration->weeks);
+               g_string_printf (string, ngettext ("%d week","%d weeks", value), value);
                have_something = TRUE;
        }
 
-       if (duration->hours >= 1) {
+       value = i_cal_duration_get_hours (duration);
+       if (value >= 1) {
                /* Translator: Entire string is like "Pop up an alert %d hours before start" */
-               g_string_printf (string, ngettext ("%d hour", "%d hours", duration->hours), duration->hours);
+               g_string_printf (string, ngettext ("%d hour", "%d hours", value), value);
                have_something = TRUE;
        }
 
-       if (duration->minutes >= 1) {
+       value = i_cal_duration_get_minutes (duration);
+       if (value >= 1) {
                /* Translator: Entire string is like "Pop up an alert %d minutes before start" */
-               g_string_printf (string, ngettext ("%d minute", "%d minutes", duration->minutes), 
duration->minutes);
+               g_string_printf (string, ngettext ("%d minute", "%d minutes", value), value);
                have_something = TRUE;
        }
 
-       if (duration->seconds >= 1) {
+       value = i_cal_duration_get_seconds (duration);
+       if (value >= 1) {
                /* Translator: Entire string is like "Pop up an alert %d seconds before start" */
-               g_string_printf (string, ngettext ("%d second", "%d seconds", duration->seconds), 
duration->seconds);
+               g_string_printf (string, ngettext ("%d second", "%d seconds", value), value);
                have_something = TRUE;
        }
 
-       if (have_something) {
-               ret = string->str;
-               g_string_free (string, FALSE);
-               return ret;
-       } else {
-               g_string_free (string, TRUE);
-               return NULL;
-       }
+       return g_string_free (string, !have_something);
 }
 
 static gchar *
 get_alarm_string (ECalComponentAlarm *alarm)
 {
        ECalComponentAlarmAction action;
-       ECalComponentAlarmTrigger trigger;
+       ECalComponentAlarmTrigger *trigger;
+       ICalDuration *duration;
        const gchar *base;
        gchar *str = NULL, *dur;
 
-       e_cal_component_alarm_get_action (alarm, &action);
-       e_cal_component_alarm_get_trigger (alarm, &trigger);
+       action = e_cal_component_alarm_get_action (alarm);
+       trigger = e_cal_component_alarm_get_trigger (alarm);
 
        switch (action) {
        case E_CAL_COMPONENT_ALARM_AUDIO:
@@ -440,12 +439,13 @@ get_alarm_string (ECalComponentAlarm *alarm)
 
        /* FIXME: This does not look like it will localize correctly. */
 
-       switch (trigger.type) {
+       switch (trigger ? e_cal_component_alarm_trigger_get_kind (trigger) : 
E_CAL_COMPONENT_ALARM_TRIGGER_NONE) {
        case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START:
-               dur = get_alarm_duration_string (&trigger.u.rel_duration);
+               duration = e_cal_component_alarm_trigger_get_duration (trigger);
+               dur = get_alarm_duration_string (duration);
 
                if (dur) {
-                       if (trigger.u.rel_duration.is_neg)
+                       if (i_cal_duration_is_neg (duration))
                                str = g_strdup_printf (
                                        /*Translator: The first %s refers to the base, which would be actions 
like
                                         * "Play a Sound". Second %s refers to the duration string e.g:"15 
minutes"*/
@@ -467,10 +467,11 @@ get_alarm_string (ECalComponentAlarm *alarm)
                break;
 
        case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END:
-               dur = get_alarm_duration_string (&trigger.u.rel_duration);
+               duration = e_cal_component_alarm_trigger_get_duration (trigger);
+               dur = get_alarm_duration_string (duration);
 
                if (dur) {
-                       if (trigger.u.rel_duration.is_neg)
+                       if (i_cal_duration_is_neg (duration))
                                str = g_strdup_printf (
                                        /* Translator: The first %s refers to the base, which would be 
actions like
                                         * "Play a Sound". Second %s refers to the duration string e.g:"15 
minutes" */
@@ -492,19 +493,19 @@ get_alarm_string (ECalComponentAlarm *alarm)
                break;
 
        case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: {
-               struct icaltimetype itt;
-               icaltimezone *utc_zone, *current_zone;
+               ICalTime *itt;
+               ICalTimezone *utc_zone, *current_zone;
                struct tm tm;
                gchar buf[256];
 
                /* Absolute triggers come in UTC, so convert them to the local timezone */
 
-               itt = trigger.u.abs_time;
+               itt = e_cal_component_alarm_trigger_get_absolute_time (trigger);
 
-               utc_zone = icaltimezone_get_utc_timezone ();
+               utc_zone = i_cal_timezone_get_utc_timezone ();
                current_zone = calendar_config_get_icaltimezone ();
 
-               tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
+               tm = e_cal_util_icaltime_to_tm_with_zone (itt, utc_zone, current_zone);
 
                e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
                                             FALSE, FALSE, buf, sizeof (buf));
diff --git a/src/calendar/gui/e-cal-component-preview.c b/src/calendar/gui/e-cal-component-preview.c
index 417a08932e..ee7d890d46 100644
--- a/src/calendar/gui/e-cal-component-preview.c
+++ b/src/calendar/gui/e-cal-component-preview.c
@@ -49,12 +49,12 @@ struct _ECalComponentPreviewPrivate {
         * if it didn't change then the preview is not updated */
        gchar *cal_uid;
        gchar *comp_uid;
-       struct icaltimetype comp_last_modified;
+       ICalTime *comp_last_modified;
        gint comp_sequence;
 
        ECalClient *client;
        ECalComponent *comp;
-       icaltimezone *timezone;
+       ICalTimezone *timezone;
        gboolean use_24_hour_format;
 };
 
@@ -79,25 +79,22 @@ clear_comp_info (ECalComponentPreview *preview)
        priv->cal_uid = NULL;
        g_free (priv->comp_uid);
        priv->comp_uid = NULL;
-       priv->comp_last_modified = icaltime_null_time ();
        priv->comp_sequence = -1;
 
+       g_clear_object (&priv->comp_last_modified);
        g_clear_object (&priv->client);
        g_clear_object (&priv->comp);
-       if (priv->timezone) {
-               icaltimezone_free (priv->timezone, 1);
-               priv->timezone = NULL;
-       }
+       g_clear_object (&priv->timezone);
 }
 
 /* Stores information about actually shown component and
  * returns whether component in the preview changed */
 static gboolean
 update_comp_info (ECalComponentPreview *preview,
-                  ECalClient *client,
-                  ECalComponent *comp,
-                  icaltimezone *zone,
-                  gboolean use_24_hour_format)
+                 ECalClient *client,
+                 ECalComponent *comp,
+                 ICalTimezone *zone,
+                 gboolean use_24_hour_format)
 {
        ECalComponentPreviewPrivate *priv;
        gboolean changed;
@@ -115,32 +112,27 @@ update_comp_info (ECalComponentPreview *preview,
                const gchar *uid;
                gchar *cal_uid;
                gchar *comp_uid;
-               struct icaltimetype comp_last_modified, *itm = NULL;
-               gint *sequence = NULL;
+               ICalTime *comp_last_modified;
                gint comp_sequence;
 
                source = e_client_get_source (E_CLIENT (client));
                cal_uid = g_strdup (e_source_get_uid (source));
-               e_cal_component_get_uid (comp, &uid);
+               uid = e_cal_component_get_uid (comp);
                comp_uid = g_strdup (uid);
-               e_cal_component_get_last_modified (comp, &itm);
-               if (itm) {
-                       comp_last_modified = *itm;
-                       e_cal_component_free_icaltimetype (itm);
-               } else
-                       comp_last_modified = icaltime_null_time ();
-               e_cal_component_get_sequence (comp, &sequence);
-               if (sequence) {
-                       comp_sequence = *sequence;
-                       e_cal_component_free_sequence (sequence);
-               } else
+               comp_last_modified = e_cal_component_get_last_modified (comp);
+               comp_sequence = e_cal_component_get_sequence (comp);
+               if (comp_sequence < 0)
                        comp_sequence = 0;
 
                changed = !priv->cal_uid || !priv->comp_uid || !cal_uid || !comp_uid ||
                          !g_str_equal (priv->cal_uid, cal_uid) ||
                          !g_str_equal (priv->comp_uid, comp_uid) ||
-                         priv->comp_sequence != comp_sequence ||
-                         icaltime_compare (priv->comp_last_modified, comp_last_modified) != 0;
+                         priv->comp_sequence != comp_sequence;
+
+               if (comp_last_modified && priv->comp_last_modified)
+                       changed = changed || i_cal_time_compare (priv->comp_last_modified, 
comp_last_modified) != 0;
+               else
+                       changed = changed || comp_last_modified != priv->comp_last_modified;
 
                clear_comp_info (preview);
 
@@ -151,7 +143,7 @@ update_comp_info (ECalComponentPreview *preview,
 
                priv->comp = g_object_ref (comp);
                priv->client = g_object_ref (client);
-               priv->timezone = icaltimezone_copy (zone);
+               priv->timezone = i_cal_timezone_copy (zone);
                priv->use_24_hour_format = use_24_hour_format;
        }
 
@@ -161,26 +153,29 @@ update_comp_info (ECalComponentPreview *preview,
 /* Converts a time_t to a string, relative to the specified timezone */
 static gchar *
 timet_to_str_with_zone (ECalComponentDateTime *dt,
-                        ECalClient *client,
-                        icaltimezone *default_zone)
+                       ECalClient *client,
+                       ICalTimezone *default_zone)
 {
-       struct icaltimetype itt;
-       icaltimezone *zone = NULL;
+       ICalTime *itt;
+       ICalTimezone *zone = NULL;
        struct tm tm;
 
-       if (dt->tzid != NULL) {
-               e_cal_client_get_timezone_sync (
-                       client, dt->tzid, &zone, NULL, NULL);
-       } else if (icaltime_is_utc (*dt->value)) {
-               zone = icaltimezone_get_utc_timezone ();
+       if (!dt)
+               return NULL;
+
+       itt = e_cal_component_datetime_get_value (dt);
+
+       if (e_cal_component_datetime_get_tzid (dt)) {
+               e_cal_client_get_timezone_sync (client, e_cal_component_datetime_get_tzid (dt), &zone, NULL, 
NULL);
+       } else if (i_cal_time_is_utc (itt)) {
+               zone = i_cal_timezone_get_utc_timezone ();
        }
 
-       itt = *dt->value;
        if (zone != NULL)
-               icaltimezone_convert_time (&itt, zone, default_zone);
-       tm = icaltimetype_to_tm (&itt);
+               i_cal_timezone_convert_time (itt, zone, default_zone);
+       tm = e_cal_util_icaltime_to_tm (itt);
 
-       return e_datetime_format_format_tm ("calendar", "table", itt.is_date ? DTFormatKindDate : 
DTFormatKindDateTime, &tm);
+       return e_datetime_format_format_tm ("calendar", "table", i_cal_time_is_date (itt) ? DTFormatKindDate 
: DTFormatKindDateTime, &tm);
 }
 
 static void
@@ -213,17 +208,18 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
 {
        ECalClient *client;
        ECalComponent *comp;
-       icaltimezone *default_zone;
-       ECalComponentText text;
-       ECalComponentDateTime dt;
+       ICalTimezone *default_zone;
+       ECalComponentText *text;
+       ECalComponentDateTime *dt;
        gchar *str;
        GString *string;
        GSList *list, *iter;
-       icalcomponent *icalcomp;
-       icalproperty *icalprop;
-       icalproperty_status status;
-       const gchar *location, *url, *tmp;
-       gint *priority_value;
+       ICalComponent *icomp;
+       ICalProperty *prop;
+       ICalPropertyStatus status;
+       const gchar *tmp;
+       gchar *location, *url;
+       gint priority;
        gchar *markup;
 
        client = preview->priv->client;
@@ -231,23 +227,24 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
        default_zone = preview->priv->timezone;
 
        /* write document header */
-       e_cal_component_get_summary (comp, &text);
+       text = e_cal_component_get_summary (comp);
 
        g_string_append (buffer, HTML_HEADER);
        g_string_append (buffer, "<body class=\"-e-web-view-background-color -e-web-view-text-color\">");
 
-       markup = g_markup_escape_text (text.value ? text.value : _("Untitled"), -1);
-       if (text.value)
+       markup = g_markup_escape_text (text && e_cal_component_text_get_value (text) ? 
e_cal_component_text_get_value (text) : _("Untitled"), -1);
+       if (text && e_cal_component_text_get_value (text))
                g_string_append_printf (buffer, "<h2>%s</h2>", markup);
        else
                g_string_append_printf (buffer, "<h2><i>%s</i></h2>", markup);
+       e_cal_component_text_free (text);
        g_free (markup);
 
        g_string_append (buffer, "<table border=\"0\" cellspacing=\"5\">");
 
        /* write icons for the categories */
        string = g_string_new (NULL);
-       e_cal_component_get_categories_list (comp, &list);
+       list = e_cal_component_get_categories_list (comp);
        if (list != NULL) {
                markup = g_markup_escape_text (_("Categories:"), -1);
                g_string_append_printf (buffer, "<tr><th>%s</th><td>", markup);
@@ -281,43 +278,47 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                g_string_append_printf (buffer, "%s", string->str);
        if (list != NULL)
                g_string_append (buffer, "</td></tr>");
-       e_cal_component_free_categories_list (list);
+       g_slist_free_full (list, g_free);
        g_string_free (string, TRUE);
 
        /* write location */
-       e_cal_component_get_location (comp, &location);
+       location = e_cal_component_get_location (comp);
        cal_component_preview_add_table_line (buffer, _("Location:"), location);
+       g_free (location);
 
        /* write start date */
-       e_cal_component_get_dtstart (comp, &dt);
-       if (dt.value != NULL) {
-               str = timet_to_str_with_zone (&dt, client, default_zone);
+       dt = e_cal_component_get_dtstart (comp);
+       if (dt && e_cal_component_datetime_get_value (dt)) {
+               str = timet_to_str_with_zone (dt, client, default_zone);
                cal_component_preview_add_table_line (buffer, _("Start Date:"), str);
                g_free (str);
        }
-       e_cal_component_free_datetime (&dt);
+       e_cal_component_datetime_free (dt);
 
        /* write end date */
-       e_cal_component_get_dtend (comp, &dt);
-       if (dt.value != NULL) {
-               str = timet_to_str_with_zone (&dt, client, default_zone);
+       dt = e_cal_component_get_dtend (comp);
+       if (dt && e_cal_component_datetime_get_value (dt)) {
+               str = timet_to_str_with_zone (dt, client, default_zone);
                cal_component_preview_add_table_line (buffer, _("End Date:"), str);
                g_free (str);
        }
-       e_cal_component_free_datetime (&dt);
+       e_cal_component_datetime_free (dt);
 
        /* write Due Date */
-       e_cal_component_get_due (comp, &dt);
-       if (dt.value != NULL) {
-               str = timet_to_str_with_zone (&dt, client, default_zone);
+       dt = e_cal_component_get_due (comp);
+       if (dt && e_cal_component_datetime_get_value (dt)) {
+               str = timet_to_str_with_zone (dt, client, default_zone);
                cal_component_preview_add_table_line (buffer, _("Due Date:"), str);
                g_free (str);
        }
-       e_cal_component_free_datetime (&dt);
+       e_cal_component_datetime_free (dt);
+
+       icomp = e_cal_component_get_icalcomponent (comp);
 
-       if (e_cal_util_component_has_recurrences (e_cal_component_get_icalcomponent (comp))) {
-               str = e_cal_recur_describe_recurrence (e_cal_component_get_icalcomponent (comp),
-                       calendar_config_get_week_start_day (), E_CAL_RECUR_DESCRIBE_RECURRENCE_FLAG_NONE);
+       if (e_cal_util_component_has_recurrences (icomp)) {
+               str = e_cal_recur_describe_recurrence (icomp,
+                       calendar_config_get_week_start_day (),
+                       E_CAL_RECUR_DESCRIBE_RECURRENCE_FLAG_NONE);
 
                if (str) {
                        cal_component_preview_add_table_line (buffer, _("Recurs:"), str);
@@ -326,36 +327,36 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
        }
 
        /* write status */
-       icalcomp = e_cal_component_get_icalcomponent (comp);
-       icalprop = icalcomponent_get_first_property (
-               icalcomp, ICAL_STATUS_PROPERTY);
-       if (icalprop != NULL) {
-               e_cal_component_get_status (comp, &status);
+       prop = i_cal_component_get_first_property (icomp, I_CAL_STATUS_PROPERTY);
+       if (prop) {
+               status = e_cal_component_get_status (comp);
                switch (status) {
-               case ICAL_STATUS_INPROCESS :
+               case I_CAL_STATUS_INPROCESS :
                        tmp = _("In Progress");
                        break;
-               case ICAL_STATUS_COMPLETED :
+               case I_CAL_STATUS_COMPLETED :
                        tmp = _("Completed");
                        break;
-               case ICAL_STATUS_CANCELLED :
+               case I_CAL_STATUS_CANCELLED :
                        tmp = _("Cancelled");
                        break;
-               case ICAL_STATUS_NONE :
+               case I_CAL_STATUS_NONE :
                default :
                        tmp = _("Not Started");
                        break;
                }
 
                cal_component_preview_add_table_line (buffer, _("Status:"), tmp);
+
+               g_object_unref (prop);
        }
 
        /* write priority */
-       e_cal_component_get_priority (comp, &priority_value);
-       if (priority_value && *priority_value != 0) {
-               if (*priority_value <= 4)
+       priority = e_cal_component_get_priority (comp);
+       if (priority > 0) {
+               if (priority <= 4)
                        tmp = _("High");
-               else if (*priority_value == 5)
+               else if (priority == 5)
                        tmp = _("Normal");
                else
                        tmp = _("Low");
@@ -363,25 +364,22 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                cal_component_preview_add_table_line (buffer, _("Priority:"), tmp);
        }
 
-       if (priority_value)
-               e_cal_component_free_priority (priority_value);
-
        if (e_cal_component_has_organizer (comp)) {
-               ECalComponentOrganizer organizer = { 0 };
+               ECalComponentOrganizer *organizer;
 
-               e_cal_component_get_organizer (comp, &organizer);
+               organizer = e_cal_component_get_organizer (comp);
 
-               if (organizer.value && *organizer.value) {
-                       const gchar *email = itip_strip_mailto (organizer.value);
+               if (organizer && e_cal_component_organizer_get_value (organizer) && 
e_cal_component_organizer_get_value (organizer)[0]) {
+                       const gchar *email = itip_strip_mailto (e_cal_component_organizer_get_value 
(organizer));
                        if (!email)
                                email = "";
                        markup = g_markup_escape_text (_("Organizer:"), -1);
                        g_string_append_printf (buffer, "<tr><th>%s</th>", markup);
                        g_free (markup);
-                       if (organizer.cn && *organizer.cn) {
+                       if (e_cal_component_organizer_get_cn (organizer) && e_cal_component_organizer_get_cn 
(organizer)[0]) {
                                gchar *html;
 
-                               str = g_strconcat (organizer.cn, " <", email, ">", NULL);
+                               str = g_strconcat (e_cal_component_organizer_get_cn (organizer), " <", email, 
">", NULL);
                                html = camel_text_to_html (str,
                                        CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
                                        CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
@@ -398,19 +396,21 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                                g_free (str);
                        }
                }
+
+               e_cal_component_organizer_free (organizer);
        }
 
        if (e_cal_component_has_attendees (comp)) {
                GSList *attendees = NULL, *a;
                gboolean have = FALSE;
 
-               e_cal_component_get_attendee_list (comp, &attendees);
+               attendees = e_cal_component_get_attendees (comp);
 
                for (a = attendees; a; a = a->next) {
                        ECalComponentAttendee *attnd = a->data;
                        const gchar *email;
 
-                       if (!attnd || !attnd->value || !*attnd->value)
+                       if (!attnd || !e_cal_component_attendee_get_value (attnd) || 
!e_cal_component_attendee_get_value (attnd)[0])
                                continue;
 
                        if (!have) {
@@ -421,14 +421,14 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                                g_string_append (buffer, "<br>");
                        }
 
-                       email = itip_strip_mailto (attnd->value);
+                       email = itip_strip_mailto (e_cal_component_attendee_get_value (attnd));
                        if (!email)
                                email = "";
 
-                       if (attnd->cn && *attnd->cn) {
+                       if (e_cal_component_attendee_get_cn (attnd) && e_cal_component_attendee_get_cn 
(attnd)[0]) {
                                gchar *html;
 
-                               str = g_strconcat (attnd->cn, " <", email, ">", NULL);
+                               str = g_strconcat (e_cal_component_attendee_get_cn (attnd), " <", email, ">", 
NULL);
                                html = camel_text_to_html (str,
                                        CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
                                        CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
@@ -451,13 +451,13 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                if (have)
                        g_string_append (buffer, "</td></tr>");
 
-               e_cal_component_free_attendee_list (attendees);
+               g_slist_free_full (attendees, e_cal_component_attendee_free);
        }
 
        /* write description and URL */
        g_string_append (buffer, "<tr><td colspan=\"2\"><hr></td></tr>");
 
-       e_cal_component_get_description_list (comp, &list);
+       list = e_cal_component_get_descriptions (comp);
        if (list) {
                GSList *node;
 
@@ -470,9 +470,12 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                for (node = list; node != NULL; node = node->next) {
                        gchar *html;
 
-                       text = * (ECalComponentText *) node->data;
+                       text = node->data;
+                       if (!text || !e_cal_component_text_get_value (text))
+                               continue;
+
                        html = camel_text_to_html (
-                               text.value ? text.value : "",
+                               e_cal_component_text_get_value (text),
                                CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
                                CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
                                CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS |
@@ -486,11 +489,11 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
 
                g_string_append (buffer, "</td></tr>");
 
-               e_cal_component_free_text_list (list);
+               g_slist_free_full (list, e_cal_component_text_free);
        }
 
        /* URL */
-       e_cal_component_get_url (comp, &url);
+       url = e_cal_component_get_url (comp);
        if (url) {
                gchar *scheme, *header_markup;
                const gchar *href = url;
@@ -522,6 +525,7 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
                g_free (header_markup);
                g_free (markup);
                g_free (str);
+               g_free (url);
        }
 
        g_string_append (buffer, "</table>");
@@ -614,7 +618,7 @@ void
 e_cal_component_preview_display (ECalComponentPreview *preview,
                                  ECalClient *client,
                                  ECalComponent *comp,
-                                 icaltimezone *zone,
+                                 ICalTimezone *zone,
                                  gboolean use_24_hour_format)
 {
        g_return_if_fail (E_IS_CAL_COMPONENT_PREVIEW (preview));
diff --git a/src/calendar/gui/e-cal-component-preview.h b/src/calendar/gui/e-cal-component-preview.h
index 9b0b376618..a8685e235c 100644
--- a/src/calendar/gui/e-cal-component-preview.h
+++ b/src/calendar/gui/e-cal-component-preview.h
@@ -71,7 +71,7 @@ GtkWidget *   e_cal_component_preview_new     (void);
 void           e_cal_component_preview_display (ECalComponentPreview *preview,
                                                 ECalClient *client,
                                                 ECalComponent *comp,
-                                                icaltimezone *zone,
+                                                ICalTimezone *zone,
                                                 gboolean use_24_hour_format);
 void           e_cal_component_preview_clear   (ECalComponentPreview *preview);
 
diff --git a/src/calendar/gui/e-cal-data-model-subscriber.c b/src/calendar/gui/e-cal-data-model-subscriber.c
index 141a5cb08f..991c02aadd 100644
--- a/src/calendar/gui/e-cal-data-model-subscriber.c
+++ b/src/calendar/gui/e-cal-data-model-subscriber.c
@@ -31,7 +31,7 @@ e_cal_data_model_subscriber_default_init (ECalDataModelSubscriberInterface *ifac
  * e_cal_data_model_subscriber_component_added:
  * @subscriber: an #ECalDataModelSubscriber
  * @client: an #ECalClient, which notifies about the component addition
- * @icalcomp: an #ECalComponent which was added
+ * @comp: an #ECalComponent which was added
  *
  * Notifies the @subscriber about an added component which belongs
  * to the time range used by the @subscriber.
diff --git a/src/calendar/gui/e-cal-data-model.c b/src/calendar/gui/e-cal-data-model.c
index 2e2aab826e..9e5dcdb222 100644
--- a/src/calendar/gui/e-cal-data-model.c
+++ b/src/calendar/gui/e-cal-data-model.c
@@ -40,7 +40,7 @@ struct _ECalDataModelPrivate {
        gboolean skip_cancelled;
        gchar *filter;
        gchar *full_filter;     /* to be used with views */
-       icaltimezone *zone;
+       ICalTimezone *zone;
        time_t range_start;
        time_t range_end;
 
@@ -91,7 +91,7 @@ typedef struct _ViewData {
        GHashTable *components; /* ECalComponentId ~> ComponentData */
        GHashTable *lost_components; /* ECalComponentId ~> ComponentData; when re-running view, valid till 
'complete' is received */
        gboolean received_complete;
-       GSList *to_expand_recurrences; /* icalcomponent */
+       GSList *to_expand_recurrences; /* ICalComponent */
        GSList *expanded_recurrences; /* ComponentData */
        gint pending_expand_recurrences; /* how many is waiting to be processed */
 
@@ -138,8 +138,8 @@ static gboolean
 component_data_equal (ComponentData *comp_data1,
                      ComponentData *comp_data2)
 {
-       icalcomponent *icomp1, *icomp2;
-       struct icaltimetype tt1, tt2;
+       ICalComponent *icomp1, *icomp2;
+       ICalTime *tt1, *tt2;
        gchar *as_str1, *as_str2;
        gboolean equal;
 
@@ -157,28 +157,40 @@ component_data_equal (ComponentData *comp_data1,
        icomp2 = e_cal_component_get_icalcomponent (comp_data2->component);
 
        if (!icomp1 || !icomp2 ||
-           icalcomponent_get_sequence (icomp1) != icalcomponent_get_sequence (icomp2) ||
-           g_strcmp0 (icalcomponent_get_uid (icomp1), icalcomponent_get_uid (icomp2)) != 0)
+           i_cal_component_get_sequence (icomp1) != i_cal_component_get_sequence (icomp2) ||
+           g_strcmp0 (i_cal_component_get_uid (icomp1), i_cal_component_get_uid (icomp2)) != 0)
                return FALSE;
 
-       tt1 = icalcomponent_get_recurrenceid (icomp1);
-       tt2 = icalcomponent_get_recurrenceid (icomp2);
-       if ((icaltime_is_valid_time (tt1) ? 1 : 0) != (icaltime_is_valid_time (tt2) ? 1 : 0) ||
-           (icaltime_is_null_time (tt1) ? 1 : 0) != (icaltime_is_null_time (tt2) ? 1 : 0) ||
-           icaltime_compare (tt1, tt2) != 0)
+       tt1 = i_cal_component_get_recurrenceid (icomp1);
+       tt2 = i_cal_component_get_recurrenceid (icomp2);
+       if (((!tt1 || i_cal_time_is_valid_time (tt1)) ? 1 : 0) != ((!tt2 || i_cal_time_is_valid_time (tt2)) ? 
1 : 0) ||
+           ((!tt1 || i_cal_time_is_null_time (tt1)) ? 1 : 0) != ((!tt2 || i_cal_time_is_null_time (tt2)) ? 1 
: 0) ||
+           i_cal_time_compare (tt1, tt2) != 0) {
+               g_clear_object (&tt1);
+               g_clear_object (&tt2);
                return FALSE;
+       }
+
+       g_clear_object (&tt1);
+       g_clear_object (&tt2);
 
-       tt1 = icalcomponent_get_dtstamp (icomp1);
-       tt2 = icalcomponent_get_dtstamp (icomp2);
-       if ((icaltime_is_valid_time (tt1) ? 1 : 0) != (icaltime_is_valid_time (tt2) ? 1 : 0) ||
-           (icaltime_is_null_time (tt1) ? 1 : 0) != (icaltime_is_null_time (tt2) ? 1 : 0) ||
-           icaltime_compare (tt1, tt2) != 0)
+       tt1 = i_cal_component_get_dtstamp (icomp1);
+       tt2 = i_cal_component_get_dtstamp (icomp2);
+       if (((!tt1 || i_cal_time_is_valid_time (tt1)) ? 1 : 0) != ((!tt2 || i_cal_time_is_valid_time (tt2)) ? 
1 : 0) ||
+           ((!tt1 || i_cal_time_is_null_time (tt1)) ? 1 : 0) != ((!tt2 || i_cal_time_is_null_time (tt2)) ? 1 
: 0) ||
+           i_cal_time_compare (tt1, tt2) != 0) {
+               g_clear_object (&tt1);
+               g_clear_object (&tt2);
                return FALSE;
+       }
+
+       g_clear_object (&tt1);
+       g_clear_object (&tt2);
 
        /* Maybe not so effective compare, but might be still more effective
           than updating whole UI with false notifications */
-       as_str1 = icalcomponent_as_ical_string_r (icomp1);
-       as_str2 = icalcomponent_as_ical_string_r (icomp2);
+       as_str1 = i_cal_component_as_ical_string_r (icomp1);
+       as_str2 = i_cal_component_as_ical_string_r (icomp2);
 
        equal = g_strcmp0 (as_str1, as_str2) == 0;
 
@@ -201,8 +213,8 @@ view_data_new (ECalClient *client)
        view_data->is_used = TRUE;
        view_data->client = g_object_ref (client);
        view_data->components = g_hash_table_new_full (
-               (GHashFunc) e_cal_component_id_hash, (GEqualFunc) e_cal_component_id_equal,
-               (GDestroyNotify) e_cal_component_free_id, component_data_free);
+               e_cal_component_id_hash, e_cal_component_id_equal,
+               e_cal_component_id_free, component_data_free);
 
        return view_data;
 }
@@ -254,7 +266,7 @@ view_data_unref (gpointer ptr)
                        g_hash_table_destroy (view_data->components);
                        if (view_data->lost_components)
                                g_hash_table_destroy (view_data->lost_components);
-                       g_slist_free_full (view_data->to_expand_recurrences, (GDestroyNotify) 
icalcomponent_free);
+                       g_slist_free_full (view_data->to_expand_recurrences, g_object_unref);
                        g_slist_free_full (view_data->expanded_recurrences, component_data_free);
                        g_rec_mutex_clear (&view_data->lock);
                        g_free (view_data);
@@ -657,7 +669,9 @@ cal_data_model_remove_one_view_component_cb (ECalDataModel *data_model,
 
        g_return_if_fail (id != NULL);
 
-       e_cal_data_model_subscriber_component_removed (subscriber, client, id->uid, id->rid);
+       e_cal_data_model_subscriber_component_removed (subscriber, client,
+               e_cal_component_id_get_uid (id),
+               e_cal_component_id_get_rid (id));
 }
 
 static void
@@ -763,8 +777,8 @@ cal_data_model_update_full_filter (ECalDataModel *data_model)
                iso_start = isodate_from_time_t (range_start);
                iso_end = isodate_from_time_t (range_end);
 
-               if (data_model->priv->zone && data_model->priv->zone != icaltimezone_get_utc_timezone ())
-                       default_tzloc = icaltimezone_get_location (data_model->priv->zone);
+               if (data_model->priv->zone && data_model->priv->zone != i_cal_timezone_get_utc_timezone ())
+                       default_tzloc = i_cal_timezone_get_location (data_model->priv->zone);
                if (!default_tzloc)
                        default_tzloc = "";
 
@@ -890,7 +904,9 @@ cal_data_model_process_added_component (ECalDataModel *data_model,
                                if (g_hash_table_remove (new_subscribers, subscriber))
                                        e_cal_data_model_subscriber_component_modified (subscriber, 
view_data->client, comp_data->component);
                                else if (old_id)
-                                       e_cal_data_model_subscriber_component_removed (subscriber, 
view_data->client, old_id->uid, old_id->rid);
+                                       e_cal_data_model_subscriber_component_removed (subscriber, 
view_data->client,
+                                               e_cal_component_id_get_uid (old_id),
+                                               e_cal_component_id_get_rid (old_id));
                        }
 
                        /* Those which left in the new_subscribers have the component added. */
@@ -912,8 +928,7 @@ cal_data_model_process_added_component (ECalDataModel *data_model,
 
        view_data_unlock (view_data);
 
-       if (old_id)
-               e_cal_component_free_id (old_id);
+       e_cal_component_id_free (old_id);
 }
 
 typedef struct _GatherComponentsData {
@@ -939,7 +954,7 @@ cal_data_model_gather_components (gpointer key,
        g_return_if_fail (gather_data->pcomponent_ids != NULL || gather_data->component_ids_hash != NULL);
        g_return_if_fail (gather_data->pcomponent_ids == NULL || gather_data->component_ids_hash == NULL);
 
-       if ((gather_data->all_instances || !comp_data->is_detached) && g_strcmp0 (id->uid, gather_data->uid) 
== 0) {
+       if ((gather_data->all_instances || !comp_data->is_detached) && g_strcmp0 (e_cal_component_id_get_uid 
(id), gather_data->uid) == 0) {
                if (gather_data->component_ids_hash) {
                        ComponentData *comp_data_copy;
 
@@ -1000,21 +1015,21 @@ cal_data_model_notify_recurrences_cb (gpointer user_data)
                gathered_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
                known_instances = g_hash_table_new_full (
                        (GHashFunc) e_cal_component_id_hash, (GEqualFunc) e_cal_component_id_equal,
-                       (GDestroyNotify) e_cal_component_free_id, component_data_free);
+                       (GDestroyNotify) e_cal_component_id_free, component_data_free);
 
                for (link = expanded_recurrences; link && view_data->is_used; link = g_slist_next (link)) {
                        ComponentData *comp_data = link->data;
-                       icalcomponent *icomp;
+                       ICalComponent *icomp;
                        const gchar *uid;
 
                        if (!comp_data)
                                continue;
 
                        icomp = e_cal_component_get_icalcomponent (comp_data->component);
-                       if (!icomp || !icalcomponent_get_uid (icomp))
+                       if (!icomp || !i_cal_component_get_uid (icomp))
                                continue;
 
-                       uid = icalcomponent_get_uid (icomp);
+                       uid = i_cal_component_get_uid (icomp);
 
                        if (!g_hash_table_contains (gathered_uids, uid)) {
                                GatherComponentsData gather_data;
@@ -1071,57 +1086,75 @@ cal_data_model_notify_recurrences_cb (gpointer user_data)
 typedef struct
 {
        ECalClient *client;
-       icaltimezone *zone;
+       ICalTimezone *zone;
        GSList **pexpanded_recurrences;
        gboolean skip_cancelled;
 } GenerateInstancesData;
 
 static gboolean
-cal_data_model_instance_generated (ECalComponent *comp,
-                                  time_t instance_start,
-                                  time_t instance_end,
-                                  gpointer data)
+cal_data_model_instance_generated (ICalComponent *icomp,
+                                  ICalTime *instance_start,
+                                  ICalTime *instance_end,
+                                  gpointer user_data,
+                                  GCancellable *cancellable,
+                                  GError **error)
 {
-       GenerateInstancesData *gid = data;
+       GenerateInstancesData *gid = user_data;
        ComponentData *comp_data;
        ECalComponent *comp_copy;
-       icalproperty_status status = ICAL_STATUS_NONE;
-       icaltimetype tt, tt2;
+       ICalTime *tt, *tt2;
+       time_t start_tt, end_tt;
 
        g_return_val_if_fail (gid != NULL, FALSE);
 
-       e_cal_component_get_status (comp, &status);
-       if (gid->skip_cancelled && status == ICAL_STATUS_CANCELLED)
-               return TRUE;
+       if (gid->skip_cancelled) {
+               ICalProperty *prop;
+
+               prop = i_cal_component_get_first_property (icomp, I_CAL_STATUS_PROPERTY);
+               if (prop && i_cal_property_get_status (prop) == I_CAL_STATUS_CANCELLED) {
+                       g_object_unref (prop);
+                       return TRUE;
+               }
 
-       comp_copy = e_cal_component_clone (comp);
+               g_clear_object (&prop);
+       }
+
+       comp_copy = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        g_return_val_if_fail (comp_copy != NULL, FALSE);
 
-       tt = icalcomponent_get_dtstart (e_cal_component_get_icalcomponent (comp_copy));
-       tt2 = icaltime_from_timet_with_zone (instance_start, tt.is_date, gid->zone);
-       if (tt.is_date || !tt.zone || tt.zone == icaltimezone_get_utc_timezone ())
-               tt2.zone = NULL;
+       tt = i_cal_component_get_dtstart (e_cal_component_get_icalcomponent (comp_copy));
+       tt2 = i_cal_time_convert_to_zone (instance_start, gid->zone);
+       if (i_cal_time_is_date (tt) || !i_cal_time_get_timezone (tt) || i_cal_time_is_utc (tt))
+               i_cal_time_set_timezone (tt2, NULL);
        else
-               tt2.zone = gid->zone;
-       icalcomponent_set_dtstart (e_cal_component_get_icalcomponent (comp_copy), tt2);
-
-       tt = icalcomponent_get_dtend (e_cal_component_get_icalcomponent (comp_copy));
-       tt2 = icaltime_from_timet_with_zone (instance_end, tt.is_date, gid->zone);
-       if (tt.is_date || !tt.zone || tt.zone == icaltimezone_get_utc_timezone ())
-               tt2.zone = NULL;
+               i_cal_time_set_timezone (tt2, gid->zone);
+       i_cal_component_set_dtstart (e_cal_component_get_icalcomponent (comp_copy), tt2);
+       g_clear_object (&tt);
+       g_clear_object (&tt2);
+
+       tt = i_cal_component_get_dtend (e_cal_component_get_icalcomponent (comp_copy));
+       tt2 = i_cal_time_convert_to_zone (instance_end, gid->zone);
+       if (i_cal_time_is_date (tt) || !i_cal_time_get_timezone (tt) || i_cal_time_is_utc (tt))
+               i_cal_time_set_timezone (tt2, NULL);
        else
-               tt2.zone = gid->zone;
-       icalcomponent_set_dtend (e_cal_component_get_icalcomponent (comp_copy), tt2);
-
-       e_cal_component_rescan (comp_copy);
+               i_cal_time_set_timezone (tt2, gid->zone);
+       i_cal_component_set_dtend (e_cal_component_get_icalcomponent (comp_copy), tt2);
+       g_clear_object (&tt);
+       g_clear_object (&tt2);
 
        cal_comp_get_instance_times (gid->client, e_cal_component_get_icalcomponent (comp_copy),
-               gid->zone, &instance_start, NULL, &instance_end, NULL, NULL);
+               gid->zone, &tt, &tt2, cancellable);
+
+       start_tt = i_cal_time_as_timet (tt);
+       end_tt = i_cal_time_as_timet (tt2);
 
-       if (instance_end > instance_start)
-               instance_end--;
+       g_clear_object (&tt);
+       g_clear_object (&tt2);
 
-       comp_data = component_data_new (comp_copy, instance_start, instance_end, FALSE);
+       if (end_tt > start_tt)
+               end_tt--;
+
+       comp_data = component_data_new (comp_copy, start_tt, end_tt, FALSE);
        *gid->pexpanded_recurrences = g_slist_prepend (*gid->pexpanded_recurrences, comp_data);
 
        g_object_unref (comp_copy);
@@ -1172,7 +1205,7 @@ cal_data_model_expand_recurrences_thread (ECalDataModel *data_model,
        view_data_unlock (view_data);
 
        for (link = to_expand_recurrences; link && view_data->is_used; link = g_slist_next (link)) {
-               icalcomponent *icomp = link->data;
+               ICalComponent *icomp = link->data;
                GenerateInstancesData gid;
 
                if (!icomp)
@@ -1180,14 +1213,16 @@ cal_data_model_expand_recurrences_thread (ECalDataModel *data_model,
 
                gid.client = client;
                gid.pexpanded_recurrences = &expanded_recurrences;
-               gid.zone = data_model->priv->zone;
+               gid.zone = g_object_ref (data_model->priv->zone);
                gid.skip_cancelled = data_model->priv->skip_cancelled;
 
-               e_cal_client_generate_instances_for_object_sync (client, icomp, range_start, range_end,
+               e_cal_client_generate_instances_for_object_sync (client, icomp, range_start, range_end, NULL,
                        cal_data_model_instance_generated, &gid);
+
+               g_clear_object (&gid.zone);
        }
 
-       g_slist_free_full (to_expand_recurrences, (GDestroyNotify) icalcomponent_free);
+       g_slist_free_full (to_expand_recurrences, g_object_unref);
 
        view_data_lock (view_data);
        if (expanded_recurrences)
@@ -1259,9 +1294,9 @@ cal_data_model_process_modified_or_added_objects (ECalClientView *view,
                cal_data_model_freeze_all_subscribers (data_model);
 
                for (link = objects; link; link = g_slist_next (link)) {
-                       icalcomponent *icomp = link->data;
+                       ICalComponent *icomp = link->data;
 
-                       if (!icomp || !icalcomponent_get_uid (icomp))
+                       if (!icomp || !i_cal_component_get_uid (icomp))
                                continue;
 
                        if (data_model->priv->expand_recurrences &&
@@ -1270,22 +1305,29 @@ cal_data_model_process_modified_or_added_objects (ECalClientView *view,
                                /* This component requires an expand of recurrences, which
                                   will be done in a dedicated thread, thus remember it */
                                to_expand_recurrences = g_slist_prepend (to_expand_recurrences,
-                                       icalcomponent_new_clone (icomp));
+                                       i_cal_component_new_clone (icomp));
                        } else {
                                /* Single or detached instance, the simple case */
                                ECalComponent *comp;
                                ComponentData *comp_data;
+                               ICalTime *start_tt = NULL, *end_tt = NULL;
                                time_t instance_start, instance_end;
 
                                if (data_model->priv->skip_cancelled &&
-                                   icalcomponent_get_status (icomp) == ICAL_STATUS_CANCELLED)
+                                   i_cal_component_get_status (icomp) == I_CAL_STATUS_CANCELLED)
                                        continue;
 
-                               comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone 
(icomp));
+                               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(icomp));
                                if (!comp)
                                        continue;
 
-                               cal_comp_get_instance_times (client, icomp, data_model->priv->zone, 
&instance_start, NULL, &instance_end, NULL, NULL);
+                               cal_comp_get_instance_times (client, icomp, data_model->priv->zone, 
&start_tt, &end_tt, NULL);
+
+                               instance_start = i_cal_time_as_timet (start_tt);
+                               instance_end = i_cal_time_as_timet (end_tt);
+
+                               g_clear_object (&start_tt);
+                               g_clear_object (&end_tt);
 
                                if (instance_end > instance_start)
                                        instance_end--;
@@ -1379,11 +1421,11 @@ cal_data_model_view_objects_removed (ECalClientView *view,
                        const ECalComponentId *id = link->data;
 
                        if (id) {
-                               if (!id->rid || !*id->rid) {
-                                       if (!g_hash_table_contains (gathered_uids, id->uid)) {
+                               if (!e_cal_component_id_get_rid (id)) {
+                                       if (!g_hash_table_contains (gathered_uids, e_cal_component_id_get_uid 
(id))) {
                                                GatherComponentsData gather_data;
 
-                                               gather_data.uid = id->uid;
+                                               gather_data.uid = e_cal_component_id_get_uid (id);
                                                gather_data.pcomponent_ids = &removed;
                                                gather_data.component_ids_hash = NULL;
                                                gather_data.copy_ids = TRUE;
@@ -1395,7 +1437,7 @@ cal_data_model_view_objects_removed (ECalClientView *view,
                                                        g_hash_table_foreach (view_data->lost_components,
                                                                cal_data_model_gather_components, 
&gather_data);
 
-                                               g_hash_table_insert (gathered_uids, id->uid, GINT_TO_POINTER 
(1));
+                                               g_hash_table_insert (gathered_uids, (gpointer) 
e_cal_component_id_get_uid (id), GINT_TO_POINTER (1));
                                        }
                                } else {
                                        removed = g_list_prepend (removed, e_cal_component_id_copy (id));
@@ -1437,7 +1479,7 @@ cal_data_model_view_objects_removed (ECalClientView *view,
 
                cal_data_model_thaw_all_subscribers (data_model);
 
-               g_list_free_full (removed, (GDestroyNotify) e_cal_component_free_id);
+               g_list_free_full (removed, (GDestroyNotify) e_cal_component_id_free);
                g_hash_table_destroy (gathered_uids);
        }
        view_data_unlock (view_data);
@@ -1691,7 +1733,7 @@ cal_data_model_update_client_view (ECalDataModel *data_model,
                view_data->lost_components = view_data->components;
                view_data->components = g_hash_table_new_full (
                        (GHashFunc) e_cal_component_id_hash, (GEqualFunc) e_cal_component_id_equal,
-                       (GDestroyNotify) e_cal_component_free_id, component_data_free);
+                       (GDestroyNotify) e_cal_component_id_free, component_data_free);
        }
 
        view_data_unlock (view_data);
@@ -1842,7 +1884,9 @@ cal_data_model_remove_from_subscriber_except_its_range (ECalDataModel *data_mode
           time range will be removed */
        if (!(instance_start <= subs_data->range_end &&
            instance_end >= subs_data->range_start))
-               e_cal_data_model_subscriber_component_removed (subs_data->subscriber, client, id->uid, 
id->rid);
+               e_cal_data_model_subscriber_component_removed (subs_data->subscriber, client,
+                       e_cal_component_id_get_uid (id),
+                       e_cal_component_id_get_rid (id));
 
        return TRUE;
 }
@@ -1853,7 +1897,7 @@ cal_data_model_set_client_default_zone_cb (gpointer key,
                                           gpointer user_data)
 {
        ECalClient *client = value;
-       icaltimezone *zone = user_data;
+       ICalTimezone *zone = user_data;
 
        g_return_if_fail (E_IS_CAL_CLIENT (client));
        g_return_if_fail (zone != NULL);
@@ -2007,6 +2051,7 @@ cal_data_model_finalize (GObject *object)
        g_slist_free_full (data_model->priv->subscribers, subscriber_data_free);
        g_free (data_model->priv->filter);
        g_free (data_model->priv->full_filter);
+       g_clear_object (&data_model->priv->zone);
 
        e_weak_ref_free (data_model->priv->submit_thread_job_responder);
        g_rec_mutex_clear (&data_model->priv->props_lock);
@@ -2084,7 +2129,7 @@ e_cal_data_model_init (ECalDataModel *data_model)
        data_model->priv->disposing = FALSE;
        data_model->priv->expand_recurrences = FALSE;
        data_model->priv->skip_cancelled = FALSE;
-       data_model->priv->zone = icaltimezone_get_utc_timezone ();
+       data_model->priv->zone = g_object_ref (i_cal_timezone_get_utc_timezone ());
 
        data_model->priv->views_update_freeze = 0;
        data_model->priv->views_update_required = FALSE;
@@ -2342,14 +2387,14 @@ e_cal_data_model_set_skip_cancelled (ECalDataModel *data_model,
  * Obtains a timezone being used for calendar views. The returned
  * timezone is owned by the @data_model.
  *
- * Returns: (transfer none): An #icaltimezone being used for calendar views.
+ * Returns: (transfer none): An #ICalTimezone being used for calendar views.
  *
  * Since: 3.16
  **/
-icaltimezone *
+ICalTimezone *
 e_cal_data_model_get_timezone (ECalDataModel *data_model)
 {
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        g_return_val_if_fail (E_IS_CAL_DATA_MODEL (data_model), NULL);
 
@@ -2361,10 +2406,11 @@ e_cal_data_model_get_timezone (ECalDataModel *data_model)
 
        return zone;
 }
+
 /**
  * e_cal_data_model_set_timezone:
  * @data_model: an #EDataModel instance
- * @zone: an #icaltimezone
+ * @zone: an #ICalTimezone
  *
  * Sets a trimezone to be used for calendar views. This change
  * regenerates all views.
@@ -2373,7 +2419,7 @@ e_cal_data_model_get_timezone (ECalDataModel *data_model)
  **/
 void
 e_cal_data_model_set_timezone (ECalDataModel *data_model,
-                              icaltimezone *zone)
+                              ICalTimezone *zone)
 {
        g_return_if_fail (E_IS_CAL_DATA_MODEL (data_model));
        g_return_if_fail (zone != NULL);
@@ -2381,7 +2427,8 @@ e_cal_data_model_set_timezone (ECalDataModel *data_model,
        LOCK_PROPS ();
 
        if (data_model->priv->zone != zone) {
-               data_model->priv->zone = zone;
+               g_clear_object (&data_model->priv->zone);
+               data_model->priv->zone = g_object_ref (zone);
 
                g_hash_table_foreach (data_model->priv->clients, cal_data_model_set_client_default_zone_cb, 
zone);
 
diff --git a/src/calendar/gui/e-cal-data-model.h b/src/calendar/gui/e-cal-data-model.h
index ff0b05c581..15ce5e708a 100644
--- a/src/calendar/gui/e-cal-data-model.h
+++ b/src/calendar/gui/e-cal-data-model.h
@@ -107,9 +107,9 @@ gboolean    e_cal_data_model_get_skip_cancelled
 void           e_cal_data_model_set_skip_cancelled
                                                (ECalDataModel *data_model,
                                                 gboolean expand_recurrences);
-icaltimezone * e_cal_data_model_get_timezone   (ECalDataModel *data_model);
+ICalTimezone * e_cal_data_model_get_timezone   (ECalDataModel *data_model);
 void           e_cal_data_model_set_timezone   (ECalDataModel *data_model,
-                                                icaltimezone *zone);
+                                                ICalTimezone *zone);
 void           e_cal_data_model_set_filter     (ECalDataModel *data_model,
                                                 const gchar *sexp);
 gchar *                e_cal_data_model_dup_filter     (ECalDataModel *data_model);
diff --git a/src/calendar/gui/e-cal-dialogs.c b/src/calendar/gui/e-cal-dialogs.c
index 04974e3b91..933d6aa4ea 100644
--- a/src/calendar/gui/e-cal-dialogs.c
+++ b/src/calendar/gui/e-cal-dialogs.c
@@ -41,24 +41,22 @@
 static gboolean
 is_past_event (ECalComponent *comp)
 {
-       ECalComponentDateTime end_date;
+       ECalComponentDateTime *end_date;
        gboolean res;
 
        if (!comp)
                return TRUE;
 
-       end_date.value = NULL;
+       end_date = e_cal_component_get_dtend (comp);
 
-       e_cal_component_get_dtend (comp, &end_date);
-
-       if (!end_date.value)
+       if (!end_date)
                return FALSE;
 
-       res = icaltime_compare_date_only (
-               *end_date.value,
-               icaltime_current_time_with_zone (
-               icaltime_get_timezone (*end_date.value))) == -1;
-       e_cal_component_free_datetime (&end_date);
+       res = i_cal_time_compare_date_only (
+               e_cal_component_datetime_get_value (end_date),
+               i_cal_time_current_time_with_zone (i_cal_time_get_timezone 
(e_cal_component_datetime_get_value (end_date)))) == -1;
+
+       e_cal_component_datetime_free (end_date);
 
        return res;
 }
@@ -157,11 +155,11 @@ struct ForeachTzidData
 };
 
 static void
-add_timezone_to_cal_cb (icalparameter *param,
+add_timezone_to_cal_cb (ICalParameter *param,
                         gpointer data)
 {
        struct ForeachTzidData *ftd = data;
-       icaltimezone *tz = NULL;
+       ICalTimezone *tz = NULL;
        const gchar *tzid;
 
        g_return_if_fail (ftd != NULL);
@@ -171,7 +169,7 @@ add_timezone_to_cal_cb (icalparameter *param,
        if (!ftd->success)
                return;
 
-       tzid = icalparameter_get_tzid (param);
+       tzid = i_cal_parameter_get_tzid (param);
        if (!tzid || !*tzid)
                return;
 
@@ -232,29 +230,29 @@ copy_source_thread (EAlertSinkThreadJobData *job_data,
        n_objects = g_slist_length (objects);
 
        for (link = objects, ii = 0; link && ftd.success && !g_cancellable_is_cancelled (cancellable); link = 
g_slist_next (link), ii++) {
-               icalcomponent *icalcomp = link->data;
-               icalcomponent *existing_icalcomp = NULL;
+               ICalComponent *icomp = link->data;
+               ICalComponent *existing_icomp = NULL;
                gint percent = 100 * (ii + 1) / n_objects;
                GError *local_error = NULL;
 
-               if (e_cal_client_get_object_sync (to_client, icalcomponent_get_uid (icalcomp), NULL, 
&existing_icalcomp, cancellable, &local_error) &&
-                   icalcomp != NULL) {
-                       if (!e_cal_client_modify_object_sync (to_client, icalcomp, E_CAL_OBJ_MOD_ALL, 
cancellable, error))
+               if (e_cal_client_get_object_sync (to_client, i_cal_component_get_uid (icomp), NULL, 
&existing_icomp, cancellable, &local_error) &&
+                   icomp != NULL) {
+                       if (!e_cal_client_modify_object_sync (to_client, icomp, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error))
                                break;
 
-                       icalcomponent_free (existing_icalcomp);
+                       g_object_unref (existing_icomp);
                } else if (local_error && !g_error_matches (local_error, E_CAL_CLIENT_ERROR, 
E_CAL_CLIENT_ERROR_OBJECT_NOT_FOUND)) {
                        g_propagate_error (error, local_error);
                        break;
                } else {
-                       icalcomponent_foreach_tzid (icalcomp, add_timezone_to_cal_cb, &ftd);
+                       i_cal_component_foreach_tzid (icomp, add_timezone_to_cal_cb, &ftd);
 
                        g_clear_error (&local_error);
 
                        if (!ftd.success)
                                break;
 
-                       if (!e_cal_client_create_object_sync (to_client, icalcomp, NULL, cancellable, error))
+                       if (!e_cal_client_create_object_sync (to_client, icomp, E_CAL_OPERATION_FLAG_NONE, 
NULL, cancellable, error))
                                break;
                }
 
@@ -267,7 +265,7 @@ copy_source_thread (EAlertSinkThreadJobData *job_data,
        if (ii > 0 && ftd.success)
                csd->to_client = g_object_ref (to_client);
  out:
-       e_cal_client_free_icalcomp_slist (objects);
+       e_util_free_nullable_object_slist (objects);
        g_clear_object (&from_client);
        g_clear_object (&to_client);
 }
@@ -391,13 +389,16 @@ e_cal_dialogs_delete_component (ECalComponent *comp,
        g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
        if (comp) {
-               ECalComponentText summary;
-
                vtype = e_cal_component_get_vtype (comp);
 
                if (!consider_as_untitled) {
-                       e_cal_component_get_summary (comp, &summary);
-                       arg0 = g_strdup (summary.value);
+                       ECalComponentText *summary;
+
+                       summary = e_cal_component_get_summary (comp);
+                       if (summary) {
+                               arg0 = g_strdup (e_cal_component_text_get_value (summary));
+                               e_cal_component_text_free (summary);
+                       }
                }
 
                switch (vtype) {
@@ -431,9 +432,7 @@ e_cal_dialogs_delete_component (ECalComponent *comp,
                        break;
 
                default:
-                       g_message (
-                               "delete_component_dialog(): Cannot handle object of type %d",
-                               vtype);
+                       g_message ("%s: Cannot handle object of type %d", G_STRFUNC, vtype);
                        g_free (arg0);
                        return FALSE;
                }
@@ -461,9 +460,7 @@ e_cal_dialogs_delete_component (ECalComponent *comp,
                        break;
 
                default:
-                       g_message (
-                               "delete_component_dialog(): Cannot handle objects of type %d",
-                               vtype);
+                       g_message ("%s: Cannot handle objects of type %d", G_STRFUNC, vtype);
                        return FALSE;
                }
 
@@ -634,18 +631,21 @@ ecal_event (ECalendarItem *calitem,
 {
        GoToDialog *dlg = user_data;
        GDate start_date, end_date;
-       struct icaltimetype tt = icaltime_null_time ();
-       icaltimezone *timezone;
+       ICalTime *tt = i_cal_time_null_time ();
+       ICalTimezone *timezone;
        time_t et;
 
        g_warn_if_fail (e_calendar_item_get_selection (calitem, &start_date, &end_date));
        timezone = e_cal_data_model_get_timezone (dlg->data_model);
 
-       tt.year = g_date_get_year (&start_date);
-       tt.month = g_date_get_month (&start_date);
-       tt.day = g_date_get_day (&start_date);
+       i_cal_time_set_date (tt,
+               g_date_get_year (&start_date),
+               g_date_get_month (&start_date),
+               g_date_get_day (&start_date));
+
+       et = i_cal_time_as_timet_with_zone (tt, timezone);
 
-       et = icaltime_as_timet_with_zone (tt, timezone);
+       g_clear_object (&tt);
 
        *(dlg->out_move_type) = E_CALENDAR_VIEW_MOVE_TO_EXACT_DAY;
        *(dlg->out_exact_date) = et;
@@ -658,23 +658,18 @@ static struct tm
 get_current_time (ECalendarItem *calitem,
                   gpointer data)
 {
-       icaltimezone *zone;
+       ICalTimezone *zone;
+       ICalTime *tt;
        struct tm tmp_tm = { 0 };
-       struct icaltimetype tt;
 
        /* Get the current timezone. */
        zone = calendar_config_get_icaltimezone ();
 
-       tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
+       tt = i_cal_time_from_timet_with_zone (time (NULL), FALSE, zone);
 
-       /* Now copy it to the struct tm and return it. */
-       tmp_tm.tm_year = tt.year - 1900;
-       tmp_tm.tm_mon = tt.month - 1;
-       tmp_tm.tm_mday = tt.day;
-       tmp_tm.tm_hour = tt.hour;
-       tmp_tm.tm_min = tt.minute;
-       tmp_tm.tm_sec = tt.second;
-       tmp_tm.tm_isdst = -1;
+       tmp_tm = e_cal_util_icaltime_to_tm (tt);
+
+       g_clear_object (&tt);
 
        return tmp_tm;
 }
@@ -790,15 +785,17 @@ e_cal_dialogs_goto_run (GtkWindow *parent,
                dlg->month_val = g_date_get_month (from_date) - 1;
                dlg->day_val = g_date_get_day (from_date);
        } else {
-               struct icaltimetype tt;
-               icaltimezone *timezone;
+               ICalTime *tt;
+               ICalTimezone *timezone;
 
                timezone = e_cal_data_model_get_timezone (dlg->data_model);
-               tt = icaltime_current_time_with_zone (timezone);
+               tt = i_cal_time_current_time_with_zone (timezone);
+
+               dlg->year_val = i_cal_time_get_year (tt);
+               dlg->month_val = i_cal_time_get_month (tt) - 1;
+               dlg->day_val = i_cal_time_get_day (tt);
 
-               dlg->year_val = tt.year;
-               dlg->month_val = tt.month - 1;
-               dlg->day_val = tt.day;
+               g_clear_object (&tt);
        }
 
        g_signal_connect (
@@ -909,13 +906,13 @@ e_cal_dialogs_recur_component (ECalClient *client,
        rb_this = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
        gtk_container_add (GTK_CONTAINER (vbox), rb_this);
 
-       if (!e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_THISANDPRIOR)) {
+       if (!e_client_check_capability (E_CLIENT (client), E_CAL_STATIC_CAPABILITY_NO_THISANDPRIOR)) {
                rb_prior = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This 
and Prior Instances"));
                gtk_container_add (GTK_CONTAINER (vbox), rb_prior);
        } else
                rb_prior = NULL;
 
-       if (!e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_THISANDFUTURE)) {
+       if (!e_client_check_capability (E_CLIENT (client), E_CAL_STATIC_CAPABILITY_NO_THISANDFUTURE)) {
                rb_future = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This 
and Future Instances"));
                gtk_container_add (GTK_CONTAINER (vbox), rb_future);
        } else
@@ -949,7 +946,7 @@ e_cal_dialogs_recur_component (ECalClient *client,
 
 gboolean
 e_cal_dialogs_recur_icalcomp (ECalClient *client,
-                             icalcomponent *icalcomp,
+                             ICalComponent *icomp,
                              ECalObjModType *mod,
                              GtkWindow *parent,
                              gboolean delegated)
@@ -957,9 +954,9 @@ e_cal_dialogs_recur_icalcomp (ECalClient *client,
        ECalComponent *comp;
        gboolean res;
 
-       g_return_val_if_fail (icalcomp != NULL, FALSE);
+       g_return_val_if_fail (icomp != NULL, FALSE);
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        if (!comp)
                return FALSE;
 
@@ -1044,31 +1041,31 @@ component_has_new_attendees (ECalComponent *comp)
 static gboolean
 have_nonprocedural_alarm (ECalComponent *comp)
 {
-       GList *uids, *l;
+       GSList *uids, *link;
 
        g_return_val_if_fail (comp != NULL, FALSE);
 
        uids = e_cal_component_get_alarm_uids (comp);
 
-       for (l = uids; l; l = l->next) {
+       for (link = uids; link; link = g_slist_next (link)) {
                ECalComponentAlarm *alarm;
                ECalComponentAlarmAction action = E_CAL_COMPONENT_ALARM_UNKNOWN;
 
-               alarm = e_cal_component_get_alarm (comp, (const gchar *) l->data);
+               alarm = e_cal_component_get_alarm (comp, link->data);
                if (alarm) {
-                       e_cal_component_alarm_get_action (alarm, &action);
+                       action = e_cal_component_alarm_get_action (alarm);
                        e_cal_component_alarm_free (alarm);
 
                        if (action != E_CAL_COMPONENT_ALARM_NONE &&
                            action != E_CAL_COMPONENT_ALARM_PROCEDURE &&
                            action != E_CAL_COMPONENT_ALARM_UNKNOWN) {
-                               cal_obj_uid_list_free (uids);
+                               g_slist_free_full (uids, g_free);
                                return TRUE;
                        }
                }
        }
 
-       cal_obj_uid_list_free (uids);
+       g_slist_free_full (uids, g_free);
 
        return FALSE;
 }
@@ -1278,22 +1275,22 @@ e_cal_dialogs_send_dragged_or_resized_component (GtkWindow *parent,
 
 gboolean
 e_cal_dialogs_send_component_prompt_subject (GtkWindow *parent,
-                                            icalcomponent *component)
+                                            ICalComponent *component)
 {
-       icalcomponent_kind kind;
+       ICalComponentKind kind;
        const gchar *id;
 
-       kind = icalcomponent_isa (component);
+       kind = i_cal_component_isa (component);
 
        switch (kind) {
-       case ICAL_VEVENT_COMPONENT:
+       case I_CAL_VEVENT_COMPONENT:
                id = "calendar:prompt-save-no-subject-calendar";
                break;
 
-       case ICAL_VTODO_COMPONENT:
+       case I_CAL_VTODO_COMPONENT:
                id = "calendar:prompt-save-no-subject-task";
                break;
-       case ICAL_VJOURNAL_COMPONENT:
+       case I_CAL_VJOURNAL_COMPONENT:
                id = "calendar:prompt-send-no-subject-memo";
                break;
 
diff --git a/src/calendar/gui/e-cal-dialogs.h b/src/calendar/gui/e-cal-dialogs.h
index 10bf44929b..348d1e6a45 100644
--- a/src/calendar/gui/e-cal-dialogs.h
+++ b/src/calendar/gui/e-cal-dialogs.h
@@ -49,7 +49,7 @@ gboolean      e_cal_dialogs_recur_component   (ECalClient *client,
                                                 GtkWindow *parent,
                                                 gboolean delegated);
 gboolean       e_cal_dialogs_recur_icalcomp    (ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 ECalObjModType *mod,
                                                 GtkWindow *parent,
                                                 gboolean delegated);
@@ -71,6 +71,6 @@ GtkResponseType       e_cal_dialogs_send_dragged_or_resized_component
                                                 gboolean *only_new_attendees);
 gboolean       e_cal_dialogs_send_component_prompt_subject
                                                (GtkWindow *parent,
-                                                icalcomponent *component);
+                                                ICalComponent *icomp);
 
 #endif /* E_CAL_DIALOGS_H */
diff --git a/src/calendar/gui/e-cal-list-view.c b/src/calendar/gui/e-cal-list-view.c
index f547e2b2a3..ee90c72ccc 100644
--- a/src/calendar/gui/e-cal-list-view.c
+++ b/src/calendar/gui/e-cal-list-view.c
@@ -39,6 +39,14 @@
 #include "calendar-config.h"
 #include "misc.h"
 
+struct _ECalListViewPrivate {
+       /* The main display table */
+       ETable *table;
+
+       /* The last ECalendarViewEvent we returned from e_cal_list_view_get_selected_events(), to be freed */
+       ECalendarViewEvent *cursor_event;
+};
+
 enum {
        PROP_0,
        PROP_IS_EDITING
@@ -93,6 +101,8 @@ e_cal_list_view_class_init (ECalListViewClass *class)
        widget_class = (GtkWidgetClass *) class;
        view_class = (ECalendarViewClass *) class;
 
+       g_type_class_add_private (class, sizeof (ECalListViewPrivate));
+
        /* Method override */
        object_class->dispose = e_cal_list_view_dispose;
        object_class->get_property = e_cal_list_view_get_property;
@@ -112,9 +122,10 @@ e_cal_list_view_class_init (ECalListViewClass *class)
 static void
 e_cal_list_view_init (ECalListView *cal_list_view)
 {
-       cal_list_view->table = NULL;
-       cal_list_view->cursor_event = NULL;
-       cal_list_view->set_table_id = 0;
+       cal_list_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (cal_list_view, E_TYPE_CAL_LIST_VIEW, 
ECalListViewPrivate);
+
+       cal_list_view->priv->table = NULL;
+       cal_list_view->priv->cursor_event = NULL;
 }
 
 /* Returns the current time, for the ECellDateEdit items. */
@@ -123,21 +134,16 @@ get_current_time_cb (ECellDateEdit *ecde,
                      gpointer data)
 {
        ECalListView *cal_list_view = data;
-       icaltimezone *zone;
-       struct tm tmp_tm = { 0 };
-       struct icaltimetype tt;
+       ICalTimezone *zone;
+       ICalTime *tt;
+       struct tm tmp_tm;
 
        zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (cal_list_view));
-       tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
+       tt = i_cal_time_from_timet_with_zone (time (NULL), FALSE, zone);
+
+       tmp_tm = e_cal_util_icaltime_to_tm (tt);
 
-       /* Now copy it to the struct tm and return it. */
-       tmp_tm.tm_year = tt.year - 1900;
-       tmp_tm.tm_mon = tt.month - 1;
-       tmp_tm.tm_mday = tt.day;
-       tmp_tm.tm_hour = tt.hour;
-       tmp_tm.tm_min = tt.minute;
-       tmp_tm.tm_sec = tt.second;
-       tmp_tm.tm_isdst = -1;
+       g_clear_object (&tt);
 
        return tmp_tm;
 }
@@ -216,7 +222,6 @@ setup_e_table (ECalListView *cal_list_view)
 
        e_table_extras_add_cell (extras, "dateedit", popup_cell);
        g_object_unref (popup_cell);
-       cal_list_view->dates_cell = E_CELL_DATE_EDIT (popup_cell);
 
        gtk_widget_hide (E_CELL_DATE_EDIT (popup_cell)->none_button);
 
@@ -292,7 +297,7 @@ setup_e_table (ECalListView *cal_list_view)
 
        widget = e_table_new (E_TABLE_MODEL (model), extras, specification);
        gtk_container_add (GTK_CONTAINER (container), widget);
-       cal_list_view->table = E_TABLE (widget);
+       cal_list_view->priv->table = E_TABLE (widget);
        gtk_widget_show (widget);
 
        g_object_unref (specification);
@@ -301,27 +306,27 @@ setup_e_table (ECalListView *cal_list_view)
 
        /* Connect signals */
        g_signal_connect (
-               cal_list_view->table, "double_click",
+               cal_list_view->priv->table, "double_click",
                G_CALLBACK (e_cal_list_view_on_table_double_click),
                cal_list_view);
        g_signal_connect (
-               cal_list_view->table, "right-click",
+               cal_list_view->priv->table, "right-click",
                G_CALLBACK (e_cal_list_view_on_table_right_click),
                cal_list_view);
        g_signal_connect (
-               cal_list_view->table, "key-press",
+               cal_list_view->priv->table, "key-press",
                G_CALLBACK (e_cal_list_view_on_table_key_press),
                cal_list_view);
        g_signal_connect (
-               cal_list_view->table, "white-space-event",
+               cal_list_view->priv->table, "white-space-event",
                G_CALLBACK (e_cal_list_view_on_table_white_space_event),
                cal_list_view);
        g_signal_connect_after (
-               cal_list_view->table, "cursor_change",
+               cal_list_view->priv->table, "cursor_change",
                G_CALLBACK (e_cal_list_view_cursor_change_cb),
                cal_list_view);
        e_signal_connect_notify_after (
-               cal_list_view->table, "notify::is-editing",
+               cal_list_view->priv->table, "notify::is-editing",
                G_CALLBACK (e_cal_list_view_table_editing_changed_cb),
                cal_list_view);
 }
@@ -351,19 +356,14 @@ e_cal_list_view_dispose (GObject *object)
 
        cal_list_view = E_CAL_LIST_VIEW (object);
 
-       if (cal_list_view->set_table_id) {
-               g_source_remove (cal_list_view->set_table_id);
-               cal_list_view->set_table_id = 0;
+       if (cal_list_view->priv->cursor_event) {
+               g_free (cal_list_view->priv->cursor_event);
+               cal_list_view->priv->cursor_event = NULL;
        }
 
-       if (cal_list_view->cursor_event) {
-               g_free (cal_list_view->cursor_event);
-               cal_list_view->cursor_event = NULL;
-       }
-
-       if (cal_list_view->table) {
-               gtk_widget_destroy (GTK_WIDGET (cal_list_view->table));
-               cal_list_view->table = NULL;
+       if (cal_list_view->priv->table) {
+               gtk_widget_destroy (GTK_WIDGET (cal_list_view->priv->table));
+               cal_list_view->priv->table = NULL;
        }
 
        /* Chain up to parent's dispose() method. */
@@ -491,38 +491,53 @@ e_cal_list_view_get_selected_time_range (ECalendarView *cal_view,
                                          time_t *end_time)
 {
        GList *selected;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        selected = e_calendar_view_get_selected_events (cal_view);
        if (selected) {
                ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
-               ECalComponentDateTime dtstart, dtend;
                ECalComponent *comp;
 
                if (!is_comp_data_valid (event))
                        return FALSE;
 
                comp = e_cal_component_new ();
-               e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone 
(event->comp_data->icalcomp));
+               e_cal_component_set_icalcomponent (comp, i_cal_component_new_clone 
(event->comp_data->icalcomp));
                if (start_time) {
-                       e_cal_component_get_dtstart (comp, &dtstart);
-                       if (dtstart.tzid) {
-                               zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (comp), 
dtstart.tzid);
+                       ECalComponentDateTime *dt;
+
+                       dt = e_cal_component_get_dtstart (comp);
+
+                       if (dt) {
+                               if (e_cal_component_datetime_get_tzid (dt)) {
+                                       zone = i_cal_component_get_timezone 
(e_cal_component_get_icalcomponent (comp), e_cal_component_datetime_get_tzid (dt));
+                               } else {
+                                       zone = NULL;
+                               }
+                               *start_time = i_cal_time_as_timet_with_zone 
(e_cal_component_datetime_get_value (dt), zone);
                        } else {
-                               zone = NULL;
+                               *start_time = (time_t) 0;
                        }
-                       *start_time = icaltime_as_timet_with_zone (*dtstart.value, zone);
-                       e_cal_component_free_datetime (&dtstart);
+
+                       e_cal_component_datetime_free (dt);
                }
                if (end_time) {
-                       e_cal_component_get_dtend (comp, &dtend);
-                       if (dtend.tzid) {
-                               zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (comp), 
dtend.tzid);
+                       ECalComponentDateTime *dt;
+
+                       dt = e_cal_component_get_dtend (comp);
+
+                       if (dt) {
+                               if (e_cal_component_datetime_get_tzid (dt)) {
+                                       zone = i_cal_component_get_timezone 
(e_cal_component_get_icalcomponent (comp), e_cal_component_datetime_get_tzid (dt));
+                               } else {
+                                       zone = NULL;
+                               }
+                               *end_time = i_cal_time_as_timet_with_zone (e_cal_component_datetime_get_value 
(dt), zone);
                        } else {
-                               zone = NULL;
+                               *end_time = (time_t) 0;
                        }
-                       *end_time = icaltime_as_timet_with_zone (*dtend.value, zone);
-                       e_cal_component_free_datetime (&dtend);
+
+                       e_cal_component_datetime_free (dt);
                }
 
                g_object_unref (comp);
@@ -540,18 +555,18 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view)
        GList *event_list = NULL;
        gint   cursor_row;
 
-       if (E_CAL_LIST_VIEW (cal_view)->cursor_event) {
-               g_free (E_CAL_LIST_VIEW (cal_view)->cursor_event);
-               E_CAL_LIST_VIEW (cal_view)->cursor_event = NULL;
+       if (E_CAL_LIST_VIEW (cal_view)->priv->cursor_event) {
+               g_free (E_CAL_LIST_VIEW (cal_view)->priv->cursor_event);
+               E_CAL_LIST_VIEW (cal_view)->priv->cursor_event = NULL;
        }
 
        cursor_row = e_table_get_cursor_row (
-               E_CAL_LIST_VIEW (cal_view)->table);
+               E_CAL_LIST_VIEW (cal_view)->priv->table);
 
        if (cursor_row >= 0) {
                ECalendarViewEvent *event;
 
-               event = E_CAL_LIST_VIEW (cal_view)->cursor_event = g_new0 (ECalendarViewEvent, 1);
+               event = E_CAL_LIST_VIEW (cal_view)->priv->cursor_event = g_new0 (ECalendarViewEvent, 1);
                event->comp_data =
                        e_cal_model_get_component_at (
                                e_calendar_view_get_model (cal_view),
@@ -562,22 +577,27 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view)
        return event_list;
 }
 
+/* It also frees 'itt' */
 static void
-adjust_range (icaltimetype icaltime,
+adjust_range (ICalTime *itt,
               time_t *earliest,
               time_t *latest,
               gboolean *set)
 {
        time_t t;
 
-       if (!icaltime_is_valid_time (icaltime))
+       if (!itt || !i_cal_time_is_valid_time (itt)) {
+               g_clear_object (&itt);
                return;
+       }
+
+       t = i_cal_time_as_timet (itt);
 
-       t = icaltime_as_timet (icaltime);
        *earliest = MIN (*earliest, t);
        *latest   = MAX (*latest, t);
-
        *set = TRUE;
+
+       g_clear_object (&itt);
 }
 
 /* NOTE: Time use for this function increases linearly with number of events.
@@ -596,18 +616,18 @@ e_cal_list_view_get_visible_time_range (ECalendarView *cal_view,
 
        for (i = 0; i < n_rows; i++) {
                ECalModelComponent *comp;
-               icalcomponent      *icalcomp;
+               ICalComponent *icomp;
 
                comp = e_cal_model_get_component_at (e_calendar_view_get_model (cal_view), i);
                if (!comp)
                        continue;
 
-               icalcomp = comp->icalcomp;
-               if (!icalcomp)
+               icomp = comp->icalcomp;
+               if (!icomp)
                        continue;
 
-               adjust_range (icalcomponent_get_dtstart (icalcomp), &earliest, &latest, &set);
-               adjust_range (icalcomponent_get_dtend (icalcomp), &earliest, &latest, &set);
+               adjust_range (i_cal_component_get_dtstart (icomp), &earliest, &latest, &set);
+               adjust_range (i_cal_component_get_dtend (icomp), &earliest, &latest, &set);
        }
 
        if (set) {
@@ -628,6 +648,14 @@ e_cal_list_view_get_visible_time_range (ECalendarView *cal_view,
        return FALSE;
 }
 
+ETable *
+e_cal_list_view_get_table (ECalListView *cal_list_view)
+{
+       g_return_val_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view), NULL);
+
+       return cal_list_view->priv->table;
+}
+
 gboolean
 e_cal_list_view_get_range_shown (ECalListView *cal_list_view,
                                  GDate *start_date,
@@ -636,6 +664,8 @@ e_cal_list_view_get_range_shown (ECalListView *cal_list_view,
        time_t  first, last;
        GDate   end_date;
 
+       g_return_val_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view), FALSE);
+
        if (!e_cal_list_view_get_visible_time_range (E_CALENDAR_VIEW (cal_list_view), &first, &last))
                return FALSE;
 
@@ -651,5 +681,5 @@ e_cal_list_view_is_editing (ECalListView *eclv)
 {
        g_return_val_if_fail (E_IS_CAL_LIST_VIEW (eclv), FALSE);
 
-       return eclv->table && e_table_is_editing (eclv->table);
+       return eclv->priv->table && e_table_is_editing (eclv->priv->table);
 }
diff --git a/src/calendar/gui/e-cal-list-view.h b/src/calendar/gui/e-cal-list-view.h
index b8a6aaabb8..985955d4a0 100644
--- a/src/calendar/gui/e-cal-list-view.h
+++ b/src/calendar/gui/e-cal-list-view.h
@@ -55,38 +55,26 @@
 
 G_BEGIN_DECLS
 
-typedef struct _ECalListView       ECalListView;
-typedef struct _ECalListViewClass  ECalListViewClass;
+typedef struct _ECalListView ECalListView;
+typedef struct _ECalListViewClass ECalListViewClass;
+typedef struct _ECalListViewPrivate ECalListViewPrivate;
 
 struct _ECalListView {
        ECalendarView parent;
 
-       /* The main display table */
-       ETable *table;
-
-       /* The default category for new events */
-       gchar *default_category;
-
-       /* Date editing cell */
-       ECellDateEdit *dates_cell;
-
-       /* The last ECalendarViewEvent we returned from e_cal_list_view_get_selected_events(), to be freed */
-       ECalendarViewEvent *cursor_event;
-
-       /* Idle handler ID for setting a new ETableModel */
-       gint set_table_id;
+       ECalListViewPrivate *priv;
 };
 
 struct _ECalListViewClass {
        ECalendarViewClass parent_class;
 };
 
-GType             e_cal_list_view_get_type             (void);
-ECalendarView *e_cal_list_view_new                     (ECalModel *cal_model);
-
-gboolean   e_cal_list_view_get_range_shown      (ECalListView *cal_list_view, GDate *start_date,
+GType          e_cal_list_view_get_type        (void);
+ECalendarView *        e_cal_list_view_new             (ECalModel *cal_model);
+ETable *       e_cal_list_view_get_table       (ECalListView *cal_list_view);
+gboolean       e_cal_list_view_get_range_shown (ECalListView *cal_list_view,
+                                                GDate *start_date,
                                                 gint *days_shown);
-
 gboolean       e_cal_list_view_is_editing      (ECalListView *eclv);
 
 G_END_DECLS
diff --git a/src/calendar/gui/e-cal-model-calendar.c b/src/calendar/gui/e-cal-model-calendar.c
index 8ce31daf9f..cac1fe3fc0 100644
--- a/src/calendar/gui/e-cal-model-calendar.c
+++ b/src/calendar/gui/e-cal-model-calendar.c
@@ -49,102 +49,119 @@ static ECellDateEditValue *
 get_dtend (ECalModelCalendar *model,
            ECalModelComponent *comp_data)
 {
-       struct icaltimetype tt_end;
+       ICalTime *tt_end;
 
        if (!comp_data->dtend) {
-               icalproperty *prop;
-               icaltimezone *zone = NULL, *model_zone = NULL;
-               gboolean got_zone = FALSE;
+               ICalProperty *prop;
+               ICalTimezone *zone = NULL, *model_zone = NULL;
+               gboolean got_zone = FALSE, is_date;
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTEND_PROPERTY);
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DTEND_PROPERTY);
                if (!prop)
                        return NULL;
 
-               tt_end = icalproperty_get_dtend (prop);
+               tt_end = i_cal_property_get_dtend (prop);
 
-               if (icaltime_get_tzid (tt_end)
-                   && e_cal_client_get_timezone_sync (comp_data->client, icaltime_get_tzid (tt_end), &zone, 
NULL, NULL))
+               if (i_cal_time_get_tzid (tt_end) &&
+                   e_cal_client_get_timezone_sync (comp_data->client, i_cal_time_get_tzid (tt_end), &zone, 
NULL, NULL))
                        got_zone = TRUE;
 
                model_zone = e_cal_model_get_timezone (E_CAL_MODEL (model));
 
+               is_date = i_cal_time_is_date (tt_end);
+
+               g_clear_object (&tt_end);
+               g_clear_object (&prop);
+
                if (got_zone) {
-                       tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, 
zone);
+                       tt_end = i_cal_time_from_timet_with_zone (comp_data->instance_end, is_date, zone);
                } else {
-                       tt_end = icaltime_from_timet_with_zone (
-                               comp_data->instance_end,
-                               tt_end.is_date, model_zone);
+                       tt_end = i_cal_time_from_timet_with_zone (comp_data->instance_end, is_date, 
model_zone);
                }
 
-               if (!icaltime_is_valid_time (tt_end) || icaltime_is_null_time (tt_end))
+               if (!i_cal_time_is_valid_time (tt_end) || i_cal_time_is_null_time (tt_end)) {
+                       g_clear_object (&tt_end);
                        return NULL;
+               }
 
-               if (tt_end.is_date && icalcomponent_get_first_property (comp_data->icalcomp, 
ICAL_DTSTART_PROPERTY)) {
-                       struct icaltimetype tt_start;
-                       icaltimezone *start_zone = NULL;
+               if (i_cal_time_is_date (tt_end) &&
+                   (prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DTSTART_PROPERTY)) 
!= NULL) {
+                       ICalTime *tt_start;
+                       ICalTimezone *start_zone = NULL;
                        gboolean got_start_zone = FALSE;
 
-                       tt_start = icalproperty_get_dtstart (prop);
+                       tt_start = i_cal_property_get_dtstart (prop);
 
-                       if (icaltime_get_tzid (tt_start)
-                           && e_cal_client_get_timezone_sync (comp_data->client, icaltime_get_tzid 
(tt_start), &start_zone, NULL, NULL))
+                       if (i_cal_time_get_tzid (tt_start) &&
+                           e_cal_client_get_timezone_sync (comp_data->client, i_cal_time_get_tzid 
(tt_start), &start_zone, NULL, NULL))
                                got_start_zone = TRUE;
 
+                       is_date = i_cal_time_is_date (tt_end);
+
+                       g_clear_object (&tt_start);
+
                        if (got_start_zone) {
-                               tt_start = icaltime_from_timet_with_zone (comp_data->instance_start, 
tt_start.is_date, start_zone);
+                               tt_start = i_cal_time_from_timet_with_zone (comp_data->instance_start, 
is_date, start_zone);
                        } else {
-                               tt_start = icaltime_from_timet_with_zone (
-                                       comp_data->instance_start,
-                                       tt_start.is_date, model_zone);
+                               tt_start = i_cal_time_from_timet_with_zone (comp_data->instance_start, 
is_date, model_zone);
                        }
 
-                       icaltime_adjust (&tt_start, 1, 0, 0, 0);
+                       i_cal_time_adjust (tt_start, 1, 0, 0, 0);
 
                        /* Decrease by a day only if the DTSTART will still be before, or the same as, DTEND 
*/
-                       if (icaltime_compare (tt_start, tt_end) <= 0)
-                               icaltime_adjust (&tt_end, -1, 0, 0, 0);
+                       if (i_cal_time_compare (tt_start, tt_end) <= 0)
+                               i_cal_time_adjust (tt_end, -1, 0, 0, 0);
+
+                       g_clear_object (&tt_start);
                }
 
-               comp_data->dtend = g_new0 (ECellDateEditValue, 1);
-               comp_data->dtend->tt = tt_end;
+               g_clear_object (&prop);
 
-               if (got_zone)
-                       comp_data->dtend->zone = zone;
-               else
-                       comp_data->dtend->zone = NULL;
+               comp_data->dtend = e_cell_date_edit_value_new_take (tt_end, (got_zone && zone) ? 
e_cal_util_copy_timezone (zone) : NULL);
        }
 
-       return e_cal_model_copy_cell_date_value (comp_data->dtend);
+       return e_cell_date_edit_value_copy (comp_data->dtend);
 }
 
 static gpointer
 get_location (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       const gchar *res = NULL;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
-       if (prop)
-               return (gpointer) icalproperty_get_location (prop);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_LOCATION_PROPERTY);
+       if (prop) {
+               res = i_cal_property_get_location (prop);
+               g_clear_object (&prop);
+       }
 
-       return (gpointer) "";
+       if (!res)
+               res = "";
+
+       return (gpointer) res;
 }
 
 static gpointer
 get_transparency (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_TRANSP_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_TRANSP_PROPERTY);
        if (prop) {
-               icalproperty_transp transp;
-
-               transp = icalproperty_get_transp (prop);
-               if (transp == ICAL_TRANSP_TRANSPARENT ||
-                   transp == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
-                       return _("Free");
-               else if (transp == ICAL_TRANSP_OPAQUE ||
-                        transp == ICAL_TRANSP_OPAQUENOCONFLICT)
-                       return _("Busy");
+               ICalPropertyTransp transp;
+               const gchar *res = NULL;
+
+               transp = i_cal_property_get_transp (prop);
+               if (transp == I_CAL_TRANSP_TRANSPARENT ||
+                   transp == I_CAL_TRANSP_TRANSPARENTNOCONFLICT)
+                       res = _("Free");
+               else if (transp == I_CAL_TRANSP_OPAQUE ||
+                        transp == I_CAL_TRANSP_OPAQUENOCONFLICT)
+                       res = _("Busy");
+
+               g_clear_object (&prop);
+
+               return (gpointer) res;
        }
 
        return NULL;
@@ -155,28 +172,29 @@ set_dtend (ECalModel *model,
            ECalModelComponent *comp_data,
            gconstpointer value)
 {
-       e_cal_model_update_comp_time (model, comp_data, value, ICAL_DTEND_PROPERTY, icalproperty_set_dtend, 
icalproperty_new_dtend);
+       e_cal_model_update_comp_time (model, comp_data, value, I_CAL_DTEND_PROPERTY, 
i_cal_property_set_dtend, i_cal_property_new_dtend);
 }
 
 static void
 set_location (ECalModelComponent *comp_data,
               gconstpointer value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_LOCATION_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
        } else {
-               if (prop)
-                       icalproperty_set_location (prop, (const gchar *) value);
-               else {
-                       prop = icalproperty_new_location ((const gchar *) value);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_location (prop, (const gchar *) value);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_location ((const gchar *) value);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
        }
 }
@@ -185,36 +203,37 @@ static void
 set_transparency (ECalModelComponent *comp_data,
                   gconstpointer value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_TRANSP_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_TRANSP_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
        } else {
-               icalproperty_transp transp;
+               ICalPropertyTransp transp;
 
                if (!g_ascii_strcasecmp (value, "FREE"))
-                       transp = ICAL_TRANSP_TRANSPARENT;
+                       transp = I_CAL_TRANSP_TRANSPARENT;
                else if (!g_ascii_strcasecmp (value, "OPAQUE"))
-                       transp = ICAL_TRANSP_OPAQUE;
+                       transp = I_CAL_TRANSP_OPAQUE;
                else {
                        if (prop) {
-                               icalcomponent_remove_property (comp_data->icalcomp, prop);
-                               icalproperty_free (prop);
+                               i_cal_component_remove_property (comp_data->icalcomp, prop);
+                               g_object_unref (prop);
                        }
 
                        return;
                }
 
-               if (prop)
-                       icalproperty_set_transp (prop, transp);
-               else {
-                       prop = icalproperty_new_transp (transp);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_transp (prop, transp);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_transp (transp);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
        }
 }
@@ -310,7 +329,7 @@ cal_model_calendar_set_value_at (ETableModel *etm,
        if (!comp_data)
                return;
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (comp_data->icalcomp));
        if (!comp) {
                return;
        }
@@ -379,7 +398,7 @@ cal_model_calendar_duplicate_value (ETableModel *etm,
 
        switch (col) {
        case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
-               return e_cal_model_copy_cell_date_value (value);
+               return e_cell_date_edit_value_copy (value);
        case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
        case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
                return g_strdup (value);
diff --git a/src/calendar/gui/e-cal-model-memos.c b/src/calendar/gui/e-cal-model-memos.c
index f7ee2b03d6..7a19dce3d6 100644
--- a/src/calendar/gui/e-cal-model-memos.c
+++ b/src/calendar/gui/e-cal-model-memos.c
@@ -64,17 +64,21 @@ cal_model_memos_fill_component_from_values (ECalModel *model,
                                            ECalModelComponent *comp_data,
                                            GHashTable *values)
 {
-       icaltimetype start;
+       ICalTime *dtstart;
 
        g_return_if_fail (E_IS_CAL_MODEL_MEMOS (model));
        g_return_if_fail (comp_data != NULL);
        g_return_if_fail (values != NULL);
 
-       start = icalcomponent_get_dtstart (comp_data->icalcomp);
-       if (icaltime_compare_date_only (start, icaltime_null_time ()) == 0) {
-               start = icaltime_today ();
-               icalcomponent_set_dtstart (comp_data->icalcomp, start);
+       dtstart = i_cal_component_get_dtstart (comp_data->icalcomp);
+       if (!dtstart || i_cal_time_is_null_time (dtstart) || !i_cal_time_is_valid_time (dtstart)) {
+               g_clear_object (&dtstart);
+
+               dtstart = i_cal_time_today ();
+               i_cal_component_set_dtstart (comp_data->icalcomp, dtstart);
        }
+
+       g_clear_object (&dtstart);
 }
 
 static gint
diff --git a/src/calendar/gui/e-cal-model-tasks.c b/src/calendar/gui/e-cal-model-tasks.c
index 71bb3ae069..4f01a83a31 100644
--- a/src/calendar/gui/e-cal-model-tasks.c
+++ b/src/calendar/gui/e-cal-model-tasks.c
@@ -83,28 +83,26 @@ ensure_task_complete (ECalModelComponent *comp_data,
 static void
 ensure_task_partially_complete (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        /* Date Completed. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-       if (prop) {
-               icalcomponent_remove_property (comp_data->icalcomp, prop);
-               icalproperty_free (prop);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_COMPLETED_PROPERTY, TRUE);
 
        /* Percent. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY);
        if (!prop)
-               icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_percentcomplete (50));
-       else if (icalproperty_get_percentcomplete (prop) == 0 || icalproperty_get_percentcomplete (prop) == 
100)
-               icalproperty_set_percentcomplete (prop, 50);
+               i_cal_component_take_property (comp_data->icalcomp, i_cal_property_new_percentcomplete (50));
+       else if (i_cal_property_get_percentcomplete (prop) == 0 || i_cal_property_get_percentcomplete (prop) 
== 100)
+               i_cal_property_set_percentcomplete (prop, 50);
+       g_clear_object (&prop);
 
        /* Status. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
        if (prop)
-               icalproperty_set_status (prop, ICAL_STATUS_INPROCESS);
+               i_cal_property_set_status (prop, I_CAL_STATUS_INPROCESS);
        else
-               icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_status 
(ICAL_STATUS_INPROCESS));
+               i_cal_component_take_property (comp_data->icalcomp, i_cal_property_new_status 
(I_CAL_STATUS_INPROCESS));
+       g_clear_object (&prop);
 }
 
 /* This makes sure a task is marked as incomplete. It clears the
@@ -112,154 +110,177 @@ ensure_task_partially_complete (ECalModelComponent *comp_data)
  * and if the status is "Completed" it sets it to "Needs Action".
  * Note that this doesn't update the component on the client. */
 static void
-ensure_task_not_complete (ECalModelComponent *comp_data)
+ensure_task_not_complete (ECalModelComponent *comp_data,
+                         gboolean with_status)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        /* Date Completed. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-       if (prop) {
-               icalcomponent_remove_property (comp_data->icalcomp, prop);
-               icalproperty_free (prop);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_COMPLETED_PROPERTY, TRUE);
 
        /* Percent. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
-       if (prop) {
-               icalcomponent_remove_property (comp_data->icalcomp, prop);
-               icalproperty_free (prop);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY, 
TRUE);
 
        /* Status. */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
-       if (prop)
-               icalproperty_set_status (prop, ICAL_STATUS_NEEDSACTION);
+       if (with_status) {
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
+               if (prop) {
+                       i_cal_property_set_status (prop, I_CAL_STATUS_NEEDSACTION);
+                       g_object_unref (prop);
+               }
+       }
 }
 
 static ECellDateEditValue *
 get_completed (ECalModelComponent *comp_data)
 {
-       struct icaltimetype tt_completed;
-
        if (!comp_data->completed) {
-               icaltimezone *zone;
-               icalproperty *prop;
+               ICalTime *tt_completed;
+               ICalTimezone *zone = NULL;
+               ICalProperty *prop;
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_COMPLETED_PROPERTY);
                if (!prop)
                        return NULL;
 
-               tt_completed = icalproperty_get_completed (prop);
-               if (!icaltime_is_valid_time (tt_completed) || icaltime_is_null_time (tt_completed))
+               tt_completed = i_cal_property_get_completed (prop);
+               g_clear_object (&prop);
+
+               if (!i_cal_time_is_valid_time (tt_completed) || i_cal_time_is_null_time (tt_completed)) {
+                       g_clear_object (&tt_completed);
                        return NULL;
+               }
 
-               comp_data->completed = g_new0 (ECellDateEditValue, 1);
-               comp_data->completed->tt = tt_completed;
+               if (!i_cal_time_get_tzid (tt_completed) ||
+                   !e_cal_client_get_timezone_sync (comp_data->client, i_cal_time_get_tzid (tt_completed), 
&zone, NULL, NULL))
+                       zone = NULL;
 
-               if (icaltime_get_tzid (tt_completed)
-                   && e_cal_client_get_timezone_sync (comp_data->client, icaltime_get_tzid (tt_completed), 
&zone, NULL, NULL))
-                       comp_data->completed->zone = zone;
-               else
-                       comp_data->completed->zone = NULL;
+               comp_data->completed = e_cell_date_edit_value_new_take (tt_completed, zone ? 
e_cal_util_copy_timezone (zone) : NULL);
        }
 
-       return e_cal_model_copy_cell_date_value (comp_data->completed);
+       return e_cell_date_edit_value_copy (comp_data->completed);
 }
 
 static ECellDateEditValue *
 get_due (ECalModelComponent *comp_data)
 {
-       struct icaltimetype tt_due;
-
        if (!comp_data->due) {
-               icaltimezone *zone;
-               icalproperty *prop;
+               ICalTime *tt_due;
+               ICalTimezone *zone = NULL;
+               ICalProperty *prop;
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DUE_PROPERTY);
                if (!prop)
                        return NULL;
 
-               tt_due = icalproperty_get_due (prop);
-               if (!icaltime_is_valid_time (tt_due) || icaltime_is_null_time (tt_due))
+               tt_due = i_cal_property_get_due (prop);
+
+               g_clear_object (&prop);
+
+               if (!i_cal_time_is_valid_time (tt_due) || i_cal_time_is_null_time (tt_due)) {
+                       g_clear_object (&tt_due);
                        return NULL;
+               }
 
-               comp_data->due = g_new0 (ECellDateEditValue, 1);
-               comp_data->due->tt = tt_due;
+               if (!i_cal_time_get_tzid (tt_due) ||
+                   !e_cal_client_get_timezone_sync (comp_data->client, i_cal_time_get_tzid (tt_due), &zone, 
NULL, NULL))
+                       zone = NULL;
 
-               if (icaltime_get_tzid (tt_due)
-                   && e_cal_client_get_timezone_sync (comp_data->client, icaltime_get_tzid (tt_due), &zone, 
NULL, NULL))
-                       comp_data->due->zone = zone;
-               else
-                       comp_data->due->zone = NULL;
+               comp_data->due = e_cell_date_edit_value_new_take (tt_due, zone ? e_cal_util_copy_timezone 
(zone) : NULL);
        }
 
-       return e_cal_model_copy_cell_date_value (comp_data->due);
+       return e_cell_date_edit_value_copy (comp_data->due);
 }
 
 static gpointer
 get_geo (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
-       struct icalgeotype geo;
+       ICalProperty *prop;
+       ICalGeo *geo = NULL;
        static gchar buf[32];
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_GEO_PROPERTY);
        if (prop) {
-               geo = icalproperty_get_geo (prop);
-               g_snprintf (
-                       buf, sizeof (buf), "%g %s, %g %s",
-                       fabs (geo.lat),
-                       geo.lat >= 0.0 ? "N" : "S",
-                       fabs (geo.lon),
-                       geo.lon >= 0.0 ? "E" : "W");
-               return buf;
+               geo = i_cal_property_get_geo (prop);
+               if (geo) {
+                       g_snprintf (
+                               buf, sizeof (buf), "%g %s, %g %s",
+                               fabs (i_cal_geo_get_lat (geo)),
+                               i_cal_geo_get_lat (geo) >= 0.0 ? "N" : "S",
+                               fabs (i_cal_geo_get_lon (geo)),
+                               i_cal_geo_get_lon (geo) >= 0.0 ? "E" : "W");
+                       g_object_unref (prop);
+                       g_object_unref (geo);
+                       return buf;
+               }
        }
 
+       g_clear_object (&prop);
+       g_clear_object (&geo);
+
        return (gpointer) "";
 }
 
 static gint
 get_percent (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       gint percent = 0;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
-       if (prop)
-               return icalproperty_get_percentcomplete (prop);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY);
+       if (prop) {
+               percent = i_cal_property_get_percentcomplete (prop);
+               g_object_unref (prop);
+       }
 
-       return 0;
+       return percent;
 }
 
 static gpointer
 get_priority (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       const gchar *value = NULL;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PRIORITY_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PRIORITY_PROPERTY);
        if (prop)
-               return (gpointer) e_cal_util_priority_to_string (icalproperty_get_priority (prop));
+               value = e_cal_util_priority_to_string (i_cal_property_get_priority (prop));
 
-       return (gpointer) "";
+       if (!value)
+               value = "";
+
+       return (gpointer) value;
 }
 
 static gboolean
 is_status_canceled (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       gboolean res;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
 
-       return prop && icalproperty_get_status (prop) == ICAL_STATUS_CANCELLED;
+       res = prop && i_cal_property_get_status (prop) == I_CAL_STATUS_CANCELLED;
+
+       g_clear_object (&prop);
+
+       return res;
 }
 
 static gpointer
 get_status (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
        if (prop) {
-               switch (icalproperty_get_status (prop)) {
+               ICalPropertyStatus status;
+
+               status = i_cal_property_get_status (prop);
+
+               g_object_unref (prop);
+
+               switch (status) {
                case ICAL_STATUS_NONE:
                        return (gpointer) "";
                case ICAL_STATUS_NEEDSACTION:
@@ -281,43 +302,59 @@ get_status (ECalModelComponent *comp_data)
 static gpointer
 get_url (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       const gchar *url = NULL;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
-       if (prop)
-               return (gpointer) icalproperty_get_url (prop);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_URL_PROPERTY);
+       if (prop) {
+               url = i_cal_property_get_url (prop);
+               g_object_unref (prop);
+       }
 
-       return (gpointer) "";
+       return (gpointer) (url ? url : "");
 }
 
 static gpointer
 get_location (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       const gchar *location = NULL;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
-       if (prop)
-               return (gpointer) icalproperty_get_location (prop);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_LOCATION_PROPERTY);
+       if (prop) {
+               location = i_cal_property_get_location (prop);
+               g_object_unref (prop);
+       }
 
-       return (gpointer) "";
+       return (gpointer) (location ? location : "");
 }
 
 static gboolean
 is_complete (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-       if (prop)
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_COMPLETED_PROPERTY);
+       if (prop) {
+               g_object_unref (prop);
                return TRUE;
+       }
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
-       if (prop && icalproperty_get_percentcomplete (prop) == 100)
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY);
+       if (prop && i_cal_property_get_percentcomplete (prop) == 100) {
+               g_object_unref (prop);
                return TRUE;
+       }
+
+       g_clear_object (&prop);
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
-       if (prop && icalproperty_get_status (prop) == ICAL_STATUS_COMPLETED)
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
+       if (prop && i_cal_property_get_status (prop) == I_CAL_STATUS_COMPLETED) {
+               g_object_unref (prop);
                return TRUE;
+       }
+
+       g_clear_object (&prop);
 
        return FALSE;
 }
@@ -334,27 +371,33 @@ static ECalModelTasksDueStatus
 get_due_status (ECalModelTasks *model,
                 ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        /* First, do we have a due date? */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DUE_PROPERTY);
        if (!prop)
                return E_CAL_MODEL_TASKS_DUE_NEVER;
        else {
-               struct icaltimetype now_tt, due_tt;
-               icaltimezone *zone = NULL;
+               ICalTime *now_tt, *due_tt;
+               ICalTimezone *zone = NULL;
 
                /* Second, is it already completed? */
-               if (is_complete (comp_data))
+               if (is_complete (comp_data)) {
+                       g_object_unref (prop);
                        return E_CAL_MODEL_TASKS_DUE_COMPLETE;
+               }
 
                /* Third, are we overdue as of right now? */
-               due_tt = icalproperty_get_due (prop);
-               if (due_tt.is_date) {
+               due_tt = i_cal_property_get_due (prop);
+               if (i_cal_time_is_date (due_tt)) {
                        gint cmp;
 
-                       now_tt = icaltime_current_time_with_zone (e_cal_model_get_timezone (E_CAL_MODEL 
(model)));
-                       cmp = icaltime_compare_date_only (due_tt, now_tt);
+                       now_tt = i_cal_time_current_time_with_zone (e_cal_model_get_timezone (E_CAL_MODEL 
(model)));
+                       cmp = i_cal_time_compare_date_only (due_tt, now_tt);
+
+                       g_object_unref (now_tt);
+                       g_object_unref (due_tt);
+                       g_object_unref (prop);
 
                        if (cmp < 0)
                                return E_CAL_MODEL_TASKS_DUE_OVERDUE;
@@ -363,28 +406,42 @@ get_due_status (ECalModelTasks *model,
                        else
                                return E_CAL_MODEL_TASKS_DUE_FUTURE;
                } else {
-                       icalparameter *param;
+                       ECalModelTasksDueStatus res;
+                       ICalParameter *param;
                        const gchar *tzid;
 
-                       if (!(param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER)))
+                       if (!(param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER))) {
+                               g_object_unref (due_tt);
+                               g_object_unref (prop);
                                return E_CAL_MODEL_TASKS_DUE_FUTURE;
+                       }
 
                        /* Get the current time in the same timezone as the DUE date.*/
-                       tzid = icalparameter_get_tzid (param);
-                       e_cal_client_get_timezone_sync (
-                               comp_data->client, tzid, &zone, NULL, NULL);
-                       if (zone == NULL)
+                       tzid = i_cal_parameter_get_tzid (param);
+                       if (!e_cal_client_get_timezone_sync (comp_data->client, tzid, &zone, NULL, NULL))
+                               zone = NULL;
+
+                       g_object_unref (param);
+                       g_object_unref (prop);
+
+                       if (zone == NULL) {
+                               g_object_unref (due_tt);
                                return E_CAL_MODEL_TASKS_DUE_FUTURE;
+                       }
 
-                       now_tt = icaltime_current_time_with_zone (zone);
+                       now_tt = i_cal_time_current_time_with_zone (zone);
 
-                       if (icaltime_compare (due_tt, now_tt) <= 0)
-                               return E_CAL_MODEL_TASKS_DUE_OVERDUE;
+                       if (i_cal_time_compare (due_tt, now_tt) <= 0)
+                               res = E_CAL_MODEL_TASKS_DUE_OVERDUE;
+                       else if (i_cal_time_compare_date_only (due_tt, now_tt) == 0)
+                               res = E_CAL_MODEL_TASKS_DUE_TODAY;
                        else
-                               if (icaltime_compare_date_only (due_tt, now_tt) == 0)
-                                       return E_CAL_MODEL_TASKS_DUE_TODAY;
-                               else
-                                       return E_CAL_MODEL_TASKS_DUE_FUTURE;
+                               res = E_CAL_MODEL_TASKS_DUE_FUTURE;
+
+                       g_clear_object (&due_tt);
+                       g_clear_object (&now_tt);
+
+                       return res;
                }
        }
 }
@@ -414,19 +471,21 @@ set_completed (ECalModelTasks *model,
        ECellDateEditValue *dv = (ECellDateEditValue *) value;
 
        if (!dv)
-               ensure_task_not_complete (comp_data);
+               ensure_task_not_complete (comp_data, TRUE);
        else {
+               ICalTime *tt;
                time_t t;
 
-               if (dv->tt.is_date) {
+               tt = e_cell_date_edit_value_get_time (dv);
+               if (i_cal_time_is_date (tt)) {
                        /* if it's a date, it will be floating,
                         * but completed needs a date time value */
-                       dv->tt.is_date = FALSE;
-                       t = icaltime_as_timet_with_zone (dv->tt, e_cal_model_get_timezone (E_CAL_MODEL 
(model)));
+                       i_cal_time_set_is_date (tt, FALSE);
+                       t = i_cal_time_as_timet_with_zone (tt, e_cal_model_get_timezone (E_CAL_MODEL 
(model)));
                } else {
                        /* we assume that COMPLETED is entered in the current timezone,
                         * even though it gets stored in UTC */
-                       t = icaltime_as_timet_with_zone (dv->tt, dv->zone);
+                       t = i_cal_time_as_timet_with_zone (tt, e_cell_date_edit_value_get_zone (dv));
                }
 
                ensure_task_complete (comp_data, t);
@@ -442,7 +501,7 @@ set_complete (ECalModelComponent *comp_data,
        if (state)
                ensure_task_complete (comp_data, -1);
        else
-               ensure_task_not_complete (comp_data);
+               ensure_task_not_complete (comp_data, TRUE);
 }
 
 static void
@@ -450,7 +509,7 @@ set_due (ECalModel *model,
          ECalModelComponent *comp_data,
          gconstpointer value)
 {
-       e_cal_model_update_comp_time (model, comp_data, value, ICAL_DUE_PROPERTY, icalproperty_set_due, 
icalproperty_new_due);
+       e_cal_model_update_comp_time (model, comp_data, value, I_CAL_DUE_PROPERTY, i_cal_property_set_due, 
i_cal_property_new_due);
 }
 
 /* FIXME: We need to set the "transient_for" property for the dialog, but the
@@ -472,32 +531,32 @@ static void
 set_geo (ECalModelComponent *comp_data,
          const gchar *value)
 {
-       gdouble latitude, longitude;
+       gdouble latitude = 0.0, longitude = 0.0;
        gint matched;
-       struct icalgeotype geo;
-       icalproperty *prop;
+       ICalGeo *geo;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_GEO_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
        } else {
                matched = sscanf (value, "%lg , %lg", &latitude, &longitude);
                if (matched != 2)
                        show_geo_warning ();
 
-               geo.lat = latitude;
-               geo.lon = longitude;
-               if (prop)
-                       icalproperty_set_geo (prop, geo);
-               else {
-                       prop = icalproperty_new_geo (geo);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
-               }
+               geo = i_cal_geo_new (latitude, longitude);
 
+               if (prop) {
+                       i_cal_property_set_geo (prop, geo);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_geo (geo);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
+               }
        }
 }
 
@@ -505,41 +564,46 @@ static void
 set_status (ECalModelComponent *comp_data,
             const gchar *value)
 {
-       icalproperty_status status;
-       icalproperty *prop;
+       ICalPropertyStatus status;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
 
        /* an empty string is the same as 'None' */
-       if (!value[0])
+       if (!value[0]) {
+               g_clear_object (&prop);
                return;
+       }
 
        /* Translators: "None" for task's status */
-       if (!e_util_utf8_strcasecmp (value, C_("cal-task-status", "None")))
+       if (!e_util_utf8_strcasecmp (value, C_("cal-task-status", "None"))) {
+               g_clear_object (&prop);
                return;
-       else if (!e_util_utf8_strcasecmp (value, _("Not Started")))
-               status = ICAL_STATUS_NEEDSACTION;
+       } else if (!e_util_utf8_strcasecmp (value, _("Not Started")))
+               status = I_CAL_STATUS_NEEDSACTION;
        else if (!e_util_utf8_strcasecmp (value, _("In Progress")))
-               status = ICAL_STATUS_INPROCESS;
+               status = I_CAL_STATUS_INPROCESS;
        else if (!e_util_utf8_strcasecmp (value, _("Completed")))
-               status = ICAL_STATUS_COMPLETED;
+               status = I_CAL_STATUS_COMPLETED;
        else if (!e_util_utf8_strcasecmp (value, _("Cancelled")))
-               status = ICAL_STATUS_CANCELLED;
+               status = I_CAL_STATUS_CANCELLED;
        else {
+               g_clear_object (&prop);
                g_warning ("Invalid status: %s\n", value);
                return;
        }
 
-       if (prop)
-               icalproperty_set_status (prop, status);
-       else {
-               prop = icalproperty_new_status (status);
-               icalcomponent_add_property (comp_data->icalcomp, prop);
+       if (prop) {
+               i_cal_property_set_status (prop, status);
+               g_object_unref (prop);
+       } else {
+               prop = i_cal_property_new_status (status);
+               i_cal_component_take_property (comp_data->icalcomp, prop);
        }
 
        switch (status) {
        case ICAL_STATUS_NEEDSACTION:
-               ensure_task_not_complete (comp_data);
+               ensure_task_not_complete (comp_data, TRUE);
                break;
 
        case ICAL_STATUS_INPROCESS:
@@ -547,9 +611,7 @@ set_status (ECalModelComponent *comp_data,
                break;
 
        case ICAL_STATUS_CANCELLED:
-               ensure_task_not_complete (comp_data);
-               /* do this again, because the previous function changed status to NEEDSACTION */
-               icalproperty_set_status (prop, status);
+               ensure_task_not_complete (comp_data, FALSE);
                break;
 
        case ICAL_STATUS_COMPLETED:
@@ -567,53 +629,53 @@ static void
 set_percent (ECalModelComponent *comp_data,
              gconstpointer value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
        gint percent = GPOINTER_TO_INT (value);
 
        g_return_if_fail (percent >= -1);
        g_return_if_fail (percent <= 100);
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY);
 
        /* A value of -1 means it isn't set */
        if (percent == -1) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
-               ensure_task_not_complete (comp_data);
+               ensure_task_not_complete (comp_data, TRUE);
        } else {
-               if (prop)
-                       icalproperty_set_percentcomplete (prop, percent);
-               else {
-                       prop = icalproperty_new_percentcomplete (percent);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_percentcomplete (prop, percent);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_percentcomplete (percent);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
 
                if (percent == 100)
                        ensure_task_complete (comp_data, -1);
                else {
-                       prop = icalcomponent_get_first_property (comp_data->icalcomp, 
ICAL_COMPLETED_PROPERTY);
+                       prop = i_cal_component_get_first_property (comp_data->icalcomp, 
I_CAL_COMPLETED_PROPERTY);
                        if (prop) {
-                               icalcomponent_remove_property (comp_data->icalcomp, prop);
-                               icalproperty_free (prop);
+                               i_cal_component_remove_property (comp_data->icalcomp, prop);
+                               g_object_unref (prop);
                        }
 
                        if (percent > 0)
                                set_status (comp_data, _("In Progress"));
                }
        }
-
 }
 
 static void
 set_priority (ECalModelComponent *comp_data,
               const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
        gint priority;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PRIORITY_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_PRIORITY_PROPERTY);
 
        priority = e_cal_util_priority_from_string (value);
        if (priority == -1) {
@@ -621,11 +683,12 @@ set_priority (ECalModelComponent *comp_data,
                priority = 0;
        }
 
-       if (prop)
-               icalproperty_set_priority (prop, priority);
-       else {
-               prop = icalproperty_new_priority (priority);
-               icalcomponent_add_property (comp_data->icalcomp, prop);
+       if (prop) {
+               i_cal_property_set_priority (prop, priority);
+               g_object_unref (prop);
+       } else {
+               prop = i_cal_property_new_priority (priority);
+               i_cal_component_take_property (comp_data->icalcomp, prop);
        }
 }
 
@@ -633,21 +696,22 @@ static void
 set_url (ECalModelComponent *comp_data,
          const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_URL_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
        } else {
-               if (prop)
-                       icalproperty_set_url (prop, value);
-               else {
-                       prop = icalproperty_new_url (value);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_url (prop, value);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_url (value);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
        }
 }
@@ -656,21 +720,22 @@ static void
 set_location (ECalModelComponent *comp_data,
               gconstpointer value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_LOCATION_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
        } else {
-               if (prop)
-                       icalproperty_set_location (prop, (const gchar *) value);
-               else {
-                       prop = icalproperty_new_location ((const gchar *) value);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_location (prop, (const gchar *) value);
+                       g_object_unref (prop);
+               } else {
+                       prop = i_cal_property_new_location ((const gchar *) value);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
        }
 }
@@ -1003,7 +1068,7 @@ cal_model_tasks_duplicate_value (ETableModel *etm,
        switch (col) {
        case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
        case E_CAL_MODEL_TASKS_FIELD_DUE :
-               return e_cal_model_copy_cell_date_value (value);
+               return e_cell_date_edit_value_copy (value);
 
        case E_CAL_MODEL_TASKS_FIELD_GEO :
        case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
@@ -1386,7 +1451,7 @@ void
 e_cal_model_tasks_mark_comp_incomplete (ECalModelTasks *model,
                                         ECalModelComponent *comp_data)
 {
-       icalproperty *prop,*prop1;
+       ICalProperty *prop;
 
        g_return_if_fail (model != NULL);
        g_return_if_fail (comp_data != NULL);
@@ -1395,25 +1460,18 @@ e_cal_model_tasks_mark_comp_incomplete (ECalModelTasks *model,
        /*e_table_model_pre_change (E_TABLE_MODEL (model));*/
 
        /* Status */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
        if (prop)
-               icalproperty_set_status (prop, ICAL_STATUS_NEEDSACTION);
+               i_cal_property_set_status (prop, ICAL_STATUS_NEEDSACTION);
        else
-               icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_status 
(ICAL_STATUS_NEEDSACTION));
+               i_cal_component_take_property (comp_data->icalcomp, i_cal_property_new_status 
(I_CAL_STATUS_NEEDSACTION));
+       g_clear_object (&prop);
 
        /*complete property*/
-       prop1 = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-       if (prop1) {
-               icalcomponent_remove_property (comp_data->icalcomp, prop1);
-               icalproperty_free (prop1);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_COMPLETED_PROPERTY, TRUE);
 
        /* Percent. */
-       prop1 = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
-       if (prop1) {
-               icalcomponent_remove_property (comp_data->icalcomp, prop1);
-               icalproperty_free (prop1);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_PERCENTCOMPLETE_PROPERTY, 
TRUE);
 
        /*e_table_model_row_changed (E_TABLE_MODEL (model), model_row);*/
 
diff --git a/src/calendar/gui/e-cal-model.c b/src/calendar/gui/e-cal-model.c
index 78bf368f18..af436480ba 100644
--- a/src/calendar/gui/e-cal-model.c
+++ b/src/calendar/gui/e-cal-model.c
@@ -64,8 +64,8 @@ struct _ECalModelPrivate {
        /* Array for storing the objects. Each element is of type ECalModelComponent */
        GPtrArray *objects;
 
-       icalcomponent_kind kind;
-       icaltimezone *zone;
+       ICalComponentKind kind;
+       ICalTimezone *zone;
 
        /* The time range to display */
        time_t start;
@@ -197,36 +197,26 @@ G_DEFINE_TYPE (ECalModelComponent, e_cal_model_component, G_TYPE_OBJECT)
 static void
 e_cal_model_component_set_icalcomponent (ECalModelComponent *comp_data,
                                         ECalModel *model,
-                                        icalcomponent *icalcomp)
+                                        ICalComponent *icomp)
 {
        if (model != NULL)
                g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (comp_data != NULL);
 
-       #define free_ptr(x) { \
-               if (x) { \
-                       g_free (x); \
-                       x = NULL; \
-               } \
-       }
-
-       if (comp_data->icalcomp)
-               icalcomponent_free (comp_data->icalcomp);
-       comp_data->icalcomp = icalcomp;
+       g_clear_object (&comp_data->icalcomp);
+       comp_data->icalcomp = icomp;
 
        if (comp_data->priv->categories_str)
                g_string_free (comp_data->priv->categories_str, TRUE);
        comp_data->priv->categories_str = NULL;
 
-       free_ptr (comp_data->dtstart);
-       free_ptr (comp_data->dtend);
-       free_ptr (comp_data->due);
-       free_ptr (comp_data->completed);
-       free_ptr (comp_data->created);
-       free_ptr (comp_data->lastmodified);
-       free_ptr (comp_data->color);
-
-       #undef free_ptr
+       g_clear_pointer (&comp_data->dtstart, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->dtend, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->due, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->completed, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->created, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->lastmodified, e_cell_date_edit_value_free);
+       g_clear_pointer (&comp_data->color, g_free);
 
        if (comp_data->icalcomp && model)
                e_cal_model_set_instance_times (comp_data, model->priv->zone);
@@ -271,14 +261,14 @@ static gpointer
 get_categories (ECalModelComponent *comp_data)
 {
        if (!comp_data->priv->categories_str) {
-               icalproperty *prop;
+               ICalProperty *prop;
 
                comp_data->priv->categories_str = g_string_new ("");
 
-               for (prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY);
+               for (prop = i_cal_component_get_first_property (comp_data->icalcomp, 
I_CAL_CATEGORIES_PROPERTY);
                     prop;
-                    prop = icalcomponent_get_next_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY)) {
-                       const gchar *categories = icalproperty_get_categories (prop);
+                    g_object_unref (prop), prop = i_cal_component_get_next_property (comp_data->icalcomp, 
I_CAL_CATEGORIES_PROPERTY)) {
+                       const gchar *categories = i_cal_property_get_categories (prop);
                        if (!categories)
                                continue;
 
@@ -294,23 +284,24 @@ get_categories (ECalModelComponent *comp_data)
 static gchar *
 get_classification (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
-       icalproperty_class class;
+       ICalProperty *prop;
+       ICalProperty_Class class_prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CLASS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_CLASS_PROPERTY);
 
        if (!prop)
                return _("Public");
 
-       class = icalproperty_get_class (prop);
+       class_prop = i_cal_property_get_class (prop);
 
-       switch (class)
-       {
-       case ICAL_CLASS_PUBLIC:
+       g_clear_object (&prop);
+
+       switch (class_prop) {
+       case I_CAL_CLASS_PUBLIC:
                return _("Public");
-       case ICAL_CLASS_PRIVATE:
+       case I_CAL_CLASS_PRIVATE:
                return _("Private");
-       case ICAL_CLASS_CONFIDENTIAL:
+       case I_CAL_CLASS_CONFIDENTIAL:
                return _("Confidential");
        default:
                return _("Unknown");
@@ -329,19 +320,18 @@ get_color (ECalModel *model,
 static gpointer
 get_description (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
-
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
-       if (prop) {
-               GString *str = g_string_new (NULL);
-               do {
-                       str = g_string_append (str, icalproperty_get_description (prop));
-               } while ((prop = icalcomponent_get_next_property (comp_data->icalcomp, 
ICAL_DESCRIPTION_PROPERTY)));
+       ICalProperty *prop;
+       GString *str = NULL;
 
-               return g_string_free (str, FALSE);
+       for (prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DESCRIPTION_PROPERTY);
+            prop;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (comp_data->icalcomp, 
I_CAL_DESCRIPTION_PROPERTY)) {
+               if (!str)
+                       str = g_string_new (NULL);
+               g_string_append (str, i_cal_property_get_description (prop));
        }
 
-       return g_strdup ("");
+       return str ? g_string_free (str, FALSE) : g_strdup ("");
 }
 
 static ECellDateEditValue *
@@ -349,65 +339,67 @@ get_dtstart (ECalModel *model,
              ECalModelComponent *comp_data)
 {
        ECalModelPrivate *priv;
-       struct icaltimetype tt_start;
+       ICalTime *tt_start;
 
        priv = model->priv;
 
        if (!comp_data->dtstart) {
-               icalproperty *prop;
-               icaltimezone *zone;
+               ICalProperty *prop;
+               ICalTimezone *zone;
                gboolean got_zone = FALSE;
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DTSTART_PROPERTY);
                if (!prop)
                        return NULL;
 
-               tt_start = icalproperty_get_dtstart (prop);
+               tt_start = i_cal_property_get_dtstart (prop);
 
-               if (icaltime_get_tzid (tt_start)
-                   && e_cal_client_get_timezone_sync (comp_data->client, icaltime_get_tzid (tt_start), 
&zone, NULL, NULL))
+               if (i_cal_time_get_tzid (tt_start)
+                   && e_cal_client_get_timezone_sync (comp_data->client, i_cal_time_get_tzid (tt_start), 
&zone, NULL, NULL))
                        got_zone = TRUE;
 
                if (e_cal_data_model_get_expand_recurrences (priv->data_model)) {
-                       if (got_zone)
-                               tt_start = icaltime_from_timet_with_zone (comp_data->instance_start, 
tt_start.is_date, zone);
-                       else if (priv->zone)
-                               tt_start = icaltime_from_timet_with_zone (comp_data->instance_start, 
tt_start.is_date, priv->zone);
+                       gboolean is_date = i_cal_time_is_date (tt_start);
+
+                       if (got_zone) {
+                               g_clear_object (&tt_start);
+                               tt_start = i_cal_time_from_timet_with_zone (comp_data->instance_start, 
is_date, zone);
+                       } else if (priv->zone) {
+                               g_clear_object (&tt_start);
+                               tt_start = i_cal_time_from_timet_with_zone (comp_data->instance_start, 
is_date, priv->zone);
+                       }
                }
 
-               if (!icaltime_is_valid_time (tt_start) || icaltime_is_null_time (tt_start))
-                       return NULL;
+               g_object_unref (prop);
 
-               comp_data->dtstart = g_new0 (ECellDateEditValue, 1);
-               comp_data->dtstart->tt = tt_start;
+               if (!i_cal_time_is_valid_time (tt_start) || i_cal_time_is_null_time (tt_start)) {
+                       g_clear_object (&tt_start);
+                       return NULL;
+               }
 
-               if (got_zone)
-                       comp_data->dtstart->zone = zone;
-               else
-                       comp_data->dtstart->zone = NULL;
+               comp_data->dtstart = e_cell_date_edit_value_new_take (tt_start, (got_zone && zone) ? 
e_cal_util_copy_timezone (zone) : NULL);
        }
 
-       return e_cal_model_copy_cell_date_value (comp_data->dtstart);
+       return e_cell_date_edit_value_copy (comp_data->dtstart);
 }
 
 static ECellDateEditValue *
 get_datetime_from_utc (ECalModel *model,
                        ECalModelComponent *comp_data,
-                       icalproperty_kind propkind,
-                       struct icaltimetype (*get_value) (const icalproperty *prop),
+                       ICalPropertyKind propkind,
+                       ICalTime * (*get_value) (ICalProperty *prop),
                       ECellDateEditValue **buffer)
 {
        g_return_val_if_fail (buffer != NULL, NULL);
 
        if (!*buffer) {
                ECalModelPrivate *priv;
-               struct icaltimetype tt_value;
-               icalproperty *prop;
-               ECellDateEditValue *res;
+               ICalTime *tt_value;
+               ICalProperty *prop;
 
                priv = model->priv;
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, propkind);
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, propkind);
                if (!prop)
                        return NULL;
 
@@ -415,37 +407,43 @@ get_datetime_from_utc (ECalModel *model,
 
                /* these are always in UTC, thus convert to default zone, if any and done */
                if (priv->zone)
-                       icaltimezone_convert_time (&tt_value, icaltimezone_get_utc_timezone (), priv->zone);
+                       i_cal_timezone_convert_time (tt_value, i_cal_timezone_get_utc_timezone (), 
priv->zone);
 
-               if (!icaltime_is_valid_time (tt_value) || icaltime_is_null_time (tt_value))
-                       return NULL;
+               g_object_unref (prop);
 
-               res = g_new0 (ECellDateEditValue, 1);
-               res->tt = tt_value;
-               res->zone = NULL;
+               if (!i_cal_time_is_valid_time (tt_value) || i_cal_time_is_null_time (tt_value)) {
+                       g_clear_object (&tt_value);
+                       return NULL;
+               }
 
-               *buffer = res;
+               *buffer = e_cell_date_edit_value_new_take (tt_value, NULL);
        }
 
-       return e_cal_model_copy_cell_date_value (*buffer);
+       return e_cell_date_edit_value_copy (*buffer);
 }
 
 static gpointer
 get_summary (ECalModelComponent *comp_data)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
+       gchar *res = NULL;
+
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_SUMMARY_PROPERTY);
+       if (prop)
+               res = g_strdup (i_cal_property_get_summary (prop));
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_SUMMARY_PROPERTY);
-       if (prop && icalproperty_get_summary (prop))
-               return g_strdup (icalproperty_get_summary (prop));
+       g_clear_object (&prop);
 
-       return g_strdup ("");
+       if (!res)
+               res = g_strdup ("");
+
+       return res;
 }
 
 static gchar *
 get_uid (ECalModelComponent *comp_data)
 {
-       return (gchar *) icalcomponent_get_uid (comp_data->icalcomp);
+       return (gchar *) i_cal_component_get_uid (comp_data->icalcomp);
 }
 
 static gchar *
@@ -462,17 +460,10 @@ static void
 set_categories (ECalModelComponent *comp_data,
                 const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        /* remove all categories first */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY);
-       while (prop) {
-               icalproperty *to_remove = prop;
-               prop = icalcomponent_get_next_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY);
-
-               icalcomponent_remove_property (comp_data->icalcomp, to_remove);
-               icalproperty_free (to_remove);
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_CATEGORIES_PROPERTY, TRUE);
 
        if (comp_data->priv->categories_str)
                g_string_free (comp_data->priv->categories_str, TRUE);
@@ -482,8 +473,8 @@ set_categories (ECalModelComponent *comp_data,
         * it'll be populated on demand (in the get_categories() function)
        */
        if (value && *value) {
-               prop = icalproperty_new_categories (value);
-               icalcomponent_add_property (comp_data->icalcomp, prop);
+               prop = i_cal_property_new_categories (value);
+               i_cal_component_take_property (comp_data->icalcomp, prop);
        }
 }
 
@@ -491,31 +482,33 @@ static void
 set_classification (ECalModelComponent *comp_data,
                     const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CLASS_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_CLASS_PROPERTY);
        if (!value || !(*value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_clear_object (&prop);
                }
        } else {
-               icalproperty_class ical_class;
+               ICalProperty_Class ical_class;
 
                if (!g_ascii_strcasecmp (value, "PUBLIC"))
-                       ical_class = ICAL_CLASS_PUBLIC;
+                       ical_class = I_CAL_CLASS_PUBLIC;
                else if (!g_ascii_strcasecmp (value, "PRIVATE"))
-                       ical_class = ICAL_CLASS_PRIVATE;
+                       ical_class = I_CAL_CLASS_PRIVATE;
                else if (!g_ascii_strcasecmp (value, "CONFIDENTIAL"))
-                       ical_class = ICAL_CLASS_CONFIDENTIAL;
+                       ical_class = I_CAL_CLASS_CONFIDENTIAL;
                else
-                       ical_class = ICAL_CLASS_NONE;
+                       ical_class = I_CAL_CLASS_NONE;
 
                if (!prop) {
-                       prop = icalproperty_new_class (ical_class);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
-               } else
-                       icalproperty_set_class (prop, ical_class);
+                       prop = i_cal_property_new_class (ical_class);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
+               } else {
+                       i_cal_property_set_class (prop, ical_class);
+                       g_clear_object (&prop);
+               }
        }
 }
 
@@ -523,27 +516,17 @@ static void
 set_description (ECalModelComponent *comp_data,
                  const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        /* remove old description(s) */
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
-       while (prop) {
-               icalproperty *next;
-
-               next = icalcomponent_get_next_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
-
-               icalcomponent_remove_property (comp_data->icalcomp, prop);
-               icalproperty_free (prop);
-
-               prop = next;
-       }
+       e_cal_util_component_remove_property_by_kind (comp_data->icalcomp, I_CAL_DESCRIPTION_PROPERTY, TRUE);
 
        /* now add the new description */
        if (!value || !(*value))
                return;
 
-       prop = icalproperty_new_description (value);
-       icalcomponent_add_property (comp_data->icalcomp, prop);
+       prop = i_cal_property_new_description (value);
+       i_cal_component_take_property (comp_data->icalcomp, prop);
 }
 
 static void
@@ -553,61 +536,62 @@ set_dtstart (ECalModel *model,
 {
        e_cal_model_update_comp_time (
                model, comp_data, value,
-               ICAL_DTSTART_PROPERTY,
-               icalproperty_set_dtstart,
-               icalproperty_new_dtstart);
+               I_CAL_DTSTART_PROPERTY,
+               i_cal_property_set_dtstart,
+               i_cal_property_new_dtstart);
 }
 
 static void
 set_summary (ECalModelComponent *comp_data,
              const gchar *value)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
-       prop = icalcomponent_get_first_property (
-               comp_data->icalcomp, ICAL_SUMMARY_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_SUMMARY_PROPERTY);
 
        if (string_is_empty (value)) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_clear_object (&prop);
                }
        } else {
-               if (prop)
-                       icalproperty_set_summary (prop, value);
-               else {
-                       prop = icalproperty_new_summary (value);
-                       icalcomponent_add_property (comp_data->icalcomp, prop);
+               if (prop) {
+                       i_cal_property_set_summary (prop, value);
+                       g_clear_object (&prop);
+               } else {
+                       prop = i_cal_property_new_summary (value);
+                       i_cal_component_take_property (comp_data->icalcomp, prop);
                }
        }
 }
 
 static void
 datetime_to_zone (ECalClient *client,
-                  struct icaltimetype *tt,
-                  icaltimezone *tt_zone,
+                 ICalTime *tt,
+                 ICalTimezone *tt_zone,
                   const gchar *tzid)
 {
-       icaltimezone *from, *to;
+       ICalTimezone *from, *to;
        const gchar *tt_tzid = NULL;
 
        g_return_if_fail (tt != NULL);
 
        if (tt_zone)
-               tt_tzid = icaltimezone_get_tzid (tt_zone);
+               tt_tzid = i_cal_timezone_get_tzid (tt_zone);
 
        if (tt_tzid == NULL || tzid == NULL ||
            tt_tzid == tzid || g_str_equal (tt_tzid, tzid))
                return;
 
        from = tt_zone;
-       to = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+       to = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
        if (!to) {
-               /* do not check failure here, maybe the zone is not available there */
-               e_cal_client_get_timezone_sync (client, tzid, &to, NULL, NULL);
+               /* do not abort on failure here, maybe the zone is not available there */
+               if (!e_cal_client_get_timezone_sync (client, tzid, &to, NULL, NULL))
+                       to = NULL;
        }
 
-       icaltimezone_convert_time (tt, from, to);
+       i_cal_timezone_convert_time (tt, from, to);
 }
 
 static void
@@ -1190,9 +1174,9 @@ cal_model_dispose (GObject *object)
        g_clear_object (&priv->registry);
        g_clear_object (&priv->shell);
        g_clear_object (&priv->client_cache);
+       g_clear_object (&priv->zone);
 
-       g_free (priv->default_source_uid);
-       priv->default_source_uid = NULL;
+       g_clear_pointer (&priv->default_source_uid, g_free);
 
        /* Chain up to parent's dispose() method. */
        G_OBJECT_CLASS (e_cal_model_parent_class)->dispose (object);
@@ -1234,9 +1218,7 @@ cal_model_get_color_for_component (ECalModel *model,
        const gchar *extension_name;
        const gchar *uid;
        gint i, first_empty = 0;
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
-       icalproperty *prop;
-       #endif
+       ICalProperty *prop;
 
        static AssignedColorData assigned_colors[] = {
                { "#BECEDD", NULL }, /* 190 206 221     Blue */
@@ -1253,20 +1235,22 @@ cal_model_get_color_for_component (ECalModel *model,
 
        g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
 
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COLOR_PROPERTY);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_COLOR_PROPERTY);
        if (prop) {
                GdkRGBA rgba;
 
-               color_spec = icalproperty_get_color (prop);
+               color_spec = i_cal_property_get_color (prop);
                if (color_spec && gdk_rgba_parse (&rgba, color_spec)) {
                        g_free (comp_data->color);
                        comp_data->color = g_strdup (color_spec);
 
+                       g_object_unref (prop);
+
                        return comp_data->color;
                }
+
+               g_object_unref (prop);
        }
-       #endif
 
        switch (e_cal_client_get_source_type (comp_data->client)) {
                case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
@@ -1398,7 +1382,7 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
        ESource *source;
        EClient *client;
        ECalModelComponent *comp_data;
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *source_uid;
        gchar *display_name;
        GError *local_error = NULL;
@@ -1456,15 +1440,17 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
 
                        if (tt > 0) {
                                /* Store Memo DTSTART as date, not as date-time */
-                               struct icaltimetype itt = icaltime_from_timet_with_zone (tt,
-                                       icalcomponent_isa (comp_data->icalcomp) == ICAL_VJOURNAL_COMPONENT, 
e_cal_model_get_timezone (ccd->model));
-                               icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, 
ICAL_DTSTART_PROPERTY);
+                               ICalTime *itt = i_cal_time_from_timet_with_zone (tt,
+                                       i_cal_component_isa (comp_data->icalcomp) == 
I_CAL_VJOURNAL_COMPONENT, e_cal_model_get_timezone (ccd->model));
+
+                               prop = i_cal_component_get_first_property (comp_data->icalcomp, 
I_CAL_DTSTART_PROPERTY);
 
                                if (prop) {
-                                       icalproperty_set_dtstart (prop, itt);
+                                       i_cal_property_set_dtstart (prop, itt);
+                                       g_object_unref (prop);
                                } else {
-                                       prop = icalproperty_new_dtstart (itt);
-                                       icalcomponent_add_property (comp_data->icalcomp, prop);
+                                       prop = i_cal_property_new_dtstart (itt);
+                                       i_cal_component_take_property (comp_data->icalcomp, prop);
                                }
                        }
                }
@@ -1475,24 +1461,28 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
                        model_class->fill_component_from_values (ccd->model, comp_data, ccd->values);
                }
 
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CLASS_PROPERTY);
-               if (!prop || icalproperty_get_class (prop) == ICAL_CLASS_NONE) {
-                       icalproperty_class ical_class = ICAL_CLASS_PUBLIC;
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_CLASS_PROPERTY);
+               if (!prop || i_cal_property_get_class (prop) == I_CAL_CLASS_NONE) {
+                       ICalProperty_Class ical_class = I_CAL_CLASS_PUBLIC;
                        GSettings *settings;
 
                        settings = e_util_ref_settings ("org.gnome.evolution.calendar");
                        if (g_settings_get_boolean (settings, "classify-private"))
-                               ical_class = ICAL_CLASS_PRIVATE;
+                               ical_class = I_CAL_CLASS_PRIVATE;
                        g_object_unref (settings);
 
                        if (!prop) {
-                               prop = icalproperty_new_class (ical_class);
-                               icalcomponent_add_property (comp_data->icalcomp, prop);
-                       } else
-                               icalproperty_set_class (prop, ical_class);
+                               prop = i_cal_property_new_class (ical_class);
+                               i_cal_component_take_property (comp_data->icalcomp, prop);
+                       } else {
+                               i_cal_property_set_class (prop, ical_class);
+                               g_object_unref (prop);
+                       }
+               } else {
+                       g_clear_object (&prop);
                }
 
-               ccd->success = e_cal_client_create_object_sync (comp_data->client, comp_data->icalcomp, &uid, 
cancellable, error);
+               ccd->success = e_cal_client_create_object_sync (comp_data->client, comp_data->icalcomp, 
E_CAL_OPERATION_FLAG_NONE, &uid, cancellable, error);
 
                g_free (uid);
        }
@@ -1602,25 +1592,20 @@ cal_model_value_at (ETableModel *etm,
        case E_CAL_MODEL_FIELD_CREATED :
                return (gpointer) get_datetime_from_utc (
                        model, comp_data, ICAL_CREATED_PROPERTY,
-                       icalproperty_get_created, &comp_data->created);
+                       i_cal_property_get_created, &comp_data->created);
        case E_CAL_MODEL_FIELD_LASTMODIFIED :
                return (gpointer) get_datetime_from_utc (
-                       model, comp_data, ICAL_LASTMODIFIED_PROPERTY,
-                       icalproperty_get_lastmodified, &comp_data->lastmodified);
+                       model, comp_data, I_CAL_LASTMODIFIED_PROPERTY,
+                       i_cal_property_get_lastmodified, &comp_data->lastmodified);
        case E_CAL_MODEL_FIELD_HAS_ALARMS :
-               return GINT_TO_POINTER (
-                       icalcomponent_get_first_component (
-                               comp_data->icalcomp,
-                               ICAL_VALARM_COMPONENT) != NULL);
+               return GINT_TO_POINTER (e_cal_util_component_has_property (comp_data->icalcomp, 
I_CAL_VALARM_COMPONENT));
        case E_CAL_MODEL_FIELD_ICON :
        {
                ECalComponent *comp;
-               icalcomponent *icalcomp;
                gint retval = 0;
 
-               comp = e_cal_component_new ();
-               icalcomp = icalcomponent_new_clone (comp_data->icalcomp);
-               if (e_cal_component_set_icalcomponent (comp, icalcomp)) {
+               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(comp_data->icalcomp));
+               if (comp) {
                        if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) {
                                g_object_unref (comp);
                                return GINT_TO_POINTER (retval);
@@ -1633,14 +1618,14 @@ cal_model_value_at (ETableModel *etm,
                        else {
                                GSList *attendees = NULL, *sl;
 
-                               e_cal_component_get_attendee_list (comp, &attendees);
+                               attendees = e_cal_component_get_attendees (comp);
                                for (sl = attendees; sl != NULL; sl = sl->next) {
                                        ECalComponentAttendee *ca = sl->data;
                                        const gchar *text;
 
-                                       text = itip_strip_mailto (ca->value);
+                                       text = itip_strip_mailto (e_cal_component_attendee_get_value (ca));
                                        if (itip_address_is_user (registry, text)) {
-                                               if (ca->delto != NULL)
+                                               if (e_cal_component_attendee_get_delegatedto (ca) != NULL)
                                                        retval = 3;
                                                else
                                                        retval = 2;
@@ -1648,12 +1633,11 @@ cal_model_value_at (ETableModel *etm,
                                        }
                                }
 
-                               e_cal_component_free_attendee_list (attendees);
+                               g_slist_free_full (attendees, e_cal_component_attendee_free);
                        }
-               } else
-                       icalcomponent_free (icalcomp);
 
-               g_object_unref (comp);
+                       g_object_unref (comp);
+               }
 
                return GINT_TO_POINTER (retval);
        }
@@ -1664,7 +1648,7 @@ cal_model_value_at (ETableModel *etm,
        case E_CAL_MODEL_FIELD_SOURCE:
                return get_source_description (registry, comp_data);
        case E_CAL_MODEL_FIELD_CANCELLED:
-               return GINT_TO_POINTER (icalcomponent_get_status (comp_data->icalcomp) == 
ICAL_STATUS_CANCELLED ? 1 : 0);
+               return GINT_TO_POINTER (i_cal_component_get_status (comp_data->icalcomp) == 
I_CAL_STATUS_CANCELLED ? 1 : 0);
        }
 
        return (gpointer) "";
@@ -1765,11 +1749,11 @@ cal_model_duplicate_value (ETableModel *etm,
        case E_CAL_MODEL_FIELD_CANCELLED:
                return (gpointer) value;
        case E_CAL_MODEL_FIELD_COMPONENT :
-               return icalcomponent_new_clone ((icalcomponent *) value);
+               return i_cal_component_new_clone ((ICalComponent *) value);
        case E_CAL_MODEL_FIELD_DTSTART :
        case E_CAL_MODEL_FIELD_CREATED :
        case E_CAL_MODEL_FIELD_LASTMODIFIED :
-               return e_cal_model_copy_cell_date_value (value);
+               return e_cell_date_edit_value_copy (value);
        }
 
        return NULL;
@@ -1804,7 +1788,7 @@ cal_model_free_value (ETableModel *etm,
                break;
        case E_CAL_MODEL_FIELD_COMPONENT :
                if (value)
-                       icalcomponent_free ((icalcomponent *) value);
+                       g_object_unref ((ICalComponent *) value);
                break;
        }
 }
@@ -1936,19 +1920,16 @@ e_cal_model_get_component_index (ECalModel *model,
 
                if (comp_data) {
                        const gchar *uid;
-                       gchar *rid = NULL;
-                       struct icaltimetype icalrid;
-                       gboolean has_rid = (id->rid && *id->rid);
+                       gchar *rid;
+                       gboolean has_rid = e_cal_component_id_get_rid (id) != NULL;
 
-                       uid = icalcomponent_get_uid (comp_data->icalcomp);
-                       icalrid = icalcomponent_get_recurrenceid (comp_data->icalcomp);
-                       if (!icaltime_is_null_time (icalrid))
-                               rid = icaltime_as_ical_string_r (icalrid);
+                       uid = i_cal_component_get_uid (comp_data->icalcomp);
+                       rid = e_cal_util_component_get_recurid_as_string (comp_data->icalcomp);
 
                        if (uid && *uid) {
-                               if ((!client || comp_data->client == client) && strcmp (id->uid, uid) == 0) {
+                               if ((!client || comp_data->client == client) && strcmp (uid, 
e_cal_component_id_get_uid (id)) == 0) {
                                        if (has_rid) {
-                                               if (!(rid && *rid && strcmp (rid, id->rid) == 0)) {
+                                               if (!(rid && *rid && strcmp (rid, e_cal_component_id_get_rid 
(id)) == 0)) {
                                                        g_free (rid);
                                                        continue;
                                                }
@@ -1975,7 +1956,7 @@ cal_model_data_subscriber_component_added_or_modified (ECalDataModelSubscriber *
        ECalModelComponent *comp_data;
        ETableModel *table_model;
        ECalComponentId *id;
-       icalcomponent *icalcomp;
+       ICalComponent *icomp;
        gint index;
 
        model = E_CAL_MODEL (subscriber);
@@ -1984,13 +1965,13 @@ cal_model_data_subscriber_component_added_or_modified (ECalDataModelSubscriber *
 
        index = e_cal_model_get_component_index (model, client, id);
 
-       e_cal_component_free_id (id);
+       e_cal_component_id_free (id);
 
        if (index < 0 && !is_added)
                return;
 
        table_model = E_TABLE_MODEL (model);
-       icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
+       icomp = i_cal_component_new_clone (e_cal_component_get_icalcomponent (comp));
 
        if (index < 0) {
                e_table_model_pre_change (table_model);
@@ -1998,7 +1979,7 @@ cal_model_data_subscriber_component_added_or_modified (ECalDataModelSubscriber *
                comp_data = g_object_new (E_TYPE_CAL_MODEL_COMPONENT, NULL);
                comp_data->is_new_component = FALSE;
                comp_data->client = g_object_ref (client);
-               comp_data->icalcomp = icalcomp;
+               comp_data->icalcomp = icomp;
                e_cal_model_set_instance_times (comp_data, model->priv->zone);
                g_ptr_array_add (model->priv->objects, comp_data);
 
@@ -2007,7 +1988,7 @@ cal_model_data_subscriber_component_added_or_modified (ECalDataModelSubscriber *
                e_table_model_pre_change (table_model);
 
                comp_data = g_ptr_array_index (model->priv->objects, index);
-               e_cal_model_component_set_icalcomponent (comp_data, model, icalcomp);
+               e_cal_model_component_set_icalcomponent (comp_data, model, icomp);
 
                e_table_model_row_changed (table_model, index);
        }
@@ -2038,16 +2019,17 @@ e_cal_model_data_subscriber_component_removed (ECalDataModelSubscriber *subscrib
        ECalModel *model;
        ECalModelComponent *comp_data;
        ETableModel *table_model;
-       ECalComponentId id;
+       ECalComponentId *id;
        GSList *link;
        gint index;
 
        model = E_CAL_MODEL (subscriber);
 
-       id.uid = (gchar *) uid;
-       id.rid = (gchar *) rid;
+       id = e_cal_component_id_new (uid, rid);
+
+       index = e_cal_model_get_component_index (model, client, id);
 
-       index = e_cal_model_get_component_index (model, client, &id);
+       e_cal_component_id_free (id);
 
        if (index < 0)
                return;
@@ -2577,10 +2559,10 @@ e_cal_model_class_init (ECalModelClass *class)
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET (ECalModelClass, timezone_changed),
                NULL, NULL,
-               e_marshal_VOID__POINTER_POINTER,
+               e_marshal_VOID__OBJECT_OBJECT,
                G_TYPE_NONE, 2,
-               G_TYPE_POINTER,
-               G_TYPE_POINTER);
+               I_CAL_TYPE_TIMEZONE,
+               I_CAL_TYPE_TIMEZONE);
 
        signals[OBJECT_CREATED] = g_signal_new (
                "object-created",
@@ -2640,25 +2622,25 @@ void
 e_cal_model_update_comp_time (ECalModel *model,
                               ECalModelComponent *comp_data,
                               gconstpointer time_value,
-                              icalproperty_kind kind,
-                              void (*set_func) (icalproperty *prop,
-                                                struct icaltimetype v),
-                              icalproperty * (*new_func) (struct icaltimetype v))
+                              ICalPropertyKind kind,
+                              void (*set_func) (ICalProperty *prop,
+                                                ICalTime *v),
+                              ICalProperty * (*new_func) (ICalTime *v))
 {
        ECellDateEditValue *dv = (ECellDateEditValue *) time_value;
-       icalproperty *prop;
-       icalparameter *param;
-       icaltimezone *model_zone;
-       struct icaltimetype tt;
+       ICalProperty *prop;
+       ICalParameter *param;
+       ICalTimezone *model_zone;
+       ICalTime *tt;
 
        g_return_if_fail (model != NULL);
        g_return_if_fail (comp_data != NULL);
        g_return_if_fail (set_func != NULL);
        g_return_if_fail (new_func != NULL);
 
-       prop = icalcomponent_get_first_property (comp_data->icalcomp, kind);
+       prop = i_cal_component_get_first_property (comp_data->icalcomp, kind);
        if (prop)
-               param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
+               param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
        else
                param = NULL;
 
@@ -2666,39 +2648,43 @@ e_cal_model_update_comp_time (ECalModel *model,
         * we remove it if it exists. */
        if (!dv) {
                if (prop) {
-                       icalcomponent_remove_property (comp_data->icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (comp_data->icalcomp, prop);
+                       g_object_unref (prop);
                }
 
                return;
        }
 
        model_zone = e_cal_model_get_timezone (model);
-       tt = dv->tt;
-       datetime_to_zone (comp_data->client, &tt, model_zone, param ? icalparameter_get_tzid (param) : NULL);
+       tt = e_cell_date_edit_value_get_time (dv);
+       datetime_to_zone (comp_data->client, tt, model_zone, param ? i_cal_parameter_get_tzid (param) : NULL);
 
        if (prop) {
                set_func (prop, tt);
        } else {
                prop = new_func (tt);
-               icalcomponent_add_property (comp_data->icalcomp, prop);
+               i_cal_component_take_property (comp_data->icalcomp, prop);
+
+               prop = i_cal_component_get_first_property (comp_data->icalcomp, kind);
        }
 
        if (param) {
-               const gchar *tzid = icalparameter_get_tzid (param);
+               const gchar *tzid = i_cal_parameter_get_tzid (param);
 
                /* If the TZID is set to "UTC", we don't want to save the TZID. */
                if (!tzid || !*tzid || !strcmp (tzid, "UTC")) {
-                       icalproperty_remove_parameter_by_kind (prop, ICAL_TZID_PARAMETER);
+                       i_cal_property_remove_parameter_by_kind (prop, I_CAL_TZID_PARAMETER);
                }
        } else if (model_zone) {
-               const gchar *tzid = icaltimezone_get_tzid (model_zone);
+               const gchar *tzid = i_cal_timezone_get_tzid (model_zone);
 
                if (tzid && *tzid) {
-                       param = icalparameter_new_tzid (tzid);
-                       icalproperty_add_parameter (prop, param);
+                       param = i_cal_parameter_new_tzid (tzid);
+                       i_cal_property_take_parameter (prop, param);
                }
        }
+
+       g_clear_object (&prop);
 }
 
 /**
@@ -2826,24 +2812,24 @@ e_cal_model_set_confirm_delete (ECalModel *model,
        g_object_notify (G_OBJECT (model), "confirm-delete");
 }
 
-icalcomponent_kind
+ICalComponentKind
 e_cal_model_get_component_kind (ECalModel *model)
 {
-       g_return_val_if_fail (E_IS_CAL_MODEL (model), ICAL_NO_COMPONENT);
+       g_return_val_if_fail (E_IS_CAL_MODEL (model), I_CAL_NO_COMPONENT);
 
        return model->priv->kind;
 }
 
 void
 e_cal_model_set_component_kind (ECalModel *model,
-                                icalcomponent_kind kind)
+                               ICalComponentKind kind)
 {
        g_return_if_fail (E_IS_CAL_MODEL (model));
 
        model->priv->kind = kind;
 }
 
-icaltimezone *
+ICalTimezone *
 e_cal_model_get_timezone (ECalModel *model)
 {
        g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
@@ -2853,9 +2839,10 @@ e_cal_model_get_timezone (ECalModel *model)
 
 void
 e_cal_model_set_timezone (ECalModel *model,
-                          icaltimezone *zone)
+                         const ICalTimezone *zone)
 {
-       icaltimezone *old_zone;
+       ICalTimezone *old_zone;
+
        g_return_if_fail (E_IS_CAL_MODEL (model));
 
        if (model->priv->zone == zone)
@@ -2863,7 +2850,7 @@ e_cal_model_set_timezone (ECalModel *model,
 
        e_table_model_pre_change (E_TABLE_MODEL (model));
        old_zone = model->priv->zone;
-       model->priv->zone = zone;
+       model->priv->zone = zone ? e_cal_util_copy_timezone (zone) : NULL;
 
        /* the timezone affects the times shown for date fields,
         * so we need to redisplay everything */
@@ -2872,7 +2859,9 @@ e_cal_model_set_timezone (ECalModel *model,
        g_object_notify (G_OBJECT (model), "timezone");
        g_signal_emit (
                model, signals[TIMEZONE_CHANGED], 0,
-               old_zone, zone);
+               old_zone, model->priv->zone);
+
+       g_clear_object (&old_zone);
 }
 
 gboolean
@@ -3635,19 +3624,17 @@ search_by_id_and_client (ECalModelPrivate *priv,
 
                if (comp_data) {
                        const gchar *uid;
-                       gchar *rid = NULL;
-                       struct icaltimetype icalrid;
-                       gboolean has_rid = (id->rid && *id->rid);
+                       gchar *rid;
+                       gboolean has_rid = e_cal_component_id_get_rid (id) != NULL;
 
-                       uid = icalcomponent_get_uid (comp_data->icalcomp);
-                       icalrid = icalcomponent_get_recurrenceid (comp_data->icalcomp);
-                       if (!icaltime_is_null_time (icalrid))
-                               rid = icaltime_as_ical_string_r (icalrid);
+                       uid = i_cal_component_get_uid (comp_data->icalcomp);
+                       rid = e_cal_util_component_get_recurid_as_string (comp_data->icalcomp);
 
                        if (uid && *uid) {
-                               if ((!client || comp_data->client == client) && !strcmp (id->uid, uid)) {
+                               if ((!client || comp_data->client == client) &&
+                                   !g_strcmp0 (e_cal_component_id_get_uid (id), uid)) {
                                        if (has_rid) {
-                                               if (!(rid && *rid && !strcmp (rid, id->rid))) {
+                                               if (!(rid && *rid && !g_strcmp0 (e_cal_component_id_get_rid 
(id), rid))) {
                                                        g_free (rid);
                                                        continue;
                                                }
@@ -3747,7 +3734,7 @@ e_cal_model_set_time_range (ECalModel *model,
 /**
  * e_cal_model_create_component_with_defaults_sync
  */
-icalcomponent *
+ICalComponent *
 e_cal_model_create_component_with_defaults_sync (ECalModel *model,
                                                 ECalClient *client,
                                                 gboolean all_day,
@@ -3755,13 +3742,13 @@ e_cal_model_create_component_with_defaults_sync (ECalModel *model,
                                                 GError **error)
 {
        ECalComponent *comp = NULL;
-       icalcomponent *icalcomp;
+       ICalComponent *icomp;
 
        g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
 
        if (client) {
                switch (model->priv->kind) {
-               case ICAL_VEVENT_COMPONENT :
+               case I_CAL_VEVENT_COMPONENT :
                        comp = cal_comp_event_new_with_defaults_sync (
                                client, all_day,
                                e_cal_model_get_use_default_reminder (model),
@@ -3769,10 +3756,10 @@ e_cal_model_create_component_with_defaults_sync (ECalModel *model,
                                e_cal_model_get_default_reminder_units (model),
                                cancellable, error);
                        break;
-               case ICAL_VTODO_COMPONENT :
+               case I_CAL_VTODO_COMPONENT :
                        comp = cal_comp_task_new_with_defaults_sync (client, cancellable, error);
                        break;
-               case ICAL_VJOURNAL_COMPONENT :
+               case I_CAL_VJOURNAL_COMPONENT :
                        comp = cal_comp_memo_new_with_defaults_sync (client, cancellable, error);
                        break;
                default:
@@ -3782,23 +3769,23 @@ e_cal_model_create_component_with_defaults_sync (ECalModel *model,
        }
 
        if (comp) {
-               icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
+               icomp = i_cal_component_new_clone (e_cal_component_get_icalcomponent (comp));
                g_object_unref (comp);
        } else {
-               icalcomp = icalcomponent_new (model->priv->kind);
+               icomp = i_cal_component_new (model->priv->kind);
        }
 
        /* make sure the component has a UID */
-       if (!icalcomponent_get_uid (icalcomp)) {
+       if (!i_cal_component_get_uid (icomp)) {
                gchar *uid;
 
                uid = e_util_generate_uid ();
-               icalcomponent_set_uid (icalcomp, uid);
+               i_cal_component_set_uid (icomp, uid);
 
                g_free (uid);
        }
 
-       return icalcomp;
+       return icomp;
 }
 
 /**
@@ -3815,17 +3802,17 @@ e_cal_model_get_attendees_status_info (ECalModel *model,
                                        ECalClient *cal_client)
 {
        struct _values {
-               icalparameter_partstat status;
+               ICalParameterPartstat status;
                const gchar *caption;
                gint count;
        } values[] = {
-               { ICAL_PARTSTAT_ACCEPTED,    N_("Accepted"),     0 },
-               { ICAL_PARTSTAT_DECLINED,    N_("Declined"),     0 },
-               { ICAL_PARTSTAT_TENTATIVE,   N_("Tentative"),    0 },
-               { ICAL_PARTSTAT_DELEGATED,   N_("Delegated"),    0 },
-               { ICAL_PARTSTAT_NEEDSACTION, N_("Needs action"), 0 },
-               { ICAL_PARTSTAT_NONE,        N_("Other"),        0 },
-               { ICAL_PARTSTAT_X,           NULL,              -1 }
+               { I_CAL_PARTSTAT_ACCEPTED,    N_("Accepted"),     0 },
+               { I_CAL_PARTSTAT_DECLINED,    N_("Declined"),     0 },
+               { I_CAL_PARTSTAT_TENTATIVE,   N_("Tentative"),    0 },
+               { I_CAL_PARTSTAT_DELEGATED,   N_("Delegated"),    0 },
+               { I_CAL_PARTSTAT_NEEDSACTION, N_("Needs action"), 0 },
+               { I_CAL_PARTSTAT_NONE,        N_("Other"),        0 },
+               { I_CAL_PARTSTAT_X,           NULL,              -1 }
        };
 
        ESourceRegistry *registry;
@@ -3842,19 +3829,19 @@ e_cal_model_get_attendees_status_info (ECalModel *model,
            !itip_organizer_is_user_ex (registry, comp, cal_client, TRUE))
                return NULL;
 
-       e_cal_component_get_attendee_list (comp, &attendees);
+       attendees = e_cal_component_get_attendees (comp);
 
        for (a = attendees; a; a = a->next) {
                ECalComponentAttendee *att = a->data;
 
-               if (att && att->cutype == ICAL_CUTYPE_INDIVIDUAL &&
-                   (att->role == ICAL_ROLE_CHAIR ||
-                    att->role == ICAL_ROLE_REQPARTICIPANT ||
-                    att->role == ICAL_ROLE_OPTPARTICIPANT)) {
+               if (att && e_cal_component_attendee_get_cutype (att) == I_CAL_CUTYPE_INDIVIDUAL &&
+                   (e_cal_component_attendee_get_role (att) == I_CAL_ROLE_CHAIR ||
+                    e_cal_component_attendee_get_role (att) == I_CAL_ROLE_REQPARTICIPANT ||
+                    e_cal_component_attendee_get_role (att) == I_CAL_ROLE_OPTPARTICIPANT)) {
                        have = TRUE;
 
                        for (i = 0; values[i].count != -1; i++) {
-                               if (att->status == values[i].status || values[i].status == 
ICAL_PARTSTAT_NONE) {
+                               if (e_cal_component_attendee_get_partstat (att) == values[i].status || 
values[i].status == I_CAL_PARTSTAT_NONE) {
                                        values[i].count++;
                                        break;
                                }
@@ -3883,8 +3870,7 @@ e_cal_model_get_attendees_status_info (ECalModel *model,
                res = g_string_free (str, FALSE);
        }
 
-       if (attendees)
-               e_cal_component_free_attendee_list (attendees);
+       g_slist_free_full (attendees, e_cal_component_attendee_free);
 
        return res;
 }
@@ -3994,7 +3980,6 @@ e_cal_model_date_value_to_string (ECalModel *model,
 {
        ECalModelPrivate *priv;
        ECellDateEditValue *dv = (ECellDateEditValue *) value;
-       struct icaltimetype tt;
        struct tm tmp_tm;
        gchar buffer[64];
 
@@ -4006,18 +3991,7 @@ e_cal_model_date_value_to_string (ECalModel *model,
                return g_strdup ("");
 
        /* We currently convert all the dates to the current timezone. */
-       tt = dv->tt;
-       icaltimezone_convert_time (&tt, dv->zone, priv->zone);
-
-       tmp_tm.tm_year = tt.year - 1900;
-       tmp_tm.tm_mon = tt.month - 1;
-       tmp_tm.tm_mday = tt.day;
-       tmp_tm.tm_hour = tt.hour;
-       tmp_tm.tm_min = tt.minute;
-       tmp_tm.tm_sec = tt.second;
-       tmp_tm.tm_isdst = -1;
-
-       tmp_tm.tm_wday = time_day_of_week (tt.day, tt.month - 1, tt.year);
+       tmp_tm = e_cal_util_icaltime_to_tm_with_zone (e_cell_date_edit_value_get_time (dv), 
e_cell_date_edit_value_get_zone (dv), priv->zone);
 
        memset (buffer, 0, sizeof (buffer));
        e_time_format_date_and_time (&tmp_tm, priv->use_24_hour_format,
@@ -4028,26 +4002,35 @@ e_cal_model_date_value_to_string (ECalModel *model,
 
 typedef struct _GenerateInstacesData {
        ECalModelGenerateInstancesData mdata;
-       ECalRecurInstanceFn cb;
+       ECalRecurInstanceCb cb;
        ECalClient *client;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 } GenerateInstancesData;
 
 static gboolean
-ecm_generate_instances_cb (ECalComponent *comp,
-                          time_t instance_start,
-                          time_t instance_end,
-                          gpointer user_data)
+ecm_generate_instances_cb (ICalComponent *comp,
+                          ICalTime *instance_start,
+                          ICalTime *instance_end,
+                          gpointer user_data,
+                          GCancellable *cancellable,
+                          GError **error)
 {
        GenerateInstancesData *gid = user_data;
+       ICalTime *changed_instance_start = NULL, *changed_instance_end = NULL;
+       gboolean res;
 
        g_return_val_if_fail (gid != NULL, FALSE);
        g_return_val_if_fail (gid->mdata.comp_data != NULL, FALSE);
 
-       cal_comp_get_instance_times (gid->mdata.comp_data->client, e_cal_component_get_icalcomponent (comp),
-               gid->zone, &instance_start, NULL, &instance_end, NULL, NULL);
+       cal_comp_get_instance_times (gid->mdata.comp_data->client, comp,
+               gid->zone, &changed_instance_start, &changed_instance_end, cancellable);
+
+       res = gid->cb (comp, changed_instance_start, changed_instance_end, &gid->mdata, cancellable, error);
 
-       return gid->cb (comp, instance_start, instance_end, &gid->mdata);
+       g_clear_object (&changed_instance_start);
+       g_clear_object (&changed_instance_end);
+
+       return res;
 }
 
 /**
@@ -4059,7 +4042,8 @@ void
 e_cal_model_generate_instances_sync (ECalModel *model,
                                      time_t start,
                                      time_t end,
-                                     ECalRecurInstanceFn cb,
+                                    GCancellable *cancellable,
+                                     ECalRecurInstanceCb cb,
                                      gpointer cb_data)
 {
        GenerateInstancesData gid;
@@ -4079,7 +4063,7 @@ e_cal_model_generate_instances_sync (ECalModel *model,
                        gid.mdata.comp_data = comp_data;
 
                        e_cal_client_generate_instances_for_object_sync (comp_data->client, 
comp_data->icalcomp, start, end,
-                               ecm_generate_instances_cb, &gid);
+                               cancellable, ecm_generate_instances_cb, &gid);
                }
        }
 }
@@ -4099,35 +4083,46 @@ e_cal_model_get_object_array (ECalModel *model)
 
 void
 e_cal_model_set_instance_times (ECalModelComponent *comp_data,
-                                const icaltimezone *zone)
+                               const ICalTimezone *zone)
 {
-       if (icalcomponent_isa (comp_data->icalcomp) == ICAL_VEVENT_COMPONENT) {
-               struct icaltimetype start_time, end_time;
+       ICalTime *instance_start = NULL, *instance_end = NULL;
 
-               start_time = icalcomponent_get_dtstart (comp_data->icalcomp);
-               end_time = icalcomponent_get_dtend (comp_data->icalcomp);
+       if (i_cal_component_isa (comp_data->icalcomp) == I_CAL_VEVENT_COMPONENT) {
+               ICalTime *start_time, *end_time;
 
-               if (start_time.is_date && icaltime_is_null_time (end_time)) {
+               start_time = i_cal_component_get_dtstart (comp_data->icalcomp);
+               end_time = i_cal_component_get_dtend (comp_data->icalcomp);
+
+               if (i_cal_time_is_date (start_time) && i_cal_time_is_null_time (end_time)) {
                        /* If end_time is null and it's an all day event,
                         * just make start_time = end_time so that end_time
                         * will be a valid date
                         */
-                       end_time = start_time;
-                       icaltime_adjust (&end_time, 1, 0, 0, 0);
-                       icalcomponent_set_dtend (comp_data->icalcomp, end_time);
-               } else if (start_time.is_date && end_time.is_date &&
-                          (icaltime_compare_date_only (start_time, end_time) == 0)) {
+                       end_time = i_cal_time_new_clone (start_time);
+                       i_cal_time_adjust (end_time, 1, 0, 0, 0);
+                       i_cal_component_set_dtend (comp_data->icalcomp, end_time);
+               } else if (i_cal_time_is_date (start_time) && i_cal_time_is_date (end_time) &&
+                          (i_cal_time_compare_date_only (start_time, end_time) == 0)) {
                        /* If both DTSTART and DTEND are DATE values, and they are the
                         * same day, we add 1 day to DTEND. This means that most
                         * events created with the old Evolution behavior will still
                         * work OK. */
-                       icaltime_adjust (&end_time, 1, 0, 0, 0);
-                       icalcomponent_set_dtend (comp_data->icalcomp, end_time);
+                       i_cal_time_adjust (end_time, 1, 0, 0, 0);
+                       i_cal_component_set_dtend (comp_data->icalcomp, end_time);
                }
+
+               g_clear_object (&start_time);
+               g_clear_object (&end_time);
        }
 
        cal_comp_get_instance_times (comp_data->client, comp_data->icalcomp, zone,
-               &comp_data->instance_start, NULL, &comp_data->instance_end, NULL, NULL);
+               &instance_start, &instance_end, NULL);
+
+       comp_data->instance_start = instance_start ? i_cal_time_as_timet (instance_start) : 
comp_data->instance_start;
+       comp_data->instance_end = instance_end ? i_cal_time_as_timet (instance_end) : comp_data->instance_end;
+
+       g_clear_object (&instance_start);
+       g_clear_object (&instance_end);
 }
 
 /**
@@ -4191,20 +4186,3 @@ e_cal_model_emit_object_created (ECalModel *model,
 
        g_signal_emit (model, signals[OBJECT_CREATED], 0, where);
 }
-
-
-ECellDateEditValue *
-e_cal_model_copy_cell_date_value (const ECellDateEditValue *value)
-{
-       ECellDateEditValue *copy;
-
-       if (!value)
-               return NULL;
-
-
-       copy = g_new0 (ECellDateEditValue, 1);
-       copy->tt = value->tt;
-       copy->zone = value->zone;
-
-       return copy;
-}
diff --git a/src/calendar/gui/e-cal-model.h b/src/calendar/gui/e-cal-model.h
index ce56036782..77ef0d5884 100644
--- a/src/calendar/gui/e-cal-model.h
+++ b/src/calendar/gui/e-cal-model.h
@@ -105,7 +105,7 @@ struct _ECalModelComponent {
        GObject object;
 
        ECalClient *client;
-       icalcomponent *icalcomp;
+       ICalComponent *icalcomp;
        time_t instance_start;
        time_t instance_end;
        gboolean is_new_component;
@@ -162,8 +162,8 @@ struct _ECalModelClass {
        void            (*comps_deleted)        (ECalModel *model,
                                                 gpointer list);
        void            (*timezone_changed)     (ECalModel *model,
-                                                icaltimezone *old_zone,
-                                                icaltimezone *new_zone);
+                                                ICalTimezone *old_zone,
+                                                ICalTimezone *new_zone);
        void            (*object_created)       (ECalModel *model,
                                                 ECalClient *where);
 };
@@ -177,16 +177,16 @@ ESourceRegistry *
                e_cal_model_get_registry        (ECalModel *model);
 EShell *       e_cal_model_get_shell           (ECalModel *model);
 EClientCache * e_cal_model_get_client_cache    (ECalModel *model);
-icalcomponent_kind
+ICalComponentKind
                e_cal_model_get_component_kind  (ECalModel *model);
 void           e_cal_model_set_component_kind  (ECalModel *model,
-                                                icalcomponent_kind kind);
+                                                ICalComponentKind kind);
 gboolean       e_cal_model_get_confirm_delete  (ECalModel *model);
 void           e_cal_model_set_confirm_delete  (ECalModel *model,
                                                 gboolean confirm_delete);
-icaltimezone * e_cal_model_get_timezone        (ECalModel *model);
+ICalTimezone * e_cal_model_get_timezone        (ECalModel *model);
 void           e_cal_model_set_timezone        (ECalModel *model,
-                                                icaltimezone *zone);
+                                                const ICalTimezone *zone);
 gboolean       e_cal_model_get_compress_weekend
                                                (ECalModel *model);
 void           e_cal_model_set_compress_weekend
@@ -334,7 +334,7 @@ void                e_cal_model_get_time_range      (ECalModel *model,
 void           e_cal_model_set_time_range      (ECalModel *model,
                                                 time_t start,
                                                 time_t end);
-icalcomponent *        e_cal_model_create_component_with_defaults_sync
+ICalComponent *        e_cal_model_create_component_with_defaults_sync
                                                (ECalModel *model,
                                                 ECalClient *client,
                                                 gboolean all_day,
@@ -371,11 +371,12 @@ void              e_cal_model_generate_instances_sync
                                                (ECalModel *model,
                                                 time_t start,
                                                 time_t end,
-                                                ECalRecurInstanceFn cb,
+                                                GCancellable *cancellable,
+                                                ECalRecurInstanceCb cb,
                                                 gpointer cb_data);
 GPtrArray *    e_cal_model_get_object_array    (ECalModel *model);
 void           e_cal_model_set_instance_times  (ECalModelComponent *comp_data,
-                                                const icaltimezone *zone);
+                                                const ICalTimezone *zone);
 gboolean       e_cal_model_test_row_editable   (ECalModel *model,
                                                 gint row);
 void           e_cal_model_set_default_time_func
@@ -386,10 +387,10 @@ void              e_cal_model_set_default_time_func
 void           e_cal_model_update_comp_time    (ECalModel *model,
                                                 ECalModelComponent *comp_data,
                                                 gconstpointer time_value,
-                                                icalproperty_kind kind,
-                                                void (*set_func) (icalproperty *prop,
-                                                                  struct icaltimetype v),
-                                                icalproperty * (*new_func) (struct icaltimetype v));
+                                                ICalPropertyKind kind,
+                                                void (*set_func) (ICalProperty *prop,
+                                                                  ICalTime *v),
+                                                ICalProperty * (*new_func) (ICalTime *v));
 
 void           e_cal_model_emit_object_created (ECalModel *model,
                                                 ECalClient *where);
@@ -405,10 +406,6 @@ void               e_cal_model_util_set_value      (GHashTable *values,
 gpointer       e_cal_model_util_get_value      (GHashTable *values,
                                                 gint column);
 
-ECellDateEditValue *
-               e_cal_model_copy_cell_date_value
-                                               (const ECellDateEditValue *value);
-
 G_END_DECLS
 
 #endif /* E_CAL_MODEL_H */
diff --git a/src/calendar/gui/e-cal-ops.c b/src/calendar/gui/e-cal-ops.c
index b885aa6926..7b8bf79f7f 100644
--- a/src/calendar/gui/e-cal-ops.c
+++ b/src/calendar/gui/e-cal-ops.c
@@ -40,7 +40,7 @@
 static void
 cal_ops_manage_send_component (ECalModel *model,
                               ECalClient *client,
-                              icalcomponent *icalcomp,
+                              ICalComponent *icomp,
                               ECalObjModType mod,
                               ECalOpsSendFlags send_flags)
 {
@@ -49,12 +49,12 @@ cal_ops_manage_send_component (ECalModel *model,
 
        g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (icomp));
 
        if ((send_flags & E_CAL_OPS_SEND_FLAG_DONT_SEND) != 0)
                return;
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        if (!comp)
                return;
 
@@ -81,7 +81,7 @@ cal_ops_manage_send_component (ECalModel *model,
 typedef struct {
        ECalModel *model;
        ECalClient *client;
-       icalcomponent *icalcomp;
+       ICalComponent *icomp;
        ECalObjModType mod;
        gchar *uid;
        gchar *rid;
@@ -104,18 +104,18 @@ basic_operation_data_free (gpointer ptr)
 
        if (bod) {
                if (bod->success) {
-                       if (bod->create_cb && bod->uid && bod->icalcomp) {
-                               bod->create_cb (bod->model, bod->client, bod->icalcomp, bod->uid, 
bod->user_data);
+                       if (bod->create_cb && bod->uid && bod->icomp) {
+                               bod->create_cb (bod->model, bod->client, bod->icomp, bod->uid, 
bod->user_data);
                                if (bod->user_data_free)
                                        bod->user_data_free (bod->user_data);
                        }
 
-                       if (bod->is_modify && bod->icalcomp && (bod->send_flags & 
E_CAL_OPS_SEND_FLAG_DONT_SEND) == 0) {
-                               cal_ops_manage_send_component (bod->model, bod->client, bod->icalcomp, 
bod->mod, bod->send_flags);
+                       if (bod->is_modify && bod->icomp && (bod->send_flags & E_CAL_OPS_SEND_FLAG_DONT_SEND) 
== 0) {
+                               cal_ops_manage_send_component (bod->model, bod->client, bod->icomp, bod->mod, 
bod->send_flags);
                        }
 
-                       if (bod->get_default_comp_cb && bod->icalcomp) {
-                               bod->get_default_comp_cb (bod->model, bod->client, bod->icalcomp, 
bod->user_data);
+                       if (bod->get_default_comp_cb && bod->icomp) {
+                               bod->get_default_comp_cb (bod->model, bod->client, bod->icomp, 
bod->user_data);
                                if (bod->user_data_free)
                                        bod->user_data_free (bod->user_data);
                        }
@@ -123,8 +123,7 @@ basic_operation_data_free (gpointer ptr)
 
                g_clear_object (&bod->model);
                g_clear_object (&bod->client);
-               if (bod->icalcomp)
-                       icalcomponent_free (bod->icalcomp);
+               g_clear_object (&bod->icomp);
                g_free (bod->for_client_uid);
                g_free (bod->uid);
                g_free (bod->rid);
@@ -142,20 +141,20 @@ cal_ops_create_component_thread (EAlertSinkThreadJobData *job_data,
 
        g_return_if_fail (bod != NULL);
 
-       bod->success = e_cal_client_create_object_sync (bod->client, bod->icalcomp, &bod->uid, cancellable, 
error);
+       bod->success = e_cal_client_create_object_sync (bod->client, bod->icomp, E_CAL_OPERATION_FLAG_NONE, 
&bod->uid, cancellable, error);
 }
 
 /**
  * e_cal_ops_create_component:
  * @model: an #ECalModel
  * @client: an #ECalClient
- * @icalcomp: an #icalcomponent
+ * @icomp: an #ICalComponent
  * @callback: (allow none): a callback to be called on success
  * @user_data: user data to be passed to @callback; ignored when @callback is #NULL
  * @user_data_free: a function to free @user_data; ignored when @callback is #NULL
  *
- * Creates a new @icalcomp in the @client. The @callback, if not #NULL,
- * is called with a new uid of the @icalcomp on sucessful component save.
+ * Creates a new @icomp in the @client. The @callback, if not #NULL,
+ * is called with a new uid of the @icomp on sucessful component save.
  * The @callback is called in the main thread.
  *
  * Since: 3.16
@@ -163,14 +162,14 @@ cal_ops_create_component_thread (EAlertSinkThreadJobData *job_data,
 void
 e_cal_ops_create_component (ECalModel *model,
                            ECalClient *client,
-                           icalcomponent *icalcomp,
+                           ICalComponent *icomp,
                            ECalOpsCreateComponentFunc callback,
                            gpointer user_data,
                            GDestroyNotify user_data_free)
 {
        ECalDataModel *data_model;
        ESource *source;
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *description;
        const gchar *alert_ident;
        gchar *display_name;
@@ -179,7 +178,7 @@ e_cal_ops_create_component (ECalModel *model,
 
        g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (icomp));
 
        switch (e_cal_client_get_source_type (client)) {
                case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
@@ -205,27 +204,28 @@ e_cal_ops_create_component (ECalModel *model,
        bod = g_new0 (BasicOperationData, 1);
        bod->model = g_object_ref (model);
        bod->client = g_object_ref (client);
-       bod->icalcomp = icalcomponent_new_clone (icalcomp);
+       bod->icomp = i_cal_component_new_clone (icomp);
        bod->create_cb = callback;
        bod->user_data = user_data;
        bod->user_data_free = user_data_free;
 
-       prop = icalcomponent_get_first_property (bod->icalcomp, ICAL_CLASS_PROPERTY);
-       if (!prop || icalproperty_get_class (prop) == ICAL_CLASS_NONE) {
-               icalproperty_class ical_class = ICAL_CLASS_PUBLIC;
+       prop = i_cal_component_get_first_property (bod->icomp, I_CAL_CLASS_PROPERTY);
+       if (!prop || i_cal_property_get_class (prop) == I_CAL_CLASS_NONE) {
+               ICalProperty_Class ical_class = I_CAL_CLASS_PUBLIC;
                GSettings *settings;
 
                settings = e_util_ref_settings ("org.gnome.evolution.calendar");
                if (g_settings_get_boolean (settings, "classify-private"))
-                       ical_class = ICAL_CLASS_PRIVATE;
+                       ical_class = I_CAL_CLASS_PRIVATE;
                g_object_unref (settings);
 
                if (!prop) {
-                       prop = icalproperty_new_class (ical_class);
-                       icalcomponent_add_property (bod->icalcomp, prop);
+                       prop = i_cal_property_new_class (ical_class);
+                       i_cal_component_add_property (bod->icomp, prop);
                } else
-                       icalproperty_set_class (prop, ical_class);
+                       i_cal_property_set_class (prop, ical_class);
        }
+       g_clear_object (&prop);
 
        display_name = e_util_get_source_full_name (e_cal_model_get_registry (model), source);
        cancellable = e_cal_data_model_submit_thread_job (data_model, description, alert_ident,
@@ -249,33 +249,33 @@ cal_ops_modify_component_thread (EAlertSinkThreadJobData *job_data,
        if (bod->mod == E_CAL_OBJ_MOD_ALL) {
                ECalComponent *comp;
 
-               comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (bod->icalcomp));
+               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (bod->icomp));
                if (comp && e_cal_component_has_recurrences (comp)) {
                        if (!comp_util_sanitize_recurrence_master_sync (comp, bod->client, cancellable, 
error)) {
                                g_object_unref (comp);
                                return;
                        }
 
-                       icalcomponent_free (bod->icalcomp);
-                       bod->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
+                       g_clear_object (&bod->icomp);
+                       bod->icomp = i_cal_component_new_clone (e_cal_component_get_icalcomponent (comp));
                }
 
                g_clear_object (&comp);
        }
 
-       bod->success = e_cal_client_modify_object_sync (bod->client, bod->icalcomp, bod->mod, cancellable, 
error);
+       bod->success = e_cal_client_modify_object_sync (bod->client, bod->icomp, bod->mod, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error);
 }
 
 /**
  * e_cal_ops_modify_component:
  * @model: an #ECalModel
  * @client: an #ECalClient
- * @icalcomp: an #icalcomponent
+ * @icomp: an #ICalComponent
  * @mod: a mode to use for modification of the component
  * @send_flags: what to do when the modify succeeded and the component has attendees
  *
- * Saves changes of the @icalcomp into the @client using the @mod. The @send_flags influences
- * what to do when the @icalcomp has attendees and the organizer is user. Only one of
+ * Saves changes of the @icomp into the @client using the @mod. The @send_flags influences
+ * what to do when the @icomp has attendees and the organizer is user. Only one of
  * #E_CAL_OPS_SEND_FLAG_ASK, #E_CAL_OPS_SEND_FLAG_SEND, #E_CAL_OPS_SEND_FLAG_DONT_SEND
  * can be used, while the ASK flag is the default.
  *
@@ -284,7 +284,7 @@ cal_ops_modify_component_thread (EAlertSinkThreadJobData *job_data,
 void
 e_cal_ops_modify_component (ECalModel *model,
                            ECalClient *client,
-                           icalcomponent *icalcomp,
+                           ICalComponent *icomp,
                            ECalObjModType mod,
                            ECalOpsSendFlags send_flags)
 {
@@ -298,7 +298,7 @@ e_cal_ops_modify_component (ECalModel *model,
 
        g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (icomp));
 
        switch (e_cal_client_get_source_type (client)) {
                case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
@@ -324,7 +324,7 @@ e_cal_ops_modify_component (ECalModel *model,
        bod = g_new0 (BasicOperationData, 1);
        bod->model = g_object_ref (model);
        bod->client = g_object_ref (client);
-       bod->icalcomp = icalcomponent_new_clone (icalcomp);
+       bod->icomp = i_cal_component_new_clone (icomp);
        bod->mod = mod;
        bod->send_flags = send_flags;
        bod->is_modify = TRUE;
@@ -351,10 +351,10 @@ cal_ops_remove_component_thread (EAlertSinkThreadJobData *job_data,
        /* The check_detached_instance means to test whether the event is a detached instance,
           then only that one is deleted, otherwise the master object is deleted */
        if (bod->check_detached_instance && bod->mod == E_CAL_OBJ_MOD_THIS && bod->rid && *bod->rid) {
-               icalcomponent *icalcomp = NULL;
+               ICalComponent *icomp = NULL;
                GError *local_error = NULL;
 
-               if (!e_cal_client_get_object_sync (bod->client, bod->uid, bod->rid, &icalcomp, cancellable, 
&local_error) &&
+               if (!e_cal_client_get_object_sync (bod->client, bod->uid, bod->rid, &icomp, cancellable, 
&local_error) &&
                    g_error_matches (local_error, E_CAL_CLIENT_ERROR, E_CAL_CLIENT_ERROR_OBJECT_NOT_FOUND)) {
                        g_free (bod->rid);
                        bod->rid = NULL;
@@ -362,11 +362,10 @@ cal_ops_remove_component_thread (EAlertSinkThreadJobData *job_data,
                }
 
                g_clear_error (&local_error);
-               if (icalcomp)
-                       icalcomponent_free (icalcomp);
+               g_clear_object (&icomp);
        }
 
-       bod->success = e_cal_client_remove_object_sync (bod->client, bod->uid, bod->rid, bod->mod, 
cancellable, error);
+       bod->success = e_cal_client_remove_object_sync (bod->client, bod->uid, bod->rid, bod->mod, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error);
 }
 
 /**
@@ -455,16 +454,13 @@ cal_ops_delete_components_thread (EAlertSinkThreadJobData *job_data,
 
        for (link = objects; link && !g_cancellable_is_cancelled (cancellable); link = g_slist_next (link)) {
                ECalModelComponent *comp_data = (ECalModelComponent *) link->data;
-               struct icaltimetype tt;
-               gchar *rid = NULL;
+               gchar *rid;
 
-               tt = icalcomponent_get_recurrenceid (comp_data->icalcomp);
-               if (icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt))
-                       rid = icaltime_as_ical_string_r (tt);
+               rid = e_cal_util_component_get_recurid_as_string (comp_data->icalcomp);
 
                if (!e_cal_client_remove_object_sync (
-                       comp_data->client, icalcomponent_get_uid (comp_data->icalcomp),
-                       rid, E_CAL_OBJ_MOD_THIS, cancellable, error)) {
+                       comp_data->client, i_cal_component_get_uid (comp_data->icalcomp),
+                       rid, E_CAL_OBJ_MOD_THIS, E_CAL_OPERATION_FLAG_NONE, cancellable, error)) {
                        ESource *source = e_client_get_source (E_CLIENT (comp_data->client));
                        e_alert_sink_thread_job_set_alert_arg_0 (job_data, e_source_get_display_name 
(source));
                        /* Stop on the first error */
@@ -507,15 +503,15 @@ e_cal_ops_delete_ecalmodel_components (ECalModel *model,
        nobjects = g_slist_length (objects_copy);
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        description = g_strdup_printf (ngettext ("Deleting an event", "Deleting %d events", 
nobjects), nobjects);
                        alert_ident = "calendar:failed-remove-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        description = g_strdup_printf (ngettext ("Deleting a memo", "Deleting %d memos", 
nobjects), nobjects);
                        alert_ident = "calendar:failed-remove-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        description = g_strdup_printf (ngettext ("Deleting a task", "Deleting %d tasks", 
nobjects), nobjects);
                        alert_ident = "calendar:failed-remove-task";
                        break;
@@ -535,35 +531,34 @@ e_cal_ops_delete_ecalmodel_components (ECalModel *model,
 
 static gboolean
 cal_ops_create_comp_with_new_uid_sync (ECalClient *cal_client,
-                                      icalcomponent *icalcomp,
+                                      ICalComponent *icomp,
                                       GCancellable *cancellable,
                                       GError **error)
 {
-       icalcomponent *clone;
+       ICalComponent *clone;
        gchar *uid;
        gboolean success;
 
        g_return_val_if_fail (E_IS_CAL_CLIENT (cal_client), FALSE);
-       g_return_val_if_fail (icalcomp != NULL, FALSE);
-
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (icomp), FALSE);
 
-       clone = icalcomponent_new_clone (icalcomp);
+       clone = i_cal_component_new_clone (icomp);
 
        uid = e_util_generate_uid ();
-       icalcomponent_set_uid (clone, uid);
+       i_cal_component_set_uid (clone, uid);
        g_free (uid);
 
-       success = e_cal_client_create_object_sync (cal_client, clone, NULL, cancellable, error);
+       success = e_cal_client_create_object_sync (cal_client, clone, E_CAL_OPERATION_FLAG_NONE, NULL, 
cancellable, error);
 
-       icalcomponent_free (clone);
+       g_clear_object (&clone);
 
        return success;
 }
 
 typedef struct {
        ECalModel *model;
-       icalcomponent *icalcomp;
-       icalcomponent_kind kind;
+       ICalComponent *icomp;
+       ICalComponentKind kind;
        const gchar *extension_name;
        gboolean success;
 } PasteComponentsData;
@@ -578,7 +573,7 @@ paste_components_data_free (gpointer ptr)
                        g_signal_emit_by_name (pcd->model, "row-appended", 0);
 
                g_clear_object (&pcd->model);
-               icalcomponent_free (pcd->icalcomp);
+               g_clear_object (&pcd->icomp);
                g_free (pcd);
        }
 }
@@ -630,29 +625,31 @@ cal_ops_update_components_thread (EAlertSinkThreadJobData *job_data,
 
        cal_client = E_CAL_CLIENT (client);
 
-       if (icalcomponent_isa (pcd->icalcomp) == ICAL_VCALENDAR_COMPONENT &&
-           icalcomponent_get_first_component (pcd->icalcomp, pcd->kind) != NULL) {
-               icalcomponent *subcomp;
+       if (i_cal_component_isa (pcd->icomp) == I_CAL_VCALENDAR_COMPONENT &&
+           i_cal_component_count_components (pcd->icomp, pcd->kind) > 0) {
+               ICalComponent *subcomp;
 
-               for (subcomp = icalcomponent_get_first_component (pcd->icalcomp, ICAL_VTIMEZONE_COMPONENT);
+               for (subcomp = i_cal_component_get_first_component (pcd->icomp, I_CAL_VTIMEZONE_COMPONENT);
                     subcomp && !g_cancellable_is_cancelled (cancellable);
-                    subcomp = icalcomponent_get_next_component (pcd->icalcomp, ICAL_VTIMEZONE_COMPONENT)) {
-                       icaltimezone *zone;
+                    g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (pcd->icomp, 
I_CAL_VTIMEZONE_COMPONENT)) {
+                       ICalTimezone *zone;
 
-                       zone = icaltimezone_new ();
-                       icaltimezone_set_component (zone, subcomp);
+                       zone = i_cal_timezone_new ();
+                       i_cal_timezone_set_component (zone, subcomp);
                        if (!e_cal_client_add_timezone_sync (cal_client, zone, cancellable, error)) {
-                               icaltimezone_free (zone, 1);
+                               g_clear_object (&zone);
                                success = FALSE;
                                break;
                        }
 
-                       icaltimezone_free (zone, 1);
+                       g_clear_object (&zone);
                }
 
-               for (subcomp = icalcomponent_get_first_component (pcd->icalcomp, pcd->kind);
+               g_clear_object (&subcomp);
+
+               for (subcomp = i_cal_component_get_first_component (pcd->icomp, pcd->kind);
                     subcomp && !g_cancellable_is_cancelled (cancellable) && success;
-                    subcomp = icalcomponent_get_next_component (pcd->icalcomp, pcd->kind)) {
+                    g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (pcd->icomp, 
pcd->kind)) {
                        if (!cal_ops_create_comp_with_new_uid_sync (cal_client, subcomp, cancellable, error)) 
{
                                success = FALSE;
                                break;
@@ -660,8 +657,10 @@ cal_ops_update_components_thread (EAlertSinkThreadJobData *job_data,
 
                        any_copied = TRUE;
                }
-       } else if (icalcomponent_isa (pcd->icalcomp) == pcd->kind) {
-               success = cal_ops_create_comp_with_new_uid_sync (cal_client, pcd->icalcomp, cancellable, 
error);
+
+               g_clear_object (&subcomp);
+       } else if (i_cal_component_isa (pcd->icomp) == pcd->kind) {
+               success = cal_ops_create_comp_with_new_uid_sync (cal_client, pcd->icomp, cancellable, error);
                any_copied = success;
        }
 
@@ -673,7 +672,7 @@ cal_ops_update_components_thread (EAlertSinkThreadJobData *job_data,
 /**
  * e_cal_ops_paste_components:
  * @model: an #ECalModel
- * @icalcompstr: a string representation of an iCalendar component
+ * @icompstr: a string representation of an iCalendar component
  *
  * Pastes components into the default source of the @model.
  *
@@ -681,11 +680,11 @@ cal_ops_update_components_thread (EAlertSinkThreadJobData *job_data,
  **/
 void
 e_cal_ops_paste_components (ECalModel *model,
-                           const gchar *icalcompstr)
+                           const gchar *icompstr)
 {
        ECalDataModel *data_model;
-       icalcomponent *icalcomp;
-       icalcomponent_kind kind;
+       ICalComponent *icomp;
+       ICalComponentKind kind;
        gint ncomponents = 0;
        GCancellable *cancellable;
        const gchar *alert_ident;
@@ -694,25 +693,25 @@ e_cal_ops_paste_components (ECalModel *model,
        PasteComponentsData *pcd;
 
        g_return_if_fail (E_IS_CAL_MODEL (model));
-       g_return_if_fail (icalcompstr != NULL);
+       g_return_if_fail (icompstr != NULL);
 
-       icalcomp = icalparser_parse_string (icalcompstr);
-       if (!icalcomp)
+       icomp = i_cal_parser_parse_string (icompstr);
+       if (!icomp)
                return;
 
-       kind = icalcomponent_isa (icalcomp);
-       if (kind != ICAL_VCALENDAR_COMPONENT &&
+       kind = i_cal_component_isa (icomp);
+       if (kind != I_CAL_VCALENDAR_COMPONENT &&
            kind != e_cal_model_get_component_kind (model)) {
-               icalcomponent_free (icalcomp);
+               g_clear_object (&icomp);
                return;
        }
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
-                       if (kind == ICAL_VCALENDAR_COMPONENT) {
-                               kind = ICAL_VEVENT_COMPONENT;
-                               ncomponents = icalcomponent_count_components (icalcomp, kind);
-                       } else if (kind == ICAL_VEVENT_COMPONENT) {
+               case I_CAL_VEVENT_COMPONENT:
+                       if (kind == I_CAL_VCALENDAR_COMPONENT) {
+                               kind = I_CAL_VEVENT_COMPONENT;
+                               ncomponents = i_cal_component_count_components (icomp, kind);
+                       } else if (kind == I_CAL_VEVENT_COMPONENT) {
                                ncomponents = 1;
                        }
 
@@ -723,11 +722,11 @@ e_cal_ops_paste_components (ECalModel *model,
                        alert_ident = "calendar:failed-create-event";
                        extension_name = E_SOURCE_EXTENSION_CALENDAR;
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
-                       if (kind == ICAL_VCALENDAR_COMPONENT) {
-                               kind = ICAL_VJOURNAL_COMPONENT;
-                               ncomponents = icalcomponent_count_components (icalcomp, kind);
-                       } else if (kind == ICAL_VJOURNAL_COMPONENT) {
+               case I_CAL_VJOURNAL_COMPONENT:
+                       if (kind == I_CAL_VCALENDAR_COMPONENT) {
+                               kind = I_CAL_VJOURNAL_COMPONENT;
+                               ncomponents = i_cal_component_count_components (icomp, kind);
+                       } else if (kind == I_CAL_VJOURNAL_COMPONENT) {
                                ncomponents = 1;
                        }
 
@@ -738,11 +737,11 @@ e_cal_ops_paste_components (ECalModel *model,
                        alert_ident = "calendar:failed-create-memo";
                        extension_name = E_SOURCE_EXTENSION_MEMO_LIST;
                        break;
-               case ICAL_VTODO_COMPONENT:
-                       if (kind == ICAL_VCALENDAR_COMPONENT) {
-                               kind = ICAL_VTODO_COMPONENT;
-                               ncomponents = icalcomponent_count_components (icalcomp, kind);
-                       } else if (kind == ICAL_VTODO_COMPONENT) {
+               case I_CAL_VTODO_COMPONENT:
+                       if (kind == I_CAL_VCALENDAR_COMPONENT) {
+                               kind = I_CAL_VTODO_COMPONENT;
+                               ncomponents = i_cal_component_count_components (icomp, kind);
+                       } else if (kind == I_CAL_VTODO_COMPONENT) {
                                ncomponents = 1;
                        }
 
@@ -759,13 +758,13 @@ e_cal_ops_paste_components (ECalModel *model,
        }
 
        if (ncomponents == 0) {
-               icalcomponent_free (icalcomp);
+               g_object_unref (icomp);
                return;
        }
 
        pcd = g_new0 (PasteComponentsData, 1);
        pcd->model = g_object_ref (model);
-       pcd->icalcomp = icalcomp;
+       pcd->icomp = icomp;
        pcd->kind = kind;
        pcd->extension_name = extension_name;
        pcd->success = FALSE;
@@ -779,10 +778,9 @@ e_cal_ops_paste_components (ECalModel *model,
        g_free (description);
 }
 
-typedef struct
-{
+typedef struct {
        ECalClient *client;
-       icalcomponent *icalcomp;
+       ICalComponent *icomp;
 } SendComponentData;
 
 static void
@@ -792,7 +790,7 @@ send_component_data_free (gpointer ptr)
 
        if (scd) {
                g_clear_object (&scd->client);
-               icalcomponent_free (scd->icalcomp);
+               g_clear_object (&scd->icomp);
                g_free (scd);
        }
 }
@@ -804,17 +802,15 @@ cal_ops_send_component_thread (EAlertSinkThreadJobData *job_data,
                               GError **error)
 {
        SendComponentData *scd = user_data;
-       icalcomponent *mod_comp = NULL;
+       ICalComponent *mod_comp = NULL;
        GSList *users = NULL;
 
        g_return_if_fail (scd != NULL);
 
-       e_cal_client_send_objects_sync (scd->client, scd->icalcomp,
+       e_cal_client_send_objects_sync (scd->client, scd->icomp, E_CAL_OPERATION_FLAG_NONE,
                &users, &mod_comp, cancellable, error);
 
-       if (mod_comp)
-               icalcomponent_free (mod_comp);
-
+       g_clear_object (&mod_comp);
        g_slist_free_full (users, g_free);
 }
 
@@ -822,17 +818,17 @@ cal_ops_send_component_thread (EAlertSinkThreadJobData *job_data,
  * e_cal_ops_send_component:
  * @model: an #ECalModel
  * @client: an #ECalClient
- * @icalcomp: an #icalcomponent
+ * @icomp: an #ICalComponent
  *
  * Sends (calls e_cal_client_send_objects_sync()) on the given @client
- * with the given @icalcomp in a dedicated thread.
+ * with the given @icomp in a dedicated thread.
  *
  * Since: 3.16
  **/
 void
 e_cal_ops_send_component (ECalModel *model,
                          ECalClient *client,
-                         icalcomponent *icalcomp)
+                         ICalComponent *icomp)
 {
        ECalDataModel *data_model;
        ESource *source;
@@ -844,7 +840,7 @@ e_cal_ops_send_component (ECalModel *model,
 
        g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (icomp));
 
        switch (e_cal_client_get_source_type (client)) {
                case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
@@ -866,7 +862,7 @@ e_cal_ops_send_component (ECalModel *model,
 
        scd = g_new0 (SendComponentData, 1);
        scd->client = g_object_ref (client);
-       scd->icalcomp = icalcomponent_new_clone (icalcomp);
+       scd->icomp = i_cal_component_new_clone (icomp);
 
        source = e_client_get_source (E_CLIENT (client));
        data_model = e_cal_model_get_data_model (model);
@@ -883,7 +879,7 @@ e_cal_ops_send_component (ECalModel *model,
 typedef struct {
        ECalModel *model;
        GList *clients;
-       icalcomponent_kind kind;
+       ICalComponentKind kind;
        time_t older_than;
 } PurgeComponentsData;
 
@@ -906,14 +902,16 @@ struct purge_data {
 };
 
 static gboolean
-ca_ops_purge_check_instance_cb (ECalComponent *comp,
-                               time_t instance_start,
-                               time_t instance_end,
-                               gpointer data)
+ca_ops_purge_check_instance_cb (ICalComponent *comp,
+                               ICalTime *instance_start,
+                               ICalTime *instance_end,
+                               gpointer user_data,
+                               GCancellable *cancellable,
+                               GError **error)
 {
-       struct purge_data *pd = data;
+       struct purge_data *pd = user_data;
 
-       if (instance_end >= pd->older_than)
+       if (i_cal_time_as_timet (instance_end) >= pd->older_than)
                pd->remove = FALSE;
 
        return pd->remove;
@@ -930,15 +928,18 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
        gchar *sexp, *start, *end;
        gboolean pushed_message = FALSE;
        const gchar *tzloc = NULL;
-       icaltimezone *zone;
-       icalcomponent_kind model_kind;
+       ICalTimezone *zone;
+       ICalComponentKind model_kind;
 
        g_return_if_fail (pcd != NULL);
 
        model_kind = e_cal_model_get_component_kind (pcd->model);
        zone = e_cal_model_get_timezone (pcd->model);
-       if (zone && zone != icaltimezone_get_utc_timezone ())
-               tzloc = icaltimezone_get_location (zone);
+       if (zone && zone != i_cal_timezone_get_utc_timezone ()) {
+               tzloc = i_cal_timezone_get_location (zone);
+               if (tzloc && g_ascii_strcasecmp (tzloc, "UTC") == 0)
+                       tzloc = NULL;
+       }
 
        start = isodate_from_time_t (0);
        end = isodate_from_time_t (pcd->older_than);
@@ -962,15 +963,15 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
                e_alert_sink_thread_job_set_alert_arg_0 (job_data, display_name);
 
                switch (model_kind) {
-                       case ICAL_VEVENT_COMPONENT:
+                       case I_CAL_VEVENT_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Getting events to purge in the calendar “%s”"), display_name);
                                break;
-                       case ICAL_VJOURNAL_COMPONENT:
+                       case I_CAL_VJOURNAL_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Getting memos to purge in the memo list “%s”"), display_name);
                                break;
-                       case ICAL_VTODO_COMPONENT:
+                       case I_CAL_VTODO_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Getting tasks to purge in the task list “%s”"), display_name);
                                break;
@@ -996,15 +997,15 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
                }
 
                switch (model_kind) {
-                       case ICAL_VEVENT_COMPONENT:
+                       case I_CAL_VEVENT_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Purging events in the calendar “%s”"), display_name);
                                break;
-                       case ICAL_VJOURNAL_COMPONENT:
+                       case I_CAL_VJOURNAL_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Purging memos in the memo list “%s”"), display_name);
                                break;
-                       case ICAL_VTODO_COMPONENT:
+                       case I_CAL_VTODO_COMPONENT:
                                camel_operation_push_message (cancellable,
                                        _("Purging tasks in the task list “%s”"), display_name);
                                break;
@@ -1019,7 +1020,7 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
                nobjects = g_slist_length (objects);
 
                for (olink = objects, ii = 0; olink; olink = g_slist_next (olink), ii++) {
-                       icalcomponent *icalcomp = olink->data;
+                       ICalComponent *icomp = olink->data;
                        gboolean remove = TRUE;
                        gint percent = 100 * (ii + 1) / nobjects;
 
@@ -1029,30 +1030,26 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
                                pd.remove = TRUE;
                                pd.older_than = pcd->older_than;
 
-                               e_cal_client_generate_instances_for_object_sync (client, icalcomp,
-                                       pcd->older_than, G_MAXINT32, ca_ops_purge_check_instance_cb, &pd);
+                               e_cal_client_generate_instances_for_object_sync (client, icomp,
+                                       pcd->older_than, G_MAXINT32, cancellable, 
ca_ops_purge_check_instance_cb, &pd);
 
                                remove = pd.remove;
                        }
 
                        if (remove) {
-                               const gchar *uid = icalcomponent_get_uid (icalcomp);
+                               const gchar *uid = i_cal_component_get_uid (icomp);
 
-                               if (e_cal_util_component_is_instance (icalcomp) ||
-                                   e_cal_util_component_has_recurrences (icalcomp)) {
-                                       gchar *rid = NULL;
-                                       struct icaltimetype recur_id;
+                               if (e_cal_util_component_is_instance (icomp) ||
+                                   e_cal_util_component_has_recurrences (icomp)) {
+                                       gchar *rid;
 
-                                       recur_id = icalcomponent_get_recurrenceid (icalcomp);
+                                       rid = e_cal_util_component_get_recurid_as_string (icomp);
 
-                                       if (!icaltime_is_null_time (recur_id))
-                                               rid = icaltime_as_ical_string_r (recur_id);
-
-                                       success = e_cal_client_remove_object_sync (client, uid, rid, 
E_CAL_OBJ_MOD_ALL, cancellable, error);
+                                       success = e_cal_client_remove_object_sync (client, uid, rid, 
E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, cancellable, error);
 
                                        g_free (rid);
                                } else {
-                                       success = e_cal_client_remove_object_sync (client, uid, NULL, 
E_CAL_OBJ_MOD_THIS, cancellable, error);
+                                       success = e_cal_client_remove_object_sync (client, uid, NULL, 
E_CAL_OBJ_MOD_THIS, E_CAL_OPERATION_FLAG_NONE, cancellable, error);
                                }
 
                                if (!success)
@@ -1065,8 +1062,7 @@ cal_ops_purge_components_thread (EAlertSinkThreadJobData *job_data,
                        }
                }
 
-               g_slist_foreach (objects, (GFunc) icalcomponent_free, NULL);
-               g_slist_free (objects);
+               g_slist_free_full (objects, g_object_unref);
 
                camel_operation_progress (cancellable, 0);
                camel_operation_pop_message (cancellable);
@@ -1105,15 +1101,15 @@ e_cal_ops_purge_components (ECalModel *model,
        g_return_if_fail (E_IS_CAL_MODEL (model));
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        description = _("Purging events");
                        alert_ident = "calendar:failed-remove-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        description = _("Purging memos");
                        alert_ident = "calendar:failed-remove-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        description = _("Purging tasks");
                        alert_ident = "calendar:failed-remove-task";
                        break;
@@ -1166,19 +1162,19 @@ cal_ops_delete_completed_thread (EAlertSinkThreadJobData *job_data,
                }
 
                for (olink = objects; olink != NULL; olink = g_slist_next (olink)) {
-                       icalcomponent *icalcomp = olink->data;
+                       ICalComponent *icomp = olink->data;
                        const gchar *uid;
 
-                       uid = icalcomponent_get_uid (icalcomp);
+                       uid = i_cal_component_get_uid (icomp);
 
-                       if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_THIS, 
cancellable, error)) {
+                       if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_THIS, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error)) {
                                ESource *source = e_client_get_source (E_CLIENT (client));
                                e_alert_sink_thread_job_set_alert_arg_0 (job_data, e_source_get_display_name 
(source));
                                break;
                        }
                }
 
-               e_cal_client_free_icalcomp_slist (objects);
+               e_util_free_nullable_object_slist (objects);
 
                /* did not process all objects => an error occurred */
                if (olink != NULL)
@@ -1277,13 +1273,13 @@ cal_ops_get_default_component_thread (EAlertSinkThreadJobData *job_data,
                registry = e_cal_model_get_registry (bod->model);
 
                switch (e_cal_model_get_component_kind (bod->model)) {
-                       case ICAL_VEVENT_COMPONENT:
+                       case I_CAL_VEVENT_COMPONENT:
                                default_source = e_source_registry_ref_default_calendar (registry);
                                break;
-                       case ICAL_VJOURNAL_COMPONENT:
+                       case I_CAL_VJOURNAL_COMPONENT:
                                default_source = e_source_registry_ref_default_memo_list (registry);
                                break;
-                       case ICAL_VTODO_COMPONENT:
+                       case I_CAL_VTODO_COMPONENT:
                                default_source = e_source_registry_ref_default_task_list (registry);
                                break;
                        default:
@@ -1301,13 +1297,13 @@ cal_ops_get_default_component_thread (EAlertSinkThreadJobData *job_data,
                const gchar *extension_name = NULL;
 
                switch (e_cal_model_get_component_kind (bod->model)) {
-                       case ICAL_VEVENT_COMPONENT:
+                       case I_CAL_VEVENT_COMPONENT:
                                extension_name = E_SOURCE_EXTENSION_CALENDAR;
                                break;
-                       case ICAL_VJOURNAL_COMPONENT:
+                       case I_CAL_VJOURNAL_COMPONENT:
                                extension_name = E_SOURCE_EXTENSION_MEMO_LIST;
                                break;
-                       case ICAL_VTODO_COMPONENT:
+                       case I_CAL_VTODO_COMPONENT:
                                extension_name = E_SOURCE_EXTENSION_TASK_LIST;
                                break;
                        default:
@@ -1323,8 +1319,8 @@ cal_ops_get_default_component_thread (EAlertSinkThreadJobData *job_data,
                        error);
        }
 
-       bod->icalcomp = e_cal_model_create_component_with_defaults_sync (bod->model, bod->client, 
bod->all_day_default_comp, cancellable, error);
-       bod->success = bod->icalcomp != NULL && !g_cancellable_is_cancelled (cancellable);
+       bod->icomp = e_cal_model_create_component_with_defaults_sync (bod->model, bod->client, 
bod->all_day_default_comp, cancellable, error);
+       bod->success = bod->icomp != NULL && !g_cancellable_is_cancelled (cancellable);
 }
 
 /**
@@ -1363,15 +1359,15 @@ e_cal_ops_get_default_component (ECalModel *model,
        g_return_if_fail (callback != NULL);
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        description = _("Creating an event");
                        alert_ident = "calendar:failed-create-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        description = _("Creating a memo");
                        alert_ident = "calendar:failed-create-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        description = _("Creating a task");
                        alert_ident = "calendar:failed-create-task";
                        break;
@@ -1393,7 +1389,7 @@ e_cal_ops_get_default_component (ECalModel *model,
        bod = g_new0 (BasicOperationData, 1);
        bod->model = g_object_ref (model);
        bod->client = NULL;
-       bod->icalcomp = NULL;
+       bod->icomp = NULL;
        bod->for_client_uid = g_strdup (for_client_uid);
        bod->all_day_default_comp = all_day;
        bod->get_default_comp_cb = callback;
@@ -1468,39 +1464,42 @@ new_component_data_free (gpointer ptr)
 
                        if (ncd->source_type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS) {
                                if (ncd->is_new_component && ncd->dtstart > 0 && ncd->dtend > 0) {
-                                       ECalComponentDateTime dt;
-                                       struct icaltimetype itt;
-                                       icaltimezone *zone;
+                                       ECalComponentDateTime *dt;
+                                       ICalTime *itt;
+                                       ICalTimezone *zone;
 
                                        if (ncd->model)
                                                zone = e_cal_model_get_timezone (ncd->model);
                                        else
                                                zone = calendar_config_get_icaltimezone ();
 
-                                       dt.value = &itt;
-                                       if (ncd->all_day)
-                                               dt.tzid = NULL;
-                                       else
-                                               dt.tzid = icaltimezone_get_tzid (zone);
-
-                                       itt = icaltime_from_timet_with_zone (ncd->dtstart, FALSE, zone);
+                                       itt = i_cal_time_from_timet_with_zone (ncd->dtstart, FALSE, zone);
                                        if (ncd->all_day) {
-                                               itt.hour = itt.minute = itt.second = 0;
-                                               itt.is_date = TRUE;
+                                               i_cal_time_set_time (itt, 0, 0, 0);
+                                               i_cal_time_set_is_date (itt, TRUE);
                                        }
-                                       e_cal_component_set_dtstart (ncd->comp, &dt);
 
-                                       itt = icaltime_from_timet_with_zone (ncd->dtend, FALSE, zone);
+                                       dt = e_cal_component_datetime_new_take (itt,
+                                               (ncd->all_day || !zone) ? NULL : g_strdup 
(i_cal_timezone_get_tzid (zone)));
+                                       e_cal_component_set_dtstart (ncd->comp, dt);
+                                       e_cal_component_datetime_free (dt);
+
+                                       itt = i_cal_time_from_timet_with_zone (ncd->dtend, FALSE, zone);
                                        if (ncd->all_day) {
                                                /* We round it up to the end of the day, unless it is
                                                 * already set to midnight */
-                                               if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) {
-                                                       icaltime_adjust (&itt, 1, 0, 0, 0);
+                                               if (i_cal_time_get_hour (itt) != 0 ||
+                                                   i_cal_time_get_minute (itt) != 0 ||
+                                                   i_cal_time_get_second (itt) != 0) {
+                                                       i_cal_time_adjust (itt, 1, 0, 0, 0);
                                                }
-                                               itt.hour = itt.minute = itt.second = 0;
-                                               itt.is_date = TRUE;
+                                               i_cal_time_set_time (itt, 0, 0, 0);
+                                               i_cal_time_set_is_date (itt, TRUE);
                                        }
-                                       e_cal_component_set_dtend (ncd->comp, &dt);
+                                       dt = e_cal_component_datetime_new_take (itt,
+                                               (ncd->all_day || !zone) ? NULL : g_strdup 
(i_cal_timezone_get_tzid (zone)));
+                                       e_cal_component_set_dtend (ncd->comp, dt);
+                                       e_cal_component_datetime_free (dt);
                                }
                                e_cal_component_commit_sequence (ncd->comp);
                        }
@@ -1834,10 +1833,10 @@ e_cal_ops_new_component_editor_from_model (ECalModel *model,
  * e_cal_ops_open_component_in_editor_sync:
  * @model: (nullable): an #ECalModel instance
  * @client: an #ECalClient, to which the component belongs
- * @icalcomp: an #icalcomponent to open in an editor
+ * @icomp: an #ICalComponent to open in an editor
  * @force_attendees: set to TRUE to force to show attendees, FALSE to auto-detect
  *
- * Opens a component @icalcomp, which belongs to a @client, in
+ * Opens a component @icomp, which belongs to a @client, in
  * a component editor. This is done synchronously.
  *
  * Since: 3.16
@@ -1845,7 +1844,7 @@ e_cal_ops_new_component_editor_from_model (ECalModel *model,
 void
 e_cal_ops_open_component_in_editor_sync (ECalModel *model,
                                         ECalClient *client,
-                                        icalcomponent *icalcomp,
+                                        ICalComponent *icomp,
                                         gboolean force_attendees)
 {
        NewComponentData *ncd;
@@ -1855,15 +1854,15 @@ e_cal_ops_open_component_in_editor_sync (ECalModel *model,
        if (model)
                g_return_if_fail (E_IS_CAL_MODEL (model));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (icomp));
 
-       comp_editor = e_comp_editor_find_existing_for (e_client_get_source (E_CLIENT (client)), icalcomp);
+       comp_editor = e_comp_editor_find_existing_for (e_client_get_source (E_CLIENT (client)), icomp);
        if (comp_editor) {
                gtk_window_present (GTK_WINDOW (comp_editor));
                return;
        }
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        g_return_if_fail (comp != NULL);
 
        ncd = g_new0 (NewComponentData, 1);
@@ -1882,24 +1881,23 @@ e_cal_ops_open_component_in_editor_sync (ECalModel *model,
        new_component_data_free (ncd);
 }
 
-typedef struct
-{
+typedef struct {
        EShell *shell;
        ECalModel *model;
        ESource *destination;
        ECalClient *destination_client;
        ECalClientSourceType source_type;
-       GHashTable *icalcomps_by_source;
+       GHashTable *icomps_by_source;
        gboolean is_move;
        gint nobjects;
 } TransferComponentsData;
 
 static void
-transfer_components_free_icalcomps_slist (gpointer ptr)
+transfer_components_free_icomps_slist (gpointer ptr)
 {
-       GSList *icalcomps = ptr;
+       GSList *icomps = ptr;
 
-       g_slist_free_full (icalcomps, (GDestroyNotify) icalcomponent_free);
+       g_slist_free_full (icomps, g_object_unref);
 }
 
 static void
@@ -1915,7 +1913,7 @@ transfer_components_data_free (gpointer ptr)
                g_clear_object (&tcd->model);
                g_clear_object (&tcd->destination);
                g_clear_object (&tcd->destination_client);
-               g_hash_table_destroy (tcd->icalcomps_by_source);
+               g_hash_table_destroy (tcd->icomps_by_source);
                g_free (tcd);
        }
 }
@@ -1969,10 +1967,10 @@ transfer_components_thread (EAlertSinkThreadJobData *job_data,
 
        nobjects = tcd->nobjects;
 
-       g_hash_table_iter_init (&iter, tcd->icalcomps_by_source);
+       g_hash_table_iter_init (&iter, tcd->icomps_by_source);
        while (g_hash_table_iter_next (&iter, &key, &value)) {
                ESource *source = key;
-               GSList *icalcomps = value;
+               GSList *icomps = value;
 
                from_client = e_util_open_client_sync (job_data, client_cache, extension_name, source, 30, 
cancellable, error);
                if (!from_client) {
@@ -1982,11 +1980,11 @@ transfer_components_thread (EAlertSinkThreadJobData *job_data,
 
                from_cal_client = E_CAL_CLIENT (from_client);
 
-               for (link = icalcomps; link && !g_cancellable_is_cancelled (cancellable); link = g_slist_next 
(link), ii++) {
+               for (link = icomps; link && !g_cancellable_is_cancelled (cancellable); link = g_slist_next 
(link), ii++) {
                        gint percent = 100 * (ii + 1) / nobjects;
-                       icalcomponent *icalcomp = link->data;
+                       ICalComponent *icomp = link->data;
 
-                       if (!cal_comp_transfer_item_to_sync (from_cal_client, to_cal_client, icalcomp, 
!tcd->is_move, cancellable, error)) {
+                       if (!cal_comp_transfer_item_to_sync (from_cal_client, to_cal_client, icomp, 
!tcd->is_move, cancellable, error)) {
                                success = FALSE;
                                break;
                        }
@@ -2013,13 +2011,12 @@ transfer_components_thread (EAlertSinkThreadJobData *job_data,
  * @shell_view: an #EShellView
  * @model: an #ECalModel, where to notify about created objects
  * @source_type: a source type of the @destination and the sources
- * @icalcomps_by_source: a hash table of #ESource to #GSList of icalcomponent to transfer
+ * @icomps_by_source: a hash table of #ESource to #GSList of ICalComponent to transfer
  * @destination: a destination #ESource
- * @icalcomps: a #GSList of icalcomponent-s to transfer
  * @is_move: whether the transfer is move (%TRUE) or copy (%FALSE)
  *
- * Transfers (copies or moves, as set by @is_move) all @icalcomps from the @source
- * to the @destination of type @source type (calendar/memo list/task list).
+ * Transfers (copies or moves, as set by @is_move) all @icomps_by_source from their source
+ * to the @destination of type source type (calendar/memo list/task list).
  *
  * Since: 3.16
  **/
@@ -2027,7 +2024,7 @@ void
 e_cal_ops_transfer_components (EShellView *shell_view,
                               ECalModel *model,
                               ECalClientSourceType source_type,
-                              GHashTable *icalcomps_by_source,
+                              GHashTable *icomps_by_source,
                               ESource *destination,
                               gboolean is_move)
 {
@@ -2041,17 +2038,17 @@ e_cal_ops_transfer_components (EShellView *shell_view,
 
        g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
        g_return_if_fail (E_IS_CAL_MODEL (model));
-       g_return_if_fail (icalcomps_by_source != NULL);
+       g_return_if_fail (icomps_by_source != NULL);
        g_return_if_fail (E_IS_SOURCE (destination));
 
        nobjects = 0;
-       g_hash_table_iter_init (&iter, icalcomps_by_source);
+       g_hash_table_iter_init (&iter, icomps_by_source);
        while (g_hash_table_iter_next (&iter, &key, &value)) {
                ESource *source = key;
-               GSList *icalcomps = value;
+               GSList *icomps = value;
 
                if (!is_move || !e_source_equal (source, destination))
-                       nobjects += g_slist_length (icalcomps);
+                       nobjects += g_slist_length (icomps);
        }
 
        switch (source_type) {
@@ -2084,28 +2081,28 @@ e_cal_ops_transfer_components (EShellView *shell_view,
        tcd = g_new0 (TransferComponentsData, 1);
        tcd->shell = g_object_ref (e_shell_window_get_shell (e_shell_view_get_shell_window (shell_view)));
        tcd->model = g_object_ref (model);
-       tcd->icalcomps_by_source = g_hash_table_new_full ((GHashFunc) e_source_hash, (GEqualFunc) 
e_source_equal,
-               g_object_unref, transfer_components_free_icalcomps_slist);
+       tcd->icomps_by_source = g_hash_table_new_full ((GHashFunc) e_source_hash, (GEqualFunc) e_source_equal,
+               g_object_unref, transfer_components_free_icomps_slist);
        tcd->destination = g_object_ref (destination);
        tcd->source_type = source_type;
        tcd->is_move = is_move;
        tcd->nobjects = nobjects;
        tcd->destination_client = NULL;
 
-       g_hash_table_iter_init (&iter, icalcomps_by_source);
+       g_hash_table_iter_init (&iter, icomps_by_source);
        while (g_hash_table_iter_next (&iter, &key, &value)) {
                ESource *source = key;
-               GSList *icalcomps = value;
+               GSList *icomps = value;
 
                if (!is_move || !e_source_equal (source, destination)) {
                        GSList *link;
 
-                       icalcomps = g_slist_copy (icalcomps);
-                       for (link = icalcomps; link; link = g_slist_next (link)) {
-                               link->data = icalcomponent_new_clone (link->data);
+                       icomps = g_slist_copy (icomps);
+                       for (link = icomps; link; link = g_slist_next (link)) {
+                               link->data = i_cal_component_new_clone (link->data);
                        }
 
-                       g_hash_table_insert (tcd->icalcomps_by_source, g_object_ref (source), icalcomps);
+                       g_hash_table_insert (tcd->icomps_by_source, g_object_ref (source), icomps);
                }
        }
 
diff --git a/src/calendar/gui/e-cal-ops.h b/src/calendar/gui/e-cal-ops.h
index f465a8dd9e..aa6be2fcac 100644
--- a/src/calendar/gui/e-cal-ops.h
+++ b/src/calendar/gui/e-cal-ops.h
@@ -26,12 +26,12 @@
 
 typedef void (* ECalOpsCreateComponentFunc)    (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *original_icalcomp,
+                                                ICalComponent *original_icomp,
                                                 const gchar *new_uid,
                                                 gpointer user_data);
 typedef void (* ECalOpsGetDefaultComponentFunc)        (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *default_component,
+                                                ICalComponent *default_component,
                                                 gpointer user_data);
 
 typedef enum {
@@ -45,13 +45,13 @@ typedef enum {
 
 void   e_cal_ops_create_component              (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 ECalOpsCreateComponentFunc callback,
                                                 gpointer user_data,
                                                 GDestroyNotify user_data_free);
 void   e_cal_ops_modify_component              (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 ECalObjModType mod,
                                                 ECalOpsSendFlags send_flags);
 void   e_cal_ops_remove_component              (ECalModel *model,
@@ -63,10 +63,10 @@ void        e_cal_ops_remove_component              (ECalModel *model,
 void   e_cal_ops_delete_ecalmodel_components   (ECalModel *model,
                                                 const GSList *objects); /* data is 'ECalModelComponent *' */
 void   e_cal_ops_paste_components              (ECalModel *model,
-                                                const gchar *icalcompstr);
+                                                const gchar *icompstr);
 void   e_cal_ops_send_component                (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp);
+                                                ICalComponent *icomp);
 void   e_cal_ops_purge_components              (ECalModel *model,
                                                 time_t older_than);
 void   e_cal_ops_delete_completed_tasks        (ECalModel *model);
@@ -99,13 +99,13 @@ void        e_cal_ops_new_component_editor_from_model
                                                 gboolean all_day);
 void   e_cal_ops_open_component_in_editor_sync (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 gboolean force_attendees);
 
 void   e_cal_ops_transfer_components           (EShellView *shell_view,
                                                 ECalModel *model,
                                                 ECalClientSourceType source_type,
-                                                GHashTable *icalcomps_by_source, /* ESource ~> 
GSList{icalcomponent} */
+                                                GHashTable *icomps_by_source, /* ESource ~> 
GSList{ICalComponent} */
                                                 ESource *destination,
                                                 gboolean is_move);
 
diff --git a/src/calendar/gui/e-calendar-view.c b/src/calendar/gui/e-calendar-view.c
index f752bdd6c4..01aadaa9e6 100644
--- a/src/calendar/gui/e-calendar-view.c
+++ b/src/calendar/gui/e-calendar-view.c
@@ -104,30 +104,30 @@ calendar_view_add_retract_data (ECalComponent *comp,
                                 const gchar *retract_comment,
                                 ECalObjModType mod)
 {
-       icalcomponent *icalcomp = NULL;
-       icalproperty *icalprop = NULL;
+       ICalComponent *icomp;
+       ICalProperty *prop;
 
-       icalcomp = e_cal_component_get_icalcomponent (comp);
+       icomp = e_cal_component_get_icalcomponent (comp);
        if (retract_comment && *retract_comment)
-               icalprop = icalproperty_new_x (retract_comment);
+               prop = i_cal_property_new_x (retract_comment);
        else
-               icalprop = icalproperty_new_x ("0");
-       icalproperty_set_x_name (icalprop, "X-EVOLUTION-RETRACT-COMMENT");
-       icalcomponent_add_property (icalcomp, icalprop);
+               prop = i_cal_property_new_x ("0");
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-RETRACT-COMMENT");
+       i_cal_component_take_property (icomp, prop);
 
        if (mod == E_CAL_OBJ_MOD_ALL)
-               icalprop = icalproperty_new_x ("All");
+               prop = i_cal_property_new_x ("All");
        else
-               icalprop = icalproperty_new_x ("This");
-       icalproperty_set_x_name (icalprop, "X-EVOLUTION-RECUR-MOD");
-       icalcomponent_add_property (icalcomp, icalprop);
+               prop = i_cal_property_new_x ("This");
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-RECUR-MOD");
+       i_cal_component_take_property (icomp, prop);
 }
 
 static gboolean
 calendar_view_check_for_retract (ECalComponent *comp,
                                  ECalClient *client)
 {
-       ECalComponentOrganizer organizer;
+       ECalComponentOrganizer *organizer;
        const gchar *strip;
        gchar *email = NULL;
        gboolean ret_val;
@@ -138,15 +138,20 @@ calendar_view_check_for_retract (ECalComponent *comp,
        if (!e_cal_client_check_save_schedules (client))
                return FALSE;
 
-       e_cal_component_get_organizer (comp, &organizer);
-       strip = itip_strip_mailto (organizer.value);
+       organizer = e_cal_component_get_organizer (comp);
+       if (!organizer)
+               return FALSE;
+
+       strip = itip_strip_mailto (e_cal_component_organizer_get_value (organizer));
 
        ret_val =
-               e_client_get_backend_property_sync (E_CLIENT (client), 
CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &email, NULL, NULL) &&
+               e_client_get_backend_property_sync (E_CLIENT (client), 
E_CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &email, NULL, NULL) &&
                (g_ascii_strcasecmp (email, strip) == 0);
 
        g_free (email);
 
+       e_cal_component_organizer_free (organizer);
+
        return ret_val;
 }
 
@@ -168,7 +173,7 @@ calendar_view_delete_event (ECalendarView *cal_view,
        registry = e_cal_model_get_registry (model);
 
        comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       e_cal_component_set_icalcomponent (comp, i_cal_component_new_clone (event->comp_data->icalcomp));
        vtype = e_cal_component_get_vtype (comp);
 
        /*FIXME remove it once the we dont set the recurrence id for all the generated instances */
@@ -182,13 +187,13 @@ calendar_view_delete_event (ECalendarView *cal_view,
 
                delete = e_cal_dialogs_prompt_retract (GTK_WIDGET (cal_view), comp, &retract_comment, 
&retract);
                if (retract) {
-                       icalcomponent *icalcomp;
+                       ICalComponent *icomp;
 
                        calendar_view_add_retract_data (comp, retract_comment, E_CAL_OBJ_MOD_ALL);
-                       icalcomp = e_cal_component_get_icalcomponent (comp);
-                       icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL);
+                       icomp = e_cal_component_get_icalcomponent (comp);
+                       i_cal_component_set_method (icomp, I_CAL_METHOD_CANCEL);
 
-                       e_cal_ops_send_component (model, event->comp_data->client, icalcomp);
+                       e_cal_ops_send_component (model, event->comp_data->client, icomp);
                }
        } else if (e_cal_model_get_confirm_delete (model))
                delete = e_cal_dialogs_delete_component (
@@ -207,15 +212,17 @@ calendar_view_delete_event (ECalendarView *cal_view,
                                                event->comp_data->client,
                                                comp, TRUE)) {
                        if (only_occurrence && !e_cal_component_is_instance (comp)) {
-                               ECalComponentRange range;
+                               ECalComponentRange *range;
+                               ECalComponentDateTime *dtstart;
+
+                               dtstart = e_cal_component_get_dtstart (comp);
+                               i_cal_time_set_is_date (e_cal_component_datetime_get_value (dtstart), 1);
 
                                /* set the recurrence ID of the object we send */
-                               range.type = E_CAL_COMPONENT_RANGE_SINGLE;
-                               e_cal_component_get_dtstart (comp, &range.datetime);
-                               range.datetime.value->is_date = 1;
-                               e_cal_component_set_recurid (comp, &range);
+                               range = e_cal_component_range_new_take (E_CAL_COMPONENT_RANGE_SINGLE, 
dtstart);
+                               e_cal_component_set_recurid (comp, range);
 
-                               e_cal_component_free_datetime (&range.datetime);
+                               e_cal_component_range_free (range);
                        }
 
                        itip_send_component_with_model (model, E_CAL_COMPONENT_METHOD_CANCEL,
@@ -223,7 +230,7 @@ calendar_view_delete_event (ECalendarView *cal_view,
                                NULL, TRUE, FALSE, FALSE);
                }
 
-               e_cal_component_get_uid (comp, &uid);
+               uid = e_cal_component_get_uid (comp);
                if (!uid || !*uid) {
                        g_object_unref (comp);
                        g_free (rid);
@@ -234,16 +241,19 @@ calendar_view_delete_event (ECalendarView *cal_view,
                        if (e_cal_component_is_instance (comp)) {
                                e_cal_ops_remove_component (model, event->comp_data->client, uid, rid, 
E_CAL_OBJ_MOD_THIS, FALSE);
                        } else {
-                               struct icaltimetype instance_rid;
-                               ECalComponentDateTime dt;
-                               icaltimezone *zone = NULL;
+                               ICalTime *instance_rid;
+                               ICalTimezone *zone = NULL;
+                               ECalComponentDateTime *dt;
 
-                               e_cal_component_get_dtstart (comp, &dt);
+                               dt = e_cal_component_get_dtstart (comp);
 
-                               if (dt.tzid) {
+                               if (dt && e_cal_component_datetime_get_tzid (dt)) {
                                        GError *local_error = NULL;
 
-                                       e_cal_client_get_timezone_sync (event->comp_data->client, dt.tzid, 
&zone, NULL, &local_error);
+                                       if (!e_cal_client_get_timezone_sync (event->comp_data->client,
+                                               e_cal_component_datetime_get_tzid (dt), &zone, NULL, 
&local_error))
+                                               zone = NULL;
+
                                        if (local_error != NULL) {
                                                zone = e_calendar_view_get_timezone (cal_view);
                                                g_clear_error (&local_error);
@@ -252,14 +262,16 @@ calendar_view_delete_event (ECalendarView *cal_view,
                                        zone = e_calendar_view_get_timezone (cal_view);
                                }
 
-                               e_cal_component_free_datetime (&dt);
+                               e_cal_component_datetime_free (dt);
 
-                               instance_rid = icaltime_from_timet_with_zone (
+                               instance_rid = i_cal_time_from_timet_with_zone (
                                        event->comp_data->instance_start,
-                                       TRUE, zone ? zone : icaltimezone_get_utc_timezone ());
+                                       TRUE, zone ? zone : i_cal_timezone_get_utc_timezone ());
                                e_cal_util_remove_instances (event->comp_data->icalcomp, instance_rid, 
E_CAL_OBJ_MOD_THIS);
                                e_cal_ops_modify_component (model, event->comp_data->client, 
event->comp_data->icalcomp,
                                        E_CAL_OBJ_MOD_THIS, E_CAL_OPS_SEND_FLAG_DONT_SEND);
+
+                               g_clear_object (&instance_rid);
                        }
                } else if (e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
                           e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
@@ -437,19 +449,19 @@ calendar_view_update_actions (ESelectable *selectable,
        for (iter = list; iter != NULL; iter = iter->next) {
                ECalendarViewEvent *event = iter->data;
                ECalClient *client;
-               icalcomponent *icalcomp;
+               ICalComponent *icomp;
 
                if (event == NULL || event->comp_data == NULL)
                        continue;
 
                client = event->comp_data->client;
-               icalcomp = event->comp_data->icalcomp;
+               icomp = event->comp_data->icalcomp;
 
                sources_are_editable = sources_are_editable && !e_client_is_readonly (E_CLIENT (client));
 
                recurring |=
-                       e_cal_util_component_is_instance (icalcomp) ||
-                       e_cal_util_component_has_recurrences (icalcomp);
+                       e_cal_util_component_is_instance (icomp) ||
+                       e_cal_util_component_has_recurrences (icomp);
        }
 
        g_list_free (list);
@@ -510,52 +522,64 @@ calendar_view_cut_clipboard (ESelectable *selectable)
 }
 
 static void
-add_related_timezones (icalcomponent *des_icalcomp,
-                       icalcomponent *src_icalcomp,
-                       ECalClient *client)
+add_related_timezones (ICalComponent *des_icomp,
+                      ICalComponent *src_icomp,
+                      ECalClient *client)
 {
-       icalproperty_kind look_in[] = {
-               ICAL_DTSTART_PROPERTY,
-               ICAL_DTEND_PROPERTY,
-               ICAL_NO_PROPERTY
+       ICalPropertyKind look_in[] = {
+               I_CAL_DTSTART_PROPERTY,
+               I_CAL_DTEND_PROPERTY,
+               I_CAL_NO_PROPERTY
        };
-       gint i;
+       gint ii;
 
-       g_return_if_fail (des_icalcomp != NULL);
-       g_return_if_fail (src_icalcomp != NULL);
+       g_return_if_fail (des_icomp != NULL);
+       g_return_if_fail (src_icomp != NULL);
        g_return_if_fail (client != NULL);
 
-       for (i = 0; look_in[i] != ICAL_NO_PROPERTY; i++) {
-               icalproperty *prop = icalcomponent_get_first_property (src_icalcomp, look_in[i]);
+       for (ii = 0; look_in[ii] != I_CAL_NO_PROPERTY; ii++) {
+               ICalProperty *prop = i_cal_component_get_first_property (src_icomp, look_in[ii]);
 
                if (prop) {
-                       icalparameter *par = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
+                       ICalParameter *par = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
 
                        if (par) {
-                               const gchar *tzid = icalparameter_get_tzid (par);
+                               const gchar *tzid = i_cal_parameter_get_tzid (par);
 
                                if (tzid) {
                                        GError *error = NULL;
-                                       icaltimezone *zone = NULL;
+                                       ICalTimezone *zone = NULL;
 
-                                       e_cal_client_get_timezone_sync (
-                                               client, tzid, &zone, NULL, &error);
+                                       if (!e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, 
&error))
+                                               zone = NULL;
                                        if (error != NULL) {
                                                g_warning (
                                                        "%s: Cannot get timezone for '%s'. %s",
                                                        G_STRFUNC, tzid, error->message);
                                                g_error_free (error);
-                                       } else if (zone &&
-                                               icalcomponent_get_timezone (des_icalcomp, 
icaltimezone_get_tzid (zone)) == NULL) {
-                                               /* do not duplicate timezones in the component */
-                                               icalcomponent *vtz_comp;
+                                       } else if (zone) {
+                                               ICalTimezone *existing_zone;
 
-                                               vtz_comp = icaltimezone_get_component (zone);
-                                               if (vtz_comp)
-                                                       icalcomponent_add_component (des_icalcomp, 
icalcomponent_new_clone (vtz_comp));
+                                               /* do not duplicate timezones in the component */
+                                               existing_zone = i_cal_component_get_timezone (des_icomp, 
i_cal_timezone_get_tzid (zone));
+                                               if (existing_zone) {
+                                                       g_object_unref (existing_zone);
+                                               } else {
+                                                       ICalComponent *vtz_comp;
+
+                                                       vtz_comp = i_cal_timezone_get_component (zone);
+                                                       if (vtz_comp) {
+                                                               i_cal_component_take_component (des_icomp, 
i_cal_component_new_clone (vtz_comp));
+                                                               g_object_unref (vtz_comp);
+                                                       }
+                                               }
                                        }
                                }
+
+                               g_object_unref (par);
                        }
+
+                       g_object_unref (prop);
                }
        }
 }
@@ -567,8 +591,7 @@ calendar_view_copy_clipboard (ESelectable *selectable)
        ECalendarViewPrivate *priv;
        GList *selected, *l;
        gchar *comp_str;
-       icalcomponent *vcal_comp;
-       icalcomponent *new_icalcomp;
+       ICalComponent *vcal_comp;
        ECalendarViewEvent *event;
        GtkClipboard *clipboard;
 
@@ -598,18 +621,20 @@ calendar_view_copy_clipboard (ESelectable *selectable)
        }
 
        for (l = selected; l != NULL; l = l->next) {
+               ICalComponent *new_icomp;
+
                event = (ECalendarViewEvent *) l->data;
 
                if (!is_comp_data_valid (event))
                        continue;
 
-               new_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
+               new_icomp = i_cal_component_new_clone (event->comp_data->icalcomp);
 
                /* do not remove RECURRENCE-IDs from copied objects */
-               icalcomponent_add_component (vcal_comp, new_icalcomp);
+               i_cal_component_take_component (vcal_comp, new_icomp);
        }
 
-       comp_str = icalcomponent_as_ical_string_r (vcal_comp);
+       comp_str = i_cal_component_as_ical_string_r (vcal_comp);
 
        /* copy the VCALENDAR to the clipboard */
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
@@ -617,7 +642,7 @@ calendar_view_copy_clipboard (ESelectable *selectable)
        gtk_clipboard_store (clipboard);
 
        /* free memory */
-       icalcomponent_free (vcal_comp);
+       g_object_unref (vcal_comp);
        g_free (comp_str);
        g_list_free (selected);
 }
@@ -625,7 +650,7 @@ calendar_view_copy_clipboard (ESelectable *selectable)
 static void
 calendar_view_component_created_cb (ECalModel *model,
                                    ECalClient *client,
-                                   icalcomponent *original_icalcomp,
+                                   ICalComponent *original_icomp,
                                    const gchar *new_uid,
                                    gpointer user_data)
 {
@@ -634,7 +659,7 @@ calendar_view_component_created_cb (ECalModel *model,
        ESourceRegistry *registry;
        GtkWidget *toplevel = user_data;
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (original_icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (original_icomp));
        g_return_if_fail (comp != NULL);
 
        registry = e_cal_model_get_registry (model);
@@ -657,17 +682,18 @@ static void
 e_calendar_view_add_event_sync (ECalModel *model,
                                ECalClient *client,
                                time_t dtstart,
-                               icaltimezone *default_zone,
-                               icalcomponent *icalcomp,
+                               ICalTimezone *default_zone,
+                               ICalComponent *icomp,
                                gboolean all_day,
                                gboolean is_day_view,
                                gint time_division,
                                GtkWidget *top_level)
 {
        ECalComponent *comp;
-       struct icaltimetype itime, old_dtstart, old_dtend;
+       ICalTime *itime, *btime, *old_dtstart, *old_dtend;
+       ICalDuration *ic_dur, *ic_oneday;
+       ICalTimezone *old_dtstart_zone;
        time_t tt_start, tt_end, new_dtstart = 0;
-       struct icaldurationtype ic_dur, ic_oneday;
        gchar *uid;
        gint start_offset, end_offset;
        gboolean all_day_event = FALSE;
@@ -675,30 +701,36 @@ e_calendar_view_add_event_sync (ECalModel *model,
        start_offset = 0;
        end_offset = 0;
 
-       old_dtstart = icalcomponent_get_dtstart (icalcomp);
-       tt_start = icaltime_as_timet (old_dtstart);
-       old_dtend = icalcomponent_get_dtend (icalcomp);
-       tt_end = icaltime_as_timet (old_dtend);
-       ic_dur = icaldurationtype_from_int (tt_end - tt_start);
+       old_dtstart = i_cal_component_get_dtstart (icomp);
+       tt_start = i_cal_time_as_timet (old_dtstart);
+       old_dtend = i_cal_component_get_dtend (icomp);
+       tt_end = i_cal_time_as_timet (old_dtend);
+       ic_dur = i_cal_duration_from_int (tt_end - tt_start);
 
-       if (icaldurationtype_as_int (ic_dur) > 60 *60 *24) {
+       if (i_cal_duration_as_int (ic_dur) > 60 * 60 * 24) {
                /* This is a long event */
-               start_offset = old_dtstart.hour * 60 + old_dtstart.minute;
-               end_offset = old_dtstart.hour * 60 + old_dtend.minute;
+               start_offset = i_cal_time_get_hour (old_dtstart) * 60 + i_cal_time_get_minute (old_dtstart);
+               end_offset = i_cal_time_get_hour (old_dtstart) * 60 + i_cal_time_get_minute (old_dtend);
        }
 
-       ic_oneday = icaldurationtype_null_duration ();
-       ic_oneday.days = 1;
+       ic_oneday = i_cal_duration_null_duration ();
+       i_cal_duration_set_days (ic_oneday, 1);
+
+       old_dtstart_zone = i_cal_time_get_timezone (old_dtstart);
+       if (!old_dtstart_zone)
+               old_dtstart_zone = default_zone;
 
        if (is_day_view) {
                if (start_offset == 0 && end_offset == 0 && all_day)
                        all_day_event = TRUE;
 
                if (all_day_event) {
-                       ic_dur = ic_oneday;
-               } else if (icaldurationtype_as_int (ic_dur) >= 60 *60 *24 && !all_day) {
+                       g_clear_object (&ic_dur);
+                       ic_dur = g_object_ref (ic_oneday);
+               } else if (i_cal_duration_as_int (ic_dur) >= 60 * 60 * 24 && !all_day) {
+                       g_clear_object (&ic_dur);
                        /* copy & paste from top canvas to main canvas */
-                       ic_dur = icaldurationtype_from_int (time_division * 60);
+                       ic_dur = i_cal_duration_from_int (time_division * 60);
                }
 
                if (all_day)
@@ -706,39 +738,46 @@ e_calendar_view_add_event_sync (ECalModel *model,
                else
                        new_dtstart = dtstart;
        } else {
-               if (old_dtstart.is_date && old_dtend.is_date
-                       && memcmp (&ic_dur, &ic_oneday, sizeof (ic_dur)) == 0) {
+               if (i_cal_time_is_date (old_dtstart) && i_cal_time_is_date (old_dtend) &&
+                   i_cal_duration_as_int (ic_dur) == i_cal_duration_as_int (ic_oneday)) {
                        all_day_event = TRUE;
                        new_dtstart = dtstart;
                } else {
-                       icaltimetype new_time = icaltime_from_timet_with_zone (dtstart, FALSE, default_zone);
+                       ICalTime *new_time = i_cal_time_from_timet_with_zone (dtstart, FALSE, default_zone);
+
+                       i_cal_time_set_hour (new_time, i_cal_time_get_hour (old_dtstart));
+                       i_cal_time_set_minute (new_time, i_cal_time_get_minute (old_dtstart));
+                       i_cal_time_set_second (new_time, i_cal_time_get_second (old_dtstart));
 
-                       new_time.hour = old_dtstart.hour;
-                       new_time.minute = old_dtstart.minute;
-                       new_time.second = old_dtstart.second;
+                       new_dtstart = i_cal_time_as_timet_with_zone (new_time, old_dtstart_zone);
 
-                       new_dtstart = icaltime_as_timet_with_zone (new_time, old_dtstart.zone ? 
old_dtstart.zone : default_zone);
+                       g_clear_object (&new_time);
                }
        }
 
-       itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, old_dtstart.zone ? old_dtstart.zone : 
default_zone);
+       itime = i_cal_time_from_timet_with_zone (new_dtstart, FALSE, old_dtstart_zone);
        /* set the timezone properly */
-       itime.zone = old_dtstart.zone ? old_dtstart.zone : default_zone;
+       i_cal_time_set_timezone (itime, old_dtstart_zone);
        if (all_day_event)
-               itime.is_date = TRUE;
-       icalcomponent_set_dtstart (icalcomp, itime);
+               i_cal_time_set_is_date (itime, TRUE);
+       i_cal_component_set_dtstart (icomp, itime);
 
-       itime.is_date = FALSE;
-       itime = icaltime_add (itime, ic_dur);
+       i_cal_time_set_is_date (itime, FALSE);
+       btime = i_cal_time_add (itime, ic_dur);
        if (all_day_event)
-               itime.is_date = TRUE;
-       icalcomponent_set_dtend (icalcomp, itime);
+               i_cal_time_set_is_date (itime, TRUE);
+       i_cal_component_set_dtend (icomp, itime);
+
+       g_clear_object (&itime);
+       g_clear_object (&btime);
+       g_clear_object (&old_dtstart);
+       g_clear_object (&old_dtend);
+       g_clear_object (&ic_dur);
+       g_clear_object (&ic_oneday);
 
        /* The new uid stuff can go away once we actually set it in the backend */
        uid = e_util_generate_uid ();
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (
-               comp, icalcomponent_new_clone (icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (icomp));
        e_cal_component_set_uid (comp, uid);
        g_free (uid);
 
@@ -785,15 +824,14 @@ paste_clipboard_data_free (gpointer ptr)
                                GSList *found = NULL;
 
                                /* Remove them one by one after ensuring it has been copied to the 
destination successfully */
-                               found = g_slist_find_custom (pcd->copied_uids, icalcomponent_get_uid 
(comp_data->icalcomp), (GCompareFunc) strcmp);
+                               found = g_slist_find_custom (pcd->copied_uids, i_cal_component_get_uid 
(comp_data->icalcomp), (GCompareFunc) strcmp);
                                if (!found)
                                        continue;
 
                                g_free (found->data);
                                pcd->copied_uids = g_slist_delete_link (pcd->copied_uids, found);
 
-                               comp = e_cal_component_new ();
-                               e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone 
(comp_data->icalcomp));
+                               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(comp_data->icalcomp));
 
                                if (itip_has_any_attendees (comp) &&
                                    (itip_organizer_is_user (registry, comp, comp_data->client) ||
@@ -802,7 +840,7 @@ paste_clipboard_data_free (gpointer ptr)
                                        itip_send_component_with_model (model, E_CAL_COMPONENT_METHOD_CANCEL,
                                                comp, comp_data->client, NULL, NULL, NULL, TRUE, FALSE, TRUE);
 
-                               e_cal_component_get_uid (comp, &uid);
+                               uid = e_cal_component_get_uid (comp);
                                if (e_cal_component_is_instance (comp)) {
                                        gchar *rid = NULL;
 
@@ -842,9 +880,9 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
                                 GError **error)
 {
        PasteClipboardData *pcd = user_data;
-       icalcomponent *icalcomp;
-       icalcomponent_kind kind;
-       icaltimezone *default_zone;
+       ICalComponent *icomp;
+       ICalComponentKind kind;
+       ICalTimezone *default_zone;
        ECalModel *model;
        ESourceRegistry *registry;
        ESource *source = NULL, *default_source = NULL;
@@ -860,8 +898,8 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
 
        g_return_if_fail (pcd != NULL);
 
-       icalcomp = icalparser_parse_string (pcd->ical_str);
-       if (!icalcomp) {
+       icomp = i_cal_parser_parse_string (pcd->ical_str);
+       if (!icomp) {
                g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
                        _("Pasted text doesn’t contain valid iCalendar data"));
                return;
@@ -871,17 +909,17 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
        registry = e_cal_model_get_registry (model);
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        default_source = e_source_registry_ref_default_calendar (registry);
                        extension_name = E_SOURCE_EXTENSION_CALENDAR;
                        message = _("Default calendar not found");
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        default_source = e_source_registry_ref_default_memo_list (registry);
                        extension_name = E_SOURCE_EXTENSION_MEMO_LIST;
                        message = _("Default memo list not found");
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        default_source = e_source_registry_ref_default_task_list (registry);
                        extension_name = E_SOURCE_EXTENSION_TASK_LIST;
                        message = _("Default task list not found");
@@ -918,38 +956,41 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
        }
 
        client = E_CAL_CLIENT (e_client);
-       kind = icalcomponent_isa (icalcomp);
+       kind = i_cal_component_isa (icomp);
        default_zone = e_cal_model_get_timezone (model);
        all_day = pcd->selection_end - pcd->selection_start == 60 * 60 * 24;
        copied_components = 0;
 
-       if (kind == ICAL_VCALENDAR_COMPONENT) {
-               icalcomponent *subcomp;
+       if (kind == I_CAL_VCALENDAR_COMPONENT) {
+               ICalComponent *subcomp;
 
                /* add timezones first, to have them ready */
-               for (subcomp = icalcomponent_get_first_component (icalcomp, ICAL_VTIMEZONE_COMPONENT);
+               for (subcomp = i_cal_component_get_first_component (icomp, I_CAL_VTIMEZONE_COMPONENT);
                     subcomp;
-                    subcomp = icalcomponent_get_next_component (icalcomp, ICAL_VTIMEZONE_COMPONENT)) {
-                       icaltimezone *zone;
+                    g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (icomp, 
I_CAL_VTIMEZONE_COMPONENT)) {
+                       ICalTimezone *zone;
 
-                       zone = icaltimezone_new ();
-                       icaltimezone_set_component (zone, subcomp);
+                       zone = i_cal_timezone_new ();
+                       i_cal_timezone_set_component (zone, i_cal_component_new_clone (subcomp));
 
                        if (!e_cal_client_add_timezone_sync (client, zone, cancellable, error)) {
-                               icaltimezone_free (zone, 1);
+                               g_object_unref (subcomp);
+                               g_object_unref (zone);
                                goto out;
                        }
 
-                       icaltimezone_free (zone, 1);
+                       g_object_unref (zone);
                }
 
-               for (subcomp = icalcomponent_get_first_component (icalcomp, ICAL_VEVENT_COMPONENT);
+               for (subcomp = i_cal_component_get_first_component (icomp, I_CAL_VEVENT_COMPONENT);
                     subcomp;
-                    subcomp = icalcomponent_get_next_component (icalcomp, ICAL_VEVENT_COMPONENT)) {
+                    g_object_unref (subcomp), subcomp = i_cal_component_get_next_component (icomp, 
I_CAL_VEVENT_COMPONENT)) {
                        if (e_cal_util_component_has_recurrences (subcomp)) {
-                               icalproperty *icalprop = icalcomponent_get_first_property (subcomp, 
ICAL_RRULE_PROPERTY);
-                               if (icalprop)
-                                       icalproperty_remove_parameter_by_name (icalprop, 
"X-EVOLUTION-ENDDATE");
+                               ICalProperty *prop = i_cal_component_get_first_property (subcomp, 
I_CAL_RRULE_PROPERTY);
+                               if (prop) {
+                                       i_cal_property_remove_parameter_by_name (prop, "X-EVOLUTION-ENDDATE");
+                                       g_object_unref (prop);
+                               }
                        }
 
                        e_calendar_view_add_event_sync (model, client, pcd->selection_start, default_zone, 
subcomp, all_day,
@@ -957,15 +998,15 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
 
                        copied_components++;
                        if (pcd->selected_cut_list)
-                               pcd->copied_uids = g_slist_prepend (pcd->copied_uids, g_strdup 
(icalcomponent_get_uid (subcomp)));
+                               pcd->copied_uids = g_slist_prepend (pcd->copied_uids, g_strdup 
(i_cal_component_get_uid (subcomp)));
                }
        } else if (kind == e_cal_model_get_component_kind (model)) {
-               e_calendar_view_add_event_sync (model, client, pcd->selection_start, default_zone, icalcomp, 
all_day,
+               e_calendar_view_add_event_sync (model, client, pcd->selection_start, default_zone, icomp, 
all_day,
                        pcd->is_day_view, pcd->time_division, pcd->top_level);
 
                copied_components++;
                if (pcd->selected_cut_list)
-                       pcd->copied_uids = g_slist_prepend (pcd->copied_uids, g_strdup (icalcomponent_get_uid 
(icalcomp)));
+                       pcd->copied_uids = g_slist_prepend (pcd->copied_uids, g_strdup 
(i_cal_component_get_uid (icomp)));
        }
 
        pcd->success = !g_cancellable_is_cancelled (cancellable);
@@ -975,7 +1016,7 @@ cal_view_paste_clipboard_thread (EAlertSinkThreadJobData *job_data,
        if (!copied_components && !g_cancellable_is_cancelled (cancellable) && error && !*error)
                g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, _("No suitable component 
found"));
 
-       icalcomponent_free (icalcomp);
+       g_clear_object (&icomp);
        g_clear_object (&source);
        g_clear_object (&default_source);
        g_clear_object (&client);
@@ -1191,10 +1232,10 @@ e_calendar_view_class_init (ECalendarViewClass *class)
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET (ECalendarViewClass, timezone_changed),
                NULL, NULL,
-               e_marshal_VOID__POINTER_POINTER,
+               e_marshal_VOID__OBJECT_OBJECT,
                G_TYPE_NONE, 2,
-               G_TYPE_POINTER,
-               G_TYPE_POINTER);
+               I_CAL_TYPE_TIMEZONE,
+               I_CAL_TYPE_TIMEZONE);
 
        signals[EVENT_CHANGED] = g_signal_new (
                "event-changed",
@@ -1293,18 +1334,19 @@ e_calendar_view_get_model (ECalendarView *cal_view)
        return cal_view->priv->model;
 }
 
-icaltimezone *
+ICalTimezone *
 e_calendar_view_get_timezone (ECalendarView *cal_view)
 {
        g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
+
        return e_cal_model_get_timezone (cal_view->priv->model);
 }
 
 void
 e_calendar_view_set_timezone (ECalendarView *cal_view,
-                              icaltimezone *zone)
+                             const ICalTimezone *zone)
 {
-       icaltimezone *old_zone;
+       ICalTimezone *old_zone;
 
        g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
 
@@ -1312,10 +1354,15 @@ e_calendar_view_set_timezone (ECalendarView *cal_view,
        if (old_zone == zone)
                return;
 
+       if (old_zone)
+               g_object_ref (old_zone);
+
        e_cal_model_set_timezone (cal_view->priv->model, zone);
        g_signal_emit (
                cal_view, signals[TIMEZONE_CHANGED], 0,
                old_zone, zone);
+
+       g_clear_object (&old_zone);
 }
 
 GtkTargetList *
@@ -1570,9 +1617,9 @@ object_created_cb (ECompEditor *comp_editor,
 
 ECompEditor *
 e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
-                                       ECalClient *client,
-                                       icalcomponent *icalcomp,
-                                       guint32 flags)
+                                      ECalClient *client,
+                                      ICalComponent *icomp,
+                                      guint32 flags)
 {
        ECompEditor *comp_editor;
        EShell *shell;
@@ -1580,7 +1627,7 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
        /* FIXME ECalendarView should own an EShell pointer. */
        shell = e_shell_get_default ();
 
-       comp_editor = e_comp_editor_find_existing_for (e_client_get_source (E_CLIENT (client)), icalcomp);
+       comp_editor = e_comp_editor_find_existing_for (e_client_get_source (E_CLIENT (client)), icomp);
        if (!comp_editor) {
                GtkWidget *toplevel;
 
@@ -1589,7 +1636,7 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
                        toplevel = NULL;
 
                comp_editor = e_comp_editor_open_for_component (GTK_WINDOW (toplevel),
-                       shell, e_client_get_source (E_CLIENT (client)), icalcomp, flags);
+                       shell, e_client_get_source (E_CLIENT (client)), icomp, flags);
 
                g_signal_connect (
                        comp_editor, "object-created",
@@ -1605,7 +1652,7 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
  * e_calendar_view_edit_appointment
  * @cal_view: A calendar view.
  * @client: Calendar client.
- * @icalcomp: The object to be edited.
+ * @icomp: The object to be edited.
  * @mode: one of #EEditEventMode
  *
  * Opens an editor window to allow the user to edit the selected
@@ -1613,9 +1660,9 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
  */
 void
 e_calendar_view_edit_appointment (ECalendarView *cal_view,
-                                  ECalClient *client,
-                                  icalcomponent *icalcomp,
-                                  EEditEventMode mode)
+                                 ECalClient *client,
+                                 ICalComponent *icomp,
+                                 EEditEventMode mode)
 {
        ECalModel *model;
        ESourceRegistry *registry;
@@ -1623,15 +1670,14 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view,
 
        g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
        g_return_if_fail (E_IS_CAL_CLIENT (client));
-       g_return_if_fail (icalcomp != NULL);
+       g_return_if_fail (icomp != NULL);
 
        model = e_calendar_view_get_model (cal_view);
        registry = e_cal_model_get_registry (model);
 
-       if ((mode == EDIT_EVENT_AUTODETECT && icalcomponent_get_first_property (icalcomp, 
ICAL_ATTENDEE_PROPERTY) != NULL)
+       if ((mode == EDIT_EVENT_AUTODETECT && e_cal_util_component_has_attendee (icomp))
            || mode == EDIT_EVENT_FORCE_MEETING) {
-               ECalComponent *comp = e_cal_component_new ();
-               e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
+               ECalComponent *comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(icomp));
                flags |= E_COMP_EDITOR_FLAG_WITH_ATTENDEES;
                if (itip_organizer_is_user (registry, comp, client) ||
                    itip_sentby_is_user (registry, comp, client) ||
@@ -1640,7 +1686,7 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view,
                g_object_unref (comp);
        }
 
-       e_calendar_view_open_event_with_flags (cal_view, client, icalcomp, flags);
+       e_calendar_view_open_event_with_flags (cal_view, client, icomp, flags);
 }
 
 static void
@@ -1676,15 +1722,15 @@ tooltip_key_event (GtkWidget *tooltip,
 }
 
 static gchar *
-get_label (struct icaltimetype *tt,
-           icaltimezone *f_zone,
-           icaltimezone *t_zone)
+get_label (ICalTime *tt,
+          ICalTimezone *f_zone,
+          ICalTimezone *t_zone)
 {
        struct tm tmp_tm;
 
-       tmp_tm = icaltimetype_to_tm_with_zone (tt, f_zone, t_zone);
+       tmp_tm = e_cal_util_icaltime_to_tm_with_zone (tt, f_zone, t_zone);
 
-       return e_datetime_format_format_tm ("calendar", "table", tt->is_date ? DTFormatKindDate : 
DTFormatKindDateTime, &tmp_tm);
+       return e_datetime_format_format_tm ("calendar", "table", i_cal_time_is_date (tt) ? DTFormatKindDate : 
DTFormatKindDateTime, &tmp_tm);
 }
 
 void
@@ -1758,11 +1804,9 @@ gboolean
 e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
 {
        GtkWidget *label, *box, *hbox, *ebox, *frame, *toplevel;
-       const gchar *str;
        gchar *tmp, *tmp1 = NULL, *tmp2 = NULL;
-       ECalComponentOrganizer organiser;
-       ECalComponentDateTime dtstart, dtend;
-       icalcomponent *clone_comp;
+       ECalComponentOrganizer *organizer;
+       ECalComponentDateTime *dtstart, *dtend;
        time_t t_start, t_end;
        ECalendarViewEvent *pevent;
        GtkWidget *widget;
@@ -1771,12 +1815,11 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
        GdkDeviceManager *device_manager;
        GdkRGBA bg_rgba, fg_rgba;
        GQueue *grabbed_keyboards;
-       ECalComponent *newcomp = e_cal_component_new ();
-       icaltimezone *zone, *default_zone;
+       ECalComponent *newcomp;
+       ICalTimezone *zone, *default_zone;
        ECalModel *model;
        ECalClient *client = NULL;
        GList *list, *link;
-       gboolean free_text = FALSE;
 
        /* This function is a timeout callback. */
 
@@ -1794,7 +1837,7 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
        if (GTK_IS_WIDGET (widget))
                gtk_widget_destroy (widget);
 
-       default_zone = e_calendar_view_get_timezone  (data->cal_view);
+       default_zone = e_calendar_view_get_timezone (data->cal_view);
        pevent = data->get_view_event (data->cal_view, data->day, data->event_num);
 
        if (!is_comp_data_valid (pevent))
@@ -1802,30 +1845,31 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
 
        client = pevent->comp_data->client;
 
-       clone_comp = icalcomponent_new_clone (pevent->comp_data->icalcomp);
-       if (!e_cal_component_set_icalcomponent (newcomp, clone_comp))
+       newcomp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(pevent->comp_data->icalcomp));
+       if (!newcomp) {
                g_warning ("couldn't update calendar component with modified data from backend\n");
+               return FALSE;
+       }
 
        box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
-       str = e_calendar_view_get_icalcomponent_summary (pevent->comp_data->client, 
pevent->comp_data->icalcomp, &free_text);
+       tmp1 = e_calendar_view_dup_component_summary (pevent->comp_data->icalcomp);
 
-       if (!(str && *str)) {
+       if (!(tmp1 && *tmp1)) {
                g_object_unref (newcomp);
                gtk_widget_destroy (box);
+               g_free (tmp1);
 
                return FALSE;
        }
 
-       tmp = g_markup_printf_escaped ("<b>%s</b>", str);
+       tmp = g_markup_printf_escaped ("<b>%s</b>", tmp1);
        label = gtk_label_new (NULL);
        gtk_label_set_line_wrap ((GtkLabel *) label, TRUE);
        gtk_label_set_markup ((GtkLabel *) label, tmp);
 
-       if (free_text) {
-               g_free ((gchar *) str);
-               str = NULL;
-       }
+       g_free (tmp1);
+       tmp1 = NULL;
 
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_pack_start ((GtkBox *) hbox, label, FALSE, FALSE, 0);
@@ -1837,19 +1881,19 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
        gtk_box_pack_start ((GtkBox *) box, ebox, FALSE, FALSE, 0);
        g_free (tmp);
 
-       e_cal_component_get_organizer (newcomp, &organiser);
-       if (organiser.cn) {
-               gchar *ptr;
-               ptr = strchr (organiser.value, ':');
+       organizer = e_cal_component_get_organizer (newcomp);
+       if (organizer && e_cal_component_organizer_get_cn (organizer)) {
+               const gchar *email;
 
-               if (ptr) {
-                       ptr++;
+               email = itip_strip_mailto (e_cal_component_organizer_get_value (organizer));
+
+               if (email) {
                        /* To Translators: It will display "Organiser: NameOfTheUser <email ofuser com>" */
-                       tmp = g_strdup_printf (_("Organizer: %s <%s>"), organiser.cn, ptr);
-               }
-               else
+                       tmp = g_strdup_printf (_("Organizer: %s <%s>"), e_cal_component_organizer_get_cn 
(organizer), email);
+               } else {
                        /* With SunOne accouts, there may be no ':' in organiser.value*/
-                       tmp = g_strdup_printf (_("Organizer: %s"), organiser.cn);
+                       tmp = g_strdup_printf (_("Organizer: %s"), e_cal_component_organizer_get_cn 
(organizer));
+               }
 
                label = gtk_label_new (tmp);
                hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -1861,11 +1905,13 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
                g_free (tmp);
        }
 
-       e_cal_component_get_location (newcomp, &str);
+       e_cal_component_organizer_free (organizer);
+
+       tmp1 = e_cal_component_get_location (newcomp);
 
-       if (str) {
+       if (tmp1) {
                /* Translators: It will display "Location: PlaceOfTheMeeting" */
-               tmp = g_markup_printf_escaped (_("Location: %s"), str);
+               tmp = g_markup_printf_escaped (_("Location: %s"), tmp1);
                label = gtk_label_new (NULL);
                gtk_widget_set_halign (label, GTK_ALIGN_START);
                gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.0);
@@ -1879,13 +1925,18 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
                gtk_box_pack_start ((GtkBox *) box, ebox, FALSE, FALSE, 0);
                g_free (tmp);
        }
-       e_cal_component_get_dtstart (newcomp, &dtstart);
-       e_cal_component_get_dtend (newcomp, &dtend);
 
-       if (dtstart.tzid) {
-               zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (newcomp), dtstart.tzid);
-               if (!zone)
-                       e_cal_client_get_timezone_sync (client, dtstart.tzid, &zone, NULL, NULL);
+       g_free (tmp1);
+       tmp1 = NULL;
+
+       dtstart = e_cal_component_get_dtstart (newcomp);
+       dtend = e_cal_component_get_dtend (newcomp);
+
+       if (dtstart && e_cal_component_datetime_get_tzid (dtstart)) {
+               zone = i_cal_component_get_timezone (e_cal_component_get_icalcomponent (newcomp), 
e_cal_component_datetime_get_tzid (dtstart));
+               if (!zone &&
+                   !e_cal_client_get_timezone_sync (client, e_cal_component_datetime_get_tzid (dtstart), 
&zone, NULL, NULL))
+                       zone = NULL;
 
                if (!zone)
                        zone = default_zone;
@@ -1894,14 +1945,14 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
                zone = NULL;
        }
 
-       if (dtstart.value) {
-               t_start = icaltime_as_timet_with_zone (*dtstart.value, zone);
-               if (dtend.value)
-                       t_end = icaltime_as_timet_with_zone (*dtend.value, zone);
+       if (dtstart && e_cal_component_datetime_get_value (dtstart)) {
+               t_start = i_cal_time_as_timet_with_zone (e_cal_component_datetime_get_value (dtstart), zone);
+               if (dtend && e_cal_component_datetime_get_value (dtend))
+                       t_end = i_cal_time_as_timet_with_zone (e_cal_component_datetime_get_value (dtend), 
zone);
                else
                        t_end = t_start;
 
-               tmp1 = get_label (dtstart.value, zone, default_zone);
+               tmp1 = get_label (e_cal_component_datetime_get_value (dtstart), zone, default_zone);
                tmp = calculate_time (t_start, t_end);
 
                /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/
@@ -1910,8 +1961,8 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
                        g_free (tmp);
                        g_free (tmp1);
 
-                       tmp1 = get_label (dtstart.value, zone, zone);
-                       tmp = g_strconcat (tmp2, "\n\t[ ", tmp1, " ", icaltimezone_get_display_name (zone), " 
]", NULL);
+                       tmp1 = get_label (e_cal_component_datetime_get_value (dtstart), zone, zone);
+                       tmp = g_strconcat (tmp2, "\n\t[ ", tmp1, " ", i_cal_timezone_get_display_name (zone), 
" ]", NULL);
                } else {
                        g_free (tmp);
                        tmp = tmp2;
@@ -1921,8 +1972,8 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
                tmp = NULL;
        }
 
-       e_cal_component_free_datetime (&dtstart);
-       e_cal_component_free_datetime (&dtend);
+       e_cal_component_datetime_free (dtstart);
+       e_cal_component_datetime_free (dtend);
 
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_pack_start ((GtkBox *) hbox, gtk_label_new_with_mnemonic (tmp), FALSE, FALSE, 0);
@@ -2028,85 +2079,79 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
 }
 
 static gboolean
-icalcomp_contains_category (icalcomponent *icalcomp,
-                            const gchar *category)
+icomp_contains_category (ICalComponent *icomp,
+                        const gchar *category)
 {
-       icalproperty *property;
+       ICalProperty *prop;
 
-       g_return_val_if_fail (icalcomp != NULL && category != NULL, FALSE);
+       g_return_val_if_fail (icomp != NULL && category != NULL, FALSE);
 
-       for (property = icalcomponent_get_first_property (icalcomp, ICAL_CATEGORIES_PROPERTY);
-            property != NULL;
-            property = icalcomponent_get_next_property (icalcomp, ICAL_CATEGORIES_PROPERTY)) {
-               gchar *value = icalproperty_get_value_as_string_r (property);
+       for (prop = i_cal_component_get_first_property (icomp, I_CAL_CATEGORIES_PROPERTY);
+            prop;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (icomp, 
I_CAL_CATEGORIES_PROPERTY)) {
+               const gchar *value = i_cal_property_get_categories (prop);
 
-               if (value && strcmp (category, value) == 0) {
-                       g_free (value);
+               if (g_strcmp0 (category, value) == 0) {
+                       g_object_unref (prop);
                        return TRUE;
                }
-               g_free (value);
        }
 
        return FALSE;
 }
 
-/* e_calendar_view_get_icalcomponent_summary returns summary of calcomp,
- * and for type of birthday or anniversary it append number of years since
- * beginning. In this case, the free_text is set to TRUE and caller need
- * to g_free returned string, otherwise free_text is set to FALSE and
- * returned value is owned by calcomp.
+/* e_calendar_view_dup_component_summary returns summary of icomp,
+ * and for type of birthday or anniversary it appends number of years since
+ * beginning. Free the returned string with g_free(), when no longer needed.
  */
-
-const gchar *
-e_calendar_view_get_icalcomponent_summary (ECalClient *client,
-                                           icalcomponent *icalcomp,
-                                           gboolean *free_text)
+gchar *
+e_calendar_view_dup_component_summary (ICalComponent *icomp)
 {
        const gchar *summary;
 
-       g_return_val_if_fail (icalcomp != NULL && free_text != NULL, NULL);
-
-       *free_text = FALSE;
-       summary = icalcomponent_get_summary (icalcomp);
+       g_return_val_if_fail (icomp != NULL, NULL);
 
-       if (icalcomp_contains_category (icalcomp, _("Birthday")) ||
-           icalcomp_contains_category (icalcomp, _("Anniversary"))) {
-               icalproperty *xprop;
+       summary = i_cal_component_get_summary (icomp);
 
-               for (xprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
-                    xprop;
-                    xprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) {
-                       const gchar *xname = icalproperty_get_x_name (xprop);
+       if (icomp_contains_category (icomp, _("Birthday")) ||
+           icomp_contains_category (icomp, _("Anniversary"))) {
+               gchar *since_year_str;
 
-                       if (xname && g_ascii_strcasecmp (xname, "X-EVOLUTION-SINCE-YEAR") == 0) {
-                               struct icaltimetype dtnow;
-                               gint since_year;
-                               gchar *str;
+               since_year_str = e_cal_util_component_dup_x_property (icomp, "X-EVOLUTION-SINCE-YEAR");
 
-                               str = icalproperty_get_value_as_string_r (xprop);
-                               since_year = str ? atoi (str) : 0;
-                               g_free (str);
+               if (since_year_str) {
+                       ICalTime *dtstart;
+                       gint since_year;
+                       gchar *res = NULL;
 
-                               dtnow = icalcomponent_get_dtstart (icalcomp);
+                       since_year = atoi (since_year_str);
 
-                               if (since_year > 0 && dtnow.year - since_year > 0) {
-                                       summary = g_strdup_printf ("%s (%d)", summary ? summary : "", 
dtnow.year - since_year);
-                                       *free_text = summary != NULL;
-                               }
+                       dtstart = i_cal_component_get_dtstart (icomp);
 
-                               break;
+                       if (since_year > 0 && dtstart && i_cal_time_is_valid_time (dtstart) &&
+                           i_cal_time_get_year (dtstart) - since_year > 0) {
+                               /* Translators: the '%s' stands for a component summary, the '%d' for the 
years.
+                                  The string is used for Birthday & Anniversary events where the first year 
is
+                                  know, constructing a summary which also shows how many years the birthday 
or
+                                  anniversary is for. Example: "Birthday: John Doe (13)" */
+                               summary = g_strdup_printf (C_("BirthdaySummary", "%s (%d)"), summary ? 
summary : "", i_cal_time_get_year (dtstart) - since_year);
                        }
+
+                       g_clear_object (&dtstart);
+                       g_free (since_year_str);
+
+                       return res ? res : g_strdup (summary);
                }
        }
 
-       return summary;
+       return g_strdup (summary);
 }
 
 /* A callback for e_cal_ops_create_component(), whose @user_data is an ECalendarView instance */
 void
 e_calendar_view_component_created_cb (ECalModel *model,
                                      ECalClient *client,
-                                     icalcomponent *original_icalcomp,
+                                     ICalComponent *original_icomp,
                                      const gchar *new_uid,
                                      gpointer user_data)
 {
@@ -2117,7 +2162,6 @@ e_calendar_view_component_created_cb (ECalModel *model,
        e_cal_model_emit_object_created (model, client);
 }
 
-
 void
 draw_curved_rectangle (cairo_t *cr,
                        gdouble x0,
@@ -2263,8 +2307,8 @@ e_calendar_view_get_description_text (ECalendarView *cal_view)
 {
        time_t start_time, end_time;
        struct tm start_tm, end_tm;
-       struct icaltimetype start_tt, end_tt;
-       icaltimezone *zone;
+       ICalTime *tt;
+       ICalTimezone *zone;
        gchar start_buffer[512] = { 0 };
        gchar end_buffer[512] = { 0 };
 
@@ -2275,26 +2319,14 @@ e_calendar_view_get_description_text (ECalendarView *cal_view)
 
        zone = e_cal_model_get_timezone (cal_view->priv->model);
 
-       start_tt = icaltime_from_timet_with_zone (start_time, FALSE, zone);
-       start_tm.tm_year = start_tt.year - 1900;
-       start_tm.tm_mon = start_tt.month - 1;
-       start_tm.tm_mday = start_tt.day;
-       start_tm.tm_hour = start_tt.hour;
-       start_tm.tm_min = start_tt.minute;
-       start_tm.tm_sec = start_tt.second;
-       start_tm.tm_isdst = -1;
-       start_tm.tm_wday = time_day_of_week (start_tt.day, start_tt.month - 1, start_tt.year);
+       tt = i_cal_time_from_timet_with_zone (start_time, FALSE, zone);
+       start_tm = e_cal_util_icaltime_to_tm (tt);
+       g_clear_object (&tt);
 
        /* Subtract one from end_time so we don't get an extra day. */
-       end_tt = icaltime_from_timet_with_zone (end_time - 1, FALSE, zone);
-       end_tm.tm_year = end_tt.year - 1900;
-       end_tm.tm_mon = end_tt.month - 1;
-       end_tm.tm_mday = end_tt.day;
-       end_tm.tm_hour = end_tt.hour;
-       end_tm.tm_min = end_tt.minute;
-       end_tm.tm_sec = end_tt.second;
-       end_tm.tm_isdst = -1;
-       end_tm.tm_wday = time_day_of_week (end_tt.day, end_tt.month - 1, end_tt.year);
+       tt = i_cal_time_from_timet_with_zone (end_time - 1, FALSE, zone);
+       end_tm = e_cal_util_icaltime_to_tm (tt);
+       g_clear_object (&tt);
 
        if (E_IS_MONTH_VIEW (cal_view) || E_IS_CAL_LIST_VIEW (cal_view)) {
                if (start_tm.tm_year == end_tm.tm_year) {
diff --git a/src/calendar/gui/e-calendar-view.h b/src/calendar/gui/e-calendar-view.h
index a5fa67c7f8..df8a993e3c 100644
--- a/src/calendar/gui/e-calendar-view.h
+++ b/src/calendar/gui/e-calendar-view.h
@@ -150,8 +150,8 @@ struct _ECalendarViewClass {
        void            (*selection_changed)    (ECalendarView *cal_view);
        void            (*selected_time_changed)(ECalendarView *cal_view);
        void            (*timezone_changed)     (ECalendarView *cal_view,
-                                                icaltimezone *old_zone,
-                                                icaltimezone *new_zone);
+                                                ICalTimezone *old_zone,
+                                                ICalTimezone *new_zone);
        void            (*event_changed)        (ECalendarView *day_view,
                                                 ECalendarViewEvent *event);
        void            (*event_added)          (ECalendarView *day_view,
@@ -187,9 +187,9 @@ struct _ECalendarViewClass {
 
 GType          e_calendar_view_get_type        (void);
 ECalModel *    e_calendar_view_get_model       (ECalendarView *cal_view);
-icaltimezone * e_calendar_view_get_timezone    (ECalendarView *cal_view);
+ICalTimezone * e_calendar_view_get_timezone    (ECalendarView *cal_view);
 void           e_calendar_view_set_timezone    (ECalendarView *cal_view,
-                                                icaltimezone *zone);
+                                                const ICalTimezone *zone);
 gint           e_calendar_view_get_time_divisions
                                                (ECalendarView *cal_view);
 void           e_calendar_view_set_time_divisions
@@ -227,7 +227,7 @@ void                e_calendar_view_delete_selected_occurrence
 ECompEditor *  e_calendar_view_open_event_with_flags
                                                (ECalendarView *cal_view,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 guint32 flags);
 
 void           e_calendar_view_popup_event     (ECalendarView *cal_view,
@@ -236,15 +236,15 @@ void              e_calendar_view_popup_event     (ECalendarView *cal_view,
 void           e_calendar_view_add_event       (ECalendarView *cal_view,
                                                 ECalClient *client,
                                                 time_t dtstart,
-                                                icaltimezone *default_zone,
-                                                icalcomponent *icalcomp,
+                                                ICalTimezone *default_zone,
+                                                ICalComponent *icomp,
                                                 gboolean in_top_canvas);
 void           e_calendar_view_new_appointment (ECalendarView *cal_view,
                                                 guint32 flags); /* bit-or of ENewAppointmentFlags */
 void           e_calendar_view_edit_appointment
                                                (ECalendarView *cal_view,
                                                 ECalClient *client,
-                                                icalcomponent *icalcomp,
+                                                ICalComponent *icomp,
                                                 EEditEventMode mode);
 void           e_calendar_view_open_event      (ECalendarView *cal_view);
 gchar *                e_calendar_view_get_description_text
@@ -258,15 +258,13 @@ void              e_calendar_view_move_tip        (GtkWidget *widget,
                                                 gint x,
                                                 gint y);
 
-const gchar *  e_calendar_view_get_icalcomponent_summary
-                                               (ECalClient *ecal,
-                                                icalcomponent *icalcomp,
-                                                gboolean *free_text);
+gchar *                e_calendar_view_dup_component_summary
+                                               (ICalComponent *icomp);
 
 void           e_calendar_view_component_created_cb
                                                (ECalModel *model,
                                                 ECalClient *client,
-                                                icalcomponent *original_icalcomp,
+                                                ICalComponent *original_icomp,
                                                 const gchar *new_uid,
                                                 gpointer user_data);
 
diff --git a/src/calendar/gui/e-cell-date-edit-text.c b/src/calendar/gui/e-cell-date-edit-text.c
index 2c7043425c..d4aac12a16 100644
--- a/src/calendar/gui/e-cell-date-edit-text.c
+++ b/src/calendar/gui/e-cell-date-edit-text.c
@@ -38,7 +38,7 @@
 struct _ECellDateEditTextPrivate {
 
        /* The timezone to display the date in. */
-       icaltimezone *timezone;
+       ICalTimezone *timezone;
 
        /* Whether to display in 24-hour format. */
        gboolean use_24_hour_format;
@@ -65,7 +65,7 @@ cell_date_edit_text_set_property (GObject *object,
                case PROP_TIMEZONE:
                        e_cell_date_edit_text_set_timezone (
                                E_CELL_DATE_EDIT_TEXT (object),
-                               g_value_get_pointer (value));
+                               g_value_get_object (value));
                        return;
 
                case PROP_USE_24_HOUR_FORMAT:
@@ -86,7 +86,7 @@ cell_date_edit_text_get_property (GObject *object,
 {
        switch (property_id) {
                case PROP_TIMEZONE:
-                       g_value_set_pointer (
+                       g_value_set_object (
                                value,
                                e_cell_date_edit_text_get_timezone (
                                E_CELL_DATE_EDIT_TEXT (object)));
@@ -103,6 +103,17 @@ cell_date_edit_text_get_property (GObject *object,
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 }
 
+static void
+cell_date_edit_text_finalize (GObject *object)
+{
+       ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (object);
+
+       g_clear_object (&ecd->priv->timezone);
+
+       /* Chain up to parent's method. */
+       G_OBJECT_CLASS (e_cell_date_edit_text_parent_class)->finalize (object);
+}
+
 static gchar *
 cell_date_edit_text_get_text (ECellText *cell,
                               ETableModel *model,
@@ -111,7 +122,8 @@ cell_date_edit_text_get_text (ECellText *cell,
 {
        ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell);
        ECellDateEditValue *dv = e_table_model_value_at (model, col, row);
-       icaltimezone *timezone;
+       ICalTimezone *timezone;
+       ICalTime *tt;
        struct tm tmp_tm;
        gchar *res;
 
@@ -120,14 +132,16 @@ cell_date_edit_text_get_text (ECellText *cell,
 
        timezone = e_cell_date_edit_text_get_timezone (ecd);
 
+       tt = e_cell_date_edit_value_get_time (dv);
+
        /* Note that although the property may be in a different
         * timezone, we convert it to the current timezone to display
         * it in the table. If the user actually edits the value,
         * it will be set to the current timezone. See set_value (). */
-       tmp_tm = icaltimetype_to_tm_with_zone (&dv->tt, dv->zone, timezone);
+       tmp_tm = e_cal_util_icaltime_to_tm_with_zone (tt, e_cell_date_edit_value_get_zone (dv), timezone);
 
        res = e_datetime_format_format_tm (
-               "calendar", "table", dv->tt.is_date ?
+               "calendar", "table", i_cal_time_is_date (tt) ?
                DTFormatKindDate : DTFormatKindDateTime, &tmp_tm);
 
        e_table_model_free_value (model, col, dv);
@@ -187,7 +201,7 @@ cell_date_edit_text_set_value (ECellText *cell,
        ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell);
        ETimeParseStatus status;
        struct tm tmp_tm;
-       ECellDateEditValue dv;
+       ECellDateEditValue *dv = NULL;
        ECellDateEditValue *value;
        gboolean is_date = TRUE;
 
@@ -207,28 +221,26 @@ cell_date_edit_text_set_value (ECellText *cell,
        if (status == E_TIME_PARSE_NONE) {
                value = NULL;
        } else {
-               dv.tt = icaltime_null_time ();
-
-               dv.tt.year = tmp_tm.tm_year + 1900;
-               dv.tt.month = tmp_tm.tm_mon + 1;
-               dv.tt.day = tmp_tm.tm_mday;
-               dv.tt.hour = tmp_tm.tm_hour;
-               dv.tt.minute = tmp_tm.tm_min;
-               dv.tt.second = tmp_tm.tm_sec;
-               dv.tt.is_date = is_date;
-
-               /* FIXME: We assume it is being set to the current timezone.
-                * Is that OK? */
+               ICalTime *tt;
+               ICalTimezone *zone;
+
+               tt = e_cal_util_tm_to_icaltime (&tmp_tm, is_date);
+
                if (is_date) {
-                       dv.zone = NULL;
+                       zone = NULL;
                } else {
-                       dv.zone = e_cell_date_edit_text_get_timezone (ecd);
+                       zone = e_cell_date_edit_text_get_timezone (ecd);
                }
 
-               value = &dv;
+               dv = e_cell_date_edit_value_new (tt, zone);
+               value = dv;
+
+               g_clear_object (&tt);
        }
 
        e_table_model_set_value_at (model, col, row, value);
+
+       e_cell_date_edit_value_free (dv);
 }
 
 static void
@@ -242,6 +254,7 @@ e_cell_date_edit_text_class_init (ECellDateEditTextClass *class)
        object_class = G_OBJECT_CLASS (class);
        object_class->set_property = cell_date_edit_text_set_property;
        object_class->get_property = cell_date_edit_text_get_property;
+       object_class->finalize = cell_date_edit_text_finalize;
 
        cell_text_class = E_CELL_TEXT_CLASS (class);
        cell_text_class->get_text = cell_date_edit_text_get_text;
@@ -251,10 +264,11 @@ e_cell_date_edit_text_class_init (ECellDateEditTextClass *class)
        g_object_class_install_property (
                object_class,
                PROP_TIMEZONE,
-               g_param_spec_pointer (
+               g_param_spec_object (
                        "timezone",
                        "Time Zone",
                        NULL,
+                       I_CAL_TYPE_TIMEZONE,
                        G_PARAM_READWRITE));
 
        g_object_class_install_property (
@@ -273,7 +287,7 @@ e_cell_date_edit_text_init (ECellDateEditText *ecd)
 {
        ecd->priv = E_CELL_DATE_EDIT_TEXT_GET_PRIVATE (ecd);
 
-       ecd->priv->timezone = icaltimezone_get_utc_timezone ();
+       ecd->priv->timezone = e_cal_util_copy_timezone (i_cal_timezone_get_utc_timezone ());
        ecd->priv->use_24_hour_format = TRUE;
 }
 
@@ -298,7 +312,7 @@ e_cell_date_edit_text_new (const gchar *fontname,
        return cell;
 }
 
-icaltimezone *
+ICalTimezone *
 e_cell_date_edit_text_get_timezone (ECellDateEditText *ecd)
 {
        g_return_val_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd), NULL);
@@ -308,14 +322,15 @@ e_cell_date_edit_text_get_timezone (ECellDateEditText *ecd)
 
 void
 e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd,
-                                    icaltimezone *timezone)
+                                   const ICalTimezone *timezone)
 {
        g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd));
 
        if (ecd->priv->timezone == timezone)
                return;
 
-       ecd->priv->timezone = timezone;
+       g_clear_object (&ecd->priv->timezone);
+       ecd->priv->timezone = timezone ? e_cal_util_copy_timezone (timezone) : NULL;
 
        g_object_notify (G_OBJECT (ecd), "timezone");
 }
@@ -349,7 +364,8 @@ e_cell_date_edit_compare_cb (gconstpointer a,
 {
        ECellDateEditValue *dv1 = (ECellDateEditValue *) a;
        ECellDateEditValue *dv2 = (ECellDateEditValue *) b;
-       struct icaltimetype tt;
+       ICalTime *tt;
+       gint res;
 
        /* First check if either is NULL. NULL dates sort last. */
        if (!dv1 || !dv2) {
@@ -362,10 +378,134 @@ e_cell_date_edit_compare_cb (gconstpointer a,
        }
 
        /* Copy the 2nd value and convert it to the same timezone as the first. */
-       tt = dv2->tt;
-
-       icaltimezone_convert_time (&tt, dv2->zone, dv1->zone);
+       tt = i_cal_time_new_clone (e_cell_date_edit_value_get_time (dv2));
+       i_cal_timezone_convert_time (tt, e_cell_date_edit_value_get_zone (dv2), 
e_cell_date_edit_value_get_zone (dv1));
 
        /* Now we can compare them. */
-       return icaltime_compare (dv1->tt, tt);
+       res = i_cal_time_compare (e_cell_date_edit_value_get_time (dv1), tt);
+
+       g_clear_object (&tt);
+
+       return res;
+}
+
+struct _ECellDateEditValue {
+       ICalTime *tt;
+       ICalTimezone *zone;
+};
+
+ECellDateEditValue *
+e_cell_date_edit_value_new (const ICalTime *tt,
+                           const ICalTimezone *zone)
+{
+       g_return_val_if_fail (I_CAL_IS_TIME (tt), NULL);
+       if (zone)
+               g_return_val_if_fail (I_CAL_IS_TIMEZONE (zone), NULL);
+
+       return e_cell_date_edit_value_new_take (i_cal_time_new_clone (tt),
+               zone ? e_cal_util_copy_timezone (zone) : NULL);
+}
+
+ECellDateEditValue *
+e_cell_date_edit_value_new_take (ICalTime *tt,
+                                ICalTimezone *zone)
+{
+       ECellDateEditValue *value;
+
+       g_return_val_if_fail (I_CAL_IS_TIME (tt), NULL);
+       if (zone)
+               g_return_val_if_fail (I_CAL_IS_TIMEZONE (zone), NULL);
+
+       value = g_new0 (ECellDateEditValue, 1);
+       value->tt = tt;
+       value->zone = zone;
+
+       return value;
+}
+
+ECellDateEditValue *
+e_cell_date_edit_value_copy (const ECellDateEditValue *src)
+{
+       if (!src)
+               return NULL;
+
+       return e_cell_date_edit_value_new (src->tt, src->zone);
+}
+
+void
+e_cell_date_edit_value_free (ECellDateEditValue *value)
+{
+       if (value) {
+               g_clear_object (&value->tt);
+               g_clear_object (&value->zone);
+               g_free (value);
+       }
+}
+
+ICalTime *
+e_cell_date_edit_value_get_time (const ECellDateEditValue *value)
+{
+       g_return_val_if_fail (value != NULL, NULL);
+
+       return value->tt;
+}
+
+void
+e_cell_date_edit_value_set_time (ECellDateEditValue *value,
+                                const ICalTime *tt)
+{
+       g_return_if_fail (value != NULL);
+       g_return_if_fail (I_CAL_IS_TIME (tt));
+
+       e_cell_date_edit_value_take_time (value, i_cal_time_new_clone (tt));
+}
+
+void
+e_cell_date_edit_value_take_time (ECellDateEditValue *value,
+                                 ICalTime *tt)
+{
+       g_return_if_fail (value != NULL);
+       g_return_if_fail (I_CAL_IS_TIME (tt));
+
+       if (value->tt != tt) {
+               g_clear_object (&value->tt);
+               value->tt = tt;
+       } else {
+               g_clear_object (&tt);
+       }
+}
+
+ICalTimezone *
+e_cell_date_edit_value_get_zone (const ECellDateEditValue *value)
+{
+       g_return_val_if_fail (value != NULL, NULL);
+
+       return value->zone;
+}
+
+void
+e_cell_date_edit_value_set_zone (ECellDateEditValue *value,
+                                const ICalTimezone *zone)
+{
+       g_return_if_fail (value != NULL);
+       if (zone)
+               g_return_if_fail (I_CAL_IS_TIMEZONE (zone));
+
+       e_cell_date_edit_value_take_zone (value, zone ? e_cal_util_copy_timezone (zone) : NULL);
+}
+
+void
+e_cell_date_edit_value_take_zone (ECellDateEditValue *value,
+                                 ICalTimezone *zone)
+{
+       g_return_if_fail (value != NULL);
+       if (zone)
+               g_return_if_fail (I_CAL_IS_TIMEZONE (zone));
+
+       if (zone != value->zone) {
+               g_clear_object (&value->zone);
+               value->zone = zone;
+       } else {
+               g_clear_object (&zone);
+       }
 }
diff --git a/src/calendar/gui/e-cell-date-edit-text.h b/src/calendar/gui/e-cell-date-edit-text.h
index 6e69981806..e0e043a97e 100644
--- a/src/calendar/gui/e-cell-date-edit-text.h
+++ b/src/calendar/gui/e-cell-date-edit-text.h
@@ -23,7 +23,7 @@
 #ifndef _E_CELL_DATE_EDIT_TEXT_H_
 #define _E_CELL_DATE_EDIT_TEXT_H_
 
-#include <libical/ical.h>
+#include <libecal/libecal.h>
 #include <e-util/e-util.h>
 
 /* Standard GObject macros */
@@ -47,15 +47,31 @@
 
 G_BEGIN_DECLS
 
+typedef struct _ECellDateEditValue ECellDateEditValue;
+
+ECellDateEditValue *
+               e_cell_date_edit_value_new      (const ICalTime *tt,
+                                                const ICalTimezone *zone);
+ECellDateEditValue *
+               e_cell_date_edit_value_new_take (ICalTime *tt,
+                                                ICalTimezone *zone);
+ECellDateEditValue *
+               e_cell_date_edit_value_copy     (const ECellDateEditValue *src);
+void           e_cell_date_edit_value_free     (ECellDateEditValue *value);
+ICalTime *     e_cell_date_edit_value_get_time (const ECellDateEditValue *value);
+void           e_cell_date_edit_value_set_time (ECellDateEditValue *value,
+                                                const ICalTime *tt);
+void           e_cell_date_edit_value_take_time(ECellDateEditValue *value,
+                                                ICalTime *tt);
+ICalTimezone * e_cell_date_edit_value_get_zone (const ECellDateEditValue *value);
+void           e_cell_date_edit_value_set_zone (ECellDateEditValue *value,
+                                                const ICalTimezone *zone);
+void           e_cell_date_edit_value_take_zone(ECellDateEditValue *value,
+                                                ICalTimezone *zone);
+
 typedef struct _ECellDateEditText ECellDateEditText;
 typedef struct _ECellDateEditTextClass ECellDateEditTextClass;
 typedef struct _ECellDateEditTextPrivate ECellDateEditTextPrivate;
-typedef struct _ECellDateEditValue ECellDateEditValue;
-
-struct _ECellDateEditValue {
-       struct icaltimetype tt;
-       icaltimezone *zone;
-};
 
 struct _ECellDateEditText {
        ECellText parent;
@@ -69,11 +85,11 @@ struct _ECellDateEditTextClass {
 GType          e_cell_date_edit_text_get_type  (void);
 ECell *                e_cell_date_edit_text_new       (const gchar *fontname,
                                                 GtkJustification justify);
-icaltimezone * e_cell_date_edit_text_get_timezone
+ICalTimezone * e_cell_date_edit_text_get_timezone
                                                (ECellDateEditText *ecd);
 void           e_cell_date_edit_text_set_timezone
                                                (ECellDateEditText *ecd,
-                                                icaltimezone *timezone);
+                                                const ICalTimezone *timezone);
 gboolean       e_cell_date_edit_text_get_use_24_hour_format
                                                (ECellDateEditText *ecd);
 void           e_cell_date_edit_text_set_use_24_hour_format
diff --git a/src/calendar/gui/e-comp-editor-event.c b/src/calendar/gui/e-comp-editor-event.c
index 361c1e3d3d..2dbe27ef43 100644
--- a/src/calendar/gui/e-comp-editor-event.c
+++ b/src/calendar/gui/e-comp-editor-event.c
@@ -87,7 +87,7 @@ ece_event_update_times (ECompEditorEvent *event_editor,
        flags = e_comp_editor_get_flags (E_COMP_EDITOR (event_editor));
 
        if ((flags & E_COMP_EDITOR_FLAG_IS_NEW) != 0) {
-               struct icaltimetype start_tt;
+               ICalTime *start_tt;
 
                start_tt = e_comp_editor_property_part_datetime_get_value (
                        E_COMP_EDITOR_PROPERTY_PART_DATETIME (event_editor->priv->dtstart));
@@ -109,6 +109,8 @@ ece_event_update_times (ECompEditorEvent *event_editor,
                } else if (event_editor->priv->in_the_past_alert) {
                        e_alert_response (event_editor->priv->in_the_past_alert, GTK_RESPONSE_OK);
                }
+
+               g_clear_object (&start_tt);
        }
 }
 
@@ -224,13 +226,13 @@ ece_event_sensitize_widgets (ECompEditor *comp_editor,
        }
 }
 
-static icaltimezone *
+static ICalTimezone *
 ece_event_get_timezone_from_property (ECompEditor *comp_editor,
-                                     icalproperty *property)
+                                     ICalProperty *property)
 {
        ECalClient *client;
-       icalparameter *param;
-       icaltimezone *zone = NULL;
+       ICalParameter *param;
+       ICalTimezone *zone = NULL;
        const gchar *tzid;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), NULL);
@@ -238,95 +240,109 @@ ece_event_get_timezone_from_property (ECompEditor *comp_editor,
        if (!property)
                return NULL;
 
-       param = icalproperty_get_first_parameter (property, ICAL_TZID_PARAMETER);
+       param = i_cal_property_get_first_parameter (property, I_CAL_TZID_PARAMETER);
        if (!param)
                return NULL;
 
-       tzid = icalparameter_get_tzid (param);
-       if (!tzid || !*tzid)
+       tzid = i_cal_parameter_get_tzid (param);
+       if (!tzid || !*tzid) {
+               g_object_unref (param);
                return NULL;
+       }
 
-       if (g_ascii_strcasecmp (tzid, "UTC") == 0)
-               return icaltimezone_get_utc_timezone ();
+       if (g_ascii_strcasecmp (tzid, "UTC") == 0) {
+               g_object_unref (param);
+               return i_cal_timezone_get_utc_timezone ();
+       }
 
        client = e_comp_editor_get_source_client (comp_editor);
        /* It should be already fetched for the UI, thus this should be non-blocking. */
-       if (client && e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, NULL) && zone)
+       if (client && e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, NULL) && zone) {
+               g_object_unref (param);
                return zone;
+       }
 
-       zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+       zone = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
        if (!zone)
-               zone = icaltimezone_get_builtin_timezone (tzid);
+               zone = i_cal_timezone_get_builtin_timezone (tzid);
+
+       g_object_unref (param);
 
        return zone;
 }
 
 static void
 ece_event_update_timezone (ECompEditorEvent *event_editor,
-                          struct icaltimetype *out_dtstart,
-                          struct icaltimetype *out_dtend)
+                          ICalTime **out_dtstart,
+                          ICalTime **out_dtend)
 {
        ECompEditor *comp_editor;
-       struct icaltimetype dtstart, dtend;
-       icalcomponent *component;
-       icaltimezone *zone = NULL;
+       ICalTime *dtstart = NULL, *dtend = NULL;
+       ICalComponent *component;
+       ICalProperty *prop;
+       ICalTimezone *zone = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_EVENT (event_editor));
 
        comp_editor = E_COMP_EDITOR (event_editor);
 
-       dtstart = icaltime_null_time ();
-       dtend = icaltime_null_time ();
-
        component = e_comp_editor_get_component (comp_editor);
        if (!component) {
                if (out_dtstart)
-                       *out_dtstart = dtstart;
+                       *out_dtstart = NULL;
 
                if (out_dtend)
-                       *out_dtend = dtend;
+                       *out_dtend = NULL;
 
                return;
        }
 
-       if (icalcomponent_get_first_property (component, ICAL_DTSTART_PROPERTY)) {
-               dtstart = icalcomponent_get_dtstart (component);
-               if (icaltime_is_valid_time (dtstart)) {
-                       if (icaltime_is_utc (dtstart))
-                               zone = icaltimezone_get_utc_timezone ();
-                       else
-                               zone = ece_event_get_timezone_from_property (comp_editor,
-                                       icalcomponent_get_first_property (component, ICAL_DTSTART_PROPERTY));
+       if (e_cal_util_component_has_property (component, I_CAL_DTSTART_PROPERTY)) {
+               dtstart = i_cal_component_get_dtstart (component);
+               if (dtstart && i_cal_time_is_valid_time (dtstart)) {
+                       if (i_cal_time_is_utc (dtstart)) {
+                               zone = i_cal_timezone_get_utc_timezone ();
+                       } else {
+                               prop = i_cal_component_get_first_property (component, I_CAL_DTSTART_PROPERTY);
+                               zone = ece_event_get_timezone_from_property (comp_editor, prop);
+                               g_clear_object (&prop);
+                       }
                }
        }
 
-       if (icalcomponent_get_first_property (component, ICAL_DTEND_PROPERTY)) {
-               dtend = icalcomponent_get_dtend (component);
-               if (!zone && icaltime_is_valid_time (dtend)) {
-                       if (icaltime_is_utc (dtend))
-                               zone = icaltimezone_get_utc_timezone ();
-                       else
-                               zone = ece_event_get_timezone_from_property (comp_editor,
-                                       icalcomponent_get_first_property (component, ICAL_DTEND_PROPERTY));
+       if (e_cal_util_component_has_property (component, I_CAL_DTEND_PROPERTY)) {
+               dtend = i_cal_component_get_dtend (component);
+               if (!zone && i_cal_time_is_valid_time (dtend)) {
+                       if (i_cal_time_is_utc (dtend)) {
+                               zone = i_cal_timezone_get_utc_timezone ();
+                       } else {
+                               prop = i_cal_component_get_first_property (component, I_CAL_DTEND_PROPERTY);
+                               zone = ece_event_get_timezone_from_property (comp_editor, prop);
+                               g_clear_object (&prop);
+                       }
                }
        }
 
        if (!zone) {
-               struct icaltimetype itt;
-
-               itt = icalcomponent_get_due (component);
-               if (icaltime_is_valid_time (itt)) {
-                       if (icaltime_is_utc (itt))
-                               zone = icaltimezone_get_utc_timezone ();
-                       else
-                               zone = ece_event_get_timezone_from_property (comp_editor,
-                                       icalcomponent_get_first_property (component, ICAL_DUE_PROPERTY));
+               ICalTime *itt;
+
+               itt = i_cal_component_get_due (component);
+               if (itt && i_cal_time_is_valid_time (itt)) {
+                       if (i_cal_time_is_utc (itt)) {
+                               zone = i_cal_timezone_get_utc_timezone ();
+                       } else {
+                               prop = i_cal_component_get_first_property (component, I_CAL_DUE_PROPERTY);
+                               zone = ece_event_get_timezone_from_property (comp_editor, prop);
+                               g_clear_object (&prop);
+                       }
                }
+
+               g_clear_object (&itt);
        }
 
        if (zone) {
                GtkWidget *edit_widget;
-               icaltimezone *cfg_zone;
+               ICalTimezone *cfg_zone;
 
                edit_widget = e_comp_editor_property_part_get_edit_widget (event_editor->priv->timezone);
 
@@ -335,8 +351,8 @@ ece_event_update_timezone (ECompEditorEvent *event_editor,
                cfg_zone = calendar_config_get_icaltimezone ();
 
                if (zone && cfg_zone && zone != cfg_zone &&
-                   (g_strcmp0 (icaltimezone_get_location (zone), icaltimezone_get_location (cfg_zone)) != 0 
||
-                    g_strcmp0 (icaltimezone_get_tzid (zone), icaltimezone_get_tzid (cfg_zone)) != 0)) {
+                   (g_strcmp0 (i_cal_timezone_get_location (zone), i_cal_timezone_get_location (cfg_zone)) 
!= 0 ||
+                    g_strcmp0 (i_cal_timezone_get_tzid (zone), i_cal_timezone_get_tzid (cfg_zone)) != 0)) {
                        /* Show timezone part */
                        GtkAction *action;
 
@@ -347,18 +363,22 @@ ece_event_update_timezone (ECompEditorEvent *event_editor,
 
        if (out_dtstart)
                *out_dtstart = dtstart;
+       else
+               g_clear_object (&dtstart);
 
        if (out_dtend)
                *out_dtend = dtend;
+       else
+               g_clear_object (&dtend);
 }
 
 static void
 ece_event_fill_widgets (ECompEditor *comp_editor,
-                       icalcomponent *component)
+                       ICalComponent *component)
 {
        ECompEditorEvent *event_editor;
-       struct icaltimetype dtstart, dtend;
-       icalproperty *prop;
+       ICalTime *dtstart, *dtend;
+       ICalProperty *prop;
        gboolean all_day_event = FALSE;
        GtkAction *action;
        guint32 flags;
@@ -369,26 +389,27 @@ ece_event_fill_widgets (ECompEditor *comp_editor,
        event_editor = E_COMP_EDITOR_EVENT (comp_editor);
 
        flags = e_comp_editor_get_flags (comp_editor);
-       dtstart = icaltime_null_time ();
-       dtend = icaltime_null_time ();
+       dtstart = NULL;
+       dtend = NULL;
 
        /* Set timezone before the times, because they are converted into this timezone */
        ece_event_update_timezone (event_editor, &dtstart, &dtend);
 
        E_COMP_EDITOR_CLASS (e_comp_editor_event_parent_class)->fill_widgets (comp_editor, component);
 
-       if (icaltime_is_valid_time (dtstart) && !icaltime_is_null_time (dtstart) &&
-           (!icaltime_is_valid_time (dtend) || icaltime_is_null_time (dtend))) {
-               dtend = dtstart;
-               if (dtstart.is_date)
-                       icaltime_adjust (&dtend, 1, 0, 0, 0);
+       if (dtstart && i_cal_time_is_valid_time (dtstart) && !i_cal_time_is_null_time (dtstart) &&
+           (!dtend || !i_cal_time_is_valid_time (dtend) || i_cal_time_is_null_time (dtend))) {
+               g_clear_object (&dtend);
+               dtend = i_cal_time_new_clone (dtstart);
+               if (i_cal_time_is_date (dtstart))
+                       i_cal_time_adjust (dtend, 1, 0, 0, 0);
        }
 
-       if (icaltime_is_valid_time (dtend) && !icaltime_is_null_time (dtend)) {
-               if (dtstart.is_date && dtend.is_date) {
+       if (dtend && i_cal_time_is_valid_time (dtend) && !i_cal_time_is_null_time (dtend)) {
+               if (i_cal_time_is_date (dtstart) && i_cal_time_is_date (dtend)) {
                        all_day_event = TRUE;
-                       if (icaltime_compare_date_only (dtend, dtstart) > 0) {
-                               icaltime_adjust (&dtend, -1, 0, 0, 0);
+                       if (i_cal_time_compare_date_only (dtend, dtstart) > 0) {
+                               i_cal_time_adjust (dtend, -1, 0, 0, 0);
                        }
                }
 
@@ -398,10 +419,10 @@ ece_event_fill_widgets (ECompEditor *comp_editor,
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (event_editor->priv->all_day_check), all_day_event);
 
-       prop = icalcomponent_get_first_property (component, ICAL_CLASS_PROPERTY);
-       if (prop && icalproperty_get_class (prop) == ICAL_CLASS_PRIVATE)
+       prop = i_cal_component_get_first_property (component, I_CAL_CLASS_PROPERTY);
+       if (prop && i_cal_property_get_class (prop) == I_CAL_CLASS_PRIVATE)
                action = e_comp_editor_get_action (comp_editor, "classify-private");
-       else if (prop && icalproperty_get_class (prop) == ICAL_CLASS_CONFIDENTIAL)
+       else if (prop && i_cal_property_get_class (prop) == I_CAL_CLASS_CONFIDENTIAL)
                action = e_comp_editor_get_action (comp_editor, "classify-confidential");
        else if (!(flags & E_COMP_EDITOR_FLAG_IS_NEW))
                action = e_comp_editor_get_action (comp_editor, "classify-public");
@@ -420,6 +441,10 @@ ece_event_fill_widgets (ECompEditor *comp_editor,
        }
 
        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
+
+       g_clear_object (&dtstart);
+       g_clear_object (&dtend);
+       g_clear_object (&prop);
 }
 
 static gboolean
@@ -431,21 +456,21 @@ ece_event_client_needs_all_day_as_time (ECompEditor *comp_editor)
 
        client = e_comp_editor_get_target_client (comp_editor);
 
-       return client && e_client_check_capability (E_CLIENT (client), 
CAL_STATIC_CAPABILITY_ALL_DAY_EVENT_AS_TIME);
+       return client && e_client_check_capability (E_CLIENT (client), 
E_CAL_STATIC_CAPABILITY_ALL_DAY_EVENT_AS_TIME);
 }
 
 static gboolean
 ece_event_fill_component (ECompEditor *comp_editor,
-                         icalcomponent *component)
+                         ICalComponent *component)
 {
        ECompEditorEvent *event_editor;
        gboolean date_valid, time_valid;
-       icalproperty *dtstart_prop, *dtend_prop;
-       icalproperty *prop;
-       icalproperty_class class_value;
+       ICalProperty *dtstart_prop, *dtend_prop;
+       ICalProperty *prop;
+       ICalProperty_Class class_value;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        if (!E_COMP_EDITOR_CLASS (e_comp_editor_event_parent_class)->fill_component (comp_editor, component))
                return FALSE;
@@ -484,42 +509,39 @@ ece_event_fill_component (ECompEditor *comp_editor,
                return FALSE;
        }
 
-       dtstart_prop = icalcomponent_get_first_property (component, ICAL_DTSTART_PROPERTY);
-       dtend_prop = icalcomponent_get_first_property (component, ICAL_DTEND_PROPERTY);
+       dtstart_prop = i_cal_component_get_first_property (component, I_CAL_DTSTART_PROPERTY);
+       dtend_prop = i_cal_component_get_first_property (component, I_CAL_DTEND_PROPERTY);
 
        if (dtstart_prop && dtend_prop) {
-               struct icaltimetype dtstart, dtend;
+               ICalTime *dtstart, *dtend;
                gboolean set_dtstart = FALSE, set_dtend = FALSE;
 
-               dtstart = icalproperty_get_dtstart (dtstart_prop);
-               dtend = icalproperty_get_dtend (dtend_prop);
+               dtstart = i_cal_property_get_dtstart (dtstart_prop);
+               dtend = i_cal_property_get_dtend (dtend_prop);
 
-               if (dtstart.is_date && dtend.is_date) {
+               if (dtstart && i_cal_time_is_date (dtstart) &&
+                   dtend && i_cal_time_is_date (dtend)) {
                        /* Add 1 day to DTEND, as it is not inclusive. */
-                       icaltime_adjust (&dtend, 1, 0, 0, 0);
+                       i_cal_time_adjust (dtend, 1, 0, 0, 0);
                        set_dtend = TRUE;
 
                        if (ece_event_client_needs_all_day_as_time (comp_editor)) {
                                ECompEditorEvent *event_editor = E_COMP_EDITOR_EVENT (comp_editor);
                                GtkWidget *timezone_entry;
 
-                               dtstart.is_date = FALSE;
-                               dtstart.hour = 0;
-                               dtstart.minute = 0;
-                               dtstart.second = 0;
+                               i_cal_time_set_is_date (dtstart, FALSE);
+                               i_cal_time_set_time (dtstart, 0, 0, 0);
 
-                               dtend.is_date = FALSE;
-                               dtend.hour = 0;
-                               dtend.minute = 0;
-                               dtend.second = 0;
+                               i_cal_time_set_is_date (dtend, FALSE);
+                               i_cal_time_set_time (dtend, 0, 0, 0);
 
                                timezone_entry = e_comp_editor_property_part_get_edit_widget 
(event_editor->priv->timezone);
 
-                               dtstart.zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY 
(timezone_entry));
-                               if (!dtstart.zone)
-                                       dtstart.zone = icaltimezone_get_utc_timezone ();
+                               i_cal_time_set_timezone (dtstart, e_timezone_entry_get_timezone 
(E_TIMEZONE_ENTRY (timezone_entry)));
+                               if (!i_cal_time_get_timezone (dtstart))
+                                       i_cal_time_set_timezone (dtstart, i_cal_timezone_get_utc_timezone ());
 
-                               dtend.zone = dtstart.zone;
+                               i_cal_time_set_timezone (dtend, i_cal_time_get_timezone (dtstart));
 
                                set_dtstart = TRUE;
                                set_dtend = TRUE;
@@ -528,36 +550,43 @@ ece_event_fill_component (ECompEditor *comp_editor,
 
                if (set_dtstart) {
                        /* Remove the VALUE parameter, to correspond to the actual value being set */
-                       icalproperty_remove_parameter_by_kind (dtstart_prop, ICAL_VALUE_PARAMETER);
+                       i_cal_property_remove_parameter_by_kind (dtstart_prop, I_CAL_VALUE_PARAMETER);
 
-                       icalproperty_set_dtstart (dtstart_prop, dtstart);
+                       i_cal_property_set_dtstart (dtstart_prop, dtstart);
                        cal_comp_util_update_tzid_parameter (dtstart_prop, dtstart);
                }
 
                if (set_dtend) {
                        /* Remove the VALUE parameter, to correspond to the actual value being set */
-                       icalproperty_remove_parameter_by_kind (dtend_prop, ICAL_VALUE_PARAMETER);
+                       i_cal_property_remove_parameter_by_kind (dtend_prop, I_CAL_VALUE_PARAMETER);
 
-                       icalproperty_set_dtend (dtend_prop, dtend);
+                       i_cal_property_set_dtend (dtend_prop, dtend);
                        cal_comp_util_update_tzid_parameter (dtend_prop, dtend);
                }
+
+               g_clear_object (&dtstart);
+               g_clear_object (&dtend);
        }
 
+       g_clear_object (&dtstart_prop);
+       g_clear_object (&dtend_prop);
+
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (
                e_comp_editor_get_action (comp_editor, "classify-private"))))
-               class_value = ICAL_CLASS_PRIVATE;
+               class_value = I_CAL_CLASS_PRIVATE;
        else if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (
                e_comp_editor_get_action (comp_editor, "classify-confidential"))))
-               class_value = ICAL_CLASS_CONFIDENTIAL;
+               class_value = I_CAL_CLASS_CONFIDENTIAL;
        else
-               class_value = ICAL_CLASS_PUBLIC;
+               class_value = I_CAL_CLASS_PUBLIC;
 
-       prop = icalcomponent_get_first_property (component, ICAL_CLASS_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_CLASS_PROPERTY);
        if (prop) {
-               icalproperty_set_class (prop, class_value);
+               i_cal_property_set_class (prop, class_value);
+               g_object_unref (prop);
        } else {
-               prop = icalproperty_new_class (class_value);
-               icalcomponent_add_property (component, prop);
+               prop = i_cal_property_new_class (class_value);
+               i_cal_component_take_property (component, prop);
        }
 
        return TRUE;
diff --git a/src/calendar/gui/e-comp-editor-memo.c b/src/calendar/gui/e-comp-editor-memo.c
index b68d378dbe..a025c44e44 100644
--- a/src/calendar/gui/e-comp-editor-memo.c
+++ b/src/calendar/gui/e-comp-editor-memo.c
@@ -56,7 +56,7 @@ ece_memo_notify_target_client_cb (GObject *object,
        comp_editor = E_COMP_EDITOR (memo_editor);
        cal_client = e_comp_editor_get_target_client (comp_editor);
 
-       supports_date = !cal_client || !e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE);
+       supports_date = !cal_client || !e_client_check_capability (E_CLIENT (cal_client), 
E_CAL_STATIC_CAPABILITY_NO_MEMO_START_DATE);
 
        e_comp_editor_property_part_set_visible (memo_editor->priv->dtstart, supports_date);
 }
diff --git a/src/calendar/gui/e-comp-editor-page-attachments.c 
b/src/calendar/gui/e-comp-editor-page-attachments.c
index 5fe0fd3ee9..c371bf3a72 100644
--- a/src/calendar/gui/e-comp-editor-page-attachments.c
+++ b/src/calendar/gui/e-comp-editor-page-attachments.c
@@ -247,78 +247,74 @@ ecep_attachments_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_attachments_fill_widgets (ECompEditorPage *page,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        ECompEditorPageAttachments *page_attachments;
        EAttachmentStore *store;
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *uid;
        gint index;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_ATTACHMENTS (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_attachments_parent_class)->fill_widgets (page, 
component);
 
        page_attachments = E_COMP_EDITOR_PAGE_ATTACHMENTS (page);
        store = E_ATTACHMENT_STORE (page_attachments->priv->store);
 
-       uid = icalcomponent_get_uid (component);
+       uid = i_cal_component_get_uid (component);
 
        g_slist_free_full (page_attachments->priv->temporary_files, temporary_file_free);
        page_attachments->priv->temporary_files = NULL;
 
        e_attachment_store_remove_all (store);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_ATTACH_PROPERTY), index = 0;
+       for (prop = i_cal_component_get_first_property (component, I_CAL_ATTACH_PROPERTY), index = 0;
             prop;
-            prop = icalcomponent_get_next_property (component, ICAL_ATTACH_PROPERTY), index++) {
-               icalparameter *param;
-               icalattach *attach;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
I_CAL_ATTACH_PROPERTY), index++) {
+               ICalParameter *param;
+               ICalAttach *attach;
                gchar *uri = NULL, *filename = NULL;
 
-               attach = icalproperty_get_attach (prop);
+               attach = i_cal_property_get_attach (prop);
                if (!attach)
                        continue;
 
-               #ifdef HAVE_ICAL_FILENAME_PARAMETER
-               param = icalproperty_get_first_parameter (prop, ICAL_FILENAME_PARAMETER);
+               param = i_cal_property_get_first_parameter (prop, I_CAL_FILENAME_PARAMETER);
                if (param) {
-                       filename = g_strdup (icalparameter_get_filename (param));
+                       filename = g_strdup (i_cal_parameter_get_filename (param));
                        if (!filename || !*filename) {
                                g_free (filename);
                                filename = NULL;
                        }
+
+                       g_clear_object (&param);
                }
-               #endif
 
-               if (icalattach_get_is_url (attach)) {
+               if (i_cal_attach_get_is_url (attach)) {
                        const gchar *data;
-                       gsize buf_size;
-
-                       data = icalattach_get_url (attach);
-                       buf_size = strlen (data);
-                       uri = g_malloc0 (buf_size + 1);
 
-                       icalvalue_decode_ical_string (data, uri, buf_size);
+                       data = i_cal_attach_get_url (attach);
+                       uri = i_cal_value_decode_ical_string (data);
                } else {
                        gchar *temporary_filename = NULL;
-                       icalparameter *encoding_par = icalproperty_get_first_parameter (prop, 
ICAL_ENCODING_PARAMETER);
+                       ICalParameter *encoding_par = i_cal_property_get_first_parameter (prop, 
I_CAL_ENCODING_PARAMETER);
                        if (encoding_par) {
-                               gchar *str_value = icalproperty_get_value_as_string_r (prop);
+                               gchar *str_value = i_cal_property_get_value_as_string_r (prop);
 
                                if (str_value) {
-                                       icalparameter_encoding encoding = icalparameter_get_encoding 
(encoding_par);
+                                       ICalParameterEncoding encoding = i_cal_parameter_get_encoding 
(encoding_par);
                                        guint8 *data = NULL;
                                        gsize data_len = 0;
 
                                        switch (encoding) {
-                                       case ICAL_ENCODING_8BIT:
+                                       case I_CAL_ENCODING_8BIT:
                                                data = (guint8 *) str_value;
                                                data_len = strlen (str_value);
                                                str_value = NULL;
                                                break;
-                                       case ICAL_ENCODING_BASE64:
+                                       case I_CAL_ENCODING_BASE64:
                                                data = g_base64_decode (str_value, &data_len);
                                                break;
                                        default:
@@ -327,14 +323,13 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
 
                                        if (data) {
                                                gchar *dir, *id_str;
-                                               struct icaltimetype rid_tt;
                                                gchar *rid;
 
-                                               rid_tt = icalcomponent_get_recurrenceid (component);
-                                               if (icaltime_is_null_time (rid_tt) || !icaltime_is_valid_time 
(rid_tt))
+                                               rid = e_cal_util_component_get_recurid_as_string (component);
+                                               if (rid && !*rid) {
+                                                       g_free (rid);
                                                        rid = NULL;
-                                               else
-                                                       rid = icaltime_as_ical_string_r (rid_tt);
+                                               }
 
                                                id_str = g_strconcat (uid, rid ? "-" : NULL, rid, NULL);
 
@@ -344,13 +339,13 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
                                                g_free (id_str);
 
                                                if (g_mkdir_with_parents (dir, 0700) >= 0) {
-                                                       for (param = icalproperty_get_first_parameter (prop, 
ICAL_X_PARAMETER);
+                                                       for (param = i_cal_property_get_first_parameter 
(prop, I_CAL_X_PARAMETER);
                                                             param && !filename;
-                                                            param = icalproperty_get_next_parameter (prop, 
ICAL_X_PARAMETER)) {
-                                                               if (e_util_strstrcase 
(icalparameter_get_xname (param), "NAME") &&
-                                                                   icalparameter_get_xvalue (param) &&
-                                                                   *icalparameter_get_xvalue (param)) {
-                                                                       filename = g_strdup 
(icalparameter_get_xvalue (param));
+                                                            g_object_unref (param), param = 
i_cal_property_get_next_parameter (prop, I_CAL_X_PARAMETER)) {
+                                                               if (e_util_strstrcase 
(i_cal_parameter_get_xname (param), "NAME") &&
+                                                                   i_cal_parameter_get_xvalue (param) &&
+                                                                   *i_cal_parameter_get_xvalue (param)) {
+                                                                       filename = g_strdup 
(i_cal_parameter_get_xvalue (param));
                                                                        if (!filename || !*filename) {
                                                                                g_free (filename);
                                                                                filename = NULL;
@@ -358,6 +353,8 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
                                                                }
                                                        }
 
+                                                       g_clear_object (&param);
+
                                                        if (!filename)
                                                                filename = g_strdup_printf ("%d.dat", index);
 
@@ -374,6 +371,8 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
                                        g_free (str_value);
                                        g_free (data);
                                }
+
+                               g_object_unref (encoding_par);
                        }
 
                        if (temporary_filename) {
@@ -396,6 +395,7 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
                        g_object_unref (attachment);
                }
 
+               g_object_unref (attach);
                g_free (filename);
                g_free (uri);
        }
@@ -403,16 +403,16 @@ ecep_attachments_fill_widgets (ECompEditorPage *page,
 
 static gboolean
 ecep_attachments_fill_component (ECompEditorPage *page,
-                                icalcomponent *component)
+                                ICalComponent *component)
 {
        ECompEditorPageAttachments *page_attachments;
        ECompEditor *comp_editor;
        GList *attachments, *link;
-       icalproperty *prop;
+       ICalProperty *prop;
        gboolean success = TRUE;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE_ATTACHMENTS (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        comp_editor = e_comp_editor_page_ref_editor (page);
        page_attachments = E_COMP_EDITOR_PAGE_ATTACHMENTS (page);
@@ -424,18 +424,15 @@ ecep_attachments_fill_component (ECompEditorPage *page,
                return FALSE;
        }
 
-       cal_comp_util_remove_all_properties (component, ICAL_ATTACH_PROPERTY);
+       e_cal_util_component_remove_property_by_kind (component, I_CAL_ATTACH_PROPERTY, TRUE);
 
        attachments = e_attachment_store_get_attachments (E_ATTACHMENT_STORE (page_attachments->priv->store));
        for (link = attachments; link; link = g_list_next (link)) {
                EAttachment *attachment = link->data;
-               icalattach *attach;
-               gsize buf_size;
+               ICalAttach *attach;
                gchar *buf, *uri, *description;
                GFile *file;
-               #ifdef HAVE_ICAL_FILENAME_PARAMETER
                GFileInfo *file_info;
-               #endif
 
                if (!attachment)
                        continue;
@@ -480,32 +477,27 @@ ecep_attachments_fill_component (ECompEditorPage *page,
                g_object_unref (file);
                g_free (description);
 
-               buf_size = 2 * strlen (uri) + 1;
-               buf = g_malloc0 (buf_size);
-
-               icalvalue_encode_ical_string (uri, buf, buf_size);
-               attach = icalattach_new_from_url (buf);
-               prop = icalproperty_new_attach (attach);
+               buf = i_cal_value_encode_ical_string (uri);
+               attach = i_cal_attach_new_from_url (buf);
+               prop = i_cal_property_new_attach (attach);
 
-               #ifdef HAVE_ICAL_FILENAME_PARAMETER
                file_info = e_attachment_ref_file_info (attachment);
                if (file_info) {
                        const gchar *display_name = g_file_info_get_display_name (file_info);
 
                        if (display_name && *display_name) {
-                               icalparameter *param;
+                               ICalParameter *param;
 
-                               param = icalparameter_new_filename (display_name);
-                               icalproperty_add_parameter (prop, param);
+                               param = i_cal_parameter_new_filename (display_name);
+                               i_cal_property_take_parameter (prop, param);
                        }
 
                        g_object_unref (file_info);
                }
-               #endif
 
-               icalcomponent_add_property (component, prop);
+               i_cal_component_take_property (component, prop);
 
-               icalattach_unref (attach);
+               g_object_unref (attach);
                g_free (buf);
                g_free (uri);
        }
diff --git a/src/calendar/gui/e-comp-editor-page-general.c b/src/calendar/gui/e-comp-editor-page-general.c
index 74d3d5cc2e..e481fd8c78 100644
--- a/src/calendar/gui/e-comp-editor-page-general.c
+++ b/src/calendar/gui/e-comp-editor-page-general.c
@@ -268,9 +268,14 @@ ecep_general_attendees_add_clicked_cb (GtkButton *button,
 
        attendee = e_meeting_store_add_attendee_with_defaults (page_general->priv->meeting_store);
 
-       if ((flags & E_COMP_EDITOR_FLAG_DELEGATE) != 0)
-               e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("mailto:%s";,
-                       page_general->priv->user_delegator ? page_general->priv->user_delegator : ""));
+       if ((flags & E_COMP_EDITOR_FLAG_DELEGATE) != 0) {
+               gchar *mailto;
+
+               mailto = g_strdup_printf ("mailto:%s";,
+                       page_general->priv->user_delegator ? page_general->priv->user_delegator : "");
+               e_meeting_attendee_set_delfrom (attendee, mailto);
+               g_free (mailto);
+       }
 
        e_meeting_list_view_edit (E_MEETING_LIST_VIEW (page_general->priv->attendees_list_view), attendee);
 
@@ -449,6 +454,7 @@ ecep_general_attendee_added_cb (EMeetingListView *meeting_list_view,
        ECompEditor *comp_editor;
        ECompEditorFlags flags;
        ECalClient *client;
+       gchar *mailto;
 
        comp_editor = e_comp_editor_page_ref_editor (E_COMP_EDITOR_PAGE (page_general));
        flags = e_comp_editor_get_flags (comp_editor);
@@ -463,17 +469,18 @@ ecep_general_attendee_added_cb (EMeetingListView *meeting_list_view,
        client = e_comp_editor_get_target_client (comp_editor);
 
        /* do not remove here, it did EMeetingListView already */
-       e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("mailto:%s";,
-               page_general->priv->user_delegator ? page_general->priv->user_delegator : ""));
+       mailto = g_strdup_printf ("mailto:%s";, page_general->priv->user_delegator ? 
page_general->priv->user_delegator : "");
+       e_meeting_attendee_set_delfrom (attendee, mailto);
+       g_free (mailto);
 
-       if (client && !e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) 
{
+       if (client && !e_client_check_capability (E_CLIENT (client), 
E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) {
                EMeetingAttendee *delegator;
 
                delegator = e_meeting_store_find_attendee (page_general->priv->meeting_store,
                        page_general->priv->user_delegator, NULL);
                g_return_if_fail (delegator != NULL);
 
-               e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address 
(attendee)));
+               e_meeting_attendee_set_delto (delegator, e_meeting_attendee_get_address (attendee));
        }
 
        ecep_general_sensitize_widgets (E_COMP_EDITOR_PAGE (page_general), FALSE);
@@ -610,7 +617,7 @@ ecep_general_target_client_notify_cb (ECompEditor *comp_editor,
 
                target_client = e_comp_editor_get_target_client (comp_editor);
                if (target_client)
-                       supports_color = e_client_check_capability (E_CLIENT (target_client), 
CAL_STATIC_CAPABILITY_COMPONENT_COLOR);
+                       supports_color = e_client_check_capability (E_CLIENT (target_client), 
E_CAL_STATIC_CAPABILITY_COMPONENT_COLOR);
 
                e_comp_editor_property_part_set_visible (page_general->priv->comp_color, supports_color);
        }
@@ -637,7 +644,11 @@ ecep_general_list_view_event_cb (EMeetingListView *list_view,
                flags = e_comp_editor_get_flags (comp_editor);
 
                if ((flags & E_COMP_EDITOR_FLAG_DELEGATE) != 0) {
-                       e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("mailto:%s";, 
page_general->priv->user_delegator));
+                       gchar *mailto;
+
+                       mailto = g_strdup_printf ("mailto:%s";, page_general->priv->user_delegator);
+                       e_meeting_attendee_set_delfrom (attendee, mailto);
+                       g_free (mailto);
                }
 
                g_clear_object (&comp_editor);
@@ -837,7 +848,7 @@ ecep_general_sensitize_widgets (ECompEditorPage *page,
                EClient *cl = E_CLIENT (client);
 
                read_only = e_client_is_readonly (cl);
-               delegate_to_many = e_client_check_capability (cl, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY);
+               delegate_to_many = e_client_check_capability (cl, E_CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY);
        } else {
                force_insensitive = TRUE;
        }
@@ -884,14 +895,14 @@ ecep_general_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_general_fill_widgets (ECompEditorPage *page,
-                          icalcomponent *component)
+                          ICalComponent *component)
 {
        ECompEditorPageGeneral *page_general;
        EMeetingListView *attendees_list_view;
-       icalproperty *prop;
+       ICalProperty *prop;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_GENERAL (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_general_parent_class)->fill_widgets (page, component);
 
@@ -903,24 +914,24 @@ ecep_general_fill_widgets (ECompEditorPage *page,
        g_slist_free_full (page_general->priv->orig_attendees, g_free);
        page_general->priv->orig_attendees = NULL;
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_ATTENDEE_PROPERTY);
+       for (prop = i_cal_component_get_first_property (component, I_CAL_ATTENDEE_PROPERTY);
             prop;
-            prop = icalcomponent_get_next_property (component, ICAL_ATTENDEE_PROPERTY)) {
+            g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
I_CAL_ATTENDEE_PROPERTY)) {
                const gchar *address;
 
-               address = itip_strip_mailto (icalproperty_get_attendee (prop));
+               address = itip_strip_mailto (i_cal_property_get_attendee (prop));
                if (address)
                        page_general->priv->orig_attendees = g_slist_prepend 
(page_general->priv->orig_attendees, g_strdup (address));
        }
 
        page_general->priv->orig_attendees = g_slist_reverse (page_general->priv->orig_attendees);
 
-       prop = icalcomponent_get_first_property (component, ICAL_ORGANIZER_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_ORGANIZER_PROPERTY);
        if (prop) {
-               icalparameter *param;
+               ICalParameter *param;
                const gchar *organizer;
 
-               organizer = icalproperty_get_organizer (prop);
+               organizer = i_cal_property_get_organizer (prop);
 
                if (organizer && *organizer) {
                        ECompEditor *comp_editor;
@@ -937,27 +948,31 @@ ecep_general_fill_widgets (ECompEditorPage *page,
                        if (itip_address_is_user (registry, itip_strip_mailto (organizer))) {
                                flags = flags | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER;
                        } else {
-                               param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER);
+                               param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
                                if (param) {
-                                       const gchar *sentby = icalparameter_get_sentby (param);
+                                       const gchar *sentby = i_cal_parameter_get_sentby (param);
 
                                        if (sentby && *sentby &&
                                            itip_address_is_user (registry, itip_strip_mailto (organizer))) {
                                                flags = flags | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER;
                                        }
+
+                                       g_object_unref (param);
                                }
                        }
 
                        e_comp_editor_page_general_set_show_attendees (page_general, TRUE);
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
                        if (param) {
                                const gchar *cn;
 
-                               cn = icalparameter_get_cn (param);
+                               cn = i_cal_parameter_get_cn (param);
                                if (cn && *cn) {
                                        value = camel_internet_address_format_address (cn, itip_strip_mailto 
(organizer));
                                }
+
+                               g_object_unref (param);
                        }
 
                        if (!value)
@@ -985,60 +1000,80 @@ ecep_general_fill_widgets (ECompEditorPage *page,
        e_meeting_store_remove_all_attendees (page_general->priv->meeting_store);
        e_meeting_list_view_remove_all_attendees_from_name_selector (attendees_list_view);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_ATTENDEE_PROPERTY);
+       for (prop = i_cal_component_get_first_property (component, I_CAL_ATTENDEE_PROPERTY);
             prop;
-            prop = icalcomponent_get_next_property (component, ICAL_ATTENDEE_PROPERTY)) {
+            g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
I_CAL_ATTENDEE_PROPERTY)) {
                const gchar *address;
 
-               address = itip_strip_mailto (icalproperty_get_attendee (prop));
+               address = itip_strip_mailto (i_cal_property_get_attendee (prop));
                if (address) {
                        EMeetingAttendee *attendee;
-                       icalparameter *param;
+                       ICalParameter *param;
 
                        attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
 
-                       /* It is supposed to be together with the MAILTO: protocol */
-                       e_meeting_attendee_set_address (attendee, g_strdup (icalproperty_get_attendee 
(prop)));
+                       /* It is supposed to be together with the "mailto:"; protocol */
+                       e_meeting_attendee_set_address (attendee, i_cal_property_get_attendee (prop));
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_MEMBER_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_member (attendee, g_strdup (icalparameter_get_member 
(param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_MEMBER_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_member (attendee, i_cal_parameter_get_member (param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_CUTYPE_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_cutype (attendee, icalparameter_get_cutype (param));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_CUTYPE_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_cutype (attendee, i_cal_parameter_get_cutype (param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_ROLE_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_role (attendee, icalparameter_get_role (param));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_ROLE_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_role (attendee, i_cal_parameter_get_role (param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_RSVP_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_rsvp (attendee, icalparameter_get_rsvp (param) == 
ICAL_RSVP_TRUE);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_RSVP_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_rsvp (attendee, i_cal_parameter_get_rsvp (param) == 
I_CAL_RSVP_TRUE);
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDTO_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_delto (attendee, g_strdup 
(icalparameter_get_delegatedto (param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_DELEGATEDTO_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_delto (attendee, i_cal_parameter_get_delegatedto 
(param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_delfrom (attendee, g_strdup 
(icalparameter_get_delegatedfrom (param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_DELEGATEDFROM_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_delfrom (attendee, i_cal_parameter_get_delegatedfrom 
(param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_status (attendee, icalparameter_get_partstat (param));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_PARTSTAT_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_partstat (attendee, i_cal_parameter_get_partstat 
(param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_sentby (attendee, g_strdup (icalparameter_get_sentby 
(param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_sentby (attendee, i_cal_parameter_get_sentby (param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_cn (attendee, g_strdup (icalparameter_get_cn (param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_cn (attendee, i_cal_parameter_get_cn (param));
+                               g_object_unref (param);
+                       }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_LANGUAGE_PARAMETER);
-                       if (param)
-                               e_meeting_attendee_set_language (attendee, g_strdup 
(icalparameter_get_language (param)));
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_LANGUAGE_PARAMETER);
+                       if (param) {
+                               e_meeting_attendee_set_language (attendee, i_cal_parameter_get_language 
(param));
+                               g_object_unref (param);
+                       }
 
                        e_meeting_store_add_attendee (page_general->priv->meeting_store, attendee);
                        e_meeting_list_view_add_attendee_to_name_selector (attendees_list_view, attendee);
@@ -1050,20 +1085,20 @@ ecep_general_fill_widgets (ECompEditorPage *page,
 
 static gboolean
 ecep_general_fill_component (ECompEditorPage *page,
-                            icalcomponent *component)
+                            ICalComponent *component)
 {
        ECompEditorPageGeneral *page_general;
-       icalproperty *prop;
+       ICalProperty *prop;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE_GENERAL (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        page_general = E_COMP_EDITOR_PAGE_GENERAL (page);
 
        if (page_general->priv->comp_color)
                e_comp_editor_property_part_fill_component (page_general->priv->comp_color, component);
 
-       cal_comp_util_remove_all_properties (component, ICAL_ATTENDEE_PROPERTY);
+       e_cal_util_component_remove_property_by_kind (component, I_CAL_ATTENDEE_PROPERTY, TRUE);
 
        if (e_comp_editor_page_general_get_show_attendees (page_general)) {
                const GPtrArray *attendees;
@@ -1102,29 +1137,31 @@ ecep_general_fill_component (ECompEditorPage *page,
                if ((flags & (E_COMP_EDITOR_FLAG_IS_NEW | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER)) != 0 &&
                    ecep_general_get_organizer (page_general, &organizer_name, &organizer_mailto, NULL)) {
                        const gchar *cal_email_address;
-                       icalparameter *param;
+                       ICalParameter *param;
 
-                       prop = icalcomponent_get_first_property (component, ICAL_ORGANIZER_PROPERTY);
+                       prop = i_cal_component_get_first_property (component, I_CAL_ORGANIZER_PROPERTY);
                        if (!prop) {
-                               prop = icalproperty_new_organizer (organizer_mailto ? organizer_mailto : 
organizer_name);
-                               icalcomponent_add_property (component, prop);
+                               prop = i_cal_property_new_organizer (organizer_mailto ? organizer_mailto : 
organizer_name);
+                               i_cal_component_take_property (component, prop);
+                               prop = i_cal_component_get_first_property (component, 
I_CAL_ORGANIZER_PROPERTY);
                        } else {
-                               icalproperty_set_organizer (prop, organizer_mailto ? organizer_mailto : 
organizer_name);
+                               i_cal_property_set_organizer (prop, organizer_mailto ? organizer_mailto : 
organizer_name);
                        }
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_CN_PARAMETER);
                        if (organizer_name && *organizer_name) {
                                if (!param) {
-                                       param = icalparameter_new_cn (organizer_name);
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_cn (organizer_name);
+                                       i_cal_property_add_parameter (prop, param);
                                } else {
-                                       icalparameter_set_cn (param, organizer_name);
+                                       i_cal_parameter_set_cn (param, organizer_name);
                                }
                        } else if (param) {
-                               icalproperty_remove_parameter_by_kind (prop, ICAL_CN_PARAMETER);
+                               i_cal_property_remove_parameter_by_kind (prop, I_CAL_CN_PARAMETER);
                        }
+                       g_clear_object (&param);
 
-                       param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER);
+                       param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
                        cal_email_address = e_comp_editor_get_cal_email_address (comp_editor);
                        if (cal_email_address && *cal_email_address) {
                                gchar *sentby;
@@ -1135,19 +1172,22 @@ ecep_general_fill_component (ECompEditorPage *page,
 
                                if (differs) {
                                        if (!param) {
-                                               param = icalparameter_new_sentby (sentby);
-                                               icalproperty_add_parameter (prop, param);
+                                               param = i_cal_parameter_new_sentby (sentby);
+                                               i_cal_property_add_parameter (prop, param);
                                        } else {
-                                               icalparameter_set_sentby (param, sentby);
+                                               i_cal_parameter_set_sentby (param, sentby);
                                        }
                                } else if (param) {
-                                       icalproperty_remove_parameter_by_kind (prop, ICAL_SENTBY_PARAMETER);
+                                       i_cal_property_remove_parameter_by_kind (prop, 
I_CAL_SENTBY_PARAMETER);
                                }
 
                                g_free (sentby);
                        } else if (param) {
-                               icalproperty_remove_parameter_by_kind (prop, ICAL_SENTBY_PARAMETER);
+                               i_cal_property_remove_parameter_by_kind (prop, I_CAL_SENTBY_PARAMETER);
                        }
+                       g_clear_object (&param);
+
+                       g_object_unref (prop);
                }
 
                /* Attendees */
@@ -1160,7 +1200,7 @@ ecep_general_fill_component (ECompEditorPage *page,
 
                        address = itip_strip_mailto (e_meeting_attendee_get_address (attendee));
                        if (address) {
-                               icalparameter *param;
+                               ICalParameter *param;
 
                                if ((flags & E_COMP_EDITOR_FLAG_DELEGATE) != 0 &&
                                    (e_meeting_attendee_is_set_delfrom (attendee) || 
e_meeting_attendee_is_set_delto (attendee)) &&
@@ -1169,48 +1209,49 @@ ecep_general_fill_component (ECompEditorPage *page,
 
                                g_hash_table_insert (known_attendees, (gpointer) address, GINT_TO_POINTER 
(1));
 
-                               prop = icalproperty_new_attendee (e_meeting_attendee_get_address (attendee));
-                               icalcomponent_add_property (component, prop);
+                               prop = i_cal_property_new_attendee (e_meeting_attendee_get_address 
(attendee));
 
                                added_attendees++;
 
                                if (e_meeting_attendee_is_set_member (attendee)) {
-                                       param = icalparameter_new_member (e_meeting_attendee_get_member 
(attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_member (e_meeting_attendee_get_member 
(attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
 
-                               param = icalparameter_new_cutype (e_meeting_attendee_get_cutype (attendee));
-                               icalproperty_add_parameter (prop, param);
+                               param = i_cal_parameter_new_cutype (e_meeting_attendee_get_cutype (attendee));
+                               i_cal_property_take_parameter (prop, param);
 
-                               param = icalparameter_new_role (e_meeting_attendee_get_role (attendee));
-                               icalproperty_add_parameter (prop, param);
+                               param = i_cal_parameter_new_role (e_meeting_attendee_get_role (attendee));
+                               i_cal_property_take_parameter (prop, param);
 
-                               param = icalparameter_new_partstat (e_meeting_attendee_get_status (attendee));
-                               icalproperty_add_parameter (prop, param);
+                               param = i_cal_parameter_new_partstat (e_meeting_attendee_get_partstat 
(attendee));
+                               i_cal_property_take_parameter (prop, param);
 
-                               param = icalparameter_new_rsvp (e_meeting_attendee_get_rsvp (attendee) ? 
ICAL_RSVP_TRUE : ICAL_RSVP_FALSE);
-                               icalproperty_add_parameter (prop, param);
+                               param = i_cal_parameter_new_rsvp (e_meeting_attendee_get_rsvp (attendee) ? 
I_CAL_RSVP_TRUE : I_CAL_RSVP_FALSE);
+                               i_cal_property_take_parameter (prop, param);
 
                                if (e_meeting_attendee_is_set_delfrom (attendee)) {
-                                       param = icalparameter_new_delegatedfrom 
(e_meeting_attendee_get_delfrom (attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_delegatedfrom 
(e_meeting_attendee_get_delfrom (attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
                                if (e_meeting_attendee_is_set_delto (attendee)) {
-                                       param = icalparameter_new_delegatedto (e_meeting_attendee_get_delto 
(attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_delegatedto (e_meeting_attendee_get_delto 
(attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
                                if (e_meeting_attendee_is_set_sentby (attendee)) {
-                                       param = icalparameter_new_sentby (e_meeting_attendee_get_sentby 
(attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_sentby (e_meeting_attendee_get_sentby 
(attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
                                if (e_meeting_attendee_is_set_cn (attendee)) {
-                                       param = icalparameter_new_cn (e_meeting_attendee_get_cn (attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_cn (e_meeting_attendee_get_cn (attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
                                if (e_meeting_attendee_is_set_language (attendee)) {
-                                       param = icalparameter_new_language (e_meeting_attendee_get_language 
(attendee));
-                                       icalproperty_add_parameter (prop, param);
+                                       param = i_cal_parameter_new_language (e_meeting_attendee_get_language 
(attendee));
+                                       i_cal_property_take_parameter (prop, param);
                                }
+
+                               i_cal_component_take_property (component, prop);
                        }
                }
 
@@ -1231,7 +1272,7 @@ ecep_general_fill_component (ECompEditorPage *page,
 
                g_clear_object (&comp_editor);
        } else {
-               cal_comp_util_remove_all_properties (component, ICAL_ORGANIZER_PROPERTY);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_ORGANIZER_PROPERTY, TRUE);
        }
 
        return E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_general_parent_class)->fill_component (page, 
component);
@@ -1432,33 +1473,30 @@ ecep_general_constructed (GObject *object)
        g_signal_connect (page_general->priv->source_combo_box, "changed",
                G_CALLBACK (ecep_general_source_combo_box_changed_cb), page_general);
 
-       /* Returns NULL when not supported by libical */
        part = e_comp_editor_property_part_color_new ();
-       if (part) {
-               widget = e_comp_editor_property_part_get_edit_widget (part);
-
-               if (widget) {
-                       const gchar *tooltip;
+       widget = e_comp_editor_property_part_get_edit_widget (part);
 
-                       gtk_box_pack_start (GTK_BOX (page_general->priv->source_and_color_hbox), widget, 
FALSE, FALSE, 0);
+       if (widget) {
+               const gchar *tooltip;
 
-                       if (g_strcmp0 (page_general->priv->source_extension_name, 
E_SOURCE_EXTENSION_CALENDAR) == 0) {
-                               tooltip = _("Override color of the event. If not set, then color of the 
calendar is used.");
-                       } else if (g_strcmp0 (page_general->priv->source_extension_name, 
E_SOURCE_EXTENSION_MEMO_LIST) == 0) {
-                               tooltip = _("Override color of the memo. If not set, then color of the memo 
list is used.");
-                       } else { /* E_SOURCE_EXTENSION_TASK_LIST */
-                               tooltip = _("Override color of the task. If not set, then color of the task 
list is used.");
-                       }
+               gtk_box_pack_start (GTK_BOX (page_general->priv->source_and_color_hbox), widget, FALSE, 
FALSE, 0);
 
-                       gtk_widget_set_tooltip_text (widget, tooltip);
+               if (g_strcmp0 (page_general->priv->source_extension_name, E_SOURCE_EXTENSION_CALENDAR) == 0) {
+                       tooltip = _("Override color of the event. If not set, then color of the calendar is 
used.");
+               } else if (g_strcmp0 (page_general->priv->source_extension_name, 
E_SOURCE_EXTENSION_MEMO_LIST) == 0) {
+                       tooltip = _("Override color of the memo. If not set, then color of the memo list is 
used.");
+               } else { /* E_SOURCE_EXTENSION_TASK_LIST */
+                       tooltip = _("Override color of the task. If not set, then color of the task list is 
used.");
                }
 
-               page_general->priv->comp_color_changed_handler_id = g_signal_connect_swapped (part, "changed",
-                       G_CALLBACK (e_comp_editor_page_emit_changed), page_general);
-
-               page_general->priv->comp_color = part;
+               gtk_widget_set_tooltip_text (widget, tooltip);
        }
 
+       page_general->priv->comp_color_changed_handler_id = g_signal_connect_swapped (part, "changed",
+               G_CALLBACK (e_comp_editor_page_emit_changed), page_general);
+
+       page_general->priv->comp_color = part;
+
        widget = gtk_button_new_with_mnemonic (C_("ECompEditor", "Atte_ndees..."));
        g_object_set (G_OBJECT (widget),
                "hexpand", FALSE,
diff --git a/src/calendar/gui/e-comp-editor-page-recurrence.c 
b/src/calendar/gui/e-comp-editor-page-recurrence.c
index c6111cf625..aacbe60eb9 100644
--- a/src/calendar/gui/e-comp-editor-page-recurrence.c
+++ b/src/calendar/gui/e-comp-editor-page-recurrence.c
@@ -92,10 +92,10 @@ enum recur_type {
 };
 
 static const gint freq_map[] = {
-       ICAL_DAILY_RECURRENCE,
-       ICAL_WEEKLY_RECURRENCE,
-       ICAL_MONTHLY_RECURRENCE,
-       ICAL_YEARLY_RECURRENCE,
+       I_CAL_DAILY_RECURRENCE,
+       I_CAL_WEEKLY_RECURRENCE,
+       I_CAL_MONTHLY_RECURRENCE,
+       I_CAL_YEARLY_RECURRENCE,
        -1
 };
 
@@ -148,7 +148,7 @@ struct _ECompEditorPageRecurrencePrivate {
 
        /* For ending date, created by hand */
        GtkWidget *ending_date_edit;
-       struct icaltimetype ending_date_tt;
+       ICalTime *ending_date_tt;
 
        /* For ending count of occurrences, created by hand */
        GtkWidget *ending_count_spin;
@@ -163,8 +163,8 @@ ecep_recurrence_update_preview (ECompEditorPageRecurrence *page_recurrence)
        ECompEditor *comp_editor;
        ECalClient *client;
        ECalComponent *comp;
-       icalcomponent *icalcomp;
-       const icalcomponent *editing_comp;
+       ICalComponent *icomp;
+       const ICalComponent *editing_comp;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
        g_return_if_fail (E_IS_CALENDAR (page_recurrence->priv->preview));
@@ -177,39 +177,38 @@ ecep_recurrence_update_preview (ECompEditorPageRecurrence *page_recurrence)
        e_calendar_item_clear_marks (e_calendar_get_item (E_CALENDAR (page_recurrence->priv->preview)));
 
        editing_comp = e_comp_editor_get_component (comp_editor);
-       if (!editing_comp || e_cal_util_component_is_instance ((icalcomponent *) editing_comp)) {
+       if (!editing_comp || e_cal_util_component_is_instance ((ICalComponent *) editing_comp)) {
                g_clear_object (&comp_editor);
                return;
        }
 
-       icalcomp = icalcomponent_new_clone ((icalcomponent *) editing_comp);
+       icomp = i_cal_component_new_clone ((ICalComponent *) editing_comp);
 
        e_comp_editor_set_updating (comp_editor, TRUE);
-       e_comp_editor_fill_component (comp_editor, icalcomp);
+       e_comp_editor_fill_component (comp_editor, icomp);
        e_comp_editor_set_updating (comp_editor, FALSE);
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomp);
+       comp = e_cal_component_new_from_icalcomponent (icomp);
 
        if (comp) {
-               icaltimezone *zone = NULL;
+               ICalTimezone *zone = NULL;
 
-               icalcomp = e_cal_component_get_icalcomponent (comp);
+               icomp = e_cal_component_get_icalcomponent (comp);
 
-               if (icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY)) {
-                       struct icaltimetype dt;
+               if (e_cal_util_component_has_property (icomp, I_CAL_DTSTART_PROPERTY)) {
+                       ICalTime *dt;
 
-                       dt = icalcomponent_get_dtstart (icalcomp);
-                       zone = (icaltimezone *) dt.zone;
+                       dt = i_cal_component_get_dtstart (icomp);
+                       zone = i_cal_time_get_timezone (dt);
                }
 
-               e_cal_component_rescan (comp);
-
                if (!zone)
                        zone = calendar_config_get_icaltimezone ();
 
                tag_calendar_by_comp (
                        E_CALENDAR (page_recurrence->priv->preview), comp,
                        client, zone, TRUE, FALSE, FALSE, page_recurrence->priv->cancellable);
+
                g_object_unref (comp);
        }
 
@@ -234,7 +233,7 @@ ecep_recurrence_changed (ECompEditorPageRecurrence *page_recurrence)
 
 static void
 ecep_recurrence_append_exception (ECompEditorPageRecurrence *page_recurrence,
-                                 const struct icaltimetype itt)
+                                 const ICalTime *itt)
 {
        GtkTreeView *view;
        GtkTreeIter  iter;
@@ -247,23 +246,27 @@ ecep_recurrence_append_exception (ECompEditorPageRecurrence *page_recurrence,
 
 static void
 ecep_recurrence_fill_exception_widgets (ECompEditorPageRecurrence *page_recurrence,
-                                       icalcomponent *component)
+                                       ICalComponent *component)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
 
        e_date_time_list_clear (page_recurrence->priv->exceptions_store);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_EXDATE_PROPERTY);
+       for (prop = i_cal_component_get_first_property (component, I_CAL_EXDATE_PROPERTY);
             prop;
-            prop = icalcomponent_get_next_property (component, ICAL_EXDATE_PROPERTY)) {
-               struct icaltimetype itt;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
I_CAL_EXDATE_PROPERTY)) {
+               ICalTime *itt;
 
-               itt = icalproperty_get_exdate (prop);
-               if (!icaltime_is_valid_time (itt) ||
-                   icaltime_is_null_time (itt))
+               itt = i_cal_property_get_exdate (prop);
+               if (!itt || !i_cal_time_is_valid_time (itt) ||
+                   i_cal_time_is_null_time (itt)) {
+                       g_clear_object (&itt);
                        continue;
+               }
 
                ecep_recurrence_append_exception (page_recurrence, itt);
+
+               g_clear_object (&itt);
        }
 }
 
@@ -325,18 +328,21 @@ ecep_recurrence_exceptions_add_clicked_cb (GtkButton *button,
        dialog = ecep_recurrence_create_exception_dialog (page_recurrence, _("Add exception"), &date_edit);
 
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
-               struct icaltimetype itt = icaltime_null_time ();
+               gint year, month, day;
 
-               /* We use DATE values for exceptions, so we don't need a TZID. */
-               itt.zone = NULL;
-               itt.hour = 0;
-               itt.minute = 0;
-               itt.second = 0;
-               itt.is_date = 1;
+               if (e_date_edit_get_date (E_DATE_EDIT (date_edit), &year, &month, &day)) {
+                       ICalTime *itt = i_cal_time_null_time ();
+
+                       /* We use DATE values for exceptions, so we don't need a TZID. */
+                       i_cal_time_set_timezone (itt, NULL);
+                       i_cal_time_set_date (itt, year, month, day);
+                       i_cal_time_set_time (itt, 0,  0,  0);
+                       i_cal_time_set_is_date (itt, TRUE);
 
-               if (e_date_edit_get_date (E_DATE_EDIT (date_edit), &itt.year, &itt.month, &itt.day)) {
                        ecep_recurrence_append_exception (page_recurrence, itt);
                        ecep_recurrence_changed (page_recurrence);
+
+                       g_clear_object (&itt);
                }
        }
 
@@ -348,7 +354,7 @@ ecep_recurrence_exceptions_edit_clicked_cb (GtkButton *button,
                                            ECompEditorPageRecurrence *page_recurrence)
 {
        GtkWidget *dialog, *date_edit;
-       const struct icaltimetype *current_itt;
+       const ICalTime *current_itt;
        GtkTreeSelection *selection;
        GtkTreeIter iter;
 
@@ -362,21 +368,24 @@ ecep_recurrence_exceptions_edit_clicked_cb (GtkButton *button,
 
        dialog = ecep_recurrence_create_exception_dialog (page_recurrence, _("Modify exception"), &date_edit);
        e_date_edit_set_date (E_DATE_EDIT (date_edit),
-               current_itt->year, current_itt->month, current_itt->day);
+               i_cal_time_get_year (current_itt), i_cal_time_get_month (current_itt), i_cal_time_get_day 
(current_itt));
 
        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
-               struct icaltimetype itt = icaltime_null_time ();
+               gint year, month, day;
 
-               /* We use DATE values for exceptions, so we don't need a TZID. */
-               itt.zone = NULL;
-               itt.hour = 0;
-               itt.minute = 0;
-               itt.second = 0;
-               itt.is_date = 1;
+               if (e_date_edit_get_date (E_DATE_EDIT (date_edit), &year, &month, &day)) {
+                       ICalTime *itt = i_cal_time_null_time ();
+
+                       /* We use DATE values for exceptions, so we don't need a TZID. */
+                       i_cal_time_set_timezone (itt, NULL);
+                       i_cal_time_set_date (itt, year, month, day);
+                       i_cal_time_set_time (itt, 0,  0,  0);
+                       i_cal_time_set_is_date (itt, TRUE);
 
-               if (e_date_edit_get_date (E_DATE_EDIT (date_edit), &itt.year, &itt.month, &itt.day)) {
                        e_date_time_list_set_date_time (page_recurrence->priv->exceptions_store, &iter, itt);
                        ecep_recurrence_changed (page_recurrence);
+
+                       g_clear_object (&itt);
                }
        }
 
@@ -436,11 +445,16 @@ static struct tm
 ecep_recurrence_get_current_time_cb (ECalendarItem *calitem,
                                     gpointer user_data)
 {
-       struct icaltimetype today;
+       ICalTime *today;
+       struct tm tm;
 
-       today = icaltime_today ();
+       today = i_cal_time_today ();
 
-       return icaltimetype_to_tm (&today);
+       tm = e_cal_util_icaltime_to_tm (today);
+
+       g_clear_object (&today);
+
+       return tm;
 }
 
 static GtkWidget *
@@ -849,7 +863,7 @@ ecep_recurrence_make_monthly_special (ECompEditorPageRecurrence *page_recurrence
 static void
 ecep_recurrence_make_recurrence_special (ECompEditorPageRecurrence *page_recurrence)
 {
-       icalrecurrencetype_frequency frequency;
+       ICalRecurrenceFrequency frequency;
        GtkWidget *child;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
@@ -870,21 +884,21 @@ ecep_recurrence_make_recurrence_special (ECompEditorPageRecurrence *page_recurre
        frequency = e_dialog_combo_box_get (page_recurrence->priv->recr_interval_unit_combo, freq_map);
 
        switch (frequency) {
-       case ICAL_DAILY_RECURRENCE:
+       case I_CAL_DAILY_RECURRENCE:
                gtk_widget_hide (page_recurrence->priv->recr_interval_special_box);
                break;
 
-       case ICAL_WEEKLY_RECURRENCE:
+       case I_CAL_WEEKLY_RECURRENCE:
                ecep_recurrence_make_weekly_special (page_recurrence);
                gtk_widget_show (page_recurrence->priv->recr_interval_special_box);
                break;
 
-       case ICAL_MONTHLY_RECURRENCE:
+       case I_CAL_MONTHLY_RECURRENCE:
                ecep_recurrence_make_monthly_special (page_recurrence);
                gtk_widget_show (page_recurrence->priv->recr_interval_special_box);
                break;
 
-       case ICAL_YEARLY_RECURRENCE:
+       case I_CAL_YEARLY_RECURRENCE:
                gtk_widget_hide (page_recurrence->priv->recr_interval_special_box);
                break;
 
@@ -893,16 +907,21 @@ ecep_recurrence_make_recurrence_special (ECompEditorPageRecurrence *page_recurre
        }
 }
 
-/* Counts the elements in the by_xxx fields of an icalrecurrencetype */
+/* Counts the elements in the by_xxx fields of an ICalRecurrence */
 static gint
-ecep_recurrence_count_by_xxx (gshort *field,
-                             gint max_elements)
+ecep_recurrence_count_by_xxx_and_free (GArray *array) /* gshort */
 {
        gint ii;
 
-       for (ii = 0; ii < max_elements; ii++)
-               if (field[ii] == ICAL_RECURRENCE_ARRAY_MAX)
+       if (!array)
+               return 0;
+
+       for (ii = 0; ii < array->len; ii++) {
+               if (g_array_index (array, gshort, ii) == I_CAL_RECURRENCE_ARRAY_MAX)
                        break;
+       }
+
+       g_array_unref (array);
 
        return ii;
 }
@@ -913,7 +932,7 @@ ecep_recurrence_make_ending_until_special (ECompEditorPageRecurrence *page_recur
 {
        ECompEditor *comp_editor;
        guint32 flags;
-       const icalcomponent *icomp;
+       const ICalComponent *icomp;
        EDateEdit *date_edit;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
@@ -939,18 +958,18 @@ ecep_recurrence_make_ending_until_special (ECompEditorPageRecurrence *page_recur
 
        icomp = e_comp_editor_get_component (comp_editor);
        if ((flags & E_COMP_EDITOR_FLAG_IS_NEW) != 0 && icomp) {
-               struct icaltimetype itt;
+               ICalTime *itt;
 
-               itt = icalcomponent_get_dtstart ((icalcomponent *) icomp);
+               itt = i_cal_component_get_dtstart ((ICalComponent *) icomp);
                /* Setting the default until time to 2 weeks */
-               icaltime_adjust (&itt, 14, 0, 0, 0);
+               i_cal_time_adjust (itt, 14, 0, 0, 0);
 
-               e_date_edit_set_date (date_edit, itt.year, itt.month, itt.day);
+               e_date_edit_set_date (date_edit, i_cal_time_get_year (itt), i_cal_time_get_month (itt), 
i_cal_time_get_day (itt));
        } else {
                e_date_edit_set_date (date_edit,
-                       page_recurrence->priv->ending_date_tt.year,
-                       page_recurrence->priv->ending_date_tt.month,
-                       page_recurrence->priv->ending_date_tt.day);
+                       i_cal_time_get_year (page_recurrence->priv->ending_date_tt),
+                       i_cal_time_get_month (page_recurrence->priv->ending_date_tt),
+                       i_cal_time_get_day (page_recurrence->priv->ending_date_tt));
        }
 
        g_signal_connect_swapped (
@@ -1054,15 +1073,19 @@ ecep_recurrence_make_ending_special (ECompEditorPageRecurrence *page_recurrence)
  */
 static void
 ecep_recurrence_fill_ending_date (ECompEditorPageRecurrence *page_recurrence,
-                                 struct icalrecurrencetype *rrule,
-                                 icalcomponent *component)
+                                 ICalRecurrence *rrule,
+                                 ICalComponent *component)
 {
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
 
        g_signal_handlers_block_matched (page_recurrence->priv->recr_ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, 
NULL, NULL, page_recurrence);
 
-       if (rrule->count == 0) {
-               if (rrule->until.year == 0) {
+       if (i_cal_recurrence_get_count (rrule) == 0) {
+               ICalTime *until;
+
+               until = i_cal_recurrence_get_until (rrule);
+
+               if (!until || i_cal_time_get_year (until) == 0) {
                        /* Forever */
 
                        e_dialog_combo_box_set (
@@ -1072,34 +1095,36 @@ ecep_recurrence_fill_ending_date (ECompEditorPageRecurrence *page_recurrence,
                } else {
                        /* Ending date */
 
-                       if (!rrule->until.is_date) {
-                               icaltimezone *from_zone, *to_zone;
-                               struct icaltimetype dtstart;
+                       if (!i_cal_time_is_date (until)) {
+                               ICalTimezone *from_zone, *to_zone = NULL;
+                               ICalTime *dtstart;
 
-                               dtstart = icalcomponent_get_dtstart (component);
+                               dtstart = i_cal_component_get_dtstart (component);
 
-                               from_zone = icaltimezone_get_utc_timezone ();
-                               to_zone = (icaltimezone *) dtstart.zone;
+                               from_zone = i_cal_timezone_get_utc_timezone ();
+                               to_zone = dtstart ? i_cal_time_get_timezone (dtstart) : NULL;
 
                                if (to_zone)
-                                       icaltimezone_convert_time (&rrule->until, from_zone, to_zone);
+                                       i_cal_timezone_convert_time (until, from_zone, to_zone);
 
-                               rrule->until.hour = 0;
-                               rrule->until.minute = 0;
-                               rrule->until.second = 0;
-                               rrule->until.is_date = TRUE;
+                               i_cal_time_set_time (until, 0, 0, 0);
+                               i_cal_time_set_is_date (until, TRUE);
+                               i_cal_recurrence_set_until (rrule, until);
                        }
 
-                       page_recurrence->priv->ending_date_tt = rrule->until;
+                       g_clear_object (&page_recurrence->priv->ending_date_tt);
+                       page_recurrence->priv->ending_date_tt = i_cal_recurrence_get_until (rrule);
                        e_dialog_combo_box_set (
                                page_recurrence->priv->recr_ending_combo,
                                ENDING_UNTIL,
                                ending_types_map);
                }
+
+               g_clear_object (&until);
        } else {
                /* Count of occurrences */
 
-               page_recurrence->priv->ending_count = rrule->count;
+               page_recurrence->priv->ending_count = i_cal_recurrence_get_count (rrule);
                e_dialog_combo_box_set (
                        page_recurrence->priv->recr_ending_combo,
                        ENDING_FOR,
@@ -1115,24 +1140,26 @@ ecep_recurrence_fill_ending_date (ECompEditorPageRecurrence *page_recurrence,
  * for use in a WeekdayPicker widget.
  */
 static guint8
-ecep_recurrence_get_start_weekday_mask (icalcomponent *component)
+ecep_recurrence_get_start_weekday_mask (ICalComponent *component)
 {
-       struct icaltimetype dtstart;
+       ICalTime *dtstart;
        guint8 retval;
 
        if (!component)
                return 0;
 
-       dtstart = icalcomponent_get_dtstart (component);
+       dtstart = i_cal_component_get_dtstart (component);
 
-       if (icaltime_is_valid_time (dtstart)) {
+       if (dtstart && i_cal_time_is_valid_time (dtstart)) {
                gshort weekday;
 
-               weekday = icaltime_day_of_week (dtstart);
+               weekday = i_cal_time_day_of_week (dtstart);
                retval = 0x1 << (weekday - 1);
        } else
                retval = 0;
 
+       g_clear_object (&dtstart);
+
        return retval;
 }
 
@@ -1141,7 +1168,7 @@ ecep_recurrence_get_start_weekday_mask (icalcomponent *component)
  */
 static void
 ecep_recurrence_set_special_defaults (ECompEditorPageRecurrence *page_recurrence,
-                                     icalcomponent *component)
+                                     ICalComponent *component)
 {
        guint8 mask;
 
@@ -1181,7 +1208,8 @@ ecep_recurrence_clear_widgets (ECompEditorPageRecurrence *page_recurrence)
        e_dialog_combo_box_set (page_recurrence->priv->recr_interval_unit_combo, ICAL_DAILY_RECURRENCE, 
freq_map);
        g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
 
-       page_recurrence->priv->ending_date_tt = icaltime_today ();
+       g_clear_object (&page_recurrence->priv->ending_date_tt);
+       page_recurrence->priv->ending_date_tt = i_cal_time_today ();
        page_recurrence->priv->ending_count = 2;
 
        g_signal_handlers_block_matched (page_recurrence->priv->recr_ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, 
NULL, NULL, page_recurrence);
@@ -1199,43 +1227,45 @@ ecep_recurrence_clear_widgets (ECompEditorPageRecurrence *page_recurrence)
 
 static void
 ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence,
-                                     icalcomponent *component)
+                                     ICalComponent *component)
 {
-       struct icalrecurrencetype r;
        enum ending_type ending_type;
-       icalproperty *prop;
+       ICalProperty *prop;
+       ICalRecurrence *recur;
+       ICalTime *until;
        gboolean date_set;
+       gint year, month, day;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
 
-       icalrecurrencetype_clear (&r);
+       recur = i_cal_recurrence_new ();
 
        /* Frequency, interval, week start */
 
-       r.freq = e_dialog_combo_box_get (page_recurrence->priv->recr_interval_unit_combo, freq_map);
-       r.interval = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON 
(page_recurrence->priv->recr_interval_value_spin));
+       i_cal_recurrence_set_freq (recur, e_dialog_combo_box_get 
(page_recurrence->priv->recr_interval_unit_combo, freq_map));
+       i_cal_recurrence_set_interval (recur, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON 
(page_recurrence->priv->recr_interval_value_spin)));
 
        switch (calendar_config_get_week_start_day ()) {
                case G_DATE_MONDAY:
-                       r.week_start = ICAL_MONDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_MONDAY_WEEKDAY);
                        break;
                case G_DATE_TUESDAY:
-                       r.week_start = ICAL_TUESDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_TUESDAY_WEEKDAY);
                        break;
                case G_DATE_WEDNESDAY:
-                       r.week_start = ICAL_WEDNESDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_WEDNESDAY_WEEKDAY);
                        break;
                case G_DATE_THURSDAY:
-                       r.week_start = ICAL_THURSDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_THURSDAY_WEEKDAY);
                        break;
                case G_DATE_FRIDAY:
-                       r.week_start = ICAL_FRIDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_FRIDAY_WEEKDAY);
                        break;
                case G_DATE_SATURDAY:
-                       r.week_start = ICAL_SATURDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_SATURDAY_WEEKDAY);
                        break;
                case G_DATE_SUNDAY:
-                       r.week_start = ICAL_SUNDAY_WEEKDAY;
+                       i_cal_recurrence_set_week_start (recur, I_CAL_SUNDAY_WEEKDAY);
                        break;
                default:
                        g_warn_if_reached ();
@@ -1244,12 +1274,12 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
 
        /* Frequency-specific data */
 
-       switch (r.freq) {
-       case ICAL_DAILY_RECURRENCE:
+       switch (i_cal_recurrence_get_freq (recur)) {
+       case I_CAL_DAILY_RECURRENCE:
                /* Nothing else is required */
                break;
 
-       case ICAL_WEEKLY_RECURRENCE: {
+       case I_CAL_WEEKLY_RECURRENCE: {
                EWeekdayChooser *chooser;
                gint ii;
 
@@ -1261,25 +1291,27 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                ii = 0;
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_SUNDAY))
-                       r.by_day[ii++] = ICAL_SUNDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_SUNDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_MONDAY))
-                       r.by_day[ii++] = ICAL_MONDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_MONDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_TUESDAY))
-                       r.by_day[ii++] = ICAL_TUESDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_TUESDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_WEDNESDAY))
-                       r.by_day[ii++] = ICAL_WEDNESDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_WEDNESDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_THURSDAY))
-                       r.by_day[ii++] = ICAL_THURSDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_THURSDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_FRIDAY))
-                       r.by_day[ii++] = ICAL_FRIDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_FRIDAY_WEEKDAY);
 
                if (e_weekday_chooser_get_selected (chooser, G_DATE_SATURDAY))
-                       r.by_day[ii] = ICAL_SATURDAY_WEEKDAY;
+                       i_cal_recurrence_set_by_day (recur, ii++, I_CAL_SATURDAY_WEEKDAY);
+
+               i_cal_recurrence_set_by_day (recur, ii, I_CAL_RECURRENCE_ARRAY_MAX);
 
                break;
        }
@@ -1307,47 +1339,47 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                switch (month_day) {
                case MONTH_DAY_NTH:
                        if (month_num == MONTH_NUM_INVALID)
-                               r.by_month_day[0] = -1;
+                               i_cal_recurrence_set_by_month_day (recur, 0, -1);
                        else
-                               r.by_month_day[0] = page_recurrence->priv->month_index;
+                               i_cal_recurrence_set_by_month_day (recur, 0, 
page_recurrence->priv->month_index);
                        break;
 
                /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not
                 * accept BYDAY=2TU. So we now use the same as Outlook
                 * by default. */
                case MONTH_DAY_MON:
-                       r.by_day[0] = ICAL_MONDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_MONDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_TUE:
-                       r.by_day[0] = ICAL_TUESDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_TUESDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_WED:
-                       r.by_day[0] = ICAL_WEDNESDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_WEDNESDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_THU:
-                       r.by_day[0] = ICAL_THURSDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_THURSDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_FRI:
-                       r.by_day[0] = ICAL_FRIDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_FRIDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_SAT:
-                       r.by_day[0] = ICAL_SATURDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_SATURDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                case MONTH_DAY_SUN:
-                       r.by_day[0] = ICAL_SUNDAY_WEEKDAY;
-                       r.by_set_pos[0] = month_num;
+                       i_cal_recurrence_set_by_day (recur, 0, I_CAL_SUNDAY_WEEKDAY);
+                       i_cal_recurrence_set_by_set_pos (recur, 0, month_num);
                        break;
 
                default:
@@ -1357,7 +1389,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                break;
        }
 
-       case ICAL_YEARLY_RECURRENCE:
+       case I_CAL_YEARLY_RECURRENCE:
                /* Nothing else is required */
                break;
 
@@ -1374,8 +1406,8 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                g_return_if_fail (page_recurrence->priv->ending_count_spin != NULL);
                g_return_if_fail (GTK_IS_SPIN_BUTTON (page_recurrence->priv->ending_count_spin));
 
-               r.count = gtk_spin_button_get_value_as_int (
-                       GTK_SPIN_BUTTON (page_recurrence->priv->ending_count_spin));
+               i_cal_recurrence_set_count (recur, gtk_spin_button_get_value_as_int (
+                       GTK_SPIN_BUTTON (page_recurrence->priv->ending_count_spin)));
                break;
 
        case ENDING_UNTIL:
@@ -1386,12 +1418,14 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                 * since we don't support sub-day recurrences. */
                date_set = e_date_edit_get_date (
                        E_DATE_EDIT (page_recurrence->priv->ending_date_edit),
-                       &r.until.year,
-                       &r.until.month,
-                       &r.until.day);
+                       &year, &month, &day);
                g_return_if_fail (date_set);
 
-               r.until.is_date = 1;
+               until = i_cal_time_null_time ();
+               i_cal_time_set_date (until, year, month, day);
+               i_cal_time_set_is_date (until, 1);
+               i_cal_recurrence_set_until (recur, until);
+               g_clear_object (&until);
 
                break;
 
@@ -1403,11 +1437,13 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                g_return_if_reached ();
        }
 
-       cal_comp_util_remove_all_properties (component, ICAL_RRULE_PROPERTY);
+       e_cal_util_component_remove_property_by_kind (component, I_CAL_RRULE_PROPERTY, TRUE);
 
        /* Set the recurrence */
-       prop = icalproperty_new_rrule (r);
-       icalcomponent_add_property (component, prop);
+       prop = i_cal_property_new_rrule (recur);
+       i_cal_component_take_property (component, prop);
+
+       g_clear_object (&recur);
 }
 
 static void
@@ -1460,35 +1496,35 @@ ecep_recurrence_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_recurrence_fill_widgets (ECompEditorPage *page,
-                             icalcomponent *component)
+                             ICalComponent *component)
 {
        ECompEditorPageRecurrence *page_recurrence;
-       struct icalrecurrencetype rrule;
-       icalproperty *prop;
+       ICalRecurrence *rrule = NULL;
+       ICalProperty *prop;
        GtkAdjustment *adj;
        gint n_by_second, n_by_minute, n_by_hour;
        gint n_by_day, n_by_month_day, n_by_year_day;
        gint n_by_week_no, n_by_month, n_by_set_pos;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_recurrence_parent_class)->fill_widgets (page, component);
 
        page_recurrence = E_COMP_EDITOR_PAGE_RECURRENCE (page);
 
-       switch (icalcomponent_isa (component)) {
-               case ICAL_VEVENT_COMPONENT:
+       switch (i_cal_component_isa (component)) {
+               case I_CAL_VEVENT_COMPONENT:
                        gtk_button_set_label (GTK_BUTTON (page_recurrence->priv->recr_check_box),
                                /* Translators: Entire string is for example:     'This appointment 
recurs/Every[x][day(s)][for][1]occurrences' (combobox options are in [square brackets]) */
                                C_("ECompEditorPageRecur", "This appointment rec_urs"));
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        gtk_button_set_label (GTK_BUTTON (page_recurrence->priv->recr_check_box),
                                /* Translators: Entire string is for example:     'This task 
recurs/Every[x][day(s)][for][1]occurrences' (combobox options are in [square brackets]) */
                                C_("ECompEditorPageRecur", "This task rec_urs"));
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        gtk_button_set_label (GTK_BUTTON (page_recurrence->priv->recr_check_box),
                                /* Translators: Entire string is for example:     'This memo 
recurs/Every[x][day(s)][for][1]occurrences' (combobox options are in [square brackets]) */
                                C_("ECompEditorPageRecur", "This memo rec_urs"));
@@ -1511,9 +1547,9 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
        ecep_recurrence_set_special_defaults (page_recurrence, component);
 
        /* No recurrences? */
-       if (!icalcomponent_get_first_property (component, ICAL_RDATE_PROPERTY)
-           && !icalcomponent_get_first_property (component, ICAL_RRULE_PROPERTY)
-           && !icalcomponent_get_first_property (component, ICAL_EXRULE_PROPERTY)) {
+       if (!e_cal_util_component_has_property (component, I_CAL_RDATE_PROPERTY) &&
+           !e_cal_util_component_has_property (component, I_CAL_RRULE_PROPERTY) &&
+           !e_cal_util_component_has_property (component, I_CAL_EXRULE_PROPERTY)) {
                g_signal_handlers_block_matched (page_recurrence->priv->recr_check_box, G_SIGNAL_MATCH_DATA, 
0, 0, NULL, NULL, page_recurrence);
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page_recurrence->priv->recr_check_box), 
FALSE);
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_check_box, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
@@ -1525,51 +1561,55 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
 
        /* See if it is a custom set we don't support */
 
-       if ((icalcomponent_get_first_property (component, ICAL_RRULE_PROPERTY) &&
-            icalcomponent_get_next_property (component, ICAL_RRULE_PROPERTY)) ||
-           icalcomponent_get_first_property (component, ICAL_RDATE_PROPERTY) ||
-           icalcomponent_get_first_property (component, ICAL_EXRULE_PROPERTY))
+       if (i_cal_component_count_properties (component, I_CAL_RRULE_PROPERTY) > 1 ||
+           e_cal_util_component_has_property (component, I_CAL_RDATE_PROPERTY) ||
+           e_cal_util_component_has_property (component, I_CAL_EXRULE_PROPERTY))
                goto custom;
 
        /* Down to one rule, so test that one */
 
-       prop = icalcomponent_get_first_property (component, ICAL_RRULE_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_RRULE_PROPERTY);
        g_return_if_fail (prop != NULL);
 
-       rrule = icalproperty_get_rrule (prop);
+       rrule = i_cal_property_get_rrule (prop);
+       if (!rrule) {
+               g_clear_object (&prop);
+
+               g_return_if_reached ();
+       }
+
+       g_clear_object (&prop);
 
        /* Any lower frequency? */
 
-       if (rrule.freq == ICAL_SECONDLY_RECURRENCE
-           || rrule.freq == ICAL_MINUTELY_RECURRENCE
-           || rrule.freq == ICAL_HOURLY_RECURRENCE)
+       if (i_cal_recurrence_get_freq (rrule) == I_CAL_SECONDLY_RECURRENCE ||
+           i_cal_recurrence_get_freq (rrule) == I_CAL_MINUTELY_RECURRENCE ||
+           i_cal_recurrence_get_freq (rrule) == I_CAL_HOURLY_RECURRENCE)
                goto custom;
 
        /* Any unusual values? */
 
-#define N_HAS_BY(field) (ecep_recurrence_count_by_xxx (field, G_N_ELEMENTS (field)))
-
-       n_by_second = N_HAS_BY (rrule.by_second);
-       n_by_minute = N_HAS_BY (rrule.by_minute);
-       n_by_hour = N_HAS_BY (rrule.by_hour);
-       n_by_day = N_HAS_BY (rrule.by_day);
-       n_by_month_day = N_HAS_BY (rrule.by_month_day);
-       n_by_year_day = N_HAS_BY (rrule.by_year_day);
-       n_by_week_no = N_HAS_BY (rrule.by_week_no);
-       n_by_month = N_HAS_BY (rrule.by_month);
-       n_by_set_pos = N_HAS_BY (rrule.by_set_pos);
-
-       if (n_by_second != 0
-           || n_by_minute != 0
-           || n_by_hour != 0)
+       n_by_second = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_second_array (rrule));
+       n_by_minute = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_minute_array (rrule));
+       n_by_hour = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_hour_array (rrule));
+       n_by_day = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_day_array (rrule));
+       n_by_month_day = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_month_day_array 
(rrule));
+       n_by_year_day = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_year_day_array 
(rrule));
+       n_by_week_no = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_week_no_array (rrule));
+       n_by_month = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_month_array (rrule));
+       n_by_set_pos = ecep_recurrence_count_by_xxx_and_free (i_cal_recurrence_get_by_set_pos_array (rrule));
+
+       if (n_by_second != 0 ||
+           n_by_minute != 0 ||
+           n_by_hour != 0)
                goto custom;
 
        /* Filter the funky shit based on the frequency; if there is nothing
         * weird we can actually set the widgets.
         */
 
-       switch (rrule.freq) {
-       case ICAL_DAILY_RECURRENCE:
+       switch (i_cal_recurrence_get_freq (rrule)) {
+       case I_CAL_DAILY_RECURRENCE:
                if (n_by_day != 0
                    || n_by_month_day != 0
                    || n_by_year_day != 0
@@ -1581,12 +1621,12 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                g_signal_handlers_block_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                e_dialog_combo_box_set (
                        page_recurrence->priv->recr_interval_unit_combo,
-                       ICAL_DAILY_RECURRENCE,
+                       I_CAL_DAILY_RECURRENCE,
                        freq_map);
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                break;
 
-       case ICAL_WEEKLY_RECURRENCE: {
+       case I_CAL_WEEKLY_RECURRENCE: {
                gint ii;
                guint8 day_mask;
 
@@ -1599,42 +1639,42 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
 
                day_mask = 0;
 
-               for (ii = 0; ii < 8 && rrule.by_day[ii] != ICAL_RECURRENCE_ARRAY_MAX; ii++) {
-                       enum icalrecurrencetype_weekday weekday;
+               for (ii = 0; ii < 8 && i_cal_recurrence_get_by_day (rrule, ii) != I_CAL_RECURRENCE_ARRAY_MAX; 
ii++) {
+                       ICalRecurrenceWeekday weekday;
                        gint pos;
 
-                       weekday = icalrecurrencetype_day_day_of_week (rrule.by_day[ii]);
-                       pos = icalrecurrencetype_day_position (rrule.by_day[ii]);
+                       weekday = i_cal_recurrence_day_day_of_week (i_cal_recurrence_get_by_day (rrule, ii));
+                       pos = i_cal_recurrence_day_position (i_cal_recurrence_get_by_day (rrule, ii));
 
                        if (pos != 0)
                                goto custom;
 
                        switch (weekday) {
-                       case ICAL_SUNDAY_WEEKDAY:
+                       case I_CAL_SUNDAY_WEEKDAY:
                                day_mask |= 1 << 0;
                                break;
 
-                       case ICAL_MONDAY_WEEKDAY:
+                       case I_CAL_MONDAY_WEEKDAY:
                                day_mask |= 1 << 1;
                                break;
 
-                       case ICAL_TUESDAY_WEEKDAY:
+                       case I_CAL_TUESDAY_WEEKDAY:
                                day_mask |= 1 << 2;
                                break;
 
-                       case ICAL_WEDNESDAY_WEEKDAY:
+                       case I_CAL_WEDNESDAY_WEEKDAY:
                                day_mask |= 1 << 3;
                                break;
 
-                       case ICAL_THURSDAY_WEEKDAY:
+                       case I_CAL_THURSDAY_WEEKDAY:
                                day_mask |= 1 << 4;
                                break;
 
-                       case ICAL_FRIDAY_WEEKDAY:
+                       case I_CAL_FRIDAY_WEEKDAY:
                                day_mask |= 1 << 5;
                                break;
 
-                       case ICAL_SATURDAY_WEEKDAY:
+                       case I_CAL_SATURDAY_WEEKDAY:
                                day_mask |= 1 << 6;
                                break;
 
@@ -1648,13 +1688,13 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                g_signal_handlers_block_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                e_dialog_combo_box_set (
                        page_recurrence->priv->recr_interval_unit_combo,
-                       ICAL_WEEKLY_RECURRENCE,
+                       I_CAL_WEEKLY_RECURRENCE,
                        freq_map);
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                break;
        }
 
-       case ICAL_MONTHLY_RECURRENCE:
+       case I_CAL_MONTHLY_RECURRENCE:
                if (n_by_year_day != 0
                    || n_by_week_no != 0
                    || n_by_month != 0
@@ -1667,17 +1707,19 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                        if (n_by_set_pos != 0)
                                goto custom;
 
-                       nth = rrule.by_month_day[0];
+                       nth = i_cal_recurrence_get_by_month_day (rrule, 0);
                        if (nth < 1 && nth != -1)
                                goto custom;
 
                        if (nth == -1) {
-                               struct icaltimetype dtstart;
+                               ICalTime *dtstart;
 
-                               dtstart = icalcomponent_get_dtstart (component);
+                               dtstart = i_cal_component_get_dtstart (component);
 
-                               page_recurrence->priv->month_index = dtstart.day;
+                               page_recurrence->priv->month_index = dtstart ? i_cal_time_get_day (dtstart) : 
0;
                                page_recurrence->priv->month_num = MONTH_NUM_LAST;
+
+                               g_clear_object (&dtstart);
                        } else {
                                page_recurrence->priv->month_index = nth;
                                page_recurrence->priv->month_num = MONTH_NUM_DAY;
@@ -1685,7 +1727,7 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                        page_recurrence->priv->month_day = MONTH_DAY_NTH;
 
                } else if (n_by_day == 1) {
-                       enum icalrecurrencetype_weekday weekday;
+                       ICalRecurrenceWeekday weekday;
                        gint pos;
                        enum month_day_options month_day;
 
@@ -1693,43 +1735,43 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                         * accept BYDAY=2TU. So we now use the same as Outlook
                         * by default. */
 
-                       weekday = icalrecurrencetype_day_day_of_week (rrule.by_day[0]);
-                       pos = icalrecurrencetype_day_position (rrule.by_day[0]);
+                       weekday = i_cal_recurrence_day_day_of_week (i_cal_recurrence_get_by_day (rrule, 0));
+                       pos = i_cal_recurrence_day_position (i_cal_recurrence_get_by_day (rrule, 0));
 
                        if (pos == 0) {
                                if (n_by_set_pos != 1)
                                        goto custom;
-                               pos = rrule.by_set_pos[0];
+                               pos = i_cal_recurrence_get_by_set_pos (rrule, 0);
                        } else if (pos < 0) {
                                goto custom;
                        }
 
                        switch (weekday) {
-                       case ICAL_MONDAY_WEEKDAY:
+                       case I_CAL_MONDAY_WEEKDAY:
                                month_day = MONTH_DAY_MON;
                                break;
 
-                       case ICAL_TUESDAY_WEEKDAY:
+                       case I_CAL_TUESDAY_WEEKDAY:
                                month_day = MONTH_DAY_TUE;
                                break;
 
-                       case ICAL_WEDNESDAY_WEEKDAY:
+                       case I_CAL_WEDNESDAY_WEEKDAY:
                                month_day = MONTH_DAY_WED;
                                break;
 
-                       case ICAL_THURSDAY_WEEKDAY:
+                       case I_CAL_THURSDAY_WEEKDAY:
                                month_day = MONTH_DAY_THU;
                                break;
 
-                       case ICAL_FRIDAY_WEEKDAY:
+                       case I_CAL_FRIDAY_WEEKDAY:
                                month_day = MONTH_DAY_FRI;
                                break;
 
-                       case ICAL_SATURDAY_WEEKDAY:
+                       case I_CAL_SATURDAY_WEEKDAY:
                                month_day = MONTH_DAY_SAT;
                                break;
 
-                       case ICAL_SUNDAY_WEEKDAY:
+                       case I_CAL_SUNDAY_WEEKDAY:
                                month_day = MONTH_DAY_SUN;
                                break;
 
@@ -1748,7 +1790,7 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                g_signal_handlers_block_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                e_dialog_combo_box_set (
                        page_recurrence->priv->recr_interval_unit_combo,
-                       ICAL_MONTHLY_RECURRENCE,
+                       I_CAL_MONTHLY_RECURRENCE,
                        freq_map);
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                break;
@@ -1765,7 +1807,7 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                g_signal_handlers_block_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                e_dialog_combo_box_set (
                        page_recurrence->priv->recr_interval_unit_combo,
-                       ICAL_YEARLY_RECURRENCE,
+                       I_CAL_YEARLY_RECURRENCE,
                        freq_map);
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                break;
@@ -1784,10 +1826,12 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
 
        adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON 
(page_recurrence->priv->recr_interval_value_spin));
        g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
-       gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_recurrence->priv->recr_interval_value_spin), 
rrule.interval);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_recurrence->priv->recr_interval_value_spin), 
i_cal_recurrence_get_interval (rrule));
        g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
 
-       ecep_recurrence_fill_ending_date (page_recurrence, &rrule, component);
+       ecep_recurrence_fill_ending_date (page_recurrence, rrule, component);
+
+       g_clear_object (&rrule);
 
        return;
 
@@ -1797,22 +1841,24 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
        page_recurrence->priv->is_custom = TRUE;
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page_recurrence->priv->recr_check_box), TRUE);
        g_signal_handlers_unblock_matched (page_recurrence->priv->recr_check_box, G_SIGNAL_MATCH_DATA, 0, 0, 
NULL, NULL, page_recurrence);
+
+       g_clear_object (&rrule);
 }
 
 static gboolean
 ecep_recurrence_fill_component (ECompEditorPage *page,
-                               icalcomponent *component)
+                               ICalComponent *component)
 {
        ECompEditorPageRecurrence *page_recurrence;
        ECompEditor *comp_editor;
        GtkTreeModel *model;
        GtkTreeIter iter;
-       icalproperty *prop;
+       ICalProperty *prop;
        gboolean recurs;
        gboolean valid_iter;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        page_recurrence = E_COMP_EDITOR_PAGE_RECURRENCE (page);
 
@@ -1822,21 +1868,21 @@ ecep_recurrence_fill_component (ECompEditorPage *page,
                /* We just keep whatever the component has currently */
                return TRUE;
        } else if (recurs) {
-               cal_comp_util_remove_all_properties (component, ICAL_RRULE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_RDATE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_EXRULE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_EXDATE_PROPERTY);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_RRULE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_RDATE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_EXRULE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_EXDATE_PROPERTY, TRUE);
                ecep_recurrence_simple_recur_to_comp (page_recurrence, component);
        } else {
                gboolean had_recurrences = e_cal_util_component_has_recurrences (component);
 
-               cal_comp_util_remove_all_properties (component, ICAL_RRULE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_RDATE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_EXRULE_PROPERTY);
-               cal_comp_util_remove_all_properties (component, ICAL_EXDATE_PROPERTY);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_RRULE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_RDATE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_EXRULE_PROPERTY, TRUE);
+               e_cal_util_component_remove_property_by_kind (component, I_CAL_EXDATE_PROPERTY, TRUE);
 
                if (had_recurrences)
-                       cal_comp_util_remove_all_properties (component, ICAL_RECURRENCEID_PROPERTY);
+                       e_cal_util_component_remove_property_by_kind (component, I_CAL_RECURRENCEID_PROPERTY, 
TRUE);
 
                return TRUE;
        }
@@ -1849,12 +1895,12 @@ ecep_recurrence_fill_component (ECompEditorPage *page,
 
        for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
             valid_iter = gtk_tree_model_iter_next (model, &iter)) {
-               const icaltimetype *dt;
+               ICalTime *dt;
 
                dt = e_date_time_list_get_date_time (E_DATE_TIME_LIST (model), &iter);
                g_return_val_if_fail (dt != NULL, FALSE);
 
-               if (!icaltime_is_valid_time (*dt)) {
+               if (!i_cal_time_is_valid_time (dt)) {
                        e_comp_editor_set_validation_error (comp_editor,
                                page, page_recurrence->priv->exceptions_tree_view,
                                _("Recurrence exception date is invalid"));
@@ -1862,22 +1908,22 @@ ecep_recurrence_fill_component (ECompEditorPage *page,
                        return FALSE;
                }
 
-               prop = icalproperty_new_exdate (*dt);
-               cal_comp_util_update_tzid_parameter (prop, *dt);
+               prop = i_cal_property_new_exdate (dt);
+               cal_comp_util_update_tzid_parameter (prop, dt);
 
-               icalcomponent_add_property (component, prop);
+               i_cal_component_take_property (component, prop);
        }
 
        if (gtk_widget_get_visible (page_recurrence->priv->recr_ending_combo) &&
            gtk_widget_get_sensitive (page_recurrence->priv->recr_ending_combo) &&
            e_dialog_combo_box_get (page_recurrence->priv->recr_ending_combo, ending_types_map) == 
ENDING_UNTIL) {
                /* check whether the "until" date is in the future */
-               struct icaltimetype tt = icaltime_null_time ();
+               gint year, month, day;
                gboolean ok = TRUE;
 
-               if (e_date_edit_get_date (E_DATE_EDIT (page_recurrence->priv->ending_date_edit), &tt.year, 
&tt.month, &tt.day)) {
+               if (e_date_edit_get_date (E_DATE_EDIT (page_recurrence->priv->ending_date_edit), &year, 
&month, &day)) {
                        ECompEditorPropertyPart *dtstart_part = NULL;
-                       struct icaltimetype dtstart = icaltime_null_time ();
+                       ICalTime *dtstart = NULL;
 
                        e_comp_editor_get_time_parts (comp_editor, &dtstart_part, NULL);
                        if (dtstart_part) {
@@ -1885,21 +1931,29 @@ ecep_recurrence_fill_component (ECompEditorPage *page,
                                        E_COMP_EDITOR_PROPERTY_PART_DATETIME (dtstart_part));
                        }
 
-                       tt.is_date = 1;
-                       tt.zone = NULL;
+                       if (dtstart && i_cal_time_is_valid_time (dtstart)) {
+                               ICalTime *tt;
+
+                               tt = i_cal_time_null_time ();
+                               i_cal_time_set_timezone (tt, NULL);
+                               i_cal_time_set_is_date (tt, TRUE);
+                               i_cal_time_set_date (tt, year, month, day);
 
-                       if (icaltime_is_valid_time (dtstart)) {
-                               ok = icaltime_compare_date_only (dtstart, tt) <= 0;
+                               ok = i_cal_time_compare_date_only (dtstart, tt) <= 0;
 
                                if (!ok) {
                                        e_date_edit_set_date (E_DATE_EDIT 
(page_recurrence->priv->ending_date_edit),
-                                               dtstart.year, dtstart.month, dtstart.day);
+                                               i_cal_time_get_year (dtstart), i_cal_time_get_month 
(dtstart), i_cal_time_get_day (dtstart));
                                } else {
                                        /* to have the date shown in "normalized" format */
                                        e_date_edit_set_date (E_DATE_EDIT 
(page_recurrence->priv->ending_date_edit),
-                                               tt.year, tt.month, tt.day);
+                                               i_cal_time_get_year (tt), i_cal_time_get_month (tt), 
i_cal_time_get_day (tt));
                                }
+
+                               g_clear_object (&tt);
                        }
+
+                       g_clear_object (&dtstart);
                }
 
                if (!ok) {
@@ -2307,6 +2361,7 @@ ecep_recurrence_dispose (GObject *object)
        }
 
        g_clear_object (&page_recurrence->priv->exceptions_store);
+       g_clear_object (&page_recurrence->priv->ending_date_tt);
 
        comp_editor = e_comp_editor_page_ref_editor (E_COMP_EDITOR_PAGE (page_recurrence));
        if (comp_editor) {
diff --git a/src/calendar/gui/e-comp-editor-page-reminders.c b/src/calendar/gui/e-comp-editor-page-reminders.c
index 47a21457c7..b46f85691b 100644
--- a/src/calendar/gui/e-comp-editor-page-reminders.c
+++ b/src/calendar/gui/e-comp-editor-page-reminders.c
@@ -90,10 +90,10 @@ static const gint action_map[] = {
 };
 
 static const gchar *action_map_cap[] = {
-       CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS,
-       CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS,
-       CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS,
-       CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS
+       E_CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS,
+       E_CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS,
+       E_CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS,
+       E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS
 };
 
 static const gint value_map[] = {
@@ -239,51 +239,59 @@ ecep_reminders_get_text_view_text (GtkWidget *text_view)
        return gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
 }
 
-static void
+static gboolean
 ecep_reminders_remove_needs_description_property (ECalComponentAlarm *alarm)
 {
-       icalcomponent *component;
-       icalproperty *prop;
+       ECalComponentPropertyBag *bag;
+       guint ii, sz;
 
-       g_return_if_fail (alarm != NULL);
+       g_return_val_if_fail (alarm != NULL, FALSE);
 
-       component = e_cal_component_alarm_get_icalcomponent (alarm);
-       g_return_if_fail (component != NULL);
+       bag = e_cal_component_alarm_get_property_bag (alarm);
+       g_return_val_if_fail (bag != NULL, FALSE);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_X_PROPERTY);
-            prop;
-            prop = icalcomponent_get_next_property (component, ICAL_X_PROPERTY)) {
+       sz = e_cal_component_property_bag_get_count (bag);
+       for (ii = 0; ii < sz; ii++) {
+               ICalProperty *prop;
                const gchar *x_name;
 
-               x_name = icalproperty_get_x_name (prop);
+               prop = e_cal_component_property_bag_get (bag, ii);
+               if (!prop || i_cal_property_isa (prop) != I_CAL_X_PROPERTY)
+                       continue;
+
+               x_name = i_cal_property_get_x_name (prop);
                if (g_str_equal (x_name, X_EVOLUTION_NEEDS_DESCRIPTION)) {
-                       icalcomponent_remove_property (component, prop);
-                       icalproperty_free (prop);
-                       break;
+                       e_cal_component_property_bag_remove (bag, ii);
+                       return TRUE;
                }
        }
+
+       return FALSE;
 }
 
 static gboolean
 ecep_reminders_has_needs_description_property (ECalComponentAlarm *alarm)
 {
-       icalcomponent *component;
-       icalproperty *prop;
+       ECalComponentPropertyBag *bag;
+       guint ii, sz;
 
        g_return_val_if_fail (alarm != NULL, FALSE);
 
-       component = e_cal_component_alarm_get_icalcomponent (alarm);
-       g_return_val_if_fail (component != NULL, FALSE);
+       bag = e_cal_component_alarm_get_property_bag (alarm);
+       g_return_val_if_fail (bag != NULL, FALSE);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_X_PROPERTY);
-            prop;
-            prop = icalcomponent_get_next_property (component, ICAL_X_PROPERTY)) {
+       sz = e_cal_component_property_bag_get_count (bag);
+       for (ii = 0; ii < sz; ii++) {
+               ICalProperty *prop;
                const gchar *x_name;
 
-               x_name = icalproperty_get_x_name (prop);
-               if (g_str_equal (x_name, X_EVOLUTION_NEEDS_DESCRIPTION)) {
+               prop = e_cal_component_property_bag_get (bag, ii);
+               if (!prop || i_cal_property_isa (prop) != I_CAL_X_PROPERTY)
+                       continue;
+
+               x_name = i_cal_property_get_x_name (prop);
+               if (g_str_equal (x_name, X_EVOLUTION_NEEDS_DESCRIPTION))
                        return TRUE;
-               }
        }
 
        return FALSE;
@@ -292,20 +300,20 @@ ecep_reminders_has_needs_description_property (ECalComponentAlarm *alarm)
 static void
 ecep_reminders_add_needs_description_property (ECalComponentAlarm *alarm)
 {
-       icalcomponent *component;
-       icalproperty *prop;
+       ECalComponentPropertyBag *bag;
+       ICalProperty *prop;
 
        g_return_if_fail (alarm != NULL);
 
        if (ecep_reminders_has_needs_description_property (alarm))
                return;
 
-       component = e_cal_component_alarm_get_icalcomponent (alarm);
-       g_return_if_fail (component != NULL);
+       bag = e_cal_component_alarm_get_property_bag (alarm);
+       g_return_if_fail (bag != NULL);
 
-       prop = icalproperty_new_x ("1");
-       icalproperty_set_x_name (prop, X_EVOLUTION_NEEDS_DESCRIPTION);
-       icalcomponent_add_property (component, prop);
+       prop = i_cal_property_new_x ("1");
+       i_cal_property_set_x_name (prop, X_EVOLUTION_NEEDS_DESCRIPTION);
+       e_cal_component_property_bag_take (bag, prop);
 }
 
 static void
@@ -345,10 +353,11 @@ ecep_reminders_reset_alarm_widget (ECompEditorPageReminders *page_reminders)
 static void
 ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
 {
-       ECalComponentAlarmTrigger trigger;
+       ECalComponentAlarmTrigger *trigger;
        ECalComponentAlarmAction action;
-       ECalComponentAlarmRepeat repeat;
+       ECalComponentAlarmRepeat *repeat;
        ECalComponentAlarm *alarm;
+       ICalDuration *duration;
        GtkTreeSelection *selection;
        GtkTreeIter iter;
 
@@ -360,8 +369,8 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
        alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (page_reminders->priv->alarm_list, &iter);
        g_return_if_fail (alarm != NULL);
 
-       e_cal_component_alarm_get_action (alarm, &action);
-       e_cal_component_alarm_get_trigger (alarm, &trigger);
+       action = e_cal_component_alarm_get_action (alarm);
+       trigger = e_cal_component_alarm_get_trigger (alarm);
 
        e_comp_editor_page_set_updating (E_COMP_EDITOR_PAGE (page_reminders), TRUE);
 
@@ -373,7 +382,7 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
        }
 
        /* Alarm Types */
-       switch (trigger.type) {
+       switch (e_cal_component_alarm_trigger_get_kind (trigger)) {
        case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START:
                e_dialog_combo_box_set (page_reminders->priv->relative_to_combo, 
E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map);
                break;
@@ -382,10 +391,11 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
                e_dialog_combo_box_set (page_reminders->priv->relative_to_combo, 
E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END, time_map);
                break;
        default:
-               g_warning ("%s: Unexpected alarm trigger type (%d)", G_STRLOC, trigger.type);
+               g_warning ("%s: Unexpected alarm trigger type (%d)", G_STRLOC, 
e_cal_component_alarm_trigger_get_kind (trigger));
        }
 
-       switch (trigger.u.rel_duration.is_neg) {
+       duration = e_cal_component_alarm_trigger_get_duration (trigger);
+       switch (i_cal_duration_is_neg (duration)) {
        case 1:
                e_dialog_combo_box_set (page_reminders->priv->relative_time_combo, BEFORE, relative_map);
                break;
@@ -395,47 +405,49 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
                break;
        }
 
-       if (trigger.u.rel_duration.days) {
+       if (i_cal_duration_get_days (duration)) {
                e_dialog_combo_box_set (page_reminders->priv->unit_combo, DAYS, value_map);
                gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->time_spin),
-                       trigger.u.rel_duration.days);
-       } else if (trigger.u.rel_duration.hours) {
+                       i_cal_duration_get_days (duration));
+       } else if (i_cal_duration_get_hours (duration)) {
                e_dialog_combo_box_set (page_reminders->priv->unit_combo, HOURS, value_map);
                gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->time_spin),
-                       trigger.u.rel_duration.hours);
-       } else if (trigger.u.rel_duration.minutes) {
+                       i_cal_duration_get_hours (duration));
+       } else if (i_cal_duration_get_minutes (duration)) {
                e_dialog_combo_box_set (page_reminders->priv->unit_combo, MINUTES, value_map);
                gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->time_spin),
-                       trigger.u.rel_duration.minutes);
+                       i_cal_duration_get_minutes (duration));
        } else {
                e_dialog_combo_box_set (page_reminders->priv->unit_combo, MINUTES, value_map);
                gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->time_spin), 0);
        }
 
        /* Repeat options */
-       e_cal_component_alarm_get_repeat (alarm, &repeat);
+       repeat = e_cal_component_alarm_get_repeat (alarm);
 
-       if (repeat.repetitions) {
+       if (e_cal_component_alarm_repeat_get_repetitions (repeat)) {
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page_reminders->priv->repeat_check), TRUE);
                gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->repeat_times_spin),
-                       repeat.repetitions);
+                       e_cal_component_alarm_repeat_get_repetitions (repeat));
 
-               if (repeat.duration.minutes) {
+               duration = e_cal_component_alarm_repeat_get_interval (repeat);
+
+               if (i_cal_duration_get_minutes (duration)) {
                        e_dialog_combo_box_set (page_reminders->priv->repeat_unit_combo, DUR_MINUTES, 
duration_units_map);
                        gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin),
-                               repeat.duration.minutes);
+                               i_cal_duration_get_minutes (duration));
                }
 
-               if (repeat.duration.hours) {
+               if (i_cal_duration_get_hours (duration)) {
                        e_dialog_combo_box_set (page_reminders->priv->repeat_unit_combo, DUR_HOURS, 
duration_units_map);
                        gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin),
-                               repeat.duration.hours);
+                               i_cal_duration_get_hours (duration));
                }
 
-               if (repeat.duration.days) {
+               if (i_cal_duration_get_days (duration)) {
                        e_dialog_combo_box_set (page_reminders->priv->repeat_unit_combo, DUR_DAYS, 
duration_units_map);
                        gtk_spin_button_set_value (GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin),
-                               repeat.duration.days);
+                               i_cal_duration_get_days (duration));
                }
        } else {
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page_reminders->priv->repeat_check), FALSE);
@@ -448,11 +460,17 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
 
        switch (action) {
        case E_CAL_COMPONENT_ALARM_AUDIO: {
-               const gchar *url;
-               icalattach *attach = NULL;
+               GSList *attachments;
+               const gchar *url = NULL;
+
+               attachments = e_cal_component_alarm_get_attachments (alarm);
+               /* Audio alarm can have only one attachment, the file to play */
+               if (attachments && !attachments->next) {
+                       ICalAttach *attach = attachments->data;
+
+                       url = attach ? i_cal_attach_get_url (attach) : NULL;
+               }
 
-               e_cal_component_alarm_get_attach (alarm, &attach);
-               url = attach ? icalattach_get_url (attach) : NULL;
                if (url && *url) {
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_sound_check), TRUE);
                        gtk_file_chooser_set_uri (GTK_FILE_CHOOSER 
(page_reminders->priv->custom_sound_chooser), url);
@@ -460,19 +478,16 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_sound_check), FALSE);
                        gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER 
(page_reminders->priv->custom_sound_chooser));
                }
-
-               if (attach)
-                       icalattach_unref (attach);
                } break;
 
        case E_CAL_COMPONENT_ALARM_DISPLAY: {
-               ECalComponentText description;
+               ECalComponentText* description;
 
-               e_cal_component_alarm_get_description (alarm, &description);
+               description = e_cal_component_alarm_get_description (alarm);
 
-               if (description.value && *description.value) {
+               if (description && e_cal_component_text_get_value (description) && 
e_cal_component_text_get_value (description)[0]) {
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_message_check), TRUE);
-                       ecep_reminders_set_text_view_text (page_reminders->priv->custom_message_text_view, 
description.value);
+                       ecep_reminders_set_text_view_text (page_reminders->priv->custom_message_text_view, 
e_cal_component_text_get_value (description));
                } else {
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_message_check), FALSE);
                        ecep_reminders_set_text_view_text (page_reminders->priv->custom_message_text_view, 
NULL);
@@ -482,38 +497,36 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
        case E_CAL_COMPONENT_ALARM_EMAIL: {
                ENameSelectorModel *name_selector_model;
                EDestinationStore *destination_store;
-               ECalComponentText description;
-               GSList *attendee_list, *link;
+               ECalComponentText *description;
+               GSList *attendees, *link;
 
                /* Attendees */
                name_selector_model = e_name_selector_peek_model (page_reminders->priv->name_selector);
                e_name_selector_model_peek_section (name_selector_model, SECTION_NAME, NULL, 
&destination_store);
 
-               e_cal_component_alarm_get_attendee_list (alarm, &attendee_list);
-               for (link = attendee_list; link; link = g_slist_next (link)) {
-                       ECalComponentAttendee *a = link->data;
+               attendees = e_cal_component_alarm_get_attendees (alarm);
+               for (link = attendees; link; link = g_slist_next (link)) {
+                       ECalComponentAttendee *att = link->data;
                        EDestination *dest;
 
                        dest = e_destination_new ();
 
-                       if (a->cn && *a->cn)
-                               e_destination_set_name (dest, a->cn);
+                       if (att && e_cal_component_attendee_get_cn (att) && e_cal_component_attendee_get_cn 
(att)[0])
+                               e_destination_set_name (dest, e_cal_component_attendee_get_cn (att));
 
-                       if (a->value && *a->value)
-                               e_destination_set_email (dest, itip_strip_mailto (a->value));
+                       if (att && e_cal_component_attendee_get_value (att) && 
e_cal_component_attendee_get_value (att)[0])
+                               e_destination_set_email (dest, itip_strip_mailto 
(e_cal_component_attendee_get_value (att)));
 
                        e_destination_store_append_destination (destination_store, dest);
 
                        g_object_unref (dest);
                }
 
-               e_cal_component_free_attendee_list (attendee_list);
-
                /* Description */
-               e_cal_component_alarm_get_description (alarm, &description);
-               if (description.value && *description.value) {
+               description = e_cal_component_alarm_get_description (alarm);
+               if (description && e_cal_component_text_get_value (description) && 
e_cal_component_text_get_value (description)[0]) {
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_email_message_check), TRUE);
-                       ecep_reminders_set_text_view_text 
(page_reminders->priv->custom_email_message_text_view, description.value);
+                       ecep_reminders_set_text_view_text 
(page_reminders->priv->custom_email_message_text_view, e_cal_component_text_get_value (description));
                } else {
                        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_email_message_check), FALSE);
                        ecep_reminders_set_text_view_text 
(page_reminders->priv->custom_email_message_text_view, NULL);
@@ -521,26 +534,27 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
                } break;
 
        case E_CAL_COMPONENT_ALARM_PROCEDURE: {
-               const gchar *url;
-               icalattach *attach = NULL;
+               const gchar *url = NULL;
+               GSList *attachments;
 
-               e_cal_component_alarm_get_attach (alarm, (&attach));
-               url = attach ? icalattach_get_url (attach) : NULL;
+               attachments = e_cal_component_alarm_get_attachments (alarm);
+               if (attachments && !attachments->next) {
+                       ICalAttach *attach = attachments->data;
+                       url = attach ? i_cal_attach_get_url (attach) : NULL;
+               }
 
                if (url && *url) {
-                       ECalComponentText description;
+                       ECalComponentText *description;
 
-                       e_cal_component_alarm_get_description (alarm, &description);
+                       description = e_cal_component_alarm_get_description (alarm);
 
                        gtk_entry_set_text (GTK_ENTRY (page_reminders->priv->custom_app_path_entry), url);
-                       gtk_entry_set_text (GTK_ENTRY (page_reminders->priv->custom_app_args_entry), 
description.value ? description.value : "");
+                       gtk_entry_set_text (GTK_ENTRY (page_reminders->priv->custom_app_args_entry),
+                               (description && e_cal_component_text_get_value (description)) ? 
e_cal_component_text_get_value (description) : "");
                } else {
                        gtk_entry_set_text (GTK_ENTRY (page_reminders->priv->custom_app_path_entry), "");
                        gtk_entry_set_text (GTK_ENTRY (page_reminders->priv->custom_app_args_entry), "");
                }
-
-               if (attach)
-                       icalattach_unref (attach);
                } break;
        default:
                g_warning ("%s: Unexpected alarm action (%d)", G_STRLOC, action);
@@ -552,10 +566,11 @@ ecep_reminders_selected_to_widgets (ECompEditorPageReminders *page_reminders)
 static void
 ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
 {
-       ECalComponentAlarmTrigger trigger;
+       ECalComponentAlarmTrigger *trigger;
        ECalComponentAlarmAction action;
-       ECalComponentAlarmRepeat repeat;
+       ECalComponentAlarmRepeat *repeat = NULL;
        ECalComponentAlarm *alarm;
+       ICalDuration *duration;
        GtkTreeSelection *selection;
        GtkTreeIter iter;
 
@@ -570,71 +585,75 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
 
        alarm = e_cal_component_alarm_new ();
 
-       /* Fill out the alarm */
-       memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger));
+       duration = i_cal_duration_null_duration ();
 
-       trigger.type = e_dialog_combo_box_get (page_reminders->priv->relative_to_combo, time_map);
        if (e_dialog_combo_box_get (page_reminders->priv->relative_time_combo, relative_map) == BEFORE)
-               trigger.u.rel_duration.is_neg = 1;
+               i_cal_duration_set_is_neg (duration, TRUE);
        else
-               trigger.u.rel_duration.is_neg = 0;
+               i_cal_duration_set_is_neg (duration, FALSE);
 
        switch (e_dialog_combo_box_get (page_reminders->priv->unit_combo, value_map)) {
        case MINUTES:
-               trigger.u.rel_duration.minutes = gtk_spin_button_get_value_as_int (
-                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin));
+               i_cal_duration_set_minutes (duration, gtk_spin_button_get_value_as_int (
+                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin)));
                break;
 
        case HOURS:
-               trigger.u.rel_duration.hours = gtk_spin_button_get_value_as_int (
-                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin));
+               i_cal_duration_set_hours (duration, gtk_spin_button_get_value_as_int (
+                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin)));
                break;
 
        case DAYS:
-               trigger.u.rel_duration.days = gtk_spin_button_get_value_as_int (
-                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin));
+               i_cal_duration_set_days (duration, gtk_spin_button_get_value_as_int (
+                       GTK_SPIN_BUTTON (page_reminders->priv->time_spin)));
                break;
 
        default:
                g_return_if_reached ();
        }
-       e_cal_component_alarm_set_trigger (alarm, trigger);
+
+       trigger = e_cal_component_alarm_trigger_new_relative (
+               e_dialog_combo_box_get (page_reminders->priv->relative_to_combo, time_map),
+               duration);
+
+       g_object_unref (duration);
+
+       e_cal_component_alarm_take_trigger (alarm, trigger);
 
        action = e_dialog_combo_box_get (page_reminders->priv->kind_combo, action_map);
        e_cal_component_alarm_set_action (alarm, action);
 
        /* Repeat stuff */
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page_reminders->priv->repeat_check))) {
-               repeat.repetitions = gtk_spin_button_get_value_as_int (
-                       GTK_SPIN_BUTTON (page_reminders->priv->repeat_times_spin));
-
-               memset (&repeat.duration, 0, sizeof (repeat.duration));
+               duration = i_cal_duration_null_duration ();
 
                switch (e_dialog_combo_box_get (page_reminders->priv->repeat_unit_combo, duration_units_map)) 
{
                case DUR_MINUTES:
-                       repeat.duration.minutes = gtk_spin_button_get_value_as_int (
-                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin));
+                       i_cal_duration_set_minutes (duration, gtk_spin_button_get_value_as_int (
+                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin)));
                        break;
 
                case DUR_HOURS:
-                       repeat.duration.hours = gtk_spin_button_get_value_as_int (
-                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin));
+                       i_cal_duration_set_hours (duration, gtk_spin_button_get_value_as_int (
+                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin)));
                        break;
 
                case DUR_DAYS:
-                       repeat.duration.days = gtk_spin_button_get_value_as_int (
-                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin));
+                       i_cal_duration_set_days (duration, gtk_spin_button_get_value_as_int (
+                               GTK_SPIN_BUTTON (page_reminders->priv->repeat_every_spin)));
                        break;
 
                default:
                        g_return_if_reached ();
                }
-       } else {
-               memset (&repeat, 0, sizeof (repeat));
-               repeat.repetitions = 0;
+
+               repeat = e_cal_component_alarm_repeat_new (gtk_spin_button_get_value_as_int (
+                       GTK_SPIN_BUTTON (page_reminders->priv->repeat_times_spin)), duration);
+
+               g_object_unref (duration);
        }
 
-       e_cal_component_alarm_set_repeat (alarm, repeat);
+       e_cal_component_alarm_take_repeat (alarm, repeat);
 
        /* Options */
        switch (action) {
@@ -649,11 +668,12 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
                        url = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER 
(page_reminders->priv->custom_sound_chooser));
 
                        if (url && *url) {
-                               icalattach *attach;
+                               ICalAttach *attach;
+                               GSList *attachments;
 
-                               attach = icalattach_new_from_url (url);
-                               e_cal_component_alarm_set_attach (alarm, attach);
-                               icalattach_unref (attach);
+                               attach = i_cal_attach_new_from_url (url);
+                               attachments = g_slist_prepend (NULL, attach);
+                               e_cal_component_alarm_take_attachments (alarm, attachments);
                        }
 
                        g_free (url);
@@ -676,15 +696,15 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
 
        case E_CAL_COMPONENT_ALARM_DISPLAY:
                if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_message_check))) {
-                       ECalComponentText description;
                        gchar *text;
 
                        text = ecep_reminders_get_text_view_text 
(page_reminders->priv->custom_message_text_view);
                        if (text && *text) {
-                               description.value = text;
-                               description.altrep = NULL;
+                               ECalComponentText *description;
 
-                               e_cal_component_alarm_set_description (alarm, &description);
+                               description = e_cal_component_text_new (text, NULL);
+
+                               e_cal_component_alarm_take_description (alarm, description);
 
                                ecep_reminders_remove_needs_description_property (alarm);
                        }
@@ -694,7 +714,7 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
                break;
 
        case E_CAL_COMPONENT_ALARM_EMAIL: {
-               GSList *attendee_list = NULL;
+               GSList *attendees = NULL;
                ENameSelectorModel *name_selector_model;
                EDestinationStore *destination_store;
                GList *destinations, *link;
@@ -706,33 +726,35 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
 
                for (link = destinations; link; link = g_list_next (link)) {
                        EDestination *dest = link->data;
-                       ECalComponentAttendee *a;
+                       ECalComponentAttendee *att;
+                       gchar *mailto;
+
+                       mailto = g_strconcat ("mailto:";, e_destination_get_email (dest), NULL);
+                       att = e_cal_component_attendee_new ();
+                       e_cal_component_attendee_set_value (att, mailto);
+                       e_cal_component_attendee_set_cn (att, e_destination_get_name (dest));
+                       e_cal_component_attendee_set_cutype (att, I_CAL_CUTYPE_INDIVIDUAL);
+                       e_cal_component_attendee_set_partstat (att, I_CAL_PARTSTAT_NEEDSACTION);
+                       e_cal_component_attendee_set_role (att, I_CAL_ROLE_REQPARTICIPANT);
 
-                       a = g_new0 (ECalComponentAttendee, 1);
-                       a->value = e_destination_get_email (dest);
-                       a->cn = e_destination_get_name (dest);
-                       a->cutype = ICAL_CUTYPE_INDIVIDUAL;
-                       a->status = ICAL_PARTSTAT_NEEDSACTION;
-                       a->role = ICAL_ROLE_REQPARTICIPANT;
+                       attendees = g_slist_prepend (attendees, att);
 
-                       attendee_list = g_slist_append (attendee_list, a);
+                       g_free (mailto);
                }
 
-               e_cal_component_alarm_set_attendee_list (alarm, attendee_list);
+               e_cal_component_alarm_take_attendees (alarm, g_slist_reverse (attendees));
 
-               e_cal_component_free_attendee_list (attendee_list);
                g_list_free (destinations);
 
                if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(page_reminders->priv->custom_email_message_check))) {
-                       ECalComponentText description;
                        gchar *text;
 
                        text = ecep_reminders_get_text_view_text 
(page_reminders->priv->custom_email_message_text_view);
                        if (text && *text) {
-                               description.value = text;
-                               description.altrep = NULL;
+                               ECalComponentText *description;
 
-                               e_cal_component_alarm_set_description (alarm, &description);
+                               description = e_cal_component_text_new (text, NULL);
+                               e_cal_component_alarm_take_description (alarm, description);
 
                                ecep_reminders_remove_needs_description_property (alarm);
                        }
@@ -742,22 +764,20 @@ ecep_reminders_widgets_to_selected (ECompEditorPageReminders *page_reminders)
                } break;
 
        case E_CAL_COMPONENT_ALARM_PROCEDURE: {
-               ECalComponentText description;
-               icalattach *attach;
+               ECalComponentText *description;
+               GSList *attachments;
                const gchar *text;
 
                text = gtk_entry_get_text (GTK_ENTRY (page_reminders->priv->custom_app_path_entry));
 
-               attach = icalattach_new_from_url (text ? text : "");
-               e_cal_component_alarm_set_attach (alarm, attach);
-               icalattach_unref (attach);
+               attachments = g_slist_prepend (NULL, i_cal_attach_new_from_url (text ? text : ""));
+               e_cal_component_alarm_take_attachments (alarm, attachments);
 
                text = gtk_entry_get_text (GTK_ENTRY (page_reminders->priv->custom_app_args_entry));
 
-               description.value = text;
-               description.altrep = NULL;
+               description = e_cal_component_text_new (text, NULL);
 
-               e_cal_component_alarm_set_description (alarm, &description);
+               e_cal_component_alarm_take_description (alarm, description);
                ecep_reminders_remove_needs_description_property (alarm);
                } break;
 
@@ -793,7 +813,7 @@ ecep_reminders_alarms_combo_changed_cb (GtkComboBox *combo_box,
                                        ECompEditorPageReminders *page_reminders)
 {
        ECalComponentAlarm *alarm;
-       ECalComponentAlarmTrigger trigger;
+       ICalDuration *duration;
        gint alarm_type;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_REMINDERS (page_reminders));
@@ -830,35 +850,35 @@ ecep_reminders_alarms_combo_changed_cb (GtkComboBox *combo_box,
 
        e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
 
-       memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger));
-       trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-       trigger.u.rel_duration.is_neg = 1;
+       duration = i_cal_duration_null_duration ();
+
+       i_cal_duration_set_is_neg (duration, TRUE);
 
        switch (alarm_type) {
        case ALARM_15_MINUTES:
-               trigger.u.rel_duration.minutes = 15;
+               i_cal_duration_set_minutes (duration, 15);
                break;
 
        case ALARM_1_HOUR:
-               trigger.u.rel_duration.hours = 1;
+               i_cal_duration_set_hours (duration, 1);
                break;
 
        case ALARM_1_DAY:
-               trigger.u.rel_duration.days = 1;
+               i_cal_duration_set_days (duration, 1);
                break;
 
        case ALARM_USER_TIME:
                switch (page_reminders->priv->alarm_units) {
                case E_DURATION_DAYS:
-                       trigger.u.rel_duration.days = page_reminders->priv->alarm_interval;
+                       i_cal_duration_set_days (duration, page_reminders->priv->alarm_interval);
                        break;
 
                case E_DURATION_HOURS:
-                       trigger.u.rel_duration.hours = page_reminders->priv->alarm_interval;
+                       i_cal_duration_set_hours (duration, page_reminders->priv->alarm_interval);
                        break;
 
                case E_DURATION_MINUTES:
-                       trigger.u.rel_duration.minutes = page_reminders->priv->alarm_interval;
+                       i_cal_duration_set_minutes (duration, page_reminders->priv->alarm_interval);
                        break;
                }
                break;
@@ -867,10 +887,12 @@ ecep_reminders_alarms_combo_changed_cb (GtkComboBox *combo_box,
                break;
        }
 
-       e_cal_component_alarm_set_trigger (alarm, trigger);
+       e_cal_component_alarm_take_trigger (alarm,
+               e_cal_component_alarm_trigger_new_relative (E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, 
duration));
        ecep_reminders_add_needs_description_property (alarm);
        e_alarm_list_append (page_reminders->priv->alarm_list, NULL, alarm);
        e_cal_component_alarm_free (alarm);
+       g_object_unref (duration);
 }
 
 static void
@@ -880,7 +902,7 @@ ecep_reminders_alarms_add_clicked_cb (GtkButton *button,
        GtkTreeSelection *selection;
        GtkTreeIter iter;
        ECalComponentAlarm *alarm;
-       ECalComponentAlarmTrigger trigger;
+       ICalDuration *duration;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_REMINDERS (page_reminders));
 
@@ -888,13 +910,14 @@ ecep_reminders_alarms_add_clicked_cb (GtkButton *button,
 
        ecep_reminders_add_needs_description_property (alarm);
 
-       memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger));
-       trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-       trigger.u.rel_duration.is_neg = 1;
-       trigger.u.rel_duration.minutes = 15;
+       duration = i_cal_duration_null_duration ();
+       i_cal_duration_set_is_neg (duration, TRUE);
+       i_cal_duration_set_minutes (duration, 15);
 
        e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
-       e_cal_component_alarm_set_trigger (alarm, trigger);
+       e_cal_component_alarm_take_trigger (alarm,
+               e_cal_component_alarm_trigger_new_relative (E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, 
duration));
+       g_object_unref (duration);
 
        e_alarm_list_append (page_reminders->priv->alarm_list, &iter, alarm);
 
@@ -963,7 +986,7 @@ ecep_reminders_set_alarm_email (ECompEditorPageReminders *page_reminders)
        target_client = e_comp_editor_get_target_client (comp_editor);
 
        if (target_client &&
-           !e_client_check_capability (E_CLIENT (target_client), CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS)) {
+           !e_client_check_capability (E_CLIENT (target_client), E_CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS)) {
                ENameSelectorModel *selector_model;
                EDestinationStore *destination_store = NULL;
                const gchar *alarm_email;
@@ -1082,65 +1105,68 @@ ecep_reminders_is_custom_alarm (ECalComponentAlarm *ca,
                                gint user_interval,
                                gint *alarm_type)
 {
-       ECalComponentAlarmTrigger trigger;
-       ECalComponentAlarmRepeat repeat;
+       ECalComponentAlarmTrigger *trigger;
+       ECalComponentAlarmRepeat *repeat;
        ECalComponentAlarmAction action;
-       ECalComponentText desc;
-       icalattach *attach;
+       ECalComponentText *desc;
+       ICalDuration *duration;
+       GSList *attachments;
 
-       e_cal_component_alarm_get_action (ca, &action);
+       action = e_cal_component_alarm_get_action (ca);
        if (action != E_CAL_COMPONENT_ALARM_DISPLAY)
                return TRUE;
 
-       e_cal_component_alarm_get_attach (ca, &attach);
-       if (attach)
+       attachments = e_cal_component_alarm_get_attachments (ca);
+       if (attachments)
                return TRUE;
 
        if (!ecep_reminders_has_needs_description_property (ca)) {
-               e_cal_component_alarm_get_description (ca, &desc);
-               if (!desc.value || !old_summary || strcmp (desc.value, old_summary))
+               desc = e_cal_component_alarm_get_description (ca);
+               if (!desc || !e_cal_component_text_get_value (desc) ||
+                   !old_summary || strcmp (e_cal_component_text_get_value (desc), old_summary))
                        return TRUE;
        }
 
-       e_cal_component_alarm_get_repeat (ca, &repeat);
-       if (repeat.repetitions != 0)
+       repeat = e_cal_component_alarm_get_repeat (ca);
+       if (repeat && e_cal_component_alarm_repeat_get_repetitions (repeat) != 0)
                return TRUE;
 
        if (e_cal_component_alarm_has_attendees (ca))
                return TRUE;
 
-       e_cal_component_alarm_get_trigger (ca, &trigger);
-       if (trigger.type != E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START)
+       trigger = e_cal_component_alarm_get_trigger (ca);
+       if (!trigger || e_cal_component_alarm_trigger_get_kind (trigger) != 
E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START)
                return TRUE;
 
-       if (trigger.u.rel_duration.is_neg != 1)
+       duration = e_cal_component_alarm_trigger_get_duration (trigger);
+       if (!duration || i_cal_duration_is_neg (duration) != 1)
                return TRUE;
 
-       if (trigger.u.rel_duration.weeks != 0)
+       if (i_cal_duration_get_weeks (duration) != 0)
                return TRUE;
 
-       if (trigger.u.rel_duration.seconds != 0)
+       if (i_cal_duration_get_seconds (duration) != 0)
                return TRUE;
 
-       if (trigger.u.rel_duration.days == 1
-           && trigger.u.rel_duration.hours == 0
-           && trigger.u.rel_duration.minutes == 0) {
+       if (i_cal_duration_get_days (duration) == 1 &&
+           i_cal_duration_get_hours (duration) == 0 &&
+           i_cal_duration_get_minutes (duration) == 0) {
                if (alarm_type)
                        *alarm_type = ALARM_1_DAY;
                return FALSE;
        }
 
-       if (trigger.u.rel_duration.days == 0
-           && trigger.u.rel_duration.hours == 1
-           && trigger.u.rel_duration.minutes == 0) {
+       if (i_cal_duration_get_days (duration) == 0 &&
+           i_cal_duration_get_hours (duration) == 1 &&
+           i_cal_duration_get_minutes (duration) == 0) {
                if (alarm_type)
                        *alarm_type = ALARM_1_HOUR;
                return FALSE;
        }
 
-       if (trigger.u.rel_duration.days == 0
-           && trigger.u.rel_duration.hours == 0
-           && trigger.u.rel_duration.minutes == 15) {
+       if (i_cal_duration_get_days (duration) == 0 &&
+           i_cal_duration_get_hours (duration) == 0 &&
+           i_cal_duration_get_minutes (duration) == 15) {
                if (alarm_type)
                        *alarm_type = ALARM_15_MINUTES;
                return FALSE;
@@ -1149,9 +1175,9 @@ ecep_reminders_is_custom_alarm (ECalComponentAlarm *ca,
        if (user_interval != -1) {
                switch (user_units) {
                case E_DURATION_DAYS:
-                       if (trigger.u.rel_duration.days == user_interval
-                           && trigger.u.rel_duration.hours == 0
-                           && trigger.u.rel_duration.minutes == 0) {
+                       if (i_cal_duration_get_days (duration) == user_interval &&
+                           i_cal_duration_get_hours (duration) == 0 &&
+                           i_cal_duration_get_minutes (duration) == 0) {
                                if (alarm_type)
                                        *alarm_type = ALARM_USER_TIME;
                                return FALSE;
@@ -1159,9 +1185,9 @@ ecep_reminders_is_custom_alarm (ECalComponentAlarm *ca,
                        break;
 
                case E_DURATION_HOURS:
-                       if (trigger.u.rel_duration.days == 0
-                           && trigger.u.rel_duration.hours == user_interval
-                           && trigger.u.rel_duration.minutes == 0) {
+                       if (i_cal_duration_get_days (duration) == 0 &&
+                           i_cal_duration_get_hours (duration) == user_interval &&
+                           i_cal_duration_get_minutes (duration) == 0) {
                                if (alarm_type)
                                        *alarm_type = ALARM_USER_TIME;
                                return FALSE;
@@ -1169,9 +1195,9 @@ ecep_reminders_is_custom_alarm (ECalComponentAlarm *ca,
                        break;
 
                case E_DURATION_MINUTES:
-                       if (trigger.u.rel_duration.days == 0
-                           && trigger.u.rel_duration.hours == 0
-                           && trigger.u.rel_duration.minutes == user_interval) {
+                       if (i_cal_duration_get_days (duration) == 0 &&
+                           i_cal_duration_get_hours (duration) == 0 &&
+                           i_cal_duration_get_minutes (duration) == user_interval) {
                                if (alarm_type)
                                        *alarm_type = ALARM_USER_TIME;
                                return FALSE;
@@ -1185,7 +1211,7 @@ ecep_reminders_is_custom_alarm (ECalComponentAlarm *ca,
 
 static gboolean
 ecep_reminders_is_custom_alarm_uid_list (ECalComponent *comp,
-                                        GList *alarms,
+                                        GSList *alarm_uids,
                                         const gchar *old_summary,
                                         EDurationType user_units,
                                         gint user_interval,
@@ -1194,10 +1220,13 @@ ecep_reminders_is_custom_alarm_uid_list (ECalComponent *comp,
        ECalComponentAlarm *ca;
        gboolean result;
 
-       if (g_list_length (alarms) > 1)
+       if (!alarm_uids)
+               return FALSE;
+
+       if (alarm_uids->next)
                return TRUE;
 
-       ca = e_cal_component_get_alarm (comp, alarms->data);
+       ca = e_cal_component_get_alarm (comp, alarm_uids->data);
        result = ecep_reminders_is_custom_alarm (ca, old_summary, user_units, user_interval, alarm_type);
        e_cal_component_alarm_free (ca);
 
@@ -1269,7 +1298,7 @@ ecep_reminders_sensitize_relative_time_combo_items (GtkWidget *combobox,
        gboolean alarm_after_start;
        gint ii;
 
-       alarm_after_start = !e_client_check_capability (client, CAL_STATIC_CAPABILITY_NO_ALARM_AFTER_START);
+       alarm_after_start = !e_client_check_capability (client, E_CAL_STATIC_CAPABILITY_NO_ALARM_AFTER_START);
        model = gtk_combo_box_get_model (GTK_COMBO_BOX (combobox));
        valid = gtk_tree_model_get_iter_first (model, &iter);
 
@@ -1312,7 +1341,7 @@ ecep_reminders_sensitize_widgets_by_client (ECompEditorPageReminders *page_remin
                target_client, time_map, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END);
 
        /* If the client doesn't support set alarm description, disable the related widgets */
-       if (e_client_check_capability (target_client, CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION)) {
+       if (e_client_check_capability (target_client, E_CAL_STATIC_CAPABILITY_ALARM_DESCRIPTION)) {
                gtk_widget_show (page_reminders->priv->custom_message_check);
                gtk_widget_show (page_reminders->priv->custom_message_text_view);
        } else {
@@ -1325,7 +1354,7 @@ ecep_reminders_sensitize_widgets_by_client (ECompEditorPageReminders *page_remin
 
        /* If we can repeat */
        gtk_widget_set_sensitive (page_reminders->priv->repeat_check,
-               !e_client_check_capability (target_client, CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT));
+               !e_client_check_capability (target_client, E_CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT));
 }
 
 static void
@@ -1365,13 +1394,14 @@ ecep_reminders_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_reminders_fill_widgets (ECompEditorPage *page,
-                            icalcomponent *component)
+                            ICalComponent *component)
 {
        ECompEditorPageReminders *page_reminders;
        ECalComponent *comp;
+       ICalComponent *valarm;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_REMINDERS (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_reminders_parent_class)->fill_widgets (page, component);
 
@@ -1379,19 +1409,22 @@ ecep_reminders_fill_widgets (ECompEditorPage *page,
 
        e_alarm_list_clear (page_reminders->priv->alarm_list);
 
-       if (!icalcomponent_get_first_component (component, ICAL_VALARM_COMPONENT)) {
+       valarm = i_cal_component_get_first_component (component, I_CAL_VALARM_COMPONENT);
+       if (!valarm) {
                e_dialog_combo_box_set (page_reminders->priv->alarms_combo, ALARM_NONE, 
page_reminders->priv->alarm_map);
                return;
        }
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (component));
+       g_object_unref (valarm);
+
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (component));
        if (comp && e_cal_component_has_alarms (comp)) {
-               GList *alarms, *link;
-               gint alarm_type;
+               GSList *alarms, *link;
+               gint alarm_type = ALARM_NONE;
 
                alarms = e_cal_component_get_alarm_uids (comp);
 
-               if (ecep_reminders_is_custom_alarm_uid_list (comp, alarms, icalcomponent_get_summary 
(component),
+               if (ecep_reminders_is_custom_alarm_uid_list (comp, alarms, i_cal_component_get_summary 
(component),
                        page_reminders->priv->alarm_units, page_reminders->priv->alarm_interval, &alarm_type))
                        alarm_type = ALARM_CUSTOM;
 
@@ -1399,7 +1432,7 @@ ecep_reminders_fill_widgets (ECompEditorPage *page,
 
                e_alarm_list_clear (page_reminders->priv->alarm_list);
 
-               for (link = alarms; link; link = g_list_next (link)) {
+               for (link = alarms; link; link = g_slist_next (link)) {
                        ECalComponentAlarm *ca;
                        const gchar *uid = link->data;
 
@@ -1408,7 +1441,7 @@ ecep_reminders_fill_widgets (ECompEditorPage *page,
                        e_cal_component_alarm_free (ca);
                }
 
-               cal_obj_uid_list_free (alarms);
+               g_slist_free_full (alarms, g_free);
 
                if (e_dialog_combo_box_get (page_reminders->priv->alarms_combo, 
page_reminders->priv->alarm_map) == ALARM_CUSTOM) {
                        GtkTreeSelection *selection;
@@ -1427,22 +1460,22 @@ ecep_reminders_fill_widgets (ECompEditorPage *page,
 
 static gboolean
 ecep_reminders_fill_component (ECompEditorPage *page,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        ECompEditorPageReminders *page_reminders;
        ECalComponent *comp;
-       icalcomponent *changed_comp, *alarm;
+       ICalComponent *changed_comp, *alarm;
        GtkTreeModel *model;
        GtkTreeIter iter;
        gboolean valid_iter;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE_REMINDERS (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        if (!E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_reminders_parent_class)->fill_component (page, 
component))
                return TRUE;
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (component));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (component));
        g_return_val_if_fail (comp != NULL, FALSE);
 
        page_reminders = E_COMP_EDITOR_PAGE_REMINDERS (page);
@@ -1456,8 +1489,7 @@ ecep_reminders_fill_component (ECompEditorPage *page,
             valid_iter = gtk_tree_model_iter_next (model, &iter)) {
                ECalComponentAlarm *alarm, *alarm_copy;
                ECalComponentAlarmAction action = E_CAL_COMPONENT_ALARM_UNKNOWN;
-               icalcomponent *icalcomp;
-               icalproperty *prop;
+               ECalComponentPropertyBag *bag;
 
                alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (page_reminders->priv->alarm_list, 
&iter);
                if (!alarm) {
@@ -1468,79 +1500,73 @@ ecep_reminders_fill_component (ECompEditorPage *page,
                /* We set the description of the alarm if it's got
                 * the X-EVOLUTION-NEEDS-DESCRIPTION property.
                 */
-               icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
-               for (prop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
-                    prop;
-                    prop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) {
-                       const gchar *x_name;
-
-                       x_name = icalproperty_get_x_name (prop);
-                       if (g_str_equal (x_name, X_EVOLUTION_NEEDS_DESCRIPTION)) {
-                               ECalComponentText summary;
-
-                               e_cal_component_get_summary (comp, &summary);
-                               e_cal_component_alarm_set_description (alarm, &summary);
-
-                               icalcomponent_remove_property (icalcomp, prop);
-                               icalproperty_free (prop);
-                               break;
-                       }
+               if (ecep_reminders_remove_needs_description_property (alarm)) {
+                       ECalComponentText *summary;
+
+                       summary = e_cal_component_get_summary (comp);
+                       e_cal_component_alarm_take_description (alarm, summary);
                }
 
-               e_cal_component_alarm_get_action (alarm, &action);
+               action = e_cal_component_alarm_get_action (alarm);
 
-               prop = icalcomponent_get_first_property (icalcomp, ICAL_SUMMARY_PROPERTY);
+               bag = e_cal_component_alarm_get_property_bag (alarm);
                if (action == E_CAL_COMPONENT_ALARM_EMAIL) {
-                       ECalComponentText summary = { NULL, NULL };
+                       ECalComponentText *summary;
+                       const gchar *text;
+                       guint idx;
+
+                       summary = e_cal_component_get_summary (comp);
+                       text = (summary && e_cal_component_text_get_value (summary)) ? 
e_cal_component_text_get_value (summary) : "";
 
-                       e_cal_component_get_summary (comp, &summary);
+                       idx = e_cal_component_property_bag_get_first_by_kind (bag, I_CAL_SUMMARY_PROPERTY);
+                       if (idx < e_cal_component_property_bag_get_count (bag)) {
+                               ICalProperty *prop;
 
-                       if (prop) {
-                               icalproperty_set_summary (prop, summary.value ? summary.value : "");
+                               prop = e_cal_component_property_bag_get (bag, idx);
+                               i_cal_property_set_summary (prop, text);
                        } else {
-                               prop = icalproperty_new_summary (summary.value ? summary.value : "");
-                               icalcomponent_add_property (icalcomp, prop);
+                               e_cal_component_property_bag_take (bag, i_cal_property_new_summary (text));
                        }
-               } else if (prop) {
-                       icalcomponent_remove_property (icalcomp, prop);
-                       icalproperty_free (prop);
+
+                       e_cal_component_text_free (summary);
+               } else {
+                       e_cal_component_property_bag_remove_by_kind (bag, I_CAL_SUMMARY_PROPERTY, TRUE);
                }
 
-               prop = icalcomponent_get_first_property (icalcomp, ICAL_DESCRIPTION_PROPERTY);
                if (action == E_CAL_COMPONENT_ALARM_EMAIL || action == E_CAL_COMPONENT_ALARM_DISPLAY) {
-                       if (!prop) {
+                       if (e_cal_component_property_bag_get_first_by_kind (bag, I_CAL_DESCRIPTION_PROPERTY) 
=
+                           e_cal_component_property_bag_get_count (bag)) {
                                const gchar *description;
 
-                               description = icalcomponent_get_description 
(e_cal_component_get_icalcomponent (comp));
+                               description = i_cal_component_get_description 
(e_cal_component_get_icalcomponent (comp));
 
-                               prop = icalproperty_new_description (description ? description : "");
-                               icalcomponent_add_property (icalcomp, prop);
+                               e_cal_component_property_bag_take (bag, i_cal_property_new_description 
(description ? description : ""));
                        }
-               } else if (prop) {
-                       icalcomponent_remove_property (icalcomp, prop);
-                       icalproperty_free (prop);
+               } else {
+                       e_cal_component_property_bag_remove_by_kind (bag, I_CAL_DESCRIPTION_PROPERTY, TRUE);
                }
 
                /* We clone the alarm to maintain the invariant that the alarm
                 * structures in the list did *not* come from the component.
                 */
 
-               alarm_copy = e_cal_component_alarm_clone (alarm);
+               alarm_copy = e_cal_component_alarm_copy (alarm);
                e_cal_component_add_alarm (comp, alarm_copy);
                e_cal_component_alarm_free (alarm_copy);
        }
 
-       while (alarm = icalcomponent_get_first_component (component, ICAL_VALARM_COMPONENT), alarm) {
-               icalcomponent_remove_component (component, alarm);
-               icalcomponent_free (alarm);
+       while (alarm = i_cal_component_get_first_component (component, I_CAL_VALARM_COMPONENT), alarm) {
+               i_cal_component_remove_component (component, alarm);
+               g_object_unref (alarm);
        }
 
        changed_comp = e_cal_component_get_icalcomponent (comp);
        if (changed_comp) {
                /* Move all VALARM components into the right 'component' */
-               while (alarm = icalcomponent_get_first_component (changed_comp, ICAL_VALARM_COMPONENT), 
alarm) {
-                       icalcomponent_remove_component (changed_comp, alarm);
-                       icalcomponent_add_component (component, alarm);
+               while (alarm = i_cal_component_get_first_component (changed_comp, I_CAL_VALARM_COMPONENT), 
alarm) {
+                       i_cal_component_remove_component (changed_comp, alarm);
+                       i_cal_component_add_component (component, alarm);
+                       g_object_unref (alarm);
                }
        } else {
                g_warn_if_reached ();
diff --git a/src/calendar/gui/e-comp-editor-page-schedule.c b/src/calendar/gui/e-comp-editor-page-schedule.c
index dc44ea6df6..10c728c4b7 100644
--- a/src/calendar/gui/e-comp-editor-page-schedule.c
+++ b/src/calendar/gui/e-comp-editor-page-schedule.c
@@ -118,7 +118,7 @@ ecep_schedule_editor_times_changed_cb (ECompEditor *comp_editor,
        ECompEditorPropertyPartDatetime *dtstart, *dtend;
        ECompEditorPropertyPart *dtstart_part = NULL, *dtend_part = NULL;
        EDateEdit *start_date_edit, *end_date_edit;
-       struct icaltimetype start_tt, end_tt;
+       ICalTime *start_tt, *end_tt;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_SCHEDULE (page_schedule));
        g_return_if_fail (page_schedule->priv->selector != NULL);
@@ -134,23 +134,42 @@ ecep_schedule_editor_times_changed_cb (ECompEditor *comp_editor,
        start_tt = e_comp_editor_property_part_datetime_get_value (dtstart);
        end_tt = e_comp_editor_property_part_datetime_get_value (dtend);
 
+       if (!start_tt || !end_tt) {
+               g_clear_object (&start_tt);
+               g_clear_object (&end_tt);
+               return;
+       }
+
        /* For All Day Events, if DTEND is after DTSTART, we subtract 1 day from it. */
-       if (start_tt.is_date && end_tt.is_date &&
-           icaltime_compare_date_only (end_tt, start_tt) > 0)
-               icaltime_adjust (&end_tt, -1, 0, 0, 0);
+       if (i_cal_time_is_date (start_tt) && i_cal_time_is_date (end_tt) &&
+           i_cal_time_compare_date_only (end_tt, start_tt) > 0)
+               i_cal_time_adjust (end_tt, -1, 0, 0, 0);
 
        e_comp_editor_page_set_updating (E_COMP_EDITOR_PAGE (page_schedule), TRUE);
 
        start_date_edit = E_DATE_EDIT (page_schedule->priv->selector->start_date_edit);
        end_date_edit = E_DATE_EDIT (page_schedule->priv->selector->end_date_edit);
 
-       e_date_edit_set_date (start_date_edit, start_tt.year, start_tt.month, start_tt.day);
-       e_date_edit_set_time_of_day (start_date_edit, start_tt.hour, start_tt.minute);
-
-       e_date_edit_set_date (end_date_edit, end_tt.year, end_tt.month, end_tt.day);
-       e_date_edit_set_time_of_day (end_date_edit, end_tt.hour, end_tt.minute);
+       e_date_edit_set_date (start_date_edit,
+               i_cal_time_get_year (start_tt),
+               i_cal_time_get_month (start_tt),
+               i_cal_time_get_day (start_tt));
+       e_date_edit_set_time_of_day (start_date_edit,
+               i_cal_time_get_hour (start_tt),
+               i_cal_time_get_minute (start_tt));
+
+       e_date_edit_set_date (end_date_edit,
+               i_cal_time_get_year (end_tt),
+               i_cal_time_get_month (end_tt),
+               i_cal_time_get_day (end_tt));
+       e_date_edit_set_time_of_day (end_date_edit,
+               i_cal_time_get_hour (end_tt),
+               i_cal_time_get_minute (end_tt));
 
        e_comp_editor_page_set_updating (E_COMP_EDITOR_PAGE (page_schedule), FALSE);
+
+       g_clear_object (&start_tt);
+       g_clear_object (&end_tt);
 }
 
 static void
@@ -178,7 +197,8 @@ ecep_schedule_set_time_to_editor (ECompEditorPageSchedule *page_schedule)
        ECompEditorPropertyPartDatetime *dtstart, *dtend;
        ECompEditorPropertyPart *dtstart_part = NULL, *dtend_part = NULL;
        ECompEditor *comp_editor;
-       struct icaltimetype start_tt, end_tt;
+       ICalTime *start_tt, *end_tt;
+       gint year, month, day, hour, minute;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_SCHEDULE (page_schedule));
        g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (page_schedule->priv->selector));
@@ -199,42 +219,41 @@ ecep_schedule_set_time_to_editor (ECompEditorPageSchedule *page_schedule)
        start_tt = e_comp_editor_property_part_datetime_get_value (dtstart);
        end_tt = e_comp_editor_property_part_datetime_get_value (dtend);
 
-       e_date_edit_get_date (
-               E_DATE_EDIT (selector->start_date_edit),
-               &start_tt.year,
-               &start_tt.month,
-               &start_tt.day);
-       e_date_edit_get_time_of_day (
-               E_DATE_EDIT (selector->start_date_edit),
-               &start_tt.hour,
-               &start_tt.minute);
-       e_date_edit_get_date (
-               E_DATE_EDIT (selector->end_date_edit),
-               &end_tt.year,
-               &end_tt.month,
-               &end_tt.day);
-       e_date_edit_get_time_of_day (
-               E_DATE_EDIT (selector->end_date_edit),
-               &end_tt.hour,
-               &end_tt.minute);
+       if (!start_tt || !end_tt) {
+               g_clear_object (&start_tt);
+               g_clear_object (&end_tt);
+               return;
+       }
+
+       e_date_edit_get_date (E_DATE_EDIT (selector->start_date_edit), &year, &month, &day);
+       e_date_edit_get_time_of_day (E_DATE_EDIT (selector->start_date_edit), &hour, &minute);
+       i_cal_time_set_date (start_tt, year, month, day);
+       i_cal_time_set_time (start_tt, hour, minute, 0);
+
+       e_date_edit_get_date (E_DATE_EDIT (selector->end_date_edit), &year, &month, &day);
+       e_date_edit_get_time_of_day (E_DATE_EDIT (selector->end_date_edit), &hour, &minute);
+       i_cal_time_set_date (end_tt, year, month, day);
+       i_cal_time_set_time (end_tt, hour, minute, 0);
 
        if (!e_date_edit_get_show_time (E_DATE_EDIT (selector->start_date_edit))) {
                /* For All-Day Events, we set the timezone to NULL, and add 1 day to DTEND. */
-               start_tt.is_date = TRUE;
-               start_tt.zone = NULL;
-               end_tt.is_date = TRUE;
-               end_tt.zone = NULL;
+               i_cal_time_set_timezone (start_tt, NULL);
+               i_cal_time_set_is_date (start_tt, TRUE);
+               i_cal_time_set_timezone (end_tt, NULL);
+               i_cal_time_set_is_date (end_tt, TRUE);
 
-               icaltime_adjust (&end_tt, 1, 0, 0, 0);
+               i_cal_time_adjust (end_tt, 1, 0, 0, 0);
        } else {
-               start_tt.is_date = FALSE;
-               end_tt.is_date = FALSE;
+               i_cal_time_set_is_date (start_tt, FALSE);
+               i_cal_time_set_is_date (end_tt, FALSE);
        }
 
        e_comp_editor_property_part_datetime_set_value (dtstart, start_tt);
        e_comp_editor_property_part_datetime_set_value (dtend, end_tt);
 
        g_clear_object (&comp_editor);
+       g_clear_object (&start_tt);
+       g_clear_object (&end_tt);
 }
 
 static void
@@ -276,17 +295,17 @@ ecep_schedule_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_schedule_fill_widgets (ECompEditorPage *page,
-                           icalcomponent *component)
+                           ICalComponent *component)
 {
        ECompEditorPageSchedule *page_schedule;
        ECompEditorPropertyPartDatetime *dtstart, *dtend;
        ECompEditorPropertyPart *dtstart_part = NULL, *dtend_part = NULL;
        ECompEditor *comp_editor;
        EMeetingTimeSelector *selector;
-       struct icaltimetype start_tt, end_tt;
+       ICalTime *start_tt, *end_tt;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_SCHEDULE (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_schedule_parent_class)->fill_widgets (page, component);
 
@@ -314,51 +333,60 @@ ecep_schedule_fill_widgets (ECompEditorPage *page,
        start_tt = e_comp_editor_property_part_datetime_get_value (dtstart);
        end_tt = e_comp_editor_property_part_datetime_get_value (dtend);
 
-       if (start_tt.is_date) {
+       if (!start_tt || !end_tt) {
+               g_clear_object (&comp_editor);
+               g_clear_object (&start_tt);
+               g_clear_object (&end_tt);
+               return;
+       }
+
+       if (i_cal_time_is_date (start_tt)) {
                /* For All-Day Events, we set the timezone to NULL, and add 1 day to DTEND. */
-               start_tt.is_date = TRUE;
-               start_tt.zone = NULL;
-               end_tt.is_date = TRUE;
-               end_tt.zone = NULL;
+               i_cal_time_set_timezone (start_tt, NULL);
+               i_cal_time_set_is_date (start_tt, TRUE);
+               i_cal_time_set_timezone (end_tt, NULL);
+               i_cal_time_set_is_date (end_tt, TRUE);
 
-               icaltime_adjust (&end_tt, 1, 0, 0, 0);
+               i_cal_time_adjust (end_tt, 1, 0, 0, 0);
        } else {
-               start_tt.is_date = FALSE;
-               end_tt.is_date = FALSE;
+               i_cal_time_set_is_date (start_tt, FALSE);
+               i_cal_time_set_is_date (end_tt, FALSE);
        }
 
        e_comp_editor_page_set_updating (page, TRUE);
 
        e_date_edit_set_date (
                E_DATE_EDIT (selector->start_date_edit),
-               start_tt.year,
-               start_tt.month,
-               start_tt.day);
+               i_cal_time_get_year (start_tt),
+               i_cal_time_get_month (start_tt),
+               i_cal_time_get_day (start_tt));
        e_date_edit_set_time_of_day (
                E_DATE_EDIT (selector->start_date_edit),
-               start_tt.hour,
-               start_tt.minute);
+               i_cal_time_get_hour (start_tt),
+               i_cal_time_get_minute (start_tt));
        e_date_edit_set_date (
                E_DATE_EDIT (selector->end_date_edit),
-               end_tt.year,
-               end_tt.month,
-               end_tt.day);
+               i_cal_time_get_year (end_tt),
+               i_cal_time_get_month (end_tt),
+               i_cal_time_get_day (end_tt));
        e_date_edit_set_time_of_day (
                E_DATE_EDIT (selector->end_date_edit),
-               end_tt.hour,
-               end_tt.minute);
+               i_cal_time_get_hour (end_tt),
+               i_cal_time_get_minute (end_tt));
 
        e_comp_editor_page_set_updating (page, FALSE);
 
        g_clear_object (&comp_editor);
+       g_clear_object (&start_tt);
+       g_clear_object (&end_tt);
 }
 
 static gboolean
 ecep_schedule_fill_component (ECompEditorPage *page,
-                             icalcomponent *component)
+                             ICalComponent *component)
 {
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE_SCHEDULE (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        return E_COMP_EDITOR_PAGE_CLASS (e_comp_editor_page_schedule_parent_class)->fill_component (page, 
component);
 }
diff --git a/src/calendar/gui/e-comp-editor-page.c b/src/calendar/gui/e-comp-editor-page.c
index 018d21b15e..c82c9d8721 100644
--- a/src/calendar/gui/e-comp-editor-page.c
+++ b/src/calendar/gui/e-comp-editor-page.c
@@ -89,12 +89,12 @@ ecep_sensitize_widgets (ECompEditorPage *page,
 
 static void
 ecep_fill_widgets (ECompEditorPage *page,
-                  icalcomponent *component)
+                  ICalComponent *component)
 {
        GSList *link;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        for (link = page->priv->parts; link; link = g_slist_next (link)) {
                PropertyPartData *ppd = link->data;
@@ -109,12 +109,12 @@ ecep_fill_widgets (ECompEditorPage *page,
 
 static gboolean
 ecep_fill_component (ECompEditorPage *page,
-                    icalcomponent *component)
+                    ICalComponent *component)
 {
        GSList *link;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        for (link = page->priv->parts; link; link = g_slist_next (link)) {
                PropertyPartData *ppd = link->data;
@@ -311,12 +311,12 @@ e_comp_editor_page_sensitize_widgets (ECompEditorPage *page,
 
 void
 e_comp_editor_page_fill_widgets (ECompEditorPage *page,
-                                icalcomponent *component)
+                                ICalComponent *component)
 {
        ECompEditorPageClass *klass;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE (page));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        klass = E_COMP_EDITOR_PAGE_GET_CLASS (page);
        g_return_if_fail (klass != NULL);
@@ -331,12 +331,12 @@ e_comp_editor_page_fill_widgets (ECompEditorPage *page,
 
 gboolean
 e_comp_editor_page_fill_component (ECompEditorPage *page,
-                                  icalcomponent *component)
+                                  ICalComponent *component)
 {
        ECompEditorPageClass *klass;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PAGE (page), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        klass = E_COMP_EDITOR_PAGE_GET_CLASS (page);
        g_return_val_if_fail (klass != NULL, FALSE);
diff --git a/src/calendar/gui/e-comp-editor-page.h b/src/calendar/gui/e-comp-editor-page.h
index 114cbdf3d7..b104efb025 100644
--- a/src/calendar/gui/e-comp-editor-page.h
+++ b/src/calendar/gui/e-comp-editor-page.h
@@ -64,9 +64,9 @@ struct _ECompEditorPageClass {
        void            (* sensitize_widgets)   (ECompEditorPage *page,
                                                 gboolean force_insensitive);
        void            (* fill_widgets)        (ECompEditorPage *page,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
        gboolean        (* fill_component)      (ECompEditorPage *page,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 
        /* Signals */
        void            (* changed)             (ECompEditorPage *page);
@@ -85,9 +85,9 @@ void          e_comp_editor_page_add_property_part    (ECompEditorPage *page,
 void           e_comp_editor_page_sensitize_widgets    (ECompEditorPage *page,
                                                         gboolean force_insensitive);
 void           e_comp_editor_page_fill_widgets         (ECompEditorPage *page,
-                                                        icalcomponent *component);
+                                                        ICalComponent *component);
 gboolean       e_comp_editor_page_fill_component       (ECompEditorPage *page,
-                                                        icalcomponent *component);
+                                                        ICalComponent *component);
 void           e_comp_editor_page_emit_changed         (ECompEditorPage *page);
 gboolean       e_comp_editor_page_get_updating         (ECompEditorPage *page);
 void           e_comp_editor_page_set_updating         (ECompEditorPage *page,
diff --git a/src/calendar/gui/e-comp-editor-property-part.c b/src/calendar/gui/e-comp-editor-property-part.c
index 3b661d7f43..68ceeb8884 100644
--- a/src/calendar/gui/e-comp-editor-property-part.c
+++ b/src/calendar/gui/e-comp-editor-property-part.c
@@ -279,7 +279,7 @@ e_comp_editor_property_part_get_edit_widget (ECompEditorPropertyPart *property_p
 
 void
 e_comp_editor_property_part_fill_widget (ECompEditorPropertyPart *property_part,
-                                        icalcomponent *component)
+                                        ICalComponent *component)
 {
        ECompEditorPropertyPartClass *klass;
 
@@ -294,7 +294,7 @@ e_comp_editor_property_part_fill_widget (ECompEditorPropertyPart *property_part,
 
 void
 e_comp_editor_property_part_fill_component (ECompEditorPropertyPart *property_part,
-                                           icalcomponent *component)
+                                           ICalComponent *component)
 {
        ECompEditorPropertyPartClass *klass;
 
@@ -390,30 +390,33 @@ ecepp_string_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_string_fill_widget (ECompEditorPropertyPart *property_part,
-                         icalcomponent *component)
+                         ICalComponent *component)
 {
        ECompEditorPropertyPartStringClass *klass;
        GtkWidget *edit_widget;
-       GString *multivalue = NULL;
-       icalproperty *prop;
-       const gchar *value = NULL;
+       ICalProperty *prop;
+       gchar *text = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_STRING (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_ENTRY (edit_widget) || GTK_IS_SCROLLED_WINDOW (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_STRING_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_get_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_get_func != NULL);
 
        if (e_comp_editor_property_part_string_is_multivalue (E_COMP_EDITOR_PROPERTY_PART_STRING 
(property_part))) {
-               for (prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+               GString *multivalue = NULL;
+
+               for (prop = i_cal_component_get_first_property (component, klass->prop_kind);
                     prop;
-                    prop = icalcomponent_get_next_property (component, klass->ical_prop_kind)) {
-                       value = klass->ical_get_func (prop);
+                    g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
klass->prop_kind)) {
+                       const gchar *value;
+
+                       value = klass->i_cal_get_func (prop);
 
                        if (!value || !*value)
                                continue;
@@ -427,53 +430,49 @@ ecepp_string_fill_widget (ECompEditorPropertyPart *property_part,
                }
 
                if (multivalue)
-                       value = multivalue->str;
-               else
-                       value = NULL;
+                       text = g_string_free (multivalue, FALSE);
        } else {
-               prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
-               if (prop)
-                       value = klass->ical_get_func (prop);
+               prop = i_cal_component_get_first_property (component, klass->prop_kind);
+               if (prop) {
+                       text = g_strdup (klass->i_cal_get_func (prop));
+                       g_object_unref (prop);
+               }
        }
 
-       if (!value)
-               value = "";
-
        if (GTK_IS_ENTRY (edit_widget)) {
-               gtk_entry_set_text (GTK_ENTRY (edit_widget), value);
+               gtk_entry_set_text (GTK_ENTRY (edit_widget), text ? text : "");
        } else /* if (GTK_IS_SCROLLED_WINDOW (edit_widget)) */ {
                GtkTextBuffer *buffer;
 
                buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (edit_widget))));
-               gtk_text_buffer_set_text (buffer, value, -1);
+               gtk_text_buffer_set_text (buffer, text ? text : "", -1);
        }
 
        e_widget_undo_reset (edit_widget);
 
-       if (multivalue)
-               g_string_free (multivalue, TRUE);
+       g_free (text);
 }
 
 static void
 ecepp_string_fill_component (ECompEditorPropertyPart *property_part,
-                            icalcomponent *component)
+                            ICalComponent *component)
 {
        ECompEditorPropertyPartStringClass *klass;
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
        gchar *value;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_STRING (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_ENTRY (edit_widget) || GTK_IS_SCROLLED_WINDOW (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_STRING_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_new_func != NULL);
-       g_return_if_fail (klass->ical_set_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_new_func != NULL);
+       g_return_if_fail (klass->i_cal_set_func != NULL);
 
        if (GTK_IS_ENTRY (edit_widget)) {
                value = g_strdup (gtk_entry_get_text (GTK_ENTRY (edit_widget)));
@@ -489,24 +488,22 @@ ecepp_string_fill_component (ECompEditorPropertyPart *property_part,
 
        if (e_comp_editor_property_part_string_is_multivalue (E_COMP_EDITOR_PROPERTY_PART_STRING 
(property_part))) {
                /* Clear all multivalues first */
-               while (prop = icalcomponent_get_first_property (component, klass->ical_prop_kind), prop) {
-                       icalcomponent_remove_property (component, prop);
-                       icalproperty_free (prop);
-               }
+               e_cal_util_component_remove_property_by_kind (component, klass->prop_kind, TRUE);
        }
 
-       prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, klass->prop_kind);
 
        if (value && *value) {
                if (prop) {
-                       klass->ical_set_func (prop, value);
+                       klass->i_cal_set_func (prop, value);
+                       g_object_unref (prop);
                } else {
-                       prop = klass->ical_new_func (value);
-                       icalcomponent_add_property (component, prop);
+                       prop = klass->i_cal_new_func (value);
+                       i_cal_component_take_property (component, prop);
                }
        } else if (prop) {
-               icalcomponent_remove_property (component, prop);
-               icalproperty_free (prop);
+               i_cal_component_remove_property (component, prop);
+               g_object_unref (prop);
        }
 
        g_free (value);
@@ -530,10 +527,10 @@ e_comp_editor_property_part_string_class_init (ECompEditorPropertyPartStringClas
 
        klass->entry_type = GTK_TYPE_ENTRY;
 
-       klass->ical_prop_kind = ICAL_NO_PROPERTY;
-       klass->ical_new_func = NULL;
-       klass->ical_set_func = NULL;
-       klass->ical_get_func = NULL;
+       klass->prop_kind = I_CAL_NO_PROPERTY;
+       klass->i_cal_new_func = NULL;
+       klass->i_cal_set_func = NULL;
+       klass->i_cal_get_func = NULL;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_string_create_widgets;
@@ -595,11 +592,11 @@ static guint ecepp_datetime_signals[ECEPP_DATETIME_LAST_SIGNAL];
 
 G_DEFINE_ABSTRACT_TYPE (ECompEditorPropertyPartDatetime, e_comp_editor_property_part_datetime, 
E_TYPE_COMP_EDITOR_PROPERTY_PART)
 
-static icaltimezone *
+static ICalTimezone *
 ecepp_datetime_lookup_timezone (ECompEditorPropertyPartDatetime *part_datetime,
                                const gchar *tzid)
 {
-       icaltimezone *zone = NULL;
+       ICalTimezone *zone = NULL;
 
        if (!tzid || !*tzid)
                return NULL;
@@ -644,125 +641,135 @@ ecepp_datetime_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_datetime_fill_widget (ECompEditorPropertyPart *property_part,
-                           icalcomponent *component)
+                           ICalComponent *component)
 {
        ECompEditorPropertyPartDatetime *part_datetime;
        ECompEditorPropertyPartDatetimeClass *klass;
        GtkWidget *edit_widget;
-       icalproperty *prop;
-       struct icaltimetype value;
+       ICalProperty *prop;
+       ICalTime *value = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (E_IS_DATE_EDIT (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_DATETIME_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_get_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_get_func != NULL);
 
        part_datetime = E_COMP_EDITOR_PROPERTY_PART_DATETIME (property_part);
 
-       prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, klass->prop_kind);
        if (prop) {
                ETimezoneEntry *timezone_entry = g_weak_ref_get (&part_datetime->priv->timezone_entry);
 
-               value = klass->ical_get_func (prop);
+               value = klass->i_cal_get_func (prop);
 
-               if (timezone_entry && !value.is_date) {
-                       icaltimezone *editor_zone = e_timezone_entry_get_timezone (timezone_entry);
+               if (timezone_entry && value && !i_cal_time_is_date (value)) {
+                       ICalTimezone *editor_zone = e_timezone_entry_get_timezone (timezone_entry);
 
                        /* Attempt to convert time to the zone used in the editor */
-                       if (editor_zone && !value.zone && !icaltime_is_utc (value)) {
-                               icalparameter *param;
+                       if (editor_zone && !i_cal_time_get_timezone (value) && !i_cal_time_is_utc (value)) {
+                               ICalParameter *param;
 
-                               param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
+                               param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
                                if (param) {
                                        const gchar *tzid;
 
-                                       tzid = icalparameter_get_tzid (param);
+                                       tzid = i_cal_parameter_get_tzid (param);
 
                                        if (tzid && *tzid) {
                                                if (editor_zone &&
-                                                   (g_strcmp0 (icaltimezone_get_tzid (editor_zone), tzid) == 
0 ||
-                                                   g_strcmp0 (icaltimezone_get_location (editor_zone), tzid) 
== 0)) {
-                                                       value.zone = editor_zone;
+                                                   (g_strcmp0 (i_cal_timezone_get_tzid (editor_zone), tzid) 
== 0 ||
+                                                   g_strcmp0 (i_cal_timezone_get_location (editor_zone), 
tzid) == 0)) {
+                                                       i_cal_time_set_timezone (value, editor_zone);
                                                } else {
-                                                       value.zone = ecepp_datetime_lookup_timezone 
(part_datetime, tzid);
+                                                       i_cal_time_set_timezone (value, 
ecepp_datetime_lookup_timezone (part_datetime, tzid));
                                                }
                                        }
+
+                                       g_object_unref (param);
                                }
                        }
                }
 
                g_clear_object (&timezone_entry);
-       } else {
-               value = icaltime_null_time ();
        }
 
+       if (!value)
+               value = i_cal_time_null_time ();
+
        e_comp_editor_property_part_datetime_set_value (part_datetime, value);
+
+       g_clear_object (&value);
 }
 
 static void
 ecepp_datetime_fill_component (ECompEditorPropertyPart *property_part,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        ECompEditorPropertyPartDatetime *part_datetime;
        ECompEditorPropertyPartDatetimeClass *klass;
        GtkWidget *edit_widget;
        EDateEdit *date_edit;
-       icalproperty *prop;
-       struct icaltimetype value;
+       ICalProperty *prop;
+       ICalTime *value;
        time_t tt;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (E_IS_DATE_EDIT (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_DATETIME_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_new_func != NULL);
-       g_return_if_fail (klass->ical_get_func != NULL);
-       g_return_if_fail (klass->ical_set_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_new_func != NULL);
+       g_return_if_fail (klass->i_cal_get_func != NULL);
+       g_return_if_fail (klass->i_cal_set_func != NULL);
 
        part_datetime = E_COMP_EDITOR_PROPERTY_PART_DATETIME (property_part);
        date_edit = E_DATE_EDIT (edit_widget);
        tt = e_date_edit_get_time (date_edit);
 
-       prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, klass->prop_kind);
 
        if (e_date_edit_get_allow_no_date_set (date_edit) && tt == (time_t) -1) {
                if (prop) {
-                       icalcomponent_remove_property (component, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (component, prop);
+                       g_object_unref (prop);
                }
        } else {
                value = e_comp_editor_property_part_datetime_get_value (part_datetime);
 
                if (prop) {
                        /* Remove the VALUE parameter, to correspond to the actual value being set */
-                       icalproperty_remove_parameter_by_kind (prop, ICAL_VALUE_PARAMETER);
+                       i_cal_property_remove_parameter_by_kind (prop, I_CAL_VALUE_PARAMETER);
 
-                       klass->ical_set_func (prop, value);
+                       klass->i_cal_set_func (prop, value);
 
                        /* Re-read the value, because it could be changed by the descendant */
-                       value = klass->ical_get_func (prop);
+                       g_clear_object (&value);
+                       value = klass->i_cal_get_func (prop);
 
                        cal_comp_util_update_tzid_parameter (prop, value);
                } else {
-                       prop = klass->ical_new_func (value);
+                       prop = klass->i_cal_new_func (value);
 
                        /* Re-read the value, because it could be changed by the descendant */
-                       value = klass->ical_get_func (prop);
+                       g_clear_object (&value);
+                       value = klass->i_cal_get_func (prop);
 
                        cal_comp_util_update_tzid_parameter (prop, value);
-                       icalcomponent_add_property (component, prop);
+                       i_cal_component_add_property (component, prop);
                }
+
+               g_clear_object (&value);
+               g_clear_object (&prop);
        }
 }
 
@@ -794,10 +801,10 @@ e_comp_editor_property_part_datetime_class_init (ECompEditorPropertyPartDatetime
 
        g_type_class_add_private (klass, sizeof (ECompEditorPropertyPartDatetimePrivate));
 
-       klass->ical_prop_kind = ICAL_NO_PROPERTY;
-       klass->ical_new_func = NULL;
-       klass->ical_set_func = NULL;
-       klass->ical_get_func = NULL;
+       klass->prop_kind = I_CAL_NO_PROPERTY;
+       klass->i_cal_new_func = NULL;
+       klass->i_cal_set_func = NULL;
+       klass->i_cal_get_func = NULL;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_datetime_create_widgets;
@@ -807,7 +814,7 @@ e_comp_editor_property_part_datetime_class_init (ECompEditorPropertyPartDatetime
        object_class = G_OBJECT_CLASS (klass);
        object_class->finalize = ecepp_datetime_finalize;
 
-       /* icaltimezone *lookup_timezone (datetime, const gchar *tzid); */
+       /* ICalTimezone *lookup_timezone (datetime, const gchar *tzid); */
        ecepp_datetime_signals[ECEPP_DATETIME_LOOKUP_TIMEZONE] = g_signal_new (
                "lookup-timezone",
                G_OBJECT_CLASS_TYPE (object_class),
@@ -888,10 +895,11 @@ e_comp_editor_property_part_datetime_get_allow_no_date_set (ECompEditorPropertyP
 
 void
 e_comp_editor_property_part_datetime_set_value (ECompEditorPropertyPartDatetime *part_datetime,
-                                               struct icaltimetype value)
+                                               const ICalTime *value)
 {
        GtkWidget *edit_widget;
        EDateEdit *date_edit;
+       ICalTime *tmp_value = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME (part_datetime));
 
@@ -900,53 +908,66 @@ e_comp_editor_property_part_datetime_set_value (ECompEditorPropertyPartDatetime
 
        date_edit = E_DATE_EDIT (edit_widget);
 
-       if (!e_date_edit_get_allow_no_date_set (date_edit) && (icaltime_is_null_time (value) ||
-           !icaltime_is_valid_time (value))) {
-               value = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+       if (!e_date_edit_get_allow_no_date_set (date_edit) && (!value || i_cal_time_is_null_time (value) ||
+           !i_cal_time_is_valid_time (value))) {
+               tmp_value = i_cal_time_current_time_with_zone (i_cal_timezone_get_utc_timezone ());
+               value = tmp_value;
        }
 
-       if (icaltime_is_null_time (value) ||
-           !icaltime_is_valid_time (value)) {
+       if (!value || i_cal_time_is_null_time (value) ||
+           !i_cal_time_is_valid_time (value)) {
                e_date_edit_set_time (date_edit, (time_t) -1);
        } else {
+               ICalTimezone *zone;
+
+               zone = i_cal_time_get_timezone (value);
+
                /* Convert to the same time zone as the editor uses, if different */
-               if (!value.is_date && value.zone) {
+               if (!i_cal_time_is_date (value) && zone) {
                        ETimezoneEntry *timezone_entry = g_weak_ref_get 
(&part_datetime->priv->timezone_entry);
 
                        if (timezone_entry) {
-                               icaltimezone *editor_zone = e_timezone_entry_get_timezone (timezone_entry);
+                               ICalTimezone *editor_zone = e_timezone_entry_get_timezone (timezone_entry);
+
+                               if (editor_zone && zone != editor_zone &&
+                                   g_strcmp0 (i_cal_timezone_get_tzid (editor_zone), i_cal_timezone_get_tzid 
(zone)) != 0 &&
+                                   g_strcmp0 (i_cal_timezone_get_location (editor_zone), 
i_cal_timezone_get_location (zone)) != 0) {
+                                       if (tmp_value != value) {
+                                               tmp_value = i_cal_time_new_clone (value);
+                                               value = tmp_value;
+                                       }
 
-                               if (editor_zone && value.zone != editor_zone &&
-                                   g_strcmp0 (icaltimezone_get_tzid (editor_zone), icaltimezone_get_tzid 
((icaltimezone *) value.zone)) != 0 &&
-                                   g_strcmp0 (icaltimezone_get_location (editor_zone), 
icaltimezone_get_location ((icaltimezone *) value.zone)) != 0) {
-                                       icaltimezone_convert_time (&value, (icaltimezone *) value.zone, 
editor_zone);
-                                       value.zone = editor_zone;
+                                       i_cal_timezone_convert_time (tmp_value, zone, editor_zone);
+                                       i_cal_time_set_timezone (tmp_value, editor_zone);
                                }
                        }
 
                        g_clear_object (&timezone_entry);
                }
 
-               e_date_edit_set_date (date_edit, value.year, value.month, value.day);
+               e_date_edit_set_date (date_edit, i_cal_time_get_year (value), i_cal_time_get_month (value), 
i_cal_time_get_day (value));
 
-               if (!value.is_date)
-                       e_date_edit_set_time_of_day (date_edit, value.hour, value.minute);
+               if (!i_cal_time_is_date (value))
+                       e_date_edit_set_time_of_day (date_edit, i_cal_time_get_hour (value), 
i_cal_time_get_minute (value));
                else if (e_date_edit_get_show_time (date_edit))
                        e_date_edit_set_time_of_day (date_edit, 0, 0);
                else if (e_date_edit_get_allow_no_date_set (date_edit))
                        e_date_edit_set_time_of_day (date_edit, -1, -1);
 
-               e_comp_editor_property_part_datetime_set_date_only (part_datetime, value.is_date);
+               e_comp_editor_property_part_datetime_set_date_only (part_datetime, i_cal_time_is_date 
(value));
        }
+
+       g_clear_object (&tmp_value);
 }
 
-struct icaltimetype
+ICalTime *
 e_comp_editor_property_part_datetime_get_value (ECompEditorPropertyPartDatetime *part_datetime)
 {
        ETimezoneEntry *timezone_entry = NULL;
        GtkWidget *edit_widget;
        EDateEdit *date_edit;
-       struct icaltimetype value = icaltime_null_time ();
+       ICalTime *value = i_cal_time_null_time ();
+       gint year, month, day;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME (part_datetime), value);
 
@@ -955,21 +976,27 @@ e_comp_editor_property_part_datetime_get_value (ECompEditorPropertyPartDatetime
 
        date_edit = E_DATE_EDIT (edit_widget);
 
-       if (!e_date_edit_get_date (date_edit, &value.year, &value.month, &value.day))
-               return icaltime_null_time ();
+       if (!e_date_edit_get_date (date_edit, &year, &month, &day))
+               return value;
+
+       i_cal_time_set_date (value, year, month, day);
 
        if (!e_date_edit_get_show_time (date_edit)) {
-               value.is_date = 1;
+               i_cal_time_set_is_date (value, TRUE);
        } else {
-               value.zone = NULL;
-               value.is_date = !e_date_edit_get_time_of_day (date_edit, &value.hour, &value.minute);
+               gint hour, minute;
+
+               i_cal_time_set_timezone (value, NULL);
+               i_cal_time_set_is_date (value, !e_date_edit_get_time_of_day (date_edit, &hour, &minute));
+
+               if (!i_cal_time_is_date (value)) {
+                       i_cal_time_set_time (value, hour, minute, 0);
 
-               if (!value.is_date) {
                        timezone_entry = g_weak_ref_get (&part_datetime->priv->timezone_entry);
                        if (timezone_entry)
-                               value.zone = e_timezone_entry_get_timezone (timezone_entry);
-                       if (!value.zone)
-                               value.zone = icaltimezone_get_utc_timezone ();
+                               i_cal_time_set_timezone (value, e_timezone_entry_get_timezone 
(timezone_entry));
+                       if (!i_cal_time_get_timezone (value))
+                               i_cal_time_set_timezone (value, i_cal_timezone_get_utc_timezone ());
                }
        }
 
@@ -1053,27 +1080,28 @@ ecepp_spin_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_spin_fill_widget (ECompEditorPropertyPart *property_part,
-                       icalcomponent *component)
+                       ICalComponent *component)
 {
        ECompEditorPropertyPartSpinClass *klass;
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
        gint value;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_SPIN (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_SPIN_BUTTON (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_SPIN_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_get_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_get_func != NULL);
 
-       prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, klass->prop_kind);
        if (prop) {
-               value = klass->ical_get_func (prop);
+               value = klass->i_cal_get_func (prop);
+               g_object_unref (prop);
        } else {
                gdouble d_min, d_max;
 
@@ -1087,34 +1115,36 @@ ecepp_spin_fill_widget (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_spin_fill_component (ECompEditorPropertyPart *property_part,
-                          icalcomponent *component)
+                          ICalComponent *component)
 {
        ECompEditorPropertyPartSpinClass *klass;
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
        gint value;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_SPIN (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_SPIN_BUTTON (edit_widget));
 
        klass = E_COMP_EDITOR_PROPERTY_PART_SPIN_GET_CLASS (property_part);
        g_return_if_fail (klass != NULL);
-       g_return_if_fail (klass->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (klass->ical_new_func != NULL);
-       g_return_if_fail (klass->ical_set_func != NULL);
+       g_return_if_fail (klass->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (klass->i_cal_new_func != NULL);
+       g_return_if_fail (klass->i_cal_set_func != NULL);
 
        value = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (edit_widget));
-       prop = icalcomponent_get_first_property (component, klass->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, klass->prop_kind);
 
        if (prop) {
-               klass->ical_set_func (prop, value);
+               klass->i_cal_set_func (prop, value);
        } else {
-               prop = klass->ical_new_func (value);
-               icalcomponent_add_property (component, prop);
+               prop = klass->i_cal_new_func (value);
+               i_cal_component_add_property (component, prop);
        }
+
+       g_clear_object (&prop);
 }
 
 static void
@@ -1132,10 +1162,10 @@ e_comp_editor_property_part_spin_class_init (ECompEditorPropertyPartSpinClass *k
 
        g_type_class_add_private (klass, sizeof (ECompEditorPropertyPartSpinPrivate));
 
-       klass->ical_prop_kind = ICAL_NO_PROPERTY;
-       klass->ical_new_func = NULL;
-       klass->ical_set_func = NULL;
-       klass->ical_get_func = NULL;
+       klass->prop_kind = I_CAL_NO_PROPERTY;
+       klass->i_cal_new_func = NULL;
+       klass->i_cal_set_func = NULL;
+       klass->i_cal_get_func = NULL;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_spin_create_widgets;
@@ -1247,13 +1277,13 @@ ecepp_picker_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_picker_fill_widget (ECompEditorPropertyPart *property_part,
-                         icalcomponent *component)
+                         ICalComponent *component)
 {
        GtkWidget *edit_widget;
        gchar *id = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_PICKER (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (edit_widget));
@@ -1270,13 +1300,13 @@ ecepp_picker_fill_widget (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_picker_fill_component (ECompEditorPropertyPart *property_part,
-                            icalcomponent *component)
+                            ICalComponent *component)
 {
        GtkWidget *edit_widget;
        const gchar *id;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_PICKER (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (edit_widget));
@@ -1331,7 +1361,7 @@ e_comp_editor_property_part_picker_get_values (ECompEditorPropertyPartPicker *pa
 
 gboolean
 e_comp_editor_property_part_picker_get_from_component (ECompEditorPropertyPartPicker *part_picker,
-                                                      icalcomponent *component,
+                                                      ICalComponent *component,
                                                       gchar **out_id)
 {
        ECompEditorPropertyPartPickerClass *klass;
@@ -1348,7 +1378,7 @@ e_comp_editor_property_part_picker_get_from_component (ECompEditorPropertyPartPi
 void
 e_comp_editor_property_part_picker_set_to_component (ECompEditorPropertyPartPicker *part_picker,
                                                     const gchar *id,
-                                                    icalcomponent *component)
+                                                    ICalComponent *component)
 {
        ECompEditorPropertyPartPickerClass *klass;
 
@@ -1398,10 +1428,10 @@ struct _ECompEditorPropertyPartPickerWithMapPrivate {
        gint n_map_elems;
        gchar *label;
 
-       icalproperty_kind ical_prop_kind;
-       ECompEditorPropertyPartPickerMapICalNewFunc ical_new_func;
-       ECompEditorPropertyPartPickerMapICalSetFunc ical_set_func;
-       ECompEditorPropertyPartPickerMapICalGetFunc ical_get_func;
+       ICalPropertyKind prop_kind;
+       ECompEditorPropertyPartPickerMapICalNewFunc i_cal_new_func;
+       ECompEditorPropertyPartPickerMapICalSetFunc i_cal_set_func;
+       ECompEditorPropertyPartPickerMapICalGetFunc i_cal_get_func;
 };
 
 enum {
@@ -1440,28 +1470,29 @@ ecepp_picker_with_map_get_values (ECompEditorPropertyPartPicker *part_picker,
 
 static gboolean
 ecepp_picker_with_map_get_from_component (ECompEditorPropertyPartPicker *part_picker,
-                                         icalcomponent *component,
+                                         ICalComponent *component,
                                          gchar **out_id)
 {
        ECompEditorPropertyPartPickerWithMap *part_picker_with_map;
-       icalproperty *prop;
+       ICalProperty *prop;
        gint ii, value;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part_picker), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
        g_return_val_if_fail (out_id != NULL, FALSE);
 
        part_picker_with_map = E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part_picker);
        g_return_val_if_fail (part_picker_with_map->priv->map != NULL, FALSE);
        g_return_val_if_fail (part_picker_with_map->priv->n_map_elems > 0, FALSE);
-       g_return_val_if_fail (part_picker_with_map->priv->ical_prop_kind != ICAL_NO_PROPERTY, FALSE);
-       g_return_val_if_fail (part_picker_with_map->priv->ical_get_func != NULL, FALSE);
+       g_return_val_if_fail (part_picker_with_map->priv->prop_kind != I_CAL_NO_PROPERTY, FALSE);
+       g_return_val_if_fail (part_picker_with_map->priv->i_cal_get_func != NULL, FALSE);
 
-       prop = icalcomponent_get_first_property (component, part_picker_with_map->priv->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, part_picker_with_map->priv->prop_kind);
        if (!prop)
                return FALSE;
 
-       value = part_picker_with_map->priv->ical_get_func (prop);
+       value = part_picker_with_map->priv->i_cal_get_func (prop);
+       g_clear_object (&prop);
 
        for (ii = 0; ii < part_picker_with_map->priv->n_map_elems; ii++) {
                gboolean matches;
@@ -1484,40 +1515,40 @@ ecepp_picker_with_map_get_from_component (ECompEditorPropertyPartPicker *part_pi
 static void
 ecepp_picker_with_map_set_to_component (ECompEditorPropertyPartPicker *part_picker,
                                        const gchar *id,
-                                       icalcomponent *component)
+                                       ICalComponent *component)
 {
        ECompEditorPropertyPartPickerWithMap *part_picker_with_map;
-       icalproperty *prop;
+       ICalProperty *prop;
        gint ii, value;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part_picker));
        g_return_if_fail (id != NULL);
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        part_picker_with_map = E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part_picker);
        g_return_if_fail (part_picker_with_map->priv->map != NULL);
        g_return_if_fail (part_picker_with_map->priv->n_map_elems > 0);
-       g_return_if_fail (part_picker_with_map->priv->ical_prop_kind != ICAL_NO_PROPERTY);
-       g_return_if_fail (part_picker_with_map->priv->ical_new_func != NULL);
-       g_return_if_fail (part_picker_with_map->priv->ical_set_func != NULL);
+       g_return_if_fail (part_picker_with_map->priv->prop_kind != I_CAL_NO_PROPERTY);
+       g_return_if_fail (part_picker_with_map->priv->i_cal_new_func != NULL);
+       g_return_if_fail (part_picker_with_map->priv->i_cal_set_func != NULL);
 
        ii = (gint) g_ascii_strtoll (id, NULL, 10);
        g_return_if_fail (ii >= 0 && ii < part_picker_with_map->priv->n_map_elems);
 
-       prop = icalcomponent_get_first_property (component, part_picker_with_map->priv->ical_prop_kind);
+       prop = i_cal_component_get_first_property (component, part_picker_with_map->priv->prop_kind);
        value = part_picker_with_map->priv->map[ii].value;
 
        if (part_picker_with_map->priv->map[ii].delete_prop) {
-               if (prop) {
-                       icalcomponent_remove_property (component, prop);
-                       icalproperty_free (prop);
-               }
+               if (prop)
+                       i_cal_component_remove_property (component, prop);
        } else if (prop) {
-               part_picker_with_map->priv->ical_set_func (prop, value);
+               part_picker_with_map->priv->i_cal_set_func (prop, value);
        } else {
-               prop = part_picker_with_map->priv->ical_new_func (value);
-               icalcomponent_add_property (component, prop);
+               prop = part_picker_with_map->priv->i_cal_new_func (value);
+               i_cal_component_add_property (component, prop);
        }
+
+       g_clear_object (&prop);
 }
 
 static void
@@ -1671,10 +1702,10 @@ ECompEditorPropertyPart *
 e_comp_editor_property_part_picker_with_map_new (const ECompEditorPropertyPartPickerMap map[],
                                                 gint n_map_elements,
                                                 const gchar *label,
-                                                icalproperty_kind ical_prop_kind,
-                                                ECompEditorPropertyPartPickerMapICalNewFunc ical_new_func,
-                                                ECompEditorPropertyPartPickerMapICalSetFunc ical_set_func,
-                                                ECompEditorPropertyPartPickerMapICalGetFunc ical_get_func)
+                                                ICalPropertyKind prop_kind,
+                                                ECompEditorPropertyPartPickerMapICalNewFunc i_cal_new_func,
+                                                ECompEditorPropertyPartPickerMapICalSetFunc i_cal_set_func,
+                                                ECompEditorPropertyPartPickerMapICalGetFunc i_cal_get_func)
 {
        ECompEditorPropertyPartPickerWithMap *part_picker_with_map;
        ECompEditorPropertyPartPickerMap *map_copy;
@@ -1684,10 +1715,10 @@ e_comp_editor_property_part_picker_with_map_new (const ECompEditorPropertyPartPi
        g_return_val_if_fail (map != NULL, NULL);
        g_return_val_if_fail (n_map_elements > 0, NULL);
        g_return_val_if_fail (label != NULL, NULL);
-       g_return_val_if_fail (ical_prop_kind != ICAL_NO_PROPERTY, NULL);
-       g_return_val_if_fail (ical_new_func != NULL, NULL);
-       g_return_val_if_fail (ical_set_func != NULL, NULL);
-       g_return_val_if_fail (ical_get_func != NULL, NULL);
+       g_return_val_if_fail (prop_kind != I_CAL_NO_PROPERTY, NULL);
+       g_return_val_if_fail (i_cal_new_func != NULL, NULL);
+       g_return_val_if_fail (i_cal_set_func != NULL, NULL);
+       g_return_val_if_fail (i_cal_get_func != NULL, NULL);
 
        map_copy = g_new0 (ECompEditorPropertyPartPickerMap, n_map_elements + 1);
        for (ii = 0; ii < n_map_elements; ii++) {
@@ -1702,10 +1733,10 @@ e_comp_editor_property_part_picker_with_map_new (const ECompEditorPropertyPartPi
 
        part_picker_with_map = E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (property_part);
 
-       part_picker_with_map->priv->ical_prop_kind = ical_prop_kind;
-       part_picker_with_map->priv->ical_new_func = ical_new_func;
-       part_picker_with_map->priv->ical_set_func = ical_set_func;
-       part_picker_with_map->priv->ical_get_func = ical_get_func;
+       part_picker_with_map->priv->prop_kind = prop_kind;
+       part_picker_with_map->priv->i_cal_new_func = i_cal_new_func;
+       part_picker_with_map->priv->i_cal_set_func = i_cal_set_func;
+       part_picker_with_map->priv->i_cal_get_func = i_cal_get_func;
 
        return property_part;
 }
diff --git a/src/calendar/gui/e-comp-editor-property-part.h b/src/calendar/gui/e-comp-editor-property-part.h
index b504e3becd..cf29a09beb 100644
--- a/src/calendar/gui/e-comp-editor-property-part.h
+++ b/src/calendar/gui/e-comp-editor-property-part.h
@@ -165,9 +165,9 @@ struct _ECompEditorPropertyPartClass {
                                                 GtkWidget **out_label_widget,
                                                 GtkWidget **out_edit_widget);
        void            (* fill_widget)         (ECompEditorPropertyPart *property_part,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
        void            (* fill_component)      (ECompEditorPropertyPart *property_part,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 
        /* Signals */
        void            (* changed)             (ECompEditorPropertyPart *property_part);
@@ -188,9 +188,9 @@ void                e_comp_editor_property_part_create_widgets      
(ECompEditorPropertyPart *prope
 GtkWidget *    e_comp_editor_property_part_get_label_widget    (ECompEditorPropertyPart *property_part);
 GtkWidget *    e_comp_editor_property_part_get_edit_widget     (ECompEditorPropertyPart *property_part);
 void           e_comp_editor_property_part_fill_widget         (ECompEditorPropertyPart *property_part,
-                                                                icalcomponent *component);
+                                                                ICalComponent *component);
 void           e_comp_editor_property_part_fill_component      (ECompEditorPropertyPart *property_part,
-                                                                icalcomponent *component);
+                                                                ICalComponent *component);
 void           e_comp_editor_property_part_emit_changed        (ECompEditorPropertyPart *property_part);
 
 /* ************************************************************************* */
@@ -212,12 +212,12 @@ struct _ECompEditorPropertyPartStringClass {
           the default is the GtkEntry */
        GType entry_type;
 
-       /* ical property kind and its manipulation functions */
-       icalproperty_kind ical_prop_kind;
-       icalproperty *  (* ical_new_func)       (const gchar *value);
-       void            (* ical_set_func)       (icalproperty *prop,
+       /* ICal property kind and its manipulation functions */
+       ICalPropertyKind prop_kind;
+       ICalProperty *  (* i_cal_new_func)      (const gchar *value);
+       void            (* i_cal_set_func)      (ICalProperty *prop,
                                                 const gchar *value);
-       const gchar *   (* ical_get_func)       (const icalproperty *prop);
+       const gchar *   (* i_cal_get_func)      (ICalProperty *prop);
 };
 
 GType          e_comp_editor_property_part_string_get_type     (void) G_GNUC_CONST;
@@ -245,13 +245,12 @@ struct _ECompEditorPropertyPartDatetime {
 struct _ECompEditorPropertyPartDatetimeClass {
        ECompEditorPropertyPartClass parent_class;
 
-       /* ical property kind and its manipulation functions */
-       icalproperty_kind ical_prop_kind;
-       icalproperty *  (* ical_new_func)       (struct icaltimetype value);
-       void            (* ical_set_func)       (icalproperty *prop,
-                                                struct icaltimetype value);
-       struct icaltimetype
-                       (* ical_get_func)       (const icalproperty *prop);
+       /* ICal property kind and its manipulation functions */
+       ICalPropertyKind prop_kind;
+       ICalProperty *  (* i_cal_new_func)      (ICalTime *value);
+       void            (* i_cal_set_func)      (ICalProperty *prop,
+                                                ICalTime *value);
+       ICalTime *      (* i_cal_get_func)      (ICalProperty *prop);
 };
 
 GType          e_comp_editor_property_part_datetime_get_type   (void) G_GNUC_CONST;
@@ -269,9 +268,8 @@ void                e_comp_editor_property_part_datetime_set_allow_no_date_set
 gboolean       e_comp_editor_property_part_datetime_get_allow_no_date_set
                                                                (ECompEditorPropertyPartDatetime 
*part_datetime);
 void           e_comp_editor_property_part_datetime_set_value  (ECompEditorPropertyPartDatetime 
*part_datetime,
-                                                                struct icaltimetype value);
-struct icaltimetype
-               e_comp_editor_property_part_datetime_get_value  (ECompEditorPropertyPartDatetime 
*part_datetime);
+                                                                const ICalTime *value);
+ICalTime *     e_comp_editor_property_part_datetime_get_value  (ECompEditorPropertyPartDatetime 
*part_datetime);
 gboolean       e_comp_editor_property_part_datetime_check_validity
                                                                (ECompEditorPropertyPartDatetime 
*part_datetime,
                                                                 gboolean *out_date_is_valid,
@@ -292,12 +290,12 @@ struct _ECompEditorPropertyPartSpin {
 struct _ECompEditorPropertyPartSpinClass {
        ECompEditorPropertyPartClass parent_class;
 
-       /* ical property kind and its manipulation functions */
-       icalproperty_kind ical_prop_kind;
-       icalproperty *  (* ical_new_func)       (gint value);
-       void            (* ical_set_func)       (icalproperty *prop,
+       /* ICal property kind and its manipulation functions */
+       ICalPropertyKind prop_kind;
+       ICalProperty *  (* i_cal_new_func)      (gint value);
+       void            (* i_cal_set_func)      (ICalProperty *prop,
                                                 gint value);
-       gint            (* ical_get_func)       (const icalproperty *prop);
+       gint            (* i_cal_get_func)      (ICalProperty *prop);
 };
 
 GType          e_comp_editor_property_part_spin_get_type       (void) G_GNUC_CONST;
@@ -327,11 +325,11 @@ struct _ECompEditorPropertyPartPickerClass {
                                                 GSList **out_ids,
                                                 GSList **out_display_names);
        gboolean        (* get_from_component)  (ECompEditorPropertyPartPicker *part_picker,
-                                                icalcomponent *component,
+                                                ICalComponent *component,
                                                 gchar **out_id);
        void            (* set_to_component)    (ECompEditorPropertyPartPicker *part_picker,
                                                 const gchar *id,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 };
 
 GType          e_comp_editor_property_part_picker_get_type     (void) G_GNUC_CONST;
@@ -340,12 +338,12 @@ void              e_comp_editor_property_part_picker_get_values   
(ECompEditorPropertyPartPick
                                                                 GSList **out_display_names);
 gboolean       e_comp_editor_property_part_picker_get_from_component
                                                                (ECompEditorPropertyPartPicker *part_picker,
-                                                                icalcomponent *component,
+                                                                ICalComponent *component,
                                                                 gchar **out_id);
 void           e_comp_editor_property_part_picker_set_to_component
                                                                (ECompEditorPropertyPartPicker *part_picker,
                                                                 const gchar *id,
-                                                                icalcomponent *component);
+                                                                ICalComponent *component);
 const gchar *  e_comp_editor_property_part_picker_get_selected_id
                                                                (ECompEditorPropertyPartPicker *part_picker);
 void           e_comp_editor_property_part_picker_set_selected_id
@@ -359,16 +357,16 @@ typedef struct _ECompEditorPropertyPartPickerWithMapClass ECompEditorPropertyPar
 typedef struct _ECompEditorPropertyPartPickerWithMapPrivate ECompEditorPropertyPartPickerWithMapPrivate;
 
 typedef struct _ECompEditorPropertyPartPickerMap {
-       gint value;               /* libical enum value */
+       gint value;               /* ICal enum value */
        const gchar *description; /* user visible description of the value */
        gboolean delete_prop;     /* whether to delete property from the component when this one is selected 
*/
        gboolean (*matches_func) (gint map_value, gint component_value); /* can be NULL, then 'equal' compare 
is done */
 } ECompEditorPropertyPartPickerMap;
 
-typedef icalproperty * (* ECompEditorPropertyPartPickerMapICalNewFunc) (gint value);
-typedef void           (* ECompEditorPropertyPartPickerMapICalSetFunc) (icalproperty *prop,
+typedef ICalProperty * (* ECompEditorPropertyPartPickerMapICalNewFunc) (gint value);
+typedef void           (* ECompEditorPropertyPartPickerMapICalSetFunc) (ICalProperty *prop,
                                                                         gint value);
-typedef gint           (* ECompEditorPropertyPartPickerMapICalGetFunc) (const icalproperty *prop);
+typedef gint           (* ECompEditorPropertyPartPickerMapICalGetFunc) (ICalProperty *prop);
 
 struct _ECompEditorPropertyPartPickerWithMap {
        ECompEditorPropertyPartPicker parent;
@@ -386,10 +384,10 @@ ECompEditorPropertyPart *
                e_comp_editor_property_part_picker_with_map_new (const ECompEditorPropertyPartPickerMap map[],
                                                                 gint n_map_elements,
                                                                 const gchar *label,
-                                                                icalproperty_kind ical_prop_kind,
-                                                                ECompEditorPropertyPartPickerMapICalNewFunc 
ical_new_func,
-                                                                ECompEditorPropertyPartPickerMapICalSetFunc 
ical_set_func,
-                                                                ECompEditorPropertyPartPickerMapICalGetFunc 
ical_get_func);
+                                                                ICalPropertyKind prop_kind,
+                                                                ECompEditorPropertyPartPickerMapICalNewFunc 
i_cal_new_func,
+                                                                ECompEditorPropertyPartPickerMapICalSetFunc 
i_cal_set_func,
+                                                                ECompEditorPropertyPartPickerMapICalGetFunc 
i_cal_get_func);
 gint           e_comp_editor_property_part_picker_with_map_get_selected
                                                                (ECompEditorPropertyPartPickerWithMap 
*part_picker_with_map);
 void           e_comp_editor_property_part_picker_with_map_set_selected
diff --git a/src/calendar/gui/e-comp-editor-property-parts.c b/src/calendar/gui/e-comp-editor-property-parts.c
index 78303ac976..daa3976d93 100644
--- a/src/calendar/gui/e-comp-editor-property-parts.c
+++ b/src/calendar/gui/e-comp-editor-property-parts.c
@@ -102,10 +102,10 @@ e_comp_editor_property_part_summary_class_init (ECompEditorPropertyPartSummaryCl
 
        part_string_class = E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass);
        part_string_class->entry_type = E_TYPE_SPELL_ENTRY;
-       part_string_class->ical_prop_kind = ICAL_SUMMARY_PROPERTY;
-       part_string_class->ical_new_func = icalproperty_new_summary;
-       part_string_class->ical_set_func = icalproperty_set_summary;
-       part_string_class->ical_get_func = icalproperty_get_summary;
+       part_string_class->prop_kind = I_CAL_SUMMARY_PROPERTY;
+       part_string_class->i_cal_new_func = i_cal_property_new_summary;
+       part_string_class->i_cal_set_func = i_cal_property_set_summary;
+       part_string_class->i_cal_get_func = i_cal_property_get_summary;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_summary_create_widgets;
@@ -337,7 +337,7 @@ ecepp_location_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_location_fill_component (ECompEditorPropertyPart *property_part,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        ECompEditorPropertyPartClass *part_class;
        GtkWidget *edit_widget;
@@ -368,10 +368,10 @@ e_comp_editor_property_part_location_class_init (ECompEditorPropertyPartLocation
        ECompEditorPropertyPartClass *part_class;
 
        part_string_class = E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass);
-       part_string_class->ical_prop_kind = ICAL_LOCATION_PROPERTY;
-       part_string_class->ical_new_func = icalproperty_new_location;
-       part_string_class->ical_set_func = icalproperty_set_location;
-       part_string_class->ical_get_func = icalproperty_get_location;
+       part_string_class->prop_kind = I_CAL_LOCATION_PROPERTY;
+       part_string_class->i_cal_new_func = i_cal_property_new_location;
+       part_string_class->i_cal_set_func = i_cal_property_set_location;
+       part_string_class->i_cal_get_func = i_cal_property_get_location;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_location_create_widgets;
@@ -482,10 +482,10 @@ e_comp_editor_property_part_categories_class_init (ECompEditorPropertyPartCatego
        ECompEditorPropertyPartClass *part_class;
 
        part_string_class = E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass);
-       part_string_class->ical_prop_kind = ICAL_CATEGORIES_PROPERTY;
-       part_string_class->ical_new_func = icalproperty_new_categories;
-       part_string_class->ical_set_func = icalproperty_set_categories;
-       part_string_class->ical_get_func = icalproperty_get_categories;
+       part_string_class->prop_kind = I_CAL_CATEGORIES_PROPERTY;
+       part_string_class->i_cal_new_func = i_cal_property_new_categories;
+       part_string_class->i_cal_set_func = i_cal_property_set_categories;
+       part_string_class->i_cal_get_func = i_cal_property_get_categories;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_categories_create_widgets;
@@ -581,13 +581,13 @@ ecepp_description_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_description_fill_widget (ECompEditorPropertyPart *property_part,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        ECompEditorPropertyPartClass *part_class;
        GtkWidget *edit_widget;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DESCRIPTION (property_part));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_description_parent_class);
        g_return_if_fail (part_class != NULL);
@@ -614,10 +614,10 @@ e_comp_editor_property_part_description_class_init (ECompEditorPropertyPartDescr
 
        part_string_class = E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass);
        part_string_class->entry_type = GTK_TYPE_TEXT_VIEW;
-       part_string_class->ical_prop_kind = ICAL_DESCRIPTION_PROPERTY;
-       part_string_class->ical_new_func = icalproperty_new_description;
-       part_string_class->ical_set_func = icalproperty_set_description;
-       part_string_class->ical_get_func = icalproperty_get_description;
+       part_string_class->prop_kind = I_CAL_DESCRIPTION_PROPERTY;
+       part_string_class->i_cal_new_func = i_cal_property_new_description;
+       part_string_class->i_cal_set_func = i_cal_property_set_description;
+       part_string_class->i_cal_get_func = i_cal_property_get_description;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_description_create_widgets;
@@ -710,10 +710,10 @@ e_comp_editor_property_part_url_class_init (ECompEditorPropertyPartUrlClass *kla
 
        part_string_class = E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass);
        part_string_class->entry_type = E_TYPE_URL_ENTRY;
-       part_string_class->ical_prop_kind = ICAL_URL_PROPERTY;
-       part_string_class->ical_new_func = icalproperty_new_url;
-       part_string_class->ical_set_func = icalproperty_set_url;
-       part_string_class->ical_get_func = icalproperty_get_url;
+       part_string_class->prop_kind = I_CAL_URL_PROPERTY;
+       part_string_class->i_cal_new_func = i_cal_property_new_url;
+       part_string_class->i_cal_set_func = i_cal_property_set_url;
+       part_string_class->i_cal_get_func = i_cal_property_get_url;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_url_create_widgets;
@@ -920,10 +920,10 @@ e_comp_editor_property_part_dtstart_class_init (ECompEditorPropertyPartDtstartCl
        ECompEditorPropertyPartDatetimeClass *part_datetime_class;
 
        part_datetime_class = E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass);
-       part_datetime_class->ical_prop_kind = ICAL_DTSTART_PROPERTY;
-       part_datetime_class->ical_new_func = icalproperty_new_dtstart;
-       part_datetime_class->ical_set_func = icalproperty_set_dtstart;
-       part_datetime_class->ical_get_func = icalproperty_get_dtstart;
+       part_datetime_class->prop_kind = I_CAL_DTSTART_PROPERTY;
+       part_datetime_class->i_cal_new_func = i_cal_property_new_dtstart;
+       part_datetime_class->i_cal_set_func = i_cal_property_set_dtstart;
+       part_datetime_class->i_cal_get_func = i_cal_property_get_dtstart;
 }
 
 ECompEditorPropertyPart *
@@ -981,10 +981,10 @@ e_comp_editor_property_part_dtend_class_init (ECompEditorPropertyPartDtendClass
        ECompEditorPropertyPartDatetimeClass *part_datetime_class;
 
        part_datetime_class = E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass);
-       part_datetime_class->ical_prop_kind = ICAL_DTEND_PROPERTY;
-       part_datetime_class->ical_new_func = icalproperty_new_dtend;
-       part_datetime_class->ical_set_func = icalproperty_set_dtend;
-       part_datetime_class->ical_get_func = icalproperty_get_dtend;
+       part_datetime_class->prop_kind = I_CAL_DTEND_PROPERTY;
+       part_datetime_class->i_cal_new_func = i_cal_property_new_dtend;
+       part_datetime_class->i_cal_set_func = i_cal_property_set_dtend;
+       part_datetime_class->i_cal_get_func = i_cal_property_get_dtend;
 }
 
 ECompEditorPropertyPart *
@@ -1042,10 +1042,10 @@ e_comp_editor_property_part_due_class_init (ECompEditorPropertyPartDueClass *kla
        ECompEditorPropertyPartDatetimeClass *part_datetime_class;
 
        part_datetime_class = E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass);
-       part_datetime_class->ical_prop_kind = ICAL_DUE_PROPERTY;
-       part_datetime_class->ical_new_func = icalproperty_new_due;
-       part_datetime_class->ical_set_func = icalproperty_set_due;
-       part_datetime_class->ical_get_func = icalproperty_get_due;
+       part_datetime_class->prop_kind = I_CAL_DUE_PROPERTY;
+       part_datetime_class->i_cal_new_func = i_cal_property_new_due;
+       part_datetime_class->i_cal_set_func = i_cal_property_set_due;
+       part_datetime_class->i_cal_get_func = i_cal_property_get_due;
 }
 
 ECompEditorPropertyPart *
@@ -1092,39 +1092,37 @@ GType e_comp_editor_property_part_completed_get_type (void) G_GNUC_CONST;
 G_DEFINE_TYPE (ECompEditorPropertyPartCompleted, e_comp_editor_property_part_completed, 
E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED)
 
 static void
-e_comp_editor_property_part_completed_ensure_date_time (struct icaltimetype *pvalue)
+e_comp_editor_property_part_completed_ensure_date_time (ICalTime *pvalue)
 {
        if (!pvalue)
                return;
 
-       if (pvalue->is_date) {
-               pvalue->is_date = 0;
-               pvalue->hour = 0;
-               pvalue->minute = 0;
-               pvalue->second = 0;
-               pvalue->zone = icaltimezone_get_utc_timezone ();
-       } else if (!icaltime_is_utc (*pvalue)) {
+       if (i_cal_time_is_date (pvalue)) {
+               i_cal_time_set_is_date (pvalue, FALSE);
+               i_cal_time_set_time (pvalue, 0, 0, 0);
+               i_cal_time_set_timezone (pvalue, i_cal_timezone_get_utc_timezone ());
+       } else if (!i_cal_time_is_utc (pvalue)) {
                /* Make sure the time is in UTC */
-               icaltimezone_convert_time (pvalue, (icaltimezone *) pvalue->zone, 
icaltimezone_get_utc_timezone ());
-               pvalue->zone = icaltimezone_get_utc_timezone ();
+               i_cal_timezone_convert_time (pvalue, i_cal_time_get_timezone (pvalue), 
i_cal_timezone_get_utc_timezone ());
+               i_cal_time_set_timezone (pvalue, i_cal_timezone_get_utc_timezone ());
        }
 }
 
-static icalproperty *
-e_comp_editor_property_part_completed_new_func_wrapper (struct icaltimetype value)
+static ICalProperty *
+e_comp_editor_property_part_completed_new_func_wrapper (ICalTime *value)
 {
-       e_comp_editor_property_part_completed_ensure_date_time (&value);
+       e_comp_editor_property_part_completed_ensure_date_time (value);
 
-       return icalproperty_new_completed (value);
+       return i_cal_property_new_completed (value);
 }
 
 static void
-e_comp_editor_property_part_completed_set_func_wrapper (icalproperty *prop,
-                                                       struct icaltimetype value)
+e_comp_editor_property_part_completed_set_func_wrapper (ICalProperty *prop,
+                                                       ICalTime *value)
 {
-       e_comp_editor_property_part_completed_ensure_date_time (&value);
+       e_comp_editor_property_part_completed_ensure_date_time (value);
 
-       return icalproperty_set_completed (prop, value);
+       i_cal_property_set_completed (prop, value);
 }
 
 static void
@@ -1138,10 +1136,10 @@ e_comp_editor_property_part_completed_class_init (ECompEditorPropertyPartComplet
        ECompEditorPropertyPartDatetimeClass *part_datetime_class;
 
        part_datetime_class = E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass);
-       part_datetime_class->ical_prop_kind = ICAL_COMPLETED_PROPERTY;
-       part_datetime_class->ical_new_func = e_comp_editor_property_part_completed_new_func_wrapper;
-       part_datetime_class->ical_set_func = e_comp_editor_property_part_completed_set_func_wrapper;
-       part_datetime_class->ical_get_func = icalproperty_get_completed;
+       part_datetime_class->prop_kind = I_CAL_COMPLETED_PROPERTY;
+       part_datetime_class->i_cal_new_func = e_comp_editor_property_part_completed_new_func_wrapper;
+       part_datetime_class->i_cal_set_func = e_comp_editor_property_part_completed_set_func_wrapper;
+       part_datetime_class->i_cal_get_func = i_cal_property_get_completed;
 }
 
 ECompEditorPropertyPart *
@@ -1167,9 +1165,9 @@ ECompEditorPropertyPart *
 e_comp_editor_property_part_classification_new (void)
 {
        ECompEditorPropertyPartPickerMap map[] = {
-               { ICAL_CLASS_PUBLIC,       NC_("ECompEditor", "Public"),       FALSE, NULL },
-               { ICAL_CLASS_PRIVATE,      NC_("ECompEditor", "Private"),      FALSE, NULL },
-               { ICAL_CLASS_CONFIDENTIAL, NC_("ECompEditor", "Confidential"), FALSE, NULL }
+               { I_CAL_CLASS_PUBLIC,       NC_("ECompEditor", "Public"),       FALSE, NULL },
+               { I_CAL_CLASS_PRIVATE,      NC_("ECompEditor", "Private"),      FALSE, NULL },
+               { I_CAL_CLASS_CONFIDENTIAL, NC_("ECompEditor", "Confidential"), FALSE, NULL }
        };
        GSettings *settings;
        ECompEditorPropertyPart *part;
@@ -1186,10 +1184,10 @@ e_comp_editor_property_part_classification_new (void)
 
        part = e_comp_editor_property_part_picker_with_map_new (map, n_elems,
                C_("ECompEditor", "C_lassification:"),
-               ICAL_CLASS_PROPERTY,
-               (ECompEditorPropertyPartPickerMapICalNewFunc) icalproperty_new_class,
-               (ECompEditorPropertyPartPickerMapICalSetFunc) icalproperty_set_class,
-               (ECompEditorPropertyPartPickerMapICalGetFunc) icalproperty_get_class);
+               I_CAL_CLASS_PROPERTY,
+               (ECompEditorPropertyPartPickerMapICalNewFunc) i_cal_property_new_class,
+               (ECompEditorPropertyPartPickerMapICalSetFunc) i_cal_property_set_class,
+               (ECompEditorPropertyPartPickerMapICalGetFunc) i_cal_property_get_class);
 
        e_comp_editor_property_part_picker_with_map_set_selected (
                E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part),
@@ -1204,10 +1202,10 @@ ECompEditorPropertyPart *
 e_comp_editor_property_part_status_new (void)
 {
        ECompEditorPropertyPartPickerMap map[] = {
-               { ICAL_STATUS_NONE,      NC_("ECompEditor", "Not Started"), TRUE,  NULL },
-               { ICAL_STATUS_INPROCESS, NC_("ECompEditor", "In Progress"), FALSE, NULL },
-               { ICAL_STATUS_COMPLETED, NC_("ECompEditor", "Completed"),   FALSE, NULL },
-               { ICAL_STATUS_CANCELLED, NC_("ECompEditor", "Cancelled"),    FALSE, NULL }
+               { I_CAL_STATUS_NONE,      NC_("ECompEditor", "Not Started"), TRUE,  NULL },
+               { I_CAL_STATUS_INPROCESS, NC_("ECompEditor", "In Progress"), FALSE, NULL },
+               { I_CAL_STATUS_COMPLETED, NC_("ECompEditor", "Completed"),   FALSE, NULL },
+               { I_CAL_STATUS_CANCELLED, NC_("ECompEditor", "Cancelled"),    FALSE, NULL }
        };
        gint ii, n_elems = G_N_ELEMENTS (map);
 
@@ -1217,10 +1215,10 @@ e_comp_editor_property_part_status_new (void)
 
        return e_comp_editor_property_part_picker_with_map_new (map, n_elems,
                C_("ECompEditor", "_Status:"),
-               ICAL_STATUS_PROPERTY,
-               (ECompEditorPropertyPartPickerMapICalNewFunc) icalproperty_new_status,
-               (ECompEditorPropertyPartPickerMapICalSetFunc) icalproperty_set_status,
-               (ECompEditorPropertyPartPickerMapICalGetFunc) icalproperty_get_status);
+               I_CAL_STATUS_PROPERTY,
+               (ECompEditorPropertyPartPickerMapICalNewFunc) i_cal_property_new_status,
+               (ECompEditorPropertyPartPickerMapICalSetFunc) i_cal_property_set_status,
+               (ECompEditorPropertyPartPickerMapICalGetFunc) i_cal_property_get_status);
 }
 
 /* ************************************************************************* */
@@ -1259,10 +1257,10 @@ e_comp_editor_property_part_priority_new (void)
 
        return e_comp_editor_property_part_picker_with_map_new (map, n_elems,
                C_("ECompEditor", "Priorit_y:"),
-               ICAL_PRIORITY_PROPERTY,
-               icalproperty_new_priority,
-               icalproperty_set_priority,
-               icalproperty_get_priority);
+               I_CAL_PRIORITY_PROPERTY,
+               i_cal_property_new_priority,
+               i_cal_property_set_priority,
+               i_cal_property_get_priority);
 }
 
 /* ************************************************************************* */
@@ -1337,10 +1335,10 @@ e_comp_editor_property_part_percentcomplete_class_init (ECompEditorPropertyPartP
        ECompEditorPropertyPartClass *part_class;
 
        part_spin_class = E_COMP_EDITOR_PROPERTY_PART_SPIN_CLASS (klass);
-       part_spin_class->ical_prop_kind = ICAL_PERCENTCOMPLETE_PROPERTY;
-       part_spin_class->ical_new_func = icalproperty_new_percentcomplete;
-       part_spin_class->ical_set_func = icalproperty_set_percentcomplete;
-       part_spin_class->ical_get_func = icalproperty_get_percentcomplete;
+       part_spin_class->prop_kind = I_CAL_PERCENTCOMPLETE_PROPERTY;
+       part_spin_class->i_cal_new_func = i_cal_property_new_percentcomplete;
+       part_spin_class->i_cal_set_func = i_cal_property_set_percentcomplete;
+       part_spin_class->i_cal_get_func = i_cal_property_get_percentcomplete;
 
        part_class = E_COMP_EDITOR_PROPERTY_PART_CLASS (klass);
        part_class->create_widgets = ecepp_percentcomplete_create_widgets;
@@ -1417,44 +1415,47 @@ ecepp_timezone_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_timezone_fill_widget (ECompEditorPropertyPart *property_part,
-                           icalcomponent *component)
+                           ICalComponent *component)
 {
-       struct icaltimetype (* get_func) (const icalproperty *prop);
-       icalproperty *prop;
+       ICalTime * (* get_func) (ICalProperty *prop);
+       ICalProperty *prop;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TIMEZONE (property_part));
 
-       get_func = icalproperty_get_dtstart;
-       prop = icalcomponent_get_first_property (component, ICAL_DTSTART_PROPERTY);
+       get_func = i_cal_property_get_dtstart;
+       prop = i_cal_component_get_first_property (component, I_CAL_DTSTART_PROPERTY);
 
        if (!prop) {
-               get_func = icalproperty_get_dtend;
-               prop = icalcomponent_get_first_property (component, ICAL_DTEND_PROPERTY);
+               get_func = i_cal_property_get_dtend;
+               prop = i_cal_component_get_first_property (component, I_CAL_DTEND_PROPERTY);
        }
 
        if (!prop) {
-               get_func = icalproperty_get_due;
-               prop = icalcomponent_get_first_property (component, ICAL_DUE_PROPERTY);
+               get_func = i_cal_property_get_due;
+               prop = i_cal_component_get_first_property (component, I_CAL_DUE_PROPERTY);
        }
 
        if (prop) {
-               struct icaltimetype itt;
+               ICalTime *itt;
 
                itt = get_func (prop);
-               if (itt.zone) {
+               if (itt && i_cal_time_get_timezone (itt)) {
                        GtkWidget *edit_widget;
 
                        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
                        g_return_if_fail (E_IS_TIMEZONE_ENTRY (edit_widget));
 
-                       e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (edit_widget), (icaltimezone *) 
itt.zone);
+                       e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (edit_widget), 
i_cal_time_get_timezone (itt));
                }
+
+               g_clear_object (&itt);
+               g_object_unref (prop);
        }
 }
 
 static void
 ecepp_timezone_fill_component (ECompEditorPropertyPart *property_part,
-                              icalcomponent *component)
+                              ICalComponent *component)
 {
        /* Nothing to do here, this is sort-of virtual property part */
 }
@@ -1535,20 +1536,22 @@ ecepp_transparency_create_widgets (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_transparency_fill_widget (ECompEditorPropertyPart *property_part,
-                               icalcomponent *component)
+                               ICalComponent *component)
 {
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY (property_part));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_CHECK_BUTTON (edit_widget));
 
-       prop = icalcomponent_get_first_property (component, ICAL_TRANSP_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_TRANSP_PROPERTY);
        if (prop) {
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edit_widget),
-                       icalproperty_get_transp (prop) == ICAL_TRANSP_OPAQUE);
+                       i_cal_property_get_transp (prop) == I_CAL_TRANSP_OPAQUE);
+
+               g_object_unref (prop);
        } else {
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edit_widget), TRUE);
        }
@@ -1556,26 +1559,28 @@ ecepp_transparency_fill_widget (ECompEditorPropertyPart *property_part,
 
 static void
 ecepp_transparency_fill_component (ECompEditorPropertyPart *property_part,
-                                  icalcomponent *component)
+                                  ICalComponent *component)
 {
        GtkWidget *edit_widget;
-       icalproperty *prop;
-       icalproperty_transp value;
+       ICalProperty *prop;
+       ICalPropertyTransp value;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY (property_part));
 
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (GTK_IS_CHECK_BUTTON (edit_widget));
 
-       value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (edit_widget)) ? ICAL_TRANSP_OPAQUE : 
ICAL_TRANSP_TRANSPARENT;
+       value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (edit_widget)) ? I_CAL_TRANSP_OPAQUE : 
I_CAL_TRANSP_TRANSPARENT;
 
-       prop = icalcomponent_get_first_property (component, ICAL_TRANSP_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_TRANSP_PROPERTY);
        if (prop) {
-               icalproperty_set_transp (prop, value);
+               i_cal_property_set_transp (prop, value);
        } else {
-               prop = icalproperty_new_transp (value);
-               icalcomponent_add_property (component, prop);
+               prop = i_cal_property_new_transp (value);
+               i_cal_component_add_property (component, prop);
        }
+
+       g_clear_object (&prop);
 }
 
 static void
@@ -1628,7 +1633,6 @@ GType e_comp_editor_property_part_color_get_type (void) G_GNUC_CONST;
 
 G_DEFINE_TYPE (ECompEditorPropertyPartColor, e_comp_editor_property_part_color, 
E_TYPE_COMP_EDITOR_PROPERTY_PART)
 
-#ifdef HAVE_ICAL_COLOR_PROPERTY
 static const gchar *
 ecepp_color_rgba_to_string (const GdkRGBA *rgba)
 {
@@ -1847,7 +1851,6 @@ ecepp_color_notify_current_color_cb (EColorCombo *color_combo,
                g_signal_handler_unblock (color_combo, color_part->notify_current_color_id);
        }
 }
-#endif /* HAVE_ICAL_COLOR_PROPERTY */
 
 static void
 ecepp_color_set_palette (GtkWidget *color_combo)
@@ -1923,9 +1926,7 @@ ecepp_color_create_widgets (ECompEditorPropertyPart *property_part,
                            GtkWidget **out_label_widget,
                            GtkWidget **out_edit_widget)
 {
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
        ECompEditorPropertyPartColor *color_part;
-       #endif
        GdkRGBA rgba;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part));
@@ -1956,21 +1957,18 @@ ecepp_color_create_widgets (ECompEditorPropertyPart *property_part,
 
        ecepp_color_set_palette (*out_edit_widget);
 
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
        color_part = E_COMP_EDITOR_PROPERTY_PART_COLOR (property_part);
        color_part->notify_current_color_id =
                g_signal_connect (*out_edit_widget, "notify::current-color",
                G_CALLBACK (ecepp_color_notify_current_color_cb), property_part);
-       #endif
 }
 
 static void
 ecepp_color_fill_widget (ECompEditorPropertyPart *property_part,
-                        icalcomponent *component)
+                        ICalComponent *component)
 {
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
        gboolean color_set = FALSE;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part));
@@ -1978,15 +1976,17 @@ ecepp_color_fill_widget (ECompEditorPropertyPart *property_part,
        edit_widget = e_comp_editor_property_part_get_edit_widget (property_part);
        g_return_if_fail (E_IS_COLOR_COMBO (edit_widget));
 
-       prop = icalcomponent_get_first_property (component, ICAL_COLOR_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_COLOR_PROPERTY);
        if (prop) {
-               const gchar *color = icalproperty_get_color (prop);
+               const gchar *color = i_cal_property_get_color (prop);
                GdkRGBA rgba;
 
                if (color && gdk_rgba_parse (&rgba, color)) {
                        e_color_combo_set_current_color (E_COLOR_COMBO (edit_widget), &rgba);
                        color_set = TRUE;
                }
+
+               g_clear_object (&prop);
        }
 
        if (!color_set) {
@@ -1999,16 +1999,14 @@ ecepp_color_fill_widget (ECompEditorPropertyPart *property_part,
 
                e_color_combo_set_current_color (E_COLOR_COMBO (edit_widget), &rgba);
        }
-       #endif
 }
 
 static void
 ecepp_color_fill_component (ECompEditorPropertyPart *property_part,
-                           icalcomponent *component)
+                           ICalComponent *component)
 {
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
        GtkWidget *edit_widget;
-       icalproperty *prop;
+       ICalProperty *prop;
        GdkRGBA rgba;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part));
@@ -2023,29 +2021,28 @@ ecepp_color_fill_component (ECompEditorPropertyPart *property_part,
 
        e_color_combo_get_current_color (E_COLOR_COMBO (edit_widget), &rgba);
 
-       prop = icalcomponent_get_first_property (component, ICAL_COLOR_PROPERTY);
+       prop = i_cal_component_get_first_property (component, I_CAL_COLOR_PROPERTY);
 
        if (rgba.alpha <= 1.0 - 1e-9) {
-               if (prop) {
-                       icalcomponent_remove_property (component, prop);
-                       icalproperty_free (prop);
-               }
+               if (prop)
+                       i_cal_component_remove_property (component, prop);
        } else {
                const gchar *str;
 
                str = ecepp_color_rgba_to_string (&rgba);
                if (str) {
                        if (prop) {
-                               icalproperty_set_color (prop, str);
+                               i_cal_property_set_color (prop, str);
                        } else {
-                               prop = icalproperty_new_color (str);
-                               icalcomponent_add_property (component, prop);
+                               prop = i_cal_property_new_color (str);
+                               i_cal_component_add_property (component, prop);
                        }
                } else {
                        g_warning ("%s: Failed to convert RGBA (%f,%f,%f,%f) to string", G_STRFUNC, rgba.red, 
rgba.green, rgba.blue, rgba.alpha);
                }
        }
-       #endif
+
+       g_clear_object (&prop);
 }
 
 static void
@@ -2067,9 +2064,5 @@ e_comp_editor_property_part_color_class_init (ECompEditorPropertyPartColorClass
 ECompEditorPropertyPart *
 e_comp_editor_property_part_color_new (void)
 {
-       #ifdef HAVE_ICAL_COLOR_PROPERTY
        return g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_COLOR, NULL);
-       #else
-       return NULL;
-       #endif
 }
diff --git a/src/calendar/gui/e-comp-editor-task.c b/src/calendar/gui/e-comp-editor-task.c
index 0493cecb0e..4869dd82a8 100644
--- a/src/calendar/gui/e-comp-editor-task.c
+++ b/src/calendar/gui/e-comp-editor-task.c
@@ -54,13 +54,13 @@ struct _ECompEditorTaskPrivate {
 
 G_DEFINE_TYPE (ECompEditorTask, e_comp_editor_task, E_TYPE_COMP_EDITOR)
 
-static icaltimezone *
+static ICalTimezone *
 ece_task_get_timezone_from_property (ECompEditor *comp_editor,
-                                    icalproperty *property)
+                                    ICalProperty *property)
 {
        ECalClient *client;
-       icalparameter *param;
-       icaltimezone *zone = NULL;
+       ICalParameter *param;
+       ICalTimezone *zone = NULL;
        const gchar *tzid;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), NULL);
@@ -68,25 +68,33 @@ ece_task_get_timezone_from_property (ECompEditor *comp_editor,
        if (!property)
                return NULL;
 
-       param = icalproperty_get_first_parameter (property, ICAL_TZID_PARAMETER);
+       param = i_cal_property_get_first_parameter (property, I_CAL_TZID_PARAMETER);
        if (!param)
                return NULL;
 
-       tzid = icalparameter_get_tzid (param);
-       if (!tzid || !*tzid)
+       tzid = i_cal_parameter_get_tzid (param);
+       if (!tzid || !*tzid) {
+               g_clear_object (&param);
                return NULL;
+       }
 
-       if (g_ascii_strcasecmp (tzid, "UTC") == 0)
-               return icaltimezone_get_utc_timezone ();
+       if (g_ascii_strcasecmp (tzid, "UTC") == 0) {
+               g_clear_object (&param);
+               return i_cal_timezone_get_utc_timezone ();
+       }
 
        client = e_comp_editor_get_source_client (comp_editor);
        /* It should be already fetched for the UI, thus this should be non-blocking. */
-       if (client && e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, NULL) && zone)
+       if (client && e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, NULL) && zone) {
+               g_clear_object (&param);
                return zone;
+       }
 
-       zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+       zone = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
        if (!zone)
-               zone = icaltimezone_get_builtin_timezone (tzid);
+               zone = i_cal_timezone_get_builtin_timezone (tzid);
+
+       g_clear_object (&param);
 
        return zone;
 }
@@ -96,13 +104,13 @@ ece_task_update_timezone (ECompEditorTask *task_editor,
                          gboolean *force_allday)
 {
        const gint properties[] = {
-               ICAL_DTSTART_PROPERTY,
-               ICAL_DUE_PROPERTY,
-               ICAL_COMPLETED_PROPERTY
+               I_CAL_DTSTART_PROPERTY,
+               I_CAL_DUE_PROPERTY,
+               I_CAL_COMPLETED_PROPERTY
        };
        ECompEditor *comp_editor;
-       icalcomponent *component;
-       icaltimezone *zone = NULL;
+       ICalComponent *component;
+       ICalTimezone *zone = NULL;
        gint ii;
 
        g_return_if_fail (E_IS_COMP_EDITOR_TASK (task_editor));
@@ -117,25 +125,32 @@ ece_task_update_timezone (ECompEditorTask *task_editor,
                return;
 
        for (ii = 0; !zone && ii < G_N_ELEMENTS (properties); ii++) {
-               struct icaltimetype dt;
-               if (icalcomponent_get_first_property (component, properties[ii])) {
-                       dt = icalcomponent_get_dtstart (component);
-                       if (icaltime_is_valid_time (dt)) {
-                               if (force_allday && dt.is_date)
+               if (e_cal_util_component_has_property (component, properties[ii])) {
+                       ICalTime *dt;
+
+                       dt = i_cal_component_get_dtstart (component);
+                       if (dt && i_cal_time_is_valid_time (dt)) {
+                               if (force_allday && i_cal_time_is_date (dt))
                                        *force_allday = TRUE;
 
-                               if (icaltime_is_utc (dt))
-                                       zone = icaltimezone_get_utc_timezone ();
-                               else
-                                       zone = ece_task_get_timezone_from_property (comp_editor,
-                                               icalcomponent_get_first_property (component, properties[ii]));
+                               if (i_cal_time_is_utc (dt)) {
+                                       zone = i_cal_timezone_get_utc_timezone ();
+                               } else {
+                                       ICalProperty *prop;
+
+                                       prop = i_cal_component_get_first_property (component, properties[ii]);
+                                       zone = ece_task_get_timezone_from_property (comp_editor, prop);
+                                       g_clear_object (&prop);
+                               }
                        }
+
+                       g_clear_object (&dt);
                }
        }
 
        if (zone) {
                GtkWidget *edit_widget;
-               icaltimezone *cfg_zone;
+               ICalTimezone *cfg_zone;
 
                edit_widget = e_comp_editor_property_part_get_edit_widget (task_editor->priv->timezone);
 
@@ -144,8 +159,8 @@ ece_task_update_timezone (ECompEditorTask *task_editor,
                cfg_zone = calendar_config_get_icaltimezone ();
 
                if (zone && cfg_zone && zone != cfg_zone &&
-                   (g_strcmp0 (icaltimezone_get_location (zone), icaltimezone_get_location (cfg_zone)) != 0 
||
-                    g_strcmp0 (icaltimezone_get_tzid (zone), icaltimezone_get_tzid (cfg_zone)) != 0)) {
+                   (g_strcmp0 (i_cal_timezone_get_location (zone), i_cal_timezone_get_location (cfg_zone)) 
!= 0 ||
+                    g_strcmp0 (i_cal_timezone_get_tzid (zone), i_cal_timezone_get_tzid (cfg_zone)) != 0)) {
                        /* Show timezone part */
                        GtkAction *action;
 
@@ -189,7 +204,7 @@ ece_task_notify_target_client_cb (GObject *object,
        action = e_comp_editor_get_action (comp_editor, "all-day-task");
        was_allday = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
 
-       date_only = !cal_client || e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_TASK_DATE_ONLY);
+       date_only = !cal_client || e_client_check_capability (E_CLIENT (cal_client), 
E_CAL_STATIC_CAPABILITY_TASK_DATE_ONLY);
 
        e_comp_editor_property_part_datetime_set_date_only (E_COMP_EDITOR_PROPERTY_PART_DATETIME 
(task_editor->priv->dtstart), date_only);
        e_comp_editor_property_part_datetime_set_date_only (E_COMP_EDITOR_PROPERTY_PART_DATETIME 
(task_editor->priv->due_date), date_only);
@@ -209,10 +224,10 @@ ece_task_notify_target_client_cb (GObject *object,
                gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
        }
 
-       can_reminders = !cal_client || !e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_TASK_NO_ALARM);
+       can_reminders = !cal_client || !e_client_check_capability (E_CLIENT (cal_client), 
E_CAL_STATIC_CAPABILITY_TASK_NO_ALARM);
        gtk_widget_set_visible (GTK_WIDGET (task_editor->priv->reminders_page), can_reminders);
 
-       can_recur = !cal_client || e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_TASK_CAN_RECUR);
+       can_recur = !cal_client || e_client_check_capability (E_CLIENT (cal_client), 
E_CAL_STATIC_CAPABILITY_TASK_CAN_RECUR);
        gtk_widget_set_visible (GTK_WIDGET (task_editor->priv->recurrence_page), can_recur);
 }
 
@@ -230,7 +245,7 @@ ece_task_check_dates_in_the_past (ECompEditorTask *task_editor)
 
        if ((flags & E_COMP_EDITOR_FLAG_IS_NEW) != 0) {
                GString *message = NULL;
-               struct icaltimetype dtstart_itt, due_date_itt;
+               ICalTime *dtstart_itt, *due_date_itt;
 
                dtstart_itt = e_comp_editor_property_part_datetime_get_value (
                        E_COMP_EDITOR_PROPERTY_PART_DATETIME (task_editor->priv->dtstart));
@@ -262,6 +277,9 @@ ece_task_check_dates_in_the_past (ECompEditorTask *task_editor)
                        g_string_free (message, TRUE);
                        g_clear_object (&alert);
                }
+
+               g_clear_object (&dtstart_itt);
+               g_clear_object (&due_date_itt);
        }
 }
 
@@ -321,7 +339,7 @@ ece_task_completed_date_changed_cb (EDateEdit *date_edit,
 {
        GtkSpinButton *percent_spin;
        ECompEditor *comp_editor;
-       struct icaltimetype itt;
+       ICalTime *itt;
        gint status;
 
        g_return_if_fail (E_IS_DATE_EDIT (date_edit));
@@ -340,25 +358,27 @@ ece_task_completed_date_changed_cb (EDateEdit *date_edit,
                E_COMP_EDITOR_PROPERTY_PART_DATETIME (task_editor->priv->completed_date));
        percent_spin = GTK_SPIN_BUTTON (e_comp_editor_property_part_get_edit_widget 
(task_editor->priv->percentcomplete));
 
-       if (icaltime_is_null_time (itt)) {
-               if (status == ICAL_STATUS_COMPLETED) {
+       if (!itt || i_cal_time_is_null_time (itt)) {
+               if (status == I_CAL_STATUS_COMPLETED) {
                        e_comp_editor_property_part_picker_with_map_set_selected (
                                E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (task_editor->priv->status),
-                               ICAL_STATUS_NONE);
+                               I_CAL_STATUS_NONE);
 
                        gtk_spin_button_set_value (percent_spin, 0);
                }
        } else {
-               if (status != ICAL_STATUS_COMPLETED) {
+               if (status != I_CAL_STATUS_COMPLETED) {
                        e_comp_editor_property_part_picker_with_map_set_selected (
                                E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (task_editor->priv->status),
-                               ICAL_STATUS_COMPLETED);
+                               I_CAL_STATUS_COMPLETED);
                }
 
                gtk_spin_button_set_value (percent_spin, 100);
        }
 
        e_comp_editor_set_updating (comp_editor, FALSE);
+
+       g_clear_object (&itt);
 }
 
 static void
@@ -385,17 +405,17 @@ ece_task_status_changed_cb (GtkComboBox *combo_box,
        status = e_comp_editor_property_part_picker_with_map_get_selected (
                E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (task_editor->priv->status));
 
-       if (status == ICAL_STATUS_NONE) {
+       if (status == I_CAL_STATUS_NONE) {
                gtk_spin_button_set_value (percent_spin, 0);
                e_date_edit_set_time (completed_date, (time_t) -1);
-       } else if (status == ICAL_STATUS_INPROCESS) {
+       } else if (status == I_CAL_STATUS_INPROCESS) {
                gint percent_complete = gtk_spin_button_get_value_as_int (percent_spin);
 
                if (percent_complete <= 0 || percent_complete >= 100)
                        gtk_spin_button_set_value (percent_spin, 50);
 
                e_date_edit_set_time (completed_date, (time_t) -1);
-       } else if (status == ICAL_STATUS_COMPLETED) {
+       } else if (status == I_CAL_STATUS_COMPLETED) {
                gtk_spin_button_set_value (percent_spin, 100);
                e_date_edit_set_time (completed_date, time (NULL));
        }
@@ -429,14 +449,14 @@ ece_task_percentcomplete_value_changed_cb (GtkSpinButton *spin_button,
        percent = gtk_spin_button_get_value_as_int (percent_spin);
        if (percent == 100) {
                ctime = time (NULL);
-               status = ICAL_STATUS_COMPLETED;
+               status = I_CAL_STATUS_COMPLETED;
        } else {
                ctime = (time_t) -1;
 
                if (percent == 0)
-                       status = ICAL_STATUS_NONE;
+                       status = I_CAL_STATUS_NONE;
                else
-                       status = ICAL_STATUS_INPROCESS;
+                       status = I_CAL_STATUS_INPROCESS;
        }
 
        e_comp_editor_property_part_picker_with_map_set_selected (
@@ -507,12 +527,12 @@ ece_task_sensitize_widgets (ECompEditor *comp_editor,
 
 static void
 ece_task_fill_widgets (ECompEditor *comp_editor,
-                      icalcomponent *component)
+                      ICalComponent *component)
 {
        gboolean force_allday = FALSE;
 
        g_return_if_fail (E_IS_COMP_EDITOR_TASK (comp_editor));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        ece_task_update_timezone (E_COMP_EDITOR_TASK (comp_editor), &force_allday);
 
@@ -528,10 +548,10 @@ ece_task_fill_widgets (ECompEditor *comp_editor,
 
 static gboolean
 ece_task_fill_component (ECompEditor *comp_editor,
-                        icalcomponent *component)
+                        ICalComponent *component)
 {
        ECompEditorTask *task_editor;
-       struct icaltimetype itt;
+       ICalTime *itt;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR_TASK (comp_editor), FALSE);
 
@@ -549,18 +569,22 @@ ece_task_fill_component (ECompEditor *comp_editor,
        }
 
        if (e_cal_util_component_has_recurrences (component)) {
-               struct icaltimetype dtstart;
+               ICalTime *dtstart;
 
                dtstart = e_comp_editor_property_part_datetime_get_value 
(E_COMP_EDITOR_PROPERTY_PART_DATETIME (task_editor->priv->dtstart));
 
-               if (icaltime_is_null_time (dtstart) || !icaltime_is_valid_time (dtstart)) {
+               if (!dtstart || i_cal_time_is_null_time (dtstart) || !i_cal_time_is_valid_time (dtstart)) {
                        e_comp_editor_set_validation_error (comp_editor,
                                task_editor->priv->page_general,
                                e_comp_editor_property_part_get_edit_widget (task_editor->priv->dtstart),
                                _("Start date is required for recurring tasks"));
 
+                       g_clear_object (&dtstart);
+
                        return FALSE;
                }
+
+               g_clear_object (&dtstart);
        }
 
        if (!e_comp_editor_property_part_datetime_check_validity (
@@ -593,9 +617,13 @@ ece_task_fill_component (ECompEditor *comp_editor,
                        e_comp_editor_property_part_get_edit_widget (task_editor->priv->completed_date),
                        _("Completed date cannot be in the future"));
 
+               g_clear_object (&itt);
+
                return FALSE;
        }
 
+       g_clear_object (&itt);
+
        if (!E_COMP_EDITOR_CLASS (e_comp_editor_task_parent_class)->fill_component (comp_editor, component))
                return FALSE;
 
@@ -609,9 +637,9 @@ ece_task_fill_component (ECompEditor *comp_editor,
                if (cal_client) {
                        if ((e_comp_editor_get_flags (comp_editor) & E_COMP_EDITOR_FLAG_IS_NEW) != 0) {
                                e_cal_util_init_recur_task_sync (component, cal_client, NULL, NULL);
-                       } else if (icalcomponent_get_first_property (component, ICAL_COMPLETED_PROPERTY)) {
+                       } else if (e_cal_util_component_has_property (component, I_CAL_COMPLETED_PROPERTY)) {
                                e_cal_util_mark_task_complete_sync (component, (time_t) -1, cal_client, NULL, 
NULL);
-                       } else if (!icalcomponent_get_first_property (component, ICAL_DUE_PROPERTY)) {
+                       } else if (!e_cal_util_component_has_property (component, I_CAL_DUE_PROPERTY)) {
                                e_cal_util_init_recur_task_sync (component, cal_client, NULL, NULL);
                        }
                }
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index 1e0fc23d5a..c164d011b7 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -48,7 +48,7 @@ struct _ECompEditorPrivate {
        EShell *shell;
        GSettings *calendar_settings;
        ESource *origin_source;
-       icalcomponent *component;
+       ICalComponent *component;
        guint32 flags;
 
        EFocusTracker *focus_tracker;
@@ -155,31 +155,31 @@ static void
 ece_set_attendees_for_delegation (ECalComponent *comp,
                                  const gchar *address)
 {
-       icalproperty *prop;
-       icalparameter *param;
-       icalcomponent *icalcomp;
+       ICalProperty *prop;
+       ICalParameter *param;
+       ICalComponent *icomp;
        gboolean again;
 
-       icalcomp = e_cal_component_get_icalcomponent (comp);
+       icomp = e_cal_component_get_icalcomponent (comp);
 
-       for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
+       for (prop = i_cal_component_get_first_property (icomp, I_CAL_ATTENDEE_PROPERTY);
             prop;
-            prop = again ? icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY) :
-            icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
-               const gchar *attendee = icalproperty_get_attendee (prop);
+            g_object_unref (prop), prop = again ? i_cal_component_get_first_property (icomp, 
I_CAL_ATTENDEE_PROPERTY) :
+            i_cal_component_get_next_property (icomp, I_CAL_ATTENDEE_PROPERTY)) {
+               const gchar *attendee = i_cal_property_get_attendee (prop);
                const gchar *delfrom = NULL;
 
                again = FALSE;
-               param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER);
+               param = i_cal_property_get_first_parameter (prop, I_CAL_DELEGATEDFROM_PARAMETER);
                if (param)
-                       delfrom = icalparameter_get_delegatedfrom (param);
+                       delfrom = i_cal_parameter_get_delegatedfrom (param);
                if (!(g_str_equal (itip_strip_mailto (attendee), address) ||
                     ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), address)))) {
-                       icalcomponent_remove_property (icalcomp, prop);
-                       icalproperty_free (prop);
+                       i_cal_component_remove_property (icomp, prop);
                        again = TRUE;
                }
 
+               g_clear_object (&param);
        }
 }
 
@@ -273,14 +273,15 @@ ece_get_mime_attach_list (ECompEditor *comp_editor)
 
 static void
 e_comp_editor_set_component (ECompEditor *comp_editor,
-                            const icalcomponent *component)
+                            const ICalComponent *component)
 {
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
-       if (comp_editor->priv->component)
-               icalcomponent_free (comp_editor->priv->component);
-       comp_editor->priv->component = icalcomponent_new_clone ((icalcomponent *) component);
+       if (comp_editor->priv->component != component) {
+               g_clear_object (&comp_editor->priv->component);
+               comp_editor->priv->component = i_cal_component_new_clone ((ICalComponent *) component);
+       }
 
        g_warn_if_fail (comp_editor->priv->component != NULL);
 }
@@ -289,7 +290,7 @@ typedef struct _SaveData {
        ECompEditor *comp_editor;
        ECalClient *source_client;
        ECalClient *target_client;
-       icalcomponent *component;
+       ICalComponent *component;
        gboolean with_send;
        gboolean close_after_save;
        ECalObjModType recur_mod;
@@ -345,9 +346,8 @@ save_data_free (SaveData *sd)
                g_clear_object (&sd->target_client);
                g_clear_object (&sd->send_comp);
                g_clear_object (&sd->send_activity);
+               g_clear_object (&sd->component);
                g_clear_error (&sd->error);
-               if (sd->component)
-                       icalcomponent_free (sd->component);
                g_slist_free_full (sd->mime_attach_list, itip_cal_mime_attach_free);
                g_free (sd->alert_ident);
                g_free (sd->alert_arg_0);
@@ -371,7 +371,7 @@ ece_send_process_method (SaveData *sd,
        g_return_val_if_fail (send_method != E_CAL_COMPONENT_METHOD_NONE, FALSE);
 
        if (e_cal_component_has_attachments (send_comp) &&
-           e_client_check_capability (E_CLIENT (sd->target_client), CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) {
+           e_client_check_capability (E_CLIENT (sd->target_client), 
E_CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) {
                /* Clone the component with attachments set to CID:...  */
                GSList *attach_list = NULL;
                GSList *attach;
@@ -382,16 +382,19 @@ ece_send_process_method (SaveData *sd,
 
                for (attach = mime_attach_list; attach; attach = attach->next) {
                        struct CalMimeAttach *cma = (struct CalMimeAttach *) attach->data;
+                       gchar *url;
 
-                       attach_list = g_slist_append (
-                               attach_list, g_strconcat (
-                               "cid:", cma->content_id, NULL));
+                       url = g_strconcat ("cid:", cma->content_id, NULL);
+                       attach_list = g_slist_prepend (attach_list, i_cal_attach_new_from_url (url));
+                       g_free (url);
                }
 
                if (attach_list) {
-                       e_cal_component_set_attachment_list (send_comp, attach_list);
+                       attach_list = g_slist_reverse (attach_list);
+
+                       e_cal_component_set_attachments (send_comp, attach_list);
 
-                       g_slist_free_full (attach_list, g_free);
+                       g_slist_free_full (attach_list, g_object_unref);
                }
        }
 
@@ -471,7 +474,7 @@ ece_prepare_send_component_thread (EAlertSinkThreadJobData *job_data,
 
        g_return_if_fail (sd != NULL);
        g_return_if_fail (E_IS_CAL_CLIENT (sd->target_client));
-       g_return_if_fail (sd->component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (sd->component));
 
        while (!sd->send_activity) {
                /* Give the main thread a chance to set this object
@@ -480,18 +483,18 @@ ece_prepare_send_component_thread (EAlertSinkThreadJobData *job_data,
                g_usleep (50000);
        }
 
-       switch (icalcomponent_isa (sd->component)) {
-               case ICAL_VEVENT_COMPONENT:
+       switch (i_cal_component_isa (sd->component)) {
+               case I_CAL_VEVENT_COMPONENT:
                        alert_ident = "calendar:failed-send-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        alert_ident = "calendar:failed-send-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        alert_ident = "calendar:failed-send-task";
                        break;
                default:
-                       g_warning ("%s: Cannot send component of kind %d", G_STRFUNC, icalcomponent_isa 
(sd->component));
+                       g_warning ("%s: Cannot send component of kind %d", G_STRFUNC, i_cal_component_isa 
(sd->component));
                        sd->success = FALSE;
                        sd->alert_ident = g_strdup ("calendar:failed-send-event");
                        return;
@@ -507,13 +510,13 @@ ece_prepare_send_component_thread (EAlertSinkThreadJobData *job_data,
 
        if (sd->recur_mod == E_CAL_OBJ_MOD_ALL && e_cal_component_is_instance (sd->send_comp)) {
                /* Ensure we send the master object, not the instance only */
-               icalcomponent *icalcomp = NULL;
+               ICalComponent *icomp = NULL;
                const gchar *uid = NULL;
 
-               e_cal_component_get_uid (sd->send_comp, &uid);
-               if (e_cal_client_get_object_sync (sd->target_client, uid, NULL, &icalcomp, cancellable, NULL) 
&&
-                   icalcomp != NULL) {
-                       send_comp = e_cal_component_new_from_icalcomponent (icalcomp);
+               uid = e_cal_component_get_uid (sd->send_comp);
+               if (e_cal_client_get_object_sync (sd->target_client, uid, NULL, &icomp, cancellable, NULL) &&
+                   icomp != NULL) {
+                       send_comp = e_cal_component_new_from_icalcomponent (icomp);
                }
        }
 
@@ -557,7 +560,7 @@ ece_save_component_done (gpointer ptr)
                if (sd->object_created)
                        g_signal_emit (sd->comp_editor, signals[OBJECT_CREATED], 0, NULL);
 
-               comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (sd->component));
+               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (sd->component));
                if (sd->comp_editor->priv->page_general) {
                        GSList *added_attendees;
 
@@ -624,19 +627,19 @@ ece_save_component_done (gpointer ptr)
 
 static gboolean
 ece_save_component_attachments_sync (ECalClient *cal_client,
-                                    icalcomponent *component,
+                                    ICalComponent *component,
                                     GCancellable *cancellable,
                                     GError **error)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *local_store;
        gchar *target_filename_prefix, *filename_prefix, *tmp;
        gboolean success = TRUE;
 
        g_return_val_if_fail (E_IS_CAL_CLIENT (cal_client), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
-       tmp = g_strdup (icalcomponent_get_uid (component));
+       tmp = g_strdup (i_cal_component_get_uid (component));
        e_filename_make_safe (tmp);
        filename_prefix = g_strconcat (tmp, "-", NULL);
        g_free (tmp);
@@ -651,25 +654,21 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
 
        g_free (filename_prefix);
 
-       for (prop = icalcomponent_get_first_property (component, ICAL_ATTACH_PROPERTY);
+       for (prop = i_cal_component_get_first_property (component, I_CAL_ATTACH_PROPERTY);
             prop && success;
-            prop = icalcomponent_get_next_property (component, ICAL_ATTACH_PROPERTY)) {
-               icalattach *attach;
+            g_object_unref (prop), prop = i_cal_component_get_next_property (component, 
I_CAL_ATTACH_PROPERTY)) {
+               ICalAttach *attach;
                gchar *uri = NULL;
 
-               attach = icalproperty_get_attach (prop);
+               attach = i_cal_property_get_attach (prop);
                if (!attach)
                        continue;
 
-               if (icalattach_get_is_url (attach)) {
+               if (i_cal_attach_get_is_url (attach)) {
                        const gchar *data;
-                       gsize buf_size;
 
-                       data = icalattach_get_url (attach);
-                       buf_size = strlen (data);
-                       uri = g_malloc0 (buf_size + 1);
-
-                       icalvalue_decode_ical_string (data, uri, buf_size);
+                       data = i_cal_attach_get_url (attach);
+                       uri = i_cal_value_decode_ical_string (data);
                }
 
                if (uri) {
@@ -693,19 +692,15 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
                                                uri = g_file_get_uri (destination);
 
                                                if (uri) {
-                                                       icalattach *new_attach;
-                                                       gsize buf_size;
+                                                       ICalAttach *new_attach;
                                                        gchar *buf;
 
-                                                       buf_size = 2 * strlen (uri) + 1;
-                                                       buf = g_malloc0 (buf_size);
-
-                                                       icalvalue_encode_ical_string (uri, buf, buf_size);
-                                                       new_attach = icalattach_new_from_url (buf);
+                                                       buf = i_cal_value_encode_ical_string (uri);
+                                                       new_attach = i_cal_attach_new_from_url (buf);
 
-                                                       icalproperty_set_attach (prop, new_attach);
+                                                       i_cal_property_set_attach (prop, new_attach);
 
-                                                       icalattach_unref (new_attach);
+                                                       g_object_unref (new_attach);
                                                        g_free (buf);
                                                }
                                        }
@@ -722,13 +717,14 @@ ece_save_component_attachments_sync (ECalClient *cal_client,
                success = success & !g_cancellable_set_error_if_cancelled (cancellable, error);
        }
 
+       g_clear_object (&prop);
        g_free (target_filename_prefix);
 
        return success;
 }
 
 static void
-ece_gather_tzids_cb (icalparameter *param,
+ece_gather_tzids_cb (ICalParameter *param,
                     gpointer user_data)
 {
        GHashTable *tzids = user_data;
@@ -737,7 +733,7 @@ ece_gather_tzids_cb (icalparameter *param,
        g_return_if_fail (param != NULL);
        g_return_if_fail (tzids != NULL);
 
-       tzid = icalparameter_get_tzid (param);
+       tzid = i_cal_parameter_get_tzid (param);
        if (tzid && *tzid && g_ascii_strcasecmp (tzid, "UTC") != 0)
                g_hash_table_insert (tzids, g_strdup (tzid), NULL);
 }
@@ -753,7 +749,7 @@ ece_save_component_add_timezones_sync (SaveData *sd,
        gboolean source_is_target;
 
        g_return_val_if_fail (sd != NULL, FALSE);
-       g_return_val_if_fail (sd->component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (sd->component), FALSE);
        g_return_val_if_fail (sd->target_client != NULL, FALSE);
 
        sd->success = TRUE;
@@ -763,19 +759,19 @@ ece_save_component_add_timezones_sync (SaveData *sd,
                e_source_equal (e_client_get_source (E_CLIENT (sd->target_client)),
                                e_client_get_source (E_CLIENT (sd->source_client)));
 
-       icalcomponent_foreach_tzid (sd->component, ece_gather_tzids_cb, tzids);
+       i_cal_component_foreach_tzid (sd->component, ece_gather_tzids_cb, tzids);
 
        g_hash_table_iter_init (&iter, tzids);
        while (sd->success && g_hash_table_iter_next (&iter, &key, &value)) {
                const gchar *tzid = key;
-               icaltimezone *zone = NULL;
+               ICalTimezone *zone = NULL;
                GError *local_error = NULL;
 
                if (!e_cal_client_get_timezone_sync (source_is_target ? sd->target_client : sd->source_client,
                        tzid, &zone, cancellable, &local_error)) {
-                       zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+                       zone = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
                        if (!zone)
-                               zone = icaltimezone_get_builtin_timezone (tzid);
+                               zone = i_cal_timezone_get_builtin_timezone (tzid);
                        if (!zone) {
                                g_propagate_error (error, local_error);
                                local_error = NULL;
@@ -806,29 +802,29 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
 
        g_return_if_fail (sd != NULL);
        g_return_if_fail (E_IS_CAL_CLIENT (sd->target_client));
-       g_return_if_fail (sd->component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (sd->component));
 
-       switch (icalcomponent_isa (sd->component)) {
-               case ICAL_VEVENT_COMPONENT:
+       switch (i_cal_component_isa (sd->component)) {
+               case I_CAL_VEVENT_COMPONENT:
                        create_alert_ident = "calendar:failed-create-event";
                        modify_alert_ident = "calendar:failed-modify-event";
                        remove_alert_ident = "calendar:failed-remove-event";
                        get_alert_ident = "calendar:failed-get-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        create_alert_ident = "calendar:failed-create-memo";
                        modify_alert_ident = "calendar:failed-modify-memo";
                        remove_alert_ident = "calendar:failed-remove-memo";
                        get_alert_ident = "calendar:failed-get-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        create_alert_ident = "calendar:failed-create-task";
                        modify_alert_ident = "calendar:failed-modify-task";
                        remove_alert_ident = "calendar:failed-remove-task";
                        get_alert_ident = "calendar:failed-get-task";
                        break;
                default:
-                       g_warning ("%s: Cannot save component of kind %d", G_STRFUNC, icalcomponent_isa 
(sd->component));
+                       g_warning ("%s: Cannot save component of kind %d", G_STRFUNC, i_cal_component_isa 
(sd->component));
                        return;
        }
 
@@ -844,7 +840,7 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
                return;
        }
 
-       orig_uid = g_strdup (icalcomponent_get_uid (sd->component));
+       orig_uid = g_strdup (i_cal_component_get_uid (sd->component));
 
        if (cal_comp_is_icalcomp_on_server_sync (sd->component, sd->target_client, cancellable, error)) {
                ECalComponent *comp;
@@ -852,7 +848,7 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
 
                e_alert_sink_thread_job_set_alert_ident (job_data, modify_alert_ident);
 
-               comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (sd->component));
+               comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (sd->component));
                g_return_if_fail (comp != NULL);
 
                has_recurrences = e_cal_util_component_has_recurrences (sd->component);
@@ -863,20 +859,20 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
                        sd->success = TRUE;
 
                if (sd->recur_mod == E_CAL_OBJ_MOD_THIS) {
-                       e_cal_component_set_rdate_list (comp, NULL);
-                       e_cal_component_set_rrule_list (comp, NULL);
-                       e_cal_component_set_exdate_list (comp, NULL);
-                       e_cal_component_set_exrule_list (comp, NULL);
+                       e_cal_component_set_rdates (comp, NULL);
+                       e_cal_component_set_rrules (comp, NULL);
+                       e_cal_component_set_exdates (comp, NULL);
+                       e_cal_component_set_exrules (comp, NULL);
                }
 
                sd->success = sd->success && e_cal_client_modify_object_sync (
-                       sd->target_client, e_cal_component_get_icalcomponent (comp), sd->recur_mod, 
cancellable, error);
+                       sd->target_client, e_cal_component_get_icalcomponent (comp), sd->recur_mod, 
E_CAL_OPERATION_FLAG_NONE, cancellable, error);
 
                g_clear_object (&comp);
        } else {
                e_alert_sink_thread_job_set_alert_ident (job_data, create_alert_ident);
 
-               sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, &new_uid, 
cancellable, error);
+               sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, 
E_CAL_OPERATION_FLAG_NONE, &new_uid, cancellable, error);
 
                if (sd->success)
                        sd->object_created = TRUE;
@@ -894,8 +890,8 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
                        recur_mod = E_CAL_OBJ_MOD_ALL;
 
                sd->success = e_cal_client_remove_object_sync (
-                       sd->source_client, orig_uid,
-                       NULL, recur_mod, cancellable, error);
+                       sd->source_client, orig_uid, NULL, recur_mod,
+                       E_CAL_OPERATION_FLAG_NONE, cancellable, error);
 
                if (!sd->success) {
                        gchar *source_display_name;
@@ -911,29 +907,22 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
        }
 
        if (new_uid) {
-               icalcomponent_set_uid (sd->component, new_uid);
+               i_cal_component_set_uid (sd->component, new_uid);
                g_free (new_uid);
        }
 
        g_free (orig_uid);
 
        if (sd->success && !sd->close_after_save) {
-               icalcomponent *comp = NULL;
+               ICalComponent *comp = NULL;
                gchar *uid, *rid = NULL;
 
-               uid = g_strdup (icalcomponent_get_uid (sd->component));
-               if (icalcomponent_get_first_property (sd->component, ICAL_RECURRENCEID_PROPERTY)) {
-                       struct icaltimetype ridtt;
-
-                       ridtt = icalcomponent_get_recurrenceid (sd->component);
-                       if (icaltime_is_valid_time (ridtt) && !icaltime_is_null_time (ridtt)) {
-                               rid = icaltime_as_ical_string_r (ridtt);
-                       }
-               }
+               uid = g_strdup (i_cal_component_get_uid (sd->component));
+               rid = e_cal_util_component_get_recurid_as_string (sd->component);
 
                sd->success = e_cal_client_get_object_sync (sd->target_client, uid, rid, &comp, cancellable, 
error);
                if (sd->success && comp) {
-                       icalcomponent_free (sd->component);
+                       g_clear_object (&sd->component);
                        sd->component = comp;
                } else {
                        e_alert_sink_thread_job_set_alert_ident (job_data, get_alert_ident);
@@ -946,7 +935,7 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
 
 static void
 ece_save_component (ECompEditor *comp_editor,
-                   icalcomponent *component,
+                   ICalComponent *component,
                    gboolean with_send,
                    gboolean close_after_save)
 {
@@ -957,9 +946,9 @@ ece_save_component (ECompEditor *comp_editor,
        gchar *source_display_name;
 
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
-       summary = icalcomponent_get_summary (component);
+       summary = i_cal_component_get_summary (component);
        if (!summary || !*summary) {
                if (!e_cal_dialogs_send_component_prompt_subject (GTK_WINDOW (comp_editor), component)) {
                        return;
@@ -981,7 +970,7 @@ ece_save_component (ECompEditor *comp_editor,
        sd->comp_editor = g_object_ref (comp_editor);
        sd->source_client = comp_editor->priv->source_client ? g_object_ref 
(comp_editor->priv->source_client) : NULL;
        sd->target_client = g_object_ref (comp_editor->priv->target_client);
-       sd->component = icalcomponent_new_clone (component);
+       sd->component = i_cal_component_new_clone (component);
        sd->with_send = with_send;
        sd->close_after_save = close_after_save;
        sd->recur_mod = recur_mod;
@@ -1098,14 +1087,14 @@ comp_editor_open_target_client_thread (EAlertSinkThreadJobData *job_data,
 
                if (!g_cancellable_is_cancelled (cancellable)) {
                        e_client_get_backend_property_sync (otc->client,
-                               CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS,
+                               E_CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS,
                                &otc->cal_email_address,
                                cancellable, error);
                }
 
                if (!g_cancellable_is_cancelled (cancellable)) {
                        e_client_get_backend_property_sync (otc->client,
-                               CAL_BACKEND_PROPERTY_ALARM_EMAIL_ADDRESS,
+                               E_CAL_BACKEND_PROPERTY_ALARM_EMAIL_ADDRESS,
                                &otc->alarm_email_address,
                                cancellable, error);
                }
@@ -1278,10 +1267,10 @@ e_comp_editor_save_and_close (ECompEditor *comp_editor,
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
 
        if (comp_editor->priv->component) {
-               icalcomponent *component = icalcomponent_new_clone (comp_editor->priv->component);
+               ICalComponent *component = i_cal_component_new_clone (comp_editor->priv->component);
                if (component && e_comp_editor_fill_component (comp_editor, component)) {
                        ece_save_component (comp_editor, component, TRUE, can_close);
-                       icalcomponent_free (component);
+                       g_clear_object (&component);
                }
        }
 }
@@ -1289,7 +1278,7 @@ e_comp_editor_save_and_close (ECompEditor *comp_editor,
 static GtkResponseType
 ece_save_component_dialog (ECompEditor *comp_editor)
 {
-       const icalcomponent *component;
+       ICalComponent *component;
        GtkWindow *parent;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), GTK_RESPONSE_NO);
@@ -1297,15 +1286,15 @@ ece_save_component_dialog (ECompEditor *comp_editor)
 
        parent = GTK_WINDOW (comp_editor);
        component = e_comp_editor_get_component (comp_editor);
-       switch (icalcomponent_isa (component)) {
-               case ICAL_VEVENT_COMPONENT:
+       switch (i_cal_component_isa (component)) {
+               case I_CAL_VEVENT_COMPONENT:
                        if (e_comp_editor_page_general_get_show_attendees (comp_editor->priv->page_general))
                                return e_alert_run_dialog_for_args (parent, "calendar:prompt-save-meeting", 
NULL);
                        else
                                return e_alert_run_dialog_for_args (parent, 
"calendar:prompt-save-appointment", NULL);
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        return e_alert_run_dialog_for_args (parent, "calendar:prompt-save-task", NULL);
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        return e_alert_run_dialog_for_args (parent, "calendar:prompt-save-memo", NULL);
                default:
                        return GTK_RESPONSE_NO;
@@ -1316,7 +1305,7 @@ static gboolean
 e_comp_editor_prompt_and_save_changes (ECompEditor *comp_editor,
                                       gboolean with_send)
 {
-       icalcomponent *component;
+       ICalComponent *component;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
 
@@ -1338,8 +1327,8 @@ e_comp_editor_prompt_and_save_changes (ECompEditor *comp_editor,
 
                if (comp_editor->priv->component &&
                    e_comp_editor_page_general_get_show_attendees (comp_editor->priv->page_general) &&
-                   icalcomponent_isa (comp_editor->priv->component) == ICAL_VTODO_COMPONENT
-                   && e_client_check_capability (E_CLIENT (comp_editor->priv->target_client), 
CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)) {
+                   i_cal_component_isa (comp_editor->priv->component) == I_CAL_VTODO_COMPONENT
+                   && e_client_check_capability (E_CLIENT (comp_editor->priv->target_client), 
E_CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)) {
                        e_alert_submit (
                                E_ALERT_SINK (comp_editor),
                                "calendar:prompt-no-task-assignment-editor",
@@ -1349,9 +1338,9 @@ e_comp_editor_prompt_and_save_changes (ECompEditor *comp_editor,
                        return FALSE;
                }
 
-               component = icalcomponent_new_clone (comp_editor->priv->component);
+               component = i_cal_component_new_clone (comp_editor->priv->component);
                if (!e_comp_editor_fill_component (comp_editor, component)) {
-                       icalcomponent_free (component);
+                       g_clear_object (&component);
                        return FALSE;
                }
 
@@ -1396,15 +1385,15 @@ static void
 ece_print_or_preview (ECompEditor *comp_editor,
                      GtkPrintOperationAction print_action)
 {
-       icalcomponent *component;
+       ICalComponent *component;
        ECalComponent *comp;
 
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
        g_return_if_fail (e_comp_editor_get_component (comp_editor) != NULL);
 
-       component = icalcomponent_new_clone (e_comp_editor_get_component (comp_editor));
+       component = i_cal_component_new_clone (e_comp_editor_get_component (comp_editor));
        if (!e_comp_editor_fill_component (comp_editor, component)) {
-               icalcomponent_free (component);
+               g_clear_object (&component);
                return;
        }
 
@@ -1471,7 +1460,7 @@ ece_organizer_email_address_is_user (ECompEditor *comp_editor,
                return TRUE;
        }
 
-       if (is_organizer && e_client_check_capability (client, 
CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))
+       if (is_organizer && e_client_check_capability (client, 
E_CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))
                return FALSE;
 
        registry = e_shell_get_registry (e_comp_editor_get_shell (comp_editor));
@@ -1481,51 +1470,70 @@ ece_organizer_email_address_is_user (ECompEditor *comp_editor,
 
 static gboolean
 ece_organizer_is_user (ECompEditor *comp_editor,
-                      icalcomponent *component,
+                      ICalComponent *component,
                       EClient *client)
 {
-       icalproperty *prop;
+       ICalProperty *prop;
        const gchar *organizer;
+       gboolean res;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
        g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
 
-       prop = icalcomponent_get_first_property (component, ICAL_ORGANIZER_PROPERTY);
-       if (!prop || e_client_check_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER))
+       prop = i_cal_component_get_first_property (component, I_CAL_ORGANIZER_PROPERTY);
+       if (!prop || e_client_check_capability (client, E_CAL_STATIC_CAPABILITY_NO_ORGANIZER)) {
+               g_clear_object (&prop);
                return FALSE;
+       }
 
-       organizer = itip_strip_mailto (icalproperty_get_organizer (prop));
-       if (!organizer || !*organizer)
+       organizer = itip_strip_mailto (i_cal_property_get_organizer (prop));
+       if (!organizer || !*organizer) {
+               g_clear_object (&prop);
                return FALSE;
+       }
+
+       res = ece_organizer_email_address_is_user (comp_editor, client, organizer, TRUE);
+
+       g_clear_object (&prop);
 
-       return ece_organizer_email_address_is_user (comp_editor, client, organizer, TRUE);
+       return res;
 }
 
 static gboolean
 ece_sentby_is_user (ECompEditor *comp_editor,
-                   icalcomponent *component,
+                   ICalComponent *component,
                    EClient *client)
 {
-       icalproperty *prop;
-       icalparameter *param;
+       ICalProperty *prop;
+       ICalParameter *param;
        const gchar *sentby;
+       gboolean res;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
        g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
 
-       prop = icalcomponent_get_first_property (component, ICAL_ORGANIZER_PROPERTY);
-       if (!prop || e_client_check_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER))
+       prop = i_cal_component_get_first_property (component, I_CAL_ORGANIZER_PROPERTY);
+       if (!prop || e_client_check_capability (client, E_CAL_STATIC_CAPABILITY_NO_ORGANIZER)) {
+               g_clear_object (&prop);
                return FALSE;
+       }
 
-       param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER);
-       if (!param)
+       param = i_cal_property_get_first_parameter (prop, I_CAL_SENTBY_PARAMETER);
+       if (!param) {
+               g_clear_object (&prop);
                return FALSE;
+       }
+
+       sentby = i_cal_parameter_get_sentby (param);
 
-       sentby = icalparameter_get_sentby (param);
+       res = ece_organizer_email_address_is_user (comp_editor, client, sentby, FALSE);
 
-       return ece_organizer_email_address_is_user (comp_editor, client, sentby, FALSE);
+       g_clear_object (&param);
+       g_clear_object (&prop);
+
+       return res;
 }
 
 static void
@@ -1591,12 +1599,12 @@ ece_sensitize_widgets (ECompEditor *comp_editor,
 
 static void
 ece_fill_widgets (ECompEditor *comp_editor,
-                 icalcomponent *component)
+                 ICalComponent *component)
 {
        GSList *link;
 
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        for (link = comp_editor->priv->pages; link; link = g_slist_next (link)) {
                ECompEditorPage *page = link->data;
@@ -1611,12 +1619,12 @@ ece_fill_widgets (ECompEditor *comp_editor,
 
 static gboolean
 ece_fill_component (ECompEditor *comp_editor,
-                   icalcomponent *component)
+                   ICalComponent *component)
 {
        GSList *link;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        for (link = comp_editor->priv->pages; link; link = g_slist_next (link)) {
                ECompEditorPage *page = link->data;
@@ -1798,7 +1806,7 @@ e_comp_editor_set_property (GObject *object,
                case PROP_COMPONENT:
                        e_comp_editor_set_component (
                                E_COMP_EDITOR (object),
-                               g_value_get_pointer (value));
+                               g_value_get_object (value));
                        return;
 
                case PROP_FLAGS:
@@ -1870,7 +1878,7 @@ e_comp_editor_get_property (GObject *object,
                        return;
 
                case PROP_COMPONENT:
-                       g_value_set_pointer (
+                       g_value_set_object (
                                value,
                                e_comp_editor_get_component (
                                E_COMP_EDITOR (object)));
@@ -2340,10 +2348,7 @@ e_comp_editor_dispose (GObject *object)
        g_free (comp_editor->priv->title_suffix);
        comp_editor->priv->title_suffix = NULL;
 
-       if (comp_editor->priv->component) {
-               icalcomponent_free (comp_editor->priv->component);
-               comp_editor->priv->component = NULL;
-       }
+       g_clear_object (&comp_editor->priv->component);
 
        ece_connect_time_parts (comp_editor, NULL, NULL);
 
@@ -2433,10 +2438,11 @@ e_comp_editor_class_init (ECompEditorClass *klass)
        g_object_class_install_property (
                object_class,
                PROP_COMPONENT,
-               g_param_spec_pointer (
+               g_param_spec_object (
                        "component",
                        "Component",
-                       "icalcomponent currently edited",
+                       "ICalComponent currently edited",
+                       I_CAL_TYPE_COMPONENT,
                        G_PARAM_READWRITE |
                        G_PARAM_CONSTRUCT_ONLY |
                        G_PARAM_STATIC_STRINGS));
@@ -2588,12 +2594,12 @@ e_comp_editor_sensitize_widgets (ECompEditor *comp_editor)
 
 void
 e_comp_editor_fill_widgets (ECompEditor *comp_editor,
-                           icalcomponent *component)
+                           ICalComponent *component)
 {
        ECompEditorClass *comp_editor_class;
 
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
-       g_return_if_fail (component != NULL);
+       g_return_if_fail (I_CAL_IS_COMPONENT (component));
 
        comp_editor_class = E_COMP_EDITOR_GET_CLASS (comp_editor);
        g_return_if_fail (comp_editor_class != NULL);
@@ -2608,13 +2614,13 @@ e_comp_editor_fill_widgets (ECompEditor *comp_editor,
 
 gboolean
 e_comp_editor_fill_component (ECompEditor *comp_editor,
-                             icalcomponent *component)
+                             ICalComponent *component)
 {
        ECompEditorClass *comp_editor_class;
        gboolean is_valid;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        comp_editor_class = E_COMP_EDITOR_GET_CLASS (comp_editor);
        g_return_val_if_fail (comp_editor_class != NULL, FALSE);
@@ -2640,8 +2646,8 @@ e_comp_editor_fill_component (ECompEditor *comp_editor,
                    ece_sentby_is_user (comp_editor, component, client)))) {
                        gint sequence;
 
-                       sequence = icalcomponent_get_sequence (component);
-                       icalcomponent_set_sequence (component, sequence + 1);
+                       sequence = i_cal_component_get_sequence (component);
+                       i_cal_component_set_sequence (component, sequence + 1);
                }
        }
 
@@ -2706,7 +2712,7 @@ e_comp_editor_get_origin_source (ECompEditor *comp_editor)
        return comp_editor->priv->origin_source;
 }
 
-icalcomponent *
+ICalComponent *
 e_comp_editor_get_component (ECompEditor *comp_editor)
 {
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), NULL);
@@ -3152,98 +3158,116 @@ e_comp_editor_add_error (ECompEditor *comp_editor,
 
 static gboolean
 ece_check_start_before_end (ECompEditor *comp_editor,
-                           struct icaltimetype *start_tt,
-                           struct icaltimetype *end_tt,
+                           ICalTime **pstart_tt,
+                           ICalTime **pend_tt,
                            gboolean adjust_end_time)
 {
-       struct icaltimetype end_tt_copy;
-       icaltimezone *start_zone, *end_zone;
+       ICalTime *start_tt, *end_tt, *end_tt_copy;
+       ICalTimezone *start_zone, *end_zone;
        gint duration = -1;
        gint cmp;
 
+       start_tt = *pstart_tt;
+       end_tt = *pend_tt;
+
        if ((e_comp_editor_get_flags (comp_editor) & E_COMP_EDITOR_FLAG_IS_NEW) == 0) {
-               icalcomponent *icomp;
+               ICalComponent *icomp;
 
                icomp = e_comp_editor_get_component (comp_editor);
                if (icomp &&
-                   icalcomponent_get_first_property (icomp, ICAL_DTSTART_PROPERTY) &&
-                   (icalcomponent_get_first_property (icomp, ICAL_DTEND_PROPERTY) ||
-                    icalcomponent_get_first_property (icomp, ICAL_DUE_PROPERTY))) {
-                       struct icaltimetype orig_start, orig_end;
+                   e_cal_util_component_has_property (icomp, I_CAL_DTSTART_PROPERTY) &&
+                   (e_cal_util_component_has_property (icomp, I_CAL_DTEND_PROPERTY) ||
+                    e_cal_util_component_has_property (icomp, I_CAL_DUE_PROPERTY))) {
+                       ICalTime *orig_start, *orig_end;
 
-                       orig_start = icalcomponent_get_dtstart (icomp);
-                       orig_end = icalcomponent_get_dtend (icomp);
+                       orig_start = i_cal_component_get_dtstart (icomp);
+                       orig_end = i_cal_component_get_dtend (icomp);
 
-                       if (icaltime_is_valid_time (orig_start) &&
-                           icaltime_is_valid_time (orig_end)) {
-                               duration = icaltime_as_timet (orig_end) - icaltime_as_timet (orig_start);
+                       if (orig_start && i_cal_time_is_valid_time (orig_start) &&
+                           orig_end && i_cal_time_is_valid_time (orig_end)) {
+                               duration = i_cal_time_as_timet (orig_end) - i_cal_time_as_timet (orig_start);
                        }
+
+                       g_clear_object (&orig_start);
+                       g_clear_object (&orig_end);
                }
        }
 
-       start_zone = (icaltimezone *) start_tt->zone;
-       end_zone = (icaltimezone *) end_tt->zone;
+       start_zone = i_cal_time_get_timezone (start_tt);
+       end_zone = i_cal_time_get_timezone (end_tt);
 
        /* Convert the end time to the same timezone as the start time. */
-       end_tt_copy = *end_tt;
+       end_tt_copy = i_cal_time_new_clone (end_tt);
 
        if (start_zone && end_zone && start_zone != end_zone)
-               icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone);
+               i_cal_timezone_convert_time (end_tt_copy, end_zone, start_zone);
 
        /* Now check if the start time is after the end time. If it is,
         * we need to modify one of the times. */
-       cmp = icaltime_compare (*start_tt, end_tt_copy);
+       cmp = i_cal_time_compare (start_tt, end_tt_copy);
        if (cmp > 0) {
                if (adjust_end_time) {
                        /* Try to switch only the date */
-                       end_tt->year = start_tt->year;
-                       end_tt->month = start_tt->month;
-                       end_tt->day = start_tt->day;
+                       i_cal_time_set_date (end_tt,
+                               i_cal_time_get_year (start_tt),
+                               i_cal_time_get_month (start_tt),
+                               i_cal_time_get_day (start_tt));
 
-                       end_tt_copy = *end_tt;
+                       g_clear_object (&end_tt_copy);
+                       end_tt_copy = i_cal_time_new_clone (end_tt);
                        if (start_zone && end_zone && start_zone != end_zone)
-                               icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone);
+                               i_cal_timezone_convert_time (end_tt_copy, end_zone, start_zone);
 
                        if (duration > 0)
-                               icaltime_adjust (&end_tt_copy, 0, 0, 0, -duration);
+                               i_cal_time_adjust (end_tt_copy, 0, 0, 0, -duration);
 
-                       if (icaltime_compare (*start_tt, end_tt_copy) >= 0) {
-                               *end_tt = *start_tt;
+                       if (i_cal_time_compare (start_tt, end_tt_copy) >= 0) {
+                               g_clear_object (&end_tt);
+                               end_tt = i_cal_time_new_clone (start_tt);
 
                                if (duration >= 0) {
-                                       icaltime_adjust (end_tt, 0, 0, 0, duration);
+                                       i_cal_time_adjust (end_tt, 0, 0, 0, duration);
                                } else {
                                        /* Modify the end time, to be the start + 1 hour/day. */
-                                       icaltime_adjust (end_tt, 0, start_tt->is_date ? 24 : 1, 0, 0);
+                                       i_cal_time_adjust (end_tt, 0, i_cal_time_is_date (start_tt) ? 24 : 1, 
0, 0);
                                }
 
                                if (start_zone && end_zone && start_zone != end_zone)
-                                       icaltimezone_convert_time (end_tt, start_zone, end_zone);
+                                       i_cal_timezone_convert_time (end_tt, start_zone, end_zone);
                        }
                } else {
                        /* Try to switch only the date */
-                       start_tt->year = end_tt->year;
-                       start_tt->month = end_tt->month;
-                       start_tt->day = end_tt->day;
+                       i_cal_time_set_date (start_tt,
+                               i_cal_time_get_year (end_tt),
+                               i_cal_time_get_month (end_tt),
+                               i_cal_time_get_day (end_tt));
 
-                       if (icaltime_compare (*start_tt, end_tt_copy) >= 0) {
-                               *start_tt = *end_tt;
+                       if (i_cal_time_compare (start_tt, end_tt_copy) >= 0) {
+                               g_clear_object (&start_tt);
+                               start_tt = i_cal_time_new_clone (end_tt);
 
                                if (duration >= 0) {
-                                       icaltime_adjust (start_tt, 0, 0, 0, -duration);
+                                       i_cal_time_adjust (start_tt, 0, 0, 0, -duration);
                                } else {
                                        /* Modify the start time, to be the end - 1 hour/day. */
-                                       icaltime_adjust (start_tt, 0, start_tt->is_date ? -24 : -1, 0, 0);
+                                       i_cal_time_adjust (start_tt, 0, i_cal_time_is_date (start_tt) ? -24 : 
-1, 0, 0);
                                }
 
                                if (start_zone && end_zone && start_zone != end_zone)
-                                       icaltimezone_convert_time (start_tt, end_zone, start_zone);
+                                       i_cal_timezone_convert_time (start_tt, end_zone, start_zone);
                        }
                }
 
+               *pstart_tt = start_tt;
+               *pend_tt = end_tt;
+
+               g_clear_object (&end_tt_copy);
+
                return TRUE;
        }
 
+       g_clear_object (&end_tt_copy);
+
        return FALSE;
 }
 
@@ -3254,7 +3278,7 @@ e_comp_editor_ensure_start_before_end (ECompEditor *comp_editor,
                                       gboolean change_end_datetime)
 {
        ECompEditorPropertyPartDatetime *start_dtm, *end_dtm;
-       struct icaltimetype start_tt, end_tt;
+       ICalTime *start_tt, *end_tt;
        gboolean set_dtstart = FALSE, set_dtend = FALSE;
 
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
@@ -3267,28 +3291,36 @@ e_comp_editor_ensure_start_before_end (ECompEditor *comp_editor,
        start_tt = e_comp_editor_property_part_datetime_get_value (start_dtm);
        end_tt = e_comp_editor_property_part_datetime_get_value (end_dtm);
 
-       if (icaltime_is_null_time (start_tt) ||
-           icaltime_is_null_time (end_tt) ||
-           !icaltime_is_valid_time (start_tt) ||
-           !icaltime_is_valid_time (end_tt))
+       if (!start_tt || !end_tt ||
+           i_cal_time_is_null_time (start_tt) ||
+           i_cal_time_is_null_time (end_tt) ||
+           !i_cal_time_is_valid_time (start_tt) ||
+           !i_cal_time_is_valid_time (end_tt)) {
+               g_clear_object (&start_tt);
+               g_clear_object (&end_tt);
                return;
+       }
 
-       if (start_tt.is_date || end_tt.is_date) {
+       if (i_cal_time_is_date (start_tt) || i_cal_time_is_date (end_tt)) {
                /* All Day Events are simple. We just compare the dates and if
                 * start > end we copy one of them to the other. */
                gint cmp;
 
-               start_tt.is_date = TRUE;
-               end_tt.is_date = TRUE;
+               i_cal_time_set_is_date (start_tt, TRUE);
+               i_cal_time_set_is_date (end_tt, TRUE);
 
-               cmp = icaltime_compare_date_only (start_tt, end_tt);
+               cmp = i_cal_time_compare_date_only (start_tt, end_tt);
 
                if (cmp > 0) {
                        if (change_end_datetime) {
+                               g_clear_object (&end_tt);
                                end_tt = start_tt;
+                               start_tt = NULL;
                                set_dtend = TRUE;
                        } else {
+                               g_clear_object (&start_tt);
                                start_tt = end_tt;
+                               end_tt = NULL;
                                set_dtstart = TRUE;
                        }
                }
@@ -3312,41 +3344,47 @@ e_comp_editor_ensure_start_before_end (ECompEditor *comp_editor,
 
                e_comp_editor_set_updating (comp_editor, FALSE);
        }
+
+       g_clear_object (&start_tt);
+       g_clear_object (&end_tt);
 }
 
 static gboolean
 e_comp_editor_holds_component (ECompEditor *comp_editor,
                               ESource *origin_source,
-                              const icalcomponent *component)
+                              const ICalComponent *component)
 {
        const gchar *component_uid, *editor_uid;
        gboolean equal;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (component != NULL, FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
 
        if (!origin_source || !comp_editor->priv->origin_source ||
            !e_source_equal (origin_source, comp_editor->priv->origin_source))
                return FALSE;
 
-       component_uid = icalcomponent_get_uid ((icalcomponent *) component);
-       editor_uid = icalcomponent_get_uid (comp_editor->priv->component);
+       component_uid = i_cal_component_get_uid ((ICalComponent *) component);
+       editor_uid = i_cal_component_get_uid (comp_editor->priv->component);
 
        if (!component_uid || !editor_uid)
                return FALSE;
 
        equal = g_strcmp0 (component_uid, editor_uid) == 0;
        if (equal) {
-               struct icaltimetype component_rid, editor_rid;
+               ICalTime *component_rid, *editor_rid;
 
-               component_rid = icalcomponent_get_recurrenceid ((icalcomponent *) component);
-               editor_rid = icalcomponent_get_recurrenceid (comp_editor->priv->component);
+               component_rid = i_cal_component_get_recurrenceid ((ICalComponent *) component);
+               editor_rid = i_cal_component_get_recurrenceid (comp_editor->priv->component);
 
-               if (icaltime_is_null_time (component_rid)) {
-                       equal = icaltime_is_null_time (editor_rid);
-               } else if (!icaltime_is_null_time (editor_rid)) {
-                       equal = icaltime_compare (component_rid, editor_rid) == 0;
+               if (!component_rid || i_cal_time_is_null_time (component_rid)) {
+                       equal = !editor_rid || i_cal_time_is_null_time (editor_rid);
+               } else if (editor_rid && !i_cal_time_is_null_time (editor_rid)) {
+                       equal = i_cal_time_compare (component_rid, editor_rid) == 0;
                }
+
+               g_clear_object (&component_rid);
+               g_clear_object (&editor_rid);
        }
 
        return equal;
@@ -3356,7 +3394,7 @@ ECompEditor *
 e_comp_editor_open_for_component (GtkWindow *parent,
                                  EShell *shell,
                                  ESource *origin_source,
-                                 const icalcomponent *component,
+                                 const ICalComponent *component,
                                  guint32 flags /* bit-or of ECompEditorFlags */)
 {
        ECompEditor *comp_editor;
@@ -3365,7 +3403,7 @@ e_comp_editor_open_for_component (GtkWindow *parent,
        g_return_val_if_fail (E_IS_SHELL (shell), NULL);
        if (origin_source)
                g_return_val_if_fail (E_IS_SOURCE (origin_source), NULL);
-       g_return_val_if_fail (component != NULL, NULL);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL);
 
        comp_editor = e_comp_editor_find_existing_for (origin_source, component);
        if (comp_editor) {
@@ -3373,14 +3411,14 @@ e_comp_editor_open_for_component (GtkWindow *parent,
                return comp_editor;
        }
 
-       switch (icalcomponent_isa (component)) {
-               case ICAL_VEVENT_COMPONENT:
+       switch (i_cal_component_isa (component)) {
+               case I_CAL_VEVENT_COMPONENT:
                        comp_editor_type = E_TYPE_COMP_EDITOR_EVENT;
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        comp_editor_type = E_TYPE_COMP_EDITOR_TASK;
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        comp_editor_type = E_TYPE_COMP_EDITOR_MEMO;
                        break;
                default:
@@ -3404,14 +3442,14 @@ e_comp_editor_open_for_component (GtkWindow *parent,
 
 ECompEditor *
 e_comp_editor_find_existing_for (ESource *origin_source,
-                                const icalcomponent *component)
+                                const ICalComponent *component)
 {
        ECompEditor *comp_editor;
        GSList *link;
 
        if (origin_source)
                g_return_val_if_fail (E_IS_SOURCE (origin_source), NULL);
-       g_return_val_if_fail (component != NULL, NULL);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL);
 
        for (link = opened_editors; link; link = g_slist_next (link)) {
                comp_editor = link->data;
@@ -3429,21 +3467,21 @@ e_comp_editor_find_existing_for (ESource *origin_source,
 }
 
 /* Returned pointer is owned by libical or ECalClient; can return NULL */
-icaltimezone *
+ICalTimezone *
 e_comp_editor_lookup_timezone (ECompEditor *comp_editor,
                               const gchar *tzid)
 {
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), NULL);
 
        if (!tzid || !*tzid)
                return NULL;
 
-       zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+       zone = i_cal_timezone_get_builtin_timezone_from_tzid (tzid);
 
        if (!zone)
-               zone = icaltimezone_get_builtin_timezone (tzid);
+               zone = i_cal_timezone_get_builtin_timezone (tzid);
 
        if (!zone && comp_editor->priv->source_client) {
                if (!e_cal_client_get_timezone_sync (comp_editor->priv->source_client, tzid, &zone, NULL, 
NULL))
diff --git a/src/calendar/gui/e-comp-editor.h b/src/calendar/gui/e-comp-editor.h
index 76a06405a2..06939208ec 100644
--- a/src/calendar/gui/e-comp-editor.h
+++ b/src/calendar/gui/e-comp-editor.h
@@ -79,9 +79,9 @@ struct _ECompEditorClass {
        void            (* sensitize_widgets)   (ECompEditor *comp_editor,
                                                 gboolean force_insensitive);
        void            (* fill_widgets)        (ECompEditor *comp_editor,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
        gboolean        (* fill_component)      (ECompEditor *comp_editor,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 
        /* Signals */
        void            (* times_changed)       (ECompEditor *comp_editor);
@@ -93,9 +93,9 @@ struct _ECompEditorClass {
 GType          e_comp_editor_get_type          (void) G_GNUC_CONST;
 void           e_comp_editor_sensitize_widgets (ECompEditor *comp_editor);
 void           e_comp_editor_fill_widgets      (ECompEditor *comp_editor,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 gboolean       e_comp_editor_fill_component    (ECompEditor *comp_editor,
-                                                icalcomponent *component);
+                                                ICalComponent *component);
 void           e_comp_editor_set_validation_error
                                                (ECompEditor *comp_editor,
                                                 ECompEditorPage *error_page,
@@ -104,7 +104,7 @@ void                e_comp_editor_set_validation_error
 EShell *       e_comp_editor_get_shell         (ECompEditor *comp_editor);
 GSettings *    e_comp_editor_get_settings      (ECompEditor *comp_editor);
 ESource *      e_comp_editor_get_origin_source (ECompEditor *comp_editor);
-icalcomponent *        e_comp_editor_get_component     (ECompEditor *comp_editor);
+ICalComponent *        e_comp_editor_get_component     (ECompEditor *comp_editor);
 guint32                e_comp_editor_get_flags         (ECompEditor *comp_editor);
 void           e_comp_editor_set_flags         (ECompEditor *comp_editor,
                                                 guint32 flags);
@@ -176,11 +176,11 @@ ECompEditor *     e_comp_editor_open_for_component
                                                (GtkWindow *parent,
                                                 EShell *shell,
                                                 ESource *origin_source,
-                                                const icalcomponent *component,
+                                                const ICalComponent *component,
                                                 guint32 flags /* bit-or of ECompEditorFlags */);
 ECompEditor *  e_comp_editor_find_existing_for (ESource *origin_source,
-                                                const icalcomponent *component);
-icaltimezone * e_comp_editor_lookup_timezone   (ECompEditor *comp_editor,
+                                                const ICalComponent *component);
+ICalTimezone * e_comp_editor_lookup_timezone   (ECompEditor *comp_editor,
                                                 const gchar *tzid);
 
 G_END_DECLS
diff --git a/src/calendar/gui/e-date-time-list.c b/src/calendar/gui/e-date-time-list.c
index 681e0a2bcf..33adfddb47 100644
--- a/src/calendar/gui/e-date-time-list.c
+++ b/src/calendar/gui/e-date-time-list.c
@@ -45,7 +45,7 @@ struct _EDateTimeListPrivate {
        guint    columns_dirty : 1;
 
        gboolean use_24_hour_format;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 };
 
 enum {
@@ -63,28 +63,11 @@ G_DEFINE_TYPE_WITH_CODE (
        G_IMPLEMENT_INTERFACE (
                GTK_TYPE_TREE_MODEL, e_date_time_list_tree_model_init))
 
-static void
-free_datetime (struct icaltimetype *itt)
-{
-       g_free (itt);
-}
-
-static struct icaltimetype *
-copy_datetime (const struct icaltimetype itt)
-{
-       struct icaltimetype *itt_copy;
-
-       itt_copy = g_new0 (struct icaltimetype, 1);
-       *itt_copy = itt;
-
-       return itt_copy;
-}
-
 static gint
-compare_datetime (const struct icaltimetype *itt1,
-                  const struct icaltimetype *itt2)
+compare_datetime (const ICalTime *itt1,
+                  const ICalTime *itt2)
 {
-       return icaltime_compare (*itt1, *itt2);
+       return i_cal_time_compare ((ICalTime *) itt1, (ICalTime *) itt2);
 }
 
 static void
@@ -155,39 +138,30 @@ row_updated (EDateTimeList *date_time_list,
 /* Builds a static string out of an exception date */
 static gchar *
 get_exception_string (EDateTimeList *date_time_list,
-                      struct icaltimetype *itt)
+                     ICalTime *itt)
 {
        static gchar buf[256];
-       struct icaltimetype tt;
        struct tm tmp_tm;
-       icaltimezone *zone;
+       ICalTime *tt;
+       ICalTimezone *zone;
        gboolean use_24_hour_format;
 
        use_24_hour_format = e_date_time_list_get_use_24_hour_format (date_time_list);
        zone = e_date_time_list_get_timezone (date_time_list);
 
-       tt = *itt;
-
        if (zone)
-               tt = icaltime_convert_to_zone (tt, zone);
-
-       tmp_tm.tm_year = tt.year - 1900;
-       tmp_tm.tm_mon = tt.month - 1;
-       tmp_tm.tm_mday = tt.day;
-       tmp_tm.tm_hour = tt.hour;
-       tmp_tm.tm_min = tt.minute;
-       tmp_tm.tm_sec = tt.second;
-       tmp_tm.tm_isdst = -1;
+               tt = i_cal_time_convert_to_zone (itt, zone);
+       else
+               tt = g_object_ref (itt);
 
-       tmp_tm.tm_wday = time_day_of_week (
-               tt.day,
-               tt.month - 1,
-               tt.year);
+       tmp_tm = e_cal_util_icaltime_to_tm (tt);
 
        e_time_format_date_and_time (
                &tmp_tm, use_24_hour_format,
                FALSE, FALSE, buf, sizeof (buf));
 
+       g_clear_object (&tt);
+
        return buf;
 }
 
@@ -238,6 +212,22 @@ date_time_list_get_property (GObject *object,
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 }
 
+static void
+date_time_list_finalize (GObject *object)
+{
+       EDateTimeList *date_time_list = E_DATE_TIME_LIST (object);
+
+       g_clear_object (&date_time_list->priv->zone);
+
+       g_warn_if_fail (date_time_list->priv->list == NULL);
+
+       g_list_free_full (date_time_list->priv->list, g_object_unref);
+       date_time_list->priv->list = NULL;
+
+       /* Chain up to parent's method. */
+       G_OBJECT_CLASS (e_date_time_list_parent_class)->finalize (object);
+}
+
 static GtkTreeModelFlags
 date_time_list_get_flags (GtkTreeModel *tree_model)
 {
@@ -321,10 +311,10 @@ date_time_list_get_value (GtkTreeModel *tree_model,
                           gint column,
                           GValue *value)
 {
-       EDateTimeList        *date_time_list = E_DATE_TIME_LIST (tree_model);
-       struct icaltimetype  *itt;
-       GList                *l;
-       const gchar          *str;
+       EDateTimeList *date_time_list = E_DATE_TIME_LIST (tree_model);
+       ICalTime *itt;
+       GList *link;
+       const gchar *str;
 
        g_return_if_fail (E_IS_DATE_TIME_LIST (tree_model));
        g_return_if_fail (column < E_DATE_TIME_LIST_NUM_COLUMNS);
@@ -336,8 +326,8 @@ date_time_list_get_value (GtkTreeModel *tree_model,
        if (!date_time_list->priv->list)
                return;
 
-       l = iter->user_data;
-       itt = l->data;
+       link = iter->user_data;
+       itt = link->data;
 
        if (!itt)
                return;
@@ -463,6 +453,7 @@ e_date_time_list_class_init (EDateTimeListClass *class)
        object_class = G_OBJECT_CLASS (class);
        object_class->set_property = date_time_list_set_property;
        object_class->get_property = date_time_list_get_property;
+       object_class->finalize = date_time_list_finalize;
 
        g_object_class_install_property (
                object_class,
@@ -519,7 +510,7 @@ e_date_time_list_new (void)
        return g_object_new (E_TYPE_DATE_TIME_LIST, NULL);
 }
 
-struct icaltimetype *
+ICalTime *
 e_date_time_list_get_date_time (EDateTimeList *date_time_list,
                                 GtkTreeIter *iter)
 {
@@ -531,15 +522,15 @@ e_date_time_list_get_date_time (EDateTimeList *date_time_list,
 void
 e_date_time_list_set_date_time (EDateTimeList *date_time_list,
                                 GtkTreeIter *iter,
-                                const struct icaltimetype itt)
+                                const ICalTime *itt)
 {
-       struct icaltimetype *itt_old;
+       ICalTime *itt_old;
 
        g_return_if_fail (IS_VALID_ITER (date_time_list, iter));
 
        itt_old = G_LIST (iter->user_data)->data;
-       free_datetime (itt_old);
-       G_LIST (iter->user_data)->data = copy_datetime (itt);
+       g_clear_object (&itt_old);
+       G_LIST (iter->user_data)->data = i_cal_time_new_clone (itt);
        row_updated (date_time_list,
                g_list_position (date_time_list->priv->list, G_LIST (iter->user_data)));
 }
@@ -566,7 +557,7 @@ e_date_time_list_set_use_24_hour_format (EDateTimeList *date_time_list,
        g_object_notify (G_OBJECT (date_time_list), "use-24-hour-format");
 }
 
-icaltimezone *
+ICalTimezone *
 e_date_time_list_get_timezone (EDateTimeList *date_time_list)
 {
        g_return_val_if_fail (E_IS_DATE_TIME_LIST (date_time_list), NULL);
@@ -576,14 +567,16 @@ e_date_time_list_get_timezone (EDateTimeList *date_time_list)
 
 void
 e_date_time_list_set_timezone (EDateTimeList *date_time_list,
-                              icaltimezone *zone)
+                              const ICalTimezone *zone)
 {
        g_return_if_fail (E_IS_DATE_TIME_LIST (date_time_list));
 
        if (date_time_list->priv->zone == zone)
                return;
 
-       date_time_list->priv->zone = zone;
+       g_clear_object (&date_time_list->priv->zone);
+       if (zone)
+               date_time_list->priv->zone = g_object_ref ((ICalTimezone *) zone);
 
        g_object_notify (G_OBJECT (date_time_list), "timezone");
 }
@@ -591,12 +584,13 @@ e_date_time_list_set_timezone (EDateTimeList *date_time_list,
 void
 e_date_time_list_append (EDateTimeList *date_time_list,
                          GtkTreeIter *iter,
-                         const struct icaltimetype itt)
+                         const ICalTime *itt)
 {
-       g_return_if_fail (icaltime_is_valid_time (itt));
+       g_return_if_fail (itt != NULL);
+       g_return_if_fail (i_cal_time_is_valid_time ((ICalTime *) itt));
 
-       if (g_list_find_custom (date_time_list->priv->list, &itt, (GCompareFunc) compare_datetime) == NULL) {
-               date_time_list->priv->list = g_list_append (date_time_list->priv->list, copy_datetime (itt));
+       if (g_list_find_custom (date_time_list->priv->list, itt, (GCompareFunc) compare_datetime) == NULL) {
+               date_time_list->priv->list = g_list_append (date_time_list->priv->list, i_cal_time_new_clone 
(itt));
                row_added (date_time_list, g_list_length (date_time_list->priv->list) - 1);
        }
 
@@ -610,12 +604,14 @@ void
 e_date_time_list_remove (EDateTimeList *date_time_list,
                          GtkTreeIter *iter)
 {
+       ICalTime *itt;
        gint n;
 
        g_return_if_fail (IS_VALID_ITER (date_time_list, iter));
 
        n = g_list_position (date_time_list->priv->list, G_LIST (iter->user_data));
-       free_datetime (G_LIST (iter->user_data)->data);
+       itt = G_LIST (iter->user_data)->data;
+       g_clear_object (&itt);
        date_time_list->priv->list = g_list_delete_link (
                date_time_list->priv->list, G_LIST (iter->user_data));
        row_deleted (date_time_list, n);
@@ -624,14 +620,8 @@ e_date_time_list_remove (EDateTimeList *date_time_list,
 void
 e_date_time_list_clear (EDateTimeList *date_time_list)
 {
-       GList *l;
-
        all_rows_deleted (date_time_list);
 
-       for (l = date_time_list->priv->list; l; l = g_list_next (l)) {
-               free_datetime (l->data);
-       }
-
-       g_list_free (date_time_list->priv->list);
+       g_list_free_full (date_time_list->priv->list, g_object_unref);
        date_time_list->priv->list = NULL;
 }
diff --git a/src/calendar/gui/e-date-time-list.h b/src/calendar/gui/e-date-time-list.h
index d9178cdf9b..c9eea14ce5 100644
--- a/src/calendar/gui/e-date-time-list.h
+++ b/src/calendar/gui/e-date-time-list.h
@@ -70,24 +70,22 @@ struct _EDateTimeListClass {
 
 GType          e_date_time_list_get_type       (void);
 EDateTimeList *        e_date_time_list_new            (void);
-struct icaltimetype *
-               e_date_time_list_get_date_time
-                                               (EDateTimeList *date_time_list,
+ICalTime *     e_date_time_list_get_date_time  (EDateTimeList *date_time_list,
                                                 GtkTreeIter *iter);
 void           e_date_time_list_set_date_time  (EDateTimeList *date_time_list,
                                                 GtkTreeIter *iter,
-                                                const struct icaltimetype itt);
+                                                const ICalTime *itt);
 gboolean       e_date_time_list_get_use_24_hour_format
                                                (EDateTimeList *date_time_list);
 void           e_date_time_list_set_use_24_hour_format
                                                (EDateTimeList *date_time_list,
                                                 gboolean use_24_hour_format);
-icaltimezone * e_date_time_list_get_timezone   (EDateTimeList *date_time_list);
+ICalTimezone * e_date_time_list_get_timezone   (EDateTimeList *date_time_list);
 void           e_date_time_list_set_timezone   (EDateTimeList *date_time_list,
-                                                icaltimezone *zone);
+                                                const ICalTimezone *zone);
 void           e_date_time_list_append         (EDateTimeList *date_time_list,
                                                 GtkTreeIter *iter,
-                                                const struct icaltimetype itt);
+                                                const ICalTime *itt);
 void           e_date_time_list_remove         (EDateTimeList *date_time_list,
                                                 GtkTreeIter *iter);
 void           e_date_time_list_clear          (EDateTimeList *date_time_list);
diff --git a/src/calendar/gui/e-day-view-main-item.c b/src/calendar/gui/e-day-view-main-item.c
index 05f9f2e795..39e93634fe 100644
--- a/src/calendar/gui/e-day-view-main-item.c
+++ b/src/calendar/gui/e-day-view-main-item.c
@@ -72,18 +72,20 @@ can_draw_in_region (cairo_region_t *draw_region,
 }
 
 static gboolean
-icalcomp_is_transparent (icalcomponent *icalcomp)
+icomp_is_transparent (ICalComponent *icomp)
 {
-       icalproperty *transp_prop;
-       icalproperty_transp ical_transp = ICAL_TRANSP_NONE;
+       ICalProperty *transp_prop;
+       ICalPropertyTransp transp = I_CAL_TRANSP_NONE;
 
-       g_return_val_if_fail (icalcomp != NULL, TRUE);
+       g_return_val_if_fail (icomp != NULL, TRUE);
 
-       transp_prop = icalcomponent_get_first_property (icalcomp, ICAL_TRANSP_PROPERTY);
-       if (transp_prop)
-               ical_transp = icalproperty_get_transp (transp_prop);
+       transp_prop = i_cal_component_get_first_property (icomp, I_CAL_TRANSP_PROPERTY);
+       if (transp_prop) {
+               transp = i_cal_property_get_transp (transp_prop);
+               g_object_unref (transp_prop);
+       }
 
-       return transp_prop && (ical_transp == ICAL_TRANSP_TRANSPARENT || ical_transp == 
ICAL_TRANSP_TRANSPARENTNOCONFLICT);
+       return transp_prop && (transp == I_CAL_TRANSP_TRANSPARENT || transp == 
I_CAL_TRANSP_TRANSPARENTNOCONFLICT);
 }
 
 static void
@@ -114,7 +116,7 @@ day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *main_item,
                        continue;
 
                /* If the event is TRANSPARENT, skip it. */
-               if (icalcomp_is_transparent (event->comp_data->icalcomp)) {
+               if (icomp_is_transparent (event->comp_data->icalcomp)) {
                        continue;
                }
 
@@ -198,14 +200,12 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
        gdouble date_fraction;
        gboolean short_event = FALSE, resize_flag = FALSE, is_editing;
        const gchar *end_resize_suffix;
-       gchar *end_regsizeime;
        gint start_hour, start_display_hour, start_minute, start_suffix_width;
        gint end_hour, end_display_hour, end_minute, end_suffix_width;
        gboolean show_span = FALSE, format_time;
        gint offset, interval;
        const gchar *start_suffix;
        const gchar *end_suffix;
-       gchar *text = NULL;
        gint scroll_flag = 0;
        gint row_y;
        PangoLayout *layout;
@@ -547,6 +547,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
 
                else if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE) {
                        GdkRGBA fg_rgba;
+                       gchar *end_regsizeime;
 
                        bar_y2 = item_y + item_h - 1;
 
@@ -590,6 +591,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
                        pango_cairo_update_layout (cr, layout);
                        pango_cairo_show_layout (cr, layout);
                        g_object_unref (layout);
+                       g_free (end_regsizeime);
 
                        cairo_close_path (cr);
                        cairo_restore (cr);
@@ -599,11 +601,12 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
        else if (bar_y2 < scroll_flag)
                event->end_minute -= time_divisions;
 
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
 
        /* Only fill it in if the event isn't TRANSPARENT. */
-       e_cal_component_get_transparency (comp, &transparency);
+       transparency = e_cal_component_get_transparency (comp);
        if (transparency != E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
                cairo_save (cr);
                pat = cairo_pattern_create_linear (
@@ -745,6 +748,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
 
        if (!short_event) {
                GdkRGBA fg_rgba;
+               gchar *text;
 
                if (event->start_minute % time_divisions != 0
                        || (day_view->show_event_end_times
@@ -784,13 +788,13 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
                                        ("%2i:%02i-%2i:%02i",
                                         start_display_hour, start_minute,
                                         end_display_hour, end_minute);
-                       } else {
-                               if (format_time) {
+                       } else if (format_time) {
                                /* 24 hour format without end time. */
                                text = g_strdup_printf
                                        ("%2i:%02i",
                                         start_display_hour, start_minute);
-                               }
+                       } else {
+                               text = NULL;
                        }
                } else {
                        if (day_view->show_event_end_times && show_span) {
@@ -833,12 +837,12 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
                pango_cairo_update_layout (cr, layout);
                pango_cairo_show_layout (cr, layout);
                g_object_unref (layout);
+               g_free (text);
 
                cairo_close_path (cr);
                cairo_restore (cr);
        }
 
-       g_free (text);
        g_object_unref (comp);
 }
 
@@ -912,7 +916,7 @@ day_view_main_item_draw_events_in_vbars (EDayViewMainItem *main_item,
                }
 
                /* If the event is TRANSPARENT, skip it. */
-               if (icalcomp_is_transparent (event->comp_data->icalcomp)) {
+               if (icomp_is_transparent (event->comp_data->icalcomp)) {
                        continue;
                }
 
@@ -1019,7 +1023,7 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
        gint day_x, day_w;
        gint start_row, end_row, rect_x, rect_y, rect_width, rect_height;
        gint days_shown;
-       struct icaltimetype day_start_tt, today_tt;
+       ICalTime *day_start_tt, *today_tt;
        gboolean today = FALSE;
        cairo_region_t *draw_region;
        GdkRectangle rect;
@@ -1050,18 +1054,18 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
 
        /* Paint the background colors. */
 
-       today_tt = icaltime_from_timet_with_zone (
+       today_tt = i_cal_time_from_timet_with_zone (
                time (NULL), FALSE,
                e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 
        for (day = 0; day < days_shown; day++) {
                GDateWeekday weekday;
 
-               day_start_tt = icaltime_from_timet_with_zone (
+               day_start_tt = i_cal_time_from_timet_with_zone (
                        day_view->day_starts[day], FALSE,
                        e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 
-               switch (icaltime_day_of_week (day_start_tt)) {
+               switch (i_cal_time_day_of_week (day_start_tt)) {
                        case 1:
                                weekday = G_DATE_SUNDAY;
                                break;
@@ -1118,9 +1122,7 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
 
                        if (days_shown > 1) {
                                /* Check if we are drawing today */
-                               today = day_start_tt.year == today_tt.year
-                                       && day_start_tt.month == today_tt.month
-                                       && day_start_tt.day == today_tt.day;
+                               today = i_cal_time_compare_date_only (day_start_tt, today_tt) == 0;
                        } else {
                                today = FALSE;
                        }
@@ -1147,8 +1149,12 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
                        cairo_fill (cr);
                        cairo_restore (cr);
                }
+
+               g_clear_object (&day_start_tt);
        }
 
+       g_clear_object (&today_tt);
+
        /* Paint the selection background. */
        if (day_view->selection_start_day != -1
            && !day_view->selection_in_top_canvas) {
@@ -1257,8 +1263,8 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
                        width, height, day, draw_region);
 
        if (e_day_view_marcus_bains_get_show_line (day_view)) {
-               icaltimezone *zone;
-               struct icaltimetype time_now, day_start;
+               ICalTimezone *zone;
+               ICalTime *time_now, *day_start;
                const gchar *marcus_bains_day_view_color;
                gint marcus_bains_y;
                GdkColor mb_color;
@@ -1277,25 +1283,26 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
                        gdk_cairo_set_source_color (cr, &mb_color);
 
                zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
-               time_now = icaltime_current_time_with_zone (zone);
+               time_now = i_cal_time_current_time_with_zone (zone);
 
                for (day = 0; day < days_shown; day++) {
-                       day_start = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, zone);
-
-                       if ((day_start.year == time_now.year) &&
-                           (day_start.month == time_now.month) &&
-                           (day_start.day == time_now.day)) {
+                       day_start = i_cal_time_from_timet_with_zone (day_view->day_starts[day], FALSE, zone);
 
+                       if (i_cal_time_compare_date_only (day_start, time_now) == 0) {
                                grid_x1 = day_view->day_offsets[day] - x + E_DAY_VIEW_BAR_WIDTH;
                                grid_x2 = day_view->day_offsets[day + 1] - x - 1;
-                               marcus_bains_y = (time_now.hour * 60 + time_now.minute) * 
day_view->row_height / time_divisions - y;
+                               marcus_bains_y = (i_cal_time_get_hour (time_now) * 60 + i_cal_time_get_minute 
(time_now)) * day_view->row_height / time_divisions - y;
                                cairo_set_line_width (cr, 1.5);
                                cairo_move_to (cr, grid_x1, marcus_bains_y);
                                cairo_line_to (cr, grid_x2, marcus_bains_y);
                                cairo_stroke (cr);
                        }
+
+                       g_clear_object (&day_start);
                }
                cairo_restore (cr);
+
+               g_clear_object (&time_now);
        }
        cairo_region_destroy (draw_region);
 }
diff --git a/src/calendar/gui/e-day-view-time-item.c b/src/calendar/gui/e-day-view-time-item.c
index 91758968d8..849b0c1958 100644
--- a/src/calendar/gui/e-day-view-time-item.c
+++ b/src/calendar/gui/e-day-view-time-item.c
@@ -64,7 +64,7 @@ struct _EDayViewTimeItemPrivate {
        gboolean dragging_selection;
 
        /* The second timezone if shown, or else NULL. */
-       icaltimezone *second_zone;
+       ICalTimezone *second_zone;
 };
 
 static void    e_day_view_time_item_update     (GnomeCanvasItem *item,
@@ -229,7 +229,7 @@ e_day_view_time_item_init (EDayViewTimeItem *time_item)
        if (last) {
                if (*last)
                        time_item->priv->second_zone =
-                               icaltimezone_get_builtin_timezone (last);
+                               i_cal_timezone_get_builtin_timezone (last);
                g_free (last);
        }
 
@@ -258,13 +258,13 @@ e_day_view_time_item_update (GnomeCanvasItem *item,
  */
 static void
 edvti_draw_zone (GnomeCanvasItem *canvas_item,
-                 cairo_t *cr,
-                 gint x,
-                 gint y,
-                 gint width,
-                 gint height,
-                 gint x_offset,
-                 icaltimezone *use_zone)
+                cairo_t *cr,
+                gint x,
+                gint y,
+                gint width,
+                gint height,
+                gint x_offset,
+                ICalTimezone *use_zone)
 {
        EDayView *day_view;
        EDayViewTimeItem *time_item;
@@ -351,31 +351,35 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
        if (use_zone) {
                /* shift time with a difference between
                 * local time and the other timezone */
-               icaltimezone *cal_zone;
-               struct icaltimetype tt;
+               ICalTimezone *cal_zone;
+               ICalTime *tt;
                gint diff;
                struct tm mn;
 
                cal_zone = e_calendar_view_get_timezone (
                        E_CALENDAR_VIEW (day_view));
-               tt = icaltime_from_timet_with_zone (
+               tt = i_cal_time_from_timet_with_zone (
                        day_view->day_starts[0], 0, cal_zone);
 
                /* diff is number of minutes */
-               diff =(icaltimezone_get_utc_offset (use_zone, &tt, NULL) -
-                       icaltimezone_get_utc_offset (cal_zone, &tt, NULL)) / 60;
+               diff = (i_cal_timezone_get_utc_offset (use_zone, tt, NULL) -
+                       i_cal_timezone_get_utc_offset (cal_zone, tt, NULL)) / 60;
 
-               tt = icaltime_from_timet_with_zone (day_view->day_starts[0], 0, cal_zone);
-               tt.is_date = FALSE;
-               icaltime_set_timezone (&tt, cal_zone);
-               tt = icaltime_convert_to_zone (tt, use_zone);
+               g_clear_object (&tt);
+
+               tt = i_cal_time_from_timet_with_zone (day_view->day_starts[0], 0, cal_zone);
+               i_cal_time_set_is_date (tt, FALSE);
+               i_cal_time_set_timezone (tt, cal_zone);
+               i_cal_time_convert_to_zone_inplace (tt, use_zone);
 
                if (diff != 0) {
                        /* shows the next midnight */
-                       icaltime_adjust (&tt, 1, 0, 0, 0);
+                       i_cal_time_adjust (tt, 1, 0, 0, 0);
                }
 
-               mn = icaltimetype_to_tm (&tt);
+               mn = e_cal_util_icaltime_to_tm (tt);
+
+               g_clear_object (&tt);
 
                /* up to two characters/numbers */
                e_utf8_strftime (buffer, sizeof (buffer), "%d", &mn);
@@ -412,7 +416,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
 
        /* Draw the Marcus Bains Line first, so it appears under other elements. */
        if (e_day_view_marcus_bains_get_show_line (day_view)) {
-               struct icaltimetype time_now;
+               ICalTime *time_now;
                const gchar *marcus_bains_time_bar_color;
                gint marcus_bains_y;
 
@@ -431,11 +435,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
                        mb_color = day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE];
                }
 
-               time_now = icaltime_current_time_with_zone (
+               time_now = i_cal_time_current_time_with_zone (
                        e_calendar_view_get_timezone (
                        E_CALENDAR_VIEW (day_view)));
                marcus_bains_y =
-                       (time_now.hour * 60 + time_now.minute) *
+                       (i_cal_time_get_hour (time_now) * 60 + i_cal_time_get_minute (time_now)) *
                        day_view->row_height / time_divisions - y;
                cairo_set_line_width (cr, 1.5);
                cairo_move_to (
@@ -445,6 +449,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
                cairo_line_to (cr, long_line_x2, marcus_bains_y);
                cairo_stroke (cr);
                cairo_restore (cr);
+
+               g_clear_object (&time_now);
        } else {
                const gchar *marcus_bains_time_bar_color;
 
@@ -724,14 +730,14 @@ edvti_second_zone_changed_cb (GSettings *settings,
 {
        EDayViewTimeItem *time_item = user_data;
        EDayView *day_view;
-       icaltimezone *second_zone;
+       ICalTimezone *second_zone;
        gchar *location;
 
        g_return_if_fail (user_data != NULL);
        g_return_if_fail (E_IS_DAY_VIEW_TIME_ITEM (time_item));
 
        location = calendar_config_get_day_second_zone ();
-       second_zone = location ? icaltimezone_get_builtin_timezone (location) : NULL;
+       second_zone = location ? i_cal_timezone_get_builtin_timezone (location) : NULL;
        g_free (location);
 
        if (second_zone == time_item->priv->second_zone)
@@ -777,7 +783,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
        gchar buffer[256];
        GSList *group = NULL, *recent_zones, *s;
        gint current_divisions, i;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        day_view = e_day_view_time_item_get_day_view (time_item);
        g_return_if_fail (day_view != NULL);
@@ -833,7 +839,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
 
        zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
        if (zone)
-               item = gtk_menu_item_new_with_label (icaltimezone_get_display_name (zone));
+               item = gtk_menu_item_new_with_label (i_cal_timezone_get_display_name (zone));
        else
                item = gtk_menu_item_new_with_label ("---");
        gtk_widget_set_sensitive (item, FALSE);
@@ -854,12 +860,12 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
 
        recent_zones = calendar_config_get_day_second_zones ();
        for (s = recent_zones; s != NULL; s = s->next) {
-               zone = icaltimezone_get_builtin_timezone (s->data);
+               zone = i_cal_timezone_get_builtin_timezone (s->data);
                if (!zone)
                        continue;
 
                item = gtk_radio_menu_item_new_with_label (
-                       group, icaltimezone_get_display_name (zone));
+                       group, i_cal_timezone_get_display_name (zone));
                group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
                /* both comes from builtin, thus no problem to compare pointers */
                if (zone == time_item->priv->second_zone)
@@ -1128,7 +1134,7 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item)
        return time_item->priv->column_width;
 }
 
-icaltimezone *
+ICalTimezone *
 e_day_view_time_item_get_second_zone (EDayViewTimeItem *time_item)
 {
        g_return_val_if_fail (E_IS_DAY_VIEW_TIME_ITEM (time_item), NULL);
diff --git a/src/calendar/gui/e-day-view-time-item.h b/src/calendar/gui/e-day-view-time-item.h
index 880aa4c470..5a8e909340 100644
--- a/src/calendar/gui/e-day-view-time-item.h
+++ b/src/calendar/gui/e-day-view-time-item.h
@@ -72,7 +72,7 @@ void          e_day_view_time_item_set_day_view
                                                 EDayView *day_view);
 gint           e_day_view_time_item_get_column_width
                                                (EDayViewTimeItem *time_item);
-icaltimezone * e_day_view_time_item_get_second_zone
+ICalTimezone * e_day_view_time_item_get_second_zone
                                                (EDayViewTimeItem *time_item);
 
 G_END_DECLS
diff --git a/src/calendar/gui/e-day-view-top-item.c b/src/calendar/gui/e-day-view-top-item.c
index 0586681335..9e080166ec 100644
--- a/src/calendar/gui/e-day-view-top-item.c
+++ b/src/calendar/gui/e-day-view-top-item.c
@@ -178,9 +178,9 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item,
        if (!is_comp_data_valid (event))
                return;
 
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (
-               comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
 
        if (!e_cal_model_get_rgba_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), 
event->comp_data, &bg_rgba)) {
                bg_rgba.red = day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].red / 65535.0;
@@ -453,7 +453,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item,
        }
 
        /* draw categories icons */
-       e_cal_component_get_categories_list (comp, &categories_list);
+       categories_list = e_cal_component_get_categories_list (comp);
        for (elem = categories_list; elem; elem = elem->next) {
                gchar *category;
                gchar *file;
@@ -483,7 +483,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item,
                }
        }
 
-       e_cal_component_free_categories_list (categories_list);
+       g_slist_free_full (categories_list, g_free);
        g_object_unref (comp);
 }
 
@@ -831,25 +831,18 @@ e_day_view_top_item_get_day_label (EDayView *day_view,
                                    gint buffer_len)
 {
        ECalendarView *view;
-       struct icaltimetype day_start_tt;
-       const icaltimezone *zone;
-       struct tm day_start = { 0 };
+       ICalTime *day_start_tt;
+       ICalTimezone *zone;
+       struct tm day_start;
        const gchar *format;
 
        view = E_CALENDAR_VIEW (day_view);
        zone = e_calendar_view_get_timezone (view);
 
-       day_start_tt = icaltime_from_timet_with_zone (
+       day_start_tt = i_cal_time_from_timet_with_zone (
                day_view->day_starts[day], FALSE, zone);
-       day_start.tm_year = day_start_tt.year - 1900;
-       day_start.tm_mon = day_start_tt.month - 1;
-       day_start.tm_mday = day_start_tt.day;
-       day_start.tm_isdst = -1;
-
-       day_start.tm_wday = time_day_of_week (
-               day_start_tt.day,
-               day_start_tt.month - 1,
-               day_start_tt.year);
+       day_start = e_cal_util_icaltime_to_tm (day_start_tt);
+       g_clear_object (&day_start_tt);
 
        if (day_view->date_format == E_DAY_VIEW_DATE_FULL)
                /* strftime format %A = full weekday name, %d = day of month,
diff --git a/src/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
index aaedadd79c..dd24033191 100644
--- a/src/calendar/gui/e-day-view.c
+++ b/src/calendar/gui/e-day-view.c
@@ -575,12 +575,12 @@ e_day_view_get_work_day_range_for_day (EDayView *day_view,
 
        if (day >= 0 && day < e_day_view_get_days_shown (day_view)) {
                GDateWeekday weekday;
-               struct icaltimetype tt;
+               ICalTime *tt;
 
-               tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE,
+               tt = i_cal_time_from_timet_with_zone (day_view->day_starts[day], FALSE,
                        e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 
-               switch (icaltime_day_of_week (tt)) {
+               switch (i_cal_time_day_of_week (tt)) {
                        case 1:
                                weekday = G_DATE_SUNDAY;
                                break;
@@ -607,6 +607,8 @@ e_day_view_get_work_day_range_for_day (EDayView *day_view,
                                break;
                }
 
+               g_clear_object (&tt);
+
                e_cal_model_get_work_day_range_for (model, weekday,
                        start_hour, start_minute,
                        end_hour, end_minute);
@@ -750,18 +752,18 @@ new_event_in_rage_data_free (gpointer ptr)
 static void
 day_view_new_event_in_selected_range_cb (ECalModel *model,
                                         ECalClient *client,
-                                        icalcomponent *default_component,
+                                        ICalComponent *default_component,
                                         gpointer user_data)
 {
        NewEventInRangeData *ned = user_data;
        ECalComponent *comp = NULL;
        gint day, event_num;
-       ECalComponentDateTime start_dt, end_dt;
-       struct icaltimetype start_tt, end_tt;
-       const gchar *uid;
+       ECalComponentDateTime *start_dt, *end_dt;
+       ICalTime *start_tt, *end_tt;
+       const gchar *uid, *use_tzid;
        AddEventData add_event_data;
        ESourceRegistry *registry;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        g_return_if_fail (ned != NULL);
        g_return_if_fail (E_IS_CAL_MODEL (model));
@@ -774,33 +776,36 @@ day_view_new_event_in_selected_range_cb (ECalModel *model,
 
        registry = e_cal_model_get_registry (model);
        zone = e_cal_model_get_timezone (model);
-       uid = icalcomponent_get_uid (default_component);
+       uid = i_cal_component_get_uid (default_component);
 
-       comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (default_component));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (default_component));
        g_return_if_fail (comp != NULL);
 
-       start_tt = icaltime_from_timet_with_zone (ned->dtstart, FALSE, zone);
-       end_tt = icaltime_from_timet_with_zone (ned->dtend, FALSE, zone);
+       start_tt = i_cal_time_from_timet_with_zone (ned->dtstart, FALSE, zone);
+       end_tt = i_cal_time_from_timet_with_zone (ned->dtend, FALSE, zone);
 
        if (ned->in_top_canvas) {
-               start_dt.tzid = NULL;
-               start_tt.is_date = 1;
-               end_tt.is_date = 1;
+               use_tzid = NULL;
+               i_cal_time_set_is_date (start_tt, 1);
+               i_cal_time_set_is_date (end_tt, 1);
 
                /* Editor default in day/work-week view - top canvas */
                e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
        } else {
-               start_dt.tzid = icaltimezone_get_tzid (zone);
+               use_tzid = i_cal_timezone_get_tzid (zone);
 
                /* Editor default in day/work-week view - main canvas */
                e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
        }
 
-       start_dt.value = &start_tt;
-       end_dt.value = &end_tt;
-       end_dt.tzid = start_dt.tzid;
-       e_cal_component_set_dtstart (comp, &start_dt);
-       e_cal_component_set_dtend (comp, &end_dt);
+       start_dt = e_cal_component_datetime_new_take (start_tt, g_strdup (use_tzid));
+       end_dt = e_cal_component_datetime_new_take (end_tt, g_strdup (use_tzid));
+
+       e_cal_component_set_dtstart (comp, start_dt);
+       e_cal_component_set_dtend (comp, end_dt);
+
+       e_cal_component_datetime_free (start_dt);
+       e_cal_component_datetime_free (end_dt);
 
        /* We add the event locally and start editing it. We don't send it
         * to the server until the user finishes editing it. */
@@ -2534,7 +2539,7 @@ e_day_view_precalc_visible_time_range (ECalendarView *cal_view,
        EDayView *day_view;
        gint days_shown;
        time_t lower;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        g_return_if_fail (E_IS_DAY_VIEW (cal_view));
        g_return_if_fail (out_start_time != NULL);
@@ -2622,8 +2627,6 @@ static void
 process_component (EDayView *day_view,
                    ECalModelComponent *comp_data)
 {
-       const gchar *uid;
-       gchar *rid = NULL;
        ECalModel *model;
        ECalComponent *comp;
        ESourceRegistry *registry;
@@ -2636,21 +2639,12 @@ process_component (EDayView *day_view,
        if (day_view->lower == 0 && day_view->upper == 0)
                return;
 
-       comp = e_cal_component_new ();
-       if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp))) {
-               g_object_unref (comp);
-
-               g_message (G_STRLOC ": Could not set icalcomponent on ECalComponent");
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (comp_data->icalcomp));
+       if (!comp) {
+               g_message (G_STRLOC ": Could not set ICalComponent on ECalComponent");
                return;
        }
 
-       e_cal_component_get_uid (comp, &uid);
-       if (e_cal_component_is_instance (comp))
-               rid = e_cal_component_get_recurid_as_string (comp);
-       else
-               rid = NULL;
-       /* rid is never used below here, why? */
-
        /* Add the object */
        add_event_data.day_view = day_view;
        add_event_data.comp_data = comp_data;
@@ -2659,7 +2653,6 @@ process_component (EDayView *day_view,
                comp_data->instance_end, &add_event_data);
 
        g_object_unref (comp);
-       g_free (rid);
 }
 
 static void
@@ -2670,8 +2663,8 @@ update_row (EDayView *day_view,
        ECalModelComponent *comp_data;
        ECalModel *model;
        gint day, event_num;
-       const gchar *uid = NULL;
-       gchar *rid = NULL;
+       const gchar *uid;
+       gchar *rid;
 
        if (do_cancel_editing)
                cancel_editing (day_view);
@@ -2682,14 +2675,8 @@ update_row (EDayView *day_view,
        comp_data = e_cal_model_get_component_at (model, row);
        g_return_if_fail (comp_data != NULL);
 
-       uid = icalcomponent_get_uid (comp_data->icalcomp);
-       if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
-               icalproperty *prop;
-
-               prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_RECURRENCEID_PROPERTY);
-               if (prop)
-                       rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid 
(comp_data->icalcomp));
-       }
+       uid = i_cal_component_get_uid (comp_data->icalcomp);
+       rid = e_cal_util_component_get_recurid_as_string (comp_data->icalcomp);
 
        if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num))
                e_day_view_remove_event_cb (day_view, day, event_num, NULL);
@@ -2791,17 +2778,11 @@ model_comps_deleted_cb (ETableModel *etm,
        for (l = list; l != NULL; l = g_slist_next (l)) {
                ECalModelComponent *comp_data = l->data;
                gint day, event_num;
-               const gchar *uid = NULL;
-               gchar *rid = NULL;
-
-               uid = icalcomponent_get_uid (comp_data->icalcomp);
-               if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
-                       icalproperty *prop;
+               const gchar *uid;
+               gchar *rid;
 
-                       prop = icalcomponent_get_first_property (comp_data->icalcomp, 
ICAL_RECURRENCEID_PROPERTY);
-                       if (prop)
-                               rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid 
(comp_data->icalcomp));
-               }
+               uid = i_cal_component_get_uid (comp_data->icalcomp);
+               rid = e_cal_util_component_get_recurid_as_string (comp_data->icalcomp);
 
                if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num))
                        e_day_view_remove_event_cb (day_view, day, event_num, NULL);
@@ -2816,11 +2797,11 @@ model_comps_deleted_cb (ETableModel *etm,
 
 static void
 timezone_changed_cb (ECalModel *cal_model,
-                     icaltimezone *old_zone,
-                     icaltimezone *new_zone,
-                     gpointer user_data)
+                    ICalTimezone *old_zone,
+                    ICalTimezone *new_zone,
+                    gpointer user_data)
 {
-       struct icaltimetype tt;
+       ICalTime *tt;
        time_t lower;
        EDayView *day_view = (EDayView *) user_data;
        ECalendarView *cal_view = (ECalendarView *) day_view;
@@ -2839,11 +2820,13 @@ timezone_changed_cb (ECalModel *cal_model,
 
        /* Recalculate the new start of the first day. We just use exactly
         * the same time, but with the new timezone. */
-       tt = icaltime_from_timet_with_zone (
+       tt = i_cal_time_from_timet_with_zone (
                day_view->lower, FALSE,
                old_zone);
 
-       lower = icaltime_as_timet_with_zone (tt, new_zone);
+       lower = i_cal_time_as_timet_with_zone (tt, new_zone);
+
+       g_clear_object (&tt);
 
        e_day_view_recalc_day_starts (day_view, lower);
        e_day_view_update_query (day_view);
@@ -3167,7 +3150,7 @@ e_day_view_foreach_event_with_uid (EDayView *day_view,
                        if (!is_comp_data_valid (event))
                                continue;
 
-                       u = icalcomponent_get_uid (event->comp_data->icalcomp);
+                       u = i_cal_component_get_uid (event->comp_data->icalcomp);
                        if (u && !strcmp (uid, u)) {
                                if (!(*callback) (day_view, day, event_num, data))
                                        return;
@@ -3184,7 +3167,7 @@ e_day_view_foreach_event_with_uid (EDayView *day_view,
                if (!is_comp_data_valid (event))
                        continue;
 
-               u = icalcomponent_get_uid (event->comp_data->icalcomp);
+               u = i_cal_component_get_uid (event->comp_data->icalcomp);
                if (u && !strcmp (uid, u)) {
                        if (!(*callback) (day_view, E_DAY_VIEW_LONG_EVENT, event_num, data))
                                return;
@@ -3308,42 +3291,52 @@ set_style_from_attendee (EDayViewEvent *event,
        ECalComponent *comp;
        GSList *attendees = NULL, *l;
        gchar *address;
-       ECalComponentAttendee *at = NULL;
+       ICalParameterPartstat partstat = I_CAL_PARTSTAT_NONE;
 
        if (!is_comp_data_valid (event))
                return;
 
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-       address = itip_get_comp_attendee (
-               registry, comp, event->comp_data->client);
-       e_cal_component_get_attendee_list (comp, &attendees);
-       for (l = attendees; l; l = l->next) {
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
+
+       address = itip_get_comp_attendee (registry, comp, event->comp_data->client);
+       attendees = e_cal_component_get_attendees (comp);
+       for (l = attendees; l && address; l = l->next) {
                ECalComponentAttendee *attendee = l->data;
+               const gchar *value, *sentby;
+
+               value = e_cal_component_attendee_get_value (attendee);
+               if (value)
+                       value = itip_strip_mailto (value);
+
+               sentby = e_cal_component_attendee_get_sentby (attendee);
+               if (sentby)
+                       value = itip_strip_mailto (sentby);
 
-               if ((attendee->value && g_strcmp0 (itip_strip_mailto (attendee->value), address) == 0)
-                || (attendee->sentby && g_strcmp0 (itip_strip_mailto (attendee->sentby), address) == 0)) {
-                       at = attendee;
+               if ((value && g_ascii_strcasecmp (value, address) == 0) ||
+                   (sentby && g_ascii_strcasecmp (sentby, address) == 0)) {
+                       partstat = e_cal_component_attendee_get_partstat (attendee);
                        break;
                }
        }
 
-       if (icalcomponent_get_status (event->comp_data->icalcomp) == ICAL_STATUS_CANCELLED)
+       if (i_cal_component_get_status (event->comp_data->icalcomp) == I_CAL_STATUS_CANCELLED)
                gnome_canvas_item_set (event->canvas_item, "strikeout", TRUE, NULL);
 
        /* The attendee has not yet accepted the meeting, display the summary as bolded.
         * If the attendee is not present, it might have come through a mailing list.
         * In that case, we never show the meeting as bold even if it is unaccepted. */
-       if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION))
+       if (partstat == I_CAL_PARTSTAT_NEEDSACTION)
                gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL);
-       else if (at && at->status == ICAL_PARTSTAT_DECLINED)
+       else if (partstat == I_CAL_PARTSTAT_DECLINED)
                gnome_canvas_item_set (event->canvas_item, "strikeout", TRUE, NULL);
-       else if (at && at->status == ICAL_PARTSTAT_TENTATIVE)
+       else if (partstat == I_CAL_PARTSTAT_TENTATIVE)
                gnome_canvas_item_set (event->canvas_item, "italic", TRUE, NULL);
-       else if (at && at->status == ICAL_PARTSTAT_DELEGATED)
+       else if (partstat == I_CAL_PARTSTAT_DELEGATED)
                gnome_canvas_item_set (event->canvas_item, "italic", TRUE, "strikeout", TRUE, NULL);
 
-       e_cal_component_free_attendee_list (attendees);
+       g_slist_free_full (attendees, e_cal_component_attendee_free);
        g_free (address);
        g_object_unref (comp);
 }
@@ -3374,7 +3367,7 @@ e_day_view_update_event_label (EDayView *day_view,
        if (!event->canvas_item || !is_comp_data_valid (event))
                return;
 
-       summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+       summary = i_cal_component_get_summary (event->comp_data->icalcomp);
        text = summary ? (gchar *) summary : (gchar *) "";
 
        if (day_view->editing_event_day == day
@@ -3405,8 +3398,8 @@ e_day_view_update_event_label (EDayView *day_view,
                        gint days_shown;
 
                        days_shown = e_day_view_get_days_shown (day_view);
-                       description = icalcomponent_get_description (event->comp_data->icalcomp);
-                       location = icalcomponent_get_location (event->comp_data->icalcomp);
+                       description = i_cal_component_get_description (event->comp_data->icalcomp);
+                       location = i_cal_component_get_location (event->comp_data->icalcomp);
 
                        if (description && *description) {
                                if (location && *location)
@@ -3429,7 +3422,7 @@ e_day_view_update_event_label (EDayView *day_view,
 
        if (e_cal_util_component_has_attendee (event->comp_data->icalcomp))
                set_style_from_attendee (event, registry);
-       else if (icalcomponent_get_status (event->comp_data->icalcomp) == ICAL_STATUS_CANCELLED)
+       else if (i_cal_component_get_status (event->comp_data->icalcomp) == I_CAL_STATUS_CANCELLED)
                gnome_canvas_item_set (event->canvas_item, "strikeout", TRUE, NULL);
 
        if (free_text)
@@ -3444,8 +3437,7 @@ e_day_view_update_long_event_label (EDayView *day_view,
        ECalendarView *cal_view;
        ECalModel *model;
        ESourceRegistry *registry;
-       const gchar *summary;
-       gboolean free_text = FALSE;
+       gchar *summary;
 
        cal_view = E_CALENDAR_VIEW (day_view);
        model = e_calendar_view_get_model (cal_view);
@@ -3462,19 +3454,18 @@ e_day_view_update_long_event_label (EDayView *day_view,
        if (!event->canvas_item || !is_comp_data_valid (event))
                return;
 
-       summary = e_calendar_view_get_icalcomponent_summary (event->comp_data->client, 
event->comp_data->icalcomp, &free_text);
+       summary = e_calendar_view_dup_component_summary (event->comp_data->icalcomp);
 
        gnome_canvas_item_set (
                event->canvas_item,
                "text", summary ? summary : "",
                NULL);
 
-       if (free_text)
-               g_free ((gchar *) summary);
+       g_free (summary);
 
        if (e_cal_util_component_has_attendee (event->comp_data->icalcomp))
                set_style_from_attendee (event, registry);
-       else if (icalcomponent_get_status (event->comp_data->icalcomp) == ICAL_STATUS_CANCELLED)
+       else if (i_cal_component_get_status (event->comp_data->icalcomp) == I_CAL_STATUS_CANCELLED)
                gnome_canvas_item_set (event->canvas_item, "strikeout", TRUE, NULL);
 }
 
@@ -3558,16 +3549,16 @@ e_day_view_find_event_from_uid (EDayView *day_view,
                        if (event->comp_data->client != client)
                                continue;
 
-                       u = icalcomponent_get_uid (event->comp_data->icalcomp);
+                       u = i_cal_component_get_uid (event->comp_data->icalcomp);
                        if (u && !strcmp (uid, u)) {
                                if (rid && *rid) {
-                                       r = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid 
(event->comp_data->icalcomp));
-                                       if (!r || !*r)
-                                               continue;
-                                       if (strcmp (rid, r) != 0) {
+                                       r = e_cal_util_component_get_recurid_as_string 
(event->comp_data->icalcomp);
+
+                                       if (!r || !*r || strcmp (rid, r) != 0) {
                                                g_free (r);
                                                continue;
                                        }
+
                                        g_free (r);
                                }
 
@@ -3589,7 +3580,7 @@ e_day_view_find_event_from_uid (EDayView *day_view,
                if (event->comp_data->client != client)
                        continue;
 
-               u = icalcomponent_get_uid (event->comp_data->icalcomp);
+               u = i_cal_component_get_uid (event->comp_data->icalcomp);
                if (u && !strcmp (uid, u)) {
                        *day_return = E_DAY_VIEW_LONG_EVENT;
                        *event_num_return = event_num;
@@ -3726,8 +3717,9 @@ e_day_view_find_work_week_start (EDayView *day_view,
        guint offset;
        GDateWeekday weekday;
        GDateWeekday first_work_day;
-       struct icaltimetype tt = icaltime_null_time ();
-       icaltimezone *zone;
+       ICalTime *tt = NULL;
+       ICalTimezone *zone;
+       time_t res;
 
        model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
        zone = e_cal_model_get_timezone (model);
@@ -3754,11 +3746,18 @@ e_day_view_find_work_week_start (EDayView *day_view,
        if (offset > 0)
                g_date_subtract_days (&date, offset);
 
-       tt.year = g_date_get_year (&date);
-       tt.month = g_date_get_month (&date);
-       tt.day = g_date_get_day (&date);
+       tt = i_cal_time_null_time ();
+
+       i_cal_time_set_date (tt,
+               g_date_get_year (&date),
+               g_date_get_month (&date),
+               g_date_get_day (&date));
 
-       return icaltime_as_timet_with_zone (tt, zone);
+       res = i_cal_time_as_timet_with_zone (tt, zone);
+
+       g_clear_object (&tt);
+
+       return res;
 }
 
 static void
@@ -3768,7 +3767,7 @@ e_day_view_recalc_day_starts (EDayView *day_view,
        gint day;
        gchar *str;
        gint days_shown;
-       struct icaltimetype tt;
+       ICalTime *tt;
        GDate dt;
 
        days_shown = e_day_view_get_days_shown (day_view);
@@ -3783,15 +3782,17 @@ e_day_view_recalc_day_starts (EDayView *day_view,
        day_view->lower = start_time;
        day_view->upper = day_view->day_starts[days_shown];
 
-       tt = icaltime_from_timet_with_zone (day_view->day_starts[0], FALSE, e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
+       tt = i_cal_time_from_timet_with_zone (day_view->day_starts[0], FALSE, e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
        g_date_clear (&dt, 1);
-       g_date_set_dmy (&dt, tt.day, tt.month, tt.year);
+       g_date_set_dmy (&dt, i_cal_time_get_day (tt), i_cal_time_get_month (tt), i_cal_time_get_year (tt));
        /* To Translators: the %d stands for a week number, it's value between 1 and 52/53 */
        str = g_strdup_printf (_("Week %d"), g_date_get_iso8601_week_of_year (&dt));
        gtk_label_set_text (GTK_LABEL (day_view->week_number_label), str);
        g_free (str);
 
        e_day_view_recalc_work_week (day_view);
+
+       g_clear_object (&tt);
 }
 
 /* Whether we are displaying a work-week, in which case the display always
@@ -5408,13 +5409,13 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
        EDayViewEvent *event;
        gint event_num;
        ECalComponent *comp;
-       ECalComponentDateTime date;
-       struct icaltimetype itt;
+       ECalComponentDateTime *date = NULL;
        time_t dt;
        ECalModel *model;
        ECalClient *client;
        ESourceRegistry *registry;
        ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
+       ICalTimezone *zone;
        gint is_date;
 
        model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
@@ -5436,8 +5437,9 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
        /* We use a temporary copy of the comp since we don't want to
         * change the original comp here. Otherwise we would not detect that
         * the event's time had changed in the "update_event" callback. */
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
 
        if (e_cal_component_has_attendees (comp) &&
            !itip_organizer_is_user (registry, comp, client)) {
@@ -5446,35 +5448,42 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
                return;
        }
 
-       date.value = &itt;
-       date.tzid = NULL;
+       zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
 
        if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) {
-               ECalComponentDateTime ecdt;
+               ECalComponentDateTime *ecdt;
+
+               ecdt = e_cal_component_get_dtstart (comp);
+               is_date = ecdt && e_cal_component_datetime_get_value (ecdt) &&
+                         i_cal_time_is_date (e_cal_component_datetime_get_value (ecdt));
 
-               e_cal_component_get_dtstart (comp, &ecdt);
-               is_date = ecdt.value && ecdt.value->is_date;
-               if (!is_date)
-                       date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
                dt = day_view->day_starts[day_view->resize_start_row];
-               *date.value = icaltime_from_timet_with_zone (dt, is_date,
-                                                            e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-               cal_comp_set_dtstart_with_oldzone (client, comp, &date);
-               e_cal_component_free_datetime (&ecdt);
-               date.tzid = NULL; /* do not reuse it later */
+               date = e_cal_component_datetime_new_take (
+                       i_cal_time_from_timet_with_zone (dt, is_date, zone),
+                       (zone && !is_date) ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+               cal_comp_set_dtstart_with_oldzone (client, comp, date);
+
+               e_cal_component_datetime_free (ecdt);
+
+               /* do not reuse it later */
+               e_cal_component_datetime_set_tzid (date, NULL);
        } else {
-               ECalComponentDateTime ecdt;
+               ECalComponentDateTime *ecdt;
+
+               ecdt = e_cal_component_get_dtend (comp);
+               is_date = ecdt && e_cal_component_datetime_get_value (ecdt) &&
+                         i_cal_time_is_date (e_cal_component_datetime_get_value (ecdt));
 
-               e_cal_component_get_dtend (comp, &ecdt);
-               is_date = ecdt.value && ecdt.value->is_date;
-               if (!is_date)
-                       date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
                dt = day_view->day_starts[day_view->resize_end_row + 1];
-               *date.value = icaltime_from_timet_with_zone (dt, is_date,
-                                                            e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-               cal_comp_set_dtend_with_oldzone (client, comp, &date);
-               e_cal_component_free_datetime (&ecdt);
-               date.tzid = NULL; /* do not reuse it later */
+               date = e_cal_component_datetime_new_take (
+                       i_cal_time_from_timet_with_zone (dt, is_date, zone),
+                       (zone && !is_date) ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+               cal_comp_set_dtend_with_oldzone (client, comp, date);
+
+               e_cal_component_datetime_free (ecdt);
+
+               /* do not reuse it later */
+               e_cal_component_datetime_set_tzid (date, NULL);
        }
 
        e_cal_component_commit_sequence (comp);
@@ -5487,24 +5496,23 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
                if (mod == E_CAL_OBJ_MOD_THIS) {
                        /* set the correct DTSTART/DTEND on the individual recurrence */
                        if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
-                               *date.value = icaltime_from_timet_with_zone (
-                                       event->comp_data->instance_end, FALSE,
-                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-                               cal_comp_set_dtend_with_oldzone (client, comp, &date);
+                               e_cal_component_datetime_take_value (date,
+                                       i_cal_time_from_timet_with_zone (event->comp_data->instance_end, 
FALSE, zone));
+                               cal_comp_set_dtend_with_oldzone (client, comp, date);
                        } else {
-                               *date.value = icaltime_from_timet_with_zone (
-                                       event->comp_data->instance_start, FALSE,
-                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-                               cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+                               e_cal_component_datetime_take_value (date,
+                                       i_cal_time_from_timet_with_zone (event->comp_data->instance_start, 
FALSE, zone));
+                               cal_comp_set_dtstart_with_oldzone (client, comp, date);
                        }
 
-                       e_cal_component_set_rdate_list (comp, NULL);
-                       e_cal_component_set_rrule_list (comp, NULL);
-                       e_cal_component_set_exdate_list (comp, NULL);
-                       e_cal_component_set_exrule_list (comp, NULL);
+                       e_cal_component_set_rdates (comp, NULL);
+                       e_cal_component_set_rrules (comp, NULL);
+                       e_cal_component_set_exdates (comp, NULL);
+                       e_cal_component_set_exrules (comp, NULL);
                }
-       } else if (e_cal_component_is_instance (comp))
+       } else if (e_cal_component_is_instance (comp)) {
                mod = E_CAL_OBJ_MOD_THIS;
+       }
 
        e_cal_component_commit_sequence (comp);
 
@@ -5514,6 +5522,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
  out:
        day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE;
 
+       e_cal_component_datetime_free (date);
        g_object_unref (comp);
 }
 
@@ -5525,8 +5534,8 @@ e_day_view_finish_resize (EDayView *day_view)
        EDayViewEvent *event;
        gint day, event_num;
        ECalComponent *comp;
-       ECalComponentDateTime date;
-       struct icaltimetype itt;
+       ECalComponentDateTime *date = NULL;
+       ICalTimezone *zone;
        time_t dt;
        ECalModel *model;
        ECalClient *client;
@@ -5560,8 +5569,9 @@ e_day_view_finish_resize (EDayView *day_view)
        /* We use a temporary shallow copy of the ico since we don't want to
         * change the original ico here. Otherwise we would not detect that
         * the event's time had changed in the "update_event" callback. */
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
 
        if (e_cal_component_has_attendees (comp) &&
            !itip_organizer_is_user (registry, comp, client)) {
@@ -5583,19 +5593,20 @@ e_day_view_finish_resize (EDayView *day_view)
                goto out;
        }
 
-       date.value = &itt;
-       date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+       zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
 
        if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
                dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row);
-               *date.value = icaltime_from_timet_with_zone (dt, FALSE,
-                                                            e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-               cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+               date = e_cal_component_datetime_new_take (
+                       i_cal_time_from_timet_with_zone (dt, FALSE, zone),
+                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+               cal_comp_set_dtstart_with_oldzone (client, comp, date);
        } else {
                dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_end_row + 1);
-               *date.value = icaltime_from_timet_with_zone (dt, FALSE,
-                                                            e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-               cal_comp_set_dtend_with_oldzone (client, comp, &date);
+               date = e_cal_component_datetime_new_take (
+                       i_cal_time_from_timet_with_zone (dt, FALSE, zone),
+                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+               cal_comp_set_dtend_with_oldzone (client, comp, date);
        }
 
        e_cal_component_commit_sequence (comp);
@@ -5622,24 +5633,23 @@ e_day_view_finish_resize (EDayView *day_view)
                if (mod == E_CAL_OBJ_MOD_THIS) {
                        /* set the correct DTSTART/DTEND on the individual recurrence */
                        if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
-                               *date.value = icaltime_from_timet_with_zone (
-                                       event->comp_data->instance_end, FALSE,
-                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-                               cal_comp_set_dtend_with_oldzone (client, comp, &date);
+                               e_cal_component_datetime_take_value (date,
+                                       i_cal_time_from_timet_with_zone (event->comp_data->instance_end, 
FALSE, zone));
+                               cal_comp_set_dtend_with_oldzone (client, comp, date);
                        } else {
-                               *date.value = icaltime_from_timet_with_zone (
-                                       event->comp_data->instance_start, FALSE,
-                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-                               cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+                               e_cal_component_datetime_take_value (date,
+                                       i_cal_time_from_timet_with_zone (event->comp_data->instance_start, 
FALSE, zone));
+                               cal_comp_set_dtstart_with_oldzone (client, comp, date);
                        }
 
-                       e_cal_component_set_rdate_list (comp, NULL);
-                       e_cal_component_set_rrule_list (comp, NULL);
-                       e_cal_component_set_exdate_list (comp, NULL);
-                       e_cal_component_set_exrule_list (comp, NULL);
+                       e_cal_component_set_rdates (comp, NULL);
+                       e_cal_component_set_rrules (comp, NULL);
+                       e_cal_component_set_exdates (comp, NULL);
+                       e_cal_component_set_exrules (comp, NULL);
                }
-       } else if (e_cal_component_is_instance (comp))
+       } else if (e_cal_component_is_instance (comp)) {
                mod = E_CAL_OBJ_MOD_THIS;
+       }
 
        e_cal_component_commit_sequence (comp);
 
@@ -5650,6 +5660,7 @@ e_day_view_finish_resize (EDayView *day_view)
 
  out:
        g_object_unref (comp);
+       g_clear_object (&date);
 }
 
 static void
@@ -5748,9 +5759,9 @@ e_day_view_add_event (ESourceRegistry *registry,
        EDayViewEvent event;
        gint day, offset;
        gint days_shown;
-       struct icaltimetype start_tt, end_tt;
+       ICalTime *start_tt, *end_tt;
+       ICalTimezone *zone;
        AddEventData *add_event_data;
-       icaltimezone *zone;
 
        add_event_data = data;
 
@@ -5770,8 +5781,8 @@ e_day_view_add_event (ESourceRegistry *registry,
                g_return_if_fail (end > add_event_data->day_view->lower);
 
        zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view));
-       start_tt = icaltime_from_timet_with_zone (start, FALSE, zone);
-       end_tt = icaltime_from_timet_with_zone (end, FALSE, zone);
+       start_tt = i_cal_time_from_timet_with_zone (start, FALSE, zone);
+       end_tt = i_cal_time_from_timet_with_zone (end, FALSE, zone);
 
        if (add_event_data->comp_data) {
                event.comp_data = g_object_ref (add_event_data->comp_data);
@@ -5780,7 +5791,7 @@ e_day_view_add_event (ESourceRegistry *registry,
                event.comp_data->is_new_component = TRUE;
                event.comp_data->client = g_object_ref (client);
                e_cal_component_abort_sequence (comp);
-               event.comp_data->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent 
(comp));
+               event.comp_data->icalcomp = i_cal_component_new_clone (e_cal_component_get_icalcomponent 
(comp));
        }
 
        event.start = start;
@@ -5796,8 +5807,11 @@ e_day_view_add_event (ESourceRegistry *registry,
         * display. */
        offset = add_event_data->day_view->first_hour_shown * 60
                + add_event_data->day_view->first_minute_shown;
-       event.start_minute = start_tt.hour * 60 + start_tt.minute - offset;
-       event.end_minute = end_tt.hour * 60 + end_tt.minute - offset;
+       event.start_minute = i_cal_time_get_hour (start_tt) * 60 + i_cal_time_get_minute (start_tt) - offset;
+       event.end_minute = i_cal_time_get_hour (end_tt) * 60 + i_cal_time_get_minute (end_tt) - offset;
+
+       g_clear_object (&start_tt);
+       g_clear_object (&end_tt);
 
        event.start_row_or_col = 0;
        event.num_columns = 0;
@@ -6015,8 +6029,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
        /* We don't show the icons while resizing, since we'd have to
         * draw them on top of the resize rect. Nor when editing. */
        num_icons = 0;
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (!comp)
+               return;
 
        /* Set up Pango prerequisites */
        pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
@@ -6166,7 +6181,7 @@ e_day_view_reshape_day_events (EDayView *day_view,
                if (!is_comp_data_valid (event))
                        continue;
 
-               current_comp_string = icalcomponent_as_ical_string_r (event->comp_data->icalcomp);
+               current_comp_string = i_cal_component_as_ical_string_r (event->comp_data->icalcomp);
                if (day_view->last_edited_comp_string == NULL) {
                        g_free (current_comp_string);
                        continue;
@@ -6221,22 +6236,22 @@ e_day_view_reshape_day_event (EDayView *day_view,
                    || day_view->resize_event_num != event_num)) {
                        ECalComponent *comp;
 
-                       comp = e_cal_component_new ();
-                       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone 
(event->comp_data->icalcomp));
-
-                       if (e_cal_component_has_alarms (comp))
-                               num_icons++;
-                       if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))
-                               num_icons++;
-                       if (e_cal_component_has_attachments (comp))
-                               num_icons++;
-                       if (event->different_timezone)
-                               num_icons++;
-                       if (e_cal_component_has_attendees (comp))
-                               num_icons++;
-
-                       num_icons += cal_comp_util_get_n_icons (comp, NULL);
-                       g_object_unref (comp);
+                       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+                       if (comp) {
+                               if (e_cal_component_has_alarms (comp))
+                                       num_icons++;
+                               if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance 
(comp))
+                                       num_icons++;
+                               if (e_cal_component_has_attachments (comp))
+                                       num_icons++;
+                               if (event->different_timezone)
+                                       num_icons++;
+                               if (e_cal_component_has_attendees (comp))
+                                       num_icons++;
+
+                               num_icons += cal_comp_util_get_n_icons (comp, NULL);
+                               g_object_unref (comp);
+                       }
                }
 
                if (num_icons > 0) {
@@ -7332,7 +7347,7 @@ cancel_editing (EDayView *day_view)
 
        /* Reset the text to what was in the component */
 
-       summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+       summary = i_cal_component_get_summary (event->comp_data->icalcomp);
        g_object_set (
                event->canvas_item,
                "text", summary ? summary : "",
@@ -7593,7 +7608,7 @@ e_day_view_event_move (ECalendarView *cal_view,
        gint time_divisions;
        gint day, event_num, resize_start_row, resize_end_row;
        time_t start_dt, end_dt;
-       struct icaltimetype start_time, end_time;
+       ICalTime *start_time, *end_time;
 
        day_view = E_DAY_VIEW (cal_view);
        day = day_view->editing_event_day;
@@ -7640,24 +7655,28 @@ e_day_view_event_move (ECalendarView *cal_view,
                        return TRUE;
                start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row);
                end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1);
-               start_time = icaltime_from_timet_with_zone (start_dt, 0, NULL);
-               end_time = icaltime_from_timet_with_zone (end_dt, 0, NULL);
-               icaltime_adjust (&start_time ,-1,0,0,0);
-               icaltime_adjust (&end_time ,-1,0,0,0);
-               start_dt = icaltime_as_timet (start_time);
-               end_dt = icaltime_as_timet (end_time);
+               start_time = i_cal_time_from_timet_with_zone (start_dt, 0, NULL);
+               end_time = i_cal_time_from_timet_with_zone (end_dt, 0, NULL);
+               i_cal_time_adjust (start_time, -1, 0, 0, 0);
+               i_cal_time_adjust (end_time, -1, 0, 0, 0);
+               start_dt = i_cal_time_as_timet (start_time);
+               end_dt = i_cal_time_as_timet (end_time);
+               g_clear_object (&start_time);
+               g_clear_object (&end_time);
                break;
        case E_CAL_VIEW_MOVE_RIGHT:
                if (day + 1 >= e_day_view_get_days_shown (day_view))
                        return TRUE;
                start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row);
                end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1);
-               start_time = icaltime_from_timet_with_zone (start_dt, 0, NULL);
-               end_time = icaltime_from_timet_with_zone (end_dt, 0, NULL);
-               icaltime_adjust (&start_time ,1,0,0,0);
-               icaltime_adjust (&end_time ,1,0,0,0);
-               start_dt = icaltime_as_timet (start_time);
-               end_dt = icaltime_as_timet (end_time);
+               start_time = i_cal_time_from_timet_with_zone (start_dt, 0, NULL);
+               end_time = i_cal_time_from_timet_with_zone (end_dt, 0, NULL);
+               i_cal_time_adjust (start_time ,1,0,0,0);
+               i_cal_time_adjust (end_time ,1,0,0,0);
+               start_dt = i_cal_time_as_timet (start_time);
+               end_dt = i_cal_time_as_timet (end_time);
+               g_clear_object (&start_time);
+               g_clear_object (&end_time);
                break;
        default:
                return FALSE;
@@ -7677,8 +7696,8 @@ e_day_view_change_event_time (EDayView *day_view,
        EDayViewEvent *event;
        gint day, event_num;
        ECalComponent *comp;
-       ECalComponentDateTime date;
-       struct icaltimetype itt;
+       ECalComponentDateTime *date;
+       ICalTimezone *zone;
        ECalModel *model;
        ECalClient *client;
        ESourceRegistry *registry;
@@ -7704,8 +7723,7 @@ e_day_view_change_event_time (EDayView *day_view,
        /* We use a temporary shallow copy of the ico since we don't want to
         * change the original ico here. Otherwise we would not detect that
         * the event's time had changed in the "update_event" callback. */
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
 
        if (e_cal_component_has_attendees (comp) &&
            !itip_organizer_is_user (registry, comp, client)) {
@@ -7713,17 +7731,18 @@ e_day_view_change_event_time (EDayView *day_view,
                return;
        }
 
-       date.value = &itt;
-       /* FIXME: Should probably keep the timezone of the original start
-        * and end times. */
-       date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+       zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
+
+       date = e_cal_component_datetime_new_take (
+               i_cal_time_from_timet_with_zone (start_dt, FALSE, zone),
+               zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+       cal_comp_set_dtstart_with_oldzone (client, comp, date);
 
-       *date.value = icaltime_from_timet_with_zone (start_dt, FALSE,
-                                                    e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-       cal_comp_set_dtstart_with_oldzone (client, comp, &date);
-       *date.value = icaltime_from_timet_with_zone (end_dt, FALSE,
-                                                    e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
-       cal_comp_set_dtend_with_oldzone (client, comp, &date);
+       e_cal_component_datetime_take_value (date,
+               i_cal_time_from_timet_with_zone (end_dt, FALSE, zone));
+       cal_comp_set_dtend_with_oldzone (client, comp, date);
+
+       e_cal_component_datetime_free (date);
 
        e_cal_component_commit_sequence (comp);
 
@@ -7743,10 +7762,10 @@ e_day_view_change_event_time (EDayView *day_view,
                }
 
                if (mod == E_CAL_OBJ_MOD_THIS) {
-                       e_cal_component_set_rdate_list (comp, NULL);
-                       e_cal_component_set_rrule_list (comp, NULL);
-                       e_cal_component_set_exdate_list (comp, NULL);
-                       e_cal_component_set_exrule_list (comp, NULL);
+                       e_cal_component_set_rdates (comp, NULL);
+                       e_cal_component_set_rrules (comp, NULL);
+                       e_cal_component_set_exdates (comp, NULL);
+                       e_cal_component_set_exrules (comp, NULL);
                }
        } else if (e_cal_component_is_instance (comp))
                mod = E_CAL_OBJ_MOD_THIS;
@@ -7903,7 +7922,7 @@ e_day_view_on_editing_stopped (EDayView *day_view,
        gint day, event_num;
        EDayViewEvent *event;
        gchar *text = NULL;
-       ECalComponentText summary;
+       ECalComponentText *summary = NULL;
        ECalComponent *comp;
        ECalClient *client;
        gboolean on_server;
@@ -7950,8 +7969,11 @@ e_day_view_on_editing_stopped (EDayView *day_view,
                NULL);
        g_return_if_fail (text != NULL);
 
-       comp = e_cal_component_new ();
-       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+       if (comp) {
+               g_free (text);
+               return;
+       }
 
        client = event->comp_data->client;
        on_server = !event->comp_data->is_new_component;
@@ -7959,7 +7981,7 @@ e_day_view_on_editing_stopped (EDayView *day_view,
        if (string_is_empty (text) && !on_server) {
                const gchar *uid;
 
-               e_cal_component_get_uid (comp, &uid);
+               uid = e_cal_component_get_uid (comp);
 
                e_day_view_foreach_event_with_uid (day_view, uid,
                                                   e_day_view_remove_event_cb, NULL);
@@ -7970,24 +7992,25 @@ e_day_view_on_editing_stopped (EDayView *day_view,
        }
 
        /* Only update the summary if necessary. */
-       e_cal_component_get_summary (comp, &summary);
-       if (summary.value && !strcmp (text, summary.value)) {
+       summary = e_cal_component_get_summary (comp);
+       if (summary && !g_strcmp0 (text, e_cal_component_text_get_value (summary))) {
                if (day == E_DAY_VIEW_LONG_EVENT)
                        e_day_view_reshape_long_event (day_view, event_num);
                else
                        e_day_view_update_event_label (
                                day_view, day,
                                event_num);
-       } else if (summary.value || !string_is_empty (text)) {
-               icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
+       } else if ((summary && e_cal_component_text_get_value (summary)) || !string_is_empty (text)) {
+               ICalComponent *icomp = e_cal_component_get_icalcomponent (comp);
 
-               summary.value = text;
-               summary.altrep = NULL;
-               e_cal_component_set_summary (comp, &summary);
+               if (summary)
+                       e_cal_component_text_free (summary);
+               summary = e_cal_component_text_new (text, NULL);
+               e_cal_component_set_summary (comp, summary);
                e_cal_component_commit_sequence (comp);
 
                if (!on_server) {
-                       e_cal_ops_create_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), 
client, icalcomp,
+                       e_cal_ops_create_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), 
client, icomp,
                                e_calendar_view_component_created_cb, g_object_ref (day_view), 
g_object_unref);
 
                        /* we remove the object since we either got the update from the server or failed */
@@ -8001,49 +8024,70 @@ e_day_view_on_editing_stopped (EDayView *day_view,
                                }
 
                                if (mod == E_CAL_OBJ_MOD_THIS) {
-                                       ECalComponentDateTime olddt, dt;
-                                       icaltimetype itt;
+                                       ECalComponentDateTime *olddt, *dt;
+
+                                       olddt = e_cal_component_get_dtstart (comp);
+
+                                       if (olddt && e_cal_component_datetime_get_value (olddt) &&
+                                           i_cal_time_get_timezone (e_cal_component_datetime_get_value 
(olddt))) {
+                                               ICalTime *itt;
 
-                                       dt.value = &itt;
+                                               itt = e_cal_component_datetime_get_value (olddt);
 
-                                       e_cal_component_get_dtstart (comp, &olddt);
-                                       if (olddt.value->zone) {
-                                               *dt.value = icaltime_from_timet_with_zone (
-                                                       event->comp_data->instance_start,
-                                                       olddt.value->is_date,
-                                                       olddt.value->zone);
+                                               dt = e_cal_component_datetime_new_take (
+                                                       i_cal_time_from_timet_with_zone 
(event->comp_data->instance_start,
+                                                               i_cal_time_is_date (itt), 
i_cal_time_get_timezone (itt)),
+                                                       g_strdup (e_cal_component_datetime_get_tzid (olddt)));
                                        } else {
-                                               *dt.value = icaltime_from_timet_with_zone (
-                                                       event->comp_data->instance_start,
-                                                       olddt.value->is_date,
-                                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
+                                               ICalTime *itt;
+                                               ICalTimezone *zone;
+
+                                               zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view));
+                                               itt = olddt ? e_cal_component_datetime_get_value (olddt) : 
NULL;
+
+                                               dt = e_cal_component_datetime_new_take (
+                                                       i_cal_time_from_timet_with_zone 
(event->comp_data->instance_start,
+                                                               itt ? i_cal_time_is_date (itt) : FALSE, zone),
+                                                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : 
NULL);
                                        }
-                                       dt.tzid = olddt.tzid;
-                                       e_cal_component_set_dtstart (comp, &dt);
-                                       dt.tzid = NULL;
-                                       e_cal_component_free_datetime (&olddt);
-
-                                       e_cal_component_get_dtend (comp, &olddt);
-                                       if (olddt.value->zone) {
-                                               *dt.value = icaltime_from_timet_with_zone (
-                                                       event->comp_data->instance_end,
-                                                       olddt.value->is_date,
-                                                       olddt.value->zone);
+                                       e_cal_component_set_dtstart (comp, dt);
+
+                                       e_cal_component_datetime_free (olddt);
+                                       e_cal_component_datetime_free (dt);
+
+                                       olddt = e_cal_component_get_dtend (comp);
+
+                                       if (olddt && e_cal_component_datetime_get_value (olddt) &&
+                                           i_cal_time_get_timezone (e_cal_component_datetime_get_value 
(olddt))) {
+                                               ICalTime *itt;
+
+                                               itt = e_cal_component_datetime_get_value (olddt);
+
+                                               dt = e_cal_component_datetime_new_take (
+                                                       i_cal_time_from_timet_with_zone 
(event->comp_data->instance_end,
+                                                               i_cal_time_is_date (itt), 
i_cal_time_get_timezone (itt)),
+                                                       g_strdup (e_cal_component_datetime_get_tzid (olddt)));
                                        } else {
-                                               *dt.value = icaltime_from_timet_with_zone (
-                                                       event->comp_data->instance_end,
-                                                       olddt.value->is_date,
-                                                       e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
+                                               ICalTime *itt;
+                                               ICalTimezone *zone;
+
+                                               zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view));
+                                               itt = olddt ? e_cal_component_datetime_get_value (olddt) : 
NULL;
+
+                                               dt = e_cal_component_datetime_new_take (
+                                                       i_cal_time_from_timet_with_zone 
(event->comp_data->instance_end,
+                                                               itt ? i_cal_time_is_date (itt) : FALSE, zone),
+                                                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : 
NULL);
                                        }
-                                       dt.tzid = olddt.tzid;
-                                       e_cal_component_set_dtend (comp, &dt);
-                                       dt.tzid = NULL;
-                                       e_cal_component_free_datetime (&olddt);
+                                       e_cal_component_set_dtend (comp, dt);
 
-                                       e_cal_component_set_rdate_list (comp, NULL);
-                                       e_cal_component_set_rrule_list (comp, NULL);
-                                       e_cal_component_set_exdate_list (comp, NULL);
-                                       e_cal_component_set_exrule_list (comp, NULL);
+                                       e_cal_component_datetime_free (olddt);
+                                       e_cal_component_datetime_free (dt);
+
+                                       e_cal_component_set_rdates (comp, NULL);
+                                       e_cal_component_set_rrules (comp, NULL);
+                                       e_cal_component_set_exdates (comp, NULL);
+                                       e_cal_component_set_exrules (comp, NULL);
 
                                        e_cal_component_commit_sequence (comp);
                                }
@@ -8059,6 +8103,7 @@ e_day_view_on_editing_stopped (EDayView *day_view,
 
  out:
 
+       e_cal_component_text_free (summary);
        g_object_unref (comp);
        g_free (text);
 
@@ -8077,7 +8122,7 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view,
 {
        ECalendarView *cal_view;
        gint time_divisions;
-       struct icaltimetype tt;
+       ICalTime *tt;
        time_t val;
        gint minutes;
 
@@ -8094,15 +8139,18 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view,
        if (minutes == 60 * 24)
                return day_view->day_starts[col + 1];
 
-       /* Create an icaltimetype and convert to a time_t. */
-       tt = icaltime_from_timet_with_zone (
+       /* Create an ICalTime and convert to a time_t. */
+       tt = i_cal_time_from_timet_with_zone (
                day_view->day_starts[col],
                FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-       tt.hour = minutes / 60;
-       tt.minute = minutes % 60;
-       tt.second = 0;
+       i_cal_time_set_hour (tt, minutes / 60);
+       i_cal_time_set_minute (tt, minutes % 60);
+       i_cal_time_set_second (tt, 0);
+
+       val = i_cal_time_as_timet_with_zone (tt, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+
+       g_clear_object (&tt);
 
-       val = icaltime_as_timet_with_zone (tt, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
        return val;
 }
 
@@ -8113,7 +8161,7 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view,
                                           gint *row)
 {
        ECalendarView *cal_view;
-       struct icaltimetype tt;
+       ICalTime *tt;
        gint time_divisions;
        gint day, minutes;
        gint days_shown;
@@ -8136,14 +8184,16 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view,
                }
        }
 
-       /* To find the row we need to convert the time to an icaltimetype,
+       /* To find the row we need to convert the time to an ICalTime,
         * calculate the offset in minutes from the top of the display and
         * divide it by the mins per row setting. */
-       tt = icaltime_from_timet_with_zone (time, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
+       tt = i_cal_time_from_timet_with_zone (time, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
 
-       minutes = tt.hour * 60 + tt.minute;
+       minutes = i_cal_time_get_hour (tt) * 60 + i_cal_time_get_minute (tt);
        minutes -= day_view->first_hour_shown * 60 + day_view->first_minute_shown;
 
+       g_clear_object (&tt);
+
        *row = minutes / time_divisions;
 
        if (*row < 0 || *row >= day_view->rows)
@@ -8737,7 +8787,7 @@ e_day_view_update_top_canvas_drag (EDayView *day_view,
                const gchar *summary;
 
                if (event && is_comp_data_valid (event)) {
-                       summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+                       summary = i_cal_component_get_summary (event->comp_data->icalcomp);
                        text = g_strdup (summary);
                } else {
                        text = NULL;
@@ -8914,7 +8964,7 @@ e_day_view_update_main_canvas_drag (EDayView *day_view,
                const gchar *summary;
 
                if (event && is_comp_data_valid (event)) {
-                       summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+                       summary = i_cal_component_get_summary (event->comp_data->icalcomp);
                        text = g_strdup (summary);
                } else {
                        text = NULL;
@@ -9050,7 +9100,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
                              EDayView *day_view)
 {
        EDayViewEvent *event;
-       icalcomponent *vcal;
+       ICalComponent *vcal;
        gint day, event_num;
        gchar *comp_str;
 
@@ -9085,10 +9135,10 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
        vcal = e_cal_util_new_top_level ();
        e_cal_util_add_timezones_from_component (
                vcal, event->comp_data->icalcomp);
-       icalcomponent_add_component (
-               vcal, icalcomponent_new_clone (event->comp_data->icalcomp));
+       i_cal_component_take_component (
+               vcal, i_cal_component_new_clone (event->comp_data->icalcomp));
 
-       comp_str = icalcomponent_as_ical_string_r (vcal);
+       comp_str = i_cal_component_as_ical_string_r (vcal);
        if (comp_str) {
                ESource *source;
                const gchar *source_uid;
@@ -9107,7 +9157,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
                g_free (tmp);
        }
 
-       icalcomponent_free (vcal);
+       g_clear_object (&vcal);
        g_free (comp_str);
 }
 
@@ -9126,9 +9176,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
        gint day, start_day, end_day, num_days;
        gint start_offset, end_offset;
        ECalComponent *comp;
-       ECalComponentDateTime date;
        ESourceRegistry *registry;
-       struct icaltimetype itt;
        time_t dt;
        gboolean all_day_event;
        ECalModel *model;
@@ -9166,9 +9214,12 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
                        x, y, &day,
                        NULL);
                if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
+                       ECalComponentDateTime *date;
                        ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
                        ECalClient *client;
                        GtkWindow *toplevel;
+                       ICalTime *itt;
+                       ICalTimezone *zone;
 
                        num_days = 1;
                        start_offset = 0;
@@ -9218,8 +9269,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
                         * Otherwise we would not detect that the event's time
                         * had changed in the "update_event" callback. */
 
-                       comp = e_cal_component_new ();
-                       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone 
(event->comp_data->icalcomp));
+                       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+                       if (!comp)
+                               return;
 
                        if (e_cal_component_has_attendees (comp) &&
                            !itip_organizer_is_user (registry, comp, client)) {
@@ -9246,38 +9298,32 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
                        else
                                all_day_event = FALSE;
 
-                       date.value = &itt;
-
+                       zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
                        dt = day_view->day_starts[day] + start_offset * 60;
-                       itt = icaltime_from_timet_with_zone (
-                               dt, FALSE,
-                               e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+                       itt = i_cal_time_from_timet_with_zone (dt, FALSE, zone);
                        if (all_day_event) {
-                               itt.is_date = TRUE;
-                               date.tzid = NULL;
+                               i_cal_time_set_is_date (itt, TRUE);
+                               date = e_cal_component_datetime_new_take (itt, NULL);
                        } else {
-                               /* FIXME: Should probably keep the timezone of
-                                * the original start and end times. */
-                               date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
+                               date = e_cal_component_datetime_new_take (itt,
+                                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
                        }
-                       cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+                       cal_comp_set_dtstart_with_oldzone (client, comp, date);
+                       e_cal_component_datetime_free (date);
 
                        if (end_offset == 0)
                                dt = day_view->day_starts[day + num_days];
                        else
                                dt = day_view->day_starts[day + num_days - 1] + end_offset * 60;
-                       itt = icaltime_from_timet_with_zone (
-                               dt, FALSE,
-                               e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+                       itt = i_cal_time_from_timet_with_zone (dt, FALSE, zone);
                        if (all_day_event) {
-                               itt.is_date = TRUE;
-                               date.tzid = NULL;
+                               i_cal_time_set_is_date (itt, TRUE);
+                               date = e_cal_component_datetime_new_take (itt, NULL);
                        } else {
-                               /* FIXME: Should probably keep the timezone of
-                                * the original start and end times. */
-                               date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
+                               date = e_cal_component_datetime_new_take (itt,
+                                       zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
                        }
-                       cal_comp_set_dtend_with_oldzone (client, comp, &date);
+                       cal_comp_set_dtend_with_oldzone (client, comp, date);
 
                        gtk_drag_finish (context, TRUE, TRUE, time);
 
@@ -9299,10 +9345,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
                                }
 
                                if (mod == E_CAL_OBJ_MOD_THIS) {
-                                       e_cal_component_set_rdate_list (comp, NULL);
-                                       e_cal_component_set_rrule_list (comp, NULL);
-                                       e_cal_component_set_exdate_list (comp, NULL);
-                                       e_cal_component_set_exrule_list (comp, NULL);
+                                       e_cal_component_set_rdates (comp, NULL);
+                                       e_cal_component_set_rrules (comp, NULL);
+                                       e_cal_component_set_exdates (comp, NULL);
+                                       e_cal_component_set_exrules (comp, NULL);
                                }
                        } else if (e_cal_component_is_instance (comp))
                                mod = E_CAL_OBJ_MOD_THIS;
@@ -9322,8 +9368,8 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
 
        if (length >= 0 && format == 8 && !drag_from_same_window) {
                /* We are dragging between different window */
-               icalcomponent *icalcomp;
-               icalcomponent_kind kind;
+               ICalComponent *icomp;
+               ICalComponentKind kind;
 
                pos = e_day_view_convert_position_in_top_canvas (
                        day_view,
@@ -9332,15 +9378,15 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
                if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
                        goto error;
 
-               icalcomp = icalparser_parse_string ((const gchar *) data);
-               if (!icalcomp)
+               icomp = i_cal_parser_parse_string ((const gchar *) data);
+               if (!icomp)
                        goto error;
 
                /* check the type of the component */
-               kind = icalcomponent_isa (icalcomp);
-               icalcomponent_free (icalcomp);
+               kind = i_cal_component_isa (icomp);
+               g_clear_object (&icomp);
 
-               if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
+               if (kind != I_CAL_VCALENDAR_COMPONENT && kind != I_CAL_VEVENT_COMPONENT)
                        goto error;
 
                e_cal_ops_paste_components (model, (const gchar *) data);
@@ -9371,9 +9417,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
        gint start_offset, end_offset;
        ECalModel *model;
        ECalComponent *comp;
-       ECalComponentDateTime date;
        ESourceRegistry *registry;
-       struct icaltimetype itt;
        time_t dt;
        gboolean drag_from_same_window;
        const guchar *data;
@@ -9412,9 +9456,11 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
                        x, y, &day,
                        &row, NULL);
                if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
+                       ECalComponentDateTime *date;
                        ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
                        ECalClient *client;
                        GtkWindow *toplevel;
+                       ICalTimezone *zone;
 
                        num_rows = 1;
                        start_offset = 0;
@@ -9462,8 +9508,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
                         * don't want to change the original comp here.
                         * Otherwise we would not detect that the event's time
                         * had changed in the "update_event" callback. */
-                       comp = e_cal_component_new ();
-                       e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone 
(event->comp_data->icalcomp));
+                       comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone 
(event->comp_data->icalcomp));
+                       if (!comp)
+                               return;
 
                        if (e_cal_component_has_attendees (comp) &&
                            !itip_organizer_is_user (registry, comp, client)) {
@@ -9485,17 +9532,22 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
                                return;
                        }
 
-                       date.value = &itt;
-                       date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW 
(day_view)));
+                       zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view));
 
                        dt = e_day_view_convert_grid_position_to_time (day_view, day, row) + start_offset * 
60;
-                       *date.value = icaltime_from_timet_with_zone (dt, FALSE,
-                                                                    e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
-                       cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+                       date = e_cal_component_datetime_new_take (
+                               i_cal_time_from_timet_with_zone (dt, FALSE, zone),
+                               zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+                       cal_comp_set_dtstart_with_oldzone (client, comp, date);
+                       e_cal_component_datetime_free (date);
+
                        dt = e_day_view_convert_grid_position_to_time (day_view, day, row + num_rows) - 
end_offset * 60;
-                       *date.value = icaltime_from_timet_with_zone (dt, FALSE,
-                                                                    e_calendar_view_get_timezone 
(E_CALENDAR_VIEW (day_view)));
-                       cal_comp_set_dtend_with_oldzone (client, comp, &date);
+                       date = e_cal_component_datetime_new_take (
+                               i_cal_time_from_timet_with_zone (dt, FALSE, zone),
+                               zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
+                       cal_comp_set_dtend_with_oldzone (client, comp, date);
+                       e_cal_component_datetime_free (date);
+
                        e_cal_component_abort_sequence (comp);
 
                        gtk_drag_finish (context, TRUE, TRUE, time);
@@ -9518,10 +9570,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
                                }
 
                                if (mod == E_CAL_OBJ_MOD_THIS) {
-                                       e_cal_component_set_rdate_list (comp, NULL);
-                                       e_cal_component_set_rrule_list (comp, NULL);
-                                       e_cal_component_set_exdate_list (comp, NULL);
-                                       e_cal_component_set_exrule_list (comp, NULL);
+                                       e_cal_component_set_rdates (comp, NULL);
+                                       e_cal_component_set_rrules (comp, NULL);
+                                       e_cal_component_set_exdates (comp, NULL);
+                                       e_cal_component_set_exrules (comp, NULL);
                                }
                        } else if (e_cal_component_is_instance (comp))
                                mod = E_CAL_OBJ_MOD_THIS;
@@ -9541,8 +9593,8 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
 
        if (length >= 0 && format == 8 && !drag_from_same_window) {
                /* We are dragging between different window */
-               icalcomponent *icalcomp;
-               icalcomponent_kind kind;
+               ICalComponent *icomp;
+               ICalComponentKind kind;
 
                pos = e_day_view_convert_position_in_main_canvas (
                        day_view,
@@ -9551,15 +9603,15 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
                if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
                        goto error;
 
-               icalcomp = icalparser_parse_string ((const gchar *) data);
-               if (!icalcomp)
+               icomp = i_cal_parser_parse_string ((const gchar *) data);
+               if (!icomp)
                        goto error;
 
                /* check the type of the component */
-               kind = icalcomponent_isa (icalcomp);
-               icalcomponent_free (icalcomp);
+               kind = i_cal_component_isa (icomp);
+               g_object_unref (&icomp);
 
-               if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
+               if (kind != I_CAL_VCALENDAR_COMPONENT && kind != I_CAL_VEVENT_COMPONENT)
                        goto error;
 
                e_cal_ops_paste_components (model, (const gchar *) data);
@@ -9677,7 +9729,7 @@ e_day_view_is_editing (EDayView *day_view)
 
 static void
 day_view_update_timezone_name_label (GtkWidget *label,
-                                    icaltimezone *zone)
+                                    ICalTimezone *zone)
 {
        const gchar *location, *dash;
        gchar *markup;
@@ -9687,11 +9739,11 @@ day_view_update_timezone_name_label (GtkWidget *label,
        if (!zone) {
                location = NULL;
        } else {
-               location = icaltimezone_get_location (zone);
+               location = i_cal_timezone_get_location (zone);
                if (location && *location)
                        location = _(location);
                if (!location || !*location)
-                       location = icaltimezone_get_tzid (zone);
+                       location = i_cal_timezone_get_tzid (zone);
        }
 
        if (!location)
@@ -9711,7 +9763,7 @@ day_view_update_timezone_name_label (GtkWidget *label,
 void
 e_day_view_update_timezone_name_labels (EDayView *day_view)
 {
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        g_return_if_fail (E_IS_DAY_VIEW (day_view));
 
diff --git a/src/calendar/gui/e-meeting-attendee.c b/src/calendar/gui/e-meeting-attendee.c
index 3c50466daf..133a0197c5 100644
--- a/src/calendar/gui/e-meeting-attendee.c
+++ b/src/calendar/gui/e-meeting-attendee.c
@@ -35,15 +35,15 @@ struct _EMeetingAttendeePrivate {
        gchar *member;
        gchar *fburi;
 
-       icalparameter_cutype cutype;
-       icalparameter_role role;
+       ICalParameterCutype cutype;
+       ICalParameterRole role;
 
        gboolean rsvp;
 
        gchar *delto;
        gchar *delfrom;
 
-       icalparameter_partstat status;
+       ICalParameterPartstat partstat;
 
        gchar *sentby;
        gchar *cn;
@@ -76,13 +76,13 @@ static void e_meeting_attendee_finalize     (GObject *obj);
 G_DEFINE_TYPE (EMeetingAttendee, e_meeting_attendee, G_TYPE_OBJECT)
 
 static gchar *
-string_test (gchar *string)
+string_test (const gchar *string)
 {
-       return string != NULL ? string : g_strdup ("");
+       return g_strdup (string ? string : "");
 }
 
 static gboolean
-string_is_set (gchar *string)
+string_is_set (const gchar *string)
 {
        if (string != NULL && *string != '\0')
                return TRUE;
@@ -110,25 +110,42 @@ notify_changed (EMeetingAttendee *ia)
        g_signal_emit_by_name (ia, "changed");
 }
 
+static void
+set_string_value (EMeetingAttendee *ia,
+                 gchar **member,
+                 const gchar *value)
+{
+       if (!string_is_set (*member) && !string_is_set (value))
+               return;
+
+       if (g_strcmp0 (*member, value) == 0)
+               return;
+
+       g_free (*member);
+       *member = string_test (value);
+
+       notify_changed (ia);
+}
+
 static void
 e_meeting_attendee_finalize (GObject *object)
 {
-       EMeetingAttendeePrivate *priv;
+       EMeetingAttendee *ia;
 
-       priv = E_MEETING_ATTENDEE_GET_PRIVATE (object);
+       ia = E_MEETING_ATTENDEE (object);
 
-       g_free (priv->address);
-       g_free (priv->member);
-       g_free (priv->fburi);
+       g_free (ia->priv->address);
+       g_free (ia->priv->member);
+       g_free (ia->priv->fburi);
 
-       g_free (priv->delto);
-       g_free (priv->delfrom);
+       g_free (ia->priv->delto);
+       g_free (ia->priv->delfrom);
 
-       g_free (priv->sentby);
-       g_free (priv->cn);
-       g_free (priv->language);
+       g_free (ia->priv->sentby);
+       g_free (ia->priv->cn);
+       g_free (ia->priv->language);
 
-       g_array_free (priv->busy_periods, TRUE);
+       g_array_free (ia->priv->busy_periods, TRUE);
 
        /* Chain up to parent's finalize() method. */
        G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize (object);
@@ -162,15 +179,15 @@ e_meeting_attendee_init (EMeetingAttendee *ia)
        ia->priv->address = string_test (NULL);
        ia->priv->member = string_test (NULL);
 
-       ia->priv->cutype = ICAL_CUTYPE_NONE;
-       ia->priv->role = ICAL_ROLE_NONE;
+       ia->priv->cutype = I_CAL_CUTYPE_NONE;
+       ia->priv->role = I_CAL_ROLE_NONE;
 
        ia->priv->rsvp = FALSE;
 
        ia->priv->delto = string_test (NULL);
        ia->priv->delfrom = string_test (NULL);
 
-       ia->priv->status = ICAL_PARTSTAT_NONE;
+       ia->priv->partstat = I_CAL_PARTSTAT_NONE;
 
        ia->priv->sentby = string_test (NULL);
        ia->priv->cn = string_test (NULL);
@@ -205,465 +222,351 @@ e_meeting_attendee_new (void)
 }
 
 GObject *
-e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca)
+e_meeting_attendee_new_from_e_cal_component_attendee (const ECalComponentAttendee *ca)
 {
        EMeetingAttendee *ia;
 
+       g_return_val_if_fail (ca != NULL, NULL);
+
        ia = E_MEETING_ATTENDEE (g_object_new (E_TYPE_MEETING_ATTENDEE, NULL));
 
-       e_meeting_attendee_set_address (ia, g_strdup (ca->value));
-       e_meeting_attendee_set_member (ia, g_strdup (ca->member));
-       e_meeting_attendee_set_cutype (ia, ca->cutype);
-       e_meeting_attendee_set_role (ia, ca->role);
-       e_meeting_attendee_set_status (ia, ca->status);
-       e_meeting_attendee_set_rsvp (ia, ca->rsvp);
-       e_meeting_attendee_set_delto (ia, g_strdup (ca->delto));
-       e_meeting_attendee_set_delfrom (ia, g_strdup (ca->delfrom));
-       e_meeting_attendee_set_sentby (ia, g_strdup (ca->sentby));
-       e_meeting_attendee_set_cn (ia, g_strdup (ca->cn));
-       e_meeting_attendee_set_language (ia, g_strdup (ca->language));
+       e_meeting_attendee_set_address (ia, e_cal_component_attendee_get_value (ca));
+       e_meeting_attendee_set_member (ia, e_cal_component_attendee_get_member (ca));
+       e_meeting_attendee_set_cutype (ia, e_cal_component_attendee_get_cutype (ca));
+       e_meeting_attendee_set_role (ia, e_cal_component_attendee_get_role (ca));
+       e_meeting_attendee_set_partstat (ia, e_cal_component_attendee_get_partstat (ca));
+       e_meeting_attendee_set_rsvp (ia, e_cal_component_attendee_get_rsvp (ca));
+       e_meeting_attendee_set_delto (ia, e_cal_component_attendee_get_delegatedto (ca));
+       e_meeting_attendee_set_delfrom (ia, e_cal_component_attendee_get_delegatedfrom (ca));
+       e_meeting_attendee_set_sentby (ia, e_cal_component_attendee_get_sentby (ca));
+       e_meeting_attendee_set_cn (ia, e_cal_component_attendee_get_cn (ca));
+       e_meeting_attendee_set_language (ia, e_cal_component_attendee_get_language (ca));
 
        return G_OBJECT (ia);
 }
 
 ECalComponentAttendee *
-e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia)
+e_meeting_attendee_as_e_cal_component_attendee (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-       ECalComponentAttendee *ca;
-
-       priv = ia->priv;
-
-       ca = g_new0 (ECalComponentAttendee, 1);
-
-       ca->value = priv->address;
-       ca->member = string_is_set (priv->member) ? priv->member : NULL;
-       ca->cutype= priv->cutype;
-       ca->role = priv->role;
-       ca->status = priv->status;
-       ca->rsvp = priv->rsvp;
-       ca->delto = string_is_set (priv->delto) ? priv->delto : NULL;
-       ca->delfrom = string_is_set (priv->delfrom) ? priv->delfrom : NULL;
-       ca->sentby = string_is_set (priv->sentby) ? priv->sentby : NULL;
-       ca->cn = string_is_set (priv->cn) ? priv->cn : NULL;
-       ca->language = string_is_set (priv->language) ? priv->language : NULL;
-
-       return ca;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
+
+       return e_cal_component_attendee_new_full (
+               ia->priv->address,
+               string_is_set (ia->priv->member) ? ia->priv->member : NULL,
+               ia->priv->cutype,
+               ia->priv->role,
+               ia->priv->partstat,
+               ia->priv->rsvp,
+               string_is_set (ia->priv->delfrom) ? ia->priv->delfrom : NULL,
+               string_is_set (ia->priv->delto) ? ia->priv->delto : NULL,
+               string_is_set (ia->priv->sentby) ? ia->priv->sentby : NULL,
+               string_is_set (ia->priv->cn) ? ia->priv->cn : NULL,
+               string_is_set (ia->priv->language) ? ia->priv->language : NULL);
 }
 
 const gchar *
-e_meeting_attendee_get_fburi (EMeetingAttendee *ia)
+e_meeting_attendee_get_fburi (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       priv = ia->priv;
-
-       return priv->fburi;
+       return ia->priv->fburi;
 }
 
 void
 e_meeting_attendee_set_fburi (EMeetingAttendee *ia,
-                              gchar *fburi)
+                             const gchar *fburi)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->fburi != NULL)
-               g_free (priv->fburi);
-
-       priv->fburi = string_test (fburi);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->fburi, fburi);
 }
 
 const gchar *
-e_meeting_attendee_get_address (EMeetingAttendee *ia)
+e_meeting_attendee_get_address (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       priv = ia->priv;
-
-       return priv->address;
+       return ia->priv->address;
 }
 
 void
 e_meeting_attendee_set_address (EMeetingAttendee *ia,
-                                gchar *address)
+                               const gchar *address)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->address != NULL)
-               g_free (priv->address);
-
-       priv->address = string_test (address);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->address, address);
 }
 
 gboolean
-e_meeting_attendee_is_set_address (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_address (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->address);
+       return string_is_set (ia->priv->address);
 }
 
 const gchar *
-e_meeting_attendee_get_member (EMeetingAttendee *ia)
+e_meeting_attendee_get_member (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       priv = ia->priv;
-
-       return priv->member;
+       return ia->priv->member;
 }
 
 void
 e_meeting_attendee_set_member (EMeetingAttendee *ia,
-                               gchar *member)
+                              const gchar *member)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->member != NULL)
-               g_free (priv->member);
-
-       priv->member = string_test (member);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->member, member);
 }
 
 gboolean
-e_meeting_attendee_is_set_member (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_member (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->member);
+       return string_is_set (ia->priv->member);
 }
 
-icalparameter_cutype
-e_meeting_attendee_get_cutype (EMeetingAttendee *ia)
+ICalParameterCutype
+e_meeting_attendee_get_cutype (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), I_CAL_CUTYPE_NONE);
 
-       return priv->cutype;
+       return ia->priv->cutype;
 }
 
 void
 e_meeting_attendee_set_cutype (EMeetingAttendee *ia,
-                               icalparameter_cutype cutype)
+                              ICalParameterCutype cutype)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       priv->cutype = cutype;
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       if (ia->priv->cutype != cutype) {
+               ia->priv->cutype = cutype;
+               notify_changed (ia);
+       }
 }
 
-icalparameter_role
-e_meeting_attendee_get_role (EMeetingAttendee *ia)
+ICalParameterRole
+e_meeting_attendee_get_role (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), I_CAL_ROLE_NONE);
 
-       return priv->role;
+       return ia->priv->role;
 }
 
 void
 e_meeting_attendee_set_role (EMeetingAttendee *ia,
-                             icalparameter_role role)
+                            ICalParameterRole role)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       priv->role = role;
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       if (ia->priv->role != role) {
+               ia->priv->role = role;
+               notify_changed (ia);
+       }
 }
 
 gboolean
-e_meeting_attendee_get_rsvp (EMeetingAttendee *ia)
+e_meeting_attendee_get_rsvp (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return priv->rsvp;
+       return ia->priv->rsvp;
 }
 
 void
 e_meeting_attendee_set_rsvp (EMeetingAttendee *ia,
                              gboolean rsvp)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       priv->rsvp = rsvp;
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       if ((ia->priv->rsvp ? 1 : 0) != (rsvp ? 1 : 0)) {
+               ia->priv->rsvp = rsvp;
+               notify_changed (ia);
+       }
 }
 
 const gchar *
-e_meeting_attendee_get_delto (EMeetingAttendee *ia)
+e_meeting_attendee_get_delto (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       priv = ia->priv;
-
-       return priv->delto;
+       return ia->priv->delto;
 }
 
 void
 e_meeting_attendee_set_delto (EMeetingAttendee *ia,
-                              gchar *delto)
+                             const gchar *delto)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->delto != NULL)
-               g_free (priv->delto);
-
-       priv->delto = string_test (delto);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->delto, delto);
 }
 
 gboolean
-e_meeting_attendee_is_set_delto (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_delto (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->delto);
+       return string_is_set (ia->priv->delto);
 }
 
 const gchar *
-e_meeting_attendee_get_delfrom (EMeetingAttendee *ia)
+e_meeting_attendee_get_delfrom (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       priv = ia->priv;
-
-       return priv->delfrom;
+       return ia->priv->delfrom;
 }
 
 void
 e_meeting_attendee_set_delfrom (EMeetingAttendee *ia,
-                                gchar *delfrom)
+                               const gchar *delfrom)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->delfrom != NULL)
-               g_free (priv->delfrom);
-
-       priv->delfrom = string_test (delfrom);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->delfrom, delfrom);
 }
 
 gboolean
-e_meeting_attendee_is_set_delfrom (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_delfrom (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->delfrom);
+       return string_is_set (ia->priv->delfrom);
 }
 
-icalparameter_partstat
-e_meeting_attendee_get_status (EMeetingAttendee *ia)
+ICalParameterPartstat
+e_meeting_attendee_get_partstat (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), I_CAL_PARTSTAT_NONE);
 
-       return priv->status;
+       return ia->priv->partstat;
 }
 
 void
-e_meeting_attendee_set_status (EMeetingAttendee *ia,
-                               icalparameter_partstat status)
+e_meeting_attendee_set_partstat (EMeetingAttendee *ia,
+                                ICalParameterPartstat partstat)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       priv->status = status;
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       if (ia->priv->partstat != partstat) {
+               ia->priv->partstat = partstat;
+               notify_changed (ia);
+       }
 }
 
 const gchar *
-e_meeting_attendee_get_sentby (EMeetingAttendee *ia)
+e_meeting_attendee_get_sentby (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       return priv->sentby;
+       return ia->priv->sentby;
 }
 
 void
 e_meeting_attendee_set_sentby (EMeetingAttendee *ia,
-                               gchar *sentby)
+                              const gchar *sentby)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->sentby != NULL)
-               g_free (priv->sentby);
-
-       priv->sentby = string_test (sentby);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->sentby, sentby);
 }
 
 gboolean
-e_meeting_attendee_is_set_sentby (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_sentby (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->sentby);
+       return string_is_set (ia->priv->sentby);
 }
 
 const gchar *
-e_meeting_attendee_get_cn (EMeetingAttendee *ia)
+e_meeting_attendee_get_cn (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       return priv->cn;
+       return ia->priv->cn;
 }
 
 void
 e_meeting_attendee_set_cn (EMeetingAttendee *ia,
-                           gchar *cn)
+                          const gchar *cn)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->cn != NULL)
-               g_free (priv->cn);
-
-       priv->cn = string_test (cn);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->cn, cn);
 }
 
 gboolean
-e_meeting_attendee_is_set_cn (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_cn (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->cn);
+       return string_is_set (ia->priv->cn);
 }
 
 const gchar *
-e_meeting_attendee_get_language (EMeetingAttendee *ia)
+e_meeting_attendee_get_language (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
-       return priv->language;
+       return ia->priv->language;
 }
 
 void
 e_meeting_attendee_set_language (EMeetingAttendee *ia,
-                                 gchar *language)
+                                const gchar *language)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->language != NULL)
-               g_free (priv->language);
-
-       priv->language = string_test (language);
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       notify_changed (ia);
+       set_string_value (ia, &ia->priv->language, language);
 }
 
 gboolean
-e_meeting_attendee_is_set_language (EMeetingAttendee *ia)
+e_meeting_attendee_is_set_language (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return string_is_set (priv->language);
+       return string_is_set (ia->priv->language);
 }
 
 EMeetingAttendeeType
-e_meeting_attendee_get_atype (EMeetingAttendee *ia)
+e_meeting_attendee_get_atype (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), E_MEETING_ATTENDEE_RESOURCE_UNKNOWN);
 
-       if (priv->cutype == ICAL_CUTYPE_ROOM
-           || priv->cutype == ICAL_CUTYPE_RESOURCE)
+       if (ia->priv->cutype == I_CAL_CUTYPE_ROOM ||
+           ia->priv->cutype == I_CAL_CUTYPE_RESOURCE)
                return E_MEETING_ATTENDEE_RESOURCE;
 
-       if (priv->role == ICAL_ROLE_CHAIR
-           || priv->role == ICAL_ROLE_REQPARTICIPANT)
+       if (ia->priv->role == I_CAL_ROLE_CHAIR ||
+           ia->priv->role == I_CAL_ROLE_REQPARTICIPANT)
                return E_MEETING_ATTENDEE_REQUIRED_PERSON;
 
        return E_MEETING_ATTENDEE_OPTIONAL_PERSON;
 }
 
 EMeetingAttendeeEditLevel
-e_meeting_attendee_get_edit_level (EMeetingAttendee *ia)
+e_meeting_attendee_get_edit_level (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       g_return_val_if_fail (ia != NULL, E_MEETING_ATTENDEE_EDIT_NONE);
        g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), E_MEETING_ATTENDEE_EDIT_NONE);
 
-       priv = ia->priv;
-
-       return priv->edit_level;
+       return ia->priv->edit_level;
 }
 
 void
 e_meeting_attendee_set_edit_level (EMeetingAttendee *ia,
                                    EMeetingAttendeeEditLevel level)
 {
-       EMeetingAttendeePrivate *priv;
-
-       g_return_if_fail (ia != NULL);
        g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       priv = ia->priv;
-
-       priv->edit_level = level;
+       ia->priv->edit_level = level;
 }
 
 static gint
@@ -707,23 +610,19 @@ compare_period_starts (gconstpointer arg1,
 static void
 ensure_periods_sorted (EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
-
-       if (priv->busy_periods_sorted)
+       if (ia->priv->busy_periods_sorted)
                return;
 
        qsort (
-               priv->busy_periods->data, priv->busy_periods->len,
+               ia->priv->busy_periods->data, ia->priv->busy_periods->len,
                sizeof (EMeetingFreeBusyPeriod),
                compare_period_starts);
 
-       priv->busy_periods_sorted = TRUE;
+       ia->priv->busy_periods_sorted = TRUE;
 }
 
 gboolean
-e_meeting_attendee_get_show_address (EMeetingAttendee *ia)
+e_meeting_attendee_get_show_address (const EMeetingAttendee *ia)
 {
        g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
@@ -745,48 +644,41 @@ e_meeting_attendee_set_show_address (EMeetingAttendee *ia,
 }
 
 gboolean
-e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia)
+e_meeting_attendee_get_has_calendar_info (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       return priv->has_calendar_info;
+       return ia->priv->has_calendar_info;
 }
 
 void
 e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia,
                                           gboolean has_calendar_info)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       priv->has_calendar_info = has_calendar_info;
+       ia->priv->has_calendar_info = has_calendar_info;
 }
 
 const GArray *
 e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), NULL);
 
        ensure_periods_sorted (ia);
 
-       return priv->busy_periods;
+       return ia->priv->busy_periods;
 }
 
 gint
 e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia,
-                                           GDate *date)
+                                          const GDate *date)
 {
-       EMeetingAttendeePrivate *priv;
        EMeetingFreeBusyPeriod *period;
        gint lower, upper, middle = 0, cmp = 0;
        GDate tmp_date;
 
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), -1);
 
        /* Make sure the busy periods have been sorted. */
        ensure_periods_sorted (ia);
@@ -794,11 +686,11 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia,
        /* Calculate the first day which could have a busy period which
         * continues onto our given date. */
        tmp_date = *date;
-       g_date_subtract_days (&tmp_date, priv->longest_period_in_days);
+       g_date_subtract_days (&tmp_date, ia->priv->longest_period_in_days);
 
        /* We want the first busy period which starts on tmp_date. */
        lower = 0;
-       upper = priv->busy_periods->len;
+       upper = ia->priv->busy_periods->len;
 
        if (upper == 0)
                return -1;
@@ -806,7 +698,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia,
        while (lower < upper) {
                middle = (lower + upper) >> 1;
 
-               period = &g_array_index (priv->busy_periods,
+               period = &g_array_index (ia->priv->busy_periods,
                                         EMeetingFreeBusyPeriod, middle);
 
                cmp = g_date_compare (&tmp_date, &period->start.date);
@@ -823,7 +715,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia,
         * backwards to the first one. */
        if (cmp == 0) {
                while (middle > 0) {
-                       period = &g_array_index (priv->busy_periods,
+                       period = &g_array_index (ia->priv->busy_periods,
                                                 EMeetingFreeBusyPeriod, middle - 1);
                        if (g_date_compare (&tmp_date, &period->start.date) != 0)
                                break;
@@ -834,7 +726,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia,
                 * the last one we looked at was before it, so if there are
                 * any more periods after this one we return it. */
                middle++;
-               if (priv->busy_periods->len <= middle)
+               if (ia->priv->busy_periods->len <= middle)
                        return -1;
        }
 
@@ -857,18 +749,14 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
                                     const gchar *summary,
                                     const gchar *location)
 {
-       EMeetingAttendeePrivate *priv;
        EMeetingFreeBusyPeriod period;
        gint period_in_days;
 
-       g_return_val_if_fail (ia != NULL, FALSE);
        g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
        g_return_val_if_fail (busy_type < E_MEETING_FREE_BUSY_LAST, FALSE);
        /* summary may be NULL (optional XFB data)  */
        /* location may be NULL (optional XFB data) */
 
-       priv = ia->priv;
-
        /* Check the dates are valid. */
        if (!g_date_valid_dmy (start_day, start_month, start_year))
                return FALSE;
@@ -902,31 +790,31 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
                goto done;
 
        /* If the busy range is not set elsewhere, track it as best we can */
-       if (!priv->start_busy_range_set) {
-               if (!g_date_valid (&priv->busy_periods_start.date)) {
-                       priv->busy_periods_start.date = period.start.date;
-                       priv->busy_periods_start.hour = period.start.hour;
-                       priv->busy_periods_start.minute = period.start.minute;
+       if (!ia->priv->start_busy_range_set) {
+               if (!g_date_valid (&ia->priv->busy_periods_start.date)) {
+                       ia->priv->busy_periods_start.date = period.start.date;
+                       ia->priv->busy_periods_start.hour = period.start.hour;
+                       ia->priv->busy_periods_start.minute = period.start.minute;
                } else {
                        gint compare;
 
                        compare = g_date_compare (
                                &period.start.date,
-                               &priv->busy_periods_start.date);
+                               &ia->priv->busy_periods_start.date);
 
                        switch (compare) {
                        case -1:
-                               priv->busy_periods_start.date = period.start.date;
-                               priv->busy_periods_start.hour = period.start.hour;
-                               priv->busy_periods_start.minute = period.start.minute;
+                               ia->priv->busy_periods_start.date = period.start.date;
+                               ia->priv->busy_periods_start.hour = period.start.hour;
+                               ia->priv->busy_periods_start.minute = period.start.minute;
                                break;
                        case 0:
-                               if (period.start.hour < priv->busy_periods_start.hour
-                                   || (period.start.hour == priv->busy_periods_start.hour
-                                       && period.start.minute < priv->busy_periods_start.minute)) {
-                                       priv->busy_periods_start.date = period.start.date;
-                                       priv->busy_periods_start.hour = period.start.hour;
-                                       priv->busy_periods_start.minute = period.start.minute;
+                               if (period.start.hour < ia->priv->busy_periods_start.hour
+                                   || (period.start.hour == ia->priv->busy_periods_start.hour
+                                       && period.start.minute < ia->priv->busy_periods_start.minute)) {
+                                       ia->priv->busy_periods_start.date = period.start.date;
+                                       ia->priv->busy_periods_start.hour = period.start.hour;
+                                       ia->priv->busy_periods_start.minute = period.start.minute;
                                        break;
                                }
                                break;
@@ -934,33 +822,33 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
                }
        }
 
-       if (!priv->end_busy_range_set) {
-               if (!g_date_valid (&priv->busy_periods_end.date)) {
-                       priv->busy_periods_end.date = period.end.date;
-                       priv->busy_periods_end.hour = period.end.hour;
-                       priv->busy_periods_end.minute = period.end.minute;
+       if (!ia->priv->end_busy_range_set) {
+               if (!g_date_valid (&ia->priv->busy_periods_end.date)) {
+                       ia->priv->busy_periods_end.date = period.end.date;
+                       ia->priv->busy_periods_end.hour = period.end.hour;
+                       ia->priv->busy_periods_end.minute = period.end.minute;
                } else {
                        gint compare;
 
                        compare = g_date_compare (
                                &period.end.date,
-                               &priv->busy_periods_end.date);
+                               &ia->priv->busy_periods_end.date);
 
                        switch (compare) {
                        case 0:
-                               if (period.end.hour > priv->busy_periods_end.hour
-                                   || (period.end.hour == priv->busy_periods_end.hour
-                                       && period.end.minute > priv->busy_periods_end.minute)) {
-                                       priv->busy_periods_end.date = period.end.date;
-                                       priv->busy_periods_end.hour = period.end.hour;
-                                       priv->busy_periods_end.minute = period.end.minute;
+                               if (period.end.hour > ia->priv->busy_periods_end.hour
+                                   || (period.end.hour == ia->priv->busy_periods_end.hour
+                                       && period.end.minute > ia->priv->busy_periods_end.minute)) {
+                                       ia->priv->busy_periods_end.date = period.end.date;
+                                       ia->priv->busy_periods_end.hour = period.end.hour;
+                                       ia->priv->busy_periods_end.minute = period.end.minute;
                                        break;
                                }
                                break;
                        case 1:
-                               priv->busy_periods_end.date = period.end.date;
-                               priv->busy_periods_end.hour = period.end.hour;
-                               priv->busy_periods_end.minute = period.end.minute;
+                               ia->priv->busy_periods_end.date = period.end.date;
+                               ia->priv->busy_periods_end.hour = period.end.hour;
+                               ia->priv->busy_periods_end.minute = period.end.minute;
                                break;
                        }
                }
@@ -970,39 +858,47 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
        e_meeting_xfb_data_init (&(period.xfb));
        e_meeting_xfb_data_set (&(period.xfb), summary, location);
 
-       g_array_append_val (priv->busy_periods, period);
+       g_array_append_val (ia->priv->busy_periods, period);
 
        period_in_days =
                g_date_get_julian (&period.end.date) -
                g_date_get_julian (&period.start.date) + 1;
-       priv->longest_period_in_days =
-               MAX (priv->longest_period_in_days, period_in_days);
+       ia->priv->longest_period_in_days =
+               MAX (ia->priv->longest_period_in_days, period_in_days);
 
 done:
-       priv->has_calendar_info = TRUE;
-       priv->busy_periods_sorted = FALSE;
+       ia->priv->has_calendar_info = TRUE;
+       ia->priv->busy_periods_sorted = FALSE;
 
        return TRUE;
 }
 
 EMeetingTime
-e_meeting_attendee_get_start_busy_range (EMeetingAttendee *ia)
+e_meeting_attendee_get_start_busy_range (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       EMeetingTime mt;
+
+       g_date_clear (&mt.date, 1);
+       mt.hour = 0;
+       mt.minute = 0;
 
-       priv = ia->priv;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), mt);
 
-       return priv->busy_periods_start;
+       return ia->priv->busy_periods_start;
 }
 
 EMeetingTime
-e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia)
+e_meeting_attendee_get_end_busy_range (const EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
+       EMeetingTime mt;
 
-       priv = ia->priv;
+       g_date_clear (&mt.date, 1);
+       mt.hour = 0;
+       mt.minute = 0;
 
-       return priv->busy_periods_end;
+       g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), mt);
+
+       return ia->priv->busy_periods_end;
 }
 
 gboolean
@@ -1013,12 +909,8 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia,
                                          gint start_hour,
                                          gint start_minute)
 {
-       EMeetingAttendeePrivate *priv;
-
        g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       priv = ia->priv;
-
        /* Check the dates are valid. */
        if (!g_date_valid_dmy (start_day, start_month, start_year))
                return FALSE;
@@ -1027,14 +919,14 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia,
        if (start_minute < 0 || start_minute > 59)
                return FALSE;
 
-       g_date_clear (&priv->busy_periods_start.date, 1);
+       g_date_clear (&ia->priv->busy_periods_start.date, 1);
        g_date_set_dmy (
-               &priv->busy_periods_start.date,
+               &ia->priv->busy_periods_start.date,
                start_day, start_month, start_year);
-       priv->busy_periods_start.hour = start_hour;
-       priv->busy_periods_start.minute = start_minute;
+       ia->priv->busy_periods_start.hour = start_hour;
+       ia->priv->busy_periods_start.minute = start_minute;
 
-       priv->start_busy_range_set = TRUE;
+       ia->priv->start_busy_range_set = TRUE;
 
        return TRUE;
 }
@@ -1047,12 +939,8 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
                                        gint end_hour,
                                        gint end_minute)
 {
-       EMeetingAttendeePrivate *priv;
-
        g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
 
-       priv = ia->priv;
-
        /* Check the dates are valid. */
        if (!g_date_valid_dmy (end_day, end_month, end_year))
                return FALSE;
@@ -1061,14 +949,14 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
        if (end_minute < 0 || end_minute > 59)
                return FALSE;
 
-       g_date_clear (&priv->busy_periods_end.date, 1);
+       g_date_clear (&ia->priv->busy_periods_end.date, 1);
        g_date_set_dmy (
-               &priv->busy_periods_end.date,
+               &ia->priv->busy_periods_end.date,
                end_day, end_month, end_year);
-       priv->busy_periods_end.hour = end_hour;
-       priv->busy_periods_end.minute = end_minute;
+       ia->priv->busy_periods_end.hour = end_hour;
+       ia->priv->busy_periods_end.minute = end_minute;
 
-       priv->end_busy_range_set = TRUE;
+       ia->priv->end_busy_range_set = TRUE;
 
        return TRUE;
 }
@@ -1077,22 +965,18 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
 void
 e_meeting_attendee_clear_busy_periods (EMeetingAttendee *ia)
 {
-       EMeetingAttendeePrivate *priv;
-
        g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
 
-       priv = ia->priv;
+       g_array_set_size (ia->priv->busy_periods, 0);
+       ia->priv->busy_periods_sorted = TRUE;
 
-       g_array_set_size (priv->busy_periods, 0);
-       priv->busy_periods_sorted = TRUE;
-
-       g_date_clear (&priv->busy_periods_start.date, 1);
-       priv->busy_periods_start.hour = 0;
-       priv->busy_periods_start.minute = 0;
+       g_date_clear (&ia->priv->busy_periods_start.date, 1);
+       ia->priv->busy_periods_start.hour = 0;
+       ia->priv->busy_periods_start.minute = 0;
 
-       g_date_clear (&priv->busy_periods_end.date, 1);
-       priv->busy_periods_end.hour = 0;
-       priv->busy_periods_end.minute = 0;
+       g_date_clear (&ia->priv->busy_periods_end.date, 1);
+       ia->priv->busy_periods_end.hour = 0;
+       ia->priv->busy_periods_end.minute = 0;
 
-       priv->longest_period_in_days = 0;
+       ia->priv->longest_period_in_days = 0;
 }
diff --git a/src/calendar/gui/e-meeting-attendee.h b/src/calendar/gui/e-meeting-attendee.h
index a345ff6b42..1e6bd839b6 100644
--- a/src/calendar/gui/e-meeting-attendee.h
+++ b/src/calendar/gui/e-meeting-attendee.h
@@ -44,11 +44,11 @@ typedef struct _EMeetingAttendeeClass    EMeetingAttendeeClass;
  * meeting room). These are used for the Autopick options, where the user can
  * ask for a time when, for example, all people and one resource are free.
  * The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */
-typedef enum
-{
+typedef enum {
        E_MEETING_ATTENDEE_REQUIRED_PERSON,
        E_MEETING_ATTENDEE_OPTIONAL_PERSON,
-       E_MEETING_ATTENDEE_RESOURCE
+       E_MEETING_ATTENDEE_RESOURCE,
+       E_MEETING_ATTENDEE_RESOURCE_UNKNOWN
 } EMeetingAttendeeType;
 
 typedef enum
@@ -70,101 +70,122 @@ struct _EMeetingAttendeeClass {
        void (* changed) (EMeetingAttendee *ia);
 };
 
-
-GType      e_meeting_attendee_get_type (void);
-GObject   *e_meeting_attendee_new      (void);
-GObject   *e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca);
-
-ECalComponentAttendee *e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_address (EMeetingAttendee *ia);
-void e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address);
-gboolean e_meeting_attendee_is_set_address (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_member (EMeetingAttendee *ia);
-void e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member);
-gboolean e_meeting_attendee_is_set_member (EMeetingAttendee *ia);
-
-icalparameter_cutype e_meeting_attendee_get_cutype (EMeetingAttendee *ia);
-void e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype);
-
-icalparameter_role e_meeting_attendee_get_role (EMeetingAttendee *ia);
-void e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role);
-
-gboolean e_meeting_attendee_get_rsvp (EMeetingAttendee *ia);
-void e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp);
-
-const gchar *e_meeting_attendee_get_delto (EMeetingAttendee *ia);
-void e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto);
-gboolean e_meeting_attendee_is_set_delto (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_delfrom (EMeetingAttendee *ia);
-void e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom);
-gboolean e_meeting_attendee_is_set_delfrom (EMeetingAttendee *ia);
-
-icalparameter_partstat e_meeting_attendee_get_status (EMeetingAttendee *ia);
-void e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status);
-
-const gchar *e_meeting_attendee_get_sentby (EMeetingAttendee *ia);
-void e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby);
-gboolean e_meeting_attendee_is_set_sentby (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_cn (EMeetingAttendee *ia);
-void e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn);
-gboolean e_meeting_attendee_is_set_cn (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_language (EMeetingAttendee *ia);
-void e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language);
-gboolean e_meeting_attendee_is_set_language (EMeetingAttendee *ia);
-
-EMeetingAttendeeType e_meeting_attendee_get_atype (EMeetingAttendee *ia);
-
-EMeetingAttendeeEditLevel e_meeting_attendee_get_edit_level (EMeetingAttendee *ia);
-void e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEditLevel level);
-
-gboolean e_meeting_attendee_get_show_address (EMeetingAttendee *ia);
-void e_meeting_attendee_set_show_address (EMeetingAttendee *ia, gboolean show_address);
-
-gboolean e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia);
-void e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info);
-
-const gchar * e_meeting_attendee_get_fburi (EMeetingAttendee *ia);
-void e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi);
-
-const GArray *e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia);
-gint e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date);
-gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
-                                       gint start_year,
-                                       gint start_month,
-                                       gint start_day,
-                                       gint start_hour,
-                                       gint start_minute,
-                                       gint end_year,
-                                       gint end_month,
-                                       gint end_day,
-                                       gint end_hour,
-                                       gint end_minute,
-                                       EMeetingFreeBusyType busy_type,
-                                       const gchar *summary,
-                                       const gchar *location);
-
-EMeetingTime e_meeting_attendee_get_start_busy_range (EMeetingAttendee *ia);
-EMeetingTime e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia);
-
-gboolean e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia,
-                                                 gint start_year,
-                                                 gint start_month,
-                                                 gint start_day,
-                                                 gint start_hour,
-                                                 gint start_minute);
-gboolean e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
-                                               gint end_year,
-                                               gint end_month,
-                                               gint end_day,
-                                               gint end_hour,
-                                               gint end_minute);
-
-void e_meeting_attendee_clear_busy_periods (EMeetingAttendee *ia);
+GType          e_meeting_attendee_get_type     (void);
+GObject *      e_meeting_attendee_new          (void);
+GObject *      e_meeting_attendee_new_from_e_cal_component_attendee
+                                               (const ECalComponentAttendee *ca);
+
+ECalComponentAttendee *
+               e_meeting_attendee_as_e_cal_component_attendee
+                                               (const EMeetingAttendee *ia);
+
+const gchar *  e_meeting_attendee_get_address  (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_address  (EMeetingAttendee *ia,
+                                                const gchar *address);
+gboolean       e_meeting_attendee_is_set_address
+                                               (const EMeetingAttendee *ia);
+const gchar *  e_meeting_attendee_get_member   (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_member   (EMeetingAttendee *ia,
+                                                const gchar *member);
+gboolean       e_meeting_attendee_is_set_member(const EMeetingAttendee *ia);
+ICalParameterCutype
+               e_meeting_attendee_get_cutype   (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_cutype   (EMeetingAttendee *ia,
+                                                ICalParameterCutype cutype);
+ICalParameterRole
+               e_meeting_attendee_get_role     (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_role     (EMeetingAttendee *ia,
+                                                ICalParameterRole role);
+gboolean       e_meeting_attendee_get_rsvp     (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_rsvp     (EMeetingAttendee *ia,
+                                                gboolean rsvp);
+const gchar *  e_meeting_attendee_get_delto    (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_delto    (EMeetingAttendee *ia,
+                                                const gchar *delto);
+gboolean       e_meeting_attendee_is_set_delto (const EMeetingAttendee *ia);
+const gchar *  e_meeting_attendee_get_delfrom  (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_delfrom  (EMeetingAttendee *ia,
+                                                const gchar *delfrom);
+gboolean       e_meeting_attendee_is_set_delfrom
+                                               (const EMeetingAttendee *ia);
+ICalParameterPartstat
+               e_meeting_attendee_get_partstat (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_partstat (EMeetingAttendee *ia,
+                                                ICalParameterPartstat partstat);
+const gchar *  e_meeting_attendee_get_sentby   (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_sentby   (EMeetingAttendee *ia,
+                                                const gchar *sentby);
+gboolean       e_meeting_attendee_is_set_sentby(const EMeetingAttendee *ia);
+const gchar *  e_meeting_attendee_get_cn       (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_cn       (EMeetingAttendee *ia,
+                                                const gchar *cn);
+gboolean       e_meeting_attendee_is_set_cn    (const EMeetingAttendee *ia);
+const gchar *  e_meeting_attendee_get_language (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_language (EMeetingAttendee *ia,
+                                                const gchar *language);
+gboolean       e_meeting_attendee_is_set_language
+                                               (const EMeetingAttendee *ia);
+EMeetingAttendeeType
+               e_meeting_attendee_get_atype    (const EMeetingAttendee *ia);
+EMeetingAttendeeEditLevel
+               e_meeting_attendee_get_edit_level
+                                               (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_edit_level
+                                               (EMeetingAttendee *ia,
+                                                EMeetingAttendeeEditLevel level);
+gboolean       e_meeting_attendee_get_show_address
+                                               (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_show_address
+                                               (EMeetingAttendee *ia,
+                                                gboolean show_address);
+gboolean       e_meeting_attendee_get_has_calendar_info
+                                               (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_has_calendar_info
+                                               (EMeetingAttendee *ia,
+                                                gboolean has_calendar_info);
+const gchar *  e_meeting_attendee_get_fburi    (const EMeetingAttendee *ia);
+void           e_meeting_attendee_set_fburi    (EMeetingAttendee *ia,
+                                                const gchar *fburi);
+const GArray * e_meeting_attendee_get_busy_periods
+                                               (EMeetingAttendee *ia);
+gint           e_meeting_attendee_find_first_busy_period
+                                               (EMeetingAttendee *ia,
+                                                const GDate *date);
+gboolean       e_meeting_attendee_add_busy_period
+                                               (EMeetingAttendee *ia,
+                                                gint start_year,
+                                                gint start_month,
+                                                gint start_day,
+                                                gint start_hour,
+                                                gint start_minute,
+                                                gint end_year,
+                                                gint end_month,
+                                                gint end_day,
+                                                gint end_hour,
+                                                gint end_minute,
+                                                EMeetingFreeBusyType busy_type,
+                                                const gchar *summary,
+                                                const gchar *location);
+EMeetingTime   e_meeting_attendee_get_start_busy_range
+                                               (const EMeetingAttendee *ia);
+EMeetingTime   e_meeting_attendee_get_end_busy_range
+                                               (const EMeetingAttendee *ia);
+gboolean       e_meeting_attendee_set_start_busy_range
+                                               (EMeetingAttendee *ia,
+                                                gint start_year,
+                                                gint start_month,
+                                                gint start_day,
+                                                gint start_hour,
+                                                gint start_minute);
+gboolean       e_meeting_attendee_set_end_busy_range
+                                               (EMeetingAttendee *ia,
+                                                gint end_year,
+                                                gint end_month,
+                                                gint end_day,
+                                                gint end_hour,
+                                                gint end_minute);
+void           e_meeting_attendee_clear_busy_periods
+                                               (EMeetingAttendee *ia);
 
 G_END_DECLS
 
diff --git a/src/calendar/gui/e-meeting-list-view.c b/src/calendar/gui/e-meeting-list-view.c
index 8b4b67b62b..9c4ebbd669 100644
--- a/src/calendar/gui/e-meeting-list-view.c
+++ b/src/calendar/gui/e-meeting-list-view.c
@@ -65,11 +65,11 @@ static const gchar *sections[] = {N_("Chair Persons"),
                                  N_("Resources"),
                                  NULL};
 
-static icalparameter_role roles[] = {ICAL_ROLE_CHAIR,
-                                    ICAL_ROLE_REQPARTICIPANT,
-                                    ICAL_ROLE_OPTPARTICIPANT,
-                                    ICAL_ROLE_NONPARTICIPANT,
-                                    ICAL_ROLE_NONE};
+static ICalParameterRole roles[] = { I_CAL_ROLE_CHAIR,
+                                    I_CAL_ROLE_REQPARTICIPANT,
+                                    I_CAL_ROLE_OPTPARTICIPANT,
+                                    I_CAL_ROLE_NONPARTICIPANT,
+                                    I_CAL_ROLE_NONE };
 
 G_DEFINE_TYPE (EMeetingListView, e_meeting_list_view, GTK_TYPE_TREE_VIEW)
 
@@ -239,16 +239,16 @@ value_edited (GtkTreeView *view,
 }
 
 static guint
-get_index_from_role (icalparameter_role role)
+get_index_from_role (ICalParameterRole role)
 {
        switch (role)   {
-               case ICAL_ROLE_CHAIR:
+               case I_CAL_ROLE_CHAIR:
                        return 0;
-               case ICAL_ROLE_REQPARTICIPANT:
+               case I_CAL_ROLE_REQPARTICIPANT:
                        return 1;
-               case ICAL_ROLE_OPTPARTICIPANT:
+               case I_CAL_ROLE_OPTPARTICIPANT:
                        return 2;
-               case ICAL_ROLE_NONPARTICIPANT:
+               case I_CAL_ROLE_NONPARTICIPANT:
                        return 3;
                default:
                        return 1;
@@ -368,7 +368,7 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                gboolean can_remove = TRUE;
 
                for (l = addresses, m = names; l && m; l = l->next, m = m->next) {
-                       gchar *name = m->data, *email = l->data;
+                       gchar *name = m->data, *email = l->data, *mailto;
 
                        if (!((name && *name) || (email && *email)))
                                        continue;
@@ -381,15 +381,17 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                        }
 
                        attendee = e_meeting_store_add_attendee_with_defaults (model);
-                       e_meeting_attendee_set_address (attendee, g_strdup_printf ("mailto:%s";, (gchar *) 
l->data));
-                       e_meeting_attendee_set_cn (attendee, g_strdup (m->data));
+                       mailto = g_strdup_printf ("mailto:%s";, (gchar *) l->data);
+                       e_meeting_attendee_set_address (attendee, mailto);
+                       g_free (mailto);
+                       e_meeting_attendee_set_cn (attendee, m->data);
                        if (existing_attendee) {
                                e_meeting_attendee_set_cutype (attendee, e_meeting_attendee_get_cutype 
(existing_attendee));
                                e_meeting_attendee_set_role (attendee, e_meeting_attendee_get_role 
(existing_attendee));
                                e_meeting_attendee_set_rsvp (attendee, e_meeting_attendee_get_rsvp 
(existing_attendee));
-                               e_meeting_attendee_set_status (attendee, ICAL_PARTSTAT_NEEDSACTION);
-                               e_meeting_attendee_set_delfrom (attendee, g_strdup 
(e_meeting_attendee_get_delfrom (existing_attendee)));
-                               e_meeting_attendee_set_fburi (attendee, g_strdup 
(e_meeting_attendee_get_fburi (existing_attendee)));
+                               e_meeting_attendee_set_partstat (attendee, I_CAL_PARTSTAT_NEEDSACTION);
+                               e_meeting_attendee_set_delfrom (attendee, e_meeting_attendee_get_delfrom 
(existing_attendee));
+                               e_meeting_attendee_set_fburi (attendee, e_meeting_attendee_get_fburi 
(existing_attendee));
                                e_meeting_attendee_set_show_address (attendee, 
e_meeting_attendee_get_show_address (existing_attendee));
                        }
                        e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), 
attendee);
@@ -414,6 +416,7 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                        gboolean show_address = FALSE;
                        EMeetingAttendee *attendee;
                        EDestination *destination;
+                       gchar *mailto;
 
                        if (existing_attendee) {
                                const gchar *addr = e_meeting_attendee_get_address (existing_attendee);
@@ -432,9 +435,11 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                        value_edited (view, E_MEETING_STORE_ADDRESS_COL, path, email);
                        value_edited (view, E_MEETING_STORE_CN_COL, path, name);
 
-                       e_meeting_attendee_set_address (attendee, g_strdup_printf ("mailto:%s";, email));
-                       e_meeting_attendee_set_cn (attendee, g_strdup (name));
-                       e_meeting_attendee_set_role (attendee, ICAL_ROLE_REQPARTICIPANT);
+                       mailto = g_strdup_printf ("mailto:%s";, email);
+                       e_meeting_attendee_set_address (attendee, mailto);
+                       g_free (mailto);
+                       e_meeting_attendee_set_cn (attendee, name);
+                       e_meeting_attendee_set_role (attendee, I_CAL_ROLE_REQPARTICIPANT);
 
                        destination = e_select_names_renderer_get_destination (E_SELECT_NAMES_RENDERER 
(renderer));
                        if (destination) {
@@ -447,8 +452,7 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                                        fburi = e_contact_get (contact, E_CONTACT_FREEBUSY_URL);
                                        if (fburi && *fburi)
                                                e_meeting_attendee_set_fburi (attendee, fburi);
-                                       else
-                                               g_free (fburi);
+                                       g_free (fburi);
 
                                        if (!e_contact_get (contact, E_CONTACT_IS_LIST)) {
                                                GList *email_list;
@@ -466,7 +470,7 @@ attendee_edited_cb (GtkCellRenderer *renderer,
                        e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), 
attendee);
 
                        if (address_changed)
-                               e_meeting_attendee_set_status (attendee, ICAL_PARTSTAT_NEEDSACTION);
+                               e_meeting_attendee_set_partstat (attendee, I_CAL_PARTSTAT_NEEDSACTION);
 
                        g_signal_emit_by_name (view, "attendee_added", (gpointer) attendee);
                }
@@ -875,7 +879,7 @@ e_meeting_list_view_edit (EMeetingListView *emlv,
 static void
 process_section (EMeetingListView *view,
                  GList *destinations,
-                 icalparameter_role role,
+                 ICalParameterRole role,
                  GSList **la)
 {
        EMeetingListViewPrivate *priv;
@@ -1000,18 +1004,19 @@ process_section (EMeetingListView *view,
 
                        if (e_meeting_store_find_attendee (priv->store, email_addr, NULL) == NULL) {
                                EMeetingAttendee *ia = e_meeting_store_add_attendee_with_defaults 
(priv->store);
+                               gchar *mailto;
 
-                               e_meeting_attendee_set_address (ia, g_strdup_printf ("mailto:%s";, 
email_addr));
+                               mailto = g_strdup_printf ("mailto:%s";, email_addr);
+                               e_meeting_attendee_set_address (ia, mailto);
+                               g_free (mailto);
                                e_meeting_attendee_set_role (ia, role);
-                               if (role == ICAL_ROLE_NONPARTICIPANT)
-                                       e_meeting_attendee_set_cutype (ia, ICAL_CUTYPE_RESOURCE);
-                               e_meeting_attendee_set_cn (ia, g_strdup (name));
+                               if (role == I_CAL_ROLE_NONPARTICIPANT)
+                                       e_meeting_attendee_set_cutype (ia, I_CAL_CUTYPE_RESOURCE);
+                               e_meeting_attendee_set_cn (ia, name);
                                e_meeting_attendee_set_show_address (ia, show_address);
 
-                               if (fburi) {
+                               if (fburi)
                                        e_meeting_attendee_set_fburi (ia, fburi);
-                                       fburi = NULL;
-                               }
                        } else {
                                if (g_slist_length (*la) == 1) {
                                        g_slist_free (*la);
diff --git a/src/calendar/gui/e-meeting-store.c b/src/calendar/gui/e-meeting-store.c
index 02c8766285..815f55719a 100644
--- a/src/calendar/gui/e-meeting-store.c
+++ b/src/calendar/gui/e-meeting-store.c
@@ -49,7 +49,7 @@ struct _EMeetingStorePrivate {
        gint stamp;
 
        ECalClient *client;
-       icaltimezone *zone;
+       ICalTimezone *zone;
 
        gint default_reminder_interval;
        EDurationType default_reminder_units;
@@ -104,32 +104,32 @@ G_DEFINE_TYPE_WITH_CODE (
        G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL)
        G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, ems_tree_model_init))
 
-static icalparameter_cutype
+static ICalParameterCutype
 text_to_type (const gchar *type)
 {
        if (!e_util_utf8_strcasecmp (type, _("Individual")))
-               return ICAL_CUTYPE_INDIVIDUAL;
+               return I_CAL_CUTYPE_INDIVIDUAL;
        else if (!e_util_utf8_strcasecmp (type, _("Group")))
-               return ICAL_CUTYPE_GROUP;
+               return I_CAL_CUTYPE_GROUP;
        else if (!e_util_utf8_strcasecmp (type, _("Resource")))
-               return ICAL_CUTYPE_RESOURCE;
+               return I_CAL_CUTYPE_RESOURCE;
        else if (!e_util_utf8_strcasecmp (type, _("Room")))
-               return ICAL_CUTYPE_ROOM;
+               return I_CAL_CUTYPE_ROOM;
        else
-               return ICAL_CUTYPE_NONE;
+               return I_CAL_CUTYPE_NONE;
 }
 
 static gchar *
-type_to_text (icalparameter_cutype type)
+type_to_text (ICalParameterCutype type)
 {
        switch (type) {
-       case ICAL_CUTYPE_INDIVIDUAL:
+       case I_CAL_CUTYPE_INDIVIDUAL:
                return _("Individual");
-       case ICAL_CUTYPE_GROUP:
+       case I_CAL_CUTYPE_GROUP:
                return _("Group");
-       case ICAL_CUTYPE_RESOURCE:
+       case I_CAL_CUTYPE_RESOURCE:
                return _("Resource");
-       case ICAL_CUTYPE_ROOM:
+       case I_CAL_CUTYPE_ROOM:
                return _("Room");
        default:
                return _("Unknown");
@@ -139,32 +139,32 @@ type_to_text (icalparameter_cutype type)
 
 }
 
-static icalparameter_role
+static ICalParameterRole
 text_to_role (const gchar *role)
 {
        if (!e_util_utf8_strcasecmp (role, _("Chair")))
-               return ICAL_ROLE_CHAIR;
+               return I_CAL_ROLE_CHAIR;
        else if (!e_util_utf8_strcasecmp (role, _("Required Participant")))
-               return ICAL_ROLE_REQPARTICIPANT;
+               return I_CAL_ROLE_REQPARTICIPANT;
        else if (!e_util_utf8_strcasecmp (role, _("Optional Participant")))
-               return ICAL_ROLE_OPTPARTICIPANT;
+               return I_CAL_ROLE_OPTPARTICIPANT;
        else if (!e_util_utf8_strcasecmp (role, _("Non-Participant")))
-               return ICAL_ROLE_NONPARTICIPANT;
+               return I_CAL_ROLE_NONPARTICIPANT;
        else
-               return ICAL_ROLE_NONE;
+               return I_CAL_ROLE_NONE;
 }
 
 static gchar *
-role_to_text (icalparameter_role role)
+role_to_text (ICalParameterRole role)
 {
        switch (role) {
-       case ICAL_ROLE_CHAIR:
+       case I_CAL_ROLE_CHAIR:
                return _("Chair");
-       case ICAL_ROLE_REQPARTICIPANT:
+       case I_CAL_ROLE_REQPARTICIPANT:
                return _("Required Participant");
-       case ICAL_ROLE_OPTPARTICIPANT:
+       case I_CAL_ROLE_OPTPARTICIPANT:
                return _("Optional Participant");
-       case ICAL_ROLE_NONPARTICIPANT:
+       case I_CAL_ROLE_NONPARTICIPANT:
                return _("Non-Participant");
        default:
                return _("Unknown");
@@ -189,46 +189,46 @@ boolean_to_text (gboolean b)
                return _("No");
 }
 
-static icalparameter_partstat
+static ICalParameterPartstat
 text_to_partstat (const gchar *partstat)
 {
        if (!e_util_utf8_strcasecmp (partstat, _("Needs Action")))
-               return ICAL_PARTSTAT_NEEDSACTION;
+               return I_CAL_PARTSTAT_NEEDSACTION;
        else if (!e_util_utf8_strcasecmp (partstat, _("Accepted")))
-               return ICAL_PARTSTAT_ACCEPTED;
+               return I_CAL_PARTSTAT_ACCEPTED;
        else if (!e_util_utf8_strcasecmp (partstat, _("Declined")))
-               return ICAL_PARTSTAT_DECLINED;
+               return I_CAL_PARTSTAT_DECLINED;
        else if (!e_util_utf8_strcasecmp (partstat, _("Tentative")))
-               return ICAL_PARTSTAT_TENTATIVE;
+               return I_CAL_PARTSTAT_TENTATIVE;
        else if (!e_util_utf8_strcasecmp (partstat, _("Delegated")))
-               return ICAL_PARTSTAT_DELEGATED;
+               return I_CAL_PARTSTAT_DELEGATED;
        else if (!e_util_utf8_strcasecmp (partstat, _("Completed")))
-               return ICAL_PARTSTAT_COMPLETED;
+               return I_CAL_PARTSTAT_COMPLETED;
        else if (!e_util_utf8_strcasecmp (partstat, _("In Process")))
-               return ICAL_PARTSTAT_INPROCESS;
+               return I_CAL_PARTSTAT_INPROCESS;
        else
-               return ICAL_PARTSTAT_NONE;
+               return I_CAL_PARTSTAT_NONE;
 }
 
 static gchar *
-partstat_to_text (icalparameter_partstat partstat)
+partstat_to_text (ICalParameterPartstat partstat)
 {
        switch (partstat) {
-       case ICAL_PARTSTAT_NEEDSACTION:
+       case I_CAL_PARTSTAT_NEEDSACTION:
                return _("Needs Action");
-       case ICAL_PARTSTAT_ACCEPTED:
+       case I_CAL_PARTSTAT_ACCEPTED:
                return _("Accepted");
-       case ICAL_PARTSTAT_DECLINED:
+       case I_CAL_PARTSTAT_DECLINED:
                return _("Declined");
-       case ICAL_PARTSTAT_TENTATIVE:
+       case I_CAL_PARTSTAT_TENTATIVE:
                return _("Tentative");
-       case ICAL_PARTSTAT_DELEGATED:
+       case I_CAL_PARTSTAT_DELEGATED:
                return _("Delegated");
-       case ICAL_PARTSTAT_COMPLETED:
+       case I_CAL_PARTSTAT_COMPLETED:
                return _("Completed");
-       case ICAL_PARTSTAT_INPROCESS:
+       case I_CAL_PARTSTAT_INPROCESS:
                return _("In Process");
-       case ICAL_PARTSTAT_NONE:
+       case I_CAL_PARTSTAT_NONE:
        default:
                return _("Unknown");
        }
@@ -384,7 +384,7 @@ get_value (GtkTreeModel *model,
                g_value_init (value, G_TYPE_STRING);
                g_value_set_string (
                        value, partstat_to_text (
-                       e_meeting_attendee_get_status (attendee)));
+                       e_meeting_attendee_get_partstat (attendee)));
                break;
        case E_MEETING_STORE_CN_COL:
                g_value_init (value, G_TYPE_STRING);
@@ -535,24 +535,27 @@ e_meeting_store_set_value (EMeetingStore *store,
                            gint col,
                            const gchar *val)
 {
-       icalparameter_cutype type;
+       ICalParameterCutype cutype;
        EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, row);
 
        switch (col) {
        case E_MEETING_STORE_ADDRESS_COL:
-               if (val != NULL && *((gchar *) val))
-                       e_meeting_attendee_set_address (
-                               attendee, g_strdup_printf (
-                               "mailto:%s";, (gchar *) val));
+               if (val != NULL && *((gchar *) val)) {
+                       gchar *mailto;
+
+                       mailto = g_strdup_printf ("mailto:%s";, (const gchar *) val);
+                       e_meeting_attendee_set_address (attendee, mailto);
+                       g_free (mailto);
+               }
                break;
        case E_MEETING_STORE_MEMBER_COL:
-               e_meeting_attendee_set_member (attendee, g_strdup (val));
+               e_meeting_attendee_set_member (attendee, val);
                break;
        case E_MEETING_STORE_TYPE_COL:
-               type = text_to_type (val);
-               e_meeting_attendee_set_cutype (attendee, text_to_type (val));
-               if (type == ICAL_CUTYPE_RESOURCE) {
-                       e_meeting_attendee_set_role (attendee, ICAL_ROLE_NONPARTICIPANT);
+               cutype = text_to_type (val);
+               e_meeting_attendee_set_cutype (attendee, cutype);
+               if (cutype == I_CAL_CUTYPE_RESOURCE) {
+                       e_meeting_attendee_set_role (attendee, I_CAL_ROLE_NONPARTICIPANT);
                }
                break;
        case E_MEETING_STORE_ROLE_COL:
@@ -562,19 +565,19 @@ e_meeting_store_set_value (EMeetingStore *store,
                e_meeting_attendee_set_rsvp (attendee, text_to_boolean (val));
                break;
        case E_MEETING_STORE_DELTO_COL:
-               e_meeting_attendee_set_delto (attendee, g_strdup (val));
+               e_meeting_attendee_set_delto (attendee, val);
                break;
        case E_MEETING_STORE_DELFROM_COL:
-               e_meeting_attendee_set_delfrom (attendee, g_strdup (val));
+               e_meeting_attendee_set_delfrom (attendee, val);
                break;
        case E_MEETING_STORE_STATUS_COL:
-               e_meeting_attendee_set_status (attendee, text_to_partstat (val));
+               e_meeting_attendee_set_partstat (attendee, text_to_partstat (val));
                break;
        case E_MEETING_STORE_CN_COL:
-               e_meeting_attendee_set_cn (attendee, g_strdup (val));
+               e_meeting_attendee_set_cn (attendee, val);
                break;
        case E_MEETING_STORE_LANGUAGE_COL:
-               e_meeting_attendee_set_language (attendee, g_strdup (val));
+               e_meeting_attendee_set_language (attendee, val);
                break;
        }
 }
@@ -776,6 +779,8 @@ meeting_store_finalize (GObject *object)
 
        g_free (priv->fb_uri);
 
+       g_clear_object (&priv->zone);
+
        g_mutex_clear (&priv->mutex);
 
        /* Chain up to parent's finalize() method. */
@@ -977,7 +982,7 @@ e_meeting_store_set_free_busy_template (EMeetingStore *store,
        g_object_notify (G_OBJECT (store), "free-busy-template");
 }
 
-icaltimezone *
+ICalTimezone *
 e_meeting_store_get_timezone (EMeetingStore *store)
 {
        g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
@@ -987,14 +992,15 @@ e_meeting_store_get_timezone (EMeetingStore *store)
 
 void
 e_meeting_store_set_timezone (EMeetingStore *store,
-                              icaltimezone *timezone)
+                             const ICalTimezone *timezone)
 {
        g_return_if_fail (E_IS_MEETING_STORE (store));
 
        if (store->priv->zone == timezone)
                return;
 
-       store->priv->zone = timezone;
+       g_clear_object (&store->priv->zone);
+       store->priv->zone = e_cal_util_copy_timezone (timezone);
 
        g_object_notify (G_OBJECT (store), "timezone");
 }
@@ -1078,8 +1084,8 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store)
 
        attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
 
-       e_meeting_attendee_set_address (attendee, g_strdup (""));
-       e_meeting_attendee_set_member (attendee, g_strdup (""));
+       e_meeting_attendee_set_address (attendee, "");
+       e_meeting_attendee_set_member (attendee, "");
 
        str = g_strdup (_("Individual"));
        e_meeting_attendee_set_cutype (attendee, text_to_type (str));
@@ -1091,15 +1097,15 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store)
        e_meeting_attendee_set_rsvp (attendee, text_to_boolean (str));
        g_free (str);
 
-       e_meeting_attendee_set_delto (attendee, g_strdup (""));
-       e_meeting_attendee_set_delfrom (attendee, g_strdup (""));
+       e_meeting_attendee_set_delto (attendee, "");
+       e_meeting_attendee_set_delfrom (attendee, "");
 
        str = g_strdup (_("Needs Action"));
-       e_meeting_attendee_set_status (attendee, text_to_partstat (str));
+       e_meeting_attendee_set_partstat (attendee, text_to_partstat (str));
        g_free (str);
 
-       e_meeting_attendee_set_cn (attendee, g_strdup (""));
-       e_meeting_attendee_set_language (attendee, g_strdup ("en"));
+       e_meeting_attendee_set_cn (attendee, "");
+       e_meeting_attendee_set_language (attendee, "en");
 
        e_meeting_store_add_attendee (store, attendee);
 
@@ -1308,44 +1314,57 @@ e_meeting_store_get_attendees (EMeetingStore *store)
        return store->priv->attendees;
 }
 
-static icaltimezone *
-find_zone (icalproperty *ip,
-           icalcomponent *tz_top_level)
+static ICalTimezone *
+find_zone (ICalProperty *in_prop,
+          ICalComponent *tz_top_level)
 {
-       icalparameter *param;
-       icalcomponent *sub_comp;
+       ICalParameter *param;
+       ICalComponent *subcomp;
        const gchar *tzid;
-       icalcompiter iter;
+       ICalCompIter *iter;
 
        if (tz_top_level == NULL)
                return NULL;
 
-       param = icalproperty_get_first_parameter (ip, ICAL_TZID_PARAMETER);
+       param = i_cal_property_get_first_parameter (in_prop, I_CAL_TZID_PARAMETER);
        if (param == NULL)
                return NULL;
-       tzid = icalparameter_get_tzid (param);
+       tzid = i_cal_parameter_get_tzid (param);
+
+       iter = i_cal_component_begin_component (tz_top_level, I_CAL_VTIMEZONE_COMPONENT);
+       subcomp = i_cal_comp_iter_deref (iter);
+       while (subcomp) {
+               ICalComponent *next_subcomp;
+               ICalProperty *prop;
+
+               next_subcomp = i_cal_comp_iter_next (iter);
 
-       iter = icalcomponent_begin_component (tz_top_level, ICAL_VTIMEZONE_COMPONENT);
-       while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
-               icalcomponent *clone;
-               icalproperty *prop;
-               const gchar *tz_tzid;
+               prop = i_cal_component_get_first_property (subcomp, I_CAL_TZID_PROPERTY);
+               if (prop && !g_strcmp0 (tzid, i_cal_property_get_tzid (prop))) {
+                       ICalComponent *clone;
+                       ICalTimezone *zone;
 
-               prop = icalcomponent_get_first_property (sub_comp, ICAL_TZID_PROPERTY);
-               tz_tzid = icalproperty_get_tzid (prop);
-               if (!strcmp (tzid, tz_tzid)) {
-                       icaltimezone *zone;
+                       zone = i_cal_timezone_new ();
+                       clone = i_cal_component_new_clone (subcomp);
+                       i_cal_timezone_set_component (zone, clone);
 
-                       zone = icaltimezone_new ();
-                       clone = icalcomponent_new_clone (sub_comp);
-                       icaltimezone_set_component (zone, clone);
+                       g_clear_object (&next_subcomp);
+                       g_clear_object (&subcomp);
+                       g_clear_object (&param);
+                       g_clear_object (&prop);
+                       g_clear_object (&iter);
 
                        return zone;
                }
 
-               icalcompiter_next (&iter);
+               g_clear_object (&prop);
+               g_object_unref (subcomp);
+               subcomp = next_subcomp;
        }
 
+       g_clear_object (&param);
+       g_clear_object (&iter);
+
        return NULL;
 }
 
@@ -1376,106 +1395,122 @@ process_callbacks (EMeetingStoreQueueData *qdata)
 }
 
 static void
-process_free_busy_comp_get_xfb (icalproperty *ip,
+process_free_busy_comp_get_xfb (ICalProperty *ip,
                                 gchar **summary,
                                 gchar **location)
 {
-       const gchar *tmp = NULL;
+       gchar *tmp;
 
        g_return_if_fail (ip != NULL);
        g_return_if_fail (summary != NULL && *summary == NULL);
        g_return_if_fail (location != NULL && *location == NULL);
 
-       /* We extract extended free/busy information from the icalproperty
+       /* We extract extended free/busy information from the ICalProperty
         * here (X-SUMMARY and X-LOCATION). If the property carries such,
         * it will be displayed as a tooltip for the busy period. Otherwise,
         * nothing will happen (*summary and/or *location will be NULL)
         */
 
-       tmp = icalproperty_get_parameter_as_string (
-               ip, E_MEETING_FREE_BUSY_XPROP_SUMMARY);
-       *summary = e_meeting_xfb_utf8_string_new_from_ical (
-               tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN);
-       tmp = icalproperty_get_parameter_as_string (
-               ip, E_MEETING_FREE_BUSY_XPROP_LOCATION);
-       *location = e_meeting_xfb_utf8_string_new_from_ical (
-               tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN);
+       tmp = i_cal_property_get_parameter_as_string_r (ip, E_MEETING_FREE_BUSY_XPROP_SUMMARY);
+       *summary = e_meeting_xfb_utf8_string_new_from_ical (tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN);
+       g_free (tmp);
+
+       tmp = i_cal_property_get_parameter_as_string_r (ip, E_MEETING_FREE_BUSY_XPROP_LOCATION);
+       *location = e_meeting_xfb_utf8_string_new_from_ical (tmp, E_MEETING_FREE_BUSY_XPROP_MAXLEN);
+       g_free (tmp);
 }
 
 static void
 process_free_busy_comp (EMeetingAttendee *attendee,
-                        icalcomponent *fb_comp,
-                        icaltimezone *zone,
-                        icalcomponent *tz_top_level)
+                       ICalComponent *fb_comp,
+                       ICalTimezone *zone,
+                       ICalComponent *tz_top_level)
 {
-       icalproperty *ip;
+       ICalProperty *ip;
 
-       ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY);
+       ip = i_cal_component_get_first_property (fb_comp, I_CAL_DTSTART_PROPERTY);
        if (ip != NULL) {
-               struct icaltimetype dtstart;
-               icaltimezone *ds_zone;
-
-               dtstart = icalproperty_get_dtstart (ip);
-               if (!icaltime_is_utc (dtstart))
-                       ds_zone = find_zone (ip, tz_top_level);
-               else
-                       ds_zone = icaltimezone_get_utc_timezone ();
-               icaltimezone_convert_time (&dtstart, ds_zone, zone);
-               e_meeting_attendee_set_start_busy_range (
-                       attendee,
-                       dtstart.year,
-                       dtstart.month,
-                       dtstart.day,
-                       dtstart.hour,
-                       dtstart.minute);
+               ICalTime *dtstart;
+               ICalTimezone *ds_zone;
+
+               dtstart = i_cal_property_get_dtstart (ip);
+               if (dtstart) {
+                       if (!i_cal_time_is_utc (dtstart))
+                               ds_zone = find_zone (ip, tz_top_level);
+                       else
+                               ds_zone = g_object_ref (i_cal_timezone_get_utc_timezone ());
+                       i_cal_timezone_convert_time (dtstart, ds_zone, zone);
+
+                       e_meeting_attendee_set_start_busy_range (
+                               attendee,
+                               i_cal_time_get_year (dtstart),
+                               i_cal_time_get_month (dtstart),
+                               i_cal_time_get_day (dtstart),
+                               i_cal_time_get_hour (dtstart),
+                               i_cal_time_get_minute (dtstart));
+
+                       g_clear_object (&ds_zone);
+                       g_clear_object (&dtstart);
+               }
        }
+       g_clear_object (&ip);
 
-       ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY);
+       ip = i_cal_component_get_first_property (fb_comp, I_CAL_DTEND_PROPERTY);
        if (ip != NULL) {
-               struct icaltimetype dtend;
-               icaltimezone *de_zone;
-
-               dtend = icalproperty_get_dtend (ip);
-               if (!icaltime_is_utc (dtend))
-                       de_zone = find_zone (ip, tz_top_level);
-               else
-                       de_zone = icaltimezone_get_utc_timezone ();
-               icaltimezone_convert_time (&dtend, de_zone, zone);
-               e_meeting_attendee_set_end_busy_range (
-                       attendee,
-                       dtend.year,
-                       dtend.month,
-                       dtend.day,
-                       dtend.hour,
-                       dtend.minute);
+               ICalTime *dtend;
+               ICalTimezone *de_zone;
+
+               dtend = i_cal_property_get_dtend (ip);
+               if (dtend) {
+                       if (!i_cal_time_is_utc (dtend))
+                               de_zone = find_zone (ip, tz_top_level);
+                       else
+                               de_zone = g_object_ref (i_cal_timezone_get_utc_timezone ());
+                       i_cal_timezone_convert_time (dtend, de_zone, zone);
+
+                       e_meeting_attendee_set_end_busy_range (
+                               attendee,
+                               i_cal_time_get_year (dtend),
+                               i_cal_time_get_month (dtend),
+                               i_cal_time_get_day (dtend),
+                               i_cal_time_get_hour (dtend),
+                               i_cal_time_get_minute (dtend));
+
+                       g_clear_object (&de_zone);
+                       g_clear_object (&dtend);
+               }
        }
+       g_clear_object (&ip);
 
-       ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
-       while (ip != NULL) {
-               icalparameter *param;
-               struct icalperiodtype fb;
+       for (ip = i_cal_component_get_first_property (fb_comp, I_CAL_FREEBUSY_PROPERTY);
+            ip;
+            g_object_unref (ip), ip = i_cal_component_get_next_property (fb_comp, I_CAL_FREEBUSY_PROPERTY)) {
+               ICalParameter *param;
+               ICalPeriod *fb;
                EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST;
-               icalparameter_fbtype fbtype = ICAL_FBTYPE_BUSY;
+               ICalParameterFbtype fbtype = I_CAL_FBTYPE_BUSY;
 
-               fb = icalproperty_get_freebusy (ip);
-               param = icalproperty_get_first_parameter (ip, ICAL_FBTYPE_PARAMETER);
-               if (param != NULL)
-                       fbtype = icalparameter_get_fbtype (param);
+               fb = i_cal_property_get_freebusy (ip);
+               param = i_cal_property_get_first_parameter (ip, I_CAL_FBTYPE_PARAMETER);
+               if (param) {
+                       fbtype = i_cal_parameter_get_fbtype (param);
+                       g_clear_object (&param);
+               }
 
                switch (fbtype) {
-               case ICAL_FBTYPE_BUSY:
+               case I_CAL_FBTYPE_BUSY:
                        busy_type = E_MEETING_FREE_BUSY_BUSY;
                        break;
 
-               case ICAL_FBTYPE_BUSYUNAVAILABLE:
+               case I_CAL_FBTYPE_BUSYUNAVAILABLE:
                        busy_type = E_MEETING_FREE_BUSY_OUT_OF_OFFICE;
                        break;
 
-               case ICAL_FBTYPE_BUSYTENTATIVE:
+               case I_CAL_FBTYPE_BUSYTENTATIVE:
                        busy_type = E_MEETING_FREE_BUSY_TENTATIVE;
                        break;
 
-               case ICAL_FBTYPE_FREE:
+               case I_CAL_FBTYPE_FREE:
                        busy_type = E_MEETING_FREE_BUSY_FREE;
                        break;
 
@@ -1484,15 +1519,19 @@ process_free_busy_comp (EMeetingAttendee *attendee,
                }
 
                if (busy_type != E_MEETING_FREE_BUSY_LAST) {
-                       icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
+                       ICalTimezone *utc_zone = i_cal_timezone_get_utc_timezone ();
+                       ICalTime *fbstart, *fbend;
                        gchar *summary = NULL;
                        gchar *location = NULL;
 
-                       icaltimezone_convert_time (&fb.start, utc_zone, zone);
-                       icaltimezone_convert_time (&fb.end, utc_zone, zone);
+                       fbstart = i_cal_period_get_start (fb);
+                       fbend = i_cal_period_get_end (fb);
+
+                       i_cal_timezone_convert_time (fbstart, utc_zone, zone);
+                       i_cal_timezone_convert_time (fbend, utc_zone, zone);
 
                        /* Extract extended free/busy (XFB) information from
-                        * the icalproperty, if it carries such.
+                        * the ICalProperty, if it carries such.
                         * See the comment for the EMeetingXfbData structure
                         * for a reference.
                         */
@@ -1500,77 +1539,91 @@ process_free_busy_comp (EMeetingAttendee *attendee,
 
                        e_meeting_attendee_add_busy_period (
                                attendee,
-                               fb.start.year,
-                               fb.start.month,
-                               fb.start.day,
-                               fb.start.hour,
-                               fb.start.minute,
-                               fb.end.year,
-                               fb.end.month,
-                               fb.end.day,
-                               fb.end.hour,
-                               fb.end.minute,
+                               i_cal_time_get_year (fbstart),
+                               i_cal_time_get_month (fbstart),
+                               i_cal_time_get_day (fbstart),
+                               i_cal_time_get_hour (fbstart),
+                               i_cal_time_get_minute (fbstart),
+                               i_cal_time_get_year (fbend),
+                               i_cal_time_get_month (fbend),
+                               i_cal_time_get_day (fbend),
+                               i_cal_time_get_hour (fbend),
+                               i_cal_time_get_minute (fbend),
                                busy_type,
                                summary,
                                location);
 
-                       if (summary != NULL)
-                               g_free (summary);
-                       if (location != NULL)
-                               g_free (location);
+                       g_clear_object (&fbstart);
+                       g_clear_object (&fbend);
+                       g_free (summary);
+                       g_free (location);
                }
 
-               ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
+               g_clear_object (&fb);
        }
 }
 
 static void
 process_free_busy (EMeetingStoreQueueData *qdata,
-                   gchar *text)
+                  const gchar *text)
 {
        EMeetingStore *store = qdata->store;
        EMeetingStorePrivate *priv;
        EMeetingAttendee *attendee = qdata->attendee;
-       icalcomponent *main_comp;
-       icalcomponent_kind kind = ICAL_NO_COMPONENT;
+       ICalComponent *main_comp;
+       ICalComponentKind kind = I_CAL_NO_COMPONENT;
 
        priv = store->priv;
 
-       main_comp = icalparser_parse_string (text);
+       main_comp = i_cal_parser_parse_string (text);
        if (main_comp == NULL) {
                process_callbacks (qdata);
                return;
        }
 
-       kind = icalcomponent_isa (main_comp);
-       if (kind == ICAL_VCALENDAR_COMPONENT) {
-               icalcompiter iter;
-               icalcomponent *tz_top_level, *sub_comp;
+       kind = i_cal_component_isa (main_comp);
+       if (kind == I_CAL_VCALENDAR_COMPONENT) {
+               ICalCompIter *iter;
+               ICalComponent *tz_top_level, *subcomp;
 
                tz_top_level = e_cal_util_new_top_level ();
 
-               iter = icalcomponent_begin_component (main_comp, ICAL_VTIMEZONE_COMPONENT);
-               while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
-                       icalcomponent *clone;
+               iter = i_cal_component_begin_component (main_comp, I_CAL_VTIMEZONE_COMPONENT);
+               subcomp = i_cal_comp_iter_deref (iter);
+               while (subcomp) {
+                       ICalComponent *next_subcomp;
 
-                       clone = icalcomponent_new_clone (sub_comp);
-                       icalcomponent_add_component (tz_top_level, clone);
+                       next_subcomp = i_cal_comp_iter_next (iter);
 
-                       icalcompiter_next (&iter);
+                       i_cal_component_take_component (tz_top_level,
+                               i_cal_component_new_clone (subcomp));
+
+                       g_object_unref (subcomp);
+                       subcomp = next_subcomp;
                }
 
-               iter = icalcomponent_begin_component (main_comp, ICAL_VFREEBUSY_COMPONENT);
-               while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
-                       process_free_busy_comp (attendee, sub_comp, priv->zone, tz_top_level);
+               g_clear_object (&iter);
+
+               iter = i_cal_component_begin_component (main_comp, I_CAL_VFREEBUSY_COMPONENT);
+               subcomp = i_cal_comp_iter_deref (iter);
+               while (subcomp) {
+                       ICalComponent *next_subcomp;
 
-                       icalcompiter_next (&iter);
+                       next_subcomp = i_cal_comp_iter_next (iter);
+
+                       process_free_busy_comp (attendee, subcomp, priv->zone, tz_top_level);
+
+                       g_object_unref (subcomp);
+                       subcomp = next_subcomp;
                }
-               icalcomponent_free (tz_top_level);
-       } else if (kind == ICAL_VFREEBUSY_COMPONENT) {
+
+               g_clear_object (&iter);
+               g_clear_object (&tz_top_level);
+       } else if (kind == I_CAL_VFREEBUSY_COMPONENT) {
                process_free_busy_comp (attendee, main_comp, priv->zone, NULL);
        }
 
-       icalcomponent_free (main_comp);
+       g_clear_object (&main_comp);
 
        process_callbacks (qdata);
 }
@@ -1747,25 +1800,33 @@ refresh_busy_periods (gpointer data)
 
        /* Check the server for free busy data */
        if (priv->client) {
-               struct icaltimetype itt;
-
-               itt = icaltime_null_time ();
-               itt.year = g_date_get_year (&qdata->start.date);
-               itt.month = g_date_get_month (&qdata->start.date);
-               itt.day = g_date_get_day (&qdata->start.date);
-               itt.hour = qdata->start.hour;
-               itt.minute = qdata->start.minute;
-               fbd->startt = icaltime_as_timet_with_zone (itt, priv->zone);
-
-               itt = icaltime_null_time ();
-               itt.year = g_date_get_year (&qdata->end.date);
-               itt.month = g_date_get_month (&qdata->end.date);
-               itt.day = g_date_get_day (&qdata->end.date);
-               itt.hour = qdata->end.hour;
-               itt.minute = qdata->end.minute;
-               fbd->endt = icaltime_as_timet_with_zone (itt, priv->zone);
-               fbd->qdata = qdata;
+               ICalTime *itt;
+
+               itt = i_cal_time_null_time ();
+               i_cal_time_set_date (itt,
+                       g_date_get_year (&qdata->start.date),
+                       g_date_get_month (&qdata->start.date),
+                       g_date_get_day (&qdata->start.date));
+               i_cal_time_set_time (itt,
+                       qdata->start.hour,
+                       qdata->start.minute,
+                       0);
+               fbd->startt = i_cal_time_as_timet_with_zone (itt, priv->zone);
+               g_clear_object (&itt);
+
+               itt = i_cal_time_null_time ();
+               i_cal_time_set_date (itt,
+                       g_date_get_year (&qdata->end.date),
+                       g_date_get_month (&qdata->end.date),
+                       g_date_get_day (&qdata->end.date));
+               i_cal_time_set_time (itt,
+                       qdata->end.hour,
+                       qdata->end.minute,
+                       0);
+               fbd->endt = i_cal_time_as_timet_with_zone (itt, priv->zone);
+               g_clear_object (&itt);
 
+               fbd->qdata = qdata;
                fbd->users = g_slist_append (fbd->users, g_strdup (fbd->email));
 
        }
diff --git a/src/calendar/gui/e-meeting-store.h b/src/calendar/gui/e-meeting-store.h
index c587d78e96..c6539a68a2 100644
--- a/src/calendar/gui/e-meeting-store.h
+++ b/src/calendar/gui/e-meeting-store.h
@@ -105,9 +105,9 @@ const gchar *       e_meeting_store_get_free_busy_template
 void           e_meeting_store_set_free_busy_template
                                                (EMeetingStore *meeting_store,
                                                 const gchar *free_busy_template);
-icaltimezone * e_meeting_store_get_timezone    (EMeetingStore *meeting_store);
+ICalTimezone * e_meeting_store_get_timezone    (EMeetingStore *meeting_store);
 void           e_meeting_store_set_timezone    (EMeetingStore *meeting_store,
-                                                icaltimezone *timezone);
+                                                const ICalTimezone *timezone);
 gboolean       e_meeting_store_get_show_address(EMeetingStore *store);
 void           e_meeting_store_set_show_address(EMeetingStore *store,
                                                 gboolean show_address);
diff --git a/src/calendar/gui/e-meeting-utils.c b/src/calendar/gui/e-meeting-utils.c
index e7df2f89fa..8b9678e6b0 100644
--- a/src/calendar/gui/e-meeting-utils.c
+++ b/src/calendar/gui/e-meeting-utils.c
@@ -93,7 +93,7 @@ e_meeting_xfb_data_clear (EMeetingXfbData *xfb)
 }
 
 /* Creates an XFB string from a string property of a vfreebusy
- * icalproperty. The ical string we read may be base64 encoded, but
+ * ICalProperty. The iCal string we read may be base64 encoded, but
  * we get no reliable indication whether it really is. So we
  * try to base64-decode, and failing that, assume the string
  * is plain. The result is validated for UTF-8. We try to convert
@@ -117,7 +117,7 @@ e_meeting_xfb_utf8_string_new_from_ical (const gchar *icalstring,
        if (icalstring == NULL)
                return NULL;
 
-       /* ical does not carry charset hints, so we
+       /* iCal does not carry charset hints, so we
         * try UTF-8 first, then conversion using
         * system locale info.
         */
diff --git a/src/calendar/gui/e-memo-table.c b/src/calendar/gui/e-memo-table.c
index 2415ffff55..f42a824eac 100644
--- a/src/calendar/gui/e-memo-table.c
+++ b/src/calendar/gui/e-memo-table.c
@@ -39,6 +39,7 @@
 #include "e-cal-ops.h"
 #include "e-calendar-view.h"
 #include "e-cell-date-edit-text.h"
+#include "itip-utils.h"
 #include "print.h"
 #include "misc.h"
 
@@ -50,6 +51,9 @@ struct _EMemoTablePrivate {
        gpointer shell_view;  /* weak pointer */
        ECalModel *model;
 
+       /* Fields used for cut/copy/paste */
+       ICalComponent *tmp_vcal;
+
        GtkTargetList *copy_target_list;
        GtkTargetList *paste_target_list;
 };
@@ -115,24 +119,20 @@ memo_table_get_current_time (ECellDateEdit *ecde,
 {
        EMemoTable *memo_table = user_data;
        ECalModel *model;
-       icaltimezone *zone;
-       struct tm tmp_tm = { 0 };
-       struct icaltimetype tt;
+       ICalTimezone *zone;
+       ICalTime *tt;
+       struct tm tmp_tm;
 
        /* Get the current timezone. */
        model = e_memo_table_get_model (memo_table);
        zone = e_cal_model_get_timezone (model);
 
-       tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
+       tt = i_cal_time_from_timet_with_zone (time (NULL), FALSE, zone);
 
        /* Now copy it to the struct tm and return it. */
-       tmp_tm.tm_year = tt.year - 1900;
-       tmp_tm.tm_mon = tt.month - 1;
-       tmp_tm.tm_mday = tt.day;
-       tmp_tm.tm_hour = tt.hour;
-       tmp_tm.tm_min = tt.minute;
-       tmp_tm.tm_sec = tt.second;
-       tmp_tm.tm_isdst = -1;
+       tmp_tm = e_cal_util_icaltime_to_tm (tt);
+
+       g_clear_object (&tt);
 
        return tmp_tm;
 }
@@ -323,7 +323,6 @@ memo_table_constructed (GObject *object)
 
        e_table_extras_add_cell (extras, "dateedit", popup_cell);
        g_object_unref (popup_cell);
-       memo_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
 
        e_cell_date_edit_set_get_time_callback (
                E_CELL_DATE_EDIT (popup_cell),
@@ -401,15 +400,12 @@ memo_table_query_tooltip (GtkWidget *widget,
        gint row = -1, col = -1, row_y = -1, row_height = -1;
        GtkWidget *box, *l, *w;
        GdkRGBA sel_bg, sel_fg, norm_bg, norm_text;
-       gchar *tmp;
-       const gchar *str;
+       gchar *tmp, *summary;
        GString *tmp2;
-       gboolean free_text = FALSE;
        ECalComponent *new_comp;
-       ECalComponentOrganizer organizer;
-       ECalComponentDateTime dtstart, dtdue;
-       icalcomponent *clone;
-       icaltimezone *zone, *default_zone;
+       ECalComponentOrganizer *organizer;
+       ECalComponentDateTime *dtstart, *dtdue;
+       ICalTimezone *zone, *default_zone;
        GSList *desc, *p;
        gint len;
        ESelectionModel *esm;
@@ -438,12 +434,9 @@ memo_table_query_tooltip (GtkWidget *widget,
        if (!comp_data || !comp_data->icalcomp)
                return FALSE;
 
-       new_comp = e_cal_component_new ();
-       clone = icalcomponent_new_clone (comp_data->icalcomp);
-       if (!e_cal_component_set_icalcomponent (new_comp, clone)) {
-               g_object_unref (new_comp);
+       new_comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (comp_data->icalcomp));
+       if (!new_comp)
                return FALSE;
-       }
 
        e_utils_get_theme_color (widget, "theme_selected_bg_color", E_UTILS_DEFAULT_THEME_SELECTED_BG_COLOR, 
&sel_bg);
        e_utils_get_theme_color (widget, "theme_selected_fg_color", E_UTILS_DEFAULT_THEME_SELECTED_FG_COLOR, 
&sel_fg);
@@ -452,17 +445,14 @@ memo_table_query_tooltip (GtkWidget *widget,
 
        box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
-       str = e_calendar_view_get_icalcomponent_summary (
-               comp_data->client, comp_data->icalcomp, &free_text);
-       if (!(str && *str)) {
-               if (free_text)
-                       g_free ((gchar *) str);
-               free_text = FALSE;
-               str = _("* No Summary *");
+       summary = e_calendar_view_dup_component_summary (comp_data->icalcomp);
+       if (!(summary && *summary)) {
+               g_free (summary);
+               summary = g_strdup (_("* No Summary *"));
        }
 
        l = gtk_label_new (NULL);
-       tmp = g_markup_printf_escaped ("<b>%s</b>", str);
+       tmp = g_markup_printf_escaped ("<b>%s</b>", summary);
        gtk_label_set_line_wrap (GTK_LABEL (l), TRUE);
        gtk_label_set_markup (GTK_LABEL (l), tmp);
        gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
@@ -474,9 +464,7 @@ memo_table_query_tooltip (GtkWidget *widget,
        gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
        g_free (tmp);
 
-       if (free_text)
-               g_free ((gchar *) str);
-       free_text = FALSE;
+       g_free (summary);
 
        w = gtk_event_box_new ();
        gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &norm_bg);
@@ -486,22 +474,22 @@ memo_table_query_tooltip (GtkWidget *widget,
        gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
        w = l;
 
-       e_cal_component_get_organizer (new_comp, &organizer);
-       if (organizer.cn) {
-               gchar *ptr;
-               ptr = strchr (organizer.value, ':');
+       organizer = e_cal_component_get_organizer (new_comp);
+       if (organizer && e_cal_component_organizer_get_cn (organizer)) {
+               const gchar *email;
+
+               email = itip_strip_mailto (e_cal_component_organizer_get_value (organizer));
 
-               if (ptr) {
-                       ptr++;
+               if (email) {
                        tmp = g_strdup_printf (
                                /* Translators: It will display
                                 * "Organizer: NameOfTheUser <email ofuser com>" */
-                               _("Organizer: %s <%s>"), organizer.cn, ptr);
+                               _("Organizer: %s <%s>"), e_cal_component_organizer_get_cn (organizer), email);
                } else {
                        /* With SunOne accounts, there may be no ':' in
                         * organizer.value */
                        tmp = g_strdup_printf (
-                               _("Organizer: %s"), organizer.cn);
+                               _("Organizer: %s"), e_cal_component_organizer_get_cn (organizer));
                }
 
                l = gtk_label_new (tmp);
@@ -513,18 +501,20 @@ memo_table_query_tooltip (GtkWidget *widget,
                gtk_widget_override_color (l, GTK_STATE_FLAG_NORMAL, &norm_text);
        }
 
-       e_cal_component_get_dtstart (new_comp, &dtstart);
-       e_cal_component_get_due (new_comp, &dtdue);
+       e_cal_component_organizer_free (organizer);
+
+       dtstart = e_cal_component_get_dtstart (new_comp);
+       dtdue = e_cal_component_get_due (new_comp);
 
        default_zone = e_cal_model_get_timezone (model);
 
-       if (dtstart.tzid) {
-               zone = icalcomponent_get_timezone (
+       if (dtstart && e_cal_component_datetime_get_tzid (dtstart)) {
+               zone = i_cal_component_get_timezone (
                        e_cal_component_get_icalcomponent (new_comp),
-                       dtstart.tzid);
+                       e_cal_component_datetime_get_tzid (dtstart));
                if (!zone)
                        e_cal_client_get_timezone_sync (
-                               comp_data->client, dtstart.tzid, &zone, NULL, NULL);
+                               comp_data->client, e_cal_component_datetime_get_tzid (dtstart), &zone, NULL, 
NULL);
                if (!zone)
                        zone = default_zone;
        } else {
@@ -533,12 +523,12 @@ memo_table_query_tooltip (GtkWidget *widget,
 
        tmp2 = g_string_new ("");
 
-       if (dtstart.value) {
+       if (dtstart && e_cal_component_datetime_get_value (dtstart)) {
                gchar *str;
 
-               tmp_tm = icaltimetype_to_tm_with_zone (dtstart.value, zone, default_zone);
+               tmp_tm = e_cal_util_icaltime_to_tm_with_zone (e_cal_component_datetime_get_value (dtstart), 
zone, default_zone);
                str = e_datetime_format_format_tm ("calendar", "table",
-                       dtstart.value->is_date ? DTFormatKindDate : DTFormatKindDateTime,
+                       i_cal_time_is_date (e_cal_component_datetime_get_value (dtstart)) ? DTFormatKindDate 
: DTFormatKindDateTime,
                        &tmp_tm);
 
                if (str && *str) {
@@ -550,12 +540,12 @@ memo_table_query_tooltip (GtkWidget *widget,
                g_free (str);
        }
 
-       if (dtdue.value) {
+       if (dtdue && e_cal_component_datetime_get_value (dtdue)) {
                gchar *str;
 
-               tmp_tm = icaltimetype_to_tm_with_zone (dtdue.value, zone, default_zone);
+               tmp_tm = e_cal_util_icaltime_to_tm_with_zone (e_cal_component_datetime_get_value (dtdue), 
zone, default_zone);
                str = e_datetime_format_format_tm ("calendar", "table",
-                       dtdue.value->is_date ? DTFormatKindDate : DTFormatKindDateTime,
+                       i_cal_time_is_date (e_cal_component_datetime_get_value (dtdue)) ? DTFormatKindDate : 
DTFormatKindDateTime,
                        &tmp_tm);
 
                if (str && *str) {
@@ -580,25 +570,26 @@ memo_table_query_tooltip (GtkWidget *widget,
 
        g_string_free (tmp2, TRUE);
 
-       e_cal_component_free_datetime (&dtstart);
-       e_cal_component_free_datetime (&dtdue);
+       e_cal_component_datetime_free (dtstart);
+       e_cal_component_datetime_free (dtdue);
 
        tmp2 = g_string_new ("");
-       e_cal_component_get_description_list (new_comp, &desc);
+       desc = e_cal_component_get_descriptions (new_comp);
        for (len = 0, p = desc; p != NULL; p = p->next) {
                ECalComponentText *text = p->data;
 
-               if (text->value != NULL) {
-                       len += strlen (text->value);
-                       g_string_append (tmp2, text->value);
+               if (text && e_cal_component_text_get_value (text)) {
+                       const gchar *value = e_cal_component_text_get_value (text);
+                       len += strlen (value);
+                       g_string_append (tmp2, value);
                        if (len > 1024) {
                                g_string_set_size (tmp2, 1020);
-                               g_string_append (tmp2, "...");
+                               g_string_append (tmp2, "…");
                                break;
                        }
                }
        }
-       e_cal_component_free_text_list (desc);
+       g_slist_free_full (desc, e_cal_component_text_free);
 
        if (tmp2->len) {
                l = gtk_label_new (tmp2->str);
@@ -820,12 +811,11 @@ copy_row_cb (gint model_row,
        EMemoTable *memo_table;
        ECalModelComponent *comp_data;
        ECalModel *model;
-       gchar *comp_str;
-       icalcomponent *child;
+       ICalComponent *child;
 
        memo_table = E_MEMO_TABLE (data);
 
-       g_return_if_fail (memo_table->tmp_vcal != NULL);
+       g_return_if_fail (memo_table->priv->tmp_vcal != NULL);
 
        model = e_memo_table_get_model (memo_table);
        comp_data = e_cal_model_get_component_at (model, model_row);
@@ -834,18 +824,12 @@ copy_row_cb (gint model_row,
 
        /* Add timezones to the VCALENDAR component. */
        e_cal_util_add_timezones_from_component (
-               memo_table->tmp_vcal, comp_data->icalcomp);
+               memo_table->priv->tmp_vcal, comp_data->icalcomp);
 
        /* Add the new component to the VCALENDAR component. */
-       comp_str = icalcomponent_as_ical_string_r (comp_data->icalcomp);
-       child = icalparser_parse_string (comp_str);
-       if (child) {
-               icalcomponent_add_component (
-                       memo_table->tmp_vcal,
-                       icalcomponent_new_clone (child));
-               icalcomponent_free (child);
-       }
-       g_free (comp_str);
+       child = i_cal_component_new_clone (comp_data->icalcomp);
+       if (child)
+               i_cal_component_take_component (memo_table->priv->tmp_vcal, child);
 }
 
 static void
@@ -858,11 +842,11 @@ memo_table_copy_clipboard (ESelectable *selectable)
        memo_table = E_MEMO_TABLE (selectable);
 
        /* Create a temporary VCALENDAR object. */
-       memo_table->tmp_vcal = e_cal_util_new_top_level ();
+       memo_table->priv->tmp_vcal = e_cal_util_new_top_level ();
 
        e_table_selected_row_foreach (
                E_TABLE (memo_table), copy_row_cb, memo_table);
-       comp_str = icalcomponent_as_ical_string_r (memo_table->tmp_vcal);
+       comp_str = i_cal_component_as_ical_string_r (memo_table->priv->tmp_vcal);
 
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
        e_clipboard_set_calendar (clipboard, comp_str, -1);
@@ -870,8 +854,7 @@ memo_table_copy_clipboard (ESelectable *selectable)
 
        g_free (comp_str);
 
-       icalcomponent_free (memo_table->tmp_vcal);
-       memo_table->tmp_vcal = NULL;
+       g_clear_object (&memo_table->priv->tmp_vcal);
 }
 
 static void
@@ -978,9 +961,8 @@ memo_table_delete_selection (ESelectable *selectable)
        /* FIXME: this may be something other than a TODO component */
 
        if (comp_data) {
-               comp = e_cal_component_new ();
-               e_cal_component_set_icalcomponent (
-                       comp, icalcomponent_new_clone (comp_data->icalcomp));
+               comp = e_cal_component_new_from_icalcomponent (
+                       i_cal_component_new_clone (comp_data->icalcomp));
        }
 
        if (e_cal_model_get_confirm_delete (model))
@@ -992,9 +974,7 @@ memo_table_delete_selection (ESelectable *selectable)
        if (delete)
                delete_selected_components (memo_table);
 
-       /* free memory */
-       if (comp)
-               g_object_unref (comp);
+       g_clear_object (&comp);
 }
 
 static void
diff --git a/src/calendar/gui/e-memo-table.h b/src/calendar/gui/e-memo-table.h
index 8bbdf363b0..3e8b7d1786 100644
--- a/src/calendar/gui/e-memo-table.h
+++ b/src/calendar/gui/e-memo-table.h
@@ -64,12 +64,6 @@ typedef struct _EMemoTablePrivate EMemoTablePrivate;
 struct _EMemoTable {
        ETable parent;
 
-       /* The ECell used to view & edit dates. */
-       ECellDateEdit *dates_cell;
-
-       /* Fields used for cut/copy/paste */
-       icalcomponent *tmp_vcal;
-
        EMemoTablePrivate *priv;
 };
 
@@ -88,9 +82,9 @@ GtkWidget *   e_memo_table_new                (EShellView *shell_view,
                                                 ECalModel *model);
 ECalModel *    e_memo_table_get_model          (EMemoTable *memo_table);
 EShellView *   e_memo_table_get_shell_view     (EMemoTable *memo_table);
-icaltimezone * e_memo_table_get_timezone       (EMemoTable *memo_table);
+ICalTimezone * e_memo_table_get_timezone       (EMemoTable *memo_table);
 void           e_memo_table_set_timezone       (EMemoTable *memo_table,
-                                                icaltimezone *timezone);
+                                                const ICalTimezone *timezone);
 gboolean       e_memo_table_get_use_24_hour_format
                                                (EMemoTable *memo_table);
 void           e_memo_table_set_use_24_hour_format
diff --git a/src/calendar/gui/e-send-options-utils.c b/src/calendar/gui/e-send-options-utils.c
index 122af980d8..bb3cc5157f 100644
--- a/src/calendar/gui/e-send-options-utils.c
+++ b/src/calendar/gui/e-send-options-utils.c
@@ -87,8 +87,14 @@ e_send_options_utils_set_default_data (ESendOptionsDialog *sod,
                if (!strcmp (value, "none"))
                        gopts->delay_enabled = FALSE;
                else {
+                       ICalTime *itt;
+
+                       itt = i_cal_time_from_string (value);
+
                        gopts->delay_enabled = TRUE;
-                       gopts->delay_until = icaltime_as_timet (icaltime_from_string (value));
+                       gopts->delay_until = i_cal_time_as_timet (itt);
+
+                       g_clear_object (&itt);
                }
        }
        g_free (value);
@@ -165,78 +171,95 @@ e_send_options_utils_set_default_data (ESendOptionsDialog *sod,
        g_free (value);
 }
 
+static ICalProperty *
+esnd_opts_new_property_take_value (gchar *value)
+{
+       ICalProperty *prop;
+
+       prop = i_cal_property_new_x (value);
+
+       g_free (value);
+
+       return prop;
+}
+
 void
 e_send_options_utils_fill_component (ESendOptionsDialog *sod,
-                                     ECalComponent *comp,
-                                     icaltimezone *zone)
+                                    ECalComponent *comp,
+                                    ICalTimezone *zone)
 {
-       gint i = 1;
-       icalproperty *prop;
-       icalcomponent *icalcomp;
+       gint ii;
+       ICalProperty *prop;
+       ICalComponent *icomp;
        ESendOptionsGeneral *gopts;
        ESendOptionsStatusTracking *sopts;
 
        gopts = sod->data->gopts;
        sopts = sod->data->sopts;
 
-       e_cal_component_set_sequence (comp, &i);
-       icalcomp = e_cal_component_get_icalcomponent (comp);
+       ii = e_cal_component_get_sequence (comp);
+       if (ii < 1)
+               ii = 1;
+
+       icomp = e_cal_component_get_icalcomponent (comp);
 
        if (e_send_options_get_need_general_options (sod)) {
-               prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", gopts->priority));
-               icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-PRIORITY");
-               icalcomponent_add_property (icalcomp, prop);
+               prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", gopts->priority));
+               i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-PRIORITY");
+               i_cal_component_take_property (icomp, prop);
 
                if (gopts->reply_enabled) {
                        if (gopts->reply_convenient)
-                               prop = icalproperty_new_x ("convenient");
+                               prop = i_cal_property_new_x ("convenient");
                        else
-                               prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", 
gopts->reply_within));
-                       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-REPLY");
-                       icalcomponent_add_property (icalcomp, prop);
+                               prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", 
gopts->reply_within));
+                       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-REPLY");
+                       i_cal_component_take_property (icomp, prop);
                }
 
                if (gopts->expiration_enabled && gopts->expire_after) {
-                       prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", 
gopts->expire_after));
-                       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-EXPIRE");
-                       icalcomponent_add_property (icalcomp, prop);
+                       prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", 
gopts->expire_after));
+                       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-EXPIRE");
+                       i_cal_component_take_property (icomp, prop);
                }
 
                if (gopts->delay_enabled) {
-                       struct icaltimetype temp;
+                       ICalTime *temp;
                        gchar *str;
 
-                       temp = icaltime_from_timet_with_zone (gopts->delay_until, FALSE, zone);
+                       temp = i_cal_time_from_timet_with_zone (gopts->delay_until, FALSE, zone);
 
-                       str = icaltime_as_ical_string_r (temp);
-                       prop = icalproperty_new_x (str);
+                       str = i_cal_time_as_ical_string_r (temp);
+                       prop = i_cal_property_new_x (str);
                        g_free (str);
-                       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-DELAY");
-                       icalcomponent_add_property (icalcomp, prop);
+                       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-DELAY");
+                       i_cal_component_take_property (icomp, prop);
+
+                       g_clear_object (&temp);
                }
        }
 
        if (sopts->tracking_enabled)
-               prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->track_when));
+               prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", sopts->track_when));
        else
-               prop = icalproperty_new_x ("0");
+               prop = i_cal_property_new_x ("0");
 
-       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-TRACKINFO");
-       icalcomponent_add_property (icalcomp, prop);
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-TRACKINFO");
+       i_cal_component_take_property (icomp, prop);
 
-       prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->opened));
-       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-OPENED");
-       icalcomponent_add_property (icalcomp, prop);
+       prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", sopts->opened));
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-OPENED");
+       i_cal_component_take_property (icomp, prop);
 
-       prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->accepted));
-       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-ACCEPTED");
-       icalcomponent_add_property (icalcomp, prop);
+       prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", sopts->accepted));
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-ACCEPTED");
+       i_cal_component_take_property (icomp, prop);
 
-       prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->declined));
-       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-DECLINED");
-       icalcomponent_add_property (icalcomp, prop);
+       prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", sopts->declined));
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-DECLINED");
+       i_cal_component_take_property (icomp, prop);
 
-       prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->completed));
-       icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-COMPLETED");
-       icalcomponent_add_property (icalcomp, prop);
+       prop = esnd_opts_new_property_take_value (g_strdup_printf ("%d", sopts->completed));
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-OPTIONS-COMPLETED");
+       i_cal_component_take_property (icomp, prop);
 }
diff --git a/src/calendar/gui/e-send-options-utils.h b/src/calendar/gui/e-send-options-utils.h
index 5a49250ba5..592b26ff45 100644
--- a/src/calendar/gui/e-send-options-utils.h
+++ b/src/calendar/gui/e-send-options-utils.h
@@ -35,6 +35,6 @@ void          e_send_options_utils_set_default_data
 void           e_send_options_utils_fill_component
                                                (ESendOptionsDialog *sod,
                                                 ECalComponent *comp,
-                                                icaltimezone *zone);
+                                                ICalTimezone *zone);
 
 #endif
diff --git a/src/calendar/gui/e-task-table.c b/src/calendar/gui/e-task-table.c
index f23c69f7db..b63b2b03cb 100644
--- a/src/calendar/gui/e-task-table.c
+++ b/src/calendar/gui/e-task-table.c
@@ -55,6 +55,9 @@ struct _ETaskTablePrivate {
        ECalModel *model;
        GCancellable *completed_cancellable; /* when processing completed tasks */
 
+       /* Fields used for cut/copy/paste */
+       ICalComponent *tmp_vcal;
+
        GtkTargetList *copy_target_list;
        GtkTargetList *paste_target_list;
 
@@ -270,7 +273,7 @@ task_table_dates_cell_before_popup_cb (ECellDateEdit *dates_cell,
 
        model = e_task_table_get_model (task_table);
        comp_data = e_cal_model_get_component_at (model, row);
-       date_only = comp_data && comp_data->client && e_client_check_capability (E_CLIENT 
(comp_data->client), CAL_STATIC_CAPABILITY_TASK_DATE_ONLY);
+       date_only = comp_data && comp_data->client && e_client_check_capability (E_CLIENT 
(comp_data->client), E_CAL_STATIC_CAPABILITY_TASK_DATE_ONLY);
 
        g_object_set (G_OBJECT (dates_cell), "show-time", !date_only, NULL);
 }
@@ -490,13 +493,12 @@ task_table_constructed (GObject *object)
                G_BINDING_SYNC_CREATE);
 
        e_table_extras_add_cell (extras, "dateedit", popup_cell);
-       g_object_unref (popup_cell);
-
-       task_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
 
-       g_signal_connect (task_table->dates_cell, "before-popup",
+       g_signal_connect (popup_cell, "before-popup",
                G_CALLBACK (task_table_dates_cell_before_popup_cb), task_table);
 
+       g_object_unref (popup_cell);
+
        e_cell_date_edit_set_get_time_callback (
                E_CELL_DATE_EDIT (popup_cell),
                e_task_table_get_current_time, task_table, NULL);
@@ -713,10 +715,10 @@ task_table_popup_menu (GtkWidget *widget)
 
 static gboolean
 task_table_query_tooltip (GtkWidget *widget,
-                              gint x,
-                              gint y,
-                              gboolean keyboard_mode,
-                              GtkTooltip *tooltip)
+                         gint x,
+                         gint y,
+                         gboolean keyboard_mode,
+                         GtkTooltip *tooltip)
 {
        ETaskTable *task_table;
        ECalModel *model;
@@ -724,15 +726,12 @@ task_table_query_tooltip (GtkWidget *widget,
        gint row = -1, col = -1, row_y = -1, row_height = -1;
        GtkWidget *box, *l, *w;
        GdkRGBA sel_bg, sel_fg, norm_bg, norm_text;
-       gchar *tmp;
-       const gchar *str;
+       gchar *tmp, *summary, *str;
        GString *tmp2;
-       gboolean free_text = FALSE;
        ECalComponent *new_comp;
-       ECalComponentOrganizer organizer;
-       ECalComponentDateTime dtstart, dtdue;
-       icalcomponent *clone;
-       icaltimezone *zone, *default_zone;
+       ECalComponentOrganizer *organizer;
+       ECalComponentDateTime *dtstart, *dtdue;
+       ICalTimezone *zone, *default_zone;
        GSList *desc, *p;
        gint len;
        ESelectionModel *esm;
@@ -759,12 +758,9 @@ task_table_query_tooltip (GtkWidget *widget,
        if (!comp_data || !comp_data->icalcomp)
                return FALSE;
 
-       new_comp = e_cal_component_new ();
-       clone = icalcomponent_new_clone (comp_data->icalcomp);
-       if (!e_cal_component_set_icalcomponent (new_comp, clone)) {
-               g_object_unref (new_comp);
+       new_comp = e_cal_component_new_from_icalcomponent (i_cal_component_new_clone (comp_data->icalcomp));
+       if (!new_comp)
                return FALSE;
-       }
 
        e_utils_get_theme_color (widget, "theme_selected_bg_color", E_UTILS_DEFAULT_THEME_SELECTED_BG_COLOR, 
&sel_bg);
        e_utils_get_theme_color (widget, "theme_selected_fg_color", E_UTILS_DEFAULT_THEME_SELECTED_FG_COLOR, 
&sel_fg);
@@ -773,17 +769,14 @@ task_table_query_tooltip (GtkWidget *widget,
 
        box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
-       str = e_calendar_view_get_icalcomponent_summary (
-               comp_data->client, comp_data->icalcomp, &free_text);
-       if (!(str && *str)) {
-               if (free_text)
-                       g_free ((gchar *) str);
-               free_text = FALSE;
-               str = _("* No Summary *");
+       summary = e_calendar_view_dup_component_summary (comp_data->icalcomp);
+       if (!(summary && *summary)) {
+               g_free (summary);
+               summary = g_strdup (_("* No Summary *"));
        }
 
        l = gtk_label_new (NULL);
-       tmp = g_markup_printf_escaped ("<b>%s</b>", str);
+       tmp = g_markup_printf_escaped ("<b>%s</b>", summary);
        gtk_label_set_line_wrap (GTK_LABEL (l), TRUE);
        gtk_label_set_markup (GTK_LABEL (l), tmp);
        gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
@@ -795,9 +788,7 @@ task_table_query_tooltip (GtkWidget *widget,
        gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
        g_free (tmp);
 
-       if (free_text)
-               g_free ((gchar *) str);
-       free_text = FALSE;
+       g_free (summary);
 
        w = gtk_event_box_new ();
        gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &norm_bg);
@@ -807,20 +798,20 @@ task_table_query_tooltip (GtkWidget *widget,
        gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
        w = l;
 
-       e_cal_component_get_organizer (new_comp, &organizer);
-       if (organizer.cn) {
-               gchar *ptr;
-               ptr = strchr (organizer.value, ':');
+       organizer = e_cal_component_get_organizer (new_comp);
+       if (organizer && e_cal_component_organizer_get_cn (organizer)) {
+               const gchar *email;
+
+               email = itip_strip_mailto (e_cal_component_organizer_get_value (organizer));
 
-               if (ptr) {
-                       ptr++;
+               if (email) {
                        /* To Translators: It will display
                         * "Organizer: NameOfTheUser <email ofuser com>" */
-                       tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr);
+                       tmp = g_strdup_printf (_("Organizer: %s <%s>"), e_cal_component_organizer_get_cn 
(organizer), email);
                } else {
                        /* With SunOne accounts, there may be no ':' in
                         * organizer.value. */
-                       tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn);
+                       tmp = g_strdup_printf (_("Organizer: %s"), e_cal_component_organizer_get_cn 
(organizer));
                }
 
                l = gtk_label_new (tmp);
@@ -832,7 +823,9 @@ task_table_query_tooltip (GtkWidget *widget,
                gtk_widget_override_color (l, GTK_STATE_FLAG_NORMAL, &norm_text);
        }
 
-       e_cal_component_get_location (new_comp, &str);
+       e_cal_component_organizer_free (organizer);
+
+       str = e_cal_component_get_location (new_comp);
 
        if (str) {
                /* Translators: It will display "Location: PlaceOfTheMeeting" */
@@ -845,20 +838,21 @@ task_table_query_tooltip (GtkWidget *widget,
                gtk_label_set_max_width_chars ((GtkLabel *) l, 80);
                gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
                g_free (tmp);
+               g_free (str);
        }
 
-       e_cal_component_get_dtstart (new_comp, &dtstart);
-       e_cal_component_get_due (new_comp, &dtdue);
+       dtstart = e_cal_component_get_dtstart (new_comp);
+       dtdue = e_cal_component_get_due (new_comp);
 
        default_zone = e_cal_model_get_timezone (model);
 
-       if (dtstart.tzid) {
-               zone = icalcomponent_get_timezone (
+       if (dtstart && e_cal_component_datetime_get_tzid (dtstart)) {
+               zone = i_cal_component_get_timezone (
                        e_cal_component_get_icalcomponent (new_comp),
-                       dtstart.tzid);
+                       e_cal_component_datetime_get_tzid (dtstart));
                if (!zone)
                        e_cal_client_get_timezone_sync (
-                               comp_data->client, dtstart.tzid, &zone, NULL, NULL);
+                               comp_data->client, e_cal_component_datetime_get_tzid (dtstart), &zone, NULL, 
NULL);
                if (!zone)
                        zone = default_zone;
        } else {
@@ -867,12 +861,12 @@ task_table_query_tooltip (GtkWidget *widget,
 
        tmp2 = g_string_new ("");
 
-       if (dtstart.value) {
+       if (dtstart && e_cal_component_datetime_get_value (dtstart)) {
                gchar *str;
 
-               tmp_tm = icaltimetype_to_tm_with_zone (dtstart.value, zone, default_zone);
+               tmp_tm = e_cal_util_icaltime_to_tm_with_zone (e_cal_component_datetime_get_value (dtstart), 
zone, default_zone);
                str = e_datetime_format_format_tm ("calendar", "table",
-                       dtstart.value->is_date ? DTFormatKindDate : DTFormatKindDateTime,
+                       i_cal_time_is_date (e_cal_component_datetime_get_value (dtstart)) ? DTFormatKindDate 
: DTFormatKindDateTime,
                        &tmp_tm);
 
                if (str && *str) {
@@ -883,12 +877,12 @@ task_table_query_tooltip (GtkWidget *widget,
                g_free (str);
        }
 
-       if (dtdue.value) {
+       if (dtdue && e_cal_component_datetime_get_value (dtdue)) {
                gchar *str;
 
-               tmp_tm = icaltimetype_to_tm_with_zone (dtdue.value, zone, default_zone);
+               tmp_tm = e_cal_util_icaltime_to_tm_with_zone (e_cal_component_datetime_get_value (dtdue), 
zone, default_zone);
                str = e_datetime_format_format_tm ("calendar", "table",
-                       dtdue.value->is_date ? DTFormatKindDate : DTFormatKindDateTime,
+                       i_cal_time_is_date (e_cal_component_datetime_get_value (dtdue)) ? DTFormatKindDate : 
DTFormatKindDateTime,
                        &tmp_tm);
 
                if (str && *str) {
@@ -912,8 +906,8 @@ task_table_query_tooltip (GtkWidget *widget,
 
        g_string_free (tmp2, TRUE);
 
-       e_cal_component_free_datetime (&dtstart);
-       e_cal_component_free_datetime (&dtdue);
+       e_cal_component_datetime_free (dtstart);
+       e_cal_component_datetime_free (dtdue);
 
        tmp = e_cal_model_get_attendees_status_info (
                model, new_comp, comp_data->client);
@@ -940,13 +934,13 @@ task_table_query_tooltip (GtkWidget *widget,
        }
 
        tmp2 = g_string_new ("");
-       e_cal_component_get_description_list (new_comp, &desc);
+       desc = e_cal_component_get_descriptions (new_comp);
        for (len = 0, p = desc; p != NULL; p = p->next) {
                ECalComponentText *text = p->data;
 
-               if (text->value != NULL) {
-                       len += strlen (text->value);
-                       g_string_append (tmp2, text->value);
+               if (text && e_cal_component_text_get_value (text)) {
+                       len += strlen (e_cal_component_text_get_value (text));
+                       g_string_append (tmp2, e_cal_component_text_get_value (text));
                        if (len > 1024) {
                                g_string_set_size (tmp2, 1020);
                                g_string_append (tmp2, "...");
@@ -954,7 +948,7 @@ task_table_query_tooltip (GtkWidget *widget,
                        }
                }
        }
-       e_cal_component_free_text_list (desc);
+       g_slist_free_full (desc, e_cal_component_text_free);
 
        if (tmp2->len) {
                l = gtk_label_new (tmp2->str);
@@ -1180,12 +1174,11 @@ copy_row_cb (gint model_row,
        ETaskTable *task_table;
        ECalModelComponent *comp_data;
        ECalModel *model;
-       gchar *comp_str;
-       icalcomponent *child;
+       ICalComponent *child;
 
        task_table = E_TASK_TABLE (data);
 
-       g_return_if_fail (task_table->tmp_vcal != NULL);
+       g_return_if_fail (task_table->priv->tmp_vcal != NULL);
 
        model = e_task_table_get_model (task_table);
        comp_data = e_cal_model_get_component_at (model, model_row);
@@ -1194,18 +1187,13 @@ copy_row_cb (gint model_row,
 
        /* Add timezones to the VCALENDAR component. */
        e_cal_util_add_timezones_from_component (
-               task_table->tmp_vcal, comp_data->icalcomp);
+               task_table->priv->tmp_vcal, comp_data->icalcomp);
 
        /* Add the new component to the VCALENDAR component. */
-       comp_str = icalcomponent_as_ical_string_r (comp_data->icalcomp);
-       child = icalparser_parse_string (comp_str);
+       child = i_cal_component_new_clone (comp_data->icalcomp);
        if (child) {
-               icalcomponent_add_component (
-                       task_table->tmp_vcal,
-                       icalcomponent_new_clone (child));
-               icalcomponent_free (child);
+               i_cal_component_take_component (task_table->priv->tmp_vcal, child);
        }
-       g_free (comp_str);
 }
 
 static void
@@ -1218,11 +1206,11 @@ task_table_copy_clipboard (ESelectable *selectable)
        task_table = E_TASK_TABLE (selectable);
 
        /* Create a temporary VCALENDAR object. */
-       task_table->tmp_vcal = e_cal_util_new_top_level ();
+       task_table->priv->tmp_vcal = e_cal_util_new_top_level ();
 
        e_table_selected_row_foreach (
                E_TABLE (task_table), copy_row_cb, task_table);
-       comp_str = icalcomponent_as_ical_string_r (task_table->tmp_vcal);
+       comp_str = i_cal_component_as_ical_string_r (task_table->priv->tmp_vcal);
 
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
        e_clipboard_set_calendar (clipboard, comp_str, -1);
@@ -1230,8 +1218,7 @@ task_table_copy_clipboard (ESelectable *selectable)
 
        g_free (comp_str);
 
-       icalcomponent_free (task_table->tmp_vcal);
-       task_table->tmp_vcal = NULL;
+       g_clear_object (&task_table->priv->tmp_vcal);
 }
 
 /* Helper for calenable_table_paste_clipboard() */
@@ -1327,23 +1314,23 @@ static void
 add_retract_data (ECalComponent *comp,
                   const gchar *retract_comment)
 {
-       icalcomponent *icalcomp = NULL;
-       icalproperty *icalprop = NULL;
+       ICalComponent *icomp = NULL;
+       ICalProperty *prop = NULL;
 
-       icalcomp = e_cal_component_get_icalcomponent (comp);
+       icomp = e_cal_component_get_icalcomponent (comp);
        if (retract_comment && *retract_comment)
-               icalprop = icalproperty_new_x (retract_comment);
+               prop = i_cal_property_new_x (retract_comment);
        else
-               icalprop = icalproperty_new_x ("0");
-       icalproperty_set_x_name (icalprop, "X-EVOLUTION-RETRACT-COMMENT");
-       icalcomponent_add_property (icalcomp, icalprop);
+               prop = i_cal_property_new_x ("0");
+       i_cal_property_set_x_name (prop, "X-EVOLUTION-RETRACT-COMMENT");
+       i_cal_component_take_property (icomp, prop);
 }
 
 static gboolean
 check_for_retract (ECalComponent *comp,
                    ECalClient *client)
 {
-       ECalComponentOrganizer org;
+       ECalComponentOrganizer *org;
        gchar *email = NULL;
        const gchar *strip = NULL;
        gboolean ret_val;
@@ -1354,15 +1341,21 @@ check_for_retract (ECalComponent *comp,
        if (!e_cal_client_check_save_schedules (client))
                return FALSE;
 
-       e_cal_component_get_organizer (comp, &org);
-       strip = itip_strip_mailto (org.value);
+       org = e_cal_component_get_organizer (comp);
+       strip = org ? itip_strip_mailto (e_cal_component_organizer_get_value (org)) : NULL;
+
+       if (!strip || !*strip) {
+               e_cal_component_organizer_free (org);
+               return FALSE;
+       }
 
        ret_val = e_client_get_backend_property_sync (
                E_CLIENT (client),
-               CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS,
+               E_CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS,
                &email, NULL, NULL) && email != NULL &&
                g_ascii_strcasecmp (email, stri