QXmpp Version: 1.10.0
QXmppByteStreamIq.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPBYTESTREAMIQ_H
6#define QXMPPBYTESTREAMIQ_H
7
8#include "QXmppIq.h"
9
10#include <QHostAddress>
11
12class QXMPP_EXPORT QXmppByteStreamIq : public QXmppIq
13{
14public:
15 enum Mode {
16 None = 0,
17 Tcp,
18 Udp
19 };
20
21 class QXMPP_EXPORT StreamHost
22 {
23 public:
24 QString jid() const;
25 void setJid(const QString &jid);
26
27 QString host() const;
28 void setHost(const QString &host);
29
30 quint16 port() const;
31 void setPort(quint16 port);
32
33 QString zeroconf() const;
34 void setZeroconf(const QString &zeroconf);
35
36 private:
37 QString m_host;
38 QString m_jid;
39 quint16 m_port;
40 QString m_zeroconf;
41 };
42
43 QXmppByteStreamIq::Mode mode() const;
44 void setMode(QXmppByteStreamIq::Mode mode);
45
46 QString sid() const;
47 void setSid(const QString &sid);
48
49 QString activate() const;
50 void setActivate(const QString &activate);
51
52 QList<QXmppByteStreamIq::StreamHost> streamHosts() const;
53 void setStreamHosts(const QList<QXmppByteStreamIq::StreamHost> &streamHosts);
54
55 QString streamHostUsed() const;
56 void setStreamHostUsed(const QString &jid);
57
58 static bool isByteStreamIq(const QDomElement &element);
59
60protected:
62 void parseElementFromChild(const QDomElement &element) override;
63 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
65
66private:
67 Mode m_mode = None;
68 QString m_sid;
69
70 QString m_activate;
71 QList<StreamHost> m_streamHosts;
72 QString m_streamHostUsed;
73};
74
75#endif
Definition: QXmppByteStreamIq.h:22
Definition: QXmppByteStreamIq.h:13
Mode
Definition: QXmppByteStreamIq.h:15
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23