LeechCraft Azoth  0.6.70-16373-g319c272718
Modular multiprotocol IM plugin for LeechCraft
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 
15 namespace LC
16 {
17 namespace 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 
123 Q_DECLARE_INTERFACE (LC::Azoth::ISupportPGP,
124  "org.Deviant.LeechCraft.Azoth.ISupportPGP/1.0")
virtual ~ISupportPGP()=default
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 QCA::PGPKey GetPrivateKey() const =0
Returns the private key for the account, if any.
virtual void encryptionStateChanged(QObject *entry, bool enabled)=0
Notifies that encryption state has changed for the given entry.
virtual GPGExceptions::MaybeException_t SetEncryptionEnabled(QObject *entry, bool enabled)=0
Enables or disables encryption for the 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.
Interface for accounts supporting PGP encryption.
Definition: isupportpgp.h:27
virtual QCA::PGPKey GetEntryKey(QObject *entry) const =0
Returns the public key for the given entry, if any.
virtual bool IsEncryptionEnabled(QObject *entry) const =0
Checks if the encryption is enabled for the entry.