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.

170 lines
6.0 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsChngr.h
  5. Abstract:
  6. Declaration of the CRmsMediumChanger class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSCHNGR_
  12. #define _RMSCHNGR_
  13. #include "resource.h" // resource symbols
  14. #include "RmsDvice.h" // CRmsDevice
  15. #include "RmsLocat.h" // CRmsLocator
  16. /*++
  17. Class Name:
  18. CRmsMediumChanger
  19. Class Description:
  20. A CRmsMediumChanger represents the robotic or human mechanism that moves media
  21. between the elements of a library. The state of in-progress move operations
  22. is maintained with this object to aid recovery.
  23. --*/
  24. class CRmsMediumChanger :
  25. public CComDualImpl<IRmsMediumChanger, &IID_IRmsMediumChanger, &LIBID_RMSLib>,
  26. public CRmsDevice, // inherits CRmsChangerElement
  27. public CWsbObject, // inherits CComObjectRoot
  28. public IRmsMoveMedia,
  29. public CComCoClass<CRmsMediumChanger,&CLSID_CRmsMediumChanger>
  30. {
  31. public:
  32. CRmsMediumChanger() {}
  33. BEGIN_COM_MAP(CRmsMediumChanger)
  34. COM_INTERFACE_ENTRY2(IDispatch, IRmsMediumChanger)
  35. COM_INTERFACE_ENTRY(IRmsMediumChanger)
  36. COM_INTERFACE_ENTRY(IRmsMoveMedia)
  37. COM_INTERFACE_ENTRY(IRmsComObject)
  38. COM_INTERFACE_ENTRY(IRmsChangerElement)
  39. COM_INTERFACE_ENTRY(IRmsDevice)
  40. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  41. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  42. COM_INTERFACE_ENTRY(IPersistStream)
  43. COM_INTERFACE_ENTRY(IWsbCollectable)
  44. COM_INTERFACE_ENTRY(IWsbPersistStream)
  45. COM_INTERFACE_ENTRY(IWsbTestable)
  46. END_COM_MAP()
  47. DECLARE_REGISTRY_RESOURCEID(IDR_RmsMediumChanger)
  48. // CComObjectRoot
  49. public:
  50. STDMETHOD(FinalConstruct)(void);
  51. STDMETHOD(FinalRelease)(void);
  52. // IPersist
  53. public:
  54. STDMETHOD(GetClassID)(CLSID *pClsid);
  55. // IPersistStream
  56. public:
  57. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  58. STDMETHOD(Load)(IStream* pStream);
  59. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  60. // IWsbCollectable
  61. public:
  62. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  63. WSB_FROM_CWSBOBJECT;
  64. // IWsbTestable
  65. public:
  66. STDMETHOD(Test)( OUT USHORT *pPassed, OUT USHORT *pFailed);
  67. // IRmsMediumChanger
  68. public:
  69. STDMETHOD( Initialize )( void );
  70. STDMETHOD( AcquireDevice )( void );
  71. STDMETHOD( ReleaseDevice )( void );
  72. STDMETHOD( GetHome )( LONG *pType, LONG *pPos, BOOL *pInvert );
  73. STDMETHOD( SetHome )( LONG type, LONG pos, BOOL invert );
  74. STDMETHOD( SetAutomatic )( BOOL flag );
  75. STDMETHOD( IsAutomatic )( void );
  76. STDMETHOD( SetCanRotate )( BOOL flag );
  77. STDMETHOD( CanRotate )( void );
  78. STDMETHOD( GetOperation )( BSTR *pOperation );
  79. STDMETHOD( SetOperation )( BSTR pOperation );
  80. STDMETHOD( GetPercentComplete )( BYTE *pPercent );
  81. STDMETHOD( SetPercentComplete )( BYTE percent );
  82. STDMETHOD( TestReady )( void );
  83. STDMETHOD( ImportCartridge )( IRmsCartridge **pCart );
  84. STDMETHOD( ExportCartridge )( IRmsCartridge **pCart );
  85. STDMETHOD( MoveCartridge )( IN IRmsCartridge *pSrcCart, IN IUnknown *pDestElmt );
  86. STDMETHOD( HomeCartridge )( IN IRmsCartridge *pCart );
  87. // IRmsMoveMedia
  88. public:
  89. STDMETHOD( GetParameters )( IN OUT PDWORD pSize, OUT PGET_CHANGER_PARAMETERS pParms );
  90. STDMETHOD( GetProductData )( IN OUT PDWORD pSize, OUT PCHANGER_PRODUCT_DATA pData );
  91. STDMETHOD( RezeroUnit )( void );
  92. STDMETHOD( InitializeElementStatus )( IN CHANGER_ELEMENT_LIST elementList, IN BOOL barCodeScan );
  93. STDMETHOD( Status )( void );
  94. STDMETHOD( SetAccess )( IN CHANGER_ELEMENT element, IN DWORD control );
  95. STDMETHOD( GetElementStatus )( IN CHANGER_ELEMENT_LIST elementList,
  96. IN BOOL volumeTagInfo,
  97. IN OUT PDWORD pSize,
  98. OUT PREAD_ELEMENT_ADDRESS_INFO pElementInformation );
  99. STDMETHOD( ExchangeMedium )( IN CHANGER_ELEMENT source, IN CHANGER_ELEMENT destination1,
  100. IN CHANGER_ELEMENT destination2, IN BOOL flip1, IN BOOL flip2 );
  101. STDMETHOD( MoveMedium )( IN CHANGER_ELEMENT source, IN CHANGER_ELEMENT destination, IN BOOL flip );
  102. STDMETHOD( Position )( IN CHANGER_ELEMENT destination, IN BOOL flip );
  103. // STDMETHOD( GetDisplay )( OUT PCHANGER_DISPLAY pDisplay );
  104. // STDMETHOD( SetDisplay )( IN PCHANGER_DISPLAY pDisplay );
  105. STDMETHOD( QueryVolumeTag )( IN CHANGER_ELEMENT startingElement, IN DWORD actionCode,
  106. IN PUCHAR pVolumeIDTemplate, OUT PDWORD pNumberOfElementsReturned,
  107. OUT PREAD_ELEMENT_ADDRESS_INFO pElementInformation );
  108. // CRmsServer
  109. private:
  110. private:
  111. enum { // Class specific constants:
  112. //
  113. Version = 1, // Class version, this should be
  114. // incremented each time the
  115. // the class definition changes.
  116. MaxInfo = 64 // Max size of the device identifier.
  117. }; //
  118. CRmsLocator m_home; // The position to move to in response to
  119. // to the Home operation.
  120. BOOL m_isAutomatic; // If TRUE, the changer is a robotic device.
  121. BOOL m_canRotate; // If TRUE, the changer can rotate a
  122. // unit of media.
  123. CWsbBstrPtr m_operation; // A description of the in-progress operation.
  124. BYTE m_percentComplete; // A value between 0-100 that indicates
  125. // what portion of the operation is complete.
  126. HANDLE m_handle; // The handle to the changer device. This is used
  127. // by the IRmsMoveMedia interface.
  128. GET_CHANGER_PARAMETERS m_parameters; // Device specific parameters. See NT DDK.
  129. };
  130. #endif // _RMSCHNGR_