WinInterface.h 22 KB

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