WinInterface.h 23 KB

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