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 <lfleischer@calcurse.org>
This commit is contained in:
Lars Henriksen
2019-12-08 17:26:52 +01:00
committed by Lukas Fleischer
parent eda28d3fef
commit dc161b3b67
3 changed files with 416 additions and 77 deletions

View File

@@ -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 *);