Messagelib

autocryptrecipient.h
1 /*
2  SPDX-FileCopyrightText: 2020 Sandro KnauƟ <knauss@kde.org>
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  [[nodiscard]] QByteArray toJson(QJsonDocument::JsonFormat format) const;
32  void fromJson(const QByteArray &json);
33 
34  [[nodiscard]] bool hasChanged() const;
35  void setChangedFlag(bool changed);
36 
37  [[nodiscard]] QByteArray addr() const;
38  [[nodiscard]] QByteArray bad_user_agent() const;
39 
40  [[nodiscard]] QDateTime last_seen() const;
41  [[nodiscard]] QDateTime autocrypt_timestamp() const;
42  [[nodiscard]] QDateTime counting_since() const;
43  [[nodiscard]] QDateTime gossip_timestamp() const;
44 
45  [[nodiscard]] int count_have_ach() const;
46  [[nodiscard]] int count_no_ach() const;
47 
48  [[nodiscard]] bool prefer_encrypt() const;
49 
50  [[nodiscard]] GpgME::Key gpgKey() const;
51  [[nodiscard]] QByteArray gpgKeydata() const;
52 
53  [[nodiscard]] GpgME::Key gossipKey() const;
54  [[nodiscard]] 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-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.