Changeset View
Changeset View
Standalone View
Standalone View
core/backends/lan/landevicelink.h
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef LANDEVICELINK_H | 21 | #ifndef LANDEVICELINK_H | ||
22 | #define LANDEVICELINK_H | 22 | #define LANDEVICELINK_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QPointer> | ||||
25 | #include <QString> | 26 | #include <QString> | ||
26 | #include <QSslSocket> | 27 | #include <QSslSocket> | ||
27 | #include <QSslCertificate> | 28 | #include <QSslCertificate> | ||
28 | 29 | | |||
29 | #include <kdeconnectcore_export.h> | 30 | #include <kdeconnectcore_export.h> | ||
30 | #include "backends/devicelink.h" | 31 | #include "backends/devicelink.h" | ||
31 | #include "uploadjob.h" | 32 | #include "uploadjob.h" | ||
33 | #include "compositeuploadjob.h" | ||||
32 | 34 | | |||
33 | class SocketLineReader; | 35 | class SocketLineReader; | ||
34 | 36 | | |||
35 | class KDECONNECTCORE_EXPORT LanDeviceLink | 37 | class KDECONNECTCORE_EXPORT LanDeviceLink | ||
36 | : public DeviceLink | 38 | : public DeviceLink | ||
37 | { | 39 | { | ||
38 | Q_OBJECT | 40 | Q_OBJECT | ||
39 | 41 | | |||
40 | public: | 42 | public: | ||
41 | enum ConnectionStarted : bool { Locally, Remotely }; | 43 | enum ConnectionStarted : bool { Locally, Remotely }; | ||
42 | 44 | | |||
43 | LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSslSocket* socket, ConnectionStarted connectionSource); | 45 | LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSslSocket* socket, ConnectionStarted connectionSource); | ||
44 | void reset(QSslSocket* socket, ConnectionStarted connectionSource); | 46 | void reset(QSslSocket* socket, ConnectionStarted connectionSource); | ||
45 | 47 | | |||
46 | QString name() override; | 48 | QString name() override; | ||
47 | bool sendPacket(NetworkPacket& np) override; | 49 | bool sendPacket(NetworkPacket& np) override; | ||
48 | UploadJob* sendPayload(const NetworkPacket& np); | | |||
49 | 50 | | |||
50 | void userRequestsPair() override; | 51 | void userRequestsPair() override; | ||
51 | void userRequestsUnpair() override; | 52 | void userRequestsUnpair() override; | ||
52 | 53 | | |||
53 | void setPairStatus(PairStatus status) override; | 54 | void setPairStatus(PairStatus status) override; | ||
54 | 55 | | |||
55 | bool linkShouldBeKeptAlive() override; | 56 | bool linkShouldBeKeptAlive() override; | ||
56 | 57 | | |||
57 | QHostAddress hostAddress() const; | 58 | QHostAddress hostAddress() const; | ||
58 | 59 | | |||
59 | private Q_SLOTS: | 60 | private Q_SLOTS: | ||
60 | void dataReceived(); | 61 | void dataReceived(); | ||
61 | 62 | | |||
62 | private: | 63 | private: | ||
63 | SocketLineReader* m_socketLineReader; | 64 | SocketLineReader* m_socketLineReader; | ||
64 | ConnectionStarted m_connectionSource; | 65 | ConnectionStarted m_connectionSource; | ||
65 | QHostAddress m_hostAddress; | 66 | QHostAddress m_hostAddress; | ||
67 | QPointer<CompositeUploadJob> m_compositeUploadJob; | ||||
66 | }; | 68 | }; | ||
67 | 69 | | |||
68 | #endif | 70 | #endif |