QXmpp: Stream.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
Stream.h
1// SPDX-FileCopyrightText: 2024 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef STREAM_H
6#define STREAM_H
7
8#include "QXmppConstants_p.h"
9
10#include <optional>
11
12#include <QMetaType>
13#include <QString>
14
15class QDomElement;
16class QXmlStreamReader;
17namespace QXmpp::Private {
18class XmlWriter;
19}
20
21namespace QXmpp::Private {
22
23struct StreamOpen {
24 static StreamOpen fromXml(QXmlStreamReader &reader);
25 void toXml(XmlWriter &) const;
26
27 QString to;
28 QString from;
29 QString id;
30 QString version;
31 QString xmlns;
32};
33
34struct StarttlsRequest {
35 static constexpr std::tuple XmlTag = { u"starttls", ns_tls };
36 static std::optional<StarttlsRequest> fromDom(const QDomElement &);
37 void toXml(XmlWriter &) const;
38};
39
40struct StarttlsProceed {
41 static constexpr std::tuple XmlTag = { u"proceed", ns_tls };
42 static std::optional<StarttlsProceed> fromDom(const QDomElement &);
43 void toXml(XmlWriter &) const;
44};
45
46struct BindElement {
47 QString jid;
48 QString resource;
49
50 static constexpr std::tuple XmlTag = { u"bind", ns_bind };
51 static std::optional<BindElement> fromDom(const QDomElement &el);
52 void toXml(XmlWriter &w) const;
53};
54
55struct CsiActive {
56 static constexpr std::tuple XmlTag = { u"active", ns_csi };
57 void toXml(XmlWriter &) const;
58};
59
60struct CsiInactive {
61 static constexpr std::tuple XmlTag = { u"inactive", ns_csi };
62 void toXml(XmlWriter &) const;
63};
64
65} // namespace QXmpp::Private
66
67Q_DECLARE_METATYPE(QXmpp::Private::StreamOpen)
68
69#endif // STREAM_H