2
* Copyright (C) 2003 Justin Karneges
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
#include <QDomElement>
37
enum Kind { Message, Presence, IQ };
40
Stanza(const Stanza &from);
41
Stanza & operator=(const Stanza &from);
47
enum ErrorType { Cancel = 1, Continue, Modify, Auth, Wait };
52
FeatureNotImplemented,
74
Error(int type=Cancel, int condition=UndefinedCondition, const QString &text="", const QDomElement &appSpec=QDomElement());
82
bool fromCode(int code);
84
QPair<QString, QString> description() const;
86
QDomElement toXml(QDomDocument &doc, const QString &baseNS) const;
87
bool fromXml(const QDomElement &e, const QString &baseNS);
96
QDomElement element() const;
97
QString toString() const;
99
QDomDocument & doc() const;
100
QString baseNS() const;
101
QDomElement createElement(const QString &ns, const QString &tagName);
102
QDomElement createTextElement(const QString &ns, const QString &tagName, const QString &text);
103
void appendChild(const QDomElement &e);
106
void setKind(Kind k);
111
QString type() const;
112
QString lang() const;
114
void setTo(const Jid &j);
115
void setFrom(const Jid &j);
116
void setId(const QString &id);
117
void setType(const QString &type);
118
void setLang(const QString &lang);
121
void setError(const Error &err);
126
Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QString &id);
127
Stanza(Stream *s, const QDomElement &e);