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.

140 lines
3.8 KiB

  1. #ifndef _HSMJOBWI_
  2. #define _HSMJOBWI_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. hsmjobwi.h
  7. Abstract:
  8. This component represents a resource that will is/was operated on by a job.
  9. Author:
  10. Chuck Bardeen [cbardeen] 09-Feb-1996
  11. Revision History:
  12. --*/
  13. #include "resource.h" // main symbols
  14. #include "wsb.h"
  15. /*++
  16. Class Name:
  17. CHsmJobWorkItem
  18. Class Description:
  19. This component represents a resource that will is/was operated on by a job.
  20. --*/
  21. class CHsmJobWorkItem :
  22. public IHsmJobWorkItem,
  23. public IHsmJobWorkItemPriv,
  24. public IHsmSessionSinkEveryState,
  25. public CWsbObject,
  26. public CComCoClass<CHsmJobWorkItem,&CLSID_CHsmJobWorkItem>
  27. {
  28. public:
  29. CHsmJobWorkItem() {}
  30. BEGIN_COM_MAP(CHsmJobWorkItem)
  31. COM_INTERFACE_ENTRY(IHsmJobWorkItem)
  32. COM_INTERFACE_ENTRY(IHsmJobWorkItemPriv)
  33. COM_INTERFACE_ENTRY(IHsmSessionSinkEveryState)
  34. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  35. COM_INTERFACE_ENTRY(IPersistStream)
  36. COM_INTERFACE_ENTRY(IWsbCollectable)
  37. COM_INTERFACE_ENTRY(IWsbTestable)
  38. END_COM_MAP()
  39. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmJobWorkItem)
  40. // CComObjectRoot
  41. public:
  42. STDMETHOD(FinalConstruct)(void);
  43. void FinalRelease(void);
  44. // IPersist
  45. public:
  46. STDMETHOD(GetClassID)(LPCLSID pClsid);
  47. // IPersistStream
  48. public:
  49. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  50. STDMETHOD(Load)(IStream* pStream);
  51. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  52. // IWsbCollectable
  53. public:
  54. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  55. // IWsbTestable
  56. STDMETHOD(Test)(USHORT *passed, USHORT* failed);
  57. // IHsmSessionSinkEveryState
  58. public:
  59. STDMETHOD(ProcessSessionState)(IHsmSession* pSession, IHsmPhase* pPhase, OLECHAR* currentPath);
  60. // IHsmJobWorkItem
  61. public:
  62. STDMETHOD(CompareToResourceId)(GUID id, SHORT* pResult);
  63. STDMETHOD(CompareToIWorkItem)(IHsmJobWorkItem* pWorkItem, SHORT* pResult);
  64. STDMETHOD(DoPostScan)(void);
  65. STDMETHOD(DoPreScan)(void);
  66. STDMETHOD(EnumPhases)(IWsbEnum** ppEnum);
  67. STDMETHOD(EnumTotals)(IWsbEnum** ppEnum);
  68. STDMETHOD(GetCurrentPath)(OLECHAR** pString, ULONG bufferSize);
  69. STDMETHOD(GetFinishTime)(FILETIME* pTime);
  70. STDMETHOD(GetResourceId)(GUID* pId);
  71. STDMETHOD(GetSession)(IHsmSession** ppSession);
  72. STDMETHOD(GetStartingPath)(OLECHAR** pString, ULONG bufferSize);
  73. STDMETHOD(GetStartTime)(FILETIME* pTime);
  74. STDMETHOD(GetState)(HSM_JOB_STATE* pState);
  75. STDMETHOD(GetStateAsString)(OLECHAR** pName, ULONG bufferSize);
  76. STDMETHOD(GetSubRunId)(ULONG* pId);
  77. // IHsmJobWorkItemPriv
  78. public:
  79. STDMETHOD(GetCookie)(DWORD* pCookie);
  80. STDMETHOD(GetPhases)(IWsbCollection** pPhases);
  81. STDMETHOD(GetTotals)(IWsbCollection** pTotals);
  82. STDMETHOD(Init)(IHsmJob* pJob);
  83. STDMETHOD(SetCookie)(DWORD cookie);
  84. STDMETHOD(SetCurrentPath)(OLECHAR* string);
  85. STDMETHOD(SetFinishTime)(FILETIME time);
  86. STDMETHOD(SetResourceId)(GUID id);
  87. STDMETHOD(SetSession)(IHsmSession* pSession);
  88. STDMETHOD(SetStartingPath)(OLECHAR* string);
  89. STDMETHOD(SetStartTime)(FILETIME time);
  90. STDMETHOD(SetState)(HSM_JOB_STATE state);
  91. STDMETHOD(SetSubRunId)(ULONG id);
  92. STDMETHOD(IsActiveItem)(void);
  93. STDMETHOD(SetActiveItem)(BOOL bActive);
  94. protected:
  95. DWORD m_cookie;
  96. CWsbStringPtr m_currentPath;
  97. FILETIME m_finishTime;
  98. GUID m_resourceId;
  99. CWsbStringPtr m_startingPath;
  100. FILETIME m_startTime;
  101. HSM_JOB_STATE m_state;
  102. ULONG m_subRunId;
  103. CComPtr<IHsmSession> m_pSession;
  104. IHsmJob* m_pJob; // Parent Pointer, Weak Reference
  105. CComPtr<IWsbCollection> m_pPhases;
  106. CComPtr<IWsbCollection> m_pTotals;
  107. BOOL m_bActive; // specifies whether this item is active (started)
  108. };
  109. #endif // _HSMJOBWI_