Synchronize.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //---------------------------------------------------------------------------
  2. #ifndef SynchronizeH
  3. #define SynchronizeH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <XPThemes.hpp>
  10. #include <HistoryComboBox.hpp>
  11. #include <WinInterface.h>
  12. #include "GrayedCheckBox.hpp"
  13. #include <ComCtrls.hpp>
  14. #include <ExtCtrls.hpp>
  15. //---------------------------------------------------------------------------
  16. class TSynchronizeDialog : public TForm
  17. {
  18. __published:
  19. TXPGroupBox *DirectoriesGroup;
  20. TButton *StopButton;
  21. TButton *CancelButton;
  22. TLabel *LocalDirectoryLabel;
  23. TLabel *RemoteDirectoryLabel;
  24. THistoryComboBox *RemoteDirectoryEdit;
  25. THistoryComboBox *LocalDirectoryEdit;
  26. TXPGroupBox *OptionsGroup;
  27. TCheckBox *SynchronizeDeleteCheck;
  28. TButton *LocalDirectoryBrowseButton;
  29. TCheckBox *SaveSettingsCheck;
  30. TCheckBox *SynchronizeExistingOnlyCheck;
  31. TButton *StartButton;
  32. TButton *MinimizeButton;
  33. TButton *TransferSettingsButton;
  34. TCheckBox *SynchronizeRecursiveCheck;
  35. TGrayedCheckBox *SynchronizeSynchronizeCheck;
  36. TXPGroupBox *CopyParamGroup;
  37. TLabel *CopyParamLabel;
  38. TButton *HelpButton;
  39. TCheckBox *SynchronizeSelectedOnlyCheck;
  40. TPanel *LogPanel;
  41. TListView *LogView;
  42. void __fastcall ControlChange(TObject *Sender);
  43. void __fastcall LocalDirectoryBrowseButtonClick(TObject *Sender);
  44. void __fastcall TransferSettingsButtonClick(TObject *Sender);
  45. void __fastcall StartButtonClick(TObject *Sender);
  46. void __fastcall StopButtonClick(TObject *Sender);
  47. void __fastcall MinimizeButtonClick(TObject *Sender);
  48. void __fastcall FormShow(TObject *Sender);
  49. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  50. void __fastcall CopyParamGroupContextPopup(TObject *Sender,
  51. TPoint &MousePos, bool &Handled);
  52. void __fastcall CopyParamGroupDblClick(TObject *Sender);
  53. void __fastcall HelpButtonClick(TObject *Sender);
  54. void __fastcall LogViewKeyDown(TObject *Sender, WORD &Key,
  55. TShiftState Shift);
  56. void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
  57. TShiftState Shift);
  58. private:
  59. TSynchronizeParamType FParams;
  60. TSynchronizeStartStopEvent FOnStartStop;
  61. TGetSynchronizeOptionsEvent FOnGetOptions;
  62. int FOptions;
  63. int FCopyParamAttrs;
  64. bool FSynchronizing;
  65. bool FMinimizedByMe;
  66. bool FAbort;
  67. bool FClose;
  68. TCopyParamType FCopyParams;
  69. TPopupMenu * FPresetsMenu;
  70. AnsiString FPreset;
  71. TSynchronizeOptions * FSynchronizeOptions;
  72. static const MaxLogItems;
  73. void __fastcall SetParams(const TSynchronizeParamType& value);
  74. TSynchronizeParamType __fastcall GetParams();
  75. void __fastcall SetSaveSettings(bool value);
  76. bool __fastcall GetSaveSettings();
  77. void __fastcall SetCopyParams(const TCopyParamType & value);
  78. TCopyParamType __fastcall GetCopyParams();
  79. void __fastcall SetOptions(int value);
  80. protected:
  81. void __fastcall DoStartStop(bool Start, bool Synchronize);
  82. void __fastcall DoAbort(TObject * Sender, bool Close);
  83. void __fastcall DoLog(TSynchronizeController * Controller, TSynchronizeLogEntry Entry,
  84. const AnsiString Message);
  85. void __fastcall Stop();
  86. virtual void __fastcall Dispatch(void * Message);
  87. void __fastcall CopyParamClick(TObject * Sender);
  88. void __fastcall ClearLog();
  89. void __fastcall CopyLog();
  90. int __fastcall ActualCopyParamAttrs();
  91. public:
  92. __fastcall TSynchronizeDialog(TComponent * Owner,
  93. TSynchronizeStartStopEvent OnStartStop, TGetSynchronizeOptionsEvent OnGetOptions);
  94. virtual __fastcall ~TSynchronizeDialog();
  95. bool __fastcall Execute();
  96. __property TSynchronizeParamType Params = { read = GetParams, write = SetParams };
  97. __property bool SaveSettings = { read = GetSaveSettings, write = SetSaveSettings };
  98. __property int Options = { read = FOptions, write = SetOptions };
  99. __property int CopyParamAttrs = { read = FCopyParamAttrs, write = FCopyParamAttrs };
  100. __property TCopyParamType CopyParams = { read = GetCopyParams, write = SetCopyParams };
  101. protected:
  102. void __fastcall UpdateControls();
  103. };
  104. //---------------------------------------------------------------------------
  105. #endif