KCalCore 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 KCALCORE_TODO_H
00032 #define KCALCORE_TODO_H
00033
00034 #include "kcalcore_export.h"
00035 #include "incidence.h"
00036 #include "supertrait.h"
00037
00038 namespace KCalCore {
00039
00044 class KCALCORE_EXPORT Todo : public Incidence
00045 {
00046 public:
00050 typedef QSharedPointer<Todo> Ptr;
00051
00055 typedef QVector<Ptr> List;
00056
00060 Todo();
00061
00066 Todo( const Todo &other );
00067
00071 ~Todo();
00072
00077 IncidenceType type() const;
00078
00083 QByteArray typeStr() const;
00084
00089 Todo *clone() const;
00090
00100 void setDtDue( const KDateTime &dtDue, bool first = false );
00101
00110 KDateTime dtDue( bool first = false ) const;
00111
00115 bool hasDueDate() const;
00116
00122 void setHasDueDate( bool hasDueDate );
00123
00127 bool hasStartDate() const;
00128
00134 void setHasStartDate( bool hasStartDate );
00135
00140 virtual KDateTime dtStart() const;
00141
00150 KDateTime dtStart( bool first ) const;
00151
00157 void setDtStart( const KDateTime &dtStart );
00158
00164 bool isCompleted() const;
00165
00174 void setCompleted( bool completed );
00175
00180 int percentComplete() const;
00181
00191 void setPercentComplete( int percent );
00192
00196 KDateTime completed() const;
00197
00203 void setCompleted( const KDateTime &completeDate );
00204
00209 bool hasCompletedDate() const;
00210
00223 bool isInProgress( bool first ) const;
00224
00229 bool isOpenEnded() const;
00230
00242 bool isNotStarted( bool first ) const;
00243
00248 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00249 const KDateTime::Spec &newSpec );
00250
00255 void setAllDay( bool allDay );
00256
00262 void setDtRecurrence( const KDateTime &dt );
00263
00267 KDateTime dtRecurrence() const;
00268
00278 virtual bool recursOn( const QDate &date,
00279 const KDateTime::Spec &timeSpec ) const;
00280
00286 bool isOverdue() const;
00287
00292 KDateTime dateTime( DateTimeRole role ) const;
00293
00298 void setDateTime( const KDateTime &dateTime, DateTimeRole role );
00299
00304 QLatin1String mimeType() const;
00305
00310 QLatin1String iconName( const KDateTime &recurrenceId = KDateTime() ) const;
00311
00315 static QLatin1String todoMimeType();
00316 protected:
00321 virtual bool equals( const IncidenceBase &todo ) const;
00322
00327 virtual IncidenceBase &assign( const IncidenceBase &other );
00328
00333 virtual void virtual_hook( int id, void *data );
00334
00335 private:
00340 bool accept( Visitor &v, IncidenceBase::Ptr incidence );
00341
00348 Todo &operator=( const Todo &other );
00349
00350
00351 class Private;
00352 Private *const d;
00353
00354 };
00355
00356 }
00357
00358 Q_DECLARE_TYPEINFO( KCalCore::Todo::Ptr, Q_MOVABLE_TYPE );
00359
00360
00361 namespace KPIMUtils {
00362
00363 template <> struct SuperClass<KCalCore::Todo> : public SuperClassTrait<KCalCore::Incidence>{};
00364 }
00365
00366
00367 #endif