QXmppJingleIq.h
/*
* Copyright (C) 2008-2014 The QXmpp developers
*
* Author:
* Jeremy Lainé
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#ifndef QXMPPJINGLEIQ_H
#define QXMPPJINGLEIQ_H
#include <QHostAddress>
#include "QXmppIq.h"
class QXmppJingleCandidatePrivate;
class QXmppJingleIqContentPrivate;
class QXmppJingleIqPrivate;
class QXmppJinglePayloadTypePrivate;
class QXMPP_EXPORT QXmppJinglePayloadType
{
public:
QXmppJinglePayloadType();
QXmppJinglePayloadType(const QXmppJinglePayloadType &other);
~QXmppJinglePayloadType();
unsigned char channels() const;
void setChannels(unsigned char channels);
unsigned int clockrate() const;
void setClockrate(unsigned int clockrate);
unsigned char id() const;
void setId(unsigned char id);
unsigned int maxptime() const;
void setMaxptime(unsigned int maxptime);
QString name() const;
void setName(const QString &name);
QMap<QString, QString> parameters() const;
void setParameters(const QMap<QString, QString> &parameters);
unsigned int ptime() const;
void setPtime(unsigned int ptime);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
QXmppJinglePayloadType& operator=(const QXmppJinglePayloadType &other);
bool operator==(const QXmppJinglePayloadType &other) const;
private:
QSharedDataPointer<QXmppJinglePayloadTypePrivate> d;
};
class QXMPP_EXPORT QXmppJingleCandidate
{
public:
enum Type
{
HostType,
PeerReflexiveType,
ServerReflexiveType,
RelayedType
};
QXmppJingleCandidate();
QXmppJingleCandidate(const QXmppJingleCandidate &other);
~QXmppJingleCandidate();
QXmppJingleCandidate& operator=(const QXmppJingleCandidate &other);
int component() const;
void setComponent(int component);
QString foundation() const;
void setFoundation(const QString &foundation);
int generation() const;
void setGeneration(int generation);
QHostAddress host() const;
void setHost(const QHostAddress &host);
QString id() const;
void setId(const QString &id);
int network() const;
void setNetwork(int network);
quint16 port() const;
void setPort(quint16 port);
int priority() const;
void setPriority(int priority);
QString protocol() const;
void setProtocol(const QString &protocol);
QXmppJingleCandidate::Type type() const;
void setType(QXmppJingleCandidate::Type);
bool isNull() const;
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
static QXmppJingleCandidate::Type typeFromString(const QString &typeStr, bool *ok = 0);
static QString typeToString(QXmppJingleCandidate::Type type);
private:
QSharedDataPointer<QXmppJingleCandidatePrivate> d;
};
class QXMPP_EXPORT QXmppJingleIq : public QXmppIq
{
public:
enum Action {
ContentAccept,
ContentAdd,
ContentModify,
ContentReject,
ContentRemove,
DescriptionInfo,
SecurityInfo,
SessionAccept,
SessionInfo,
SessionInitiate,
SessionTerminate,
TransportAccept,
TransportInfo,
TransportReject,
TransportReplace
};
class QXMPP_EXPORT Content
{
public:
Content();
Content(const QXmppJingleIq::Content &other);
~Content();
Content& operator=(const Content &other);
QString creator() const;
void setCreator(const QString &creator);
QString name() const;
void setName(const QString &name);
QString senders() const;
void setSenders(const QString &senders);
// XEP-0167: Jingle RTP Sessions
QString descriptionMedia() const;
void setDescriptionMedia(const QString &media);
quint32 descriptionSsrc() const;
void setDescriptionSsrc(quint32 ssrc);
void addPayloadType(const QXmppJinglePayloadType &payload);
QList<QXmppJinglePayloadType> payloadTypes() const;
void setPayloadTypes(const QList<QXmppJinglePayloadType> &payloadTypes);
void addTransportCandidate(const QXmppJingleCandidate &candidate);
QList<QXmppJingleCandidate> transportCandidates() const;
void setTransportCandidates(const QList<QXmppJingleCandidate> &candidates);
QString transportUser() const;
void setTransportUser(const QString &user);
QString transportPassword() const;
void setTransportPassword(const QString &password);
// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
QByteArray transportFingerprint() const;
void setTransportFingerprint(const QByteArray &fingerprint);
QString transportFingerprintHash() const;
void setTransportFingerprintHash(const QString &hash);
QString transportFingerprintSetup() const;
void setTransportFingerprintSetup(const QString &setup);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
bool parseSdp(const QString &sdp);
QString toSdp() const;
private:
QSharedDataPointer<QXmppJingleIqContentPrivate> d;
};
class QXMPP_EXPORT Reason
{
public:
enum Type {
None,
AlternativeSession,
Busy,
Cancel,
ConnectivityError,
Decline,
Expired,
FailedApplication,
FailedTransport,
GeneralError,
Gone,
IncompatibleParameters,
MediaError,
SecurityError,
Success,
Timeout,
UnsupportedApplications,
UnsupportedTransports
};
Reason();
QString text() const;
void setText(const QString &text);
Type type() const;
void setType(Type type);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
private:
QString m_text;
Type m_type;
};
QXmppJingleIq();
QXmppJingleIq(const QXmppJingleIq &other);
~QXmppJingleIq();
QXmppJingleIq& operator=(const QXmppJingleIq &other);
Action action() const;
void setAction(Action action);
void addContent(const Content &content);
QList<Content> contents() const;
void setContents(const QList<Content> &contents);
QString initiator() const;
void setInitiator(const QString &initiator);
Reason& reason();
const Reason& reason() const;
QString responder() const;
void setResponder(const QString &responder);
// XEP-0167: Jingle RTP Sessions
bool ringing() const;
void setRinging(bool ringing);
QString sid() const;
void setSid(const QString &sid);
static bool isJingleIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
private:
QSharedDataPointer<QXmppJingleIqPrivate> d;
};
#endif
QXmppJingleIq
The QXmppJingleIq class represents an IQ used for initiating media sessions as specified by XEP-0166:...
Definition: QXmppJingleIq.h:154
QXmppJingleIq::Action
Action
This enum is used to describe a Jingle action.
Definition: QXmppJingleIq.h:158
QXmppJinglePayloadType
The QXmppJinglePayloadType class represents a payload type as specified by XEP-0167: Jingle RTP Sessi...
Definition: QXmppJingleIq.h:40
QXmppJingleCandidate::HostType
Host candidate, a local address/port.
Definition: QXmppJingleIq.h:90
QXmppJingleCandidate::Type
Type
This enum is used to describe a candidate's type.
Definition: QXmppJingleIq.h:88
QXmppJingleIq::Reason::Type
Type
This enum is used to describe a reason's type.
Definition: QXmppJingleIq.h:251
QXmppIq::Type
Type
This enum describes the type of IQ.
Definition: QXmppIq.h:46
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppJingleCandidate
The QXmppJingleCandidate class represents a transport candidate as specified by XEP-0176: Jingle ICE-...
Definition: QXmppJingleIq.h:84