author | alwin <alwin> | 2003-12-21 10:36:22 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-21 10:36:22 (UTC) |
commit | af0b88049e0c77cb90ef1aca608accc32a2e2828 (patch) (unidiff) | |
tree | ad8a2ce76ae1ab3cf535f4d1d7addbc240ff4209 /noncore/net/mail/smtpwrapper.h | |
parent | 8e884631cc002011a9abab37be9223d4a1421ff2 (diff) | |
download | opie-af0b88049e0c77cb90ef1aca608accc32a2e2828.zip opie-af0b88049e0c77cb90ef1aca608accc32a2e2828.tar.gz opie-af0b88049e0c77cb90ef1aca608accc32a2e2828.tar.bz2 |
- MailWrapper -> SMTPwrapper
- made dependies from libetpan includes somewhat cleaner
- removed standalone static funs and moved to class based static methods
- arguements in SMTPwrapper now always const references and not deep copies
TODO: clean up GOTO statements, change QList to QValueList for a better
handling of "const" arguments, store mails in queue and/or a local "Sent"
folder.
Diffstat (limited to 'noncore/net/mail/smtpwrapper.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/smtpwrapper.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/net/mail/smtpwrapper.h b/noncore/net/mail/smtpwrapper.h new file mode 100644 index 0000000..8fdb07d --- a/dev/null +++ b/noncore/net/mail/smtpwrapper.h | |||
@@ -0,0 +1,53 @@ | |||
1 | #ifndef SMTPwrapper_H | ||
2 | #define SMTPwrapper_H | ||
3 | |||
4 | #include <qpe/applnk.h> | ||
5 | |||
6 | #include <qbitarray.h> | ||
7 | #include <qdatetime.h> | ||
8 | #include <libetpan/clist.h> | ||
9 | |||
10 | #include "settings.h" | ||
11 | |||
12 | class Mail; | ||
13 | class Attachment; | ||
14 | struct mailimf_fields; | ||
15 | struct mailimf_field; | ||
16 | struct mailimf_mailbox; | ||
17 | struct mailmime; | ||
18 | struct mailimf_address_list; | ||
19 | |||
20 | class SMTPwrapper : public QObject | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | |||
24 | public: | ||
25 | SMTPwrapper( Settings *s ); | ||
26 | virtual ~SMTPwrapper(){} | ||
27 | void sendMail(const Mail& mail ); | ||
28 | |||
29 | protected: | ||
30 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | ||
31 | mailimf_fields *createImfFields(const Mail &mail ); | ||
32 | mailmime *createMimeMail(const Mail&mail ); | ||
33 | |||
34 | mailimf_address_list *parseAddresses(const QString&addr ); | ||
35 | void addFileParts( mailmime *message,const QList<Attachment>&files ); | ||
36 | mailmime *buildTxtPart(const QString&str ); | ||
37 | mailmime *buildFilePart(const QString&filename,const QString&mimetype ); | ||
38 | void smtpSend( mailmime *mail ); | ||
39 | mailimf_field *getField( mailimf_fields *fields, int type ); | ||
40 | clist *createRcptList( mailimf_fields *fields ); | ||
41 | char *getFrom( mailmime *mail ); | ||
42 | SMTPaccount *getAccount(const QString&from ); | ||
43 | void writeToFile(const QString&file, mailmime *mail ); | ||
44 | void readFromFile(const QString&file, char **data, size_t *size ); | ||
45 | |||
46 | static QString mailsmtpError( int err ); | ||
47 | static QString getTmpFile(); | ||
48 | static void progress( size_t current, size_t maximum ); | ||
49 | static void addRcpts( clist *list, mailimf_address_list *addr_list ); | ||
50 | Settings *settings; | ||
51 | }; | ||
52 | |||
53 | #endif | ||