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
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 #define HTMLDOC_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument2, iface)
39 static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppvObject)
41 HTMLDocument *This = HTMLDOC_THIS(iface);
44 if(IsEqualGUID(&IID_IUnknown, riid)) {
45 TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppvObject);
46 *ppvObject = HTMLDOC(This);
47 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
48 TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppvObject);
49 *ppvObject = DISPATCHEX(This);
50 }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
51 TRACE("(%p)->(IID_IDispatchEx, %p)\n", This, ppvObject);
52 *ppvObject = DISPATCHEX(This);
53 }else if(IsEqualGUID(&IID_IHTMLDocument, riid)) {
54 TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppvObject);
55 *ppvObject = HTMLDOC(This);
56 }else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) {
57 TRACE("(%p)->(IID_IHTMLDocument2, %p)\n", This, ppvObject);
58 *ppvObject = HTMLDOC(This);
59 }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) {
60 TRACE("(%p)->(IID_IHTMLDocument3, %p)\n", This, ppvObject);
61 *ppvObject = HTMLDOC3(This);
62 }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) {
63 TRACE("(%p)->(IID_IHTMLDocument4, %p)\n", This, ppvObject);
64 *ppvObject = HTMLDOC4(This);
65 }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) {
66 TRACE("(%p)->(IID_IHTMLDocument5, %p)\n", This, ppvObject);
67 *ppvObject = HTMLDOC5(This);
68 }else if(IsEqualGUID(&IID_IPersist, riid)) {
69 TRACE("(%p)->(IID_IPersist, %p)\n", This, ppvObject);
70 *ppvObject = PERSIST(This);
71 }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) {
72 TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppvObject);
73 *ppvObject = PERSISTMON(This);
74 }else if(IsEqualGUID(&IID_IPersistFile, riid)) {
75 TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppvObject);
76 *ppvObject = PERSISTFILE(This);
77 }else if(IsEqualGUID(&IID_IMonikerProp, riid)) {
78 TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppvObject);
79 *ppvObject = MONPROP(This);
80 }else if(IsEqualGUID(&IID_IOleObject, riid)) {
81 TRACE("(%p)->(IID_IOleObject, %p)\n", This, ppvObject);
82 *ppvObject = OLEOBJ(This);
83 }else if(IsEqualGUID(&IID_IOleDocument, riid)) {
84 TRACE("(%p)->(IID_IOleDocument, %p)\n", This, ppvObject);
85 *ppvObject = OLEDOC(This);
86 }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) {
87 TRACE("(%p)->(IID_IOleDocumentView, %p)\n", This, ppvObject);
88 *ppvObject = DOCVIEW(This);
89 }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
90 TRACE("(%p)->(IID_IOleInPlaceActiveObject, %p)\n", This, ppvObject);
91 *ppvObject = ACTOBJ(This);
92 }else if(IsEqualGUID(&IID_IViewObject, riid)) {
93 TRACE("(%p)->(IID_IViewObject, %p)\n", This, ppvObject);
94 *ppvObject = VIEWOBJ(This);
95 }else if(IsEqualGUID(&IID_IViewObject2, riid)) {
96 TRACE("(%p)->(IID_IViewObject2, %p)\n", This, ppvObject);
97 *ppvObject = VIEWOBJ2(This);
98 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
99 TRACE("(%p)->(IID_IOleWindow, %p)\n", This, ppvObject);
100 *ppvObject = OLEWIN(This);
101 }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) {
102 TRACE("(%p)->(IID_IOleInPlaceObject, %p)\n", This, ppvObject);
103 *ppvObject = INPLACEOBJ(This);
104 }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) {
105 TRACE("(%p)->(IID_IOleInPlaceObjectWindowless, %p)\n", This, ppvObject);
106 *ppvObject = INPLACEWIN(This);
107 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
108 TRACE("(%p)->(IID_IServiceProvider, %p)\n", This, ppvObject);
109 *ppvObject = SERVPROV(This);
110 }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
111 TRACE("(%p)->(IID_IOleCommandTarget, %p)\n", This, ppvObject);
112 *ppvObject = CMDTARGET(This);
113 }else if(IsEqualGUID(&IID_IOleControl, riid)) {
114 TRACE("(%p)->(IID_IOleControl, %p)\n", This, ppvObject);
115 *ppvObject = CONTROL(This);
116 }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) {
117 TRACE("(%p)->(IID_IHlinkTarget, %p)\n", This, ppvObject);
118 *ppvObject = HLNKTARGET(This);
119 }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
120 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppvObject);
121 *ppvObject = CONPTCONT(&This->cp_container);
122 }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) {
123 TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppvObject);
124 *ppvObject = PERSTRINIT(This);
125 }else if(IsEqualGUID(&IID_ICustomDoc, riid)) {
126 TRACE("(%p)->(IID_ICustomDoc %p)\n", This, ppvObject);
127 *ppvObject = CUSTOMDOC(This);
128 }else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) {
129 TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppvObject);
130 *ppvObject = HTMLDOC(This);
131 }else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
132 FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppvObject);
133 return E_NOINTERFACE;
134 }else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
135 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppvObject);
136 return E_NOINTERFACE;
137 }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
138 TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppvObject);
139 return E_NOINTERFACE;
140 }else if(dispex_query_interface(&This->dispex, riid, ppvObject)) {
141 return *ppvObject ? S_OK : E_NOINTERFACE;
145 IHTMLDocument2_AddRef(iface);
149 FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppvObject);
150 return E_NOINTERFACE;
153 static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface)
155 HTMLDocument *This = HTMLDOC_THIS(iface);
156 ULONG ref = InterlockedIncrement(&This->ref);
157 TRACE("(%p) ref = %u\n", This, ref);
161 static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
163 HTMLDocument *This = HTMLDOC_THIS(iface);
164 ULONG ref = InterlockedDecrement(&This->ref);
166 TRACE("(%p) ref = %u\n", This, ref);
169 remove_doc_tasks(This);
170 release_script_hosts(This);
173 IOleObject_SetClientSite(OLEOBJ(This), NULL);
174 if(This->in_place_active)
175 IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
177 IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
179 IOleUndoManager_Release(This->undomgr);
181 set_document_bscallback(This, NULL);
182 set_current_mon(This, NULL);
184 if(This->tooltips_hwnd)
185 DestroyWindow(This->tooltips_hwnd);
187 DestroyWindow(This->hwnd);
189 if(This->option_factory) {
190 This->option_factory->doc = NULL;
191 IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory));
195 This->location->doc = NULL;
198 IHTMLWindow2_Release(HTMLWINDOW2(This->window));
200 heap_free(This->mime);
201 detach_selection(This);
205 ConnectionPointContainer_Destroy(&This->cp_container);
207 if(This->nscontainer)
208 NSContainer_Release(This->nscontainer);
218 static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo)
220 HTMLDocument *This = HTMLDOC_THIS(iface);
222 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
225 static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo,
226 LCID lcid, ITypeInfo **ppTInfo)
228 HTMLDocument *This = HTMLDOC_THIS(iface);
230 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
233 static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid,
234 LPOLESTR *rgszNames, UINT cNames,
235 LCID lcid, DISPID *rgDispId)
237 HTMLDocument *This = HTMLDOC_THIS(iface);
239 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
242 static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember,
243 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
244 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
246 HTMLDocument *This = HTMLDOC_THIS(iface);
248 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
249 pVarResult, pExcepInfo, puArgErr);
252 static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
254 HTMLDocument *This = HTMLDOC_THIS(iface);
255 FIXME("(%p)->(%p)\n", This, p);
259 static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
261 HTMLDocument *This = HTMLDOC_THIS(iface);
262 nsIDOMDocument *nsdoc = NULL;
263 nsIDOMElement *nselem = NULL;
266 TRACE("(%p)->(%p)\n", This, p);
268 if(!This->nscontainer) {
273 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
275 ERR("GetDocument failed: %08x\n", nsres);
278 nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem);
280 ERR("GetDocumentElement failed: %08x\n", nsres);
288 *p = create_all_collection(get_node(This, (nsIDOMNode*)nselem, TRUE));
290 nsIDOMElement_Release(nselem);
294 static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
296 HTMLDocument *This = HTMLDOC_THIS(iface);
297 nsIDOMDocument *nsdoc;
298 nsIDOMHTMLDocument *nshtmldoc;
299 nsIDOMHTMLElement *nsbody = NULL;
303 TRACE("(%p)->(%p)\n", This, p);
307 if(!This->nscontainer)
310 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
311 if(NS_FAILED(nsres)) {
312 ERR("GetDocument failed: %08x\n", nsres);
316 if(NS_FAILED(nsres) || !nsdoc)
319 nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
320 nsIDOMDocument_Release(nsdoc);
322 nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
323 nsIDOMHTMLDocument_Release(nshtmldoc);
325 if(NS_FAILED(nsres) || !nsbody) {
326 TRACE("Could not get body: %08x\n", nsres);
330 node = get_node(This, (nsIDOMNode*)nsbody, TRUE);
331 nsIDOMHTMLElement_Release(nsbody);
333 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
335 TRACE("*p = %p\n", *p);
339 static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
341 HTMLDocument *This = HTMLDOC_THIS(iface);
342 FIXME("(%p)->(%p)\n", This, p);
346 static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
348 HTMLDocument *This = HTMLDOC_THIS(iface);
349 FIXME("(%p)->(%p)\n", This, p);
353 static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
355 HTMLDocument *This = HTMLDOC_THIS(iface);
356 FIXME("(%p)->(%p)\n", This, p);
360 static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
362 HTMLDocument *This = HTMLDOC_THIS(iface);
363 FIXME("(%p)->(%p)\n", This, p);
367 static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
369 HTMLDocument *This = HTMLDOC_THIS(iface);
370 FIXME("(%p)->(%p)\n", This, p);
374 static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
376 HTMLDocument *This = HTMLDOC_THIS(iface);
377 FIXME("(%p)->(%p)\n", This, p);
381 static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
383 HTMLDocument *This = HTMLDOC_THIS(iface);
384 nsIDOMHTMLDocument *nshtmldoc;
385 nsIDOMDocument *nsdoc;
389 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
391 if(!This->nscontainer)
394 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
395 if(NS_FAILED(nsres) || !nsdoc) {
396 ERR("GetDocument failed: %08x\n", nsres);
400 nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
401 nsIDOMDocument_Release(nsdoc);
403 nsAString_Init(&nsstr, v);
404 nsres = nsIDOMHTMLDocument_SetTitle(nshtmldoc, &nsstr);
405 nsIDOMHTMLDocument_Release(nshtmldoc);
406 nsAString_Finish(&nsstr);
408 ERR("SetTitle failed: %08x\n", nsres);
413 static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
415 HTMLDocument *This = HTMLDOC_THIS(iface);
416 FIXME("(%p)->(%p)\n", This, p);
420 static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
422 HTMLDocument *This = HTMLDOC_THIS(iface);
423 FIXME("(%p)->(%p)\n", This, p);
427 static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
429 HTMLDocument *This = HTMLDOC_THIS(iface);
430 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
434 static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
436 HTMLDocument *This = HTMLDOC_THIS(iface);
437 FIXME("(%p)->(%p)\n", This, p);
441 static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
443 HTMLDocument *This = HTMLDOC_THIS(iface);
444 nsISelection *nsselection = NULL;
446 TRACE("(%p)->(%p)\n", This, p);
448 if(This->nscontainer) {
449 nsIDOMWindow *dom_window = NULL;
451 nsIWebBrowser_GetContentDOMWindow(This->nscontainer->webbrowser, &dom_window);
453 nsIDOMWindow_GetSelection(dom_window, &nsselection);
454 nsIDOMWindow_Release(dom_window);
458 *p = HTMLSelectionObject_Create(This, nsselection);
462 static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p)
464 HTMLDocument *This = HTMLDOC_THIS(iface);
466 static const WCHAR wszUninitialized[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
467 static const WCHAR wszLoading[] = {'l','o','a','d','i','n','g',0};
468 static const WCHAR wszLoaded[] = {'l','o','a','d','e','d',0};
469 static const WCHAR wszInteractive[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
470 static const WCHAR wszComplete[] = {'c','o','m','p','l','e','t','e',0};
472 static const LPCWSTR readystate_str[] = {
480 TRACE("(%p)->(%p)\n", iface, p);
485 *p = SysAllocString(readystate_str[This->readystate]);
489 static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
491 HTMLDocument *This = HTMLDOC_THIS(iface);
492 FIXME("(%p)->(%p)\n", This, p);
496 static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
498 HTMLDocument *This = HTMLDOC_THIS(iface);
499 FIXME("(%p)->(%p)\n", This, p);
503 static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p)
505 HTMLDocument *This = HTMLDOC_THIS(iface);
506 FIXME("(%p)->(%p)\n", This, p);
510 static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v)
512 HTMLDocument *This = HTMLDOC_THIS(iface);
513 FIXME("(%p)\n", This);
517 static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p)
519 HTMLDocument *This = HTMLDOC_THIS(iface);
520 FIXME("(%p)->(%p)\n", This, p);
524 static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
526 HTMLDocument *This = HTMLDOC_THIS(iface);
527 FIXME("(%p)\n", This);
531 static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p)
533 HTMLDocument *This = HTMLDOC_THIS(iface);
534 FIXME("(%p)->(%p)\n", This, p);
538 static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v)
540 HTMLDocument *This = HTMLDOC_THIS(iface);
541 FIXME("(%p)\n", This);
545 static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p)
547 HTMLDocument *This = HTMLDOC_THIS(iface);
548 FIXME("(%p)->(%p)\n", This, p);
552 static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v)
554 HTMLDocument *This = HTMLDOC_THIS(iface);
555 FIXME("(%p)->()\n", This);
559 static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p)
561 HTMLDocument *This = HTMLDOC_THIS(iface);
562 FIXME("(%p)->(%p)\n", This, p);
566 static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v)
568 HTMLDocument *This = HTMLDOC_THIS(iface);
569 FIXME("(%p)\n", This);
573 static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p)
575 HTMLDocument *This = HTMLDOC_THIS(iface);
576 FIXME("(%p)->(%p)\n", This, p);
580 static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
582 HTMLDocument *This = HTMLDOC_THIS(iface);
583 FIXME("(%p)->(%p)\n", This, p);
587 static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
589 HTMLDocument *This = HTMLDOC_THIS(iface);
591 TRACE("(%p)->(%p)\n", This, p);
594 IHTMLLocation_AddRef(HTMLLOCATION(This->location));
596 This->location = HTMLLocation_Create(This);
598 *p = HTMLLOCATION(This->location);
602 static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
604 HTMLDocument *This = HTMLDOC_THIS(iface);
605 FIXME("(%p)->(%p)\n", This, p);
609 static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
611 HTMLDocument *This = HTMLDOC_THIS(iface);
612 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
616 static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
618 HTMLDocument *This = HTMLDOC_THIS(iface);
620 static const WCHAR about_blank_url[] =
621 {'a','b','o','u','t',':','b','l','a','n','k',0};
623 TRACE("(%p)->(%p)\n", iface, p);
625 *p = SysAllocString(This->url ? This->url : about_blank_url);
629 static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
631 HTMLDocument *This = HTMLDOC_THIS(iface);
632 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
636 static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
638 HTMLDocument *This = HTMLDOC_THIS(iface);
639 FIXME("(%p)->(%p)\n", This, p);
643 static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
645 HTMLDocument *This = HTMLDOC_THIS(iface);
646 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
650 static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
652 HTMLDocument *This = HTMLDOC_THIS(iface);
653 FIXME("(%p)->(%p)\n", This, p);
657 static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v)
659 HTMLDocument *This = HTMLDOC_THIS(iface);
660 FIXME("(%p)->(%x)\n", This, v);
664 static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p)
666 HTMLDocument *This = HTMLDOC_THIS(iface);
667 FIXME("(%p)->(%p)\n", This, p);
671 static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v)
673 HTMLDocument *This = HTMLDOC_THIS(iface);
674 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
678 static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
680 HTMLDocument *This = HTMLDOC_THIS(iface);
681 FIXME("(%p)->(%p)\n", This, p);
685 static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v)
687 HTMLDocument *This = HTMLDOC_THIS(iface);
688 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
692 static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p)
694 HTMLDocument *This = HTMLDOC_THIS(iface);
695 FIXME("(%p)->(%p)\n", This, p);
699 static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p)
701 HTMLDocument *This = HTMLDOC_THIS(iface);
702 FIXME("(%p)->(%p)\n", This, p);
706 static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p)
708 HTMLDocument *This = HTMLDOC_THIS(iface);
709 FIXME("(%p)->(%p)\n", This, p);
713 static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p)
715 HTMLDocument *This = HTMLDOC_THIS(iface);
716 FIXME("(%p)->(%p)\n", This, p);
720 static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p)
722 HTMLDocument *This = HTMLDOC_THIS(iface);
723 FIXME("(%p)->(%p)\n", This, p);
727 static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p)
729 HTMLDocument *This = HTMLDOC_THIS(iface);
730 FIXME("(%p)->(%p)\n", This, p);
734 static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p)
736 HTMLDocument *This = HTMLDOC_THIS(iface);
737 FIXME("(%p)->(%p)\n", This, p);
741 static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p)
743 HTMLDocument *This = HTMLDOC_THIS(iface);
744 FIXME("(%p)->(%p)\n", This, p);
748 static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
750 HTMLDocument *This = HTMLDOC_THIS(iface);
751 FIXME("(%p)->(%p)\n", This, p);
755 static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
757 HTMLDocument *This = HTMLDOC_THIS(iface);
758 nsIDOMDocument *domdoc;
759 nsIDOMHTMLDocument *nsdoc;
766 TRACE("(%p)->(%p)\n", iface, psarray);
768 if(psarray->cDims != 1) {
769 FIXME("cDims=%d\n", psarray->cDims);
773 if(!This->nscontainer)
776 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &domdoc);
777 if(NS_FAILED(nsres)) {
778 ERR("GetDocument failed: %08x\n", nsres);
782 nsres = nsIDOMDocument_QueryInterface(domdoc, &IID_nsIDOMHTMLDocument, (void**)&nsdoc);
783 nsIDOMDocument_Release(domdoc);
787 hres = SafeArrayAccessData(psarray, (void**)&var);
789 WARN("SafeArrayAccessData failed: %08x\n", hres);
790 nsIDOMHTMLDocument_Release(nsdoc);
794 nsAString_Init(&nsstr, NULL);
796 for(i=0; i < psarray->rgsabound[0].cElements; i++) {
797 if(V_VT(var+i) == VT_BSTR) {
798 nsAString_SetData(&nsstr, V_BSTR(var+i));
799 nsres = nsIDOMHTMLDocument_Write(nsdoc, &nsstr);
801 ERR("Write failed: %08x\n", nsres);
803 FIXME("vt=%d\n", V_VT(var+i));
807 nsAString_Finish(&nsstr);
808 SafeArrayUnaccessData(psarray);
809 nsIDOMHTMLDocument_Release(nsdoc);
814 static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray)
816 HTMLDocument *This = HTMLDOC_THIS(iface);
817 FIXME("(%p)->(%p)\n", This, psarray);
821 static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name,
822 VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
824 HTMLDocument *This = HTMLDOC_THIS(iface);
825 FIXME("(%p)->(%s %p)\n", This, debugstr_w(url), pomWindowResult);
829 static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
831 HTMLDocument *This = HTMLDOC_THIS(iface);
832 FIXME("(%p)\n", This);
836 static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
838 HTMLDocument *This = HTMLDOC_THIS(iface);
839 FIXME("(%p)\n", This);
843 static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,
846 HTMLDocument *This = HTMLDOC_THIS(iface);
847 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
851 static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID,
854 HTMLDocument *This = HTMLDOC_THIS(iface);
855 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
859 static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID,
862 HTMLDocument *This = HTMLDOC_THIS(iface);
863 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
867 static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID,
870 HTMLDocument *This = HTMLDOC_THIS(iface);
871 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
875 static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID,
878 HTMLDocument *This = HTMLDOC_THIS(iface);
879 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
883 static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID,
886 HTMLDocument *This = HTMLDOC_THIS(iface);
887 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
891 static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID,
892 VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet)
894 HTMLDocument *This = HTMLDOC_THIS(iface);
895 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(cmdID), showUI, pfRet);
899 static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID,
902 HTMLDocument *This = HTMLDOC_THIS(iface);
903 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
907 static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag,
908 IHTMLElement **newElem)
910 HTMLDocument *This = HTMLDOC_THIS(iface);
911 nsIDOMDocument *nsdoc;
912 nsIDOMElement *nselem;
917 TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
919 nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
921 nsAString_Init(&tag_str, eTag);
922 nsres = nsIDOMDocument_CreateElement(nsdoc, &tag_str, &nselem);
923 nsAString_Finish(&tag_str);
924 nsIDOMDocument_Release(nsdoc);
925 if(NS_FAILED(nsres)) {
926 ERR("CreateElement failed: %08x\n", nsres);
930 elem = HTMLElement_Create(This, (nsIDOMNode*)nselem, TRUE);
931 nsIDOMElement_Release(nselem);
933 *newElem = HTMLELEM(elem);
934 IHTMLElement_AddRef(HTMLELEM(elem));
938 static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)
940 HTMLDocument *This = HTMLDOC_THIS(iface);
941 FIXME("(%p)\n", This);
945 static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p)
947 HTMLDocument *This = HTMLDOC_THIS(iface);
948 FIXME("(%p)->(%p)\n", This, p);
952 static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
954 HTMLDocument *This = HTMLDOC_THIS(iface);
955 FIXME("(%p)\n", This);
959 static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p)
961 HTMLDocument *This = HTMLDOC_THIS(iface);
962 FIXME("(%p)->(%p)\n", This, p);
966 static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v)
968 HTMLDocument *This = HTMLDOC_THIS(iface);
969 FIXME("(%p)\n", This);
973 static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p)
975 HTMLDocument *This = HTMLDOC_THIS(iface);
976 FIXME("(%p)->(%p)\n", This, p);
980 static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
982 HTMLDocument *This = HTMLDOC_THIS(iface);
983 FIXME("(%p)\n", This);
987 static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
989 HTMLDocument *This = HTMLDOC_THIS(iface);
990 FIXME("(%p)->(%p)\n", This, p);
994 static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
996 HTMLDocument *This = HTMLDOC_THIS(iface);
997 FIXME("(%p)\n", This);
1001 static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
1003 HTMLDocument *This = HTMLDOC_THIS(iface);
1004 FIXME("(%p)->(%p)\n", This, p);
1008 static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
1010 HTMLDocument *This = HTMLDOC_THIS(iface);
1011 FIXME("(%p)\n", This);
1015 static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p)
1017 HTMLDocument *This = HTMLDOC_THIS(iface);
1018 FIXME("(%p)->(%p)\n", This, p);
1022 static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v)
1024 HTMLDocument *This = HTMLDOC_THIS(iface);
1025 FIXME("(%p)\n", This);
1029 static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p)
1031 HTMLDocument *This = HTMLDOC_THIS(iface);
1032 FIXME("(%p)->(%p)\n", This, p);
1036 static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v)
1038 HTMLDocument *This = HTMLDOC_THIS(iface);
1039 FIXME("(%p)\n", This);
1043 static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p)
1045 HTMLDocument *This = HTMLDOC_THIS(iface);
1046 FIXME("(%p)->(%p)\n", This, p);
1050 static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v)
1052 HTMLDocument *This = HTMLDOC_THIS(iface);
1053 FIXME("(%p)\n", This);
1057 static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p)
1059 HTMLDocument *This = HTMLDOC_THIS(iface);
1060 FIXME("(%p)->(%p)\n", This, p);
1064 static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v)
1066 HTMLDocument *This = HTMLDOC_THIS(iface);
1067 FIXME("(%p)\n", This);
1071 static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p)
1073 HTMLDocument *This = HTMLDOC_THIS(iface);
1074 FIXME("(%p)->(%p)\n", This, p);
1078 static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v)
1080 HTMLDocument *This = HTMLDOC_THIS(iface);
1081 FIXME("(%p)\n", This);
1085 static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
1087 HTMLDocument *This = HTMLDOC_THIS(iface);
1088 FIXME("(%p)->(%p)\n", This, p);
1092 static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v)
1094 HTMLDocument *This = HTMLDOC_THIS(iface);
1095 FIXME("(%p)\n", This);
1099 static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p)
1101 HTMLDocument *This = HTMLDOC_THIS(iface);
1102 FIXME("(%p)->(%p)\n", This, p);
1106 static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v)
1108 HTMLDocument *This = HTMLDOC_THIS(iface);
1109 FIXME("(%p)\n", This);
1113 static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p)
1115 HTMLDocument *This = HTMLDOC_THIS(iface);
1116 FIXME("(%p)->(%p)\n", This, p);
1120 static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v)
1122 HTMLDocument *This = HTMLDOC_THIS(iface);
1123 FIXME("(%p)\n", This);
1127 static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p)
1129 HTMLDocument *This = HTMLDOC_THIS(iface);
1130 FIXME("(%p)->(%p)\n", This, p);
1134 static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v)
1136 HTMLDocument *This = HTMLDOC_THIS(iface);
1137 FIXME("(%p)\n", This);
1141 static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p)
1143 HTMLDocument *This = HTMLDOC_THIS(iface);
1144 FIXME("(%p)->(%p)\n", This, p);
1148 static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
1150 HTMLDocument *This = HTMLDOC_THIS(iface);
1151 FIXME("(%p)\n", This);
1155 static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
1157 HTMLDocument *This = HTMLDOC_THIS(iface);
1158 FIXME("(%p)->(%p)\n", This, p);
1162 static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
1164 HTMLDocument *This = HTMLDOC_THIS(iface);
1165 FIXME("(%p)\n", This);
1169 static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
1171 HTMLDocument *This = HTMLDOC_THIS(iface);
1172 FIXME("(%p)->(%p)\n", This, p);
1176 static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, long x, long y,
1177 IHTMLElement **elementHit)
1179 HTMLDocument *This = HTMLDOC_THIS(iface);
1180 FIXME("(%p)->(%ld %ld %p)\n", This, x, y, elementHit);
1184 static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p)
1186 HTMLDocument *This = HTMLDOC_THIS(iface);
1188 TRACE("(%p)->(%p)\n", This, p);
1190 *p = HTMLWINDOW2(This->window);
1191 IHTMLWindow2_AddRef(*p);
1195 static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
1196 IHTMLStyleSheetsCollection **p)
1198 HTMLDocument *This = HTMLDOC_THIS(iface);
1199 nsIDOMStyleSheetList *nsstylelist;
1200 nsIDOMDocumentStyle *nsdocstyle;
1201 nsIDOMDocument *nsdoc;
1204 TRACE("(%p)->(%p)\n", This, p);
1208 if(!This->nscontainer)
1211 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
1212 if(NS_FAILED(nsres)) {
1213 ERR("GetDocument failed: %08x\n", nsres);
1217 if(NS_FAILED(nsres) || !nsdoc)
1220 nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
1221 nsIDOMDocument_Release(nsdoc);
1223 nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
1224 nsIDOMDocumentStyle_Release(nsdocstyle);
1226 *p = HTMLStyleSheetsCollection_Create(nsstylelist);
1227 nsIDOMDocumentStyle_Release(nsstylelist);
1232 static HRESULT WINAPI HTMLDocument_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v)
1234 HTMLDocument *This = HTMLDOC_THIS(iface);
1235 FIXME("(%p)\n", This);
1239 static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p)
1241 HTMLDocument *This = HTMLDOC_THIS(iface);
1242 FIXME("(%p)->(%p)\n", This, p);
1246 static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v)
1248 HTMLDocument *This = HTMLDOC_THIS(iface);
1249 FIXME("(%p)\n", This);
1253 static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p)
1255 HTMLDocument *This = HTMLDOC_THIS(iface);
1256 FIXME("(%p)->(%p)\n", This, p);
1260 static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
1262 HTMLDocument *This = HTMLDOC_THIS(iface);
1263 FIXME("(%p)->(%p)\n", This, String);
1267 static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
1268 long lIndex, IHTMLStyleSheet **ppnewStyleSheet)
1270 HTMLDocument *This = HTMLDOC_THIS(iface);
1272 FIXME("(%p)->(%s %ld %p) semi-stub\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
1274 *ppnewStyleSheet = HTMLStyleSheet_Create(NULL);
1278 static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
1279 HTMLDocument_QueryInterface,
1280 HTMLDocument_AddRef,
1281 HTMLDocument_Release,
1282 HTMLDocument_GetTypeInfoCount,
1283 HTMLDocument_GetTypeInfo,
1284 HTMLDocument_GetIDsOfNames,
1285 HTMLDocument_Invoke,
1286 HTMLDocument_get_Script,
1287 HTMLDocument_get_all,
1288 HTMLDocument_get_body,
1289 HTMLDocument_get_activeElement,
1290 HTMLDocument_get_images,
1291 HTMLDocument_get_applets,
1292 HTMLDocument_get_links,
1293 HTMLDocument_get_forms,
1294 HTMLDocument_get_anchors,
1295 HTMLDocument_put_title,
1296 HTMLDocument_get_title,
1297 HTMLDocument_get_scripts,
1298 HTMLDocument_put_designMode,
1299 HTMLDocument_get_designMode,
1300 HTMLDocument_get_selection,
1301 HTMLDocument_get_readyState,
1302 HTMLDocument_get_frames,
1303 HTMLDocument_get_embeds,
1304 HTMLDocument_get_plugins,
1305 HTMLDocument_put_alinkColor,
1306 HTMLDocument_get_alinkColor,
1307 HTMLDocument_put_bgColor,
1308 HTMLDocument_get_bgColor,
1309 HTMLDocument_put_fgColor,
1310 HTMLDocument_get_fgColor,
1311 HTMLDocument_put_linkColor,
1312 HTMLDocument_get_linkColor,
1313 HTMLDocument_put_vlinkColor,
1314 HTMLDocument_get_vlinkColor,
1315 HTMLDocument_get_referrer,
1316 HTMLDocument_get_location,
1317 HTMLDocument_get_lastModified,
1318 HTMLDocument_put_URL,
1319 HTMLDocument_get_URL,
1320 HTMLDocument_put_domain,
1321 HTMLDocument_get_domain,
1322 HTMLDocument_put_cookie,
1323 HTMLDocument_get_cookie,
1324 HTMLDocument_put_expando,
1325 HTMLDocument_get_expando,
1326 HTMLDocument_put_charset,
1327 HTMLDocument_get_charset,
1328 HTMLDocument_put_defaultCharset,
1329 HTMLDocument_get_defaultCharset,
1330 HTMLDocument_get_mimeType,
1331 HTMLDocument_get_fileSize,
1332 HTMLDocument_get_fileCreatedDate,
1333 HTMLDocument_get_fileModifiedDate,
1334 HTMLDocument_get_fileUpdatedDate,
1335 HTMLDocument_get_security,
1336 HTMLDocument_get_protocol,
1337 HTMLDocument_get_nameProp,
1339 HTMLDocument_writeln,
1343 HTMLDocument_queryCommandSupported,
1344 HTMLDocument_queryCommandEnabled,
1345 HTMLDocument_queryCommandState,
1346 HTMLDocument_queryCommandIndeterm,
1347 HTMLDocument_queryCommandText,
1348 HTMLDocument_queryCommandValue,
1349 HTMLDocument_execCommand,
1350 HTMLDocument_execCommandShowHelp,
1351 HTMLDocument_createElement,
1352 HTMLDocument_put_onhelp,
1353 HTMLDocument_get_onhelp,
1354 HTMLDocument_put_onclick,
1355 HTMLDocument_get_onclick,
1356 HTMLDocument_put_ondblclick,
1357 HTMLDocument_get_ondblclick,
1358 HTMLDocument_put_onkeyup,
1359 HTMLDocument_get_onkeyup,
1360 HTMLDocument_put_onkeydown,
1361 HTMLDocument_get_onkeydown,
1362 HTMLDocument_put_onkeypress,
1363 HTMLDocument_get_onkeypress,
1364 HTMLDocument_put_onmouseup,
1365 HTMLDocument_get_onmouseup,
1366 HTMLDocument_put_onmousedown,
1367 HTMLDocument_get_onmousedown,
1368 HTMLDocument_put_onmousemove,
1369 HTMLDocument_get_onmousemove,
1370 HTMLDocument_put_onmouseout,
1371 HTMLDocument_get_onmouseout,
1372 HTMLDocument_put_onmouseover,
1373 HTMLDocument_get_onmouseover,
1374 HTMLDocument_put_onreadystatechange,
1375 HTMLDocument_get_onreadystatechange,
1376 HTMLDocument_put_onafterupdate,
1377 HTMLDocument_get_onafterupdate,
1378 HTMLDocument_put_onrowexit,
1379 HTMLDocument_get_onrowexit,
1380 HTMLDocument_put_onrowenter,
1381 HTMLDocument_get_onrowenter,
1382 HTMLDocument_put_ondragstart,
1383 HTMLDocument_get_ondragstart,
1384 HTMLDocument_put_onselectstart,
1385 HTMLDocument_get_onselectstart,
1386 HTMLDocument_elementFromPoint,
1387 HTMLDocument_get_parentWindow,
1388 HTMLDocument_get_styleSheets,
1389 HTMLDocument_put_onbeforeupdate,
1390 HTMLDocument_get_onbeforeupdate,
1391 HTMLDocument_put_onerrorupdate,
1392 HTMLDocument_get_onerrorupdate,
1393 HTMLDocument_toString,
1394 HTMLDocument_createStyleSheet
1397 #define DISPEX_THIS(iface) DEFINE_THIS(HTMLDocument, IDispatchEx, iface)
1399 static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
1401 HTMLDocument *This = DISPEX_THIS(iface);
1403 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
1406 static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface)
1408 HTMLDocument *This = DISPEX_THIS(iface);
1410 return IHTMLDocument2_AddRef(HTMLDOC(This));
1413 static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface)
1415 HTMLDocument *This = DISPEX_THIS(iface);
1417 return IHTMLDocument2_Release(HTMLDOC(This));
1420 static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
1422 HTMLDocument *This = DISPEX_THIS(iface);
1424 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
1427 static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
1428 LCID lcid, ITypeInfo **ppTInfo)
1430 HTMLDocument *This = DISPEX_THIS(iface);
1432 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
1435 static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
1436 LPOLESTR *rgszNames, UINT cNames,
1437 LCID lcid, DISPID *rgDispId)
1439 HTMLDocument *This = DISPEX_THIS(iface);
1441 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
1444 static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
1445 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1446 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1448 HTMLDocument *This = DISPEX_THIS(iface);
1450 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
1451 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1453 switch(dispIdMember) {
1454 case DISPID_READYSTATE:
1455 TRACE("DISPID_READYSTATE\n");
1457 if(!(wFlags & DISPATCH_PROPERTYGET))
1458 return E_INVALIDARG;
1460 V_VT(pVarResult) = VT_I4;
1461 V_I4(pVarResult) = This->readystate;
1465 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
1466 pVarResult, pExcepInfo, puArgErr);
1469 static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
1471 HTMLDocument *This = DISPEX_THIS(iface);
1473 return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
1476 static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
1477 VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
1479 HTMLDocument *This = DISPEX_THIS(iface);
1481 return IDispatchEx_InvokeEx(DISPATCHEX(&This->dispex), id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1484 static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
1486 HTMLDocument *This = DISPEX_THIS(iface);
1488 return IDispatchEx_DeleteMemberByName(DISPATCHEX(&This->dispex), bstrName, grfdex);
1491 static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
1493 HTMLDocument *This = DISPEX_THIS(iface);
1495 return IDispatchEx_DeleteMemberByDispID(DISPATCHEX(&This->dispex), id);
1498 static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
1500 HTMLDocument *This = DISPEX_THIS(iface);
1502 return IDispatchEx_GetMemberProperties(DISPATCHEX(&This->dispex), id, grfdexFetch, pgrfdex);
1505 static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
1507 HTMLDocument *This = DISPEX_THIS(iface);
1509 return IDispatchEx_GetMemberName(DISPATCHEX(&This->dispex), id, pbstrName);
1512 static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
1514 HTMLDocument *This = DISPEX_THIS(iface);
1516 return IDispatchEx_GetNextDispID(DISPATCHEX(&This->dispex), grfdex, id, pid);
1519 static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
1521 HTMLDocument *This = DISPEX_THIS(iface);
1523 return IDispatchEx_GetNameSpaceParent(DISPATCHEX(&This->dispex), ppunk);
1528 static const IDispatchExVtbl DocDispatchExVtbl = {
1529 DocDispatchEx_QueryInterface,
1530 DocDispatchEx_AddRef,
1531 DocDispatchEx_Release,
1532 DocDispatchEx_GetTypeInfoCount,
1533 DocDispatchEx_GetTypeInfo,
1534 DocDispatchEx_GetIDsOfNames,
1535 DocDispatchEx_Invoke,
1536 DocDispatchEx_GetDispID,
1537 DocDispatchEx_InvokeEx,
1538 DocDispatchEx_DeleteMemberByName,
1539 DocDispatchEx_DeleteMemberByDispID,
1540 DocDispatchEx_GetMemberProperties,
1541 DocDispatchEx_GetMemberName,
1542 DocDispatchEx_GetNextDispID,
1543 DocDispatchEx_GetNameSpaceParent
1546 static const tid_t HTMLDocument_iface_tids[] = {
1553 static dispex_static_data_t HTMLDocument_dispex = {
1555 DispHTMLDocument_tid,
1557 HTMLDocument_iface_tids
1560 HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
1565 TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
1567 ret = heap_alloc_zero(sizeof(HTMLDocument));
1568 ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
1569 ret->lpIDispatchExVtbl = &DocDispatchExVtbl;
1571 ret->readystate = READYSTATE_UNINITIALIZED;
1573 list_init(&ret->bindings);
1574 list_init(&ret->script_hosts);
1575 list_init(&ret->selection_list);
1576 list_init(&ret->range_list);
1578 hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
1586 HTMLDocument_HTMLDocument3_Init(ret);
1587 HTMLDocument_HTMLDocument5_Init(ret);
1588 HTMLDocument_Persist_Init(ret);
1589 HTMLDocument_OleCmd_Init(ret);
1590 HTMLDocument_OleObj_Init(ret);
1591 HTMLDocument_View_Init(ret);
1592 HTMLDocument_Window_Init(ret);
1593 HTMLDocument_Service_Init(ret);
1594 HTMLDocument_Hlink_Init(ret);
1596 ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLDOC(ret));
1597 ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
1598 ConnectionPoint_Init(&ret->cp_htmldocevents, &ret->cp_container, &DIID_HTMLDocumentEvents);
1599 ConnectionPoint_Init(&ret->cp_htmldocevents2, &ret->cp_container, &DIID_HTMLDocumentEvents2);
1601 init_dispex(&ret->dispex, (IUnknown*)HTMLDOC(ret), &HTMLDocument_dispex);
1603 ret->nscontainer = NSContainer_Create(ret, NULL);
1604 ret->window = HTMLWindow_Create(ret);