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