From dc161b3b67c6290b52d0ec33e690ada53faada43 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sun, 8 Dec 2019 17:26:52 +0100 Subject: User interface for recurrence rules The function update_rept() is extended with editing of the three recurrence rule lists for BYMONTH, BYMONTHDAY and BYDAY. The integers of the bymonth and bymonthday lists are edited directly as integers, while those of the bywday list are mapped to localized weekday names (as they appear in the calendar panel) with an optional integer prefix (in RFC5545 style: 1MO, -2SA). The RFC5545 (icalendar) requirement that the start day must be the first occurrence and must match the recurrence rule, is met by testing that an occurrence indeed appears on the start day, in these circumstances: - when a recurrent item is loaded from file - when the recurrence rule of an item is edited interactively - when a recurrent appointment gets a new start time - when a recurrent appointment is moved Copy and paste of a recurrent item will only retain the basic recurrence properties of type, frequency, until and exception days. Signed-off-by: Lukas Fleischer --- src/calcurse.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/calcurse.h') diff --git a/src/calcurse.h b/src/calcurse.h index 6b3905b..dab1543 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -407,6 +407,16 @@ struct rpt { llist_t exc; /* EXDATE's */ }; +/* Types of integers in rrule lists. */ +typedef enum { + BYMONTH, + BYDAY_W, + BYDAY_M, + BYDAY_Y, + BYMONTHDAY, + NOLL +} int_list_t; + /* Recurrent appointment definition. */ struct recur_apoint { struct rpt *rpt; /* recurrence rule */ @@ -1042,6 +1052,8 @@ void pcal_export_data(FILE *); /* recur.c */ extern llist_ts_t recur_alist_p; extern llist_t recur_elist; +void recur_free_int_list(llist_t *); +void recur_int_list_dup(llist_t *, llist_t *); void recur_free_exc_list(llist_t *); void recur_exc_dup(llist_t *, llist_t *); int recur_str2exc(llist_t *, char *); -- cgit v1.2.3-54-g00ecf