task.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __TASK_H__
00021 #define __TASK_H__
00022
00023 #include <qtopia/private/palmtoprecord.h>
00024 #include <qtopia/stringutil.h>
00025
00026 #include <qvaluelist.h>
00027 #include <qdatetime.h>
00028
00029 class TaskPrivate;
00030 class QPC_EXPORT Task : public Qtopia::Record
00031 {
00032 public:
00033 Task();
00034 Task( const QMap<int, QString> &fromMap );
00035 ~Task();
00036
00037 QMap<int, QString> toMap() const;
00038
00039 static void writeVCalendar( const QString &filename, const QValueList<Task> &tasks);
00040 static void writeVCalendar( const QString &filename, const Task &task);
00041 static QValueList<Task> readVCalendar( const QString &filename );
00042
00043 enum PriorityValue { VeryHigh=1, High, Normal, Low, VeryLow };
00044
00045 void setPriority( int priority ) { mPriority = priority; }
00046 int priority() const { return mPriority; }
00047
00048
00049
00050
00051
00052 void setDescription( const QString& description )
00053 { mDesc = Qtopia::simplifyMultiLineSpace(description); }
00054 const QString &description() const { return mDesc; }
00055
00056
00057 void setDueDate( const QDate &date);
00058 void clearDueDate();
00059
00060
00061 void setDueDate( const QDate& date, bool hasDue ) { mDueDate = date; mDue = hasDue; }
00062 void setHasDueDate( bool b ) { mDue = b; }
00063
00064 const QDate &dueDate() const { return mDueDate; }
00065 bool hasDueDate() const { return mDue; }
00066
00067 void setCompleted( bool b ) { mCompleted = b; }
00068 bool isCompleted() const { return mCompleted; }
00069
00070 void save( QString& buf ) const;
00071 bool match( const QRegExp &r ) const;
00072
00073 private:
00074 Qtopia::UidGen &uidGen() { return sUidGen; }
00075 static Qtopia::UidGen sUidGen;
00076
00077 bool mDue;
00078 QDate mDueDate;
00079 bool mCompleted;
00080 int mPriority;
00081 QString mDesc;
00082 TaskPrivate *d;
00083
00084 int recordId;
00085 int recordInfo;
00086
00087 };
00088
00089
00090 inline void Task::setDueDate( const QDate &date) { setDueDate(date, date.isValid()); }
00091 inline void Task::clearDueDate() { setHasDueDate( FALSE ); }
00092 #endif
This file is part of the documentation for OPIE Version 1.5.5.