QXmpp Version: 1.12.0
Loading...
Searching...
No Matches
QXmppOmemoDeviceElement_p.h
1// SPDX-FileCopyrightText: 2021 Germán Márquez Mejía <mancho@olomono.de>
2// SPDX-FileCopyrightText: 2021 Melvin Keskin <melvo@olomono.de>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPOMEMODEVICEELEMENT_H
7#define QXMPPOMEMODEVICEELEMENT_H
8
9#include "QXmppConstants_p.h"
10#include "QXmppGlobal.h"
11
12class QDomElement;
13class QXmlStreamWriter;
14
15class QXMPP_AUTOTEST_EXPORT QXmppOmemoDeviceElement
16{
17public:
18 bool operator==(const QXmppOmemoDeviceElement &other) const;
19
20 uint32_t id() const;
21 void setId(uint32_t id);
22
23 QString label() const;
24 void setLabel(const QString &label);
25
27 static constexpr std::tuple XmlTag = { u"device", QXmpp::Private::ns_omemo_2 };
28 void parse(const QDomElement &element);
29 void toXml(QXmlStreamWriter *writer) const;
31
32 static bool isOmemoDeviceElement(const QDomElement &element);
33
34private:
35 uint32_t m_id = 0;
36 QString m_label;
37};
38
39Q_DECLARE_TYPEINFO(QXmppOmemoDeviceElement, Q_MOVABLE_TYPE);
40
41#endif // QXMPPOMEMODEVICEELEMENT_H