WinConfiguration.h 41 KB

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