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.

90 lines
2.8 KiB

  1. /**************************************************************************
  2. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright 1998 Microsoft Corporation. All Rights Reserved.
  7. **************************************************************************/
  8. /******************************************************************************
  9. File: DataObj.h
  10. Description: CDataObject definitions.
  11. ******************************************************************************/
  12. #ifndef DATAOBJ_H
  13. #define DATAOBJ_H
  14. #include <windows.h>
  15. #include <windowsx.h>
  16. #include <shlobj.h>
  17. #include "ShlFldr.h"
  18. #include "PidlMgr.h"
  19. #include "resource.h"
  20. #define SETDefFormatEtc(fe, cf, med) \
  21. {\
  22. (fe).cfFormat=cf; \
  23. (fe).dwAspect=DVASPECT_CONTENT; \
  24. (fe).ptd=NULL;\
  25. (fe).tymed=med;\
  26. (fe).lindex=-1;\
  27. };
  28. /**************************************************************************
  29. CDataObject class definition
  30. **************************************************************************/
  31. class CDataObject : public IDataObject, IEnumFORMATETC
  32. {
  33. private:
  34. DWORD m_ObjRefCount;
  35. LPITEMIDLIST *m_aPidls;
  36. IMalloc *m_pMalloc;
  37. CPidlMgr *m_pPidlMgr;
  38. CShellFolder *m_psfParent;
  39. UINT m_uItemCount;
  40. ULONG m_iCurrent;
  41. ULONG m_cFormatEtc;
  42. LPFORMATETC m_pFormatEtc;
  43. UINT m_cfPrivateData;
  44. UINT m_cfShellIDList;
  45. public:
  46. CDataObject(CShellFolder*, LPCITEMIDLIST*, UINT);
  47. ~CDataObject();
  48. //IUnknown methods
  49. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  50. STDMETHODIMP_(DWORD) AddRef();
  51. STDMETHODIMP_(DWORD) Release();
  52. //IDataObject methods
  53. STDMETHODIMP GetData(LPFORMATETC, LPSTGMEDIUM);
  54. STDMETHODIMP GetDataHere(LPFORMATETC, LPSTGMEDIUM);
  55. STDMETHODIMP QueryGetData(LPFORMATETC);
  56. STDMETHODIMP GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC);
  57. STDMETHODIMP SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
  58. STDMETHODIMP EnumFormatEtc(DWORD, IEnumFORMATETC**);
  59. STDMETHODIMP DAdvise(LPFORMATETC, DWORD, IAdviseSink*, LPDWORD);
  60. STDMETHODIMP DUnadvise(DWORD dwConnection);
  61. STDMETHODIMP EnumDAdvise(IEnumSTATDATA** ppEnumAdvise);
  62. // IEnumFORMATETC members
  63. STDMETHODIMP Next(ULONG, LPFORMATETC, ULONG*);
  64. STDMETHODIMP Skip(ULONG);
  65. STDMETHODIMP Reset(void);
  66. STDMETHODIMP Clone(LPENUMFORMATETC*);
  67. private:
  68. BOOL AllocPidlTable(DWORD);
  69. VOID FreePidlTable(VOID);
  70. BOOL FillPidlTable(LPCITEMIDLIST*, UINT);
  71. };
  72. #endif// DATAOBJ_H