kdeconnect-kde/core/backends/lan/landevicelink.h

57 lines
1.3 KiB
C
Raw Normal View History

/**
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
2013-08-28 22:47:39 +01:00
#ifndef LANDEVICELINK_H
#define LANDEVICELINK_H
#include <QObject>
#include <QPointer>
#include <QString>
2015-07-05 14:23:53 +01:00
#include <QSslSocket>
#include <QSslCertificate>
2016-06-10 14:07:33 +01:00
#include <kdeconnectcore_export.h>
2016-07-05 13:27:53 +01:00
#include "backends/devicelink.h"
#include "uploadjob.h"
#include "compositeuploadjob.h"
class SocketLineReader;
2016-06-10 14:07:33 +01:00
class KDECONNECTCORE_EXPORT LanDeviceLink
: public DeviceLink
{
Q_OBJECT
public:
enum ConnectionStarted : bool { Locally, Remotely };
LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSslSocket* socket, ConnectionStarted connectionSource);
void reset(QSslSocket* socket, ConnectionStarted connectionSource);
QString name() override;
bool sendPacket(NetworkPacket& np) override;
void userRequestsPair() override;
void userRequestsUnpair() override;
2015-12-01 18:45:14 +00:00
void setPairStatus(PairStatus status) override;
2015-12-01 18:45:14 +00:00
bool linkShouldBeKeptAlive() override;
QHostAddress hostAddress() const;
QSslCertificate certificate() const override;
private Q_SLOTS:
void dataReceived();
private:
SocketLineReader* m_socketLineReader;
ConnectionStarted m_connectionSource;
QPointer<CompositeUploadJob> m_compositeUploadJob;
};
#endif