Changeset View
Changeset View
Standalone View
Standalone View
src/domain/task.h
Show All 20 Lines | 1 | /* This file is part of Zanshin | |||
---|---|---|---|---|---|
21 | USA. | 21 | USA. | ||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | 24 | | |||
25 | #ifndef DOMAIN_TASK_H | 25 | #ifndef DOMAIN_TASK_H | ||
26 | #define DOMAIN_TASK_H | 26 | #define DOMAIN_TASK_H | ||
27 | 27 | | |||
28 | #include "artifact.h" | 28 | #include "artifact.h" | ||
29 | #include <QDateTime> | 29 | #include <QDate> | ||
30 | #include <QUrl> | 30 | #include <QUrl> | ||
31 | 31 | | |||
32 | namespace Domain { | 32 | namespace Domain { | ||
33 | 33 | | |||
34 | class Task : public Artifact | 34 | class Task : public Artifact | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) | 37 | Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) | ||
38 | Q_PROPERTY(bool done READ isDone WRITE setDone NOTIFY doneChanged) | 38 | Q_PROPERTY(bool done READ isDone WRITE setDone NOTIFY doneChanged) | ||
39 | Q_PROPERTY(QDateTime startDate READ startDate WRITE setStartDate NOTIFY startDateChanged) | 39 | Q_PROPERTY(QDate startDate READ startDate WRITE setStartDate NOTIFY startDateChanged) | ||
40 | Q_PROPERTY(QDateTime dueDate READ dueDate WRITE setDueDate NOTIFY dueDateChanged) | 40 | Q_PROPERTY(QDate dueDate READ dueDate WRITE setDueDate NOTIFY dueDateChanged) | ||
41 | Q_PROPERTY(Domain::Task::Recurrence recurrence READ recurrence WRITE setRecurrence NOTIFY recurrenceChanged) | 41 | Q_PROPERTY(Domain::Task::Recurrence recurrence READ recurrence WRITE setRecurrence NOTIFY recurrenceChanged) | ||
42 | Q_PROPERTY(Domain::Task::Delegate delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) | 42 | Q_PROPERTY(Domain::Task::Delegate delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) | ||
43 | Q_PROPERTY(Domain::Task::Attachments attachements READ attachments WRITE setAttachments NOTIFY attachmentsChanged) | 43 | Q_PROPERTY(Domain::Task::Attachments attachements READ attachments WRITE setAttachments NOTIFY attachmentsChanged) | ||
44 | public: | 44 | public: | ||
45 | typedef QSharedPointer<Task> Ptr; | 45 | typedef QSharedPointer<Task> Ptr; | ||
46 | typedef QList<Task::Ptr> List; | 46 | typedef QList<Task::Ptr> List; | ||
47 | 47 | | |||
48 | enum Recurrence { | 48 | enum Recurrence { | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 116 | private: | |||
118 | QString m_email; | 118 | QString m_email; | ||
119 | }; | 119 | }; | ||
120 | 120 | | |||
121 | explicit Task(QObject *parent = Q_NULLPTR); | 121 | explicit Task(QObject *parent = Q_NULLPTR); | ||
122 | virtual ~Task(); | 122 | virtual ~Task(); | ||
123 | 123 | | |||
124 | bool isRunning() const; | 124 | bool isRunning() const; | ||
125 | bool isDone() const; | 125 | bool isDone() const; | ||
126 | QDateTime startDate() const; | 126 | QDate startDate() const; | ||
127 | QDateTime dueDate() const; | 127 | QDate dueDate() const; | ||
128 | QDateTime doneDate() const; | 128 | QDate doneDate() const; | ||
129 | Recurrence recurrence() const; | 129 | Recurrence recurrence() const; | ||
130 | Attachments attachments() const; | 130 | Attachments attachments() const; | ||
131 | Delegate delegate() const; | 131 | Delegate delegate() const; | ||
132 | 132 | | |||
133 | public slots: | 133 | public slots: | ||
134 | void setRunning(bool running); | 134 | void setRunning(bool running); | ||
135 | void setDone(bool done); | 135 | void setDone(bool done); | ||
136 | void setDoneDate(const QDateTime &doneDate); | 136 | void setDoneDate(const QDate &doneDate); | ||
137 | void setStartDate(const QDateTime &startDate); | 137 | void setStartDate(const QDate &startDate); | ||
138 | void setDueDate(const QDateTime &dueDate); | 138 | void setDueDate(const QDate &dueDate); | ||
139 | void setRecurrence(Domain::Task::Recurrence recurrence); | 139 | void setRecurrence(Domain::Task::Recurrence recurrence); | ||
140 | void setAttachments(const Domain::Task::Attachments &attachments); | 140 | void setAttachments(const Domain::Task::Attachments &attachments); | ||
141 | void setDelegate(const Domain::Task::Delegate &delegate); | 141 | void setDelegate(const Domain::Task::Delegate &delegate); | ||
142 | 142 | | |||
143 | signals: | 143 | signals: | ||
144 | void runningChanged(bool isRunning); | 144 | void runningChanged(bool isRunning); | ||
145 | void doneChanged(bool isDone); | 145 | void doneChanged(bool isDone); | ||
146 | void doneDateChanged(const QDateTime &doneDate); | 146 | void doneDateChanged(const QDate &doneDate); | ||
147 | void startDateChanged(const QDateTime &startDate); | 147 | void startDateChanged(const QDate &startDate); | ||
148 | void dueDateChanged(const QDateTime &dueDate); | 148 | void dueDateChanged(const QDate &dueDate); | ||
149 | void recurrenceChanged(Domain::Task::Recurrence recurrence); | 149 | void recurrenceChanged(Domain::Task::Recurrence recurrence); | ||
150 | void attachmentsChanged(const Domain::Task::Attachments &attachments); | 150 | void attachmentsChanged(const Domain::Task::Attachments &attachments); | ||
151 | void delegateChanged(const Domain::Task::Delegate &delegate); | 151 | void delegateChanged(const Domain::Task::Delegate &delegate); | ||
152 | 152 | | |||
153 | private: | 153 | private: | ||
154 | bool m_running; | 154 | bool m_running; | ||
155 | bool m_done; | 155 | bool m_done; | ||
156 | QDateTime m_startDate; | 156 | QDate m_startDate; | ||
157 | QDateTime m_dueDate; | 157 | QDate m_dueDate; | ||
158 | QDateTime m_doneDate; | 158 | QDate m_doneDate; | ||
159 | Recurrence m_recurrence; | 159 | Recurrence m_recurrence; | ||
160 | Attachments m_attachments; | 160 | Attachments m_attachments; | ||
161 | Delegate m_delegate; | 161 | Delegate m_delegate; | ||
162 | }; | 162 | }; | ||
163 | 163 | | |||
164 | } | 164 | } | ||
165 | 165 | | |||
166 | Q_DECLARE_METATYPE(Domain::Task::Ptr) | 166 | Q_DECLARE_METATYPE(Domain::Task::Ptr) | ||
167 | Q_DECLARE_METATYPE(Domain::Task::List) | 167 | Q_DECLARE_METATYPE(Domain::Task::List) | ||
168 | Q_DECLARE_METATYPE(Domain::Task::Attachment) | 168 | Q_DECLARE_METATYPE(Domain::Task::Attachment) | ||
169 | Q_DECLARE_METATYPE(Domain::Task::Attachments) | 169 | Q_DECLARE_METATYPE(Domain::Task::Attachments) | ||
170 | Q_DECLARE_METATYPE(Domain::Task::Delegate) | 170 | Q_DECLARE_METATYPE(Domain::Task::Delegate) | ||
171 | 171 | | |||
172 | #endif // DOMAIN_TASK_H | 172 | #endif // DOMAIN_TASK_H |