winedump: Fix printing of module sources in PDB files.
[wine.git] / dlls / mshtml / htmlelem3.c
bloba2da8cc327ac4bbb38b344bc8a1828f0cb6a5de6
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"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 static inline HTMLElement *impl_from_IHTMLElement3(IHTMLElement3 *iface)
38 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement3_iface);
41 static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
42 REFIID riid, void **ppv)
44 HTMLElement *This = impl_from_IHTMLElement3(iface);
45 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
48 static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
50 HTMLElement *This = impl_from_IHTMLElement3(iface);
51 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
54 static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
56 HTMLElement *This = impl_from_IHTMLElement3(iface);
57 return IHTMLElement_Release(&This->IHTMLElement_iface);
60 static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
62 HTMLElement *This = impl_from_IHTMLElement3(iface);
63 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
66 static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
67 LCID lcid, ITypeInfo **ppTInfo)
69 HTMLElement *This = impl_from_IHTMLElement3(iface);
70 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
73 static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
74 LPOLESTR *rgszNames, UINT cNames,
75 LCID lcid, DISPID *rgDispId)
77 HTMLElement *This = impl_from_IHTMLElement3(iface);
78 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
79 lcid, rgDispId);
82 static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
83 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
84 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
86 HTMLElement *This = impl_from_IHTMLElement3(iface);
87 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
88 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
91 static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
93 HTMLElement *This = impl_from_IHTMLElement3(iface);
94 FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
95 return E_NOTIMPL;
98 static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
100 HTMLElement *This = impl_from_IHTMLElement3(iface);
101 FIXME("(%p)->(%p)\n", This, p);
102 return E_NOTIMPL;
105 static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
107 HTMLElement *This = impl_from_IHTMLElement3(iface);
108 FIXME("(%p)->(%p)\n", This, p);
109 return E_NOTIMPL;
112 static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
114 HTMLElement *This = impl_from_IHTMLElement3(iface);
115 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
116 return E_NOTIMPL;
119 static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
121 HTMLElement *This = impl_from_IHTMLElement3(iface);
122 FIXME("(%p)->(%p)\n", This, p);
123 return E_NOTIMPL;
126 static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
128 HTMLElement *This = impl_from_IHTMLElement3(iface);
129 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
130 return E_NOTIMPL;
133 static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
135 HTMLElement *This = impl_from_IHTMLElement3(iface);
136 FIXME("(%p)->(%p)\n", This, p);
137 return E_NOTIMPL;
140 static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
142 HTMLElement *This = impl_from_IHTMLElement3(iface);
143 FIXME("(%p)->(%x)\n", This, v);
144 return E_NOTIMPL;
147 static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
149 HTMLElement *This = impl_from_IHTMLElement3(iface);
150 FIXME("(%p)->(%p)\n", This, p);
151 return E_NOTIMPL;
154 static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
156 HTMLElement *This = impl_from_IHTMLElement3(iface);
157 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
158 return E_NOTIMPL;
161 static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
163 HTMLElement *This = impl_from_IHTMLElement3(iface);
164 FIXME("(%p)->(%p)\n", This, p);
165 return E_NOTIMPL;
168 static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
170 HTMLElement *This = impl_from_IHTMLElement3(iface);
171 FIXME("(%p)\n", This);
172 return E_NOTIMPL;
175 static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
177 HTMLElement *This = impl_from_IHTMLElement3(iface);
178 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
179 return E_NOTIMPL;
182 static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
184 HTMLElement *This = impl_from_IHTMLElement3(iface);
185 FIXME("(%p)->(%p)\n", This, p);
186 return E_NOTIMPL;
189 static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
191 HTMLElement *This = impl_from_IHTMLElement3(iface);
192 FIXME("(%p)->(%p)\n", This, p);
193 return E_NOTIMPL;
196 static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
198 HTMLElement *This = impl_from_IHTMLElement3(iface);
199 FIXME("(%p)->(%x)\n", This, v);
200 return E_NOTIMPL;
203 static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
205 HTMLElement *This = impl_from_IHTMLElement3(iface);
206 FIXME("(%p)->(%p)\n", This, p);
207 return E_NOTIMPL;
210 static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
212 static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
214 HTMLElement *This = impl_from_IHTMLElement3(iface);
215 VARIANT *var;
216 HRESULT hres;
218 TRACE("(%p)->(%x)\n", This, v);
220 if(This->node.vtbl->put_disabled)
221 return This->node.vtbl->put_disabled(&This->node, v);
223 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
224 if(FAILED(hres))
225 return hres;
227 VariantClear(var);
228 V_VT(var) = VT_BOOL;
229 V_BOOL(var) = v;
230 return S_OK;
233 static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
235 HTMLElement *This = impl_from_IHTMLElement3(iface);
236 VARIANT *var;
237 HRESULT hres;
239 TRACE("(%p)->(%p)\n", This, p);
241 if(This->node.vtbl->get_disabled)
242 return This->node.vtbl->get_disabled(&This->node, p);
244 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
245 if(hres == DISP_E_UNKNOWNNAME) {
246 *p = VARIANT_FALSE;
247 return S_OK;
249 if(FAILED(hres))
250 return hres;
252 if(V_VT(var) != VT_BOOL) {
253 FIXME("vt %d\n", V_VT(var));
254 return E_NOTIMPL;
257 *p = V_BOOL(var);
258 return S_OK;
261 static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
263 HTMLElement *This = impl_from_IHTMLElement3(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
270 HTMLElement *This = impl_from_IHTMLElement3(iface);
271 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
272 return E_NOTIMPL;
275 static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
277 HTMLElement *This = impl_from_IHTMLElement3(iface);
278 FIXME("(%p)->(%p)\n", This, p);
279 return E_NOTIMPL;
282 static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
284 HTMLElement *This = impl_from_IHTMLElement3(iface);
285 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
286 return E_NOTIMPL;
289 static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
291 HTMLElement *This = impl_from_IHTMLElement3(iface);
292 FIXME("(%p)->(%p)\n", This, p);
293 return E_NOTIMPL;
296 static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
297 VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
299 HTMLElement *This = impl_from_IHTMLElement3(iface);
301 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
302 pfCancelled);
304 return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
307 static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
309 HTMLElement *This = impl_from_IHTMLElement3(iface);
310 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
311 return E_NOTIMPL;
314 static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
316 HTMLElement *This = impl_from_IHTMLElement3(iface);
317 FIXME("(%p)->(%p)\n", This, p);
318 return E_NOTIMPL;
321 static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
323 HTMLElement *This = impl_from_IHTMLElement3(iface);
324 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
325 return E_NOTIMPL;
328 static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
330 HTMLElement *This = impl_from_IHTMLElement3(iface);
331 FIXME("(%p)->(%p)\n", This, p);
332 return E_NOTIMPL;
335 static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
337 HTMLElement *This = impl_from_IHTMLElement3(iface);
338 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
339 return E_NOTIMPL;
342 static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
344 HTMLElement *This = impl_from_IHTMLElement3(iface);
345 FIXME("(%p)->(%p)\n", This, p);
346 return E_NOTIMPL;
349 static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
351 HTMLElement *This = impl_from_IHTMLElement3(iface);
352 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
353 return E_NOTIMPL;
356 static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
358 HTMLElement *This = impl_from_IHTMLElement3(iface);
359 FIXME("(%p)->(%p)\n", This, p);
360 return E_NOTIMPL;
363 static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
365 HTMLElement *This = impl_from_IHTMLElement3(iface);
366 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
367 return E_NOTIMPL;
370 static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
372 HTMLElement *This = impl_from_IHTMLElement3(iface);
373 FIXME("(%p)->(%p)\n", This, p);
374 return E_NOTIMPL;
377 static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
379 HTMLElement *This = impl_from_IHTMLElement3(iface);
380 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
381 return E_NOTIMPL;
384 static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
386 HTMLElement *This = impl_from_IHTMLElement3(iface);
387 FIXME("(%p)->(%p)\n", This, p);
388 return E_NOTIMPL;
391 static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
393 HTMLElement *This = impl_from_IHTMLElement3(iface);
394 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
395 return E_NOTIMPL;
398 static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
400 HTMLElement *This = impl_from_IHTMLElement3(iface);
401 FIXME("(%p)->(%p)\n", This, p);
402 return E_NOTIMPL;
405 static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
407 HTMLElement *This = impl_from_IHTMLElement3(iface);
408 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
409 return E_NOTIMPL;
412 static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
414 HTMLElement *This = impl_from_IHTMLElement3(iface);
415 FIXME("(%p)->(%p)\n", This, p);
416 return E_NOTIMPL;
419 static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
421 HTMLElement *This = impl_from_IHTMLElement3(iface);
422 FIXME("(%p)->(%p)\n", This, pfRet);
423 return E_NOTIMPL;
426 static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
428 HTMLElement *This = impl_from_IHTMLElement3(iface);
429 FIXME("(%p)->(%p)\n", This, p);
430 return E_NOTIMPL;
433 static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
434 HTMLElement3_QueryInterface,
435 HTMLElement3_AddRef,
436 HTMLElement3_Release,
437 HTMLElement3_GetTypeInfoCount,
438 HTMLElement3_GetTypeInfo,
439 HTMLElement3_GetIDsOfNames,
440 HTMLElement3_Invoke,
441 HTMLElement3_mergeAttributes,
442 HTMLElement3_get_isMultiLine,
443 HTMLElement3_get_canHaveHTML,
444 HTMLElement3_put_onlayoutcomplete,
445 HTMLElement3_get_onlayoutcomplete,
446 HTMLElement3_put_onpage,
447 HTMLElement3_get_onpage,
448 HTMLElement3_put_inflateBlock,
449 HTMLElement3_get_inflateBlock,
450 HTMLElement3_put_onbeforedeactivate,
451 HTMLElement3_get_onbeforedeactivate,
452 HTMLElement3_setActive,
453 HTMLElement3_put_contentEditable,
454 HTMLElement3_get_contentEditable,
455 HTMLElement3_get_isContentEditable,
456 HTMLElement3_put_hideFocus,
457 HTMLElement3_get_hideFocus,
458 HTMLElement3_put_disabled,
459 HTMLElement3_get_disabled,
460 HTMLElement3_get_isDisabled,
461 HTMLElement3_put_onmove,
462 HTMLElement3_get_onmove,
463 HTMLElement3_put_oncontrolselect,
464 HTMLElement3_get_oncontrolselect,
465 HTMLElement3_fireEvent,
466 HTMLElement3_put_onresizestart,
467 HTMLElement3_get_onresizestart,
468 HTMLElement3_put_onresizeend,
469 HTMLElement3_get_onresizeend,
470 HTMLElement3_put_onmovestart,
471 HTMLElement3_get_onmovestart,
472 HTMLElement3_put_onmoveend,
473 HTMLElement3_get_onmoveend,
474 HTMLElement3_put_onmousecenter,
475 HTMLElement3_get_onmousecenter,
476 HTMLElement3_put_onmouseleave,
477 HTMLElement3_get_onmouseleave,
478 HTMLElement3_put_onactivate,
479 HTMLElement3_get_onactivate,
480 HTMLElement3_put_ondeactivate,
481 HTMLElement3_get_ondeactivate,
482 HTMLElement3_dragDrop,
483 HTMLElement3_get_glyphMode
486 void HTMLElement3_Init(HTMLElement *This)
488 This->IHTMLElement3_iface.lpVtbl = &HTMLElement3Vtbl;