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.

104 lines
2.2 KiB

  1. #ifndef _HSMPOLCY_
  2. #define _HSMPOLCY_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. hsmrule.cpp
  7. Abstract:
  8. This component represents a job's policy.
  9. Author:
  10. Chuck Bardeen [cbardeen] 29-Oct-1996
  11. Revision History:
  12. --*/
  13. #include "resource.h" // main symbols
  14. #include "wsb.h"
  15. /*++
  16. Class Name:
  17. CHsmPolicy
  18. Class Description:
  19. This component represents a job's policy.
  20. --*/
  21. class CHsmPolicy :
  22. public IHsmPolicy,
  23. public CWsbObject,
  24. public CComCoClass<CHsmPolicy,&CLSID_CHsmPolicy>
  25. {
  26. public:
  27. CHsmPolicy() {}
  28. BEGIN_COM_MAP(CHsmPolicy)
  29. COM_INTERFACE_ENTRY(IHsmPolicy)
  30. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  31. COM_INTERFACE_ENTRY(IPersistStream)
  32. COM_INTERFACE_ENTRY(IWsbCollectable)
  33. COM_INTERFACE_ENTRY(IWsbTestable)
  34. END_COM_MAP()
  35. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmPolicy)
  36. // CComObjectRoot
  37. public:
  38. STDMETHOD(FinalConstruct)(void);
  39. // IPersist
  40. public:
  41. STDMETHOD(GetClassID)(LPCLSID pClsid);
  42. // IPersistStream
  43. public:
  44. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  45. STDMETHOD(Load)(IStream* pStream);
  46. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  47. // IWsbCollectable
  48. public:
  49. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  50. // IWsbTestable
  51. STDMETHOD(Test)(USHORT *passed, USHORT* failed);
  52. // IHsmPolicy
  53. public:
  54. STDMETHOD(CompareToIdentifier)(GUID id, SHORT* pResult);
  55. STDMETHOD(CompareToIPolicy)(IHsmPolicy* pPolicy, SHORT* pResult);
  56. STDMETHOD(EnumRules)(IWsbEnum** ppEnum);
  57. STDMETHOD(GetAction)(IHsmAction** ppAction);
  58. STDMETHOD(GetIdentifier)(GUID* pId);
  59. STDMETHOD(GetName)(OLECHAR** pName, ULONG bufferSize);
  60. STDMETHOD(GetScale)(USHORT* pScale);
  61. STDMETHOD(Rules)(IWsbCollection** ppWsbCollection);
  62. STDMETHOD(SetAction)(IHsmAction* pAction);
  63. STDMETHOD(SetName)(OLECHAR* name);
  64. STDMETHOD(SetScale)(USHORT scale);
  65. STDMETHOD(SetUsesDefaultRules)(BOOL usesDefaults);
  66. STDMETHOD(UsesDefaultRules)(void);
  67. protected:
  68. GUID m_id;
  69. CWsbStringPtr m_name;
  70. USHORT m_scale;
  71. BOOL m_usesDefaultRules;
  72. CComPtr<IHsmAction> m_pAction;
  73. CComPtr<IWsbCollection> m_pRules;
  74. };
  75. #endif // _HSMPOLCY_