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.

120 lines
3.7 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsObjct.h
  5. Abstract:
  6. Declaration of the CRmsComObject class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSOBJCT_
  12. #define _RMSOBJCT_
  13. #include "resource.h" // resource symbols
  14. /*++
  15. Class Name:
  16. CRmsComObject
  17. Class Description:
  18. A CRmsComObject is the base class for all Rms service COM objects. This
  19. object holds state, security, and error information about an Rms object.
  20. --*/
  21. class CRmsComObject :
  22. public CComDualImpl<IRmsComObject, &IID_IRmsComObject, &LIBID_RMSLib>,
  23. public ISupportErrorInfo
  24. {
  25. // CRmsComObject
  26. public:
  27. CRmsComObject();
  28. HRESULT GetSizeMax(OUT ULARGE_INTEGER* pSize);
  29. HRESULT Load(IN IStream* pStream);
  30. HRESULT Save(IN IStream* pStream, IN BOOL clearDirty);
  31. HRESULT CompareTo( IN IUnknown* pCollectable, OUT SHORT* pResult);
  32. HRESULT Test(OUT USHORT *pPassed, OUT USHORT *pFailed);
  33. // ISupportsErrorInfo
  34. public:
  35. STDMETHOD(InterfaceSupportsErrorInfo)(IN REFIID riid);
  36. // IRmsComObject
  37. public:
  38. STDMETHOD(GetObjectId)(OUT GUID *pObjectId);
  39. STDMETHOD(SetObjectId)(IN GUID objectId);
  40. STDMETHOD(GetObjectType)(OUT LONG *pType);
  41. STDMETHOD(SetObjectType)(IN LONG type);
  42. STDMETHOD(IsEnabled)(void);
  43. STDMETHOD(Enable)();
  44. STDMETHOD(Disable)(IN HRESULT reason);
  45. STDMETHOD(GetState)(OUT LONG *pState);
  46. STDMETHOD(SetState)(IN LONG state);
  47. STDMETHOD(GetStatusCode)(OUT HRESULT *pResult);
  48. STDMETHOD(SetStatusCode)(IN HRESULT result);
  49. STDMETHOD(GetName)(OUT BSTR *pName);
  50. STDMETHOD(SetName)(IN BSTR name);
  51. STDMETHOD(GetDescription)(OUT BSTR *pName);
  52. STDMETHOD(SetDescription)(IN BSTR name);
  53. STDMETHOD(GetPermissions)(OUT SECURITY_DESCRIPTOR *lpPermit);
  54. STDMETHOD(SetPermissions)(IN SECURITY_DESCRIPTOR permit);
  55. STDMETHOD(GetFindBy)(OUT LONG *pFindBy);
  56. STDMETHOD(SetFindBy)(IN LONG findBy);
  57. ////////////////////////////////////////////////////////////////////////////////////////
  58. //
  59. // data members
  60. //
  61. protected:
  62. GUID m_objectId; // Unique ID for this object.
  63. RmsObject m_ObjectType; // The type of object.
  64. BOOL m_IsEnabled; // TRUE, if the object is enabled for normal
  65. // processing.
  66. LONG m_State; // The current operating state of the object.
  67. // Varies by object type. See RmsXXXState.
  68. HRESULT m_StatusCode; // S_OK if the object is enabled for normal
  69. // processing, otherwise this holds the
  70. // result code, or reason, associated with
  71. // the disabled object. This result is
  72. // returned whenever normal processing
  73. // on the object is attempted while object
  74. // is disabled.
  75. CWsbBstrPtr m_Name; // Name of the object.
  76. CWsbBstrPtr m_Description; // Description for the object.
  77. SECURITY_DESCRIPTOR m_Permit; // Defines security attributes of the object.
  78. RmsFindBy m_findBy; // Defines the type of CompareTo to perform
  79. // when searching a collection.
  80. ////////////////////////////////////////////////////////////////////////////////////////
  81. //
  82. // local methods
  83. //
  84. private:
  85. HRESULT adviseOfStatusChange(void);
  86. };
  87. #endif // _RMSOBJCT_