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 qGuiApp->installEventFilter(this);
97 slotGeneralPaletteChanged();
98}
99
100bool Viewer::eventFilter(QObject *obj, QEvent *event)
101{
102 Q_UNUSED(obj);
104 slotGeneralPaletteChanged();
105 }
106 return false;
107}
108
109void Viewer::slotGeneralPaletteChanged()
110{
111 Q_D(Viewer);
112 d->updatePalette();
113}
114
115void Viewer::changeEvent(QEvent *event)
116{
117 Q_D(Viewer);
118 if (event->type() == QEvent::FontChange) {
119 d->slotGeneralFontChanged();
120 }
122}
123
124void Viewer::setMessage(const KMime::Message::Ptr &message, MimeTreeParser::UpdateMode updateMode)
125{
126 Q_D(Viewer);
127 if (message == d->message()) {
128 return;
129 }
130 d->setMessage(message, updateMode);
131}
132
133void Viewer::setMessageItem(const Akonadi::Item &item, MimeTreeParser::UpdateMode updateMode)
134{
135 Q_D(Viewer);
136 if (d->messageItem() == item) {
137 return;
138 }
139 if (!item.isValid() || item.loadedPayloadParts().contains(Akonadi::MessagePart::Body)) {
140 d->setMessageItem(item, updateMode);
141 } else {
143 connect(job, &Akonadi::ItemFetchJob::result, this, [d](KJob *job) {
144 d->itemFetchResult(job);
145 });
146 d->displaySplashPage(i18n("Loading message..."));
147 }
148}
149
151{
152 Q_D(const Viewer);
153 return d->mMessagePath;
154}
155
157{
158 Q_D(Viewer);
159 d->mMessagePath = path;
160}
161
162void Viewer::displaySplashPage(const QString &templateName, const QVariantHash &data, const QByteArray &domain)
163{
164 Q_D(Viewer);
165 d->displaySplashPage(templateName, data, domain);
166}
167
169{
170 Q_D(Viewer);
171 d->enableMessageDisplay();
172}
173
175{
176 Q_D(Viewer);
177 d->printMessage(msg);
178}
179
180void Viewer::printPreviewMessage(const Akonadi::Item &message)
181{
182 Q_D(Viewer);
183 d->printPreviewMessage(message);
184}
185
186void Viewer::printPreview()
187{
188 Q_D(Viewer);
189 d->slotPrintPreview();
190}
191
193{
194 Q_D(Viewer);
195 d->slotPrintMessage();
196}
197
198void Viewer::resizeEvent(QResizeEvent *)
199{
200 Q_D(Viewer);
201 if (!d->mResizeTimer.isActive()) {
202 //
203 // Combine all resize operations that are requested as long a
204 // the timer runs.
205 //
206 d->mResizeTimer.start(100);
207 }
208}
209
211{
212 Q_D(Viewer);
214 d->writeConfig();
215}
216
217void Viewer::slotAttachmentSaveAs()
218{
219 Q_D(Viewer);
220 d->slotAttachmentSaveAs();
221}
222
223void Viewer::slotAttachmentSaveAll()
224{
225 Q_D(Viewer);
226 d->slotAttachmentSaveAll();
227}
228
229void Viewer::slotSaveMessage()
230{
231 Q_D(Viewer);
232 d->slotSaveMessage();
233}
234
236{
237 Q_D(Viewer);
238 d->mViewer->scrollUp(10);
239}
240
241void Viewer::slotScrollDown()
242{
243 Q_D(Viewer);
244 d->mViewer->scrollDown(10);
245}
246
248{
249 Q_D(const Viewer);
250 d->mViewer->isScrolledToBottom();
251}
252
253void Viewer::slotJumpDown()
254{
255 Q_D(Viewer);
256 d->mViewer->scrollPageDown(100);
257}
258
259void Viewer::slotScrollPrior()
260{
261 Q_D(Viewer);
262 d->mViewer->scrollPageUp(80);
263}
264
265void Viewer::slotScrollNext()
266{
267 Q_D(Viewer);
268 d->mViewer->scrollPageDown(80);
269}
270
271QString Viewer::selectedText() const
272{
273 Q_D(const Viewer);
274 return d->mViewer->selectedText();
275}
276
277Viewer::DisplayFormatMessage Viewer::displayFormatMessageOverwrite() const
278{
279 Q_D(const Viewer);
280 return d->displayFormatMessageOverwrite();
281}
282
283void Viewer::setDisplayFormatMessageOverwrite(Viewer::DisplayFormatMessage format)
284{
285 Q_D(Viewer);
286 d->setDisplayFormatMessageOverwrite(format);
287}
288
289void Viewer::setHtmlLoadExtDefault(bool loadExtDefault)
290{
291 Q_D(Viewer);
292 d->setHtmlLoadExtDefault(loadExtDefault);
293}
294
295void Viewer::setHtmlLoadExtOverride(bool loadExtOverride)
296{
297 Q_D(Viewer);
298 d->setHtmlLoadExtOverride(loadExtOverride);
299}
300
302{
303 Q_D(const Viewer);
304 return d->htmlLoadExtOverride();
305}
306
308{
309 Q_D(const Viewer);
310 return d->htmlMail();
311}
312
314{
315 Q_D(const Viewer);
316 return d->htmlLoadExternal();
317}
318
319bool Viewer::isFixedFont() const
320{
321 Q_D(const Viewer);
322 return d->mHtmlHeadSettings.fixedFont;
323}
324
325void Viewer::setUseFixedFont(bool useFixedFont)
326{
327 Q_D(Viewer);
328 d->setUseFixedFont(useFixedFont);
329}
330
331QWidget *Viewer::mainWindow()
332{
333 Q_D(Viewer);
334 return d->mMainWindow;
335}
336
338{
339 Q_D(Viewer);
340 d->setDecryptMessageOverwrite(overwrite);
341}
342
344{
345 Q_D(const Viewer);
346 return d->mMessage;
347}
348
350{
351 Q_D(const Viewer);
352 return d->mMessageItem;
353}
354
356{
357 Q_D(Viewer);
358 if (e->type() == QEvent::PaletteChange) {
359 d->recreateCssHelper();
360 d->update(MimeTreeParser::Force);
361 e->accept();
362 return true;
363 }
364
365 return QWidget::event(e);
366}
367
368void Viewer::slotFind()
369{
370 Q_D(Viewer);
371 d->slotFind();
372}
373
374const AttachmentStrategy *Viewer::attachmentStrategy() const
375{
376 Q_D(const Viewer);
377 return d->attachmentStrategy();
378}
379
380void Viewer::setAttachmentStrategy(const AttachmentStrategy *strategy)
381{
382 Q_D(Viewer);
383 d->setAttachmentStrategy(strategy);
384}
385
386QString Viewer::overrideEncoding() const
387{
388 Q_D(const Viewer);
389 return d->overrideEncoding();
390}
391
392void Viewer::setOverrideEncoding(const QString &encoding)
393{
394 Q_D(Viewer);
395 d->setOverrideEncoding(encoding);
396}
397
398CSSHelper *Viewer::cssHelper() const
399{
400 Q_D(const Viewer);
401 return d->cssHelper();
402}
403
404KToggleAction *Viewer::toggleFixFontAction() const
405{
406 Q_D(const Viewer);
407 return d->mToggleFixFontAction;
408}
409
410bool Viewer::mimePartTreeIsEmpty() const
411{
412 Q_D(const Viewer);
413 return d->mimePartTreeIsEmpty();
414}
415
416KToggleAction *Viewer::toggleMimePartTreeAction() const
417{
418 Q_D(const Viewer);
419 return d->mToggleMimePartTreeAction;
420}
421
422QAction *Viewer::selectAllAction() const
423{
424 Q_D(const Viewer);
425 return d->mSelectAllAction;
426}
427
428QAction *Viewer::viewSourceAction() const
429{
430 Q_D(const Viewer);
431 return d->mViewSourceAction;
432}
433
434QAction *Viewer::copyURLAction() const
435{
436 Q_D(const Viewer);
437 return d->mCopyURLAction;
438}
439
440QAction *Viewer::copyAction() const
441{
442 Q_D(const Viewer);
443 return d->mCopyAction;
444}
445
446QAction *Viewer::speakTextAction() const
447{
448 Q_D(const Viewer);
449 return d->mSpeakTextAction;
450}
451
452QAction *Viewer::copyImageLocation() const
453{
454 Q_D(const Viewer);
455 return d->mCopyImageLocation;
456}
457
458QAction *Viewer::saveAsAction() const
459{
460 Q_D(const Viewer);
461 return d->mSaveMessageAction;
462}
463
464QAction *Viewer::urlOpenAction() const
465{
466 Q_D(const Viewer);
467 return d->mUrlOpenAction;
468}
469
470bool Viewer::printingMode() const
471{
472 Q_D(const Viewer);
473 return d->printingMode();
474}
475
476void Viewer::setPrinting(bool enable)
477{
478 Q_D(Viewer);
479 d->setPrinting(enable);
480}
481
482void Viewer::writeConfig(bool force)
483{
484 Q_D(Viewer);
485 d->writeConfig(force);
486}
487
488QUrl Viewer::urlClicked() const
489{
490 Q_D(const Viewer);
491 return d->mClickedUrl;
492}
493
494QUrl Viewer::imageUrlClicked() const
495{
496 Q_D(const Viewer);
497 return d->imageUrl();
498}
499
500void Viewer::update(MimeTreeParser::UpdateMode updateMode)
501{
502 Q_D(Viewer);
503 d->update(updateMode);
504}
505
507{
508 Q_D(Viewer);
509 d->setMessagePart(aMsgPart);
510}
511
512void Viewer::clear(MimeTreeParser::UpdateMode updateMode)
513{
514 setMessage(KMime::Message::Ptr(), updateMode);
515}
516
517void Viewer::slotShowMessageSource()
518{
519 Q_D(Viewer);
520 d->slotShowMessageSource();
521}
522
523void Viewer::readConfig()
524{
525 Q_D(Viewer);
526 d->readConfig();
527}
528
530{
531 return d_func()->mMimePartTree->mimePartModel();
532}
533
535{
536 Q_D(Viewer);
537 auto job = new Akonadi::ItemFetchJob(item, d->mSession);
538 job->fetchScope().fetchAllAttributes();
539 job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent);
540 job->fetchScope().fetchFullPayload(true);
541 job->fetchScope().fetchAttribute<Akonadi::ErrorAttribute>();
542 job->fetchScope().fetchAttribute<Akonadi::MDNStateAttribute>();
543 return job;
544}
545
547{
548 Q_D(Viewer);
549
550 if (!handler) {
551 return;
552 }
553
554 handler->setSession(d->mSession);
555 d->mMessageLoadedHandlers.insert(handler);
556}
557
559{
560 Q_D(Viewer);
561
562 d->mMessageLoadedHandlers.remove(handler);
563}
564
566{
567 Q_D(Viewer);
568 Q_EMIT deleteMessage(d->messageItem());
569}
570
571void Viewer::selectAll()
572{
573 Q_D(Viewer);
574 d->selectAll();
575}
576
577void Viewer::copySelectionToClipboard()
578{
579 Q_D(Viewer);
580 d->slotCopySelectedText();
581}
582
583void Viewer::setZoomFactor(qreal zoomFactor)
584{
585 Q_D(Viewer);
586 d->mZoomActionMenu->setZoomFactor(zoomFactor);
587}
588
589void Viewer::slotZoomReset()
590{
591 Q_D(Viewer);
592 d->mZoomActionMenu->slotZoomReset();
593}
594
595void Viewer::slotZoomIn()
596{
597 Q_D(Viewer);
598 d->mZoomActionMenu->slotZoomIn();
599}
600
601void Viewer::slotZoomOut()
602{
603 Q_D(Viewer);
604 d->mZoomActionMenu->slotZoomOut();
605}
606
607QAction *Viewer::findInMessageAction() const
608{
609 Q_D(const Viewer);
610 return d->mFindInMessageAction;
611}
612
613QAction *Viewer::shareTextAction() const
614{
615 Q_D(const Viewer);
616 return d->mShareTextAction;
617}
618
619void Viewer::slotChangeDisplayMail(Viewer::DisplayFormatMessage mode, bool loadExternal)
620{
621 if ((htmlLoadExtOverride() != loadExternal) || (displayFormatMessageOverwrite() != mode)) {
622 setHtmlLoadExtOverride(loadExternal);
624 update(MimeTreeParser::Force);
625 }
626}
627
628QAction *Viewer::saveMessageDisplayFormatAction() const
629{
630 Q_D(const Viewer);
631 return d->mSaveMessageDisplayFormat;
632}
633
634QAction *Viewer::resetMessageDisplayFormatAction() const
635{
636 Q_D(const Viewer);
637 return d->mResetMessageDisplayFormat;
638}
639
640QAction *Viewer::developmentToolsAction() const
641{
642 Q_D(const Viewer);
643 return d->mDevelopmentToolsAction;
644}
645
646KToggleAction *Viewer::disableEmoticonAction() const
647{
648 Q_D(const Viewer);
649 return d->mDisableEmoticonAction;
650}
651
652void Viewer::saveMainFrameScreenshotInFile(const QString &filename)
653{
654 Q_D(Viewer);
655 d->saveMainFrameScreenshotInFile(filename);
656}
657
658KActionMenu *Viewer::shareServiceUrlMenu() const
659{
660 Q_D(const Viewer);
661 return d->mShareServiceUrlMenu;
662}
663
664HeaderStylePlugin *Viewer::headerStylePlugin() const
665{
666 Q_D(const Viewer);
667 return d->mHeaderStylePlugin;
668}
669
670DKIMViewerMenu *Viewer::dkimViewerMenu()
671{
672 Q_D(Viewer);
673 return d->dkimViewerMenu();
674}
675
676RemoteContentMenu *Viewer::remoteContentMenu() const
677{
678 Q_D(const Viewer);
679 return d->remoteContentMenu();
680}
681
682void Viewer::showMdnInformations(const QPair<QString, bool> &mdnInfo)
683{
684 Q_D(Viewer);
685 d->showMdnInformations(mdnInfo);
686}
687
688void Viewer::mdnWarningAnimatedHide()
689{
690 Q_D(Viewer);
691 d->mdnWarningAnimatedHide();
692}
693
694void Viewer::setPluginName(const QString &pluginName)
695{
696 Q_D(Viewer);
697 d->setPluginName(pluginName);
698}
699
700void Viewer::showOpenAttachmentFolderWidget(const QList<QUrl> &urls)
701{
702 Q_D(Viewer);
703 d->showSavedFileFolderWidget(urls, MessageViewer::OpenSavedFileFolderWidget::FileType::Attachment);
704}
705
706QList<QAction *> Viewer::viewerPluginActionList(ViewerPluginInterface::SpecificFeatureTypes features)
707{
708 Q_D(Viewer);
709 return d->viewerPluginActionList(features);
710}
711
712QList<QAction *> Viewer::interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const
713{
714 Q_D(const Viewer);
715 return d->interceptorUrlActions(result);
716}
717
718void Viewer::runJavaScript(const QString &code)
719{
720 Q_D(Viewer);
721 d->mViewer->page()->runJavaScript(code, WebEngineViewer::WebEngineManageScript::scriptWordId());
722}
723
724void Viewer::setPrintElementBackground(bool printElementBackground)
725{
726 Q_D(Viewer);
727 d->mViewer->setPrintElementBackground(printElementBackground);
728}
729
730bool Viewer::showSignatureDetails() const
731{
732 Q_D(const Viewer);
733 return d->showSignatureDetails();
734}
735
736void Viewer::setShowSignatureDetails(bool showDetails)
737{
738 Q_D(Viewer);
739 d->setShowSignatureDetails(showDetails);
740}
741
742bool Viewer::showEncryptionDetails() const
743{
744 Q_D(const Viewer);
745 return d->showEncryptionDetails();
746}
747
748void Viewer::hasMultiMessages(bool messages)
749{
750 Q_D(Viewer);
751 d->hasMultiMessages(messages);
752}
753
754void Viewer::updateShowMultiMessagesButton(bool enablePreviousButton, bool enableNextButton)
755{
756 Q_D(Viewer);
757 d->updateShowMultiMessagesButton(enablePreviousButton, enableNextButton);
758}
759
760void Viewer::setShowEncryptionDetails(bool showDetails)
761{
762 Q_D(Viewer);
763 d->setShowEncryptionDetails(showDetails);
764}
765
766qreal Viewer::webViewZoomFactor() const
767{
768 Q_D(const Viewer);
769 return d->webViewZoomFactor();
770}
771
772void Viewer::setWebViewZoomFactor(qreal factor)
773{
774 Q_D(Viewer);
775 d->setWebViewZoomFactor(factor);
776}
777
778MessageViewer::DKIMWidgetInfo *Viewer::dkimWidgetInfo()
779{
780 Q_D(Viewer);
781 return d->mDkimWidgetInfo;
782}
783
784void Viewer::exportToPdf(const QString &fileName)
785{
786 Q_D(Viewer);
787 d->exportToPdf(fileName);
788}
789
790void Viewer::showDevelopmentTools()
791{
792 Q_D(Viewer);
793 d->slotShowDevelopmentTools();
794}
795
796void Viewer::setIdentityManager(KIdentityManagementCore::IdentityManager *ident)
797{
798 Q_D(Viewer);
799 d->setIdentityManager(ident);
800}
801
802void Viewer::setFolderIdentity(uint folderIdentity)
803{
804 Q_D(Viewer);
805 d->setFolderIdentity(folderIdentity);
806}
807
808}
809
810#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:529
void deleteMessage()
Initiates a delete, by sending a signal to delete the message item.
Definition viewer.cpp:565
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:210
QString messagePath() const
The path to the message in terms of Akonadi collection hierarchy.
Definition viewer.cpp:150
void print()
Print the currently displayed message.
Definition viewer.cpp:192
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:355
Viewer::DisplayFormatMessage displayFormatMessageOverwrite() const
Get the html override setting.
Definition viewer.cpp:277
void setHtmlLoadExtDefault(bool loadExtDefault)
Default behavior for loading external references.
Definition viewer.cpp:289
void setMessageItem(const Akonadi::Item &item, MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Set the Akonadi item that will be displayed.
Definition viewer.cpp:133
bool htmlMail() const
Is html mail to be supported? Takes into account override.
Definition viewer.cpp:307
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:174
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:534
void setMessagePart(KMime::Content *aMsgPart)
Instead of settings a message to be shown sets a message part to be shown.
Definition viewer.cpp:506
bool htmlLoadExtOverride() const
Get the load external references override setting.
Definition viewer.cpp:301
void setMessage(const KMime::Message::Ptr &message, MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Set the message that shall be shown.
Definition viewer.cpp:124
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:313
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:162
void setHtmlLoadExtOverride(bool loadExtOverride)
Override default load external references setting.
Definition viewer.cpp:295
void atBottom()
Returns true if the message view is scrolled to the bottom.
Definition viewer.cpp:247
void slotScrollUp()
HTML Widget scrollbar and layout handling.
Definition viewer.cpp:235
void setDisplayFormatMessageOverwrite(Viewer::DisplayFormatMessage format)
Override default html mail setting.
Definition viewer.cpp:283
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:546
void enableMessageDisplay()
Enable the displaying of messages again after an splash (or other) page was displayed.
Definition viewer.cpp:168
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:558
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:156
void clear(MimeTreeParser::UpdateMode updateMode=MimeTreeParser::Delayed)
Convenience method to clear the reader and discard the current message.
Definition viewer.cpp:512
KMime::Message::Ptr message() const
Returns the current message displayed in the viewer.
Definition viewer.cpp:343
Akonadi::Item messageItem() const
Returns the current message item displayed in the viewer.
Definition viewer.cpp:349
void setDecryptMessageOverwrite(bool overwrite=true)
Enforce message decryption.
Definition viewer.cpp:337
The WebHitTestResult class.
QString i18n(const char *text, const TYPE &arg...)
AKONADI_MIME_EXPORT const char Body[]
ApplicationPaletteChange
void accept()
Type type() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
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 Fri Nov 29 2024 11:50:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.