Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
4.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. auditchk.hxx
  7. This file contains the definition for the audit checkboxes
  8. FILE HISTORY:
  9. Johnl 29-Aug-1991 Created
  10. */
  11. #ifndef _AUDITCHK_HXX_
  12. #define _AUDITCHK_HXX_
  13. #include "bitfield.hxx"
  14. #include "maskmap.hxx"
  15. #include "focuschk.hxx"
  16. /*************************************************************************
  17. NAME: AUDIT_CHECKBOXES
  18. SYNOPSIS: This class contains two FOCUS_CHECKBOXES and an SLT. One
  19. checkbox represents an audit successful events, the other
  20. an audit failed events. The SLT is the audit name.
  21. INTERFACE:
  22. QueryMask()
  23. Returns the BITFIELD mask this audit checkbox is assoicated
  24. with.
  25. IsSuccessChecked()
  26. Returns TRUE if the success audit checkbox is checked
  27. IsFailedChecked()
  28. Returns TRUE if the failed audit checkbox is checked
  29. Enable()
  30. Enables or disables this set of audit checkboxes
  31. PARENT: BASE
  32. USES: FOCUS_CHECKBOX, BITFIELD, SLT
  33. CAVEATS:
  34. NOTES:
  35. The checkboxes are enabled and displayed, thus allowing the user
  36. to have the checkboxes by default be disabled and hidden.
  37. HISTORY:
  38. Johnl 9-Sep-1991 Created
  39. **************************************************************************/
  40. DLL_CLASS AUDIT_CHECKBOXES : public BASE
  41. {
  42. private:
  43. SLT _sltAuditName ;
  44. BITFIELD _bitMask ;
  45. FOCUS_CHECKBOX _fcheckSuccess ;
  46. FOCUS_CHECKBOX _fcheckFailed ;
  47. public:
  48. AUDIT_CHECKBOXES( OWNER_WINDOW * powin,
  49. CID cidSLTAuditName,
  50. CID cidCheckSuccess,
  51. CID cidCheckFailed,
  52. const NLS_STR & nlsAuditName,
  53. const BITFIELD & bitMask ) ;
  54. ~AUDIT_CHECKBOXES() ;
  55. /* Set fClear to clear the checkbox when the checkbox
  56. */
  57. void Enable( BOOL fEnable, BOOL fClear = FALSE ) ;
  58. BITFIELD * QueryMask( void )
  59. { return &_bitMask ; }
  60. BOOL IsSuccessChecked( void )
  61. { return _fcheckSuccess.QueryCheck() ; }
  62. BOOL IsFailedChecked( void )
  63. { return _fcheckFailed.QueryCheck() ; }
  64. void CheckSuccess( BOOL fCheck )
  65. { _fcheckSuccess.SetCheck( fCheck ) ; }
  66. void CheckFailed( BOOL fCheck )
  67. { _fcheckFailed.SetCheck( fCheck ) ; }
  68. } ;
  69. /*************************************************************************
  70. NAME: SET_OF_AUDIT_CATEGORIES
  71. SYNOPSIS: Array of audit checkboxes
  72. INTERFACE:
  73. Enable()
  74. Enables or disables this set of audit categories
  75. PARENT: BASE
  76. USES: AUDIT_CHECKBOXES, BITFIELD
  77. CAVEATS:
  78. NOTES:
  79. HISTORY:
  80. Johnl 30-Sep-1991 Created
  81. **************************************************************************/
  82. DLL_CLASS SET_OF_AUDIT_CATEGORIES : public BASE
  83. {
  84. private:
  85. /* This is a pointer to the storage that contains the array of
  86. * checkboxes
  87. */
  88. AUDIT_CHECKBOXES * _pAuditCheckboxes ;
  89. INT _cUsedAuditCheckboxes ;
  90. OWNER_WINDOW * _pOwnerWindow ;
  91. CID _cidSLTBase ;
  92. CID _cidSuccessCheckboxBase ;
  93. CID _cidFailedCheckboxBase ;
  94. INT _nID;
  95. public:
  96. SET_OF_AUDIT_CATEGORIES( OWNER_WINDOW * powin,
  97. CID cidSLTBase,
  98. CID cidCheckSuccessBase,
  99. CID cidCheckFailedBase,
  100. MASK_MAP * pmaskmapAuditInfo,
  101. BITFIELD * pbitsSuccess,
  102. BITFIELD * pbitsFailed,
  103. INT nID = 0 ) ;
  104. ~SET_OF_AUDIT_CATEGORIES() ;
  105. APIERR SetCheckBoxNames( MASK_MAP * pAccessMaskMap ) ;
  106. APIERR QueryUserSelectedBits( BITFIELD * pbitsSuccess, BITFIELD * pbitsFailed ) ;
  107. APIERR ApplyPermissionsToCheckBoxes( BITFIELD * pbitsSuccess,
  108. BITFIELD * pbitsFailed ) ;
  109. /* Grays out SLTs and disables checkboxes, if fEnable is FALSE.
  110. */
  111. void Enable( BOOL fEnable, BOOL fClear = FALSE ) ;
  112. INT QueryCount( void )
  113. { return _cUsedAuditCheckboxes ; }
  114. AUDIT_CHECKBOXES * QueryAuditCheckBox( INT iIndex )
  115. { UIASSERT( iIndex < QueryCount() ); return &_pAuditCheckboxes[iIndex] ; }
  116. OWNER_WINDOW * QueryOwnerWindow( void )
  117. { return _pOwnerWindow ; }
  118. CID QuerySLTBaseCID( void )
  119. { return _cidSLTBase ; }
  120. CID QuerySuccessBaseCID( void )
  121. { return _cidSuccessCheckboxBase ; }
  122. CID QueryFailedBaseCID( void )
  123. { return _cidFailedCheckboxBase ; }
  124. } ;
  125. #endif // _AUDITCHK_HXX_