-rw-r--r-- | libopie2/opiepim/otodo.h | 147 |
1 files changed, 76 insertions, 71 deletions
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h index 61add04..04dd269 100644 --- a/libopie2/opiepim/otodo.h +++ b/libopie2/opiepim/otodo.h | |||
@@ -1,35 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Main Author <main-author@whereever.org> | 3 | Copyright (C) The Main Author <main-author@whereever.org> |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_TODO_EVENT_H | ||
30 | #define OPIE_TODO_EVENT_H | ||
31 | 29 | ||
30 | #ifndef OTODOEVENT_H | ||
31 | #define OTODOEVENT_H | ||
32 | 32 | ||
33 | /* OPIE */ | ||
34 | #include <opie2/opimrecord.h> | ||
35 | #include <qpe/recordfields.h> | ||
36 | #include <qpe/palmtopuidgen.h> | ||
37 | |||
38 | /* QT */ | ||
33 | #include <qarray.h> | 39 | #include <qarray.h> |
34 | #include <qmap.h> | 40 | #include <qmap.h> |
35 | #include <qregexp.h> | 41 | #include <qregexp.h> |
@@ -37,20 +43,16 @@ | |||
37 | #include <qdatetime.h> | 43 | #include <qdatetime.h> |
38 | #include <qvaluelist.h> | 44 | #include <qvaluelist.h> |
39 | 45 | ||
40 | #include <qpe/recordfields.h> | 46 | namespace Opie |
41 | #include <qpe/palmtopuidgen.h> | 47 | { |
42 | |||
43 | #include <opie2/opimrecord.h> | ||
44 | |||
45 | |||
46 | namespace Opie { | ||
47 | 48 | ||
48 | class OPimState; | 49 | class OPimState; |
49 | class ORecur; | 50 | class ORecur; |
50 | class OPimMaintainer; | 51 | class OPimMaintainer; |
51 | class OPimNotifyManager; | 52 | class OPimNotifyManager; |
52 | class OTodo : public OPimRecord { | 53 | class OTodo : public OPimRecord |
53 | public: | 54 | { |
55 | public: | ||
54 | typedef QValueList<OTodo> ValueList; | 56 | typedef QValueList<OTodo> ValueList; |
55 | enum RecordFields { | 57 | enum RecordFields { |
56 | Uid = Qtopia::UID_ID, | 58 | Uid = Qtopia::UID_ID, |
@@ -74,9 +76,9 @@ public: | |||
74 | StartDate, | 76 | StartDate, |
75 | CompletedDate | 77 | CompletedDate |
76 | }; | 78 | }; |
77 | public: | 79 | public: |
78 | // priorities from Very low to very high | 80 | // priorities from Very low to very high |
79 | enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; | 81 | enum TaskPriority { VeryHigh = 1, High, Normal, Low, VeryLow }; |
80 | 82 | ||
81 | /* Constructs a new ToDoEvent | 83 | /* Constructs a new ToDoEvent |
82 | @param completed Is the TodoEvent completed | 84 | @param completed Is the TodoEvent completed |
@@ -101,13 +103,13 @@ public: | |||
101 | const QString& summary = QString::null, | 103 | const QString& summary = QString::null, |
102 | const QString& description = QString::null, | 104 | const QString& description = QString::null, |
103 | ushort progress = 0, | 105 | ushort progress = 0, |
104 | bool hasDate = false, QDate date = QDate::currentDate(), | 106 | bool hasDate = false, QDate date = QDate::currentDate(), |
105 | int uid = 0 /* empty */ ); | 107 | int uid = 0 /* empty */ ); |
106 | 108 | ||
107 | /** Copy c'tor | 109 | /** Copy c'tor |
108 | * | 110 | * |
109 | */ | 111 | */ |
110 | OTodo(const OTodo & ); | 112 | OTodo( const OTodo & ); |
111 | 113 | ||
112 | /** | 114 | /** |
113 | *destructor | 115 | *destructor |
@@ -123,13 +125,13 @@ public: | |||
123 | * Does this Event have a deadline | 125 | * Does this Event have a deadline |
124 | */ | 126 | */ |
125 | bool hasDueDate() const; | 127 | bool hasDueDate() const; |
126 | bool hasStartDate()const; | 128 | bool hasStartDate() const; |
127 | bool hasCompletedDate()const; | 129 | bool hasCompletedDate() const; |
128 | 130 | ||
129 | /** | 131 | /** |
130 | * What is the priority? | 132 | * What is the priority? |
131 | */ | 133 | */ |
132 | int priority()const ; | 134 | int priority() const ; |
133 | 135 | ||
134 | /** | 136 | /** |
135 | * progress as ushort 0, 20, 40, 60, 80 or 100% | 137 | * progress as ushort 0, 20, 40, 60, 80 or 100% |
@@ -139,52 +141,52 @@ public: | |||
139 | /** | 141 | /** |
140 | * The due Date | 142 | * The due Date |
141 | */ | 143 | */ |
142 | QDate dueDate()const; | 144 | QDate dueDate() const; |
143 | 145 | ||
144 | /** | 146 | /** |
145 | * When did it start? | 147 | * When did it start? |
146 | */ | 148 | */ |
147 | QDate startDate()const; | 149 | QDate startDate() const; |
148 | 150 | ||
149 | /** | 151 | /** |
150 | * When was it completed? | 152 | * When was it completed? |
151 | */ | 153 | */ |
152 | QDate completedDate()const; | 154 | QDate completedDate() const; |
153 | 155 | ||
154 | /** | 156 | /** |
155 | * does it have a state? | 157 | * does it have a state? |
156 | */ | 158 | */ |
157 | bool hasState()const; | 159 | bool hasState() const; |
158 | 160 | ||
159 | /** | 161 | /** |
160 | * What is the state of this OTodo? | 162 | * What is the state of this OTodo? |
161 | */ | 163 | */ |
162 | OPimState state()const; | 164 | OPimState state() const; |
163 | 165 | ||
164 | /** | 166 | /** |
165 | * has recurrence? | 167 | * has recurrence? |
166 | */ | 168 | */ |
167 | bool hasRecurrence()const; | 169 | bool hasRecurrence() const; |
168 | 170 | ||
169 | /** | 171 | /** |
170 | * the recurrance of this | 172 | * the recurrance of this |
171 | */ | 173 | */ |
172 | ORecur recurrence()const; | 174 | ORecur recurrence() const; |
173 | 175 | ||
174 | /** | 176 | /** |
175 | * does this OTodo have a maintainer? | 177 | * does this OTodo have a maintainer? |
176 | */ | 178 | */ |
177 | bool hasMaintainer()const; | 179 | bool hasMaintainer() const; |
178 | 180 | ||
179 | /** | 181 | /** |
180 | * the Maintainer of this OTodo | 182 | * the Maintainer of this OTodo |
181 | */ | 183 | */ |
182 | OPimMaintainer maintainer()const; | 184 | OPimMaintainer maintainer() const; |
183 | 185 | ||
184 | /** | 186 | /** |
185 | * The description of the todo | 187 | * The description of the todo |
186 | */ | 188 | */ |
187 | QString description()const; | 189 | QString description() const; |
188 | 190 | ||
189 | /** | 191 | /** |
190 | * A small summary of the todo | 192 | * A small summary of the todo |
@@ -197,7 +199,7 @@ public: | |||
197 | */ | 199 | */ |
198 | QString toRichText() const; | 200 | QString toRichText() const; |
199 | 201 | ||
200 | bool hasNotifiers()const; | 202 | bool hasNotifiers() const; |
201 | /* | 203 | /* |
202 | * FIXME check if the sharing is still fine!! -zecke | 204 | * FIXME check if the sharing is still fine!! -zecke |
203 | * ### CHECK If API is fine | 205 | * ### CHECK If API is fine |
@@ -210,25 +212,25 @@ public: | |||
210 | /** | 212 | /** |
211 | * | 213 | * |
212 | */ | 214 | */ |
213 | const OPimNotifyManager ¬ifiers()const; | 215 | const OPimNotifyManager ¬ifiers() const; |
214 | 216 | ||
215 | /** | 217 | /** |
216 | * reimplementations | 218 | * reimplementations |
217 | */ | 219 | */ |
218 | QString type()const; | 220 | QString type() const; |
219 | QString toShortText()const; | 221 | QString toShortText() const; |
220 | QString recordField(int id )const; | 222 | QString recordField( int id ) const; |
221 | 223 | ||
222 | /** | 224 | /** |
223 | * toMap puts all data into the map. int relates | 225 | * toMap puts all data into the map. int relates |
224 | * to ToDoEvent RecordFields enum | 226 | * to ToDoEvent RecordFields enum |
225 | */ | 227 | */ |
226 | QMap<int, QString> toMap()const; | 228 | QMap<int, QString> toMap() const; |
227 | 229 | ||
228 | /** | 230 | /** |
229 | * Set if this Todo is completed | 231 | * Set if this Todo is completed |
230 | */ | 232 | */ |
231 | void setCompleted(bool completed ); | 233 | void setCompleted( bool completed ); |
232 | 234 | ||
233 | /** | 235 | /** |
234 | * set if this todo got an end data | 236 | * set if this todo got an end data |
@@ -242,7 +244,7 @@ public: | |||
242 | /** | 244 | /** |
243 | * Set the priority of the Todo | 245 | * Set the priority of the Todo |
244 | */ | 246 | */ |
245 | void setPriority(int priority ); | 247 | void setPriority( int priority ); |
246 | 248 | ||
247 | /** | 249 | /** |
248 | * Set the progress. | 250 | * Set the progress. |
@@ -266,14 +268,14 @@ public: | |||
266 | 268 | ||
267 | void setRecurrence( const ORecur& ); | 269 | void setRecurrence( const ORecur& ); |
268 | 270 | ||
269 | void setDescription(const QString& ); | 271 | void setDescription( const QString& ); |
270 | void setSummary(const QString& ); | 272 | void setSummary( const QString& ); |
271 | 273 | ||
272 | /** | 274 | /** |
273 | * set the state of a Todo | 275 | * set the state of a Todo |
274 | * @param state State what the todo should take | 276 | * @param state State what the todo should take |
275 | */ | 277 | */ |
276 | void setState( const OPimState& state); | 278 | void setState( const OPimState& state ); |
277 | 279 | ||
278 | /** | 280 | /** |
279 | * set the Maintainer Mode | 281 | * set the Maintainer Mode |
@@ -283,19 +285,19 @@ public: | |||
283 | bool isOverdue(); | 285 | bool isOverdue(); |
284 | 286 | ||
285 | 287 | ||
286 | virtual bool match( const QRegExp &r )const; | 288 | virtual bool match( const QRegExp &r ) const; |
287 | 289 | ||
288 | bool operator<(const OTodo &toDoEvent )const; | 290 | bool operator<( const OTodo &toDoEvent ) const; |
289 | bool operator<=(const OTodo &toDoEvent )const; | 291 | bool operator<=( const OTodo &toDoEvent ) const; |
290 | bool operator!=(const OTodo &toDoEvent )const; | 292 | bool operator!=( const OTodo &toDoEvent ) const; |
291 | bool operator>(const OTodo &toDoEvent )const; | 293 | bool operator>( const OTodo &toDoEvent ) const; |
292 | bool operator>=(const OTodo &toDoEvent)const; | 294 | bool operator>=( const OTodo &toDoEvent ) const; |
293 | bool operator==(const OTodo &toDoEvent )const; | 295 | bool operator==( const OTodo &toDoEvent ) const; |
294 | OTodo &operator=(const OTodo &toDoEvent ); | 296 | OTodo &operator=( const OTodo &toDoEvent ); |
295 | 297 | ||
296 | static int rtti(); | 298 | static int rtti(); |
297 | 299 | ||
298 | private: | 300 | private: |
299 | class OTodoPrivate; | 301 | class OTodoPrivate; |
300 | struct OTodoData; | 302 | struct OTodoData; |
301 | 303 | ||
@@ -306,8 +308,11 @@ public: | |||
306 | OTodoData *data; | 308 | OTodoData *data; |
307 | 309 | ||
308 | }; | 310 | }; |
309 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { | 311 | |
310 | return !(*this == toDoEvent); | 312 | |
313 | inline bool OTodo::operator!=( const OTodo &toDoEvent ) const | ||
314 | { | ||
315 | return !( *this == toDoEvent ); | ||
311 | } | 316 | } |
312 | 317 | ||
313 | } | 318 | } |