QXmpp Version: 1.10.0
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
21class 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
47public Q_SLOTS:
51 QStringList interfaces() const;
52
53private:
54 void buildMethodHash();
55 QHash<QByteArray, int> m_methodHash;
56 QReadWriteLock m_lock;
57};
58
59#endif
Definition: QXmppInvokable.h:22
virtual bool isAuthorized(const QString &jid) const =0