diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2015-12-07 00:27:36 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2015-12-07 00:27:36 +0100 |
commit | 552f6d4c02f0d760368a1f345068b469ee3af36a (patch) | |
tree | a3490b8b9b1f4d97034c6337d3d4c2806fd6b8bf /framework/mail/folderlistcontroller.h | |
parent | 58f9f288fc5b3a7edf42e4dc997fe93418977249 (diff) | |
download | kube-552f6d4c02f0d760368a1f345068b469ee3af36a.tar.gz kube-552f6d4c02f0d760368a1f345068b469ee3af36a.zip |
add folderlistcontroller
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 | }; | ||