LeechCraft Azoth 0.6.70-17335-ge406ffdcaf
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
isupportpgp.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QtGlobal>
12#include <QtCrypto>
13#include "gpgexceptions.h"
14
15namespace LC
16{
17namespace Azoth
18{
28 {
29 protected:
30 virtual ~ISupportPGP () = default;
31 public:
36 virtual void SetPrivateKey (const QCA::PGPKey& key) = 0;
37
43 virtual QCA::PGPKey GetPrivateKey () const = 0;
44
50 virtual void SetEntryKey (QObject *entry, const QCA::PGPKey& pubKey) = 0;
51
60 virtual QCA::PGPKey GetEntryKey (QObject *entry) const = 0;
61
72 virtual GPGExceptions::MaybeException_t SetEncryptionEnabled (QObject *entry, bool enabled) = 0;
73
84 virtual bool IsEncryptionEnabled (QObject *entry) const = 0;
85 protected:
101 virtual void signatureVerified (QObject *entry, bool successful) = 0;
102
118 virtual void encryptionStateChanged (QObject *entry, bool enabled) = 0;
119 };
120}
121}
122
123Q_DECLARE_INTERFACE (LC::Azoth::ISupportPGP,
124 "org.Deviant.LeechCraft.Azoth.ISupportPGP/1.0")
Interface for accounts supporting PGP encryption.
Definition isupportpgp.h:28
virtual QCA::PGPKey GetEntryKey(QObject *entry) const =0
Returns the public key for the given entry, if any.
virtual void encryptionStateChanged(QObject *entry, bool enabled)=0
Notifies that encryption state has changed for the given entry.
virtual QCA::PGPKey GetPrivateKey() const =0
Returns the private key for the account, if any.
virtual ~ISupportPGP()=default
virtual GPGExceptions::MaybeException_t SetEncryptionEnabled(QObject *entry, bool enabled)=0
Enables or disables encryption for the entry.
virtual bool IsEncryptionEnabled(QObject *entry) const =0
Checks if the encryption is enabled for the entry.
virtual void SetEntryKey(QObject *entry, const QCA::PGPKey &pubKey)=0
Sets the public key for the given entry.
virtual void signatureVerified(QObject *entry, bool successful)=0
Notifies whether signature has been verified for the given entry.
virtual void SetPrivateKey(const QCA::PGPKey &key)=0
Sets the private key for the account.
std::optional< AnyException_t > MaybeException_t
A type representing a possibility of a GPG-related error.