Diffstat (limited to 'noncore/net/mail/accountview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index e7fe038..98abf44 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -3,48 +3,50 @@ | |||
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | 6 | ||
7 | #include "settings.h" | 7 | #include "settings.h" |
8 | #include "mailwrapper.h" | 8 | #include "mailwrapper.h" |
9 | #include "abstractmail.h" | 9 | #include "abstractmail.h" |
10 | 10 | ||
11 | class POP3wrapper; | 11 | class POP3wrapper; |
12 | class RecMail; | 12 | class RecMail; |
13 | class RecBody; | 13 | class RecBody; |
14 | class QPopupMenu; | 14 | class QPopupMenu; |
15 | 15 | ||
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: | ||
28 | static const QString contextName; | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | class POP3viewItem : public AccountViewItem | 31 | class POP3viewItem : public AccountViewItem |
30 | { | 32 | { |
31 | 33 | ||
32 | public: | 34 | public: |
33 | POP3viewItem( POP3account *a, QListView *parent ); | 35 | POP3viewItem( POP3account *a, QListView *parent ); |
34 | ~POP3viewItem(); | 36 | ~POP3viewItem(); |
35 | virtual void refresh( QList<RecMail> &target ); | 37 | virtual void refresh( QList<RecMail> &target ); |
36 | virtual RecBody fetchBody( const RecMail &mail ); | 38 | virtual RecBody fetchBody( const RecMail &mail ); |
37 | AbstractMail *getWrapper(); | 39 | AbstractMail *getWrapper(); |
38 | private: | 40 | private: |
39 | POP3account *account; | 41 | POP3account *account; |
40 | AbstractMail *wrapper; | 42 | AbstractMail *wrapper; |
41 | 43 | ||
42 | }; | 44 | }; |
43 | 45 | ||
44 | class POP3folderItem : public AccountViewItem | 46 | class POP3folderItem : public AccountViewItem |
45 | { | 47 | { |
46 | 48 | ||
47 | public: | 49 | public: |
48 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); | 50 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); |
49 | ~POP3folderItem(); | 51 | ~POP3folderItem(); |
50 | virtual void refresh(QList<RecMail>&); | 52 | virtual void refresh(QList<RecMail>&); |
@@ -67,86 +69,100 @@ public: | |||
67 | AbstractMail *getWrapper(); | 69 | AbstractMail *getWrapper(); |
68 | virtual QPopupMenu * getContextMenu(); | 70 | virtual QPopupMenu * getContextMenu(); |
69 | virtual void contextMenuSelected(int); | 71 | virtual void contextMenuSelected(int); |
70 | 72 | ||
71 | protected: | 73 | protected: |
72 | IMAPfolderItem*findSubItem(const QString&path,IMAPfolderItem*start=0); | 74 | IMAPfolderItem*findSubItem(const QString&path,IMAPfolderItem*start=0); |
73 | virtual void refreshFolders(bool force=false); | 75 | virtual void refreshFolders(bool force=false); |
74 | virtual void createNewFolder(); | 76 | virtual void createNewFolder(); |
75 | 77 | ||
76 | private: | 78 | private: |
77 | IMAPaccount *account; | 79 | IMAPaccount *account; |
78 | AbstractMail *wrapper; | 80 | AbstractMail *wrapper; |
79 | }; | 81 | }; |
80 | 82 | ||
81 | class IMAPfolderItem : public AccountViewItem | 83 | class IMAPfolderItem : public AccountViewItem |
82 | { | 84 | { |
83 | 85 | ||
84 | public: | 86 | public: |
85 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); | 87 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); |
86 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | 88 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); |
87 | ~IMAPfolderItem(); | 89 | ~IMAPfolderItem(); |
88 | virtual void refresh(QList<RecMail>&); | 90 | virtual void refresh(QList<RecMail>&); |
89 | virtual RecBody fetchBody(const RecMail&); | 91 | virtual RecBody fetchBody(const RecMail&); |
90 | bool matchName(const QString&name)const; | 92 | bool matchName(const QString&name)const; |
91 | virtual void deleteAllMails(); | ||
92 | virtual QPopupMenu * getContextMenu(); | 93 | virtual QPopupMenu * getContextMenu(); |
93 | virtual void contextMenuSelected(int); | 94 | virtual void contextMenuSelected(int); |
94 | virtual const QString& Delemiter()const; | 95 | virtual const QString& Delemiter()const; |
95 | protected: | 96 | protected: |
96 | virtual void createNewFolder(); | 97 | virtual void createNewFolder(); |
97 | virtual void deleteFolder(); | 98 | virtual void deleteFolder(); |
99 | virtual void deleteAllMails(); | ||
98 | 100 | ||
99 | private: | 101 | private: |
100 | Folder *folder; | 102 | Folder *folder; |
101 | IMAPviewItem *imap; | 103 | IMAPviewItem *imap; |
102 | }; | 104 | }; |
103 | 105 | ||
104 | class MBOXviewItem : public AccountViewItem | 106 | class MBOXviewItem : public AccountViewItem |
105 | { | 107 | { |
108 | friend class MBOXfolderItem; | ||
106 | 109 | ||
107 | public: | 110 | public: |
108 | // MBOXviewItem( MBOXaccount *a, QListView *parent ); | 111 | // MBOXviewItem( MBOXaccount *a, QListView *parent ); |
109 | MBOXviewItem( const QString&aMboxPath, QListView *parent ); | 112 | MBOXviewItem( const QString&aMboxPath, QListView *parent ); |
110 | ~MBOXviewItem(); | 113 | ~MBOXviewItem(); |
111 | virtual void refresh( QList<RecMail> &target ); | 114 | virtual void refresh( QList<RecMail> &target ); |
112 | virtual RecBody fetchBody( const RecMail &mail ); | 115 | virtual RecBody fetchBody( const RecMail &mail ); |
113 | AbstractMail *getWrapper(); | 116 | AbstractMail *getWrapper(); |
117 | virtual QPopupMenu * getContextMenu(); | ||
118 | virtual void contextMenuSelected(int); | ||
119 | |||
120 | protected: | ||
121 | virtual void refresh(bool force=false); | ||
122 | virtual void createFolder(); | ||
123 | |||
114 | private: | 124 | private: |
115 | // MBOXaccount *account; | 125 | // MBOXaccount *account; |
116 | QString m_Path; | 126 | QString m_Path; |
117 | AbstractMail *wrapper; | 127 | AbstractMail *wrapper; |
118 | 128 | ||
119 | }; | 129 | }; |
120 | 130 | ||
121 | class MBOXfolderItem : public AccountViewItem | 131 | class MBOXfolderItem : public AccountViewItem |
122 | { | 132 | { |
123 | 133 | ||
124 | public: | 134 | public: |
125 | MBOXfolderItem( Folder *folder, MBOXviewItem *parent , QListViewItem*after ); | 135 | MBOXfolderItem( Folder *folder, MBOXviewItem *parent , QListViewItem*after ); |
126 | ~MBOXfolderItem(); | 136 | ~MBOXfolderItem(); |
127 | virtual void refresh(QList<RecMail>&); | 137 | virtual void refresh(QList<RecMail>&); |
128 | virtual RecBody fetchBody(const RecMail&); | 138 | virtual RecBody fetchBody(const RecMail&); |
139 | virtual QPopupMenu * getContextMenu(); | ||
140 | virtual void contextMenuSelected(int); | ||
141 | |||
142 | protected: | ||
143 | virtual void deleteAllMails(); | ||
144 | virtual void deleteFolder(); | ||
129 | private: | 145 | private: |
130 | Folder *folder; | 146 | Folder *folder; |
131 | MBOXviewItem *mbox; | 147 | MBOXviewItem *mbox; |
132 | }; | 148 | }; |
133 | 149 | ||
134 | class AccountView : public QListView | 150 | class AccountView : public QListView |
135 | { | 151 | { |
136 | Q_OBJECT | 152 | Q_OBJECT |
137 | 153 | ||
138 | public: | 154 | public: |
139 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 155 | AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
140 | void populate( QList<Account> list ); | 156 | void populate( QList<Account> list ); |
141 | RecBody fetchBody(const RecMail&aMail); | 157 | RecBody fetchBody(const RecMail&aMail); |
142 | 158 | ||
143 | public slots: | 159 | public slots: |
144 | virtual void refreshAll(); | 160 | virtual void refreshAll(); |
145 | virtual void refresh(QListViewItem *item); | 161 | virtual void refresh(QListViewItem *item); |
146 | virtual void refreshCurrent(); | 162 | virtual void refreshCurrent(); |
147 | virtual void slotHold(int, QListViewItem *,const QPoint&,int); | 163 | virtual void slotHold(int, QListViewItem *,const QPoint&,int); |
148 | virtual void slotContextMenu(int id); | 164 | virtual void slotContextMenu(int id); |
149 | 165 | ||
150 | signals: | 166 | signals: |
151 | void refreshMailview(QList<RecMail>*); | 167 | void refreshMailview(QList<RecMail>*); |
152 | 168 | ||