author | alwin <alwin> | 2004-02-13 02:52:41 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-13 02:52:41 (UTC) |
commit | aca5ba5ed24b4da61517560ea91f566afd132d28 (patch) (unidiff) | |
tree | 86085c6042e591dc9f211a8716cb63ff30cb5f4e /noncore/net/mail/libmailwrapper/smtpwrapper.h | |
parent | 2fd9c32e07714b7caf38994c0b0f1da8ffb27aa9 (diff) | |
download | opie-aca5ba5ed24b4da61517560ea91f566afd132d28.zip opie-aca5ba5ed24b4da61517560ea91f566afd132d28.tar.gz opie-aca5ba5ed24b4da61517560ea91f566afd132d28.tar.bz2 |
interface changes
Diffstat (limited to 'noncore/net/mail/libmailwrapper/smtpwrapper.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index 75e4891..7f6aac1 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -1,76 +1,83 @@ | |||
1 | // -*- Mode: C++; -*- | ||
1 | #ifndef SMTPwrapper_H | 2 | #ifndef SMTPwrapper_H |
2 | #define SMTPwrapper_H | 3 | #define SMTPwrapper_H |
3 | 4 | ||
4 | #include <qpe/applnk.h> | 5 | #include <qpe/applnk.h> |
5 | 6 | ||
6 | #include <qbitarray.h> | 7 | #include <qbitarray.h> |
7 | #include <qdatetime.h> | 8 | #include <qdatetime.h> |
8 | #include <libetpan/clist.h> | 9 | #include <libetpan/clist.h> |
9 | 10 | ||
10 | #include "settings.h" | 11 | #include "settings.h" |
11 | 12 | ||
12 | class Mail; | 13 | class Mail; |
13 | class AbstractMail; | 14 | class AbstractMail; |
14 | class RecMail; | 15 | class RecMail; |
15 | class Attachment; | 16 | class Attachment; |
16 | struct mailimf_fields; | 17 | struct mailimf_fields; |
17 | struct mailimf_field; | 18 | struct mailimf_field; |
18 | struct mailimf_mailbox; | 19 | struct mailimf_mailbox; |
19 | struct mailmime; | 20 | struct mailmime; |
20 | struct mailimf_address_list; | 21 | struct mailimf_address_list; |
21 | class progressMailSend; | 22 | class progressMailSend; |
22 | struct mailsmtp; | 23 | struct mailsmtp; |
24 | class SMTPaccount; | ||
23 | 25 | ||
24 | class SMTPwrapper : public QObject | 26 | class SMTPwrapper : public QObject |
25 | { | 27 | { |
26 | Q_OBJECT | 28 | Q_OBJECT |
27 | 29 | ||
28 | public: | 30 | public: |
29 | SMTPwrapper( Settings *s ); | 31 | SMTPwrapper(SMTPaccount * aSmtp); |
30 | virtual ~SMTPwrapper(){} | 32 | virtual ~SMTPwrapper(); |
31 | void sendMail(const Mail& mail,SMTPaccount*smtp,bool later=false ); | 33 | void sendMail(const Mail& mail,bool later=false ); |
32 | bool flushOutbox(SMTPaccount*smtp); | 34 | bool flushOutbox(); |
33 | 35 | ||
34 | static progressMailSend*sendProgress; | 36 | static progressMailSend*sendProgress; |
35 | 37 | ||
36 | signals: | 38 | signals: |
37 | void queuedMails( int ); | 39 | void queuedMails( int ); |
38 | 40 | ||
39 | protected: | 41 | protected: |
42 | mailsmtp *m_smtp; | ||
43 | SMTPaccount * m_SmtpAccount; | ||
44 | |||
45 | void connect_server(); | ||
46 | void disc_server(); | ||
47 | int start_smtp_tls(); | ||
48 | |||
40 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | 49 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); |
41 | mailimf_fields *createImfFields(const Mail &mail ); | 50 | mailimf_fields *createImfFields(const Mail &mail ); |
42 | mailmime *createMimeMail(const Mail&mail ); | 51 | mailmime *createMimeMail(const Mail&mail ); |
43 | 52 | ||
44 | mailimf_address_list *parseAddresses(const QString&addr ); | 53 | mailimf_address_list *parseAddresses(const QString&addr ); |
45 | void addFileParts( mailmime *message,const QList<Attachment>&files ); | 54 | void addFileParts( mailmime *message,const QList<Attachment>&files ); |
46 | mailmime *buildTxtPart(const QString&str ); | 55 | mailmime *buildTxtPart(const QString&str ); |
47 | mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); | 56 | mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); |
48 | void smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ); | 57 | void smtpSend( mailmime *mail,bool later); |
49 | clist *createRcptList( mailimf_fields *fields ); | 58 | clist *createRcptList( mailimf_fields *fields ); |
50 | 59 | ||
51 | static void storeMail(const char*mail, size_t length, const QString&box); | 60 | static void storeMail(const char*mail, size_t length, const QString&box); |
52 | static QString mailsmtpError( int err ); | 61 | static QString mailsmtpError( int err ); |
53 | static void progress( size_t current, size_t maximum ); | 62 | static void progress( size_t current, size_t maximum ); |
54 | static void addRcpts( clist *list, mailimf_address_list *addr_list ); | 63 | static void addRcpts( clist *list, mailimf_address_list *addr_list ); |
55 | static char *getFrom( mailmime *mail ); | 64 | static char *getFrom( mailmime *mail ); |
56 | static char *getFrom( mailimf_field *ffrom); | 65 | static char *getFrom( mailimf_field *ffrom); |
57 | static mailimf_field *getField( mailimf_fields *fields, int type ); | 66 | static mailimf_field *getField( mailimf_fields *fields, int type ); |
58 | static int start_smtp_tls(mailsmtp *session); | ||
59 | 67 | ||
60 | int smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMTPaccount *smtp ); | 68 | int smtpSend(char*from,clist*rcpts,const char*data,size_t size); |
61 | 69 | ||
62 | void storeMail(mailmime*mail, const QString&box); | 70 | void storeMail(mailmime*mail, const QString&box); |
63 | Settings *settings; | ||
64 | 71 | ||
65 | int sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which); | 72 | int sendQueuedMail(AbstractMail*wrap,RecMail*which); |
66 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); | 73 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); |
67 | 74 | ||
68 | int m_queuedMail; | 75 | int m_queuedMail; |
69 | static const char* USER_AGENT; | 76 | static const char* USER_AGENT; |
70 | 77 | ||
71 | protected slots: | 78 | protected slots: |
72 | void emitQCop( int queued ); | 79 | void emitQCop( int queued ); |
73 | 80 | ||
74 | }; | 81 | }; |
75 | 82 | ||
76 | #endif | 83 | #endif |