CustomScpExplorer.h 35 KB

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