QXmpp
Version:0.9.3
|
00001 /* 00002 * Copyright (C) 2008-2014 The QXmpp developers 00003 * 00004 * Author: 00005 * Jeremy Lainé 00006 * 00007 * Source: 00008 * https://github.com/qxmpp-project/qxmpp 00009 * 00010 * This file is a part of QXmpp library. 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 */ 00023 00024 #ifndef QXMPPBYTESTREAMIQ_H 00025 #define QXMPPBYTESTREAMIQ_H 00026 00027 #include "QXmppIq.h" 00028 00029 #include <QHostAddress> 00030 00031 class QXMPP_EXPORT QXmppByteStreamIq : public QXmppIq 00032 { 00033 public: 00034 enum Mode { 00035 None = 0, 00036 Tcp, 00037 Udp 00038 }; 00039 00040 class QXMPP_EXPORT StreamHost 00041 { 00042 public: 00043 QString jid() const; 00044 void setJid(const QString &jid); 00045 00046 QString host() const; 00047 void setHost(const QString &host); 00048 00049 quint16 port() const; 00050 void setPort(quint16 port); 00051 00052 QString zeroconf() const; 00053 void setZeroconf(const QString &zeroconf); 00054 00055 private: 00056 QString m_host; 00057 QString m_jid; 00058 quint16 m_port; 00059 QString m_zeroconf; 00060 }; 00061 00062 QXmppByteStreamIq::Mode mode() const; 00063 void setMode(QXmppByteStreamIq::Mode mode); 00064 00065 QString sid() const; 00066 void setSid(const QString &sid); 00067 00068 QString activate() const; 00069 void setActivate(const QString &activate); 00070 00071 QList<QXmppByteStreamIq::StreamHost> streamHosts() const; 00072 void setStreamHosts(const QList<QXmppByteStreamIq::StreamHost> &streamHosts); 00073 00074 QString streamHostUsed() const; 00075 void setStreamHostUsed(const QString &jid); 00076 00077 static bool isByteStreamIq(const QDomElement &element); 00078 00079 protected: 00081 void parseElementFromChild(const QDomElement &element); 00082 void toXmlElementFromChild(QXmlStreamWriter *writer) const; 00084 00085 private: 00086 Mode m_mode; 00087 QString m_sid; 00088 00089 QString m_activate; 00090 QList<StreamHost> m_streamHosts; 00091 QString m_streamHostUsed; 00092 }; 00093 00094 #endif