Configuration.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. //---------------------------------------------------------------------------
  2. #ifndef ConfigurationH
  3. #define ConfigurationH
  4. #include <set>
  5. #include <list>
  6. #include "RemoteFiles.h"
  7. #include "FileBuffer.h"
  8. #include "HierarchicalStorage.h"
  9. #include "Usage.h"
  10. //---------------------------------------------------------------------------
  11. #define SET_CONFIG_PROPERTY_EX(PROPERTY, APPLY) \
  12. if (PROPERTY != value) { F ## PROPERTY = value; Changed(); APPLY; }
  13. #define SET_CONFIG_PROPERTY(PROPERTY) \
  14. SET_CONFIG_PROPERTY_EX(PROPERTY, )
  15. //---------------------------------------------------------------------------
  16. extern const wchar_t * AutoSwitchNames;
  17. extern const wchar_t * NotAutoSwitchNames;
  18. enum TAutoSwitch { asOn, asOff, asAuto }; // Has to match PuTTY FORCE_ON, FORCE_OFF, AUTO
  19. //---------------------------------------------------------------------------
  20. class TStoredSessionList;
  21. class TCopyParamType;
  22. //---------------------------------------------------------------------------
  23. class TSshHostCA
  24. {
  25. public:
  26. TSshHostCA();
  27. void Save(THierarchicalStorage * Storage) const;
  28. void Load(THierarchicalStorage * Storage);
  29. UnicodeString Name;
  30. RawByteString PublicKey;
  31. UnicodeString ValidityExpression;
  32. bool PermitRsaSha1;
  33. bool PermitRsaSha256;
  34. bool PermitRsaSha512;
  35. typedef std::vector<TSshHostCA> TList;
  36. };
  37. //---------------------------------------------------------------------------
  38. class TSshHostCAList
  39. {
  40. public:
  41. TSshHostCAList();
  42. TSshHostCAList(const TSshHostCA::TList & List);
  43. TSshHostCAList & operator =(const TSshHostCAList & other);
  44. void Default();
  45. TSshHostCA::TList GetList() const;
  46. int GetCount() const;
  47. const TSshHostCA * Get(int Index) const;
  48. const TSshHostCA * Find(const UnicodeString & Name) const;
  49. void Save(THierarchicalStorage * Storage);
  50. void Load(THierarchicalStorage * Storage);
  51. private:
  52. TSshHostCA::TList FList;
  53. };
  54. //---------------------------------------------------------------------------
  55. class TConfiguration : public TObject
  56. {
  57. private:
  58. bool FDontSave;
  59. bool FForceSave;
  60. bool FChanged;
  61. int FUpdating;
  62. TNotifyEvent FOnChange;
  63. void * FApplicationInfo;
  64. TUsage * FUsage;
  65. bool FLogging;
  66. bool FPermanentLogging;
  67. UnicodeString FLogFileName;
  68. UnicodeString FPermanentLogFileName;
  69. int FLogWindowLines;
  70. bool FLogFileAppend;
  71. bool FLogSensitive;
  72. bool FPermanentLogSensitive;
  73. __int64 FLogMaxSize;
  74. __int64 FPermanentLogMaxSize;
  75. int FLogMaxCount;
  76. int FPermanentLogMaxCount;
  77. int FLogProtocol;
  78. int FPermanentLogProtocol;
  79. int FActualLogProtocol;
  80. bool FLogActions;
  81. bool FPermanentLogActions;
  82. bool FLogActionsRequired;
  83. UnicodeString FActionsLogFileName;
  84. UnicodeString FPermanentActionsLogFileName;
  85. bool FConfirmOverwriting;
  86. bool FConfirmResume;
  87. bool FAutoReadDirectoryAfterOp;
  88. int FSessionReopenAuto;
  89. int FSessionReopenBackground;
  90. int FSessionReopenTimeout;
  91. int FSessionReopenAutoStall;
  92. UnicodeString FCustomIniFileStorageName;
  93. UnicodeString FIniFileStorageName;
  94. UnicodeString FVirtualIniFileStorageName;
  95. std::unique_ptr<TStrings> FOptionsStorage;
  96. int FProgramIniPathWrittable;
  97. int FTunnelLocalPortNumberLow;
  98. int FTunnelLocalPortNumberHigh;
  99. int FCacheDirectoryChangesMaxSize;
  100. bool FShowFtpWelcomeMessage;
  101. UnicodeString FDefaultRandomSeedFile;
  102. UnicodeString FRandomSeedFile;
  103. UnicodeString FPuttyRegistryStorageKey;
  104. UnicodeString FExternalIpAddress;
  105. int FLocalPortNumberMin;
  106. int FLocalPortNumberMax;
  107. bool FTryFtpWhenSshFails;
  108. int FParallelDurationThreshold;
  109. bool FScripting;
  110. UnicodeString FMimeTypes;
  111. int FDontReloadMoreThanSessions;
  112. int FScriptProgressFileNameLimit;
  113. int FKeyVersion;
  114. int FQueueTransfersLimit;
  115. int FParallelTransferThreshold;
  116. UnicodeString FCertificateStorage;
  117. UnicodeString FAWSMetadataService;
  118. UnicodeString FChecksumCommands;
  119. std::unique_ptr<TSshHostCAList> FSshHostCAList;
  120. bool FDisablePasswordStoring;
  121. bool FForceBanners;
  122. bool FDisableAcceptingHostKeys;
  123. bool FDefaultCollectUsage;
  124. TVSFixedFileInfo *__fastcall GetFixedApplicationInfo();
  125. void * __fastcall GetApplicationInfo();
  126. virtual UnicodeString __fastcall GetVersionStr();
  127. virtual UnicodeString __fastcall GetVersion();
  128. UnicodeString __fastcall GetProductVersion();
  129. UnicodeString __fastcall GetProductName();
  130. UnicodeString __fastcall GetCompanyName();
  131. UnicodeString __fastcall GetFileVersion(TVSFixedFileInfo * Info);
  132. UnicodeString __fastcall GetStoredSessionsSubKey();
  133. UnicodeString __fastcall DoGetPuttySessionsKey();
  134. UnicodeString __fastcall GetPuttySessionsSubKey();
  135. void __fastcall SetRandomSeedFile(UnicodeString value);
  136. UnicodeString __fastcall GetRandomSeedFileName();
  137. void __fastcall SetPuttyRegistryStorageKey(UnicodeString value);
  138. UnicodeString __fastcall GetSshHostKeysSubKey();
  139. UnicodeString __fastcall GetRootKeyStr();
  140. UnicodeString __fastcall GetConfigurationSubKey();
  141. TEOLType __fastcall GetLocalEOLType();
  142. void __fastcall SetLogging(bool value);
  143. bool __fastcall GetLogging();
  144. void __fastcall SetLogFileName(UnicodeString value);
  145. UnicodeString __fastcall GetLogFileName();
  146. bool __fastcall GetLogToFile();
  147. void __fastcall SetLogFileAppend(bool value);
  148. void __fastcall SetLogSensitive(bool value);
  149. void __fastcall SetLogMaxSize(__int64 value);
  150. __int64 __fastcall GetLogMaxSize();
  151. void __fastcall SetLogMaxCount(int value);
  152. int __fastcall GetLogMaxCount();
  153. void __fastcall SetLogProtocol(int value);
  154. void __fastcall SetLogActions(bool value);
  155. bool __fastcall GetLogActions();
  156. void __fastcall SetActionsLogFileName(UnicodeString value);
  157. UnicodeString __fastcall GetPermanentActionsLogFileName();
  158. UnicodeString __fastcall GetActionsLogFileName();
  159. UnicodeString __fastcall GetDefaultLogFileName();
  160. UnicodeString __fastcall GetTimeFormat();
  161. UnicodeString __fastcall GetRegistryStorageKey();
  162. UnicodeString __fastcall GetIniFileStorageNameForReadingWriting();
  163. UnicodeString __fastcall GetIniFileStorageNameForReading();
  164. UnicodeString __fastcall GetIniFileStorageName(bool ReadingOnly);
  165. void __fastcall SetOptionsStorage(TStrings * value);
  166. TStrings * __fastcall GetOptionsStorage();
  167. UnicodeString __fastcall GetFileInfoString(const UnicodeString Key);
  168. void __fastcall SetSessionReopenAuto(int value);
  169. void __fastcall SetSessionReopenBackground(int value);
  170. void __fastcall SetSessionReopenTimeout(int value);
  171. void __fastcall SetSessionReopenAutoStall(int value);
  172. void __fastcall SetTunnelLocalPortNumberLow(int value);
  173. void __fastcall SetTunnelLocalPortNumberHigh(int value);
  174. void __fastcall SetCacheDirectoryChangesMaxSize(int value);
  175. void __fastcall SetShowFtpWelcomeMessage(bool value);
  176. int __fastcall GetCompoundVersion();
  177. void __fastcall UpdateActualLogProtocol();
  178. void __fastcall SetExternalIpAddress(UnicodeString value);
  179. void __fastcall SetTryFtpWhenSshFails(bool value);
  180. void __fastcall SetParallelDurationThreshold(int value);
  181. void __fastcall SetMimeTypes(UnicodeString value);
  182. void SetCertificateStorage(const UnicodeString & value);
  183. UnicodeString GetCertificateStorageExpanded();
  184. void SetAWSMetadataService(const UnicodeString & value);
  185. bool __fastcall GetCollectUsage();
  186. void __fastcall SetCollectUsage(bool value);
  187. bool __fastcall GetIsUnofficial();
  188. bool __fastcall GetPersistent();
  189. void SetLocalPortNumberMin(int value);
  190. void SetLocalPortNumberMax(int value);
  191. void SetQueueTransfersLimit(int value);
  192. const TSshHostCAList * GetSshHostCAList();
  193. void SetSshHostCAList(const TSshHostCAList * value);
  194. protected:
  195. TStorage FStorage;
  196. TCriticalSection * FCriticalSection;
  197. virtual TStorage __fastcall GetStorage();
  198. virtual void __fastcall Changed();
  199. virtual void __fastcall SaveData(THierarchicalStorage * Storage, bool All);
  200. virtual void __fastcall LoadData(THierarchicalStorage * Storage);
  201. virtual void __fastcall LoadFrom(THierarchicalStorage * Storage);
  202. virtual void __fastcall CopyData(THierarchicalStorage * Source, THierarchicalStorage * Target);
  203. virtual void __fastcall LoadAdmin(THierarchicalStorage * Storage);
  204. virtual UnicodeString __fastcall GetDefaultKeyFile();
  205. virtual void __fastcall Saved();
  206. void __fastcall CleanupRegistry(const UnicodeString & RegistryPath);
  207. void __fastcall CopyAllStringsInSubKey(
  208. THierarchicalStorage * Source, THierarchicalStorage * Target, const UnicodeString & Name);
  209. bool __fastcall CopySubKey(THierarchicalStorage * Source, THierarchicalStorage * Target, const UnicodeString & Name);
  210. UnicodeString __fastcall BannerHash(const UnicodeString & Banner);
  211. void __fastcall SetBannerData(const UnicodeString & SessionKey, const UnicodeString & BannerHash, unsigned int Params);
  212. void __fastcall GetBannerData(const UnicodeString & SessionKey, UnicodeString & BannerHash, unsigned int & Params);
  213. static UnicodeString __fastcall PropertyToKey(const UnicodeString & Property);
  214. void DoSave(THierarchicalStorage * AStorage, bool All);
  215. virtual void __fastcall DoSave(bool All, bool Explicit);
  216. UnicodeString __fastcall FormatFingerprintKey(const UnicodeString & SiteKey, const UnicodeString & FingerprintType);
  217. THierarchicalStorage * OpenDirectoryStatisticsCache(bool CanCreate);
  218. UnicodeString __fastcall GetDirectoryStatisticsCacheKey(
  219. const UnicodeString & SessionKey, const UnicodeString & Path, const TCopyParamType & CopyParam);
  220. virtual bool __fastcall GetConfirmOverwriting();
  221. virtual void __fastcall SetConfirmOverwriting(bool value);
  222. bool __fastcall GetConfirmResume();
  223. void __fastcall SetConfirmResume(bool value);
  224. bool __fastcall GetAutoReadDirectoryAfterOp();
  225. void __fastcall SetAutoReadDirectoryAfterOp(bool value);
  226. virtual bool __fastcall GetRememberPassword();
  227. UnicodeString __fastcall GetReleaseType();
  228. UnicodeString __fastcall LoadCustomIniFileStorageName();
  229. void __fastcall SaveCustomIniFileStorageName();
  230. UnicodeString __fastcall GetRegistryStorageOverrideKey();
  231. TStrings * GetCaches();
  232. UnicodeString GetFullVersion();
  233. virtual UnicodeString __fastcall ModuleFileName();
  234. UnicodeString __fastcall GetFileFileInfoString(const UnicodeString Key,
  235. const UnicodeString FileName, bool AllowEmpty = false);
  236. void * __fastcall GetFileApplicationInfo(const UnicodeString FileName);
  237. UnicodeString __fastcall GetFileProductVersion(const UnicodeString FileName);
  238. UnicodeString __fastcall GetFileProductName(const UnicodeString FileName);
  239. UnicodeString __fastcall GetFileCompanyName(const UnicodeString FileName);
  240. __property bool PermanentLogging = { read=GetLogging, write=SetLogging };
  241. __property UnicodeString PermanentLogFileName = { read=GetLogFileName, write=SetLogFileName };
  242. __property bool PermanentLogActions = { read=GetLogActions, write=SetLogActions };
  243. __property UnicodeString PermanentActionsLogFileName = { read=GetPermanentActionsLogFileName, write=SetActionsLogFileName };
  244. __property int PermanentLogProtocol = { read=FPermanentLogProtocol, write=SetLogProtocol };
  245. __property bool PermanentLogSensitive = { read=FPermanentLogSensitive, write=SetLogSensitive };
  246. __property __int64 PermanentLogMaxSize = { read=GetLogMaxSize, write=SetLogMaxSize };
  247. __property int PermanentLogMaxCount = { read=GetLogMaxCount, write=SetLogMaxCount };
  248. public:
  249. __fastcall TConfiguration();
  250. virtual __fastcall ~TConfiguration();
  251. virtual void __fastcall Default();
  252. virtual void __fastcall UpdateStaticUsage();
  253. void __fastcall Load(THierarchicalStorage * Storage);
  254. void __fastcall Save();
  255. void __fastcall SaveExplicit();
  256. void __fastcall MoveStorage(TStorage AStorage, const UnicodeString & ACustomIniFileStorageName);
  257. void __fastcall ScheduleCustomIniFileStorageUse(const UnicodeString & ACustomIniFileStorageName);
  258. void __fastcall SetExplicitIniFileStorageName(const UnicodeString & FileName);
  259. void __fastcall SetNulStorage();
  260. UnicodeString __fastcall GetAutomaticIniFileStorageName(bool ReadingOnly);
  261. UnicodeString __fastcall GetDefaultIniFileExportPath();
  262. UnicodeString __fastcall GetIniFileParamValue();
  263. void __fastcall Export(const UnicodeString & FileName);
  264. void __fastcall Import(const UnicodeString & FileName);
  265. void __fastcall CleanupConfiguration();
  266. void __fastcall CleanupIniFile();
  267. void __fastcall CleanupCaches();
  268. bool __fastcall HasAnyCache();
  269. void __fastcall CleanupRandomSeedFile();
  270. void __fastcall BeginUpdate();
  271. void __fastcall EndUpdate();
  272. void __fastcall DontSave();
  273. void __fastcall LoadDirectoryChangesCache(const UnicodeString SessionKey,
  274. TRemoteDirectoryChangesCache * DirectoryChangesCache);
  275. void __fastcall SaveDirectoryChangesCache(const UnicodeString SessionKey,
  276. TRemoteDirectoryChangesCache * DirectoryChangesCache);
  277. TStrings * __fastcall LoadDirectoryStatisticsCache(
  278. const UnicodeString & SessionKey, const UnicodeString & Path, const TCopyParamType & CopyParam);
  279. void __fastcall SaveDirectoryStatisticsCache(
  280. const UnicodeString & SessionKey, const UnicodeString & Path, const TCopyParamType & CopyParam, TStrings * DataList);
  281. bool __fastcall ShowBanner(const UnicodeString & SessionKey, const UnicodeString & Banner, unsigned int & Params);
  282. void __fastcall NeverShowBanner(const UnicodeString & SessionKey, const UnicodeString & Banner);
  283. void __fastcall SetBannerParams(const UnicodeString & SessionKey, unsigned int Params);
  284. void __fastcall RememberLastFingerprint(const UnicodeString & SiteKey, const UnicodeString & FingerprintType, const UnicodeString & Fingerprint);
  285. UnicodeString __fastcall LastFingerprint(const UnicodeString & SiteKey, const UnicodeString & FingerprintType);
  286. THierarchicalStorage * CreateConfigStorage();
  287. THierarchicalStorage * CreateConfigRegistryStorage();
  288. virtual THierarchicalStorage * CreateScpStorage(bool & SessionList);
  289. void __fastcall TemporaryLogging(const UnicodeString ALogFileName);
  290. void __fastcall TemporaryActionsLogging(const UnicodeString ALogFileName);
  291. void __fastcall TemporaryLogProtocol(int ALogProtocol);
  292. void __fastcall TemporaryLogSensitive(bool ALogSensitive);
  293. void __fastcall TemporaryLogMaxSize(__int64 ALogMaxSize);
  294. void __fastcall TemporaryLogMaxCount(int ALogMaxCount);
  295. virtual RawByteString __fastcall EncryptPassword(UnicodeString Password, UnicodeString Key);
  296. virtual UnicodeString __fastcall DecryptPassword(RawByteString Password, UnicodeString Key);
  297. virtual RawByteString __fastcall StronglyRecryptPassword(RawByteString Password, UnicodeString Key);
  298. UnicodeString __fastcall GetFileDescription(const UnicodeString & FileName);
  299. UnicodeString __fastcall GetFileVersion(const UnicodeString & FileName);
  300. UnicodeString __fastcall GetFileMimeType(const UnicodeString & FileName);
  301. bool RegistryPathExists(const UnicodeString & RegistryPath);
  302. bool HasLocalPortNumberLimits();
  303. virtual UnicodeString TemporaryDir(bool Mask = false) = 0;
  304. UnicodeString GetVersionStrHuman();
  305. TStoredSessionList * __fastcall SelectFilezillaSessionsForImport(
  306. TStoredSessionList * Sessions, UnicodeString & Error);
  307. bool __fastcall AnyFilezillaSessionForImport(TStoredSessionList * Sessions);
  308. TStoredSessionList * __fastcall SelectKnownHostsSessionsForImport(
  309. TStoredSessionList * Sessions, UnicodeString & Error);
  310. TStoredSessionList * __fastcall SelectKnownHostsSessionsForImport(
  311. TStrings * Lines, TStoredSessionList * Sessions, UnicodeString & Error);
  312. TStoredSessionList * SelectOpensshSessionsForImport(TStoredSessionList * Sessions, UnicodeString & Error);
  313. UnicodeString GetPuttySessionsKey(const UnicodeString & RootKey);
  314. __property TVSFixedFileInfo *FixedApplicationInfo = { read=GetFixedApplicationInfo };
  315. __property void * ApplicationInfo = { read=GetApplicationInfo };
  316. __property TUsage * Usage = { read = FUsage };
  317. __property bool CollectUsage = { read = GetCollectUsage, write = SetCollectUsage };
  318. __property UnicodeString StoredSessionsSubKey = {read=GetStoredSessionsSubKey};
  319. __property UnicodeString PuttyRegistryStorageKey = { read=FPuttyRegistryStorageKey, write=SetPuttyRegistryStorageKey };
  320. __property UnicodeString PuttySessionsKey = { read=DoGetPuttySessionsKey };
  321. __property UnicodeString PuttySessionsSubKey = { read=GetPuttySessionsSubKey };
  322. __property UnicodeString RandomSeedFile = { read=FRandomSeedFile, write=SetRandomSeedFile };
  323. __property UnicodeString RandomSeedFileName = { read=GetRandomSeedFileName };
  324. __property UnicodeString SshHostKeysSubKey = { read=GetSshHostKeysSubKey };
  325. __property UnicodeString RootKeyStr = { read=GetRootKeyStr };
  326. __property UnicodeString ConfigurationSubKey = { read=GetConfigurationSubKey };
  327. __property TEOLType LocalEOLType = { read = GetLocalEOLType };
  328. __property UnicodeString VersionStr = { read=GetVersionStr };
  329. __property UnicodeString Version = { read=GetVersion };
  330. __property int CompoundVersion = { read=GetCompoundVersion };
  331. __property UnicodeString ProductVersion = { read=GetProductVersion };
  332. __property UnicodeString ProductName = { read=GetProductName };
  333. __property UnicodeString CompanyName = { read=GetCompanyName };
  334. __property bool IsUnofficial = { read = GetIsUnofficial };
  335. __property bool Logging = { read=FLogging, write=SetLogging };
  336. __property UnicodeString LogFileName = { read=FLogFileName, write=SetLogFileName };
  337. __property bool LogToFile = { read=GetLogToFile };
  338. __property bool LogFileAppend = { read=FLogFileAppend, write=SetLogFileAppend };
  339. __property bool LogSensitive = { read=FLogSensitive, write=SetLogSensitive };
  340. __property __int64 LogMaxSize = { read=FLogMaxSize, write=SetLogMaxSize };
  341. __property int LogMaxCount = { read=FLogMaxCount, write=SetLogMaxCount };
  342. __property int LogProtocol = { read=FLogProtocol, write=SetLogProtocol };
  343. __property int ActualLogProtocol = { read=FActualLogProtocol };
  344. __property bool LogActions = { read=FLogActions, write=SetLogActions };
  345. __property bool LogActionsRequired = { read=FLogActionsRequired, write=FLogActionsRequired };
  346. __property UnicodeString ActionsLogFileName = { read=GetActionsLogFileName, write=SetActionsLogFileName };
  347. __property UnicodeString DefaultLogFileName = { read=GetDefaultLogFileName };
  348. __property TNotifyEvent OnChange = { read = FOnChange, write = FOnChange };
  349. __property bool ConfirmOverwriting = { read = GetConfirmOverwriting, write = SetConfirmOverwriting};
  350. __property bool ConfirmResume = { read = GetConfirmResume, write = SetConfirmResume};
  351. __property bool AutoReadDirectoryAfterOp = { read = GetAutoReadDirectoryAfterOp, write = SetAutoReadDirectoryAfterOp};
  352. __property bool RememberPassword = { read = GetRememberPassword };
  353. __property int SessionReopenAuto = { read = FSessionReopenAuto, write = SetSessionReopenAuto };
  354. __property int SessionReopenBackground = { read = FSessionReopenBackground, write = SetSessionReopenBackground };
  355. __property int SessionReopenTimeout = { read = FSessionReopenTimeout, write = SetSessionReopenTimeout };
  356. __property int SessionReopenAutoStall = { read = FSessionReopenAutoStall, write = SetSessionReopenAutoStall };
  357. __property int TunnelLocalPortNumberLow = { read = FTunnelLocalPortNumberLow, write = SetTunnelLocalPortNumberLow };
  358. __property int TunnelLocalPortNumberHigh = { read = FTunnelLocalPortNumberHigh, write = SetTunnelLocalPortNumberHigh };
  359. __property int CacheDirectoryChangesMaxSize = { read = FCacheDirectoryChangesMaxSize, write = SetCacheDirectoryChangesMaxSize };
  360. __property bool ShowFtpWelcomeMessage = { read = FShowFtpWelcomeMessage, write = SetShowFtpWelcomeMessage };
  361. __property UnicodeString ExternalIpAddress = { read = FExternalIpAddress, write = SetExternalIpAddress };
  362. __property UnicodeString CertificateStorage = { read = FCertificateStorage, write = SetCertificateStorage };
  363. __property UnicodeString CertificateStorageExpanded = { read = GetCertificateStorageExpanded };
  364. __property UnicodeString AWSMetadataService = { read = FAWSMetadataService, write = SetAWSMetadataService };
  365. __property UnicodeString ChecksumCommands = { read = FChecksumCommands };
  366. __property int LocalPortNumberMin = { read = FLocalPortNumberMin, write = SetLocalPortNumberMin };
  367. __property int LocalPortNumberMax = { read = FLocalPortNumberMax, write = SetLocalPortNumberMax };
  368. __property bool TryFtpWhenSshFails = { read = FTryFtpWhenSshFails, write = SetTryFtpWhenSshFails };
  369. __property int ParallelDurationThreshold = { read = FParallelDurationThreshold, write = SetParallelDurationThreshold };
  370. __property UnicodeString MimeTypes = { read = FMimeTypes, write = SetMimeTypes };
  371. __property int DontReloadMoreThanSessions = { read = FDontReloadMoreThanSessions, write = FDontReloadMoreThanSessions };
  372. __property int ScriptProgressFileNameLimit = { read = FScriptProgressFileNameLimit, write = FScriptProgressFileNameLimit };
  373. __property int QueueTransfersLimit = { read = FQueueTransfersLimit, write = SetQueueTransfersLimit };
  374. __property int ParallelTransferThreshold = { read = FParallelTransferThreshold, write = FParallelTransferThreshold };
  375. __property int KeyVersion = { read = FKeyVersion, write = FKeyVersion };
  376. __property TSshHostCAList * SshHostCAList = { read = GetSshHostCAList, write = SetSshHostCAList };
  377. __property UnicodeString TimeFormat = { read = GetTimeFormat };
  378. __property TStorage Storage = { read=GetStorage };
  379. __property UnicodeString RegistryStorageKey = { read=GetRegistryStorageKey };
  380. __property UnicodeString CustomIniFileStorageName = { read=FCustomIniFileStorageName };
  381. __property UnicodeString ExplicitIniFileStorageName = { read=FIniFileStorageName };
  382. __property UnicodeString IniFileStorageName = { read=GetIniFileStorageNameForReadingWriting };
  383. __property UnicodeString IniFileStorageNameForReading = { read=GetIniFileStorageNameForReading };
  384. __property TStrings * OptionsStorage = { read = GetOptionsStorage, write = SetOptionsStorage };
  385. __property bool Persistent = { read = GetPersistent };
  386. __property bool ForceSave = { read = FForceSave, write = FForceSave };
  387. __property bool Scripting = { read = FScripting, write = FScripting };
  388. __property UnicodeString DefaultKeyFile = { read = GetDefaultKeyFile };
  389. __property bool DisablePasswordStoring = { read = FDisablePasswordStoring };
  390. __property bool ForceBanners = { read = FForceBanners };
  391. __property bool DisableAcceptingHostKeys = { read = FDisableAcceptingHostKeys };
  392. };
  393. //---------------------------------------------------------------------------
  394. class TShortCuts
  395. {
  396. public:
  397. void __fastcall Add(TShortCut ShortCut);
  398. bool __fastcall Has(TShortCut ShortCut) const;
  399. private:
  400. std::set<TShortCut> FShortCuts;
  401. };
  402. //---------------------------------------------------------------------------
  403. extern const UnicodeString OriginalPuttyRegistryStorageKey;
  404. extern const UnicodeString KittyRegistryStorageKey;
  405. extern const UnicodeString OriginalPuttyExecutable;
  406. extern const UnicodeString KittyExecutable;
  407. //---------------------------------------------------------------------------
  408. extern const UnicodeString Sha1ChecksumAlg;
  409. extern const UnicodeString Sha224ChecksumAlg;
  410. extern const UnicodeString Sha256ChecksumAlg;
  411. extern const UnicodeString Sha384ChecksumAlg;
  412. extern const UnicodeString Sha512ChecksumAlg;
  413. extern const UnicodeString Md5ChecksumAlg;
  414. extern const UnicodeString Crc32ChecksumAlg;
  415. //---------------------------------------------------------------------------
  416. extern const UnicodeString SshFingerprintType;
  417. extern const UnicodeString TlsFingerprintType;
  418. //---------------------------------------------------------------------------
  419. extern const UnicodeString FtpsCertificateStorageKey;
  420. extern const UnicodeString HttpsCertificateStorageKey;
  421. //---------------------------------------------------------------------------
  422. extern const int BelowNormalLogLevels;
  423. //---------------------------------------------------------------------------
  424. extern const UnicodeString OpensshFolderName;
  425. extern const UnicodeString OpensshAuthorizedKeysFileName;
  426. //---------------------------------------------------------------------------
  427. #endif