From e659d5be0974fab8c1cbfad4dbe9c680dfa6f374 Mon Sep 17 00:00:00 2001 From: Louie S Date: Wed, 21 Feb 2024 20:43:58 -0500 Subject: Create rule class --- src/rule.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/rule.h (limited to 'src/rule.h') diff --git a/src/rule.h b/src/rule.h new file mode 100644 index 0000000..ecd2285 --- /dev/null +++ b/src/rule.h @@ -0,0 +1,32 @@ +#ifndef RULE_H +#define RULE_H + +#include +#include +#include + +// rule's widgets will always be allocated, even though they are only rendered when options are open +// TODO determine whether an alternative approach is better (same goes for group and entry) + +class Rule : QHBoxLayout { + enum When { before, after }; + + public: + int id; + int entry_id; + When when; + QDateTime date; + QString color = ""; + QString highlight = ""; + + Rule( + int id, + int entry_id, + When when, + QDateTime date, + QString color, + QString highlight + ); +}; + +#endif -- cgit