summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/generatemail.h
blob: b9f82858ce7f64ac96e195b4e82290c5d3a6f59b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __GENERATE_MAIL_H
#define __GENERATE_MAIL_H

//#include <qpe/applnk.h>

#include <qobject.h>
#include <libetpan/clist.h>
#include "mailwrapper.h"

#include <opie2/osmartpointer.h>

class Mail;
class RecMail;

struct mailimf_fields;
struct mailimf_field;
struct mailimf_mailbox;
struct mailmime;
struct mailimf_address_list;
class progressMailSend;
struct mailsmtp;

class Generatemail : public QObject
{
    Q_OBJECT
public:
    Generatemail();
    virtual ~Generatemail();

protected:
    static void addRcpts( clist *list, mailimf_address_list *addr_list );
    static char *getFrom( mailmime *mail );
    static char *getFrom( mailimf_field *ffrom);
    static mailimf_field *getField( mailimf_fields *fields, int type );
    mailimf_address_list *parseAddresses(const QString&addr );
    void addFileParts( mailmime *message,const QList<Attachment>&files );
    mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content);
    mailmime *buildTxtPart(const QString&str );
    mailimf_mailbox *newMailbox(const QString&name,const QString&mail );
    mailimf_fields *createImfFields(const Opie::Core::OSmartPointer<Mail> &mail );
    mailmime *createMimeMail(const Opie::Core::OSmartPointer<Mail>&mail );
    clist *createRcptList( mailimf_fields *fields );

    static const char* USER_AGENT;
};

#endif