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.

107 lines
3.4 KiB

  1. // DataObj.h : Declaration of the data object classes
  2. #ifndef __DATAOBJ_H_INCLUDED__
  3. #define __DATAOBJ_H_INCLUDED__
  4. #include "cookie.h" // FILEMGMT_TRANSPORT
  5. #include "stddtobj.h" // class DataObject
  6. #include <list>
  7. using namespace std;
  8. typedef list<LPDATAOBJECT> CDataObjectList;
  9. class CFileMgmtDataObject : public CDataObject
  10. {
  11. DECLARE_NOT_AGGREGATABLE(CFileMgmtDataObject)
  12. public:
  13. // debug refcount
  14. #if DBG==1
  15. ULONG InternalAddRef()
  16. {
  17. TRACE2( "DataObj 0x%xd AddRef (%d)\n", (DWORD)this, m_dwRef ); return CComObjectRoot::InternalAddRef();
  18. }
  19. ULONG InternalRelease()
  20. {
  21. TRACE2( "DataObj 0x%xd Release (%d)\n", (DWORD)this, m_dwRef );return CComObjectRoot::InternalRelease();
  22. }
  23. int dbg_InstID;
  24. #endif // DBG==1
  25. CFileMgmtDataObject()
  26. : m_pComponentData(0), m_pcookie(NULL)
  27. {
  28. }
  29. ~CFileMgmtDataObject();
  30. virtual HRESULT Initialize( CFileMgmtCookie* pcookie,
  31. CFileMgmtComponentData& refComponentData,
  32. DATA_OBJECT_TYPES type );
  33. // IDataObject interface implementation
  34. HRESULT STDMETHODCALLTYPE GetDataHere(
  35. FORMATETC __RPC_FAR *pFormatEtcIn,
  36. STGMEDIUM __RPC_FAR *pMedium);
  37. HRESULT PutDisplayName(STGMEDIUM* pMedium);
  38. HRESULT PutServiceName(STGMEDIUM* pMedium);
  39. HRESULT STDMETHODCALLTYPE GetData(
  40. FORMATETC __RPC_FAR *pFormatEtcIn,
  41. STGMEDIUM __RPC_FAR *pMedium);
  42. void FreeMultiSelectObjList();
  43. HRESULT InitMultiSelectDataObjects(CFileMgmtComponentData& refComponentData);
  44. HRESULT AddMultiSelectDataObjects(CFileMgmtCookie* pCookie, DATA_OBJECT_TYPES type);
  45. CDataObjectList* GetMultiSelectObjList() { return &m_MultiSelectObjList; }
  46. protected:
  47. CDataObjectList m_MultiSelectObjList;
  48. CFileMgmtCookie* m_pcookie; // the CCookieBlock is AddRef'ed for the life of the DataObject
  49. CString m_strMachineName; // CODEWORK should not be necessary
  50. FileMgmtObjectType m_objecttype; // CODEWORK should not be necessary
  51. DATA_OBJECT_TYPES m_dataobjecttype;
  52. GUID m_SnapInCLSID;
  53. BOOL m_fAllowOverrideMachineName; // From CFileMgmtComponentData
  54. public:
  55. // Clipboard formats
  56. static CLIPFORMAT m_CFSnapinPreloads; // added JonN 01/19/00
  57. static CLIPFORMAT m_CFDisplayName;
  58. static CLIPFORMAT m_CFTransport;
  59. static CLIPFORMAT m_CFMachineName;
  60. static CLIPFORMAT m_CFShareName;
  61. static CLIPFORMAT m_CFSessionClientName; // only for SMB
  62. static CLIPFORMAT m_CFSessionUserName; // only for SMB
  63. static CLIPFORMAT m_CFSessionID; // only for FPNW and SFM
  64. static CLIPFORMAT m_CFFileID;
  65. static CLIPFORMAT m_CFServiceName;
  66. static CLIPFORMAT m_CFServiceDisplayName;
  67. static CLIPFORMAT m_cfSendConsoleMessageRecipients;
  68. static CLIPFORMAT m_CFIDList; // only for SMB
  69. static CLIPFORMAT m_CFObjectTypesInMultiSelect;
  70. static CLIPFORMAT m_CFMultiSelectDataObject;
  71. static CLIPFORMAT m_CFMultiSelectSnapins;
  72. static CLIPFORMAT m_CFInternal;
  73. private:
  74. CFileMgmtComponentData* m_pComponentData;
  75. };
  76. FileMgmtObjectType FileMgmtObjectTypeFromIDataObject(IN LPDATAOBJECT lpDataObject);
  77. //
  78. // I recommend passing a non-NULL pobjecttype, to make sure that the
  79. // type of the cookie is valid
  80. //
  81. HRESULT ExtractBaseCookie(
  82. LPDATAOBJECT piDataObject,
  83. CCookie** ppcookie,
  84. FileMgmtObjectType* pobjecttype = NULL );
  85. BOOL IsMultiSelectObject(LPDATAOBJECT piDataObject);
  86. #endif // ~__DATAOBJ_H_INCLUDED__