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.

125 lines
4.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: N O T I F Y . H
  7. //
  8. // Contents: Implementation of INetConnectionNotifySink
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 21 Aug 1998
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. class CConnectionFolder;
  17. class CEnumArray :
  18. public CComObjectRootEx <CComObjectThreadModel>,
  19. public IEnumIDList
  20. {
  21. public:
  22. BEGIN_COM_MAP(CEnumArray)
  23. COM_INTERFACE_ENTRY(IEnumIDList)
  24. END_COM_MAP()
  25. static HRESULT CreateInstance(IEnumIDList** ppv, LPCITEMIDLIST *ppidl, UINT cItems);
  26. // IEnumIDList
  27. STDMETHODIMP Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched);
  28. STDMETHODIMP Skip(ULONG celt);
  29. STDMETHODIMP Reset();
  30. STDMETHODIMP Clone(IEnumIDList **ppenum);
  31. protected:
  32. CEnumArray();
  33. virtual ~CEnumArray();
  34. LPCITEMIDLIST *_ppidl; // this holds aliases to the pidls, don't free them
  35. private:
  36. LONG _cRef;
  37. ULONG _ulIndex;
  38. UINT _cItems;
  39. };
  40. #define TOPLEVEL TRUE
  41. #define TASKLEVEL FALSE
  42. #define DECLARE_WEBVIEW_INVOKE_HANDLER(cmd) \
  43. static HRESULT cmd (IUnknown* pv, IShellItemArray *psiItemArray, IBindCtx *pbc);
  44. #define DECLARE_CANSHOW_HANDLER(cmd) \
  45. static HRESULT cmd (IUnknown* pv, IShellItemArray *psiItemArray, BOOL fOkToBeSlow, UISTATE* puisState);
  46. #define DECLARE_WEBVIEW_HANDLERS(cmd) \
  47. DECLARE_WEBVIEW_INVOKE_HANDLER(On##cmd); \
  48. DECLARE_CANSHOW_HANDLER(CanShow##cmd);
  49. #define INVOKE_HANDLER_OF(cmd) CNCWebView::On##cmd
  50. #define CANSHOW_HANDLER_OF(cmd) CNCWebView::CanShow##cmd
  51. #define IMPLEMENT_WEBVIEW_INVOKE_HANDLER(clsname, cmd, verb) \
  52. HRESULT clsname##::##cmd (IUnknown* pv, IShellItemArray *psiItemArray, IBindCtx *pbc) \
  53. { \
  54. return WebviewVerbInvoke(verb, pv, psiItemArray); \
  55. }
  56. #define IMPLEMENT_CANSHOW_HANDLER(level, clsname, cmd, verb) \
  57. HRESULT clsname##::##cmd (IUnknown* pv, IShellItemArray *psiItemArray, BOOL fOkToBeSlow, UISTATE* puisState) \
  58. { \
  59. return WebviewVerbCanInvoke(verb, pv, psiItemArray, fOkToBeSlow, puisState, level); \
  60. }
  61. #define IMPLEMENT_WEBVIEW_HANDLERS(level, clsname, verb) \
  62. IMPLEMENT_WEBVIEW_INVOKE_HANDLER(clsname, On##verb, verb) \
  63. IMPLEMENT_CANSHOW_HANDLER(level, clsname, CanShow##verb, verb)
  64. #define MAXOTHERPLACES 5
  65. class CNCWebView
  66. {
  67. private:
  68. // PIDLs to the folders in the webview other places section
  69. LPITEMIDLIST m_apidlOtherPlaces[MAXOTHERPLACES];
  70. CConnectionFolder* m_pConnectionFolder;
  71. public:
  72. CNCWebView(CConnectionFolder* pConnectionFolder);
  73. ~CNCWebView();
  74. STDMETHOD(CreateOtherPlaces)(LPDWORD pdwCount);
  75. STDMETHOD(DestroyOtherPlaces)();
  76. STDMETHOD(RealMessage)(UINT uMsg, WPARAM wParam, LPARAM lParam);
  77. STDMETHOD(OnGetWebViewLayout)(DWORD pv, UINT uViewMode, SFVM_WEBVIEW_LAYOUT_DATA* pData);
  78. STDMETHOD(OnGetWebViewContent)(DWORD pv, SFVM_WEBVIEW_CONTENT_DATA* pData);
  79. STDMETHOD(OnGetWebViewTasks)(DWORD pv, SFVM_WEBVIEW_TASKSECTION_DATA* pTasks);
  80. public:
  81. static HRESULT WebviewVerbInvoke(DWORD dwVerbID, IUnknown* pv, IShellItemArray *psiItemArray);
  82. static HRESULT WebviewVerbCanInvoke(DWORD dwVerbID, IUnknown* pv, IShellItemArray *psiItemArray, BOOL fOkToBeSlow, UISTATE* puisState, BOOL bLevel);
  83. DECLARE_WEBVIEW_INVOKE_HANDLER(OnNull);
  84. DECLARE_WEBVIEW_HANDLERS(CMIDM_NEW_CONNECTION);
  85. DECLARE_WEBVIEW_HANDLERS(CMIDM_FIX);
  86. DECLARE_WEBVIEW_HANDLERS(CMIDM_CONNECT);
  87. DECLARE_WEBVIEW_HANDLERS(CMIDM_DISCONNECT);
  88. DECLARE_WEBVIEW_HANDLERS(CMIDM_ENABLE);
  89. DECLARE_WEBVIEW_HANDLERS(CMIDM_DISABLE);
  90. DECLARE_WEBVIEW_HANDLERS(CMIDM_RENAME);
  91. DECLARE_WEBVIEW_HANDLERS(CMIDM_DELETE);
  92. DECLARE_WEBVIEW_HANDLERS(CMIDM_STATUS);
  93. DECLARE_WEBVIEW_HANDLERS(CMIDM_PROPERTIES);
  94. DECLARE_WEBVIEW_HANDLERS(CMIDM_HOMENET_WIZARD);
  95. DECLARE_WEBVIEW_HANDLERS(CMIDM_NET_TROUBLESHOOT);
  96. };
  97. HRESULT HrIsWebViewEnabled();