Properties.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //----------------------------------------------------------------------------
  2. #ifndef PropertiesH
  3. #define PropertiesH
  4. //----------------------------------------------------------------------------
  5. #include <vcl\System.hpp>
  6. #include <vcl\Windows.hpp>
  7. #include <vcl\SysUtils.hpp>
  8. #include <vcl\Classes.hpp>
  9. #include <vcl\Graphics.hpp>
  10. #include <vcl\StdCtrls.hpp>
  11. #include <vcl\Forms.hpp>
  12. #include <vcl\Controls.hpp>
  13. #include <vcl\Buttons.hpp>
  14. #include <vcl\ExtCtrls.hpp>
  15. #include <ComCtrls.hpp>
  16. #include <PathLabel.hpp>
  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. private:
  72. int FAllowedChanges;
  73. TStrings * FFileList;
  74. TRemoteProperties FOrigProperties;
  75. bool FGroupsSet;
  76. bool FUsersSet;
  77. TImageList * FShellImageList;
  78. bool FAllowCalculateStats;
  79. bool FStatsNotCalculated;
  80. TCalculateSizeEvent FOnCalculateSize;
  81. TCalculateChecksumEvent FOnCalculateChecksum;
  82. bool FChecksumLoaded;
  83. bool FMultipleChecksum;
  84. void __fastcall SetDirectory(const AnsiString value);
  85. AnsiString __fastcall GetDirectory();
  86. TRemoteProperties __fastcall GetFileProperties();
  87. TStrings * __fastcall GetGroupList();
  88. TStrings * __fastcall GetUserList();
  89. bool __fastcall GetMultiple();
  90. void __fastcall SetAllowedChanges(int value);
  91. void __fastcall SetFileList(TStrings * value);
  92. void __fastcall SetFileProperties(TRemoteProperties value);
  93. void __fastcall SetGroupList(TStrings * value);
  94. void __fastcall SetUserList(TStrings * value);
  95. void __fastcall CalculateChecksum();
  96. void __fastcall NeedChecksum();
  97. bool __fastcall ChecksumSupported();
  98. void __fastcall ResetChecksum();
  99. void __fastcall CalculatedChecksum(
  100. const AnsiString & FileName, const AnsiString & Alg, const AnsiString & Hash);
  101. protected:
  102. void __fastcall LoadInfo();
  103. void __fastcall UpdateControls();
  104. void __fastcall LoadStats(__int64 FilesSize, const TCalculateSizeStats & Stats);
  105. __property bool Multiple = { read = GetMultiple };
  106. public:
  107. virtual __fastcall ~TPropertiesDialog();
  108. bool __fastcall Execute();
  109. virtual __fastcall TPropertiesDialog(TComponent * AOwner,
  110. TCalculateSizeEvent OnCalculateSize,
  111. TCalculateChecksumEvent OnCalculateChecksum);
  112. __property int AllowedChanges = { read = FAllowedChanges, write = SetAllowedChanges };
  113. __property AnsiString Directory = { read = GetDirectory, write = SetDirectory };
  114. __property TStrings * FileList = { read = FFileList, write = SetFileList };
  115. __property TRemoteProperties FileProperties = { read = GetFileProperties, write = SetFileProperties };
  116. __property TStrings * GroupList = { read = GetGroupList, write = SetGroupList };
  117. __property TStrings * UserList = { read = GetUserList, write = SetUserList };
  118. };
  119. //----------------------------------------------------------------------------
  120. #endif