urlmon: Add new IE7 QUERYOPTION.
[wine.git] / dlls / mshtml / htmlimg.c
blob92647be9a7bcdf7ca030e2a9c65d7215b3ced428
1 /*
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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34 typedef struct {
35 HTMLElement element;
37 const IHTMLImgElementVtbl *lpHTMLImgElementVtbl;
38 } HTMLImgElement;
40 #define HTMLIMG(x) ((IHTMLImgElement*) &(x)->lpHTMLImgElementVtbl)
42 #define HTMLIMG_THIS(iface) DEFINE_THIS(HTMLImgElement, HTMLImgElement, iface)
44 static HRESULT WINAPI HTMLImgElement_QueryInterface(IHTMLImgElement *iface, REFIID riid, void **ppv)
46 HTMLImgElement *This = HTMLIMG_THIS(iface);
48 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
51 static ULONG WINAPI HTMLImgElement_AddRef(IHTMLImgElement *iface)
53 HTMLImgElement *This = HTMLIMG_THIS(iface);
55 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
58 static ULONG WINAPI HTMLImgElement_Release(IHTMLImgElement *iface)
60 HTMLImgElement *This = HTMLIMG_THIS(iface);
62 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
65 static HRESULT WINAPI HTMLImgElement_GetTypeInfoCount(IHTMLImgElement *iface, UINT *pctinfo)
67 HTMLImgElement *This = HTMLIMG_THIS(iface);
68 FIXME("(%p)->(%p)\n", This, pctinfo);
69 return E_NOTIMPL;
72 static HRESULT WINAPI HTMLImgElement_GetTypeInfo(IHTMLImgElement *iface, UINT iTInfo,
73 LCID lcid, ITypeInfo **ppTInfo)
75 HTMLImgElement *This = HTMLIMG_THIS(iface);
76 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
77 return E_NOTIMPL;
80 static HRESULT WINAPI HTMLImgElement_GetIDsOfNames(IHTMLImgElement *iface, REFIID riid,
81 LPOLESTR *rgszNames, UINT cNames,
82 LCID lcid, DISPID *rgDispId)
84 HTMLImgElement *This = HTMLIMG_THIS(iface);
85 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
86 lcid, rgDispId);
87 return E_NOTIMPL;
90 static HRESULT WINAPI HTMLImgElement_Invoke(IHTMLImgElement *iface, DISPID dispIdMember,
91 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
92 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
94 HTMLImgElement *This = HTMLIMG_THIS(iface);
95 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
96 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
97 return E_NOTIMPL;
100 static HRESULT WINAPI HTMLImgElement_put_isMap(IHTMLImgElement *iface, VARIANT_BOOL v)
102 HTMLImgElement *This = HTMLIMG_THIS(iface);
103 FIXME("(%p)->(%x)\n", This, v);
104 return E_NOTIMPL;
107 static HRESULT WINAPI HTMLImgElement_get_isMap(IHTMLImgElement *iface, VARIANT_BOOL *p)
109 HTMLImgElement *This = HTMLIMG_THIS(iface);
110 FIXME("(%p)->(%p)\n", This, p);
111 return E_NOTIMPL;
114 static HRESULT WINAPI HTMLImgElement_put_useMap(IHTMLImgElement *iface, BSTR v)
116 HTMLImgElement *This = HTMLIMG_THIS(iface);
117 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
118 return E_NOTIMPL;
121 static HRESULT WINAPI HTMLImgElement_get_useMap(IHTMLImgElement *iface, BSTR *p)
123 HTMLImgElement *This = HTMLIMG_THIS(iface);
124 FIXME("(%p)->(%p)\n", This, p);
125 return E_NOTIMPL;
128 static HRESULT WINAPI HTMLImgElement_get_mimeType(IHTMLImgElement *iface, BSTR *p)
130 HTMLImgElement *This = HTMLIMG_THIS(iface);
131 FIXME("(%p)->(%p)\n", This, p);
132 return E_NOTIMPL;
135 static HRESULT WINAPI HTMLImgElement_get_fileSize(IHTMLImgElement *iface, BSTR *p)
137 HTMLImgElement *This = HTMLIMG_THIS(iface);
138 FIXME("(%p)->(%p)\n", This, p);
139 return E_NOTIMPL;
142 static HRESULT WINAPI HTMLImgElement_get_fileCreatedDate(IHTMLImgElement *iface, BSTR *p)
144 HTMLImgElement *This = HTMLIMG_THIS(iface);
145 FIXME("(%p)->(%p)\n", This, p);
146 return E_NOTIMPL;
149 static HRESULT WINAPI HTMLImgElement_get_fileModifiedDate(IHTMLImgElement *iface, BSTR *p)
151 HTMLImgElement *This = HTMLIMG_THIS(iface);
152 FIXME("(%p)->(%p)\n", This, p);
153 return E_NOTIMPL;
156 static HRESULT WINAPI HTMLImgElement_get_fileUpdatedDate(IHTMLImgElement *iface, BSTR *p)
158 HTMLImgElement *This = HTMLIMG_THIS(iface);
159 FIXME("(%p)->(%p)\n", This, p);
160 return E_NOTIMPL;
163 static HRESULT WINAPI HTMLImgElement_get_protocol(IHTMLImgElement *iface, BSTR *p)
165 HTMLImgElement *This = HTMLIMG_THIS(iface);
166 FIXME("(%p)->(%p)\n", This, p);
167 return E_NOTIMPL;
170 static HRESULT WINAPI HTMLImgElement_get_href(IHTMLImgElement *iface, BSTR *p)
172 HTMLImgElement *This = HTMLIMG_THIS(iface);
173 FIXME("(%p)->(%p)\n", This, p);
174 return E_NOTIMPL;
177 static HRESULT WINAPI HTMLImgElement_get_nameProp(IHTMLImgElement *iface, BSTR *p)
179 HTMLImgElement *This = HTMLIMG_THIS(iface);
180 FIXME("(%p)->(%p)\n", This, p);
181 return E_NOTIMPL;
184 static HRESULT WINAPI HTMLImgElement_put_border(IHTMLImgElement *iface, VARIANT v)
186 HTMLImgElement *This = HTMLIMG_THIS(iface);
187 FIXME("(%p)->()\n", This);
188 return E_NOTIMPL;
191 static HRESULT WINAPI HTMLImgElement_get_border(IHTMLImgElement *iface, VARIANT *p)
193 HTMLImgElement *This = HTMLIMG_THIS(iface);
194 FIXME("(%p)->(%p)\n", This, p);
195 return E_NOTIMPL;
198 static HRESULT WINAPI HTMLImgElement_put_vspace(IHTMLImgElement *iface, long v)
200 HTMLImgElement *This = HTMLIMG_THIS(iface);
201 FIXME("(%p)->(%ld)\n", This, v);
202 return E_NOTIMPL;
205 static HRESULT WINAPI HTMLImgElement_get_vspace(IHTMLImgElement *iface, long *p)
207 HTMLImgElement *This = HTMLIMG_THIS(iface);
208 FIXME("(%p)->(%p)\n", This, p);
209 return E_NOTIMPL;
212 static HRESULT WINAPI HTMLImgElement_put_hspace(IHTMLImgElement *iface, long v)
214 HTMLImgElement *This = HTMLIMG_THIS(iface);
215 FIXME("(%p)->(%ld)\n", This, v);
216 return E_NOTIMPL;
219 static HRESULT WINAPI HTMLImgElement_get_hspace(IHTMLImgElement *iface, long *p)
221 HTMLImgElement *This = HTMLIMG_THIS(iface);
222 FIXME("(%p)->(%p)\n", This, p);
223 return E_NOTIMPL;
226 static HRESULT WINAPI HTMLImgElement_put_alt(IHTMLImgElement *iface, BSTR v)
228 HTMLImgElement *This = HTMLIMG_THIS(iface);
229 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
230 return E_NOTIMPL;
233 static HRESULT WINAPI HTMLImgElement_get_alt(IHTMLImgElement *iface, BSTR *p)
235 HTMLImgElement *This = HTMLIMG_THIS(iface);
236 FIXME("(%p)->(%p)\n", This, p);
237 return E_NOTIMPL;
240 static HRESULT WINAPI HTMLImgElement_put_src(IHTMLImgElement *iface, BSTR v)
242 HTMLImgElement *This = HTMLIMG_THIS(iface);
243 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
244 return E_NOTIMPL;
247 static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p)
249 HTMLImgElement *This = HTMLIMG_THIS(iface);
250 FIXME("(%p)->(%p)\n", This, p);
251 return E_NOTIMPL;
254 static HRESULT WINAPI HTMLImgElement_put_lowsrc(IHTMLImgElement *iface, BSTR v)
256 HTMLImgElement *This = HTMLIMG_THIS(iface);
257 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
258 return E_NOTIMPL;
261 static HRESULT WINAPI HTMLImgElement_get_lowsrc(IHTMLImgElement *iface, BSTR *p)
263 HTMLImgElement *This = HTMLIMG_THIS(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLImgElement_put_vrml(IHTMLImgElement *iface, BSTR v)
270 HTMLImgElement *This = HTMLIMG_THIS(iface);
271 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
272 return E_NOTIMPL;
275 static HRESULT WINAPI HTMLImgElement_get_vrml(IHTMLImgElement *iface, BSTR *p)
277 HTMLImgElement *This = HTMLIMG_THIS(iface);
278 FIXME("(%p)->(%p)\n", This, p);
279 return E_NOTIMPL;
282 static HRESULT WINAPI HTMLImgElement_put_dynsrc(IHTMLImgElement *iface, BSTR v)
284 HTMLImgElement *This = HTMLIMG_THIS(iface);
285 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
286 return E_NOTIMPL;
289 static HRESULT WINAPI HTMLImgElement_get_dynsrc(IHTMLImgElement *iface, BSTR *p)
291 HTMLImgElement *This = HTMLIMG_THIS(iface);
292 FIXME("(%p)->(%p)\n", This, p);
293 return E_NOTIMPL;
296 static HRESULT WINAPI HTMLImgElement_get_readyState(IHTMLImgElement *iface, BSTR *p)
298 HTMLImgElement *This = HTMLIMG_THIS(iface);
299 FIXME("(%p)->(%p)\n", This, p);
300 return E_NOTIMPL;
303 static HRESULT WINAPI HTMLImgElement_get_complete(IHTMLImgElement *iface, VARIANT_BOOL *p)
305 HTMLImgElement *This = HTMLIMG_THIS(iface);
306 FIXME("(%p)->(%p)\n", This, p);
307 return E_NOTIMPL;
310 static HRESULT WINAPI HTMLImgElement_put_loop(IHTMLImgElement *iface, VARIANT v)
312 HTMLImgElement *This = HTMLIMG_THIS(iface);
313 FIXME("(%p)->()\n", This);
314 return E_NOTIMPL;
317 static HRESULT WINAPI HTMLImgElement_get_loop(IHTMLImgElement *iface, VARIANT *p)
319 HTMLImgElement *This = HTMLIMG_THIS(iface);
320 FIXME("(%p)->(%p)\n", This, p);
321 return E_NOTIMPL;
324 static HRESULT WINAPI HTMLImgElement_put_align(IHTMLImgElement *iface, BSTR v)
326 HTMLImgElement *This = HTMLIMG_THIS(iface);
327 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
328 return E_NOTIMPL;
331 static HRESULT WINAPI HTMLImgElement_get_align(IHTMLImgElement *iface, BSTR *p)
333 HTMLImgElement *This = HTMLIMG_THIS(iface);
334 FIXME("(%p)->(%p)\n", This, p);
335 return E_NOTIMPL;
338 static HRESULT WINAPI HTMLImgElement_put_onload(IHTMLImgElement *iface, VARIANT v)
340 HTMLImgElement *This = HTMLIMG_THIS(iface);
341 FIXME("(%p)->()\n", This);
342 return E_NOTIMPL;
345 static HRESULT WINAPI HTMLImgElement_get_onload(IHTMLImgElement *iface, VARIANT *p)
347 HTMLImgElement *This = HTMLIMG_THIS(iface);
348 FIXME("(%p)->(%p)\n", This, p);
349 return E_NOTIMPL;
352 static HRESULT WINAPI HTMLImgElement_put_onerror(IHTMLImgElement *iface, VARIANT v)
354 HTMLImgElement *This = HTMLIMG_THIS(iface);
355 FIXME("(%p)->()\n", This);
356 return E_NOTIMPL;
359 static HRESULT WINAPI HTMLImgElement_get_onerror(IHTMLImgElement *iface, VARIANT *p)
361 HTMLImgElement *This = HTMLIMG_THIS(iface);
362 FIXME("(%p)->(%p)\n", This, p);
363 return E_NOTIMPL;
366 static HRESULT WINAPI HTMLImgElement_put_onabort(IHTMLImgElement *iface, VARIANT v)
368 HTMLImgElement *This = HTMLIMG_THIS(iface);
369 FIXME("(%p)->()\n", This);
370 return E_NOTIMPL;
373 static HRESULT WINAPI HTMLImgElement_get_onabort(IHTMLImgElement *iface, VARIANT *p)
375 HTMLImgElement *This = HTMLIMG_THIS(iface);
376 FIXME("(%p)->(%p)\n", This, p);
377 return E_NOTIMPL;
380 static HRESULT WINAPI HTMLImgElement_put_name(IHTMLImgElement *iface, BSTR v)
382 HTMLImgElement *This = HTMLIMG_THIS(iface);
383 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
384 return E_NOTIMPL;
387 static HRESULT WINAPI HTMLImgElement_get_name(IHTMLImgElement *iface, BSTR *p)
389 HTMLImgElement *This = HTMLIMG_THIS(iface);
390 FIXME("(%p)->(%p)\n", This, p);
391 return E_NOTIMPL;
394 static HRESULT WINAPI HTMLImgElement_put_width(IHTMLImgElement *iface, long v)
396 HTMLImgElement *This = HTMLIMG_THIS(iface);
397 FIXME("(%p)->(%ld)\n", This, v);
398 return E_NOTIMPL;
401 static HRESULT WINAPI HTMLImgElement_get_width(IHTMLImgElement *iface, long *p)
403 HTMLImgElement *This = HTMLIMG_THIS(iface);
404 FIXME("(%p)->(%p)\n", This, p);
405 return E_NOTIMPL;
408 static HRESULT WINAPI HTMLImgElement_put_height(IHTMLImgElement *iface, long v)
410 HTMLImgElement *This = HTMLIMG_THIS(iface);
411 FIXME("(%p)->(%ld)\n", This, v);
412 return E_NOTIMPL;
415 static HRESULT WINAPI HTMLImgElement_get_height(IHTMLImgElement *iface, long *p)
417 HTMLImgElement *This = HTMLIMG_THIS(iface);
418 FIXME("(%p)->(%p)\n", This, p);
419 return E_NOTIMPL;
422 static HRESULT WINAPI HTMLImgElement_put_start(IHTMLImgElement *iface, BSTR v)
424 HTMLImgElement *This = HTMLIMG_THIS(iface);
425 FIXME("(%p)->()\n", This);
426 return E_NOTIMPL;
429 static HRESULT WINAPI HTMLImgElement_get_start(IHTMLImgElement *iface, BSTR *p)
431 HTMLImgElement *This = HTMLIMG_THIS(iface);
432 FIXME("(%p)->(%p)\n", This, p);
433 return E_NOTIMPL;
436 #undef HTMLIMG_THIS
438 static const IHTMLImgElementVtbl HTMLImgElementVtbl = {
439 HTMLImgElement_QueryInterface,
440 HTMLImgElement_AddRef,
441 HTMLImgElement_Release,
442 HTMLImgElement_GetTypeInfoCount,
443 HTMLImgElement_GetTypeInfo,
444 HTMLImgElement_GetIDsOfNames,
445 HTMLImgElement_Invoke,
446 HTMLImgElement_put_isMap,
447 HTMLImgElement_get_isMap,
448 HTMLImgElement_put_useMap,
449 HTMLImgElement_get_useMap,
450 HTMLImgElement_get_mimeType,
451 HTMLImgElement_get_fileSize,
452 HTMLImgElement_get_fileCreatedDate,
453 HTMLImgElement_get_fileModifiedDate,
454 HTMLImgElement_get_fileUpdatedDate,
455 HTMLImgElement_get_protocol,
456 HTMLImgElement_get_href,
457 HTMLImgElement_get_nameProp,
458 HTMLImgElement_put_border,
459 HTMLImgElement_get_border,
460 HTMLImgElement_put_vspace,
461 HTMLImgElement_get_vspace,
462 HTMLImgElement_put_hspace,
463 HTMLImgElement_get_hspace,
464 HTMLImgElement_put_alt,
465 HTMLImgElement_get_alt,
466 HTMLImgElement_put_src,
467 HTMLImgElement_get_src,
468 HTMLImgElement_put_lowsrc,
469 HTMLImgElement_get_lowsrc,
470 HTMLImgElement_put_vrml,
471 HTMLImgElement_get_vrml,
472 HTMLImgElement_put_dynsrc,
473 HTMLImgElement_get_dynsrc,
474 HTMLImgElement_get_readyState,
475 HTMLImgElement_get_complete,
476 HTMLImgElement_put_loop,
477 HTMLImgElement_get_loop,
478 HTMLImgElement_put_align,
479 HTMLImgElement_get_align,
480 HTMLImgElement_put_onload,
481 HTMLImgElement_get_onload,
482 HTMLImgElement_put_onerror,
483 HTMLImgElement_get_onerror,
484 HTMLImgElement_put_onabort,
485 HTMLImgElement_get_onabort,
486 HTMLImgElement_put_name,
487 HTMLImgElement_get_name,
488 HTMLImgElement_put_width,
489 HTMLImgElement_get_width,
490 HTMLImgElement_put_height,
491 HTMLImgElement_get_height,
492 HTMLImgElement_put_start,
493 HTMLImgElement_get_start
496 #define HTMLIMG_NODE_THIS(iface) DEFINE_THIS2(HTMLImgElement, element.node, iface)
498 static HRESULT HTMLImgElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
500 HTMLImgElement *This = HTMLIMG_NODE_THIS(iface);
502 *ppv = NULL;
504 if(IsEqualGUID(&IID_IHTMLImgElement, riid)) {
505 TRACE("(%p)->(IID_IHTMLImgElement %p)\n", This, ppv);
506 *ppv = HTMLIMG(This);
507 }else {
508 return HTMLElement_QI(&This->element.node, riid, ppv);
511 IUnknown_AddRef((IUnknown*)*ppv);
512 return S_OK;
515 static void HTMLImgElement_destructor(HTMLDOMNode *iface)
517 HTMLImgElement *This = HTMLIMG_NODE_THIS(iface);
519 HTMLElement_destructor(&This->element.node);
522 #undef HTMLIMG_NODE_THIS
524 static const NodeImplVtbl HTMLImgElementImplVtbl = {
525 HTMLImgElement_QI,
526 HTMLImgElement_destructor
529 static const tid_t HTMLImgElement_iface_tids[] = {
530 IHTMLDOMNode_tid,
531 IHTMLDOMNode2_tid,
532 IHTMLElement_tid,
533 IHTMLElement2_tid,
534 IHTMLImgElement_tid,
537 static dispex_static_data_t HTMLImgElement_dispex = {
538 NULL,
539 DispHTMLImg_tid,
540 NULL,
541 HTMLImgElement_iface_tids
544 HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem)
546 HTMLImgElement *ret = heap_alloc_zero(sizeof(HTMLImgElement));
548 ret->lpHTMLImgElementVtbl = &HTMLImgElementVtbl;
549 ret->element.node.vtbl = &HTMLImgElementImplVtbl;
551 init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLIMG(ret), &HTMLImgElement_dispex);
552 HTMLElement_Init(&ret->element);
554 return &ret->element;