QXmppInvokable Class

The QXmppInvokable class is the base class for all objects that can be invoked via RPC. More...

Header: #include <QXmppInvokable.h>
Inherits: QObject

Public Functions

QXmppInvokable(QObject *parent = nullptr)
virtual ~QXmppInvokable() override
QVariant dispatch(const QByteArray &method, const QList<QVariant> &args = QList<QVariant>())
virtual bool isAuthorized(const QString &jid) const = 0

Public Slots

QStringList interfaces() const

Static Public Members

QList<QByteArray> paramTypes(const QList<QVariant> &params)

Detailed Description

All public slots of objects derived from this class are exposed to the RPC interface of the QXmppRpcManager. The methods can only use argument and return types that QVariant supports.

Note: This class is only used by QXmppRpcManager, which is deprecated.

See also QXmppRpcManager.

Member Function Documentation

QXmppInvokable::QXmppInvokable(QObject *parent = nullptr)

Constructs a QXmppInvokable with the specified parent.

[override virtual noexcept] QXmppInvokable::~QXmppInvokable()

Destroys the object.

QVariant QXmppInvokable::dispatch(const QByteArray &method, const QList<QVariant> &args = QList<QVariant>())

Executes the method on this object with the arguments args and returns its result.

This method is reentrant and the method is invoked in a thread safe manner. However, the side effects of the invoked method may not be thread safe.

Returns an invalid QVariant if the method does not exist or the types of the arguments do not match.

[slot] QStringList QXmppInvokable::interfaces() const

Returns the names of all slots of this object for introspection of the provided interface.

[pure virtual] bool QXmppInvokable::isAuthorized(const QString &jid) const

Returns whether the entity with the JID jid is allowed to execute methods of this object.

Reimplement this method to restrict access to the object.

[static] QList<QByteArray> QXmppInvokable::paramTypes(const QList<QVariant> &params)

Returns the type names of the values in params, e.g. for type checking.