00001 #ifndef SCHEDULE_H
00002 #define SCHEDULE_H
00003
00004 #include "duration.h"
00005 #include "clock.h"
00006
00007 #include <tools/global.h>
00008
00009 #include <QSharedDataPointer>
00010 #include <QDateTime>
00011
00012 class QDateTime;
00013
00014 namespace domain
00015 {
00016
00017 class Duration;
00018
00019 struct SchedulePrivate;
00020
00026 class DOMAIN_EXPORT Schedule
00027 {
00028 public:
00029
00042 Schedule(const Duration& duration = Duration(),
00043 const QDateTime& startDate = Clock::currentTime(),
00044 const QDateTime& dueDate = Clock::currentTime().addSecs(1));
00045
00049 Schedule(const Schedule& other);
00050
00054 ~Schedule();
00055
00059 const Duration& duration() const;
00060
00064 const QDateTime& startDate() const;
00065
00069 const QDateTime& dueDate() const;
00070
00078 void setDuration(const Duration& duration);
00079
00087 void setStartDate(const QDateTime& startDate);
00088
00096 void setDueDate(const QDateTime& dueDate);
00097
00098 Schedule& operator=(const Schedule& other);
00099
00104 bool operator==(const Schedule& other) const;
00105
00114 static bool isValid(const Duration& duration, const QDateTime& startDate,
00115 const QDateTime& dueDate);
00116
00117 private:
00118
00119 QSharedDataPointer<SchedulePrivate> d;
00120 };
00121
00122 }
00123
00124 #endif