Properties.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //----------------------------------------------------------------------------
  2. #ifndef PropertiesH
  3. #define PropertiesH
  4. //----------------------------------------------------------------------------
  5. #include "PathLabel.hpp"
  6. #include "Rights.h"
  7. #include <System.Classes.hpp>
  8. #include <Vcl.ComCtrls.hpp>
  9. #include <Vcl.Controls.hpp>
  10. #include <Vcl.ExtCtrls.hpp>
  11. #include <Vcl.Forms.hpp>
  12. #include <Vcl.Graphics.hpp>
  13. #include <Vcl.Menus.hpp>
  14. #include <Vcl.StdCtrls.hpp>
  15. #include <Menus.hpp>
  16. //----------------------------------------------------------------------------
  17. #include <GUITools.h>
  18. //----------------------------------------------------------------------------
  19. struct TCalculateSizeStats;
  20. //----------------------------------------------------------------------------
  21. class TPropertiesDialog : public TForm
  22. {
  23. __published:
  24. TButton *OkButton;
  25. TButton *CancelButton;
  26. TPageControl *PageControl;
  27. TTabSheet *CommonSheet;
  28. TBevel *Bevel1;
  29. TLabel *FileLabel;
  30. TLabel *Label1;
  31. TPathLabel *LocationLabel;
  32. TLabel *Label2;
  33. TLabel *SizeLabel;
  34. TLabel *LinksToLabelLabel;
  35. TPathLabel *LinksToLabel;
  36. TBevel *Bevel2;
  37. TLabel *Label3;
  38. TBevel *Bevel3;
  39. TLabel *Label4;
  40. TComboBox *GroupComboBox;
  41. TLabel *Label5;
  42. TComboBox *OwnerComboBox;
  43. TImage *FileIconImage;
  44. TBevel *RecursiveBevel;
  45. TCheckBox *RecursiveCheck;
  46. TButton *CalculateSizeButton;
  47. TRightsFrame *RightsFrame;
  48. TButton *HelpButton;
  49. TTabSheet *ChecksumSheet;
  50. TListView *ChecksumView;
  51. TLabel *Label6;
  52. TComboBox *ChecksumAlgEdit;
  53. TButton *ChecksumButton;
  54. TGroupBox *ChecksumGroup;
  55. TEdit *ChecksumEdit;
  56. TPopupMenu *ListViewMenu;
  57. TMenuItem *Copy;
  58. TLabel *ChecksumUnknownLabel;
  59. void __fastcall ControlChange(TObject *Sender);
  60. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  61. void __fastcall CalculateSizeButtonClick(TObject *Sender);
  62. void __fastcall HelpButtonClick(TObject *Sender);
  63. void __fastcall ChecksumButtonClick(TObject *Sender);
  64. void __fastcall PageControlChange(TObject *Sender);
  65. void __fastcall ChecksumAlgEditChange(TObject *Sender);
  66. void __fastcall CopyClick(TObject *Sender);
  67. void __fastcall ChecksumViewContextPopup(TObject *Sender,
  68. TPoint &MousePos, bool &Handled);
  69. void __fastcall GroupComboBoxExit(TObject *Sender);
  70. void __fastcall OwnerComboBoxExit(TObject *Sender);
  71. void __fastcall FormShow(TObject *Sender);
  72. private:
  73. int FAllowedChanges;
  74. bool FUserGroupByID;
  75. TStrings * FFileList;
  76. const TRemoteTokenList * FGroupList;
  77. const TRemoteTokenList * FUserList;
  78. TStrings * FChecksumAlgs;
  79. TRemoteProperties FOrigProperties;
  80. bool FMultiple;
  81. bool FAllowCalculateStats;
  82. bool FStatsNotCalculated;
  83. TCalculateSizeEvent FOnCalculateSize;
  84. TCalculateChecksumEvent FOnCalculateChecksum;
  85. bool FChecksumLoaded;
  86. UnicodeString FAlgUsed;
  87. bool FMultipleChecksum;
  88. void __fastcall CalculateChecksum();
  89. void __fastcall NeedChecksum();
  90. bool __fastcall ChecksumSupported();
  91. void __fastcall ResetChecksum();
  92. void __fastcall CalculatedChecksum(
  93. const UnicodeString & FileName, const UnicodeString & Alg, const UnicodeString & Hash);
  94. void __fastcall SetFileProperties(const TRemoteProperties & value);
  95. TRemoteProperties __fastcall GetFileProperties();
  96. TModalResult __fastcall DefaultResult();
  97. void __fastcall CMDpiChanged(TMessage & Message);
  98. protected:
  99. void __fastcall LoadInfo();
  100. void __fastcall LoadRemoteTokens(TComboBox * ComboBox, const TRemoteTokenList * List);
  101. UnicodeString __fastcall LoadRemoteToken(const TRemoteToken & Token);
  102. void __fastcall LoadRemoteToken(TComboBox * ComboBox, bool Valid, const TRemoteToken & Token);
  103. TRemoteToken __fastcall StoreRemoteToken(const TRemoteToken & Orig,
  104. UnicodeString Text, int Message, const TRemoteTokenList * List);
  105. void __fastcall StoreRemoteToken(TComboBox * ComboBox,
  106. int ChangeFlag, TValidProperty PropertyFlag, const TRemoteToken & Orig,
  107. TRemoteToken & Token, int Message, const TRemoteTokenList * List,
  108. TRemoteProperties & Properties);
  109. void __fastcall StoreRemoteToken(unsigned int ID, const UnicodeString & Text,
  110. const TRemoteTokenList * List, TRemoteToken & Result);
  111. void __fastcall ValidateRemoteToken(
  112. const TRemoteToken & Orig, int Message, TComboBox * ComboBox,
  113. const TRemoteTokenList * List);
  114. void __fastcall UpdateControls();
  115. void __fastcall LoadStats(__int64 FilesSize, const TCalculateSizeStats & Stats);
  116. virtual void __fastcall Dispatch(void * Message);
  117. void __fastcall UpdateFileImage();
  118. INTERFACE_HOOK;
  119. public:
  120. virtual __fastcall TPropertiesDialog(TComponent * AOwner,
  121. TStrings * FileList, const UnicodeString Directory,
  122. const TRemoteTokenList * GroupList, const TRemoteTokenList * UserList,
  123. TStrings * ChecksumAlgs,
  124. int AllowedChanges, bool UserGroupByID, TCalculateSizeEvent OnCalculateSize,
  125. TCalculateChecksumEvent OnCalculateChecksum);
  126. virtual __fastcall ~TPropertiesDialog();
  127. bool __fastcall Execute(TRemoteProperties & Properties);
  128. };
  129. //----------------------------------------------------------------------------
  130. #endif