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.

141 lines
5.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: items.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _INC_CSCUI_ITEMS_H
  11. #define _INC_CSCUI_ITEMS_H
  12. #ifndef _INC_SHELL_IDLDATA_H
  13. # include "idldata.h"
  14. #endif
  15. class COfflineItemsData : public CIDLData
  16. {
  17. public:
  18. COfflineItemsData(LPCITEMIDLIST pidlFolder,
  19. UINT cidl,
  20. LPCITEMIDLIST *apidl,
  21. HWND hwndParent,
  22. IShellFolder *psfOwner = NULL,
  23. IDataObject *pdtInner = NULL);
  24. ~COfflineItemsData(void);
  25. STDMETHODIMP GetData(FORMATETC *pFEIn, STGMEDIUM *pstm);
  26. STDMETHODIMP SetData(FORMATETC *pFEIn, STGMEDIUM *pstm, BOOL fRelease);
  27. STDMETHODIMP QueryGetData(FORMATETC *pFE);
  28. static HRESULT CreateInstance(COfflineItemsData **ppOut,
  29. LPCITEMIDLIST pidlFolder,
  30. UINT cidl,
  31. LPCITEMIDLIST *apidl,
  32. HWND hwndParent,
  33. IShellFolder *psfOwner = NULL,
  34. IDataObject *pdtInner = NULL);
  35. static HRESULT CreateInstance(IDataObject **ppOut,
  36. LPCITEMIDLIST pidlFolder,
  37. UINT cidl,
  38. LPCITEMIDLIST *apidl,
  39. HWND hwndParent,
  40. IShellFolder *psfOwner = NULL,
  41. IDataObject *pdtInner = NULL);
  42. HRESULT CtorResult(void) const
  43. { return m_hrCtor; }
  44. protected:
  45. HRESULT ProvideFormats(CEnumFormatEtc *pEnumFmtEtc);
  46. private:
  47. HWND m_hwndParent;
  48. LPCOLID *m_rgpolid; // Pidls cloned in private format.
  49. int m_cItems;
  50. HRESULT m_hrCtor;
  51. DWORD m_dwPreferredEffect;
  52. DWORD m_dwPerformedEffect;
  53. DWORD m_dwLogicalPerformedEffect;
  54. static CLIPFORMAT m_cfHDROP;
  55. static CLIPFORMAT m_cfFileContents;
  56. static CLIPFORMAT m_cfFileDesc;
  57. static CLIPFORMAT m_cfPreferedEffect;
  58. static CLIPFORMAT m_cfPerformedEffect;
  59. static CLIPFORMAT m_cfLogicalPerformedEffect;
  60. static CLIPFORMAT m_cfDataSrcClsid;
  61. HRESULT CreateFileDescriptor(STGMEDIUM *pstm);
  62. HRESULT CreateFileContents(STGMEDIUM *pstm, LONG lindex);
  63. HRESULT CreatePrefDropEffect(STGMEDIUM *pstm);
  64. HRESULT CreatePerformedDropEffect(STGMEDIUM *pstm);
  65. HRESULT CreateLogicalPerformedDropEffect(STGMEDIUM *pstm);
  66. HRESULT CreateHDROP(STGMEDIUM *pstm);
  67. HRESULT CreateDataSrcClsid(STGMEDIUM *pstm);
  68. HRESULT CreateDWORD(STGMEDIUM *pstm, DWORD dwEffect);
  69. DWORD GetDataDWORD(FORMATETC *pfe, STGMEDIUM *pstm, DWORD *pdwOut);
  70. //
  71. // Prevent copy.
  72. //
  73. COfflineItemsData(const COfflineItemsData& rhs);
  74. COfflineItemsData& operator = (const COfflineItemsData& rhs);
  75. };
  76. class COfflineItems : public IContextMenu,
  77. public IQueryInfo
  78. {
  79. public:
  80. HRESULT Initialize(UINT cidl, LPCITEMIDLIST *ppidl);
  81. //
  82. // IUnknown Methods
  83. //
  84. STDMETHODIMP QueryInterface(REFIID,void **);
  85. STDMETHODIMP_(ULONG) AddRef(void);
  86. STDMETHODIMP_(ULONG) Release(void);
  87. //
  88. // IContextMenu Methods
  89. //
  90. STDMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
  91. STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici);
  92. STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uType,UINT *pwReserved, LPSTR pszName, UINT cchMax);
  93. //
  94. // IQueryInfo Methods
  95. //
  96. STDMETHODIMP GetInfoTip(DWORD dwFlags, WCHAR **ppwszTip);
  97. STDMETHODIMP GetInfoFlags(DWORD *pdwFlags);
  98. static HRESULT CreateInstance(COfflineFilesFolder *pfolder,
  99. HWND hwnd,
  100. UINT cidl,
  101. LPCITEMIDLIST *ppidl,
  102. REFIID riid,
  103. void **ppv);
  104. private:
  105. //
  106. // Only create through CreateInstance() static function.
  107. //
  108. COfflineItems(COfflineFilesFolder *pfolder, HWND hwnd);
  109. ~COfflineItems();
  110. LONG m_cRef; // reference count
  111. COfflineFilesFolder *m_pFolder; // back pointer to our shell folder
  112. UINT m_cItems; // number of items we represent
  113. LPCOLID *m_ppolid; // variable size array of items
  114. HWND m_hwndBrowser;
  115. };
  116. #endif // _INC_CSCUI_ITEMS_H