9#include "QXmppConfiguration.h"
10#include "QXmppLogger.h"
11#include "QXmppPresence.h"
12#include "QXmppSendResult.h"
13#include "QXmppSendStanzaParams.h"
18#include <QAbstractSocket>
27class QXmppClientPrivate;
29class QXmppOutgoingClient;
39namespace QXmpp::Private {
64 Q_PROPERTY(
QXmppLogger *logger READ logger WRITE setLogger NOTIFY loggerChanged)
66 Q_PROPERTY(
State state READ state NOTIFY stateChanged)
109 QXmppClient(InitialExtensions, QObject *parent =
nullptr);
114 template<
typename T,
typename... Args>
118 auto *ext =
new T(args...);
127 QList<QXmppClientExtension *> extensions()
const;
145 const QList<QXmppClientExtension *> list = extensions();
146 for (
auto ext : list) {
147 T *extension = qobject_cast<T *>(ext);
173 auto list = extensions();
174 for (
int i = 0; i < list.size(); ++i) {
175 if (qobject_cast<T *>(list.at(i)) !=
nullptr) {
182 bool isAuthenticated()
const;
183 bool isConnected()
const;
185 bool isActive()
const;
186 void setActive(
bool active);
188 StreamManagementState streamManagementState()
const;
200 QAbstractSocket::SocketError socketError();
201 QString socketErrorString()
const;
215#if QXMPP_DEPRECATED_SINCE(1, 1)
216 QT_DEPRECATED_X(
"Use QXmppClient::findExtension<QXmppRosterManager>() instead")
313 void connectToServer(
const QString &jid,
314 const QString &password);
315 void disconnectFromServer();
317 void sendMessage(
const QString &bareJid,
const QString &message);
320 QXmppOutgoingClient *stream()
const;
321 void injectIq(
const QDomElement &element,
const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
325 void _q_elementReceived(
const QDomElement &element,
bool &handled);
327 void _q_socketStateChanged(QAbstractSocket::SocketState state);
328 void _q_streamConnected(
const QXmpp::Private::SessionBegin &);
329 void _q_streamDisconnected();
332 const std::unique_ptr<QXmppClientPrivate> d;
337 friend class TestClient;
The QXmppCarbonManagerV2 class handles message carbons as described in XEP-0280: Message Carbons.
Definition QXmppCarbonManagerV2.h:11
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:32
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:60
void presenceReceived(const QXmppPresence &presence)
Q_SIGNAL void credentialsChanged()
void error(QXmppClient::Error)
int indexOfExtension() const
Returns the index of an extension.
Definition QXmppClient.h:171
T * findExtension() const
Returns the extension which can be cast into type T*, or 0 if there is no such extension.
Definition QXmppClient.h:143
InitialExtensions
Definition QXmppClient.h:102
@ BasicExtensions
Creates a client with the default set of extensions.
Definition QXmppClient.h:106
@ NoExtensions
Creates a client without any extensions.
Definition QXmppClient.h:104
State
This enumeration describes a client state.
Definition QXmppClient.h:83
@ DisconnectedState
Disconnected from the server.
Definition QXmppClient.h:84
@ ConnectingState
Trying to connect to the server.
Definition QXmppClient.h:85
Q_SIGNAL void errorOccurred(const QXmppError &error)
void loggerChanged(QXmppLogger *logger)
This signal is emitted when the logger changes.
Error
Definition QXmppClient.h:74
@ NoError
No error.
Definition QXmppClient.h:75
@ XmppStreamError
Error due to XML stream.
Definition QXmppClient.h:78
@ KeepAliveError
Error due to no response to a keep alive.
Definition QXmppClient.h:77
@ SocketError
Error due to TCP socket.
Definition QXmppClient.h:76
void sslErrors(const QList< QSslError > &errors)
void stateChanged(QXmppClient::State state)
This signal is emitted when the client state changes.
void messageReceived(const QXmppMessage &message)
StreamManagementState
Describes the use of XEP-0198: Stream Management.
Definition QXmppClient.h:91
@ NoStreamManagement
Stream Management is not used.
Definition QXmppClient.h:93
@ NewStream
Stream Management is used and the previous stream has not been resumed.
Definition QXmppClient.h:95
void iqReceived(const QXmppIq &iq)
T * addNewExtension(Args... args)
Definition QXmppClient.h:115
std::variant< QXmpp::Success, QXmppError > EmptyResult
Definition QXmppClient.h:70
void disconnected()
This signal is emitted when the XMPP connection disconnects.
std::variant< QDomElement, QXmppError > IqResult
Definition QXmppClient.h:69
The QXmppConfiguration class holds configuration options.
Definition QXmppConfiguration.h:37
Definition QXmppDiscoveryIq.h:18
Definition QXmppE2eeExtension.h:23
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:110
The QXmppLogger class represents a sink for logging messages.
Definition QXmppLogger.h:29
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:46
Definition QXmppNonza.h:14
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:21
The QXmppRegistrationManager class manages in-band registration and account management tasks like cha...
Definition QXmppRegistrationManager.h:222
The QXmppRosterManager class provides access to a connected client's roster.
Definition QXmppRosterManager.h:56
Condition
A detailed condition of the error.
Definition QXmppStanza.h:110
The QXmppStanza class is the base class for all XMPP stanzas.
Definition QXmppStanza.h:88
Definition QXmppTask.h:62
The QXmppVCardManager class gets/sets XMPP vCards. It is an implementation of XEP-0054: vcard-temp.
Definition QXmppVCardManager.h:43
The QXmppVersionManager class makes it possible to request for the software version of an entity as d...
Definition QXmppVersionManager.h:24
Definition Algorithms.h:12
Definition QXmppError.h:17