Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 1 | /* 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 Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 31 | #include <vncviewer/FileTransfer.h> |
Dennis Syrovatsky | 6c6786d | 2005-11-07 09:17:38 +0000 | [diff] [blame] | 32 | #include <vncviewer/FTListView.h> |
| 33 | #include <vncviewer/FTProgress.h> |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 34 | #include <vncviewer/resource.h> |
| 35 | |
| 36 | namespace rfb { |
| 37 | namespace win32 { |
Dennis Syrovatsky | 4ab4185 | 2005-11-07 09:52:36 +0000 | [diff] [blame] | 38 | class FileTransfer; |
| 39 | |
Dennis Syrovatsky | 6c6786d | 2005-11-07 09:17:38 +0000 | [diff] [blame] | 40 | class FTDialog |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 41 | { |
| 42 | public: |
| 43 | FTDialog(HINSTANCE hInst, FileTransfer *pFT); |
| 44 | ~FTDialog(); |
| 45 | |
Dennis Syrovatsky | 4905c8f | 2005-11-21 15:52:46 +0000 | [diff] [blame] | 46 | bool createFTDialog(HWND hwndParent); |
Dennis Syrovatsky | 6c6786d | 2005-11-07 09:17:38 +0000 | [diff] [blame] | 47 | bool closeFTDialog(); |
| 48 | void destroyFTDialog(); |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 49 | |
| 50 | static BOOL CALLBACK FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 51 | |
Dennis Syrovatsky | d6febeb | 2005-11-10 04:27:49 +0000 | [diff] [blame] | 52 | void addRemoteLVItems(FileInfo *pFI); |
Dennis Syrovatsky | 8b194ee | 2005-11-10 08:56:34 +0000 | [diff] [blame] | 53 | void reqFolderUnavailable(); |
Dennis Syrovatsky | 6806fec | 2005-11-28 06:12:44 +0000 | [diff] [blame^] | 54 | |
| 55 | void setStatusText(char *pText); |
| 56 | |
| 57 | FTProgress *m_pProgress; |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 58 | |
| 59 | private: |
| 60 | FileTransfer *m_pFileTransfer; |
| 61 | |
| 62 | HWND m_hwndFTDialog; |
Dennis Syrovatsky | b595e03 | 2005-11-09 06:24:25 +0000 | [diff] [blame] | 63 | HWND m_hwndLocalPath; |
| 64 | HWND m_hwndRemotePath; |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 65 | HINSTANCE m_hInstance; |
| 66 | |
Dennis Syrovatsky | 8b194ee | 2005-11-10 08:56:34 +0000 | [diff] [blame] | 67 | void showLocalLVItems(); |
| 68 | void showRemoteLVItems(); |
| 69 | |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 70 | void onLocalItemActivate(LPNMITEMACTIVATE lpnmia); |
| 71 | void onRemoteItemActivate(LPNMITEMACTIVATE lpnmia); |
| 72 | |
Dennis Syrovatsky | 0b765cc | 2005-11-10 04:52:10 +0000 | [diff] [blame] | 73 | void onLocalReload(); |
| 74 | void onRemoteReload(); |
| 75 | |
Dennis Syrovatsky | 3f079e7 | 2005-11-23 05:23:50 +0000 | [diff] [blame] | 76 | void onLocalRButton(); |
| 77 | void onRemoteRButton(); |
Dennis Syrovatsky | be4956b | 2005-11-23 09:15:12 +0000 | [diff] [blame] | 78 | void showFTMenu(bool copyBtnState, bool createFldBtnState, |
| 79 | bool renameBtnState, bool deleteBtnState, |
| 80 | bool cancelBtnState); |
| 81 | void onFTMenuCommand(int command); |
Dennis Syrovatsky | 3f079e7 | 2005-11-23 05:23:50 +0000 | [diff] [blame] | 82 | |
Dennis Syrovatsky | abc2cc5 | 2005-11-23 03:52:07 +0000 | [diff] [blame] | 83 | void onUpload(); |
| 84 | void onDownload(); |
| 85 | |
Dennis Syrovatsky | be4956b | 2005-11-23 09:15:12 +0000 | [diff] [blame] | 86 | void onLocalRename(); |
| 87 | void onRemoteRename(); |
| 88 | |
| 89 | void onLocalDelete(); |
| 90 | void onRemoteDelete(); |
| 91 | |
| 92 | void onFTCancel(); |
| 93 | |
Dennis Syrovatsky | 0b765cc | 2005-11-10 04:52:10 +0000 | [diff] [blame] | 94 | void setIcon(int dest, int idIcon); |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 95 | bool initFTDialog(); |
| 96 | |
Dennis Syrovatsky | b595e03 | 2005-11-09 06:24:25 +0000 | [diff] [blame] | 97 | void onLocalOneUpFolder(); |
| 98 | void onRemoteOneUpFolder(); |
Dennis Syrovatsky | 0b765cc | 2005-11-10 04:52:10 +0000 | [diff] [blame] | 99 | int makeOneUpFolder(char *pPath); |
Dennis Syrovatsky | abc2cc5 | 2005-11-23 03:52:07 +0000 | [diff] [blame] | 100 | |
Dennis Syrovatsky | be4956b | 2005-11-23 09:15:12 +0000 | [diff] [blame] | 101 | void refreshBtnState(); |
| 102 | void setButtonsState(); |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 103 | |
| 104 | bool m_bDlgShown; |
Dennis Syrovatsky | 6c6786d | 2005-11-07 09:17:38 +0000 | [diff] [blame] | 105 | |
| 106 | FTListView *m_pLocalLV; |
| 107 | FTListView *m_pRemoteLV; |
| 108 | |
Dennis Syrovatsky | be4956b | 2005-11-23 09:15:12 +0000 | [diff] [blame] | 109 | int m_FTMenuSource; |
| 110 | |
Dennis Syrovatsky | d6febeb | 2005-11-10 04:27:49 +0000 | [diff] [blame] | 111 | char m_szLocalPath[FT_FILENAME_SIZE]; |
| 112 | char m_szRemotePath[FT_FILENAME_SIZE]; |
| 113 | char m_szLocalPathTmp[FT_FILENAME_SIZE]; |
| 114 | char m_szRemotePathTmp[FT_FILENAME_SIZE]; |
Dennis Syrovatsky | be4956b | 2005-11-23 09:15:12 +0000 | [diff] [blame] | 115 | |
| 116 | typedef struct tagFTBUTTONSSTATE |
| 117 | { |
| 118 | bool uploadBtn; |
| 119 | bool downloadBtn; |
| 120 | bool createLocalFldBtn; |
| 121 | bool createRemoteFldBtn; |
| 122 | bool renameLocalBtn; |
| 123 | bool renameRemoteBtn; |
| 124 | bool deleteLocalBtn; |
| 125 | bool deleteRemoteBtn; |
| 126 | bool cancelBtn; |
| 127 | } FTBUTTONSSTATE; |
| 128 | |
| 129 | FTBUTTONSSTATE m_BtnState; |
Dennis Syrovatsky | 139d783 | 2005-11-02 05:36:05 +0000 | [diff] [blame] | 130 | }; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | #endif // __RFB_WIN32_FTDIALOG_H__ |