From 1ce7a46bf44ee6317f8bb5dd2bb80fde2df759de Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Fri, 19 Feb 2010 15:40:42 +0000 Subject: make QXmppElement API closer to QDomElement --- source/QXmppElement.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'source/QXmppElement.h') diff --git a/source/QXmppElement.h b/source/QXmppElement.h index 58ec6918..780d00c0 100644 --- a/source/QXmppElement.h +++ b/source/QXmppElement.h @@ -30,6 +30,7 @@ class QDomElement; class QXmppElement; +class QXmppElementPrivate; class QXmppElementList : public QList { @@ -43,16 +44,19 @@ class QXmppElement { public: QXmppElement(); + QXmppElement(const QXmppElement &other); QXmppElement(const QDomElement &element); + ~QXmppElement(); QStringList attributeNames() const; QString attribute(const QString &name) const; void setAttribute(const QString &name, const QString &value); + void appendChild(const QXmppElement &child); QXmppElementList children() const; - QXmppElement firstChild(const QString &name) const; - void setChildren(const QXmppElementList &children); + QXmppElement firstChildElement(const QString &name = QString()) const; + void removeChild(const QXmppElement &child); QString tagName() const; void setTagName(const QString &type); @@ -63,11 +67,11 @@ public: bool isNull() const; void toXml(QXmlStreamWriter *writer) const; + QXmppElement &operator=(const QXmppElement &other); + private: - QMap m_attributes; - QXmppElementList m_children; - QString m_tagName; - QString m_value; + QXmppElement(QXmppElementPrivate *other); + QXmppElementPrivate *d; }; #endif -- cgit v1.2.3