blob: 805c10ec3904604cf92a7e5a9e7ba31a96b07426 [file] [log] [blame]
Dennis Syrovatsky139d7832005-11-02 05:36:05 +00001/* Copyright (C) 2005 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 *
18 * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
19 *
20 */
21
22// -=- FileTransfer.h
23
24#ifndef __RFB_WIN32_FILETRANSFER_H__
25#define __RFB_WIN32_FILETRANSFER_H__
26
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000027#include <rdr/InStream.h>
28#include <rdr/OutStream.h>
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000029#include <rfb/msgTypes.h>
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000030#include <rfb/FileInfo.h>
31#include <rfb/TransferQueue.h>
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000032#include <vncviewer/FTDialog.h>
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000033#include <vncviewer/FTMsgReader.h>
34#include <vncviewer/FTMsgWriter.h>
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000035
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000036namespace rfb {
37 namespace win32 {
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000038 class FTDialog;
39
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000040 class FileTransfer
41 {
42 public:
43 FileTransfer();
44 ~FileTransfer();
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000045
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000046 bool initialize(rdr::InStream *pIS, rdr::OutStream *pOS);
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000047 bool processFTMsg(int type);
Dennis Syrovatsky4905c8f2005-11-21 15:52:46 +000048 bool show(HWND hwndParent);
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000049
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000050 void requestFileList(char *pPath, int dest, bool bDirOnly);
51
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000052 private:
53 bool m_bFTDlgShown;
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000054 bool m_bInitialized;
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000055
56 FTDialog *m_pFTDialog;
Dennis Syrovatsky5c761172005-11-09 04:19:05 +000057
Dennis Syrovatsky63943a32005-11-10 06:24:56 +000058 FTMsgReader *m_pReader;
59 FTMsgWriter *m_pWriter;
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000060
61 FileInfo m_queueFileListRqst;
Dennis Syrovatskyc08f0422005-11-10 06:36:46 +000062
63 bool procFileListDataMsg();
Dennis Syrovatskyc08f0422005-11-10 06:36:46 +000064 bool procFileDownloadDataMsg();
65 bool procFileUploadCancelMsg();
66 bool procFileDownloadFailedMsg();
67 bool procFileDirSizeDataMsg();
68 bool procFileLastRqstFailedMsg();
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000069
70 bool procFLRMain(FileInfo *pFI);
71 bool procFLRBrowse(FileInfo *pFI);
72 bool procFLRUpload(FileInfo *pFI);
73 bool procFLRDownload(FileInfo *pFI);
74 bool procFLRDelete(FileInfo *pFI);
75 bool procFLRRename(FileInfo *pFI);
76
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000077 };
78 }
79}
80
81#endif // __RFB_WIN32_FILETRANSFER_H__