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.

152 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxdataobj.h
  5. Abstract:
  6. This header prototypes my implementation of IDataObject.
  7. Environment:
  8. WIN32 User Mode
  9. Author:
  10. Darwin Ouyang (t-darouy) 30-Sept-1997
  11. --*/
  12. #ifndef __FAXDATAOBJECT_H_
  13. #define __FAXDATAOBJECT_H_
  14. #include "resource.h"
  15. class CInternalNode; // Forward declarations
  16. class CFaxComponentData;
  17. class CFaxDataObject : public CComObjectRoot,
  18. public IDataObject
  19. {
  20. public:
  21. // ATL Map
  22. DECLARE_NOT_AGGREGATABLE(CFaxDataObject)
  23. BEGIN_COM_MAP(CFaxDataObject)
  24. COM_INTERFACE_ENTRY(IDataObject)
  25. END_COM_MAP()
  26. // constructor and destructor
  27. CFaxDataObject();
  28. ~CFaxDataObject();
  29. //
  30. // IDataObject
  31. //
  32. virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetDataHere(
  33. /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
  34. /* [out][in] */ STGMEDIUM __RPC_FAR *pmedium);
  35. // these are not implemented
  36. virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetData(
  37. /* [unique][in] */ FORMATETC __RPC_FAR *pformatetcIn,
  38. /* [out] */ STGMEDIUM __RPC_FAR *pmedium) {
  39. return E_NOTIMPL;
  40. }
  41. virtual HRESULT STDMETHODCALLTYPE QueryGetData(
  42. /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc) {
  43. return E_NOTIMPL;
  44. }
  45. virtual HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(
  46. /* [unique][in] */ FORMATETC __RPC_FAR *pformatectIn,
  47. /* [out] */ FORMATETC __RPC_FAR *pformatetcOut) {
  48. return E_NOTIMPL;
  49. }
  50. virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetData(
  51. /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
  52. /* [unique][in] */ STGMEDIUM __RPC_FAR *pmedium,
  53. /* [in] */ BOOL fRelease) {
  54. return E_NOTIMPL;
  55. }
  56. virtual HRESULT STDMETHODCALLTYPE EnumFormatEtc(
  57. /* [in] */ DWORD dwDirection,
  58. /* [out] */ IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc) {
  59. return E_NOTIMPL;
  60. }
  61. virtual HRESULT STDMETHODCALLTYPE DAdvise(
  62. /* [in] */ FORMATETC __RPC_FAR *pformatetc,
  63. /* [in] */ DWORD advf,
  64. /* [unique][in] */ IAdviseSink __RPC_FAR *pAdvSink,
  65. /* [out] */ DWORD __RPC_FAR *pdwConnection) {
  66. return E_NOTIMPL;
  67. }
  68. virtual HRESULT STDMETHODCALLTYPE DUnadvise(
  69. /* [in] */ DWORD dwConnection) {
  70. return E_NOTIMPL;
  71. }
  72. virtual HRESULT STDMETHODCALLTYPE EnumDAdvise(
  73. /* [out] */ IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise) {
  74. return E_NOTIMPL;
  75. }
  76. //
  77. // Non-interface member functions
  78. //
  79. public:
  80. ULONG_PTR GetCookie() { return m_ulCookie; } // cast the owner to a cookie.
  81. void SetCookie( ULONG_PTR cookie )
  82. {
  83. m_ulCookie = cookie;
  84. }
  85. CInternalNode * GetOwner() { return pOwner; }
  86. // this functino sets the owner of the dataobject
  87. // as well as registers the node specific clipboard formats
  88. void SetOwner( CInternalNode* pO );
  89. DATA_OBJECT_TYPES GetContext( void ) { return m_Context; }
  90. void SetContext( DATA_OBJECT_TYPES context )
  91. {
  92. m_Context = context;
  93. }
  94. private:
  95. HRESULT _WriteInternal(IStream *pstm);
  96. HRESULT _WriteDisplayName(IStream *pstm);
  97. HRESULT _WriteNodeType(IStream *pstm);
  98. HRESULT _WriteClsid(IStream *pstm);
  99. ULONG m_cRefs; // object refcount
  100. ULONG_PTR m_ulCookie; // what this obj refers to
  101. CInternalNode * pOwner; // used for getting info from the creator class
  102. DATA_OBJECT_TYPES m_Context; // context in which this was created
  103. #ifdef DEBUG
  104. static long DataObjectCount; // debug DataObjectCount
  105. #endif
  106. public:
  107. // At a minimum we have to implement these clipboard formats
  108. // to keep MMC happy. We will assert if we don't
  109. static UINT s_cfInternal; // Our custom clipboard format
  110. static UINT s_cfDisplayName;
  111. static UINT s_cfNodeType;
  112. static UINT s_cfSnapinClsid;
  113. };
  114. #endif