QXmpp  Version: 1.6.0
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 {
17  QXmppRemoteMethodResult() : hasError(false), code(0) { }
18  bool hasError;
19  int code;
20  QString errorMessage;
21  QVariant result;
22 };
23 
24 class QXMPP_EXPORT QXmppRemoteMethod : public QObject
25 {
26  Q_OBJECT
27 public:
28  QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client);
29  QXmppRemoteMethodResult call();
30 
31 private Q_SLOTS:
32  void gotError(const QXmppRpcErrorIq &iq);
33  void gotResult(const QXmppRpcResponseIq &iq);
34 
35 Q_SIGNALS:
36  void callDone();
37 
38 private:
39  QXmppRpcInvokeIq m_payload;
40  QXmppClient *m_client;
41  QXmppRemoteMethodResult m_result;
42 };
43 
44 #endif // QXMPPREMOTEMETHOD_H
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:84
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