QXmppInvokable.h
/*
* Copyright (C) 2008-2021 The QXmpp developers
*
* Authors:
* Ian Reinhart Geiser
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#ifndef QXMPPINVOKABLE_H
#define QXMPPINVOKABLE_H
#include "QXmppGlobal.h"
#include <QHash>
#include <QObject>
#include <QStringList>
#include <QVariant>
#include <QWriteLocker>
class QXMPP_EXPORT QXmppInvokable : public QObject
{
Q_OBJECT
public:
QXmppInvokable(QObject *parent = nullptr);
~QXmppInvokable() override;
QVariant dispatch(const QByteArray &method, const QList<QVariant> &args = QList<QVariant>());
static QList<QByteArray> paramTypes(const QList<QVariant> &params);
virtual bool isAuthorized(const QString &jid) const = 0;
public Q_SLOTS:
QStringList interfaces() const;
private:
void buildMethodHash();
QHash<QByteArray, int> m_methodHash;
QReadWriteLock m_lock;
};
#endif
QXmppInvokable
Definition: QXmppInvokable.h:41
QXmppInvokable::isAuthorized
virtual bool isAuthorized(const QString &jid) const =0