From 7f2eef29708380844922f34f59ba4e9beefbf7c3 Mon Sep 17 00:00:00 2001 From: conber Date: Sat, 15 Jun 2002 09:46:14 +0000 Subject: initial checkin --- (limited to 'noncore/unsupported/mail2/libmail/mailfactory.h') 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 @@ +#ifndef MAILFACTORY_H +#define MAILFACTORY_H + +#include + +#include + +#include "configfile.h" + +class Attachment +{ +public: + void setFileName(QString fileName) { _fileName = fileName; } + void setNewName(QString newName) { _newName = newName; } + void setDescription(QString description) { _description = description; } + void setDocLnk(DocLnk *docLnk) { _docLnk = docLnk; } + + QString fileName() { return _fileName; } + QString newName() { return _newName; } + QString description() { return _description; } + DocLnk *docLnk() { return _docLnk; } + +protected: + QString _fileName, _newName, _description; + DocLnk *_docLnk; + +}; + +class SendMail +{ +public: + SendMail() { _needsMime = false; } + + void setAccount(Account account) { _account = account; } + + void setFrom(QString from) { _from = from; } + void setReplyTo(QString replyTo) { _replyTo = replyTo; } + void setTo(QString to) { _to = to; } + void setCc(QString cc) { _cc = cc; } + void setBcc(QString bcc) { _bcc = bcc; } + void setSubject(QString subject) { _subject = subject; } + void setPriority(QString priority) { _priority = priority; } + void setMessage(QString message) { _message = message; } + void setInReplyTo(QString inReplyTo) { _inReplyTo = inReplyTo; } + + void setNeedsMime(bool needsMime) { _needsMime = needsMime; } + + //void setEncrypt(bool encrypt) { _encrypt = encrypt; } + //void setSign(bool sign) { _sign = sign; } + //void setGpgReceivers(QValueList receivers) { _receivers = receivers; } + //void setGpgPassphrase(QString passphrase) { _passphrase = passphrase; } + + void setAttachments(QValueList attachments) { _attachments = attachments; } + void addAttachment(Attachment attachment) { _attachments.append(attachment); } + + Account account() { return _account; } + + QString from() { return _from; } + QString replyTo() { return _replyTo; } + QString to() { return _to; } + QString cc() { return _cc; } + QString bcc() { return _bcc; } + QString subject() { return _subject; } + QString priority() { return _priority; } + QString message() { return _message; } + QString inReplyTo() { return _inReplyTo; } + + bool needsMime() { return _needsMime; } + + //bool encrypt() { return _encrypt; } + //bool sign() { return _sign; } + //QValueList gpgReceivers() { return _receivers; } + //QString gpgPassphrase() { return _passphrase; } + + QValueList attachments() { return _attachments; } + +protected: + Account _account; + QString _from, _replyTo, _to, _cc, _bcc, _subject, _priority, _message, _inReplyTo; + bool _needsMime; + //bool _encrypt, _sign; + //QValueList _receivers; + //QString _passphrase; + QValueList _attachments; + +}; + +class MailFactory : public QObject +{ + Q_OBJECT + +public: + static void genMail(QString &header, QString &message, SendMail &smail, QWidget *parent); + +protected: + MailFactory(SendMail &smail, QWidget *parent); + +// void openPgpEncrypt(const QString &text, QString &header, QString &message); +// void openPgpSign(const QString &text, QString &header, QString &message); +// void openPgpSignEncrypt(const QString &text, QString &header, QString &message); + + bool _abort; + SendMail _smail; + QWidget *_parent; + QString _header, _body; + +}; + +#endif -- cgit v0.9.0.2