Commit 14891a09 authored by Sandro Knauß's avatar Sandro Knauß

move HtmlWriter from MimeTreeParser->MessageViewer

Test Plan: run tests of messagelib and kdepim-addons

Reviewers: vkrause

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D8575
parent 6f849b1b
......@@ -49,7 +49,6 @@ using namespace MessageComposer;
#include <setupenv.h>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/BufferedHtmlWriter>
using MessageCore::AttachmentPart;
......@@ -153,17 +152,14 @@ void CryptoComposerTest::testEncryptSameAttachments()
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
MimeTreeParser::BufferedHtmlWriter testWriter;
testWriter.begin();
TestCSSHelper testCSSHelper;
MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
MimeTreeParser::ProcessResult pResult(nh);
otp.parseObjectTree(message.data());
testWriter.end();
KMime::Message::Ptr unencrypted = nh->unencryptedMessage(message);
KMime::Content *testAttachment = Util::findTypeInMessage(unencrypted.data(), "x-some", "x-type");
......
......@@ -31,7 +31,6 @@
#include <MessageViewer/CSSHelper>
#include <MessageViewer/ObjectTreeEmptySource>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/BufferedHtmlWriter>
#include <MessageCore/NodeHelper>
......@@ -61,10 +60,8 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
resultMessage->parse();
// parse the result and make sure it is valid in various ways
MimeTreeParser::BufferedHtmlWriter testWriter;
testWriter.begin();
TestCSSHelper testCSSHelper;
MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
MimeTreeParser::ProcessResult pResult(nh);
......@@ -134,10 +131,8 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
resultMessage->parse();
// parse the result and make sure it is valid in various ways
MimeTreeParser::BufferedHtmlWriter testWriter;
testWriter.begin();
TestCSSHelper testCSSHelper;
MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
......@@ -190,10 +185,8 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
resultMessage->parse();
// parse the result and make sure it is valid in various ways
MimeTreeParser::BufferedHtmlWriter testWriter;
testWriter.begin();
TestCSSHelper testCSSHelper;
MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
......
......@@ -38,7 +38,6 @@
#include "testcsshelper.h"
#include <setupenv.h>
#include <MimeTreeParser/BufferedHtmlWriter>
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
......
......@@ -47,15 +47,14 @@ std::vector<GpgME::Key> getKeys(bool smime = false);
class TestObjectTreeSource : public MessageViewer::EmptySource
{
public:
TestObjectTreeSource(MimeTreeParser::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
: mWriter(writer)
, mCSSHelper(cssHelper)
TestObjectTreeSource(MessageViewer::CSSHelperBase *cssHelper)
: mCSSHelper(cssHelper)
{
}
MimeTreeParser::HtmlWriter *htmlWriter() override
MessageViewer::HtmlWriter *htmlWriter() override
{
return mWriter;
return nullptr;
}
MessageViewer::CSSHelperBase *cssHelper() override
......@@ -64,7 +63,6 @@ public:
}
private:
MimeTreeParser::HtmlWriter *mWriter = nullptr;
MessageViewer::CSSHelperBase *mCSSHelper = nullptr;
};
}
......
......@@ -135,6 +135,12 @@ set(libmessageviewer_htmlwriter_webengine_SRCS
htmlwriter/webengineembedpart.cpp
)
set(libmessageviewer_htmlwriter_SRCS
${libmessageviewer_htmlwriter_webengine_SRCS}
htmlwriter/bufferedhtmlwriter.cpp
htmlwriter/filehtmlwriter.cpp
)
set(libmessageviewer_antispam_SRCS
antispam/spamheaderanalyzer.cpp
antispam/antispamconfig.cpp
......@@ -166,9 +172,13 @@ set(libmessageviewer_messagepartthemes_default_SRCS
messagepartthemes/default/messagepartrendererfactory.cpp
)
set(libmessageviewer_interfaces_SRCS
interfaces/htmlwriter.cpp
)
set(libmessageviewer_SRCS
${libmessageviewer_messagepartthemes_default_SRCS}
${libmessageviewer_htmlwriter_webengine_SRCS}
${libmessageviewer_htmlwriter_SRCS}
${libmessageviewer_messagepartthemes_SRCS}
${libmessageviewer_scamdetection_webengine_SRCS}
${libmessageviewer_widgets_webengine_SRCS}
......@@ -183,6 +193,7 @@ set(libmessageviewer_SRCS
${libmessageviewer_viewerplugins_SRCS}
settings/messageviewersettings.cpp
${libmessageviewer_mailviewer_SRCS}
${libmessageviewer_interfaces_SRCS}
)
qt5_add_resources(libmessageviewer_SRCS messagepartthemes.qrc)
......@@ -318,6 +329,7 @@ ecm_generate_headers(MessageViewer_Camelcaseantispam_HEADERS
ecm_generate_headers(MessageViewer_Camelcaseinterfaces_HEADERS
HEADER_NAMES
HtmlWriter
BodyPartURLHandler
URLHandler
REQUIRED_HEADERS MessageViewer_interfaces_HEADERS
......@@ -325,6 +337,15 @@ ecm_generate_headers(MessageViewer_Camelcaseinterfaces_HEADERS
RELATIVE interfaces
)
ecm_generate_headers(MessageViewer_Camelcasehtmlwriter_HEADERS
HEADER_NAMES
BufferedHtmlWriter
FileHtmlWriter
REQUIRED_HEADERS MessageViewer_htmlwriter_HEADERS
PREFIX MessageViewer
RELATIVE htmlwriter
)
ecm_generate_headers(MessageViewer_Camelcasesettings_HEADERS
HEADER_NAMES
MessageViewerSettings
......@@ -388,6 +409,7 @@ install(FILES
${MessageViewer_Camelcasesettings_HEADERS}
${MessageViewer_Camelcaseutils_HEADERS}
${MessageViewer_Camelcaseinterfaces_HEADERS}
${MessageViewer_Camelcasehtmlwriter_HEADERS}
${MessageViewer_Camelcaseviewer_HEADERS}
${MessageViewer_Camelcasewidgets_HEADERS}
${MessageViewer_Camelcaseantispam_HEADERS}
......@@ -406,6 +428,7 @@ install(FILES
${MessageViewer_header_HEADERS}
${MessageViewer_utils_HEADERS}
${MessageViewer_interfaces_HEADERS}
${MessageViewer_htmlwriter_HEADERS}
${MessageViewer_HEADERS}
${MessageViewer_viewer_HEADERS}
${MessageViewer_widgets_HEADERS}
......
......@@ -19,7 +19,7 @@
#include "bufferedhtmlwriter.h"
using namespace MimeTreeParser;
using namespace MessageViewer;
BufferedHtmlWriter::BufferedHtmlWriter()
: m_buffer(&m_data)
......
......@@ -17,20 +17,20 @@
02110-1301, USA.
*/
#ifndef MIMETREEPARSER_BUFFEREDHTMLWRITER_H
#define MIMETREEPARSER_BUFFEREDHTMLWRITER_H
#ifndef MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
#define MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
#include "mimetreeparser_export.h"
#include <mimetreeparser/htmlwriter.h>
#include "messageviewer_export.h"
#include <MessageViewer/HtmlWriter>
#include <QBuffer>
#include <QByteArray>
namespace MimeTreeParser {
namespace MessageViewer {
/**
* QBuffer-backed HtmlWriter
*/
class MIMETREEPARSER_EXPORT BufferedHtmlWriter : public HtmlWriter
class MESSAGEVIEWER_EXPORT BufferedHtmlWriter : public HtmlWriter
{
public:
BufferedHtmlWriter();
......@@ -55,4 +55,4 @@ private:
};
}
#endif // MIMETREEPARSER_BUFFEREDHTMLWRITER_H
#endif // MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
......@@ -30,9 +30,9 @@
*/
#include "filehtmlwriter.h"
#include "mimetreeparser_debug.h"
#include "messageviewer_debug.h"
using namespace MimeTreeParser;
using namespace MessageViewer;
FileHtmlWriter::FileHtmlWriter(const QString &filename)
: mFile(filename.isEmpty() ? QStringLiteral("filehtmlwriter.out") : filename)
......@@ -42,7 +42,7 @@ FileHtmlWriter::FileHtmlWriter(const QString &filename)
FileHtmlWriter::~FileHtmlWriter()
{
if (mFile.isOpen()) {
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
HtmlWriter::end();
mFile.close();
}
......@@ -51,11 +51,11 @@ FileHtmlWriter::~FileHtmlWriter()
void FileHtmlWriter::begin()
{
if (mFile.isOpen()) {
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
mFile.close();
}
if (!mFile.open(QIODevice::WriteOnly)) {
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
}
HtmlWriter::begin();
}
......
......@@ -29,16 +29,16 @@
your version.
*/
#ifndef __MIMETREEPARSER_FILEHTMLWRITER_H__
#define __MIMETREEPARSER_FILEHTMLWRITER_H__
#ifndef __MESSAGEVIEWER_FILEHTMLWRITER_H__
#define __MESSAGEVIEWER_FILEHTMLWRITER_H__
#include "mimetreeparser_export.h"
#include "mimetreeparser/htmlwriter.h"
#include "messageviewer_export.h"
#include <MessageViewer/HtmlWriter>
#include <QFile>
namespace MimeTreeParser {
class MIMETREEPARSER_EXPORT FileHtmlWriter : public HtmlWriter
namespace MessageViewer {
class MESSAGEVIEWER_EXPORT FileHtmlWriter : public HtmlWriter
{
public:
explicit FileHtmlWriter(const QString &filename);
......@@ -54,6 +54,6 @@ public:
private:
QFile mFile;
};
} // namespace MimeTreeParser
} // namespace MessageViewer
#endif // __MIMETREEPARSER_FILEHTMLWRITER_H__
#endif // __MESSAGEVIEWER_FILEHTMLWRITER_H__
......@@ -17,7 +17,7 @@
#ifndef WEBENGINEPARTHTMLWRITER_H
#define WEBENGINEPARTHTMLWRITER_H
#include <MimeTreeParser/BufferedHtmlWriter>
#include "bufferedhtmlwriter.h"
#include <QObject>
#include <QString>
......@@ -28,7 +28,7 @@ class MailWebEngineView;
}
namespace MessageViewer {
class WebEnginePartHtmlWriter : public QObject, public MimeTreeParser::BufferedHtmlWriter
class WebEnginePartHtmlWriter : public QObject, public BufferedHtmlWriter
{
Q_OBJECT
public:
......
......@@ -21,7 +21,7 @@
#include <QTextStream>
using namespace MimeTreeParser;
using namespace MessageViewer;
HtmlWriter::HtmlWriter() = default;
HtmlWriter::~HtmlWriter() = default;
......
......@@ -30,10 +30,10 @@
your version.
*/
#ifndef __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
#define __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
#ifndef __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
#define __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
#include "mimetreeparser_export.h"
#include "messageviewer_export.h"
#include <qglobal.h>
#include <memory>
......@@ -43,13 +43,13 @@ class QIODevice;
class QString;
class QTextStream;
namespace MimeTreeParser {
namespace MessageViewer {
/**
* @short An interface for HTML sinks.
* @author Marc Mutz <mutz@kde.org>
*
*/
class MIMETREEPARSER_EXPORT HtmlWriter
class MESSAGEVIEWER_EXPORT HtmlWriter
{
public:
HtmlWriter();
......@@ -102,4 +102,4 @@ private:
};
}
#endif // __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
#endif // __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
......@@ -21,7 +21,7 @@
#include "setupenv.h"
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/BufferedHtmlWriter>
#include <MessageViewer/BufferedHtmlWriter>
#include <MessageViewer/CSSHelperBase>
#include <QTest>
......@@ -92,7 +92,7 @@ void ObjectTreeParserTester::test_parseEncapsulatedMessage()
QCOMPARE(msg->contents().size(), 2);
// Parse the message
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
......@@ -130,7 +130,7 @@ void ObjectTreeParserTester::test_missingContentTypeHeader()
false).constData(), "Simple Mail Without Content-Type Header");
QCOMPARE(msg->contents().size(), 0);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
......@@ -150,7 +150,7 @@ void ObjectTreeParserTester::test_inlinePGPDecryption()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "inlinepgpencrypted");
QCOMPARE(msg->contents().size(), 0);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
......@@ -177,7 +177,7 @@ void ObjectTreeParserTester::test_inlinePGPSigned()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "test");
QCOMPARE(msg->contents().size(), 0);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
......@@ -217,7 +217,7 @@ void ObjectTreeParserTester::test_HTMLasText()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 2);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -255,7 +255,7 @@ void ObjectTreeParserTester::test_HTMLOnlyText()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 0);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -279,7 +279,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
QCOMPARE(msg->contents().size(), 0);
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -294,7 +294,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
QVERIFY(testWriter.data().contains("This HTML message may contain external references to images etc. For security/privacy reasons external references are not loaded."));
}
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -315,7 +315,7 @@ void ObjectTreeParserTester::test_Alternative()
KMime::Message::Ptr msg = Test::readAndParseMail(QStringLiteral("alternative.mbox"));
QCOMPARE(msg->contents().size(), 2);
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -332,7 +332,7 @@ void ObjectTreeParserTester::test_Alternative()
}
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -352,7 +352,7 @@ void ObjectTreeParserTester::test_Alternative()
msg = Test::readAndParseMail(QStringLiteral("alternative-notext.mbox"));
QCOMPARE(msg->contents().size(), 1);
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -368,7 +368,7 @@ void ObjectTreeParserTester::test_Alternative()
}
{
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......
......@@ -22,7 +22,7 @@
#include "setupenv.h"
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/BufferedHtmlWriter>
#include <MessageViewer/BufferedHtmlWriter>
#include <MessageViewer/CSSHelperBase>
#include <MimeTreeParser/MessagePart>
#include <MessageViewer/IconNameCache>
......@@ -138,7 +138,7 @@ void QuoteHtmlTest::testQuoteHtml()
QFETCH(QString, result);
QFETCH(bool, showExpandQuotesMark);
QFETCH(int, quotelevel);
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
emptySource.setShowExpandQuotesMark(showExpandQuotesMark);
......
......@@ -23,7 +23,7 @@
#include "testcsshelper.h"
#include "util.h"
#include <MimeTreeParser/FileHtmlWriter>
#include <MessageViewer/FileHtmlWriter>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/MessagePart>
......@@ -311,7 +311,7 @@ void RenderTest::testRender()
const KMime::Message::Ptr msg(Test::readAndParseMail(mailFileName));
// render the mail
MimeTreeParser::FileHtmlWriter fileWriter(outFileName);
FileHtmlWriter fileWriter(outFileName);
QImage paintDevice;
Test::TestCSSHelper cssHelper(&paintDevice);
MimeTreeParser::NodeHelper nodeHelper;
......
......@@ -43,7 +43,7 @@ void setupEnv();
class ObjectTreeSource : public MessageViewer::EmptySource
{
public:
ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
ObjectTreeSource(HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
: mWriter(writer)
, mCSSHelper(cssHelper)
, mAttachmentStrategy(QStringLiteral("smart"))
......@@ -56,7 +56,7 @@ public:
{
}
MimeTreeParser::HtmlWriter *htmlWriter() override
HtmlWriter *htmlWriter() override
{
return mWriter;
}
......@@ -169,7 +169,7 @@ public:
}
private:
MimeTreeParser::HtmlWriter *mWriter;
HtmlWriter *mWriter;
MessageViewer::CSSHelperBase *mCSSHelper;
QString mAttachmentStrategy;
MimeTreeParser::BodyPartFormatterFactory mBodyPartFormatterFactory;
......
......@@ -24,7 +24,7 @@
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/BufferedHtmlWriter>
#include <MessageViewer/BufferedHtmlWriter>
#include <QTest>
......@@ -54,7 +54,7 @@ void UnencryptedMessageTest::testSignedForwardedOpenPGPSignedEncrypted()
= Test::readAndParseMail(QStringLiteral("signed-forward-openpgp-signed-encrypted.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -78,7 +78,7 @@ void UnencryptedMessageTest::testForwardedOpenPGPSignedEncrypted()
= Test::readAndParseMail(QStringLiteral("forward-openpgp-signed-encrypted.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -313,7 +313,7 @@ void UnencryptedMessageTest::testNotDecrypted()
KMime::Message::Ptr originalMessage = Test::readAndParseMail(mailFileName);
MimeTreeParser::NodeHelper nodeHelper;
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......@@ -338,7 +338,7 @@ void UnencryptedMessageTest::testSMimeAutoCertImport()
KMime::Message::Ptr originalMessage = Test::readAndParseMail(QStringLiteral("smime-cert.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
MimeTreeParser::BufferedHtmlWriter testWriter;
BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
......
......@@ -20,7 +20,7 @@
#ifndef __MESSAGEVIEWER_TESTS_UTIL_H__
#define __MESSAGEVIEWER_TESTS_UTIL_H__
#include <MimeTreeParser/HtmlWriter>
#include "interfaces/htmlwriter.h"
#include <MessageViewer/CSSHelperBase>
#include <KMime/Message>
......
......@@ -34,7 +34,7 @@
#include "viewer/csshelperbase.h"
#include "messagepartrenderermanager.h"
#include <MimeTreeParser/BufferedHtmlWriter>
#include "htmlwriter/bufferedhtmlwriter.h"
#include <MimeTreeParser/MessagePart>
#include <MimeTreeParser/ObjectTreeParser>
#include <GrantleeTheme/QtResourceTemplateLoader>
......@@ -1038,7 +1038,7 @@ void DefaultRenderer::setAttachmentStrategy(const AttachmentStrategy *strategy)
d->mAttachmentStrategy = strategy;
}
void DefaultRenderer::render(const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *writer)
void DefaultRenderer::render(const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *writer)
{
d->mMsgPart = msgPart;
d->renderFactory(d->mMsgPart, writer);
......
......@@ -24,12 +24,12 @@
namespace MimeTreeParser {
class DefaultRendererPrivate;
class HtmlWriter;
class MessagePart;
typedef QSharedPointer<MessagePart> MessagePartPtr;
}
namespace MessageViewer {
class HtmlWriter;
class AttachmentStrategy;
class CSSHelperBase;
......@@ -41,7 +41,7 @@ public:
void setShowOnlyOneMimePart(bool onlyOneMimePart);
void setAttachmentStrategy(const AttachmentStrategy *strategy);
void render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *writer);
void render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *writer);
private:
MimeTreeParser::DefaultRendererPrivate *d;
};
......
......@@ -35,6 +35,7 @@ class HtmlWriter;
}
namespace MimeTreeParser {
class DefaultRendererPrivate : public MessageViewer::RenderContext
{
public:
......@@ -45,21 +46,21 @@ public:
Interface::ObjectTreeSource *source() const;
void renderSubParts(const MessagePart::Ptr &msgPart, HtmlWriter *htmlWriter) override;
void renderSubParts(const MessagePart::Ptr &msgPart, MessageViewer::HtmlWriter *htmlWriter) override;
void render(const MessagePartList::Ptr &mp, HtmlWriter *htmlWriter);
void render(const MimeMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const EncapsulatedRfc822MessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const HtmlMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void renderEncrypted(const EncryptedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void renderSigned(const SignedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const SignedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const EncryptedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const AlternativeMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
void render(const CertMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
bool renderWithFactory(const QMetaObject *mo, const MessagePart::Ptr &msgPart, HtmlWriter *writer) override;
void render(const MessagePartList::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void render(const MimeMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void render(const EncapsulatedRfc822MessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void render(const HtmlMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void renderEncrypted(const EncryptedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void renderSigned(const SignedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void render(const SignedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
void render(const EncryptedMessagePart::Ptr &mp, MessageViewer::HtmlWriter