34#ifndef DISPID_BEFORENAVIGATE
35#define DISPID_BEFORENAVIGATE 100
36#define DISPID_NAVIGATECOMPLETE 101
37#define DISPID_STATUSTEXTCHANGE 102
38#define DISPID_QUIT 103
39#define DISPID_DOWNLOADCOMPLETE 104
40#define DISPID_COMMANDSTATECHANGE 105
41#define DISPID_DOWNLOADBEGIN 106
42#define DISPID_NEWWINDOW 107
43#define DISPID_PROGRESSCHANGE 108
44#define DISPID_WINDOWMOVE 109
45#define DISPID_WINDOWRESIZE 110
46#define DISPID_WINDOWACTIVATE 111
47#define DISPID_PROPERTYCHANGE 112
48#define DISPID_TITLECHANGE 113
49#define DISPID_TITLEICONCHANGE 114
50#define DISPID_FRAMEBEFORENAVIGATE 200
51#define DISPID_FRAMENAVIGATECOMPLETE 201
52#define DISPID_FRAMENEWWINDOW 204
54#define DISPID_NAVIGATECOMPLETE2 252
55#define DISPID_ONQUIT 253
56#define DISPID_ONVISIBLE 254
57#define DISPID_ONTOOLBAR 255
58#define DISPID_ONMENUBAR 256
59#define DISPID_ONSTATUSBAR 257
60#define DISPID_ONFULLSCREEN 258
61#define DISPID_DOCUMENTCOMPLETE 259
62#define DISPID_ONTHEATERMODE 260
63#define DISPID_ONADDRESSBAR 261
64#define DISPID_WINDOWSETRESIZABLE 262
65#define DISPID_WINDOWCLOSING 263
66#define DISPID_WINDOWSETLEFT 264
67#define DISPID_WINDOWSETTOP 265
68#define DISPID_WINDOWSETWIDTH 266
69#define DISPID_WINDOWSETHEIGHT 267
70#define DISPID_CLIENTTOHOSTWINDOW 268
71#define DISPID_SETSECURELOCKICON 269
72#define DISPID_FILEDOWNLOAD 270
73#define DISPID_NAVIGATEERROR 271
74#define DISPID_PRIVACYIMPACTEDSTATECHANGE 272
78#define V_INT(x) V_UNION(x, intVal)
82#pragma warning(disable: 4355)
269 LPOLEINPLACEFRAMEINFO lpFrameInfo)
276 *lprcClipRect =
rect;
278 assert(lpFrameInfo->cb>=
sizeof(OLEINPLACEFRAMEINFO));
279 lpFrameInfo->fMDIApp =
FALSE;
280 lpFrameInfo->hwndFrame = 0;
281 lpFrameInfo->haccel = 0;
282 lpFrameInfo->cAccelEntries = 0;
435 const Variant& targetFrameName,
const Variant& postData,
510 void attach(IWebBrowser* browser);
512 void set_html_page(
const String& html_txt);
526interface FixedDWebBrowserEvents2 :
public IDispatch
529 virtual ~FixedDWebBrowserEvents2() {}
544 :
super(DIID_DWebBrowserEvents2),
545 _navigator(navigator)
576 switch(dispIdMember) {
582 _callback->
CommandStateChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
590 _callback->
ProgressChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
610 _callback->
TitleChange((BStr)Variant(pDispParams->rgvarg[0]));
621 if (pDispParams->cArgs != 6)
626 (BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
627 (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
628 (BStr)Variant(&pDispParams->rgvarg[1]), *
V_BOOLREF(&pDispParams->rgvarg[0]));
632 if (pDispParams->cArgs != 1)
638 if (pDispParams->cArgs != 6)
642 _callback->
FrameNewWindow((BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
643 (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
644 (BStr)Variant(&pDispParams->rgvarg[1]), *
V_BOOLREF(&pDispParams->rgvarg[0]));
648 if (pDispParams->cArgs != 7)
653 pDispParams->rgvarg[5], &pDispParams->rgvarg[4],
654 pDispParams->rgvarg[3], &pDispParams->rgvarg[2],
655 pDispParams->rgvarg[1], *
V_BOOLREF(&pDispParams->rgvarg[0]));
659 if (pDispParams->cArgs != 2)
669 if (pDispParams->cArgs != 2)
673 NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
675 _callback->
NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
683 if (pDispParams->cArgs != 1)
685 _callback->
OnVisible(Variant(pDispParams->rgvarg[0]));
689 if (pDispParams->cArgs != 1)
691 _callback->
OnToolbar(Variant(pDispParams->rgvarg[0]));
695 if (pDispParams->cArgs != 1)
697 _callback->
OnMenubar(Variant(pDispParams->rgvarg[0]));
701 if (pDispParams->cArgs != 1)
703 _callback->
OnStatusbar(Variant(pDispParams->rgvarg[0]));
707 if (pDispParams->cArgs != 1)
709 _callback->
OnFullscreen(Variant(pDispParams->rgvarg[0]));
721 if (pDispParams->cArgs != 1)
727 if (pDispParams->cArgs != 1)
729 _callback->
OnAddressbar(Variant(pDispParams->rgvarg[0]));
733 if (pDispParams->cArgs != 1)
739 if (pDispParams->cArgs != 2)
747 if (pDispParams->cArgs != 1)
753 if (pDispParams->cArgs != 1)
755 _callback->
WindowSetTop(Variant(pDispParams->rgvarg[0]));
759 if (pDispParams->cArgs != 1)
765 if (pDispParams->cArgs != 1)
773 if (pDispParams->cArgs != 2)
786 if (pDispParams->cArgs != 1)
792 if (pDispParams->cArgs != 1)
794 Variant
var(pDispParams->rgvarg[0]);
799 if (pDispParams->cArgs != 5)
803 _callback->
NavigateError(Variant(pDispParams->rgvarg[4]), Variant(pDispParams->rgvarg[3]),
804 Variant(pDispParams->rgvarg[2]), Variant(pDispParams->rgvarg[1]),
809 if (pDispParams->cArgs != 1)
854 const Variant& targetFrameName,
const Variant& postData,
#define STDMETHODCALLTYPE
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
#define DISPID_BEFORENAVIGATE2
#define DISPID_NEWWINDOW2
#define CLASSNAME_CHILDWND
GLsizei GLenum GLboolean sink
HRESULT FindConnectionPoint([in] REFIID riid, [out] IConnectionPoint **ppCP)
HRESULT Unadvise([in] DWORD dwCookie)
HRESULT Advise([in] IUnknown *pUnkSink, [out] DWORD *pdwCookie)
HRESULT SetObjectRects([in] LPCRECT lprcPosRect, [in] LPCRECT lprcClipRect)
HRESULT SetClientSite([in, unique] IOleClientSite *pClientSite)
HRESULT Close([in] DWORD dwSaveOption)
HRESULT DoVerb([in] LONG iVerb, [in, unique] LPMSG lpmsg, [in, unique] IOleClientSite *pActiveSite, [in] LONG lindex, [in] HWND hwndParent, [in, unique] LPCRECT lprcPosRect)
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
static VARIANTARG static DISPID
static unsigned int progressMax
#define OLEIVERB_INPLACEACTIVATE
const GUID IID_IOleInPlaceSite
const GUID IID_IConnectionPointContainer
const GUID IID_IOleClientSite
const GUID IID_IOleInPlaceObject
const GUID IID_IOleObject
_Out_opt_ int _Out_opt_ int * cy
#define IsEqualIID(riid1, riid2)
vector< Header * > headers
void CheckError(HRESULT hr)
SIfacePtr< IWebBrowser > _browser
IWebBrowser * get_browser()
bool _browser_initialized
void navigated(LPCTSTR url)
void set_url(LPCTSTR url)
static ChildWindow * create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
ConnectionPoint(IConnectionPointContainer *pCPC, REFIID riid)
virtual void ClientToHostWindow(long &CX, long &CY)
virtual void DownloadBegin()
virtual void WindowMove()
virtual void OnVisible(bool Visible)
virtual void FrameNewWindow(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed)
virtual void TitleIconChange(const BStr &text)
virtual void FrameNavigateComplete(const BStr &url)
virtual void ProgressChange(long progress, long progressMax)
virtual void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel)
virtual void OnStatusbar(bool Visible)
virtual void OnToolbar(bool Visible)
virtual void FrameBeforeNavigate(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel)
virtual void WindowSetHeight(long Height)
virtual void PropertyChange(const BStr &property)
virtual void BeforeNavigate2(IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel)
virtual void WindowActivate()
virtual void NewWindow2(IDispatch **ppDisp, VARIANT_BOOL &cancel)
virtual void WindowSetLeft(long Left)
virtual void DownloadComplete()
virtual void OnMenubar(bool Visible)
virtual void DocumentComplete()
virtual void FileDownload(Variant &cancel)
virtual void NavigateError(IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel)
virtual void OnAddressbar(bool Visible)
virtual void TitleChange(const BStr &text)
virtual void NavigateComplete2(IDispatch *pDisp, const Variant &url)
virtual void PrivacyImpactedStateChange(bool bImpacted)
virtual void WindowSetWidth(long Width)
virtual void CommandStateChange(long command, bool enable)
virtual void WindowResize()
virtual void WindowSetResizable(bool Visible)
virtual void OnFullscreen(bool Visible)
virtual void OnTheatermode(bool Visible)
virtual ~DWebBrowserEvents2IF()
virtual void SetSecureLockIcon(long SecureLockIcon)
virtual void StatusTextChange(const BStr &text)
virtual void WindowSetTop(long Top)
DWebBrowserEvents2IF * _callback
BrowserNavigator & _navigator
void NavigateComplete2(IDispatch *pDisp, const Variant &url)
IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > super
DWebBrowserEvents2Impl(BrowserNavigator &navigator)
EventConnection(IConnectionPoint *connectionpoint, IUnknown *sink)
EventConnection(T &connectionpoint, IUnknown *sink)
SIfacePtr< IConnectionPoint > _connectionpoint
EventConnector(IUnknown *unknown, REFIID riid, IUnknown *sink)
information structure for creation of FileChildWindow
OleInPlaceClient _client_side
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
IPCtrlWindow(HWND hwnd, T &info)
HRESULT create_control(HWND hwnd, REFIID clsid, REFIID riid)
SIfacePtr< IOleInPlaceObject > _in_place_object
virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate()
virtual HRESULT STDMETHODCALLTYPE GetContainer(IOleContainer __RPC_FAR *__RPC_FAR *ppContainer)
virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate()
STDMETHODIMP_(ULONG) AddRef()
virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout()
virtual HRESULT STDMETHODCALLTYPE ShowObject()
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo()
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND __RPC_FAR *phwnd)
virtual HRESULT STDMETHODCALLTYPE OnShowWindow(BOOL fShow)
virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate()
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv)
OleInPlaceClient(HWND hwnd=0)
virtual HRESULT STDMETHODCALLTYPE GetWindowContext(IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
virtual HRESULT STDMETHODCALLTYPE SaveObject()
HRESULT detach(IOleObject *ole_obj, DWORD dwSaveOption=OLECLOSE_SAVEIFDIRTY)
STDMETHODIMP_(ULONG) Release()
virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(BOOL fUndoable)
virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(LPCRECT lprcPosRect)
virtual HRESULT STDMETHODCALLTYPE OnUIActivate()
virtual HRESULT STDMETHODCALLTYPE Scroll(SIZE scrollExtant)
virtual HRESULT STDMETHODCALLTYPE GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker __RPC_FAR *__RPC_FAR *ppmk)
virtual HRESULT STDMETHODCALLTYPE DiscardUndoState()
HRESULT attach_control(IOleObject *ole_obj, LONG iVerb=OLEIVERB_INPLACEACTIVATE, HWND hwndParent=0, LPCRECT pRect=NULL)
wrapper class for COM interface pointers
encapsulation of Web control in MDI child windows
void CommandStateChange(long command, bool enable)
void StatusTextChange(const BStr &text)
void WindowSetTop(long Top)
IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > super
void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel)
void OnTheatermode(bool Visible)
void BeforeNavigate2(IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel)
void FileDownload(Variant &cancel)
void ProgressChange(long Progress, long ProgressMax)
void OnStatusbar(bool Visible)
void PrivacyImpactedStateChange(bool bImpacted)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
void WindowSetWidth(long Width)
virtual String jump_to_int(LPCTSTR url)
BrowserNavigator _navigator
void OnAddressbar(bool Visible)
void ClientToHostWindow(long &CX, long &CY)
void FrameNewWindow(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed)
void SetSecureLockIcon(long SecureLockIcon)
void OnMenubar(bool Visible)
DWebBrowserEvents2Impl web_super
void PropertyChange(const BStr &Property)
void TitleIconChange(const BStr &text)
void FrameNavigateComplete(const BStr &url)
void FrameBeforeNavigate(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel)
void NavigateComplete2(IDispatch *pDisp, const Variant &url)
void OnFullscreen(bool Visible)
void TitleChange(const BStr &text)
void WindowSetHeight(long Height)
static WebChildWindow * create(const FileChildWndInfo &info)
void OnToolbar(bool Visible)
void WindowSetResizable(bool Visible)
void OnVisible(bool Visible)
void NewWindow2(IDispatch **ppDisp, VARIANT_BOOL &cancel)
void WindowSetLeft(long Left)
auto_ptr< EventConnector > _connector
void NavigateError(IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel)
information structure for creation of WebChildWindow
static int processed(const type_t *type)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
#define DISPID_ONSTATUSBAR
#define DISPID_ONADDRESSBAR
#define DISPID_WINDOWSETRESIZABLE
#define DISPID_SETSECURELOCKICON
#define DISPID_PRIVACYIMPACTEDSTATECHANGE
#define DISPID_WINDOWACTIVATE
#define DISPID_ONFULLSCREEN
#define DISPID_WINDOWRESIZE
#define DISPID_TITLEICONCHANGE
#define DISPID_NAVIGATECOMPLETE2
#define DISPID_FILEDOWNLOAD
#define DISPID_FRAMENAVIGATECOMPLETE
#define DISPID_CLIENTTOHOSTWINDOW
#define DISPID_TITLECHANGE
#define DISPID_COMMANDSTATECHANGE
#define DISPID_WINDOWSETLEFT
#define DISPID_NAVIGATEERROR
#define DISPID_WINDOWSETWIDTH
#define DISPID_DOWNLOADCOMPLETE
#define DISPID_PROGRESSCHANGE
#define DISPID_WINDOWCLOSING
#define DISPID_FRAMEBEFORENAVIGATE
#define DISPID_DOWNLOADBEGIN
#define DISPID_FRAMENEWWINDOW
#define DISPID_WINDOWSETHEIGHT
#define DISPID_STATUSTEXTCHANGE
#define DISPID_DOCUMENTCOMPLETE
#define DISPID_WINDOWSETTOP
#define DISPID_ONTHEATERMODE
#define DISPID_PROPERTYCHANGE
#define DISPID_WINDOWMOVE
_In_ DWORD _Out_ _In_ WORD wFlags