WinConfiguration.h 30 KB

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