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.

61 lines
1.9 KiB

  1. #ifndef __HISTORY_H
  2. #define __HISTORY_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: history.h
  5. Description: To prevent the watchdog from excessive repeate notifications,
  6. the system administrator can set a minimum period for notification
  7. silence. This class (CHistory) manages the reading of this setting
  8. along with remembering the last time an action occured. A client
  9. of the object is able to ask it if a given action should be performed
  10. on the basis of past actions.
  11. CHistory
  12. Revision History:
  13. Date Description Programmer
  14. -------- --------------------------------------------------- ----------
  15. 07/01/97 Initial creation. BrianAu
  16. */
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef __DSKQUOTA_REG_PARAMS_H
  19. # include "regparam.h"
  20. #endif
  21. class CPolicy;
  22. class CHistory
  23. {
  24. public:
  25. CHistory(CPolicy& policy);
  26. ~CHistory(VOID) { };
  27. BOOL ShouldPopupDialog(VOID);
  28. BOOL ShouldSendEmail(VOID);
  29. BOOL ShouldDoAnyNotifications(VOID);
  30. VOID RecordDialogPoppedUp(VOID);
  31. VOID RecordEmailSent(VOID);
  32. private:
  33. RegParamTable m_RegParams;
  34. CPolicy& m_policy; // To get min email/popup periods.
  35. static VOID GetSysTime(LPFILETIME pftOut);
  36. static INT CalcDiffMinutes(const FILETIME& ftA, const FILETIME& ftB);
  37. //
  38. // Registry parameter value names.
  39. //
  40. static const TCHAR SZ_REG_LAST_NOTIFY_EMAIL_TIME[];
  41. static const TCHAR SZ_REG_LAST_NOTIFY_POPUP_TIME[];
  42. //
  43. // Prevent copy.
  44. //
  45. CHistory(const CHistory& rhs);
  46. CHistory& operator = (const CHistory& rhs);
  47. };
  48. #endif //__HISTORY_H