Messagelib

objecttreeviewersource.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
3 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#include "objecttreeviewersource.h"
9#include "csshelper.h"
10#include <MimeTreeParser/BodyPartFormatterFactory>
11
12#include "messagepartthemes/default/defaultrenderer.h"
13#include <MimeTreeParser/BodyPartFormatter>
14
15#include "settings/messageviewersettings.h"
16#include "viewer/viewer_p.h"
17#include "widgets/htmlstatusbar.h"
18
19using namespace MessageViewer;
20
21MailViewerSource::MailViewerSource(ViewerPrivate *viewer)
22 : MessageViewer::EmptySource()
23 , mViewer(viewer)
24{
25}
26
27MailViewerSource::~MailViewerSource() = default;
28
30{
31 return mViewer->decryptMessage();
32}
33
35{
36 return mViewer->htmlLoadExternal();
37}
38
39bool MailViewerSource::showSignatureDetails() const
40{
41 return mViewer->mShowSignatureDetails;
42}
43
44bool MailViewerSource::showEncryptionDetails() const
45{
46 return mViewer->mShowEncryptionDetails;
47}
48
50{
51 // qDebug() << " void MailViewerSource::setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList<MimeTreeParser::Util::HtmlMode> &availableModes)";
52 // for (int i = 0; i < availableModes.count(); ++i) {
53 // qDebug() << "MailViewerSource::setHtmlMode Mode " << MimeTreeParser::Util::htmlModeToString(availableModes.at(i));
54 // }
55 // qDebug() << "MailViewerSource::setHtmlMode preferred " << MimeTreeParser::Util::htmlModeToString(mode);
56
57 mViewer->mColorBar->setAvailableModes(availableModes);
58 mViewer->mColorBar->setMode(mode);
59}
60
62{
63 switch (mViewer->displayFormatMessageOverwrite()) {
64 case MessageViewer::Viewer::UseGlobalSetting:
65 case MessageViewer::Viewer::Unknown:
66 return mViewer->htmlMailGlobalSetting() ? MimeTreeParser::Util::Html : MimeTreeParser::Util ::Normal;
67 case MessageViewer::Viewer::Html:
69 case MessageViewer::Viewer::Text:
71 case MessageViewer::Viewer::ICal:
73 }
74 Q_ASSERT(true);
76}
77
78int MailViewerSource::levelQuote() const
79{
80 return mViewer->mLevelQuote;
81}
82
84{
85 return mViewer->overrideCodecName();
86}
87
88QString MailViewerSource::createMessageHeader(KMime::Message *message)
89{
90 return mViewer->writeMessageHeader(message, nullptr, false);
91}
92
93const AttachmentStrategy *MailViewerSource::attachmentStrategy() const
94{
95 return mViewer->attachmentStrategy();
96}
97
98CSSHelperBase *MailViewerSource::cssHelper() const
99{
100 return mViewer->cssHelper();
101}
102
103HtmlWriter *MailViewerSource::htmlWriter() const
104{
105 return mViewer->htmlWriter();
106}
107
109{
110 return MessageViewer::MessageViewerSettings::self()->autoImportKeys();
111}
112
113bool MailViewerSource::showEmoticons() const
114{
115 return mViewer->showEmoticons();
116}
117
118bool MailViewerSource::showExpandQuotesMark() const
119{
120 return MessageViewer::MessageViewerSettings::self()->showExpandQuotesMark();
121}
122
123bool MailViewerSource::isPrinting() const
124{
125 return mViewer->mPrinting;
126}
The AttachmentStrategy class.
The CSSHelperBase class.
An interface for HTML sinks.
Definition htmlwriter.h:29
QByteArray overrideCodecName() const override
The override codec that should be used for the mail.
bool decryptMessage() const override
Return true if an encrypted mail should be decrypted.
void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList< MimeTreeParser::Util::HtmlMode > &availableModes) override
Sets the type of mail that is currently displayed.
bool htmlLoadExternal() const override
Return true if external sources should be loaded in a html mail.
MimeTreeParser::Util::HtmlMode preferredMode() const override
Return the mode that is the preferred to display.
bool autoImportKeys() const override
should keys be imported automatically
HtmlMode
Describes the type of the displayed message.
@ Html
A HTML message, non-multipart.
@ MultipartPlain
A multipart/alternative message, the plain text part is currently displayed.
@ MultipartIcal
A multipart/alternative message, the ICal part is currently displayed.
@ MultipartHtml
A multipart/alternative message, the HTML part is currently displayed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.