Loading...
Searching...
No Matches
QXmppOutgoingClient.h
// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPOUTGOINGCLIENT_H
#define QXMPPOUTGOINGCLIENT_H
#include "QXmppClient.h"
#include "QXmppStanza.h"
#include "QXmppStream.h"
class QDomElement;
class QSslError;
class QXmppConfiguration;
class QXmppPresence;
class QXmppIq;
class QXmppMessage;
class QXmppOutgoingClientPrivate;
class QXMPP_EXPORT QXmppOutgoingClient : public QXmppStream
{
Q_OBJECT
public:
QXmppOutgoingClient(QObject *parent);
~QXmppOutgoingClient() override;
void connectToHost();
bool isAuthenticated() const;
bool isConnected() const override;
bool isClientStateIndicationEnabled() const;
bool isStreamManagementEnabled() const;
bool isStreamResumed() const;
QXmppTask<IqResult> sendIq(QXmppIq &&);
QSslSocket *socket() const { return QXmppStream::socket(); };
QXmppStanza::Error::Condition xmppStreamError();
QXmppConfiguration &configuration();
Q_SIGNALS:
void error(QXmppClient::Error);
void elementReceived(const QDomElement &element, bool &handled);
void presenceReceived(const QXmppPresence &);
void messageReceived(const QXmppMessage &);
void iqReceived(const QXmppIq &);
void sslErrors(const QList<QSslError> &errors);
protected:
// Overridable methods
void handleStart() override;
void handleStanza(const QDomElement &element) override;
void handleStream(const QDomElement &element) override;
public Q_SLOTS:
void disconnectFromHost() override;
private Q_SLOTS:
void _q_dnsLookupFinished();
void _q_socketDisconnected();
void socketError(QAbstractSocket::SocketError);
void socketSslErrors(const QList<QSslError> &);
void pingStart();
void pingStop();
void pingSend();
void pingTimeout();
private:
bool setResumeAddress(const QString &address);
static std::pair<QString, int> parseHostAddress(const QString &address);
friend class QXmppOutgoingClientPrivate;
friend class tst_QXmppOutgoingClient;
const std::unique_ptr<QXmppOutgoingClientPrivate> d;
};
#endif // QXMPPOUTGOINGCLIENT_H
QXmppClient::Error
Error
Definition QXmppClient.h:98
QXmppConfiguration
The QXmppConfiguration class holds configuration options.
Definition QXmppConfiguration.h:29
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:35
QXmppOutgoingClient
The QXmppOutgoingClient class represents an outgoing XMPP stream to an XMPP server.
Definition QXmppOutgoingClient.h:28
QXmppOutgoingClient::error
void error(QXmppClient::Error)
This signal is emitted when an error is encountered.
QXmppOutgoingClient::presenceReceived
void presenceReceived(const QXmppPresence &)
This signal is emitted when a presence is received.
QXmppOutgoingClient::socket
QSslSocket * socket() const
Returns the used socket.
Definition QXmppOutgoingClient.h:44
QXmppOutgoingClient::messageReceived
void messageReceived(const QXmppMessage &)
This signal is emitted when a message is received.
QXmppOutgoingClient::sslErrors
void sslErrors(const QList< QSslError > &errors)
This signal is emitted when SSL errors are encountered.
QXmppOutgoingClient::elementReceived
void elementReceived(const QDomElement &element, bool &handled)
This signal is emitted when an element is received.
QXmppOutgoingClient::iqReceived
void iqReceived(const QXmppIq &)
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:21
QXmppStanza::Error::Condition
Condition
A detailed condition of the error.
Definition QXmppStanza.h:110
QXmppStream
The QXmppStream class is the base class for all XMPP streams.
Definition QXmppStream.h:36
QXmppStream::disconnectFromHost
virtual void disconnectFromHost()
Definition QXmppStream.cpp:107
QXmppStream::sendIq
QXmppTask< IqResult > sendIq(QXmppIq &&, const QString &to)
Definition QXmppStream.cpp:211
QXmppStream::socket
QSslSocket * socket() const
Definition QXmppStream.cpp:316
QXmppStream::handleStart
virtual void handleStart()
Definition QXmppStream.cpp:128
QXmppStream::isConnected
virtual bool isConnected() const
Definition QXmppStream.cpp:138
QXmppStream::handleStream
virtual void handleStream(const QDomElement &element)=0
QXmppStream::handleStanza
virtual void handleStanza(const QDomElement &element)=0
QXmppTask
Definition QXmppTask.h:62