Messagelib

autocryptrecipient.h
1 /*
2  SPDX-FileCopyrightText: 2020 Sandro KnauƟ <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "messagecore_export.h"
10 
11 #include <KMime/Headers>
12 
13 #include <gpgme++/data.h>
14 
15 #include <QJsonDocument>
16 
17 namespace MessageCore
18 {
19 class AutocryptRecipientPrivate;
20 class AutocryptStorage;
21 class HeaderMixupNodeHelper;
22 
23 class MESSAGECORE_EXPORT AutocryptRecipient
24 {
25 public:
27  AutocryptRecipient();
28  void updateFromMessage(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
29  void updateFromGossip(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
30 
31  Q_REQUIRED_RESULT QByteArray toJson(QJsonDocument::JsonFormat format) const;
32  void fromJson(const QByteArray &json);
33 
34  Q_REQUIRED_RESULT bool hasChanged() const;
35  void setChangedFlag(bool changed);
36 
37  Q_REQUIRED_RESULT QByteArray addr() const;
38  Q_REQUIRED_RESULT QByteArray bad_user_agent() const;
39 
40  Q_REQUIRED_RESULT QDateTime last_seen() const;
41  Q_REQUIRED_RESULT QDateTime autocrypt_timestamp() const;
42  Q_REQUIRED_RESULT QDateTime counting_since() const;
43  Q_REQUIRED_RESULT QDateTime gossip_timestamp() const;
44 
45  Q_REQUIRED_RESULT int count_have_ach() const;
46  Q_REQUIRED_RESULT int count_no_ach() const;
47 
48  Q_REQUIRED_RESULT bool prefer_encrypt() const;
49 
50  Q_REQUIRED_RESULT GpgME::Key gpgKey() const;
51  Q_REQUIRED_RESULT QByteArray gpgKeydata() const;
52 
53  Q_REQUIRED_RESULT GpgME::Key gossipKey() const;
54  Q_REQUIRED_RESULT QByteArray gossipKeydata() const;
55 
56 private:
57  std::unique_ptr<AutocryptRecipientPrivate> d_ptr;
58  Q_DECLARE_PRIVATE(AutocryptRecipient)
59 
60  friend class AutocryptStorage;
61 };
62 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.