QXmpp  Version: 1.15.1
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 #if QXMPP_DEPRECATED_SINCE(1, 12)
16 QT_WARNING_PUSH
17 QT_WARNING_DISABLE_DEPRECATED
18 
20 struct [[deprecated("Removed from public API (unmaintained)")]] QXmppRemoteMethodResult {
21  QXmppRemoteMethodResult() : hasError(false), code(0) { }
22  bool hasError;
23  int code;
24  QString errorMessage;
25  QVariant result;
26 };
27 
28 class QXMPP_EXPORT Q_DECL_DEPRECATED_X("Removed from public API (unmaintained)") QXmppRemoteMethod : public QObject
29 {
30  Q_OBJECT
31 public:
32  QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client);
33  QXmppRemoteMethodResult call();
34 
35  Q_SIGNAL void callDone();
36 
37 private:
38  Q_SLOT void gotError(const QXmppRpcErrorIq &iq);
39  Q_SLOT void gotResult(const QXmppRpcResponseIq &iq);
40 
41  QXmppRpcInvokeIq m_payload;
42  QXmppClient *m_client;
43  QXmppRemoteMethodResult m_result;
44 };
46 
47 QT_WARNING_POP
48 #endif
49 
50 #endif // QXMPPREMOTEMETHOD_H
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition: QXmppRpcIq.h:25
bool hasError(const Result< T > &r)
Definition: QXmppGlobal.h:224
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