QXmpp: QXmppElement.h Source File

QXmpp Version: 1.14.3

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
20 class QXMPP_EXPORT QXmppElement
21{
22public:
23 QXmppElement();
24 QXmppElement(const QXmppElement &other);
25 QXmppElement(const QDomElement &element);
26 ~QXmppElement();
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
QXmppElement
Definition QXmppElement.h:21
QXmppElement::firstChildElement
QXmppElement firstChildElement(const QString &name=QString()) const
Definition QXmppElement.cpp:209
QXmppElement::setValue
void setValue(const QString &text)
Definition QXmppElement.cpp:286
QXmppElement::attribute
QString attribute(const QString &name) const
Definition QXmppElement.cpp:174
QXmppElement::nextSiblingElement
QXmppElement nextSiblingElement(const QString &name=QString()) const
Definition QXmppElement.cpp:223
QXmppElement::isNull
bool isNull() const
Definition QXmppElement.cpp:240
QXmppElement::removeChild
void removeChild(const QXmppElement &child)
Definition QXmppElement.cpp:248
QXmppElement::setAttribute
void setAttribute(const QString &name, const QString &value)
Definition QXmppElement.cpp:182
QXmppElement::attributeNames
QStringList attributeNames() const
Definition QXmppElement.cpp:166
QXmppElement::toXml
void toXml(QXmlStreamWriter *writer) const
Definition QXmppElement.cpp:294
QXmppElement::sourceDomElement
QDomElement sourceDomElement() const
Definition QXmppElement.cpp:144
QXmppElement::tagName
QString tagName() const
Definition QXmppElement.cpp:262
QXmppElement::QXmppElement
QXmppElement()
Definition QXmppElement.cpp:87
QXmppElement::value
QString value() const
Definition QXmppElement.cpp:278
QXmppElement::setTagName
void setTagName(const QString &type)
Definition QXmppElement.cpp:270
QXmppElement::appendChild
void appendChild(const QXmppElement &child)
Definition QXmppElement.cpp:190
QXmppElement::operator=
QXmppElement & operator=(const QXmppElement &other)
Definition QXmppElement.cpp:125