Properties.h 4.9 KB

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