2 * Copyright 2007 Jacek Caban for CodeWeavers
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 static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
39 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
42 static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
43 REFIID riid, void **ppv)
45 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
46 return htmldoc_query_interface(This, riid, ppv);
49 static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
51 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
52 return htmldoc_addref(This);
55 static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
57 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
58 return htmldoc_release(This);
61 static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
63 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
64 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
67 static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
68 LCID lcid, ITypeInfo **ppTInfo)
70 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
71 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
74 static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
75 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
77 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
78 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
81 static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
82 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
83 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
85 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
86 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
87 pVarResult, pExcepInfo, puArgErr);
90 static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
92 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
93 FIXME("(%p)->(v)\n", This);
97 static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
99 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
100 FIXME("(%p)->(%p)\n", This, p);
104 static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
106 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
107 FIXME("(%p)->(%p)\n", This, p);
111 static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
113 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
114 FIXME("(%p)->(%p)\n", This, p);
118 static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
119 IHTMLDOMAttribute **ppattribute)
121 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
122 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
126 static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
127 IHTMLDOMNode **ppRetNode)
129 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
130 nsIDOMComment *nscomment;
136 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
138 if(!This->doc_node->nsdoc) {
139 WARN("NULL nsdoc\n");
143 nsAString_InitDepend(&str, bstrdata);
144 nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
145 nsAString_Finish(&str);
146 if(NS_FAILED(nsres)) {
147 ERR("CreateTextNode failed: %08x\n", nsres);
151 hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
152 nsIDOMElement_Release(nscomment);
156 *ppRetNode = HTMLDOMNODE(&elem->node);
157 IHTMLDOMNode_AddRef(HTMLDOMNODE(&elem->node));
161 static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
163 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
164 FIXME("(%p)->(v)\n", This);
168 static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
170 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
171 FIXME("(%p)->(%p)\n", This, p);
175 static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
177 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
178 FIXME("(%p)->(v)\n", This);
182 static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
184 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
185 FIXME("(%p)->(%p)\n", This, p);
189 static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
191 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
192 FIXME("(%p)->(v)\n", This);
196 static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
198 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
199 FIXME("(%p)->(%p)\n", This, p);
203 static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
205 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
206 FIXME("(%p)->(v)\n", This);
210 static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
212 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
213 FIXME("(%p)->(%p)\n", This, p);
217 static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
219 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
220 FIXME("(%p)->(v)\n", This);
224 static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
226 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
227 FIXME("(%p)->(%p)\n", This, p);
231 static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
233 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
234 FIXME("(%p)->(v)\n", This);
238 static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
240 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
241 FIXME("(%p)->(%p)\n", This, p);
245 static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
247 HTMLDocument *This = impl_from_IHTMLDocument5(iface);
248 nsIDOMNSHTMLDocument *nshtmldoc;
250 const PRUnichar *mode;
253 TRACE("(%p)->(%p)\n", This, p);
255 if(!This->doc_node->nsdoc) {
256 WARN("NULL nsdoc\n");
260 nsres = nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
261 if(NS_FAILED(nsres)) {
262 ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
266 nsAString_Init(&mode_str, NULL);
267 nsIDOMNSHTMLDocument_GetCompatMode(nshtmldoc, &mode_str);
268 nsIDOMNSHTMLDocument_Release(nshtmldoc);
270 nsAString_GetData(&mode_str, &mode);
271 *p = SysAllocString(mode);
272 nsAString_Finish(&mode_str);
277 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
278 HTMLDocument5_QueryInterface,
279 HTMLDocument5_AddRef,
280 HTMLDocument5_Release,
281 HTMLDocument5_GetTypeInfoCount,
282 HTMLDocument5_GetTypeInfo,
283 HTMLDocument5_GetIDsOfNames,
284 HTMLDocument5_Invoke,
285 HTMLDocument5_put_onmousewheel,
286 HTMLDocument5_get_onmousewheel,
287 HTMLDocument5_get_doctype,
288 HTMLDocument5_get_implementation,
289 HTMLDocument5_createAttribute,
290 HTMLDocument5_createComment,
291 HTMLDocument5_put_onfocusin,
292 HTMLDocument5_get_onfocusin,
293 HTMLDocument5_put_onfocusout,
294 HTMLDocument5_get_onfocusout,
295 HTMLDocument5_put_onactivate,
296 HTMLDocument5_get_onactivate,
297 HTMLDocument5_put_ondeactivate,
298 HTMLDocument5_get_ondeactivate,
299 HTMLDocument5_put_onbeforeactivate,
300 HTMLDocument5_get_onbeforeactivate,
301 HTMLDocument5_put_onbeforedeactivate,
302 HTMLDocument5_get_onbeforedeactivate,
303 HTMLDocument5_get_compatMode
306 #define HTMLDOC6_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument6, iface)
308 static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
309 REFIID riid, void **ppv)
311 HTMLDocument *This = HTMLDOC6_THIS(iface);
312 return htmldoc_query_interface(This, riid, ppv);
315 static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
317 HTMLDocument *This = HTMLDOC6_THIS(iface);
318 return htmldoc_addref(This);
321 static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
323 HTMLDocument *This = HTMLDOC6_THIS(iface);
324 return htmldoc_release(This);
327 static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
329 HTMLDocument *This = HTMLDOC6_THIS(iface);
330 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
333 static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
334 LCID lcid, ITypeInfo **ppTInfo)
336 HTMLDocument *This = HTMLDOC6_THIS(iface);
337 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
340 static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
341 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
343 HTMLDocument *This = HTMLDOC6_THIS(iface);
344 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
347 static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
348 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
349 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
351 HTMLDocument *This = HTMLDOC6_THIS(iface);
352 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
353 pVarResult, pExcepInfo, puArgErr);
356 static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
357 IHTMLDocumentCompatibleInfoCollection **p)
359 HTMLDocument *This = HTMLDOC6_THIS(iface);
360 FIXME("(%p)->(%p)\n", This, p);
364 static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
367 HTMLDocument *This = HTMLDOC6_THIS(iface);
368 FIXME("(%p)->(%p)\n", This, p);
372 static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
375 HTMLDocument *This = HTMLDOC6_THIS(iface);
376 FIXME("(%p)->(%p)\n", This, p);
380 static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface,
383 HTMLDocument *This = HTMLDOC6_THIS(iface);
384 FIXME("(%p)->(v)\n", This);
388 static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
391 HTMLDocument *This = HTMLDOC6_THIS(iface);
392 FIXME("(%p)->(%p)\n", This, p);
396 static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface,
399 HTMLDocument *This = HTMLDOC6_THIS(iface);
400 FIXME("(%p)->(v)\n", This);
404 static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
405 BSTR bstrId, IHTMLElement2 **p)
407 HTMLDocument *This = HTMLDOC6_THIS(iface);
408 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
412 static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
414 HTMLDocument *This = HTMLDOC6_THIS(iface);
415 FIXME("(%p)->()\n", This);
421 static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
422 HTMLDocument6_QueryInterface,
423 HTMLDocument6_AddRef,
424 HTMLDocument6_Release,
425 HTMLDocument6_GetTypeInfoCount,
426 HTMLDocument6_GetTypeInfo,
427 HTMLDocument6_GetIDsOfNames,
428 HTMLDocument6_Invoke,
429 HTMLDocument6_get_compatible,
430 HTMLDocument6_get_documentMode,
431 HTMLDocument6_put_onstorage,
432 HTMLDocument6_get_onstorage,
433 HTMLDocument6_put_onstoragecommit,
434 HTMLDocument6_get_onstoragecommit,
435 HTMLDocument6_getElementById,
436 HTMLDocument6_updateSettings
439 void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
441 This->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
442 This->lpHTMLDocument6Vtbl = &HTMLDocument6Vtbl;