author | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 12:09:49 (UTC) |
commit | 6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff) | |
tree | 6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/backend/task.h | |
parent | d10cddb3c9ce75bc90b14add14bc133737fe35aa (diff) | |
download | opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2 |
Qtopia1-6 merge
still to test
bic changes to be resolved
more changes to be made?
-rw-r--r-- | library/backend/task.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/library/backend/task.h b/library/backend/task.h index 6f383b8..091f2e9 100644 --- a/library/backend/task.h +++ b/library/backend/task.h | |||
@@ -1,81 +1,92 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef __TASK_H__ | 20 | #ifndef __TASK_H__ |
21 | #define __TASK_H__ | 21 | #define __TASK_H__ |
22 | 22 | ||
23 | #include <qpe/palmtoprecord.h> | 23 | #include <qtopia/private/palmtoprecord.h> |
24 | #include <qpe/stringutil.h> | 24 | #include <qtopia/stringutil.h> |
25 | 25 | ||
26 | #include <qvaluelist.h> | 26 | #include <qvaluelist.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | 28 | ||
29 | class TaskPrivate; | 29 | class TaskPrivate; |
30 | class QPC_EXPORT Task : public Qtopia::Record | 30 | class QPC_EXPORT Task : public Qtopia::Record |
31 | { | 31 | { |
32 | public: | 32 | public: |
33 | Task(); | 33 | Task(); |
34 | Task( const QMap<int, QString> &fromMap ); | 34 | Task( const QMap<int, QString> &fromMap ); |
35 | ~Task(); | 35 | ~Task(); |
36 | 36 | ||
37 | QMap<int, QString> toMap() const; | 37 | QMap<int, QString> toMap() const; |
38 | 38 | ||
39 | static void writeVCalendar( const QString &filename, const QValueList<Task> &tasks); | 39 | static void writeVCalendar( const QString &filename, const QValueList<Task> &tasks); |
40 | static void writeVCalendar( const QString &filename, const Task &task); | 40 | static void writeVCalendar( const QString &filename, const Task &task); |
41 | static QValueList<Task> readVCalendar( const QString &filename ); | 41 | static QValueList<Task> readVCalendar( const QString &filename ); |
42 | 42 | ||
43 | enum PriorityValue { VeryHigh=1, High, Normal, Low, VeryLow }; | ||
44 | |||
43 | void setPriority( int priority ) { mPriority = priority; } | 45 | void setPriority( int priority ) { mPriority = priority; } |
44 | int priority() const { return mPriority; } | 46 | int priority() const { return mPriority; } |
45 | 47 | ||
46 | // void setCategory( const QString& category ) | 48 | // void setCategory( const QString& category ) |
47 | // { mCategory = category.stripWhiteSpace(); } | 49 | // { mCategory = category.stripWhiteSpace(); } |
48 | // const QString &category() const { return mCategory; } | 50 | // const QString &category() const { return mCategory; } |
49 | 51 | ||
50 | void setDescription( const QString& description ) | 52 | void setDescription( const QString& description ) |
51 | { mDesc = Qtopia::simplifyMultiLineSpace(description); } | 53 | { mDesc = Qtopia::simplifyMultiLineSpace(description); } |
52 | const QString &description() const { return mDesc; } | 54 | const QString &description() const { return mDesc; } |
53 | 55 | ||
56 | // Use THESE functions | ||
57 | void setDueDate( const QDate &date); | ||
58 | void clearDueDate(); | ||
59 | |||
60 | // Instead of these functions. | ||
54 | void setDueDate( const QDate& date, bool hasDue ) { mDueDate = date; mDue = hasDue; } | 61 | void setDueDate( const QDate& date, bool hasDue ) { mDueDate = date; mDue = hasDue; } |
62 | void setHasDueDate( bool b ) { mDue = b; } | ||
63 | |||
55 | const QDate &dueDate() const { return mDueDate; } | 64 | const QDate &dueDate() const { return mDueDate; } |
56 | bool hasDueDate() const { return mDue; } | 65 | bool hasDueDate() const { return mDue; } |
57 | void setHasDueDate( bool b ) { mDue = b; } | ||
58 | 66 | ||
59 | void setCompleted( bool b ) { mCompleted = b; } | 67 | void setCompleted( bool b ) { mCompleted = b; } |
60 | bool isCompleted() const { return mCompleted; } | 68 | bool isCompleted() const { return mCompleted; } |
61 | 69 | ||
62 | void save( QString& buf ) const; | 70 | void save( QString& buf ) const; |
63 | bool match( const QRegExp &r ) const; | 71 | bool match( const QRegExp &r ) const; |
64 | 72 | ||
65 | private: | 73 | private: |
66 | Qtopia::UidGen &uidGen() { return sUidGen; } | 74 | Qtopia::UidGen &uidGen() { return sUidGen; } |
67 | static Qtopia::UidGen sUidGen; | 75 | static Qtopia::UidGen sUidGen; |
68 | 76 | ||
69 | bool mDue; | 77 | bool mDue; |
70 | QDate mDueDate; | 78 | QDate mDueDate; |
71 | bool mCompleted; | 79 | bool mCompleted; |
72 | int mPriority; | 80 | int mPriority; |
73 | QString mDesc; | 81 | QString mDesc; |
74 | TaskPrivate *d; | 82 | TaskPrivate *d; |
75 | // ADDITION | 83 | // ADDITION |
76 | int recordId; | 84 | int recordId; |
77 | int recordInfo; | 85 | int recordInfo; |
78 | // | 86 | // |
79 | }; | 87 | }; |
80 | 88 | ||
89 | // MUST be inline. (forwards compatability). | ||
90 | inline void Task::setDueDate( const QDate &date) { setDueDate(date, date.isValid()); } | ||
91 | inline void Task::clearDueDate() { setHasDueDate( FALSE ); } | ||
81 | #endif | 92 | #endif |