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