2013-07-23 15:11:54 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2013-07-23 15:11:54 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2013-07-23 15:11:54 +01:00
|
|
|
*/
|
|
|
|
|
2013-08-28 22:47:39 +01:00
|
|
|
#ifndef LANDEVICELINK_H
|
|
|
|
#define LANDEVICELINK_H
|
2013-07-23 15:11:54 +01:00
|
|
|
|
|
|
|
#include <QObject>
|
2018-11-28 18:56:22 +00:00
|
|
|
#include <QPointer>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QSslSocket>
|
|
|
|
#include <QString>
|
2013-07-23 15:11:54 +01:00
|
|
|
|
2016-07-05 13:27:53 +01:00
|
|
|
#include "backends/devicelink.h"
|
2018-11-28 18:56:22 +00:00
|
|
|
#include "compositeuploadjob.h"
|
2023-06-27 12:10:59 +01:00
|
|
|
#include "deviceinfo.h"
|
2022-09-10 22:23:52 +01:00
|
|
|
#include "uploadjob.h"
|
|
|
|
#include <kdeconnectcore_export.h>
|
2013-09-09 17:35:56 +01:00
|
|
|
|
2013-10-30 00:18:25 +00:00
|
|
|
class SocketLineReader;
|
2023-06-27 12:10:59 +01:00
|
|
|
class LanLinkProvider;
|
2013-07-23 15:11:54 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class KDECONNECTCORE_EXPORT LanDeviceLink : public DeviceLink
|
2013-07-23 15:11:54 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-01-10 15:12:13 +00:00
|
|
|
enum ConnectionStarted : bool { Locally, Remotely };
|
|
|
|
|
2023-06-27 12:10:59 +01:00
|
|
|
LanDeviceLink(const DeviceInfo &deviceInfo, LanLinkProvider *parent, QSslSocket *socket);
|
|
|
|
void reset(QSslSocket *socket);
|
2013-07-23 15:11:54 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
bool sendPacket(NetworkPacket &np) override;
|
2013-07-23 15:11:54 +01:00
|
|
|
|
2023-06-27 12:10:59 +01:00
|
|
|
DeviceInfo deviceInfo() const override
|
|
|
|
{
|
|
|
|
return m_deviceInfo;
|
|
|
|
}
|
|
|
|
|
2017-07-22 10:25:07 +01:00
|
|
|
QHostAddress hostAddress() const;
|
2017-07-22 10:13:21 +01:00
|
|
|
|
2013-07-23 15:11:54 +01:00
|
|
|
private Q_SLOTS:
|
|
|
|
void dataReceived();
|
|
|
|
|
|
|
|
private:
|
2022-09-10 22:23:52 +01:00
|
|
|
SocketLineReader *m_socketLineReader;
|
2017-09-03 20:39:44 +01:00
|
|
|
ConnectionStarted m_connectionSource;
|
2018-11-28 18:56:22 +00:00
|
|
|
QPointer<CompositeUploadJob> m_compositeUploadJob;
|
2023-06-27 12:10:59 +01:00
|
|
|
DeviceInfo m_deviceInfo;
|
2013-07-23 15:11:54 +01:00
|
|
|
};
|
|
|
|
|
2013-10-30 00:18:25 +00:00
|
|
|
#endif
|