QXmppByteStreamIq.h

    00001 /*
    00002  * Copyright (C) 2008-2011 The QXmpp developers
    00003  *
    00004  * Author:
    00005  *  Jeremy Lainé
    00006  *
    00007  * Source:
    00008  *  http://code.google.com/p/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 QDomElement;
    00032 class QXmlStreamWriter;
    00033
    00034 class QXmppByteStreamIq : public QXmppIq
    00035 {
    00036 public:
    00037     enum Mode {
    00038         None = 0,
    00039         Tcp,
    00040         Udp,
    00041     };
    00042
    00043     class StreamHost
    00044     {
    00045     public:
    00046         QString jid() const;
    00047         void setJid(const QString &jid);
    00048
    00049         QHostAddress host() const;
    00050         void setHost(const QHostAddress &host);
    00051
    00052         quint16 port() const;
    00053         void setPort(quint16 port);
    00054
    00055         QString zeroconf() const;
    00056         void setZeroconf(const QString &zeroconf);
    00057
    00058     private:
    00059         QHostAddress m_host;
    00060         QString m_jid;
    00061         quint16 m_port;
    00062         QString m_zeroconf;
    00063     };
    00064
    00065     QXmppByteStreamIq::Mode mode() const;
    00066     void setMode(QXmppByteStreamIq::Mode mode);
    00067
    00068     QString sid() const;
    00069     void setSid(const QString &sid);
    00070
    00071     QString activate() const;
    00072     void setActivate(const QString &activate);
    00073
    00074     QList<QXmppByteStreamIq::StreamHost> streamHosts() const;
    00075     void setStreamHosts(const QList<QXmppByteStreamIq::StreamHost> &streamHosts);
    00076
    00077     QString streamHostUsed() const;
    00078     void setStreamHostUsed(const QString &jid);
    00079
    00080     static bool isByteStreamIq(const QDomElement &element);
    00081
    00082 protected:
    00084     void parseElementFromChild(const QDomElement &element);
    00085     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
    00087
    00088 private:
    00089     Mode m_mode;
    00090     QString m_sid;
    00091
    00092     QString m_activate;
    00093     QList<StreamHost> m_streamHosts;
    00094     QString m_streamHostUsed;
    00095 };
    00096
    00097 #endif

All Classes Functions Enumerations Enumerator Properties