WinConfiguration.h 46 KB

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