QXmpp Version: 1.10.0
QXmppIncomingClient.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPINCOMINGCLIENT_H
6#define QXMPPINCOMINGCLIENT_H
7
8#include "QXmppLogger.h"
9
10#include <memory>
11
12class QDomElement;
13class QSslSocket;
14class QXmppNonza;
15class QXmppIncomingClientPrivate;
17
22class QXMPP_EXPORT QXmppIncomingClient : public QXmppLoggable
23{
24 Q_OBJECT
25public:
26 QXmppIncomingClient(QSslSocket *socket, const QString &domain, QObject *parent = nullptr);
27 ~QXmppIncomingClient() override;
28
29 bool isConnected() const;
30 QString jid() const;
31
32 bool sendPacket(const QXmppNonza &);
33 Q_SLOT bool sendData(const QByteArray &);
34 void disconnectFromHost();
35
36 void setInactivityTimeout(int secs);
37 void setPasswordChecker(QXmppPasswordChecker *checker);
38
40 Q_SIGNAL void elementReceived(const QDomElement &element);
41
43 Q_SIGNAL void connected();
44
46 Q_SIGNAL void disconnected();
47
48protected:
50 void handleStart();
51 void handleStream(const QDomElement &element);
52 void handleStanza(const QDomElement &element);
54
55private Q_SLOTS:
56 void onDigestReply();
57 void onPasswordReply();
58 void onSocketDisconnected();
59 void onTimeout();
60
61private:
62 void onSasl2Authenticated();
63 void sendStreamFeatures();
64
65 const std::unique_ptr<QXmppIncomingClientPrivate> d;
66 friend class QXmppIncomingClientPrivate;
67};
68
69#endif
The QXmppIncomingClient class represents an incoming XMPP stream from an XMPP client.
Definition: QXmppIncomingClient.h:23
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
Q_SIGNAL void elementReceived(const QDomElement &element)
This signal is emitted when an element is received.
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:110
Definition: QXmppNonza.h:14
The QXmppPasswordChecker class represents an abstract password checker.
Definition: QXmppPasswordChecker.h:83