summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie/todoevent.h b/libopie/todoevent.h
index 40d8f0b..8a00f99 100644
--- a/libopie/todoevent.h
+++ b/libopie/todoevent.h
@@ -1,91 +1,92 @@
1 1
2#ifndef todoevent_h 2#ifndef todoevent_h
3#define todoevent_h 3#define todoevent_h
4 4
5#include <qregexp.h>
5#include <qstringlist.h> 6#include <qstringlist.h>
6#include <qdatetime.h> 7#include <qdatetime.h>
7 8
8class ToDoEvent { 9class ToDoEvent {
9 friend class ToDoDB; 10 friend class ToDoDB;
10 public: 11 public:
11 // priorities from Very low to very high 12 // priorities from Very low to very high
12 enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW }; 13 enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW };
13 /* Constructs a new ToDoEvent 14 /* Constructs a new ToDoEvent
14 @param completed Is the TodoEvent completed 15 @param completed Is the TodoEvent completed
15 @param priority What is the priority of this ToDoEvent 16 @param priority What is the priority of this ToDoEvent
16 @param category Which category does it belong( uid ) 17 @param category Which category does it belong( uid )
17 @param description What is this ToDoEvent about 18 @param description What is this ToDoEvent about
18 @param hasDate Does this Event got a deadline 19 @param hasDate Does this Event got a deadline
19 @param date what is the deadline? 20 @param date what is the deadline?
20 @param uid what is the UUID of this Event 21 @param uid what is the UUID of this Event
21 **/ 22 **/
22 ToDoEvent( bool completed = false, int priority = NORMAL, 23 ToDoEvent( bool completed = false, int priority = NORMAL,
23 const QStringList &category = QStringList(), 24 const QStringList &category = QStringList(),
24 const QString &description = QString::null , 25 const QString &description = QString::null ,
25 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); 26 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 );
26 /* Copy c'tor 27 /* Copy c'tor
27 28
28 **/ 29 **/
29 ToDoEvent(const ToDoEvent & ); 30 ToDoEvent(const ToDoEvent & );
30 31
31 /* 32 /*
32 Is this event completed? 33 Is this event completed?
33 **/ 34 **/
34 bool isCompleted() const; 35 bool isCompleted() const;
35 36
36 /* 37 /*
37 Does this Event have a deadline 38 Does this Event have a deadline
38 **/ 39 **/
39 bool hasDate() const; 40 bool hasDate() const;
40 41
41 /* 42 /*
42 What is the priority? 43 What is the priority?
43 **/ 44 **/
44 int priority()const ; 45 int priority()const ;
45 QStringList allCategories()const; 46 QStringList allCategories()const;
46 QArray<int> categories() const; 47 QArray<int> categories() const;
47 QDate date()const; 48 QDate date()const;
48 QString description()const; 49 QString description()const;
49 50
50 QString richText() const; 51 QString richText() const;
51 52
52 int uid()const { return m_uid;}; 53 int uid()const { return m_uid;};
53 void setCompleted(bool completed ); 54 void setCompleted(bool completed );
54 void setHasDate( bool hasDate ); 55 void setHasDate( bool hasDate );
55 // if the category doesn't exist we will create it 56 // if the category doesn't exist we will create it
56 // this sets the the Category after this call category will be the only category 57 // this sets the the Category after this call category will be the only category
57 void setCategory( const QString &category ); 58 void setCategory( const QString &category );
58 // adds a category to the Categories of this event 59 // adds a category to the Categories of this event
59 void insertCategory(const QString &category ); 60 void insertCategory(const QString &category );
60 void clearCategories(); 61 void clearCategories();
61 void setCategories(const QStringList& ); 62 void setCategories(const QStringList& );
62 63
63 void setPriority(int priority ); 64 void setPriority(int priority );
64 void setDate( QDate date ); 65 void setDate( QDate date );
65 void setDescription(const QString& ); 66 void setDescription(const QString& );
66 bool isOverdue(); 67 bool isOverdue();
67 68
68 bool match( const QRegExp &r )const; 69 bool match( const QRegExp &r )const;
69 70
70 void setUid(int id) {m_uid = id; }; 71 void setUid(int id) {m_uid = id; };
71 bool operator<(const ToDoEvent &toDoEvent )const; 72 bool operator<(const ToDoEvent &toDoEvent )const;
72 bool operator<=(const ToDoEvent &toDoEvent )const; 73 bool operator<=(const ToDoEvent &toDoEvent )const;
73 bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; 74 bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); };
74 bool operator>(const ToDoEvent &toDoEvent )const; 75 bool operator>(const ToDoEvent &toDoEvent )const;
75 bool operator>=(const ToDoEvent &toDoEvent)const; 76 bool operator>=(const ToDoEvent &toDoEvent)const;
76 bool operator==(const ToDoEvent &toDoEvent )const; 77 bool operator==(const ToDoEvent &toDoEvent )const;
77 ToDoEvent &operator=(const ToDoEvent &toDoEvent ); 78 ToDoEvent &operator=(const ToDoEvent &toDoEvent );
78 private: 79 private:
79 class ToDoEventPrivate; 80 class ToDoEventPrivate;
80 ToDoEventPrivate *d; 81 ToDoEventPrivate *d;
81 QDate m_date; 82 QDate m_date;
82 bool m_isCompleted:1; 83 bool m_isCompleted:1;
83 bool m_hasDate:1; 84 bool m_hasDate:1;
84 int m_priority; 85 int m_priority;
85 QStringList m_category; 86 QStringList m_category;
86 QString m_desc; 87 QString m_desc;
87 int m_uid; 88 int m_uid;
88}; 89};
89 90
90 91
91#endif 92#endif