-rw-r--r-- | libopie2/opiepim/otodo.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h index 6df98b9..61add04 100644 --- a/libopie2/opiepim/otodo.h +++ b/libopie2/opiepim/otodo.h | |||
@@ -1,65 +1,94 @@ | |||
1 | 1 | /* | |
2 | This file is part of the Opie Project | ||
3 | Copyright (C) The Main Author <main-author@whereever.org> | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
2 | #ifndef OPIE_TODO_EVENT_H | 29 | #ifndef OPIE_TODO_EVENT_H |
3 | #define OPIE_TODO_EVENT_H | 30 | #define OPIE_TODO_EVENT_H |
4 | 31 | ||
5 | 32 | ||
6 | #include <qarray.h> | 33 | #include <qarray.h> |
7 | #include <qmap.h> | 34 | #include <qmap.h> |
8 | #include <qregexp.h> | 35 | #include <qregexp.h> |
9 | #include <qstringlist.h> | 36 | #include <qstringlist.h> |
10 | #include <qdatetime.h> | 37 | #include <qdatetime.h> |
11 | #include <qvaluelist.h> | 38 | #include <qvaluelist.h> |
12 | 39 | ||
13 | #include <qpe/recordfields.h> | 40 | #include <qpe/recordfields.h> |
14 | #include <qpe/palmtopuidgen.h> | 41 | #include <qpe/palmtopuidgen.h> |
15 | 42 | ||
16 | #include <opie/opimrecord.h> | 43 | #include <opie2/opimrecord.h> |
44 | |||
17 | 45 | ||
46 | namespace Opie { | ||
18 | 47 | ||
19 | class OPimState; | 48 | class OPimState; |
20 | class ORecur; | 49 | class ORecur; |
21 | class OPimMaintainer; | 50 | class OPimMaintainer; |
22 | class OPimNotifyManager; | 51 | class OPimNotifyManager; |
23 | class OTodo : public OPimRecord { | 52 | class OTodo : public OPimRecord { |
24 | public: | 53 | public: |
25 | typedef QValueList<OTodo> ValueList; | 54 | typedef QValueList<OTodo> ValueList; |
26 | enum RecordFields { | 55 | enum RecordFields { |
27 | Uid = Qtopia::UID_ID, | 56 | Uid = Qtopia::UID_ID, |
28 | Category = Qtopia::CATEGORY_ID, | 57 | Category = Qtopia::CATEGORY_ID, |
29 | HasDate, | 58 | HasDate, |
30 | Completed, | 59 | Completed, |
31 | Description, | 60 | Description, |
32 | Summary, | 61 | Summary, |
33 | Priority, | 62 | Priority, |
34 | DateDay, | 63 | DateDay, |
35 | DateMonth, | 64 | DateMonth, |
36 | DateYear, | 65 | DateYear, |
37 | Progress, | 66 | Progress, |
38 | CrossReference, | 67 | CrossReference, |
39 | State, | 68 | State, |
40 | Recurrence, | 69 | Recurrence, |
41 | Alarms, | 70 | Alarms, |
42 | Reminders, | 71 | Reminders, |
43 | Notifiers, | 72 | Notifiers, |
44 | Maintainer, | 73 | Maintainer, |
45 | StartDate, | 74 | StartDate, |
46 | CompletedDate | 75 | CompletedDate |
47 | }; | 76 | }; |
48 | public: | 77 | public: |
49 | // priorities from Very low to very high | 78 | // priorities from Very low to very high |
50 | enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; | 79 | enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow }; |
51 | 80 | ||
52 | /* Constructs a new ToDoEvent | 81 | /* Constructs a new ToDoEvent |
53 | @param completed Is the TodoEvent completed | 82 | @param completed Is the TodoEvent completed |
54 | @param priority What is the priority of this ToDoEvent | 83 | @param priority What is the priority of this ToDoEvent |
55 | @param category Which category does it belong( uid ) | 84 | @param category Which category does it belong( uid ) |
56 | @param summary A small summary of the todo | 85 | @param summary A small summary of the todo |
57 | @param description What is this ToDoEvent about | 86 | @param description What is this ToDoEvent about |
58 | @param hasDate Does this Event got a deadline | 87 | @param hasDate Does this Event got a deadline |
59 | @param date what is the deadline? | 88 | @param date what is the deadline? |
60 | @param uid what is the UUID of this Event | 89 | @param uid what is the UUID of this Event |
61 | **/ | 90 | **/ |
62 | OTodo( bool completed = false, int priority = Normal, | 91 | OTodo( bool completed = false, int priority = Normal, |
63 | const QStringList &category = QStringList(), | 92 | const QStringList &category = QStringList(), |
64 | const QString &summary = QString::null , | 93 | const QString &summary = QString::null , |
65 | const QString &description = QString::null, | 94 | const QString &description = QString::null, |
@@ -236,50 +265,51 @@ public: | |||
236 | void setCompletedDate( const QDate& date ); | 265 | void setCompletedDate( const QDate& date ); |
237 | 266 | ||
238 | void setRecurrence( const ORecur& ); | 267 | void setRecurrence( const ORecur& ); |
239 | 268 | ||
240 | void setDescription(const QString& ); | 269 | void setDescription(const QString& ); |
241 | void setSummary(const QString& ); | 270 | void setSummary(const QString& ); |
242 | 271 | ||
243 | /** | 272 | /** |
244 | * set the state of a Todo | 273 | * set the state of a Todo |
245 | * @param state State what the todo should take | 274 | * @param state State what the todo should take |
246 | */ | 275 | */ |
247 | void setState( const OPimState& state); | 276 | void setState( const OPimState& state); |
248 | 277 | ||
249 | /** | 278 | /** |
250 | * set the Maintainer Mode | 279 | * set the Maintainer Mode |
251 | */ | 280 | */ |
252 | void setMaintainer( const OPimMaintainer& ); | 281 | void setMaintainer( const OPimMaintainer& ); |
253 | 282 | ||
254 | bool isOverdue(); | 283 | bool isOverdue(); |
255 | 284 | ||
256 | 285 | ||
257 | virtual bool match( const QRegExp &r )const; | 286 | virtual bool match( const QRegExp &r )const; |
258 | 287 | ||
259 | bool operator<(const OTodo &toDoEvent )const; | 288 | bool operator<(const OTodo &toDoEvent )const; |
260 | bool operator<=(const OTodo &toDoEvent )const; | 289 | bool operator<=(const OTodo &toDoEvent )const; |
261 | bool operator!=(const OTodo &toDoEvent )const; | 290 | bool operator!=(const OTodo &toDoEvent )const; |
262 | bool operator>(const OTodo &toDoEvent )const; | 291 | bool operator>(const OTodo &toDoEvent )const; |
263 | bool operator>=(const OTodo &toDoEvent)const; | 292 | bool operator>=(const OTodo &toDoEvent)const; |
264 | bool operator==(const OTodo &toDoEvent )const; | 293 | bool operator==(const OTodo &toDoEvent )const; |
265 | OTodo &operator=(const OTodo &toDoEvent ); | 294 | OTodo &operator=(const OTodo &toDoEvent ); |
266 | 295 | ||
267 | static int rtti(); | 296 | static int rtti(); |
268 | 297 | ||
269 | private: | 298 | private: |
270 | class OTodoPrivate; | 299 | class OTodoPrivate; |
271 | struct OTodoData; | 300 | struct OTodoData; |
272 | 301 | ||
273 | void deref(); | 302 | void deref(); |
274 | inline void changeOrModify(); | 303 | inline void changeOrModify(); |
275 | void copy( OTodoData* src, OTodoData* dest ); | 304 | void copy( OTodoData* src, OTodoData* dest ); |
276 | OTodoPrivate *d; | 305 | OTodoPrivate *d; |
277 | OTodoData *data; | 306 | OTodoData *data; |
278 | 307 | ||
279 | }; | 308 | }; |
280 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { | 309 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { |
281 | return !(*this == toDoEvent); | 310 | return !(*this == toDoEvent); |
282 | } | 311 | } |
283 | 312 | ||
313 | } | ||
284 | 314 | ||
285 | #endif | 315 | #endif |