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
23
#include "iris_export.h"
26
#include <QDomElement>
35
class IRIS_EXPORT Stanza
38
enum Kind { Message, Presence, IQ };
41
Stanza(const Stanza &from);
42
Stanza & operator=(const Stanza &from);
48
enum ErrorType { Cancel = 1, Continue, Modify, Auth, Wait };
53
FeatureNotImplemented,
75
Error(int type=Cancel, int condition=UndefinedCondition, const QString &text="", const QDomElement &appSpec=QDomElement());
83
bool fromCode(int code);
85
QPair<QString, QString> description() const;
87
QDomElement toXml(QDomDocument &doc, const QString &baseNS) const;
88
bool fromXml(const QDomElement &e, const QString &baseNS);
97
QDomElement element() const;
98
QString toString() const;
100
QDomDocument & doc() const;
101
QString baseNS() const;
102
QDomElement createElement(const QString &ns, const QString &tagName);
103
QDomElement createTextElement(const QString &ns, const QString &tagName, const QString &text);
104
void appendChild(const QDomElement &e);
107
void setKind(Kind k);
112
QString type() const;
113
QString lang() const;
115
void setTo(const Jid &j);
116
void setFrom(const Jid &j);
117
void setId(const QString &id);
118
void setType(const QString &type);
119
void setLang(const QString &lang);
122
void setError(const Error &err);
127
Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QString &id);
128
Stanza(Stream *s, const QDomElement &e);