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;
286 if(window->doc_obj && window->doc_obj->basedoc.window == window)
287 call_property_onchanged(&window->doc_obj->basedoc.cp_propnotif, DISPID_READYSTATE);
288 if(window->frame_element)
289 fire_event(window->frame_element->element.node.doc, EVENTID_READYSTATECHANGE,
290 window->frame_element->element.node.nsnode, NULL);
293 static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
301 WARN("NULL nsdoc\n");
305 nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
306 if(NS_FAILED(nsres)) {
307 ERR("Could not get nsIDOMNode failed: %08x\n", nsres);
311 nsAString_Init(&nsstr, NULL);
312 nsnode_to_nsstring(nsnode, &nsstr);
313 nsIDOMNode_Release(nsnode);
315 nsAString_GetData(&nsstr, &strw);
316 TRACE("%s\n", debugstr_w(strw));
318 *str = heap_strdupWtoA(strw);
320 nsAString_Finish(&nsstr);
326 /**********************************************************
327 * IPersistMoniker implementation
330 #define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
332 static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid,
335 HTMLDocument *This = PERSISTMON_THIS(iface);
336 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
339 static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
341 HTMLDocument *This = PERSISTMON_THIS(iface);
342 return IHTMLDocument2_AddRef(HTMLDOC(This));
345 static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
347 HTMLDocument *This = PERSISTMON_THIS(iface);
348 return IHTMLDocument2_Release(HTMLDOC(This));
351 static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
353 HTMLDocument *This = PERSISTMON_THIS(iface);
354 return IPersist_GetClassID(PERSIST(This), pClassID);
357 static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
359 HTMLDocument *This = PERSISTMON_THIS(iface);
361 TRACE("(%p)\n", This);
363 return IPersistStreamInit_IsDirty(PERSTRINIT(This));
366 static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
367 IMoniker *pimkName, LPBC pibc, DWORD grfMode)
369 HTMLDocument *This = PERSISTMON_THIS(iface);
372 TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
375 IUnknown *unk = NULL;
379 * "__PrecreatedObject"
380 * "BIND_CONTEXT_PARAM"
381 * "__HTMLLOADOPTIONS"
384 * "_ITransData_Object_"
388 IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
390 IOleClientSite *client = NULL;
392 hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
393 if(SUCCEEDED(hres)) {
394 TRACE("Got client site %p\n", client);
395 IOleObject_SetClientSite(OLEOBJ(This), client);
396 IOleClientSite_Release(client);
399 IUnknown_Release(unk);
403 hres = set_moniker(This, pimkName, pibc, NULL, TRUE);
407 return start_binding(This->window, NULL, (BSCallback*)This->window->bscallback, pibc);
410 static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
411 LPBC pbc, BOOL fRemember)
413 HTMLDocument *This = PERSISTMON_THIS(iface);
414 FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
418 static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
420 HTMLDocument *This = PERSISTMON_THIS(iface);
421 FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
425 static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
427 HTMLDocument *This = PERSISTMON_THIS(iface);
429 TRACE("(%p)->(%p)\n", This, ppimkName);
431 if(!This->window || !This->window->mon)
434 IMoniker_AddRef(This->window->mon);
435 *ppimkName = This->window->mon;
439 static const IPersistMonikerVtbl PersistMonikerVtbl = {
440 PersistMoniker_QueryInterface,
441 PersistMoniker_AddRef,
442 PersistMoniker_Release,
443 PersistMoniker_GetClassID,
444 PersistMoniker_IsDirty,
447 PersistMoniker_SaveCompleted,
448 PersistMoniker_GetCurMoniker
451 /**********************************************************
452 * IMonikerProp implementation
455 #define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
457 static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppvObject)
459 HTMLDocument *This = MONPROP_THIS(iface);
460 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
463 static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
465 HTMLDocument *This = MONPROP_THIS(iface);
466 return IHTMLDocument2_AddRef(HTMLDOC(This));
469 static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
471 HTMLDocument *This = MONPROP_THIS(iface);
472 return IHTMLDocument_Release(HTMLDOC(This));
475 static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
477 HTMLDocument *This = MONPROP_THIS(iface);
479 TRACE("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
483 heap_free(This->doc_obj->mime);
484 This->doc_obj->mime = heap_strdupW(val);
491 FIXME("mkp %d\n", mkp);
498 static const IMonikerPropVtbl MonikerPropVtbl = {
499 MonikerProp_QueryInterface,
502 MonikerProp_PutProperty
505 /**********************************************************
506 * IPersistFile implementation
509 #define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
511 static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
513 HTMLDocument *This = PERSISTFILE_THIS(iface);
514 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
517 static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
519 HTMLDocument *This = PERSISTFILE_THIS(iface);
520 return IHTMLDocument2_AddRef(HTMLDOC(This));
523 static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
525 HTMLDocument *This = PERSISTFILE_THIS(iface);
526 return IHTMLDocument2_Release(HTMLDOC(This));
529 static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
531 HTMLDocument *This = PERSISTFILE_THIS(iface);
533 TRACE("(%p)->(%p)\n", This, pClassID);
538 *pClassID = CLSID_HTMLDocument;
542 static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
544 HTMLDocument *This = PERSISTFILE_THIS(iface);
546 TRACE("(%p)\n", This);
548 return IPersistStreamInit_IsDirty(PERSTRINIT(This));
551 static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
553 HTMLDocument *This = PERSISTFILE_THIS(iface);
554 FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode);
558 static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
560 HTMLDocument *This = PERSISTFILE_THIS(iface);
566 TRACE("(%p)->(%s %x)\n", This, debugstr_w(pszFileName), fRemember);
568 file = CreateFileW(pszFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
569 FILE_ATTRIBUTE_NORMAL, NULL);
570 if(file == INVALID_HANDLE_VALUE) {
571 WARN("Could not create file: %u\n", GetLastError());
575 hres = get_doc_string(This->doc_node, &str);
577 WriteFile(file, str, strlen(str), &written, NULL);
583 static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
585 HTMLDocument *This = PERSISTFILE_THIS(iface);
586 FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
590 static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
592 HTMLDocument *This = PERSISTFILE_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, pszFileName);
597 static const IPersistFileVtbl PersistFileVtbl = {
598 PersistFile_QueryInterface,
601 PersistFile_GetClassID,
605 PersistFile_SaveCompleted,
606 PersistFile_GetCurFile
609 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
611 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
612 REFIID riid, void **ppv)
614 HTMLDocument *This = PERSTRINIT_THIS(iface);
615 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
618 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
620 HTMLDocument *This = PERSTRINIT_THIS(iface);
621 return IHTMLDocument2_AddRef(HTMLDOC(This));
624 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
626 HTMLDocument *This = PERSTRINIT_THIS(iface);
627 return IHTMLDocument2_Release(HTMLDOC(This));
630 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
632 HTMLDocument *This = PERSTRINIT_THIS(iface);
633 return IPersist_GetClassID(PERSIST(This), pClassID);
636 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
638 HTMLDocument *This = PERSTRINIT_THIS(iface);
640 TRACE("(%p)\n", This);
642 if(This->doc_obj->usermode == EDITMODE)
643 return editor_is_dirty(This);
648 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
650 HTMLDocument *This = PERSTRINIT_THIS(iface);
654 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
656 TRACE("(%p)->(%p)\n", This, pStm);
658 hres = CreateURLMoniker(NULL, about_blankW, &mon);
660 WARN("CreateURLMoniker failed: %08x\n", hres);
664 hres = set_moniker(This, mon, NULL, NULL, TRUE);
665 IMoniker_Release(mon);
669 return channelbsc_load_stream(This->window->bscallback, pStm);
672 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
675 HTMLDocument *This = PERSTRINIT_THIS(iface);
680 TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
682 hres = get_doc_string(This->doc_node, &str);
686 hres = IStream_Write(pStm, str, strlen(str), &written);
688 FIXME("Write failed: %08x\n", hres);
693 set_dirty(This, VARIANT_FALSE);
698 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
699 ULARGE_INTEGER *pcbSize)
701 HTMLDocument *This = PERSTRINIT_THIS(iface);
702 FIXME("(%p)->(%p)\n", This, pcbSize);
706 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
708 HTMLDocument *This = PERSTRINIT_THIS(iface);
712 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
714 TRACE("(%p)\n", This);
716 hres = CreateURLMoniker(NULL, about_blankW, &mon);
718 WARN("CreateURLMoniker failed: %08x\n", hres);
722 hres = set_moniker(This, mon, NULL, NULL, FALSE);
723 IMoniker_Release(mon);
727 return start_binding(This->window, NULL, (BSCallback*)This->window->bscallback, NULL);
730 #undef PERSTRINIT_THIS
732 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
733 PersistStreamInit_QueryInterface,
734 PersistStreamInit_AddRef,
735 PersistStreamInit_Release,
736 PersistStreamInit_GetClassID,
737 PersistStreamInit_IsDirty,
738 PersistStreamInit_Load,
739 PersistStreamInit_Save,
740 PersistStreamInit_GetSizeMax,
741 PersistStreamInit_InitNew
744 /**********************************************************
745 * IPersistHistory implementation
748 #define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
750 static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppvObject)
752 HTMLDocument *This = PERSISTHIST_THIS(iface);
753 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
756 static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
758 HTMLDocument *This = PERSISTHIST_THIS(iface);
759 return IHTMLDocument2_AddRef(HTMLDOC(This));
762 static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
764 HTMLDocument *This = PERSISTHIST_THIS(iface);
765 return IHTMLDocument2_Release(HTMLDOC(This));
768 static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
770 HTMLDocument *This = PERSISTHIST_THIS(iface);
771 return IPersist_GetClassID(PERSIST(This), pClassID);
774 static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
776 HTMLDocument *This = PERSISTHIST_THIS(iface);
777 FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
781 static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
783 HTMLDocument *This = PERSISTHIST_THIS(iface);
784 FIXME("(%p)->(%p)\n", This, pStream);
788 static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
790 HTMLDocument *This = PERSISTHIST_THIS(iface);
791 FIXME("(%p)->(%x)\n", This, dwPositioncookie);
795 static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
797 HTMLDocument *This = PERSISTHIST_THIS(iface);
798 FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
802 #undef PERSISTHIST_THIS
804 static const IPersistHistoryVtbl PersistHistoryVtbl = {
805 PersistHistory_QueryInterface,
806 PersistHistory_AddRef,
807 PersistHistory_Release,
808 PersistHistory_GetClassID,
809 PersistHistory_LoadHistory,
810 PersistHistory_SaveHistory,
811 PersistHistory_SetPositionCookie,
812 PersistHistory_GetPositionCookie
815 void HTMLDocument_Persist_Init(HTMLDocument *This)
817 This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
818 This->lpPersistFileVtbl = &PersistFileVtbl;
819 This->lpMonikerPropVtbl = &MonikerPropVtbl;
820 This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
821 This->lpPersistHistoryVtbl = &PersistHistoryVtbl;