QXmpp  Version:0.9.1
QXmppIq.h
1 /*
2  * Copyright (C) 2008-2014 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 
25 #ifndef QXMPPIQ_H
26 #define QXMPPIQ_H
27 
28 #include "QXmppStanza.h"
29 
30 // forward declarations of QXmlStream* classes will not work on Mac, we need to
31 // include the whole header.
32 // See http://lists.trolltech.com/qt-interest/2008-07/thread00798-0.html
33 // for an explanation.
34 #include <QXmlStreamWriter>
35 
36 class QXmppIqPrivate;
37 
41 
42 class QXMPP_EXPORT QXmppIq : public QXmppStanza
43 {
44 public:
46  enum Type
47  {
48  Error = 0,
49  Get,
50  Set,
51  Result
52  };
53 
55  QXmppIq(const QXmppIq &other);
56  ~QXmppIq();
57 
58  QXmppIq& operator=(const QXmppIq &other);
59 
60  QXmppIq::Type type() const;
61  void setType(QXmppIq::Type);
62 
64  void parse(const QDomElement &element);
65  void toXml(QXmlStreamWriter *writer) const;
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
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:90
Set request.
Definition: QXmppIq.h:50
Type
This enum describes the type of IQ.
Definition: QXmppIq.h:46
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
Get request.
Definition: QXmppIq.h:49
QXmppStanza & operator=(const QXmppStanza &other)
Assigns other to this stanza.
Definition: QXmppStanza.cpp:460