QXmpp Version: 1.10.0
QXmppRpcIq.h
1// SPDX-FileCopyrightText: 2009 Ian Reinhart Geiser <geiseri@kde.org>
2// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPRPCIQ_H
7#define QXMPPRPCIQ_H
8
9#include "QXmppIq.h"
10
11#include <QVariant>
12
13class QXMPP_EXPORT QXmppRpcMarshaller
14{
15public:
16 static void marshall(QXmlStreamWriter *writer, const QVariant &value);
17 static QVariant demarshall(const QDomElement &elem, QStringList &errors);
18};
19
24
25class QXMPP_EXPORT QXmppRpcResponseIq : public QXmppIq
26{
27public:
29
30 int faultCode() const;
31 void setFaultCode(int faultCode);
32
33 QString faultString() const;
34 void setFaultString(const QString &faultString);
35
36 QVariantList values() const;
37 void setValues(const QVariantList &values);
38
40 static bool isRpcResponseIq(const QDomElement &element);
42
43protected:
45 void parseElementFromChild(const QDomElement &element) override;
46 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
48
49private:
50 int m_faultCode;
51 QString m_faultString;
52 QVariantList m_values;
53};
54
59
60class QXMPP_EXPORT QXmppRpcInvokeIq : public QXmppIq
61{
62public:
64
65 QString method() const;
66 void setMethod(const QString &method);
67
68 QVariantList arguments() const;
69 void setArguments(const QVariantList &arguments);
70
72 static bool isRpcInvokeIq(const QDomElement &element);
74
75protected:
77 void parseElementFromChild(const QDomElement &element) override;
78 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
80
81private:
82 QVariantList m_arguments;
83 QString m_method;
84
85 friend class QXmppRpcErrorIq;
86};
87
88class QXMPP_EXPORT QXmppRpcErrorIq : public QXmppIq
89{
90public:
91 QXmppRpcErrorIq();
92
93 QXmppRpcInvokeIq query() const;
94 void setQuery(const QXmppRpcInvokeIq &query);
95
97 static bool isRpcErrorIq(const QDomElement &element);
99
100protected:
102 void parseElementFromChild(const QDomElement &element) override;
103 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
105
106private:
107 QXmppRpcInvokeIq m_query;
108};
109
110#endif // QXMPPRPCIQ_H
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition: QXmppRpcIq.h:61
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition: QXmppRpcIq.h:26