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 = &elem->node.IHTMLDOMNode_iface;
157 IHTMLDOMNode_AddRef(&elem->node.IHTMLDOMNode_iface);
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 static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
308 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
311 static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
312 REFIID riid, void **ppv)
314 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
315 return htmldoc_query_interface(This, riid, ppv);
318 static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
320 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
321 return htmldoc_addref(This);
324 static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
326 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
327 return htmldoc_release(This);
330 static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
332 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
333 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
336 static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
337 LCID lcid, ITypeInfo **ppTInfo)
339 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
340 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
343 static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
344 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
346 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
347 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
350 static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
351 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
352 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
354 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
355 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
356 pVarResult, pExcepInfo, puArgErr);
359 static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
360 IHTMLDocumentCompatibleInfoCollection **p)
362 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
363 FIXME("(%p)->(%p)\n", This, p);
367 static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
370 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
371 FIXME("(%p)->(%p)\n", This, p);
375 static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
378 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
379 FIXME("(%p)->(%p)\n", This, p);
383 static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface,
386 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
387 FIXME("(%p)->(v)\n", This);
391 static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
394 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
395 FIXME("(%p)->(%p)\n", This, p);
399 static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface,
402 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
403 FIXME("(%p)->(v)\n", This);
407 static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
408 BSTR bstrId, IHTMLElement2 **p)
410 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
411 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
415 static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
417 HTMLDocument *This = impl_from_IHTMLDocument6(iface);
418 FIXME("(%p)->()\n", This);
422 static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
423 HTMLDocument6_QueryInterface,
424 HTMLDocument6_AddRef,
425 HTMLDocument6_Release,
426 HTMLDocument6_GetTypeInfoCount,
427 HTMLDocument6_GetTypeInfo,
428 HTMLDocument6_GetIDsOfNames,
429 HTMLDocument6_Invoke,
430 HTMLDocument6_get_compatible,
431 HTMLDocument6_get_documentMode,
432 HTMLDocument6_put_onstorage,
433 HTMLDocument6_get_onstorage,
434 HTMLDocument6_put_onstoragecommit,
435 HTMLDocument6_get_onstoragecommit,
436 HTMLDocument6_getElementById,
437 HTMLDocument6_updateSettings
440 void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
442 This->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
443 This->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl;