QXmpp: QXmppIncomingClient.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
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;
16class QXmppPasswordChecker;
17
18namespace QXmpp::Private {
19struct StreamOpen;
20}
21
26 class QXMPP_EXPORT QXmppIncomingClient : public QXmppLoggable
27{
28 Q_OBJECT
29public:
30 QXmppIncomingClient(QSslSocket *socket, const QString &domain, QObject *parent = nullptr);
31 ~QXmppIncomingClient() override;
32
33 bool isConnected() const;
34 QString jid() const;
35
36 bool sendPacket(const QXmppNonza &);
37 Q_SLOT bool sendData(const QByteArray &);
38 void disconnectFromHost();
39
40 void setInactivityTimeout(int secs);
41 void setPasswordChecker(QXmppPasswordChecker *checker);
42
44 Q_SIGNAL void elementReceived(const QDomElement &element);
45
47 Q_SIGNAL void connected();
48
50 Q_SIGNAL void disconnected();
51
52protected:
54 void handleStart();
55 void handleStream(const QXmpp::Private::StreamOpen &);
56 void handleStanza(const QDomElement &element);
58
59private:
60 Q_SLOT void onDigestReply();
61 Q_SLOT void onPasswordReply();
62 Q_SLOT void onSocketDisconnected();
63 Q_SLOT void onTimeout();
64
65 void onSasl2Authenticated();
66 void sendStreamFeatures();
67
68 const std::unique_ptr<QXmppIncomingClientPrivate> d;
69 friend class QXmppIncomingClientPrivate;
70};
71
72#endif
QXmppIncomingClient::connected
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
QXmppIncomingClient::jid
QString jid() const
Definition QXmppIncomingClient.cpp:140
QXmppIncomingClient::setPasswordChecker
void setPasswordChecker(QXmppPasswordChecker *checker)
Definition QXmppIncomingClient.cpp:179
QXmppIncomingClient::disconnectFromHost
void disconnectFromHost()
Disconnects from the remote host.
Definition QXmppIncomingClient.cpp:158
QXmppIncomingClient::QXmppIncomingClient
QXmppIncomingClient(QSslSocket *socket, const QString &domain, QObject *parent=nullptr)
Definition QXmppIncomingClient.cpp:104
QXmppIncomingClient::sendPacket
bool sendPacket(const QXmppNonza &)
Sends an XMPP packet to the peer.
Definition QXmppIncomingClient.cpp:146
QXmppIncomingClient::elementReceived
Q_SIGNAL void elementReceived(const QDomElement &element)
This signal is emitted when an element is received.
QXmppIncomingClient::disconnected
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
QXmppIncomingClient::setInactivityTimeout
void setInactivityTimeout(int secs)
Definition QXmppIncomingClient.cpp:165
QXmppIncomingClient::sendData
Q_SLOT bool sendData(const QByteArray &)
Sends raw data to the peer.
Definition QXmppIncomingClient.cpp:152
QXmppIncomingClient::isConnected
bool isConnected() const
Definition QXmppIncomingClient.cpp:131
QXmppLoggable::QXmppLoggable
QXmppLoggable(QObject *parent=nullptr)
Definition QXmppLogger.cpp:57
QXmppNonza
Definition QXmppNonza.h:14
QXmppPasswordChecker
The QXmppPasswordChecker class represents an abstract password checker.
Definition QXmppPasswordChecker.h:81