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)
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")
295 void iqReceived(
const QXmppIq &iq);
299 void sslErrors(
const QList<QSslError> &errors);
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;
334 #endif // QXMPPCLIENT_H The QXmppVersionManager class makes it possible to request for the software version of an entity as d...
Definition: QXmppVersionManager.h:23
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:185
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
Definition: QXmppNonza.h:13
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:34
T * findExtension()
Returns the extension which can be cast into type T*, or 0 if there is no such extension.
Definition: QXmppClient.h:157
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:129
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