WinConfiguration.h 42 KB

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