otodo.h
Go to the documentation of this file.00001
00002 #ifndef OPIE_TODO_EVENT_H
00003 #define OPIE_TODO_EVENT_H
00004
00005
00006 #include <qarray.h>
00007 #include <qmap.h>
00008 #include <qregexp.h>
00009 #include <qstringlist.h>
00010 #include <qdatetime.h>
00011 #include <qvaluelist.h>
00012
00013 #include <qpe/recordfields.h>
00014 #include <qpe/palmtopuidgen.h>
00015
00016 #include <opie/opimrecord.h>
00017
00018
00019 class OPimState;
00020 class ORecur;
00021 class OPimMaintainer;
00022 class OPimNotifyManager;
00023 class OTodo : public OPimRecord {
00024 public:
00025 typedef QValueList<OTodo> ValueList;
00026 enum RecordFields {
00027 Uid = Qtopia::UID_ID,
00028 Category = Qtopia::CATEGORY_ID,
00029 HasDate,
00030 Completed,
00031 Description,
00032 Summary,
00033 Priority,
00034 DateDay,
00035 DateMonth,
00036 DateYear,
00037 Progress,
00038 CrossReference,
00039 State,
00040 Recurrence,
00041 Alarms,
00042 Reminders,
00043 Notifiers,
00044 Maintainer,
00045 StartDate,
00046 CompletedDate
00047 };
00048 public:
00049
00050 enum TaskPriority { VeryHigh=1, High, Normal, Low, VeryLow };
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 OTodo( bool completed = false, int priority = Normal,
00063 const QStringList &category = QStringList(),
00064 const QString &summary = QString::null ,
00065 const QString &description = QString::null,
00066 ushort progress = 0,
00067 bool hasDate = false, QDate date = QDate::currentDate(),
00068 int uid = 0 );
00069
00070 OTodo( bool completed, int priority,
00071 const QArray<int>& category,
00072 const QString& summary = QString::null,
00073 const QString& description = QString::null,
00074 ushort progress = 0,
00075 bool hasDate = false, QDate date = QDate::currentDate(),
00076 int uid = 0 );
00077
00081 OTodo(const OTodo & );
00082
00086 ~OTodo();
00087
00091 bool isCompleted() const;
00092
00096 bool hasDueDate() const;
00097 bool hasStartDate()const;
00098 bool hasCompletedDate()const;
00099
00103 int priority()const ;
00104
00108 ushort progress() const;
00109
00113 QDate dueDate()const;
00114
00118 QDate startDate()const;
00119
00123 QDate completedDate()const;
00124
00128 bool hasState()const;
00129
00133 OPimState state()const;
00134
00138 bool hasRecurrence()const;
00139
00143 ORecur recurrence()const;
00144
00148 bool hasMaintainer()const;
00149
00153 OPimMaintainer maintainer()const;
00154
00158 QString description()const;
00159
00163 QString summary() const;
00164
00169 QString toRichText() const;
00170
00171 bool hasNotifiers()const;
00172
00173
00174
00175
00179 OPimNotifyManager ¬ifiers();
00180
00184 const OPimNotifyManager ¬ifiers()const;
00185
00189 QString type()const;
00190 QString toShortText()const;
00191 QString recordField(int id )const;
00192
00197 QMap<int, QString> toMap()const;
00198
00202 void setCompleted(bool completed );
00203
00207 void setHasDueDate( bool hasDate );
00208
00209
00210
00211
00212
00216 void setPriority(int priority );
00217
00221 void setProgress( ushort progress );
00222
00226 void setDueDate( const QDate& date );
00227
00231 void setStartDate( const QDate& date );
00232
00236 void setCompletedDate( const QDate& date );
00237
00238 void setRecurrence( const ORecur& );
00239
00240 void setDescription(const QString& );
00241 void setSummary(const QString& );
00242
00247 void setState( const OPimState& state);
00248
00252 void setMaintainer( const OPimMaintainer& );
00253
00254 bool isOverdue();
00255
00256
00257 virtual bool match( const QRegExp &r )const;
00258
00259 bool operator<(const OTodo &toDoEvent )const;
00260 bool operator<=(const OTodo &toDoEvent )const;
00261 bool operator!=(const OTodo &toDoEvent )const;
00262 bool operator>(const OTodo &toDoEvent )const;
00263 bool operator>=(const OTodo &toDoEvent)const;
00264 bool operator==(const OTodo &toDoEvent )const;
00265 OTodo &operator=(const OTodo &toDoEvent );
00266
00267 static int rtti();
00268
00269 private:
00270 class OTodoPrivate;
00271 struct OTodoData;
00272
00273 void deref();
00274 inline void changeOrModify();
00275 void copy( OTodoData* src, OTodoData* dest );
00276 OTodoPrivate *d;
00277 OTodoData *data;
00278
00279 };
00280 inline bool OTodo::operator!=(const OTodo &toDoEvent )const {
00281 return !(*this == toDoEvent);
00282 }
00283
00284
00285 #endif
This file is part of the documentation for OPIE Version 1.1.