aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-19 07:47:52 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-19 07:47:52 +0800
commit8d96fe16f15f653d0809603ccaecd677e5708d8d (patch)
tree56d1ccf4be7dcec8a7a09524f2d312ab1da004af /calendar/cal-util
parenta1d12a819a73754b94eeaf558aefa91e77f169f3 (diff)
downloadgsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar.gz
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar.bz2
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar.lz
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar.xz
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.tar.zst
gsoc2013-evolution-8d96fe16f15f653d0809603ccaecd677e5708d8d.zip
Alarm instance generation support for the Wombat.
2000-12-18 Federico Mena Quintero <federico@helixcode.com> Alarm instance generation support for the Wombat. * idl/evolution-calendar.idl (Cal::CalAlarmInstance): Changed to have an alarm UID, the trigger time, and the actual occurrence time. (Cal::CalComponentAlarms): New structure to hold a pair of a component and its alarms that trigger in a particular range of time. (Cal::getAlarmsInRange): Changed to return a CalComponentAlarmsSeq. * cal-util/cal-component.h (CalAlarmInstance): New C-side structure to match the one on the IDL. (CalComponentAlarms): Ditto. (CalAlarmAction): Renamed from CalComponentAlarmAction. (CalAlarmTriggerType): Renamed from CalComponentAlarmTriggerType. Encoded the START and END parameters for the RELATED parameter in this enum, too. Added a NONE value for invalid or missing trigger specifications. (CalComponentAlarmTriggerRelated): Removed. (CalAlarmTrigger): Renamed from CalComponentAlarmTrigger. Renamed the duration/time fields to rel_duration/abs_time, respectively. * cal-util/cal-component.c (cal_component_alarm_get_trigger): Changed to use the new trigger structure. (cal_component_alarm_set_trigger): Likewise. (cal_component_alarm_free_trigger): Removed function. (cal_component_has_alarms): Count the elements in the alarm_uid_hash instead of trying to fetch the first alarm subcomponent. (cal_component_alarms_free): New function to free a CalComponentAlarms structure. (CalComponentAlarmPrivate): Added an uid property pointer. (scan_alarm_property): Scan for the our extension UID property. (cal_component_alarm_get_uid): New function. * pcs/cal-backend.h (CalBackendClass): Changed the signatures of the ::get_alarms_in_range() and ::get_alarms_for_object() methods. * pcs/cal-backend.c (cal_backend_get_alarms_in_range): Changed signature; use the new method. (cal_backend_get_alarms_for_object): Likewise. * pcs/cal-backend-file.c (compute_alarm_range): New spiffy function to compute a range of time for alarm occurrences. (add_alarm_occurrences_cb): New function to add alarms for a particular occurrence of the component. (generate_absolute_triggers): New function to add the absolute alarm triggers. (generate_alarms_for_comp): New function to generate all the alarm instances for a component. (cal_backend_file_get_alarms_in_range): Implemented. * pcs/cal.c (Cal_get_alarms_in_range): Use the new CalBackend API. (Cal_get_alarms_for_object): Likewise. (build_alarm_instance_seq): Removed old function. * cal-util/cal-util.c (cal_alarm_instance_list_free): Removed function. * cal-client/cal-client.c (build_component_alarms_list): New function to demarshal the component alarms sequence. (build_alarm_instance_list): New function to demarshal the alarm instances sequence. (cal_client_get_alarms_in_range): Updated for the new API. (cal_client_get_alarms_for_object): Updated for the new API. * gui/gnome-cal.c: Temporary #ifdef-ing out of alarm-related stuff to make it build. svn path=/trunk/; revision=7076
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c190
-rw-r--r--calendar/cal-util/cal-component.h95
-rw-r--r--calendar/cal-util/cal-util.c25
-rw-r--r--calendar/cal-util/cal-util.h12
4 files changed, 170 insertions, 152 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index c7a1e6e324..1ece361da7 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -118,6 +118,9 @@ struct _CalComponentAlarm {
/* Alarm icalcomponent we wrap */
icalcomponent *icalcomp;
+ /* Our extension UID property */
+ icalproperty *uid;
+
/* Properties */
icalproperty *action;
@@ -3433,7 +3436,6 @@ gboolean
cal_component_has_alarms (CalComponent *comp)
{
CalComponentPrivate *priv;
- icalcomponent *subcomp;
g_return_val_if_fail (comp != NULL, FALSE);
g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE);
@@ -3441,9 +3443,7 @@ cal_component_has_alarms (CalComponent *comp)
priv = comp->priv;
g_return_val_if_fail (priv->icalcomp != NULL, FALSE);
- subcomp = icalcomponent_get_first_component (priv->icalcomp, ICAL_VALARM_COMPONENT);
-
- return subcomp != NULL ? TRUE : FALSE;
+ return g_hash_table_size (priv->alarm_uid_hash) != 0;
}
/* Scans an icalproperty from a calendar component and adds its mapping to our
@@ -3453,6 +3453,7 @@ static void
scan_alarm_property (CalComponentAlarm *alarm, icalproperty *prop)
{
icalproperty_kind kind;
+ const char *xname;
kind = icalproperty_isa (prop);
@@ -3465,6 +3466,15 @@ scan_alarm_property (CalComponentAlarm *alarm, icalproperty *prop)
alarm->trigger = prop;
break;
+ case ICAL_X_PROPERTY:
+ xname = icalproperty_get_x_name (prop);
+ g_assert (xname != NULL);
+
+ if (strcmp (xname, EVOLUTION_ALARM_UID_PROPERTY) == 0)
+ alarm->uid = prop;
+
+ break;
+
default:
break;
}
@@ -3481,12 +3491,15 @@ make_alarm (CalComponent *comp, icalcomponent *subcomp)
alarm->parent = comp;
alarm->icalcomp = subcomp;
+ alarm->uid = NULL;
for (prop = icalcomponent_get_first_property (subcomp, ICAL_ANY_PROPERTY);
prop;
prop = icalcomponent_get_next_property (subcomp, ICAL_ANY_PROPERTY))
scan_alarm_property (alarm, prop);
+ g_assert (alarm->uid != NULL);
+
return alarm;
}
@@ -3589,6 +3602,50 @@ cal_component_alarm_free (CalComponentAlarm *alarm)
}
/**
+ * cal_component_alarms_free:
+ * @alarms: Component alarms structure.
+ *
+ * Frees a #CalComponentAlarms structure.
+ **/
+void
+cal_component_alarms_free (CalComponentAlarms *alarms)
+{
+ GSList *l;
+
+ g_return_if_fail (alarms != NULL);
+
+ g_assert (alarms->comp != NULL);
+ gtk_object_unref (GTK_OBJECT (alarms->comp));
+
+ for (l = alarms->alarms; l; l = l->next) {
+ CalAlarmInstance *instance;
+
+ instance = l->data;
+ g_assert (instance != NULL);
+ g_free (instance);
+ }
+
+ g_free (alarms->alarms);
+ g_free (alarms);
+}
+
+/**
+ * cal_component_alarm_get_uid:
+ * @alarm: An alarm subcomponent.
+ *
+ * Queries the unique identifier of an alarm subcomponent.
+ *
+ * Return value: UID of the alarm.
+ **/
+const char *
+cal_component_alarm_get_uid (CalComponentAlarm *alarm)
+{
+ g_return_val_if_fail (alarm != NULL, NULL);
+
+ return alarm_uid_from_prop (alarm->uid);
+}
+
+/**
* cal_component_alarm_get_action:
* @alarm: An alarm.
* @action: Return value for the alarm's action type.
@@ -3596,7 +3653,7 @@ cal_component_alarm_free (CalComponentAlarm *alarm)
* Queries the action type of an alarm.
**/
void
-cal_component_alarm_get_action (CalComponentAlarm *alarm, CalComponentAlarmAction *action)
+cal_component_alarm_get_action (CalComponentAlarm *alarm, CalAlarmAction *action)
{
const char *str;
@@ -3606,22 +3663,22 @@ cal_component_alarm_get_action (CalComponentAlarm *alarm, CalComponentAlarmActio
g_assert (alarm->icalcomp != NULL);
if (!alarm->action) {
- *action = CAL_COMPONENT_ALARM_NONE;
+ *action = CAL_ALARM_NONE;
return;
}
str = icalproperty_get_action (alarm->action);
if (strcasecmp (str, "AUDIO") == 0)
- *action = CAL_COMPONENT_ALARM_AUDIO;
+ *action = CAL_ALARM_AUDIO;
else if (strcasecmp (str, "DISPLAY") == 0)
- *action = CAL_COMPONENT_ALARM_DISPLAY;
+ *action = CAL_ALARM_DISPLAY;
else if (strcasecmp (str, "EMAIL") == 0)
- *action = CAL_COMPONENT_ALARM_EMAIL;
+ *action = CAL_ALARM_EMAIL;
else if (strcasecmp (str, "PROCEDURE") == 0)
- *action = CAL_COMPONENT_ALARM_PROCEDURE;
+ *action = CAL_ALARM_PROCEDURE;
else
- *action = CAL_COMPONENT_ALARM_UNKNOWN;
+ *action = CAL_ALARM_UNKNOWN;
}
/**
@@ -3632,30 +3689,30 @@ cal_component_alarm_get_action (CalComponentAlarm *alarm, CalComponentAlarmActio
* Sets the action type for an alarm.
**/
void
-cal_component_alarm_set_action (CalComponentAlarm *alarm, CalComponentAlarmAction action)
+cal_component_alarm_set_action (CalComponentAlarm *alarm, CalAlarmAction action)
{
char *str;
g_return_if_fail (alarm != NULL);
- g_return_if_fail (action != CAL_COMPONENT_ALARM_NONE);
- g_return_if_fail (action != CAL_COMPONENT_ALARM_UNKNOWN);
+ g_return_if_fail (action != CAL_ALARM_NONE);
+ g_return_if_fail (action != CAL_ALARM_UNKNOWN);
g_assert (alarm->icalcomp != NULL);
switch (action) {
- case CAL_COMPONENT_ALARM_AUDIO:
+ case CAL_ALARM_AUDIO:
str = "AUDIO";
break;
- case CAL_COMPONENT_ALARM_DISPLAY:
+ case CAL_ALARM_DISPLAY:
str = "DISPLAY";
break;
- case CAL_COMPONENT_ALARM_EMAIL:
+ case CAL_ALARM_EMAIL:
str = "EMAIL";
break;
- case CAL_COMPONENT_ALARM_PROCEDURE:
+ case CAL_ALARM_PROCEDURE:
str = "PROCEDURE";
break;
@@ -3675,16 +3732,16 @@ cal_component_alarm_set_action (CalComponentAlarm *alarm, CalComponentAlarmActio
/**
* cal_component_alarm_get_trigger:
* @alarm: An alarm.
- * @trigger: Return value for the trigger time. This should be freed using the
- * cal_component_alarm_free_trigger() function.
+ * @trigger: Return value for the trigger time.
*
* Queries the trigger time for an alarm.
**/
void
-cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrigger **trigger)
+cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalAlarmTrigger *trigger)
{
icalparameter *param;
union icaltriggertype t;
+ gboolean relative;
g_return_if_fail (alarm != NULL);
g_return_if_fail (trigger != NULL);
@@ -3692,16 +3749,13 @@ cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
g_assert (alarm->icalcomp != NULL);
if (!alarm->trigger) {
- *trigger = NULL;
+ trigger->type = CAL_ALARM_TRIGGER_NONE;
return;
}
- *trigger = g_new (CalComponentAlarmTrigger, 1);
-
/* Get trigger type */
param = icalproperty_get_first_parameter (alarm->trigger, ICAL_VALUE_PARAMETER);
-
if (param) {
icalparameter_value value;
@@ -3709,30 +3763,29 @@ cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
switch (value) {
case ICAL_VALUE_DURATION:
- (*trigger)->type = CAL_COMPONENT_ALARM_TRIGGER_RELATIVE;
+ relative = TRUE;
break;
case ICAL_VALUE_DATETIME:
- (*trigger)->type = CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE;
+ relative = FALSE;
break;
default:
g_message ("cal_component_alarm_get_trigger(): Unknown value for trigger "
"value %d; using RELATIVE", value);
- (*trigger)->type = CAL_COMPONENT_ALARM_TRIGGER_RELATIVE;
+ relative = TRUE;
break;
}
} else
- (*trigger)->type = CAL_COMPONENT_ALARM_TRIGGER_RELATIVE;
+ relative = TRUE;
/* Get trigger value and the RELATED parameter */
t = icalproperty_get_trigger (alarm->trigger);
- switch ((*trigger)->type) {
- case CAL_COMPONENT_ALARM_TRIGGER_RELATIVE:
- (*trigger)->u.relative.duration = t.duration;
+ if (relative) {
+ trigger->u.rel_duration = t.duration;
param = icalproperty_get_first_parameter (alarm->trigger, ICAL_RELATED_PARAMETER);
if (param) {
@@ -3742,29 +3795,21 @@ cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
switch (rel) {
case ICAL_RELATED_START:
- (*trigger)->u.relative.related =
- CAL_COMPONENT_ALARM_TRIGGER_RELATED_START;
+ trigger->type = CAL_ALARM_TRIGGER_RELATIVE_START;
break;
case ICAL_RELATED_END:
- (*trigger)->u.relative.related =
- CAL_COMPONENT_ALARM_TRIGGER_RELATED_END;
+ trigger->type = CAL_ALARM_TRIGGER_RELATIVE_END;
break;
default:
g_assert_not_reached ();
}
} else
- (*trigger)->u.relative.related = CAL_COMPONENT_ALARM_TRIGGER_RELATED_START;
-
- break;
-
- case CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE:
- (*trigger)->u.absolute = t.time;
- break;
-
- default:
- g_assert_not_reached ();
+ trigger->type = CAL_ALARM_TRIGGER_RELATIVE_START;
+ } else {
+ trigger->u.abs_time = t.time;
+ trigger->type = CAL_ALARM_TRIGGER_ABSOLUTE;
}
}
@@ -3776,7 +3821,7 @@ cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
* Sets the trigger time of an alarm.
**/
void
-cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrigger *trigger)
+cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalAlarmTrigger trigger)
{
union icaltriggertype t;
icalparameter *param;
@@ -3784,7 +3829,7 @@ cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
icalparameter_related related;
g_return_if_fail (alarm != NULL);
- g_return_if_fail (trigger != NULL);
+ g_return_if_fail (trigger.type != CAL_ALARM_TRIGGER_NONE);
g_assert (alarm->icalcomp != NULL);
@@ -3798,32 +3843,23 @@ cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
/* Set the value */
- value_type = ICAL_DURATION_VALUE; /* Keep GCC happy */
- related = ICAL_RELATED_START; /* Ditto */
+ related = ICAL_RELATED_START; /* Keep GCC happy */
- switch (trigger->type) {
- case CAL_COMPONENT_ALARM_TRIGGER_RELATIVE:
- t.duration = trigger->u.relative.duration;
+ switch (trigger.type) {
+ case CAL_ALARM_TRIGGER_RELATIVE_START:
+ t.duration = trigger.u.rel_duration;
value_type = ICAL_DURATION_VALUE;
+ related = ICAL_RELATED_START;
+ break;
- switch (trigger->u.relative.related) {
- case CAL_COMPONENT_ALARM_TRIGGER_RELATED_START:
- related = ICAL_RELATED_START;
- break;
-
- case CAL_COMPONENT_ALARM_TRIGGER_RELATED_END:
- related = ICAL_RELATED_END;
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
+ case CAL_ALARM_TRIGGER_RELATIVE_END:
+ t.duration = trigger.u.rel_duration;
+ value_type = ICAL_DURATION_VALUE;
+ related = ICAL_RELATED_END;
break;
- case CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE:
- t.time = trigger->u.absolute;
+ case CAL_ALARM_TRIGGER_ABSOLUTE:
+ t.time = trigger.u.abs_time;
value_type = ICAL_DATETIME_VALUE;
break;
@@ -3847,7 +3883,7 @@ cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
/* Related parameter */
- if (trigger->type == CAL_COMPONENT_ALARM_TRIGGER_RELATIVE) {
+ if (trigger.type != CAL_ALARM_TRIGGER_ABSOLUTE) {
param = icalproperty_get_first_parameter (alarm->trigger, ICAL_RELATED_PARAMETER);
if (param)
@@ -3858,17 +3894,3 @@ cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrig
}
}
}
-
-/**
- * cal_component_alarm_free_trigger:
- * @trigger: A #CalComponentAlarmTrigger structure.
- *
- * Frees a #CalComponentAlarmTrigger structure.
- **/
-void
-cal_component_alarm_free_trigger (CalComponentAlarmTrigger *trigger)
-{
- g_return_if_fail (trigger != NULL);
-
- g_free (trigger);
-}
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index f59bb33a7b..893e066f52 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -51,7 +51,9 @@ typedef enum {
CAL_COMPONENT_TIMEZONE
} CalComponentVType;
-/* Field identifiers for a calendar component */
+/* Field identifiers for a calendar component; these are used by the data model
+ * for ETable.
+ */
typedef enum {
CAL_COMPONENT_FIELD_CATEGORIES, /* concatenation of the categories list */
CAL_COMPONENT_FIELD_CLASSIFICATION,
@@ -74,8 +76,9 @@ typedef enum {
CAL_COMPONENT_FIELD_NUM_FIELDS
} CalComponentField;
-/* Structures to return properties and their parameters */
+/* Structures and enumerations to return properties and their parameters */
+/* CLASSIFICATION property */
typedef enum {
CAL_COMPONENT_CLASS_NONE,
CAL_COMPONENT_CLASS_PUBLIC,
@@ -84,6 +87,7 @@ typedef enum {
CAL_COMPONENT_CLASS_UNKNOWN
} CalComponentClassification;
+/* Properties that have time and timezone information */
typedef struct {
/* Actual date/time value */
struct icaltimetype *value;
@@ -92,11 +96,13 @@ typedef struct {
const char *tzid;
} CalComponentDateTime;
+/* Way in which a period of time is specified */
typedef enum {
CAL_COMPONENT_PERIOD_DATETIME,
CAL_COMPONENT_PERIOD_DURATION
} CalComponentPeriodType;
+/* Period of time, can have explicit start/end times or start/duration instead */
typedef struct {
CalComponentPeriodType type;
@@ -108,6 +114,7 @@ typedef struct {
} u;
} CalComponentPeriod;
+/* Text properties */
typedef struct {
/* Description string */
const char *value;
@@ -116,6 +123,7 @@ typedef struct {
const char *altrep;
} CalComponentText;
+/* Time transparency */
typedef enum {
CAL_COMPONENT_TRANSP_NONE,
CAL_COMPONENT_TRANSP_TRANSPARENT,
@@ -123,7 +131,7 @@ typedef enum {
CAL_COMPONENT_TRANSP_UNKNOWN
} CalComponentTransparency;
-typedef struct _CalComponentAlarm CalComponentAlarm;
+/* Main calendar component object */
typedef struct _CalComponent CalComponent;
typedef struct _CalComponentClass CalComponentClass;
@@ -262,37 +270,58 @@ void cal_component_free_text_list (GSList *text_list);
/* Alarms */
-typedef enum {
- CAL_COMPONENT_ALARM_NONE,
- CAL_COMPONENT_ALARM_AUDIO,
- CAL_COMPONENT_ALARM_DISPLAY,
- CAL_COMPONENT_ALARM_EMAIL,
- CAL_COMPONENT_ALARM_PROCEDURE,
- CAL_COMPONENT_ALARM_UNKNOWN
-} CalComponentAlarmAction;
+/* Opaque structure used to represent alarm subcomponents */
+typedef struct _CalComponentAlarm CalComponentAlarm;
-typedef enum {
- CAL_COMPONENT_ALARM_TRIGGER_RELATIVE,
- CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE
-} CalComponentAlarmTriggerType;
+/* An alarm occurrence, i.e. a trigger instance */
+typedef struct {
+ /* UID of the alarm that triggered */
+ const char *auid;
+
+ /* Trigger time, i.e. "5 minutes before the appointment" */
+ time_t trigger;
+ /* Actual event occurrence to which this trigger corresponds */
+ time_t occur;
+} CalAlarmInstance;
+
+/* Alarm trigger instances for a particular component */
+typedef struct {
+ /* The actual component */
+ CalComponent *comp;
+
+ /* List of CalAlarmInstance structures */
+ GSList *alarms;
+} CalComponentAlarms;
+
+/* Alarm types */
+typedef enum {
+ CAL_ALARM_NONE,
+ CAL_ALARM_AUDIO,
+ CAL_ALARM_DISPLAY,
+ CAL_ALARM_EMAIL,
+ CAL_ALARM_PROCEDURE,
+ CAL_ALARM_UNKNOWN
+} CalAlarmAction;
+
+/* Whether a trigger is relative to the start or end of an event occurrence, or
+ * whether it is specified to occur at an absolute time.
+ */
typedef enum {
- CAL_COMPONENT_ALARM_TRIGGER_RELATED_START,
- CAL_COMPONENT_ALARM_TRIGGER_RELATED_END
-} CalComponentAlarmTriggerRelated;
+ CAL_ALARM_TRIGGER_NONE,
+ CAL_ALARM_TRIGGER_RELATIVE_START,
+ CAL_ALARM_TRIGGER_RELATIVE_END,
+ CAL_ALARM_TRIGGER_ABSOLUTE
+} CalAlarmTriggerType;
typedef struct {
- CalComponentAlarmTriggerType type;
+ CalAlarmTriggerType type;
union {
- struct {
- struct icaldurationtype duration;
- CalComponentAlarmTriggerRelated related;
- } relative;
-
- struct icaltimetype absolute;
+ struct icaldurationtype rel_duration;
+ struct icaltimetype abs_time;
} u;
-} CalComponentAlarmTrigger;
+} CalAlarmTrigger;
gboolean cal_component_has_alarms (CalComponent *comp);
GList *cal_component_get_alarm_uids (CalComponent *comp);
@@ -300,12 +329,16 @@ CalComponentAlarm *cal_component_get_alarm (CalComponent *comp, const char *auid
void cal_component_alarm_free (CalComponentAlarm *alarm);
-void cal_component_alarm_get_action (CalComponentAlarm *alarm, CalComponentAlarmAction *action);
-void cal_component_alarm_set_action (CalComponentAlarm *alarm, CalComponentAlarmAction action);
+void cal_component_alarms_free (CalComponentAlarms *alarms);
+
+const char *cal_component_alarm_get_uid (CalComponentAlarm *alarm);
+
+void cal_component_alarm_get_action (CalComponentAlarm *alarm, CalAlarmAction *action);
+void cal_component_alarm_set_action (CalComponentAlarm *alarm, CalAlarmAction action);
+
+void cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalAlarmTrigger *trigger);
+void cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalAlarmTrigger trigger);
-void cal_component_alarm_get_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrigger **trigger);
-void cal_component_alarm_set_trigger (CalComponentAlarm *alarm, CalComponentAlarmTrigger *trigger);
-void cal_component_alarm_free_trigger (CalComponentAlarmTrigger *trigger);
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index 092fd79889..c75a65d7d5 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -51,31 +51,6 @@ cal_obj_instance_list_free (GList *list)
}
/**
- * cal_alarm_instance_list_free:
- * @list: List of #CalAlarmInstance structures.
- *
- * Frees a list of #CalAlarmInstance structures.
- **/
-void
-cal_alarm_instance_list_free (GList *list)
-{
- CalAlarmInstance *i;
- GList *l;
-
- for (l = list; l; l = l->next) {
- i = l->data;
-
- g_assert (i != NULL);
- g_assert (i->uid != NULL);
-
- g_free (i->uid);
- g_free (i);
- }
-
- g_list_free (list);
-}
-
-/**
* cal_obj_uid_list_free:
* @list: List of strings with unique identifiers.
*
diff --git a/calendar/cal-util/cal-util.h b/calendar/cal-util/cal-util.h
index 5c640a2d89..ac7838885e 100644
--- a/calendar/cal-util/cal-util.h
+++ b/calendar/cal-util/cal-util.h
@@ -41,18 +41,6 @@ typedef struct {
void cal_obj_instance_list_free (GList *list);
-/* Instance of an alarm trigger */
-typedef struct {
- char *uid; /* UID of object */
-#if 0
- enum AlarmType type; /* Type of alarm */
-#endif
- time_t trigger; /* Alarm trigger time */
- time_t occur; /* Occurrence time */
-} CalAlarmInstance;
-
-void cal_alarm_instance_list_free (GList *list);
-
/* Used for multiple UID queries */
typedef enum {
CALOBJ_TYPE_EVENT = 1 << 0,