QXmpp: QXmppRpcIq.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
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
25 class QXMPP_EXPORT QXmppRpcResponseIq : public QXmppIq
26{
27public:
28 QXmppRpcResponseIq();
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
60 class QXMPP_EXPORT QXmppRpcInvokeIq : public QXmppIq
61{
62public:
63 QXmppRpcInvokeIq();
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
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppRpcInvokeIq
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition QXmppRpcIq.h:61
QXmppRpcInvokeIq::setMethod
void setMethod(const QString &method)
Sets the method name.
Definition QXmppRpcIq.cpp:417
QXmppRpcInvokeIq::arguments
QVariantList arguments() const
Returns the method arguments.
Definition QXmppRpcIq.cpp:397
QXmppRpcInvokeIq::method
QString method() const
Definition QXmppRpcIq.cpp:411
QXmppRpcInvokeIq::setArguments
void setArguments(const QVariantList &arguments)
Sets the method arguments.
Definition QXmppRpcIq.cpp:403
QXmppRpcResponseIq::values
QVariantList values() const
Returns the response values.
Definition QXmppRpcIq.cpp:321
QXmppRpcResponseIq::setFaultCode
void setFaultCode(int faultCode)
Sets the fault code.
Definition QXmppRpcIq.cpp:303
QXmppRpcResponseIq::setFaultString
void setFaultString(const QString &faultString)
Sets the fault string.
Definition QXmppRpcIq.cpp:315
QXmppRpcResponseIq::faultCode
int faultCode() const
Returns the fault code.
Definition QXmppRpcIq.cpp:297
QXmppRpcResponseIq::setValues
void setValues(const QVariantList &values)
Sets the response values.
Definition QXmppRpcIq.cpp:327
QXmppRpcResponseIq::faultString
QString faultString() const
Returns the fault string.
Definition QXmppRpcIq.cpp:309