QXmppOutgoingClient.h
/*
* Copyright (C) 2008-2021 The QXmpp developers
*
* Authors:
* Manjeet Dahiya
* Jeremy Lainé
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#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;
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;
QXmppOutgoingClientPrivate *const d;
};
#endif // QXMPPOUTGOINGCLIENT_H
QXmppClient::Error
Error
Definition: QXmppClient.h:105
QXmppConfiguration
The QXmppConfiguration class holds configuration options.
Definition: QXmppConfiguration.h:48
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:46
QXmppOutgoingClient
The QXmppOutgoingClient class represents an outgoing XMPP stream to an XMPP server.
Definition: QXmppOutgoingClient.h:47
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::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:36
QXmppStanza::Error::Condition
Condition
A detailed condition of the error.
Definition: QXmppStanza.h:121
QXmppStream
The QXmppStream class is the base class for all XMPP streams.
Definition: QXmppStream.h:42
QXmppStream::disconnectFromHost
virtual void disconnectFromHost()
Definition: QXmppStream.cpp:97
QXmppStream::socket
QSslSocket * socket() const
Definition: QXmppStream.cpp:184
QXmppStream::handleStart
virtual void handleStart()
Definition: QXmppStream.cpp:118
QXmppStream::isConnected
virtual bool isConnected() const
Definition: QXmppStream.cpp:128
QXmppStream::handleStream
virtual void handleStream(const QDomElement &element)=0
QXmppStream::handleStanza
virtual void handleStanza(const QDomElement &element)=0