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
17namespace MessageCore
18{
19class AutocryptRecipientPrivate;
20class AutocryptStorage;
21class HeaderMixupNodeHelper;
22
23class MESSAGECORE_EXPORT AutocryptRecipient
24{
25public:
27 AutocryptRecipient();
28 ~AutocryptRecipient();
29 void updateFromMessage(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
30 void updateFromGossip(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
31
32 [[nodiscard]] QByteArray toJson(QJsonDocument::JsonFormat format) const;
33 void fromJson(const QByteArray &json);
34
35 [[nodiscard]] bool hasChanged() const;
36 void setChangedFlag(bool changed);
37
38 [[nodiscard]] QByteArray addr() const;
39 [[nodiscard]] QByteArray bad_user_agent() const;
40
41 [[nodiscard]] QDateTime last_seen() const;
42 [[nodiscard]] QDateTime autocrypt_timestamp() const;
43 [[nodiscard]] QDateTime counting_since() const;
44 [[nodiscard]] QDateTime gossip_timestamp() const;
45
46 [[nodiscard]] int count_have_ach() const;
47 [[nodiscard]] int count_no_ach() const;
48
49 [[nodiscard]] bool prefer_encrypt() const;
50
51 [[nodiscard]] GpgME::Key gpgKey() const;
52 [[nodiscard]] QByteArray gpgKeydata() const;
53
54 [[nodiscard]] GpgME::Key gossipKey() const;
55 [[nodiscard]] QByteArray gossipKeydata() const;
56
57private:
58 std::unique_ptr<AutocryptRecipientPrivate> d_ptr;
59 Q_DECLARE_PRIVATE(AutocryptRecipient)
60
61 friend class AutocryptStorage;
62};
63}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.