Commit 1c3bd593 authored by Sandro Knauß's avatar Sandro Knauß

Move renderingparts to own subdir.

cleanup parsing and rendering from eachother.
parent d8d23702
......@@ -29,7 +29,6 @@ set(libmimetreeparser_main_SRCS
viewer/bodypartformatterbasefactory.cpp
viewer/cryptohelper.cpp
viewer/csshelperbase.cpp
viewer/htmlblock.cpp
viewer/nodehelper.cpp
viewer/objecttreeparser.cpp
viewer/messagepart.cpp
......@@ -49,6 +48,7 @@ set(libmimetreeparser_extra_SRCS
htmlwriter/filehtmlwriter.cpp
htmlwriter/queuehtmlwriter.cpp
themes/default/mailrenderer.cpp
themes/default/htmlblock.cpp
)
set(mimetreeparser_temporaryfile_SRCS
......
......@@ -20,19 +20,10 @@
#include "htmlblock.h"
#include "mimetreeparser_debug.h"
#include "interfaces/objecttreesource.h"
#include "interfaces/htmlwriter.h"
#include "nodehelper.h"
#include <MessageCore/StringUtil>
#include <KMime/Content>
#include <gpgme.h>
#include <Libkleo/CryptoBackendFactory>
#include <KLocalizedString>
#include <KEmailAddress>
#include <QApplication>
using namespace MimeTreeParser;
......@@ -78,45 +69,6 @@ void AttachmentMarkBlock::internalExit()
entered = false;
}
HTMLWarnBlock::HTMLWarnBlock(HtmlWriter *writer, const QString &msg)
: mWriter(writer)
, mMsg(msg)
{
internalEnter();
}
HTMLWarnBlock::~HTMLWarnBlock()
{
internalExit();
}
void HTMLWarnBlock::internalEnter()
{
if (!mWriter || entered) {
return;
}
entered = true;
if (!mMsg.isEmpty()) {
mWriter->queue(QStringLiteral("<div class=\"htmlWarn\">\n"));
mWriter->queue(mMsg);
mWriter->queue(QStringLiteral("</div><br/><br/>"));
}
mWriter->queue(QStringLiteral("<div style=\"position: relative\">\n"));
}
void HTMLWarnBlock::internalExit()
{
if (!entered) {
return;
}
entered = false;
mWriter->queue(QStringLiteral("</div>\n"));
}
RootBlock::RootBlock(HtmlWriter *writer)
: HTMLBlock()
, mWriter(writer)
......
......@@ -20,9 +20,6 @@
#ifndef __MIMETREEPARSER_HTMLBLOCK_H__
#define __MIMETREEPARSER_HTMLBLOCK_H__
#include "partmetadata.h"
#include <Libkleo/CryptoBackend>
#include <QString>
#include <QSharedPointer>
#include <QVector>
......@@ -83,19 +80,6 @@ private:
HtmlWriter *mWriter;
};
class HTMLWarnBlock : public HTMLBlock
{
public:
HTMLWarnBlock(MimeTreeParser::HtmlWriter *writer, const QString &msg);
virtual ~HTMLWarnBlock();
private:
void internalEnter();
void internalExit();
private:
HtmlWriter *mWriter;
const QString &mMsg;
};
// Make sure the whole content is relative, so that nothing is painted over the header
// if a malicious message uses absolute positioning.
// Also force word wrapping, which is useful for printing, see https://issues.kolab.org/issue3992.
......
This diff is collapsed.
......@@ -70,7 +70,6 @@ public:
virtual QString text() const Q_DECL_OVERRIDE;
void setText(const QString &text);
virtual void html(bool decorate) Q_DECL_OVERRIDE;
void setAttachmentFlag(KMime::Content *node);
bool isAttachment() const;
......@@ -88,18 +87,9 @@ public:
bool hasSubParts() const;
protected:
/** Change the string to `quoted' html (meaning, that the quoted
part of the message get italized */
QString quotedHTML(const QString &s, bool decorate);
void parseInternal(KMime::Content *node, bool onlyOneMimePart);
void renderInternalHtml(bool decorate) const;
QString internalContent() const;
QString renderInternalText() const;
HTMLBlockPtr attachmentBlock() const;
HTMLBlockPtr rootBlock() const;
HtmlWriter* htmlWriter() const;
void setHtmlWriter(HtmlWriter *htmlWriter) const;
......@@ -114,11 +104,7 @@ protected:
private:
CSSHelperBase *cssHelper() const;
QString mCollapseIcon;
QString mExpandIcon;
KMime::Content *attachmentNode() const;
HTMLBlockPtr internalRootBlock() const;
QVector<Interface::MessagePart::Ptr> mBlocks;
bool mIsInternalRoot;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment