WinConfiguration.h 27 KB

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