WinInterface.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. //---------------------------------------------------------------------------
  2. #ifndef WinInterfaceH
  3. #define WinInterfaceH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Buttons.hpp>
  7. #include <Interface.h>
  8. #include <GUIConfiguration.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 THEME_OFFICEXP L"OfficeXP"
  29. #define THEME_OFFICE2003 L"Office2003"
  30. #define THEME_DEFAULT L"Default"
  31. struct TMessageParams
  32. {
  33. TMessageParams(unsigned int AParams = 0);
  34. TMessageParams(const TQueryParams * AParams);
  35. const TQueryButtonAlias * Aliases;
  36. unsigned int AliasesCount;
  37. unsigned int Params;
  38. unsigned int Timer;
  39. TQueryParamsTimerEvent TimerEvent;
  40. UnicodeString TimerMessage;
  41. unsigned int TimerAnswers;
  42. TQueryType TimerQueryType;
  43. unsigned int Timeout;
  44. unsigned int TimeoutAnswer;
  45. UnicodeString NeverAskAgainTitle;
  46. unsigned int NeverAskAgainAnswer;
  47. bool NeverAskAgainCheckedInitially;
  48. bool AllowHelp;
  49. UnicodeString ImageName;
  50. UnicodeString MoreMessagesUrl;
  51. TSize MoreMessagesSize;
  52. private:
  53. inline void Reset();
  54. };
  55. class TCustomScpExplorerForm;
  56. TCustomScpExplorerForm * __fastcall CreateScpExplorer();
  57. void __fastcall ConfigureInterface();
  58. void __fastcall DoProductLicense();
  59. extern const UnicodeString AppName;
  60. void __fastcall SetOnForeground(bool OnForeground);
  61. void __fastcall FlashOnBackground();
  62. void __fastcall ShowExtendedExceptionEx(TTerminal * Terminal, Exception * E);
  63. void __fastcall FormHelp(TCustomForm * Form);
  64. void __fastcall SearchHelp(const UnicodeString & Message);
  65. void __fastcall MessageWithNoHelp(const UnicodeString & Message);
  66. class TProgramParams;
  67. bool __fastcall CheckSafe(TProgramParams * Params);
  68. bool __fastcall CheckXmlLogParam(TProgramParams * Params);
  69. UnicodeString __fastcall GetToolbarsLayoutStr(TComponent * OwnerComponent);
  70. void __fastcall LoadToolbarsLayoutStr(TComponent * OwnerComponent, UnicodeString LayoutStr);
  71. namespace Tb2item { class TTBCustomItem; }
  72. void __fastcall AddMenuSeparator(Tb2item::TTBCustomItem * Menu);
  73. void __fastcall AddMenuLabel(Tb2item::TTBCustomItem * Menu, const UnicodeString & Label);
  74. // windows\WinHelp.cpp
  75. void __fastcall InitializeWinHelp();
  76. void __fastcall FinalizeWinHelp();
  77. // windows\WinInterface.cpp
  78. unsigned int __fastcall MessageDialog(const UnicodeString Msg, TQueryType Type,
  79. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  80. unsigned int __fastcall MessageDialog(int Ident, TQueryType Type,
  81. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  82. unsigned int __fastcall SimpleErrorDialog(const UnicodeString Msg, const UnicodeString MoreMessages = L"");
  83. unsigned int __fastcall MoreMessageDialog(const UnicodeString Message,
  84. TStrings * MoreMessages, TQueryType Type, unsigned int Answers,
  85. UnicodeString HelpKeyword, const TMessageParams * Params = NULL);
  86. unsigned int __fastcall ExceptionMessageDialog(Exception * E, TQueryType Type,
  87. const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  88. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  89. unsigned int __fastcall FatalExceptionMessageDialog(Exception * E, TQueryType Type,
  90. int SessionReopenTimeout, const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  91. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  92. // forms\Custom.cpp
  93. TSessionData * __fastcall DoSaveSession(TSessionData * SessionData,
  94. TSessionData * OriginalSession, bool ForceDialog,
  95. TStrings * AdditionalFolders);
  96. void __fastcall SessionNameValidate(const UnicodeString & Text,
  97. const UnicodeString & OriginalName);
  98. bool __fastcall DoSaveWorkspaceDialog(UnicodeString & WorkspaceName,
  99. bool * SavePasswords, bool NotRecommendedSavingPasswords,
  100. bool & CreateShortcut, bool & EnableAutoSave);
  101. class TShortCuts;
  102. bool __fastcall DoShortCutDialog(TShortCut & ShortCut,
  103. const TShortCuts & ShortCuts, UnicodeString HelpKeyword);
  104. // windows\UserInterface.cpp
  105. bool __fastcall DoMasterPasswordDialog();
  106. bool __fastcall DoChangeMasterPasswordDialog(UnicodeString & NewPassword);
  107. // windows\WinMain.cpp
  108. int __fastcall Execute();
  109. void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
  110. TObjectList * DataList, UnicodeString & DownloadFile);
  111. // forms\InputDlg.cpp
  112. struct TInputDialogData
  113. {
  114. TEdit * Edit;
  115. };
  116. typedef void __fastcall (__closure *TInputDialogInitialize)
  117. (TObject * Sender, TInputDialogData * Data);
  118. bool __fastcall InputDialog(const UnicodeString ACaption,
  119. const UnicodeString APrompt, UnicodeString & Value, UnicodeString HelpKeyword = HELP_NONE,
  120. TStrings * History = NULL, bool PathInput = false,
  121. TInputDialogInitialize OnInitialize = NULL);
  122. // forms\About.cpp
  123. struct TRegistration
  124. {
  125. bool Registered;
  126. UnicodeString Subject;
  127. int Licenses;
  128. UnicodeString ProductId;
  129. bool NeverExpires;
  130. TDateTime Expiration;
  131. bool EduLicense;
  132. TNotifyEvent OnRegistrationLink;
  133. };
  134. void __fastcall DoAboutDialog(TConfiguration * Configuration,
  135. bool AllowLicense, TRegistration * Registration);
  136. void __fastcall DoAboutDialog(TConfiguration *Configuration);
  137. // forms\Cleanup.cpp
  138. bool __fastcall DoCleanupDialog(TStoredSessionList *SessionList,
  139. TConfiguration *Configuration);
  140. // forms\Console.cpp
  141. void __fastcall DoConsoleDialog(TTerminal * Terminal,
  142. const UnicodeString Command = L"", const TStrings * Log = NULL);
  143. // forms\Copy.cpp
  144. const coTemp = 0x001;
  145. const coDisableQueue = 0x002;
  146. const coDisableDirectory = 0x008; // not used anymore
  147. const coDoNotShowAgain = 0x020;
  148. const coDisableSaveSettings = 0x040; // not used anymore
  149. const coDoNotUsePresets = 0x080;
  150. const coAllowRemoteTransfer = 0x100;
  151. const coNoQueue = 0x200;
  152. const coNoQueueIndividually = 0x400;
  153. const coShortCutHint = 0x800;
  154. const cooDoNotShowAgain = 0x01;
  155. const cooRemoteTransfer = 0x02;
  156. const cooSaveSettings = 0x04;
  157. bool __fastcall DoCopyDialog(bool ToRemote,
  158. bool Move, TStrings * FileList, UnicodeString & TargetDirectory,
  159. TGUICopyParamType * Params, int Options, int CopyParamAttrs,
  160. int * OutputOptions);
  161. // forms\CreateDirectory.cpp
  162. bool __fastcall DoCreateDirectoryDialog(UnicodeString & Directory,
  163. TRemoteProperties * Properties, int AllowedChanges, bool & SaveSettings);
  164. // forms\ImportSessions.cpp
  165. bool __fastcall DoImportSessionsDialog(TList * Imported);
  166. // forms\License.cpp
  167. enum TLicense { lcNoLicense = -1, lcWinScp, lcExpat };
  168. void __fastcall DoLicenseDialog(TLicense License);
  169. // forms\Login.cpp
  170. // these flags are used in navigation tree of login dialog, change with care
  171. const loLocalDirectory = 0x01;
  172. const loExternalTools = 0x04;
  173. const loColor = 0x80;
  174. const loNone = 0x00;
  175. const loAddSession = (loLocalDirectory | loColor);
  176. const loStartup = (loLocalDirectory | loExternalTools | loColor);
  177. bool __fastcall DoLoginDialog(TStoredSessionList * SessionList,
  178. TList * DataList, int Options);
  179. // forms\SiteAdvanced.cpp
  180. bool __fastcall DoSiteAdvancedDialog(TSessionData * SessionData, int Options);
  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. 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. 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(UnicodeString & Target, UnicodeString & FileMask);
  243. enum TDirectRemoteCopy { drcDisallow, drcAllow, drcConfirmCommandSession };
  244. bool __fastcall DoRemoteCopyDialog(TStrings * Sessions, TStrings * Directories,
  245. TDirectRemoteCopy AllowDirectCopy, void *& Session, UnicodeString & Target, UnicodeString & FileMask,
  246. 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. TForm * __fastcall ShowEditorForm(const UnicodeString FileName, TCustomForm * ParentForm,
  302. TNotifyEvent OnFileChanged, TNotifyEvent OnFileReload, TFileClosedEvent OnClose,
  303. const UnicodeString Caption, bool StandaloneEditor, TColor Color);
  304. void __fastcall ReconfigureEditorForm(TForm * Form);
  305. void __fastcall EditorFormFileUploadComplete(TForm * Form);
  306. bool __fastcall DoSymlinkDialog(UnicodeString & FileName, UnicodeString & PointTo,
  307. TOperationSide Side, bool & SymbolicLink, bool Edit, bool AllowSymbolic);
  308. // forms\FileSystemInfo.cpp
  309. struct TSpaceAvailable;
  310. struct TFileSystemInfo;
  311. struct TSessionInfo;
  312. typedef void __fastcall (__closure *TGetSpaceAvailable)
  313. (const UnicodeString Path, TSpaceAvailable & ASpaceAvailable, bool & Close);
  314. void __fastcall DoFileSystemInfoDialog(
  315. const TSessionInfo & SessionInfo, const TFileSystemInfo & FileSystemInfo,
  316. UnicodeString SpaceAvailablePath, TGetSpaceAvailable OnGetSpaceAvailable);
  317. // forms\MessageDlg.cpp
  318. void __fastcall AnswerNameAndCaption(
  319. unsigned int Answer, UnicodeString & Name, UnicodeString & Caption);
  320. TForm * __fastcall CreateMoreMessageDialog(const UnicodeString & Msg,
  321. TStrings * MoreMessages, TMsgDlgType DlgType, unsigned int Answers,
  322. const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
  323. unsigned int TimeoutAnswer, TButton ** TimeoutButton,
  324. const UnicodeString & ImageName, const UnicodeString & NeverAskAgainCaption,
  325. const UnicodeString & MoreMessagesUrl, TSize MoreMessagesSize);
  326. // windows\Console.cpp
  327. enum TConsoleMode { cmNone, cmScripting, cmHelp, cmBatchSettings };
  328. int __fastcall Console(TConsoleMode Mode);
  329. // forms\EditorPreferences.cpp
  330. enum TEditorPreferencesMode { epmAdd, epmEdit, epmAdHoc };
  331. class TEditorData;
  332. bool __fastcall DoEditorPreferencesDialog(TEditorData * Editor,
  333. bool & Remember, TEditorPreferencesMode Mode, bool MayRemote);
  334. // forms\Find.cpp
  335. typedef void __fastcall (__closure *TFindEvent)
  336. (UnicodeString Directory, const TFileMasks & FileMask,
  337. TFileFoundEvent OnFileFound, TFindingFileEvent OnFindingFile);
  338. bool __fastcall DoFileFindDialog(UnicodeString Directory,
  339. TFindEvent OnFind, UnicodeString & Path);
  340. // forms\GenerateUrl.cpp
  341. void __fastcall DoGenerateUrlDialog(TSessionData * Data, TStrings * Paths);
  342. void __fastcall CopyParamListButton(TButton * Button);
  343. const int cplNone = 0x00;
  344. const int cplCustomize = 0x01;
  345. const int cplCustomizeDefault = 0x02;
  346. const int cplSaveSettings = 0x04;
  347. void __fastcall CopyParamListPopup(TRect R, TPopupMenu * Menu,
  348. const TCopyParamType & Param, UnicodeString Preset, TNotifyEvent OnClick,
  349. int Options, int CopyParamAttrs, bool SaveSettings = false);
  350. bool __fastcall CopyParamListPopupClick(TObject * Sender,
  351. TCopyParamType & Param, UnicodeString & Preset, int CopyParamAttrs,
  352. bool * SaveSettings = NULL);
  353. void __fastcall MenuPopup(TPopupMenu * Menu, TRect Rect, TComponent * PopupComponent);
  354. void __fastcall MenuPopup(TPopupMenu * Menu, TButton * Button);
  355. void __fastcall MenuPopup(TObject * Sender, const TPoint & MousePos, bool & Handled);
  356. void __fastcall MenuButton(TButton * Button);
  357. TComponent * __fastcall GetPopupComponent(TObject * Sender);
  358. TRect __fastcall CalculatePopupRect(TButton * Button);
  359. TRect __fastcall CalculatePopupRect(TControl * Control, TPoint MousePos);
  360. typedef void __fastcall (__closure *TColorChangeEvent)
  361. (TColor Color);
  362. TPopupMenu * __fastcall CreateSessionColorPopupMenu(TColor Color,
  363. TColorChangeEvent OnColorChange);
  364. void __fastcall CreateSessionColorMenu(TComponent * AOwner, TColor Color,
  365. TColorChangeEvent OnColorChange);
  366. void __fastcall FixButtonImage(TButton * Button);
  367. void __fastcall CenterButtonImage(TButton * Button);
  368. void __fastcall UncenterButtonImage(TButton * Button);
  369. void __fastcall UpgradeSpeedButton(TSpeedButton * Button);
  370. void __fastcall SetGlobalMinimizeHandler(TCustomForm * Form, TNotifyEvent OnMinimize);
  371. void __fastcall ClearGlobalMinimizeHandler(TNotifyEvent OnMinimize);
  372. void __fastcall CallGlobalMinimizeHandler(TObject * Sender);
  373. bool __fastcall IsApplicationMinimized();
  374. void __fastcall ApplicationMinimize();
  375. void __fastcall ApplicationRestore();
  376. void __fastcall WinInitialize();
  377. void __fastcall WinFinalize();
  378. void __fastcall ShowNotification(TTerminal * Terminal, const UnicodeString & Str,
  379. TQueryType Type);
  380. void __fastcall InitializeShortCutCombo(TComboBox * ComboBox,
  381. const TShortCuts & ShortCuts);
  382. void __fastcall SetShortCutCombo(TComboBox * ComboBox, TShortCut Value);
  383. TShortCut __fastcall GetShortCutCombo(TComboBox * ComboBox);
  384. bool __fastcall IsCustomShortCut(TShortCut ShortCut);
  385. //---------------------------------------------------------------------------
  386. #define HIDDEN_WINDOW_NAME L"WinSCPHiddenWindow2"
  387. //---------------------------------------------------------------------------
  388. struct TCopyDataMessage
  389. {
  390. enum { CommandCanCommandLine, CommandCommandLine };
  391. static const unsigned int Version1 = 1;
  392. unsigned int Version;
  393. unsigned int Command;
  394. union
  395. {
  396. wchar_t CommandLine[10240];
  397. };
  398. };
  399. //---------------------------------------------------------------------------
  400. class TWinInteractiveCustomCommand : public TInteractiveCustomCommand
  401. {
  402. public:
  403. TWinInteractiveCustomCommand(TCustomCommand * ChildCustomCommand,
  404. const UnicodeString CustomCommandName);
  405. protected:
  406. virtual void __fastcall Prompt(const UnicodeString & Prompt,
  407. UnicodeString & Value);
  408. virtual void __fastcall Execute(const UnicodeString & Command,
  409. UnicodeString & Value);
  410. private:
  411. UnicodeString FCustomCommandName;
  412. };
  413. //---------------------------------------------------------------------------
  414. class TTrayIcon
  415. {
  416. public:
  417. __fastcall TTrayIcon(unsigned int Id);
  418. __fastcall ~TTrayIcon();
  419. void __fastcall PopupBalloon(UnicodeString Title, const UnicodeString & Str,
  420. TQueryType QueryType, unsigned int Timeout, TNotifyEvent OnBalloonClick,
  421. TObject * BalloonUserData);
  422. void __fastcall CancelBalloon();
  423. __property bool Visible = { read = FVisible, write = SetVisible };
  424. __property TNotifyEvent OnClick = { read = FOnClick, write = FOnClick };
  425. __property UnicodeString Hint = { read = GetHint, write = SetHint };
  426. protected:
  427. void __fastcall Update();
  428. bool __fastcall Notify(unsigned int Message);
  429. private:
  430. bool FVisible;
  431. NOTIFYICONDATA * FTrayIcon;
  432. TNotifyEvent FOnClick;
  433. TNotifyEvent FOnBalloonClick;
  434. TObject * FBalloonUserData;
  435. UINT FTaskbarCreatedMsg;
  436. void __fastcall WndProc(TMessage & Message);
  437. void __fastcall SetVisible(bool value);
  438. UnicodeString __fastcall GetHint();
  439. void __fastcall SetHint(UnicodeString value);
  440. void __fastcall BalloonCancelled();
  441. };
  442. //---------------------------------------------------------------------------
  443. #endif // WinInterfaceH