aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util/cal-recur.h
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-05-20 18:38:19 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-05-20 18:38:19 +0800
commit4eb47f9a4696877218bf05d53c52f829d2afcdd5 (patch)
tree81a7adf9cc66caa99031a1908d7317d616ea2b64 /calendar/cal-util/cal-recur.h
parentccd4d84234d933ccf05769e71a3372e149d707d1 (diff)
downloadgsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar.gz
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar.bz2
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar.lz
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar.xz
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.tar.zst
gsoc2013-evolution-4eb47f9a4696877218bf05d53c52f829d2afcdd5.zip
new files to implement iCalendar recurrence rules. These are only part
2000-05-20 Damon Chaplin <damon@helixcode.com> * cal-util/cal-recur.[hc]: new files to implement iCalendar recurrence rules. These are only part finished, but people may like to check that the architecture seems OK. 2000-05-17 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c (e_day_view_on_delete_occurrence): * gui/e-week-view.c (e_week_view_on_delete_occurrence): use a copy of the iCalObject so we detect the change in the "update_event" callback. Maybe we should just update the view ourselves and then we wouldn't need to detect any change in the callback. * cal-util/calobj.c (ical_object_reset_recurrence): new function to get rid of any recurrence rules. Used when we 'unrecur' an event. * gui/e-day-view.c (e_day_view_key_press): don't add a new event if it won't fit, or we end up adding a new event for each key press. (e_day_view_update_event_label): don't update it if it doesn't have an EText item (i.e. it isn't visible). * gui/e-day-view-time-item.c: allow selection of times using this column. svn path=/trunk/; revision=3144
Diffstat (limited to 'calendar/cal-util/cal-recur.h')
-rw-r--r--calendar/cal-util/cal-recur.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-recur.h b/calendar/cal-util/cal-recur.h
new file mode 100644
index 0000000000..340b897417
--- /dev/null
+++ b/calendar/cal-util/cal-recur.h
@@ -0,0 +1,102 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Evolution calendar recurrence rule functions
+ *
+ * Copyright (C) 2000 Helix Code, Inc.
+ *
+ * Author: Damon Chaplin <damon@helixcode.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef CAL_RECURL_H
+#define CAL_RECUR_H
+
+#include <libgnome/gnome-defs.h>
+#include <glib.h>
+
+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. */
+
+enum RecurType {
+ RECUR_YEARLY,
+ RECUR_MONTHLY,
+ RECUR_WEEKLY,
+ RECUR_DAILY,
+ RECUR_HOURLY,
+ RECUR_MINUTELY,
+ RECUR_SECONDLY,
+};
+
+typedef struct {
+ enum RecurType type;
+
+ int interval;
+
+ int weekday;
+
+ int month_pos;
+
+ int month_day;
+
+
+ /* For BYMONTH modifier. A list of GINT_TO_POINTERs, 0-11. */
+ GList *bymonth;
+
+
+ /* For BYHOUR modifier. A list of GINT_TO_POINTERs, 0-23. */
+ GList *byhour;
+
+ /* For BYMINUTE modifier. A list of GINT_TO_POINTERs, 0-59. */
+ GList *byminute;
+
+ /* For BYSECOND modifier. A list of GINT_TO_POINTERs, 0-60. */
+ GList *bysecond;
+
+} Recurrence;
+
+
+
+/* This is what we use to represent a date & time. */
+typedef struct _CalObjTime CalObjTime;
+struct _CalObjTime {
+ guint16 year;
+ guint8 month; /* 0 - 11 */
+ guint8 day; /* 1 - 31 */
+ guint8 hour; /* 0 - 23 */
+ guint8 minute; /* 0 - 59 */
+ guint8 second; /* 0 - 59 (maybe 60 for leap second) */
+};
+
+
+
+/* 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,
+ CalObjTime *interval_start,
+ CalObjTime *interval_end);
+
+END_GNOME_DECLS
+
+#endif