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.

83 lines
2.8 KiB

  1. /**************************************************************\
  2. FILE: bandprxy.h
  3. DESCRIPTION:
  4. The CBandProxy class will allow bands to navigate a
  5. generic browser window. This will work correctly if the
  6. band is tied to the Browser Window because it's a ToolBar.
  7. Or if it's a toolband, each time a navigation happens,
  8. the top most browser window needs to be found or a new window
  9. created.
  10. \**************************************************************/
  11. #ifndef _BANDPRXY_H
  12. #define _BANDPRXY_H
  13. #include "bands.h"
  14. ///////////////////////////////////////////////////////////////////
  15. // #DEFINEs
  16. #define SEC_DEFAULT 0x0000
  17. #define SEC_WAIT 0x0002
  18. #define SEC_SHELLSERVICEOBJECTS 0x0004
  19. #define SEC_NOUI 0x0008
  20. /**************************************************************\
  21. CLASS: CBandProxy
  22. DESCRIPTION:
  23. The CBandProxy class will allow bands to navigate a
  24. generic browser window. This will work correctly if the
  25. band is tied to the Browser Window because it's a ToolBar.
  26. Or if it's a toolband, each time a navigation happens,
  27. the top most browser window needs to be found or a new window
  28. created.
  29. \**************************************************************/
  30. class CBandProxy
  31. : public IBandProxy // (Includes IUnknown)
  32. {
  33. public:
  34. //////////////////////////////////////////////////////
  35. // Public Interfaces
  36. //////////////////////////////////////////////////////
  37. // *** IUnknown ***
  38. virtual STDMETHODIMP_(ULONG) AddRef(void);
  39. virtual STDMETHODIMP_(ULONG) Release(void);
  40. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  41. // *** IBandProxy methods ***
  42. virtual STDMETHODIMP SetSite(IUnknown* punkSite);
  43. virtual STDMETHODIMP CreateNewWindow(IUnknown** ppunk);
  44. virtual STDMETHODIMP GetBrowserWindow(IUnknown** ppunk);
  45. virtual STDMETHODIMP IsConnected();
  46. virtual STDMETHODIMP NavigateToPIDL(LPCITEMIDLIST pidl);
  47. virtual STDMETHODIMP NavigateToURL(LPCWSTR wzUrl, VARIANT * Flags);
  48. // Constructor / Destructor
  49. CBandProxy();
  50. ~CBandProxy(void);
  51. // Friend Functions
  52. friend HRESULT CBandProxy_CreateInstance(IUnknown *punkOuter, IUnknown **ppunk, LPCOBJECTINFO poi);
  53. protected:
  54. //////////////////////////////////////////////////////
  55. // Private Member Variables
  56. //////////////////////////////////////////////////////
  57. int _cRef;
  58. BITBOOL _fHaveBrowser : 1; // We haven't tried to get _pwb
  59. IWebBrowser2 * _pwb;
  60. IUnknown * _punkSite;
  61. HRESULT _NavigateToUrlOLE(BSTR bstrURL, VARIANT * Flags);
  62. HRESULT MakeBrowserVisible(IUnknown* punk);
  63. IWebBrowser2* _GetBrowserWindow();
  64. IWebBrowser2* _GetBrowser();
  65. };
  66. #endif /* _BANDPRXY_H */