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.

76 lines
2.5 KiB

  1. //*******************************************************************************************
  2. //
  3. // Filename : DataObj.h
  4. //
  5. // Definition of CCabObj
  6. //
  7. // Copyright (c) 1994 - 1996 Microsoft Corporation. All rights reserved
  8. //
  9. //*******************************************************************************************
  10. #ifndef _DATAOBJ_H_
  11. #define _DATAOBJ_H_
  12. #include "thisguid.h"
  13. class CCabObj : public IDataObject, public IPersistStream
  14. {
  15. public:
  16. CCabObj(HWND hwndOwner, CCabFolder *pcf, LPCABITEM *apit, UINT cpit);
  17. ~CCabObj();
  18. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject);
  19. STDMETHODIMP_(ULONG) AddRef();
  20. STDMETHODIMP_(ULONG) Release();
  21. STDMETHODIMP GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium);
  22. STDMETHODIMP GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium);
  23. STDMETHODIMP QueryGetData(FORMATETC *pformatetc);
  24. STDMETHODIMP GetCanonicalFormatEtc(FORMATETC *pformatectIn, FORMATETC *pformatetcOut);
  25. STDMETHODIMP SetData(FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease);
  26. STDMETHODIMP EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc);
  27. STDMETHODIMP DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink,
  28. DWORD *pdwConnection);
  29. STDMETHODIMP DUnadvise(DWORD dwConnection);
  30. STDMETHODIMP EnumDAdvise(IEnumSTATDATA **ppenumAdvise);
  31. // *** IPersist ***
  32. STDMETHODIMP GetClassID(CLSID* pClassID){ *pClassID = CLSID_CabViewDataObject; return S_OK; }
  33. // *** IPersistStream ***
  34. STDMETHODIMP IsDirty(void) {return S_OK;} // Indicate that we are dirty and ::Save() needs to be called.
  35. STDMETHODIMP Load(IStream *pStm);
  36. STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty);
  37. STDMETHODIMP GetSizeMax(ULARGE_INTEGER * pcbSize);
  38. private:
  39. BOOL InitFileGroupDesc();
  40. BOOL InitFileContents();
  41. BOOL InitPersistedDataObject();
  42. BOOL InitHIDA();
  43. static HGLOBAL * CALLBACK ShouldExtract(LPCTSTR pszFile, DWORD dwSize,
  44. UINT date, UINT time, UINT attribs, LPARAM lParam);
  45. HRESULT InitContents();
  46. friend HRESULT CabViewDataObject_CreateInstance(REFIID riid, LPVOID* ppv);
  47. CCabObj();
  48. private:
  49. static UINT s_uFileGroupDesc;
  50. static UINT s_uFileContents;
  51. static UINT s_uPersistedDataObject;
  52. static UINT s_uHIDA;
  53. CRefCount m_cRef;
  54. CRefDll m_cRefDll;
  55. CCabItemList m_lSel;
  56. HGLOBAL *m_lContents;
  57. CCabFolder *m_pcfHere;
  58. HWND m_hwndOwner;
  59. };
  60. #endif // _DATAOBJ_H_