QXmpp Version: 1.4.0
QXmppElement.h
1/*
2 * Copyright (C) 2008-2021 The QXmpp developers
3 *
4 * Author:
5 * Jeremy Lainé
6 *
7 * Source:
8 * https://github.com/qxmpp-project/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 "QXmppGlobal.h"
28
29#include <QMap>
30#include <QStringList>
31#include <QXmlStreamWriter>
32
33class QDomElement;
34class QXmppElement;
35class QXmppElementPrivate;
36
37using QXmppElementList = QList<QXmppElement>;
38
42class QXMPP_EXPORT QXmppElement
43{
44public:
46 QXmppElement(const QXmppElement &other);
47 QXmppElement(const QDomElement &element);
49
50 QDomElement sourceDomElement() const;
51
52 QStringList attributeNames() const;
53
54 QString attribute(const QString &name) const;
55 void setAttribute(const QString &name, const QString &value);
56
57 void appendChild(const QXmppElement &child);
58 QXmppElement firstChildElement(const QString &name = QString()) const;
59 QXmppElement nextSiblingElement(const QString &name = QString()) const;
60 void removeChild(const QXmppElement &child);
61
62 QString tagName() const;
63 void setTagName(const QString &type);
64
65 QString value() const;
66 void setValue(const QString &text);
67
68 bool isNull() const;
69 void toXml(QXmlStreamWriter *writer) const;
70
71 QXmppElement &operator=(const QXmppElement &other);
72
73private:
74 QXmppElement(QXmppElementPrivate *other);
75 QXmppElementPrivate *d;
76};
77
78#endif
QXmppElement represents a raw XML element with possible children.
Definition: QXmppElement.h:43