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
00029 #ifndef KCAL_TODO_H
00030 #define KCAL_TODO_H
00031
00032 #include "incidence.h"
00033 #include <kpimutils/supertrait.h>
00034 #include <QtCore/QByteArray>
00035
00036 namespace KCal {
00037
00042 class KCAL_EXPORT Todo : public Incidence
00043 {
00044 public:
00048 typedef ListBase<Todo> List;
00049
00053 typedef boost::shared_ptr<Todo> Ptr;
00054
00058 Todo();
00059
00064 Todo( const Todo &other );
00065
00069 ~Todo();
00070
00075 QByteArray type() const;
00076
00081 Todo *clone();
00082
00092 void setDtDue( const KDateTime &dtDue, bool first = false );
00093
00102 KDateTime dtDue( bool first = false ) const;
00103
00114 KDE_DEPRECATED QString dtDueTimeStr(
00115 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00116
00127 KDE_DEPRECATED QString dtDueDateStr(
00128 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00129
00140 KDE_DEPRECATED QString dtDueStr(
00141 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00142
00146 bool hasDueDate() const;
00147
00153 void setHasDueDate( bool hasDueDate );
00154
00158 bool hasStartDate() const;
00159
00165 void setHasStartDate( bool hasStartDate );
00166
00171 virtual KDateTime dtStart() const;
00172
00180 KDateTime dtStart( bool first ) const;
00181
00187 void setDtStart( const KDateTime &dtStart );
00188
00203 KDE_DEPRECATED QString dtStartTimeStr(
00204 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00205
00210 virtual KDE_DEPRECATED QString dtStartTimeStr(
00211 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00212
00227 KDE_DEPRECATED QString dtStartDateStr(
00228 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00229
00234 virtual KDE_DEPRECATED QString dtStartDateStr(
00235 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00236
00251 KDE_DEPRECATED QString dtStartStr(
00252 bool shortfmt, bool first, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00253
00258 virtual KDE_DEPRECATED QString dtStartStr(
00259 bool shortfmt = true, const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00260
00266 bool isCompleted() const;
00267
00276 void setCompleted( bool completed );
00277
00282 int percentComplete() const;
00283
00293 void setPercentComplete( int percent );
00294
00298 KDateTime completed() const;
00299
00306 QString completedStr( bool shortfmt = false ) const;
00307
00313 void setCompleted( const KDateTime &completeDate );
00314
00319 bool hasCompletedDate() const;
00320
00325 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00326 const KDateTime::Spec &newSpec );
00327
00333 void setDtRecurrence( const KDateTime &dt );
00334
00338 KDateTime dtRecurrence() const;
00339
00349 virtual bool recursOn( const QDate &date,
00350 const KDateTime::Spec &timeSpec ) const;
00351
00356 bool isOverdue() const;
00357
00362 Todo &operator=( const Todo &other );
00363
00368 bool operator==( const Todo &todo ) const;
00369
00370 protected:
00374 virtual KDateTime endDateRecurrenceBase() const;
00375
00376 private:
00381 bool accept( Visitor &v ) { return v.visit( this ); }
00382
00383
00384 class Private;
00385 Private *const d;
00386
00387 };
00388
00389 }
00390
00391
00392
00393 namespace KPIMUtils {
00394 template <> struct SuperClass<KCal::Todo> : public SuperClassTrait<KCal::Incidence>{};
00395 }
00396
00397
00398 #endif