玉兔远程控制 0.1.0-bate11
载入中...
搜索中...
未找到
BackendFileTransfer.h
1// Copyright Copyright (c) Kang Lin studio, All Rights Reserved
2// Author: Kang Lin <kl222@126.com>
3
4#pragma once
5
6#include <QEvent>
7#include "Backend.h"
8#include "OperateFileTransfer.h"
9
10#if HAVE_LIBSSH
11#include "ChannelSFTP.h"
12#endif
13
14class CBackendFileTransfer : public CBackend
15{
16 Q_OBJECT
17
18public:
19 CBackendFileTransfer(COperateFileTransfer* pOperate);
20 virtual ~CBackendFileTransfer();
21
22 virtual int WakeUp() override;
23 virtual bool event(QEvent *event) override;
24
25protected:
26 virtual OnInitReturnValue OnInit() override;
27 virtual int OnClean() override;
28 virtual int OnProcess() override;
29
30private Q_SLOTS:
31 void slotMakeDir(const QString& szDir);
32 void slotRemoveDir(const QString& szDir);
33 void slotGetDir(CRemoteFileSystem* pRemoteFileSystem);
34 void slotRemoveFile(const QString& szFile);
35 void slotRename(const QString& oldName, const QString& newName);
36Q_SIGNALS:
37 void sigGetDir(CRemoteFileSystem* pRemoteFileSystem,
38 QVector<QSharedPointer<CRemoteFileSystem> > contents,
39 bool bEnd);
40private Q_SLOTS:
41 void slotStartFileTransfer(QSharedPointer<CFileTransfer> f);
42 void slotStopFileTransfer(QSharedPointer<CFileTransfer> f);
43Q_SIGNALS:
44 void sigFileTransferUpdate(QSharedPointer<CFileTransfer> f);
45
46private:
47 int SetConnect(COperateFileTransfer *pOperate);
48 OnInitReturnValue InitSFTP();
49
50private:
51 COperateFileTransfer* m_pOperate;
52#if HAVE_LIBSSH
53 CChannelSFTP* m_pSFTP;
54#endif
56};
virtual OnInitReturnValue OnInit() override
初始化
virtual int WakeUp() override
唤醒后台线程。
virtual int OnClean() override
清理
virtual int OnProcess() override
具体操作处理
CBackend(COperate *pOperate=nullptr, bool bStopSignal=true)
CBackend
File transfer operate interface