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.

86 lines
2.5 KiB

  1. #ifndef __POLICY_H
  2. #define __POLICY_H
  3. #ifndef _WINDOWS_
  4. # include <windows.h>
  5. #endif
  6. //
  7. // This class provides an in-memory copy of the notification policy
  8. // information contained in an INI file or the registry.
  9. //
  10. class CPolicy
  11. {
  12. public:
  13. CPolicy(VOID);
  14. ~CPolicy(VOID);
  15. HRESULT Load(LPCTSTR pszIniFile);
  16. HRESULT Load(HKEY hkeyReg);
  17. VOID GetOtherEmailTo(CString& strOut)
  18. { strOut = m_strOtherEmailTo; }
  19. LPTSTR GetOtherEmailTo(VOID)
  20. { return (LPTSTR)m_strOtherEmailTo; }
  21. VOID GetOtherEmailCc(CString& strOut)
  22. { strOut = m_strOtherEmailCc; }
  23. LPTSTR GetOtherEmailCc(VOID)
  24. { return (LPTSTR)m_strOtherEmailCc; }
  25. VOID GetOtherEmailBcc(CString& strOut)
  26. { strOut = m_strOtherEmailBcc; }
  27. LPTSTR GetOtherEmailBcc(VOID)
  28. { return (LPTSTR)m_strOtherEmailBcc; }
  29. BOOL ShouldSendUserEmail(VOID) const
  30. { return m_bSendUserEmail; }
  31. BOOL ShouldShowClientDialog(VOID) const
  32. { return m_bShowClientDialog; }
  33. BOOL ShouldSendAnyEmail(VOID) const;
  34. private:
  35. BOOL m_bSendUserEmail; // Should we send user email?
  36. BOOL m_bShowClientDialog; // Should we popup a dialog on client?
  37. CString m_strOtherEmailTo; // Comma-sep list of email names.
  38. CString m_strOtherEmailCc; // Comma-sep list of email names.
  39. CString m_strOtherEmailBcc; // Comma-sep list of email names.
  40. VOID Reset(VOID);
  41. HRESULT LoadString(
  42. LPCTSTR pszFile,
  43. LPCTSTR pszSection,
  44. LPCTSTR pszValueName,
  45. LPCTSTR pszDefaultValue,
  46. CString& strOut);
  47. //
  48. // Prevent copy.
  49. //
  50. CPolicy(const CPolicy& rhs);
  51. CPolicy& operator = (const CPolicy& rhs);
  52. //
  53. // Names of registry/INI file sections and values.
  54. //
  55. static TCHAR SZ_REGINI_WATCHDOG[];
  56. static TCHAR SZ_REGINI_SEND_USER_EMAIL[];
  57. static TCHAR SZ_REGINI_SHOW_CLIENT_DIALOG[];
  58. static TCHAR SZ_REGINI_SEND_EMAIL_TO[];
  59. static TCHAR SZ_REGINI_SEND_EMAIL_CC[];
  60. static TCHAR SZ_REGINI_SEND_EMAIL_BCC[];
  61. static INT I_REGINI_SEND_USER_EMAIL_DEFAULT;
  62. static INT I_REGINI_SHOW_CLIENT_DIALOG_DEFAULT;
  63. static TCHAR SZ_REGINI_SEND_EMAIL_TO_DEFAULT[];
  64. static TCHAR SZ_REGINI_SEND_EMAIL_CC_DEFAULT[];
  65. static TCHAR SZ_REGINI_SEND_EMAIL_BCC_DEFAULT[];
  66. };
  67. #endif //__POLICY_H