8#include "QXmppConfiguration.h"
9#include "QXmppLogger.h"
10#include "QXmppPresence.h"
11#include "QXmppSendResult.h"
12#include "QXmppSendStanzaParams.h"
17#include <QAbstractSocket>
26class QXmppClientPrivate;
31class QXmppInternalClientExtension;
88 Q_PROPERTY(
QXmppLogger *logger READ logger WRITE setLogger NOTIFY loggerChanged)
90 Q_PROPERTY(
State state READ state NOTIFY stateChanged)
128 template<
typename T,
typename... Args>
132 auto *ext =
new T(args...);
141 QList<QXmppClientExtension *> extensions();
159 const QList<QXmppClientExtension *> list = extensions();
160 for (
auto ext : list) {
161 T *extension = qobject_cast<T *>(ext);
187 auto list = extensions();
188 for (
int i = 0; i < list.size(); ++i) {
189 if (qobject_cast<T *>(list.at(i)) !=
nullptr) {
196 bool isAuthenticated()
const;
197 bool isConnected()
const;
199 bool isActive()
const;
200 void setActive(
bool active);
202 StreamManagementState streamManagementState()
const;
214 QAbstractSocket::SocketError socketError();
215 QString socketErrorString()
const;
229#if QXMPP_DEPRECATED_SINCE(1, 1)
230 QT_DEPRECATED_X(
"Use QXmppClient::findExtension<QXmppRosterManager>() instead")
308 void connectToServer(
const QString &jid,
309 const QString &password);
310 void disconnectFromServer();
312 void sendMessage(
const QString &bareJid,
const QString &message);
315 void injectIq(
const QDomElement &element,
const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
319 void _q_elementReceived(
const QDomElement &element,
bool &handled);
321 void _q_socketStateChanged(QAbstractSocket::SocketState state);
322 void _q_streamConnected();
323 void _q_streamDisconnected();
327 const std::unique_ptr<QXmppClientPrivate> d;
330 friend class QXmppInternalClientExtension;
331 friend class TestClient;
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition QXmppClientExtension.h:33
The QXmppClient class is the main class for using QXmpp.
Definition QXmppClient.h:84
void presenceReceived(const QXmppPresence &presence)
void error(QXmppClient::Error)
std::variant< QDomElement, QXmppError > IqResult
Definition QXmppClient.h:93
State
This enumeration describes a client state.
Definition QXmppClient.h:107
@ DisconnectedState
Disconnected from the server.
Definition QXmppClient.h:108
@ ConnectingState
Trying to connect to the server.
Definition QXmppClient.h:109
void loggerChanged(QXmppLogger *logger)
This signal is emitted when the logger changes.
Error
Definition QXmppClient.h:98
@ NoError
No error.
Definition QXmppClient.h:99
@ XmppStreamError
Error due to XML stream.
Definition QXmppClient.h:102
@ KeepAliveError
Error due to no response to a keep alive.
Definition QXmppClient.h:101
@ SocketError
Error due to TCP socket.
Definition QXmppClient.h:100
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:115
@ NoStreamManagement
Stream Management is not used.
Definition QXmppClient.h:117
@ NewStream
Stream Management is used and the previous stream has not been resumed.
Definition QXmppClient.h:119
void iqReceived(const QXmppIq &iq)
T * addNewExtension(Args... args)
Definition QXmppClient.h:129
T * findExtension()
Returns the extension which can be cast into type T*, or 0 if there is no such extension.
Definition QXmppClient.h:157
void disconnected()
This signal is emitted when the XMPP connection disconnects.
std::variant< QXmpp::Success, QXmppError > EmptyResult
Definition QXmppClient.h:94
int indexOfExtension()
Returns the index of an extension.
Definition QXmppClient.h:185
The QXmppConfiguration class holds configuration options.
Definition QXmppConfiguration.h:29
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:105
The QXmppLogger class represents a sink for logging messages.
Definition QXmppLogger.h:27
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:35
Definition QXmppNonza.h:14
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:21
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
The QXmppStream class is the base class for all XMPP streams.
Definition QXmppStream.h:36
Definition QXmppTask.h:62
The QXmppVCardManager class gets/sets XMPP vCards. It is an implementation of XEP-0054: vcard-temp.
Definition QXmppVCardManager.h:38
The QXmppVersionManager class makes it possible to request for the software version of an entity as d...
Definition QXmppVersionManager.h:24
Definition QXmppError.h:18