8 #include "QXmppConfiguration.h" 9 #include "QXmppLogger.h" 10 #include "QXmppPresence.h" 11 #include "QXmppSendResult.h" 12 #include "QXmppSendStanzaParams.h" 17 #include <QAbstractSocket> 26 class QXmppClientPrivate;
31 class QXmppInternalClientExtension;
88 Q_PROPERTY(
QXmppLogger *logger READ logger WRITE setLogger NOTIFY loggerChanged)
90 Q_PROPERTY(
State state READ state NOTIFY stateChanged)
133 QXmppClient(InitialExtensions, QObject *parent =
nullptr);
138 template<
typename T,
typename... Args>
142 auto *ext =
new T(args...);
151 QList<QXmppClientExtension *> extensions();
169 const QList<QXmppClientExtension *> list = extensions();
170 for (
auto ext : list) {
171 T *extension = qobject_cast<T *>(ext);
197 auto list = extensions();
198 for (
int i = 0; i < list.size(); ++i) {
199 if (qobject_cast<T *>(list.at(i)) !=
nullptr) {
206 bool isAuthenticated()
const;
207 bool isConnected()
const;
209 bool isActive()
const;
210 void setActive(
bool active);
212 StreamManagementState streamManagementState()
const;
224 QAbstractSocket::SocketError socketError();
225 QString socketErrorString()
const;
239 #if QXMPP_DEPRECATED_SINCE(1, 1) 240 QT_DEPRECATED_X(
"Use QXmppClient::findExtension<QXmppRosterManager>() instead")
305 void iqReceived(
const QXmppIq &iq);
309 void sslErrors(
const QList<QSslError> &errors);
318 void connectToServer(
const QString &jid,
319 const QString &password);
320 void disconnectFromServer();
322 void sendMessage(
const QString &bareJid,
const QString &message);
325 void injectIq(
const QDomElement &element,
const std::optional<QXmppE2eeMetadata> &e2eeMetadata);
329 void _q_elementReceived(
const QDomElement &element,
bool &handled);
331 void _q_socketStateChanged(QAbstractSocket::SocketState state);
332 void _q_streamConnected();
333 void _q_streamDisconnected();
337 const std::unique_ptr<QXmppClientPrivate> d;
340 friend class QXmppInternalClientExtension;
341 friend class TestClient;
344 #endif // QXMPPCLIENT_H The QXmppVersionManager class makes it possible to request for the software version of an entity as d...
Definition: QXmppVersionManager.h:23
InitialExtensions
Definition: QXmppClient.h:126
The QXmppConfiguration class holds configuration options.
Definition: QXmppConfiguration.h:28
Error due to no response to a keep alive.
Definition: QXmppClient.h:101
The QXmppVCardManager class gets/sets XMPP vCards. It is an implementation of XEP-0054: vcard-temp...
Definition: QXmppVCardManager.h:37
Stream Management is not used.
Definition: QXmppClient.h:117
Disconnected from the server.
Definition: QXmppClient.h:108
Definition: QXmppE2eeExtension.h:22
int indexOfExtension()
Returns the index of an extension.
Definition: QXmppClient.h:195
Creates a client with the default set of extensions.
Definition: QXmppClient.h:130
Trying to connect to the server.
Definition: QXmppClient.h:109
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:87
Definition: QXmppError.h:17
std::variant< QDomElement, QXmppError > IqResult
Definition: QXmppClient.h:93
No error.
Definition: QXmppClient.h:99
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:104
Definition: QXmppStream.h:20
Error
Definition: QXmppClient.h:98
Definition: QXmppDiscoveryIq.h:17
Stream Management is used and the previous stream has not been resumed.
Definition: QXmppClient.h:119
Error due to XML stream.
Definition: QXmppClient.h:102
The QXmppRosterManager class provides access to a connected client's roster.
Definition: QXmppRosterManager.h:55
The QXmppLogger class represents a sink for logging messages.
Definition: QXmppLogger.h:26
StreamManagementState
Describes the use of XEP-0198: Stream Management.
Definition: QXmppClient.h:115
The QXmppStream class is the base class for all XMPP streams.
Definition: QXmppStream.h:35
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:20
Condition
A detailed condition of the error.
Definition: QXmppStanza.h:110
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:22
Creates a client without any extensions.
Definition: QXmppClient.h:128
Definition: QXmppNonza.h:13
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:37
T * findExtension()
Returns the extension which can be cast into type T*, or 0 if there is no such extension.
Definition: QXmppClient.h:167
State
This enumeration describes a client state.
Definition: QXmppClient.h:107
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
T * addNewExtension(Args... args)
Definition: QXmppClient.h:139
Error due to TCP socket.
Definition: QXmppClient.h:100
std::variant< QXmpp::Success, QXmppError > EmptyResult
Definition: QXmppClient.h:94
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:83