summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/folderwidget.h
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/folderwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/folderwidget.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/folderwidget.h b/noncore/unsupported/mail2/folderwidget.h
new file mode 100644
index 0000000..bb10319
--- a/dev/null
+++ b/noncore/unsupported/mail2/folderwidget.h
@@ -0,0 +1,123 @@
1#ifndef FOLDERWIDGET_H
2#define FOLDERWIDGET_H
3
4#include "imapresponse.h"
5#include "listviewplus.h"
6#include "configfile.h"
7
8class IMAPHandler;
9
10class TopFolder
11{
12public:
13 TopFolder()
14 {
15 _valid = true;
16 }
17
18 bool isValid() { return _valid; }
19 void setAccount(Account account) { _account = account; }
20 Account account() { return _account; }
21 void setIMAPHandler(IMAPHandler *handler) { _handler = handler; }
22 IMAPHandler *handler() { return _handler; }
23
24private:
25 bool _valid;
26 Account _account;
27 IMAPHandler *_handler;
28
29};
30
31class Folder
32{
33public:
34 Folder()
35 {
36 _valid = true;
37 _noCache = false;
38 }
39
40 bool isValid() { return _valid; }
41 void setNoCache(bool noCache) { _noCache = noCache; }
42 bool noCache() { return _noCache; }
43 void setFullName(QString fullName) { _fullName = fullName; }
44 QString fullName() { return _fullName; }
45 void setSeparator(QString separator) { _separator = separator; }
46 QString separator() { return _separator; }
47 void setTopFolder(TopFolder topFolder) { _topFolder = topFolder; }
48 TopFolder topFolder() { return _topFolder; }
49
50private:
51 bool _valid, _noCache;
52 QString _fullName, _separator;
53 TopFolder _topFolder;
54
55};
56
57class FolderWidgetItem : public QListViewItem
58{
59public:
60 FolderWidgetItem(Folder &folder, QListView *parent);
61 FolderWidgetItem(Folder &folder, FolderWidgetItem *parent);
62
63 Folder folder() { return _folder; }
64
65private:
66 Folder _folder;
67
68};
69
70class FolderWidget : public ListViewPlus
71{
72 Q_OBJECT
73
74public:
75 FolderWidget(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
76 ~FolderWidget();
77
78public slots:
79 void update();
80
81signals:
82 void folderSelected(Folder folder);
83 void status(const QString &text);
84 void connecting();
85 void connected();
86 void disconnected();
87
88protected:
89 void getAccounts();
90 FolderWidgetItem *addFolder(Folder &folder, FolderWidgetItem *folderWidgetItem);
91 FolderWidgetItem *addAccount(Account &account);
92
93 static const int MENU_RENAME = 0;
94 static const int MENU_DELETE = 1;
95 static const int MENU_MOVE = 2;
96 static const int MENU_COPY = 3;
97 static const int MENU_CREATE = 4;
98 static const int MENU_RESCAN = 5;
99
100protected slots:
101 void slotMenuActivated(int itemid);
102 void slotItemClicked(QListViewItem *item);
103
104 void slotIMAPLookingUpHost();
105 void slotIMAPHostFound();
106 void slotIMAPConnected();
107 void slotIMAPError(int error);
108 void slotIMAPDisconnected();
109
110 void slotIMAPLogin(IMAPResponse &response);
111 void slotIMAPRename(IMAPResponse &response);
112 void slotIMAPDelete(IMAPResponse &response);
113 void slotIMAPCreate(IMAPResponse &response);
114 void slotIMAPList(IMAPResponse &response);
115
116private:
117 Account _rescanAccount;
118 Folder _createFolder;
119
120};
121
122#endif
123