author | alwin <alwin> | 2003-12-08 22:20:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-08 22:20:44 (UTC) |
commit | 115bb2c722dc03c0491e2f1c49495a1ceb760000 (patch) (unidiff) | |
tree | 0c8dd795db536da485f85338bdbf9d888fbd37f2 | |
parent | 760fc48703328d8254c60acd19dc9ab367f2a134 (diff) | |
download | opie-115bb2c722dc03c0491e2f1c49495a1ceb760000.zip opie-115bb2c722dc03c0491e2f1c49495a1ceb760000.tar.gz opie-115bb2c722dc03c0491e2f1c49495a1ceb760000.tar.bz2 |
imap wrapper has now an own include file
-rw-r--r-- | noncore/net/mail/accountview.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/accountview.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.h | 25 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 25 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.h | 19 | ||||
-rw-r--r-- | noncore/net/mail/mail.pro | 3 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.h | 19 |
9 files changed, 57 insertions, 41 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index c6a44ab..a531976 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,33 +1,34 @@ | |||
1 | #include "accountview.h" | 1 | #include "accountview.h" |
2 | #include "imapwrapper.h" | ||
2 | #include "defines.h" | 3 | #include "defines.h" |
3 | 4 | ||
4 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) | 5 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) |
5 | : AccountViewItem( parent ) | 6 | : AccountViewItem( parent ) |
6 | { | 7 | { |
7 | account = a; | 8 | account = a; |
8 | wrapper = new IMAPwrapper( account ); | 9 | wrapper = new IMAPwrapper( account ); |
9 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 10 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
10 | setText( 0, account->getAccountName() ); | 11 | setText( 0, account->getAccountName() ); |
11 | setOpen( true ); | 12 | setOpen( true ); |
12 | } | 13 | } |
13 | 14 | ||
14 | IMAPviewItem::~IMAPviewItem() | 15 | IMAPviewItem::~IMAPviewItem() |
15 | { | 16 | { |
16 | delete wrapper; | 17 | delete wrapper; |
17 | } | 18 | } |
18 | 19 | ||
19 | IMAPwrapper *IMAPviewItem::getWrapper() | 20 | IMAPwrapper *IMAPviewItem::getWrapper() |
20 | { | 21 | { |
21 | return wrapper; | 22 | return wrapper; |
22 | } | 23 | } |
23 | 24 | ||
24 | void IMAPviewItem::refresh(Maillist&) | 25 | void IMAPviewItem::refresh(Maillist&) |
25 | { | 26 | { |
26 | QList<IMAPFolder> *folders = wrapper->listFolders(); | 27 | QList<IMAPFolder> *folders = wrapper->listFolders(); |
27 | 28 | ||
28 | QListViewItem *child = firstChild(); | 29 | QListViewItem *child = firstChild(); |
29 | while ( child ) { | 30 | while ( child ) { |
30 | QListViewItem *tmp = child; | 31 | QListViewItem *tmp = child; |
31 | child = child->nextSibling(); | 32 | child = child->nextSibling(); |
32 | delete tmp; | 33 | delete tmp; |
33 | } | 34 | } |
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 14d8efa..2bc8023 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -1,40 +1,42 @@ | |||
1 | #ifndef ACCOUNTVIEW_H | 1 | #ifndef ACCOUNTVIEW_H |
2 | #define ACCOUNTVIEW_H | 2 | #define ACCOUNTVIEW_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | 5 | ||
6 | #include "settings.h" | 6 | #include "settings.h" |
7 | #include "mailwrapper.h" | 7 | #include "mailwrapper.h" |
8 | 8 | ||
9 | class IMAPwrapper; | ||
10 | |||
9 | class AccountViewItem : public QListViewItem | 11 | class AccountViewItem : public QListViewItem |
10 | { | 12 | { |
11 | 13 | ||
12 | public: | 14 | public: |
13 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} | 15 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} |
14 | AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {} | 16 | AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {} |
15 | virtual void refresh(Maillist&)=0; | 17 | virtual void refresh(Maillist&)=0; |
16 | virtual QString fetchBody(const RecMail&)=0; | 18 | virtual QString fetchBody(const RecMail&)=0; |
17 | }; | 19 | }; |
18 | 20 | ||
19 | class IMAPviewItem : public AccountViewItem | 21 | class IMAPviewItem : public AccountViewItem |
20 | { | 22 | { |
21 | 23 | ||
22 | public: | 24 | public: |
23 | IMAPviewItem( IMAPaccount *a, QListView *parent ); | 25 | IMAPviewItem( IMAPaccount *a, QListView *parent ); |
24 | ~IMAPviewItem(); | 26 | ~IMAPviewItem(); |
25 | virtual void refresh(Maillist&); | 27 | virtual void refresh(Maillist&); |
26 | virtual QString fetchBody(const RecMail&){return "";} | 28 | virtual QString fetchBody(const RecMail&){return "";} |
27 | IMAPwrapper *getWrapper(); | 29 | IMAPwrapper *getWrapper(); |
28 | 30 | ||
29 | private: | 31 | private: |
30 | IMAPaccount *account; | 32 | IMAPaccount *account; |
31 | IMAPwrapper *wrapper; | 33 | IMAPwrapper *wrapper; |
32 | 34 | ||
33 | }; | 35 | }; |
34 | 36 | ||
35 | class IMAPfolderItem : public AccountViewItem | 37 | class IMAPfolderItem : public AccountViewItem |
36 | { | 38 | { |
37 | 39 | ||
38 | public: | 40 | public: |
39 | IMAPfolderItem( IMAPFolder *folder, IMAPviewItem *parent ); | 41 | IMAPfolderItem( IMAPFolder *folder, IMAPviewItem *parent ); |
40 | ~IMAPfolderItem(); | 42 | ~IMAPfolderItem(); |
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index fc12947..7b78499 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -1,36 +1,36 @@ | |||
1 | 1 | ||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include "mailwrapper.h" | 4 | #include "imapwrapper.h" |
5 | 5 | ||
6 | 6 | ||
7 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 7 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
8 | { | 8 | { |
9 | account = a; | 9 | account = a; |
10 | } | 10 | } |
11 | 11 | ||
12 | void imap_progress( size_t current, size_t maximum ) | 12 | void imap_progress( size_t current, size_t maximum ) |
13 | { | 13 | { |
14 | qDebug( "IMAP: %i of %i", current, maximum ); | 14 | qDebug( "IMAP: %i of %i", current, maximum ); |
15 | } | 15 | } |
16 | 16 | ||
17 | void IMAPwrapper::listMessages(const QString&mailbox,Maillist&target ) | 17 | void IMAPwrapper::listMessages(const QString&mailbox,Maillist&target ) |
18 | { | 18 | { |
19 | const char *server, *user, *pass, *mb; | 19 | const char *server, *user, *pass, *mb; |
20 | uint16_t port; | 20 | uint16_t port; |
21 | int err = MAILIMAP_NO_ERROR; | 21 | int err = MAILIMAP_NO_ERROR; |
22 | clist *result; | 22 | clist *result; |
23 | clistcell *current; | 23 | clistcell *current; |
24 | mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate; | 24 | mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate; |
25 | mailimap_fetch_type *fetchType; | 25 | mailimap_fetch_type *fetchType; |
26 | mailimap_set *set; | 26 | mailimap_set *set; |
27 | 27 | ||
28 | mb = mailbox.latin1(); | 28 | mb = mailbox.latin1(); |
29 | server = account->getServer().latin1(); | 29 | server = account->getServer().latin1(); |
30 | port = account->getPort().toUInt(); | 30 | port = account->getPort().toUInt(); |
31 | user = account->getUser().latin1(); | 31 | user = account->getUser().latin1(); |
32 | pass = account->getPassword().latin1(); | 32 | pass = account->getPassword().latin1(); |
33 | 33 | ||
34 | mailimap *imap = mailimap_new( 20, &imap_progress ); | 34 | mailimap *imap = mailimap_new( 20, &imap_progress ); |
35 | if ( imap == NULL ) { | 35 | if ( imap == NULL ) { |
36 | qDebug("IMAP Memory error"); | 36 | qDebug("IMAP Memory error"); |
diff --git a/noncore/net/mail/imapwrapper.h b/noncore/net/mail/imapwrapper.h new file mode 100644 index 0000000..65c36e0 --- a/dev/null +++ b/noncore/net/mail/imapwrapper.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef __IMAPWRAPPER | ||
2 | #define __IMAPWRAPPER | ||
3 | |||
4 | #include "mailwrapper.h" | ||
5 | #include <libetpan/mailimap.h> | ||
6 | |||
7 | class IMAPwrapper : public QObject | ||
8 | { | ||
9 | Q_OBJECT | ||
10 | |||
11 | public: | ||
12 | IMAPwrapper( IMAPaccount *a ); | ||
13 | QList<IMAPFolder>* listFolders(); | ||
14 | void listMessages(const QString & mailbox,Maillist&target ); | ||
15 | QString fetchBody(const QString & mailbox,const RecMail&mail); | ||
16 | |||
17 | protected: | ||
18 | RecMail*parse_list_result(mailimap_msg_att*); | ||
19 | |||
20 | private: | ||
21 | IMAPaccount *account; | ||
22 | |||
23 | }; | ||
24 | |||
25 | #endif | ||
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index fc12947..7b78499 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -1,36 +1,36 @@ | |||
1 | 1 | ||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include "mailwrapper.h" | 4 | #include "imapwrapper.h" |
5 | 5 | ||
6 | 6 | ||
7 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 7 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
8 | { | 8 | { |
9 | account = a; | 9 | account = a; |
10 | } | 10 | } |
11 | 11 | ||
12 | void imap_progress( size_t current, size_t maximum ) | 12 | void imap_progress( size_t current, size_t maximum ) |
13 | { | 13 | { |
14 | qDebug( "IMAP: %i of %i", current, maximum ); | 14 | qDebug( "IMAP: %i of %i", current, maximum ); |
15 | } | 15 | } |
16 | 16 | ||
17 | void IMAPwrapper::listMessages(const QString&mailbox,Maillist&target ) | 17 | void IMAPwrapper::listMessages(const QString&mailbox,Maillist&target ) |
18 | { | 18 | { |
19 | const char *server, *user, *pass, *mb; | 19 | const char *server, *user, *pass, *mb; |
20 | uint16_t port; | 20 | uint16_t port; |
21 | int err = MAILIMAP_NO_ERROR; | 21 | int err = MAILIMAP_NO_ERROR; |
22 | clist *result; | 22 | clist *result; |
23 | clistcell *current; | 23 | clistcell *current; |
24 | mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate; | 24 | mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate; |
25 | mailimap_fetch_type *fetchType; | 25 | mailimap_fetch_type *fetchType; |
26 | mailimap_set *set; | 26 | mailimap_set *set; |
27 | 27 | ||
28 | mb = mailbox.latin1(); | 28 | mb = mailbox.latin1(); |
29 | server = account->getServer().latin1(); | 29 | server = account->getServer().latin1(); |
30 | port = account->getPort().toUInt(); | 30 | port = account->getPort().toUInt(); |
31 | user = account->getUser().latin1(); | 31 | user = account->getUser().latin1(); |
32 | pass = account->getPassword().latin1(); | 32 | pass = account->getPassword().latin1(); |
33 | 33 | ||
34 | mailimap *imap = mailimap_new( 20, &imap_progress ); | 34 | mailimap *imap = mailimap_new( 20, &imap_progress ); |
35 | if ( imap == NULL ) { | 35 | if ( imap == NULL ) { |
36 | qDebug("IMAP Memory error"); | 36 | qDebug("IMAP Memory error"); |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h new file mode 100644 index 0000000..65c36e0 --- a/dev/null +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef __IMAPWRAPPER | ||
2 | #define __IMAPWRAPPER | ||
3 | |||
4 | #include "mailwrapper.h" | ||
5 | #include <libetpan/mailimap.h> | ||
6 | |||
7 | class IMAPwrapper : public QObject | ||
8 | { | ||
9 | Q_OBJECT | ||
10 | |||
11 | public: | ||
12 | IMAPwrapper( IMAPaccount *a ); | ||
13 | QList<IMAPFolder>* listFolders(); | ||
14 | void listMessages(const QString & mailbox,Maillist&target ); | ||
15 | QString fetchBody(const QString & mailbox,const RecMail&mail); | ||
16 | |||
17 | protected: | ||
18 | RecMail*parse_list_result(mailimap_msg_att*); | ||
19 | |||
20 | private: | ||
21 | IMAPaccount *account; | ||
22 | |||
23 | }; | ||
24 | |||
25 | #endif | ||
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index f45eab7..955a8e2 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h | |||
@@ -1,41 +1,40 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <libetpan/mailmime.h> | 6 | #include <libetpan/mailmime.h> |
7 | #include <libetpan/mailimf.h> | 7 | #include <libetpan/mailimf.h> |
8 | #include <libetpan/mailsmtp.h> | 8 | #include <libetpan/mailsmtp.h> |
9 | #include <libetpan/mailimap.h> | ||
10 | #include <libetpan/mailstorage.h> | 9 | #include <libetpan/mailstorage.h> |
11 | #include <libetpan/maildriver.h> | 10 | #include <libetpan/maildriver.h> |
12 | #include <qbitarray.h> | 11 | #include <qbitarray.h> |
13 | #include <qdatetime.h> | 12 | #include <qdatetime.h> |
14 | 13 | ||
15 | #include "settings.h" | 14 | #include "settings.h" |
16 | 15 | ||
17 | class Attachment | 16 | class Attachment |
18 | { | 17 | { |
19 | public: | 18 | public: |
20 | Attachment( DocLnk lnk ); | 19 | Attachment( DocLnk lnk ); |
21 | virtual ~Attachment(){} | 20 | virtual ~Attachment(){} |
22 | const QString getFileName()const{ return doc.file(); } | 21 | const QString getFileName()const{ return doc.file(); } |
23 | const QString getName()const{ return doc.name(); } | 22 | const QString getName()const{ return doc.name(); } |
24 | const QString getMimeType()const{ return doc.type(); } | 23 | const QString getMimeType()const{ return doc.type(); } |
25 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 24 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
26 | const int getSize()const { return size; } | 25 | const int getSize()const { return size; } |
27 | DocLnk getDocLnk() { return doc; } | 26 | DocLnk getDocLnk() { return doc; } |
28 | 27 | ||
29 | protected: | 28 | protected: |
30 | DocLnk doc; | 29 | DocLnk doc; |
31 | int size; | 30 | int size; |
32 | 31 | ||
33 | }; | 32 | }; |
34 | 33 | ||
35 | #define FLAG_ANSWERED 0 | 34 | #define FLAG_ANSWERED 0 |
36 | #define FLAG_FLAGGED 1 | 35 | #define FLAG_FLAGGED 1 |
37 | #define FLAG_DELETED 2 | 36 | #define FLAG_DELETED 2 |
38 | #define FLAG_SEEN 3 | 37 | #define FLAG_SEEN 3 |
39 | #define FLAG_DRAFT 4 | 38 | #define FLAG_DRAFT 4 |
40 | #define FLAG_RECENT 5 | 39 | #define FLAG_RECENT 5 |
41 | 40 | ||
@@ -133,51 +132,33 @@ class IMAPFolder : public Folder | |||
133 | }; | 132 | }; |
134 | 133 | ||
135 | class MailWrapper : public QObject | 134 | class MailWrapper : public QObject |
136 | { | 135 | { |
137 | Q_OBJECT | 136 | Q_OBJECT |
138 | 137 | ||
139 | public: | 138 | public: |
140 | MailWrapper( Settings *s ); | 139 | MailWrapper( Settings *s ); |
141 | void sendMail( Mail mail ); | 140 | void sendMail( Mail mail ); |
142 | 141 | ||
143 | private: | 142 | private: |
144 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | 143 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); |
145 | mailimf_address_list *parseAddresses(const QString&addr ); | 144 | mailimf_address_list *parseAddresses(const QString&addr ); |
146 | mailimf_fields *createImfFields( Mail *mail ); | 145 | mailimf_fields *createImfFields( Mail *mail ); |
147 | mailmime *buildTxtPart( QString str ); | 146 | mailmime *buildTxtPart( QString str ); |
148 | mailmime *buildFilePart( QString filename, QString mimetype ); | 147 | mailmime *buildFilePart( QString filename, QString mimetype ); |
149 | void addFileParts( mailmime *message, QList<Attachment> files ); | 148 | void addFileParts( mailmime *message, QList<Attachment> files ); |
150 | mailmime *createMimeMail( Mail *mail ); | 149 | mailmime *createMimeMail( Mail *mail ); |
151 | void smtpSend( mailmime *mail ); | 150 | void smtpSend( mailmime *mail ); |
152 | mailimf_field *getField( mailimf_fields *fields, int type ); | 151 | mailimf_field *getField( mailimf_fields *fields, int type ); |
153 | clist *createRcptList( mailimf_fields *fields ); | 152 | clist *createRcptList( mailimf_fields *fields ); |
154 | char *getFrom( mailmime *mail ); | 153 | char *getFrom( mailmime *mail ); |
155 | SMTPaccount *getAccount( QString from ); | 154 | SMTPaccount *getAccount( QString from ); |
156 | void writeToFile( QString file, mailmime *mail ); | 155 | void writeToFile( QString file, mailmime *mail ); |
157 | void readFromFile( QString file, char **data, size_t *size ); | 156 | void readFromFile( QString file, char **data, size_t *size ); |
158 | static QString mailsmtpError( int err ); | 157 | static QString mailsmtpError( int err ); |
159 | static QString getTmpFile(); | 158 | static QString getTmpFile(); |
160 | 159 | ||
161 | Settings *settings; | 160 | Settings *settings; |
162 | 161 | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | class IMAPwrapper : public QObject | ||
166 | { | ||
167 | Q_OBJECT | ||
168 | |||
169 | public: | ||
170 | IMAPwrapper( IMAPaccount *a ); | ||
171 | QList<IMAPFolder>* listFolders(); | ||
172 | void listMessages(const QString & mailbox,Maillist&target ); | ||
173 | QString fetchBody(const QString & mailbox,const RecMail&mail); | ||
174 | |||
175 | protected: | ||
176 | RecMail*parse_list_result(mailimap_msg_att*); | ||
177 | |||
178 | private: | ||
179 | IMAPaccount *account; | ||
180 | |||
181 | }; | ||
182 | |||
183 | #endif | 164 | #endif |
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index 46a476d..2142cdc 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro | |||
@@ -1,39 +1,40 @@ | |||
1 | CONFIG += qt warn_on debug quick-app | 1 | CONFIG += qt warn_on debug quick-app |
2 | 2 | ||
3 | HEADERS = defines.h \ | 3 | HEADERS = defines.h \ |
4 | logindialog.h \ | 4 | logindialog.h \ |
5 | settings.h \ | 5 | settings.h \ |
6 | editaccounts.h \ | 6 | editaccounts.h \ |
7 | mailwrapper.h \ | 7 | mailwrapper.h \ |
8 | composemail.h \ | 8 | composemail.h \ |
9 | accountview.h \ | 9 | accountview.h \ |
10 | mainwindow.h \ | 10 | mainwindow.h \ |
11 | opiemail.h | 11 | opiemail.h \ |
12 | imapwrapper.h | ||
12 | 13 | ||
13 | SOURCES = main.cpp \ | 14 | SOURCES = main.cpp \ |
14 | opiemail.cpp \ | 15 | opiemail.cpp \ |
15 | mainwindow.cpp \ | 16 | mainwindow.cpp \ |
16 | accountview.cpp \ | 17 | accountview.cpp \ |
17 | composemail.cpp \ | 18 | composemail.cpp \ |
18 | mailwrapper.cpp \ | 19 | mailwrapper.cpp \ |
19 | imapwrapper.cpp \ | 20 | imapwrapper.cpp \ |
20 | addresspicker.cpp \ | 21 | addresspicker.cpp \ |
21 | editaccounts.cpp \ | 22 | editaccounts.cpp \ |
22 | logindialog.cpp \ | 23 | logindialog.cpp \ |
23 | settings.cpp | 24 | settings.cpp |
24 | 25 | ||
25 | INTERFACES = editaccountsui.ui \ | 26 | INTERFACES = editaccountsui.ui \ |
26 | selectmailtypeui.ui \ | 27 | selectmailtypeui.ui \ |
27 | imapconfigui.ui \ | 28 | imapconfigui.ui \ |
28 | pop3configui.ui \ | 29 | pop3configui.ui \ |
29 | nntpconfigui.ui \ | 30 | nntpconfigui.ui \ |
30 | smtpconfigui.ui \ | 31 | smtpconfigui.ui \ |
31 | addresspickerui.ui \ | 32 | addresspickerui.ui \ |
32 | logindialogui.ui \ | 33 | logindialogui.ui \ |
33 | composemailui.ui | 34 | composemailui.ui |
34 | 35 | ||
35 | INCLUDEPATH += $(OPIEDIR)/include | 36 | INCLUDEPATH += $(OPIEDIR)/include |
36 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb | 37 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb |
37 | TARGET = opiemail | 38 | TARGET = opiemail |
38 | 39 | ||
39 | include ( $(OPIEDIR)/include.pro ) | 40 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h index f45eab7..955a8e2 100644 --- a/noncore/net/mail/mailwrapper.h +++ b/noncore/net/mail/mailwrapper.h | |||
@@ -1,41 +1,40 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <libetpan/mailmime.h> | 6 | #include <libetpan/mailmime.h> |
7 | #include <libetpan/mailimf.h> | 7 | #include <libetpan/mailimf.h> |
8 | #include <libetpan/mailsmtp.h> | 8 | #include <libetpan/mailsmtp.h> |
9 | #include <libetpan/mailimap.h> | ||
10 | #include <libetpan/mailstorage.h> | 9 | #include <libetpan/mailstorage.h> |
11 | #include <libetpan/maildriver.h> | 10 | #include <libetpan/maildriver.h> |
12 | #include <qbitarray.h> | 11 | #include <qbitarray.h> |
13 | #include <qdatetime.h> | 12 | #include <qdatetime.h> |
14 | 13 | ||
15 | #include "settings.h" | 14 | #include "settings.h" |
16 | 15 | ||
17 | class Attachment | 16 | class Attachment |
18 | { | 17 | { |
19 | public: | 18 | public: |
20 | Attachment( DocLnk lnk ); | 19 | Attachment( DocLnk lnk ); |
21 | virtual ~Attachment(){} | 20 | virtual ~Attachment(){} |
22 | const QString getFileName()const{ return doc.file(); } | 21 | const QString getFileName()const{ return doc.file(); } |
23 | const QString getName()const{ return doc.name(); } | 22 | const QString getName()const{ return doc.name(); } |
24 | const QString getMimeType()const{ return doc.type(); } | 23 | const QString getMimeType()const{ return doc.type(); } |
25 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 24 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
26 | const int getSize()const { return size; } | 25 | const int getSize()const { return size; } |
27 | DocLnk getDocLnk() { return doc; } | 26 | DocLnk getDocLnk() { return doc; } |
28 | 27 | ||
29 | protected: | 28 | protected: |
30 | DocLnk doc; | 29 | DocLnk doc; |
31 | int size; | 30 | int size; |
32 | 31 | ||
33 | }; | 32 | }; |
34 | 33 | ||
35 | #define FLAG_ANSWERED 0 | 34 | #define FLAG_ANSWERED 0 |
36 | #define FLAG_FLAGGED 1 | 35 | #define FLAG_FLAGGED 1 |
37 | #define FLAG_DELETED 2 | 36 | #define FLAG_DELETED 2 |
38 | #define FLAG_SEEN 3 | 37 | #define FLAG_SEEN 3 |
39 | #define FLAG_DRAFT 4 | 38 | #define FLAG_DRAFT 4 |
40 | #define FLAG_RECENT 5 | 39 | #define FLAG_RECENT 5 |
41 | 40 | ||
@@ -133,51 +132,33 @@ class IMAPFolder : public Folder | |||
133 | }; | 132 | }; |
134 | 133 | ||
135 | class MailWrapper : public QObject | 134 | class MailWrapper : public QObject |
136 | { | 135 | { |
137 | Q_OBJECT | 136 | Q_OBJECT |
138 | 137 | ||
139 | public: | 138 | public: |
140 | MailWrapper( Settings *s ); | 139 | MailWrapper( Settings *s ); |
141 | void sendMail( Mail mail ); | 140 | void sendMail( Mail mail ); |
142 | 141 | ||
143 | private: | 142 | private: |
144 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | 143 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); |
145 | mailimf_address_list *parseAddresses(const QString&addr ); | 144 | mailimf_address_list *parseAddresses(const QString&addr ); |
146 | mailimf_fields *createImfFields( Mail *mail ); | 145 | mailimf_fields *createImfFields( Mail *mail ); |
147 | mailmime *buildTxtPart( QString str ); | 146 | mailmime *buildTxtPart( QString str ); |
148 | mailmime *buildFilePart( QString filename, QString mimetype ); | 147 | mailmime *buildFilePart( QString filename, QString mimetype ); |
149 | void addFileParts( mailmime *message, QList<Attachment> files ); | 148 | void addFileParts( mailmime *message, QList<Attachment> files ); |
150 | mailmime *createMimeMail( Mail *mail ); | 149 | mailmime *createMimeMail( Mail *mail ); |
151 | void smtpSend( mailmime *mail ); | 150 | void smtpSend( mailmime *mail ); |
152 | mailimf_field *getField( mailimf_fields *fields, int type ); | 151 | mailimf_field *getField( mailimf_fields *fields, int type ); |
153 | clist *createRcptList( mailimf_fields *fields ); | 152 | clist *createRcptList( mailimf_fields *fields ); |
154 | char *getFrom( mailmime *mail ); | 153 | char *getFrom( mailmime *mail ); |
155 | SMTPaccount *getAccount( QString from ); | 154 | SMTPaccount *getAccount( QString from ); |
156 | void writeToFile( QString file, mailmime *mail ); | 155 | void writeToFile( QString file, mailmime *mail ); |
157 | void readFromFile( QString file, char **data, size_t *size ); | 156 | void readFromFile( QString file, char **data, size_t *size ); |
158 | static QString mailsmtpError( int err ); | 157 | static QString mailsmtpError( int err ); |
159 | static QString getTmpFile(); | 158 | static QString getTmpFile(); |
160 | 159 | ||
161 | Settings *settings; | 160 | Settings *settings; |
162 | 161 | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | class IMAPwrapper : public QObject | ||
166 | { | ||
167 | Q_OBJECT | ||
168 | |||
169 | public: | ||
170 | IMAPwrapper( IMAPaccount *a ); | ||
171 | QList<IMAPFolder>* listFolders(); | ||
172 | void listMessages(const QString & mailbox,Maillist&target ); | ||
173 | QString fetchBody(const QString & mailbox,const RecMail&mail); | ||
174 | |||
175 | protected: | ||
176 | RecMail*parse_list_result(mailimap_msg_att*); | ||
177 | |||
178 | private: | ||
179 | IMAPaccount *account; | ||
180 | |||
181 | }; | ||
182 | |||
183 | #endif | 164 | #endif |