diff options
Diffstat (limited to 'framework/domain/maillistcontroller.h')
-rw-r--r-- | framework/domain/maillistcontroller.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/framework/domain/maillistcontroller.h b/framework/domain/maillistcontroller.h new file mode 100644 index 00000000..959c63a3 --- /dev/null +++ b/framework/domain/maillistcontroller.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
3 | Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com> | ||
4 | |||
5 | This library is free software; you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Library General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, but WITHOUT | ||
11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||
13 | License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
18 | 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #pragma once | ||
22 | |||
23 | #include "maillistmodel.h" | ||
24 | |||
25 | #include <QObject> | ||
26 | #include <QScopedPointer> | ||
27 | #include <QString> | ||
28 | #include <QAbstractItemModel> | ||
29 | |||
30 | class MailListController : public QObject | ||
31 | { | ||
32 | Q_OBJECT | ||
33 | Q_PROPERTY (MailListModel *model READ model CONSTANT) | ||
34 | Q_PROPERTY (QString selectedMail READ selectedMail WRITE setSelectedMail NOTIFY selectedMailChanged) | ||
35 | |||
36 | public: | ||
37 | explicit MailListController(QObject *parent = Q_NULLPTR); | ||
38 | |||
39 | MailListModel *model() const; | ||
40 | |||
41 | QString selectedMail() const; | ||
42 | void setSelectedMail(const QString &id); | ||
43 | |||
44 | signals: | ||
45 | void selectedMailChanged(); | ||
46 | |||
47 | public slots: | ||
48 | void loadAllMail(); | ||
49 | void loadUnreadMail(); | ||
50 | void loadImportantMail(); | ||
51 | void loadMailFolder(const QString &folderId); | ||
52 | |||
53 | void markMailImportant(bool important); | ||
54 | void markMailUnread(bool unread); | ||
55 | void deleteMail(); | ||
56 | |||
57 | private: | ||
58 | QScopedPointer<MailListModel> m_model; | ||
59 | |||
60 | QString m_selectedMail; | ||
61 | }; | ||