QXmpp Version: 1.10.0
QXmppIncomingServer.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPINCOMINGSERVER_H
6#define QXMPPINCOMINGSERVER_H
7
8#include "QXmppLogger.h"
9
10#include <memory>
11
12class QDomElement;
13class QSslSocket;
14class QXmppDialback;
15class QXmppIncomingServerPrivate;
16class QXmppNonza;
17
22class QXMPP_EXPORT QXmppIncomingServer : public QXmppLoggable
23{
24 Q_OBJECT
25
26public:
27 QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent);
28 ~QXmppIncomingServer() override;
29
30 bool isConnected() const;
31 void disconnectFromHost();
32
33 QString localStreamId() const;
34
35 bool sendPacket(const QXmppNonza &);
36 Q_SLOT bool sendData(const QByteArray &);
37
39 Q_SIGNAL void connected();
41 Q_SIGNAL void disconnected();
43 Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result);
45 Q_SIGNAL void elementReceived(const QDomElement &element);
46
47private:
48 void handleStart();
49 void handleStanza(const QDomElement &element);
50 void handleStream(const QDomElement &element);
51
52 void slotDialbackResponseReceived(const QXmppDialback &dialback);
53 void slotSocketDisconnected();
54
55 const std::unique_ptr<QXmppIncomingServerPrivate> d;
56 friend class QXmppIncomingServerPrivate;
57};
58
59#endif
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition: QXmppDialback.h:16
The QXmppIncomingServer class represents an incoming XMPP stream from an XMPP server.
Definition: QXmppIncomingServer.h:23
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 elementReceived(const QDomElement &element)
This signal is emitted when an element is received.
Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result)
This signal is emitted when a dialback verify request is received.
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:110
Definition: QXmppNonza.h:14