Loading...
Searching...
No Matches
QXmppClientExtension.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPCLIENTEXTENSION_H
#define QXMPPCLIENTEXTENSION_H
#include "QXmppDiscoveryIq.h"
#include "QXmppExtension.h"
#include "QXmppLogger.h"
#include <memory>
class QDomElement;
class QXmppClient;
class QXmppClientExtensionPrivate;
class QXmppMessage;
class QXMPP_EXPORT QXmppClientExtension : public QXmppLoggable, public QXmppExtension
{
Q_OBJECT
public:
QXmppClientExtension();
~QXmppClientExtension() override;
virtual QStringList discoveryFeatures() const;
virtual QList<QXmppDiscoIdentity> discoveryIdentities() const;
virtual bool handleStanza(const QDomElement &stanza);
virtual bool handleStanza(const QDomElement &stanza, const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
protected:
QXmppClient *client() const;
virtual void setClient(QXmppClient *client);
virtual void onRegistered(QXmppClient *client);
virtual void onUnregistered(QXmppClient *client);
void injectIq(const QDomElement &element, const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
bool injectMessage(QXmppMessage &&message);
private:
// m_client can be replaced with a d-ptr if needed (same size)
QXmppClient *m_client;
friend class QXmppClient;
};
#endif
QXmppClientExtension::discoveryIdentities
virtual QList< QXmppDiscoIdentity > discoveryIdentities() const
Definition QXmppClientExtension.cpp:30
QXmppClientExtension::setClient
virtual void setClient(QXmppClient *client)
Definition QXmppClientExtension.cpp:67
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppClientExtension::injectIq
void injectIq(const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
Definition QXmppClientExtension.cpp:111
QXmppClientExtension::injectMessage
bool injectMessage(QXmppMessage &&message)
Definition QXmppClientExtension.cpp:124
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition client/compat/removed_api.cpp:44
QXmppClient
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:62
QXmppLoggable::QXmppLoggable
QXmppLoggable(QObject *parent=nullptr)
Definition QXmppLogger.cpp:57
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:64