WinConfiguration.h 45 KB

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