Properties.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. TEdit *FileLabel;
  30. TLabel *Label1;
  31. TEdit *LocationLabel;
  32. TLabel *Label2;
  33. TEdit *SizeLabel;
  34. TLabel *LinksToLabelLabel;
  35. TEdit *LinksToLabel;
  36. TBevel *Bevel2;
  37. TLabel *RightsLabel;
  38. TBevel *GroupOwnerRightsBevel;
  39. TLabel *GroupLabel;
  40. TComboBox *GroupComboBox;
  41. TLabel *OwnerLabel;
  42. TComboBox *OwnerComboBox;
  43. TImage *FileIconImage;
  44. TBevel *RecursiveBevel;
  45. TCheckBox *RecursiveCheck2;
  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. TEdit *OwnerView;
  60. TEdit *GroupView;
  61. TTabSheet *TagsSheet;
  62. TListView *TagsView;
  63. TButton *AddTagButton;
  64. TButton *RemoveTagButton;
  65. TButton *EditTagButton;
  66. void __fastcall ControlChange(TObject *Sender);
  67. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  68. void __fastcall CalculateSizeButtonClick(TObject *Sender);
  69. void __fastcall HelpButtonClick(TObject *Sender);
  70. void __fastcall ChecksumButtonClick(TObject *Sender);
  71. void __fastcall PageControlChange(TObject *Sender);
  72. void __fastcall ChecksumAlgEditChange(TObject *Sender);
  73. void __fastcall CopyClick(TObject *Sender);
  74. void __fastcall ListViewContextPopup(TObject *Sender,
  75. TPoint &MousePos, bool &Handled);
  76. void __fastcall GroupComboBoxExit(TObject *Sender);
  77. void __fastcall OwnerComboBoxExit(TObject *Sender);
  78. void __fastcall FormShow(TObject *Sender);
  79. void __fastcall TagsViewKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
  80. void __fastcall AddTagButtonClick(TObject *Sender);
  81. void __fastcall TagsViewSelectItem(TObject *Sender, TListItem *Item, bool Selected);
  82. void __fastcall EditTagButtonClick(TObject *Sender);
  83. void __fastcall RemoveTagButtonClick(TObject *Sender);
  84. void __fastcall TagsViewDblClick(TObject *Sender);
  85. private:
  86. int FAllowedChanges;
  87. int FOptions;
  88. TStrings * FFileList;
  89. const TRemoteTokenList * FGroupList;
  90. const TRemoteTokenList * FUserList;
  91. TStrings * FChecksumAlgs;
  92. TRemoteProperties FOrigProperties;
  93. bool FMultiple;
  94. bool FAnyDirectories;
  95. bool FAllowCalculateStats;
  96. bool FStatsNotCalculated;
  97. TCalculateSizeEvent FOnCalculateSize;
  98. TCalculateChecksumEvent FOnCalculateChecksum;
  99. bool FChecksumLoaded;
  100. UnicodeString FAlgUsed;
  101. bool FMultipleChecksum;
  102. void __fastcall CalculateChecksum();
  103. void __fastcall NeedChecksum();
  104. bool __fastcall ChecksumSupported();
  105. void __fastcall ResetChecksum();
  106. void __fastcall CalculatedChecksum(
  107. const UnicodeString & FileName, const UnicodeString & Alg, const UnicodeString & Hash);
  108. void __fastcall SetFileProperties(const TRemoteProperties & value);
  109. TRemoteProperties __fastcall GetFileProperties();
  110. TModalResult __fastcall DefaultResult();
  111. void __fastcall CMDpiChanged(TMessage & Message);
  112. protected:
  113. void __fastcall LoadInfo();
  114. void __fastcall LoadRemoteTokens(TComboBox * ComboBox, const TRemoteTokenList * List);
  115. UnicodeString __fastcall LoadRemoteToken(const TRemoteToken & Token);
  116. void __fastcall LoadRemoteToken(
  117. TComboBox * ComboBox, TEdit * View, TLabel * Label, bool Valid, const TRemoteToken & Token, int Change);
  118. TRemoteToken __fastcall StoreRemoteToken(const TRemoteToken & Orig,
  119. UnicodeString Text, int Message, const TRemoteTokenList * List);
  120. void __fastcall StoreRemoteToken(TComboBox * ComboBox,
  121. int ChangeFlag, TValidProperty PropertyFlag, const TRemoteToken & Orig,
  122. TRemoteToken & Token, int Message, const TRemoteTokenList * List,
  123. TRemoteProperties & Properties);
  124. void __fastcall StoreRemoteToken(unsigned int ID, const UnicodeString & Text,
  125. const TRemoteTokenList * List, TRemoteToken & Result);
  126. void __fastcall ValidateRemoteToken(
  127. const TRemoteToken & Orig, int Message, TComboBox * ComboBox,
  128. const TRemoteTokenList * List);
  129. void __fastcall UpdateControls();
  130. void __fastcall LoadStats(__int64 FilesSize, const TCalculateSizeStats & Stats);
  131. virtual void __fastcall Dispatch(void * Message);
  132. void __fastcall UpdateFileImage();
  133. TListItem * AddTag(const UnicodeString & Key, const UnicodeString & Value);
  134. void AutoSizeTagsView();
  135. void AddEditTag(bool Add);
  136. INTERFACE_HOOK;
  137. public:
  138. virtual __fastcall TPropertiesDialog(TComponent * AOwner,
  139. TStrings * FileList, const UnicodeString Directory,
  140. const TRemoteTokenList * GroupList, const TRemoteTokenList * UserList,
  141. TStrings * ChecksumAlgs,
  142. int AllowedChanges, int Options, TCalculateSizeEvent OnCalculateSize,
  143. TCalculateChecksumEvent OnCalculateChecksum);
  144. virtual __fastcall ~TPropertiesDialog();
  145. bool __fastcall Execute(TRemoteProperties & Properties);
  146. };
  147. //----------------------------------------------------------------------------
  148. #endif