QXmpp Version: 1.10.0
QXmppIq.h
1// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPIQ_H
6#define QXMPPIQ_H
7
8#include "QXmppStanza.h"
9
10// forward declarations of QXmlStream* classes will not work on Mac, we need to
11// include the whole header.
12// See http://lists.trolltech.com/qt-interest/2008-07/thread00798-0.html
13// for an explanation.
14#include <QXmlStreamWriter>
15
16class QXmppIqPrivate;
17
21
22class QXMPP_EXPORT QXmppIq : public QXmppStanza
23{
24public:
26 enum Type {
27 Error = 0,
30 Result
31 };
32
34 QXmppIq(const QXmppIq &other);
36 ~QXmppIq() override;
37
38 QXmppIq &operator=(const QXmppIq &other);
40
41 QXmppIq::Type type() const;
42 void setType(QXmppIq::Type);
43
44 bool isXmppStanza() const override;
45
47 void parse(const QDomElement &element) override;
48 void toXml(QXmlStreamWriter *writer) const override;
49
50 virtual void parseElementFromChild(const QDomElement &element);
51 virtual void toXmlElementFromChild(QXmlStreamWriter *writer) const;
53
54private:
55 QSharedDataPointer<QXmppIqPrivate> d;
56};
57
58Q_DECLARE_METATYPE(QXmppIq::Type)
59
60#endif // QXMPPIQ_H
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23
QXmppIq(QXmppIq &&)
Default move-constructor.
QXmppIq(const QXmppIq &other)
Constructs a copy of other.
Type
This enum describes the type of IQ.
Definition: QXmppIq.h:26
@ Set
Set request.
Definition: QXmppIq.h:29
@ Get
Get request.
Definition: QXmppIq.h:28
QXmppIq & operator=(const QXmppIq &other)
Assigns other to this IQ.
QXmppIq & operator=(QXmppIq &&)
Move-assignment operator.
virtual void parse(const QDomElement &)=0
virtual bool isXmppStanza() const
Definition: QXmppNonza.h:19
virtual void toXml(QXmlStreamWriter *writer) const =0
The Error class represents a stanza error.
Definition: QXmppStanza.h:94
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:88