36 lines
956 B
C++
36 lines
956 B
C++
#ifndef EMAILCOMPOSERBRIDGE_H
|
|
#define EMAILCOMPOSERBRIDGE_H
|
|
|
|
#include <QObject>
|
|
#include <QStringList>
|
|
#include <QByteArray>
|
|
#include "mailitem.h"
|
|
|
|
class EmailComposerBridge : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit EmailComposerBridge(QObject *parent = nullptr);
|
|
~EmailComposerBridge() override = default;
|
|
|
|
struct Attachment {
|
|
QString fileName;
|
|
QString filePath;
|
|
QByteArray data;
|
|
QString mimeType;
|
|
};
|
|
|
|
MailItem createMailItem(const QString &to, const QString &cc, const QString &bcc,
|
|
const QString &subject, const QString &body,
|
|
const QString &accountId,
|
|
const QVector<Attachment> &attachments = {});
|
|
|
|
QString renderBodyToHtml(const QString &plainText) const;
|
|
|
|
signals:
|
|
void mailReadyToSend(const MailItem &mail);
|
|
void mailSendFailed(const QString &errorMessage);
|
|
};
|
|
|
|
#endif // EMAILCOMPOSERBRIDGE_H
|