QXmpp: QXmppInvokable.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppInvokable.h
1// SPDX-FileCopyrightText: 2009 Ian Reinhart Geiser <geiseri@kde.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPINVOKABLE_H
6#define QXMPPINVOKABLE_H
7
8#include "QXmppGlobal.h"
9
10#include <QHash>
11#include <QObject>
12#include <QStringList>
13#include <QVariant>
14#include <QWriteLocker>
15
21 class QXMPP_EXPORT QXmppInvokable : public QObject
22{
23 Q_OBJECT
24public:
25 QXmppInvokable(QObject *parent = nullptr);
26
27 ~QXmppInvokable() override;
28
34 QVariant dispatch(const QByteArray &method, const QList<QVariant> &args = QList<QVariant>());
35
40 static QList<QByteArray> paramTypes(const QList<QVariant> &params);
41
45 virtual bool isAuthorized(const QString &jid) const = 0;
46
50 Q_SLOT QStringList interfaces() const;
51
52private:
53 void buildMethodHash();
54 QHash<QByteArray, int> m_methodHash;
55 QReadWriteLock m_lock;
56};
57
58#endif
QXmppInvokable::QXmppInvokable
QXmppInvokable(QObject *parent=nullptr)
Constructs a QXmppInvokable with the specified parent.
Definition QXmppInvokable.cpp:13
QXmppInvokable::interfaces
Q_SLOT QStringList interfaces() const
Definition QXmppInvokable.cpp:102
QXmppInvokable::dispatch
QVariant dispatch(const QByteArray &method, const QList< QVariant > &args=QList< QVariant >())
Definition QXmppInvokable.cpp:20
QXmppInvokable::isAuthorized
virtual bool isAuthorized(const QString &jid) const =0
QXmppInvokable::paramTypes
static QList< QByteArray > paramTypes(const QList< QVariant > &params)
Definition QXmppInvokable.cpp:78