File indexing completed on 2024-06-23 05:19:21

0001 /*
0002   SPDX-FileCopyrightText: 2023 Daniel Vrátil <dvratil@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "cryptobodypartmemento.h"
0010 #include <Libkleo/KeyCache>
0011 
0012 #include <QString>
0013 
0014 namespace MimeTreeParser
0015 {
0016 class KeyCacheMemento : public CryptoBodyPartMemento
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit KeyCacheMemento(const std::shared_ptr<Kleo::KeyCache> &keyCache, GpgME::Protocol protocol);
0021     ~KeyCacheMemento() override;
0022 
0023     [[nodiscard]] bool start() override;
0024     void exec() override;
0025 
0026     std::shared_ptr<const Kleo::KeyCache> keyCache() const
0027     {
0028         return m_keyCache;
0029     }
0030 
0031 private Q_SLOTS:
0032     void slotKeyCacheInitialized();
0033 
0034 private:
0035     std::shared_ptr<Kleo::KeyCache> m_keyCache;
0036     const GpgME::Protocol m_protocol;
0037 };
0038 
0039 } // namespace MimeTreeParser