libkcal
todo.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KCAL_TODO_H
00022 #define KCAL_TODO_H
00023
00024 #include "incidence.h"
00025
00026 namespace KCal {
00027
00031 class LIBKCAL_EXPORT Todo : public Incidence
00032 {
00033 public:
00034 typedef ListBase<Todo> List;
00035
00036 Todo();
00037 Todo( const Todo & );
00038 ~Todo();
00039 bool operator==( const Todo& ) const;
00040
00041 QCString type() const { return "Todo"; }
00042
00047 Todo *clone();
00048
00055 void setDtDue(const QDateTime &dtDue, bool first = false);
00064 QDateTime dtDue( bool first = false ) const;
00069 QString dtDueTimeStr() const;
00077 QString dtDueDateStr( bool shortfmt = true ) const;
00082 QString dtDueStr() const;
00083
00087 bool hasDueDate() const;
00093 void setHasDueDate( bool hasDueDate );
00094
00098 bool hasStartDate() const;
00104 void setHasStartDate( bool hasStartDate );
00105
00113 QDateTime dtStart( bool first = false ) const;
00114
00118 void setDtStart( const QDateTime &dtStart );
00119
00127 QString dtStartTimeStr( bool first = false ) const;
00137 QString dtStartDateStr( bool shortfmt = true, bool first = false ) const;
00145 QString dtStartStr( bool first = false ) const;
00146
00150 bool isCompleted() const;
00157 void setCompleted( bool completed );
00158
00163 int percentComplete() const;
00168 void setPercentComplete( int );
00169
00173 QDateTime completed() const;
00178 QString completedStr() const;
00182 void setCompleted( const QDateTime &completed );
00183
00188 bool hasCompletedDate() const;
00189
00193 void setDtRecurrence( const QDateTime &dt );
00194
00198 QDateTime dtRecurrence() const;
00199
00206 virtual bool recursOn( const QDate &date ) const;
00207
00212 bool isOverdue() const;
00213
00214 protected:
00216 virtual QDateTime endDateRecurrenceBase() const { return dtDue(); }
00217
00218 private:
00219 bool accept(Visitor &v) { return v.visit( this ); }
00221 bool recurTodo();
00222
00223 QDateTime mDtDue;
00224
00225 QDateTime mDtRecurrence;
00226
00227 bool mHasDueDate;
00228 bool mHasStartDate;
00229
00230 QDateTime mCompleted;
00231 bool mHasCompletedDate;
00232
00233 int mPercentComplete;
00234
00235 class Private;
00236 Private *d;
00237 };
00238
00239 }
00240
00241 #endif
|