From 4e5b1da82e7ada3667bfa47471defd5932afc405 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 2 Aug 2000 01:08:52 +0000 Subject: Use CalComponent and the new property types instead of the old iCalObject 2000-07-31 Federico Mena Quintero * cal-util/cal-recur.c (*): Use CalComponent and the new property types instead of the old iCalObject stuff. (cal_recur_generate_instances): Renamed from cal_object_generate_events(). Ensure that the component has the DTSTART property. (generate_instances_for_year): Renamed from cal_object_generate_events_for_year(). (cal_obj_expand_recurrence): Made static. (cal_recur_from_icalrecurrencetype): New function. We should really convert this whole file to use struct icalrecurrencetype instead. (cal_recur_free): New function. * cal-util/cal-recur.h (CalRecurType): Renamed from CalObjRecurType. (CalRecurrence): Renamed from CalObjRecurrence. * cal-util/timeutil.c (time_from_icaltimetype): New function. * cal-util/Makefile.am: Commented out the test-recur program. svn path=/trunk/; revision=4464 --- calendar/cal-util/cal-recur.h | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'calendar/cal-util/cal-recur.h') diff --git a/calendar/cal-util/cal-recur.h b/calendar/cal-util/cal-recur.h index 391fbfd491..621985b71b 100644 --- a/calendar/cal-util/cal-recur.h +++ b/calendar/cal-util/cal-recur.h @@ -26,15 +26,10 @@ #include #include -#include "calobj.h" +#include BEGIN_GNOME_DECLS - -/* FIXME: I've put modified versions of RecurType and Recurrence here, since - the ones in calobj.h don't support all of iCalendar. Hopefully Seth will - update those soon and these can be removed. */ - typedef enum { CAL_RECUR_YEARLY, CAL_RECUR_MONTHLY, @@ -43,10 +38,10 @@ typedef enum { CAL_RECUR_HOURLY, CAL_RECUR_MINUTELY, CAL_RECUR_SECONDLY -} CalObjRecurType; +} CalRecurType; typedef struct { - CalObjRecurType type; + CalRecurType type; int interval; @@ -90,10 +85,7 @@ typedef struct { /* For BYSETPOS modifier. A list of GINT_TO_POINTERs, +ve or -ve. */ GList *bysetpos; -} CalObjRecurrence; - - - +} CalRecurrence; /* This is what we use to represent a date & time. */ typedef struct _CalObjTime CalObjTime; @@ -106,21 +98,19 @@ struct _CalObjTime { guint8 second; /* 0 - 59 (maybe 60 for leap second) */ }; +typedef gboolean (* CalRecurInstanceFn) (CalComponent *comp, + time_t instance_start, + time_t instace_end, + gpointer data); -/* This will eventually replace ical_object_generate_events(). */ -void cal_object_generate_events (iCalObject *ico, - time_t start, - time_t end, - calendarfn cb, - void *closure); - - -/* This is an internal function, only here for testing. */ -GArray* cal_obj_expand_recurrence (CalObjTime *event_start, - CalObjRecurrence *recur, - CalObjTime *interval_start, - CalObjTime *interval_end); +void cal_recur_generate_instances (CalComponent *comp, + time_t start, + time_t end, + CalRecurInstanceFn cb, + gpointer cb_data); +CalRecurrence *cal_recur_from_icalrecurrencetype (struct icalrecurrencetype *ir); +void cal_recur_free (CalRecurrence *r); END_GNOME_DECLS -- cgit v1.2.3