Diffstat (limited to 'noncore/net/mail/accountitem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountitem.h | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/noncore/net/mail/accountitem.h b/noncore/net/mail/accountitem.h index b2c50a1..6518899 100644 --- a/noncore/net/mail/accountitem.h +++ b/noncore/net/mail/accountitem.h | |||
@@ -1,18 +1,20 @@ | |||
1 | #ifndef __ACCOUNT_ITEM | 1 | #ifndef __ACCOUNT_ITEM |
2 | #define __ACCOUNT_ITEM | 2 | #define __ACCOUNT_ITEM |
3 | 3 | ||
4 | #include <opie2/osmartpointer.h> | ||
5 | |||
4 | #include <qlistview.h> | 6 | #include <qlistview.h> |
5 | #include <qlist.h> | 7 | #include <qlist.h> |
6 | #include <opie2/osmartpointer.h> | 8 | #include <qmap.h> |
7 | 9 | ||
8 | class POP3wrapper; | 10 | class POP3wrapper; |
9 | class RecMail; | 11 | class RecMail; |
10 | class RecBody; | 12 | class RecBody; |
11 | class QPopupMenu; | 13 | class QPopupMenu; |
12 | class Selectstore; | 14 | class Selectstore; |
13 | class AccountView; | 15 | class AccountView; |
14 | class POP3account; | 16 | class POP3account; |
15 | class NNTPaccount; | 17 | class NNTPaccount; |
16 | class IMAPaccount; | 18 | class IMAPaccount; |
17 | class AbstractMail; | 19 | class AbstractMail; |
18 | class Folder; | 20 | class Folder; |
@@ -22,204 +24,206 @@ class Folder; | |||
22 | class AccountViewItem : public QListViewItem | 24 | class AccountViewItem : public QListViewItem |
23 | { | 25 | { |
24 | 26 | ||
25 | public: | 27 | public: |
26 | AccountViewItem( AccountView *parent ); | 28 | AccountViewItem( AccountView *parent ); |
27 | AccountViewItem( QListViewItem *parent); | 29 | AccountViewItem( QListViewItem *parent); |
28 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); | 30 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); |
29 | AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); | 31 | AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); |
30 | 32 | ||
31 | virtual ~AccountViewItem(); | 33 | virtual ~AccountViewItem(); |
32 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; | 34 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; |
33 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; | 35 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; |
34 | virtual QPopupMenu * getContextMenu(){return 0;}; | 36 | virtual QPopupMenu * getContextMenu(); |
35 | virtual void contextMenuSelected(int){} | 37 | virtual bool contextMenuSelected(int){return false;} |
36 | virtual AccountView*accountView(); | 38 | virtual AccountView*accountView(); |
37 | virtual bool matchName(const QString&name)const; | 39 | virtual bool matchName(const QString&name)const; |
38 | virtual bool isDraftfolder(); | 40 | virtual bool isDraftfolder(); |
39 | /* 1 - server | 41 | /* 1 - server |
40 | * 2 - folder | 42 | * 2 - folder |
41 | * 3 - beides | 43 | * 3 - both |
42 | */ | 44 | */ |
43 | virtual int isServer()const=0; | 45 | virtual int isServer()const=0; |
46 | virtual QMap<int,QString> serverMenu(); | ||
47 | virtual QMap<int,QString> folderMenu(); | ||
44 | 48 | ||
45 | protected: | 49 | protected: |
46 | AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); | 50 | AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); |
47 | virtual void init(); | 51 | virtual void init(); |
48 | virtual void removeChilds(); | 52 | virtual void removeChilds(); |
49 | virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f); | 53 | virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f); |
50 | static const QString contextName; | 54 | static const QString contextName; |
51 | AccountView*m_Backlink; | 55 | AccountView*m_Backlink; |
52 | Opie::Core::OSmartPointer<Folder> folder; | 56 | Opie::Core::OSmartPointer<Folder> folder; |
53 | }; | 57 | }; |
54 | 58 | ||
55 | class POP3viewItem : public AccountViewItem | 59 | class POP3viewItem : public AccountViewItem |
56 | { | 60 | { |
57 | 61 | ||
58 | public: | 62 | public: |
59 | POP3viewItem( POP3account *a, AccountView *parent ); | 63 | POP3viewItem( POP3account *a, AccountView *parent ); |
60 | virtual ~POP3viewItem(); | 64 | virtual ~POP3viewItem(); |
61 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); | 65 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); |
62 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); | 66 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); |
63 | AbstractMail *getWrapper(); | 67 | AbstractMail *getWrapper(); |
64 | virtual QPopupMenu * getContextMenu(); | 68 | virtual bool contextMenuSelected(int); |
65 | virtual void contextMenuSelected(int); | ||
66 | virtual int isServer()const{return 1;} | 69 | virtual int isServer()const{return 1;} |
70 | virtual QMap<int,QString> serverMenu(); | ||
67 | 71 | ||
68 | protected: | 72 | protected: |
69 | POP3account *account; | 73 | POP3account *account; |
70 | virtual void refresh(); | 74 | virtual void refresh(); |
71 | AbstractMail *wrapper; | 75 | AbstractMail *wrapper; |
72 | void disconnect(); | 76 | void disconnect(); |
73 | void setOnOffline(); | 77 | void setOnOffline(); |
74 | }; | 78 | }; |
75 | 79 | ||
76 | class POP3folderItem : public AccountViewItem | 80 | class POP3folderItem : public AccountViewItem |
77 | { | 81 | { |
78 | 82 | ||
79 | public: | 83 | public: |
80 | POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); | 84 | POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); |
81 | virtual ~POP3folderItem(); | 85 | virtual ~POP3folderItem(); |
82 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); | 86 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); |
83 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); | 87 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); |
84 | virtual QPopupMenu * getContextMenu(); | 88 | virtual bool contextMenuSelected(int); |
85 | virtual void contextMenuSelected(int); | ||
86 | virtual int isServer()const{return 2;} | 89 | virtual int isServer()const{return 2;} |
90 | virtual QMap<int,QString> folderMenu(); | ||
87 | 91 | ||
88 | protected: | 92 | protected: |
89 | void downloadMails(); | 93 | void downloadMails(); |
90 | POP3viewItem *pop3; | 94 | POP3viewItem *pop3; |
91 | }; | 95 | }; |
92 | 96 | ||
93 | 97 | ||
94 | class NNTPviewItem : public AccountViewItem | 98 | class NNTPviewItem : public AccountViewItem |
95 | { | 99 | { |
96 | 100 | ||
97 | public: | 101 | public: |
98 | NNTPviewItem( NNTPaccount *a, AccountView *parent ); | 102 | NNTPviewItem( NNTPaccount *a, AccountView *parent ); |
99 | virtual ~NNTPviewItem(); | 103 | virtual ~NNTPviewItem(); |
100 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); | 104 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); |
101 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); | 105 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); |
102 | AbstractMail *getWrapper(); | 106 | AbstractMail *getWrapper(); |
103 | virtual QPopupMenu * getContextMenu(); | 107 | virtual bool contextMenuSelected(int); |
104 | virtual void contextMenuSelected(int); | ||
105 | virtual int isServer()const{return 1;} | 108 | virtual int isServer()const{return 1;} |
109 | virtual QMap<int,QString> serverMenu(); | ||
106 | 110 | ||
107 | protected: | 111 | protected: |
108 | NNTPaccount *account; | 112 | NNTPaccount *account; |
109 | virtual void refresh(); | 113 | virtual void refresh(); |
110 | AbstractMail *wrapper; | 114 | AbstractMail *wrapper; |
111 | void disconnect(); | 115 | void disconnect(); |
112 | void setOnOffline(); | 116 | void setOnOffline(); |
113 | void subscribeGroups(); | 117 | void subscribeGroups(); |
114 | }; | 118 | }; |
115 | 119 | ||
116 | class NNTPfolderItem : public AccountViewItem | 120 | class NNTPfolderItem : public AccountViewItem |
117 | { | 121 | { |
118 | 122 | ||
119 | public: | 123 | public: |
120 | NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); | 124 | NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); |
121 | virtual ~NNTPfolderItem(); | 125 | virtual ~NNTPfolderItem(); |
122 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); | 126 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); |
123 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); | 127 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); |
124 | virtual QPopupMenu * getContextMenu(); | 128 | virtual bool contextMenuSelected(int); |
125 | virtual void contextMenuSelected(int); | ||
126 | virtual int isServer()const{return 2;} | 129 | virtual int isServer()const{return 2;} |
127 | 130 | virtual QMap<int,QString> folderMenu(); | |
128 | protected: | 131 | protected: |
129 | void downloadMails(); | 132 | void downloadMails(); |
130 | NNTPviewItem *nntp; | 133 | NNTPviewItem *nntp; |
131 | }; | 134 | }; |
132 | 135 | ||
133 | 136 | ||
134 | 137 | ||
135 | class IMAPviewItem : public AccountViewItem | 138 | class IMAPviewItem : public AccountViewItem |
136 | { | 139 | { |
137 | friend class IMAPfolderItem; | 140 | friend class IMAPfolderItem; |
138 | public: | 141 | public: |
139 | IMAPviewItem( IMAPaccount *a, AccountView *parent ); | 142 | IMAPviewItem( IMAPaccount *a, AccountView *parent ); |
140 | virtual ~IMAPviewItem(); | 143 | virtual ~IMAPviewItem(); |
141 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); | 144 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); |
142 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); | 145 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); |
143 | AbstractMail *getWrapper(); | 146 | AbstractMail *getWrapper(); |
144 | virtual QPopupMenu * getContextMenu(); | 147 | virtual bool contextMenuSelected(int); |
145 | virtual void contextMenuSelected(int); | ||
146 | const QStringList&subFolders(); | 148 | const QStringList&subFolders(); |
147 | virtual void refreshFolders(bool force=false); | 149 | virtual void refreshFolders(bool force=false); |
148 | virtual int isServer()const{return 1;} | 150 | virtual int isServer()const{return 1;} |
149 | bool offline(); | 151 | bool offline(); |
152 | virtual QMap<int,QString> serverMenu(); | ||
150 | 153 | ||
151 | protected: | 154 | protected: |
152 | virtual void createNewFolder(); | 155 | virtual void createNewFolder(); |
153 | IMAPaccount *account; | 156 | IMAPaccount *account; |
154 | AbstractMail *wrapper; | 157 | AbstractMail *wrapper; |
155 | QStringList currentFolders; | 158 | QStringList currentFolders; |
156 | }; | 159 | }; |
157 | 160 | ||
158 | class IMAPfolderItem : public AccountViewItem | 161 | class IMAPfolderItem : public AccountViewItem |
159 | { | 162 | { |
160 | 163 | ||
161 | public: | 164 | public: |
162 | IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); | 165 | IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); |
163 | IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | 166 | IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); |
164 | virtual ~IMAPfolderItem(); | 167 | virtual ~IMAPfolderItem(); |
165 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); | 168 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); |
166 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); | 169 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); |
167 | virtual QPopupMenu * getContextMenu(); | 170 | virtual bool contextMenuSelected(int); |
168 | virtual void contextMenuSelected(int); | ||
169 | virtual const QString& Delemiter()const; | 171 | virtual const QString& Delemiter()const; |
170 | virtual int isServer()const{return 2;} | 172 | virtual int isServer()const{return 2;} |
173 | virtual QMap<int,QString> folderMenu(); | ||
171 | protected: | 174 | protected: |
172 | virtual void createNewFolder(); | 175 | virtual void createNewFolder(); |
173 | virtual void deleteFolder(); | 176 | virtual bool deleteFolder(); |
174 | virtual void downloadMails(); | 177 | virtual void downloadMails(); |
175 | IMAPviewItem *imap; | 178 | IMAPviewItem *imap; |
176 | }; | 179 | }; |
177 | 180 | ||
178 | class MHviewItem : public AccountViewItem | 181 | class MHviewItem : public AccountViewItem |
179 | { | 182 | { |
180 | friend class MHfolderItem; | 183 | friend class MHfolderItem; |
181 | 184 | ||
182 | public: | 185 | public: |
183 | MHviewItem( const QString&aMboxPath, AccountView *parent ); | 186 | MHviewItem( const QString&aMboxPath, AccountView *parent ); |
184 | virtual ~MHviewItem(); | 187 | virtual ~MHviewItem(); |
185 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); | 188 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); |
186 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); | 189 | virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); |
187 | AbstractMail *getWrapper(); | 190 | AbstractMail *getWrapper(); |
188 | virtual QPopupMenu * getContextMenu(); | 191 | virtual bool contextMenuSelected(int); |
189 | virtual void contextMenuSelected(int); | ||
190 | QStringList subFolders(); | 192 | QStringList subFolders(); |
191 | virtual void refresh(bool force=false); | 193 | virtual void refresh(bool force=false); |
192 | virtual int isServer()const{return 3;} | 194 | virtual int isServer()const{return 3;} |
195 | virtual QMap<int,QString> serverMenu(); | ||
196 | virtual QMap<int,QString> folderMenu(); | ||
193 | 197 | ||
194 | protected: | 198 | protected: |
195 | void downloadMails(); | 199 | void downloadMails(); |
196 | virtual void createFolder(); | 200 | virtual void createFolder(); |
197 | QString m_Path; | 201 | QString m_Path; |
198 | AbstractMail *wrapper; | 202 | AbstractMail *wrapper; |
199 | QStringList currentFolders; | 203 | QStringList currentFolders; |
200 | }; | 204 | }; |
201 | 205 | ||
202 | class MHfolderItem : public AccountViewItem | 206 | class MHfolderItem : public AccountViewItem |
203 | { | 207 | { |
204 | 208 | ||
205 | public: | 209 | public: |
206 | MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); | 210 | MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); |
207 | MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); | 211 | MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); |
208 | virtual ~MHfolderItem(); | 212 | virtual ~MHfolderItem(); |
209 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); | 213 | virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); |
210 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); | 214 | virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); |
211 | virtual QPopupMenu * getContextMenu(); | 215 | virtual bool contextMenuSelected(int); |
212 | virtual void contextMenuSelected(int); | ||
213 | virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const; | 216 | virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const; |
214 | virtual bool isDraftfolder(); | 217 | virtual bool isDraftfolder(); |
215 | virtual int isServer()const{return 2;} | 218 | virtual int isServer()const{return 2;} |
219 | virtual QMap<int,QString> folderMenu(); | ||
216 | 220 | ||
217 | protected: | 221 | protected: |
218 | void downloadMails(); | 222 | void downloadMails(); |
219 | virtual void createFolder(); | 223 | virtual void createFolder(); |
220 | virtual void deleteFolder(); | 224 | virtual bool deleteFolder(); |
221 | void initName(); | 225 | void initName(); |
222 | MHviewItem *mbox; | 226 | MHviewItem *mbox; |
223 | }; | 227 | }; |
224 | 228 | ||
225 | #endif | 229 | #endif |