WinConfiguration.h 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. //---------------------------------------------------------------------------
  2. #ifndef WinConfigurationH
  3. #define WinConfigurationH
  4. //---------------------------------------------------------------------------
  5. #include "CustomWinConfiguration.h"
  6. #include "CustomDirView.hpp"
  7. #include "FileInfo.h"
  8. //---------------------------------------------------------------------------
  9. enum TEditor { edInternal, edExternal, edOpen };
  10. enum TGenerateUrlCodeTarget { guctUrl, guctScript, guctAssembly };
  11. enum TScriptFormat { sfScriptFile, sfBatchFile, sfCommandLine, sfPowerShell };
  12. enum TLocaleFlagOverride { lfoLanguageIfRecommended, lfoLanguage, lfoAlways, lfoNever };
  13. //---------------------------------------------------------------------------
  14. #define C(Property) (Property != rhc.Property) ||
  15. struct TScpExplorerConfiguration {
  16. UnicodeString WindowParams;
  17. UnicodeString DirViewParams;
  18. UnicodeString ToolbarsLayout;
  19. UnicodeString ToolbarsButtons;
  20. bool SessionsTabs;
  21. bool StatusBar;
  22. UnicodeString LastLocalTargetDirectory;
  23. int ViewStyle;
  24. bool ShowFullAddress;
  25. bool DriveView;
  26. int DriveViewWidth;
  27. int DriveViewWidthPixelsPerInch;
  28. bool __fastcall operator !=(TScpExplorerConfiguration & rhc)
  29. { return C(WindowParams) C(DirViewParams) C(ToolbarsLayout) C(ToolbarsButtons)
  30. C(SessionsTabs) C(StatusBar)
  31. C(LastLocalTargetDirectory) C(ViewStyle) C(ShowFullAddress)
  32. C(DriveView) C(DriveViewWidth) C(DriveViewWidthPixelsPerInch) 0; };
  33. };
  34. //---------------------------------------------------------------------------
  35. struct TScpCommanderPanelConfiguration {
  36. UnicodeString DirViewParams;
  37. bool StatusBar;
  38. bool DriveView;
  39. int DriveViewHeight;
  40. int DriveViewHeightPixelsPerInch;
  41. int DriveViewWidth;
  42. int DriveViewWidthPixelsPerInch;
  43. UnicodeString LastPath;
  44. bool __fastcall operator !=(TScpCommanderPanelConfiguration & rhc)
  45. { return C(DirViewParams) C(StatusBar)
  46. C(DriveView) C(DriveViewHeight) C(DriveViewHeightPixelsPerInch)
  47. C(DriveViewWidth) C(DriveViewWidthPixelsPerInch) C(LastPath) 0; };
  48. };
  49. //---------------------------------------------------------------------------
  50. struct TScpCommanderConfiguration {
  51. UnicodeString WindowParams;
  52. double LocalPanelWidth;
  53. UnicodeString ToolbarsLayout;
  54. UnicodeString ToolbarsButtons;
  55. bool SessionsTabs;
  56. bool StatusBar;
  57. TOperationSide CurrentPanel;
  58. TNortonLikeMode NortonLikeMode;
  59. bool PreserveLocalDirectory;
  60. TScpCommanderPanelConfiguration LocalPanel;
  61. TScpCommanderPanelConfiguration RemotePanel;
  62. bool CompareByTime;
  63. bool CompareBySize;
  64. bool SwappedPanels;
  65. bool TreeOnLeft;
  66. bool ExplorerKeyboardShortcuts;
  67. bool SystemContextMenu;
  68. UnicodeString OtherLocalPanelDirViewParams;
  69. UnicodeString OtherLocalPanelLastPath;
  70. bool __fastcall operator !=(TScpCommanderConfiguration & rhc)
  71. { return C(WindowParams) C(LocalPanelWidth) C(ToolbarsLayout) C(ToolbarsButtons)
  72. C(SessionsTabs) C(StatusBar)
  73. C(LocalPanel) C(RemotePanel) C(CurrentPanel)
  74. C(NortonLikeMode) C(PreserveLocalDirectory)
  75. C(CompareBySize) C(CompareByTime) C(SwappedPanels)
  76. C(TreeOnLeft) C(ExplorerKeyboardShortcuts) C(SystemContextMenu)
  77. C(OtherLocalPanelDirViewParams) C(OtherLocalPanelLastPath) 0; };
  78. TCompareCriterias __fastcall CompareCriterias()
  79. {
  80. TCompareCriterias Criterias;
  81. if (CompareByTime)
  82. {
  83. Criterias << ccTime;
  84. }
  85. if (CompareBySize)
  86. {
  87. Criterias << ccSize;
  88. }
  89. return Criterias;
  90. }
  91. };
  92. //---------------------------------------------------------------------------
  93. struct TFontConfiguration
  94. {
  95. UnicodeString FontName;
  96. int FontSize;
  97. int FontCharset;
  98. int FontStyle;
  99. __fastcall TFontConfiguration()
  100. {
  101. FontSize = 0;
  102. FontCharset = DEFAULT_CHARSET;
  103. FontStyle = 0;
  104. }
  105. // keep in sync with SameFont
  106. bool __fastcall operator !=(const TFontConfiguration & rhc)
  107. { return !SameText(FontName, rhc.FontName) || C(FontSize)
  108. C(FontCharset) C(FontStyle) 0; };
  109. };
  110. //---------------------------------------------------------------------------
  111. struct TEditorConfiguration {
  112. TFontConfiguration Font;
  113. TColor FontColor;
  114. TColor BackgroundColor;
  115. bool WordWrap;
  116. UnicodeString FindText;
  117. UnicodeString ReplaceText;
  118. bool FindMatchCase;
  119. bool FindWholeWord;
  120. bool FindDown;
  121. unsigned int TabSize;
  122. unsigned int MaxEditors;
  123. unsigned int EarlyClose;
  124. bool SDIShellEditor;
  125. UnicodeString WindowParams;
  126. int Encoding;
  127. bool WarnOnEncodingFallback;
  128. bool WarnOrLargeFileSize;
  129. bool __fastcall operator !=(TEditorConfiguration & rhc)
  130. { return C(Font) C(FontColor) C(BackgroundColor) C(WordWrap) C(FindText) C(ReplaceText)
  131. C(FindMatchCase) C(FindWholeWord) C(FindDown) C(TabSize)
  132. C(MaxEditors) C(EarlyClose) C(SDIShellEditor) C(WindowParams)
  133. C(Encoding) C(WarnOnEncodingFallback) C(WarnOrLargeFileSize) 0; };
  134. };
  135. //---------------------------------------------------------------------------
  136. enum TQueueViewShow { qvShow, qvHideWhenEmpty, qvHide };
  137. struct TQueueViewConfiguration {
  138. int Height;
  139. int HeightPixelsPerInch;
  140. UnicodeString Layout;
  141. TQueueViewShow Show;
  142. TQueueViewShow LastHideShow;
  143. bool ToolBar;
  144. bool Label;
  145. bool FileList;
  146. int FileListHeight;
  147. int FileListHeightPixelsPerInch;
  148. bool __fastcall operator !=(TQueueViewConfiguration & rhc)
  149. { return C(Height) C(HeightPixelsPerInch) C(Layout) C(Show) C(LastHideShow) C(ToolBar) C(Label)
  150. C(FileList) C(FileListHeight) C(FileListHeightPixelsPerInch) 0; };
  151. };
  152. //---------------------------------------------------------------------------
  153. struct TUpdatesData
  154. {
  155. int ForVersion;
  156. int Version;
  157. UnicodeString Message;
  158. bool Critical;
  159. UnicodeString Release;
  160. bool Disabled;
  161. UnicodeString Url;
  162. UnicodeString UrlButton;
  163. UnicodeString NewsUrl;
  164. TSize NewsSize;
  165. UnicodeString DownloadUrl;
  166. __int64 DownloadSize;
  167. UnicodeString DownloadSha256;
  168. UnicodeString AuthenticationError;
  169. bool OpenGettingStarted;
  170. UnicodeString DownloadingUrl;
  171. TSize TipsSize;
  172. UnicodeString TipsUrl;
  173. UnicodeString Tips;
  174. int TipsIntervalDays;
  175. int TipsIntervalRuns;
  176. bool __fastcall operator !=(TUpdatesData & rhc)
  177. { return C(ForVersion) C(Version) C(Message) C(Critical) C(Release)
  178. C(Disabled) C(Url) C(UrlButton) C(NewsUrl) C(NewsSize)
  179. C(DownloadUrl) C(DownloadSize) C(DownloadSha256) C(AuthenticationError)
  180. C(OpenGettingStarted) C(DownloadingUrl)
  181. C(TipsSize) C(TipsUrl) C(Tips) C(TipsIntervalDays) C(TipsIntervalRuns) 0; };
  182. void Reset()
  183. {
  184. ForVersion = 0;
  185. Version = 0;
  186. Message = L"";
  187. Critical = false;
  188. Release = L"";
  189. Disabled = false;
  190. Url = L"";
  191. UrlButton = L"";
  192. NewsUrl = L"";
  193. NewsSize = TSize();
  194. DownloadUrl = L"";
  195. DownloadSize = 0;
  196. DownloadSha256 = L"";
  197. AuthenticationError = L"";
  198. OpenGettingStarted = false;
  199. DownloadingUrl = L"";
  200. TipsSize = TSize();
  201. TipsUrl = L"";
  202. Tips = L"";
  203. TipsIntervalDays = 7;
  204. TipsIntervalRuns = 5;
  205. }
  206. };
  207. //---------------------------------------------------------------------------
  208. enum TConnectionType { ctDirect, ctAuto, ctProxy };
  209. //---------------------------------------------------------------------------
  210. struct TUpdatesConfiguration
  211. {
  212. TDateTime Period;
  213. TDateTime LastCheck;
  214. TConnectionType ConnectionType;
  215. UnicodeString ProxyHost;
  216. int ProxyPort;
  217. TAutoSwitch BetaVersions;
  218. bool ShowOnStartup;
  219. UnicodeString AuthenticationEmail;
  220. bool HaveResults;
  221. bool ShownResults;
  222. UnicodeString DotNetVersion;
  223. UnicodeString ConsoleVersion;
  224. TUpdatesData Results;
  225. bool __fastcall operator !=(TUpdatesConfiguration & rhc)
  226. { return C(Period) C(LastCheck) C(ConnectionType) C(ProxyHost) C(ProxyPort)
  227. C(BetaVersions) C(ShowOnStartup) C(AuthenticationEmail)
  228. C(HaveResults) C(ShownResults) C(DotNetVersion)
  229. C(ConsoleVersion) C(Results) 0; };
  230. bool __fastcall HaveValidResultsForVersion(int CompoundVersion)
  231. {
  232. return
  233. HaveResults &&
  234. (double(Period) > 0) &&
  235. (ZeroBuildNumber(Results.ForVersion) == CompoundVersion);
  236. }
  237. };
  238. //---------------------------------------------------------------------------
  239. struct TEditorData
  240. {
  241. __fastcall TEditorData();
  242. __fastcall TEditorData(const TEditorData & Source);
  243. TFileMasks FileMask;
  244. TEditor Editor;
  245. UnicodeString ExternalEditor;
  246. bool ExternalEditorText;
  247. bool SDIExternalEditor;
  248. bool DetectMDIExternalEditor;
  249. bool __fastcall operator ==(const TEditorData & rhd) const;
  250. void __fastcall ExternalEditorOptionsAutodetect();
  251. };
  252. //---------------------------------------------------------------------------
  253. struct TFileColorData
  254. {
  255. TFileColorData();
  256. TFileMasks FileMask;
  257. TColor Color;
  258. void Load(const UnicodeString & S);
  259. UnicodeString Save() const;
  260. typedef std::vector<TFileColorData> TList;
  261. static void LoadList(const UnicodeString & S, TList & List);
  262. static UnicodeString SaveList(const TList & List);
  263. };
  264. //---------------------------------------------------------------------------
  265. #undef C
  266. //---------------------------------------------------------------------------
  267. class TEditorPreferences
  268. {
  269. public:
  270. __fastcall TEditorPreferences();
  271. __fastcall TEditorPreferences(const TEditorData & Data);
  272. bool __fastcall Matches(const UnicodeString FileName, bool Local,
  273. const TFileMasks::TParams & Params) const;
  274. void __fastcall Load(THierarchicalStorage * Storage, bool Legacy);
  275. void __fastcall Save(THierarchicalStorage * Storage) const;
  276. void __fastcall LegacyDefaults();
  277. UnicodeString __fastcall ExtractExternalEditorName() const;
  278. static UnicodeString __fastcall GetDefaultExternalEditor();
  279. bool __fastcall operator ==(const TEditorPreferences & rhp) const;
  280. __property const TEditorData * Data = { read = GetConstData };
  281. __property UnicodeString Name = { read = GetName };
  282. TEditorData * __fastcall GetData();
  283. private:
  284. TEditorData FData;
  285. mutable UnicodeString FName;
  286. UnicodeString __fastcall GetName() const;
  287. const TEditorData * __fastcall GetConstData() const { return &FData; };
  288. };
  289. //---------------------------------------------------------------------------
  290. class TEditorList
  291. {
  292. public:
  293. __fastcall TEditorList();
  294. virtual __fastcall ~TEditorList();
  295. const TEditorPreferences * __fastcall Find(const UnicodeString FileName,
  296. bool Local, const TFileMasks::TParams & Params) const;
  297. void __fastcall Load(THierarchicalStorage * Storage);
  298. void __fastcall Save(THierarchicalStorage * Storage) const;
  299. TEditorList & __fastcall operator=(const TEditorList & rhl);
  300. bool __fastcall operator==(const TEditorList & rhl) const;
  301. void __fastcall Clear();
  302. void __fastcall Add(TEditorPreferences * Editor);
  303. void __fastcall Insert(int Index, TEditorPreferences * Editor);
  304. void __fastcall Change(int Index, TEditorPreferences * Editor);
  305. void __fastcall Move(int CurIndex, int NewIndex);
  306. void __fastcall Delete(int Index);
  307. void __fastcall Saved();
  308. bool __fastcall IsDefaultList() const;
  309. __property int Count = { read = GetCount };
  310. __property const TEditorPreferences * Editors[int Index] = { read = GetEditor };
  311. __property bool Modified = { read = FModified };
  312. private:
  313. TList * FEditors;
  314. bool FModified;
  315. int __fastcall GetCount() const;
  316. void __fastcall Init();
  317. void __fastcall Modify();
  318. const TEditorPreferences * __fastcall GetEditor(int Index) const;
  319. };
  320. //---------------------------------------------------------------------------
  321. class TBookmarks;
  322. class TBookmarkList;
  323. class TCustomCommandList;
  324. enum TPathInCaption { picShort, picFull, picNone };
  325. enum TSessionTabNameFormat { stnfNone, stnfShortPath, stnfShortPathTrunc };
  326. // constants must be compatible with legacy CopyOnDoubleClick
  327. enum TDoubleClickAction { dcaOpen = 0, dcaCopy = 1, dcaEdit = 2 };
  328. //---------------------------------------------------------------------------
  329. typedef void __fastcall (__closure *TMasterPasswordPromptEvent)();
  330. //---------------------------------------------------------------------------
  331. class TWinConfiguration : public TCustomWinConfiguration
  332. {
  333. private:
  334. UnicodeString FAutoStartSession;
  335. TDoubleClickAction FDoubleClickAction;
  336. bool FCopyOnDoubleClickConfirmation;
  337. bool FDDDisableMove;
  338. TAutoSwitch FDDTransferConfirmation;
  339. bool FDeleteToRecycleBin;
  340. bool FDimmHiddenFiles;
  341. bool FRenameWholeName;
  342. TScpCommanderConfiguration FScpCommander;
  343. TScpExplorerConfiguration FScpExplorer;
  344. bool FSelectDirectories;
  345. UnicodeString FSelectMask;
  346. bool FShowHiddenFiles;
  347. TFormatBytesStyle FFormatSizeBytes;
  348. TIncrementalSearch FPanelSearch;
  349. bool FShowInaccesibleDirectories;
  350. bool FConfirmTransferring;
  351. bool FConfirmDeleting;
  352. bool FConfirmRecycling;
  353. bool FUseLocationProfiles;
  354. bool FUseSharedBookmarks;
  355. UnicodeString FDDTemporaryDirectory;
  356. UnicodeString FDDDrives;
  357. bool FDDWarnLackOfTempSpace;
  358. bool FDDFakeFile;
  359. int FDDExtInstalled;
  360. int FDDExtTimeout;
  361. bool FConfirmClosingSession;
  362. double FDDWarnLackOfTempSpaceRatio;
  363. UnicodeString FTemporarySessionFile;
  364. UnicodeString FTemporaryKeyFile;
  365. TBookmarks * FBookmarks;
  366. TCustomCommandList * FCustomCommandList;
  367. TCustomCommandList * FExtensionList;
  368. UnicodeString FExtensionsDeleted;
  369. UnicodeString FExtensionsOrder;
  370. UnicodeString FExtensionsShortCuts;
  371. bool FCustomCommandsDefaults;
  372. TEditorConfiguration FEditor;
  373. TQueueViewConfiguration FQueueView;
  374. bool FEnableQueueByDefault;
  375. bool FEmbeddedSessions;
  376. bool FExpertMode;
  377. bool FDisableOpenEdit;
  378. bool FDefaultDirIsHome;
  379. int FDDDeleteDelay;
  380. bool FTemporaryDirectoryAppendSession;
  381. bool FTemporaryDirectoryAppendPath;
  382. bool FTemporaryDirectoryDeterministic;
  383. bool FTemporaryDirectoryCleanup;
  384. bool FConfirmTemporaryDirectoryCleanup;
  385. UnicodeString FDefaultTranslationFile;
  386. UnicodeString FInvalidDefaultTranslationMessage;
  387. bool FPreservePanelState;
  388. TAutoSwitch FDarkTheme;
  389. int FSysDarkTheme;
  390. UnicodeString FLastStoredSession;
  391. UnicodeString FLastWorkspace;
  392. bool FAutoSaveWorkspace;
  393. bool FAutoSaveWorkspacePasswords;
  394. UnicodeString FAutoWorkspace;
  395. TPathInCaption FPathInCaption;
  396. TSessionTabNameFormat FSessionTabNameFormat;
  397. bool FMinimizeToTray;
  398. bool FBalloonNotifications;
  399. unsigned int FNotificationsTimeout;
  400. unsigned int FNotificationsStickTime;
  401. TUpdatesConfiguration FUpdates;
  402. UnicodeString FVersionHistory;
  403. bool FCopyParamAutoSelectNotice;
  404. bool FLockToolbars;
  405. bool FSelectiveToolbarText;
  406. TEditorList * FEditorList;
  407. TEditorPreferences * FLegacyEditor;
  408. UnicodeString FDefaultKeyFile;
  409. bool FAutoOpenInPutty;
  410. TDateTime FDefaultUpdatesPeriod;
  411. bool FRefreshRemotePanel;
  412. TDateTime FRefreshRemotePanelInterval;
  413. TFontConfiguration FPanelFont;
  414. bool FNaturalOrderNumericalSorting;
  415. bool FFullRowSelect;
  416. bool FOfferedEditorAutoConfig;
  417. bool FUseMasterPassword;
  418. UnicodeString FPlainMasterPasswordEncrypt;
  419. UnicodeString FPlainMasterPasswordDecrypt;
  420. UnicodeString FMasterPasswordVerifier;
  421. TMasterPasswordPromptEvent FOnMasterPasswordPrompt;
  422. UnicodeString FOpenedStoredSessionFolders;
  423. bool FAutoImportedFromPuttyOrFilezilla;
  424. int FGenerateUrlComponents;
  425. TGenerateUrlCodeTarget FGenerateUrlCodeTarget;
  426. TScriptFormat FGenerateUrlScriptFormat;
  427. TAssemblyLanguage FGenerateUrlAssemblyLanguage;
  428. bool FExternalSessionInExistingInstance;
  429. bool FShowLoginWhenNoSession;
  430. bool FKeepOpenWhenNoSession;
  431. bool FLocalIconsByExt;
  432. TLocaleFlagOverride FBidiModeOverride;
  433. TLocaleFlagOverride FFlipChildrenOverride;
  434. bool FShowTips;
  435. UnicodeString FTipsSeen;
  436. TDateTime FTipsShown;
  437. UnicodeString FFileColors;
  438. int FRunsSinceLastTip;
  439. bool FLockedInterface;
  440. bool FTimeoutShellIconRetrieval;
  441. bool FUseIconUpdateThread;
  442. bool FAllowWindowPrint;
  443. int FDontDecryptPasswords;
  444. int FMasterPasswordSession;
  445. bool FMasterPasswordSessionAsked;
  446. std::unique_ptr<TStringList> FCustomCommandOptions;
  447. bool FCustomCommandOptionsModified;
  448. int FLastMachineInstallations;
  449. __property int LastMachineInstallations = { read = FLastMachineInstallations, write = FLastMachineInstallations };
  450. int FMachineInstallations;
  451. LCID FDefaultLocale;
  452. std::unique_ptr<TStrings> FExtensionTranslations;
  453. void __fastcall SetDoubleClickAction(TDoubleClickAction value);
  454. void __fastcall SetCopyOnDoubleClickConfirmation(bool value);
  455. void __fastcall SetDDDisableMove(bool value);
  456. void __fastcall SetDDTransferConfirmation(TAutoSwitch value);
  457. void __fastcall SetDeleteToRecycleBin(bool value);
  458. void __fastcall SetDimmHiddenFiles(bool value);
  459. void __fastcall SetRenameWholeName(bool value);
  460. void __fastcall SetScpCommander(TScpCommanderConfiguration value);
  461. void __fastcall SetScpExplorer(TScpExplorerConfiguration value);
  462. void __fastcall SetSelectDirectories(bool value);
  463. void __fastcall SetShowHiddenFiles(bool value);
  464. void __fastcall SetFormatSizeBytes(TFormatBytesStyle value);
  465. void __fastcall SetPanelSearch(TIncrementalSearch value);
  466. void __fastcall SetShowInaccesibleDirectories(bool value);
  467. void __fastcall SetConfirmTransferring(bool value);
  468. void __fastcall SetConfirmDeleting(bool value);
  469. void __fastcall SetConfirmRecycling(bool value);
  470. void __fastcall SetUseLocationProfiles(bool value);
  471. void __fastcall SetUseSharedBookmarks(bool value);
  472. void __fastcall SetDDTemporaryDirectory(UnicodeString value);
  473. void __fastcall SetDDDrives(UnicodeString value);
  474. void __fastcall SetDDWarnLackOfTempSpace(bool value);
  475. void __fastcall SetDDFakeFile(bool value);
  476. void __fastcall SetDDExtTimeout(int value);
  477. void __fastcall SetConfirmClosingSession(bool value);
  478. void __fastcall SetDDWarnLackOfTempSpaceRatio(double value);
  479. void __fastcall SetBookmarks(UnicodeString Key, TBookmarkList * value);
  480. TBookmarkList * __fastcall GetBookmarks(UnicodeString Key);
  481. void __fastcall SetSharedBookmarks(TBookmarkList * value);
  482. TBookmarkList * __fastcall GetSharedBookmarks();
  483. void __fastcall SetAutoStartSession(UnicodeString value);
  484. void __fastcall SetExpertMode(bool value);
  485. void __fastcall SetDefaultDirIsHome(bool value);
  486. void __fastcall SetEditor(TEditorConfiguration value);
  487. void __fastcall SetQueueView(TQueueViewConfiguration value);
  488. void __fastcall SetEnableQueueByDefault(bool value);
  489. void __fastcall SetCustomCommandList(TCustomCommandList * value);
  490. void __fastcall SetExtensionList(TCustomCommandList * value);
  491. void __fastcall SetTemporaryDirectoryAppendSession(bool value);
  492. void __fastcall SetTemporaryDirectoryAppendPath(bool value);
  493. void __fastcall SetTemporaryDirectoryDeterministic(bool value);
  494. void __fastcall SetTemporaryDirectoryCleanup(bool value);
  495. void __fastcall SetConfirmTemporaryDirectoryCleanup(bool value);
  496. void __fastcall SetPreservePanelState(bool value);
  497. void __fastcall SetDarkTheme(TAutoSwitch value);
  498. void __fastcall SetLastStoredSession(UnicodeString value);
  499. void __fastcall SetAutoSaveWorkspace(bool value);
  500. void __fastcall SetAutoSaveWorkspacePasswords(bool value);
  501. void __fastcall SetAutoWorkspace(UnicodeString value);
  502. void __fastcall SetPathInCaption(TPathInCaption value);
  503. void __fastcall SetSessionTabNameFormat(TSessionTabNameFormat value);
  504. void __fastcall SetMinimizeToTray(bool value);
  505. void __fastcall SetBalloonNotifications(bool value);
  506. void __fastcall SetNotificationsTimeout(unsigned int value);
  507. void __fastcall SetNotificationsStickTime(unsigned int value);
  508. void __fastcall SetCopyParamAutoSelectNotice(bool value);
  509. TUpdatesConfiguration __fastcall GetUpdates();
  510. void __fastcall SetUpdates(TUpdatesConfiguration value);
  511. void __fastcall SetVersionHistory(UnicodeString value);
  512. void __fastcall SetLockToolbars(bool value);
  513. void __fastcall SetSelectiveToolbarText(bool value);
  514. const TEditorList * __fastcall GetEditorList();
  515. void __fastcall SetEditorList(const TEditorList * value);
  516. void __fastcall SetAutoOpenInPutty(bool value);
  517. void __fastcall SetRefreshRemotePanel(bool value);
  518. void __fastcall SetRefreshRemotePanelInterval(TDateTime value);
  519. void __fastcall SetPanelFont(const TFontConfiguration & value);
  520. void __fastcall SetNaturalOrderNumericalSorting(bool value);
  521. void __fastcall SetFullRowSelect(bool value);
  522. void __fastcall SetOfferedEditorAutoConfig(bool value);
  523. void __fastcall SetLastMonitor(int value);
  524. int __fastcall GetLastMonitor();
  525. void __fastcall SetOpenedStoredSessionFolders(UnicodeString value);
  526. void __fastcall SetAutoImportedFromPuttyOrFilezilla(bool value);
  527. void __fastcall SetGenerateUrlComponents(int value);
  528. void __fastcall SetGenerateUrlCodeTarget(TGenerateUrlCodeTarget value);
  529. void __fastcall SetGenerateUrlScriptFormat(TScriptFormat value);
  530. void __fastcall SetGenerateUrlAssemblyLanguage(TAssemblyLanguage value);
  531. void __fastcall SetExternalSessionInExistingInstance(bool value);
  532. void __fastcall SetShowLoginWhenNoSession(bool value);
  533. void __fastcall SetKeepOpenWhenNoSession(bool value);
  534. void __fastcall SetLocalIconsByExt(bool value);
  535. void __fastcall SetBidiModeOverride(TLocaleFlagOverride value);
  536. void __fastcall SetFlipChildrenOverride(TLocaleFlagOverride value);
  537. void __fastcall SetShowTips(bool value);
  538. void __fastcall SetTipsSeen(UnicodeString value);
  539. void __fastcall SetTipsShown(TDateTime value);
  540. void __fastcall SetFileColors(UnicodeString value);
  541. void __fastcall SetRunsSinceLastTip(int value);
  542. bool __fastcall GetHonorDrivePolicy();
  543. void __fastcall SetHonorDrivePolicy(bool value);
  544. bool __fastcall GetIsBeta();
  545. TStrings * __fastcall GetCustomCommandOptions();
  546. void __fastcall SetCustomCommandOptions(TStrings * value);
  547. void __fastcall SetLockedInterface(bool value);
  548. bool __fastcall GetTimeoutShellOperations();
  549. void __fastcall SetTimeoutShellOperations(bool value);
  550. void __fastcall SetTimeoutShellIconRetrieval(bool value);
  551. void __fastcall SetUseIconUpdateThread(bool value);
  552. void __fastcall SetAllowWindowPrint(bool value);
  553. int __fastcall GetLocaleCompletenessTreshold();
  554. bool __fastcall GetDDExtInstalled();
  555. void __fastcall AddVersionToHistory();
  556. bool __fastcall GetAnyBetaInVersionHistory();
  557. void __fastcall PurgePassword(UnicodeString & Password);
  558. void __fastcall UpdateEntryInJumpList(
  559. bool Session, const UnicodeString & Name, bool Add);
  560. TStringList * __fastcall LoadJumpList(THierarchicalStorage * Storage,
  561. UnicodeString Name);
  562. void __fastcall SaveJumpList(THierarchicalStorage * Storage,
  563. UnicodeString Name, TStringList * List);
  564. void __fastcall TrimJumpList(TStringList * List);
  565. void __fastcall UpdateIconFont();
  566. protected:
  567. virtual TStorage __fastcall GetStorage();
  568. virtual void __fastcall SaveData(THierarchicalStorage * Storage, bool All);
  569. virtual void __fastcall LoadData(THierarchicalStorage * Storage);
  570. virtual void __fastcall LoadFrom(THierarchicalStorage * Storage);
  571. virtual void __fastcall LoadAdmin(THierarchicalStorage * Storage);
  572. virtual void __fastcall CopyData(THierarchicalStorage * Source, THierarchicalStorage * Target);
  573. virtual UnicodeString __fastcall GetDefaultKeyFile();
  574. virtual void __fastcall Saved();
  575. void __fastcall RecryptPasswords(TStrings * RecryptPasswordErrors);
  576. virtual bool __fastcall GetUseMasterPassword();
  577. bool __fastcall SameStringLists(TStrings * Strings1, TStrings * Strings2);
  578. virtual HINSTANCE __fastcall LoadNewResourceModule(LCID Locale,
  579. UnicodeString & FileName);
  580. void __fastcall CheckTranslationVersion(const UnicodeString FileName,
  581. bool InternalLocaleOnError);
  582. virtual void __fastcall DefaultLocalized();
  583. bool __fastcall DetectRegistryStorage(HKEY RootKey);
  584. bool __fastcall CanWriteToStorage();
  585. bool __fastcall DoIsBeta(const UnicodeString & ReleaseType);
  586. void __fastcall AskForMasterPassword();
  587. void __fastcall DoLoadExtensionList(const UnicodeString & Path, const UnicodeString & PathId, TStringList * DeletedExtensions);
  588. TStrings * __fastcall GetExtensionsPaths();
  589. virtual int __fastcall GetResourceModuleCompleteness(HINSTANCE Module);
  590. virtual bool __fastcall IsTranslationComplete(HINSTANCE Module);
  591. void __fastcall LoadExtensionList();
  592. void __fastcall ReleaseExtensionTranslations();
  593. void __fastcall LoadExtensionTranslations();
  594. TStrings * __fastcall DoFindTemporaryFolders(bool OnlyFirst);
  595. public:
  596. __fastcall TWinConfiguration();
  597. virtual __fastcall ~TWinConfiguration();
  598. virtual void __fastcall Default();
  599. void __fastcall ClearTemporaryLoginData();
  600. virtual THierarchicalStorage * CreateScpStorage(bool & SessionList);
  601. UnicodeString __fastcall TemporaryDir(bool Mask = false);
  602. TStrings * __fastcall FindTemporaryFolders();
  603. bool __fastcall AnyTemporaryFolders();
  604. void __fastcall CleanupTemporaryFolders();
  605. void __fastcall CleanupTemporaryFolders(TStrings * Folders = NULL);
  606. UnicodeString __fastcall ExpandedTemporaryDirectory();
  607. void __fastcall CheckDefaultTranslation();
  608. const TEditorPreferences * __fastcall DefaultEditorForFile(
  609. const UnicodeString FileName, bool Local, const TFileMasks::TParams & MaskParams);
  610. virtual UnicodeString __fastcall DecryptPassword(RawByteString Password, UnicodeString Key);
  611. virtual RawByteString __fastcall StronglyRecryptPassword(RawByteString Password, UnicodeString Key);
  612. void __fastcall SetMasterPassword(UnicodeString value);
  613. void __fastcall ChangeMasterPassword(UnicodeString value, TStrings * RecryptPasswordErrors);
  614. bool __fastcall ValidateMasterPassword(UnicodeString value);
  615. void __fastcall ClearMasterPassword(TStrings * RecryptPasswordErrors);
  616. void __fastcall BeginMasterPasswordSession();
  617. void __fastcall EndMasterPasswordSession();
  618. virtual void __fastcall AskForMasterPasswordIfNotSet();
  619. void __fastcall AddSessionToJumpList(UnicodeString SessionName);
  620. void __fastcall DeleteSessionFromJumpList(UnicodeString SessionName);
  621. void __fastcall AddWorkspaceToJumpList(UnicodeString Workspace);
  622. void __fastcall DeleteWorkspaceFromJumpList(UnicodeString Workspace);
  623. void __fastcall UpdateJumpList();
  624. virtual void __fastcall UpdateStaticUsage();
  625. void __fastcall CustomCommandShortCuts(TShortCuts & ShortCuts) const;
  626. UnicodeString __fastcall GetUserExtensionsPath();
  627. UnicodeString __fastcall GetExtensionId(const UnicodeString & ExtensionPath);
  628. UnicodeString __fastcall ExtensionStringTranslation(const UnicodeString & ExtensionId, const UnicodeString & S);
  629. UnicodeString __fastcall UniqueExtensionName(const UnicodeString & ExtensionName, int Counter);
  630. UnicodeString __fastcall GetProvisionaryExtensionId(const UnicodeString & FileName);
  631. bool __fastcall IsDDExtRunning();
  632. bool __fastcall IsDDExtBroken();
  633. bool __fastcall UseDarkTheme();
  634. static void __fastcall RestoreFont(const TFontConfiguration & Configuration, TFont * Font);
  635. static void __fastcall StoreFont(TFont * Font, TFontConfiguration & Configuration);
  636. __property TScpCommanderConfiguration ScpCommander = { read = FScpCommander, write = SetScpCommander };
  637. __property TScpExplorerConfiguration ScpExplorer = { read = FScpExplorer, write = SetScpExplorer };
  638. __property bool SelectDirectories = { read = FSelectDirectories, write = SetSelectDirectories };
  639. __property UnicodeString SelectMask = { read = FSelectMask, write = FSelectMask };
  640. __property bool ShowHiddenFiles = { read = FShowHiddenFiles, write = SetShowHiddenFiles };
  641. __property TFormatBytesStyle FormatSizeBytes = { read = FFormatSizeBytes, write = SetFormatSizeBytes };
  642. __property TIncrementalSearch PanelSearch = { read = FPanelSearch, write = SetPanelSearch };
  643. __property bool ShowInaccesibleDirectories = { read = FShowInaccesibleDirectories, write = SetShowInaccesibleDirectories };
  644. __property TEditorConfiguration Editor = { read = FEditor, write = SetEditor };
  645. __property TQueueViewConfiguration QueueView = { read = FQueueView, write = SetQueueView };
  646. __property bool EnableQueueByDefault = { read = FEnableQueueByDefault, write = SetEnableQueueByDefault };
  647. __property TUpdatesConfiguration Updates = { read = GetUpdates, write = SetUpdates };
  648. __property UnicodeString VersionHistory = { read = FVersionHistory, write = SetVersionHistory };
  649. __property bool AnyBetaInVersionHistory = { read = GetAnyBetaInVersionHistory };
  650. __property bool IsBeta = { read = GetIsBeta };
  651. __property UnicodeString AutoStartSession = { read = FAutoStartSession, write = SetAutoStartSession };
  652. __property TDoubleClickAction DoubleClickAction = { read = FDoubleClickAction, write = SetDoubleClickAction };
  653. __property bool CopyOnDoubleClickConfirmation = { read = FCopyOnDoubleClickConfirmation, write = SetCopyOnDoubleClickConfirmation };
  654. __property bool DDDisableMove = { read = FDDDisableMove, write = SetDDDisableMove };
  655. __property TAutoSwitch DDTransferConfirmation = { read = FDDTransferConfirmation, write = SetDDTransferConfirmation };
  656. __property bool DeleteToRecycleBin = { read = FDeleteToRecycleBin, write = SetDeleteToRecycleBin };
  657. __property bool DimmHiddenFiles = { read = FDimmHiddenFiles, write = SetDimmHiddenFiles };
  658. __property bool RenameWholeName = { read = FRenameWholeName, write = SetRenameWholeName };
  659. __property bool ConfirmTransferring = { read = FConfirmTransferring, write = SetConfirmTransferring};
  660. __property bool ConfirmDeleting = { read = FConfirmDeleting, write = SetConfirmDeleting};
  661. __property bool ConfirmRecycling = { read = FConfirmRecycling, write = SetConfirmRecycling};
  662. __property bool UseLocationProfiles = { read = FUseLocationProfiles, write = SetUseLocationProfiles};
  663. __property bool UseSharedBookmarks = { read = FUseSharedBookmarks, write = SetUseSharedBookmarks};
  664. __property UnicodeString DDTemporaryDirectory = { read=FDDTemporaryDirectory, write=SetDDTemporaryDirectory };
  665. __property UnicodeString DDDrives = { read=FDDDrives, write=SetDDDrives };
  666. __property bool DDWarnLackOfTempSpace = { read=FDDWarnLackOfTempSpace, write=SetDDWarnLackOfTempSpace };
  667. __property bool DDFakeFile = { read=FDDFakeFile, write=SetDDFakeFile };
  668. __property bool DDExtInstalled = { read=GetDDExtInstalled };
  669. __property int DDExtTimeout = { read=FDDExtTimeout, write=SetDDExtTimeout };
  670. __property bool ConfirmClosingSession = { read=FConfirmClosingSession, write=SetConfirmClosingSession };
  671. __property double DDWarnLackOfTempSpaceRatio = { read=FDDWarnLackOfTempSpaceRatio, write=SetDDWarnLackOfTempSpaceRatio };
  672. __property TBookmarkList * Bookmarks[UnicodeString Key] = { read = GetBookmarks, write = SetBookmarks };
  673. __property TBookmarkList * SharedBookmarks = { read = GetSharedBookmarks, write = SetSharedBookmarks };
  674. __property bool EmbeddedSessions = { read = FEmbeddedSessions };
  675. __property bool ExpertMode = { read = FExpertMode, write = SetExpertMode };
  676. __property bool DefaultDirIsHome = { read = FDefaultDirIsHome, write = SetDefaultDirIsHome };
  677. __property bool DisableOpenEdit = { read = FDisableOpenEdit };
  678. __property TCustomCommandList * CustomCommandList = { read = FCustomCommandList, write = SetCustomCommandList };
  679. __property TCustomCommandList * ExtensionList = { read = FExtensionList, write = SetExtensionList };
  680. __property int DDDeleteDelay = { read = FDDDeleteDelay };
  681. __property bool TemporaryDirectoryAppendSession = { read = FTemporaryDirectoryAppendSession, write = SetTemporaryDirectoryAppendSession };
  682. __property bool TemporaryDirectoryAppendPath = { read = FTemporaryDirectoryAppendPath, write = SetTemporaryDirectoryAppendPath };
  683. __property bool TemporaryDirectoryDeterministic = { read = FTemporaryDirectoryDeterministic, write = SetTemporaryDirectoryDeterministic };
  684. __property bool TemporaryDirectoryCleanup = { read = FTemporaryDirectoryCleanup, write = SetTemporaryDirectoryCleanup };
  685. __property bool ConfirmTemporaryDirectoryCleanup = { read = FConfirmTemporaryDirectoryCleanup, write = SetConfirmTemporaryDirectoryCleanup };
  686. __property bool PreservePanelState = { read = FPreservePanelState, write = SetPreservePanelState };
  687. __property TAutoSwitch DarkTheme = { read = FDarkTheme, write = SetDarkTheme };
  688. __property UnicodeString LastStoredSession = { read = FLastStoredSession, write = SetLastStoredSession };
  689. __property UnicodeString LastWorkspace = { read = FLastWorkspace, write = FLastWorkspace };
  690. __property bool AutoSaveWorkspace = { read = FAutoSaveWorkspace, write = SetAutoSaveWorkspace };
  691. __property bool AutoSaveWorkspacePasswords = { read = FAutoSaveWorkspacePasswords, write = SetAutoSaveWorkspacePasswords };
  692. __property UnicodeString AutoWorkspace = { read = FAutoWorkspace, write = SetAutoWorkspace };
  693. __property TPathInCaption PathInCaption = { read = FPathInCaption, write = SetPathInCaption };
  694. __property TSessionTabNameFormat SessionTabNameFormat = { read = FSessionTabNameFormat, write = FSessionTabNameFormat };
  695. __property bool MinimizeToTray = { read = FMinimizeToTray, write = SetMinimizeToTray };
  696. __property bool BalloonNotifications = { read = FBalloonNotifications, write = SetBalloonNotifications };
  697. __property unsigned int NotificationsTimeout = { read = FNotificationsTimeout, write = SetNotificationsTimeout };
  698. __property unsigned int NotificationsStickTime = { read = FNotificationsStickTime, write = SetNotificationsStickTime };
  699. __property UnicodeString DefaultTranslationFile = { read = FDefaultTranslationFile };
  700. __property bool CopyParamAutoSelectNotice = { read = FCopyParamAutoSelectNotice, write = SetCopyParamAutoSelectNotice };
  701. __property bool LockToolbars = { read = FLockToolbars, write = SetLockToolbars };
  702. __property bool SelectiveToolbarText = { read = FSelectiveToolbarText, write = SetSelectiveToolbarText };
  703. __property bool AutoOpenInPutty = { read = FAutoOpenInPutty, write = SetAutoOpenInPutty };
  704. __property bool RefreshRemotePanel = { read = FRefreshRemotePanel, write = SetRefreshRemotePanel };
  705. __property TDateTime RefreshRemotePanelInterval = { read = FRefreshRemotePanelInterval, write = SetRefreshRemotePanelInterval };
  706. __property TFontConfiguration PanelFont = { read = FPanelFont, write = SetPanelFont };
  707. __property bool NaturalOrderNumericalSorting = { read = FNaturalOrderNumericalSorting, write = SetNaturalOrderNumericalSorting };
  708. __property bool FullRowSelect = { read = FFullRowSelect, write = SetFullRowSelect };
  709. __property bool OfferedEditorAutoConfig = { read = FOfferedEditorAutoConfig, write = SetOfferedEditorAutoConfig };
  710. __property int LastMonitor = { read = GetLastMonitor, write = SetLastMonitor };
  711. __property const TEditorList * EditorList = { read = GetEditorList, write = SetEditorList };
  712. __property UnicodeString DefaultKeyFile = { read = GetDefaultKeyFile, write = FDefaultKeyFile };
  713. __property UnicodeString OpenedStoredSessionFolders = { read = FOpenedStoredSessionFolders, write = SetOpenedStoredSessionFolders };
  714. __property bool AutoImportedFromPuttyOrFilezilla = { read = FAutoImportedFromPuttyOrFilezilla, write = SetAutoImportedFromPuttyOrFilezilla };
  715. __property int GenerateUrlComponents = { read = FGenerateUrlComponents, write = SetGenerateUrlComponents };
  716. __property TGenerateUrlCodeTarget GenerateUrlCodeTarget = { read = FGenerateUrlCodeTarget, write = SetGenerateUrlCodeTarget };
  717. __property TScriptFormat GenerateUrlScriptFormat = { read = FGenerateUrlScriptFormat, write = SetGenerateUrlScriptFormat };
  718. __property TAssemblyLanguage GenerateUrlAssemblyLanguage = { read = FGenerateUrlAssemblyLanguage, write = SetGenerateUrlAssemblyLanguage };
  719. __property bool ExternalSessionInExistingInstance = { read = FExternalSessionInExistingInstance, write = SetExternalSessionInExistingInstance };
  720. __property bool ShowLoginWhenNoSession = { read = FShowLoginWhenNoSession, write = SetShowLoginWhenNoSession };
  721. __property bool KeepOpenWhenNoSession = { read = FKeepOpenWhenNoSession, write = SetKeepOpenWhenNoSession };
  722. __property bool LocalIconsByExt = { read = FLocalIconsByExt, write = SetLocalIconsByExt };
  723. __property TLocaleFlagOverride BidiModeOverride = { read = FBidiModeOverride, write = SetBidiModeOverride };
  724. __property TLocaleFlagOverride FlipChildrenOverride = { read = FFlipChildrenOverride, write = SetFlipChildrenOverride };
  725. __property bool ShowTips = { read = FShowTips, write = SetShowTips };
  726. __property UnicodeString TipsSeen = { read = FTipsSeen, write = SetTipsSeen };
  727. __property TDateTime TipsShown = { read = FTipsShown, write = SetTipsShown };
  728. __property UnicodeString FileColors = { read = FFileColors, write = SetFileColors };
  729. __property int RunsSinceLastTip = { read = FRunsSinceLastTip, write = SetRunsSinceLastTip };
  730. __property bool HonorDrivePolicy = { read = GetHonorDrivePolicy, write = SetHonorDrivePolicy };
  731. __property TMasterPasswordPromptEvent OnMasterPasswordPrompt = { read = FOnMasterPasswordPrompt, write = FOnMasterPasswordPrompt };
  732. __property TStrings * CustomCommandOptions = { read = GetCustomCommandOptions, write = SetCustomCommandOptions };
  733. __property bool LockedInterface = { read = FLockedInterface, write = SetLockedInterface };
  734. __property bool TimeoutShellOperations = { read = GetTimeoutShellOperations, write = SetTimeoutShellOperations };
  735. __property bool TimeoutShellIconRetrieval = { read = FTimeoutShellIconRetrieval, write = SetTimeoutShellIconRetrieval };
  736. __property bool UseIconUpdateThread = { read = FUseIconUpdateThread, write = SetUseIconUpdateThread };
  737. __property bool AllowWindowPrint = { read = FAllowWindowPrint, write = SetAllowWindowPrint };
  738. __property LCID DefaultLocale = { read = FDefaultLocale };
  739. __property int LocaleCompletenessTreshold = { read = GetLocaleCompletenessTreshold };
  740. };
  741. //---------------------------------------------------------------------------
  742. class TCustomCommandType
  743. {
  744. public:
  745. __fastcall TCustomCommandType();
  746. __fastcall TCustomCommandType(const TCustomCommandType & Other);
  747. enum TOptionKind { okUnknown, okLabel, okLink, okSeparator, okGroup, okTextBox, okFile, okDropDownList, okComboBox, okCheckBox };
  748. enum TOptionFlag { ofRun = 0x01, ofConfig = 0x02, ofSite = 0x04 };
  749. class TOption
  750. {
  751. public:
  752. __fastcall TOption() {}
  753. UnicodeString Id;
  754. unsigned int Flags;
  755. TOptionKind Kind;
  756. UnicodeString Caption;
  757. UnicodeString Default;
  758. typedef std::vector<UnicodeString> TParams;
  759. TParams Params;
  760. UnicodeString FileCaption;
  761. UnicodeString FileFilter;
  762. UnicodeString FileInitial;
  763. UnicodeString FileExt;
  764. bool operator==(const TOption & Other) const;
  765. __property bool IsControl = { read = GetIsControl };
  766. bool HasPatterns(TCustomCommand * CustomCommandForOptions) const;
  767. private:
  768. bool __fastcall GetIsControl() const;
  769. };
  770. TCustomCommandType & operator=(const TCustomCommandType & Other);
  771. bool __fastcall Equals(const TCustomCommandType * Other) const;
  772. void __fastcall LoadExtension(const UnicodeString & Path);
  773. void __fastcall LoadExtension(TStrings * Lines, const UnicodeString & PathForBaseName);
  774. static UnicodeString __fastcall GetExtensionId(const UnicodeString & Name);
  775. __property UnicodeString Name = { read = FName, write = FName };
  776. __property UnicodeString Command = { read = FCommand, write = FCommand };
  777. __property int Params = { read = FParams, write = FParams };
  778. __property TShortCut ShortCut = { read = FShortCut, write = FShortCut };
  779. __property UnicodeString Id = { read = FId, write = FId };
  780. __property UnicodeString FileName = { read = FFileName, write = FFileName };
  781. __property UnicodeString Description = { read = FDescription, write = FDescription };
  782. __property UnicodeString HomePage = { read = FHomePage, write = FHomePage };
  783. __property UnicodeString OptionsPage = { read = FOptionsPage, write = FOptionsPage };
  784. __property int OptionsCount = { read = GetOptionsCount };
  785. const TOption & __fastcall GetOption(int Index) const;
  786. bool __fastcall AnyOptionWithFlag(unsigned int Flag) const;
  787. UnicodeString __fastcall GetOptionKey(const TOption & Option, const UnicodeString & Site) const;
  788. UnicodeString __fastcall GetCommandWithExpandedOptions(
  789. TStrings * CustomCommandOptions, const UnicodeString & Site) const;
  790. bool __fastcall HasCustomShortCut() const;
  791. protected:
  792. bool __fastcall ParseOption(const UnicodeString & Value, TOption & Option, const UnicodeString & ExtensionBaseName);
  793. int __fastcall GetOptionsCount() const;
  794. UnicodeString __fastcall GetOptionCommand(const TOption & Option, const UnicodeString & Value) const;
  795. private:
  796. UnicodeString FName;
  797. UnicodeString FCommand;
  798. int FParams;
  799. TShortCut FShortCut;
  800. TShortCut FShortCutOriginal;
  801. UnicodeString FId;
  802. UnicodeString FFileName;
  803. UnicodeString FDescription;
  804. UnicodeString FHomePage;
  805. UnicodeString FOptionsPage;
  806. std::vector<TOption> FOptions;
  807. };
  808. //---------------------------------------------------------------------------
  809. class TCustomCommandList
  810. {
  811. public:
  812. __fastcall TCustomCommandList();
  813. __fastcall ~TCustomCommandList();
  814. void __fastcall Load(THierarchicalStorage * Storage);
  815. void __fastcall Save(THierarchicalStorage * Storage);
  816. void __fastcall Reset();
  817. void __fastcall Modify();
  818. void __fastcall Clear();
  819. void __fastcall Add(const UnicodeString Name, const UnicodeString Command, int Params);
  820. void __fastcall Add(TCustomCommandType * Command);
  821. void __fastcall Insert(int Index, TCustomCommandType * Command);
  822. void __fastcall Change(int Index, TCustomCommandType * Command);
  823. void __fastcall Move(int CurIndex, int NewIndex);
  824. void __fastcall Delete(int Index);
  825. void __fastcall SortBy(TStrings * Ids);
  826. const TCustomCommandType * Find(const UnicodeString Name) const;
  827. const TCustomCommandType * Find(TShortCut ShortCut) const;
  828. int FindIndexByFileName(const UnicodeString & FileName) const;
  829. bool __fastcall Equals(const TCustomCommandList * Other) const;
  830. void __fastcall Assign(const TCustomCommandList * Other);
  831. void __fastcall ShortCuts(TShortCuts & ShortCuts) const;
  832. __property bool Modified = { read = FModified };
  833. __property int Count = { read = GetCount };
  834. __property const TCustomCommandType * Commands[int Index] = { read = GetConstCommand };
  835. private:
  836. bool FModified;
  837. TList * FCommands;
  838. int __fastcall GetCount() const;
  839. const TCustomCommandType * __fastcall GetConstCommand(int Index) const;
  840. TCustomCommandType * __fastcall GetCommand(int Index);
  841. };
  842. //---------------------------------------------------------------------------
  843. extern TWinConfiguration * WinConfiguration;
  844. extern const UnicodeString WinSCPExtensionExt;
  845. //---------------------------------------------------------------------------
  846. #endif