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