QXmpp  Version:1.3.0
QXmppIq.h
1 /*
2  * Copyright (C) 2008-2020 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPIQ_H
25 #define QXMPPIQ_H
26 
27 #include "QXmppStanza.h"
28 
29 // forward declarations of QXmlStream* classes will not work on Mac, we need to
30 // include the whole header.
31 // See http://lists.trolltech.com/qt-interest/2008-07/thread00798-0.html
32 // for an explanation.
33 #include <QXmlStreamWriter>
34 
35 class QXmppIqPrivate;
36 
40 
41 class QXMPP_EXPORT QXmppIq : public QXmppStanza
42 {
43 public:
45  enum Type {
46  Error = 0,
47  Get,
48  Set,
49  Result
50  };
51 
53  QXmppIq(const QXmppIq &other);
54  ~QXmppIq() override;
55 
56  QXmppIq &operator=(const QXmppIq &other);
57 
58  QXmppIq::Type type() const;
59  void setType(QXmppIq::Type);
60 
61  bool isXmppStanza() const override;
62 
64  void parse(const QDomElement &element) override;
65  void toXml(QXmlStreamWriter *writer) const override;
66 
67 protected:
68  virtual void parseElementFromChild(const QDomElement &element);
69  virtual void toXmlElementFromChild(QXmlStreamWriter *writer) const;
71 
72 private:
73  QSharedDataPointer<QXmppIqPrivate> d;
74 };
75 
76 #endif // QXMPPIQ_H
QXmppIq::Set
Set request.
Definition: QXmppIq.h:48
QXmppStanza::operator=
QXmppStanza & operator=(const QXmppStanza &other)
Assigns other to this stanza.
Definition: QXmppStanza.cpp:583
QXmppStanza::Error
The Error class represents a stanza error.
Definition: QXmppStanza.h:105
QXmppStanza::isXmppStanza
virtual bool isXmppStanza() const
Definition: QXmppStanza.cpp:710
QXmppStanza
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:99
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:41
QXmppIq::Get
Get request.
Definition: QXmppIq.h:47
QXmppIq::Type
Type
This enum describes the type of IQ.
Definition: QXmppIq.h:45