QXmpp  Version:1.3.1
QXmppIbbIq.h
1 /*
2  * Copyright (C) 2008-2020 The QXmpp developers
3  *
4  * Authors:
5  * Manjeet Dahiya
6  * Jeremy LainĂ©
7  *
8  * Source:
9  * https://github.com/qxmpp-project/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 
36 class QXmppIbbOpenIq : public QXmppIq
37 {
38 public:
40 
41  long blockSize() const;
42  void setBlockSize(long block_size);
43 
44  QString sid() const;
45  void setSid(const QString &sid);
46 
47  static bool isIbbOpenIq(const QDomElement &element);
48 
49 protected:
51  void parseElementFromChild(const QDomElement &element) override;
52  void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
54 
55 private:
56  long m_block_size;
57  QString m_sid;
58 };
59 
66 class QXmppIbbCloseIq : public QXmppIq
67 {
68 public:
70 
71  QString sid() const;
72  void setSid(const QString &sid);
73 
74  static bool isIbbCloseIq(const QDomElement &element);
75 
76 protected:
78  void parseElementFromChild(const QDomElement &element) override;
79  void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
81 
82 private:
83  QString m_sid;
84 };
85 
92 class QXMPP_EXPORT QXmppIbbDataIq : public QXmppIq
93 {
94 public:
96 
97  quint16 sequence() const;
98  void setSequence(quint16 seq);
99 
100  QString sid() const;
101  void setSid(const QString &sid);
102 
103  QByteArray payload() const;
104  void setPayload(const QByteArray &data);
105 
106  static bool isIbbDataIq(const QDomElement &element);
107 
108 protected:
110  void parseElementFromChild(const QDomElement &element) override;
111  void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
113 
114 private:
115  quint16 m_seq;
116  QString m_sid;
117  QByteArray m_payload;
118 };
119 
120 #endif // QXMPPIBBIQS_H
QXmppIbbDataIq
QXmppIbbCloseIq represents an IBB data request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:92
QXmppIbbCloseIq
QXmppIbbCloseIq represents an IBB close request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:66
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:41
QXmppIbbOpenIq
QXmppIbbOpenIq represents an IBB open request as defined by XEP-0047: In-Band Bytestreams.
Definition: QXmppIbbIq.h:36