diff --git a/messageviewer/src/viewer/objecttreeemptysource.h b/messageviewer/src/viewer/objecttreeemptysource.h index cfd0d1fc..66641c5e 100644 --- a/messageviewer/src/viewer/objecttreeemptysource.h +++ b/messageviewer/src/viewer/objecttreeemptysource.h @@ -1,69 +1,69 @@ /* Copyright (C) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net Copyright (c) 2009 Andras Mantia This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAILVIEWER_OBJECTTREEEMPTYSOURCE_H #define MAILVIEWER_OBJECTTREEEMPTYSOURCE_H #include #include "messageviewer_export.h" class QString; namespace MessageViewer { class AttachmentStrategy; class CSSHelperBase; class HtmlWriter; /** An ObjectTreeSource that does not work on anything */ class EmptySourcePrivate; /** * @brief The EmptySource class */ class MESSAGEVIEWER_EXPORT EmptySource : public MimeTreeParser::Interface::ObjectTreeSource { public: EmptySource(); ~EmptySource() override; - bool decryptMessage() const override; + Q_REQUIRED_RESULT bool decryptMessage() const override; void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList &availableModes) override; - MimeTreeParser::Util::HtmlMode preferredMode() const override; + Q_REQUIRED_RESULT MimeTreeParser::Util::HtmlMode preferredMode() const override; void setAllowDecryption(bool allowDecryption); const QTextCodec *overrideCodec() override; virtual QString createMessageHeader(KMime::Message *message); - bool autoImportKeys() const override; + Q_REQUIRED_RESULT bool autoImportKeys() const override; const MimeTreeParser::BodyPartFormatterFactory *bodyPartFormatterFactory() override; void render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart); virtual const AttachmentStrategy *attachmentStrategy() const; virtual HtmlWriter *htmlWriter() const; virtual CSSHelperBase *cssHelper() const; /** Return true if external sources should be loaded in a html mail */ virtual bool htmlLoadExternal() const; virtual bool showSignatureDetails() const; virtual bool showEncryptionDetails() const; virtual bool showEmoticons() const; virtual bool showExpandQuotesMark() const; virtual bool isPrinting() const; virtual int levelQuote() const; private: EmptySourcePrivate *const d; }; } #endif diff --git a/messageviewer/src/viewer/urlhandlermanager_p.h b/messageviewer/src/viewer/urlhandlermanager_p.h index 3ddf8851..de02be13 100644 --- a/messageviewer/src/viewer/urlhandlermanager_p.h +++ b/messageviewer/src/viewer/urlhandlermanager_p.h @@ -1,301 +1,301 @@ /* Copyright (C) 2017 Sandro Knauß This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MESSAGEVIEWER_URLHANDLERMANAGER_P_H #define MESSAGEVIEWER_URLHANDLERMANAGER_P_H #include "urlhandlermanager.h" #include #include namespace KMime { class Content; } namespace MessageViewer { class MESSAGEVIEWER_TESTS_EXPORT BodyPartURLHandlerManager : public MimeTreeParser::URLHandler { public: BodyPartURLHandlerManager() : MimeTreeParser::URLHandler() { } ~BodyPartURLHandlerManager() override; - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; void registerHandler(const Interface::BodyPartURLHandler *handler, const QString &mimeType); void unregisterHandler(const Interface::BodyPartURLHandler *handler); private: QVector handlersForPart(KMime::Content *node) const; typedef QHash > BodyPartHandlerList; BodyPartHandlerList mHandlers; }; class MESSAGEVIEWER_TESTS_EXPORT KMailProtocolURLHandler : public MimeTreeParser::URLHandler { public: KMailProtocolURLHandler() : MimeTreeParser::URLHandler() { } ~KMailProtocolURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &url, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &url, const QPoint &, ViewerPrivate *) const override { return url.scheme() == QLatin1String("kmail"); } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; }; class MESSAGEVIEWER_TESTS_EXPORT ExpandCollapseQuoteURLManager : public MimeTreeParser::URLHandler { public: ExpandCollapseQuoteURLManager() : MimeTreeParser::URLHandler() { } ~ExpandCollapseQuoteURLManager() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; }; class MESSAGEVIEWER_TESTS_EXPORT SMimeURLHandler : public MimeTreeParser::URLHandler { public: SMimeURLHandler() : MimeTreeParser::URLHandler() { } ~SMimeURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; }; class MESSAGEVIEWER_TESTS_EXPORT MailToURLHandler : public MimeTreeParser::URLHandler { public: MailToURLHandler() : MimeTreeParser::URLHandler() { } ~MailToURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override { return false; } - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; }; class MESSAGEVIEWER_TESTS_EXPORT ContactUidURLHandler : public MimeTreeParser::URLHandler { public: ContactUidURLHandler() : MimeTreeParser::URLHandler() { } ~ContactUidURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ViewerPrivate *) const override; - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; }; class MESSAGEVIEWER_TESTS_EXPORT HtmlAnchorHandler : public MimeTreeParser::URLHandler { public: HtmlAnchorHandler() : MimeTreeParser::URLHandler() { } ~HtmlAnchorHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override { return QString(); } }; class MESSAGEVIEWER_TESTS_EXPORT AttachmentURLHandler : public MimeTreeParser::URLHandler { public: AttachmentURLHandler() : MimeTreeParser::URLHandler() { } ~AttachmentURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleShiftClick(const QUrl &, ViewerPrivate *window) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; - bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleShiftClick(const QUrl &, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; private: KMime::Content *nodeForUrl(const QUrl &url, ViewerPrivate *w) const; bool attachmentIsInHeader(const QUrl &url) const; }; class MESSAGEVIEWER_TESTS_EXPORT ShowAuditLogURLHandler : public MimeTreeParser::URLHandler { public: ShowAuditLogURLHandler() : MimeTreeParser::URLHandler() { } ~ShowAuditLogURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; - bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; }; // Handler that prevents dragging of internal images added by KMail, such as the envelope image // in the enterprise header class MESSAGEVIEWER_TESTS_EXPORT InternalImageURLHandler : public MimeTreeParser::URLHandler { public: InternalImageURLHandler() : MimeTreeParser::URLHandler() { } ~InternalImageURLHandler() override { } - bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool handleClick(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override { return false; } - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override { return QString(); } }; class MESSAGEVIEWER_TESTS_EXPORT EmbeddedImageURLHandler : public MimeTreeParser::URLHandler { public: EmbeddedImageURLHandler() : MimeTreeParser::URLHandler() { } ~EmbeddedImageURLHandler() override { } - bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; - bool handleClick(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool willHandleDrag(const QUrl &url, ViewerPrivate *window) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override { return false; } - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &url, ViewerPrivate *) const override + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &url, ViewerPrivate *) const override { Q_UNUSED(url); return QString(); } }; class MESSAGEVIEWER_TESTS_EXPORT KRunURLHandler : public MimeTreeParser::URLHandler { public: KRunURLHandler() : MimeTreeParser::URLHandler() { } ~KRunURLHandler() override { } - bool handleClick(const QUrl &, ViewerPrivate *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ViewerPrivate *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ViewerPrivate *) const override { return false; } - QString statusBarMessage(const QUrl &, ViewerPrivate *) const override + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ViewerPrivate *) const override { return QString(); } }; } #endif // MESSAGEVIEWER_URLHANDLERMANAGER_P_H