Changeset View
Changeset View
Standalone View
Standalone View
src/domain/task.h
Show All 19 Lines | 1 | /* This file is part of Zanshin | |||
---|---|---|---|---|---|
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
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" | | |||
29 | #include <QDate> | 28 | #include <QDate> | ||
29 | #include <QMetaType> | ||||
30 | #include <QSharedPointer> | ||||
31 | #include <QString> | ||||
30 | #include <QUrl> | 32 | #include <QUrl> | ||
31 | 33 | | |||
32 | namespace Domain { | 34 | namespace Domain { | ||
33 | 35 | | |||
34 | class Task : public Artifact | 36 | class Task : public QObject | ||
35 | { | 37 | { | ||
36 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) | ||||
40 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) | ||||
37 | Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) | 41 | Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) | ||
38 | Q_PROPERTY(bool done READ isDone WRITE setDone NOTIFY doneChanged) | 42 | Q_PROPERTY(bool done READ isDone WRITE setDone NOTIFY doneChanged) | ||
39 | Q_PROPERTY(QDate startDate READ startDate WRITE setStartDate NOTIFY startDateChanged) | 43 | Q_PROPERTY(QDate startDate READ startDate WRITE setStartDate NOTIFY startDateChanged) | ||
40 | Q_PROPERTY(QDate dueDate READ dueDate WRITE setDueDate NOTIFY dueDateChanged) | 44 | Q_PROPERTY(QDate dueDate READ dueDate WRITE setDueDate NOTIFY dueDateChanged) | ||
41 | Q_PROPERTY(Domain::Task::Recurrence recurrence READ recurrence WRITE setRecurrence NOTIFY recurrenceChanged) | 45 | Q_PROPERTY(Domain::Task::Recurrence recurrence READ recurrence WRITE setRecurrence NOTIFY recurrenceChanged) | ||
42 | Q_PROPERTY(Domain::Task::Attachments attachements READ attachments WRITE setAttachments NOTIFY attachmentsChanged) | 46 | Q_PROPERTY(Domain::Task::Attachments attachements READ attachments WRITE setAttachments NOTIFY attachmentsChanged) | ||
43 | public: | 47 | public: | ||
44 | typedef QSharedPointer<Task> Ptr; | 48 | typedef QSharedPointer<Task> Ptr; | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 89 | private: | |||
90 | QString m_iconName; | 94 | QString m_iconName; | ||
91 | }; | 95 | }; | ||
92 | 96 | | |||
93 | typedef QList<Attachment> Attachments; | 97 | typedef QList<Attachment> Attachments; | ||
94 | 98 | | |||
95 | explicit Task(QObject *parent = Q_NULLPTR); | 99 | explicit Task(QObject *parent = Q_NULLPTR); | ||
96 | virtual ~Task(); | 100 | virtual ~Task(); | ||
97 | 101 | | |||
102 | QString text() const; | ||||
103 | QString title() const; | ||||
98 | bool isRunning() const; | 104 | bool isRunning() const; | ||
99 | bool isDone() const; | 105 | bool isDone() const; | ||
100 | QDate startDate() const; | 106 | QDate startDate() const; | ||
101 | QDate dueDate() const; | 107 | QDate dueDate() const; | ||
102 | QDate doneDate() const; | 108 | QDate doneDate() const; | ||
103 | Recurrence recurrence() const; | 109 | Recurrence recurrence() const; | ||
104 | Attachments attachments() const; | 110 | Attachments attachments() const; | ||
105 | 111 | | |||
106 | public slots: | 112 | public slots: | ||
113 | void setText(const QString &text); | ||||
114 | void setTitle(const QString &title); | ||||
107 | void setRunning(bool running); | 115 | void setRunning(bool running); | ||
108 | void setDone(bool done); | 116 | void setDone(bool done); | ||
109 | void setDoneDate(const QDate &doneDate); | 117 | void setDoneDate(const QDate &doneDate); | ||
110 | void setStartDate(const QDate &startDate); | 118 | void setStartDate(const QDate &startDate); | ||
111 | void setDueDate(const QDate &dueDate); | 119 | void setDueDate(const QDate &dueDate); | ||
112 | void setRecurrence(Domain::Task::Recurrence recurrence); | 120 | void setRecurrence(Domain::Task::Recurrence recurrence); | ||
113 | void setAttachments(const Domain::Task::Attachments &attachments); | 121 | void setAttachments(const Domain::Task::Attachments &attachments); | ||
114 | 122 | | |||
115 | signals: | 123 | signals: | ||
124 | void textChanged(const QString &text); | ||||
125 | void titleChanged(const QString &title); | ||||
116 | void runningChanged(bool isRunning); | 126 | void runningChanged(bool isRunning); | ||
117 | void doneChanged(bool isDone); | 127 | void doneChanged(bool isDone); | ||
118 | void doneDateChanged(const QDate &doneDate); | 128 | void doneDateChanged(const QDate &doneDate); | ||
119 | void startDateChanged(const QDate &startDate); | 129 | void startDateChanged(const QDate &startDate); | ||
120 | void dueDateChanged(const QDate &dueDate); | 130 | void dueDateChanged(const QDate &dueDate); | ||
121 | void recurrenceChanged(Domain::Task::Recurrence recurrence); | 131 | void recurrenceChanged(Domain::Task::Recurrence recurrence); | ||
122 | void attachmentsChanged(const Domain::Task::Attachments &attachments); | 132 | void attachmentsChanged(const Domain::Task::Attachments &attachments); | ||
123 | 133 | | |||
124 | private: | 134 | private: | ||
135 | QString m_text; | ||||
136 | QString m_title; | ||||
125 | bool m_running; | 137 | bool m_running; | ||
126 | bool m_done; | 138 | bool m_done; | ||
127 | QDate m_startDate; | 139 | QDate m_startDate; | ||
128 | QDate m_dueDate; | 140 | QDate m_dueDate; | ||
129 | QDate m_doneDate; | 141 | QDate m_doneDate; | ||
130 | Recurrence m_recurrence; | 142 | Recurrence m_recurrence; | ||
131 | Attachments m_attachments; | 143 | Attachments m_attachments; | ||
132 | }; | 144 | }; | ||
Show All 9 Lines |