-rw-r--r-- | libopie2/opiepim/otodo.h | 59 |
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 | |||
@@ -10,47 +10,49 @@ | |||
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 | ||
19 | class OPimState; | 19 | class OPimState; |
20 | class ORecur; | 20 | class ORecur; |
21 | class OPimMaintainer; | 21 | class OPimMaintainer; |
22 | class OPimNotifyManager; | ||
22 | class OTodo : public OPimRecord { | 23 | class OTodo : public OPimRecord { |
23 | public: | 24 | public: |
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, |
28 | HasDate, | 29 | HasDate, |
29 | Completed, | 30 | Completed, |
30 | Description, | 31 | Description, |
31 | Summary, | 32 | Summary, |
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 |
51 | @param completed Is the TodoEvent completed | 53 | @param completed Is the TodoEvent completed |
52 | @param priority What is the priority of this ToDoEvent | 54 | @param priority What is the priority of this ToDoEvent |
53 | @param category Which category does it belong( uid ) | 55 | @param category Which category does it belong( uid ) |
54 | @param summary A small summary of the todo | 56 | @param summary A small summary of the todo |
55 | @param description What is this ToDoEvent about | 57 | @param description What is this ToDoEvent about |
56 | @param hasDate Does this Event got a deadline | 58 | @param hasDate Does this Event got a deadline |
@@ -64,68 +66,75 @@ public: | |||
64 | ushort progress = 0, | 66 | ushort progress = 0, |
65 | bool hasDate = false, QDate date = QDate::currentDate(), | 67 | bool hasDate = false, QDate date = QDate::currentDate(), |
66 | int uid = 0 /*empty*/ ); | 68 | int uid = 0 /*empty*/ ); |
67 | 69 | ||
68 | OTodo( bool completed, int priority, | 70 | OTodo( bool completed, int priority, |
69 | const QArray<int>& category, | 71 | const QArray<int>& category, |
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(); |
85 | 87 | ||
86 | /** | 88 | /** |
87 | * Is this event completed? | 89 | * Is this event completed? |
88 | */ | 90 | */ |
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 | ||
101 | /** | 105 | /** |
102 | * What is the priority? | 106 | * What is the priority? |
103 | */ | 107 | */ |
104 | int priority()const ; | 108 | int priority()const ; |
105 | 109 | ||
106 | /** | 110 | /** |
107 | * progress as ushort 0, 20, 40, 60, 80 or 100% | 111 | * progress as ushort 0, 20, 40, 60, 80 or 100% |
108 | */ | 112 | */ |
109 | ushort progress() const; | 113 | ushort progress() const; |
110 | 114 | ||
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 | ||
126 | /** | 135 | /** |
127 | * the recurrance of this | 136 | * the recurrance of this |
128 | */ | 137 | */ |
129 | ORecur recurrence()const; | 138 | ORecur recurrence()const; |
130 | 139 | ||
131 | /** | 140 | /** |
@@ -140,68 +149,84 @@ public: | |||
140 | 149 | ||
141 | /** | 150 | /** |
142 | * A small summary of the todo | 151 | * A small summary of the todo |
143 | */ | 152 | */ |
144 | QString summary() const; | 153 | QString summary() const; |
145 | 154 | ||
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 ¬ifiers(); | ||
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 | ||
160 | /** | 177 | /** |
161 | * toMap puts all data into the map. int relates | 178 | * toMap puts all data into the map. int relates |
162 | * to ToDoEvent RecordFields enum | 179 | * to ToDoEvent RecordFields enum |
163 | */ | 180 | */ |
164 | QMap<int, QString> toMap()const; | 181 | QMap<int, QString> toMap()const; |
165 | 182 | ||
166 | /** | 183 | /** |
167 | * Set if this Todo is completed | 184 | * Set if this Todo is completed |
168 | */ | 185 | */ |
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 | ||
186 | /** | 202 | /** |
187 | * Set the progress. | 203 | * Set the progress. |
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 ); |
202 | 227 | ||
203 | void setDescription(const QString& ); | 228 | void setDescription(const QString& ); |
204 | void setSummary(const QString& ); | 229 | void setSummary(const QString& ); |
205 | 230 | ||
206 | /** | 231 | /** |
207 | * set the state of a Todo | 232 | * set the state of a Todo |
@@ -218,24 +243,26 @@ public: | |||
218 | 243 | ||
219 | 244 | ||
220 | bool match( const QRegExp &r )const; | 245 | bool match( const QRegExp &r )const; |
221 | 246 | ||
222 | bool operator<(const OTodo &toDoEvent )const; | 247 | bool operator<(const OTodo &toDoEvent )const; |
223 | bool operator<=(const OTodo &toDoEvent )const; | 248 | bool operator<=(const OTodo &toDoEvent )const; |
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(); |
236 | void copy( OTodoData* src, OTodoData* dest ); | 263 | void copy( OTodoData* src, OTodoData* dest ); |
237 | OTodoPrivate *d; | 264 | OTodoPrivate *d; |
238 | OTodoData *data; | 265 | OTodoData *data; |
239 | 266 | ||
240 | }; | 267 | }; |
241 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { | 268 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { |