2
* xmlcommon.h - helper functions for dealing with XML
3
* Copyright (C) 2001, 2002 Justin Karneges
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#ifndef JABBER_XMLCOMMON_H
22
#define JABBER_XMLCOMMON_H
37
XDomNodeList(const XDomNodeList &from);
38
XDomNodeList(const QDomNodeList &from);
40
XDomNodeList & operator=(const XDomNodeList &from);
42
QDomNode at(int index) const { return item(index); }
43
int count() const { return (int)length(); }
45
QDomNode item(int index) const;
47
int size() const { return (int)length(); }
49
void append(const QDomNode &i);
51
bool operator==(const XDomNodeList &a) const;
53
bool operator!=(const XDomNodeList &a) const
55
return !operator==(a);
62
QDateTime stamp2TS(const QString &ts);
63
bool stamp2TS(const QString &ts, QDateTime *d);
64
QString TS2stamp(const QDateTime &d);
65
QDomElement textTag(QDomDocument *doc, const QString &name, const QString &content);
66
QString tagContent(const QDomElement &e);
67
QDomElement findSubTag(const QDomElement &e, const QString &name, bool *found);
68
XDomNodeList childElementsByTagNameNS(const QDomElement &e, const QString &nsURI, const QString &localName);
69
QDomElement createIQ(QDomDocument *doc, const QString &type, const QString &to, const QString &id);
70
QDomElement queryTag(const QDomElement &e);
71
QString queryNS(const QDomElement &e);
72
void getErrorFromElement(const QDomElement &e, const QString &baseNS, int *code, QString *str);
73
QDomElement addCorrectNS(const QDomElement &e);
76
//QDomElement findSubTag(const QDomElement &e, const QString &name, bool *found);
77
bool hasSubTag(const QDomElement &e, const QString &name);
79
QDomElement emptyTag(QDomDocument *doc, const QString &name);
80
QString subTagText(const QDomElement &e, const QString &name);
82
QDomElement textTag(QDomDocument &doc, const QString &name, const QString &content);
83
QDomElement textTag(QDomDocument &doc, const QString &name, int content);
84
QDomElement textTag(QDomDocument &doc, const QString &name, bool content);
85
QDomElement textTag(QDomDocument &doc, const QString &name, QSize &s);
86
QDomElement textTag(QDomDocument &doc, const QString &name, QRect &r);
87
QDomElement stringListToXml(QDomDocument &doc, const QString &name, const QStringList &l);
89
void readEntry(const QDomElement &e, const QString &name, QString *v);
90
void readNumEntry(const QDomElement &e, const QString &name, int *v);
91
void readBoolEntry(const QDomElement &e, const QString &name, bool *v);
92
void readSizeEntry(const QDomElement &e, const QString &name, QSize *v);
93
void readRectEntry(const QDomElement &e, const QString &name, QRect *v);
94
void readColorEntry(const QDomElement &e, const QString &name, QColor *v);
96
void xmlToStringList(const QDomElement &e, const QString &name, QStringList *v);
98
void setBoolAttribute(QDomElement e, const QString &name, bool b);
99
void readBoolAttribute(QDomElement e, const QString &name, bool *v);
101
//QString tagContent(const QDomElement &e); // obsolete;