WinConfiguration.h 46 KB

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