WinInterface.h 22 KB

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