Diffstat (limited to 'noncore/net/mail/accountview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.h | 162 |
1 files changed, 6 insertions, 156 deletions
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 60e2b4b..9f92090 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -1,176 +1,26 @@ | |||
1 | #ifndef ACCOUNTVIEW_H | 1 | #ifndef ACCOUNTVIEW_H |
2 | #define ACCOUNTVIEW_H | 2 | #define ACCOUNTVIEW_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | 6 | ||
7 | #include <libmailwrapper/settings.h> | 7 | class Selectstore; |
8 | #include <libmailwrapper/mailwrapper.h> | ||
9 | #include <libmailwrapper/abstractmail.h> | ||
10 | |||
11 | class POP3wrapper; | ||
12 | class RecMail; | 8 | class RecMail; |
13 | class RecBody; | 9 | class RecBody; |
14 | class QPopupMenu; | 10 | class Folder; |
15 | class Selectstore; | 11 | class AbstractMail; |
16 | class AccountView; | 12 | class Account; |
17 | 13 | class IMAPviewItem; | |
18 | class AccountViewItem : public QListViewItem | 14 | class MHviewItem; |
19 | { | ||
20 | |||
21 | public: | ||
22 | AccountViewItem( AccountView *parent ); | ||
23 | AccountViewItem( QListViewItem *parent); | ||
24 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); | ||
25 | virtual ~AccountViewItem(); | ||
26 | virtual void refresh(QList<RecMail>&)=0; | ||
27 | virtual RecBody fetchBody(const RecMail&)=0; | ||
28 | virtual QPopupMenu * getContextMenu(){return 0;}; | ||
29 | virtual void contextMenuSelected(int){} | ||
30 | virtual AccountView*accountView(); | ||
31 | protected: | ||
32 | virtual void deleteAllMail(AbstractMail*wrapper,Folder*f); | ||
33 | static const QString contextName; | ||
34 | AccountView*m_Backlink; | ||
35 | }; | ||
36 | |||
37 | class POP3viewItem : public AccountViewItem | ||
38 | { | ||
39 | |||
40 | public: | ||
41 | POP3viewItem( POP3account *a, AccountView *parent ); | ||
42 | virtual ~POP3viewItem(); | ||
43 | virtual void refresh( QList<RecMail> &target ); | ||
44 | virtual RecBody fetchBody( const RecMail &mail ); | ||
45 | AbstractMail *getWrapper(); | ||
46 | virtual QPopupMenu * getContextMenu(); | ||
47 | virtual void contextMenuSelected(int); | ||
48 | |||
49 | protected: | ||
50 | POP3account *account; | ||
51 | virtual void refresh(); | ||
52 | AbstractMail *wrapper; | ||
53 | void disconnect(); | ||
54 | void setOnOffline(); | ||
55 | }; | ||
56 | |||
57 | class POP3folderItem : public AccountViewItem | ||
58 | { | ||
59 | |||
60 | public: | ||
61 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); | ||
62 | virtual ~POP3folderItem(); | ||
63 | virtual void refresh(QList<RecMail>&); | ||
64 | virtual RecBody fetchBody(const RecMail&); | ||
65 | virtual QPopupMenu * getContextMenu(); | ||
66 | virtual void contextMenuSelected(int); | ||
67 | |||
68 | protected: | ||
69 | void downloadMails(); | ||
70 | Folder *folder; | ||
71 | POP3viewItem *pop3; | ||
72 | }; | ||
73 | |||
74 | class IMAPfolderItem; | ||
75 | |||
76 | class IMAPviewItem : public AccountViewItem | ||
77 | { | ||
78 | friend class IMAPfolderItem; | ||
79 | public: | ||
80 | IMAPviewItem( IMAPaccount *a, AccountView *parent ); | ||
81 | virtual ~IMAPviewItem(); | ||
82 | virtual void refresh(QList<RecMail>&); | ||
83 | virtual RecBody fetchBody(const RecMail&); | ||
84 | AbstractMail *getWrapper(); | ||
85 | virtual QPopupMenu * getContextMenu(); | ||
86 | virtual void contextMenuSelected(int); | ||
87 | const QStringList&subFolders(); | ||
88 | virtual void refreshFolders(bool force=false); | ||
89 | bool offline(); | ||
90 | |||
91 | protected: | ||
92 | IMAPfolderItem*findSubItem(const QString&path,IMAPfolderItem*start=0); | ||
93 | virtual void createNewFolder(); | ||
94 | virtual void removeChilds(); | ||
95 | IMAPaccount *account; | ||
96 | AbstractMail *wrapper; | ||
97 | QStringList currentFolders; | ||
98 | }; | ||
99 | |||
100 | class IMAPfolderItem : public AccountViewItem | ||
101 | { | ||
102 | |||
103 | public: | ||
104 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); | ||
105 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | ||
106 | virtual ~IMAPfolderItem(); | ||
107 | virtual void refresh(QList<RecMail>&); | ||
108 | virtual RecBody fetchBody(const RecMail&); | ||
109 | bool matchName(const QString&name)const; | ||
110 | virtual QPopupMenu * getContextMenu(); | ||
111 | virtual void contextMenuSelected(int); | ||
112 | virtual const QString& Delemiter()const; | ||
113 | protected: | ||
114 | virtual void createNewFolder(); | ||
115 | virtual void deleteFolder(); | ||
116 | virtual void downloadMails(); | ||
117 | Folder *folder; | ||
118 | IMAPviewItem *imap; | ||
119 | }; | ||
120 | |||
121 | class MHviewItem : public AccountViewItem | ||
122 | { | ||
123 | friend class MHfolderItem; | ||
124 | |||
125 | public: | ||
126 | MHviewItem( const QString&aMboxPath, AccountView *parent ); | ||
127 | virtual ~MHviewItem(); | ||
128 | virtual void refresh( QList<RecMail> &target ); | ||
129 | virtual RecBody fetchBody( const RecMail &mail ); | ||
130 | AbstractMail *getWrapper(); | ||
131 | virtual QPopupMenu * getContextMenu(); | ||
132 | virtual void contextMenuSelected(int); | ||
133 | QStringList subFolders(); | ||
134 | virtual void refresh(bool force=false); | ||
135 | |||
136 | protected: | ||
137 | void downloadMails(); | ||
138 | void removeChilds(); | ||
139 | virtual void createFolder(); | ||
140 | QString m_Path; | ||
141 | AbstractMail *wrapper; | ||
142 | Folder *folder; | ||
143 | }; | ||
144 | |||
145 | class MHfolderItem : public AccountViewItem | ||
146 | { | ||
147 | |||
148 | public: | ||
149 | MHfolderItem( Folder *folder, MHviewItem *parent , QListViewItem*after ); | ||
150 | MHfolderItem( Folder *folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); | ||
151 | virtual ~MHfolderItem(); | ||
152 | virtual void refresh(QList<RecMail>&); | ||
153 | virtual RecBody fetchBody(const RecMail&); | ||
154 | virtual QPopupMenu * getContextMenu(); | ||
155 | virtual void contextMenuSelected(int); | ||
156 | virtual Folder*getFolder(); | ||
157 | |||
158 | protected: | ||
159 | void downloadMails(); | ||
160 | virtual void deleteFolder(); | ||
161 | void initName(); | ||
162 | Folder *folder; | ||
163 | MHviewItem *mbox; | ||
164 | }; | ||
165 | 15 | ||
166 | class AccountView : public QListView | 16 | class AccountView : public QListView |
167 | { | 17 | { |
168 | Q_OBJECT | 18 | Q_OBJECT |
169 | 19 | ||
170 | public: | 20 | public: |
171 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 21 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
172 | virtual ~AccountView(); | 22 | virtual ~AccountView(); |
173 | virtual void populate( QList<Account> list ); | 23 | virtual void populate( QList<Account> list ); |
174 | virtual RecBody fetchBody(const RecMail&aMail); | 24 | virtual RecBody fetchBody(const RecMail&aMail); |
175 | virtual void downloadMails(Folder*fromFolder,AbstractMail*fromWrapper); | 25 | virtual void downloadMails(Folder*fromFolder,AbstractMail*fromWrapper); |
176 | 26 | ||