diff options
Diffstat (limited to 'framework/mail/singlemailcontroller.h')
-rw-r--r-- | framework/mail/singlemailcontroller.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/framework/mail/singlemailcontroller.h b/framework/mail/singlemailcontroller.h new file mode 100644 index 00000000..e6ec9a22 --- /dev/null +++ b/framework/mail/singlemailcontroller.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "maillistmodel.h" | ||
4 | |||
5 | #include <QObject> | ||
6 | #include <QString> | ||
7 | |||
8 | class SingleMailController : public QObject | ||
9 | { | ||
10 | Q_OBJECT | ||
11 | Q_PROPERTY (QString akonadiId READ akonadiId WRITE setAkonadiId NOTIFY akonadiIdChanged) | ||
12 | Q_PROPERTY (bool isUnread READ isUnread NOTIFY isUnreadChanged) | ||
13 | Q_PROPERTY (bool isImportant READ isImportant NOTIFY isImportantChanged) | ||
14 | Q_PROPERTY (QString message READ message NOTIFY messageChanged) | ||
15 | |||
16 | public: | ||
17 | explicit SingleMailController(QObject *parent = Q_NULLPTR); | ||
18 | |||
19 | QString akonadiId() const; | ||
20 | void setAkonadiId(const QString &id); | ||
21 | |||
22 | bool isUnread() const; | ||
23 | bool isImportant() const; | ||
24 | QString message() const; | ||
25 | |||
26 | void loadMessage(const QString &id); | ||
27 | |||
28 | signals: | ||
29 | void akonadiIdChanged(); | ||
30 | void isUnreadChanged(); | ||
31 | void isImportantChanged(); | ||
32 | void messageChanged(); | ||
33 | |||
34 | public slots: | ||
35 | void deleteMail(); | ||
36 | void markMailImportant(bool important); | ||
37 | void markMailUnread(bool unread); | ||
38 | |||
39 | private: | ||
40 | QString m_akonadiId; | ||
41 | bool m_isImportant; | ||
42 | bool m_isUnread; | ||
43 | QString m_message; | ||
44 | }; | ||