KCal Library
todo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00031 #ifndef KCAL_TODO_H
00032 #define KCAL_TODO_H
00033
00034 #include "incidence.h"
00035 #include <kpimutils/supertrait.h>
00036 #include <QtCore/QByteArray>
00037
00038 namespace KCal {
00039
00044 class KCAL_EXPORT Todo : public Incidence
00045 {
00046 public:
00050 typedef ListBase<Todo> List;
00051
00055 typedef boost::shared_ptr<Todo> Ptr;
00056
00060 typedef boost::shared_ptr<const Todo> ConstPtr;
00061
00065 Todo();
00066
00071 Todo( const Todo &other );
00072
00076 ~Todo();
00077
00082 QByteArray type() const;
00083
00088
00089
00094 Todo *clone();
00095
00105 void setDtDue( const KDateTime &dtDue, bool first = false );
00106
00115 KDateTime dtDue( bool first = false ) const;
00116
00127 KDE_DEPRECATED QString dtDueTimeStr(
00128 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00129
00140 KDE_DEPRECATED QString dtDueDateStr(
00141 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00142
00153 KDE_DEPRECATED QString dtDueStr(
00154 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00155
00159 bool hasDueDate() const;
00160
00166 void setHasDueDate( bool hasDueDate );
00167
00171 bool hasStartDate() const;
00172
00178 void setHasStartDate( bool hasStartDate );
00179
00184 virtual KDateTime dtStart() const;
00185
00194 KDateTime dtStart( bool first ) const;
00195
00201 void setDtStart( const KDateTime &dtStart );
00202
00218 KDE_DEPRECATED QString dtStartTimeStr(
00219 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00220
00225 virtual KDE_DEPRECATED QString dtStartTimeStr(
00226 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00227
00243 KDE_DEPRECATED QString dtStartDateStr(
00244 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00245
00250 virtual KDE_DEPRECATED QString dtStartDateStr(
00251 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00252
00268 KDE_DEPRECATED QString dtStartStr(
00269 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00270
00275 virtual KDE_DEPRECATED QString dtStartStr(
00276 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00277
00283 bool isCompleted() const;
00284
00293 void setCompleted( bool completed );
00294
00299 int percentComplete() const;
00300
00310 void setPercentComplete( int percent );
00311
00315 KDateTime completed() const;
00316
00323 QString completedStr( bool shortfmt = false ) const;
00324
00330 void setCompleted( const KDateTime &completeDate );
00331
00336 bool hasCompletedDate() const;
00337
00351 bool isInProgress( bool first ) const;
00352
00358 bool isOpenEnded() const;
00359
00372 bool isNotStarted( bool first ) const;
00373
00378 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00379 const KDateTime::Spec &newSpec );
00380
00386 void setDtRecurrence( const KDateTime &dt );
00387
00391 KDateTime dtRecurrence() const;
00392
00402 virtual bool recursOn( const QDate &date,
00403 const KDateTime::Spec &timeSpec ) const;
00404
00410 bool isOverdue() const;
00411
00416 Todo &operator=( const Todo &other );
00417
00422 bool operator==( const Todo &todo ) const;
00423
00424 protected:
00428 virtual KDateTime endDateRecurrenceBase() const;
00429
00430 private:
00435 bool accept( Visitor &v ) { return v.visit( this ); }
00436
00437
00438 class Private;
00439 Private *const d;
00440
00441 };
00442
00443 }
00444
00445
00446
00447 namespace KPIMUtils {
00448 template <> struct SuperClass<KCal::Todo> : public SuperClassTrait<KCal::Incidence>{};
00449 }
00450
00451
00452 #endif