QXmpp  Version: 1.15.1
QXmppTrustMessageElement.h
1 // SPDX-FileCopyrightText: 2021 Melvin Keskin <melvo@olomono.de>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 
5 #ifndef QXMPPTRUSTMESSAGEELEMENT_H
6 #define QXMPPTRUSTMESSAGEELEMENT_H
7 
8 #include "QXmppConstants_p.h"
9 #include "QXmppGlobal.h"
10 
11 #include <QSharedDataPointer>
12 
13 class QDomElement;
14 class QXmlStreamWriter;
15 class QXmppTrustMessageElementPrivate;
17 
18 class QXMPP_EXPORT QXmppTrustMessageElement
19 {
20 public:
25 
26  QXmppTrustMessageElement &operator=(const QXmppTrustMessageElement &other);
28 
29  QString usage() const;
30  void setUsage(const QString &usage);
31 
32  QString encryption() const;
33  void setEncryption(const QString &encryption);
34 
35  QList<QXmppTrustMessageKeyOwner> keyOwners() const;
36  void setKeyOwners(const QList<QXmppTrustMessageKeyOwner> &keyOwners);
37  void addKeyOwner(const QXmppTrustMessageKeyOwner &keyOwner);
38 
40  static constexpr std::tuple XmlTag = { u"trust-message", QXmpp::Private::ns_tm };
41  void parse(const QDomElement &element);
42  void toXml(QXmlStreamWriter *writer) const;
44 
45  static bool isTrustMessageElement(const QDomElement &element);
46 
47 private:
48  QSharedDataPointer<QXmppTrustMessageElementPrivate> d;
49 };
50 
51 Q_DECLARE_TYPEINFO(QXmppTrustMessageElement, Q_MOVABLE_TYPE);
52 
53 #endif // QXMPPTRUSTMESSAGEELEMENT_H
The QXmppTrustMessageKeyOwner class represents a key owner of the trust message as defined by XEP-043...
Definition: QXmppTrustMessageKeyOwner.h:17
The QXmppTrustMessageElement class represents a trust message element as defined by XEP-0434: Trust M...
Definition: QXmppTrustMessageElement.h:18