QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppElement.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPELEMENT_H
6#define QXMPPELEMENT_H
7
8#include "QXmppGlobal.h"
9
10#include <QMap>
11#include <QStringList>
12#include <QXmlStreamWriter>
13
14class QDomElement;
15class QXmppElement;
16class QXmppElementPrivate;
17
18using QXmppElementList = QList<QXmppElement>;
19
20class QXMPP_EXPORT QXmppElement
21{
22public:
24 QXmppElement(const QXmppElement &other);
25 QXmppElement(const QDomElement &element);
27
28 QDomElement sourceDomElement() const;
29
30 QStringList attributeNames() const;
31
32 QString attribute(const QString &name) const;
33 void setAttribute(const QString &name, const QString &value);
34
35 void appendChild(const QXmppElement &child);
36 QXmppElement firstChildElement(const QString &name = QString()) const;
37 QXmppElement nextSiblingElement(const QString &name = QString()) const;
38 void removeChild(const QXmppElement &child);
39
40 QString tagName() const;
41 void setTagName(const QString &type);
42
43 QString value() const;
44 void setValue(const QString &text);
45
46 bool isNull() const;
47 void toXml(QXmlStreamWriter *writer) const;
48
49 QXmppElement &operator=(const QXmppElement &other);
50
51private:
52 QXmppElement(QXmppElementPrivate *other);
53 // ### QXmpp2: Use an std::shared_ptr if possible?
54 QXmppElementPrivate *d;
55};
56
57#endif
Definition QXmppElement.h:21