QXmpp: QXmppClientExtension.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppClientExtension.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPCLIENTEXTENSION_H
6#define QXMPPCLIENTEXTENSION_H
7
8#include "QXmppDiscoveryIq.h"
9#include "QXmppExtension.h"
10#include "QXmppLogger.h"
11
12#include <memory>
13
14class QDomElement;
15
16class QXmppClient;
17class QXmppClientExtensionPrivate;
18class QXmppMessage;
19
31 class QXMPP_EXPORT QXmppClientExtension : public QXmppLoggable, public QXmppExtension
32{
33 Q_OBJECT
34
35public:
36 QXmppClientExtension();
37 ~QXmppClientExtension() override;
38
39 virtual QStringList discoveryFeatures() const;
40 virtual QList<QXmppDiscoIdentity> discoveryIdentities() const;
41
42 virtual bool handleStanza(const QDomElement &stanza);
43 virtual bool handleStanza(const QDomElement &stanza, const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
44
45protected:
46 QXmppClient *client() const;
47 virtual void setClient(QXmppClient *client);
48
49 virtual void onRegistered(QXmppClient *client);
50 virtual void onUnregistered(QXmppClient *client);
51
52 void injectIq(const QDomElement &element, const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
53 bool injectMessage(QXmppMessage &&message);
54
55private:
56 // m_client can be replaced with a d-ptr if needed (same size)
57 QXmppClient *m_client;
58
59 friend class QXmppClient;
60};
61
62#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