QXmpp Version: 1.10.0
QXmppOutgoingServer.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPOUTGOINGSERVER_H
6#define QXMPPOUTGOINGSERVER_H
7
8#include "QXmppLogger.h"
9
10#include <QAbstractSocket>
11
12class QDomElement;
13class QSslError;
14class QXmppDialback;
15class QXmppNonza;
17class QXmppOutgoingServerPrivate;
18
23class QXMPP_EXPORT QXmppOutgoingServer : public QXmppLoggable
24{
25 Q_OBJECT
26
27public:
28 QXmppOutgoingServer(const QString &domain, QObject *parent);
29 ~QXmppOutgoingServer() override;
30
31 bool isConnected() const;
32 Q_SLOT void connectToHost(const QString &domain);
33 void disconnectFromHost();
34 Q_SLOT void queueData(const QByteArray &data);
35
37 Q_SIGNAL void connected();
39 Q_SIGNAL void disconnected();
40
41 bool sendData(const QByteArray &);
42 bool sendPacket(const QXmppNonza &);
43
44 QString localStreamKey() const;
45 void setLocalStreamKey(const QString &key);
46 void setVerify(const QString &id, const QString &key);
47
48 QString remoteDomain() const;
49
51 Q_SIGNAL void dialbackResponseReceived(const QXmppDialback &response);
52
53private:
54 void handleStart();
55 void handleStream(const QDomElement &streamElement);
56 void handleStanza(const QDomElement &stanzaElement);
57
58 void onDnsLookupFinished();
59 void onSocketDisconnected();
60 void sendDialback();
61 void slotSslErrors(const QList<QSslError> &errors);
62 void socketError(QAbstractSocket::SocketError error);
63
64 const std::unique_ptr<QXmppOutgoingServerPrivate> d;
65};
66
67#endif
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition: QXmppDialback.h:16
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:110
Definition: QXmppNonza.h:14
The QXmppOutgoingServer class represents an outgoing XMPP stream to another XMPP server.
Definition: QXmppOutgoingServer.h:24
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
Q_SIGNAL void dialbackResponseReceived(const QXmppDialback &response)
This signal is emitted when a dialback verify response is received.