WinConfiguration.h 25 KB

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