From d9745efcd24e547ba0185732bfc9b0c9f931162e Mon Sep 17 00:00:00 2001 From: Ian Geiser Date: Wed, 11 Nov 2009 11:09:28 +0000 Subject: This is the rest of XEP-009. This needs some cleanup and testing still. I am not happy with the implementation, but I am happy with the interface on QXmppClient. --- source/QXmppRemoteMethod.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 source/QXmppRemoteMethod.h (limited to 'source/QXmppRemoteMethod.h') diff --git a/source/QXmppRemoteMethod.h b/source/QXmppRemoteMethod.h new file mode 100644 index 00000000..b1a8c00d --- /dev/null +++ b/source/QXmppRemoteMethod.h @@ -0,0 +1,41 @@ +#ifndef QXMPPREMOTEMETHOD_H +#define QXMPPREMOTEMETHOD_H + +#include +#include + +#include "QXmppRpcIq.h" + +class QXmppClient; +class QXmppStream; + +struct QXmppRemoteMethodResult { + QXmppRemoteMethodResult() : hasError(false), code(0) { } + bool hasError; + int code; + QString errorMessage; + QVariant result; +}; + +class QXmppRemoteMethod : public QObject +{ + Q_OBJECT +public: + QXmppRemoteMethod(const QString &jid, const QString &method, const QVariantList &args, QXmppClient *client); + QXmppRemoteMethodResult call( ); + +private slots: + void gotError( const QXmppRpcErrorIq &iq ); + void gotResult( const QXmppRpcResponseIq &iq ); + +signals: + void callDone(); + +private: + QXmppRpcInvokeIq m_payload; + QXmppClient *m_client; + QXmppRemoteMethodResult m_result; + +}; + +#endif // QXMPPREMOTEMETHOD_H -- cgit v1.2.3