WinConfiguration.h 44 KB

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