00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QXMPPINVOKABLE_H
00025 #define QXMPPINVOKABLE_H
00026
00027 #include <QObject>
00028 #include <QHash>
00029 #include <QVariant>
00030 #include <QWriteLocker>
00031 #include <QStringList>
00032
00038 class QXmppInvokable : public QObject
00039 {
00040 Q_OBJECT
00041 public:
00042 QXmppInvokable( QObject *parent = 0 );
00043
00044 ~QXmppInvokable();
00045
00051 QVariant dispatch( const QByteArray &method, const QList<QVariant> &args = QList<QVariant>() );
00052
00057 static QList<QByteArray> paramTypes( const QList<QVariant> ¶ms );
00058
00062 virtual bool isAuthorized( const QString &jid ) const = 0;
00063
00064 public slots:
00068 QStringList interfaces() const;
00069
00070 private:
00071 void buildMethodHash();
00072 QHash<QByteArray,int> m_methodHash;
00073 QReadWriteLock m_lock;
00074 };
00075
00076
00077 #endif