Properties.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. TBevel *Bevel1;
  31. TLabel *FileLabel;
  32. TLabel *Label1;
  33. TPathLabel *LocationLabel;
  34. TLabel *Label2;
  35. TLabel *SizeLabel;
  36. TLabel *LinksToLabelLabel;
  37. TPathLabel *LinksToLabel;
  38. TBevel *Bevel2;
  39. TLabel *Label3;
  40. TBevel *Bevel3;
  41. TLabel *Label4;
  42. TComboBox *GroupComboBox;
  43. TLabel *Label5;
  44. TComboBox *OwnerComboBox;
  45. TImage *FileIconImage;
  46. TBevel *RecursiveBevel;
  47. TCheckBox *RecursiveCheck;
  48. TButton *CalculateSizeButton;
  49. TRightsExtFrame *RightsFrame;
  50. TButton *HelpButton;
  51. TTabSheet *ChecksumSheet;
  52. TListView *ChecksumView;
  53. TLabel *Label6;
  54. TComboBox *ChecksumAlgEdit;
  55. TButton *ChecksumButton;
  56. TGroupBox *ChecksumGroup;
  57. TEdit *ChecksumEdit;
  58. TPopupMenu *ListViewMenu;
  59. TMenuItem *Copy;
  60. void __fastcall ControlChange(TObject *Sender);
  61. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  62. void __fastcall CalculateSizeButtonClick(TObject *Sender);
  63. void __fastcall HelpButtonClick(TObject *Sender);
  64. void __fastcall ChecksumButtonClick(TObject *Sender);
  65. void __fastcall PageControlChange(TObject *Sender);
  66. void __fastcall ChecksumAlgEditChange(TObject *Sender);
  67. void __fastcall CopyClick(TObject *Sender);
  68. void __fastcall ChecksumViewContextPopup(TObject *Sender,
  69. TPoint &MousePos, bool &Handled);
  70. void __fastcall GroupComboBoxExit(TObject *Sender);
  71. void __fastcall OwnerComboBoxExit(TObject *Sender);
  72. void __fastcall FormShow(TObject *Sender);
  73. private:
  74. int FAllowedChanges;
  75. bool FUserGroupByID;
  76. TStrings * FFileList;
  77. const TRemoteTokenList * FGroupList;
  78. const TRemoteTokenList * FUserList;
  79. TStrings * FChecksumAlgs;
  80. TRemoteProperties FOrigProperties;
  81. bool FMultiple;
  82. bool FAllowCalculateStats;
  83. bool FStatsNotCalculated;
  84. TCalculateSizeEvent FOnCalculateSize;
  85. TCalculateChecksumEvent FOnCalculateChecksum;
  86. bool FChecksumLoaded;
  87. UnicodeString FAlgUsed;
  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. TModalResult __fastcall DefaultResult();
  98. void __fastcall CMDpiChanged(TMessage & Message);
  99. protected:
  100. void __fastcall LoadInfo();
  101. void __fastcall LoadRemoteTokens(TComboBox * ComboBox, const TRemoteTokenList * List);
  102. UnicodeString __fastcall LoadRemoteToken(const TRemoteToken & Token);
  103. void __fastcall LoadRemoteToken(TComboBox * ComboBox, bool Valid, const TRemoteToken & Token);
  104. TRemoteToken __fastcall StoreRemoteToken(const TRemoteToken & Orig,
  105. UnicodeString Text, int Message, const TRemoteTokenList * List);
  106. void __fastcall StoreRemoteToken(TComboBox * ComboBox,
  107. int ChangeFlag, TValidProperty PropertyFlag, const TRemoteToken & Orig,
  108. TRemoteToken & Token, int Message, const TRemoteTokenList * List,
  109. TRemoteProperties & Properties);
  110. void __fastcall StoreRemoteToken(unsigned int ID, const UnicodeString & Text,
  111. const TRemoteTokenList * List, TRemoteToken & Result);
  112. void __fastcall ResolveRemoteToken(
  113. const TRemoteToken & Orig, int Message, TComboBox * ComboBox,
  114. const TRemoteTokenList * List);
  115. void __fastcall UpdateControls();
  116. void __fastcall LoadStats(__int64 FilesSize, const TCalculateSizeStats & Stats);
  117. virtual void __fastcall Dispatch(void * Message);
  118. void __fastcall UpdateFileImage();
  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