diff options
| author | Ian Geiser <ian.geiser@gmail.com> | 2009-11-11 11:09:28 +0000 |
|---|---|---|
| committer | Ian Geiser <ian.geiser@gmail.com> | 2009-11-11 11:09:28 +0000 |
| commit | d9745efcd24e547ba0185732bfc9b0c9f931162e (patch) | |
| tree | c66bc1c52329ea1a21771b74845009a9a0addd70 /source/QXmppRemoteMethod.h | |
| parent | 5b0870ddaac421af2639058648a218c7061cdd6f (diff) | |
| download | qxmpp-d9745efcd24e547ba0185732bfc9b0c9f931162e.tar.gz | |
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.
Diffstat (limited to 'source/QXmppRemoteMethod.h')
| -rw-r--r-- | source/QXmppRemoteMethod.h | 41 |
1 files changed, 41 insertions, 0 deletions
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 <QObject> +#include <QVariant> + +#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 |
