author | zecke <zecke> | 2002-04-13 16:27:19 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-13 16:27:19 (UTC) |
commit | def870c6fcccf2b20d7ce3821055391b18243a24 (patch) (unidiff) | |
tree | 006357788654cf0e18c76640bd821cf87731d952 /libopie/todoevent.h | |
parent | e42465b45553f51cf7c7d24130aa3a90a6be3ddd (diff) | |
download | opie-def870c6fcccf2b20d7ce3821055391b18243a24.zip opie-def870c6fcccf2b20d7ce3821055391b18243a24.tar.gz opie-def870c6fcccf2b20d7ce3821055391b18243a24.tar.bz2 |
multiple categories
-rw-r--r-- | libopie/todoevent.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libopie/todoevent.h b/libopie/todoevent.h index ac996a1..0d477fd 100644 --- a/libopie/todoevent.h +++ b/libopie/todoevent.h | |||
@@ -1,57 +1,64 @@ | |||
1 | 1 | ||
2 | #ifndef todoevent_h | 2 | #ifndef todoevent_h |
3 | #define todoevent_h | 3 | #define todoevent_h |
4 | 4 | ||
5 | #include <qstringlist.h> | ||
5 | #include <qdatetime.h> | 6 | #include <qdatetime.h> |
6 | 7 | ||
7 | class ToDoEvent { | 8 | class ToDoEvent { |
8 | friend class ToDoDB; | 9 | friend class ToDoDB; |
9 | public: | 10 | public: |
10 | enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW }; | 11 | enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW }; |
11 | ToDoEvent( bool completed = false, int priority = NORMAL, | 12 | ToDoEvent( bool completed = false, int priority = NORMAL, |
12 | const QString &category = QString::null, | 13 | const QStringList &category = QStringList(), |
13 | const QString &description = QString::null , | 14 | const QString &description = QString::null , |
14 | bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); | 15 | bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); |
15 | ToDoEvent(const ToDoEvent & ); | 16 | ToDoEvent(const ToDoEvent & ); |
16 | bool isCompleted() const; | 17 | bool isCompleted() const; |
17 | bool hasDate() const; | 18 | bool hasDate() const; |
18 | int priority()const ; | 19 | int priority()const ; |
19 | QString category()const; | 20 | QStringList allCategories()const; |
20 | QArray<int> categories() const; | 21 | QArray<int> categories() const; |
21 | QDate date()const; | 22 | QDate date()const; |
22 | QString description()const; | 23 | QString description()const; |
23 | 24 | ||
24 | int uid()const { return m_uid;}; | 25 | int uid()const { return m_uid;}; |
25 | void setCompleted(bool completed ); | 26 | void setCompleted(bool completed ); |
26 | void setHasDate( bool hasDate ); | 27 | void setHasDate( bool hasDate ); |
27 | // if the category doesn't exist we will create it | 28 | // if the category doesn't exist we will create it |
29 | // this sets the the Category after this call category will be the only category | ||
28 | void setCategory( const QString &category ); | 30 | void setCategory( const QString &category ); |
31 | // adds a category to the Categories of this event | ||
32 | void insertCategory(const QString &category ); | ||
33 | void clearCategories(); | ||
34 | void setCategories(const QStringList& ); | ||
35 | |||
29 | void setPriority(int priority ); | 36 | void setPriority(int priority ); |
30 | void setDate( QDate date ); | 37 | void setDate( QDate date ); |
31 | void setDescription(const QString& ); | 38 | void setDescription(const QString& ); |
32 | bool isOverdue(); | 39 | bool isOverdue(); |
33 | 40 | ||
34 | bool match( const QRegExp &r )const; | 41 | bool match( const QRegExp &r )const; |
35 | 42 | ||
36 | void setUid(int id) {m_uid = id; }; | 43 | void setUid(int id) {m_uid = id; }; |
37 | bool operator<(const ToDoEvent &toDoEvent )const; | 44 | bool operator<(const ToDoEvent &toDoEvent )const; |
38 | bool operator<=(const ToDoEvent &toDoEvent )const; | 45 | bool operator<=(const ToDoEvent &toDoEvent )const; |
39 | bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; | 46 | bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; |
40 | bool operator>(const ToDoEvent &toDoEvent )const; | 47 | bool operator>(const ToDoEvent &toDoEvent )const; |
41 | bool operator>=(const ToDoEvent &toDoEvent)const; | 48 | bool operator>=(const ToDoEvent &toDoEvent)const; |
42 | bool operator==(const ToDoEvent &toDoEvent )const; | 49 | bool operator==(const ToDoEvent &toDoEvent )const; |
43 | ToDoEvent &operator=(const ToDoEvent &toDoEvent ); | 50 | ToDoEvent &operator=(const ToDoEvent &toDoEvent ); |
44 | private: | 51 | private: |
45 | class ToDoEventPrivate; | 52 | class ToDoEventPrivate; |
46 | ToDoEventPrivate *d; | 53 | ToDoEventPrivate *d; |
47 | QDate m_date; | 54 | QDate m_date; |
48 | bool m_isCompleted:1; | 55 | bool m_isCompleted:1; |
49 | bool m_hasDate:1; | 56 | bool m_hasDate:1; |
50 | int m_priority; | 57 | int m_priority; |
51 | QString m_category; | 58 | QStringList m_category; |
52 | QString m_desc; | 59 | QString m_desc; |
53 | int m_uid; | 60 | int m_uid; |
54 | }; | 61 | }; |
55 | 62 | ||
56 | 63 | ||
57 | #endif | 64 | #endif |