Added stub implementation of IViewObject[2] interface.
[wine] / dlls / mshtml / htmldoc.c
1 /*
2  * Copyright 2005 Jacek Caban
3  *
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.
8  *
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.
13  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "docobj.h"
31
32 #include "mshtml.h"
33 #include "mshtmdid.h"
34
35 #include "wine/debug.h"
36
37 #include "mshtml_private.h"
38
39 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
40
41 static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppvObject)
42 {
43     HTMLDocument *This = (HTMLDocument*)iface;
44
45     *ppvObject = NULL;
46     if(IsEqualGUID(&IID_IUnknown, riid)) {
47         TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppvObject);
48         *ppvObject = HTMLDOC(This);
49     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
50         TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppvObject);
51         *ppvObject = HTMLDOC(This);
52     }else if(IsEqualGUID(&IID_IHTMLDocument, riid)) {
53         TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppvObject);
54         *ppvObject = HTMLDOC(This);
55     }else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) {
56         TRACE("(%p)->(IID_IHTMLDocument2, %p)\n", This, ppvObject);
57         *ppvObject = HTMLDOC(This);
58     }else if(IsEqualGUID(&IID_IPersist, riid)) {
59         TRACE("(%p)->(IID_IPersist, %p)\n", This, ppvObject);
60         *ppvObject = PERSIST(This);
61     }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) {
62         TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppvObject);
63         *ppvObject = PERSISTMON(This);
64     }else if(IsEqualGUID(&IID_IPersistFile, riid)) {
65         TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppvObject);
66         *ppvObject = PERSISTFILE(This);
67     }else if(IsEqualGUID(&IID_IMonikerProp, riid)) {
68         TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppvObject);
69         *ppvObject = MONPROP(This);
70     }else if(IsEqualGUID(&IID_IOleObject, riid)) {
71         TRACE("(%p)->(IID_IOleObject, %p)\n", This, ppvObject);
72         *ppvObject = OLEOBJ(This);
73     }else if(IsEqualGUID(&IID_IOleDocument, riid)) {
74         TRACE("(%p)->(IID_IOleDocument, %p)\n", This, ppvObject);
75         *ppvObject = OLEDOC(This);
76     }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) {
77         TRACE("(%p)->(IID_IOleDocumentView, %p)\n", This, ppvObject);
78         *ppvObject = DOCVIEW(This);
79     }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
80         TRACE("(%p)->(IID_IOleInPlaceActiveObject, %p)\n", This, ppvObject);
81         *ppvObject = ACTOBJ(This);
82     }else if(IsEqualGUID(&IID_IViewObject, riid)) {
83         TRACE("(%p)->(IID_IViewObject, %p)\n", This, ppvObject);
84         *ppvObject = VIEWOBJ(This);
85     }else if(IsEqualGUID(&IID_IViewObject2, riid)) {
86         TRACE("(%p)->(IID_IViewObject2, %p)\n", This, ppvObject);
87         *ppvObject = VIEWOBJ2(This);
88     }
89
90     if(*ppvObject) {
91         IHTMLDocument2_AddRef(iface);
92         return S_OK;
93     }
94
95     FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppvObject);
96     return E_NOINTERFACE;
97 }
98
99 static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface)
100 {
101     HTMLDocument *This = (HTMLDocument*)iface;
102     ULONG ref = InterlockedIncrement(&This->ref);
103     TRACE("(%p) ref = %lu\n", This, ref);
104     return ref;
105 }
106
107 static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
108 {
109     HTMLDocument *This = (HTMLDocument*)iface;
110     ULONG ref = InterlockedDecrement(&This->ref);
111
112     TRACE("(%p) ref = %lu\n", This, ref);
113
114     if(!ref) {
115         if(This->client)
116             IOleClientSite_Release(This->client);
117         if(This->ipsite)
118             IOleInPlaceSite_Release(This->ipsite);
119         if(This->frame)
120             IOleInPlaceFrame_Release(This->frame);
121         HeapFree(GetProcessHeap(), 0, This);
122     }
123
124     return ref;
125 }
126
127 static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo)
128 {
129     FIXME("(%p)->(%p)\n", iface, pctinfo);
130     return E_NOTIMPL;
131 }
132
133 static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo,
134                                                 LCID lcid, ITypeInfo **ppTInfo)
135 {
136     FIXME("(%p)->(%u %lu %p)\n", iface, iTInfo, lcid, ppTInfo);
137     return E_NOTIMPL;
138 }
139
140 static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid,
141                                                 LPOLESTR *rgszNames, UINT cNames,
142                                                 LCID lcid, DISPID *rgDispId)
143 {
144     FIXME("(%p)->(%s %p %u %lu %p)\n", iface, debugstr_guid(riid), rgszNames, cNames,
145                                         lcid, rgDispId);
146     return E_NOTIMPL;
147 }
148
149 static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember,
150                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
151                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
152 {
153     FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", iface, dispIdMember, debugstr_guid(riid),
154                                   lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
155     return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
159 {
160     FIXME("(%p)->(%p)\n", iface, p);
161     return E_NOTIMPL;
162 }
163
164 static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
165 {
166     FIXME("(%p)->(%p)\n", iface, p);
167     return E_NOTIMPL;
168 }
169
170 static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
171 {
172     FIXME("(%p)->(%p)\n", iface, p);
173     return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
177 {
178     FIXME("(%p)->(%p)\n", iface, p);
179     return E_NOTIMPL;
180 }
181
182 static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
183 {
184     FIXME("(%p)->(%p)\n", iface, p);
185     return E_NOTIMPL;
186 }
187
188 static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
189 {
190     FIXME("(%p)->(%p)\n", iface, p);
191     return E_NOTIMPL;
192 }
193
194 static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
195 {
196     FIXME("(%p)->(%p)\n", iface, p);
197     return E_NOTIMPL;
198 }
199
200 static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
201 {
202     FIXME("(%p)->(%p)\n", iface, p);
203     return E_NOTIMPL;
204 }
205
206 static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
207 {
208     FIXME("(%p)->(%p)\n", iface, p);
209     return E_NOTIMPL;
210 }
211
212 static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
213 {
214     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
215     return E_NOTIMPL;
216 }
217
218 static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
219 {
220     FIXME("(%p)->(%p)\n", iface, p);
221     return E_NOTIMPL;
222 }
223
224 static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
225 {
226     FIXME("(%p)->(%p)\n", iface, p);
227     return E_NOTIMPL;
228 }
229
230 static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
231 {
232     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
233     return E_NOTIMPL;
234 }
235
236 static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
237 {
238     FIXME("(%p)->(%p)\n", iface, p);
239     return E_NOTIMPL;
240 }
241
242 static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
243 {
244     FIXME("(%p)->(%p)\n", iface, p);
245     return E_NOTIMPL;
246 }
247
248 static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p)
249 {
250     FIXME("(%p)->(%p)\n", iface, p);
251     return E_NOTIMPL;
252 }
253
254 static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
255 {
256     FIXME("(%p)->(%p)\n", iface, p);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
261 {
262     FIXME("(%p)->(%p)\n", iface, p);
263     return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p)
267 {
268     FIXME("(%p)->(%p)\n", iface, p);
269     return E_NOTIMPL;
270 }
271
272 static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v)
273 {
274     FIXME("(%p)\n", iface);
275     return E_NOTIMPL;
276 }
277
278 static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p)
279 {
280     FIXME("(%p)->(%p)\n", iface, p);
281     return E_NOTIMPL;
282 }
283
284 static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
285 {
286     FIXME("(%p)\n", iface);
287     return E_NOTIMPL;
288 }
289
290 static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p)
291 {
292     FIXME("(%p)->(%p)\n", iface, p);
293     return E_NOTIMPL;
294 }
295
296 static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v)
297 {
298     FIXME("(%p)\n", iface);
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p)
303 {
304     FIXME("(%p)->(%p)\n", iface, p);
305     return E_NOTIMPL;
306 }
307
308 static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v)
309 {
310     FIXME("(%p)->()\n", iface);
311     return E_NOTIMPL;
312 }
313
314 static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p)
315 {
316     FIXME("(%p)->(%p)\n", iface, p);
317     return E_NOTIMPL;
318 }
319
320 static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v)
321 {
322     FIXME("(%p)\n", iface);
323     return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p)
327 {
328     FIXME("(%p)->(%p)\n", iface, p);
329     return E_NOTIMPL;
330 }
331
332 static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
333 {
334     FIXME("(%p)->(%p)\n", iface, p);
335     return E_NOTIMPL;
336 }
337
338 static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
339 {
340     FIXME("(%p)->(%p)\n", iface, p);
341     return E_NOTIMPL;
342 }
343
344 static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
345 {
346     FIXME("(%p)->(%p)\n", iface, p);
347     return E_NOTIMPL;
348 }
349
350 static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
351 {
352     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
353     return E_NOTIMPL;
354 }
355
356 static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
357 {
358     FIXME("(%p)->(%p)\n", iface, p);
359     return E_NOTIMPL;
360 }
361
362 static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
363 {
364     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
365     return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
369 {
370     FIXME("(%p)->(%p)\n", iface, p);
371     return E_NOTIMPL;
372 }
373
374 static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
375 {
376     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
377     return E_NOTIMPL;
378 }
379
380 static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
381 {
382     FIXME("(%p)->(%p)\n", iface, p);
383     return E_NOTIMPL;
384 }
385
386 static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v)
387 {
388     FIXME("(%p)->(%x)\n", iface, v);
389     return E_NOTIMPL;
390 }
391
392 static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p)
393 {
394     FIXME("(%p)->(%p)\n", iface, p);
395     return E_NOTIMPL;
396 }
397
398 static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v)
399 {
400     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
401     return E_NOTIMPL;
402 }
403
404 static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
405 {
406     FIXME("(%p)->(%p)\n", iface, p);
407     return E_NOTIMPL;
408 }
409
410 static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v)
411 {
412     FIXME("(%p)->(%s)\n", iface, debugstr_w(v));
413     return E_NOTIMPL;
414 }
415
416 static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p)
417 {
418     FIXME("(%p)->(%p)\n", iface, p);
419     return E_NOTIMPL;
420 }
421
422 static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p)
423 {
424     FIXME("(%p)->(%p)\n", iface, p);
425     return E_NOTIMPL;
426 }
427
428 static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p)
429 {
430     FIXME("(%p)->(%p)\n", iface, p);
431     return E_NOTIMPL;
432 }
433
434 static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p)
435 {
436     FIXME("(%p)->(%p)\n", iface, p);
437     return E_NOTIMPL;
438 }
439
440 static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p)
441 {
442     FIXME("(%p)->(%p)\n", iface, p);
443     return E_NOTIMPL;
444 }
445
446 static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p)
447 {
448     FIXME("(%p)->(%p)\n", iface, p);
449     return E_NOTIMPL;
450 }
451
452 static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p)
453 {
454     FIXME("(%p)->(%p)\n", iface, p);
455     return E_NOTIMPL;
456 }
457
458 static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p)
459 {
460     FIXME("(%p)->(%p)\n", iface, p);
461     return E_NOTIMPL;
462 }
463
464 static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
465 {
466     FIXME("(%p)->(%p)\n", iface, p);
467     return E_NOTIMPL;
468 }
469
470 static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
471 {
472     FIXME("(%p)->(%p)\n", iface, psarray);
473     return E_NOTIMPL;
474 }
475
476 static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray)
477 {
478     FIXME("(%p)->(%p)\n", iface, psarray);
479     return E_NOTIMPL;
480 }
481
482 static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name,
483                         VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
484 {
485     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(url), pomWindowResult);
486     return E_NOTIMPL;
487 }
488
489 static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
490 {
491     FIXME("(%p)\n", iface);
492     return E_NOTIMPL;
493 }
494
495 static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
496 {
497     FIXME("(%p)\n", iface);
498     return E_NOTIMPL;
499 }
500
501 static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,
502                                                         VARIANT_BOOL *pfRet)
503 {
504     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
505     return E_NOTIMPL;
506 }
507
508 static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID,
509                                                         VARIANT_BOOL *pfRet)
510 {
511     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
512     return E_NOTIMPL;
513 }
514
515 static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID,
516                                                         VARIANT_BOOL *pfRet)
517 {
518     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
519     return E_NOTIMPL;
520 }
521
522 static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID,
523                                                         VARIANT_BOOL *pfRet)
524 {
525     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
526     return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID,
530                                                         BSTR *pfRet)
531 {
532     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
533     return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID,
537                                                         VARIANT *pfRet)
538 {
539     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
540     return E_NOTIMPL;
541 }
542
543 static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID,
544                                 VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet)
545 {
546     FIXME("(%p)->(%s %x %p)\n", iface, debugstr_w(cmdID), showUI, pfRet);
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID,
551                                                         VARIANT_BOOL *pfRet)
552 {
553     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(cmdID), pfRet);
554     return E_NOTIMPL;
555 }
556
557 static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag,
558                                                     IHTMLElement **newElem)
559 {
560     FIXME("(%p)->(%s %p)\n", iface, debugstr_w(eTag), newElem);
561     return E_NOTIMPL;
562 }
563
564 static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)
565 {
566     FIXME("(%p)\n", iface);
567     return E_NOTIMPL;
568 }
569
570 static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p)
571 {
572     FIXME("(%p)->(%p)\n", iface, p);
573     return E_NOTIMPL;
574 }
575
576 static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
577 {
578     FIXME("(%p)\n", iface);
579     return E_NOTIMPL;
580 }
581
582 static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p)
583 {
584     FIXME("(%p)->(%p)\n", iface, p);
585     return E_NOTIMPL;
586 }
587
588 static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v)
589 {
590     FIXME("(%p)\n", iface);
591     return E_NOTIMPL;
592 }
593
594 static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p)
595 {
596     FIXME("(%p)->(%p)\n", iface, p);
597     return E_NOTIMPL;
598 }
599
600 static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
601 {
602     FIXME("(%p)\n", iface);
603     return E_NOTIMPL;
604 }
605
606 static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
607 {
608     FIXME("(%p)->(%p)\n", iface, p);
609     return E_NOTIMPL;
610 }
611
612 static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
613 {
614     FIXME("(%p)\n", iface);
615     return E_NOTIMPL;
616 }
617
618 static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
619 {
620     FIXME("(%p)->(%p)\n", iface, p);
621     return E_NOTIMPL;
622 }
623
624 static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
625 {
626     FIXME("(%p)\n", iface);
627     return E_NOTIMPL;
628 }
629
630 static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p)
631 {
632     FIXME("(%p)->(%p)\n", iface, p);
633     return E_NOTIMPL;
634 }
635
636 static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v)
637 {
638     FIXME("(%p)\n", iface);
639     return E_NOTIMPL;
640 }
641
642 static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p)
643 {
644     FIXME("(%p)->(%p)\n", iface, p);
645     return E_NOTIMPL;
646 }
647
648 static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v)
649 {
650     FIXME("(%p)\n", iface);
651     return E_NOTIMPL;
652 }
653
654 static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p)
655 {
656     FIXME("(%p)->(%p)\n", iface, p);
657     return E_NOTIMPL;
658 }
659
660 static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v)
661 {
662     FIXME("(%p)\n", iface);
663     return E_NOTIMPL;
664 }
665
666 static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p)
667 {
668     FIXME("(%p)->(%p)\n", iface, p);
669     return E_NOTIMPL;
670 }
671
672 static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v)
673 {
674     FIXME("(%p)\n", iface);
675     return E_NOTIMPL;
676 }
677
678 static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p)
679 {
680     FIXME("(%p)->(%p)\n", iface, p);
681     return E_NOTIMPL;
682 }
683
684 static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v)
685 {
686     FIXME("(%p)\n", iface);
687     return E_NOTIMPL;
688 }
689
690 static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
691 {
692     FIXME("(%p)->(%p)\n", iface, p);
693     return E_NOTIMPL;
694 }
695
696 static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v)
697 {
698     FIXME("(%p)\n", iface);
699     return E_NOTIMPL;
700 }
701
702 static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p)
703 {
704     FIXME("(%p)->(%p)\n", iface, p);
705     return E_NOTIMPL;
706 }
707
708 static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v)
709 {
710     FIXME("(%p)\n", iface);
711     return E_NOTIMPL;
712 }
713
714 static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p)
715 {
716     FIXME("(%p)->(%p)\n", iface, p);
717     return E_NOTIMPL;
718 }
719
720 static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v)
721 {
722     FIXME("(%p)\n", iface);
723     return E_NOTIMPL;
724 }
725
726 static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p)
727 {
728     FIXME("(%p)->(%p)\n", iface, p);
729     return E_NOTIMPL;
730 }
731
732 static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v)
733 {
734     FIXME("(%p)\n", iface);
735     return E_NOTIMPL;
736 }
737
738 static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p)
739 {
740     FIXME("(%p)->(%p)\n", iface, p);
741     return E_NOTIMPL;
742 }
743
744 static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
745 {
746     FIXME("(%p)\n", iface);
747     return E_NOTIMPL;
748 }
749
750 static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
751 {
752     FIXME("(%p)->(%p)\n", iface, p);
753     return E_NOTIMPL;
754 }
755
756 static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
757 {
758     FIXME("(%p)\n", iface);
759     return E_NOTIMPL;
760 }
761
762 static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
763 {
764     FIXME("(%p)->(%p)\n", iface, p);
765     return E_NOTIMPL;
766 }
767
768 static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, long x, long y,
769                                                         IHTMLElement **elementHit)
770 {
771     FIXME("(%p)->(%ld %ld %p)\n", iface, x, y, elementHit);
772     return E_NOTIMPL;
773 }
774
775 static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p)
776 {
777     FIXME("(%p)->(%p)\n", iface, p);
778     return E_NOTIMPL;
779 }
780
781 static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
782                                                     IHTMLStyleSheetsCollection **p)
783 {
784     FIXME("(%p)->(%p)\n", iface, p);
785     return E_NOTIMPL;
786 }
787
788 static HRESULT WINAPI HTMLDocument_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v)
789 {
790     FIXME("(%p)\n", iface);
791     return E_NOTIMPL;
792 }
793
794 static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p)
795 {
796     FIXME("(%p)->(%p)\n", iface, p);
797     return E_NOTIMPL;
798 }
799
800 static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v)
801 {
802     FIXME("(%p)\n", iface);
803     return E_NOTIMPL;
804 }
805
806 static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p)
807 {
808     FIXME("(%p)->(%p)\n", iface, p);
809     return E_NOTIMPL;
810 }
811
812 static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
813 {
814     FIXME("(%p)->(%p)\n", iface, String);
815     return E_NOTIMPL;
816 }
817
818 static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
819                                             long lIndex, IHTMLStyleSheet **ppnewStyleSheet)
820 {
821     FIXME("(%p)->(%s %ld %p)\n", iface, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
822     return E_NOTIMPL;
823 }
824
825 static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
826     HTMLDocument_QueryInterface,
827     HTMLDocument_AddRef,
828     HTMLDocument_Release,
829     HTMLDocument_GetTypeInfoCount,
830     HTMLDocument_GetTypeInfo,
831     HTMLDocument_GetIDsOfNames,
832     HTMLDocument_Invoke,
833     HTMLDocument_get_Script,
834     HTMLDocument_get_all,
835     HTMLDocument_get_body,
836     HTMLDocument_get_activeElement,
837     HTMLDocument_get_images,
838     HTMLDocument_get_applets,
839     HTMLDocument_get_links,
840     HTMLDocument_get_forms,
841     HTMLDocument_get_anchors,
842     HTMLDocument_put_title,
843     HTMLDocument_get_title,
844     HTMLDocument_get_scripts,
845     HTMLDocument_put_designMode,
846     HTMLDocument_get_designMode,
847     HTMLDocument_get_selection,
848     HTMLDocument_get_readyState,
849     HTMLDocument_get_frames,
850     HTMLDocument_get_embeds,
851     HTMLDocument_get_plugins,
852     HTMLDocument_put_alinkColor,
853     HTMLDocument_get_alinkColor,
854     HTMLDocument_put_bgColor,
855     HTMLDocument_get_bgColor,
856     HTMLDocument_put_fgColor,
857     HTMLDocument_get_fgColor,
858     HTMLDocument_put_linkColor,
859     HTMLDocument_get_linkColor,
860     HTMLDocument_put_vlinkColor,
861     HTMLDocument_get_vlinkColor,
862     HTMLDocument_get_referrer,
863     HTMLDocument_get_location,
864     HTMLDocument_get_lastModified,
865     HTMLDocument_put_URL,
866     HTMLDocument_get_URL,
867     HTMLDocument_put_domain,
868     HTMLDocument_get_domain,
869     HTMLDocument_put_cookie,
870     HTMLDocument_get_cookie,
871     HTMLDocument_put_expando,
872     HTMLDocument_get_expando,
873     HTMLDocument_put_charset,
874     HTMLDocument_get_charset,
875     HTMLDocument_put_defaultCharset,
876     HTMLDocument_get_defaultCharset,
877     HTMLDocument_get_mimeType,
878     HTMLDocument_get_fileSize,
879     HTMLDocument_get_fileCreatedDate,
880     HTMLDocument_get_fileModifiedDate,
881     HTMLDocument_get_fileUpdatedDate,
882     HTMLDocument_get_security,
883     HTMLDocument_get_protocol,
884     HTMLDocument_get_nameProp,
885     HTMLDocument_write,
886     HTMLDocument_writeln,
887     HTMLDocument_open,
888     HTMLDocument_close,
889     HTMLDocument_clear,
890     HTMLDocument_queryCommandSupported,
891     HTMLDocument_queryCommandEnabled,
892     HTMLDocument_queryCommandState,
893     HTMLDocument_queryCommandIndeterm,
894     HTMLDocument_queryCommandText,
895     HTMLDocument_queryCommandValue,
896     HTMLDocument_execCommand,
897     HTMLDocument_execCommandShowHelp,
898     HTMLDocument_createElement,
899     HTMLDocument_put_onhelp,
900     HTMLDocument_get_onhelp,
901     HTMLDocument_put_onclick,
902     HTMLDocument_get_onclick,
903     HTMLDocument_put_ondblclick,
904     HTMLDocument_get_ondblclick,
905     HTMLDocument_put_onkeyup,
906     HTMLDocument_get_onkeyup,
907     HTMLDocument_put_onkeydown,
908     HTMLDocument_get_onkeydown,
909     HTMLDocument_put_onkeypress,
910     HTMLDocument_get_onkeypress,
911     HTMLDocument_put_onmouseup,
912     HTMLDocument_get_onmouseup,
913     HTMLDocument_put_onmousedown,
914     HTMLDocument_get_onmousedown,
915     HTMLDocument_put_onmousemove,
916     HTMLDocument_get_onmousemove,
917     HTMLDocument_put_onmouseout,
918     HTMLDocument_get_onmouseout,
919     HTMLDocument_put_onmouseover,
920     HTMLDocument_get_onmouseover,
921     HTMLDocument_put_onreadystatechange,
922     HTMLDocument_get_onreadystatechange,
923     HTMLDocument_put_onafterupdate,
924     HTMLDocument_get_onafterupdate,
925     HTMLDocument_put_onrowexit,
926     HTMLDocument_get_onrowexit,
927     HTMLDocument_put_onrowenter,
928     HTMLDocument_get_onrowenter,
929     HTMLDocument_put_ondragstart,
930     HTMLDocument_get_ondragstart,
931     HTMLDocument_put_onselectstart,
932     HTMLDocument_get_onselectstart,
933     HTMLDocument_elementFromPoint,
934     HTMLDocument_get_parentWindow,
935     HTMLDocument_get_styleSheets,
936     HTMLDocument_put_onbeforeupdate,
937     HTMLDocument_get_onbeforeupdate,
938     HTMLDocument_put_onerrorupdate,
939     HTMLDocument_get_onerrorupdate,
940     HTMLDocument_toString,
941     HTMLDocument_createStyleSheet
942 };
943
944 HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
945 {
946     HTMLDocument *ret;
947     HRESULT hres;
948
949     TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
950
951     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLDocument));
952     ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
953     ret->ref = 0;
954
955     hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
956     if(FAILED(hres))
957         HeapFree(GetProcessHeap(), 0, ret);
958
959     HTMLDocument_Persist_Init(ret);
960     HTMLDocument_OleObj_Init(ret);
961     HTMLDocument_View_Init(ret);
962
963     return hres;
964 }