summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/libmail/mailfactory.h
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/libmail/mailfactory.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/libmail/mailfactory.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/libmail/mailfactory.h b/noncore/unsupported/mail2/libmail/mailfactory.h
new file mode 100644
index 0000000..8f67447
--- a/dev/null
+++ b/noncore/unsupported/mail2/libmail/mailfactory.h
@@ -0,0 +1,109 @@
1#ifndef MAILFACTORY_H
2#define MAILFACTORY_H
3
4#include <qobject.h>
5
6#include <qpe/applnk.h>
7
8#include "configfile.h"
9
10class Attachment
11{
12public:
13 void setFileName(QString fileName) { _fileName = fileName; }
14 void setNewName(QString newName) { _newName = newName; }
15 void setDescription(QString description) { _description = description; }
16 void setDocLnk(DocLnk *docLnk) { _docLnk = docLnk; }
17
18 QString fileName() { return _fileName; }
19 QString newName() { return _newName; }
20 QString description() { return _description; }
21 DocLnk *docLnk() { return _docLnk; }
22
23protected:
24 QString _fileName, _newName, _description;
25 DocLnk *_docLnk;
26
27};
28
29class SendMail
30{
31public:
32 SendMail() { _needsMime = false; }
33
34 void setAccount(Account account) { _account = account; }
35
36 void setFrom(QString from) { _from = from; }
37 void setReplyTo(QString replyTo) { _replyTo = replyTo; }
38 void setTo(QString to) { _to = to; }
39 void setCc(QString cc) { _cc = cc; }
40 void setBcc(QString bcc) { _bcc = bcc; }
41 void setSubject(QString subject) { _subject = subject; }
42 void setPriority(QString priority) { _priority = priority; }
43 void setMessage(QString message) { _message = message; }
44 void setInReplyTo(QString inReplyTo) { _inReplyTo = inReplyTo; }
45
46 void setNeedsMime(bool needsMime) { _needsMime = needsMime; }
47
48 //void setEncrypt(bool encrypt) { _encrypt = encrypt; }
49 //void setSign(bool sign) { _sign = sign; }
50 //void setGpgReceivers(QValueList<GpgKey> receivers) { _receivers = receivers; }
51 //void setGpgPassphrase(QString passphrase) { _passphrase = passphrase; }
52
53 void setAttachments(QValueList<Attachment> attachments) { _attachments = attachments; }
54 void addAttachment(Attachment attachment) { _attachments.append(attachment); }
55
56 Account account() { return _account; }
57
58 QString from() { return _from; }
59 QString replyTo() { return _replyTo; }
60 QString to() { return _to; }
61 QString cc() { return _cc; }
62 QString bcc() { return _bcc; }
63 QString subject() { return _subject; }
64 QString priority() { return _priority; }
65 QString message() { return _message; }
66 QString inReplyTo() { return _inReplyTo; }
67
68 bool needsMime() { return _needsMime; }
69
70 //bool encrypt() { return _encrypt; }
71 //bool sign() { return _sign; }
72 //QValueList<GpgKey> gpgReceivers() { return _receivers; }
73 //QString gpgPassphrase() { return _passphrase; }
74
75 QValueList<Attachment> attachments() { return _attachments; }
76
77protected:
78 Account _account;
79 QString _from, _replyTo, _to, _cc, _bcc, _subject, _priority, _message, _inReplyTo;
80 bool _needsMime;
81 //bool _encrypt, _sign;
82 //QValueList<GpgKey> _receivers;
83 //QString _passphrase;
84 QValueList<Attachment> _attachments;
85
86};
87
88class MailFactory : public QObject
89{
90 Q_OBJECT
91
92public:
93 static void genMail(QString &header, QString &message, SendMail &smail, QWidget *parent);
94
95protected:
96 MailFactory(SendMail &smail, QWidget *parent);
97
98 //void openPgpEncrypt(const QString &text, QString &header, QString &message);
99 //void openPgpSign(const QString &text, QString &header, QString &message);
100 //void openPgpSignEncrypt(const QString &text, QString &header, QString &message);
101
102 bool _abort;
103 SendMail _smail;
104 QWidget *_parent;
105 QString _header, _body;
106
107};
108
109#endif