summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/otodo.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.h59
1 files changed, 43 insertions, 16 deletions
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h
index 70b0253..2f66f55 100644
--- a/libopie2/opiepim/otodo.h
+++ b/libopie2/opiepim/otodo.h
@@ -16,12 +16,13 @@
16#include <opie/opimrecord.h> 16#include <opie/opimrecord.h>
17 17
18 18
19class OPimState; 19class OPimState;
20class ORecur; 20class ORecur;
21class OPimMaintainer; 21class OPimMaintainer;
22class OPimNotifyManager;
22class OTodo : public OPimRecord { 23class OTodo : public OPimRecord {
23public: 24public:
24 typedef QValueList<OTodo> ValueList; 25 typedef QValueList<OTodo> ValueList;
25 enum RecordFields { 26 enum RecordFields {
26 Uid = Qtopia::UID_ID, 27 Uid = Qtopia::UID_ID,
27 Category = Qtopia::CATEGORY_ID, 28 Category = Qtopia::CATEGORY_ID,
@@ -32,19 +33,20 @@ public:
32 Priority, 33 Priority,
33 DateDay, 34 DateDay,
34 DateMonth, 35 DateMonth,
35 DateYear, 36 DateYear,
36 Progress, 37 Progress,
37 CrossReference, 38 CrossReference,
38 HasAlarmDateTime,
39 AlarmDateTime,
40 State, 39 State,
41 Recurrance, 40 Recurrence,
42 Alarms, 41 Alarms,
43 Reminders, 42 Reminders,
44 Notifiers 43 Notifiers,
44 Maintainer,
45 StartDate,
46 CompletedDate
45 }; 47 };
46 public: 48 public:
47 // priorities from Very low to very high 49 // priorities from Very low to very high
48 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; 50 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow };
49 51
50 /* Constructs a new ToDoEvent 52 /* Constructs a new ToDoEvent
@@ -70,15 +72,15 @@ public:
70 const QString& summary = QString::null, 72 const QString& summary = QString::null,
71 const QString& description = QString::null, 73 const QString& description = QString::null,
72 ushort progress = 0, 74 ushort progress = 0,
73 bool hasDate = false, QDate date = QDate::currentDate(), 75 bool hasDate = false, QDate date = QDate::currentDate(),
74 int uid = 0 /* empty */ ); 76 int uid = 0 /* empty */ );
75 77
76 /* Copy c'tor 78 /** Copy c'tor
77 79 *
78 **/ 80 */
79 OTodo(const OTodo & ); 81 OTodo(const OTodo & );
80 82
81 /** 83 /**
82 *destructor 84 *destructor
83 */ 85 */
84 ~OTodo(); 86 ~OTodo();
@@ -89,12 +91,14 @@ public:
89 bool isCompleted() const; 91 bool isCompleted() const;
90 92
91 /** 93 /**
92 * Does this Event have a deadline 94 * Does this Event have a deadline
93 */ 95 */
94 bool hasDueDate() const; 96 bool hasDueDate() const;
97 bool hasStartDate()const;
98 bool hasCompletedDate()const;
95 99
96 /** 100 /**
97 * Does this Event has an alarm time ? 101 * Does this Event has an alarm time ?
98 */ 102 */
99 bool hasAlarmDateTime() const; 103 bool hasAlarmDateTime() const;
100 104
@@ -111,15 +115,20 @@ public:
111 /** 115 /**
112 * The due Date 116 * The due Date
113 */ 117 */
114 QDate dueDate()const; 118 QDate dueDate()const;
115 119
116 /** 120 /**
117 * Alarm Date and Time 121 * When did it start?
122 */
123 QDate startDate()const;
124
125 /**
126 * When was it completed?
118 */ 127 */
119 QDateTime alarmDateTime()const; 128 QDate completedDate()const;
120 129
121 /** 130 /**
122 * What is the state of this OTodo? 131 * What is the state of this OTodo?
123 */ 132 */
124 OPimState state()const; 133 OPimState state()const;
125 134
@@ -146,14 +155,22 @@ public:
146 /** 155 /**
147 * @reimplemented 156 * @reimplemented
148 * Return this todoevent in a RichText formatted QString 157 * Return this todoevent in a RichText formatted QString
149 */ 158 */
150 QString toRichText() const; 159 QString toRichText() const;
151 160
161 /*
162 * check if the sharing is still fine!! -zecke
163 */
164 /**
165 * return a reference to our notifiers...
166 */
167 OPimNotifyManager &notifiers();
168
152 /** 169 /**
153 * reimplementation 170 * reimplementations
154 */ 171 */
155 QString type()const; 172 QString type()const;
156 QString toShortText()const; 173 QString toShortText()const;
157 QMap<QString, QString> toExtraMap()const; 174 QMap<QString, QString> toExtraMap()const;
158 QString recordField(int id )const; 175 QString recordField(int id )const;
159 176
@@ -169,17 +186,16 @@ public:
169 void setCompleted(bool completed ); 186 void setCompleted(bool completed );
170 187
171 /** 188 /**
172 * set if this todo got an end data 189 * set if this todo got an end data
173 */ 190 */
174 void setHasDueDate( bool hasDate ); 191 void setHasDueDate( bool hasDate );
175 192 // FIXME we do not have these for start, completed
176 /** 193 // cause we'll use the isNull() of QDate for figuring
177 * set if this todo has an alarm time and date 194 // out if it's has a date...
178 */ 195 // decide what to do here? -zecke
179 void setHasAlarmDateTime ( bool hasAlarm );
180 196
181 /** 197 /**
182 * Set the priority of the Todo 198 * Set the priority of the Todo
183 */ 199 */
184 void setPriority(int priority ); 200 void setPriority(int priority );
185 201
@@ -188,14 +204,23 @@ public:
188 */ 204 */
189 void setProgress( ushort progress ); 205 void setProgress( ushort progress );
190 206
191 /** 207 /**
192 * set the end date 208 * set the end date
193 */ 209 */
194 void setDueDate( QDate date ); 210 void setDueDate( const QDate& date );
195 211
212 /**
213 * set the start date
214 */
215 void setStartDate( const QDate& date );
216
217 /**
218 * set the completed date
219 */
220 void setCompletedDate( const QDate& date );
196 221
197 void setRecurrence( const ORecur& ); 222 void setRecurrence( const ORecur& );
198 /** 223 /**
199 * set the alarm time 224 * set the alarm time
200 */ 225 */
201 void setAlarmDateTime ( const QDateTime& alarm ); 226 void setAlarmDateTime ( const QDateTime& alarm );
@@ -224,12 +249,14 @@ public:
224 bool operator!=(const OTodo &toDoEvent )const; 249 bool operator!=(const OTodo &toDoEvent )const;
225 bool operator>(const OTodo &toDoEvent )const; 250 bool operator>(const OTodo &toDoEvent )const;
226 bool operator>=(const OTodo &toDoEvent)const; 251 bool operator>=(const OTodo &toDoEvent)const;
227 bool operator==(const OTodo &toDoEvent )const; 252 bool operator==(const OTodo &toDoEvent )const;
228 OTodo &operator=(const OTodo &toDoEvent ); 253 OTodo &operator=(const OTodo &toDoEvent );
229 254
255 static int rtti();
256
230 private: 257 private:
231 class OTodoPrivate; 258 class OTodoPrivate;
232 struct OTodoData; 259 struct OTodoData;
233 260
234 void deref(); 261 void deref();
235 inline void changeOrModify(); 262 inline void changeOrModify();