WinConfiguration.h 42 KB

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