QXmpp Version:0.7.6

- Main Page
- Modules
- Classes
- Files

- File List

All Classes Functions Variables Enumerations Enumerator Properties Groups
QXmppElement.h
1 /*
2 * Copyright (C) 2008-2012 The QXmpp developers
3 *
4 * Author:
5 * Jeremy Lainé
6 *
7 * Source:
8 * http://code.google.com/p/qxmpp
9 *
10 * This file is a part of QXmpp library.
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 */
23
24 #ifndef QXMPPELEMENT_H
25 #define QXMPPELEMENT_H
26
27 #include <QMap>
28 #include <QStringList>
29 #include <QXmlStreamWriter>
30
31 #include "QXmppGlobal.h"
32
33 class QDomElement;
34 class QXmppElement;
35 class QXmppElementPrivate;
36
37 typedef QList<QXmppElement> QXmppElementList;
38 class QXMPP_EXPORT QXmppElement
39 {
40 public:
41 QXmppElement();
42 QXmppElement(const QXmppElement &other);
43 QXmppElement(const QDomElement &element);
44 ~QXmppElement();
45
46 QStringList attributeNames() const;
47
48 QString attribute(const QString &name) const;
49 void setAttribute(const QString &name, const QString &value);
50
51 void appendChild(const QXmppElement &child);
52 QXmppElement firstChildElement(const QString &name = QString()) const;
53 QXmppElement nextSiblingElement(const QString &name = QString()) const;
54 void removeChild(const QXmppElement &child);
55
56 QString tagName() const;
57 void setTagName(const QString &type);
58
59 QString value() const;
60 void setValue(const QString &text);
61
62 bool isNull() const;
63 void toXml(QXmlStreamWriter *writer) const;
64
65 QXmppElement &operator=(const QXmppElement &other);
66
67 private:
68 QXmppElement(QXmppElementPrivate *other);
69 QXmppElementPrivate *d;
70 };
71
72 #endif