QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppRpcManager.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPRPCMANAGER_H
6#define QXMPPRPCMANAGER_H
7
8#include "QXmppClientExtension.h"
9#include "QXmppInvokable.h"
10#include "QXmppRemoteMethod.h"
11
12#include <QMap>
13#include <QVariant>
14
15class QXmppRpcErrorIq;
18
34
35class QXMPP_EXPORT QXmppRpcManager : public QXmppClientExtension
36{
37 Q_OBJECT
38
39public:
41
42 void addInvokableInterface(QXmppInvokable *interface);
43 QXmppRemoteMethodResult callRemoteMethod(const QString &jid,
44 const QString &interface,
45 const QVariant &arg1 = QVariant(),
46 const QVariant &arg2 = QVariant(),
47 const QVariant &arg3 = QVariant(),
48 const QVariant &arg4 = QVariant(),
49 const QVariant &arg5 = QVariant(),
50 const QVariant &arg6 = QVariant(),
51 const QVariant &arg7 = QVariant(),
52 const QVariant &arg8 = QVariant(),
53 const QVariant &arg9 = QVariant(),
54 const QVariant &arg10 = QVariant());
55
57 QStringList discoveryFeatures() const override;
58 QList<QXmppDiscoveryIq::Identity> discoveryIdentities() const override;
59 bool handleStanza(const QDomElement &element) override;
61
62Q_SIGNALS:
64 void rpcCallResponse(const QXmppRpcResponseIq &result);
65 void rpcCallError(const QXmppRpcErrorIq &err);
67
68private:
69 void invokeInterfaceMethod(const QXmppRpcInvokeIq &iq);
70
71 QMap<QString, QXmppInvokable *> m_interfaces;
72};
73
74#endif
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:33
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
virtual QList< QXmppDiscoveryIq::Identity > discoveryIdentities() const
Definition QXmppClientExtension.cpp:30
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition QXmppClientExtension.cpp:51
Definition QXmppInvokable.h:22
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition QXmppRpcIq.h:61
The QXmppRpcManager class make it possible to invoke remote methods and to expose local interfaces fo...
Definition QXmppRpcManager.h:36
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition QXmppRpcIq.h:26