SmtpClient-for-Qt/src/mimemessage.h

86 lines
1.9 KiB
C
Raw Normal View History

2011-09-02 12:20:33 +00:00
/*
Copyright (c) 2011 - Tőkés Attila
This file is part of SmtpClient for Qt.
SmtpClient for Qt is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
SmtpClient for Qt is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
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);
void setHeaderEncoding(MimePart::Encoding);
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;
/* [2] --- */
/* [3] Public methods */
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
MimePart::Encoding hEncoding;
2011-08-30 18:59:16 +00:00
/* [4] --- */
};
#endif // MIMEMESSAGE_H