Leaked source code of windows server 2003
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.

126 lines
3.7 KiB

  1. #include <atlsnap.h>
  2. #include <wtypes.h>
  3. // multiselection dragdrop status
  4. enum
  5. {
  6. DD_NONE = 0,
  7. DD_SUCCEEDED,
  8. DD_FAILED
  9. };
  10. class CMultiSelectItemDataObject:
  11. public CComObjectRootEx<CComSingleThreadModel>,
  12. public IDataObject
  13. {
  14. public:
  15. CMultiSelectItemDataObject();
  16. ~CMultiSelectItemDataObject();
  17. public:
  18. BEGIN_COM_MAP(CMultiSelectItemDataObject)
  19. COM_INTERFACE_ENTRY(IDataObject)
  20. END_COM_MAP()
  21. BEGIN_SNAPINCOMMAND_MAP(CMultiSelectItemDataObject, FALSE)
  22. SNAPINCOMMAND_ENTRY(ID_TOP_MOVE, OnMoveMultipleObjs )
  23. SNAPINCOMMAND_ENTRY(ID_VIEW_VERSION, OnVersionInfo )
  24. END_SNAPINCOMMAND_MAP()
  25. SNAPINMENUID(IDR_MULTISEL_MENU)
  26. // interface member functions
  27. public:
  28. STDMETHOD(GetDataHere)(FORMATETC *pformatetc, STGMEDIUM *pmedium);
  29. STDMETHOD(GetData)(FORMATETC *pformatetc, STGMEDIUM *pmedium);
  30. STDMETHOD(QueryGetData)(FORMATETC *pformatetc);
  31. STDMETHOD(GetClassID)(CLSID *pCLSID)
  32. {
  33. return S_FALSE;
  34. }
  35. STDMETHOD(GetCanonicalFormatEtc)(FORMATETC* /* pformatectIn */,FORMATETC* /* pformatetcOut */)
  36. {
  37. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::GetCanonicalFormatEtc\n"));
  38. }
  39. STDMETHOD(SetData)(FORMATETC* /* pformatetc */, STGMEDIUM* /* pmedium */, BOOL /* fRelease */)
  40. {
  41. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::SetData\n"));
  42. }
  43. STDMETHOD(EnumFormatEtc)(DWORD /* dwDirection */, IEnumFORMATETC** /* ppenumFormatEtc */)
  44. {
  45. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::EnumFormatEtc\n"));
  46. }
  47. STDMETHOD(DAdvise)(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink,
  48. DWORD *pdwConnection)
  49. {
  50. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::SetData\n"));
  51. }
  52. STDMETHOD(DUnadvise)(DWORD dwConnection)
  53. {
  54. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::SetDatan\n"));
  55. }
  56. STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise)
  57. {
  58. ATLTRACENOTIMPL(_T("SnapInDataObjectImpl::SetData\n"));
  59. }
  60. // non-interface member functions
  61. public:
  62. HRESULT AddMultiSelectItem( CObjectData *pDataObject );
  63. HRESULT OnNotify(CDomMigratorComponent *pComponent, MMC_NOTIFY_TYPE event, long arg, long param );
  64. HRESULT AddMenuItems(LPCONTEXTMENUCALLBACK piCallback,
  65. long *pInsertionAllowed, DATA_OBJECT_TYPES type);
  66. void UpdateMenuState( UINT id, LPTSTR pBuf, UINT *flags){}
  67. void SetMenuInsertionFlags(bool bBeforeInsertion, long* pInsertionAllowed){}
  68. HRESULT Command(long lCommandID, CSnapInObjectRootBase* pObj, DATA_OBJECT_TYPES type);
  69. HRESULT OnSelect(IConsole *spConsole);
  70. HRESULT OnSelectAllowDragDrop(IConsole *spConsole);
  71. HRESULT OnCutOrMove( IConsole* pConsole );
  72. void SetParentGuid( GUID *guid );
  73. void GetParentGuid( GUID *guid );
  74. DWORD GetItemCount();
  75. void SetParentItem( CSnapInItem *pParentItem );
  76. CSnapInItem *GetParentItem();
  77. CSnapInItem *GetSnapInItem(DWORD index);
  78. BYTE GetDDStatus(DWORD index);
  79. void SetDDStatus(DWORD index, BYTE status);
  80. static SMMCDataObjects *ExtractMSDataObjects( LPDATAOBJECT lpDataObject );
  81. /* CNetNode *GetDomainPtr()
  82. {
  83. return m_pDomain;
  84. }
  85. void SetDomainPtr( CNetNode *ptr )
  86. {
  87. m_pDomain = ptr;
  88. }
  89. */
  90. HRESULT OnMoveMultipleObjs(bool &bHandled, CSnapInObjectRootBase* pObj);
  91. HRESULT OnVersionInfo(bool &bHandled, CSnapInObjectRootBase* pObj);
  92. private:
  93. CPtrArray m_objectDataArray;
  94. CByteArray m_ddStatusArray;
  95. CSnapInItem *m_pParentItem;
  96. GUID m_parentGuid;
  97. // CNetNode *m_pDomain;
  98. public:
  99. bool m_bHasGroup;
  100. public:
  101. static UINT s_cfMsObjTypes; // MultiSelect clipformats
  102. static UINT s_cfMsDataObjs; // MultiSelect snapin
  103. };