Messagelib

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

KDE's Doxygen guidelines are available online.