diff options
Diffstat (limited to 'framework/mail/folderlistcontroller.h')
-rw-r--r-- | framework/mail/folderlistcontroller.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/framework/mail/folderlistcontroller.h b/framework/mail/folderlistcontroller.h new file mode 100644 index 00000000..18f5624d --- /dev/null +++ b/framework/mail/folderlistcontroller.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <QObject> | ||
4 | #include <QScopedPointer> | ||
5 | #include <QString> | ||
6 | #include <QAbstractItemModel> | ||
7 | |||
8 | class FolderListController : public QObject | ||
9 | { | ||
10 | Q_OBJECT | ||
11 | Q_PROPERTY (QString accountId READ accountId WRITE setAccountId NOTIFY accountIdChanged) | ||
12 | Q_PROPERTY (QAbstractItemModel *model READ model CONSTANT) | ||
13 | |||
14 | public: | ||
15 | explicit FolderListController(QObject *parent = Q_NULLPTR); | ||
16 | |||
17 | QString accountId() const; | ||
18 | void setAccountId(const QString &id); | ||
19 | |||
20 | QAbstractItemModel *model() const; | ||
21 | |||
22 | void loadFolders(const QString &id); | ||
23 | |||
24 | signals: | ||
25 | void accountIdChanged(); | ||
26 | |||
27 | public slots: | ||
28 | void deleteFolder(const QString &id); | ||
29 | void addFolder(const QString &name); | ||
30 | |||
31 | |||
32 | private: | ||
33 | QString m_accountId; | ||
34 | QScopedPointer<QAbstractItemModel> m_model; | ||
35 | }; | ||