QXmpp Version: 1.4.0
Loading...
Searching...
No Matches
QXmppRemoteMethod.h
1/*
2 * Copyright (C) 2008-2021 The QXmpp developers
3 *
4 * Authors:
5 * Ian Reinhart Geiser
6 *
7 * Source:
8 * https://github.com/qxmpp-project/qxmpp
9 *
10 * This file is a part of QXmpp library.
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 */
23
24#ifndef QXMPPREMOTEMETHOD_H
25#define QXMPPREMOTEMETHOD_H
26
27#include "QXmppRpcIq.h"
28
29#include <QObject>
30#include <QVariant>
31
32class QXmppClient;
33
34struct QXmppRemoteMethodResult {
35 QXmppRemoteMethodResult() : hasError(false), code(0) { }
36 bool hasError;
37 int code;
38 QString errorMessage;
39 QVariant result;
40};
41
42class QXMPP_EXPORT QXmppRemoteMethod : public QObject
43{
44 Q_OBJECT
45public:
46 QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client);
47 QXmppRemoteMethodResult call();
48
49private Q_SLOTS:
50 void gotError(const QXmppRpcErrorIq &iq);
51 void gotResult(const QXmppRpcResponseIq &iq);
52
53Q_SIGNALS:
54 void callDone();
55
56private:
57 QXmppRpcInvokeIq m_payload;
58 QXmppClient *m_client;
59 QXmppRemoteMethodResult m_result;
60};
61
62#endif // QXMPPREMOTEMETHOD_H
The QXmppClient class is the main class for using QXmpp.
Definition QXmppClient.h:94
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition QXmppRpcIq.h:80
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition QXmppRpcIq.h:45