WinConfiguration.h 44 KB

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