WinConfiguration.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. //---------------------------------------------------------------------------
  2. #ifndef WinConfigurationH
  3. #define WinConfigurationH
  4. //---------------------------------------------------------------------------
  5. #include "CustomWinConfiguration.h"
  6. #include "CustomDirView.hpp"
  7. //---------------------------------------------------------------------------
  8. enum TEditor { edInternal, edExternal, edOpen };
  9. //---------------------------------------------------------------------------
  10. #define C(Property) (Property != rhc.Property) ||
  11. struct TScpExplorerConfiguration {
  12. UnicodeString WindowParams;
  13. UnicodeString DirViewParams;
  14. UnicodeString ToolbarsLayout;
  15. bool SessionsTabs;
  16. bool StatusBar;
  17. UnicodeString LastLocalTargetDirectory;
  18. int ViewStyle;
  19. bool ShowFullAddress;
  20. bool DriveView;
  21. int DriveViewWidth;
  22. int DriveViewWidthPixelsPerInch;
  23. bool __fastcall operator !=(TScpExplorerConfiguration & rhc)
  24. { return C(WindowParams) C(DirViewParams) C(ToolbarsLayout)
  25. C(SessionsTabs) C(StatusBar)
  26. C(LastLocalTargetDirectory) C(ViewStyle) C(ShowFullAddress)
  27. C(DriveView) C(DriveViewWidth) C(DriveViewWidthPixelsPerInch) 0; };
  28. };
  29. //---------------------------------------------------------------------------
  30. struct TScpCommanderPanelConfiguration {
  31. UnicodeString DirViewParams;
  32. bool StatusBar;
  33. bool DriveView;
  34. int DriveViewHeight;
  35. int DriveViewHeightPixelsPerInch;
  36. int DriveViewWidth;
  37. int DriveViewWidthPixelsPerInch;
  38. bool __fastcall operator !=(TScpCommanderPanelConfiguration & rhc)
  39. { return C(DirViewParams) C(StatusBar)
  40. C(DriveView) C(DriveViewHeight) C(DriveViewHeightPixelsPerInch)
  41. C(DriveViewWidth) C(DriveViewWidthPixelsPerInch) 0; };
  42. };
  43. //---------------------------------------------------------------------------
  44. struct TScpCommanderConfiguration {
  45. UnicodeString WindowParams;
  46. double LocalPanelWidth;
  47. UnicodeString ToolbarsLayout;
  48. bool SessionsTabs;
  49. bool StatusBar;
  50. TOperationSide CurrentPanel;
  51. TNortonLikeMode NortonLikeMode;
  52. bool PreserveLocalDirectory;
  53. TScpCommanderPanelConfiguration LocalPanel;
  54. TScpCommanderPanelConfiguration RemotePanel;
  55. bool CompareByTime;
  56. bool CompareBySize;
  57. bool SwappedPanels;
  58. bool TreeOnLeft;
  59. bool ExplorerKeyboardShortcuts;
  60. bool SystemContextMenu;
  61. bool __fastcall operator !=(TScpCommanderConfiguration & rhc)
  62. { return C(WindowParams) C(LocalPanelWidth) C(ToolbarsLayout)
  63. C(SessionsTabs) C(StatusBar)
  64. C(LocalPanel) C(RemotePanel) C(CurrentPanel)
  65. C(NortonLikeMode) C(PreserveLocalDirectory)
  66. C(CompareBySize) C(CompareByTime) C(SwappedPanels)
  67. C(TreeOnLeft) C(ExplorerKeyboardShortcuts) C(SystemContextMenu) 0; };
  68. TCompareCriterias __fastcall CompareCriterias()
  69. {
  70. TCompareCriterias Criterias;
  71. if (CompareByTime)
  72. {
  73. Criterias << ccTime;
  74. }
  75. if (CompareBySize)
  76. {
  77. Criterias << ccSize;
  78. }
  79. return Criterias;
  80. }
  81. };
  82. //---------------------------------------------------------------------------
  83. struct TEditorConfiguration {
  84. UnicodeString FontName;
  85. int FontSize;
  86. int FontCharset;
  87. int FontStyle;
  88. bool WordWrap;
  89. UnicodeString FindText;
  90. UnicodeString ReplaceText;
  91. bool FindMatchCase;
  92. bool FindWholeWord;
  93. bool FindDown;
  94. unsigned int TabSize;
  95. unsigned int MaxEditors;
  96. unsigned int EarlyClose;
  97. bool SDIShellEditor;
  98. UnicodeString WindowParams;
  99. int Encoding;
  100. bool WarnOnEncodingFallback;
  101. bool __fastcall operator !=(TEditorConfiguration & rhc)
  102. { return C(FontName) C(FontSize)
  103. C(FontCharset) C(FontStyle) C(WordWrap) C(FindText) C(ReplaceText)
  104. C(FindMatchCase) C(FindWholeWord) C(FindDown) C(TabSize)
  105. C(MaxEditors) C(EarlyClose) C(SDIShellEditor) C(WindowParams)
  106. C(Encoding) C(WarnOnEncodingFallback) 0; };
  107. };
  108. //---------------------------------------------------------------------------
  109. enum TQueueViewShow { qvShow, qvHideWhenEmpty, qvHide };
  110. struct TQueueViewConfiguration {
  111. int Height;
  112. int HeightPixelsPerInch;
  113. UnicodeString Layout;
  114. TQueueViewShow Show;
  115. TQueueViewShow LastHideShow;
  116. bool ToolBar;
  117. bool Label;
  118. bool __fastcall operator !=(TQueueViewConfiguration & rhc)
  119. { return C(Height) C(HeightPixelsPerInch) C(Layout) C(Show) C(LastHideShow) C(ToolBar) C(Label) 0; };
  120. };
  121. //---------------------------------------------------------------------------
  122. struct TUpdatesData
  123. {
  124. int ForVersion;
  125. int Version;
  126. UnicodeString Message;
  127. bool Critical;
  128. UnicodeString Release;
  129. bool Disabled;
  130. UnicodeString Url;
  131. UnicodeString UrlButton;
  132. bool __fastcall operator !=(TUpdatesData & rhc)
  133. { return C(ForVersion) C(Version) C(Message) C(Critical) C(Release)
  134. C(Disabled) C(Url) C(UrlButton) 0; };
  135. void Reset()
  136. {
  137. ForVersion = 0;
  138. Version = 0;
  139. Message = L"";
  140. Critical = false;
  141. Release = L"";
  142. Disabled = false;
  143. Url = L"";
  144. UrlButton = L"";
  145. }
  146. };
  147. //---------------------------------------------------------------------------
  148. enum TConnectionType { ctDirect, ctAuto, ctProxy };
  149. //---------------------------------------------------------------------------
  150. struct TUpdatesConfiguration
  151. {
  152. TDateTime Period;
  153. TDateTime LastCheck;
  154. TConnectionType ConnectionType;
  155. UnicodeString ProxyHost;
  156. int ProxyPort;
  157. TAutoSwitch BetaVersions;
  158. bool HaveResults;
  159. bool ShownResults;
  160. UnicodeString DotNetVersion;
  161. UnicodeString ConsoleVersion;
  162. TUpdatesData Results;
  163. bool __fastcall operator !=(TUpdatesConfiguration & rhc)
  164. { return C(Period) C(LastCheck) C(ConnectionType) C(ProxyHost) C(ProxyPort)
  165. C(BetaVersions) C(HaveResults) C(ShownResults) C(DotNetVersion)
  166. C(ConsoleVersion) C(Results) 0; };
  167. };
  168. //---------------------------------------------------------------------------
  169. struct TEditorData
  170. {
  171. __fastcall TEditorData();
  172. __fastcall TEditorData(const TEditorData & Source);
  173. TFileMasks FileMask;
  174. TEditor Editor;
  175. UnicodeString ExternalEditor;
  176. bool ExternalEditorText;
  177. bool SDIExternalEditor;
  178. bool DetectMDIExternalEditor;
  179. bool __fastcall operator ==(const TEditorData & rhd) const;
  180. };
  181. //---------------------------------------------------------------------------
  182. #undef C
  183. //---------------------------------------------------------------------------
  184. class TEditorPreferences
  185. {
  186. public:
  187. __fastcall TEditorPreferences();
  188. __fastcall TEditorPreferences(const TEditorData & Data);
  189. bool __fastcall Matches(const UnicodeString FileName, bool Local,
  190. const TFileMasks::TParams & Params) const;
  191. void __fastcall Load(THierarchicalStorage * Storage, bool Legacy);
  192. void __fastcall Save(THierarchicalStorage * Storage) const;
  193. void __fastcall LegacyDefaults();
  194. static UnicodeString __fastcall GetDefaultExternalEditor();
  195. bool __fastcall operator ==(const TEditorPreferences & rhp) const;
  196. __property const TEditorData * Data = { read = GetConstData };
  197. __property UnicodeString Name = { read = GetName };
  198. TEditorData * __fastcall GetData();
  199. private:
  200. TEditorData FData;
  201. mutable UnicodeString FName;
  202. UnicodeString __fastcall GetName() const;
  203. const TEditorData * __fastcall GetConstData() const { return &FData; };
  204. };
  205. //---------------------------------------------------------------------------
  206. class TEditorList
  207. {
  208. public:
  209. __fastcall TEditorList();
  210. virtual __fastcall ~TEditorList();
  211. const TEditorPreferences * __fastcall Find(const UnicodeString FileName,
  212. bool Local, const TFileMasks::TParams & Params) const;
  213. void __fastcall Load(THierarchicalStorage * Storage);
  214. void __fastcall Save(THierarchicalStorage * Storage) const;
  215. TEditorList & __fastcall operator=(const TEditorList & rhl);
  216. bool __fastcall operator==(const TEditorList & rhl) const;
  217. void __fastcall Clear();
  218. void __fastcall Add(TEditorPreferences * Editor);
  219. void __fastcall Insert(int Index, TEditorPreferences * Editor);
  220. void __fastcall Change(int Index, TEditorPreferences * Editor);
  221. void __fastcall Move(int CurIndex, int NewIndex);
  222. void __fastcall Delete(int Index);
  223. void __fastcall Saved();
  224. bool __fastcall IsDefaultList() const;
  225. __property int Count = { read = GetCount };
  226. __property const TEditorPreferences * Editors[int Index] = { read = GetEditor };
  227. __property bool Modified = { read = FModified };
  228. private:
  229. TList * FEditors;
  230. bool FModified;
  231. int __fastcall GetCount() const;
  232. void __fastcall Init();
  233. void __fastcall Modify();
  234. const TEditorPreferences * __fastcall GetEditor(int Index) const;
  235. };
  236. //---------------------------------------------------------------------------
  237. class TBookmarks;
  238. class TBookmarkList;
  239. class TCustomCommandList;
  240. enum TPathInCaption { picShort, picFull, picNone };
  241. // constants must be compatible with legacy CopyOnDoubleClick
  242. enum TDoubleClickAction { dcaOpen = 0, dcaCopy = 1, dcaEdit = 2 };
  243. //---------------------------------------------------------------------------
  244. typedef void __fastcall (__closure *TMasterPasswordPromptEvent)();
  245. //---------------------------------------------------------------------------
  246. class TWinConfiguration : public TCustomWinConfiguration
  247. {
  248. private:
  249. UnicodeString FAutoStartSession;
  250. TDoubleClickAction FDoubleClickAction;
  251. bool FCopyOnDoubleClickConfirmation;
  252. bool FDDAllowMove;
  253. bool FDDAllowMoveInit;
  254. TAutoSwitch FDDTransferConfirmation;
  255. bool FDeleteToRecycleBin;
  256. bool FDimmHiddenFiles;
  257. bool FRenameWholeName;
  258. bool FLogWindowOnStartup;
  259. UnicodeString FLogWindowParams;
  260. TScpCommanderConfiguration FScpCommander;
  261. TScpExplorerConfiguration FScpExplorer;
  262. bool FSelectDirectories;
  263. UnicodeString FSelectMask;
  264. bool FShowHiddenFiles;
  265. bool FFormatSizeBytes;
  266. bool FShowInaccesibleDirectories;
  267. bool FConfirmTransferring;
  268. bool FConfirmDeleting;
  269. bool FConfirmRecycling;
  270. bool FUseLocationProfiles;
  271. bool FUseSharedBookmarks;
  272. UnicodeString FDDTemporaryDirectory;
  273. bool FDDWarnLackOfTempSpace;
  274. bool FDDExtEnabled;
  275. int FDDExtInstalled;
  276. int FDDExtTimeout;
  277. bool FConfirmClosingSession;
  278. double FDDWarnLackOfTempSpaceRatio;
  279. UnicodeString FTemporarySessionFile;
  280. UnicodeString FTemporaryKeyFile;
  281. TBookmarks * FBookmarks;
  282. TCustomCommandList * FCustomCommandList;
  283. bool FCustomCommandsDefaults;
  284. TEditorConfiguration FEditor;
  285. TQueueViewConfiguration FQueueView;
  286. bool FEnableQueueByDefault;
  287. bool FEmbeddedSessions;
  288. bool FExpertMode;
  289. bool FDisableOpenEdit;
  290. bool FDefaultDirIsHome;
  291. int FDDDeleteDelay;
  292. bool FTemporaryDirectoryAppendSession;
  293. bool FTemporaryDirectoryAppendPath;
  294. bool FTemporaryDirectoryCleanup;
  295. bool FConfirmTemporaryDirectoryCleanup;
  296. UnicodeString FDefaultTranslationFile;
  297. UnicodeString FInvalidDefaultTranslationMessage;
  298. bool FPreservePanelState;
  299. UnicodeString FTheme;
  300. UnicodeString FLastStoredSession;
  301. UnicodeString FLastWorkspace;
  302. bool FAutoSaveWorkspace;
  303. bool FAutoSaveWorkspacePasswords;
  304. UnicodeString FAutoWorkspace;
  305. TPathInCaption FPathInCaption;
  306. bool FMinimizeToTray;
  307. bool FBalloonNotifications;
  308. unsigned int FNotificationsTimeout;
  309. unsigned int FNotificationsStickTime;
  310. TUpdatesConfiguration FUpdates;
  311. UnicodeString FVersionHistory;
  312. bool FCopyParamAutoSelectNotice;
  313. bool FLockToolbars;
  314. bool FSelectiveToolbarText;
  315. TEditorList * FEditorList;
  316. TEditorPreferences * FLegacyEditor;
  317. UnicodeString FDefaultKeyFile;
  318. bool FAutoOpenInPutty;
  319. TDateTime FDefaultUpdatesPeriod;
  320. bool FRefreshRemotePanel;
  321. TDateTime FRefreshRemotePanelInterval;
  322. bool FFullRowSelect;
  323. bool FOfferedEditorAutoConfig;
  324. bool FUseMasterPassword;
  325. UnicodeString FPlainMasterPasswordEncrypt;
  326. UnicodeString FPlainMasterPasswordDecrypt;
  327. UnicodeString FMasterPasswordVerifier;
  328. TMasterPasswordPromptEvent FOnMasterPasswordPrompt;
  329. UnicodeString FOpenedStoredSessionFolders;
  330. bool FAutoImportedFromPuttyOrFilezilla;
  331. int FDontDecryptPasswords;
  332. int FMasterPasswordSession;
  333. bool FMasterPasswordSessionAsked;
  334. void __fastcall SetDoubleClickAction(TDoubleClickAction value);
  335. void __fastcall SetCopyOnDoubleClickConfirmation(bool value);
  336. void __fastcall SetDDAllowMove(bool value);
  337. void __fastcall SetDDAllowMoveInit(bool value);
  338. void __fastcall SetDDTransferConfirmation(TAutoSwitch value);
  339. void __fastcall SetDeleteToRecycleBin(bool value);
  340. void __fastcall SetDimmHiddenFiles(bool value);
  341. void __fastcall SetRenameWholeName(bool value);
  342. void __fastcall SetLogWindowOnStartup(bool value);
  343. void __fastcall SetLogWindowParams(UnicodeString value);
  344. void __fastcall SetScpCommander(TScpCommanderConfiguration value);
  345. void __fastcall SetScpExplorer(TScpExplorerConfiguration value);
  346. void __fastcall SetSelectDirectories(bool value);
  347. void __fastcall SetShowHiddenFiles(bool value);
  348. void __fastcall SetFormatSizeBytes(bool value);
  349. void __fastcall SetShowInaccesibleDirectories(bool value);
  350. void __fastcall SetConfirmTransferring(bool value);
  351. void __fastcall SetConfirmDeleting(bool value);
  352. void __fastcall SetConfirmRecycling(bool value);
  353. void __fastcall SetUseLocationProfiles(bool value);
  354. void __fastcall SetUseSharedBookmarks(bool value);
  355. void __fastcall SetDDTemporaryDirectory(UnicodeString value);
  356. void __fastcall SetDDWarnLackOfTempSpace(bool value);
  357. void __fastcall SetDDExtEnabled(bool value);
  358. void __fastcall SetDDExtTimeout(int value);
  359. void __fastcall SetConfirmClosingSession(bool value);
  360. void __fastcall SetDDWarnLackOfTempSpaceRatio(double value);
  361. void __fastcall SetBookmarks(UnicodeString Key, TBookmarkList * value);
  362. TBookmarkList * __fastcall GetBookmarks(UnicodeString Key);
  363. void __fastcall SetSharedBookmarks(TBookmarkList * value);
  364. TBookmarkList * __fastcall GetSharedBookmarks();
  365. void __fastcall SetAutoStartSession(UnicodeString value);
  366. void __fastcall SetExpertMode(bool value);
  367. void __fastcall SetDefaultDirIsHome(bool value);
  368. void __fastcall SetEditor(TEditorConfiguration value);
  369. void __fastcall SetQueueView(TQueueViewConfiguration value);
  370. void __fastcall SetEnableQueueByDefault(bool value);
  371. void __fastcall SetCustomCommandList(TCustomCommandList * value);
  372. void __fastcall SetTemporaryDirectoryAppendSession(bool value);
  373. void __fastcall SetTemporaryDirectoryAppendPath(bool value);
  374. void __fastcall SetTemporaryDirectoryCleanup(bool value);
  375. void __fastcall SetConfirmTemporaryDirectoryCleanup(bool value);
  376. void __fastcall SetPreservePanelState(bool value);
  377. void __fastcall SetTheme(UnicodeString value);
  378. void __fastcall SetLastStoredSession(UnicodeString value);
  379. void __fastcall SetAutoSaveWorkspace(bool value);
  380. void __fastcall SetAutoSaveWorkspacePasswords(bool value);
  381. void __fastcall SetAutoWorkspace(UnicodeString value);
  382. void __fastcall SetPathInCaption(TPathInCaption value);
  383. void __fastcall SetMinimizeToTray(bool value);
  384. void __fastcall SetBalloonNotifications(bool value);
  385. void __fastcall SetNotificationsTimeout(unsigned int value);
  386. void __fastcall SetNotificationsStickTime(unsigned int value);
  387. void __fastcall SetCopyParamAutoSelectNotice(bool value);
  388. TUpdatesConfiguration __fastcall GetUpdates();
  389. void __fastcall SetUpdates(TUpdatesConfiguration value);
  390. void __fastcall SetVersionHistory(UnicodeString value);
  391. void __fastcall SetLockToolbars(bool value);
  392. void __fastcall SetSelectiveToolbarText(bool value);
  393. const TEditorList * __fastcall GetEditorList();
  394. void __fastcall SetEditorList(const TEditorList * value);
  395. void __fastcall SetAutoOpenInPutty(bool value);
  396. void __fastcall SetRefreshRemotePanel(bool value);
  397. void __fastcall SetRefreshRemotePanelInterval(TDateTime value);
  398. void __fastcall SetFullRowSelect(bool value);
  399. void __fastcall SetOfferedEditorAutoConfig(bool value);
  400. void __fastcall SetLastMonitor(int value);
  401. int __fastcall GetLastMonitor();
  402. void __fastcall SetOpenedStoredSessionFolders(UnicodeString value);
  403. void __fastcall SetAutoImportedFromPuttyOrFilezilla(bool value);
  404. bool __fastcall GetIsBeta();
  405. bool __fastcall GetDDExtInstalled();
  406. void __fastcall AddVersionToHistory();
  407. bool __fastcall GetAnyBetaInVersionHistory();
  408. void __fastcall PurgePassword(UnicodeString & Password);
  409. void __fastcall UpdateEntryInJumpList(
  410. bool Session, const UnicodeString & Name, bool Add);
  411. TStringList * __fastcall LoadJumpList(THierarchicalStorage * Storage,
  412. UnicodeString Name);
  413. void __fastcall SaveJumpList(THierarchicalStorage * Storage,
  414. UnicodeString Name, TStringList * List);
  415. void __fastcall TrimJumpList(TStringList * List);
  416. protected:
  417. virtual TStorage __fastcall GetStorage();
  418. virtual void __fastcall SaveData(THierarchicalStorage * Storage, bool All);
  419. virtual void __fastcall LoadData(THierarchicalStorage * Storage);
  420. virtual void __fastcall LoadFrom(THierarchicalStorage * Storage);
  421. virtual void __fastcall LoadAdmin(THierarchicalStorage * Storage);
  422. virtual void __fastcall CopyData(THierarchicalStorage * Source, THierarchicalStorage * Target);
  423. virtual UnicodeString __fastcall GetDefaultKeyFile();
  424. virtual void __fastcall Saved();
  425. void __fastcall RecryptPasswords(TStrings * RecryptPasswordErrors);
  426. virtual bool __fastcall GetUseMasterPassword();
  427. bool __fastcall SameStringLists(TStrings * Strings1, TStrings * Strings2);
  428. bool __fastcall InternalReloadComponentRes(const UnicodeString ResName,
  429. HINSTANCE HInst, TComponent * Instance);
  430. bool __fastcall InitComponent(TComponent * Instance,
  431. TClass RootAncestor, TClass ClassType);
  432. virtual HINSTANCE __fastcall LoadNewResourceModule(LCID Locale,
  433. UnicodeString * FileName = NULL);
  434. virtual void __fastcall SetResourceModule(HINSTANCE Instance);
  435. virtual LCID __fastcall GetLocale();
  436. void __fastcall CheckTranslationVersion(const UnicodeString FileName,
  437. bool InternalLocaleOnError);
  438. virtual void __fastcall DefaultLocalized();
  439. bool __fastcall DetectRegistryStorage(HKEY RootKey);
  440. bool __fastcall CanWriteToStorage();
  441. bool __fastcall DoIsBeta(const UnicodeString & ReleaseType);
  442. void __fastcall AskForMasterPassword();
  443. public:
  444. __fastcall TWinConfiguration();
  445. virtual __fastcall ~TWinConfiguration();
  446. virtual void __fastcall Default();
  447. void __fastcall ClearTemporaryLoginData();
  448. virtual THierarchicalStorage * CreateScpStorage(bool SessionList);
  449. UnicodeString __fastcall TemporaryDir(bool Mask = false);
  450. TStrings * __fastcall FindTemporaryFolders();
  451. void __fastcall CleanupTemporaryFolders(TStrings * Folders = NULL);
  452. void __fastcall CheckDefaultTranslation();
  453. const TEditorPreferences * __fastcall DefaultEditorForFile(
  454. const UnicodeString FileName, bool Local, const TFileMasks::TParams & MaskParams);
  455. virtual UnicodeString __fastcall DecryptPassword(RawByteString Password, UnicodeString Key);
  456. virtual RawByteString __fastcall StronglyRecryptPassword(RawByteString Password, UnicodeString Key);
  457. void __fastcall SetMasterPassword(UnicodeString value);
  458. void __fastcall ChangeMasterPassword(UnicodeString value, TStrings * RecryptPasswordErrors);
  459. bool __fastcall ValidateMasterPassword(UnicodeString value);
  460. void __fastcall ClearMasterPassword(TStrings * RecryptPasswordErrors);
  461. void __fastcall BeginMasterPasswordSession();
  462. void __fastcall EndMasterPasswordSession();
  463. virtual void __fastcall AskForMasterPasswordIfNotSet();
  464. void __fastcall AddSessionToJumpList(UnicodeString SessionName);
  465. void __fastcall DeleteSessionFromJumpList(UnicodeString SessionName);
  466. void __fastcall AddWorkspaceToJumpList(UnicodeString Workspace);
  467. void __fastcall DeleteWorkspaceFromJumpList(UnicodeString Workspace);
  468. void __fastcall UpdateJumpList();
  469. virtual void __fastcall UpdateStaticUsage();
  470. __property TScpCommanderConfiguration ScpCommander = { read = FScpCommander, write = SetScpCommander };
  471. __property TScpExplorerConfiguration ScpExplorer = { read = FScpExplorer, write = SetScpExplorer };
  472. __property bool SelectDirectories = { read = FSelectDirectories, write = SetSelectDirectories };
  473. __property UnicodeString SelectMask = { read = FSelectMask, write = FSelectMask };
  474. __property bool ShowHiddenFiles = { read = FShowHiddenFiles, write = SetShowHiddenFiles };
  475. __property bool FormatSizeBytes = { read = FFormatSizeBytes, write = SetFormatSizeBytes };
  476. __property bool ShowInaccesibleDirectories = { read = FShowInaccesibleDirectories, write = SetShowInaccesibleDirectories };
  477. __property TEditorConfiguration Editor = { read = FEditor, write = SetEditor };
  478. __property TQueueViewConfiguration QueueView = { read = FQueueView, write = SetQueueView };
  479. __property bool EnableQueueByDefault = { read = FEnableQueueByDefault, write = SetEnableQueueByDefault };
  480. __property TUpdatesConfiguration Updates = { read = GetUpdates, write = SetUpdates };
  481. __property UnicodeString VersionHistory = { read = FVersionHistory, write = SetVersionHistory };
  482. __property bool AnyBetaInVersionHistory = { read = GetAnyBetaInVersionHistory };
  483. __property bool IsBeta = { read = GetIsBeta };
  484. __property UnicodeString AutoStartSession = { read = FAutoStartSession, write = SetAutoStartSession };
  485. __property TDoubleClickAction DoubleClickAction = { read = FDoubleClickAction, write = SetDoubleClickAction };
  486. __property bool CopyOnDoubleClickConfirmation = { read = FCopyOnDoubleClickConfirmation, write = SetCopyOnDoubleClickConfirmation };
  487. __property bool DDAllowMove = { read = FDDAllowMove, write = SetDDAllowMove };
  488. __property bool DDAllowMoveInit = { read = FDDAllowMoveInit, write = SetDDAllowMoveInit };
  489. __property TAutoSwitch DDTransferConfirmation = { read = FDDTransferConfirmation, write = SetDDTransferConfirmation };
  490. __property bool LogWindowOnStartup = { read = FLogWindowOnStartup, write = SetLogWindowOnStartup };
  491. __property bool DeleteToRecycleBin = { read = FDeleteToRecycleBin, write = SetDeleteToRecycleBin };
  492. __property bool DimmHiddenFiles = { read = FDimmHiddenFiles, write = SetDimmHiddenFiles };
  493. __property bool RenameWholeName = { read = FRenameWholeName, write = SetRenameWholeName };
  494. __property UnicodeString LogWindowParams = { read = FLogWindowParams, write = SetLogWindowParams };
  495. __property bool ConfirmTransferring = { read = FConfirmTransferring, write = SetConfirmTransferring};
  496. __property bool ConfirmDeleting = { read = FConfirmDeleting, write = SetConfirmDeleting};
  497. __property bool ConfirmRecycling = { read = FConfirmRecycling, write = SetConfirmRecycling};
  498. __property bool UseLocationProfiles = { read = FUseLocationProfiles, write = SetUseLocationProfiles};
  499. __property bool UseSharedBookmarks = { read = FUseSharedBookmarks, write = SetUseSharedBookmarks};
  500. __property UnicodeString DDTemporaryDirectory = { read=FDDTemporaryDirectory, write=SetDDTemporaryDirectory };
  501. __property bool DDWarnLackOfTempSpace = { read=FDDWarnLackOfTempSpace, write=SetDDWarnLackOfTempSpace };
  502. __property bool DDExtEnabled = { read=FDDExtEnabled, write=SetDDExtEnabled };
  503. __property bool DDExtInstalled = { read=GetDDExtInstalled };
  504. __property int DDExtTimeout = { read=FDDExtTimeout, write=SetDDExtTimeout };
  505. __property bool ConfirmClosingSession = { read=FConfirmClosingSession, write=SetConfirmClosingSession };
  506. __property double DDWarnLackOfTempSpaceRatio = { read=FDDWarnLackOfTempSpaceRatio, write=SetDDWarnLackOfTempSpaceRatio };
  507. __property TBookmarkList * Bookmarks[UnicodeString Key] = { read = GetBookmarks, write = SetBookmarks };
  508. __property TBookmarkList * SharedBookmarks = { read = GetSharedBookmarks, write = SetSharedBookmarks };
  509. __property bool EmbeddedSessions = { read = FEmbeddedSessions };
  510. __property bool ExpertMode = { read = FExpertMode, write = SetExpertMode };
  511. __property bool DefaultDirIsHome = { read = FDefaultDirIsHome, write = SetDefaultDirIsHome };
  512. __property bool DisableOpenEdit = { read = FDisableOpenEdit };
  513. __property TCustomCommandList * CustomCommandList = { read = FCustomCommandList, write = SetCustomCommandList };
  514. __property int DDDeleteDelay = { read = FDDDeleteDelay };
  515. __property bool TemporaryDirectoryAppendSession = { read = FTemporaryDirectoryAppendSession, write = SetTemporaryDirectoryAppendSession };
  516. __property bool TemporaryDirectoryAppendPath = { read = FTemporaryDirectoryAppendPath, write = SetTemporaryDirectoryAppendPath };
  517. __property bool TemporaryDirectoryCleanup = { read = FTemporaryDirectoryCleanup, write = SetTemporaryDirectoryCleanup };
  518. __property bool ConfirmTemporaryDirectoryCleanup = { read = FConfirmTemporaryDirectoryCleanup, write = SetConfirmTemporaryDirectoryCleanup };
  519. __property bool PreservePanelState = { read = FPreservePanelState, write = SetPreservePanelState };
  520. __property UnicodeString Theme = { read = FTheme, write = SetTheme };
  521. __property UnicodeString LastStoredSession = { read = FLastStoredSession, write = SetLastStoredSession };
  522. __property UnicodeString LastWorkspace = { read = FLastWorkspace, write = FLastWorkspace };
  523. __property bool AutoSaveWorkspace = { read = FAutoSaveWorkspace, write = SetAutoSaveWorkspace };
  524. __property bool AutoSaveWorkspacePasswords = { read = FAutoSaveWorkspacePasswords, write = SetAutoSaveWorkspacePasswords };
  525. __property UnicodeString AutoWorkspace = { read = FAutoWorkspace, write = SetAutoWorkspace };
  526. __property TPathInCaption PathInCaption = { read = FPathInCaption, write = SetPathInCaption };
  527. __property bool MinimizeToTray = { read = FMinimizeToTray, write = SetMinimizeToTray };
  528. __property bool BalloonNotifications = { read = FBalloonNotifications, write = SetBalloonNotifications };
  529. __property unsigned int NotificationsTimeout = { read = FNotificationsTimeout, write = SetNotificationsTimeout };
  530. __property unsigned int NotificationsStickTime = { read = FNotificationsStickTime, write = SetNotificationsStickTime };
  531. __property UnicodeString DefaultTranslationFile = { read = FDefaultTranslationFile };
  532. __property bool CopyParamAutoSelectNotice = { read = FCopyParamAutoSelectNotice, write = SetCopyParamAutoSelectNotice };
  533. __property bool LockToolbars = { read = FLockToolbars, write = SetLockToolbars };
  534. __property bool SelectiveToolbarText = { read = FSelectiveToolbarText, write = SetSelectiveToolbarText };
  535. __property bool AutoOpenInPutty = { read = FAutoOpenInPutty, write = SetAutoOpenInPutty };
  536. __property bool RefreshRemotePanel = { read = FRefreshRemotePanel, write = SetRefreshRemotePanel };
  537. __property TDateTime RefreshRemotePanelInterval = { read = FRefreshRemotePanelInterval, write = SetRefreshRemotePanelInterval };
  538. __property bool FullRowSelect = { read = FFullRowSelect, write = SetFullRowSelect };
  539. __property bool OfferedEditorAutoConfig = { read = FOfferedEditorAutoConfig, write = SetOfferedEditorAutoConfig };
  540. __property int LastMonitor = { read = GetLastMonitor, write = SetLastMonitor };
  541. __property const TEditorList * EditorList = { read = GetEditorList, write = SetEditorList };
  542. __property UnicodeString DefaultKeyFile = { read = GetDefaultKeyFile, write = FDefaultKeyFile };
  543. __property UnicodeString OpenedStoredSessionFolders = { read = FOpenedStoredSessionFolders, write = SetOpenedStoredSessionFolders };
  544. __property bool AutoImportedFromPuttyOrFilezilla = { read = FAutoImportedFromPuttyOrFilezilla, write = SetAutoImportedFromPuttyOrFilezilla };
  545. __property TMasterPasswordPromptEvent OnMasterPasswordPrompt = { read = FOnMasterPasswordPrompt, write = FOnMasterPasswordPrompt };
  546. };
  547. //---------------------------------------------------------------------------
  548. class TCustomCommandType
  549. {
  550. public:
  551. __fastcall TCustomCommandType();
  552. __fastcall TCustomCommandType(const TCustomCommandType & Other);
  553. TCustomCommandType & operator=(const TCustomCommandType & Other);
  554. bool __fastcall Equals(const TCustomCommandType * Other) const;
  555. __property UnicodeString Name = { read = FName, write = FName };
  556. __property UnicodeString Command = { read = FCommand, write = FCommand };
  557. __property int Params = { read = FParams, write = FParams };
  558. __property TShortCut ShortCut = { read = FShortCut, write = FShortCut };
  559. private:
  560. UnicodeString FName;
  561. UnicodeString FCommand;
  562. int FParams;
  563. TShortCut FShortCut;
  564. };
  565. //---------------------------------------------------------------------------
  566. class TCustomCommandList
  567. {
  568. public:
  569. __fastcall TCustomCommandList();
  570. __fastcall ~TCustomCommandList();
  571. void __fastcall Load(THierarchicalStorage * Storage);
  572. void __fastcall Save(THierarchicalStorage * Storage);
  573. void __fastcall Reset();
  574. void __fastcall Modify();
  575. void __fastcall Clear();
  576. void __fastcall Add(const UnicodeString Name, const UnicodeString Command, int Params);
  577. void __fastcall Add(TCustomCommandType * Command);
  578. void __fastcall Insert(int Index, TCustomCommandType * Command);
  579. void __fastcall Change(int Index, TCustomCommandType * Command);
  580. void __fastcall Move(int CurIndex, int NewIndex);
  581. void __fastcall Delete(int Index);
  582. const TCustomCommandType * Find(const UnicodeString Name) const;
  583. const TCustomCommandType * Find(TShortCut ShortCut) const;
  584. bool __fastcall Equals(const TCustomCommandList * Other) const;
  585. void __fastcall Assign(const TCustomCommandList * Other);
  586. void __fastcall ShortCuts(TShortCuts & ShortCuts) const;
  587. __property bool Modified = { read = FModified };
  588. __property int Count = { read = GetCount };
  589. __property const TCustomCommandType * Commands[int Index] = { read = GetConstCommand };
  590. private:
  591. bool FModified;
  592. TList * FCommands;
  593. int __fastcall GetCount() const;
  594. const TCustomCommandType * __fastcall GetConstCommand(int Index) const;
  595. TCustomCommandType * __fastcall GetCommand(int Index);
  596. };
  597. //---------------------------------------------------------------------------
  598. #define WinConfiguration (dynamic_cast<TWinConfiguration *>(Configuration))
  599. //---------------------------------------------------------------------------
  600. #endif