From ae20f0a057f4740e3eedb1641d99c37601ad0b7f Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 26 Apr 2018 16:43:00 +0200 Subject: No more direct GpgMe usage in the interfaces. --- framework/src/domain/mime/mailcrypto.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'framework/src/domain/mime/mailcrypto.h') diff --git a/framework/src/domain/mime/mailcrypto.h b/framework/src/domain/mime/mailcrypto.h index 9e317b43..c9247859 100644 --- a/framework/src/domain/mime/mailcrypto.h +++ b/framework/src/domain/mime/mailcrypto.h @@ -25,19 +25,28 @@ #include #include +#include #include #include namespace MailCrypto { -Expected> -processCrypto(std::unique_ptr content, const std::vector &signingKeys, - const std::vector &encryptionKeys, const GpgME::Key &attachedKey); +struct Key { + GpgME::Key key; +}; + +struct Error { + GpgME::Error key; +}; -std::vector findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); +Expected> +processCrypto(std::unique_ptr content, const std::vector &signingKeys, + const std::vector &encryptionKeys, const Key &attachedKey); -void importKeys(const std::vector &keys); +std::vector findKeys(const QStringList &filter, bool findPrivate = false, bool remote = false); + +void importKeys(const std::vector &keys); struct ImportResult { int considered; @@ -48,3 +57,7 @@ struct ImportResult { ImportResult importKey(const QByteArray &key); }; // namespace MailCrypto + +Q_DECLARE_METATYPE(MailCrypto::Key); + +QDebug operator<< (QDebug d, const MailCrypto::Key &); -- cgit v1.2.3