Rights.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //---------------------------------------------------------------------------
  2. #ifndef RightsH
  3. #define RightsH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <Buttons.hpp>
  10. #include <RemoteFiles.h>
  11. #include <ActnList.hpp>
  12. #include <ImgList.hpp>
  13. #include <Menus.hpp>
  14. #include "GrayedCheckBox.hpp"
  15. #include "PngImageList.hpp"
  16. //---------------------------------------------------------------------------
  17. class TRightsFrame : public TFrame
  18. {
  19. __published:
  20. TLabel *GroupLabel;
  21. TLabel *OthersLabel;
  22. TLabel *OwnerLabel;
  23. TGrayedCheckBox *OwnerReadCheck;
  24. TGrayedCheckBox *OwnerWriteCheck;
  25. TGrayedCheckBox *OwnerExecuteCheck;
  26. TGrayedCheckBox *GroupReadCheck;
  27. TGrayedCheckBox *GroupWriteCheck;
  28. TGrayedCheckBox *GroupExecuteCheck;
  29. TGrayedCheckBox *OthersReadCheck;
  30. TGrayedCheckBox *OthersWriteCheck;
  31. TGrayedCheckBox *OthersExecuteCheck;
  32. TCheckBox *DirectoriesXCheck;
  33. TSpeedButton *OwnerButton;
  34. TSpeedButton *GroupButton;
  35. TSpeedButton *OthersButton;
  36. TPopupMenu *RightsPopup;
  37. TMenuItem *Norights1;
  38. TMenuItem *Defaultrights1;
  39. TMenuItem *Allrights1;
  40. TMenuItem *Leaveasis1;
  41. TActionList *RightsActions;
  42. TAction *NoRightsAction;
  43. TAction *DefaultRightsAction;
  44. TAction *AllRightsAction;
  45. TAction *LeaveRightsAsIsAction;
  46. TPngImageList *RightsImages;
  47. TMenuItem *N1;
  48. TAction *CopyTextAction;
  49. TAction *CopyOctalAction;
  50. TAction *PasteAction;
  51. TMenuItem *CopyAsText1;
  52. TMenuItem *CopyAsOctal1;
  53. TMenuItem *Paste1;
  54. void __fastcall ControlChange(TObject *Sender);
  55. void __fastcall RightsButtonsClick(TObject *Sender);
  56. void __fastcall RightsActionsExecute(TBasicAction *Action,
  57. bool &Handled);
  58. void __fastcall RightsActionsUpdate(TBasicAction *Action, bool &Handled);
  59. void __fastcall RightsPopupPopup(TObject *Sender);
  60. void __fastcall FrameContextPopup(TObject *Sender, TPoint &MousePos,
  61. bool &Handled);
  62. private:
  63. bool FAllowAddXToDirectories;
  64. TNotifyEvent FOnChange;
  65. bool FPopup;
  66. TWinControl * FPopupParent;
  67. TButton * FDefaultButton;
  68. TButton * FCancelButton;
  69. bool FPopingContextMenu;
  70. UnicodeString FAddXToDirectoriesSuffix;
  71. bool FInitialized;
  72. void __fastcall CycleRights(int Group);
  73. bool __fastcall GetAddXToDirectories();
  74. bool __fastcall GetAllowUndef();
  75. TCheckBox * __fastcall GetChecks(TRights::TRight Right);
  76. TRights __fastcall GetRights();
  77. TRights::TState __fastcall GetStates(TRights::TRight Right);
  78. void __fastcall SetAddXToDirectories(bool value);
  79. void __fastcall SetAllowAddXToDirectories(bool value);
  80. void __fastcall SetAllowUndef(bool value);
  81. void __fastcall SetRights(const TRights & value);
  82. void __fastcall SetStates(TRights::TRight Right, TRights::TState value);
  83. UnicodeString __fastcall GetText();
  84. void __fastcall SetText(UnicodeString value);
  85. public:
  86. virtual __fastcall ~TRightsFrame();
  87. __fastcall TRightsFrame(TComponent* Owner);
  88. void __fastcall DropDown();
  89. void __fastcall CloseUp();
  90. __property bool AddXToDirectories = { read = GetAddXToDirectories, write = SetAddXToDirectories };
  91. __property bool AllowAddXToDirectories = { read = FAllowAddXToDirectories, write = SetAllowAddXToDirectories };
  92. __property bool AllowUndef = { read = GetAllowUndef, write = SetAllowUndef };
  93. __property TCheckBox * Checks[TRights::TRight Right] = { read = GetChecks };
  94. __property TNotifyEvent OnChange = { read = FOnChange, write = FOnChange };
  95. __property TRights Rights = { read = GetRights, write = SetRights };
  96. __property UnicodeString Text = { read = GetText, write = SetText };
  97. __property bool Popup = { read = FPopup, write = SetPopup };
  98. __property TWinControl * PopupParent = { read = FPopupParent, write = FPopupParent };
  99. protected:
  100. void __fastcall DoChange();
  101. virtual void __fastcall UpdateControls();
  102. virtual void __fastcall SetEnabled(bool Value);
  103. virtual void __fastcall ForceUpdate();
  104. virtual void __fastcall CreateParams(TCreateParams & Params);
  105. virtual void __fastcall CreateWnd();
  106. virtual void __fastcall Dispatch(void * Message);
  107. void __fastcall CMCancelMode(TCMCancelMode & Message);
  108. void __fastcall CMDialogKey(TCMDialogKey & Message);
  109. void __fastcall WMContextMenu(TWMContextMenu & Message);
  110. bool __fastcall IsAncestor(TControl * Control, TControl * Ancestor);
  111. DYNAMIC void __fastcall DoExit();
  112. virtual void __fastcall SetPopup(bool value);
  113. void __fastcall DoCloseUp();
  114. bool __fastcall HasFocus();
  115. bool __fastcall DirectoriesXEffective();
  116. __property TRights::TState States[TRights::TRight Right] = { read = GetStates, write = SetStates };
  117. };
  118. //---------------------------------------------------------------------------
  119. #endif