author | alwin <alwin> | 2003-12-28 12:57:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-28 12:57:44 (UTC) |
commit | b41e3eb92eab8bf61fd20db70d0317c816b1c2f0 (patch) (unidiff) | |
tree | 5795854d7de75edc4385edc6ee7389809f98f4e1 /noncore/net/mail/accountview.h | |
parent | b834b22bade330b2d684c59b7fc1031a8bf650c5 (diff) | |
download | opie-b41e3eb92eab8bf61fd20db70d0317c816b1c2f0.zip opie-b41e3eb92eab8bf61fd20db70d0317c816b1c2f0.tar.gz opie-b41e3eb92eab8bf61fd20db70d0317c816b1c2f0.tar.bz2 |
basic folder handling for pop3 accounts
some code dups reduced
Diffstat (limited to 'noncore/net/mail/accountview.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 98abf44..361dd86 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -16,24 +16,25 @@ class QPopupMenu; | |||
16 | class AccountViewItem : public QListViewItem | 16 | class AccountViewItem : public QListViewItem |
17 | { | 17 | { |
18 | 18 | ||
19 | public: | 19 | public: |
20 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} | 20 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} |
21 | AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {} | 21 | AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {} |
22 | AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {} | 22 | AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {} |
23 | virtual void refresh(QList<RecMail>&)=0; | 23 | virtual void refresh(QList<RecMail>&)=0; |
24 | virtual RecBody fetchBody(const RecMail&)=0; | 24 | virtual RecBody fetchBody(const RecMail&)=0; |
25 | virtual QPopupMenu * getContextMenu(){return 0;}; | 25 | virtual QPopupMenu * getContextMenu(){return 0;}; |
26 | virtual void contextMenuSelected(int){} | 26 | virtual void contextMenuSelected(int){} |
27 | protected: | 27 | protected: |
28 | virtual void deleteAllMail(AbstractMail*wrapper,Folder*f); | ||
28 | static const QString contextName; | 29 | static const QString contextName; |
29 | }; | 30 | }; |
30 | 31 | ||
31 | class POP3viewItem : public AccountViewItem | 32 | class POP3viewItem : public AccountViewItem |
32 | { | 33 | { |
33 | 34 | ||
34 | public: | 35 | public: |
35 | POP3viewItem( POP3account *a, QListView *parent ); | 36 | POP3viewItem( POP3account *a, QListView *parent ); |
36 | ~POP3viewItem(); | 37 | ~POP3viewItem(); |
37 | virtual void refresh( QList<RecMail> &target ); | 38 | virtual void refresh( QList<RecMail> &target ); |
38 | virtual RecBody fetchBody( const RecMail &mail ); | 39 | virtual RecBody fetchBody( const RecMail &mail ); |
39 | AbstractMail *getWrapper(); | 40 | AbstractMail *getWrapper(); |
@@ -42,24 +43,27 @@ private: | |||
42 | AbstractMail *wrapper; | 43 | AbstractMail *wrapper; |
43 | 44 | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | class POP3folderItem : public AccountViewItem | 47 | class POP3folderItem : public AccountViewItem |
47 | { | 48 | { |
48 | 49 | ||
49 | public: | 50 | public: |
50 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); | 51 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); |
51 | ~POP3folderItem(); | 52 | ~POP3folderItem(); |
52 | virtual void refresh(QList<RecMail>&); | 53 | virtual void refresh(QList<RecMail>&); |
53 | virtual RecBody fetchBody(const RecMail&); | 54 | virtual RecBody fetchBody(const RecMail&); |
55 | virtual QPopupMenu * getContextMenu(); | ||
56 | virtual void contextMenuSelected(int); | ||
57 | |||
54 | private: | 58 | private: |
55 | Folder *folder; | 59 | Folder *folder; |
56 | POP3viewItem *pop3; | 60 | POP3viewItem *pop3; |
57 | }; | 61 | }; |
58 | 62 | ||
59 | class IMAPfolderItem; | 63 | class IMAPfolderItem; |
60 | 64 | ||
61 | class IMAPviewItem : public AccountViewItem | 65 | class IMAPviewItem : public AccountViewItem |
62 | { | 66 | { |
63 | friend class IMAPfolderItem; | 67 | friend class IMAPfolderItem; |
64 | public: | 68 | public: |
65 | IMAPviewItem( IMAPaccount *a, QListView *parent ); | 69 | IMAPviewItem( IMAPaccount *a, QListView *parent ); |
@@ -87,25 +91,24 @@ public: | |||
87 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); | 91 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); |
88 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | 92 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); |
89 | ~IMAPfolderItem(); | 93 | ~IMAPfolderItem(); |
90 | virtual void refresh(QList<RecMail>&); | 94 | virtual void refresh(QList<RecMail>&); |
91 | virtual RecBody fetchBody(const RecMail&); | 95 | virtual RecBody fetchBody(const RecMail&); |
92 | bool matchName(const QString&name)const; | 96 | bool matchName(const QString&name)const; |
93 | virtual QPopupMenu * getContextMenu(); | 97 | virtual QPopupMenu * getContextMenu(); |
94 | virtual void contextMenuSelected(int); | 98 | virtual void contextMenuSelected(int); |
95 | virtual const QString& Delemiter()const; | 99 | virtual const QString& Delemiter()const; |
96 | protected: | 100 | protected: |
97 | virtual void createNewFolder(); | 101 | virtual void createNewFolder(); |
98 | virtual void deleteFolder(); | 102 | virtual void deleteFolder(); |
99 | virtual void deleteAllMails(); | ||
100 | 103 | ||
101 | private: | 104 | private: |
102 | Folder *folder; | 105 | Folder *folder; |
103 | IMAPviewItem *imap; | 106 | IMAPviewItem *imap; |
104 | }; | 107 | }; |
105 | 108 | ||
106 | class MBOXviewItem : public AccountViewItem | 109 | class MBOXviewItem : public AccountViewItem |
107 | { | 110 | { |
108 | friend class MBOXfolderItem; | 111 | friend class MBOXfolderItem; |
109 | 112 | ||
110 | public: | 113 | public: |
111 | // MBOXviewItem( MBOXaccount *a, QListView *parent ); | 114 | // MBOXviewItem( MBOXaccount *a, QListView *parent ); |
@@ -131,25 +134,24 @@ private: | |||
131 | class MBOXfolderItem : public AccountViewItem | 134 | class MBOXfolderItem : public AccountViewItem |
132 | { | 135 | { |
133 | 136 | ||
134 | public: | 137 | public: |
135 | MBOXfolderItem( Folder *folder, MBOXviewItem *parent , QListViewItem*after ); | 138 | MBOXfolderItem( Folder *folder, MBOXviewItem *parent , QListViewItem*after ); |
136 | ~MBOXfolderItem(); | 139 | ~MBOXfolderItem(); |
137 | virtual void refresh(QList<RecMail>&); | 140 | virtual void refresh(QList<RecMail>&); |
138 | virtual RecBody fetchBody(const RecMail&); | 141 | virtual RecBody fetchBody(const RecMail&); |
139 | virtual QPopupMenu * getContextMenu(); | 142 | virtual QPopupMenu * getContextMenu(); |
140 | virtual void contextMenuSelected(int); | 143 | virtual void contextMenuSelected(int); |
141 | 144 | ||
142 | protected: | 145 | protected: |
143 | virtual void deleteAllMails(); | ||
144 | virtual void deleteFolder(); | 146 | virtual void deleteFolder(); |
145 | private: | 147 | private: |
146 | Folder *folder; | 148 | Folder *folder; |
147 | MBOXviewItem *mbox; | 149 | MBOXviewItem *mbox; |
148 | }; | 150 | }; |
149 | 151 | ||
150 | class AccountView : public QListView | 152 | class AccountView : public QListView |
151 | { | 153 | { |
152 | Q_OBJECT | 154 | Q_OBJECT |
153 | 155 | ||
154 | public: | 156 | public: |
155 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 157 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |