Messagelib

viewer.cpp
1/*
2 This file is part of KMail, the KDE mail client.
3 SPDX-FileCopyrightText: 1997 Markus Wuebben <markus.wuebben@kde.org>
4 SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
5 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
6 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11// define this to copy all html that is written to the readerwindow to
12// filehtmlwriter.out in the current working directory
13// #define KMAIL_READER_HTML_DEBUG 1
14
15#include "viewer.h"
16#include "csshelper.h"
17#include "dkim-verify/dkimwidgetinfo.h"
18#include "viewer/mimeparttree/mimeparttreeview.h"
19#include "viewer/mimeparttree/mimetreemodel.h"
20#include "viewer/webengine/mailwebengineview.h"
21#include "viewer_p.h"
22#include "widgets/zoomactionmenu.h"
23#include <Akonadi/ItemFetchJob>
24#include <Akonadi/ItemFetchScope>
25#include <Akonadi/MessageParts>
26#include <QUrl>
27#include <WebEngineViewer/WebEngineManageScript>
28#include <WebEngineViewer/WebHitTestResult>
29
30#include <Akonadi/ErrorAttribute>
31
32#include <KLocalizedString>
33
34#include <QAction>
35
36#include <Akonadi/MDNStateAttribute>
37
38namespace MessageViewer
39{
40class AbstractMessageLoadedHandler::AbstractMessageLoadedHandlerPrivate
41{
42public:
43 Akonadi::Session *mSession = nullptr;
44};
45
46AbstractMessageLoadedHandler::AbstractMessageLoadedHandler()
47 : d(new AbstractMessageLoadedHandlerPrivate)
48{
49}
50
51AbstractMessageLoadedHandler::~AbstractMessageLoadedHandler() = default;
52
53void AbstractMessageLoadedHandler::setSession(Akonadi::Session *session)
54{
55 d->mSession = session;
56}
57
58Akonadi::Session *AbstractMessageLoadedHandler::session() const
59{
60 return d->mSession;
61}
62
63Viewer::Viewer(QWidget *aParent, QWidget *mainWindow, KActionCollection *actionCollection)
64 : QWidget(aParent)
65 , d_ptr(new ViewerPrivate(this, mainWindow, actionCollection))
66{
67 initialize();
68}
69
70// the d_ptr is automatically deleted
71Viewer::~Viewer() = default;
72
73void Viewer::initialize()
74{
75 connect(d_ptr, &ViewerPrivate::displayPopupMenu, this, &Viewer::displayPopupMenu);
76 connect(d_ptr, &ViewerPrivate::popupMenu, this, &Viewer::popupMenu);
77 connect(d_ptr, SIGNAL(urlClicked(Akonadi::Item, QUrl)), SIGNAL(urlClicked(Akonadi::Item, QUrl)));
78 connect(d_ptr, &ViewerPrivate::requestConfigSync, this, &Viewer::requestConfigSync);
79 connect(d_ptr, &ViewerPrivate::makeResourceOnline, this, &Viewer::makeResourceOnline);
80 connect(d_ptr, &ViewerPrivate::showReader, this, &Viewer::showReader);
81 connect(d_ptr, &ViewerPrivate::showMessage, this, &Viewer::showMessage);
82 connect(d_ptr, &ViewerPrivate::replyMessageTo, this, &Viewer::replyMessageTo);
83 connect(d_ptr, &ViewerPrivate::showStatusBarMessage, this, &Viewer::showStatusBarMessage);
84 connect(d_ptr, &ViewerPrivate::itemRemoved, this, &Viewer::itemRemoved);
85 connect(d_ptr, &ViewerPrivate::changeDisplayMail, this, &Viewer::slotChangeDisplayMail);
86 connect(d_ptr, &ViewerPrivate::moveMessageToTrash, this, &Viewer::moveMessageToTrash);
87 connect(d_ptr, &ViewerPrivate::pageIsScrolledToBottom, this, &Viewer::pageIsScrolledToBottom);
88 connect(d_ptr, &ViewerPrivate::printingFinished, this, &Viewer::printingFinished);
89 connect(d_ptr, &ViewerPrivate::zoomChanged, this, &Viewer::zoomChanged);
90
91 connect(d_ptr, &ViewerPrivate::showNextMessage, this, &Viewer::showNextMessage);
92 connect(d_ptr, &ViewerPrivate::showPreviousMessage, this, &Viewer::showPreviousMessage);
93 connect(d_ptr, &ViewerPrivate::sendResponse, this, &Viewer::sendResponse);
94
95 setMessage(KMime::Message::Ptr(), MimeTreeParser::Delayed);
96}
97
98void Viewer::slotGeneralPaletteChanged()
99{
100 Q_D(Viewer);
101 d->updatePalette();
102}
103
104void Viewer::changeEvent(QEvent *event)
105{
106 Q_D(Viewer);
107 if (event->type() == QEvent::FontChange) {
108 d->slotGeneralFontChanged();
109 }
111}
112
113void Viewer::setMessage(const KMime::Message::Ptr &message, MimeTreeParser::UpdateMode updateMode)
114{
115 Q_D(Viewer);
116 if (message == d->message()) {
117 return;
118 }
119 d->setMessage(message, updateMode);
120}
121
122void Viewer::setMessageItem(const Akonadi::Item &item, MimeTreeParser::UpdateMode updateMode)
123{
124 Q_D(Viewer);
125 if (d->messageItem() == item) {
126 return;
127 }
128 if (!item.isValid() || item.loadedPayloadParts().contains(Akonadi::MessagePart::Body)) {
129 d->setMessageItem(item, updateMode);
130 } else {
133 d->itemFetchResult(job);
134 });
135 d->displaySplashPage(i18n("Loading message..."));
136 }
137}
138
140{
141 Q_D(const Viewer);
142 return d->mMessagePath;
143}
144
146{
147 Q_D(Viewer);
148 d->mMessagePath = path;
149}
150
151void Viewer::displaySplashPage(const QString &templateName, const QVariantHash &data, const QByteArray &domain)
152{
153 Q_D(Viewer);
154 d->displaySplashPage(templateName, data, domain);
155}
156
158{
159 Q_D(Viewer);
160 d->enableMessageDisplay();
161}
162
164{
165 Q_D(Viewer);
166 d->printMessage(msg);
167}
168
169void Viewer::printPreviewMessage(const Akonadi::Item &message)
170{
171 Q_D(Viewer);
172 d->printPreviewMessage(message);
173}
174
175void Viewer::printPreview()
176{
177 Q_D(Viewer);
178 d->slotPrintPreview();
179}
180
182{
183 Q_D(Viewer);
184 d->slotPrintMessage();
185}
186
187void Viewer::resizeEvent(QResizeEvent *)
188{
189 Q_D(Viewer);
190 if (!d->mResizeTimer.isActive()) {
191 //
192 // Combine all resize operations that are requested as long a
193 // the timer runs.
194 //
195 d->mResizeTimer.start(100);
196 }
197}
198
200{
201 Q_D(Viewer);
203 d->writeConfig();
204}
205
206void Viewer::slotAttachmentSaveAs()
207{
208 Q_D(Viewer);
209 d->slotAttachmentSaveAs();
210}
211
212void Viewer::slotAttachmentSaveAll()
213{
214 Q_D(Viewer);
215 d->slotAttachmentSaveAll();
216}
217
218void Viewer::slotSaveMessage()
219{
220 Q_D(Viewer);
221 d->slotSaveMessage();
222}
223
225{
226 Q_D(Viewer);
227 d->mViewer->scrollUp(10);
228}
229
230void Viewer::slotScrollDown()
231{
232 Q_D(Viewer);
233 d->mViewer->scrollDown(10);
234}
235
237{
238 Q_D(const Viewer);
239 d->mViewer->isScrolledToBottom();
240}
241
242void Viewer::slotJumpDown()
243{
244 Q_D(Viewer);
245 d->mViewer->scrollPageDown(100);
246}
247
248void Viewer::slotScrollPrior()
249{
250 Q_D(Viewer);
251 d->mViewer->scrollPageUp(80);
252}
253
254void Viewer::slotScrollNext()
255{
256 Q_D(Viewer);
257 d->mViewer->scrollPageDown(80);
258}
259
260QString Viewer::selectedText() const
261{
262 Q_D(const Viewer);
263 return d->mViewer->selectedText();
264}
265
266Viewer::DisplayFormatMessage Viewer::displayFormatMessageOverwrite() const
267{
268 Q_D(const Viewer);
269 return d->displayFormatMessageOverwrite();
270}
271
272void Viewer::setDisplayFormatMessageOverwrite(Viewer::DisplayFormatMessage format)
273{
274 Q_D(Viewer);
275 d->setDisplayFormatMessageOverwrite(format);
276}
277
278void Viewer::setHtmlLoadExtDefault(bool loadExtDefault)
279{
280 Q_D(Viewer);
281 d->setHtmlLoadExtDefault(loadExtDefault);
282}
283
284void Viewer::setHtmlLoadExtOverride(bool loadExtOverride)
285{
286 Q_D(Viewer);
287 d->setHtmlLoadExtOverride(loadExtOverride);
288}
289
291{
292 Q_D(const Viewer);
293 return d->htmlLoadExtOverride();
294}
295
297{
298 Q_D(const Viewer);
299 return d->htmlMail();
300}
301
303{
304 Q_D(const Viewer);
305 return d->htmlLoadExternal();
306}
307
308bool Viewer::isFixedFont() const
309{
310 Q_D(const Viewer);
311 return d->mHtmlHeadSettings.fixedFont;
312}
313
314void Viewer::setUseFixedFont(bool useFixedFont)
315{
316 Q_D(Viewer);
317 d->setUseFixedFont(useFixedFont);
318}
319
320QWidget *Viewer::mainWindow()
321{
322 Q_D(Viewer);
323 return d->mMainWindow;
324}
325
327{
328 Q_D(Viewer);
329 d->setDecryptMessageOverwrite(overwrite);
330}
331
333{
334 Q_D(const Viewer);
335 return d->mMessage;
336}
337
339{
340 Q_D(const Viewer);
341 return d->mMessageItem;
342}
343
345{
346 Q_D(Viewer);
347 if (e->type() == QEvent::PaletteChange) {
348 d->recreateCssHelper();
349 d->update(MimeTreeParser::Force);
350 e->accept();
351 return true;
352 } else if (e->type() == QEvent::ApplicationPaletteChange) {
353 slotGeneralPaletteChanged();
354 }
355
356 return QWidget::event(e);
357}
358
359void Viewer::slotFind()
360{
361 Q_D(Viewer);
362 d->slotFind();
363}
364
365const AttachmentStrategy *Viewer::attachmentStrategy() const
366{
367 Q_D(const Viewer);
368 return d->attachmentStrategy();
369}
370
371void Viewer::setAttachmentStrategy(const AttachmentStrategy *strategy)
372{
373 Q_D(Viewer);
374 d->setAttachmentStrategy(strategy);
375}
376
377QString Viewer::overrideEncoding() const
378{
379 Q_D(const Viewer);
380 return d->overrideEncoding();
381}
382
383void Viewer::setOverrideEncoding(const QString &encoding)
384{
385 Q_D(Viewer);
386 d->setOverrideEncoding(encoding);
387}
388
389CSSHelper *Viewer::cssHelper() const
390{
391 Q_D(const Viewer);
392 return d->cssHelper();
393}
394
395KToggleAction *Viewer::toggleFixFontAction() const
396{
397 Q_D(const Viewer);
398 return d->mToggleFixFontAction;
399}
400
401bool Viewer::mimePartTreeIsEmpty() const
402{
403 Q_D(const Viewer);
404 return d->mimePartTreeIsEmpty();
405}
406
407KToggleAction *Viewer::toggleMimePartTreeAction() const
408{
409 Q_D(const Viewer);
410 return d->mToggleMimePartTreeAction;
411}
412
413QAction *Viewer::selectAllAction() const
414{
415 Q_D(const Viewer);
416 return d->mSelectAllAction;
417}
418
419QAction *Viewer::viewSourceAction() const
420{
421 Q_D(const Viewer);
422 return d->mViewSourceAction;
423}
424
425QAction *Viewer::copyURLAction() const
426{
427 Q_D(const Viewer);
428 return d->mCopyURLAction;
429}
430
431QAction *Viewer::copyAction() const
432{
433 Q_D(const Viewer);
434 return d->mCopyAction;
435}
436
437QAction *Viewer::speakTextAction() const
438{
439 Q_D(const Viewer);
440 return d->mSpeakTextAction;
441}
442
443QAction *Viewer::copyImageLocation() const
444{
445 Q_D(const Viewer);
446 return d->mCopyImageLocation;
447}
448
449QAction *Viewer::saveAsAction() const
450{
451 Q_D(const Viewer);
452 return d->mSaveMessageAction;
453}
454
455QAction *Viewer::urlOpenAction() const
456{
457 Q_D(const Viewer);
458 return d->mUrlOpenAction;
459}
460
461bool Viewer::printingMode() const
462{
463 Q_D(const Viewer);
464 return d->printingMode();
465}
466
467void Viewer::setPrinting(bool enable)
468{
469 Q_D(Viewer);
470 d->setPrinting(enable);
471}
472
473void Viewer::writeConfig(bool force)
474{
475 Q_D(Viewer);
476 d->writeConfig(force);
477}
478
479QUrl Viewer::urlClicked() const
480{
481 Q_D(const Viewer);
482 return d->mClickedUrl;
483}
484
485QUrl Viewer::imageUrlClicked() const
486{
487 Q_D(const Viewer);
488 return d->imageUrl();
489}
490
491void Viewer::update(MimeTreeParser::UpdateMode updateMode)
492{
493 Q_D(Viewer);
494 d->update(updateMode);
495}
496
498{
499 Q_D(Viewer);
500 d->setMessagePart(aMsgPart);
501}
502
503void Viewer::clear(MimeTreeParser::UpdateMode updateMode)
504{
505 setMessage(KMime::Message::Ptr(), updateMode);
506}
507
508void Viewer::slotShowMessageSource()
509{
510 Q_D(Viewer);
511 d->slotShowMessageSource();
512}
513
514void Viewer::readConfig()
515{
516 Q_D(Viewer);
517 d->readConfig();
518}
519
521{
522 return d_func()->mMimePartTree->mimePartModel();
523}
524
526{
527 Q_D(Viewer);
528 auto job = new Akonadi::ItemFetchJob(item, d->mSession);
529 job->fetchScope().fetchAllAttributes();
530 job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent);
531 job->fetchScope().fetchFullPayload(true);
532 job->fetchScope().setFetchRelations(true); // needed to know if we have notes or not
533 job->fetchScope().fetchAttribute<Akonadi::ErrorAttribute>();
534 job->fetchScope().fetchAttribute<Akonadi::MDNStateAttribute>();
535 return job;
536}
537
539{
540 Q_D(Viewer);
541
542 if (!handler) {
543 return;
544 }
545
546 handler->setSession(d->mSession);
547 d->mMessageLoadedHandlers.insert(handler);
548}
549
551{
552 Q_D(Viewer);
553
554 d->mMessageLoadedHandlers.remove(handler);
555}
556
558{
559 Q_D(Viewer);
560 Q_EMIT deleteMessage(d->messageItem());
561}
562
563void Viewer::selectAll()
564{
565 Q_D(Viewer);
566 d->selectAll();
567}
568
569void Viewer::copySelectionToClipboard()
570{
571 Q_D(Viewer);
572 d->slotCopySelectedText();
573}
574
575void Viewer::setZoomFactor(qreal zoomFactor)
576{
577 Q_D(Viewer);
578 d->mZoomActionMenu->setZoomFactor(zoomFactor);
579}
580
581void Viewer::slotZoomReset()
582{
583 Q_D(Viewer);
584 d->mZoomActionMenu->slotZoomReset();
585}
586
587void Viewer::slotZoomIn()
588{
589 Q_D(Viewer);
590 d->mZoomActionMenu->slotZoomIn();
591}
592
593void Viewer::slotZoomOut()
594{
595 Q_D(Viewer);
596 d->mZoomActionMenu->slotZoomOut();
597}
598
599QAction *Viewer::findInMessageAction() const
600{
601 Q_D(const Viewer);
602 return d->mFindInMessageAction;
603}
604
605QAction *Viewer::shareTextAction() const
606{
607 Q_D(const Viewer);
608 return d->mShareTextAction;
609}
610
611void Viewer::slotChangeDisplayMail(Viewer::DisplayFormatMessage mode, bool loadExternal)
612{
616 update(MimeTreeParser::Force);
617 }
618}
619
620QAction *Viewer::saveMessageDisplayFormatAction() const
621{
622 Q_D(const Viewer);
623 return d->mSaveMessageDisplayFormat;
624}
625
626QAction *Viewer::resetMessageDisplayFormatAction() const
627{
628 Q_D(const Viewer);
629 return d->mResetMessageDisplayFormat;
630}
631
632QAction *Viewer::developmentToolsAction() const
633{
634 Q_D(const Viewer);
635 return d->mDevelopmentToolsAction;
636}
637
638KToggleAction *Viewer::disableEmoticonAction() const
639{
640 Q_D(const Viewer);
641 return d->mDisableEmoticonAction;
642}
643
644void Viewer::saveMainFrameScreenshotInFile(const QString &filename)
645{
646 Q_D(Viewer);
647 d->saveMainFrameScreenshotInFile(filename);
648}
649
650KActionMenu *Viewer::shareServiceUrlMenu() const
651{
652 Q_D(const Viewer);
653 return d->mShareServiceUrlMenu;
654}
655
656HeaderStylePlugin *Viewer::headerStylePlugin() const
657{
658 Q_D(const Viewer);
659 return d->mHeaderStylePlugin;
660}
661
662DKIMViewerMenu *Viewer::dkimViewerMenu()
663{
664 Q_D(Viewer);
665 return d->dkimViewerMenu();
666}
667
668RemoteContentMenu *Viewer::remoteContentMenu() const
669{
670 Q_D(const Viewer);
671 return d->remoteContentMenu();
672}
673
674void Viewer::showMdnInformations(const QPair<QString, bool> &mdnInfo)
675{
676 Q_D(Viewer);
677 d->showMdnInformations(mdnInfo);
678}
679
680void Viewer::mdnWarningAnimatedHide()
681{
682 Q_D(Viewer);
683 d->mdnWarningAnimatedHide();
684}
685
686void Viewer::setPluginName(const QString &pluginName)
687{
688 Q_D(Viewer);
689 d->setPluginName(pluginName);
690}
691
692void Viewer::showOpenAttachmentFolderWidget(const QList<QUrl> &urls)
693{
694 Q_D(Viewer);
695 d->showSavedFileFolderWidget(urls, MessageViewer::OpenSavedFileFolderWidget::FileType::Attachment);
696}
697
698QList<QAction *> Viewer::viewerPluginActionList(ViewerPluginInterface::SpecificFeatureTypes features)
699{
700 Q_D(Viewer);
701 return d->viewerPluginActionList(features);
702}
703
704QList<QAction *> Viewer::interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const
705{
706 Q_D(const Viewer);
707 return d->interceptorUrlActions(result);
708}
709
710void Viewer::runJavaScript(const QString &code)
711{
712 Q_D(Viewer);
713 d->mViewer->page()->runJavaScript(code, WebEngineViewer::WebEngineManageScript::scriptWordId());
714}
715
716void Viewer::setPrintElementBackground(bool printElementBackground)
717{
718 Q_D(Viewer);
719 d->mViewer->setPrintElementBackground(printElementBackground);
720}
721
722bool Viewer::showSignatureDetails() const
723{
724 Q_D(const Viewer);
725 return d->showSignatureDetails();
726}
727
728void Viewer::setShowSignatureDetails(bool showDetails)
729{
730 Q_D(Viewer);
731 d->setShowSignatureDetails(showDetails);
732}
733
734bool Viewer::showEncryptionDetails() const
735{
736 Q_D(const Viewer);
737 return d->showEncryptionDetails();
738}
739
740void Viewer::hasMultiMessages(bool messages)
741{
742 Q_D(Viewer);
743 d->hasMultiMessages(messages);
744}
745
746void Viewer::updateShowMultiMessagesButton(bool enablePreviousButton, bool enableNextButton)
747{
748 Q_D(Viewer);
749 d->updateShowMultiMessagesButton(enablePreviousButton, enableNextButton);
750}
751
752void Viewer::setShowEncryptionDetails(bool showDetails)
753{
754 Q_D(Viewer);
755 d->setShowEncryptionDetails(showDetails);
756}
757
758qreal Viewer::webViewZoomFactor() const
759{
760 Q_D(const Viewer);
761 return d->webViewZoomFactor();
762}
763
764void Viewer::setWebViewZoomFactor(qreal factor)
765{
766 Q_D(Viewer);
767 d->setWebViewZoomFactor(factor);
768}
769
770MessageViewer::DKIMWidgetInfo *Viewer::dkimWidgetInfo()
771{
772 Q_D(Viewer);
773 return d->mDkimWidgetInfo;
774}
775
776void Viewer::exportToPdf(const QString &fileName)
777{
778 Q_D(Viewer);
779 d->exportToPdf(fileName);
780}
781
782void Viewer::showDevelopmentTools()
783{
784 Q_D(Viewer);
785 d->slotShowDevelopmentTools();
786}
787
788void Viewer::setIdentityManager(KIdentityManagementCore::IdentityManager *ident)
789{
790 Q_D(Viewer);
791 d->setIdentityManager(ident);
792}
793
794void Viewer::setFolderIdentity(uint folderIdentity)
795{
796 Q_D(Viewer);
797 d->setFolderIdentity(folderIdentity);
798}
799
800}
801
802#include "moc_viewer.cpp"
bool isValid() const
QSet< QByteArray > loadedPayloadParts() const
void result(KJob *job)
An interface to plug in a handler that is called when an message item has been loaded into the view.
Definition viewer.h:67
The DKIMWidgetInfo class.
This is the main widget for the viewer.
Definition viewer.h:97
QAbstractItemModel * messageTreeModel() const
A QAIM tree model of the message structure.
Definition viewer.cpp:520
void deleteMessage()
Initiates a delete, by sending a signal to delete the message item.
Definition viewer.cpp:557
void showReader(KMime::Content *aMsgPart, bool aHTML, const QString &encoding)
Emitted when the content should be shown in a separate window.
void itemRemoved()
Emitted when the item, previously set with setMessageItem, has been removed.
void closeEvent(QCloseEvent *) override
Some necessary event handling.
Definition viewer.cpp:199
QString messagePath() const
The path to the message in terms of Akonadi collection hierarchy.
Definition viewer.cpp:139
void print()
Print the currently displayed message.
Definition viewer.cpp:181
void showMessage(const KMime::Message::Ptr &message, const QString &encoding)
Emitted when the message should be shown in a separate window.
bool event(QEvent *e) override
Watch for palette changes.
Definition viewer.cpp:344
Viewer::DisplayFormatMessage displayFormatMessageOverwrite() const
Get the html override setting.
Definition viewer.cpp:266
void setHtmlLoadExtDefault(bool loadExtDefault)
Default behavior for loading external references.
Definition viewer.cpp:278
void setMessageItem(const Akonadi::Item &item, MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Set the Akonadi item that will be displayed.
Definition viewer.cpp:122
bool htmlMail() const
Is html mail to be supported? Takes into account override.
Definition viewer.cpp:296
void showStatusBarMessage(const QString &message)
Emitted when a status bar message is shown.
void printMessage(const Akonadi::Item &msg)
Sets a message as the current one and print it immediately.
Definition viewer.cpp:163
Akonadi::ItemFetchJob * createFetchJob(const Akonadi::Item &item)
Create an item fetch job that is suitable for using to fetch the message item that will be displayed ...
Definition viewer.cpp:525
void setMessagePart(KMime::Content *aMsgPart)
Instead of settings a message to be shown sets a message part to be shown.
Definition viewer.cpp:497
bool htmlLoadExtOverride() const
Get the load external references override setting.
Definition viewer.cpp:290
void setMessage(const KMime::Message::Ptr &message, MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Set the message that shall be shown.
Definition viewer.cpp:113
void popupMenu(const Akonadi::Item &msg, const QUrl &url, const QUrl &imageUrl, const QPoint &mousePos)
The user presses the right mouse button.
bool htmlLoadExternal() const
Is loading ext.
Definition viewer.cpp:302
void displaySplashPage(const QString &templateName, const QVariantHash &data, const QByteArray &domain=QByteArray())
Display a generic HTML splash page instead of a message.
Definition viewer.cpp:151
void setHtmlLoadExtOverride(bool loadExtOverride)
Override default load external references setting.
Definition viewer.cpp:284
void atBottom()
Returns true if the message view is scrolled to the bottom.
Definition viewer.cpp:236
void slotScrollUp()
HTML Widget scrollbar and layout handling.
Definition viewer.cpp:224
void setDisplayFormatMessageOverwrite(Viewer::DisplayFormatMessage format)
Override default html mail setting.
Definition viewer.cpp:272
void addMessageLoadedHandler(AbstractMessageLoadedHandler *handler)
Adds a handler for actions that will be executed when the message has been loaded into the view.
Definition viewer.cpp:538
void enableMessageDisplay()
Enable the displaying of messages again after an splash (or other) page was displayed.
Definition viewer.cpp:157
void removeMessageLoadedHandler(AbstractMessageLoadedHandler *handler)
Removes the handler for actions that will be executed when the message has been loaded into the view.
Definition viewer.cpp:550
Viewer(QWidget *parent, QWidget *widget=nullptr, KActionCollection *actionCollection=nullptr)
Create a mail viewer widget.
Definition viewer.cpp:63
void setMessagePath(const QString &path)
Set the path to the message in terms of Akonadi collection hierarchy.
Definition viewer.cpp:145
void clear(MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Convenience method to clear the reader and discard the current message.
Definition viewer.cpp:503
KMime::Message::Ptr message() const
Returns the current message displayed in the viewer.
Definition viewer.cpp:332
Akonadi::Item messageItem() const
Returns the current message item displayed in the viewer.
Definition viewer.cpp:338
void setDecryptMessageOverwrite(bool overwrite=true)
Enforce message decryption.
Definition viewer.cpp:326
The WebHitTestResult class.
QString i18n(const char *text, const TYPE &arg...)
AKONADI_MIME_EXPORT const char Body[]
void accept()
QEvent::Type type() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
T qobject_cast(QObject *object)
virtual void changeEvent(QEvent *event)
virtual void closeEvent(QCloseEvent *event)
virtual bool event(QEvent *event) override
void update()
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.