2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
38 #include "mshtml_private.h"
39 #include "htmlevent.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
47 } download_proc_task_t
;
49 static BOOL
use_gecko_script(LPCWSTR url
)
51 static const WCHAR fileW
[] = {'f','i','l','e',':'};
52 static const WCHAR aboutW
[] = {'a','b','o','u','t',':'};
53 static const WCHAR resW
[] = {'r','e','s',':'};
55 return strncmpiW(fileW
, url
, sizeof(fileW
)/sizeof(WCHAR
))
56 && strncmpiW(aboutW
, url
, sizeof(aboutW
)/sizeof(WCHAR
))
57 && strncmpiW(resW
, url
, sizeof(resW
)/sizeof(WCHAR
));
60 void set_current_mon(HTMLWindow
*This
, IMoniker
*mon
)
65 IMoniker_Release(This
->mon
);
70 CoTaskMemFree(This
->url
);
80 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &This
->url
);
82 WARN("GetDisplayName failed: %08x\n", hres
);
84 set_script_mode(This
, use_gecko_script(This
->url
) ? SCRIPTMODE_GECKO
: SCRIPTMODE_ACTIVESCRIPT
);
87 static void set_progress_proc(task_t
*_task
)
89 docobj_task_t
*task
= (docobj_task_t
*)_task
;
90 IOleCommandTarget
*olecmd
= NULL
;
91 HTMLDocumentObj
*doc
= task
->doc
;
97 IOleClientSite_QueryInterface(doc
->client
, &IID_IOleCommandTarget
, (void**)&olecmd
);
100 VARIANT progress_max
, progress
;
102 V_VT(&progress_max
) = VT_I4
;
103 V_I4(&progress_max
) = 0; /* FIXME */
104 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETPROGRESSMAX
, OLECMDEXECOPT_DONTPROMPTUSER
,
105 &progress_max
, NULL
);
107 V_VT(&progress
) = VT_I4
;
108 V_I4(&progress
) = 0; /* FIXME */
109 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETPROGRESSPOS
, OLECMDEXECOPT_DONTPROMPTUSER
,
111 IOleCommandTarget_Release(olecmd
);
114 if(doc
->usermode
== EDITMODE
&& doc
->hostui
) {
115 DOCHOSTUIINFO hostinfo
;
117 memset(&hostinfo
, 0, sizeof(DOCHOSTUIINFO
));
118 hostinfo
.cbSize
= sizeof(DOCHOSTUIINFO
);
119 hres
= IDocHostUIHandler_GetHostInfo(doc
->hostui
, &hostinfo
);
121 /* FIXME: use hostinfo */
122 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
123 hostinfo
.cbSize
, hostinfo
.dwFlags
, hostinfo
.dwDoubleClick
,
124 debugstr_w(hostinfo
.pchHostCss
), debugstr_w(hostinfo
.pchHostNS
));
128 static void set_downloading_proc(task_t
*_task
)
130 download_proc_task_t
*task
= (download_proc_task_t
*)_task
;
131 HTMLDocumentObj
*doc
= task
->doc
;
132 IOleCommandTarget
*olecmd
;
135 TRACE("(%p)\n", doc
);
138 IOleInPlaceFrame_SetStatusText(doc
->frame
, NULL
/* FIXME */);
143 if(task
->set_download
) {
144 hres
= IOleClientSite_QueryInterface(doc
->client
, &IID_IOleCommandTarget
, (void**)&olecmd
);
145 if(SUCCEEDED(hres
)) {
151 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETDOWNLOADSTATE
,
152 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
153 IOleCommandTarget_Release(olecmd
);
156 doc
->download_state
= 1;
160 IAdviseSink_OnViewChange(doc
->view_sink
, DVASPECT_CONTENT
, -1);
163 IDropTarget
*drop_target
= NULL
;
165 hres
= IDocHostUIHandler_GetDropTarget(doc
->hostui
, NULL
/* FIXME */, &drop_target
);
167 FIXME("Use IDropTarget\n");
168 IDropTarget_Release(drop_target
);
173 HRESULT
set_moniker(HTMLDocument
*This
, IMoniker
*mon
, IBindCtx
*pibc
, nsChannelBSC
*async_bsc
, BOOL set_download
)
175 nsChannelBSC
*bscallback
;
177 download_proc_task_t
*download_task
;
182 hres
= IMoniker_GetDisplayName(mon
, pibc
, NULL
, &url
);
184 WARN("GetDiaplayName failed: %08x\n", hres
);
188 TRACE("got url: %s\n", debugstr_w(url
));
190 if(This
->doc_obj
->client
) {
191 VARIANT silent
, offline
;
193 hres
= get_client_disp_property(This
->doc_obj
->client
, DISPID_AMBIENT_SILENT
, &silent
);
194 if(SUCCEEDED(hres
)) {
195 if(V_VT(&silent
) != VT_BOOL
)
196 WARN("V_VT(silent) = %d\n", V_VT(&silent
));
197 else if(V_BOOL(&silent
))
198 FIXME("silent == true\n");
201 hres
= get_client_disp_property(This
->doc_obj
->client
,
202 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
, &offline
);
203 if(SUCCEEDED(hres
)) {
204 if(V_VT(&silent
) != VT_BOOL
)
205 WARN("V_VT(offline) = %d\n", V_VT(&silent
));
206 else if(V_BOOL(&silent
))
207 FIXME("offline == true\n");
211 if(This
->window
->mon
) {
212 update_doc(This
, UPDATE_TITLE
|UPDATE_UI
);
214 update_doc(This
, UPDATE_TITLE
);
215 set_current_mon(This
->window
, mon
);
218 set_ready_state(This
->window
, READYSTATE_LOADING
);
220 if(This
->doc_obj
->client
) {
221 IOleCommandTarget
*cmdtrg
= NULL
;
223 hres
= IOleClientSite_QueryInterface(This
->doc_obj
->client
, &IID_IOleCommandTarget
,
225 if(SUCCEEDED(hres
)) {
231 IOleCommandTarget_Exec(cmdtrg
, &CGID_ShellDocView
, 37, 0, &var
, NULL
);
233 V_VT(&var
) = VT_UNKNOWN
;
234 V_UNKNOWN(&var
) = (IUnknown
*)HTMLWINDOW2(This
->window
);
235 V_VT(&out
) = VT_EMPTY
;
236 hres
= IOleCommandTarget_Exec(cmdtrg
, &CGID_ShellDocView
, 63, 0, &var
, &out
);
241 IOleCommandTarget_Release(cmdtrg
);
245 hres
= create_doc_uri(This
->window
, url
, &nsuri
);
251 bscallback
= async_bsc
;
253 hres
= create_channelbsc(mon
, NULL
, NULL
, 0, &bscallback
);
258 hres
= load_nsuri(This
->window
, nsuri
, bscallback
, LOAD_INITIAL_DOCUMENT_URI
);
259 nsISupports_Release((nsISupports
*)nsuri
); /* FIXME */
261 set_window_bscallback(This
->window
, bscallback
);
262 if(bscallback
!= async_bsc
)
263 IUnknown_Release((IUnknown
*)bscallback
);
267 HTMLDocument_LockContainer(This
->doc_obj
, TRUE
);
269 if(This
->doc_obj
->frame
) {
270 task
= heap_alloc(sizeof(docobj_task_t
));
271 task
->doc
= This
->doc_obj
;
272 push_task(&task
->header
, set_progress_proc
, This
->doc_obj
->basedoc
.task_magic
);
275 download_task
= heap_alloc(sizeof(download_proc_task_t
));
276 download_task
->doc
= This
->doc_obj
;
277 download_task
->set_download
= set_download
;
278 push_task(&download_task
->header
, set_downloading_proc
, This
->doc_obj
->basedoc
.task_magic
);
283 void set_ready_state(HTMLWindow
*window
, READYSTATE readystate
)
285 window
->readystate
= readystate
;
287 if(window
->doc_obj
&& window
->doc_obj
->basedoc
.window
== window
)
288 call_property_onchanged(&window
->doc_obj
->basedoc
.cp_propnotif
, DISPID_READYSTATE
);
290 fire_event(window
->doc
, EVENTID_READYSTATECHANGE
, FALSE
, window
->doc
->node
.nsnode
, NULL
);
292 if(window
->frame_element
)
293 fire_event(window
->frame_element
->element
.node
.doc
, EVENTID_READYSTATECHANGE
,
294 TRUE
, window
->frame_element
->element
.node
.nsnode
, NULL
);
297 static HRESULT
get_doc_string(HTMLDocumentNode
*This
, char **str
)
305 WARN("NULL nsdoc\n");
309 nsres
= nsIDOMHTMLDocument_QueryInterface(This
->nsdoc
, &IID_nsIDOMNode
, (void**)&nsnode
);
310 if(NS_FAILED(nsres
)) {
311 ERR("Could not get nsIDOMNode failed: %08x\n", nsres
);
315 nsAString_Init(&nsstr
, NULL
);
316 nsnode_to_nsstring(nsnode
, &nsstr
);
317 nsIDOMNode_Release(nsnode
);
319 nsAString_GetData(&nsstr
, &strw
);
320 TRACE("%s\n", debugstr_w(strw
));
322 *str
= heap_strdupWtoA(strw
);
324 nsAString_Finish(&nsstr
);
330 /**********************************************************
331 * IPersistMoniker implementation
334 #define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
336 static HRESULT WINAPI
PersistMoniker_QueryInterface(IPersistMoniker
*iface
, REFIID riid
,
339 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
340 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
343 static ULONG WINAPI
PersistMoniker_AddRef(IPersistMoniker
*iface
)
345 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
346 return IHTMLDocument2_AddRef(HTMLDOC(This
));
349 static ULONG WINAPI
PersistMoniker_Release(IPersistMoniker
*iface
)
351 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
352 return IHTMLDocument2_Release(HTMLDOC(This
));
355 static HRESULT WINAPI
PersistMoniker_GetClassID(IPersistMoniker
*iface
, CLSID
*pClassID
)
357 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
358 return IPersist_GetClassID(PERSIST(This
), pClassID
);
361 static HRESULT WINAPI
PersistMoniker_IsDirty(IPersistMoniker
*iface
)
363 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
365 TRACE("(%p)\n", This
);
367 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
370 static HRESULT WINAPI
PersistMoniker_Load(IPersistMoniker
*iface
, BOOL fFullyAvailable
,
371 IMoniker
*pimkName
, LPBC pibc
, DWORD grfMode
)
373 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
376 TRACE("(%p)->(%x %p %p %08x)\n", This
, fFullyAvailable
, pimkName
, pibc
, grfMode
);
379 IUnknown
*unk
= NULL
;
383 * "__PrecreatedObject"
384 * "BIND_CONTEXT_PARAM"
385 * "__HTMLLOADOPTIONS"
388 * "_ITransData_Object_"
392 IBindCtx_GetObjectParam(pibc
, (LPOLESTR
)SZ_HTML_CLIENTSITE_OBJECTPARAM
, &unk
);
394 IOleClientSite
*client
= NULL
;
396 hres
= IUnknown_QueryInterface(unk
, &IID_IOleClientSite
, (void**)&client
);
397 if(SUCCEEDED(hres
)) {
398 TRACE("Got client site %p\n", client
);
399 IOleObject_SetClientSite(OLEOBJ(This
), client
);
400 IOleClientSite_Release(client
);
403 IUnknown_Release(unk
);
407 hres
= set_moniker(This
, pimkName
, pibc
, NULL
, TRUE
);
411 return start_binding(This
->window
, NULL
, (BSCallback
*)This
->window
->bscallback
, pibc
);
414 static HRESULT WINAPI
PersistMoniker_Save(IPersistMoniker
*iface
, IMoniker
*pimkName
,
415 LPBC pbc
, BOOL fRemember
)
417 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
418 FIXME("(%p)->(%p %p %x)\n", This
, pimkName
, pbc
, fRemember
);
422 static HRESULT WINAPI
PersistMoniker_SaveCompleted(IPersistMoniker
*iface
, IMoniker
*pimkName
, LPBC pibc
)
424 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
425 FIXME("(%p)->(%p %p)\n", This
, pimkName
, pibc
);
429 static HRESULT WINAPI
PersistMoniker_GetCurMoniker(IPersistMoniker
*iface
, IMoniker
**ppimkName
)
431 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
433 TRACE("(%p)->(%p)\n", This
, ppimkName
);
435 if(!This
->window
|| !This
->window
->mon
)
438 IMoniker_AddRef(This
->window
->mon
);
439 *ppimkName
= This
->window
->mon
;
443 static const IPersistMonikerVtbl PersistMonikerVtbl
= {
444 PersistMoniker_QueryInterface
,
445 PersistMoniker_AddRef
,
446 PersistMoniker_Release
,
447 PersistMoniker_GetClassID
,
448 PersistMoniker_IsDirty
,
451 PersistMoniker_SaveCompleted
,
452 PersistMoniker_GetCurMoniker
455 /**********************************************************
456 * IMonikerProp implementation
459 #define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
461 static HRESULT WINAPI
MonikerProp_QueryInterface(IMonikerProp
*iface
, REFIID riid
, void **ppvObject
)
463 HTMLDocument
*This
= MONPROP_THIS(iface
);
464 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
467 static ULONG WINAPI
MonikerProp_AddRef(IMonikerProp
*iface
)
469 HTMLDocument
*This
= MONPROP_THIS(iface
);
470 return IHTMLDocument2_AddRef(HTMLDOC(This
));
473 static ULONG WINAPI
MonikerProp_Release(IMonikerProp
*iface
)
475 HTMLDocument
*This
= MONPROP_THIS(iface
);
476 return IHTMLDocument_Release(HTMLDOC(This
));
479 static HRESULT WINAPI
MonikerProp_PutProperty(IMonikerProp
*iface
, MONIKERPROPERTY mkp
, LPCWSTR val
)
481 HTMLDocument
*This
= MONPROP_THIS(iface
);
483 TRACE("(%p)->(%d %s)\n", This
, mkp
, debugstr_w(val
));
487 heap_free(This
->doc_obj
->mime
);
488 This
->doc_obj
->mime
= heap_strdupW(val
);
495 FIXME("mkp %d\n", mkp
);
502 static const IMonikerPropVtbl MonikerPropVtbl
= {
503 MonikerProp_QueryInterface
,
506 MonikerProp_PutProperty
509 /**********************************************************
510 * IPersistFile implementation
513 #define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
515 static HRESULT WINAPI
PersistFile_QueryInterface(IPersistFile
*iface
, REFIID riid
, void **ppvObject
)
517 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
518 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
521 static ULONG WINAPI
PersistFile_AddRef(IPersistFile
*iface
)
523 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
524 return IHTMLDocument2_AddRef(HTMLDOC(This
));
527 static ULONG WINAPI
PersistFile_Release(IPersistFile
*iface
)
529 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
530 return IHTMLDocument2_Release(HTMLDOC(This
));
533 static HRESULT WINAPI
PersistFile_GetClassID(IPersistFile
*iface
, CLSID
*pClassID
)
535 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
537 TRACE("(%p)->(%p)\n", This
, pClassID
);
542 *pClassID
= CLSID_HTMLDocument
;
546 static HRESULT WINAPI
PersistFile_IsDirty(IPersistFile
*iface
)
548 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
550 TRACE("(%p)\n", This
);
552 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
555 static HRESULT WINAPI
PersistFile_Load(IPersistFile
*iface
, LPCOLESTR pszFileName
, DWORD dwMode
)
557 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
558 FIXME("(%p)->(%s %08x)\n", This
, debugstr_w(pszFileName
), dwMode
);
562 static HRESULT WINAPI
PersistFile_Save(IPersistFile
*iface
, LPCOLESTR pszFileName
, BOOL fRemember
)
564 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
570 TRACE("(%p)->(%s %x)\n", This
, debugstr_w(pszFileName
), fRemember
);
572 file
= CreateFileW(pszFileName
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
,
573 FILE_ATTRIBUTE_NORMAL
, NULL
);
574 if(file
== INVALID_HANDLE_VALUE
) {
575 WARN("Could not create file: %u\n", GetLastError());
579 hres
= get_doc_string(This
->doc_node
, &str
);
581 WriteFile(file
, str
, strlen(str
), &written
, NULL
);
587 static HRESULT WINAPI
PersistFile_SaveCompleted(IPersistFile
*iface
, LPCOLESTR pszFileName
)
589 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
590 FIXME("(%p)->(%s)\n", This
, debugstr_w(pszFileName
));
594 static HRESULT WINAPI
PersistFile_GetCurFile(IPersistFile
*iface
, LPOLESTR
*pszFileName
)
596 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
597 FIXME("(%p)->(%p)\n", This
, pszFileName
);
601 static const IPersistFileVtbl PersistFileVtbl
= {
602 PersistFile_QueryInterface
,
605 PersistFile_GetClassID
,
609 PersistFile_SaveCompleted
,
610 PersistFile_GetCurFile
613 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
615 static HRESULT WINAPI
PersistStreamInit_QueryInterface(IPersistStreamInit
*iface
,
616 REFIID riid
, void **ppv
)
618 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
619 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
622 static ULONG WINAPI
PersistStreamInit_AddRef(IPersistStreamInit
*iface
)
624 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
625 return IHTMLDocument2_AddRef(HTMLDOC(This
));
628 static ULONG WINAPI
PersistStreamInit_Release(IPersistStreamInit
*iface
)
630 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
631 return IHTMLDocument2_Release(HTMLDOC(This
));
634 static HRESULT WINAPI
PersistStreamInit_GetClassID(IPersistStreamInit
*iface
, CLSID
*pClassID
)
636 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
637 return IPersist_GetClassID(PERSIST(This
), pClassID
);
640 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
642 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
644 TRACE("(%p)\n", This
);
646 if(This
->doc_obj
->usermode
== EDITMODE
)
647 return editor_is_dirty(This
);
652 static HRESULT WINAPI
PersistStreamInit_Load(IPersistStreamInit
*iface
, LPSTREAM pStm
)
654 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
658 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
660 TRACE("(%p)->(%p)\n", This
, pStm
);
662 hres
= CreateURLMoniker(NULL
, about_blankW
, &mon
);
664 WARN("CreateURLMoniker failed: %08x\n", hres
);
668 hres
= set_moniker(This
, mon
, NULL
, NULL
, TRUE
);
669 IMoniker_Release(mon
);
673 return channelbsc_load_stream(This
->window
->bscallback
, pStm
);
676 static HRESULT WINAPI
PersistStreamInit_Save(IPersistStreamInit
*iface
, LPSTREAM pStm
,
679 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
684 TRACE("(%p)->(%p %x)\n", This
, pStm
, fClearDirty
);
686 hres
= get_doc_string(This
->doc_node
, &str
);
690 hres
= IStream_Write(pStm
, str
, strlen(str
), &written
);
692 FIXME("Write failed: %08x\n", hres
);
697 set_dirty(This
, VARIANT_FALSE
);
702 static HRESULT WINAPI
PersistStreamInit_GetSizeMax(IPersistStreamInit
*iface
,
703 ULARGE_INTEGER
*pcbSize
)
705 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
706 FIXME("(%p)->(%p)\n", This
, pcbSize
);
710 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
712 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
716 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
718 TRACE("(%p)\n", This
);
720 hres
= CreateURLMoniker(NULL
, about_blankW
, &mon
);
722 WARN("CreateURLMoniker failed: %08x\n", hres
);
726 hres
= set_moniker(This
, mon
, NULL
, NULL
, FALSE
);
727 IMoniker_Release(mon
);
731 return start_binding(This
->window
, NULL
, (BSCallback
*)This
->window
->bscallback
, NULL
);
734 #undef PERSTRINIT_THIS
736 static const IPersistStreamInitVtbl PersistStreamInitVtbl
= {
737 PersistStreamInit_QueryInterface
,
738 PersistStreamInit_AddRef
,
739 PersistStreamInit_Release
,
740 PersistStreamInit_GetClassID
,
741 PersistStreamInit_IsDirty
,
742 PersistStreamInit_Load
,
743 PersistStreamInit_Save
,
744 PersistStreamInit_GetSizeMax
,
745 PersistStreamInit_InitNew
748 /**********************************************************
749 * IPersistHistory implementation
752 #define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
754 static HRESULT WINAPI
PersistHistory_QueryInterface(IPersistHistory
*iface
, REFIID riid
, void **ppvObject
)
756 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
757 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
760 static ULONG WINAPI
PersistHistory_AddRef(IPersistHistory
*iface
)
762 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
763 return IHTMLDocument2_AddRef(HTMLDOC(This
));
766 static ULONG WINAPI
PersistHistory_Release(IPersistHistory
*iface
)
768 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
769 return IHTMLDocument2_Release(HTMLDOC(This
));
772 static HRESULT WINAPI
PersistHistory_GetClassID(IPersistHistory
*iface
, CLSID
*pClassID
)
774 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
775 return IPersist_GetClassID(PERSIST(This
), pClassID
);
778 static HRESULT WINAPI
PersistHistory_LoadHistory(IPersistHistory
*iface
, IStream
*pStream
, IBindCtx
*pbc
)
780 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
781 FIXME("(%p)->(%p %p)\n", This
, pStream
, pbc
);
785 static HRESULT WINAPI
PersistHistory_SaveHistory(IPersistHistory
*iface
, IStream
*pStream
)
787 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
788 FIXME("(%p)->(%p)\n", This
, pStream
);
792 static HRESULT WINAPI
PersistHistory_SetPositionCookie(IPersistHistory
*iface
, DWORD dwPositioncookie
)
794 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
795 FIXME("(%p)->(%x)\n", This
, dwPositioncookie
);
799 static HRESULT WINAPI
PersistHistory_GetPositionCookie(IPersistHistory
*iface
, DWORD
*pdwPositioncookie
)
801 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
802 FIXME("(%p)->(%p)\n", This
, pdwPositioncookie
);
806 #undef PERSISTHIST_THIS
808 static const IPersistHistoryVtbl PersistHistoryVtbl
= {
809 PersistHistory_QueryInterface
,
810 PersistHistory_AddRef
,
811 PersistHistory_Release
,
812 PersistHistory_GetClassID
,
813 PersistHistory_LoadHistory
,
814 PersistHistory_SaveHistory
,
815 PersistHistory_SetPositionCookie
,
816 PersistHistory_GetPositionCookie
819 void HTMLDocument_Persist_Init(HTMLDocument
*This
)
821 This
->lpPersistMonikerVtbl
= &PersistMonikerVtbl
;
822 This
->lpPersistFileVtbl
= &PersistFileVtbl
;
823 This
->lpMonikerPropVtbl
= &MonikerPropVtbl
;
824 This
->lpPersistStreamInitVtbl
= &PersistStreamInitVtbl
;
825 This
->lpPersistHistoryVtbl
= &PersistHistoryVtbl
;