Diffstat (limited to 'noncore/net/mailit/emailclient.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailclient.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/net/mailit/emailclient.h b/noncore/net/mailit/emailclient.h index 549683b..994fec5 100644 --- a/noncore/net/mailit/emailclient.h +++ b/noncore/net/mailit/emailclient.h | |||
@@ -1,174 +1,181 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef EMAILCLIENT_H | 20 | #ifndef EMAILCLIENT_H |
21 | #define EMAILCLIENT_H | 21 | #define EMAILCLIENT_H |
22 | 22 | ||
23 | #include <qlist.h> | 23 | #include <qlist.h> |
24 | #include <qcstring.h> | 24 | #include <qcstring.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | 26 | ||
27 | #include <qtoolbar.h> | 27 | #include <qtoolbar.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qlistview.h> | 31 | #include <qlistview.h> |
32 | #include <qaction.h> | 32 | #include <qaction.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qtooltip.h> | 34 | #include <qtooltip.h> |
35 | #include <qtoolbutton.h> | 35 | #include <qtoolbutton.h> |
36 | #include <qimage.h> | 36 | #include <qimage.h> |
37 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
38 | #include <qstringlist.h> | 38 | #include <qstringlist.h> |
39 | #include <qprogressbar.h> | 39 | #include <qprogressbar.h> |
40 | #include <qstatusbar.h> | 40 | #include <qstatusbar.h> |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | #include <opie/otabwidget.h> | 43 | #include <opie/otabwidget.h> |
44 | #include <qpe/qcopenvelope_qws.h> | ||
44 | #include <qtimer.h> | 45 | #include <qtimer.h> |
45 | 46 | ||
46 | #include "emailhandler.h" | 47 | #include "emailhandler.h" |
47 | #include "emaillistitem.h" | 48 | #include "emaillistitem.h" |
48 | #include "textparser.h" | 49 | #include "textparser.h" |
49 | #include "editaccount.h" | 50 | #include "editaccount.h" |
50 | #include "maillist.h" | 51 | #include "maillist.h" |
51 | #include "addresslist.h" | 52 | #include "addresslist.h" |
52 | 53 | ||
53 | #include <qpe/config.h> | 54 | #include <qpe/config.h> |
54 | 55 | ||
55 | class AccountList : public QList<MailAccount> | 56 | class AccountList : public QList<MailAccount> |
56 | { | 57 | { |
57 | public: | 58 | public: |
58 | Item newItem(Item d); | 59 | Item newItem(Item d); |
59 | private: | 60 | private: |
60 | MailAccount* dupl(MailAccount *in); | 61 | MailAccount* dupl(MailAccount *in); |
61 | MailAccount *ac; | 62 | MailAccount *ac; |
62 | }; | 63 | }; |
63 | 64 | ||
64 | //class EmailClient : public EmailClientBase | 65 | //class EmailClient : public EmailClientBase |
65 | class EmailClient : public QMainWindow | 66 | class EmailClient : public QMainWindow |
66 | { | 67 | { |
67 | Q_OBJECT | 68 | Q_OBJECT |
68 | 69 | ||
69 | public: | 70 | public: |
70 | EmailClient( QWidget* parent, const char* name, WFlags fl = 0 ); | 71 | EmailClient( QWidget* parent, const char* name, WFlags fl = 0 ); |
71 | ~EmailClient(); | 72 | ~EmailClient(); |
72 | AddressList* getAdrListRef(); | 73 | AddressList* getAdrListRef(); |
73 | void download(Email*); | ||
74 | 74 | ||
75 | protected: | 75 | protected: |
76 | void timerEvent(QTimerEvent*); | 76 | //void timerEvent(QTimerEvent*); |
77 | 77 | ||
78 | signals: | 78 | signals: |
79 | void composeRequested(); | 79 | void composeRequested(); |
80 | void viewEmail(QListView *, Email *); | 80 | void viewEmail(QListView *, Email *); |
81 | void mailUpdated(Email *); | 81 | void mailUpdated(Email *); |
82 | void newCaption(const QString &); | 82 | void newCaption(const QString &); |
83 | void replyRequested(Email&, bool&); | 83 | void replyRequested(Email&, bool&); |
84 | void forwardRequested(Email&); | 84 | void forwardRequested(Email&); |
85 | void removeItem(EmailListItem*, bool&); | 85 | void removeItem(EmailListItem*, bool&); |
86 | /*void reply(Email&); | 86 | /*void reply(Email&); |
87 | void replyAll(Email&); | 87 | void replyAll(Email&); |
88 | void remove(Email&); | 88 | void remove(Email&); |
89 | void forward(Email&);*/ | 89 | void forward(Email&);*/ |
90 | 90 | ||
91 | public slots: | 91 | public slots: |
92 | void compose(); | 92 | void compose(); |
93 | void cancel(); | 93 | void cancel(); |
94 | void enqueMail(const Email &mail); | 94 | void enqueMail(const Email &mail); |
95 | void setMailAccount(); | 95 | void setMailAccount(); |
96 | void sendQuedMail(); | 96 | void sendQuedMail(); |
97 | void mailSent(); | 97 | void mailSent(); |
98 | void deleteItem(); | 98 | void deleteItem(); |
99 | void getNewMail(); | 99 | void getNewMail(); |
100 | void getAllNewMail(); | 100 | void getAllNewMail(); |
101 | void smtpError(int code); | 101 | void smtpError(int code); |
102 | void popError(int code); | 102 | void popError(int code); |
103 | void inboxItemSelected(); | 103 | void inboxItemSelected(); |
104 | void outboxItemSelected(); | 104 | void outboxItemSelected(); |
105 | void inboxItemPressed(); | 105 | void inboxItemPressed(); |
106 | void inboxItemReleased(); | 106 | void inboxItemReleased(); |
107 | void mailArrived(const Email &mail, bool fromDisk); | 107 | void mailArrived(const Email &mail, bool fromDisk); |
108 | void allMailArrived(int); | 108 | void allMailArrived(int); |
109 | void saveMail(QString fileName, QListView *view); | 109 | void saveMail(QString fileName, QListView *view); |
110 | void selectAccount(int); | 110 | void selectAccount(int); |
111 | void editAccount(int); | 111 | void editAccount(int); |
112 | void updateAccounts(); | 112 | void updateAccounts(); |
113 | void deleteAccount(int); | 113 | void deleteAccount(int); |
114 | void deleteMail(EmailListItem *mailItem, bool &inbox); | 114 | void deleteMail(EmailListItem *mailItem, bool &inbox); |
115 | void setTotalSize(int); | 115 | void setTotalSize(int); |
116 | void setMailSize(int); | 116 | void setMailSize(int); |
117 | void setDownloadedSize(int); | 117 | void setDownloadedSize(int); |
118 | void moveMailFront(Email *mailPtr); | 118 | void moveMailFront(Email *mailPtr); |
119 | void download(Email*); | ||
119 | /* void reply(); | 120 | /* void reply(); |
120 | void replyAll(); | 121 | void replyAll(); |
121 | void forward(); | 122 | void forward(); |
122 | void remove();*/ | 123 | void remove();*/ |
123 | 124 | ||
125 | private slots: | ||
126 | void receive(const QCString&, const QByteArray&); | ||
127 | |||
124 | private: | 128 | private: |
125 | void init(); | 129 | void init(); |
130 | void initStatusBar(QWidget*); | ||
126 | void readMail(); | 131 | void readMail(); |
127 | QString getPath(bool enclosurePath); | 132 | QString getPath(bool enclosurePath); |
128 | void readSettings(); | 133 | void readSettings(); |
129 | void saveSettings(); | 134 | void saveSettings(); |
130 | Email* getCurrentMail(); | 135 | Email* getCurrentMail(); |
131 | int timerID; | 136 | int timerID; |
132 | Config *mailconf; | 137 | Config *mailconf; |
133 | int newAccountId, idCount, mailIdCount; | 138 | int newAccountId, idCount, mailIdCount; |
134 | int accountIdCount; | 139 | int accountIdCount; |
135 | AccountList accountList; | 140 | AccountList accountList; |
136 | AddressList *addressList; | 141 | AddressList *addressList; |
137 | 142 | ||
138 | EditAccount *editAccountView; | 143 | EditAccount *editAccountView; |
139 | EmailListItem *item; | 144 | EmailListItem *item; |
140 | EmailHandler *emailHandler; | 145 | EmailHandler *emailHandler; |
141 | QList<Email> quedMessages; | 146 | QList<Email> quedMessages; |
142 | MailList mailDownloadList; | 147 | MailList mailDownloadList; |
143 | MailList tempMailDownloadList; | 148 | MailList tempMailDownloadList; |
144 | 149 | ||
145 | bool sending, receiving, previewingMail, allAccounts; | 150 | bool sending, receiving, previewingMail, allAccounts; |
146 | QString lineShift; | 151 | QString lineShift; |
147 | MailAccount account, *currentAccount; | 152 | MailAccount account, *currentAccount; |
148 | 153 | ||
154 | QCopChannel* channel; | ||
155 | |||
149 | QToolBar *bar; | 156 | QToolBar *bar; |
150 | QProgressBar *progressBar; | 157 | QProgressBar *progressBar; |
151 | QStatusBar *statusBar; | 158 | QStatusBar *statusBar; |
152 | QLabel *status1Label, *status2Label; | 159 | QLabel *status1Label, *status2Label; |
153 | QToolButton *getMailButton; | 160 | QToolButton *getMailButton; |
154 | QAction *sendMailButton; | 161 | QAction *sendMailButton; |
155 | QAction *composeButton; | 162 | QAction *composeButton; |
156 | QAction *cancelButton; | 163 | QAction *cancelButton; |
157 | QAction *deleteButton; | 164 | QAction *deleteButton; |
158 | //QToolButton *setAccountButton; | 165 | //QToolButton *setAccountButton; |
159 | 166 | ||
160 | QMenuBar *mb; | 167 | QMenuBar *mb; |
161 | QPopupMenu *selectAccountMenu; | 168 | QPopupMenu *selectAccountMenu; |
162 | QPopupMenu *editAccountMenu; | 169 | QPopupMenu *editAccountMenu; |
163 | QPopupMenu *deleteAccountMenu; | 170 | QPopupMenu *deleteAccountMenu; |
164 | QPopupMenu *setAccountMenu; | 171 | QPopupMenu *setAccountMenu; |
165 | 172 | ||
166 | OTabWidget* mailboxView; | 173 | OTabWidget* mailboxView; |
167 | QListView* inboxView; | 174 | QListView* inboxView; |
168 | QListView* outboxView; | 175 | QListView* outboxView; |
169 | 176 | ||
170 | QGridLayout* grid_2; | 177 | QGridLayout* grid_2; |
171 | QGridLayout* grid_3; | 178 | QGridLayout* grid_3; |
172 | }; | 179 | }; |
173 | 180 | ||
174 | #endif // EMAILCLIENT_H | 181 | #endif // EMAILCLIENT_H |