Commit 5f63bd04 authored by Sandro Knauß's avatar Sandro Knauß

Make namespace shift from MessageViewer-> MimeTreeParser

parent f16574fd
......@@ -74,7 +74,7 @@ set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(GRAVATAR_LIB_VERSION "5.2.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.2.40")
set(KTNEF_LIB_VERSION "5.2.40")
set(MESSAGELIB_LIB_VERSION "5.2.45")
set(MESSAGELIB_LIB_VERSION "5.2.46")
find_package(KF5MailCommon ${MAILCOMMN_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -71,7 +71,7 @@ void ItemViewerWidget::selectionChanged(const QModelIndex &selectedIndex)
Akonadi::Item item = selectedIndex.data(EntityTreeModel::ItemRole).value<Akonadi::Item>();
if (mimeType == QLatin1String("message/rfc822")) {
m_widgetStack->setCurrentIndex(1);
m_mailViewer->setMessageItem(item, MessageViewer::Force);
m_mailViewer->setMessageItem(item, MimeTreeParser::Force);
return;
}
if (mimeType == QLatin1String("text/directory")) {
......
......@@ -72,7 +72,7 @@ void ItemViewerWidget::selectionChanged(const QItemSelection selected, const QIt
Akonadi::Item item = selectedIndex.data(EntityTreeModel::ItemRole).value<Akonadi::Item>();
if (mimeType == QLatin1String("message/rfc822")) {
m_widgetStack->setCurrentIndex(1);
m_mailViewer->setMessageItem(item, MessageViewer::Force);
m_mailViewer->setMessageItem(item, MimeTreeParser::Force);
return;
}
if (mimeType == QLatin1String("text/directory")) {
......
......@@ -26,7 +26,7 @@ mailreaderView::mailreaderView(QWidget *parent)
ui_mailreaderview.setupUi(this);
QHBoxLayout *layout = new QHBoxLayout;
m_readerWin = new MessageViewer::Viewer(this, parent, dynamic_cast<KXmlGuiWindow *>(parent)->actionCollection());
m_readerWin->setAttachmentStrategy(MessageViewer::AttachmentStrategy::inlined());
m_readerWin->setAttachmentStrategy(MimeTreeParser::AttachmentStrategy::inlined());
layout->addWidget(m_readerWin);
setLayout(layout);
setAutoFillBackground(true);
......@@ -59,7 +59,7 @@ void mailreaderView::showItem(const Akonadi::Item &item)
qDebug() << "Show item with ID: " << item.id();
m_readerWin->enableMessageDisplay();
m_readerWin->setDecryptMessageOverwrite(false);
m_readerWin->setMessageItem(item, MessageViewer::Force);
m_readerWin->setMessageItem(item, MimeTreeParser::Force);
}
void mailreaderView::showAboutPage()
......
......@@ -64,12 +64,12 @@ void RenderTest::testRender()
msg->parse();
// render the mail
MessageViewer::FileHtmlWriter fileWriter(outFileName);
MimeTreeParser::FileHtmlWriter fileWriter(outFileName);
QImage paintDevice;
MessageViewer::CSSHelperBase cssHelper(&paintDevice);
MessageViewer::NodeHelper nodeHelper;
MimeTreeParser::CSSHelperBase cssHelper(&paintDevice);
MimeTreeParser::NodeHelper nodeHelper;
TestObjectTreeSource testSource(&fileWriter, &cssHelper);
MessageViewer::ObjectTreeParser otp(&testSource, &nodeHelper);
MimeTreeParser::ObjectTreeParser otp(&testSource, &nodeHelper);
fileWriter.begin(QString());
fileWriter.queue(QStringLiteral("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
......
......@@ -28,8 +28,8 @@
class TestObjectTreeSource : public MessageViewer::EmptySource
{
public:
TestObjectTreeSource(MessageViewer::HtmlWriter *writer,
MessageViewer::CSSHelperBase *cssHelper)
TestObjectTreeSource(MimeTreeParser::HtmlWriter *writer,
MimeTreeParser::CSSHelperBase *cssHelper)
: mWriter(writer)
, mCSSHelper(cssHelper)
, mHtmlLoadExternal(false)
......@@ -37,11 +37,11 @@ public:
{
}
MessageViewer::HtmlWriter *htmlWriter() Q_DECL_OVERRIDE {
MimeTreeParser::HtmlWriter *htmlWriter() Q_DECL_OVERRIDE {
return mWriter;
}
MessageViewer::CSSHelperBase *cssHelper() Q_DECL_OVERRIDE {
MimeTreeParser::CSSHelperBase *cssHelper() Q_DECL_OVERRIDE {
return mCSSHelper;
}
......@@ -73,7 +73,7 @@ public:
{
return false;
}
void setHtmlMode(MessageViewer::Util::HtmlMode mode) Q_DECL_OVERRIDE {
void setHtmlMode(MimeTreeParser::Util::HtmlMode mode) Q_DECL_OVERRIDE {
Q_UNUSED(mode)
}
int levelQuote() const Q_DECL_OVERRIDE
......@@ -87,8 +87,8 @@ public:
Q_UNUSED(message);
return QString();
}
const MessageViewer::AttachmentStrategy *attachmentStrategy() Q_DECL_OVERRIDE {
return MessageViewer::AttachmentStrategy::smart();
const MimeTreeParser::AttachmentStrategy *attachmentStrategy() Q_DECL_OVERRIDE {
return MimeTreeParser::AttachmentStrategy::smart();
}
QObject *sourceObject() Q_DECL_OVERRIDE {
return 0;
......@@ -108,8 +108,8 @@ public:
}
private:
MessageViewer::HtmlWriter *mWriter;
MessageViewer::CSSHelperBase *mCSSHelper;
MimeTreeParser::HtmlWriter *mWriter;
MimeTreeParser::CSSHelperBase *mCSSHelper;
bool mHtmlLoadExternal;
bool mHtmlMail;
};
......
......@@ -58,10 +58,10 @@
namespace
{
class Formatter : public MessageViewer::Interface::BodyPartFormatter
class Formatter : public MimeTreeParser::Interface::BodyPartFormatter
{
public:
MessageViewer::Interface::BodyPartFormatter::Result format(MessageViewer::Interface::BodyPart *bodyPart, MessageViewer::HtmlWriter *writer) const Q_DECL_OVERRIDE
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
if (!writer) {
......@@ -108,7 +108,7 @@ public:
if (tnefatts.isEmpty() && inviteStr.isEmpty()) {
qCDebug(MS_TNEF_LOG) << "No attachments or invitation found in" << fileName;
QString label = MessageViewer::NodeHelper::fileName(bodyPart->content());
QString label = MimeTreeParser::NodeHelper::fileName(bodyPart->content());
label = MessageCore::StringUtil::quoteHtmlChars(label, true);
const QString comment =
MessageCore::StringUtil::quoteHtmlChars(
......@@ -127,7 +127,7 @@ public:
return NeedContent;
}
QString label = MessageViewer::NodeHelper::fileName(bodyPart->content());
QString label = MimeTreeParser::NodeHelper::fileName(bodyPart->content());
label = MessageCore::StringUtil::quoteHtmlChars(label, true);
const QString comment =
MessageCore::StringUtil::quoteHtmlChars(
......@@ -170,7 +170,7 @@ public:
bodyPart->nodeHelper()->addTempFile(dir + QDir::separator() + attFileName);
const QString href = QStringLiteral("file:") + QString::fromLatin1(QUrl::toPercentEncoding(dir + QDir::separator() + att->name()));
const QString iconName = QUrl::fromLocalFile(MessageViewer::Util::fileNameForMimetype(att->mimeTag(),
const QString iconName = QUrl::fromLocalFile(MimeTreeParser::Util::fileNameForMimetype(att->mimeTag(),
KIconLoader::Desktop, attFileName)).url();
writer->queue(QStringLiteral("<div><a href=\"") + href + QStringLiteral("\"><img src=\"") +
......@@ -187,13 +187,13 @@ public:
}
// unhide the overload with three arguments
using MessageViewer::Interface::BodyPartFormatter::format;
using MimeTreeParser::Interface::BodyPartFormatter::format;
};
class Plugin : public MessageViewer::Interface::BodyPartFormatterPlugin
class Plugin : public MimeTreeParser::Interface::BodyPartFormatterPlugin
{
public:
const MessageViewer::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
{
return idx == 0 ? new Formatter() : 0;
}
......@@ -212,7 +212,7 @@ public:
}
}
const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int) const Q_DECL_OVERRIDE
{
return 0;
}
......@@ -221,7 +221,7 @@ public:
}
extern "C"
Q_DECL_EXPORT MessageViewer::Interface::BodyPartFormatterPlugin *
Q_DECL_EXPORT MimeTreeParser::Interface::BodyPartFormatterPlugin *
messageviewer_bodypartformatter_application_mstnef_create_bodypart_formatter_plugin()
{
return new Plugin();
......
......@@ -39,7 +39,7 @@
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/HtmlWriter>
using MessageViewer::Interface::BodyPart;
using MimeTreeParser::Interface::BodyPart;
#include <Libkdepim/AddContactJob>
......@@ -63,19 +63,19 @@ using MessageViewer::Interface::BodyPart;
namespace
{
class Formatter : public MessageViewer::Interface::BodyPartFormatter
class Formatter : public MimeTreeParser::Interface::BodyPartFormatter
{
public:
Formatter()
{
}
Result format(MessageViewer::Interface::BodyPart *part, MessageViewer::HtmlWriter *writer) const Q_DECL_OVERRIDE
Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
return format(part, writer, 0);
}
Result format(MessageViewer::Interface::BodyPart *bodyPart, MessageViewer::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE
{
if (!writer) {
return Ok;
......@@ -122,7 +122,7 @@ public:
bodyPart->setBodyPartMemento(memento);
if (asyncResultObserver) {
QObject::connect(memento, SIGNAL(update(MessageViewer::UpdateMode)), asyncResultObserver, SLOT(update(MessageViewer::UpdateMode)));
QObject::connect(memento, SIGNAL(update(MimeTreeParser::UpdateMode)), asyncResultObserver, SLOT(update(MimeTreeParser::UpdateMode)));
}
}
......@@ -182,7 +182,7 @@ public:
}
};
class UrlHandler : public MessageViewer::Interface::BodyPartURLHandler
class UrlHandler : public MimeTreeParser::Interface::BodyPartURLHandler
{
public:
bool handleClick(MessageViewer::Viewer *viewerInstance, BodyPart *bodyPart,
......@@ -312,10 +312,10 @@ public:
}
};
class Plugin : public MessageViewer::Interface::BodyPartFormatterPlugin
class Plugin : public MimeTreeParser::Interface::BodyPartFormatterPlugin
{
public:
const MessageViewer::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
{
return validIndex(idx) ? new Formatter() : 0;
}
......@@ -337,7 +337,7 @@ public:
}
}
const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int idx) const Q_DECL_OVERRIDE
{
return validIndex(idx) ? new UrlHandler() : 0;
}
......@@ -352,7 +352,7 @@ private:
}
extern "C"
Q_DECL_EXPORT MessageViewer::Interface::BodyPartFormatterPlugin *
Q_DECL_EXPORT MimeTreeParser::Interface::BodyPartFormatterPlugin *
messageviewer_bodypartformatter_text_vcard_create_bodypart_formatter_plugin()
{
return new Plugin();
......
......@@ -74,7 +74,7 @@ void VcardMemento::continueToCheckEmail()
{
if (mIndex == mVCardList.count()) {
mFinished = true;
Q_EMIT update(Delayed);
Q_EMIT update(MimeTreeParser::Delayed);
} else {
checkEmail();
}
......@@ -87,7 +87,7 @@ bool VcardMemento::finished() const
void VcardMemento::detach()
{
disconnect(this, SIGNAL(update(MessageViewer::UpdateMode)), 0, 0);
disconnect(this, SIGNAL(update(MimeTreeParser::UpdateMode)), 0, 0);
}
bool VcardMemento::vcardExist(int index) const
......
......@@ -18,9 +18,8 @@
#ifndef VCARDMEMENTO_H
#define VCARDMEMENTO_H
#include <MessageViewer/Viewer>
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/Enums>
#include <QObject>
#include <QMap>
......@@ -47,7 +46,7 @@ struct VCard {
bool found;
};
class VcardMemento : public QObject, public Interface::BodyPartMemento
class VcardMemento : public QObject, public MimeTreeParser::Interface::BodyPartMemento
{
Q_OBJECT
public:
......@@ -67,7 +66,7 @@ private Q_SLOTS:
Q_SIGNALS:
// TODO: Factor our update and detach into base class
void update(MessageViewer::UpdateMode);
void update(MimeTreeParser::UpdateMode);
private:
void checkEmail();
......
......@@ -48,17 +48,17 @@ namespace
// TODO: Show filename header to make it possible to save the patch.
// FIXME: The box should only be as wide as necessary.
class Formatter : public MessageViewer::Interface::BodyPartFormatter
class Formatter : public MimeTreeParser::Interface::BodyPartFormatter
{
public:
Result format(MessageViewer::Interface::BodyPart *bodyPart, MessageViewer::HtmlWriter *writer) const Q_DECL_OVERRIDE
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
if (!writer) {
return Ok;
}
if (bodyPart->defaultDisplay() == MessageViewer::Interface::BodyPart::AsIcon) {
if (bodyPart->defaultDisplay() == MimeTreeParser::Interface::BodyPart::AsIcon) {
return AsIcon;
}
......@@ -118,13 +118,13 @@ public:
}
// unhide the overload with three arguments
using MessageViewer::Interface::BodyPartFormatter::format;
using MimeTreeParser::Interface::BodyPartFormatter::format;
};
class Plugin : public MessageViewer::Interface::BodyPartFormatterPlugin
class Plugin : public MimeTreeParser::Interface::BodyPartFormatterPlugin
{
public:
const MessageViewer::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const Q_DECL_OVERRIDE
{
return idx == 0 ? new Formatter() : 0;
}
......@@ -137,7 +137,7 @@ public:
return idx == 0 ? "x-diff" : 0;
}
const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int) const Q_DECL_OVERRIDE
const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int) const Q_DECL_OVERRIDE
{
return 0;
}
......@@ -146,7 +146,7 @@ public:
}
extern "C"
Q_DECL_EXPORT MessageViewer::Interface::BodyPartFormatterPlugin *
Q_DECL_EXPORT MimeTreeParser::Interface::BodyPartFormatterPlugin *
messageviewer_bodypartformatter_text_xdiff_create_bodypart_formatter_plugin()
{
return new Plugin();
......
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