Loading...
Searching...
No Matches
QXmppByteStreamIq.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPBYTESTREAMIQ_H
#define QXMPPBYTESTREAMIQ_H
#include "QXmppConstants_p.h"
#include "QXmppIq.h"
#include <QHostAddress>
class QXMPP_EXPORT QXmppByteStreamIq : public QXmppIq
{
public:
enum Mode {
None = 0,
Tcp,
Udp
};
class QXMPP_EXPORT StreamHost
{
public:
QString jid() const;
void setJid(const QString &jid);
QString host() const;
void setHost(const QString &host);
quint16 port() const;
void setPort(quint16 port);
QString zeroconf() const;
void setZeroconf(const QString &zeroconf);
static constexpr std::tuple XmlTag = { u"streamhost", QXmpp::Private::ns_bytestreams };
static std::optional<StreamHost> fromDom(const QDomElement &el);
void toXml(QXmlStreamWriter *writer) const;
private:
QString m_host;
QString m_jid;
quint16 m_port;
QString m_zeroconf;
};
QXmppByteStreamIq::Mode mode() const;
void setMode(QXmppByteStreamIq::Mode mode);
QString sid() const;
void setSid(const QString &sid);
QString activate() const;
void setActivate(const QString &activate);
QList<QXmppByteStreamIq::StreamHost> streamHosts() const;
void setStreamHosts(const QList<QXmppByteStreamIq::StreamHost> &streamHosts);
QString streamHostUsed() const;
void setStreamHostUsed(const QString &jid);
static constexpr std::tuple PayloadXmlTag = { u"query", QXmpp::Private::ns_bytestreams };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isByteStreamIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
Mode m_mode = None;
QString m_sid;
QString m_activate;
QList<StreamHost> m_streamHosts;
QString m_streamHostUsed;
};
#endif
QXmppByteStreamIq::StreamHost
Definition QXmppByteStreamIq.h:23
QXmppByteStreamIq::StreamHost::setZeroconf
void setZeroconf(const QString &zeroconf)
Definition QXmppByteStreamIq.cpp:98
QXmppByteStreamIq::StreamHost::setPort
void setPort(quint16 port)
Definition QXmppByteStreamIq.cpp:82
QXmppByteStreamIq::StreamHost::zeroconf
QString zeroconf() const
Definition QXmppByteStreamIq.cpp:90
QXmppByteStreamIq::StreamHost::port
quint16 port() const
Definition QXmppByteStreamIq.cpp:74
QXmppByteStreamIq::StreamHost::setJid
void setJid(const QString &jid)
Definition QXmppByteStreamIq.cpp:66
QXmppByteStreamIq::StreamHost::jid
QString jid() const
Definition QXmppByteStreamIq.cpp:58
QXmppByteStreamIq::StreamHost::setHost
void setHost(const QString &host)
Definition QXmppByteStreamIq.cpp:50
QXmppByteStreamIq::StreamHost::host
QString host() const
Definition QXmppByteStreamIq.cpp:42
QXmppByteStreamIq
Definition QXmppByteStreamIq.h:14
QXmppByteStreamIq::streamHostUsed
QString streamHostUsed() const
Definition QXmppByteStreamIq.cpp:200
QXmppByteStreamIq::setActivate
void setActivate(const QString &activate)
Definition QXmppByteStreamIq.cpp:176
QXmppByteStreamIq::setSid
void setSid(const QString &sid)
Definition QXmppByteStreamIq.cpp:160
QXmppByteStreamIq::setStreamHostUsed
void setStreamHostUsed(const QString &jid)
Definition QXmppByteStreamIq.cpp:208
QXmppByteStreamIq::mode
QXmppByteStreamIq::Mode mode() const
Definition QXmppByteStreamIq.cpp:136
QXmppByteStreamIq::Mode
Mode
Definition QXmppByteStreamIq.h:16
QXmppByteStreamIq::setMode
void setMode(QXmppByteStreamIq::Mode mode)
Definition QXmppByteStreamIq.cpp:144
QXmppByteStreamIq::activate
QString activate() const
Definition QXmppByteStreamIq.cpp:168
QXmppByteStreamIq::streamHosts
QList< QXmppByteStreamIq::StreamHost > streamHosts() const
Definition QXmppByteStreamIq.cpp:184
QXmppByteStreamIq::sid
QString sid() const
Definition QXmppByteStreamIq.cpp:152
QXmppByteStreamIq::setStreamHosts
void setStreamHosts(const QList< QXmppByteStreamIq::StreamHost > &streamHosts)
Definition QXmppByteStreamIq.cpp:192
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppNonza::toXml
virtual void toXml(QXmlStreamWriter *writer) const =0