QXmpp  Version: 1.10.4
QXmppRemoteMethod.h
1 // SPDX-FileCopyrightText: 2009 Ian Reinhart Geiser <geiseri@kde.org>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 
5 #ifndef QXMPPREMOTEMETHOD_H
6 #define QXMPPREMOTEMETHOD_H
7 
8 #include "QXmppRpcIq.h"
9 
10 #include <QObject>
11 #include <QVariant>
12 
13 class QXmppClient;
14 
15 struct QXmppRemoteMethodResult {
16  QXmppRemoteMethodResult() : hasError(false), code(0) { }
17  bool hasError;
18  int code;
19  QString errorMessage;
20  QVariant result;
21 };
22 
23 class QXMPP_EXPORT QXmppRemoteMethod : public QObject
24 {
25  Q_OBJECT
26 public:
27  QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client);
28  QXmppRemoteMethodResult call();
29 
30 private Q_SLOTS:
31  void gotError(const QXmppRpcErrorIq &iq);
32  void gotResult(const QXmppRpcResponseIq &iq);
33 
34 Q_SIGNALS:
35  void callDone();
36 
37 private:
38  QXmppRpcInvokeIq m_payload;
39  QXmppClient *m_client;
40  QXmppRemoteMethodResult m_result;
41 };
42 
43 #endif // QXMPPREMOTEMETHOD_H
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition: QXmppRpcIq.h:25
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition: QXmppRpcIq.h:60
Main class for starting and managing connections to XMPP servers.
Definition: QXmppClient.h:61