aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/calobj.c16
-rw-r--r--calendar/pcs/calobj.h7
2 files changed, 11 insertions, 12 deletions
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index 89bfc94540..c2fadad4d7 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -680,7 +680,7 @@ ical_object_to_vobject (iCalObject *ical)
}
void
-ical_foreach (GList *events, iCalObjectFn fn, void *closure)
+ical_foreach (GList *events, calendarfn fn, void *closure)
{
for (; events; events = events->next){
iCalObject *ical = events->data;
@@ -690,13 +690,13 @@ ical_foreach (GList *events, iCalObjectFn fn, void *closure)
}
void
-ical_object_set_user_data (iCalObject *ical, void *user_data)
+ical_object_generate_events (iCalObject *ico, time_t start, time_t end, calendarfn cb, void *closure)
{
- ical->user_data = user_data;
-}
+ if (!ico->recur){
+ if ((start <= ico->dtstart) && (ico->dtend <= end))
+ (*cb)(ico, ico->dtstart, ico->dtend, closure);
+ return;
+ }
-void *
-ical_object_get_user_data (iCalObject *ical)
-{
- return ical->user_data;
+ /* The event has a recurrence rule */
}
diff --git a/calendar/pcs/calobj.h b/calendar/pcs/calobj.h
index 9b69eefd5f..ab9d061956 100644
--- a/calendar/pcs/calobj.h
+++ b/calendar/pcs/calobj.h
@@ -157,16 +157,15 @@ typedef struct {
} iCalObject;
/* The callback for the recurrence generator */
-typedef void (*iCalObjectFn)(iCalObject *, time_t, time_t, void *);
+typedef void (*calendarfn)(iCalObject *, time_t, time_t, void *);
iCalObject *ical_new (char *comment, char *organizer, char *summary);
iCalObject *ical_object_new (void);
void ical_object_destroy (iCalObject *ico);
iCalObject *ical_object_create_from_vobject (VObject *obj, const char *object_name);
VObject *ical_object_to_vobject (iCalObject *ical);
-void ical_foreach (GList *events, iCalObjectFn fn, void *closure);
-void ical_object_set_user_data (iCalObject *ical, void *user_data);
-void *ical_object_get_user_data (iCalObject *ical);
+void ical_foreach (GList *events, calendarfn fn, void *closure);
+void ical_object_generate_events (iCalObject *ico, time_t start, time_t end, calendarfn cb, void *closure);
END_GNOME_DECLS