QXmpp Version: 1.4.0
Loading...
Searching...
No Matches
QXmppInvokable.h
1/*
2 * Copyright (C) 2008-2021 The QXmpp developers
3 *
4 * Authors:
5 * Ian Reinhart Geiser
6 *
7 * Source:
8 * https://github.com/qxmpp-project/qxmpp
9 *
10 * This file is a part of QXmpp library.
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 */
23
24#ifndef QXMPPINVOKABLE_H
25#define QXMPPINVOKABLE_H
26
27#include "QXmppGlobal.h"
28
29#include <QHash>
30#include <QObject>
31#include <QStringList>
32#include <QVariant>
33#include <QWriteLocker>
34
40class QXMPP_EXPORT QXmppInvokable : public QObject
41{
42 Q_OBJECT
43public:
44 QXmppInvokable(QObject *parent = nullptr);
45
46 ~QXmppInvokable() override;
47
53 QVariant dispatch(const QByteArray &method, const QList<QVariant> &args = QList<QVariant>());
54
59 static QList<QByteArray> paramTypes(const QList<QVariant> &params);
60
64 virtual bool isAuthorized(const QString &jid) const = 0;
65
66public Q_SLOTS:
70 QStringList interfaces() const;
71
72private:
73 void buildMethodHash();
74 QHash<QByteArray, int> m_methodHash;
75 QReadWriteLock m_lock;
76};
77
78#endif
Definition: QXmppInvokable.h:41
virtual bool isAuthorized(const QString &jid) const =0