File indexing completed on 2025-01-19 04:46:49

0001 /*
0002   SPDX-FileCopyrightText: 2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <MessageViewer/BodyPartURLHandler>
0010 
0011 #include <KMime/Message>
0012 
0013 class GnuPGWKSMessagePart;
0014 
0015 class ApplicationGnuPGWKSUrlHandler : public MessageViewer::Interface::BodyPartURLHandler
0016 {
0017 public:
0018     ApplicationGnuPGWKSUrlHandler() = default;
0019 
0020     QString name() const override;
0021     bool handleClick(MessageViewer::Viewer *viewerInstance, MimeTreeParser::Interface::BodyPart *part, const QString &path) const override;
0022     bool handleContextMenuRequest(MimeTreeParser::Interface::BodyPart *part, const QString &path, const QPoint &p) const override;
0023     QString statusBarMessage(MimeTreeParser::Interface::BodyPart *part, const QString &path) const override;
0024 
0025 private:
0026     bool sendConfirmation(MessageViewer::Viewer *viewerInstance, const GnuPGWKSMessagePart &mp) const;
0027 
0028     [[nodiscard]] QByteArray createConfirmation(const KMime::Message::Ptr &msg) const;
0029 };