3#include "IceSignalQXmppIq.h"
6#include <QLoggingCategory>
8Q_LOGGING_CATEGORY(ChannelICE,
"Channel.ICE")
14QString CIceSignalQXmppIq::ns()
16 return "KangLinStudio.Rabbit.DataChannel";
19bool CIceSignalQXmppIq::isIceSignalIq(
const QDomElement &element)
21 QDomElement domElement = element.firstChildElement(
"query");
22 return (domElement.namespaceURI() == ns());
25void CIceSignalQXmppIq::parseElementFromChild(
const QDomElement &element)
27 QDomElement dataChannelElement = element.firstChildElement(
"query");
28 if(dataChannelElement.isNull())
30 qCritical(ChannelICE) <<
"webrtcElement is null";
33 m_ChannelId = dataChannelElement.attribute(
"channelid");
34 m_SignalType = dataChannelElement.attribute(
"type");
35 if(
"candidate" == SignalType())
37 m_Candidate = dataChannelElement.firstChildElement(
"candidate").text();
38 m_mid = dataChannelElement.firstChildElement(
"mid").text();
40 m_Description = dataChannelElement.firstChildElement(
"description").text();
44void CIceSignalQXmppIq::toXmlElementFromChild(QXmlStreamWriter *writer)
const
46 writer->writeStartElement(
"query");
47 writer->writeAttribute(
"xmlns", ns());
48 writer->writeAttribute(
"channelid", ChannelId());
49 writer->writeAttribute(
"type", SignalType());
50 if(
"candidate" == SignalType())
52 writer->writeTextElement(
"candidate", Candidate());
53 writer->writeTextElement(
"mid", mid());
55 writer->writeTextElement(
"description", Description());
57 writer->writeEndElement();
60const QString &CIceSignalQXmppIq::ChannelId()
const
65void CIceSignalQXmppIq::setChannelId(
const QString &newChannelId)
67 m_ChannelId = newChannelId;
70const QString &CIceSignalQXmppIq::SignalType()
const
75void CIceSignalQXmppIq::setSignalType(
const QString &newType)
77 m_SignalType = newType;
80const QString &CIceSignalQXmppIq::Description()
const
85void CIceSignalQXmppIq::setDescription(
const QString &newDescription)
87 m_Description = newDescription;
90const QString &CIceSignalQXmppIq::Candidate()
const
95void CIceSignalQXmppIq::setCandidate(
const QString &newCandidate)
97 m_Candidate = newCandidate;
100const QString &CIceSignalQXmppIq::mid()
const
105void CIceSignalQXmppIq::setMid(
const QString &newMid)