File indexing completed on 2024-06-23 05:18:29
0001 /* 0002 SPDX-FileCopyrightText: 2021 Sandro Knauß <sknauss@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "messagecomposer_export.h" 0010 #include <KMime/Message> 0011 #include <Libkleo/Enum> 0012 0013 namespace MessageComposer 0014 { 0015 0016 class MESSAGECOMPOSER_EXPORT DraftEncryptionState 0017 { 0018 public: 0019 explicit DraftEncryptionState(const KMime::Message::Ptr &msg); 0020 0021 void setState(bool encrypt); 0022 void removeState(); 0023 0024 [[nodiscard]] bool encryptionState() const; 0025 [[nodiscard]] bool isDefined() const; 0026 0027 private: 0028 KMime::Message::Ptr mMsg; 0029 }; 0030 0031 class MESSAGECOMPOSER_EXPORT DraftSignatureState 0032 { 0033 public: 0034 explicit DraftSignatureState(const KMime::Message::Ptr &msg); 0035 0036 void setState(bool sign); 0037 void removeState(); 0038 0039 [[nodiscard]] bool signState() const; 0040 [[nodiscard]] bool isDefined() const; 0041 0042 private: 0043 KMime::Message::Ptr mMsg; 0044 }; 0045 0046 class MESSAGECOMPOSER_EXPORT DraftCryptoMessageFormatState 0047 { 0048 public: 0049 explicit DraftCryptoMessageFormatState(const KMime::Message::Ptr &msg); 0050 0051 void setState(Kleo::CryptoMessageFormat cryptoMessageFormat); 0052 void removeState(); 0053 0054 [[nodiscard]] Kleo::CryptoMessageFormat cryptoMessageFormatState() const; 0055 [[nodiscard]] bool isDefined() const; 0056 0057 private: 0058 KMime::Message::Ptr mMsg; 0059 }; 0060 0061 void MESSAGECOMPOSER_EXPORT removeDraftCryptoHeaders(const KMime::Message::Ptr &msg); 0062 0063 }