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"
37 #include "mshtml_private.h"
38 #include "htmlevent.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
49 } download_proc_task_t;
51 static BOOL use_gecko_script(HTMLWindow *window)
56 static const WCHAR aboutW[] = {'a','b','o','u','t',':'};
58 hres = IInternetSecurityManager_MapUrlToZone(window->secmgr, window->url, &zone, 0);
60 WARN("Could not map %s to zone: %08x\n", debugstr_w(window->url), hres);
64 TRACE("zone %d\n", zone);
65 return zone != URLZONE_LOCAL_MACHINE && zone != URLZONE_TRUSTED
66 && strncmpiW(aboutW, window->url, sizeof(aboutW)/sizeof(WCHAR));
69 void set_current_mon(HTMLWindow *This, IMoniker *mon)
74 IMoniker_Release(This->mon);
79 CoTaskMemFree(This->url);
89 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
91 WARN("GetDisplayName failed: %08x\n", hres);
93 set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
96 void set_download_state(HTMLDocumentObj *doc, int state)
99 IOleCommandTarget *olecmd;
102 hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
103 if(SUCCEEDED(hres)) {
109 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
110 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
111 IOleCommandTarget_Release(olecmd);
115 doc->download_state = state;
118 static void set_progress_proc(task_t *_task)
120 docobj_task_t *task = (docobj_task_t*)_task;
121 IOleCommandTarget *olecmd = NULL;
122 HTMLDocumentObj *doc = task->doc;
125 TRACE("(%p)\n", doc);
128 IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
131 VARIANT progress_max, progress;
133 V_VT(&progress_max) = VT_I4;
134 V_I4(&progress_max) = 0; /* FIXME */
135 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
136 &progress_max, NULL);
138 V_VT(&progress) = VT_I4;
139 V_I4(&progress) = 0; /* FIXME */
140 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
142 IOleCommandTarget_Release(olecmd);
145 if(doc->usermode == EDITMODE && doc->hostui) {
146 DOCHOSTUIINFO hostinfo;
148 memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
149 hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
150 hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
152 /* FIXME: use hostinfo */
153 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
154 hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
155 debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
159 static void set_downloading_proc(task_t *_task)
161 download_proc_task_t *task = (download_proc_task_t*)_task;
162 HTMLDocumentObj *doc = task->doc;
165 TRACE("(%p)\n", doc);
167 set_statustext(doc, IDS_STATUS_DOWNLOADINGFROM, task->url);
169 if(task->set_download)
170 set_download_state(doc, 1);
176 IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1);
179 IDropTarget *drop_target = NULL;
181 hres = IDocHostUIHandler_GetDropTarget(doc->hostui, NULL /* FIXME */, &drop_target);
182 if(SUCCEEDED(hres)) {
183 FIXME("Use IDropTarget\n");
184 IDropTarget_Release(drop_target);
189 static void set_downloading_task_destr(task_t *_task)
191 download_proc_task_t *task = (download_proc_task_t*)_task;
193 CoTaskMemFree(task->url);
197 void prepare_for_binding(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL navigated_binding)
201 if(This->doc_obj->client) {
202 VARIANT silent, offline;
204 hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
205 if(SUCCEEDED(hres)) {
206 if(V_VT(&silent) != VT_BOOL)
207 WARN("V_VT(silent) = %d\n", V_VT(&silent));
208 else if(V_BOOL(&silent))
209 FIXME("silent == true\n");
212 hres = get_client_disp_property(This->doc_obj->client,
213 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
214 if(SUCCEEDED(hres)) {
215 if(V_VT(&offline) != VT_BOOL)
216 WARN("V_VT(offline) = %d\n", V_VT(&offline));
217 else if(V_BOOL(&offline))
218 FIXME("offline == true\n");
222 if(This->window->mon) {
223 update_doc(This, UPDATE_TITLE|UPDATE_UI);
225 update_doc(This, UPDATE_TITLE);
226 set_current_mon(This->window, mon);
229 if(This->doc_obj->client) {
230 IOleCommandTarget *cmdtrg = NULL;
232 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
234 if(SUCCEEDED(hres)) {
237 if(!navigated_binding) {
240 IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
242 V_VT(&var) = VT_UNKNOWN;
243 V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
244 V_VT(&out) = VT_EMPTY;
245 hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
250 IOleCommandTarget_Release(cmdtrg);
255 HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannelBSC *async_bsc, BOOL set_download)
257 download_proc_task_t *download_task;
258 nsChannelBSC *bscallback;
263 hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
265 WARN("GetDiaplayName failed: %08x\n", hres);
269 TRACE("got url: %s\n", debugstr_w(url));
271 set_ready_state(This->window, READYSTATE_LOADING);
273 hres = create_doc_uri(This->window, url, &nsuri);
274 if(SUCCEEDED(hres)) {
276 bscallback = async_bsc;
278 hres = create_channelbsc(mon, NULL, NULL, 0, &bscallback);
281 if(SUCCEEDED(hres)) {
282 remove_target_tasks(This->task_magic);
283 abort_document_bindings(This->doc_node);
285 hres = load_nsuri(This->window, nsuri, bscallback, 0/*LOAD_INITIAL_DOCUMENT_URI*/);
286 nsISupports_Release((nsISupports*)nsuri); /* FIXME */
288 set_window_bscallback(This->window, bscallback);
289 if(bscallback != async_bsc)
290 IUnknown_Release((IUnknown*)bscallback);
298 HTMLDocument_LockContainer(This->doc_obj, TRUE);
300 if(This->doc_obj->frame) {
303 task = heap_alloc(sizeof(docobj_task_t));
304 task->doc = This->doc_obj;
305 push_task(&task->header, set_progress_proc, NULL, This->doc_obj->basedoc.task_magic);
308 download_task = heap_alloc(sizeof(download_proc_task_t));
309 download_task->doc = This->doc_obj;
310 download_task->set_download = set_download;
311 download_task->url = url;
312 push_task(&download_task->header, set_downloading_proc, set_downloading_task_destr, This->doc_obj->basedoc.task_magic);
317 void set_ready_state(HTMLWindow *window, READYSTATE readystate)
319 window->readystate = readystate;
321 if(window->doc_obj && window->doc_obj->basedoc.window == window)
322 call_property_onchanged(&window->doc_obj->basedoc.cp_propnotif, DISPID_READYSTATE);
324 fire_event(window->doc, EVENTID_READYSTATECHANGE, FALSE, window->doc->node.nsnode, NULL);
326 if(window->frame_element)
327 fire_event(window->frame_element->element.node.doc, EVENTID_READYSTATECHANGE,
328 TRUE, window->frame_element->element.node.nsnode, NULL);
331 static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
340 WARN("NULL nsdoc\n");
344 nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
345 if(NS_FAILED(nsres)) {
346 ERR("Could not get nsIDOMNode failed: %08x\n", nsres);
350 nsAString_Init(&nsstr, NULL);
351 hres = nsnode_to_nsstring(nsnode, &nsstr);
352 nsIDOMNode_Release(nsnode);
354 nsAString_Finish(&nsstr);
358 nsAString_GetData(&nsstr, &strw);
359 TRACE("%s\n", debugstr_w(strw));
361 *str = heap_strdupWtoA(strw);
363 nsAString_Finish(&nsstr);
366 return E_OUTOFMEMORY;
371 /**********************************************************
372 * IPersistMoniker implementation
375 static inline HTMLDocument *impl_from_IPersistMoniker(IPersistMoniker *iface)
377 return CONTAINING_RECORD(iface, HTMLDocument, IPersistMoniker_iface);
380 static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv)
382 HTMLDocument *This = impl_from_IPersistMoniker(iface);
383 return htmldoc_query_interface(This, riid, ppv);
386 static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
388 HTMLDocument *This = impl_from_IPersistMoniker(iface);
389 return htmldoc_addref(This);
392 static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
394 HTMLDocument *This = impl_from_IPersistMoniker(iface);
395 return htmldoc_release(This);
398 static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
400 HTMLDocument *This = impl_from_IPersistMoniker(iface);
401 return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
404 static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
406 HTMLDocument *This = impl_from_IPersistMoniker(iface);
408 TRACE("(%p)\n", This);
410 return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
413 static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
414 IMoniker *pimkName, LPBC pibc, DWORD grfMode)
416 HTMLDocument *This = impl_from_IPersistMoniker(iface);
419 TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
422 IUnknown *unk = NULL;
426 * "__PrecreatedObject"
427 * "BIND_CONTEXT_PARAM"
428 * "__HTMLLOADOPTIONS"
431 * "_ITransData_Object_"
435 IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
437 IOleClientSite *client = NULL;
439 hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
440 if(SUCCEEDED(hres)) {
441 TRACE("Got client site %p\n", client);
442 IOleObject_SetClientSite(&This->IOleObject_iface, client);
443 IOleClientSite_Release(client);
446 IUnknown_Release(unk);
450 prepare_for_binding(This, pimkName, pibc, FALSE);
451 hres = set_moniker(This, pimkName, pibc, NULL, TRUE);
455 return start_binding(This->window, NULL, (BSCallback*)This->window->bscallback, pibc);
458 static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
459 LPBC pbc, BOOL fRemember)
461 HTMLDocument *This = impl_from_IPersistMoniker(iface);
462 FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
466 static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
468 HTMLDocument *This = impl_from_IPersistMoniker(iface);
469 FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
473 static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
475 HTMLDocument *This = impl_from_IPersistMoniker(iface);
477 TRACE("(%p)->(%p)\n", This, ppimkName);
479 if(!This->window || !This->window->mon)
482 IMoniker_AddRef(This->window->mon);
483 *ppimkName = This->window->mon;
487 static const IPersistMonikerVtbl PersistMonikerVtbl = {
488 PersistMoniker_QueryInterface,
489 PersistMoniker_AddRef,
490 PersistMoniker_Release,
491 PersistMoniker_GetClassID,
492 PersistMoniker_IsDirty,
495 PersistMoniker_SaveCompleted,
496 PersistMoniker_GetCurMoniker
499 /**********************************************************
500 * IMonikerProp implementation
503 static inline HTMLDocument *impl_from_IMonikerProp(IMonikerProp *iface)
505 return CONTAINING_RECORD(iface, HTMLDocument, IMonikerProp_iface);
508 static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv)
510 HTMLDocument *This = impl_from_IMonikerProp(iface);
511 return htmldoc_query_interface(This, riid, ppv);
514 static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
516 HTMLDocument *This = impl_from_IMonikerProp(iface);
517 return htmldoc_addref(This);
520 static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
522 HTMLDocument *This = impl_from_IMonikerProp(iface);
523 return htmldoc_release(This);
526 static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
528 HTMLDocument *This = impl_from_IMonikerProp(iface);
530 TRACE("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
534 heap_free(This->doc_obj->mime);
535 This->doc_obj->mime = heap_strdupW(val);
542 FIXME("mkp %d\n", mkp);
549 static const IMonikerPropVtbl MonikerPropVtbl = {
550 MonikerProp_QueryInterface,
553 MonikerProp_PutProperty
556 /**********************************************************
557 * IPersistFile implementation
560 static inline HTMLDocument *impl_from_IPersistFile(IPersistFile *iface)
562 return CONTAINING_RECORD(iface, HTMLDocument, IPersistFile_iface);
565 static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv)
567 HTMLDocument *This = impl_from_IPersistFile(iface);
568 return htmldoc_query_interface(This, riid, ppv);
571 static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
573 HTMLDocument *This = impl_from_IPersistFile(iface);
574 return htmldoc_addref(This);
577 static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
579 HTMLDocument *This = impl_from_IPersistFile(iface);
580 return htmldoc_release(This);
583 static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
585 HTMLDocument *This = impl_from_IPersistFile(iface);
587 TRACE("(%p)->(%p)\n", This, pClassID);
592 *pClassID = CLSID_HTMLDocument;
596 static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
598 HTMLDocument *This = impl_from_IPersistFile(iface);
600 TRACE("(%p)\n", This);
602 return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
605 static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
607 HTMLDocument *This = impl_from_IPersistFile(iface);
608 FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode);
612 static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
614 HTMLDocument *This = impl_from_IPersistFile(iface);
620 TRACE("(%p)->(%s %x)\n", This, debugstr_w(pszFileName), fRemember);
622 file = CreateFileW(pszFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
623 FILE_ATTRIBUTE_NORMAL, NULL);
624 if(file == INVALID_HANDLE_VALUE) {
625 WARN("Could not create file: %u\n", GetLastError());
629 hres = get_doc_string(This->doc_node, &str);
631 WriteFile(file, str, strlen(str), &written, NULL);
637 static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
639 HTMLDocument *This = impl_from_IPersistFile(iface);
640 FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
644 static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
646 HTMLDocument *This = impl_from_IPersistFile(iface);
647 FIXME("(%p)->(%p)\n", This, pszFileName);
651 static const IPersistFileVtbl PersistFileVtbl = {
652 PersistFile_QueryInterface,
655 PersistFile_GetClassID,
659 PersistFile_SaveCompleted,
660 PersistFile_GetCurFile
663 static inline HTMLDocument *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
665 return CONTAINING_RECORD(iface, HTMLDocument, IPersistStreamInit_iface);
668 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
669 REFIID riid, void **ppv)
671 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
672 return htmldoc_query_interface(This, riid, ppv);
675 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
677 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
678 return htmldoc_addref(This);
681 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
683 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
684 return htmldoc_release(This);
687 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
689 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
690 return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
693 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
695 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
697 TRACE("(%p)\n", This);
699 if(This->doc_obj->usermode == EDITMODE)
700 return editor_is_dirty(This);
705 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
707 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
711 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
713 TRACE("(%p)->(%p)\n", This, pStm);
715 hres = CreateURLMoniker(NULL, about_blankW, &mon);
717 WARN("CreateURLMoniker failed: %08x\n", hres);
721 prepare_for_binding(This, mon, NULL, FALSE);
722 hres = set_moniker(This, mon, NULL, NULL, TRUE);
723 IMoniker_Release(mon);
727 return channelbsc_load_stream(This->window->bscallback, pStm);
730 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
733 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
738 TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
740 hres = get_doc_string(This->doc_node, &str);
744 hres = IStream_Write(pStm, str, strlen(str), &written);
746 FIXME("Write failed: %08x\n", hres);
751 set_dirty(This, VARIANT_FALSE);
756 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
757 ULARGE_INTEGER *pcbSize)
759 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
760 FIXME("(%p)->(%p)\n", This, pcbSize);
764 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
766 HTMLDocument *This = impl_from_IPersistStreamInit(iface);
770 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
772 TRACE("(%p)\n", This);
774 hres = CreateURLMoniker(NULL, about_blankW, &mon);
776 WARN("CreateURLMoniker failed: %08x\n", hres);
780 prepare_for_binding(This, mon, NULL, FALSE);
781 hres = set_moniker(This, mon, NULL, NULL, FALSE);
782 IMoniker_Release(mon);
786 return channelbsc_load_stream(This->window->bscallback, NULL);
789 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
790 PersistStreamInit_QueryInterface,
791 PersistStreamInit_AddRef,
792 PersistStreamInit_Release,
793 PersistStreamInit_GetClassID,
794 PersistStreamInit_IsDirty,
795 PersistStreamInit_Load,
796 PersistStreamInit_Save,
797 PersistStreamInit_GetSizeMax,
798 PersistStreamInit_InitNew
801 /**********************************************************
802 * IPersistHistory implementation
805 static inline HTMLDocument *impl_from_IPersistHistory(IPersistHistory *iface)
807 return CONTAINING_RECORD(iface, HTMLDocument, IPersistHistory_iface);
810 static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv)
812 HTMLDocument *This = impl_from_IPersistHistory(iface);
813 return htmldoc_query_interface(This, riid, ppv);
816 static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
818 HTMLDocument *This = impl_from_IPersistHistory(iface);
819 return htmldoc_addref(This);
822 static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
824 HTMLDocument *This = impl_from_IPersistHistory(iface);
825 return htmldoc_release(This);
828 static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
830 HTMLDocument *This = impl_from_IPersistHistory(iface);
831 return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
834 static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
836 HTMLDocument *This = impl_from_IPersistHistory(iface);
837 FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
841 static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
843 HTMLDocument *This = impl_from_IPersistHistory(iface);
844 FIXME("(%p)->(%p)\n", This, pStream);
848 static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
850 HTMLDocument *This = impl_from_IPersistHistory(iface);
851 FIXME("(%p)->(%x)\n", This, dwPositioncookie);
855 static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
857 HTMLDocument *This = impl_from_IPersistHistory(iface);
858 FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
862 static const IPersistHistoryVtbl PersistHistoryVtbl = {
863 PersistHistory_QueryInterface,
864 PersistHistory_AddRef,
865 PersistHistory_Release,
866 PersistHistory_GetClassID,
867 PersistHistory_LoadHistory,
868 PersistHistory_SaveHistory,
869 PersistHistory_SetPositionCookie,
870 PersistHistory_GetPositionCookie
873 void HTMLDocument_Persist_Init(HTMLDocument *This)
875 This->IPersistMoniker_iface.lpVtbl = &PersistMonikerVtbl;
876 This->IPersistFile_iface.lpVtbl = &PersistFileVtbl;
877 This->IMonikerProp_iface.lpVtbl = &MonikerPropVtbl;
878 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
879 This->IPersistHistory_iface.lpVtbl = &PersistHistoryVtbl;