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