00001
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 Todo& operator=( const Todo& );
00040 bool operator==( const Todo& ) const;
00041
00042 TQCString type() const { return "Todo"; }
00043
00048 Todo *clone();
00049
00056 void setDtDue(const TQDateTime &dtDue, bool first = false);
00065 TQDateTime dtDue( bool first = false ) const;
00071 KDE_DEPRECATED TQString dtDueTimeStr() const;
00072
00081 KDE_DEPRECATED TQString dtDueDateStr( bool shortfmt = true ) const;
00082
00088 KDE_DEPRECATED TQString dtDueStr() const;
00089
00093 bool hasDueDate() const;
00099 void setHasDueDate( bool hasDueDate );
00100
00104 bool hasStartDate() const;
00110 void setHasStartDate( bool hasStartDate );
00111
00119 TQDateTime dtStart( bool first = false ) const;
00120
00124 void setDtStart( const TQDateTime &dtStart );
00125
00133 TQString dtStartTimeStr( bool first = false ) const;
00143 TQString dtStartDateStr( bool shortfmt = true, bool first = false ) const;
00151 TQString dtStartStr( bool first = false ) const;
00152
00156 bool isCompleted() const;
00163 void setCompleted( bool completed );
00164
00169 int percentComplete() const;
00174 void setPercentComplete( int );
00175
00179 TQDateTime completed() const;
00184 TQString completedStr() const;
00188 void setCompleted( const TQDateTime &completed );
00189
00194 bool hasCompletedDate() const;
00195
00199 void setDtRecurrence( const TQDateTime &dt );
00200
00204 TQDateTime dtRecurrence() const;
00205
00212 virtual bool recursOn( const TQDate &date ) const;
00213
00218 bool isOverdue() const;
00219
00220 protected:
00222 virtual TQDateTime endDateRecurrenceBase() const { return dtDue(); }
00223
00224 private:
00225 bool accept(Visitor &v) { return v.visit( this ); }
00226
00234 bool recurTodo();
00235
00236 TQDateTime mDtDue;
00237
00238 TQDateTime mDtRecurrence;
00239
00240 bool mHasDueDate;
00241 bool mHasStartDate;
00242
00243 TQDateTime mCompleted;
00244 bool mHasCompletedDate;
00245
00246 int mPercentComplete;
00247
00248 class Private;
00249 Private *d;
00250 };
00251
00252 }
00253
00254 #endif