blob: f9e5ba3822d8e108e8900a77bf7e0ce8a0c09e1c [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// -=- FTDialog.h
23
24#ifndef __RFB_WIN32_FTDIALOG_H__
25#define __RFB_WIN32_FTDIALOG_H__
26
27#include <windows.h>
28#include <commctrl.h>
29
30#include <rfb/FileInfo.h>
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000031#include <vncviewer/FileTransfer.h>
Dennis Syrovatsky6c6786d2005-11-07 09:17:38 +000032#include <vncviewer/FTListView.h>
33#include <vncviewer/FTProgress.h>
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000034#include <vncviewer/resource.h>
35
36namespace rfb {
37 namespace win32 {
Dennis Syrovatsky4ab41852005-11-07 09:52:36 +000038 class FileTransfer;
39
Dennis Syrovatsky6c6786d2005-11-07 09:17:38 +000040 class FTDialog
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000041 {
42 public:
43 FTDialog(HINSTANCE hInst, FileTransfer *pFT);
44 ~FTDialog();
45
Dennis Syrovatsky4905c8f2005-11-21 15:52:46 +000046 bool createFTDialog(HWND hwndParent);
Dennis Syrovatsky6c6786d2005-11-07 09:17:38 +000047 bool closeFTDialog();
48 void destroyFTDialog();
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000049
50 static BOOL CALLBACK FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
51
Dennis Syrovatskyd6febeb2005-11-10 04:27:49 +000052 void addRemoteLVItems(FileInfo *pFI);
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000053 void reqFolderUnavailable();
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000054
55 private:
56 FileTransfer *m_pFileTransfer;
57
58 HWND m_hwndFTDialog;
Dennis Syrovatskyb595e032005-11-09 06:24:25 +000059 HWND m_hwndLocalPath;
60 HWND m_hwndRemotePath;
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000061 HINSTANCE m_hInstance;
62
Dennis Syrovatsky8b194ee2005-11-10 08:56:34 +000063 void showLocalLVItems();
64 void showRemoteLVItems();
65
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000066 void onLocalItemActivate(LPNMITEMACTIVATE lpnmia);
67 void onRemoteItemActivate(LPNMITEMACTIVATE lpnmia);
68
Dennis Syrovatsky0b765cc2005-11-10 04:52:10 +000069 void onLocalReload();
70 void onRemoteReload();
71
Dennis Syrovatsky3f079e72005-11-23 05:23:50 +000072 void onLocalRButton();
73 void onRemoteRButton();
74 void showFTMenu(int copyBtnState, int renameBtnState,
75 int deleteBtnState, int cancelBtnState);
76
Dennis Syrovatskyabc2cc52005-11-23 03:52:07 +000077 void onUpload();
78 void onDownload();
79
Dennis Syrovatsky0b765cc2005-11-10 04:52:10 +000080 void setIcon(int dest, int idIcon);
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000081 bool initFTDialog();
82
Dennis Syrovatskyb595e032005-11-09 06:24:25 +000083 void onLocalOneUpFolder();
84 void onRemoteOneUpFolder();
Dennis Syrovatsky0b765cc2005-11-10 04:52:10 +000085 int makeOneUpFolder(char *pPath);
Dennis Syrovatskyabc2cc52005-11-23 03:52:07 +000086
87 void refreshState();
88 void setButtonsState(int uploadBtnState, int downloadBtnState, int cancelBtnState);
Dennis Syrovatsky139d7832005-11-02 05:36:05 +000089
90 bool m_bDlgShown;
Dennis Syrovatsky6c6786d2005-11-07 09:17:38 +000091
92 FTListView *m_pLocalLV;
93 FTListView *m_pRemoteLV;
94
95 FTProgress *m_pProgress;
Dennis Syrovatskyd6febeb2005-11-10 04:27:49 +000096
97 char m_szLocalPath[FT_FILENAME_SIZE];
98 char m_szRemotePath[FT_FILENAME_SIZE];
99 char m_szLocalPathTmp[FT_FILENAME_SIZE];
100 char m_szRemotePathTmp[FT_FILENAME_SIZE];
Dennis Syrovatsky139d7832005-11-02 05:36:05 +0000101 };
102 }
103}
104
105#endif // __RFB_WIN32_FTDIALOG_H__