2 * Copyright 2008 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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
37 const IHTMLImgElementVtbl
*lpHTMLImgElementVtbl
;
39 nsIDOMHTMLImageElement
*nsimg
;
42 #define HTMLIMG(x) ((IHTMLImgElement*) &(x)->lpHTMLImgElementVtbl)
44 #define HTMLIMG_THIS(iface) DEFINE_THIS(HTMLImgElement, HTMLImgElement, iface)
46 static HRESULT WINAPI
HTMLImgElement_QueryInterface(IHTMLImgElement
*iface
, REFIID riid
, void **ppv
)
48 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
50 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This
->element
.node
), riid
, ppv
);
53 static ULONG WINAPI
HTMLImgElement_AddRef(IHTMLImgElement
*iface
)
55 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
57 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This
->element
.node
));
60 static ULONG WINAPI
HTMLImgElement_Release(IHTMLImgElement
*iface
)
62 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
64 return IHTMLDOMNode_Release(HTMLDOMNODE(&This
->element
.node
));
67 static HRESULT WINAPI
HTMLImgElement_GetTypeInfoCount(IHTMLImgElement
*iface
, UINT
*pctinfo
)
69 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
70 FIXME("(%p)->(%p)\n", This
, pctinfo
);
74 static HRESULT WINAPI
HTMLImgElement_GetTypeInfo(IHTMLImgElement
*iface
, UINT iTInfo
,
75 LCID lcid
, ITypeInfo
**ppTInfo
)
77 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
78 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
82 static HRESULT WINAPI
HTMLImgElement_GetIDsOfNames(IHTMLImgElement
*iface
, REFIID riid
,
83 LPOLESTR
*rgszNames
, UINT cNames
,
84 LCID lcid
, DISPID
*rgDispId
)
86 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
87 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
92 static HRESULT WINAPI
HTMLImgElement_Invoke(IHTMLImgElement
*iface
, DISPID dispIdMember
,
93 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
94 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
96 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
97 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
98 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
102 static HRESULT WINAPI
HTMLImgElement_put_isMap(IHTMLImgElement
*iface
, VARIANT_BOOL v
)
104 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
105 FIXME("(%p)->(%x)\n", This
, v
);
109 static HRESULT WINAPI
HTMLImgElement_get_isMap(IHTMLImgElement
*iface
, VARIANT_BOOL
*p
)
111 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
112 FIXME("(%p)->(%p)\n", This
, p
);
116 static HRESULT WINAPI
HTMLImgElement_put_useMap(IHTMLImgElement
*iface
, BSTR v
)
118 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
119 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
123 static HRESULT WINAPI
HTMLImgElement_get_useMap(IHTMLImgElement
*iface
, BSTR
*p
)
125 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
126 FIXME("(%p)->(%p)\n", This
, p
);
130 static HRESULT WINAPI
HTMLImgElement_get_mimeType(IHTMLImgElement
*iface
, BSTR
*p
)
132 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
133 FIXME("(%p)->(%p)\n", This
, p
);
137 static HRESULT WINAPI
HTMLImgElement_get_fileSize(IHTMLImgElement
*iface
, BSTR
*p
)
139 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
140 FIXME("(%p)->(%p)\n", This
, p
);
144 static HRESULT WINAPI
HTMLImgElement_get_fileCreatedDate(IHTMLImgElement
*iface
, BSTR
*p
)
146 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
147 FIXME("(%p)->(%p)\n", This
, p
);
151 static HRESULT WINAPI
HTMLImgElement_get_fileModifiedDate(IHTMLImgElement
*iface
, BSTR
*p
)
153 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
154 FIXME("(%p)->(%p)\n", This
, p
);
158 static HRESULT WINAPI
HTMLImgElement_get_fileUpdatedDate(IHTMLImgElement
*iface
, BSTR
*p
)
160 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
161 FIXME("(%p)->(%p)\n", This
, p
);
165 static HRESULT WINAPI
HTMLImgElement_get_protocol(IHTMLImgElement
*iface
, BSTR
*p
)
167 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
168 FIXME("(%p)->(%p)\n", This
, p
);
172 static HRESULT WINAPI
HTMLImgElement_get_href(IHTMLImgElement
*iface
, BSTR
*p
)
174 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
175 FIXME("(%p)->(%p)\n", This
, p
);
179 static HRESULT WINAPI
HTMLImgElement_get_nameProp(IHTMLImgElement
*iface
, BSTR
*p
)
181 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
182 FIXME("(%p)->(%p)\n", This
, p
);
186 static HRESULT WINAPI
HTMLImgElement_put_border(IHTMLImgElement
*iface
, VARIANT v
)
188 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
189 FIXME("(%p)->()\n", This
);
193 static HRESULT WINAPI
HTMLImgElement_get_border(IHTMLImgElement
*iface
, VARIANT
*p
)
195 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
196 FIXME("(%p)->(%p)\n", This
, p
);
200 static HRESULT WINAPI
HTMLImgElement_put_vspace(IHTMLImgElement
*iface
, long v
)
202 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
203 FIXME("(%p)->(%ld)\n", This
, v
);
207 static HRESULT WINAPI
HTMLImgElement_get_vspace(IHTMLImgElement
*iface
, long *p
)
209 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
210 FIXME("(%p)->(%p)\n", This
, p
);
214 static HRESULT WINAPI
HTMLImgElement_put_hspace(IHTMLImgElement
*iface
, long v
)
216 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
217 FIXME("(%p)->(%ld)\n", This
, v
);
221 static HRESULT WINAPI
HTMLImgElement_get_hspace(IHTMLImgElement
*iface
, long *p
)
223 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
224 FIXME("(%p)->(%p)\n", This
, p
);
228 static HRESULT WINAPI
HTMLImgElement_put_alt(IHTMLImgElement
*iface
, BSTR v
)
230 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
231 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
235 static HRESULT WINAPI
HTMLImgElement_get_alt(IHTMLImgElement
*iface
, BSTR
*p
)
237 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
238 FIXME("(%p)->(%p)\n", This
, p
);
242 static HRESULT WINAPI
HTMLImgElement_put_src(IHTMLImgElement
*iface
, BSTR v
)
244 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
248 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
250 nsAString_Init(&src_str
, v
);
251 nsres
= nsIDOMHTMLImageElement_SetSrc(This
->nsimg
, &src_str
);
252 nsAString_Finish(&src_str
);
254 ERR("SetSrc failed: %08x\n", nsres
);
259 static HRESULT WINAPI
HTMLImgElement_get_src(IHTMLImgElement
*iface
, BSTR
*p
)
261 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
262 FIXME("(%p)->(%p)\n", This
, p
);
266 static HRESULT WINAPI
HTMLImgElement_put_lowsrc(IHTMLImgElement
*iface
, BSTR v
)
268 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
269 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
273 static HRESULT WINAPI
HTMLImgElement_get_lowsrc(IHTMLImgElement
*iface
, BSTR
*p
)
275 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
276 FIXME("(%p)->(%p)\n", This
, p
);
280 static HRESULT WINAPI
HTMLImgElement_put_vrml(IHTMLImgElement
*iface
, BSTR v
)
282 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
283 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
287 static HRESULT WINAPI
HTMLImgElement_get_vrml(IHTMLImgElement
*iface
, BSTR
*p
)
289 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
290 FIXME("(%p)->(%p)\n", This
, p
);
294 static HRESULT WINAPI
HTMLImgElement_put_dynsrc(IHTMLImgElement
*iface
, BSTR v
)
296 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
297 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
301 static HRESULT WINAPI
HTMLImgElement_get_dynsrc(IHTMLImgElement
*iface
, BSTR
*p
)
303 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
304 FIXME("(%p)->(%p)\n", This
, p
);
308 static HRESULT WINAPI
HTMLImgElement_get_readyState(IHTMLImgElement
*iface
, BSTR
*p
)
310 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
311 FIXME("(%p)->(%p)\n", This
, p
);
315 static HRESULT WINAPI
HTMLImgElement_get_complete(IHTMLImgElement
*iface
, VARIANT_BOOL
*p
)
317 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
318 FIXME("(%p)->(%p)\n", This
, p
);
322 static HRESULT WINAPI
HTMLImgElement_put_loop(IHTMLImgElement
*iface
, VARIANT v
)
324 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
325 FIXME("(%p)->()\n", This
);
329 static HRESULT WINAPI
HTMLImgElement_get_loop(IHTMLImgElement
*iface
, VARIANT
*p
)
331 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
332 FIXME("(%p)->(%p)\n", This
, p
);
336 static HRESULT WINAPI
HTMLImgElement_put_align(IHTMLImgElement
*iface
, BSTR v
)
338 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
339 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
343 static HRESULT WINAPI
HTMLImgElement_get_align(IHTMLImgElement
*iface
, BSTR
*p
)
345 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
346 FIXME("(%p)->(%p)\n", This
, p
);
350 static HRESULT WINAPI
HTMLImgElement_put_onload(IHTMLImgElement
*iface
, VARIANT v
)
352 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
353 FIXME("(%p)->()\n", This
);
357 static HRESULT WINAPI
HTMLImgElement_get_onload(IHTMLImgElement
*iface
, VARIANT
*p
)
359 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
360 FIXME("(%p)->(%p)\n", This
, p
);
364 static HRESULT WINAPI
HTMLImgElement_put_onerror(IHTMLImgElement
*iface
, VARIANT v
)
366 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
367 FIXME("(%p)->()\n", This
);
371 static HRESULT WINAPI
HTMLImgElement_get_onerror(IHTMLImgElement
*iface
, VARIANT
*p
)
373 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
374 FIXME("(%p)->(%p)\n", This
, p
);
378 static HRESULT WINAPI
HTMLImgElement_put_onabort(IHTMLImgElement
*iface
, VARIANT v
)
380 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
381 FIXME("(%p)->()\n", This
);
385 static HRESULT WINAPI
HTMLImgElement_get_onabort(IHTMLImgElement
*iface
, VARIANT
*p
)
387 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
388 FIXME("(%p)->(%p)\n", This
, p
);
392 static HRESULT WINAPI
HTMLImgElement_put_name(IHTMLImgElement
*iface
, BSTR v
)
394 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
395 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
399 static HRESULT WINAPI
HTMLImgElement_get_name(IHTMLImgElement
*iface
, BSTR
*p
)
401 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
402 FIXME("(%p)->(%p)\n", This
, p
);
406 static HRESULT WINAPI
HTMLImgElement_put_width(IHTMLImgElement
*iface
, long v
)
408 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
409 FIXME("(%p)->(%ld)\n", This
, v
);
413 static HRESULT WINAPI
HTMLImgElement_get_width(IHTMLImgElement
*iface
, long *p
)
415 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
416 FIXME("(%p)->(%p)\n", This
, p
);
420 static HRESULT WINAPI
HTMLImgElement_put_height(IHTMLImgElement
*iface
, long v
)
422 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
423 FIXME("(%p)->(%ld)\n", This
, v
);
427 static HRESULT WINAPI
HTMLImgElement_get_height(IHTMLImgElement
*iface
, long *p
)
429 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
430 FIXME("(%p)->(%p)\n", This
, p
);
434 static HRESULT WINAPI
HTMLImgElement_put_start(IHTMLImgElement
*iface
, BSTR v
)
436 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
437 FIXME("(%p)->()\n", This
);
441 static HRESULT WINAPI
HTMLImgElement_get_start(IHTMLImgElement
*iface
, BSTR
*p
)
443 HTMLImgElement
*This
= HTMLIMG_THIS(iface
);
444 FIXME("(%p)->(%p)\n", This
, p
);
450 static const IHTMLImgElementVtbl HTMLImgElementVtbl
= {
451 HTMLImgElement_QueryInterface
,
452 HTMLImgElement_AddRef
,
453 HTMLImgElement_Release
,
454 HTMLImgElement_GetTypeInfoCount
,
455 HTMLImgElement_GetTypeInfo
,
456 HTMLImgElement_GetIDsOfNames
,
457 HTMLImgElement_Invoke
,
458 HTMLImgElement_put_isMap
,
459 HTMLImgElement_get_isMap
,
460 HTMLImgElement_put_useMap
,
461 HTMLImgElement_get_useMap
,
462 HTMLImgElement_get_mimeType
,
463 HTMLImgElement_get_fileSize
,
464 HTMLImgElement_get_fileCreatedDate
,
465 HTMLImgElement_get_fileModifiedDate
,
466 HTMLImgElement_get_fileUpdatedDate
,
467 HTMLImgElement_get_protocol
,
468 HTMLImgElement_get_href
,
469 HTMLImgElement_get_nameProp
,
470 HTMLImgElement_put_border
,
471 HTMLImgElement_get_border
,
472 HTMLImgElement_put_vspace
,
473 HTMLImgElement_get_vspace
,
474 HTMLImgElement_put_hspace
,
475 HTMLImgElement_get_hspace
,
476 HTMLImgElement_put_alt
,
477 HTMLImgElement_get_alt
,
478 HTMLImgElement_put_src
,
479 HTMLImgElement_get_src
,
480 HTMLImgElement_put_lowsrc
,
481 HTMLImgElement_get_lowsrc
,
482 HTMLImgElement_put_vrml
,
483 HTMLImgElement_get_vrml
,
484 HTMLImgElement_put_dynsrc
,
485 HTMLImgElement_get_dynsrc
,
486 HTMLImgElement_get_readyState
,
487 HTMLImgElement_get_complete
,
488 HTMLImgElement_put_loop
,
489 HTMLImgElement_get_loop
,
490 HTMLImgElement_put_align
,
491 HTMLImgElement_get_align
,
492 HTMLImgElement_put_onload
,
493 HTMLImgElement_get_onload
,
494 HTMLImgElement_put_onerror
,
495 HTMLImgElement_get_onerror
,
496 HTMLImgElement_put_onabort
,
497 HTMLImgElement_get_onabort
,
498 HTMLImgElement_put_name
,
499 HTMLImgElement_get_name
,
500 HTMLImgElement_put_width
,
501 HTMLImgElement_get_width
,
502 HTMLImgElement_put_height
,
503 HTMLImgElement_get_height
,
504 HTMLImgElement_put_start
,
505 HTMLImgElement_get_start
508 #define HTMLIMG_NODE_THIS(iface) DEFINE_THIS2(HTMLImgElement, element.node, iface)
510 static HRESULT
HTMLImgElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
512 HTMLImgElement
*This
= HTMLIMG_NODE_THIS(iface
);
516 if(IsEqualGUID(&IID_IHTMLImgElement
, riid
)) {
517 TRACE("(%p)->(IID_IHTMLImgElement %p)\n", This
, ppv
);
518 *ppv
= HTMLIMG(This
);
520 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
523 IUnknown_AddRef((IUnknown
*)*ppv
);
527 static void HTMLImgElement_destructor(HTMLDOMNode
*iface
)
529 HTMLImgElement
*This
= HTMLIMG_NODE_THIS(iface
);
532 nsIDOMHTMLImageElement_Release(This
->nsimg
);
534 HTMLElement_destructor(&This
->element
.node
);
537 #undef HTMLIMG_NODE_THIS
539 static const NodeImplVtbl HTMLImgElementImplVtbl
= {
541 HTMLImgElement_destructor
544 static const tid_t HTMLImgElement_iface_tids
[] = {
552 static dispex_static_data_t HTMLImgElement_dispex
= {
556 HTMLImgElement_iface_tids
559 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*nselem
)
561 HTMLImgElement
*ret
= heap_alloc_zero(sizeof(HTMLImgElement
));
564 ret
->lpHTMLImgElementVtbl
= &HTMLImgElementVtbl
;
565 ret
->element
.node
.vtbl
= &HTMLImgElementImplVtbl
;
567 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLImageElement
, (void**)&ret
->nsimg
);
569 ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres
);
571 init_dispex(&ret
->element
.node
.dispex
, (IUnknown
*)HTMLIMG(ret
), &HTMLImgElement_dispex
);
572 HTMLElement_Init(&ret
->element
);
574 return &ret
->element
;