summaryrefslogtreecommitdiff
path: root/libopie/pim/otodo.h
Unidiff
Diffstat (limited to 'libopie/pim/otodo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodo.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h
index 5bd91d6..2cdc587 100644
--- a/libopie/pim/otodo.h
+++ b/libopie/pim/otodo.h
@@ -1,60 +1,67 @@
1 1
2#ifndef OPIE_TODO_EVENT_H 2#ifndef OPIE_TODO_EVENT_H
3#define OPIE_TODO_EVENT_H 3#define OPIE_TODO_EVENT_H
4 4
5 5
6#include <qarray.h> 6#include <qarray.h>
7#include <qmap.h> 7#include <qmap.h>
8#include <qregexp.h> 8#include <qregexp.h>
9#include <qstringlist.h> 9#include <qstringlist.h>
10#include <qdatetime.h> 10#include <qdatetime.h>
11#include <qvaluelist.h> 11#include <qvaluelist.h>
12 12
13#include <qpe/recordfields.h> 13#include <qpe/recordfields.h>
14#include <qpe/palmtopuidgen.h> 14#include <qpe/palmtopuidgen.h>
15 15
16#include <opie/opimrecord.h> 16#include <opie/opimrecord.h>
17 17
18 18
19class OPimState;
20class ORecur;
19class OTodo : public OPimRecord { 21class OTodo : public OPimRecord {
20public: 22public:
21 typedef QValueList<OTodo> ValueList; 23 typedef QValueList<OTodo> ValueList;
22 enum RecordFields { 24 enum RecordFields {
23 Uid = Qtopia::UID_ID, 25 Uid = Qtopia::UID_ID,
24 Category = Qtopia::CATEGORY_ID, 26 Category = Qtopia::CATEGORY_ID,
25 HasDate, 27 HasDate,
26 Completed, 28 Completed,
27 Description, 29 Description,
28 Summary, 30 Summary,
29 Priority, 31 Priority,
30 DateDay, 32 DateDay,
31 DateMonth, 33 DateMonth,
32 DateYear, 34 DateYear,
33 Progress, 35 Progress,
34 CrossReference, 36 CrossReference,
35 HasAlarmDateTime, 37 HasAlarmDateTime,
36 AlarmDateTime 38 AlarmDateTime,
39 State,
40 Recurrance,
41 Alarms,
42 Reminders,
43 Notifiers
37 }; 44 };
38 public: 45 public:
39 // priorities from Very low to very high 46 // priorities from Very low to very high
40 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; 47 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow };
41 48
42 /* Constructs a new ToDoEvent 49 /* Constructs a new ToDoEvent
43 @param completed Is the TodoEvent completed 50 @param completed Is the TodoEvent completed
44 @param priority What is the priority of this ToDoEvent 51 @param priority What is the priority of this ToDoEvent
45 @param category Which category does it belong( uid ) 52 @param category Which category does it belong( uid )
46 @param summary A small summary of the todo 53 @param summary A small summary of the todo
47 @param description What is this ToDoEvent about 54 @param description What is this ToDoEvent about
48 @param hasDate Does this Event got a deadline 55 @param hasDate Does this Event got a deadline
49 @param date what is the deadline? 56 @param date what is the deadline?
50 @param uid what is the UUID of this Event 57 @param uid what is the UUID of this Event
51 **/ 58 **/
52 OTodo( bool completed = false, int priority = Normal, 59 OTodo( bool completed = false, int priority = Normal,
53 const QStringList &category = QStringList(), 60 const QStringList &category = QStringList(),
54 const QString &summary = QString::null , 61 const QString &summary = QString::null ,
55 const QString &description = QString::null, 62 const QString &description = QString::null,
56 ushort progress = 0, 63 ushort progress = 0,
57 bool hasDate = false, QDate date = QDate::currentDate(), 64 bool hasDate = false, QDate date = QDate::currentDate(),
58 int uid = 0 /*empty*/ ); 65 int uid = 0 /*empty*/ );
59 66
60 OTodo( bool completed, int priority, 67 OTodo( bool completed, int priority,
@@ -90,48 +97,58 @@ public:
90 */ 97 */
91 bool hasAlarmDateTime() const; 98 bool hasAlarmDateTime() const;
92 99
93 /** 100 /**
94 * What is the priority? 101 * What is the priority?
95 */ 102 */
96 int priority()const ; 103 int priority()const ;
97 104
98 /** 105 /**
99 * progress as ushort 0, 20, 40, 60, 80 or 100% 106 * progress as ushort 0, 20, 40, 60, 80 or 100%
100 */ 107 */
101 ushort progress() const; 108 ushort progress() const;
102 109
103 /** 110 /**
104 * The due Date 111 * The due Date
105 */ 112 */
106 QDate dueDate()const; 113 QDate dueDate()const;
107 114
108 /** 115 /**
109 * Alarm Date and Time 116 * Alarm Date and Time
110 */ 117 */
111 QDateTime alarmDateTime()const; 118 QDateTime alarmDateTime()const;
112 119
113 /** 120 /**
121 * What is the state of this OTodo?
122 */
123 OPimState state()const;
124
125 /**
126 * the recurrance of this
127 */
128 ORecur recurrence()const;
129
130 /**
114 * The description of the todo 131 * The description of the todo
115 */ 132 */
116 QString description()const; 133 QString description()const;
117 134
118 /** 135 /**
119 * A small summary of the todo 136 * A small summary of the todo
120 */ 137 */
121 QString summary() const; 138 QString summary() const;
122 139
123 /** 140 /**
124 * @reimplemented 141 * @reimplemented
125 * Return this todoevent in a RichText formatted QString 142 * Return this todoevent in a RichText formatted QString
126 */ 143 */
127 QString toRichText() const; 144 QString toRichText() const;
128 145
129 /** 146 /**
130 * reimplementation 147 * reimplementation
131 */ 148 */
132 QString type()const; 149 QString type()const;
133 QString toShortText()const; 150 QString toShortText()const;
134 QMap<QString, QString> toExtraMap()const; 151 QMap<QString, QString> toExtraMap()const;
135 QString recordField(int id )const; 152 QString recordField(int id )const;
136 153
137 /** 154 /**
@@ -149,55 +166,63 @@ public:
149 * set if this todo got an end data 166 * set if this todo got an end data
150 */ 167 */
151 void setHasDueDate( bool hasDate ); 168 void setHasDueDate( bool hasDate );
152 169
153 /** 170 /**
154 * set if this todo has an alarm time and date 171 * set if this todo has an alarm time and date
155 */ 172 */
156 void setHasAlarmDateTime ( bool hasAlarm ); 173 void setHasAlarmDateTime ( bool hasAlarm );
157 174
158 /** 175 /**
159 * Set the priority of the Todo 176 * Set the priority of the Todo
160 */ 177 */
161 void setPriority(int priority ); 178 void setPriority(int priority );
162 179
163 /** 180 /**
164 * Set the progress. 181 * Set the progress.
165 */ 182 */
166 void setProgress( ushort progress ); 183 void setProgress( ushort progress );
167 184
168 /** 185 /**
169 * set the end date 186 * set the end date
170 */ 187 */
171 void setDueDate( QDate date ); 188 void setDueDate( QDate date );
172 189
190
191 void setRecurrence( const ORecur& );
173 /** 192 /**
174 * set the alarm time 193 * set the alarm time
175 */ 194 */
176 void setAlarmDateTime ( const QDateTime& alarm ); 195 void setAlarmDateTime ( const QDateTime& alarm );
177 196
178 void setDescription(const QString& ); 197 void setDescription(const QString& );
179 void setSummary(const QString& ); 198 void setSummary(const QString& );
199
200 /**
201 * set the state of a Todo
202 * @param state State what the todo should take
203 */
204 void setState( const OPimState& state);
180 bool isOverdue(); 205 bool isOverdue();
181 206
182 207
183 bool match( const QRegExp &r )const; 208 bool match( const QRegExp &r )const;
184 209
185 bool operator<(const OTodo &toDoEvent )const; 210 bool operator<(const OTodo &toDoEvent )const;
186 bool operator<=(const OTodo &toDoEvent )const; 211 bool operator<=(const OTodo &toDoEvent )const;
187 bool operator!=(const OTodo &toDoEvent )const; 212 bool operator!=(const OTodo &toDoEvent )const;
188 bool operator>(const OTodo &toDoEvent )const; 213 bool operator>(const OTodo &toDoEvent )const;
189 bool operator>=(const OTodo &toDoEvent)const; 214 bool operator>=(const OTodo &toDoEvent)const;
190 bool operator==(const OTodo &toDoEvent )const; 215 bool operator==(const OTodo &toDoEvent )const;
191 OTodo &operator=(const OTodo &toDoEvent ); 216 OTodo &operator=(const OTodo &toDoEvent );
192 217
193 private: 218 private:
194 class OTodoPrivate; 219 class OTodoPrivate;
195 struct OTodoData; 220 struct OTodoData;
196 221
197 void deref(); 222 void deref();
198 inline void changeOrModify(); 223 inline void changeOrModify();
199 void copy( OTodoData* src, OTodoData* dest ); 224 void copy( OTodoData* src, OTodoData* dest );
200 OTodoPrivate *d; 225 OTodoPrivate *d;
201 OTodoData *data; 226 OTodoData *data;
202 227
203}; 228};