WinInterface.h 22 KB

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