QXmpp  Version: 1.5.3
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 
16 class QXmppIqPrivate;
17 
21 
22 class QXMPP_EXPORT QXmppIq : public QXmppStanza
23 {
24 public:
26  enum Type {
27  Error = 0,
28  Get,
29  Set,
30  Result
31  };
32 
34  QXmppIq(const QXmppIq &other);
35  QXmppIq(QXmppIq &&);
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 
54 private:
55  QSharedDataPointer<QXmppIqPrivate> d;
56 };
57 
58 #endif // QXMPPIQ_H
virtual bool isXmppStanza() const
Definition: QXmppNonza.h:19
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:87
Type
This enum describes the type of IQ.
Definition: QXmppIq.h:26
virtual void parse(const QDomElement &)=0
Set request.
Definition: QXmppIq.h:29
Get request.
Definition: QXmppIq.h:28
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:22
virtual void toXml(QXmlStreamWriter *writer) const =0
The Error class represents a stanza error.
Definition: QXmppStanza.h:93
QXmppStanza & operator=(const QXmppStanza &other)
Assigns other to this stanza.