WinInterface.h 22 KB

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