QXmpp Version: 1.15.1
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 QString xmlLang;
33};
34
35struct StarttlsRequest {
36 static constexpr std::tuple XmlTag = { u"starttls", ns_tls };
37 static std::optional<StarttlsRequest> fromDom(const QDomElement &);
38 void toXml(XmlWriter &) const;
39};
40
41struct StarttlsProceed {
42 static constexpr std::tuple XmlTag = { u"proceed", ns_tls };
43 static std::optional<StarttlsProceed> fromDom(const QDomElement &);
44 void toXml(XmlWriter &) const;
45};
46
47struct BindElement {
48 QString jid;
49 QString resource;
50
51 static constexpr std::tuple XmlTag = { u"bind", ns_bind };
52 static std::optional<BindElement> fromDom(const QDomElement &el);
53 void toXml(XmlWriter &w) const;
54};
55
56struct CsiActive {
57 static constexpr std::tuple XmlTag = { u"active", ns_csi };
58 void toXml(XmlWriter &) const;
59};
60
61struct CsiInactive {
62 static constexpr std::tuple XmlTag = { u"inactive", ns_csi };
63 void toXml(XmlWriter &) const;
64};
65
66} // namespace QXmpp::Private
67
68Q_DECLARE_METATYPE(QXmpp::Private::StreamOpen)
69
70#endif // STREAM_H