CustomScpExplorer.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. //---------------------------------------------------------------------------
  2. #ifndef CustomScpExplorerH
  3. #define CustomScpExplorerH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <CustomDirView.hpp>
  10. #include <CustomUnixDirView.hpp>
  11. #include <IEListView.hpp>
  12. #include <NortonLikeListView.hpp>
  13. #include <UnixDirView.h>
  14. #include <ComCtrls.hpp>
  15. #include <ExtCtrls.hpp>
  16. #include <ToolWin.hpp>
  17. #include <WinInterface.h>
  18. #include <WinConfiguration.h>
  19. #include <Terminal.h>
  20. #include <Queue.h>
  21. #include "QueueController.h"
  22. #include "UnixDriveView.h"
  23. #include "CustomDriveView.hpp"
  24. #include "TBX.hpp"
  25. #include "TB2Dock.hpp"
  26. #include "TBXExtItems.hpp"
  27. #include "TBXStatusBars.hpp"
  28. #include "TB2Item.hpp"
  29. #include "TB2Toolbar.hpp"
  30. #include "TBXToolPals.hpp"
  31. #include "PngImageList.hpp"
  32. #include "ThemePageControl.h"
  33. #include "PathLabel.hpp"
  34. #include <Vcl.AppEvnts.hpp>
  35. //---------------------------------------------------------------------------
  36. class TProgressForm;
  37. class TSynchronizeProgressForm;
  38. class TTerminalQueue;
  39. class TTerminalQueueStatus;
  40. class TQueueItem;
  41. class TQueueItemProxy;
  42. class TQueueController;
  43. class TSynchronizeController;
  44. class TEditorManager;
  45. class TEditorData;
  46. class TTransferPresetNoteData;
  47. struct TEditedFileData;
  48. class ITaskbarList3;
  49. //---------------------------------------------------------------------------
  50. enum TActionAllowed { aaShortCut, aaUpdate, aaExecute };
  51. enum TActionFlag { afLocal = 1, afRemote = 2, afExplorer = 4 , afCommander = 8 };
  52. enum TExecuteFileBy { efShell = 1, efInternalEditor = 2, efExternalEditor = 3, efDefaultEditor = 100 };
  53. enum TPanelExport { pePath, peFileList, peFullFileList };
  54. enum TPanelExportDestination { pedClipboard, pedCommandLine };
  55. enum TCopyOperationCommandFlag {
  56. cocNone = 0x00, cocShortCutHint = 0x01, cocQueue = 0x02, cocNonQueue = 0x04
  57. };
  58. enum TCustomCommandListType { ccltAll, ccltBoth, ccltNonFile, ccltFile };
  59. //---------------------------------------------------------------------------
  60. class TCustomScpExplorerForm : public TForm
  61. {
  62. __published:
  63. TPanel *RemotePanel;
  64. TTBXStatusBar *RemoteStatusBar;
  65. TUnixDirView *RemoteDirView;
  66. TTBXDock *TopDock;
  67. TListView *QueueView3;
  68. TPanel *QueuePanel;
  69. TSplitter *QueueSplitter;
  70. TTBXToolbar *QueueToolbar;
  71. TTBXDock *QueueDock;
  72. TTBXItem *QueueEnableItem;
  73. TTBXSeparatorItem *TBXSeparatorItem203;
  74. TTBXItem *TBXItem201;
  75. TTBXItem *TBXItem202;
  76. TTBXItem *TBXItem203;
  77. TTBXItem *TBXItem204;
  78. TTBXItem *TBXItem205;
  79. TTBXSeparatorItem *TBXSeparatorItem201;
  80. TTBXItem *TBXItem206;
  81. TTBXItem *TBXItem207;
  82. TTBXSeparatorItem *TBXSeparatorItem202;
  83. TTBXItem *TBXItem208;
  84. TUnixDriveView *RemoteDriveView;
  85. TSplitter *RemotePanelSplitter;
  86. TTBXItem *TBXItem194;
  87. TTBXItem *TBXItem195;
  88. TTBXSubmenuItem *TBXSubmenuItem27;
  89. TTBXItem *TBXItem211;
  90. TTBXItem *TBXItem225;
  91. TTBXItem *TBXItem226;
  92. TTabSheet *TabSheet1;
  93. TThemePageControl *SessionsPageControl;
  94. TPathLabel *QueueLabel;
  95. TTBXSeparatorItem *TBXSeparatorItem57;
  96. TTBXItem *QueueDeleteAllDoneQueueToolbarItem;
  97. TTBXItem *TBXItem173;
  98. TApplicationEvents *ApplicationEvents;
  99. void __fastcall ApplicationMinimize(TObject * Sender);
  100. void __fastcall ApplicationRestore(TObject * Sender);
  101. void __fastcall RemoteDirViewContextPopup(TObject *Sender,
  102. const TPoint &MousePos, bool &Handled);
  103. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  104. void __fastcall RemoteDirViewDisplayProperties(TObject *Sender);
  105. void __fastcall DirViewColumnRightClick(TObject *Sender,
  106. TListColumn *Column, TPoint &Point);
  107. void __fastcall DirViewExecFile(TObject *Sender, TListItem *Item, bool &AllowExec);
  108. void __fastcall ToolBarResize(TObject *Sender);
  109. void __fastcall FileControlDDDragEnter(TObject *Sender,
  110. _di_IDataObject DataObj, int grfKeyState, const TPoint &Point,
  111. int &dwEffect, bool &Accept);
  112. void __fastcall FileControlDDDragLeave(TObject *Sender);
  113. void __fastcall RemoteFileControlDDCreateDragFileList(TObject *Sender,
  114. TFileList *FileList, bool &Created);
  115. void __fastcall RemoteFileControlDDEnd(TObject *Sender);
  116. void __fastcall RemoteFileControlDDCreateDataObject(TObject *Sender,
  117. TDataObject *&DataObject);
  118. void __fastcall RemoteFileControlDDGiveFeedback(TObject *Sender,
  119. int dwEffect, HRESULT &Result);
  120. void __fastcall QueueSplitterCanResize(TObject *Sender, int &NewSize,
  121. bool &Accept);
  122. void __fastcall QueueView3ContextPopup(TObject *Sender, TPoint &MousePos,
  123. bool &Handled);
  124. void __fastcall QueueView3Deletion(TObject *Sender, TListItem *Item);
  125. void __fastcall QueueView3StartDrag(TObject *Sender,
  126. TDragObject *&DragObject);
  127. void __fastcall QueueView3DragOver(TObject *Sender, TObject *Source,
  128. int X, int Y, TDragState State, bool &Accept);
  129. void __fastcall QueueView3DragDrop(TObject *Sender, TObject *Source,
  130. int X, int Y);
  131. void __fastcall QueueView3Enter(TObject *Sender);
  132. void __fastcall QueueView3SelectItem(TObject *Sender, TListItem *Item,
  133. bool Selected);
  134. void __fastcall RemoteFileControlDDFileOperation(TObject * Sender,
  135. int Effect, UnicodeString SourcePath, UnicodeString TargetPath,
  136. bool & DoOperation);
  137. void __fastcall RemoteFileContolDDChooseEffect(TObject * Sender,
  138. int grfKeyState, int & dwEffect);
  139. void __fastcall RemoteFileControlDDDragFileName(TObject * Sender,
  140. TRemoteFile * File, UnicodeString & FileName);
  141. void __fastcall RemoteFileControlDDDragDetect(TObject * Sender,
  142. int grfKeyState, const TPoint & DetectStart, const TPoint & Point,
  143. TDragDetectStatus DragStatus);
  144. void __fastcall RemoteFileControlDDQueryContinueDrag(TObject *Sender,
  145. BOOL FEscapePressed, int grfKeyState, HRESULT &Result);
  146. void __fastcall RemoteDirViewEnter(TObject *Sender);
  147. void __fastcall RemoteDriveViewEnter(TObject *Sender);
  148. void __fastcall DirViewMatchMask(TObject *Sender, UnicodeString FileName,
  149. bool Directory, __int64 Size, TDateTime Modification,
  150. UnicodeString Masks, bool &Matches, bool AllowImplicitMatches);
  151. void __fastcall DirViewGetOverlay(TObject *Sender, TListItem *Item,
  152. WORD &Indexes);
  153. void __fastcall DirViewHistoryChange(TCustomDirView *Sender);
  154. void __fastcall RemoteStatusBarClick(TObject *Sender);
  155. void __fastcall DirViewLoaded(TObject *Sender);
  156. void __fastcall ToolbarGetBaseSize(TTBCustomToolbar * Toolbar, TPoint & ASize);
  157. void __fastcall FormConstrainedResize(TObject * Sender, int & MinWidth,
  158. int &MinHeight, int &MaxWidth, int &MaxHeight);
  159. void __fastcall StatusBarPanelDblClick(TTBXCustomStatusBar * Sender,
  160. TTBXStatusPanel * Panel);
  161. void __fastcall RemotePathComboBoxAdjustImageIndex(
  162. TTBXComboBoxItem * Sender, const UnicodeString AText, int AIndex,
  163. int & ImageIndex);
  164. void __fastcall RemotePathComboBoxDrawItem(TTBXCustomList * Sender,
  165. TCanvas * ACanvas, TRect & ARect, int AIndex, int AHoverIndex,
  166. bool & DrawDefault);
  167. void __fastcall RemotePathComboBoxMeasureWidth(TTBXCustomList * Sender,
  168. TCanvas * ACanvas, int AIndex, int & AWidth);
  169. void __fastcall RemotePathComboBoxItemClick(TObject * Sender);
  170. void __fastcall RemotePathComboBoxCancel(TObject * Sender);
  171. void __fastcall DirViewEditing(TObject *Sender, TListItem *Item,
  172. bool &AllowEdit);
  173. void __fastcall FormShow(TObject *Sender);
  174. void __fastcall SessionsPageControlChange(TObject *Sender);
  175. void __fastcall SessionsPageControlMouseDown(TObject *Sender, TMouseButton Button,
  176. TShiftState Shift, int X, int Y);
  177. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  178. void __fastcall RemoteDirViewRead(TObject *Sender);
  179. void __fastcall DirViewSelectItem(TObject *Sender, TListItem *Item, bool Selected);
  180. void __fastcall SessionsPageControlDragDrop(TObject *Sender, TObject *Source, int X,
  181. int Y);
  182. void __fastcall SessionsPageControlDragOver(TObject *Sender, TObject *Source, int X,
  183. int Y, TDragState State, bool &Accept);
  184. void __fastcall QueueView3Exit(TObject *Sender);
  185. void __fastcall EditMenuItemPopup(TTBCustomItem *Sender, bool FromLink);
  186. void __fastcall DirViewBusy(TObject *Sender, int Busy, bool & Allow);
  187. void __fastcall SessionsPageControlContextPopup(TObject *Sender, TPoint &MousePos, bool &Handled);
  188. private:
  189. TTerminal * FTerminal;
  190. TTerminalQueue * FQueue;
  191. TTerminalQueueStatus * FQueueStatus;
  192. TCriticalSection * FQueueStatusSection;
  193. bool FQueueStatusInvalidated;
  194. bool FQueueItemInvalidated;
  195. bool FFormRestored;
  196. bool FAutoOperation;
  197. TFileOperationFinishedEvent FOnFileOperationFinished;
  198. bool FForceExecution;
  199. unsigned short FIgnoreNextDialogChar;
  200. TStringList * FErrorList;
  201. HANDLE FDDExtMutex;
  202. UnicodeString FDragExtFakeDirectory;
  203. TStrings * FDelayedDeletionList;
  204. TTimer * FDelayedDeletionTimer;
  205. TStrings * FDDFileList;
  206. __int64 FDDTotalSize;
  207. std::unique_ptr<ExtException> FDragDropSshTerminate;
  208. HINSTANCE FOle32Library;
  209. HCURSOR FDragMoveCursor;
  210. UnicodeString FDragTempDir;
  211. bool FRefreshLocalDirectory;
  212. bool FRefreshRemoteDirectory;
  213. TListItem * FQueueActedItem;
  214. TQueueController * FQueueController;
  215. int FLastDropEffect;
  216. bool FPendingTempSpaceWarn;
  217. TEditorManager * FEditorManager;
  218. TList * FLocalEditors;
  219. TStrings * FCapturedLog;
  220. bool FDragDropOperation;
  221. UnicodeString FCopyParamDefault;
  222. UnicodeString FCopyParamAutoSelected;
  223. bool FEditingFocusedAdHocCommand;
  224. TList * FDocks;
  225. TSynchronizeController * FSynchronizeController;
  226. UnicodeString FTransferDropDownHint;
  227. int FTransferListHoverIndex;
  228. TColor FSessionColor;
  229. TPngImageList * FSessionColors;
  230. int FNewSessionTabImageIndex;
  231. int FSessionTabImageIndex;
  232. int FSessionColorMaskImageIndex;
  233. ::TTrayIcon * FTrayIcon;
  234. TCustomCommandType FLastCustomCommand;
  235. TFileMasks FDirViewMatchMask;
  236. TTBXPopupMenu * FCustomCommandMenu;
  237. TStrings * FCustomCommandLocalFileList;
  238. TStrings * FCustomCommandRemoteFileList;
  239. ITaskbarList3 * FTaskbarList;
  240. bool FShowing;
  241. int FMaxQueueLength;
  242. TDateTime FSessionsPageControlNewSessionTime;
  243. bool FAppIdle;
  244. typedef std::set<TTBCustomItem *> TItemsWithTextDisplayMode;
  245. TItemsWithTextDisplayMode FItemsWithTextDisplayMode;
  246. HWND FHiddenWindow;
  247. TStrings * FTransferResumeList;
  248. bool FMoveToQueue;
  249. bool FStandaloneEditing;
  250. TFeedSynchronizeError FOnFeedSynchronizeError;
  251. bool FNeedSession;
  252. TTerminal * FFileFindTerminal;
  253. bool __fastcall GetEnableFocusedOperation(TOperationSide Side, int FilesOnly);
  254. bool __fastcall GetEnableSelectedOperation(TOperationSide Side, int FilesOnly);
  255. void __fastcall SetTerminal(TTerminal * value);
  256. void __fastcall SetQueue(TTerminalQueue * value);
  257. void __fastcall TransferListChange(TObject * Sender);
  258. void __fastcall TransferListDrawItem(TTBXCustomList * Sender, TCanvas * ACanvas,
  259. const TRect & ARect, int AIndex, int AHoverIndex, bool & DrawDefault);
  260. void __fastcall CloseInternalEditor(TObject * Sender);
  261. void __fastcall ForceCloseInternalEditor(TObject * Sender);
  262. void __fastcall ForceCloseLocalEditors();
  263. void __fastcall TerminalCaptureLog(const UnicodeString & AddedLine, TCaptureOutputType OutputType);
  264. void __fastcall HistoryItemClick(System::TObject* Sender);
  265. void __fastcall UpdateHistoryMenu(TOperationSide Side, bool Back);
  266. void __fastcall AdHocCustomCommandValidate(const TCustomCommandType & Command);
  267. void __fastcall SetDockAllowDrag(bool value);
  268. void __fastcall QueueSplitterDblClick(TObject * Sender);
  269. void __fastcall AddQueueItem(TTerminalQueue * Queue, TTransferDirection Direction,
  270. TStrings * FileList, const UnicodeString TargetDirectory,
  271. const TGUICopyParamType & CopyParam, int Params);
  272. void __fastcall AddQueueItem(TTerminalQueue * Queue, TQueueItem * QueueItem, TTerminal * Terminal);
  273. void __fastcall ClearTransferSourceSelection(TTransferDirection Direction);
  274. void __fastcall SessionsDDDragOver(int KeyState, const TPoint & Point, int & Effect);
  275. void __fastcall SessionsDDProcessDropped(TObject * Sender, int KeyState, const TPoint & Point, int Effect);
  276. void __fastcall RemoteFileControlDragDropFileOperation(
  277. TObject * Sender, int Effect, UnicodeString TargetPath, bool ForceQueue);
  278. void __fastcall SessionsDDDragEnter(_di_IDataObject DataObj, int KeyState,
  279. const TPoint & Point, int & Effect, bool & Accept);
  280. void __fastcall SessionsDDDragLeave();
  281. void __fastcall QueueDDProcessDropped(TObject * Sender, int KeyState, const TPoint & Point, int Effect);
  282. void __fastcall QueueDDDragEnter(_di_IDataObject DataObj, int KeyState,
  283. const TPoint & Point, int & Effect, bool & Accept);
  284. void __fastcall QueueDDDragLeave();
  285. void __fastcall EnableDDTransferConfirmation(TObject * Sender);
  286. void __fastcall CollectItemsWithTextDisplayMode(TWinControl * Control);
  287. void __fastcall CreateHiddenWindow();
  288. bool __fastcall IsQueueAutoPopup();
  289. void __fastcall UpdateSessionsPageControlHeight();
  290. TDragDropFilesEx * __fastcall CreateDragDropFilesEx();
  291. void __fastcall KeyProcessed(Word & Key, TShiftState Shift);
  292. void __fastcall CheckCustomCommandShortCut(TCustomCommandList * List, Word & Key, Classes::TShiftState Shift, TShortCut KeyShortCut);
  293. bool __fastcall CanPasteToDirViewFromClipBoard();
  294. void __fastcall CMShowingChanged(TMessage & Message);
  295. void __fastcall WMClose(TMessage & Message);
  296. void __fastcall CMDpiChanged(TMessage & Message);
  297. void __fastcall WMDpiChanged(TMessage & Message);
  298. protected:
  299. TOperationSide FCurrentSide;
  300. bool FEverShown;
  301. TControl * FDDTargetControl;
  302. TProgressForm * FProgressForm;
  303. TSynchronizeProgressForm * FSynchronizeProgressForm;
  304. HANDLE FDDExtMapFile;
  305. bool FDDMoveSlipped;
  306. TTimer * FUserActionTimer;
  307. TQueueItemProxy * FPendingQueueActionItem;
  308. TTBXPopupMenu * FHistoryMenu[2][2];
  309. bool FAllowTransferPresetAutoSelect;
  310. TStrings * FNotes;
  311. TTimer * FNoteTimer;
  312. TDateTime FNoteShown;
  313. UnicodeString FNote;
  314. TObject * FNoteData;
  315. UnicodeString FNoteHints;
  316. TNotifyEvent FOnNoteClick;
  317. unsigned int FLockLevel;
  318. unsigned int FLockSuspendLevel;
  319. bool FDisabledOnLockSuspend;
  320. bool FAlternativeDelete;
  321. TDragDropFilesEx * FSessionsDragDropFilesEx;
  322. TDragDropFilesEx * FQueueDragDropFilesEx;
  323. TPoint FLastContextPopupScreenPoint;
  324. bool FRemoteDirViewWasFocused;
  325. virtual bool __fastcall CopyParamDialog(TTransferDirection Direction,
  326. TTransferType Type, bool Temp, TStrings * FileList,
  327. UnicodeString & TargetDirectory, TGUICopyParamType & CopyParam, bool Confirm,
  328. bool DragDrop, int Options);
  329. virtual void __fastcall CopyParamDialogAfter(TTransferDirection Direction, bool Temp, const UnicodeString & TargetDirectory);
  330. virtual bool __fastcall RemoteTransferDialog(TTerminal *& Session,
  331. TStrings * FileList, UnicodeString & Target, UnicodeString & FileMask, bool & DirectCopy,
  332. bool NoConfirmation, bool Move);
  333. virtual void __fastcall CreateParams(TCreateParams & Params);
  334. void __fastcall DeleteFiles(TOperationSide Side, TStrings * FileList, bool Alternative);
  335. bool __fastcall RemoteTransferFiles(TStrings * FileList, bool NoConfirmation,
  336. bool Move, TTerminal * Session);
  337. virtual void __fastcall DoDirViewExecFile(TObject * Sender, TListItem * Item, bool & AllowExec);
  338. virtual TControl * __fastcall GetComponent(Byte Component);
  339. bool __fastcall GetComponentVisible(Byte Component);
  340. virtual Boolean __fastcall GetHasDirView(TOperationSide Side);
  341. DYNAMIC void __fastcall KeyDown(Word & Key, Classes::TShiftState Shift);
  342. virtual void __fastcall RestoreFormParams();
  343. virtual void __fastcall RestoreParams();
  344. virtual void __fastcall SetComponentVisible(Byte Component, bool value);
  345. virtual void __fastcall ComponentShowing(Byte Component, bool value);
  346. virtual void __fastcall FixControlsPlacement();
  347. bool __fastcall SetProperties(TOperationSide Side, TStrings * FileList);
  348. void __fastcall CustomCommand(TStrings * FileList,
  349. const TCustomCommandType & Command, TStrings * ALocalFileList);
  350. void __fastcall RemoteCustomCommand(
  351. TStrings * FileList, const TCustomCommandType & ACommand,
  352. const TCustomCommandData & Data, const UnicodeString & CommandCommand);
  353. void __fastcall LocalCustomCommandPure(
  354. TStrings * FileList, const TCustomCommandType & ACommand, const UnicodeString & Command, TStrings * ALocalFileList,
  355. const TCustomCommandData & Data, bool LocalFileCommand, bool FileListCommand, UnicodeString * POutput);
  356. void __fastcall LocalCustomCommandWithRemoteFiles(
  357. const TCustomCommandType & ACommand, const UnicodeString & Command, const TCustomCommandData & Data,
  358. bool FileListCommand, UnicodeString * POutput);
  359. void __fastcall LocalCustomCommand(TStrings * FileList,
  360. const TCustomCommandType & ACommand, TStrings * ALocalFileList,
  361. const TCustomCommandData & Data, const UnicodeString & CommandCommand);
  362. virtual void __fastcall TerminalChanging();
  363. virtual void __fastcall TerminalChanged();
  364. virtual void __fastcall QueueChanged();
  365. void __fastcall InitStatusBar();
  366. void __fastcall UpdateStatusBar();
  367. virtual void __fastcall UpdateStatusPanelText(TTBXStatusPanel * Panel);
  368. virtual void __fastcall DoOperationFinished(TFileOperation Operation,
  369. TOperationSide Side, bool Temp, const UnicodeString & FileName, bool Success,
  370. TOnceDoneOperation & OnceDoneOperation);
  371. virtual void __fastcall DoOpenDirectoryDialog(TOpenDirectoryMode Mode, TOperationSide Side);
  372. virtual void __fastcall FileOperationProgress(TFileOperationProgressType & ProgressData);
  373. void __fastcall OperationComplete(const TDateTime & StartTime);
  374. void __fastcall ExecutedFileChanged(const UnicodeString FileName,
  375. TEditedFileData * Data, HANDLE UploadCompleteEvent);
  376. void __fastcall ExecutedFileReload(const UnicodeString FileName,
  377. const TEditedFileData * Data);
  378. void __fastcall ExecutedFileEarlyClosed(const TEditedFileData * Data,
  379. bool & KeepOpen);
  380. void __fastcall ExecutedFileUploadComplete(TObject * Sender);
  381. void __fastcall CMDialogChar(TMessage & AMessage);
  382. inline void __fastcall WMAppCommand(TMessage & Message);
  383. inline void __fastcall WMSysCommand(TMessage & Message);
  384. void __fastcall WMQueryEndSession(TMessage & Message);
  385. void __fastcall WMEndSession(TWMEndSession & Message);
  386. #ifdef _DEBUG
  387. inline void __fastcall WMWindowPosChanged(TWMWindowPosMsg & Message);
  388. #endif
  389. void __fastcall WMCopyData(TMessage & Message);
  390. virtual void __fastcall SysResizing(unsigned int Cmd);
  391. DYNAMIC void __fastcall DoShow();
  392. TStrings * __fastcall CreateVisitedDirectories(TOperationSide Side);
  393. void __fastcall HandleErrorList(TStringList *& ErrorList);
  394. void __fastcall TerminalSynchronizeDirectory(const UnicodeString LocalDirectory,
  395. const UnicodeString RemoteDirectory, bool & Continue, bool Collect);
  396. void __fastcall DoSynchronize(TSynchronizeController * Sender,
  397. const UnicodeString LocalDirectory, const UnicodeString RemoteDirectory,
  398. const TCopyParamType & CopyParam, const TSynchronizeParamType & Params,
  399. TSynchronizeChecklist ** Checklist, TSynchronizeOptions * Options, bool Full);
  400. void __fastcall DoSynchronizeInvalid(TSynchronizeController * Sender,
  401. const UnicodeString Directory, const UnicodeString ErrorStr);
  402. void __fastcall DoSynchronizeTooManyDirectories(TSynchronizeController * Sender,
  403. int & MaxDirectories);
  404. void __fastcall Synchronize(const UnicodeString LocalDirectory,
  405. const UnicodeString RemoteDirectory, TSynchronizeMode Mode,
  406. const TCopyParamType & CopyParam, int Params, TSynchronizeChecklist ** Checklist,
  407. TSynchronizeOptions * Options);
  408. void __fastcall SynchronizeSessionLog(const UnicodeString & Message);
  409. void __fastcall GetSynchronizeOptions(int Params, TSynchronizeOptions & Options);
  410. bool __fastcall SynchronizeAllowSelectedOnly();
  411. virtual void __fastcall BatchStart(void *& Storage);
  412. virtual void __fastcall BatchEnd(void * Storage);
  413. bool __fastcall ExecuteFileOperation(TFileOperation Operation, TOperationSide Side,
  414. TStrings * FileList, bool NoConfirmation, void * Param);
  415. virtual bool __fastcall DDGetTarget(UnicodeString & Directory,
  416. bool & ForceQueue, bool & Internal);
  417. virtual void __fastcall DDExtInitDrag(TFileList * FileList, bool & Created);
  418. virtual void __fastcall SideEnter(TOperationSide Side);
  419. virtual TOperationSide __fastcall GetSide(TOperationSide Side);
  420. TStrings * __fastcall PanelExport(TOperationSide Side, TPanelExport Export);
  421. virtual void __fastcall PanelExportStore(TOperationSide Side,
  422. TPanelExport Export, TPanelExportDestination Destination,
  423. TStrings * ExportData);
  424. void __fastcall GenerateUrl(TStrings * Paths);
  425. void __fastcall QueueListUpdate(TTerminalQueue * Queue);
  426. void __fastcall QueueItemUpdate(TTerminalQueue * Queue, TQueueItem * Item);
  427. void __fastcall UpdateQueueStatus(bool QueueChanging);
  428. void __fastcall RefreshQueueItems();
  429. virtual int __fastcall GetStaticComponentsHeight();
  430. void __fastcall FillQueueViewItem(TListItem * Item,
  431. TQueueItemProxy * QueueItem, bool Detail);
  432. void __fastcall QueueViewDeleteItem(int Index);
  433. void __fastcall UserActionTimer(TObject * Sender);
  434. void __fastcall UpdateQueueView();
  435. bool __fastcall CanCloseQueue();
  436. virtual bool __fastcall IsFileControl(TObject * Control, TOperationSide Side);
  437. virtual void __fastcall ReloadLocalDirectory(const UnicodeString Directory = L"");
  438. virtual bool __fastcall PanelOperation(TOperationSide Side, bool DragDrop);
  439. void __fastcall DoWarnLackOfTempSpace(const UnicodeString Path,
  440. __int64 RequiredSpace, bool & Continue);
  441. void __fastcall AddDelayedDirectoryDeletion(const UnicodeString TempDir, int SecDelay);
  442. void __fastcall DoDelayedDeletion(TObject * Sender);
  443. TDragDropFilesEx * __fastcall DragDropFiles(TObject * Sender);
  444. void __fastcall RemoteFileControlDDTargetDrop();
  445. bool __fastcall RemoteFileControlFileOperation(TObject * Sender,
  446. TFileOperation Operation, bool NoConfirmation, void * Param);
  447. void __fastcall DDDownload(TStrings * FilesToCopy,
  448. const UnicodeString TargetDir, const TCopyParamType * CopyParam, int Params);
  449. bool __fastcall EnsureCommandSessionFallback(TFSCapability Capability);
  450. bool __fastcall CommandSessionFallback();
  451. void __fastcall FileTerminalRemoved(const UnicodeString FileName,
  452. TEditedFileData * Data, TObject * Token, void * Arg);
  453. void __fastcall FileConfigurationChanged(const UnicodeString FileName,
  454. TEditedFileData * Data, TObject * Token, void * Arg);
  455. void __fastcall CustomExecuteFile(TOperationSide Side,
  456. TExecuteFileBy ExecuteFileBy, UnicodeString FileName, UnicodeString OriginalFileName,
  457. const TEditorData * ExternalEditor, UnicodeString LocalRootDirectory,
  458. UnicodeString RemoteDirectory);
  459. void __fastcall ExecuteFile(TOperationSide Side,
  460. TExecuteFileBy ExecuteFileBy, const TEditorData * ExternalEditor,
  461. UnicodeString FullFileName, TObject * Object,
  462. const TFileMasks::TParams & MaskParams);
  463. bool __fastcall RemoteExecuteForceText(TExecuteFileBy ExecuteFileBy,
  464. const TEditorData * ExternalEditor);
  465. void __fastcall ExecuteFileNormalize(TExecuteFileBy & ExecuteFileBy,
  466. const TEditorData *& ExternalEditor, const UnicodeString & FileName,
  467. bool Local, const TFileMasks::TParams & MaskParams);
  468. void __fastcall ExecuteRemoteFile(
  469. const UnicodeString & FullFileName, TRemoteFile * File, TExecuteFileBy ExecuteFileBy);
  470. void __fastcall TemporaryFileCopyParam(TCopyParamType & CopyParam);
  471. void __fastcall TemporaryDirectoryForRemoteFiles(
  472. UnicodeString RemoteDirectory, TCopyParamType CopyParam,
  473. UnicodeString & Result, UnicodeString & RootDirectory);
  474. void __fastcall TemporarilyDownloadFiles(TStrings * FileList, bool ForceText,
  475. UnicodeString & RootTempDir, UnicodeString & TempDir, bool AllFiles, bool GetTargetNames,
  476. bool AutoOperation);
  477. void __fastcall LocalEditorClosed(TObject * Sender, bool Forced);
  478. TTBXPopupMenu * __fastcall HistoryMenu(TOperationSide Side, bool Back);
  479. UnicodeString __fastcall FileStatusBarText(const TStatusFileInfo & FileInfo, TOperationSide Side);
  480. void __fastcall UpdateFileStatusBar(TTBXStatusBar * StatusBar,
  481. const TStatusFileInfo & FileInfo, TOperationSide Side);
  482. void __fastcall UpdateFileStatusExtendedPanels(
  483. TTBXStatusBar * StatusBar, const TStatusFileInfo & FileInfo);
  484. void __fastcall FileStatusBarPanelClick(TTBXStatusPanel * Panel, TOperationSide Side);
  485. virtual void __fastcall DoDirViewLoaded(TCustomDirView * Sender);
  486. virtual void __fastcall UpdateControls();
  487. void __fastcall UpdateTransferList();
  488. void __fastcall UpdateTransferLabel();
  489. void __fastcall StartUpdates();
  490. void __fastcall TransferPresetAutoSelect();
  491. virtual void __fastcall GetTransferPresetAutoSelectData(TCopyParamRuleData & Data);
  492. inline bool __fastcall CustomCommandRemoteAllowed();
  493. void __fastcall CustomCommandMenu(
  494. TAction * Action, TStrings * LocalFileList, TStrings * RemoteFileList);
  495. void __fastcall LoadToolbarsLayoutStr(UnicodeString LayoutStr);
  496. UnicodeString __fastcall GetToolbarsLayoutStr();
  497. virtual void __fastcall Dispatch(void * Message);
  498. void __fastcall PostComponentHide(Byte Component);
  499. void __fastcall GetSpaceAvailable(const UnicodeString Path,
  500. TSpaceAvailable & ASpaceAvailable, bool & Close);
  501. void __fastcall CalculateSize(TStrings * FileList, __int64 & Size,
  502. TCalculateSizeStats & Stats, bool & Close);
  503. void __fastcall CalculateChecksum(const UnicodeString & Alg, TStrings * FileList,
  504. TCalculatedChecksumEvent OnCalculatedChecksum, bool & Close);
  505. void __fastcall UpdateCustomCommandsToolbar();
  506. virtual void __fastcall UpdateActions();
  507. void __fastcall SetSessionColor(TColor value);
  508. void __fastcall NoteTimer(TObject * Sender);
  509. void __fastcall AddNote(UnicodeString Note, bool UpdateNow = true);
  510. void __fastcall PostNote(UnicodeString Note, unsigned int Seconds,
  511. TNotifyEvent OnNoteClick, TObject * NoteData);
  512. bool __fastcall CancelNote(bool Force);
  513. void __fastcall UpdatesChecked();
  514. void __fastcall UpdatesNoteClicked(TObject * Sender);
  515. void __fastcall TransferPresetNoteClicked(TObject * Sender);
  516. void __fastcall TransferPresetNoteMessage(TTransferPresetNoteData * NoteData,
  517. bool AllowNeverAskAgain);
  518. void __fastcall UpdateTrayIcon();
  519. void __fastcall TrayIconClick(TObject * Sender);
  520. void __fastcall Notify(TTerminal * Terminal, UnicodeString Message,
  521. TQueryType Type, bool Important = false, TNotifyEvent OnClick = NULL,
  522. TObject * UserData = NULL, Exception * E = NULL);
  523. virtual void __fastcall UpdateSessionData(TSessionData * Data);
  524. virtual void __fastcall UpdateRemotePathComboBox(bool TextOnly);
  525. virtual void __fastcall ToolbarItemResize(TTBXCustomDropDownItem * Item, int Width);
  526. virtual void __fastcall CreateWnd();
  527. virtual void __fastcall DestroyWnd();
  528. virtual bool __fastcall OpenBookmark(UnicodeString Local, UnicodeString Remote);
  529. void __fastcall DoFindFiles(TTerminal * Terminal, UnicodeString Directory, const TFileMasks & FileMask,
  530. TFileFoundEvent OnFileFound, TFindingFileEvent OnFindingFile);
  531. virtual void __fastcall DoFocusRemotePath(TTerminal * Terminal, const UnicodeString & Path);
  532. void __fastcall DoOperationOnFoundFiles(
  533. TFileOperation Operation, TTerminal * ATerminal, TStrings * FileList, TFileOperationFinishedEvent OnFileOperationFinished);
  534. void __fastcall DoDeleteFoundFiles(TTerminal * Terminal, TStrings * FileList, TFileOperationFinishedEvent OnFileOperationFinished);
  535. void __fastcall DoDownloadFoundFiles(TTerminal * ATerminal, TStrings * FileList, TFileOperationFinishedEvent OnFileOperationFinished);
  536. bool __fastcall ExecuteFileOperation(TFileOperation Operation, TOperationSide Side,
  537. bool OnFocused, bool NoConfirmation = false, void * Param = NULL);
  538. void __fastcall UpdateCopyParamCounters(const TCopyParamType & CopyParam);
  539. int __fastcall AddSessionColor(TColor Color);
  540. void __fastcall UpdateSessionTab(TTabSheet * TabSheet);
  541. void __fastcall UpdateNewSessionTab();
  542. void __fastcall AddFixedSessionImages();
  543. int __fastcall AddFixedSessionImage(int GlyphsSourceIndex);
  544. TObjectList * __fastcall DoCollectWorkspace();
  545. void __fastcall DoSaveWorkspace(const UnicodeString & Name,
  546. TObjectList * DataList, bool SavePasswords);
  547. UnicodeString __fastcall WorkspaceName();
  548. virtual bool __fastcall EligibleForImageDisplayMode(TTBCustomItem * Item);
  549. virtual bool __fastcall UpdateToolbarDisplayMode();
  550. virtual void __fastcall QueueLabelUpdateStatus();
  551. void __fastcall EditorAutoConfig();
  552. void __fastcall DirViewContextPopupDefaultItem(
  553. TOperationSide Side, TTBXCustomItem * Item, TDoubleClickAction DoubleClickAction);
  554. void __fastcall DirViewContextPopup(
  555. TOperationSide Side, Byte PopupComponent, const TPoint & MousePos);
  556. bool __fastcall CommandLineFromAnotherInstance(const UnicodeString & CommandLine);
  557. bool __fastcall CanCommandLineFromAnotherInstance();
  558. void __fastcall SetQueueProgress();
  559. void __fastcall UpdateQueueLabel();
  560. void __fastcall SetTaskbarListProgressState(TBPFLAG Flags);
  561. void __fastcall SetTaskbarListProgressValue(TFileOperationProgressType * ProgressData);
  562. TTerminal * __fastcall GetSessionTabTerminal(TTabSheet * TabSheet);
  563. bool __fastcall SessionTabSwitched();
  564. void __fastcall RestoreApp();
  565. void __fastcall GoToQueue();
  566. virtual UnicodeString __fastcall DefaultDownloadTargetDirectory() = 0;
  567. void __fastcall LockFiles(TStrings * FileList, bool Lock);
  568. void __fastcall SaveInternalEditor(
  569. const UnicodeString FileName, TEditedFileData * Data, TObject * Token,
  570. void * Arg);
  571. void __fastcall SaveAllInternalEditors(TObject * Sender);
  572. void __fastcall InternalEditorModified(
  573. const UnicodeString FileName, TEditedFileData * Data, TObject * Token,
  574. void * Arg);
  575. void __fastcall AnyInternalEditorModified(TObject * Sender, bool & Modified);
  576. virtual void __fastcall StartingDisconnected();
  577. void __fastcall DoTerminalListChanged(bool Force);
  578. void __fastcall NeedSession(bool ReloadSessions);
  579. bool __fastcall DraggingAllFilesFromDirView(TOperationSide Side, TStrings * FileList);
  580. bool __fastcall SelectedAllFilesInDirView(TCustomDirView * DView);
  581. TSessionData * __fastcall SessionDataForCode();
  582. void __fastcall RefreshPanel(const UnicodeString & Session, const UnicodeString & Path);
  583. DYNAMIC void __fastcall ChangeScale(int M, int D);
  584. virtual void __fastcall UpdateImages();
  585. void __fastcall UpdatePixelsPerInchMainWindowCounter();
  586. public:
  587. virtual __fastcall ~TCustomScpExplorerForm();
  588. void __fastcall AddBookmark(TOperationSide Side);
  589. virtual void __fastcall AddEditLink(TOperationSide Side, bool Add);
  590. bool __fastcall CanAddEditLink(TOperationSide Side);
  591. bool __fastcall LinkFocused();
  592. virtual Boolean __fastcall AllowedAction(TAction * Action, TActionAllowed Allowed);
  593. bool __fastcall IsBusy();
  594. virtual void __fastcall ConfigurationChanged();
  595. void __fastcall CreateDirectory(TOperationSide Side);
  596. void __fastcall ExecuteFileOperationCommand(TFileOperation Operation, TOperationSide Side,
  597. bool OnFocused, bool NoConfirmation = false, void * Param = NULL);
  598. void __fastcall ExecuteCopyOperationCommand(
  599. TOperationSide Side, bool OnFocused, unsigned int Flags);
  600. void __fastcall AdHocCustomCommand(bool OnFocused);
  601. virtual TCustomDirView * __fastcall DirView(TOperationSide Side);
  602. virtual bool __fastcall DirViewEnabled(TOperationSide Side);
  603. virtual void __fastcall ChangePath(TOperationSide Side) = 0;
  604. virtual void __fastcall StoreParams();
  605. int __fastcall CustomCommandState(const TCustomCommandType & Command, bool OnFocused, TCustomCommandListType ListType);
  606. bool __fastcall GetLastCustomCommand(bool OnFocused,
  607. TCustomCommandType & CustomCommand, int & State);
  608. void __fastcall LastCustomCommand(bool OnFocused);
  609. void __fastcall BothCustomCommand(const TCustomCommandType & Command);
  610. void __fastcall LockWindow(bool Force = false);
  611. void __fastcall UnlockWindow();
  612. void __fastcall SuspendWindowLock();
  613. void __fastcall ResumeWindowLock();
  614. void __fastcall NewSession(bool FromSite, const UnicodeString & SessionUrl = L"");
  615. void __fastcall DuplicateSession();
  616. void __fastcall CloseSession();
  617. void __fastcall OpenDirectory(TOperationSide Side);
  618. virtual void __fastcall HomeDirectory(TOperationSide Side);
  619. void __fastcall OpenStoredSession(TSessionData * Data);
  620. void __fastcall OpenFolderOrWorkspace(const UnicodeString & Name);
  621. void __fastcall Idle();
  622. __fastcall TCustomScpExplorerForm(TComponent* Owner);
  623. void __fastcall SaveCurrentSession();
  624. TSessionData * __fastcall CloneCurrentSessionData();
  625. bool __fastcall SaveWorkspace(bool EnableAutoSave);
  626. virtual void __fastcall CompareDirectories();
  627. void __fastcall ExecuteCurrentFile();
  628. virtual void __fastcall OpenConsole(UnicodeString Command = L"");
  629. virtual void __fastcall UpdateTerminal(TTerminal * Terminal);
  630. virtual void __fastcall SynchronizeDirectories();
  631. virtual void __fastcall FullSynchronizeDirectories() = 0;
  632. virtual void __fastcall ExploreLocalDirectory();
  633. virtual void __fastcall GoToCommandLine();
  634. virtual void __fastcall GoToTree();
  635. void __fastcall PanelExport(TOperationSide Side, TPanelExport Export,
  636. TPanelExportDestination Destination);
  637. void __fastcall Filter(TOperationSide Side);
  638. void __fastcall ExecuteFile(TOperationSide Side, TExecuteFileBy ExecuteFileBy,
  639. const TEditorData * ExternalEditor = NULL, bool AllSelected = false,
  640. bool OnFocused = false);
  641. void __fastcall ExecuteCurrentFileWith(bool OnFocused);
  642. void __fastcall EditNew(TOperationSide Side);
  643. bool __fastcall AllowQueueOperation(TQueueOperation Operation, void ** Param = NULL);
  644. void __fastcall ExecuteQueueOperation(TQueueOperation Operation, void * Param = NULL);
  645. TQueueOperation __fastcall DefaultQueueOperation();
  646. bool __fastcall GetQueueEnabled();
  647. void __fastcall ToggleQueueEnabled();
  648. UnicodeString __fastcall GetQueueProgressTitle();
  649. void __fastcall LastTerminalClosed(TObject * Sender);
  650. void __fastcall TerminalRemoved(TObject * Sender);
  651. void __fastcall TerminalListChanged(TObject * Sender);
  652. void __fastcall ApplicationTitleChanged();
  653. unsigned int __fastcall MoreMessageDialog(const UnicodeString Message,
  654. TStrings * MoreMessages, TQueryType Type, unsigned int Answers,
  655. UnicodeString HelpKeyword, const TMessageParams * Params = NULL,
  656. TTerminal * Terminal = NULL);
  657. void __fastcall OperationFinished(TFileOperation Operation, TOperationSide Side,
  658. bool Temp, const UnicodeString & FileName, bool Success, TOnceDoneOperation & OnceDoneOperation);
  659. void __fastcall OperationProgress(TFileOperationProgressType & ProgressData);
  660. void __fastcall ShowExtendedException(TTerminal * Terminal, Exception * E);
  661. void __fastcall InactiveTerminalException(TTerminal * Terminal, Exception * E);
  662. void __fastcall TerminalReady();
  663. void __fastcall QueueEvent(TTerminal * Terminal, TTerminalQueue * Queue, TQueueEvent Event);
  664. void __fastcall QueueEmptyNoteClicked(TObject * Sender);
  665. bool __fastcall DoSynchronizeDirectories(UnicodeString & LocalDirectory,
  666. UnicodeString & RemoteDirectory, bool UseDefaults);
  667. bool __fastcall DoFullSynchronizeDirectories(UnicodeString & LocalDirectory,
  668. UnicodeString & RemoteDirectory, TSynchronizeMode & Mode, bool & SaveMode,
  669. bool UseDefaults);
  670. void __fastcall StandaloneEdit(const UnicodeString & FileName);
  671. bool __fastcall CanPasteFromClipBoard();
  672. void __fastcall PasteFromClipBoard();
  673. void __fastcall ToggleQueueVisibility();
  674. virtual UnicodeString __fastcall PathForCaption();
  675. void __fastcall FileListFromClipboard();
  676. void __fastcall SelectAll(TOperationSide Side, TSelectMode Mode);
  677. void __fastcall SelectByMask(TOperationSide Side, bool Select);
  678. void __fastcall RestoreSelectedNames(TOperationSide Side);
  679. void __fastcall SelectSameExt(bool Select);
  680. void __fastcall PreferencesDialog(TPreferencesMode APreferencesMode);
  681. virtual void __fastcall BeforeAction();
  682. void __fastcall FileSystemInfo();
  683. void __fastcall SessionGenerateUrl();
  684. void __fastcall FileGenerateUrl();
  685. void __fastcall ReadDirectoryCancelled();
  686. void __fastcall SynchronizeBrowsingChanged();
  687. void __fastcall ToggleShowHiddenFiles();
  688. void __fastcall SetFormatSizeBytes(TFormatBytesStyle Style);
  689. void __fastcall ToggleAutoReadDirectoryAfterOp();
  690. void __fastcall PopupTrayBalloon(TTerminal * Terminal, const UnicodeString & Str,
  691. TQueryType Type, Exception * E = NULL, unsigned int Seconds = 0,
  692. TNotifyEvent OnBalloonClick = NULL, TObject * UserData = NULL);
  693. void __fastcall RemoteFindFiles();
  694. virtual void __fastcall HistoryGo(TOperationSide Side, int Index);
  695. void __fastcall UpdateTaskbarList(ITaskbarList3 * TaskbarList);
  696. virtual void __fastcall DisplaySystemContextMenu();
  697. virtual void __fastcall GoToAddress() = 0;
  698. bool __fastcall CanConsole();
  699. bool __fastcall CanChangePassword();
  700. void __fastcall ChangePassword();
  701. __property bool ComponentVisible[Byte Component] = { read = GetComponentVisible, write = SetComponentVisible };
  702. __property bool EnableFocusedOperation[TOperationSide Side] = { read = GetEnableFocusedOperation, index = 0 };
  703. __property bool EnableSelectedOperation[TOperationSide Side] = { read = GetEnableSelectedOperation, index = 0 };
  704. __property bool EnableFocusedFileOperation[TOperationSide Side] = { read = GetEnableFocusedOperation, index = 1 };
  705. __property bool EnableSelectedFileOperation[TOperationSide Side] = { read = GetEnableSelectedOperation, index = 1 };
  706. __property bool HasDirView[TOperationSide Side] = { read = GetHasDirView };
  707. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  708. __property TTerminalQueue * Queue = { read = FQueue, write = SetQueue };
  709. __property TColor SessionColor = { read = FSessionColor, write = SetSessionColor };
  710. };
  711. //---------------------------------------------------------------------------
  712. #endif