QXmpp Version: 1.11.3
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 CsiActive {
47 static constexpr std::tuple XmlTag = { u"active", ns_csi };
48 void toXml(XmlWriter &) const;
49};
50
51struct CsiInactive {
52 static constexpr std::tuple XmlTag = { u"inactive", ns_csi };
53 void toXml(XmlWriter &) const;
54};
55
56} // namespace QXmpp::Private
57
58Q_DECLARE_METATYPE(QXmpp::Private::StreamOpen)
59
60#endif // STREAM_H