Messagelib
7 #include "draftstatus.h"
9 #include <MessageCore/AutocryptUtils>
15 DraftEncryptionState(msg).removeState();
16 DraftSignatureState(msg).removeState();
17 DraftCryptoMessageFormatState(msg).removeState();
25 void DraftEncryptionState::setState(
bool encrypt)
28 hdr->fromUnicodeString(encrypt ? QStringLiteral(
"true") : QStringLiteral(
"false"),
"utf-8");
32 void DraftEncryptionState::removeState()
34 mMsg->removeHeader(
"X-KMail-EncryptActionEnabled");
37 bool DraftEncryptionState::encryptionState()
const
40 auto hdr = mMsg->headerByType(
"X-KMail-EncryptActionEnabled");
41 return hdr->as7BitString(
false).contains(
"true");
47 bool DraftEncryptionState::isDefined()
const
49 return mMsg->hasHeader(
"X-KMail-EncryptActionEnabled");
57 void DraftSignatureState::setState(
bool sign)
60 hdr->fromUnicodeString(sign ? QStringLiteral(
"true") : QStringLiteral(
"false"),
"utf-8");
64 void DraftSignatureState::removeState()
66 mMsg->removeHeader(
"X-KMail-SignatureActionEnabled");
69 bool DraftSignatureState::signState()
const
72 auto hdr = mMsg->headerByType(
"X-KMail-SignatureActionEnabled");
73 return hdr->as7BitString(
false).contains(
"true");
79 bool DraftSignatureState::isDefined()
const
81 return mMsg->hasHeader(
"X-KMail-SignatureActionEnabled");
84 DraftCryptoMessageFormatState::DraftCryptoMessageFormatState(
const KMime::Message::Ptr &msg)
89 void DraftCryptoMessageFormatState::setState(Kleo::CryptoMessageFormat cryptoMessageFormat)
96 void DraftCryptoMessageFormatState::removeState()
98 mMsg->removeHeader(
"X-KMail-CryptoMessageFormat");
101 Kleo::CryptoMessageFormat DraftCryptoMessageFormatState::cryptoMessageFormatState()
const
104 auto hdr = mMsg->headerByType(
"X-KMail-CryptoMessageFormat");
105 return static_cast<Kleo::CryptoMessageFormat
>(hdr->asUnicodeString().toInt());
108 return Kleo::AutoFormat;
111 bool DraftCryptoMessageFormatState::isDefined()
const
113 return mMsg->hasHeader(
"X-KMail-CryptoMessageFormat");
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QString number(int n, int base)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:01:56 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.