QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppIq.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
6  *
7  * Source:
8  * http://code.google.com/p/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 
39 
40 class QXMPP_EXPORT QXmppIq : public QXmppStanza
41 {
42 public:
44  enum Type
45  {
46  Error = 0,
47  Get,
48  Set,
49  Result
50  };
51 
53 
54  QXmppIq::Type type() const;
55  void setType(QXmppIq::Type);
56 
58  void parse(const QDomElement &element);
59  void toXml(QXmlStreamWriter *writer) const;
60 
61 protected:
62  virtual void parseElementFromChild(const QDomElement &element);
63  virtual void toXmlElementFromChild(QXmlStreamWriter *writer) const;
65 
66 private:
67  QString getTypeStr() const;
68  void setTypeFromStr(const QString& str);
69 
70  Type m_type;
71 };
72 
73 #endif // QXMPPIQ_H