1
0

WinConfiguration.h 41 KB

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