2011-09-02 12:20:33 +00:00
|
|
|
/*
|
2012-07-24 14:06:55 +00:00
|
|
|
Copyright (c) 2011-2012 - Tőkés Attila
|
2011-09-02 12:20:33 +00:00
|
|
|
|
|
|
|
This file is part of SmtpClient for Qt.
|
|
|
|
|
2012-07-24 14:06:55 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2011-09-02 12:20:33 +00:00
|
|
|
|
2012-07-24 14:06:55 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2011-09-02 12:20:33 +00:00
|
|
|
|
2011-09-02 15:24:39 +00:00
|
|
|
See the LICENSE file for more details.
|
2011-09-02 12:20:33 +00:00
|
|
|
*/
|
|
|
|
|
2011-08-30 18:59:16 +00:00
|
|
|
#ifndef MIMEMESSAGE_H
|
|
|
|
#define MIMEMESSAGE_H
|
|
|
|
|
2011-08-30 21:53:08 +00:00
|
|
|
#include "mimepart.h"
|
2012-07-23 18:01:08 +00:00
|
|
|
#include "mimemultipart.h"
|
2011-08-30 21:53:08 +00:00
|
|
|
#include "emailaddress.h"
|
2011-08-30 18:59:16 +00:00
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
class MimeMessage : public QObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2012-07-23 18:01:08 +00:00
|
|
|
enum RecipientType {
|
|
|
|
To, // primary
|
|
|
|
Cc, // carbon copy
|
|
|
|
Bcc // blind carbon copy
|
|
|
|
};
|
|
|
|
|
2011-08-30 18:59:16 +00:00
|
|
|
/* [1] Constructors and Destructors */
|
|
|
|
|
2012-07-23 18:01:08 +00:00
|
|
|
MimeMessage(bool createAutoMimeConent = true);
|
2011-08-30 18:59:16 +00:00
|
|
|
~MimeMessage();
|
|
|
|
|
|
|
|
/* [1] --- */
|
|
|
|
|
|
|
|
|
|
|
|
/* [2] Getters and Setters */
|
|
|
|
|
|
|
|
void setSender(EmailAddress* e);
|
2012-07-23 18:01:08 +00:00
|
|
|
void addRecipient(EmailAddress* rcpt, RecipientType type = To);
|
|
|
|
void addTo(EmailAddress* rcpt);
|
|
|
|
void addCc(EmailAddress* rcpt);
|
|
|
|
void addBcc(EmailAddress* rcpt);
|
2011-08-30 18:59:16 +00:00
|
|
|
void setSubject(const QString & subject);
|
|
|
|
void addPart(MimePart* part);
|
|
|
|
|
2011-11-18 19:58:16 +00:00
|
|
|
void setHeaderEncoding(MimePart::Encoding);
|
2011-11-10 18:50:38 +00:00
|
|
|
|
2011-08-30 18:59:16 +00:00
|
|
|
const EmailAddress & getSender() const;
|
2012-07-23 18:01:08 +00:00
|
|
|
const QList<EmailAddress*> & getRecipients(RecipientType type = To) const;
|
2011-08-30 18:59:16 +00:00
|
|
|
const QString & getSubject() const;
|
|
|
|
const QList<MimePart*> & getParts() const;
|
|
|
|
|
2012-08-09 19:17:07 +00:00
|
|
|
MimePart& getContent();
|
|
|
|
void setContent(MimePart *content);
|
2011-08-30 18:59:16 +00:00
|
|
|
/* [2] --- */
|
|
|
|
|
|
|
|
|
|
|
|
/* [3] Public methods */
|
|
|
|
|
2012-03-20 11:30:49 +00:00
|
|
|
virtual QString toString();
|
2011-08-30 18:59:16 +00:00
|
|
|
|
|
|
|
/* [3] --- */
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
/* [4] Protected members */
|
|
|
|
|
|
|
|
EmailAddress* sender;
|
2012-07-23 18:01:08 +00:00
|
|
|
QList<EmailAddress*> recipientsTo, recipientsCc, recipientsBcc;
|
2011-08-30 18:59:16 +00:00
|
|
|
QString subject;
|
2012-07-23 18:01:08 +00:00
|
|
|
MimePart *content;
|
2011-08-30 18:59:16 +00:00
|
|
|
|
2011-11-18 19:58:16 +00:00
|
|
|
MimePart::Encoding hEncoding;
|
2011-11-10 18:50:38 +00:00
|
|
|
|
2011-08-30 18:59:16 +00:00
|
|
|
/* [4] --- */
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MIMEMESSAGE_H
|