history.h
Upload User: caisha3
Upload Date: 2013-09-21
Package Size: 208739k
Code Size: 2k
Category:

Windows Develop

Development Platform:

Visual C++

  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.         
  12.             CHistory
  13.     Revision History:
  14.     Date        Description                                          Programmer
  15.     --------    ---------------------------------------------------  ----------
  16.     07/01/97    Initial creation.                                    BrianAu
  17. */
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef __DSKQUOTA_REG_PARAMS_H
  20. #   include "regparam.h"
  21. #endif
  22. class CPolicy;
  23. class CHistory
  24. {
  25.     public:
  26.         CHistory(CPolicy& policy);
  27.         ~CHistory(VOID) { };
  28.         BOOL ShouldPopupDialog(VOID);
  29.         BOOL ShouldSendEmail(VOID);
  30.         BOOL ShouldDoAnyNotifications(VOID);
  31.         VOID RecordDialogPoppedUp(VOID);
  32.         VOID RecordEmailSent(VOID);
  33.     private:
  34.         RegParamTable m_RegParams;
  35.         CPolicy&      m_policy;    // To get min email/popup periods.
  36.         static VOID GetSysTime(LPFILETIME pftOut);
  37.         static INT CalcDiffMinutes(const FILETIME& ftA, const FILETIME& ftB);
  38.         //
  39.         // Registry parameter value names.
  40.         //
  41.         static const TCHAR SZ_REG_LAST_NOTIFY_EMAIL_TIME[];
  42.         static const TCHAR SZ_REG_LAST_NOTIFY_POPUP_TIME[];
  43.         //
  44.         // Prevent copy.
  45.         //
  46.         CHistory(const CHistory& rhs);
  47.         CHistory& operator = (const CHistory& rhs);
  48. };
  49. #endif //__HISTORY_H