QXmpp  Version: 1.10.4
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 
12 class QDomElement;
13 class QSslError;
14 class QXmppDialback;
15 class QXmppNonza;
17 class QXmppOutgoingServerPrivate;
18 
23 class QXMPP_EXPORT QXmppOutgoingServer : public QXmppLoggable
24 {
25  Q_OBJECT
26 
27 public:
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 
53 private:
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:15
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:109
The QXmppOutgoingServer class represents an outgoing XMPP stream to another XMPP server.
Definition: QXmppOutgoingServer.h:23
Definition: QXmppNonza.h:13