aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util/cal-recur.h
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-06-01 06:09:33 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-06-01 06:09:33 +0800
commit10e4e8dc54f63f5516acffdf5e28b39d7a549843 (patch)
tree56580ab967e59a4676f9a47274fff19c13b5db9f /calendar/cal-util/cal-recur.h
parent74ff74bf9b704a9cd6c007d25256d2ee6bbdad2f (diff)
downloadgsoc2013-evolution-10e4e8dc54f63f5516acffdf5e28b39d7a549843.tar.gz
gsoc2013-evolution-10e4e8dc54f63f5516acffdf5e28b39d7a549843.tar.zst
gsoc2013-evolution-10e4e8dc54f63f5516acffdf5e28b39d7a549843.zip
added test-recur test program.
2000-05-31 Damon Chaplin <damon@helixcode.com> * cal-util/Makefile.am: added test-recur test program. * cal-util/test-recur.c: new file to test the recurrence code. * cal-util/.cvsignore: added test-recur. * cal-util/cal-recur.c: updated. svn path=/trunk/; revision=3315
Diffstat (limited to 'calendar/cal-util/cal-recur.h')
-rw-r--r--calendar/cal-util/cal-recur.h62
1 files changed, 39 insertions, 23 deletions
diff --git a/calendar/cal-util/cal-recur.h b/calendar/cal-util/cal-recur.h
index 340b897417..6069ff5f75 100644
--- a/calendar/cal-util/cal-recur.h
+++ b/calendar/cal-util/cal-recur.h
@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef CAL_RECURL_H
+#ifndef CAL_RECUR_H
#define CAL_RECUR_H
#include <libgnome/gnome-defs.h>
@@ -34,31 +34,49 @@ BEGIN_GNOME_DECLS
the ones in calobj.h don't support all of iCalendar. Hopefully Seth will
update those soon and these can be removed. */
-enum RecurType {
- RECUR_YEARLY,
- RECUR_MONTHLY,
- RECUR_WEEKLY,
- RECUR_DAILY,
- RECUR_HOURLY,
- RECUR_MINUTELY,
- RECUR_SECONDLY,
-};
+typedef enum {
+ CAL_RECUR_YEARLY,
+ CAL_RECUR_MONTHLY,
+ CAL_RECUR_WEEKLY,
+ CAL_RECUR_DAILY,
+ CAL_RECUR_HOURLY,
+ CAL_RECUR_MINUTELY,
+ CAL_RECUR_SECONDLY
+} CalObjRecurType;
typedef struct {
- enum RecurType type;
+ CalObjRecurType type;
int interval;
- int weekday;
+ /* Specifies the end of the recurrence. No occurrences are generated
+ after this date. If it is 0, the event recurs forever. */
+ time_t enddate;
- int month_pos;
+ /* WKST property - the week start day: 0 = Monday to 6 = Sunday. */
+ gint week_start_day;
- int month_day;
+ /* NOTE: I've used GList's here, but it doesn't matter if we use
+ other data structures like arrays. The code should be easy to
+ change. So long as it is easy to see if the modifier is set. */
/* For BYMONTH modifier. A list of GINT_TO_POINTERs, 0-11. */
GList *bymonth;
+ /* For BYWEEKNO modifier. A list of GINT_TO_POINTERs, [+-]1-53. */
+ GList *byweekno;
+
+ /* For BYYEARDAY modifier. A list of GINT_TO_POINTERs, [+-]1-366. */
+ GList *byyearday;
+
+ /* For BYMONTHDAY modifier. A list of GINT_TO_POINTERs, [+-]1-31. */
+ GList *bymonthday;
+
+ /* For BYDAY modifier. A list of GINT_TO_POINTERs, in pairs.
+ The first of each pair is the weekday, 0 = Monday to 6 = Sunday.
+ The second of each pair is the week number [+-]0-53. */
+ GList *byday;
/* For BYHOUR modifier. A list of GINT_TO_POINTERs, 0-23. */
GList *byhour;
@@ -69,7 +87,10 @@ typedef struct {
/* For BYSECOND modifier. A list of GINT_TO_POINTERs, 0-60. */
GList *bysecond;
-} Recurrence;
+ /* For BYSETPOS modifier. A list of GINT_TO_POINTERs, +ve or -ve. */
+ GList *bysetpos;
+} CalObjRecurrence;
+
@@ -86,17 +107,12 @@ struct _CalObjTime {
-/* Returns an unsorted array of time_t's resulting from expanding the
- recurrence within the given interval. Each iCalendar event can have any
- number of recurrence rules specifying occurrences of the event, as well as
- any number of recurrence rules specifying exceptions. */
-GArray*
-cal_obj_expand_recurrence (CalObjTime *event_start,
- CalObjTime *event_end,
- Recurrence *recur,
+GArray* cal_obj_expand_recurrence (CalObjTime *event_start,
+ CalObjRecurrence *recur,
CalObjTime *interval_start,
CalObjTime *interval_end);
+
END_GNOME_DECLS
#endif