kernel: Check for an exe which is always present in a system dir.
[wine.git] / dlls / mshtml / htmlbody.c
blob0ad554ec3f96c627460335ff617f9a1071edbbc0
1 /*
2 * Copyright 2006 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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winnls.h"
30 #include "ole2.h"
32 #include "wine/debug.h"
34 #include "mshtml_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 typedef struct {
39 const IHTMLBodyElementVtbl *lpHTMLBodyElementVtbl;
41 HTMLTextContainer text_container;
43 HTMLElement *element;
44 nsIDOMHTMLBodyElement *nsbody;
45 } HTMLBodyElement;
47 #define HTMLBODY(x) ((IHTMLBodyElement*) &(x)->lpHTMLBodyElementVtbl)
49 #define HTMLBODY_THIS(iface) DEFINE_THIS(HTMLBodyElement, HTMLBodyElement, iface)
51 static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface,
52 REFIID riid, void **ppv)
54 HTMLBodyElement *This = HTMLBODY_THIS(iface);
55 HRESULT hres;
57 *ppv = NULL;
59 if(IsEqualGUID(&IID_IUnknown, riid)) {
60 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
61 *ppv = HTMLBODY(This);
62 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
63 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
64 *ppv = HTMLBODY(This);
65 }else if(IsEqualGUID(&IID_IHTMLBodyElement, riid)) {
66 TRACE("(%p)->(IID_IHTMLBodyElement %p)\n", This, ppv);
67 *ppv = HTMLBODY(This);
68 }else if(IsEqualGUID(&IID_IHTMLTextContainer, riid)) {
69 TRACE("(%p)->(IID_IHTMLTextContainer %p)\n", This, ppv);
70 *ppv = HTMLTEXTCONT(&This->text_container);
73 if(*ppv) {
74 IUnknown_AddRef((IUnknown*)*ppv);
75 return S_OK;
78 hres = HTMLElement_QI(This->element, riid, ppv);
79 if(FAILED(hres))
80 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
82 return hres;
85 static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface)
87 HTMLBodyElement *This = HTMLBODY_THIS(iface);
89 TRACE("(%p)\n", This);
91 return IHTMLDocument2_AddRef(HTMLDOC(This->element->node->doc));
94 static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
96 HTMLBodyElement *This = HTMLBODY_THIS(iface);
98 TRACE("(%p)\n", This);
100 return IHTMLDocument2_Release(HTMLDOC(This->element->node->doc));
103 static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
105 HTMLBodyElement *This = HTMLBODY_THIS(iface);
106 FIXME("(%p)->(%p)\n", This, pctinfo);
107 return E_NOTIMPL;
110 static HRESULT WINAPI HTMLBodyElement_GetTypeInfo(IHTMLBodyElement *iface, UINT iTInfo,
111 LCID lcid, ITypeInfo **ppTInfo)
113 HTMLBodyElement *This = HTMLBODY_THIS(iface);
114 FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo);
115 return E_NOTIMPL;
118 static HRESULT WINAPI HTMLBodyElement_GetIDsOfNames(IHTMLBodyElement *iface, REFIID riid,
119 LPOLESTR *rgszNames, UINT cNames,
120 LCID lcid, DISPID *rgDispId)
122 HTMLBodyElement *This = HTMLBODY_THIS(iface);
123 FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
124 lcid, rgDispId);
125 return E_NOTIMPL;
128 static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dispIdMember,
129 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
130 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
132 HTMLBodyElement *This = HTMLBODY_THIS(iface);
133 FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
134 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
135 return E_NOTIMPL;
138 static HRESULT WINAPI HTMLBodyElement_put_background(IHTMLBodyElement *iface, BSTR v)
140 HTMLBodyElement *This = HTMLBODY_THIS(iface);
141 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
142 return E_NOTIMPL;
145 static HRESULT WINAPI HTMLBodyElement_get_background(IHTMLBodyElement *iface, BSTR *p)
147 HTMLBodyElement *This = HTMLBODY_THIS(iface);
148 TRACE("(%p)->(%p)\n", This, p);
149 return E_NOTIMPL;
152 static HRESULT WINAPI HTMLBodyElement_put_bgProperties(IHTMLBodyElement *iface, BSTR v)
154 HTMLBodyElement *This = HTMLBODY_THIS(iface);
155 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
156 return E_NOTIMPL;
159 static HRESULT WINAPI HTMLBodyElement_get_bgProperties(IHTMLBodyElement *iface, BSTR *p)
161 HTMLBodyElement *This = HTMLBODY_THIS(iface);
162 TRACE("(%p)->(%p)\n", This, p);
163 return E_NOTIMPL;
166 static HRESULT WINAPI HTMLBodyElement_put_leftMargin(IHTMLBodyElement *iface, VARIANT v)
168 HTMLBodyElement *This = HTMLBODY_THIS(iface);
169 TRACE("(%p)->()\n", This);
170 return E_NOTIMPL;
173 static HRESULT WINAPI HTMLBodyElement_get_leftMargin(IHTMLBodyElement *iface, VARIANT *p)
175 HTMLBodyElement *This = HTMLBODY_THIS(iface);
176 TRACE("(%p)->(%p)\n", This, p);
177 return E_NOTIMPL;
180 static HRESULT WINAPI HTMLBodyElement_put_topMargin(IHTMLBodyElement *iface, VARIANT v)
182 HTMLBodyElement *This = HTMLBODY_THIS(iface);
183 TRACE("(%p)->()\n", This);
184 return E_NOTIMPL;
187 static HRESULT WINAPI HTMLBodyElement_get_topMargin(IHTMLBodyElement *iface, VARIANT *p)
189 HTMLBodyElement *This = HTMLBODY_THIS(iface);
190 TRACE("(%p)->(%p)\n", This, p);
191 return E_NOTIMPL;
194 static HRESULT WINAPI HTMLBodyElement_put_rightMargin(IHTMLBodyElement *iface, VARIANT v)
196 HTMLBodyElement *This = HTMLBODY_THIS(iface);
197 TRACE("(%p)->()\n", This);
198 return E_NOTIMPL;
201 static HRESULT WINAPI HTMLBodyElement_get_rightMargin(IHTMLBodyElement *iface, VARIANT *p)
203 HTMLBodyElement *This = HTMLBODY_THIS(iface);
204 TRACE("(%p)->(%p)\n", This, p);
205 return E_NOTIMPL;
208 static HRESULT WINAPI HTMLBodyElement_put_bottomMargin(IHTMLBodyElement *iface, VARIANT v)
210 HTMLBodyElement *This = HTMLBODY_THIS(iface);
211 TRACE("(%p)->()\n", This);
212 return E_NOTIMPL;
215 static HRESULT WINAPI HTMLBodyElement_get_bottomMargin(IHTMLBodyElement *iface, VARIANT *p)
217 HTMLBodyElement *This = HTMLBODY_THIS(iface);
218 TRACE("(%p)->(%p)\n", This, p);
219 return E_NOTIMPL;
222 static HRESULT WINAPI HTMLBodyElement_put_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL v)
224 HTMLBodyElement *This = HTMLBODY_THIS(iface);
225 TRACE("(%p)->(%x)\n", This, v);
226 return E_NOTIMPL;
229 static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL *p)
231 HTMLBodyElement *This = HTMLBODY_THIS(iface);
232 TRACE("(%p)->(%p)\n", This, p);
233 return E_NOTIMPL;
236 static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v)
238 HTMLBodyElement *This = HTMLBODY_THIS(iface);
239 TRACE("(%p)->()\n", This);
240 return E_NOTIMPL;
243 static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIANT *p)
245 HTMLBodyElement *This = HTMLBODY_THIS(iface);
246 TRACE("(%p)->(%p)\n", This, p);
247 return E_NOTIMPL;
250 static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)
252 HTMLBodyElement *This = HTMLBODY_THIS(iface);
253 TRACE("(%p)->()\n", This);
254 return E_NOTIMPL;
257 static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT *p)
259 HTMLBodyElement *This = HTMLBODY_THIS(iface);
260 TRACE("(%p)->(%p)\n", This, p);
261 return E_NOTIMPL;
264 static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
266 HTMLBodyElement *This = HTMLBODY_THIS(iface);
267 TRACE("(%p)->()\n", This);
268 return E_NOTIMPL;
271 static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT *p)
273 HTMLBodyElement *This = HTMLBODY_THIS(iface);
274 TRACE("(%p)->(%p)\n", This, p);
275 return E_NOTIMPL;
278 static HRESULT WINAPI HTMLBodyElement_put_vLink(IHTMLBodyElement *iface, VARIANT v)
280 HTMLBodyElement *This = HTMLBODY_THIS(iface);
281 TRACE("(%p)->()\n", This);
282 return E_NOTIMPL;
285 static HRESULT WINAPI HTMLBodyElement_get_vLink(IHTMLBodyElement *iface, VARIANT *p)
287 HTMLBodyElement *This = HTMLBODY_THIS(iface);
288 TRACE("(%p)->(%p)\n", This, p);
289 return E_NOTIMPL;
292 static HRESULT WINAPI HTMLBodyElement_put_aLink(IHTMLBodyElement *iface, VARIANT v)
294 HTMLBodyElement *This = HTMLBODY_THIS(iface);
295 TRACE("(%p)->()\n", This);
296 return E_NOTIMPL;
299 static HRESULT WINAPI HTMLBodyElement_get_aLink(IHTMLBodyElement *iface, VARIANT *p)
301 HTMLBodyElement *This = HTMLBODY_THIS(iface);
302 TRACE("(%p)->(%p)\n", This, p);
303 return E_NOTIMPL;
306 static HRESULT WINAPI HTMLBodyElement_put_onload(IHTMLBodyElement *iface, VARIANT v)
308 HTMLBodyElement *This = HTMLBODY_THIS(iface);
309 TRACE("(%p)->()\n", This);
310 return E_NOTIMPL;
313 static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIANT *p)
315 HTMLBodyElement *This = HTMLBODY_THIS(iface);
316 TRACE("(%p)->(%p)\n", This, p);
317 return E_NOTIMPL;
320 static HRESULT WINAPI HTMLBodyElement_put_onunload(IHTMLBodyElement *iface, VARIANT v)
322 HTMLBodyElement *This = HTMLBODY_THIS(iface);
323 TRACE("(%p)->()\n", This);
324 return E_NOTIMPL;
327 static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARIANT *p)
329 HTMLBodyElement *This = HTMLBODY_THIS(iface);
330 TRACE("(%p)->(%p)\n", This, p);
331 return E_NOTIMPL;
334 static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
336 HTMLBodyElement *This = HTMLBODY_THIS(iface);
337 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
338 return E_NOTIMPL;
341 static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
343 HTMLBodyElement *This = HTMLBODY_THIS(iface);
344 TRACE("(%p)->(%p)\n", This, p);
345 return E_NOTIMPL;
348 static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
350 HTMLBodyElement *This = HTMLBODY_THIS(iface);
351 TRACE("(%p)->()\n", This);
352 return E_NOTIMPL;
355 static HRESULT WINAPI HTMLBodyElement_get_onselect(IHTMLBodyElement *iface, VARIANT *p)
357 HTMLBodyElement *This = HTMLBODY_THIS(iface);
358 TRACE("(%p)->(%p)\n", This, p);
359 return E_NOTIMPL;
362 static HRESULT WINAPI HTMLBodyElement_put_onbeforeunload(IHTMLBodyElement *iface, VARIANT v)
364 HTMLBodyElement *This = HTMLBODY_THIS(iface);
365 TRACE("(%p)->()\n", This);
366 return E_NOTIMPL;
369 static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface, VARIANT *p)
371 HTMLBodyElement *This = HTMLBODY_THIS(iface);
372 TRACE("(%p)->(%p)\n", This, p);
373 return E_NOTIMPL;
376 static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
378 HTMLBodyElement *This = HTMLBODY_THIS(iface);
379 TRACE("(%p)->(%p)\n", This, range);
380 return E_NOTIMPL;
383 static void HTMLBodyElement_destructor(IUnknown *iface)
385 HTMLBodyElement *This = HTMLBODY_THIS(iface);
387 nsIDOMHTMLBodyElement_Release(This->nsbody);
388 HeapFree(GetProcessHeap(), 0, This);
391 static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
392 HTMLBodyElement_QueryInterface,
393 HTMLBodyElement_AddRef,
394 HTMLBodyElement_Release,
395 HTMLBodyElement_GetTypeInfoCount,
396 HTMLBodyElement_GetTypeInfo,
397 HTMLBodyElement_GetIDsOfNames,
398 HTMLBodyElement_Invoke,
399 HTMLBodyElement_put_background,
400 HTMLBodyElement_get_background,
401 HTMLBodyElement_put_bgProperties,
402 HTMLBodyElement_get_bgProperties,
403 HTMLBodyElement_put_leftMargin,
404 HTMLBodyElement_get_leftMargin,
405 HTMLBodyElement_put_topMargin,
406 HTMLBodyElement_get_topMargin,
407 HTMLBodyElement_put_rightMargin,
408 HTMLBodyElement_get_rightMargin,
409 HTMLBodyElement_put_bottomMargin,
410 HTMLBodyElement_get_bottomMargin,
411 HTMLBodyElement_put_noWrap,
412 HTMLBodyElement_get_noWrap,
413 HTMLBodyElement_put_bgColor,
414 HTMLBodyElement_get_bgColor,
415 HTMLBodyElement_put_text,
416 HTMLBodyElement_get_text,
417 HTMLBodyElement_put_link,
418 HTMLBodyElement_get_link,
419 HTMLBodyElement_put_vLink,
420 HTMLBodyElement_get_vLink,
421 HTMLBodyElement_put_aLink,
422 HTMLBodyElement_get_aLink,
423 HTMLBodyElement_put_onload,
424 HTMLBodyElement_get_onload,
425 HTMLBodyElement_put_onunload,
426 HTMLBodyElement_get_onunload,
427 HTMLBodyElement_put_scroll,
428 HTMLBodyElement_get_scroll,
429 HTMLBodyElement_put_onselect,
430 HTMLBodyElement_get_onselect,
431 HTMLBodyElement_put_onbeforeunload,
432 HTMLBodyElement_get_onbeforeunload,
433 HTMLBodyElement_createTextRange
436 void HTMLBodyElement_Create(HTMLElement *element)
438 HTMLBodyElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLBodyElement));
439 nsresult nsres;
441 ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
442 ret->element = element;
444 HTMLTextContainer_Init(&ret->text_container, (IUnknown*)HTMLBODY(ret));
446 nsres = nsIDOMHTMLElement_QueryInterface(element->nselem, &IID_nsIDOMHTMLBodyElement,
447 (void**)&ret->nsbody);
448 if(NS_FAILED(nsres))
449 ERR("Could not get nsDOMHTMLBodyElement: %08lx\n", nsres);
451 element->impl = (IUnknown*)HTMLBODY(ret);
452 element->destructor = HTMLBodyElement_destructor;