diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-08-06 10:14:03 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-08-06 12:08:14 +0200 |
commit | 1878b7c4b053f6f2600d3edd84227d7e505f9e37 (patch) | |
tree | cbb928e0017f91f1d211ebd531a467be766b1267 /src/calcurse.h | |
parent | 86553f35feea67f0ac70018ccfde1903106b4c4d (diff) | |
download | calcurse-1878b7c4b053f6f2600d3edd84227d7e505f9e37.zip |
Allow for filtering TODO items
The item filters now apply to both appointments and TODO items. Also,
add a new type mask "todo" and the following new filter options:
* --filter-priority
* --filter-completed
* --filter-uncompleted
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r-- | src/calcurse.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/calcurse.h b/src/calcurse.h index 0290520..2c6dd00 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -373,7 +373,7 @@ union aptev_ptr { struct recur_event *rev; }; -/* Available types of items. */ +/* Available item types in the calendar view. */ enum day_item_type { DAY_HEADING = 1, RECUR_EVNT, @@ -383,13 +383,24 @@ enum day_item_type { APPT }; +/* Available item types. */ +enum item_type { + TYPE_EVNT, + TYPE_APPT, + TYPE_RECUR_EVNT, + TYPE_RECUR_APPT, + TYPE_TODO +}; + /* Available item type masks. */ -#define TYPE_MASK_EVNT (1 << EVNT) -#define TYPE_MASK_APPT (1 << APPT) -#define TYPE_MASK_RECUR_EVNT (1 << RECUR_EVNT) -#define TYPE_MASK_RECUR_APPT (1 << RECUR_APPT) +#define TYPE_MASK_EVNT (1 << TYPE_EVNT) +#define TYPE_MASK_APPT (1 << TYPE_APPT) +#define TYPE_MASK_RECUR_EVNT (1 << TYPE_RECUR_EVNT) +#define TYPE_MASK_RECUR_APPT (1 << TYPE_RECUR_APPT) #define TYPE_MASK_RECUR (TYPE_MASK_RECUR_EVNT | TYPE_MASK_RECUR_APPT) -#define TYPE_MASK_ALL (TYPE_MASK_EVNT | TYPE_MASK_APPT | TYPE_MASK_RECUR) +#define TYPE_MASK_CAL (TYPE_MASK_EVNT | TYPE_MASK_APPT | TYPE_MASK_RECUR) +#define TYPE_MASK_TODO (1 << TYPE_TODO) +#define TYPE_MASK_ALL (TYPE_MASK_CAL | TYPE_MASK_TODO) /* Filter settings. */ struct item_filter { @@ -399,6 +410,9 @@ struct item_filter { long start_to; long end_from; long end_to; + int priority; + int completed; + int uncompleted; }; /* Generic item description (to hold appointments, events...). */ @@ -781,7 +795,7 @@ unsigned io_save_todo(const char *); unsigned io_save_keys(void); void io_save_cal(enum save_display); void io_load_app(struct item_filter *); -void io_load_todo(void); +void io_load_todo(struct item_filter *); void io_load_keys(const char *); int io_check_dir(const char *); unsigned io_dir_exists(const char *); |