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.

702 lines
31 KiB

  1. #ifndef _BASESB2_H
  2. #define _BASESB2_H
  3. #include "iface.h"
  4. #include "track.h"
  5. #include "fldset.h"
  6. #include <vervec.h>
  7. #include <iethread.h>
  8. #include <profsvc.h>
  9. #include "browsext.h"
  10. #include "airesize.h"
  11. // this is used to identify the top frame browsers dwBrowserIndex
  12. #define BID_TOPFRAMEBROWSER ((DWORD)-1)
  13. void IECleanUpAutomationObject(void);
  14. #define CBASEBROWSER CBaseBrowser2
  15. class CBaseBrowser2 : public CAggregatedUnknown
  16. , public IShellBrowser
  17. , public IBrowserService3
  18. , public IServiceProvider
  19. , public IOleCommandTarget
  20. , public IOleContainer
  21. , public IOleInPlaceUIWindow
  22. , public IAdviseSink
  23. , public IDropTarget
  24. , public IInputObjectSite
  25. , public IDocNavigate
  26. , public IPersistHistory
  27. , public IInternetSecurityMgrSite
  28. , public IVersionHost
  29. , public IProfferServiceImpl
  30. , public ITravelLogClient
  31. , public ITravelLogClient2
  32. , public ITridentService2
  33. , public IShellBrowserService
  34. , public IInitViewLinkedWebOC
  35. , public INotifyAppStart
  36. {
  37. public:
  38. // IUnknown
  39. STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObj) {return CAggregatedUnknown::QueryInterface(riid, ppvObj);};
  40. STDMETHODIMP_(ULONG) AddRef(void) { return CAggregatedUnknown::AddRef();};
  41. STDMETHODIMP_(ULONG) Release(void) { return CAggregatedUnknown::Release();};
  42. // IOleWindow
  43. STDMETHODIMP GetWindow(HWND * lphwnd);
  44. STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
  45. // IShellBrowser (same as IOleInPlaceFrame)
  46. STDMETHODIMP InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
  47. STDMETHODIMP SetMenuSB(HMENU hmenuShared, HOLEMENU holemenu, HWND hwnd);
  48. STDMETHODIMP RemoveMenusSB(HMENU hmenuShared);
  49. STDMETHODIMP SetStatusTextSB(LPCOLESTR lpszStatusText);
  50. STDMETHODIMP EnableModelessSB(BOOL fEnable);
  51. STDMETHODIMP TranslateAcceleratorSB(LPMSG lpmsg, WORD wID);
  52. STDMETHODIMP BrowseObject(LPCITEMIDLIST pidl, UINT wFlags);
  53. STDMETHODIMP GetViewStateStream(DWORD grfMode, LPSTREAM *ppStrm) {return E_NOTIMPL; };
  54. STDMETHODIMP GetControlWindow(UINT id, HWND * lphwnd);
  55. STDMETHODIMP SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret);
  56. STDMETHODIMP QueryActiveShellView(struct IShellView ** ppshv);
  57. STDMETHODIMP OnViewWindowActive(struct IShellView * ppshv);
  58. STDMETHODIMP SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags);
  59. // IOleInPlaceUIWindow (also IOleWindow)
  60. STDMETHODIMP GetBorder(LPRECT lprectBorder);
  61. STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS pborderwidths);
  62. STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS pborderwidths);
  63. STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName);
  64. // IOleCommandTarget
  65. STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  66. STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  67. // IOleContainer
  68. STDMETHODIMP ParseDisplayName(IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut);
  69. STDMETHODIMP EnumObjects(DWORD grfFlags, IEnumUnknown **ppenum);
  70. STDMETHODIMP LockContainer( BOOL fLock);
  71. // IBrowserService
  72. STDMETHODIMP GetParentSite(struct IOleInPlaceSite** ppipsite);
  73. STDMETHODIMP SetTitle(IShellView *psv, LPCWSTR pszName);
  74. STDMETHODIMP GetTitle(IShellView *psv, LPWSTR pszName, DWORD cchName);
  75. STDMETHODIMP GetOleObject(struct IOleObject** ppobjv);
  76. STDMETHODIMP GetTravelLog(ITravelLog **pptl);
  77. STDMETHODIMP ShowControlWindow(UINT id, BOOL fShow);
  78. STDMETHODIMP IsControlWindowShown(UINT id, BOOL *pfShown);
  79. STDMETHODIMP IEGetDisplayName(LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags);
  80. STDMETHODIMP IEParseDisplayName(UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut);
  81. STDMETHODIMP DisplayParseError(HRESULT hres, LPCWSTR pwszPath);
  82. STDMETHODIMP NavigateToPidl(LPCITEMIDLIST pidl, DWORD grfHLNF);
  83. STDMETHODIMP SetNavigateState(BNSTATE bnstate);
  84. STDMETHODIMP GetNavigateState(BNSTATE *pbnstate);
  85. STDMETHODIMP UpdateWindowList(void);
  86. STDMETHODIMP UpdateBackForwardState(void);
  87. STDMETHODIMP NotifyRedirect(IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse);
  88. STDMETHODIMP SetFlags(DWORD dwFlags, DWORD dwFlagMask);
  89. STDMETHODIMP GetFlags(DWORD *pdwFlags);
  90. STDMETHODIMP CanNavigateNow(void);
  91. STDMETHODIMP GetPidl(LPITEMIDLIST *ppidl);
  92. STDMETHODIMP SetReferrer(LPITEMIDLIST pidl);
  93. STDMETHODIMP_(DWORD) GetBrowserIndex(void);
  94. STDMETHODIMP GetBrowserByIndex(DWORD dwID, IUnknown **ppunk);
  95. STDMETHODIMP GetHistoryObject(IOleObject **ppole, IStream **ppstm, IBindCtx **ppbc);
  96. STDMETHODIMP SetHistoryObject(IOleObject *pole, BOOL fIsLocalAnchor);
  97. STDMETHODIMP CacheOLEServer(IOleObject *pole);
  98. STDMETHODIMP GetSetCodePage(VARIANT* pvarIn, VARIANT* pvarOut);
  99. STDMETHODIMP OnHttpEquiv(IShellView* psv, BOOL fDone, VARIANT *pvarargIn, VARIANT *pvarargOut);
  100. STDMETHODIMP GetPalette( HPALETTE * hpal );
  101. STDMETHODIMP RegisterWindow(BOOL fUnregister, int swc) {return E_NOTIMPL;}
  102. STDMETHODIMP_(LRESULT) WndProcBS(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  103. STDMETHODIMP OnSize(WPARAM wParam);
  104. STDMETHODIMP OnCreate(LPCREATESTRUCT pcs);
  105. STDMETHODIMP_(LRESULT) OnCommand(WPARAM wParam, LPARAM lParam);
  106. STDMETHODIMP OnDestroy();
  107. STDMETHODIMP ReleaseShellView();
  108. STDMETHODIMP ActivatePendingView();
  109. STDMETHODIMP_(LRESULT) OnNotify(NMHDR * pnm);
  110. STDMETHODIMP OnSetFocus();
  111. STDMETHODIMP OnFrameWindowActivateBS(BOOL fActive);
  112. STDMETHODIMP SetTopBrowser();
  113. STDMETHODIMP UpdateSecureLockIcon(int eSecureLock);
  114. STDMETHODIMP Offline(int iCmd);
  115. STDMETHODIMP SetActivateState(UINT uActivate) { _bbd._uActivateState = uActivate; return S_OK;};
  116. STDMETHODIMP AllowViewResize(BOOL f) { HRESULT hres = _fDontResizeView ? S_FALSE : S_OK; _fDontResizeView = !BOOLIFY(f); return hres;};
  117. STDMETHODIMP InitializeDownloadManager();
  118. STDMETHODIMP InitializeTransitionSite();
  119. STDMETHODIMP CreateViewWindow(IShellView* psvNew, IShellView* psvOld, LPRECT prcView, HWND* phwnd);
  120. STDMETHODIMP GetFolderSetData(struct tagFolderSetData*) { ASSERT(0); return E_NOTIMPL;};
  121. STDMETHODIMP CreateBrowserPropSheetExt(REFIID, void **) { ASSERT(0); return E_NOTIMPL;};
  122. STDMETHODIMP GetBaseBrowserData( LPCBASEBROWSERDATA* ppbd ) { *ppbd = &_bbd; return S_OK; };
  123. STDMETHODIMP_(LPBASEBROWSERDATA) PutBaseBrowserData() { return &_bbd; };
  124. STDMETHODIMP SetAsDefFolderSettings() { TraceMsg(TF_ERROR, "CBaseBrowser2::SetAsDefFolderSettings called, returned E_NOTIMPL"); return E_NOTIMPL;};
  125. STDMETHODIMP GetViewRect(RECT* prc);
  126. STDMETHODIMP GetViewWindow(HWND * phwndView);
  127. STDMETHODIMP InitializeTravelLog(ITravelLog* ptl, DWORD dw);
  128. STDMETHODIMP _Initialize(HWND hwnd, IUnknown *pauto);
  129. // ITravelLogClient
  130. STDMETHODIMP FindWindowByIndex(DWORD dwID, IUnknown ** ppunk);
  131. STDMETHODIMP GetWindowData(LPWINDOWDATA pWinData);
  132. STDMETHODIMP LoadHistoryPosition(LPOLESTR pszUrlLocation, DWORD dwCookie);
  133. // ITridentService
  134. STDMETHODIMP FireBeforeNavigate2(IDispatch * pDispatch,
  135. LPCTSTR lpszUrl,
  136. DWORD dwFlags,
  137. LPCTSTR lpszFrameName,
  138. LPBYTE pPostData,
  139. DWORD cbPostData,
  140. LPCTSTR lpszHeaders,
  141. BOOL fPlayNavSound,
  142. BOOL * pfCancel);
  143. STDMETHODIMP FireNavigateComplete2(IHTMLWindow2 * pHTMLWindow2,
  144. DWORD dwFlags);
  145. STDMETHODIMP FireDownloadBegin();
  146. STDMETHODIMP FireDownloadComplete();
  147. STDMETHODIMP FireDocumentComplete(IHTMLWindow2 * pHTMLWindow2,
  148. DWORD dwFlags);
  149. STDMETHODIMP UpdateDesktopComponent(IHTMLWindow2 * pHTMLWindow);
  150. STDMETHODIMP GetPendingUrl(BSTR * pbstrPendingUrl);
  151. STDMETHODIMP ActiveElementChanged(IHTMLElement * pHTMLElement);
  152. STDMETHODIMP GetUrlSearchComponent(BSTR * pbstrSearch);
  153. STDMETHODIMP IsErrorUrl(LPCTSTR lpszUrl, BOOL *pfIsError);
  154. STDMETHOD(FireNavigateError)(IHTMLWindow2 * pHTMLWindow2,
  155. DWORD dwStatusCode,
  156. BOOL * pfCancel)
  157. {
  158. ASSERT(0);
  159. return E_NOTIMPL;
  160. }
  161. // ITridentService2
  162. //
  163. STDMETHODIMP AttachMyPics(void *pDoc2, void **ppMyPics);
  164. STDMETHODIMP_(BOOL) ReleaseMyPics(void *pMyPics);
  165. STDMETHODIMP InitAutoImageResize();
  166. STDMETHODIMP UnInitAutoImageResize();
  167. STDMETHODIMP IsGalleryMeta(BOOL bFlag, void *pMyPics);
  168. STDMETHODIMP EmailPicture(BSTR bstrURL);
  169. STDMETHODIMP FireNavigateError(IHTMLWindow2 * pHTMLWindow2,
  170. BSTR bstrURL,
  171. BSTR bstrTargetFrameName,
  172. DWORD dwStatusCode,
  173. BOOL * pfCancel);
  174. STDMETHODIMP FirePrintTemplateEvent(IHTMLWindow2 * pHTMLWindow2, DISPID dispidPrintEvent);
  175. STDMETHODIMP FireUpdatePageStatus(IHTMLWindow2 * pHTMLWindow2, DWORD nPage, BOOL fDone);
  176. STDMETHODIMP FirePrivacyImpactedStateChange(BOOL bPrivacyImpacted);
  177. STDMETHODIMP_(UINT) _get_itbLastFocus() { ASSERT(0); return ITB_VIEW; };
  178. STDMETHODIMP _put_itbLastFocus(UINT itbLastFocus) { return E_NOTIMPL; };
  179. // IShellBrowserService
  180. //
  181. STDMETHODIMP GetPropertyBag(DWORD dwFlags, REFIID riid, void** ppv) {ASSERT(0); return E_NOTIMPL;}
  182. // see _UIActivateView, below
  183. // BEGIN REVIEW: review names and need of each.
  184. //
  185. // this first set could be basebrowser only members. no one overrides
  186. STDMETHODIMP _CancelPendingNavigationAsync() ;
  187. STDMETHODIMP _CancelPendingView() ;
  188. STDMETHODIMP _MaySaveChanges() ;
  189. STDMETHODIMP _PauseOrResumeView( BOOL fPaused) ;
  190. STDMETHODIMP _DisableModeless() ;
  191. // rethink these... are all of these necessary?
  192. STDMETHODIMP _NavigateToPidl( LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags);
  193. STDMETHODIMP _TryShell2Rename( IShellView* psv, LPCITEMIDLIST pidlNew);
  194. STDMETHODIMP _SwitchActivationNow( );
  195. // this belongs with the toolbar set.
  196. STDMETHODIMP _ExecChildren(IUnknown *punkBar, BOOL fBroadcast,
  197. const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  198. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  199. STDMETHODIMP _SendChildren(HWND hwndBar, BOOL fBroadcast,
  200. UINT uMsg, WPARAM wParam, LPARAM lParam);
  201. STDMETHODIMP _GetViewBorderRect(RECT* prc);
  202. STDMETHODIMP _UpdateViewRectSize();
  203. STDMETHODIMP _ResizeNextBorder(UINT itb);
  204. STDMETHODIMP _ResizeView();
  205. // Notes: Only CDesktopBrowser may sublcass this.
  206. STDMETHODIMP _GetEffectiveClientArea(LPRECT lprectBorder, HMONITOR hmon);
  207. //END REVIEW:
  208. // CDesktopBrowser accesses CCommonBrowser implementations of these:
  209. STDMETHODIMP_(IStream*) v_GetViewStream(LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) { ASSERT(FALSE); return NULL; }
  210. STDMETHODIMP_(LRESULT) ForwardViewMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) { ASSERT(FALSE); return 0; }
  211. STDMETHODIMP SetAcceleratorMenu(HACCEL hacc) { ASSERT(FALSE); return E_NOTIMPL; }
  212. STDMETHODIMP_(int) _GetToolbarCount(THIS) { ASSERT(FALSE); return 0; }
  213. STDMETHODIMP_(LPTOOLBARITEM) _GetToolbarItem(THIS_ int itb) { ASSERT(FALSE); return NULL; }
  214. STDMETHODIMP _SaveToolbars(IStream* pstm) { ASSERT(FALSE); return E_NOTIMPL; }
  215. STDMETHODIMP _LoadToolbars(IStream* pstm) { ASSERT(FALSE); return E_NOTIMPL; }
  216. STDMETHODIMP _CloseAndReleaseToolbars(BOOL fClose) { ASSERT(FALSE); return E_NOTIMPL; }
  217. STDMETHODIMP v_MayGetNextToolbarFocus(LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM * pptbi, HWND * phwnd) { ASSERT(FALSE); return E_NOTIMPL; };
  218. STDMETHODIMP _ResizeNextBorderHelper(UINT itb, BOOL bUseHmonitor) { ASSERT(FALSE); return E_NOTIMPL; }
  219. STDMETHODIMP_(UINT) _FindTBar(IUnknown* punkSrc) { ASSERT(FALSE); return (UINT)-1; };
  220. STDMETHODIMP _SetFocus(LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) { ASSERT(FALSE); return E_NOTIMPL; }
  221. STDMETHODIMP v_MayTranslateAccelerator(MSG* pmsg) { ASSERT(FALSE); return E_NOTIMPL; }
  222. STDMETHODIMP _GetBorderDWHelper(IUnknown* punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) { ASSERT(FALSE); return E_NOTIMPL; }
  223. // CShellBrowser overrides this.
  224. STDMETHODIMP v_CheckZoneCrossing(LPCITEMIDLIST pidl) {return S_OK;};
  225. // IServiceProvider
  226. STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void ** ppvObj);
  227. // IAdviseSink
  228. STDMETHODIMP_(void) OnDataChange(FORMATETC *, STGMEDIUM *);
  229. STDMETHODIMP_(void) OnViewChange(DWORD dwAspect, LONG lindex);
  230. STDMETHODIMP_(void) OnRename(IMoniker *);
  231. STDMETHODIMP_(void) OnSave();
  232. STDMETHODIMP_(void) OnClose();
  233. // IDropTarget ***
  234. STDMETHODIMP DragEnter(IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  235. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  236. STDMETHODIMP DragLeave(void);
  237. STDMETHODIMP Drop(IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  238. // IInputObjectSite
  239. STDMETHODIMP OnFocusChangeIS(IUnknown* punkSrc, BOOL fSetFocus);
  240. // IDocNavigate
  241. STDMETHODIMP OnReadyStateChange(IShellView* psvSource, DWORD dwReadyState);
  242. STDMETHODIMP get_ReadyState(DWORD * pdwReadyState);
  243. // IPersist
  244. STDMETHODIMP GetClassID(CLSID *pclsid);
  245. // IPersistHistory
  246. STDMETHODIMP LoadHistory(IStream *pStream, IBindCtx *pbc);
  247. STDMETHODIMP SaveHistory(IStream *pStream);
  248. STDMETHODIMP SetPositionCookie(DWORD dwPositionCookie);
  249. STDMETHODIMP GetPositionCookie(DWORD *pdwPositioncookie);
  250. // IInternetSecurityMgrSite
  251. // STDMETHODIMP GetWindow(HWND * lphwnd) { return IOleWindow::GetWindow(lphwnd); }
  252. STDMETHODIMP EnableModeless(BOOL fEnable) { return EnableModelessSB(fEnable); }
  253. // IVersionHost
  254. STDMETHODIMP QueryUseLocalVersionVector( BOOL *fUseLocal);
  255. STDMETHODIMP QueryVersionVector( IVersionVector *pVersion);
  256. // ITravelLogClient2
  257. STDMETHODIMP GetDummyWindowData(LPWSTR pszUrl, LPWSTR pszTitle, LPWINDOWDATA pWinData);
  258. // This is the QueryInterface the aggregator implements
  259. virtual HRESULT v_InternalQueryInterface(REFIID riid, void ** ppvObj);
  260. // IInitViewLinkedWebOC methods
  261. STDMETHODIMP SetViewLinkedWebOC(BOOL bValue)
  262. {
  263. _fIsViewLinkedWebOC = bValue;
  264. return S_OK;
  265. };
  266. STDMETHODIMP IsViewLinkedWebOC(BOOL* pbValue)
  267. {
  268. ASSERT(pbValue);
  269. *pbValue = _fIsViewLinkedWebOC;
  270. return S_OK;
  271. };
  272. STDMETHODIMP SetViewLinkedWebOCFrame(IDispatch * pDisp)
  273. {
  274. HRESULT hr = E_FAIL;
  275. ASSERT(pDisp);
  276. ATOMICRELEASE(_pDispViewLinkedWebOCFrame);
  277. hr = IUnknown_QueryService(pDisp,
  278. SID_SWebBrowserApp,
  279. IID_PPV_ARG(IWebBrowser2, &_pDispViewLinkedWebOCFrame));
  280. if (FAILED(hr))
  281. {
  282. _fIsViewLinkedWebOC = FALSE;
  283. }
  284. return hr;
  285. };
  286. STDMETHODIMP GetViewLinkedWebOCFrame(IDispatch** ppDisp)
  287. {
  288. ASSERT(_fIsViewLinkedWebOC);
  289. ASSERT(_pDispViewLinkedWebOCFrame);
  290. ASSERT(ppDisp);
  291. *ppDisp = _pDispViewLinkedWebOCFrame;
  292. _pDispViewLinkedWebOCFrame->AddRef();
  293. return S_OK;
  294. };
  295. STDMETHODIMP SetFrameName(BSTR bstrFrameName);
  296. // INotifyAppStart
  297. STDMETHODIMP AppStarting(void);
  298. STDMETHODIMP AppStarted(void);
  299. static BSTR GetHTMLWindowUrl(IHTMLWindow2 * pHTMLWindow);
  300. static LPITEMIDLIST PidlFromUrl(BSTR bstrUrl);
  301. protected:
  302. // "protected" so derived classes can construct/destruct us too
  303. CBaseBrowser2(IUnknown* punkAgg);
  304. virtual ~CBaseBrowser2();
  305. friend HRESULT CBaseBrowser2_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  306. // topmost CBaseBrowser2 in a frameset (IE3/AOL/CIS/VB)
  307. virtual void _OnNavigateComplete(LPCITEMIDLIST pidl, DWORD grfHLNF);
  308. virtual HRESULT _CheckZoneCrossing(LPCITEMIDLIST pidl);
  309. virtual STDMETHODIMP _PositionViewWindow(HWND hwnd, LPRECT prc);
  310. void _PositionViewWindowHelper(HWND hwnd, LPRECT prc);
  311. virtual LRESULT _DefWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  312. virtual void _ViewChange(DWORD dwAspect, LONG lindex);
  313. virtual void _UpdateBackForwardState();
  314. virtual BOOL v_OnSetCursor(LPARAM lParam);
  315. virtual STDMETHODIMP v_ShowHideChildWindows(BOOL fChildOnly);
  316. virtual void v_PropagateMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL fSend);
  317. virtual HRESULT _ShowBlankPage(LPCTSTR pszAboutUrl, LPCITEMIDLIST pidlIntended);
  318. // ViewStateStream related
  319. HRESULT _CheckInCacheIfOffline(LPCITEMIDLIST pidl, BOOL fIsAPost);
  320. void _CreateShortcutOnDesktop(IUnknown *pUnk, BOOL fUI);
  321. void _AddToFavorites(LPCITEMIDLIST pidl, LPCTSTR pszTitle, BOOL fDisplayUI);
  322. // to avoid having to pass hwnd on every message to WndProc, set it once
  323. void _SetWindow(HWND hwnd) { _bbd._hwnd = hwnd; }
  324. void _DoOptions(VARIANT* pvar);
  325. LRESULT _OnGoto(void);
  326. void _NavigateToPidlAsync(LPITEMIDLIST pidl, DWORD dwSBSP, BOOL fDontCallCancel = FALSE);
  327. BOOL _CanNavigate(void);
  328. // inline so that lego will get the right opt.
  329. void _PreActivatePendingViewAsync(void)
  330. {
  331. _StopAsyncOperation();
  332. };
  333. BOOL _ActivatePendingViewAsync(void);
  334. void _FreeQueuedPidl(LPITEMIDLIST* ppidl);
  335. void _StopAsyncOperation(void);
  336. void _MayUnblockAsyncOperation();
  337. BOOL _PostAsyncOperation(UINT uAction);
  338. LRESULT _SendAsyncOperation(UINT uAction);
  339. void _SendAsyncNavigationMsg(VARIANTARG *pvarargIn);
  340. HRESULT _OnCoCreateDocument(VARIANTARG *pvarargOut);
  341. void _NotifyCommandStateChange();
  342. BOOL _IsViewMSHTML(IShellView * psv);
  343. BOOL _ActivateView(BSTR bstrUrl,
  344. LPITEMIDLIST pidl,
  345. DWORD dwFlags,
  346. BOOL fIsErrorUrl);
  347. HRESULT _GetWebBrowserForEvt(IDispatch * pDispatch,
  348. IWebBrowser2 ** ppWebBrowser);
  349. void _Exec_psbMixedZone();
  350. #ifdef TEST_AMBIENTS
  351. BOOL _LocalOffline(int iCmd);
  352. BOOL _LocalSilent(int iCmd);
  353. #endif // TEST_AMBIENTS
  354. #define NAVTYPE_ShellNavigate 0x01
  355. #define NAVTYPE_PageIsChanging 0x02
  356. #define NAVTYPE_SiteIsChanging 0x04
  357. void _EnableStop(BOOL fEnable);
  358. LRESULT _OnInitMenuPopup(HMENU hmenuPopup, int nIndex, BOOL fSystemMenu);
  359. HRESULT _updateNavigationUI();
  360. HRESULT _setDescendentNavigate(VARIANTARG *pvarargIn);
  361. void _UpdateBrowserState(LPCITEMIDLIST pidl);
  362. void _UpdateDocHostState(LPITEMIDLIST pidl, BOOL fIsErrorUrl) const;
  363. HRESULT _FireBeforeNavigateEvent(LPCITEMIDLIST pidl, BOOL* pfUseCache);
  364. LPITEMIDLIST _GetPidlForDisplay(BSTR bstrUrl, BOOL * pfIsErrorUrl = NULL);
  365. HRESULT _OpenNewFrame(LPITEMIDLIST pidlNew, UINT wFlags);
  366. STDMETHODIMP _UIActivateView(UINT uState);
  367. HRESULT _CancelPendingNavigation(BOOL fDontReleaseState = FALSE);
  368. void _StopCurrentView(void);
  369. void _MayTrackClickStream(LPITEMIDLIST pidlThis); // (peihwal)
  370. STDMETHODIMP _OnFocusChange(UINT itb);
  371. void _RegisterAsDropTarget();
  372. void _UnregisterAsDropTarget();
  373. HRESULT _InitDocHost(IWebBrowser2 * pWebBrowser);
  374. enum BrowserPaletteType
  375. {
  376. BPT_DeferPaletteSupport = 0, // we don't think we own the palette
  377. BPT_UnknownDisplay, // need to decide if we need a palette
  378. BPT_DisplayViewChanged, // BPT_UnknownDisplay handling notify
  379. BPT_UnknownPalette, // need to decide what palette to use
  380. BPT_PaletteViewChanged, // BPT_UnknownPalette handling notify
  381. BPT_Normal, // handle WM_QUERYNEWPALETTE ourselves
  382. BPT_ShellView, // forward WM_QUERYNEWPALETTE to view
  383. BPT_NotPalettized // not a palettized display, do nothing
  384. };
  385. void _ColorsDirty(BrowserPaletteType bptNew);
  386. void _DisplayChanged(WPARAM wParam, LPARAM lParam);
  387. HRESULT _UpdateBrowserPaletteInPlace(LOGPALETTE *plp);
  388. void _RealizeBrowserPalette(BOOL fBackground);
  389. virtual void _PaletteChanged(WPARAM wParam, LPARAM lParam);
  390. BOOL _QueryNewPalette();
  391. void _DLMDestroy(void);
  392. void _DLMUpdate(MSOCMD* prgCmd);
  393. void _DLMRegister(IUnknown* punk);
  394. void CreateNewSyncShellView( void );
  395. void _UpdateTravelLog(BOOL fForceUpdate = FALSE);
  396. virtual BOOL _HeyMoe_IsWiseGuy(void) {return FALSE;}
  397. void _ShowIEHardNavWarning();
  398. BOOL _CanShowModalDialogNow();
  399. IBrowserService2* _pbsOuter;
  400. IBrowserService3* _pbsOuter3;
  401. IShellBrowser* _psbOuter;
  402. IServiceProvider* _pspOuter;
  403. IDockingWindowSite* _pdwsOuter;
  404. // The following are intercepted by CCommonBrowser, but we don't call 'em
  405. //IOleCommandTarget* _pctOuter;
  406. //IInputObjectSite* _piosOuter;
  407. BASEBROWSERDATA _bbd;
  408. IUnknown *_pauto;
  409. BrowserPaletteType _bptBrowser;
  410. HPALETTE _hpalBrowser;
  411. IViewObject *_pvo; // view object implementation on the shell view
  412. UINT _cRefUIActivateSV;
  413. DWORD _dwBrowserIndex;
  414. DWORD _dwReadyState;
  415. DWORD _dwReadyStateCur;
  416. LPWSTR _pszTitleCur;
  417. IDropTarget * _pdtView; // Pointer to _bbd._psv's IDropTarget interface
  418. IOleObject * _poleHistory;
  419. IStream * _pstmHistory;
  420. IBindCtx * _pbcHistory;
  421. IHTMLDocument2 * _pHTMLDocument;
  422. IPersistHistory * _pphHistory;
  423. IOleInPlaceActiveObject *_pact; // for UIWindow
  424. IClassFactory* _pcfHTML; // cached/locked class factory
  425. DWORD _dwReadyStatePending;
  426. LPWSTR _pszTitlePending;
  427. DWORD _grfHLNFPending;
  428. HDPA _hdpaDLM; // downloading object (for DLM)
  429. BOOL _cp; // current codepage
  430. //
  431. // NOTES: Currently, we support only one pending navigation.
  432. // If we want to support queued navigation, we need to turn
  433. // following two variables into a queue. (SatoNa)
  434. //
  435. DWORD _uActionQueued; // queued action
  436. LPITEMIDLIST _pidlQueued; // pidl to go asynchronously
  437. DWORD _dwSBSPQueued; // grfHLNF to go asynchronously
  438. UINT _cRefCannotNavigate; // Increment when we can navigate
  439. RECT _rcBorderDoc; // for UIWindow
  440. DWORD _dwStartingAppTick;
  441. BITBOOL _fDontResizeView : 1; // Don't resize _hwndView
  442. BITBOOL _fNavigate:1; // are we navigating?
  443. BITBOOL _fDescendentNavigate:1; // are our descendents navigating?
  444. BITBOOL _fDownloadSet:1; // did we invoke download animation ?
  445. BITBOOL _fNoDragDrop:1; // TRUE iff we want to register for drops
  446. BITBOOL _fRegisteredDragDrop:1; // TRUE iff we have registered for drops
  447. BITBOOL _fNavigatedToBlank: 1; // Has called _ShowBlankPage once.
  448. BITBOOL _fAsyncNavigate:1; // Ignore sync-hack-bug-fix
  449. BITBOOL _fPausedByParent :1; // Interaction paused by parent
  450. BITBOOL _fDontAddTravelEntry:1;
  451. BITBOOL _fIsLocalAnchor:1;
  452. BITBOOL _fGeneratedPage:1; // trident told us that the page is generated.
  453. BITBOOL _fOwnsPalette:1; // does the browser own the palette ? (did we get QueryNewPalette ..)
  454. BITBOOL _fUsesPaletteCommands : 1; // if we are using a separate communication with trident for palette commands
  455. BITBOOL _fCreateViewWindowPending:1;
  456. BITBOOL _fReleasingShellView:1;
  457. BITBOOL _fDeferredUIDeactivate:1;
  458. BITBOOL _fDeferredSelfDestruction:1;
  459. BITBOOL _fActive:1; // remember if the frame is active or not (WM_ACTIVATE)
  460. BITBOOL _fUIActivateOnActive:1; // TRUE iff we have a bending uiactivate
  461. BITBOOL _fInQueryStatus:1;
  462. BITBOOL _fCheckedDesktopComponentName:1;
  463. BITBOOL _fInDestroy:1; // being destroyed
  464. BITBOOL _fDontUpdateTravelLog:1;
  465. BITBOOL _fHtmlNavCanceled:1;
  466. BITBOOL _fDontShowNavCancelPage:1;
  467. BITBOOL _fHadBeforeNavigate :1;
  468. BITBOOL _fHadNavigateComplete :1;
  469. BITBOOL _fInvokeDefBrowserOnNewWindow:1;
  470. enum DOCFLAGS
  471. {
  472. DOCFLAG_DOCCANNAVIGATE = 0x00000001, // The document knows how to navigate
  473. DOCFLAG_NAVIGATEFROMDOC = 0x00000002, // Document called Navigate
  474. DOCFLAG_SETNAVIGATABLECODEPAGE = 0x00000004, // GetBindInfo should call NavigatableCodepage
  475. };
  476. DWORD _dwDocFlags;
  477. // for IDropTarget
  478. DWORD _dwDropEffect;
  479. #ifdef DEBUG
  480. BOOL _fProcessed_WM_CLOSE; // TRUE iff WM_CLOSE processed
  481. BOOL _fMightBeShuttingDown; // TRUE if we might be shutting down (recieved a WM_QUERYENDSESSION || (WM_ENDSESSION w/ wParam == TRUE))
  482. #endif
  483. // friend CIEFrameAuto;
  484. interface IShellHTMLWindowSupport *_phtmlWS;
  485. IUrlHistoryStg *_pIUrlHistoryStg; // pointer to url history storage object
  486. ITravelLogStg *_pITravelLogStg; // exposed travel log object
  487. ITargetFrame2 *_ptfrm;
  488. // Cached History IShellFolder
  489. IUnknown *_punkSFHistory;
  490. // what SSL icon to show
  491. int _eSecureLockIconPending;
  492. // Support for OLECMDID_HTTPEQUIV (Client Pull, PICS, etc)
  493. #ifdef NEVER
  494. HRESULT _HandleHttpEquiv (VARIANT *pvarargIn, VARIANT *pvarargOut, BOOL fDone);
  495. HRESULT _KillRefreshTimer( void );
  496. VOID _OnRefreshTimer(void);
  497. void _StartRefreshTimer(void);
  498. // equiv handlers we know about
  499. friend HRESULT _HandleRefresh (HWND hwnd, WCHAR *pwz, WCHAR *pwzColon, CBaseBrowser2 *pbb, BOOL fDone, LPARAM lParam);
  500. #endif
  501. #ifdef NEVER
  502. friend VOID CALLBACK _RefreshTimerProc (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
  503. // Client Pull values
  504. WCHAR *_pwzRefreshURL;
  505. int _iRefreshTimeout;
  506. BOOL _iRefreshTimeoutSet:1;
  507. INT_PTR _iRefreshTimerID;
  508. #endif
  509. #ifdef MESSAGEFILTER
  510. // COM Message filter used to help dispatch TIMER messages during OLE operations.
  511. LPMESSAGEFILTER _lpMF;
  512. #endif
  513. CUrlTrackingStg * _ptracking;
  514. CAutoImageResize *_pAIResize;
  515. // _fTopBrowser vs. _fNoTopLevelBrowser:
  516. // _fTopBrowser: True means we are the top most browser, or a top most browser does not exist and we are acting like the top most browser.
  517. // In the latter case, the immediate childern of our host will also act like top most browsers.
  518. // _fNoTopLevelBrowser: This means that the top most item isn't one of our shell browsers, so it's immediate browser child
  519. // will act like a top most browser.
  520. //
  521. // In normal cases, a shell browser (CShellBrowser, CDesktopBrowser, ...) is a top most browser
  522. // with TRUE==_fTopBrowser and FALSE==_fNoTopLevelBrowser. It can have subframes that will have
  523. // FALSE==_fTopBrowser and FALSE==_fNoTopLevelBrowser.
  524. //
  525. // The only time _fNoTopLevelBrowser is TRUE is if some other object (like Athena) hosts MSHTML directly
  526. // which will prevent some shell browser from being top most. Since the HTML can have several frames,
  527. // each will have TRUE==_fTopBrowser, so _fNoTopLevelBrowser will be set to TRUE to distinguish this case.
  528. BOOL _fTopBrowser :1; // Should only be set via the _SetTopBrowser method
  529. BOOL _fNoTopLevelBrowser :1; // TRUE iff the toplevel is a non-shell browser (Athena). Shell browsers include CDesktopBrowser, CShellBrowser, ...
  530. BOOL _fHaveOldStatusText :1;
  531. WCHAR _szwOldStatusText[MAX_PATH];
  532. FOLDERSETDATABASE _fldBase; // cache viewset results in here (used when navigating)
  533. // Manages extended toolbar buttons and tools menu extensions for IE
  534. IToolbarExt* _pToolbarExt;
  535. LPITEMIDLIST _pidlBeforeNavigateEvent; // pidl refered to in BeforeNavigate2 event
  536. // ViewLinkedWebOC variables
  537. BOOL _fIsViewLinkedWebOC; // TRUE if an instance of the WebOC is a ViewLinked
  538. IWebBrowser2* _pDispViewLinkedWebOCFrame; // The pDisp of the Frame of a ViewLinkedWebOC.
  539. BOOL _fHadFirstBeforeNavigate; // TRUE if we have already skipped over the first ViewLinkedWebOC's
  540. // BeforeNavigateEvent.
  541. TCHAR _szViewLinkedWebOCFrameName[INTERNET_MAX_URL_LENGTH+1];
  542. public:
  543. // handling for plugUI shutdown
  544. // need the hwnd for the lang change modal property sheet
  545. static HDPA s_hdpaOptionsHwnd;
  546. static void _SyncDPA();
  547. static int CALLBACK _OptionsPropSheetCallback(HWND hwndDlg, UINT uMsg, LPARAM lParam);
  548. private:
  549. HRESULT _AddFolderOptionsSheets(DWORD dwReserved, LPFNADDPROPSHEETPAGE pfnAddPropSheetPage, LPPROPSHEETHEADER ppsh);
  550. HRESULT _AddInternetOptionsSheets(DWORD dwReserved, LPFNADDPROPSHEETPAGE pfnAddPropSheetPage, LPPROPSHEETHEADER ppsh);
  551. HRESULT _ReplaceWithGoHome(LPCITEMIDLIST * ppidl, LPITEMIDLIST * ppidlFree);
  552. // this is private! it should only be called by _NavigateToPidl
  553. HRESULT _CreateNewShellViewPidl(LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD fSBSP);
  554. HRESULT _CreateNewShellView(IShellFolder* psf, LPCITEMIDLIST pidl, DWORD grfHLNF);
  555. HRESULT _DismissFindDialog();
  556. // Privacy state
  557. HRESULT _UpdatePrivacyIcon(BOOL fSetNewState, BOOL fNewState);
  558. };
  559. HRESULT _DisplayParseError(HWND hwnd, HRESULT hres, LPCWSTR pwszPath);
  560. #endif // _BASESB2_H