QXmpp: QXmppIncomingServer.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
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
18namespace QXmpp::Private {
19struct StreamOpen;
20}
21
26 class QXMPP_EXPORT QXmppIncomingServer : public QXmppLoggable
27{
28 Q_OBJECT
29
30public:
31 QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent);
32 ~QXmppIncomingServer() override;
33
34 bool isConnected() const;
35 void disconnectFromHost();
36
37 QString localStreamId() const;
38
39 bool sendPacket(const QXmppNonza &);
40 Q_SLOT bool sendData(const QByteArray &);
41
43 Q_SIGNAL void connected();
45 Q_SIGNAL void disconnected();
47 Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result);
49 Q_SIGNAL void elementReceived(const QDomElement &element);
50
51private:
52 void handleStart();
53 void handleStanza(const QDomElement &element);
54 void handleStream(const QXmpp::Private::StreamOpen &element);
55
56 void slotDialbackResponseReceived(const QXmppDialback &dialback);
57 void slotSocketDisconnected();
58
59 const std::unique_ptr<QXmppIncomingServerPrivate> d;
60 friend class QXmppIncomingServerPrivate;
61};
62
63#endif
QXmppDialback
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition QXmppDialback.h:16
QXmppIncomingServer::connected
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
QXmppIncomingServer::disconnected
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
QXmppIncomingServer::disconnectFromHost
void disconnectFromHost()
Disconnects from the remote host.
Definition QXmppIncomingServer.cpp:88
QXmppIncomingServer::sendPacket
bool sendPacket(const QXmppNonza &)
Sends an XMPP packet to the peer.
Definition QXmppIncomingServer.cpp:100
QXmppIncomingServer::QXmppIncomingServer
QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent)
Definition QXmppIncomingServer.cpp:63
QXmppIncomingServer::sendData
Q_SLOT bool sendData(const QByteArray &)
Sends raw data to the peer.
Definition QXmppIncomingServer.cpp:106
QXmppIncomingServer::localStreamId
QString localStreamId() const
Returns the stream's identifier.
Definition QXmppIncomingServer.cpp:94
QXmppIncomingServer::isConnected
bool isConnected() const
Definition QXmppIncomingServer.cpp:82
QXmppIncomingServer::elementReceived
Q_SIGNAL void elementReceived(const QDomElement &element)
This signal is emitted when an element is received.
QXmppIncomingServer::dialbackRequestReceived
Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result)
This signal is emitted when a dialback verify request is received.
QXmppLoggable::QXmppLoggable
QXmppLoggable(QObject *parent=nullptr)
Definition QXmppLogger.cpp:57
QXmppNonza
Definition QXmppNonza.h:14