QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppIbbIq.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Authors:
5  * Manjeet Dahiya
6  * Jeremy LainĂ©
7  *
8  * Source:
9  * http://code.google.com/p/qxmpp
10  *
11  * This file is a part of QXmpp library.
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2.1 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Lesser General Public License for more details.
22  *
23  */
24 
25 #ifndef QXMPPIBBIQ_H
26 #define QXMPPIBBIQ_H
27 
28 #include "QXmppIq.h"
29 
30 class QDomElement;
31 class QXmlStreamWriter;
32 
33 class QXmppIbbOpenIq: public QXmppIq
34 {
35 public:
36  QXmppIbbOpenIq();
37 
38  long blockSize() const;
39  void setBlockSize( long block_size );
40 
41  QString sid() const;
42  void setSid( const QString &sid );
43 
44  static bool isIbbOpenIq(const QDomElement &element);
45 
46 protected:
48  void parseElementFromChild(const QDomElement &element);
49  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
51 
52 private:
53  long m_block_size;
54  QString m_sid;
55 };
56 
57 class QXmppIbbCloseIq: public QXmppIq
58 {
59 public:
60  QXmppIbbCloseIq();
61 
62  QString sid() const;
63  void setSid( const QString &sid );
64 
65  static bool isIbbCloseIq(const QDomElement &element);
66 
67 protected:
69  void parseElementFromChild(const QDomElement &element);
70  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
72 
73 private:
74  QString m_sid;
75 };
76 
77 class QXMPP_EXPORT QXmppIbbDataIq : public QXmppIq
78 {
79 public:
80  QXmppIbbDataIq();
81 
82  quint16 sequence() const;
83  void setSequence( quint16 seq );
84 
85  QString sid() const;
86  void setSid( const QString &sid );
87 
88  QByteArray payload() const;
89  void setPayload( const QByteArray &data );
90 
91  static bool isIbbDataIq(const QDomElement &element);
92 
93 protected:
95  void parseElementFromChild(const QDomElement &element);
96  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
98 
99 private:
100  quint16 m_seq;
101  QString m_sid;
102  QByteArray m_payload;
103 };
104 
105 #endif // QXMPPIBBIQS_H