-rw-r--r-- | library/backend/task.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/library/backend/task.h b/library/backend/task.h new file mode 100644 index 0000000..ffe26b0 --- a/dev/null +++ b/library/backend/task.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef __TASK_H__ | ||
21 | #define __TASK_H__ | ||
22 | |||
23 | #include <qpe/palmtoprecord.h> | ||
24 | #include <qpe/stringutil.h> | ||
25 | |||
26 | #include <qvaluelist.h> | ||
27 | #include <qdatetime.h> | ||
28 | |||
29 | class TaskPrivate; | ||
30 | class QPC_EXPORT Task : public Qtopia::Record | ||
31 | { | ||
32 | public: | ||
33 | Task(); | ||
34 | Task( const QMap<int, QString> &fromMap ); | ||
35 | ~Task(); | ||
36 | |||
37 | QMap<int, QString> toMap() const; | ||
38 | |||
39 | static void writeVCalendar( const QString &filename, const QValueList<Task> &tasks); | ||
40 | static void writeVCalendar( const QString &filename, const Task &task); | ||
41 | static QValueList<Task> readVCalendar( const QString &filename ); | ||
42 | |||
43 | void setPriority( int priority ) { mPriority = priority; } | ||
44 | int priority() const { return mPriority; } | ||
45 | |||
46 | // void setCategory( const QString& category ) | ||
47 | // { mCategory = category.stripWhiteSpace(); } | ||
48 | // const QString &category() const { return mCategory; } | ||
49 | |||
50 | void setDescription( const QString& description ) | ||
51 | { mDesc = Qtopia::simplifyMultiLineSpace(description); } | ||
52 | const QString &description() const { return mDesc; } | ||
53 | |||
54 | void setDueDate( const QDate& date, bool hasDue ) { mDueDate = date; mDue = hasDue; } | ||
55 | const QDate &dueDate() const { return mDueDate; } | ||
56 | bool hasDueDate() const { return mDue; } | ||
57 | void setHasDueDate( bool b ) { mDue = b; } | ||
58 | |||
59 | void setCompleted( bool b ) { mCompleted = b; } | ||
60 | bool isCompleted() const { return mCompleted; } | ||
61 | |||
62 | void save( QString& buf ) const; | ||
63 | bool match( const QRegExp &r ) const; | ||
64 | |||
65 | private: | ||
66 | Qtopia::UidGen &uidGen() { return sUidGen; } | ||
67 | static Qtopia::UidGen sUidGen; | ||
68 | |||
69 | bool mDue; | ||
70 | QDate mDueDate; | ||
71 | bool mCompleted; | ||
72 | int mPriority; | ||
73 | QString mDesc; | ||
74 | TaskPrivate *d; | ||
75 | }; | ||
76 | |||
77 | #endif | ||