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',':'};
54 return strncmpiW(fileW
, url
, sizeof(fileW
)/sizeof(WCHAR
))
55 && strncmpiW(aboutW
, url
, sizeof(aboutW
)/sizeof(WCHAR
));
58 void set_current_mon(HTMLWindow
*This
, IMoniker
*mon
)
63 IMoniker_Release(This
->mon
);
68 CoTaskMemFree(This
->url
);
78 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &This
->url
);
80 WARN("GetDisplayName failed: %08x\n", hres
);
82 set_script_mode(This
, use_gecko_script(This
->url
) ? SCRIPTMODE_GECKO
: SCRIPTMODE_ACTIVESCRIPT
);
85 static void set_progress_proc(task_t
*_task
)
87 docobj_task_t
*task
= (docobj_task_t
*)_task
;
88 IOleCommandTarget
*olecmd
= NULL
;
89 HTMLDocumentObj
*doc
= task
->doc
;
95 IOleClientSite_QueryInterface(doc
->client
, &IID_IOleCommandTarget
, (void**)&olecmd
);
98 VARIANT progress_max
, progress
;
100 V_VT(&progress_max
) = VT_I4
;
101 V_I4(&progress_max
) = 0; /* FIXME */
102 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETPROGRESSMAX
, OLECMDEXECOPT_DONTPROMPTUSER
,
103 &progress_max
, NULL
);
105 V_VT(&progress
) = VT_I4
;
106 V_I4(&progress
) = 0; /* FIXME */
107 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETPROGRESSPOS
, OLECMDEXECOPT_DONTPROMPTUSER
,
111 if(doc
->usermode
== EDITMODE
&& doc
->hostui
) {
112 DOCHOSTUIINFO hostinfo
;
114 memset(&hostinfo
, 0, sizeof(DOCHOSTUIINFO
));
115 hostinfo
.cbSize
= sizeof(DOCHOSTUIINFO
);
116 hres
= IDocHostUIHandler_GetHostInfo(doc
->hostui
, &hostinfo
);
118 /* FIXME: use hostinfo */
119 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
120 hostinfo
.cbSize
, hostinfo
.dwFlags
, hostinfo
.dwDoubleClick
,
121 debugstr_w(hostinfo
.pchHostCss
), debugstr_w(hostinfo
.pchHostNS
));
125 static void set_downloading_proc(task_t
*_task
)
127 download_proc_task_t
*task
= (download_proc_task_t
*)_task
;
128 HTMLDocumentObj
*doc
= task
->doc
;
129 IOleCommandTarget
*olecmd
;
132 TRACE("(%p)\n", doc
);
135 IOleInPlaceFrame_SetStatusText(doc
->frame
, NULL
/* FIXME */);
140 if(task
->set_download
) {
141 hres
= IOleClientSite_QueryInterface(doc
->client
, &IID_IOleCommandTarget
, (void**)&olecmd
);
142 if(SUCCEEDED(hres
)) {
148 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETDOWNLOADSTATE
,
149 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
150 IOleCommandTarget_Release(olecmd
);
153 doc
->download_state
= 1;
157 IDropTarget
*drop_target
= NULL
;
159 hres
= IDocHostUIHandler_GetDropTarget(doc
->hostui
, NULL
/* FIXME */, &drop_target
);
161 FIXME("Use IDropTarget\n");
162 IDropTarget_Release(drop_target
);
167 static HRESULT
set_moniker(HTMLDocument
*This
, IMoniker
*mon
, IBindCtx
*pibc
, BOOL set_download
)
169 nsChannelBSC
*bscallback
;
172 download_proc_task_t
*download_task
;
177 IUnknown
*unk
= NULL
;
181 * "__PrecreatedObject"
182 * "BIND_CONTEXT_PARAM"
183 * "__HTMLLOADOPTIONS"
187 * "_ITransData_Object_"
191 IBindCtx_GetObjectParam(pibc
, (LPOLESTR
)SZ_HTML_CLIENTSITE_OBJECTPARAM
, &unk
);
193 IOleClientSite
*client
= NULL
;
195 hres
= IUnknown_QueryInterface(unk
, &IID_IOleClientSite
, (void**)&client
);
196 if(SUCCEEDED(hres
)) {
197 TRACE("Got client site %p\n", client
);
198 IOleObject_SetClientSite(OLEOBJ(This
), client
);
199 IOleClientSite_Release(client
);
202 IUnknown_Release(unk
);
206 set_ready_state(This
->window
, READYSTATE_LOADING
);
207 update_doc(This
, UPDATE_TITLE
);
209 HTMLDocument_LockContainer(This
->doc_obj
, TRUE
);
211 hres
= IMoniker_GetDisplayName(mon
, pibc
, NULL
, &url
);
213 WARN("GetDiaplayName failed: %08x\n", hres
);
217 TRACE("got url: %s\n", debugstr_w(url
));
219 set_current_mon(This
->window
, mon
);
221 if(This
->doc_obj
->client
) {
222 VARIANT silent
, offline
;
223 IOleCommandTarget
*cmdtrg
= NULL
;
225 hres
= get_client_disp_property(This
->doc_obj
->client
, DISPID_AMBIENT_SILENT
, &silent
);
226 if(SUCCEEDED(hres
)) {
227 if(V_VT(&silent
) != VT_BOOL
)
228 WARN("V_VT(silent) = %d\n", V_VT(&silent
));
229 else if(V_BOOL(&silent
))
230 FIXME("silent == true\n");
233 hres
= get_client_disp_property(This
->doc_obj
->client
,
234 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
, &offline
);
235 if(SUCCEEDED(hres
)) {
236 if(V_VT(&silent
) != VT_BOOL
)
237 WARN("V_VT(offline) = %d\n", V_VT(&silent
));
238 else if(V_BOOL(&silent
))
239 FIXME("offline == true\n");
242 hres
= IOleClientSite_QueryInterface(This
->doc_obj
->client
, &IID_IOleCommandTarget
,
244 if(SUCCEEDED(hres
)) {
249 IOleCommandTarget_Exec(cmdtrg
, &CGID_ShellDocView
, 37, 0, &var
, NULL
);
251 IOleCommandTarget_Release(cmdtrg
);
255 bscallback
= create_channelbsc(mon
);
257 if(This
->doc_obj
->frame
) {
258 task
= heap_alloc(sizeof(docobj_task_t
));
259 task
->doc
= This
->doc_obj
;
260 push_task(&task
->header
, set_progress_proc
, This
->doc_obj
->basedoc
.task_magic
);
263 download_task
= heap_alloc(sizeof(download_proc_task_t
));
264 download_task
->doc
= This
->doc_obj
;
265 download_task
->set_download
= set_download
;
266 push_task(&download_task
->header
, set_downloading_proc
, This
->doc_obj
->basedoc
.task_magic
);
268 if(This
->doc_obj
->nscontainer
) {
269 This
->doc_obj
->nscontainer
->bscallback
= bscallback
;
270 nsres
= nsIWebNavigation_LoadURI(This
->doc_obj
->nscontainer
->navigation
, url
,
271 LOAD_FLAGS_NONE
, NULL
, NULL
, NULL
);
272 This
->doc_obj
->nscontainer
->bscallback
= NULL
;
273 if(NS_FAILED(nsres
)) {
274 WARN("LoadURI failed: %08x\n", nsres
);
275 IUnknown_Release((IUnknown
*)bscallback
);
281 set_window_bscallback(This
->window
, bscallback
);
282 IUnknown_Release((IUnknown
*)bscallback
);
288 void set_ready_state(HTMLWindow
*window
, READYSTATE readystate
)
290 window
->readystate
= readystate
;
291 if(window
->doc_obj
&& window
->doc_obj
->basedoc
.window
== window
)
292 call_property_onchanged(&window
->doc_obj
->basedoc
.cp_propnotif
, DISPID_READYSTATE
);
293 if(window
->frame_element
)
294 fire_event(window
->frame_element
->element
.node
.doc
, EVENTID_READYSTATECHANGE
,
295 window
->frame_element
->element
.node
.nsnode
, NULL
);
298 static HRESULT
get_doc_string(HTMLDocumentNode
*This
, char **str
)
306 WARN("NULL nsdoc\n");
310 nsres
= nsIDOMHTMLDocument_QueryInterface(This
->nsdoc
, &IID_nsIDOMNode
, (void**)&nsnode
);
311 if(NS_FAILED(nsres
)) {
312 ERR("Could not get nsIDOMNode failed: %08x\n", nsres
);
316 nsAString_Init(&nsstr
, NULL
);
317 nsnode_to_nsstring(nsnode
, &nsstr
);
318 nsIDOMNode_Release(nsnode
);
320 nsAString_GetData(&nsstr
, &strw
);
321 TRACE("%s\n", debugstr_w(strw
));
323 *str
= heap_strdupWtoA(strw
);
325 nsAString_Finish(&nsstr
);
331 /**********************************************************
332 * IPersistMoniker implementation
335 #define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
337 static HRESULT WINAPI
PersistMoniker_QueryInterface(IPersistMoniker
*iface
, REFIID riid
,
340 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
341 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
344 static ULONG WINAPI
PersistMoniker_AddRef(IPersistMoniker
*iface
)
346 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
347 return IHTMLDocument2_AddRef(HTMLDOC(This
));
350 static ULONG WINAPI
PersistMoniker_Release(IPersistMoniker
*iface
)
352 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
353 return IHTMLDocument2_Release(HTMLDOC(This
));
356 static HRESULT WINAPI
PersistMoniker_GetClassID(IPersistMoniker
*iface
, CLSID
*pClassID
)
358 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
359 return IPersist_GetClassID(PERSIST(This
), pClassID
);
362 static HRESULT WINAPI
PersistMoniker_IsDirty(IPersistMoniker
*iface
)
364 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
366 TRACE("(%p)\n", This
);
368 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
371 static HRESULT WINAPI
PersistMoniker_Load(IPersistMoniker
*iface
, BOOL fFullyAvailable
,
372 IMoniker
*pimkName
, LPBC pibc
, DWORD grfMode
)
374 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
377 TRACE("(%p)->(%x %p %p %08x)\n", This
, fFullyAvailable
, pimkName
, pibc
, grfMode
);
379 hres
= set_moniker(This
, pimkName
, pibc
, TRUE
);
383 return start_binding(This
->window
, NULL
, (BSCallback
*)This
->window
->bscallback
, pibc
);
386 static HRESULT WINAPI
PersistMoniker_Save(IPersistMoniker
*iface
, IMoniker
*pimkName
,
387 LPBC pbc
, BOOL fRemember
)
389 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
390 FIXME("(%p)->(%p %p %x)\n", This
, pimkName
, pbc
, fRemember
);
394 static HRESULT WINAPI
PersistMoniker_SaveCompleted(IPersistMoniker
*iface
, IMoniker
*pimkName
, LPBC pibc
)
396 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
397 FIXME("(%p)->(%p %p)\n", This
, pimkName
, pibc
);
401 static HRESULT WINAPI
PersistMoniker_GetCurMoniker(IPersistMoniker
*iface
, IMoniker
**ppimkName
)
403 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
405 TRACE("(%p)->(%p)\n", This
, ppimkName
);
407 if(!This
->window
|| !This
->window
->mon
)
410 IMoniker_AddRef(This
->window
->mon
);
411 *ppimkName
= This
->window
->mon
;
415 static const IPersistMonikerVtbl PersistMonikerVtbl
= {
416 PersistMoniker_QueryInterface
,
417 PersistMoniker_AddRef
,
418 PersistMoniker_Release
,
419 PersistMoniker_GetClassID
,
420 PersistMoniker_IsDirty
,
423 PersistMoniker_SaveCompleted
,
424 PersistMoniker_GetCurMoniker
427 /**********************************************************
428 * IMonikerProp implementation
431 #define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
433 static HRESULT WINAPI
MonikerProp_QueryInterface(IMonikerProp
*iface
, REFIID riid
, void **ppvObject
)
435 HTMLDocument
*This
= MONPROP_THIS(iface
);
436 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
439 static ULONG WINAPI
MonikerProp_AddRef(IMonikerProp
*iface
)
441 HTMLDocument
*This
= MONPROP_THIS(iface
);
442 return IHTMLDocument2_AddRef(HTMLDOC(This
));
445 static ULONG WINAPI
MonikerProp_Release(IMonikerProp
*iface
)
447 HTMLDocument
*This
= MONPROP_THIS(iface
);
448 return IHTMLDocument_Release(HTMLDOC(This
));
451 static HRESULT WINAPI
MonikerProp_PutProperty(IMonikerProp
*iface
, MONIKERPROPERTY mkp
, LPCWSTR val
)
453 HTMLDocument
*This
= MONPROP_THIS(iface
);
455 TRACE("(%p)->(%d %s)\n", This
, mkp
, debugstr_w(val
));
459 heap_free(This
->doc_obj
->mime
);
460 This
->doc_obj
->mime
= heap_strdupW(val
);
467 FIXME("mkp %d\n", mkp
);
474 static const IMonikerPropVtbl MonikerPropVtbl
= {
475 MonikerProp_QueryInterface
,
478 MonikerProp_PutProperty
481 /**********************************************************
482 * IPersistFile implementation
485 #define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
487 static HRESULT WINAPI
PersistFile_QueryInterface(IPersistFile
*iface
, REFIID riid
, void **ppvObject
)
489 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
490 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
493 static ULONG WINAPI
PersistFile_AddRef(IPersistFile
*iface
)
495 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
496 return IHTMLDocument2_AddRef(HTMLDOC(This
));
499 static ULONG WINAPI
PersistFile_Release(IPersistFile
*iface
)
501 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
502 return IHTMLDocument2_Release(HTMLDOC(This
));
505 static HRESULT WINAPI
PersistFile_GetClassID(IPersistFile
*iface
, CLSID
*pClassID
)
507 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
509 TRACE("(%p)->(%p)\n", This
, pClassID
);
514 *pClassID
= CLSID_HTMLDocument
;
518 static HRESULT WINAPI
PersistFile_IsDirty(IPersistFile
*iface
)
520 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
522 TRACE("(%p)\n", This
);
524 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
527 static HRESULT WINAPI
PersistFile_Load(IPersistFile
*iface
, LPCOLESTR pszFileName
, DWORD dwMode
)
529 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
530 FIXME("(%p)->(%s %08x)\n", This
, debugstr_w(pszFileName
), dwMode
);
534 static HRESULT WINAPI
PersistFile_Save(IPersistFile
*iface
, LPCOLESTR pszFileName
, BOOL fRemember
)
536 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
542 TRACE("(%p)->(%s %x)\n", This
, debugstr_w(pszFileName
), fRemember
);
544 file
= CreateFileW(pszFileName
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
,
545 FILE_ATTRIBUTE_NORMAL
, NULL
);
546 if(file
== INVALID_HANDLE_VALUE
) {
547 WARN("Could not create file: %u\n", GetLastError());
551 hres
= get_doc_string(This
->doc_node
, &str
);
553 WriteFile(file
, str
, strlen(str
), &written
, NULL
);
559 static HRESULT WINAPI
PersistFile_SaveCompleted(IPersistFile
*iface
, LPCOLESTR pszFileName
)
561 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
562 FIXME("(%p)->(%s)\n", This
, debugstr_w(pszFileName
));
566 static HRESULT WINAPI
PersistFile_GetCurFile(IPersistFile
*iface
, LPOLESTR
*pszFileName
)
568 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
569 FIXME("(%p)->(%p)\n", This
, pszFileName
);
573 static const IPersistFileVtbl PersistFileVtbl
= {
574 PersistFile_QueryInterface
,
577 PersistFile_GetClassID
,
581 PersistFile_SaveCompleted
,
582 PersistFile_GetCurFile
585 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
587 static HRESULT WINAPI
PersistStreamInit_QueryInterface(IPersistStreamInit
*iface
,
588 REFIID riid
, void **ppv
)
590 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
591 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
594 static ULONG WINAPI
PersistStreamInit_AddRef(IPersistStreamInit
*iface
)
596 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
597 return IHTMLDocument2_AddRef(HTMLDOC(This
));
600 static ULONG WINAPI
PersistStreamInit_Release(IPersistStreamInit
*iface
)
602 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
603 return IHTMLDocument2_Release(HTMLDOC(This
));
606 static HRESULT WINAPI
PersistStreamInit_GetClassID(IPersistStreamInit
*iface
, CLSID
*pClassID
)
608 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
609 return IPersist_GetClassID(PERSIST(This
), pClassID
);
612 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
614 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
616 TRACE("(%p)\n", This
);
618 if(This
->doc_obj
->usermode
== EDITMODE
)
619 return editor_is_dirty(This
);
624 static HRESULT WINAPI
PersistStreamInit_Load(IPersistStreamInit
*iface
, LPSTREAM pStm
)
626 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
630 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
632 TRACE("(%p)->(%p)\n", This
, pStm
);
634 hres
= CreateURLMoniker(NULL
, about_blankW
, &mon
);
636 WARN("CreateURLMoniker failed: %08x\n", hres
);
640 hres
= set_moniker(This
, mon
, NULL
, TRUE
);
641 IMoniker_Release(mon
);
645 return channelbsc_load_stream(This
->window
->bscallback
, pStm
);
648 static HRESULT WINAPI
PersistStreamInit_Save(IPersistStreamInit
*iface
, LPSTREAM pStm
,
651 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
656 TRACE("(%p)->(%p %x)\n", This
, pStm
, fClearDirty
);
658 hres
= get_doc_string(This
->doc_node
, &str
);
662 hres
= IStream_Write(pStm
, str
, strlen(str
), &written
);
664 FIXME("Write failed: %08x\n", hres
);
669 set_dirty(This
, VARIANT_FALSE
);
674 static HRESULT WINAPI
PersistStreamInit_GetSizeMax(IPersistStreamInit
*iface
,
675 ULARGE_INTEGER
*pcbSize
)
677 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
678 FIXME("(%p)->(%p)\n", This
, pcbSize
);
682 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
684 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
690 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
691 static const WCHAR html_bodyW
[] = {'<','H','T','M','L','>','<','/','H','T','M','L','>',0};
693 TRACE("(%p)\n", This
);
695 body
= GlobalAlloc(0, sizeof(html_bodyW
));
697 return E_OUTOFMEMORY
;
698 memcpy(body
, html_bodyW
, sizeof(html_bodyW
));
700 hres
= CreateURLMoniker(NULL
, about_blankW
, &mon
);
702 WARN("CreateURLMoniker failed: %08x\n", hres
);
707 hres
= set_moniker(This
, mon
, NULL
, FALSE
);
708 IMoniker_Release(mon
);
714 hres
= CreateStreamOnHGlobal(body
, TRUE
, &stream
);
720 hres
= channelbsc_load_stream(This
->window
->bscallback
, stream
);
722 IStream_Release(stream
);
726 #undef PERSTRINIT_THIS
728 static const IPersistStreamInitVtbl PersistStreamInitVtbl
= {
729 PersistStreamInit_QueryInterface
,
730 PersistStreamInit_AddRef
,
731 PersistStreamInit_Release
,
732 PersistStreamInit_GetClassID
,
733 PersistStreamInit_IsDirty
,
734 PersistStreamInit_Load
,
735 PersistStreamInit_Save
,
736 PersistStreamInit_GetSizeMax
,
737 PersistStreamInit_InitNew
740 /**********************************************************
741 * IPersistHistory implementation
744 #define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
746 static HRESULT WINAPI
PersistHistory_QueryInterface(IPersistHistory
*iface
, REFIID riid
, void **ppvObject
)
748 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
749 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
752 static ULONG WINAPI
PersistHistory_AddRef(IPersistHistory
*iface
)
754 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
755 return IHTMLDocument2_AddRef(HTMLDOC(This
));
758 static ULONG WINAPI
PersistHistory_Release(IPersistHistory
*iface
)
760 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
761 return IHTMLDocument2_Release(HTMLDOC(This
));
764 static HRESULT WINAPI
PersistHistory_GetClassID(IPersistHistory
*iface
, CLSID
*pClassID
)
766 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
767 return IPersist_GetClassID(PERSIST(This
), pClassID
);
770 static HRESULT WINAPI
PersistHistory_LoadHistory(IPersistHistory
*iface
, IStream
*pStream
, IBindCtx
*pbc
)
772 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
773 FIXME("(%p)->(%p %p)\n", This
, pStream
, pbc
);
777 static HRESULT WINAPI
PersistHistory_SaveHistory(IPersistHistory
*iface
, IStream
*pStream
)
779 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
780 FIXME("(%p)->(%p)\n", This
, pStream
);
784 static HRESULT WINAPI
PersistHistory_SetPositionCookie(IPersistHistory
*iface
, DWORD dwPositioncookie
)
786 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
787 FIXME("(%p)->(%x)\n", This
, dwPositioncookie
);
791 static HRESULT WINAPI
PersistHistory_GetPositionCookie(IPersistHistory
*iface
, DWORD
*pdwPositioncookie
)
793 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
794 FIXME("(%p)->(%p)\n", This
, pdwPositioncookie
);
798 #undef PERSISTHIST_THIS
800 static const IPersistHistoryVtbl PersistHistoryVtbl
= {
801 PersistHistory_QueryInterface
,
802 PersistHistory_AddRef
,
803 PersistHistory_Release
,
804 PersistHistory_GetClassID
,
805 PersistHistory_LoadHistory
,
806 PersistHistory_SaveHistory
,
807 PersistHistory_SetPositionCookie
,
808 PersistHistory_GetPositionCookie
811 void HTMLDocument_Persist_Init(HTMLDocument
*This
)
813 This
->lpPersistMonikerVtbl
= &PersistMonikerVtbl
;
814 This
->lpPersistFileVtbl
= &PersistFileVtbl
;
815 This
->lpMonikerPropVtbl
= &MonikerPropVtbl
;
816 This
->lpPersistStreamInitVtbl
= &PersistStreamInitVtbl
;
817 This
->lpPersistHistoryVtbl
= &PersistHistoryVtbl
;