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 #define HTMLDOC5_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument5, iface)
39 static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
40 REFIID riid, void **ppv)
42 HTMLDocument *This = HTMLDOC5_THIS(iface);
43 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
46 static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
48 HTMLDocument *This = HTMLDOC5_THIS(iface);
49 return IHTMLDocument2_AddRef(HTMLDOC(This));
52 static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
54 HTMLDocument *This = HTMLDOC5_THIS(iface);
55 return IHTMLDocument2_Release(HTMLDOC(This));
58 static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
60 HTMLDocument *This = HTMLDOC5_THIS(iface);
61 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
64 static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
65 LCID lcid, ITypeInfo **ppTInfo)
67 HTMLDocument *This = HTMLDOC5_THIS(iface);
68 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
71 static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
72 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
74 HTMLDocument *This = HTMLDOC5_THIS(iface);
75 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
78 static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
79 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
80 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
82 HTMLDocument *This = HTMLDOC5_THIS(iface);
83 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
84 pVarResult, pExcepInfo, puArgErr);
87 static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
89 HTMLDocument *This = HTMLDOC5_THIS(iface);
90 FIXME("(%p)->(v)\n", This);
94 static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
96 HTMLDocument *This = HTMLDOC5_THIS(iface);
97 FIXME("(%p)->(%p)\n", This, p);
101 static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
103 HTMLDocument *This = HTMLDOC5_THIS(iface);
104 FIXME("(%p)->(%p)\n", This, p);
108 static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
110 HTMLDocument *This = HTMLDOC5_THIS(iface);
111 FIXME("(%p)->(%p)\n", This, p);
115 static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
116 IHTMLDOMAttribute **ppattribute)
118 HTMLDocument *This = HTMLDOC5_THIS(iface);
119 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
123 static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
124 IHTMLDOMNode **ppRetNode)
126 HTMLDocument *This = HTMLDOC5_THIS(iface);
127 nsIDOMComment *nscomment;
133 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
135 if(!This->doc_node->nsdoc) {
136 WARN("NULL nsdoc\n");
140 nsAString_InitDepend(&str, bstrdata);
141 nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
142 nsAString_Finish(&str);
143 if(NS_FAILED(nsres)) {
144 ERR("CreateTextNode failed: %08x\n", nsres);
148 hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
149 nsIDOMElement_Release(nscomment);
153 *ppRetNode = HTMLDOMNODE(&elem->node);
154 IHTMLDOMNode_AddRef(HTMLDOMNODE(&elem->node));
158 static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
160 HTMLDocument *This = HTMLDOC5_THIS(iface);
161 FIXME("(%p)->(v)\n", This);
165 static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
167 HTMLDocument *This = HTMLDOC5_THIS(iface);
168 FIXME("(%p)->(%p)\n", This, p);
172 static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
174 HTMLDocument *This = HTMLDOC5_THIS(iface);
175 FIXME("(%p)->(v)\n", This);
179 static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
181 HTMLDocument *This = HTMLDOC5_THIS(iface);
182 FIXME("(%p)->(%p)\n", This, p);
186 static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
188 HTMLDocument *This = HTMLDOC5_THIS(iface);
189 FIXME("(%p)->(v)\n", This);
193 static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
195 HTMLDocument *This = HTMLDOC5_THIS(iface);
196 FIXME("(%p)->(%p)\n", This, p);
200 static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
202 HTMLDocument *This = HTMLDOC5_THIS(iface);
203 FIXME("(%p)->(v)\n", This);
207 static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
209 HTMLDocument *This = HTMLDOC5_THIS(iface);
210 FIXME("(%p)->(%p)\n", This, p);
214 static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
216 HTMLDocument *This = HTMLDOC5_THIS(iface);
217 FIXME("(%p)->(v)\n", This);
221 static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
223 HTMLDocument *This = HTMLDOC5_THIS(iface);
224 FIXME("(%p)->(%p)\n", This, p);
228 static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
230 HTMLDocument *This = HTMLDOC5_THIS(iface);
231 FIXME("(%p)->(v)\n", This);
235 static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
237 HTMLDocument *This = HTMLDOC5_THIS(iface);
238 FIXME("(%p)->(%p)\n", This, p);
242 static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
244 HTMLDocument *This = HTMLDOC5_THIS(iface);
245 nsIDOMNSHTMLDocument *nshtmldoc;
247 const PRUnichar *mode;
250 TRACE("(%p)->(%p)\n", This, p);
252 if(!This->doc_node->nsdoc) {
253 WARN("NULL nsdoc\n");
257 nsres = nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
258 if(NS_FAILED(nsres)) {
259 ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
263 nsAString_Init(&mode_str, NULL);
264 nsIDOMNSHTMLDocument_GetCompatMode(nshtmldoc, &mode_str);
265 nsIDOMNSHTMLDocument_Release(nshtmldoc);
267 nsAString_GetData(&mode_str, &mode);
268 *p = SysAllocString(mode);
269 nsAString_Finish(&mode_str);
276 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
277 HTMLDocument5_QueryInterface,
278 HTMLDocument5_AddRef,
279 HTMLDocument5_Release,
280 HTMLDocument5_GetTypeInfoCount,
281 HTMLDocument5_GetTypeInfo,
282 HTMLDocument5_GetIDsOfNames,
283 HTMLDocument5_Invoke,
284 HTMLDocument5_put_onmousewheel,
285 HTMLDocument5_get_onmousewheel,
286 HTMLDocument5_get_doctype,
287 HTMLDocument5_get_implementation,
288 HTMLDocument5_createAttribute,
289 HTMLDocument5_createComment,
290 HTMLDocument5_put_onfocusin,
291 HTMLDocument5_get_onfocusin,
292 HTMLDocument5_put_onfocusout,
293 HTMLDocument5_get_onfocusout,
294 HTMLDocument5_put_onactivate,
295 HTMLDocument5_get_onactivate,
296 HTMLDocument5_put_ondeactivate,
297 HTMLDocument5_get_ondeactivate,
298 HTMLDocument5_put_onbeforeactivate,
299 HTMLDocument5_get_onbeforeactivate,
300 HTMLDocument5_put_onbeforedeactivate,
301 HTMLDocument5_get_onbeforedeactivate,
302 HTMLDocument5_get_compatMode
305 #define HTMLDOC6_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument6, iface)
307 static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
308 REFIID riid, void **ppv)
310 HTMLDocument *This = HTMLDOC6_THIS(iface);
311 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
314 static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
316 HTMLDocument *This = HTMLDOC6_THIS(iface);
317 return IHTMLDocument2_AddRef(HTMLDOC(This));
320 static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
322 HTMLDocument *This = HTMLDOC6_THIS(iface);
323 return IHTMLDocument2_Release(HTMLDOC(This));
326 static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
328 HTMLDocument *This = HTMLDOC6_THIS(iface);
329 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
332 static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
333 LCID lcid, ITypeInfo **ppTInfo)
335 HTMLDocument *This = HTMLDOC6_THIS(iface);
336 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
339 static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
340 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
342 HTMLDocument *This = HTMLDOC6_THIS(iface);
343 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
346 static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
347 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
348 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
350 HTMLDocument *This = HTMLDOC6_THIS(iface);
351 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
352 pVarResult, pExcepInfo, puArgErr);
355 static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
356 IHTMLDocumentCompatibleInfoCollection **p)
358 HTMLDocument *This = HTMLDOC6_THIS(iface);
359 FIXME("(%p)->(%p)\n", This, p);
363 static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
366 HTMLDocument *This = HTMLDOC6_THIS(iface);
367 FIXME("(%p)->(%p)\n", This, p);
371 static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
374 HTMLDocument *This = HTMLDOC6_THIS(iface);
375 FIXME("(%p)->(%p)\n", This, p);
379 static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface,
382 HTMLDocument *This = HTMLDOC6_THIS(iface);
383 FIXME("(%p)->(v)\n", This);
387 static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
390 HTMLDocument *This = HTMLDOC6_THIS(iface);
391 FIXME("(%p)->(%p)\n", This, p);
395 static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface,
398 HTMLDocument *This = HTMLDOC6_THIS(iface);
399 FIXME("(%p)->(v)\n", This);
403 static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
404 BSTR bstrId, IHTMLElement2 **p)
406 HTMLDocument *This = HTMLDOC6_THIS(iface);
407 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
411 static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
413 HTMLDocument *This = HTMLDOC6_THIS(iface);
414 FIXME("(%p)->()\n", This);
420 static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
421 HTMLDocument6_QueryInterface,
422 HTMLDocument6_AddRef,
423 HTMLDocument6_Release,
424 HTMLDocument6_GetTypeInfoCount,
425 HTMLDocument6_GetTypeInfo,
426 HTMLDocument6_GetIDsOfNames,
427 HTMLDocument6_Invoke,
428 HTMLDocument6_get_compatible,
429 HTMLDocument6_get_documentMode,
430 HTMLDocument6_put_onstorage,
431 HTMLDocument6_get_onstorage,
432 HTMLDocument6_put_onstoragecommit,
433 HTMLDocument6_get_onstoragecommit,
434 HTMLDocument6_getElementById,
435 HTMLDocument6_updateSettings
438 void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
440 This->lpHTMLDocument5Vtbl = &HTMLDocument5Vtbl;
441 This->lpHTMLDocument6Vtbl = &HTMLDocument6Vtbl;