CustomWinConfiguration.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //---------------------------------------------------------------------------
  2. #ifndef CustomWinConfigurationH
  3. #define CustomWinConfigurationH
  4. //---------------------------------------------------------------------------
  5. #include "GUIConfiguration.h"
  6. #define WM_WINSCP_USER (WM_USER + 0x2000)
  7. #define WM_LOCALE_CHANGE (WM_WINSCP_USER + 1)
  8. // WM_USER_STOP = WM_WINSCP_USER + 2 (in forms/Synchronize.cpp)
  9. // WM_INTERUPT_IDLE = WM_WINSCP_USER + 3 (in windows/ConsoleRunner.cpp)
  10. // WM_COMPONENT_HIDE = WM_WINSCP_USER + 4 (forms/CustomScpExplorer.cpp)
  11. // WM_TRAY_ICON = WM_WINSCP_USER + 5 (forms/CustomScpExplorer.cpp)
  12. // WM_LOG_UPDATE = WM_WINSCP_USER + 6 (components/LogMemo.cpp)
  13. //---------------------------------------------------------------------------
  14. #define C(Property) (Property != rhc.Property) ||
  15. struct TSynchronizeChecklistConfiguration
  16. {
  17. AnsiString WindowParams;
  18. AnsiString ListParams;
  19. bool __fastcall operator !=(TSynchronizeChecklistConfiguration & rhc)
  20. { return C(WindowParams) C(ListParams) 0; };
  21. };
  22. //---------------------------------------------------------------------------
  23. struct TConsoleWinConfiguration
  24. {
  25. AnsiString WindowSize;
  26. bool __fastcall operator !=(TConsoleWinConfiguration & rhc)
  27. { return C(WindowSize) 0; };
  28. };
  29. //---------------------------------------------------------------------------
  30. class TCustomWinConfiguration : public TGUIConfiguration
  31. {
  32. static const int MaxHistoryCount = 50;
  33. private:
  34. TLogView FLogView;
  35. TInterface FInterface;
  36. bool FShowAdvancedLoginOptions;
  37. TStringList * FHistory;
  38. TStrings * FEmptyHistory;
  39. TSynchronizeChecklistConfiguration FSynchronizeChecklist;
  40. TConsoleWinConfiguration FConsoleWin;
  41. void __fastcall SetInterface(TInterface value);
  42. void __fastcall SetLogView(TLogView value);
  43. void __fastcall SetShowAdvancedLoginOptions(bool value);
  44. void __fastcall SetHistory(const AnsiString Index, TStrings * value);
  45. TStrings * __fastcall GetHistory(const AnsiString Index);
  46. void __fastcall SetSynchronizeChecklist(TSynchronizeChecklistConfiguration value);
  47. void __fastcall SetConsoleWin(TConsoleWinConfiguration value);
  48. protected:
  49. virtual void __fastcall SaveData(THierarchicalStorage * Storage, bool All);
  50. virtual void __fastcall LoadData(THierarchicalStorage * Storage);
  51. virtual void __fastcall Saved();
  52. void __fastcall ClearHistory();
  53. public:
  54. __fastcall TCustomWinConfiguration();
  55. virtual __fastcall ~TCustomWinConfiguration();
  56. virtual void __fastcall Default();
  57. __property TLogView LogView = { read = FLogView, write = SetLogView };
  58. __property TInterface Interface = { read = FInterface, write = SetInterface };
  59. __property bool ShowAdvancedLoginOptions = { read = FShowAdvancedLoginOptions, write = SetShowAdvancedLoginOptions};
  60. __property TStrings * History[AnsiString Name] = { read = GetHistory, write = SetHistory };
  61. __property TSynchronizeChecklistConfiguration SynchronizeChecklist = { read = FSynchronizeChecklist, write = SetSynchronizeChecklist };
  62. __property TConsoleWinConfiguration ConsoleWin = { read = FConsoleWin, write = SetConsoleWin };
  63. };
  64. //---------------------------------------------------------------------------
  65. #define CustomWinConfiguration \
  66. (dynamic_cast<TCustomWinConfiguration *>(Configuration))
  67. //---------------------------------------------------------------------------
  68. #endif