WinInterface.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. //---------------------------------------------------------------------------
  2. #ifndef WinInterfaceH
  3. #define WinInterfaceH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Buttons.hpp>
  7. #include <Interface.h>
  8. #include <WinConfiguration.h>
  9. #include <SynchronizeController.h>
  10. #ifdef LOCALINTERFACE
  11. #include <LocalInterface.h>
  12. #endif
  13. #define SITE_ICON 1
  14. #define SITE_FOLDER_ICON 2
  15. #define WORKSPACE_ICON 3
  16. class TStoredSessionList;
  17. class TConfiguration;
  18. class TTerminal;
  19. const int mpNeverAskAgainCheck = 0x01;
  20. const int mpAllowContinueOnError = 0x02;
  21. #define UPLOAD_IF_ANY_SWITCH L"UploadIfAny"
  22. #define UPLOAD_SWITCH L"Upload"
  23. #define JUMPLIST_SWITCH L"JumpList"
  24. #define DESKTOP_SWITCH L"Desktop"
  25. #define SEND_TO_HOOK_SWITCH L"SendToHook"
  26. #define UNSAFE_SWITCH L"Unsafe"
  27. #define NEWINSTANCE_SWICH L"NewInstance"
  28. #define KEYGEN_SWITCH L"KeyGen"
  29. #define KEYGEN_OUTPUT_SWITCH L"Output"
  30. #define KEYGEN_COMMENT_SWITCH L"Comment"
  31. #define KEYGEN_CHANGE_PASSPHRASE_SWITCH L"ChangePassphrase"
  32. #define LOG_SWITCH L"Log"
  33. #define LOGSIZE_SWITCH L"LogSize"
  34. #define LOGSIZE_SEPARATOR L"*"
  35. #define INI_SWITCH L"Ini"
  36. #define FINGERPRINTSCAN_SWITCH L"FingerprintScan"
  37. struct TMessageParams
  38. {
  39. TMessageParams(unsigned int AParams = 0);
  40. TMessageParams(const TQueryParams * AParams);
  41. const TQueryButtonAlias * Aliases;
  42. unsigned int AliasesCount;
  43. unsigned int Params;
  44. unsigned int Timer;
  45. TQueryParamsTimerEvent TimerEvent;
  46. UnicodeString TimerMessage;
  47. unsigned int TimerAnswers;
  48. TQueryType TimerQueryType;
  49. unsigned int Timeout;
  50. unsigned int TimeoutAnswer;
  51. UnicodeString NeverAskAgainTitle;
  52. unsigned int NeverAskAgainAnswer;
  53. bool NeverAskAgainCheckedInitially;
  54. bool AllowHelp;
  55. UnicodeString ImageName;
  56. UnicodeString MoreMessagesUrl;
  57. TSize MoreMessagesSize;
  58. UnicodeString CustomCaption;
  59. private:
  60. inline void Reset();
  61. };
  62. class TCustomScpExplorerForm;
  63. TCustomScpExplorerForm * __fastcall CreateScpExplorer();
  64. void __fastcall ConfigureInterface();
  65. void __fastcall DoProductLicense();
  66. extern const UnicodeString AppName;
  67. void __fastcall SetOnForeground(bool OnForeground);
  68. void __fastcall FlashOnBackground();
  69. void __fastcall TerminateApplication();
  70. void __fastcall ShowExtendedExceptionEx(TTerminal * Terminal, Exception * E);
  71. void __fastcall FormHelp(TCustomForm * Form);
  72. void __fastcall SearchHelp(const UnicodeString & Message);
  73. void __fastcall MessageWithNoHelp(const UnicodeString & Message);
  74. class TProgramParams;
  75. bool __fastcall CheckSafe(TProgramParams * Params);
  76. void __fastcall CheckLogParam(TProgramParams * Params);
  77. bool __fastcall CheckXmlLogParam(TProgramParams * Params);
  78. UnicodeString __fastcall GetToolbarsLayoutStr(TComponent * OwnerComponent);
  79. void __fastcall LoadToolbarsLayoutStr(TComponent * OwnerComponent, UnicodeString LayoutStr);
  80. namespace Tb2item { class TTBCustomItem; }
  81. namespace Tbx { class TTBXSeparatorItem; }
  82. Tbx::TTBXSeparatorItem * __fastcall AddMenuSeparator(Tb2item::TTBCustomItem * Menu);
  83. void __fastcall AddMenuLabel(Tb2item::TTBCustomItem * Menu, const UnicodeString & Label);
  84. void __fastcall ClickToolbarItem(Tb2item::TTBCustomItem * Item, bool PositionCursor);
  85. // windows\WinHelp.cpp
  86. void __fastcall InitializeWinHelp();
  87. void __fastcall FinalizeWinHelp();
  88. // windows\WinInterface.cpp
  89. unsigned int __fastcall MessageDialog(const UnicodeString Msg, TQueryType Type,
  90. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  91. unsigned int __fastcall MessageDialog(int Ident, TQueryType Type,
  92. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  93. unsigned int __fastcall SimpleErrorDialog(const UnicodeString Msg, const UnicodeString MoreMessages = L"");
  94. unsigned int __fastcall MoreMessageDialog(const UnicodeString Message,
  95. TStrings * MoreMessages, TQueryType Type, unsigned int Answers,
  96. UnicodeString HelpKeyword, const TMessageParams * Params = NULL);
  97. unsigned int __fastcall ExceptionMessageDialog(Exception * E, TQueryType Type,
  98. const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  99. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  100. unsigned int __fastcall FatalExceptionMessageDialog(Exception * E, TQueryType Type,
  101. int SessionReopenTimeout, const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  102. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  103. // forms\Custom.cpp
  104. TSessionData * __fastcall DoSaveSession(TSessionData * SessionData,
  105. TSessionData * OriginalSession, bool ForceDialog,
  106. TStrings * AdditionalFolders);
  107. void __fastcall SessionNameValidate(const UnicodeString & Text,
  108. const UnicodeString & OriginalName);
  109. bool __fastcall DoSaveWorkspaceDialog(UnicodeString & WorkspaceName,
  110. bool * SavePasswords, bool NotRecommendedSavingPasswords,
  111. bool & CreateShortcut, bool & EnableAutoSave);
  112. class TShortCuts;
  113. bool __fastcall DoShortCutDialog(TShortCut & ShortCut,
  114. const TShortCuts & ShortCuts, UnicodeString HelpKeyword);
  115. bool __fastcall DoCustomCommandOptionsDialog(
  116. const TCustomCommandType * Command, TStrings * CustomCommandOptions, unsigned int Flags,
  117. TCustomCommand * CustomCommandForOptions, const UnicodeString & Site);
  118. void __fastcall DoUsageStatisticsDialog();
  119. // windows\UserInterface.cpp
  120. bool __fastcall DoMasterPasswordDialog();
  121. bool __fastcall DoChangeMasterPasswordDialog(UnicodeString & NewPassword);
  122. // windows\WinMain.cpp
  123. int __fastcall Execute();
  124. void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
  125. TObjectList * DataList, UnicodeString & DownloadFile, bool NeedSession, TForm * LinkedForm);
  126. // forms\InputDlg.cpp
  127. struct TInputDialogData
  128. {
  129. TCustomEdit * Edit;
  130. };
  131. typedef void __fastcall (__closure *TInputDialogInitialize)
  132. (TObject * Sender, TInputDialogData * Data);
  133. bool __fastcall InputDialog(const UnicodeString ACaption,
  134. const UnicodeString APrompt, UnicodeString & Value, UnicodeString HelpKeyword = HELP_NONE,
  135. TStrings * History = NULL, bool PathInput = false,
  136. TInputDialogInitialize OnInitialize = NULL, bool Echo = true);
  137. // forms\About.cpp
  138. struct TRegistration
  139. {
  140. bool Registered;
  141. UnicodeString Subject;
  142. int Licenses;
  143. UnicodeString ProductId;
  144. bool NeverExpires;
  145. TDateTime Expiration;
  146. bool EduLicense;
  147. TNotifyEvent OnRegistrationLink;
  148. };
  149. void __fastcall DoAboutDialog(TConfiguration * Configuration,
  150. bool AllowLicense, TRegistration * Registration);
  151. void __fastcall DoAboutDialog(TConfiguration *Configuration);
  152. // forms\Cleanup.cpp
  153. bool __fastcall DoCleanupDialog(TStoredSessionList *SessionList,
  154. TConfiguration *Configuration);
  155. // forms\Console.cpp
  156. void __fastcall DoConsoleDialog(TTerminal * Terminal,
  157. const UnicodeString Command = L"", const TStrings * Log = NULL);
  158. // forms\Copy.cpp
  159. const coTemp = 0x001;
  160. const coDisableQueue = 0x002;
  161. const coDisableDirectory = 0x008; // not used anymore
  162. const coDoNotShowAgain = 0x020;
  163. const coDisableSaveSettings = 0x040; // not used anymore
  164. const coDoNotUsePresets = 0x080;
  165. const coAllowRemoteTransfer = 0x100;
  166. const coNoQueue = 0x200;
  167. const coNoQueueIndividually = 0x400;
  168. const coShortCutHint = 0x800;
  169. const coAllFiles = 0x1000;
  170. const cooDoNotShowAgain = 0x01;
  171. const cooRemoteTransfer = 0x02;
  172. const cooSaveSettings = 0x04;
  173. bool __fastcall DoCopyDialog(bool ToRemote,
  174. bool Move, TStrings * FileList, UnicodeString & TargetDirectory,
  175. TGUICopyParamType * Params, int Options, int CopyParamAttrs,
  176. TSessionData * SessionData, int * OutputOptions);
  177. // forms\CreateDirectory.cpp
  178. bool __fastcall DoCreateDirectoryDialog(UnicodeString & Directory,
  179. TRemoteProperties * Properties, int AllowedChanges, bool & SaveSettings);
  180. // forms\ImportSessions.cpp
  181. bool __fastcall DoImportSessionsDialog(TList * Imported);
  182. // forms\License.cpp
  183. enum TLicense { lcNoLicense = -1, lcWinScp, lcExpat };
  184. void __fastcall DoLicenseDialog(TLicense License);
  185. bool __fastcall DoLoginDialog(TStoredSessionList * SessionList, TList * DataList, TForm * LinkedForm);
  186. // forms\SiteAdvanced.cpp
  187. bool __fastcall DoSiteAdvancedDialog(TSessionData * SessionData);
  188. // forms\OpenDirectory.cpp
  189. enum TOpenDirectoryMode { odBrowse, odAddBookmark };
  190. bool __fastcall DoOpenDirectoryDialog(TOpenDirectoryMode Mode, TOperationSide Side,
  191. UnicodeString & Directory, TStrings * Directories, TTerminal * Terminal,
  192. bool AllowSwitch);
  193. // forms\LocatinoProfiles.cpp
  194. bool __fastcall LocationProfilesDialog(TOpenDirectoryMode Mode,
  195. TOperationSide Side, UnicodeString & LocalDirectory, UnicodeString & RemoteDirectory,
  196. TStrings * LocalDirectories, TStrings * RemoteDirectories, TTerminal * Terminal);
  197. // forms\Preferences.cpp
  198. enum TPreferencesMode { pmDefault, pmEditor, pmCustomCommands,
  199. pmQueue, pmLogging, pmUpdates, pmPresets, pmEditors, pmCommander,
  200. pmEditorInternal };
  201. class TCopyParamRuleData;
  202. struct TPreferencesDialogData
  203. {
  204. TCopyParamRuleData * CopyParamRuleData;
  205. };
  206. bool __fastcall DoPreferencesDialog(TPreferencesMode APreferencesMode,
  207. TPreferencesDialogData * DialogData = NULL);
  208. // forms\CustomCommand.cpp
  209. class TCustomCommandList;
  210. class TCustomCommandType;
  211. class TShortCuts;
  212. enum TCustomCommandsMode { ccmAdd, ccmEdit, ccmAdHoc };
  213. const ccoDisableRemote = 0x01;
  214. const ccoDisableRemoteFiles = 0x02;
  215. typedef void __fastcall (__closure *TCustomCommandValidate)
  216. (const TCustomCommandType & Command);
  217. bool __fastcall DoCustomCommandDialog(TCustomCommandType & Command,
  218. const TCustomCommandList * CustomCommandList,
  219. TCustomCommandsMode Mode, int Options, TCustomCommandValidate OnValidate,
  220. const TShortCuts * ShortCuts);
  221. // forms\CopyParamPreset.cpp
  222. class TCopyParamList;
  223. enum TCopyParamPresetMode { cpmAdd, cpmAddCurrent, cpmEdit, cpmDuplicate };
  224. bool __fastcall DoCopyParamPresetDialog(TCopyParamList * CopyParamList,
  225. int & Index, TCopyParamPresetMode Mode, TCopyParamRuleData * CurrentRuleData,
  226. const TCopyParamType & DefaultCopyParams);
  227. // forms\CopyParamCsutom.cpp
  228. bool __fastcall DoCopyParamCustomDialog(TCopyParamType & CopyParam,
  229. int CopyParamAttrs);
  230. // forms\Properties.cpp
  231. class TRemoteProperties;
  232. class TRemoteTokenList;
  233. struct TCalculateSizeStats;
  234. const cpMode = 0x01;
  235. const cpOwner = 0x02;
  236. const cpGroup = 0x04;
  237. typedef void __fastcall (__closure *TCalculateSizeEvent)
  238. (TStrings * FileList, __int64 & Size, TCalculateSizeStats & Stats,
  239. bool & Close);
  240. typedef void __fastcall (__closure *TCalculatedChecksumCallbackEvent)(
  241. const UnicodeString & FileName, const UnicodeString & Alg, const UnicodeString & Hash);
  242. typedef void __fastcall (__closure *TCalculateChecksumEvent)
  243. (const UnicodeString & Alg, TStrings * FileList,
  244. TCalculatedChecksumCallbackEvent OnCalculatedChecksum, bool & Close);
  245. bool __fastcall DoPropertiesDialog(TStrings * FileList,
  246. const UnicodeString Directory, const TRemoteTokenList * GroupList,
  247. const TRemoteTokenList * UserList, TStrings * ChecksumAlgs,
  248. TRemoteProperties * Properties,
  249. int AllowedChanges, bool UserGroupByID, TCalculateSizeEvent OnCalculateSize,
  250. TCalculateChecksumEvent OnCalculateChecksum);
  251. bool __fastcall DoRemoteMoveDialog(bool Multi, UnicodeString & Target, UnicodeString & FileMask);
  252. enum TDirectRemoteCopy { drcDisallow, drcAllow, drcConfirmCommandSession };
  253. bool __fastcall DoRemoteCopyDialog(TStrings * Sessions, TStrings * Directories,
  254. TDirectRemoteCopy AllowDirectCopy, bool Multi, void *& Session,
  255. UnicodeString & Target, UnicodeString & FileMask, bool & DirectCopy, void * CurrentSession);
  256. // forms\SelectMask.cpp
  257. #ifdef CustomdirviewHPP
  258. bool __fastcall DoSelectMaskDialog(TCustomDirView * Parent, bool Select,
  259. TFileFilter * Filter, TConfiguration * Configuration);
  260. bool __fastcall DoFilterMaskDialog(TCustomDirView * Parent,
  261. TFileFilter * Filter);
  262. #endif
  263. // forms\EditMask.cpp
  264. bool __fastcall DoEditMaskDialog(TFileMasks & Mask);
  265. const spDelete = 0x01;
  266. const spNoConfirmation = 0x02;
  267. const spExistingOnly = 0x04;
  268. const spPreviewChanges = 0x40; // not used by core
  269. const spTimestamp = 0x100;
  270. const spNotByTime = 0x200;
  271. const spBySize = 0x400;
  272. const spSelectedOnly = 0x800;
  273. const spMirror = 0x1000;
  274. // forms\Synchronize.cpp
  275. const soDoNotUsePresets = 0x01;
  276. const soNoMinimize = 0x02;
  277. const soAllowSelectedOnly = 0x04;
  278. typedef void __fastcall (__closure *TGetSynchronizeOptionsEvent)
  279. (int Params, TSynchronizeOptions & Options);
  280. typedef void __fastcall (__closure *TSynchronizeSessionLog)
  281. (const UnicodeString & Message);
  282. typedef void __fastcall (__closure *TFeedSynchronizeError)
  283. (const UnicodeString & Message, TStrings * MoreMessages, TQueryType Type,
  284. const UnicodeString & HelpKeyword);
  285. bool __fastcall DoSynchronizeDialog(TSynchronizeParamType & Params,
  286. const TCopyParamType * CopyParams, TSynchronizeStartStopEvent OnStartStop,
  287. bool & SaveSettings, int Options, int CopyParamAttrs,
  288. TGetSynchronizeOptionsEvent OnGetOptions,
  289. TSynchronizeSessionLog OnSynchronizeSessionLog,
  290. TFeedSynchronizeError & OnFeedSynchronizeError,
  291. bool Start);
  292. // forms\FullSynchronize.cpp
  293. struct TUsableCopyParamAttrs;
  294. enum TSynchronizeMode { smRemote, smLocal, smBoth };
  295. const fsoDisableTimestamp = 0x01;
  296. const fsoDoNotUsePresets = 0x02;
  297. const fsoAllowSelectedOnly = 0x04;
  298. bool __fastcall DoFullSynchronizeDialog(TSynchronizeMode & Mode, int & Params,
  299. UnicodeString & LocalDirectory, UnicodeString & RemoteDirectory,
  300. TCopyParamType * CopyParams, bool & SaveSettings, bool & SaveMode,
  301. int Options, const TUsableCopyParamAttrs & CopyParamAttrs);
  302. // forms\SynchronizeChecklist.cpp
  303. class TSynchronizeChecklist;
  304. typedef void __fastcall (__closure *TCustomCommandMenuEvent)
  305. (TAction * Action, TStrings * LocalFileList, TStrings * RemoteFileList);
  306. bool __fastcall DoSynchronizeChecklistDialog(TSynchronizeChecklist * Checklist,
  307. TSynchronizeMode Mode, int Params,
  308. const UnicodeString LocalDirectory, const UnicodeString RemoteDirectory,
  309. TCustomCommandMenuEvent OnCustomCommandMenu);
  310. // forms\Editor.cpp
  311. typedef void __fastcall (__closure *TFileClosedEvent)
  312. (TObject * Sender, bool Forced);
  313. typedef void __fastcall (__closure *TAnyModifiedEvent)
  314. (TObject * Sender, bool & Modified);
  315. TForm * __fastcall ShowEditorForm(const UnicodeString FileName, TCustomForm * ParentForm,
  316. TNotifyEvent OnFileChanged, TNotifyEvent OnFileReload, TFileClosedEvent OnClose,
  317. TNotifyEvent OnSaveAll, TAnyModifiedEvent OnAnyModified,
  318. const UnicodeString Caption, bool StandaloneEditor, TColor Color);
  319. void __fastcall ReconfigureEditorForm(TForm * Form);
  320. void __fastcall EditorFormFileUploadComplete(TForm * Form);
  321. void __fastcall EditorFormFileSave(TForm * Form);
  322. bool __fastcall IsEditorFormModified(TForm * Form);
  323. bool __fastcall DoSymlinkDialog(UnicodeString & FileName, UnicodeString & PointTo,
  324. TOperationSide Side, bool & SymbolicLink, bool Edit, bool AllowSymbolic);
  325. // forms\FileSystemInfo.cpp
  326. struct TSpaceAvailable;
  327. struct TFileSystemInfo;
  328. struct TSessionInfo;
  329. typedef void __fastcall (__closure *TGetSpaceAvailable)
  330. (const UnicodeString Path, TSpaceAvailable & ASpaceAvailable, bool & Close);
  331. void __fastcall DoFileSystemInfoDialog(
  332. const TSessionInfo & SessionInfo, const TFileSystemInfo & FileSystemInfo,
  333. UnicodeString SpaceAvailablePath, TGetSpaceAvailable OnGetSpaceAvailable);
  334. // forms\MessageDlg.cpp
  335. void __fastcall AnswerNameAndCaption(
  336. unsigned int Answer, UnicodeString & Name, UnicodeString & Caption);
  337. TForm * __fastcall CreateMoreMessageDialog(const UnicodeString & Msg,
  338. TStrings * MoreMessages, TMsgDlgType DlgType, unsigned int Answers,
  339. const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
  340. unsigned int TimeoutAnswer, TButton ** TimeoutButton,
  341. const UnicodeString & ImageName, const UnicodeString & NeverAskAgainCaption,
  342. const UnicodeString & MoreMessagesUrl, TSize MoreMessagesSize,
  343. const UnicodeString & CustomCaption);
  344. TForm * __fastcall CreateMoreMessageDialogEx(const UnicodeString Message, TStrings * MoreMessages,
  345. TQueryType Type, unsigned int Answers, UnicodeString HelpKeyword, const TMessageParams * Params);
  346. unsigned int __fastcall ExecuteMessageDialog(TForm * Dialog, unsigned int Answers, const TMessageParams * Params);
  347. void __fastcall InsertPanelToMessageDialog(TCustomForm * Form, TPanel * Panel);
  348. void __fastcall NavigateMessageDialogToUrl(TCustomForm * Form, const UnicodeString & Url);
  349. extern const UnicodeString MessagePanelName;
  350. extern const UnicodeString MainMessageLabelName;
  351. extern const UnicodeString MessageLabelName;
  352. extern const UnicodeString YesButtonName;
  353. extern const UnicodeString OKButtonName;
  354. // windows\Console.cpp
  355. enum TConsoleMode { cmNone, cmScripting, cmHelp, cmBatchSettings, cmKeyGen, cmFingerprintScan };
  356. int __fastcall Console(TConsoleMode Mode);
  357. // forms\EditorPreferences.cpp
  358. enum TEditorPreferencesMode { epmAdd, epmEdit, epmAdHoc };
  359. class TEditorData;
  360. bool __fastcall DoEditorPreferencesDialog(TEditorData * Editor,
  361. bool & Remember, TEditorPreferencesMode Mode, bool MayRemote);
  362. // forms\Find.cpp
  363. typedef void __fastcall (__closure *TFindEvent)
  364. (TTerminal * Terminal, UnicodeString Directory, const TFileMasks & FileMask,
  365. TFileFoundEvent OnFileFound, TFindingFileEvent OnFindingFile);
  366. typedef void __fastcall (__closure *TFocusFileEvent)
  367. (TTerminal * Terminal, const UnicodeString & Path);
  368. typedef void __fastcall (__closure *TFileOperationFinishedEvent)
  369. (const UnicodeString & FileName, bool Success);
  370. typedef void __fastcall (__closure *TFileListOperationEvent)
  371. (TTerminal * Terminal, TStrings * FileList, TFileOperationFinishedEvent OnFileOperationFinished);
  372. void __fastcall ShowFileFindDialog(
  373. TTerminal * Terminal, UnicodeString Directory, TFindEvent OnFind, TFocusFileEvent OnFocusFile,
  374. TFileListOperationEvent OnDeleteFiles, TFileListOperationEvent OnDownloadFiles);
  375. void __fastcall HideFileFindDialog();
  376. // forms\GenerateUrl.cpp
  377. void __fastcall DoGenerateUrlDialog(TSessionData * Data, TStrings * Paths);
  378. enum TFilesSelected { fsList, fsAll };
  379. void __fastcall DoGenerateTransferCodeDialog(
  380. bool ToRemote, bool Move, int CopyParamAttrs, TSessionData * Data, TFilesSelected FilesSelected,
  381. TStrings * FileList, const UnicodeString & Path, const TCopyParamType & CopyParam);
  382. void __fastcall CopyParamListButton(TButton * Button);
  383. const int cplNone = 0x00;
  384. const int cplCustomize = 0x01;
  385. const int cplCustomizeDefault = 0x02;
  386. const int cplSaveSettings = 0x04;
  387. const int cplGenerateCode = 0x08;
  388. void __fastcall CopyParamListPopup(TRect R, TPopupMenu * Menu,
  389. const TCopyParamType & Param, UnicodeString Preset, TNotifyEvent OnClick,
  390. int Options, int CopyParamAttrs, bool SaveSettings = false);
  391. int __fastcall CopyParamListPopupClick(TObject * Sender,
  392. TCopyParamType & Param, UnicodeString & Preset, int CopyParamAttrs,
  393. bool * SaveSettings = NULL);
  394. void __fastcall MenuPopup(TPopupMenu * Menu, TRect Rect, TComponent * PopupComponent);
  395. void __fastcall MenuPopup(TPopupMenu * Menu, TButton * Button);
  396. void __fastcall MenuPopup(TObject * Sender, const TPoint & MousePos, bool & Handled);
  397. void __fastcall MenuButton(TButton * Button);
  398. TComponent * __fastcall GetPopupComponent(TObject * Sender);
  399. TRect __fastcall CalculatePopupRect(TButton * Button);
  400. TRect __fastcall CalculatePopupRect(TControl * Control, TPoint MousePos);
  401. typedef void __fastcall (__closure *TColorChangeEvent)
  402. (TColor Color);
  403. TPopupMenu * __fastcall CreateSessionColorPopupMenu(TColor Color,
  404. TColorChangeEvent OnColorChange);
  405. void __fastcall CreateSessionColorMenu(TComponent * AOwner, TColor Color,
  406. TColorChangeEvent OnColorChange);
  407. void __fastcall CreateEditorBackgroundColorMenu(TComponent * AOwner, TColor Color,
  408. TColorChangeEvent OnColorChange);
  409. TPopupMenu * __fastcall CreateColorPopupMenu(TColor Color,
  410. TColorChangeEvent OnColorChange);
  411. void __fastcall FixButtonImage(TButton * Button);
  412. void __fastcall CenterButtonImage(TButton * Button);
  413. void __fastcall UpgradeSpeedButton(TSpeedButton * Button);
  414. int __fastcall AdjustLocaleFlag(const UnicodeString & S, TLocaleFlagOverride LocaleFlagOverride, bool Recommended, int On, int Off);
  415. void __fastcall SetGlobalMinimizeHandler(TCustomForm * Form, TNotifyEvent OnMinimize);
  416. void __fastcall ClearGlobalMinimizeHandler(TNotifyEvent OnMinimize);
  417. void __fastcall CallGlobalMinimizeHandler(TObject * Sender);
  418. bool __fastcall IsApplicationMinimized();
  419. void __fastcall ApplicationMinimize();
  420. void __fastcall ApplicationRestore();
  421. bool __fastcall HandleMinimizeSysCommand(TMessage & Message);
  422. void __fastcall WinInitialize();
  423. void __fastcall WinFinalize();
  424. void __fastcall ShowNotification(TTerminal * Terminal, const UnicodeString & Str,
  425. TQueryType Type);
  426. void __fastcall InitializeShortCutCombo(TComboBox * ComboBox,
  427. const TShortCuts & ShortCuts);
  428. void __fastcall SetShortCutCombo(TComboBox * ComboBox, TShortCut Value);
  429. TShortCut __fastcall GetShortCutCombo(TComboBox * ComboBox);
  430. bool __fastcall IsCustomShortCut(TShortCut ShortCut);
  431. class TAnimationsModule;
  432. TAnimationsModule * __fastcall GetAnimationsModule();
  433. void __fastcall ReleaseAnimationsModule();
  434. #ifdef _DEBUG
  435. void __fastcall ForceTracing();
  436. #endif
  437. //---------------------------------------------------------------------------
  438. #define HIDDEN_WINDOW_NAME L"WinSCPHiddenWindow3"
  439. //---------------------------------------------------------------------------
  440. struct TCopyDataMessage
  441. {
  442. enum { CommandCanCommandLine, CommandCommandLine, MainWindowCheck, RefreshPanel };
  443. static const unsigned int Version1 = 1;
  444. unsigned int Version;
  445. unsigned int Command;
  446. union
  447. {
  448. wchar_t CommandLine[10240];
  449. struct
  450. {
  451. wchar_t Session[1024];
  452. wchar_t Path[1024];
  453. } Refresh;
  454. };
  455. TCopyDataMessage()
  456. {
  457. Version = TCopyDataMessage::Version1;
  458. Command = static_cast<unsigned int>(-1);
  459. }
  460. };
  461. //---------------------------------------------------------------------------
  462. class TWinInteractiveCustomCommand : public TInteractiveCustomCommand
  463. {
  464. public:
  465. TWinInteractiveCustomCommand(
  466. TCustomCommand * ChildCustomCommand, const UnicodeString CustomCommandName, const UnicodeString HelpKeyword);
  467. protected:
  468. virtual void __fastcall Prompt(int Index, const UnicodeString & Prompt,
  469. UnicodeString & Value);
  470. virtual void __fastcall Execute(const UnicodeString & Command,
  471. UnicodeString & Value);
  472. virtual void __fastcall PatternHint(int Index, const UnicodeString & Pattern);
  473. private:
  474. UnicodeString FCustomCommandName;
  475. std::map<int, size_t> FIndexes;
  476. TUnicodeStringVector FPrompts;
  477. TUnicodeStringVector FDefaults;
  478. TUnicodeStringVector FValues;
  479. UnicodeString FHelpKeyword;
  480. };
  481. //---------------------------------------------------------------------------
  482. class TTrayIcon
  483. {
  484. public:
  485. __fastcall TTrayIcon(unsigned int Id);
  486. __fastcall ~TTrayIcon();
  487. void __fastcall PopupBalloon(UnicodeString Title, const UnicodeString & Str,
  488. TQueryType QueryType, unsigned int Timeout, TNotifyEvent OnBalloonClick,
  489. TObject * BalloonUserData);
  490. void __fastcall CancelBalloon();
  491. __property bool Visible = { read = FVisible, write = SetVisible };
  492. __property TNotifyEvent OnClick = { read = FOnClick, write = FOnClick };
  493. __property UnicodeString Hint = { read = GetHint, write = SetHint };
  494. protected:
  495. void __fastcall Update();
  496. bool __fastcall Notify(unsigned int Message);
  497. private:
  498. bool FVisible;
  499. NOTIFYICONDATA * FTrayIcon;
  500. TNotifyEvent FOnClick;
  501. TNotifyEvent FOnBalloonClick;
  502. TObject * FBalloonUserData;
  503. UINT FTaskbarCreatedMsg;
  504. void __fastcall WndProc(TMessage & Message);
  505. void __fastcall SetVisible(bool value);
  506. UnicodeString __fastcall GetHint();
  507. void __fastcall SetHint(UnicodeString value);
  508. void __fastcall BalloonCancelled();
  509. };
  510. //---------------------------------------------------------------------------
  511. #endif // WinInterfaceH