QXmpp  Version:0.9.1
QXmppRemoteMethod.h
1 /*
2  * Copyright (C) 2008-2014 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 <QObject>
28 #include <QVariant>
29 
30 #include "QXmppRpcIq.h"
31 
32 class QXmppClient;
33 
34 struct QXmppRemoteMethodResult {
35  QXmppRemoteMethodResult() : hasError(false), code(0) { }
36  bool hasError;
37  int code;
38  QString errorMessage;
39  QVariant result;
40 };
41 
42 class QXMPP_EXPORT QXmppRemoteMethod : public QObject
43 {
44  Q_OBJECT
45 public:
46  QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client);
47  QXmppRemoteMethodResult call( );
48 
49 private slots:
50  void gotError( const QXmppRpcErrorIq &iq );
51  void gotResult( const QXmppRpcResponseIq &iq );
52 
53 signals:
54  void callDone();
55 
56 private:
57  QXmppRpcInvokeIq m_payload;
58  QXmppClient *m_client;
59  QXmppRemoteMethodResult m_result;
60 
61 };
62 
63 #endif // QXMPPREMOTEMETHOD_H
The QXmppRpcResponseIq class represents an IQ used to carry an RPC response as specified by XEP-0009:...
Definition: QXmppRpcIq.h:43
The QXmppRpcInvokeIq class represents an IQ used to carry an RPC invocation as specified by XEP-0009:...
Definition: QXmppRpcIq.h:78
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:80