push a9ea98eed33411fd355fd4e8b78f7880f1dd09a3
[wine/hacks.git] / dlls / mshtml / htmlanchor.c
blob48095438bee0c9a25883ae256caf80b80aa42d79
1 /*
2 * Copyright 2007 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>
20 #include <stdio.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 typedef struct {
36 HTMLElement element;
38 const IHTMLAnchorElementVtbl *lpHTMLAnchorElementVtbl;
39 } HTMLAnchorElement;
41 #define HTMLANCHOR(x) ((IHTMLAnchorElement*) &(x)->lpHTMLAnchorElementVtbl)
43 #define HTMLANCHOR_THIS(iface) DEFINE_THIS(HTMLAnchorElement, HTMLAnchorElement, iface)
45 static HRESULT WINAPI HTMLAnchorElement_QueryInterface(IHTMLAnchorElement *iface,
46 REFIID riid, void **ppv)
48 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
50 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
53 static ULONG WINAPI HTMLAnchorElement_AddRef(IHTMLAnchorElement *iface)
55 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
57 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
60 static ULONG WINAPI HTMLAnchorElement_Release(IHTMLAnchorElement *iface)
62 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
64 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
67 static HRESULT WINAPI HTMLAnchorElement_GetTypeInfoCount(IHTMLAnchorElement *iface, UINT *pctinfo)
69 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
70 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
73 static HRESULT WINAPI HTMLAnchorElement_GetTypeInfo(IHTMLAnchorElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
77 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
80 static HRESULT WINAPI HTMLAnchorElement_GetIDsOfNames(IHTMLAnchorElement *iface, REFIID riid,
81 LPOLESTR *rgszNames, UINT cNames,
82 LCID lcid, DISPID *rgDispId)
84 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
85 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
88 static HRESULT WINAPI HTMLAnchorElement_Invoke(IHTMLAnchorElement *iface, DISPID dispIdMember,
89 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
90 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
92 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
93 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid,
94 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
97 static HRESULT WINAPI HTMLAnchorElement_put_href(IHTMLAnchorElement *iface, BSTR v)
99 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
100 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
101 return E_NOTIMPL;
104 static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR *p)
106 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
107 FIXME("(%p)->(%p)\n", This, p);
108 return E_NOTIMPL;
111 static HRESULT WINAPI HTMLAnchorElement_put_target(IHTMLAnchorElement *iface, BSTR v)
113 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
114 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
115 return E_NOTIMPL;
118 static HRESULT WINAPI HTMLAnchorElement_get_target(IHTMLAnchorElement *iface, BSTR *p)
120 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
121 FIXME("(%p)->(%p)\n", This, p);
122 return E_NOTIMPL;
125 static HRESULT WINAPI HTMLAnchorElement_put_rel(IHTMLAnchorElement *iface, BSTR v)
127 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
128 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
129 return E_NOTIMPL;
132 static HRESULT WINAPI HTMLAnchorElement_get_rel(IHTMLAnchorElement *iface, BSTR *p)
134 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
135 FIXME("(%p)->(%p)\n", This, p);
136 return E_NOTIMPL;
139 static HRESULT WINAPI HTMLAnchorElement_put_rev(IHTMLAnchorElement *iface, BSTR v)
141 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
142 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
143 return E_NOTIMPL;
146 static HRESULT WINAPI HTMLAnchorElement_get_rev(IHTMLAnchorElement *iface, BSTR *p)
148 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
153 static HRESULT WINAPI HTMLAnchorElement_put_urn(IHTMLAnchorElement *iface, BSTR v)
155 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
156 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
157 return E_NOTIMPL;
160 static HRESULT WINAPI HTMLAnchorElement_get_urn(IHTMLAnchorElement *iface, BSTR *p)
162 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
163 FIXME("(%p)->(%p)\n", This, p);
164 return E_NOTIMPL;
167 static HRESULT WINAPI HTMLAnchorElement_put_Methods(IHTMLAnchorElement *iface, BSTR v)
169 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
170 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
171 return E_NOTIMPL;
174 static HRESULT WINAPI HTMLAnchorElement_get_Methods(IHTMLAnchorElement *iface, BSTR *p)
176 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
177 FIXME("(%p)->(%p)\n", This, p);
178 return E_NOTIMPL;
181 static HRESULT WINAPI HTMLAnchorElement_put_name(IHTMLAnchorElement *iface, BSTR v)
183 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
184 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
185 return E_NOTIMPL;
188 static HRESULT WINAPI HTMLAnchorElement_get_name(IHTMLAnchorElement *iface, BSTR *p)
190 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
191 FIXME("(%p)->(%p)\n", This, p);
192 return E_NOTIMPL;
195 static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR v)
197 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
198 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
199 return E_NOTIMPL;
202 static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
204 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
205 FIXME("(%p)->(%p)\n", This, p);
206 return E_NOTIMPL;
209 static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
211 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
212 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
213 return E_NOTIMPL;
216 static HRESULT WINAPI HTMLAnchorElement_get_hostname(IHTMLAnchorElement *iface, BSTR *p)
218 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
219 FIXME("(%p)->(%p)\n", This, p);
220 return E_NOTIMPL;
223 static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface, BSTR v)
225 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
226 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
227 return E_NOTIMPL;
230 static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
232 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, p);
234 return E_NOTIMPL;
237 static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
239 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
240 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
241 return E_NOTIMPL;
244 static HRESULT WINAPI HTMLAnchorElement_get_port(IHTMLAnchorElement *iface, BSTR *p)
246 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
247 FIXME("(%p)->(%p)\n", This, p);
248 return E_NOTIMPL;
251 static HRESULT WINAPI HTMLAnchorElement_put_protocol(IHTMLAnchorElement *iface, BSTR v)
253 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
254 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
255 return E_NOTIMPL;
258 static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface, BSTR *p)
260 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
261 FIXME("(%p)->(%p)\n", This, p);
262 return E_NOTIMPL;
265 static HRESULT WINAPI HTMLAnchorElement_put_search(IHTMLAnchorElement *iface, BSTR v)
267 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
268 FIXME("(%p)->(%p)\n", This, debugstr_w(v));
269 return E_NOTIMPL;
272 static HRESULT WINAPI HTMLAnchorElement_get_search(IHTMLAnchorElement *iface, BSTR *p)
274 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
275 FIXME("(%p)->(%p)\n", This, p);
276 return E_NOTIMPL;
279 static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR v)
281 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
282 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
283 return E_NOTIMPL;
286 static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
288 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
289 FIXME("(%p)->(%p)\n", This, p);
290 return E_NOTIMPL;
293 static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)
295 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
296 FIXME("(%p)->()\n", This);
297 return E_NOTIMPL;
300 static HRESULT WINAPI HTMLAnchorElement_get_onblur(IHTMLAnchorElement *iface, VARIANT *p)
302 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
303 FIXME("(%p)->(%p)\n", This, p);
304 return E_NOTIMPL;
307 static HRESULT WINAPI HTMLAnchorElement_put_onfocus(IHTMLAnchorElement *iface, VARIANT v)
309 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
310 FIXME("(%p)->()\n", This);
311 return E_NOTIMPL;
314 static HRESULT WINAPI HTMLAnchorElement_get_onfocus(IHTMLAnchorElement *iface, VARIANT *p)
316 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
317 FIXME("(%p)->(%p)\n", This, p);
318 return E_NOTIMPL;
321 static HRESULT WINAPI HTMLAnchorElement_put_accessKey(IHTMLAnchorElement *iface, BSTR v)
323 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
324 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
325 return E_NOTIMPL;
328 static HRESULT WINAPI HTMLAnchorElement_get_accessKey(IHTMLAnchorElement *iface, BSTR *p)
330 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
331 FIXME("(%p)->(%p)\n", This, p);
332 return E_NOTIMPL;
335 static HRESULT WINAPI HTMLAnchorElement_get_protocolLong(IHTMLAnchorElement *iface, BSTR *p)
337 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
338 FIXME("(%p)->(%p)\n", This, p);
339 return E_NOTIMPL;
342 static HRESULT WINAPI HTMLAnchorElement_get_mimeType(IHTMLAnchorElement *iface, BSTR *p)
344 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
345 FIXME("(%p)->(%p)\n", This, p);
346 return E_NOTIMPL;
349 static HRESULT WINAPI HTMLAnchorElement_get_nameProp(IHTMLAnchorElement *iface, BSTR *p)
351 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
352 FIXME("(%p)->(%p)\n", This, p);
353 return E_NOTIMPL;
356 static HRESULT WINAPI HTMLAnchorElement_put_tabIndex(IHTMLAnchorElement *iface, short v)
358 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
359 FIXME("(%p)->()\n", This);
360 return E_NOTIMPL;
363 static HRESULT WINAPI HTMLAnchorElement_get_tabIndex(IHTMLAnchorElement *iface, short *p)
365 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
366 FIXME("(%p)->(%p)\n", This, p);
367 return E_NOTIMPL;
370 static HRESULT WINAPI HTMLAnchorElement_focus(IHTMLAnchorElement *iface)
372 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
373 FIXME("(%p)\n", This);
374 return E_NOTIMPL;
377 static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
379 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
380 FIXME("(%p)\n", This);
381 return E_NOTIMPL;
384 #undef HTMLANCHOR_THIS
386 static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
387 HTMLAnchorElement_QueryInterface,
388 HTMLAnchorElement_AddRef,
389 HTMLAnchorElement_Release,
390 HTMLAnchorElement_GetTypeInfoCount,
391 HTMLAnchorElement_GetTypeInfo,
392 HTMLAnchorElement_GetIDsOfNames,
393 HTMLAnchorElement_Invoke,
394 HTMLAnchorElement_put_href,
395 HTMLAnchorElement_get_href,
396 HTMLAnchorElement_put_target,
397 HTMLAnchorElement_get_target,
398 HTMLAnchorElement_put_rel,
399 HTMLAnchorElement_get_rel,
400 HTMLAnchorElement_put_rev,
401 HTMLAnchorElement_get_rev,
402 HTMLAnchorElement_put_urn,
403 HTMLAnchorElement_get_urn,
404 HTMLAnchorElement_put_Methods,
405 HTMLAnchorElement_get_Methods,
406 HTMLAnchorElement_put_name,
407 HTMLAnchorElement_get_name,
408 HTMLAnchorElement_put_host,
409 HTMLAnchorElement_get_host,
410 HTMLAnchorElement_put_hostname,
411 HTMLAnchorElement_get_hostname,
412 HTMLAnchorElement_put_pathname,
413 HTMLAnchorElement_get_pathname,
414 HTMLAnchorElement_put_port,
415 HTMLAnchorElement_get_port,
416 HTMLAnchorElement_put_protocol,
417 HTMLAnchorElement_get_protocol,
418 HTMLAnchorElement_put_search,
419 HTMLAnchorElement_get_search,
420 HTMLAnchorElement_put_hash,
421 HTMLAnchorElement_get_hash,
422 HTMLAnchorElement_put_onblur,
423 HTMLAnchorElement_get_onblur,
424 HTMLAnchorElement_put_onfocus,
425 HTMLAnchorElement_get_onfocus,
426 HTMLAnchorElement_put_accessKey,
427 HTMLAnchorElement_get_accessKey,
428 HTMLAnchorElement_get_protocolLong,
429 HTMLAnchorElement_get_mimeType,
430 HTMLAnchorElement_get_nameProp,
431 HTMLAnchorElement_put_tabIndex,
432 HTMLAnchorElement_get_tabIndex,
433 HTMLAnchorElement_focus,
434 HTMLAnchorElement_blur
437 #define HTMLANCHOR_NODE_THIS(iface) DEFINE_THIS2(HTMLAnchorElement, element.node, iface)
439 static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
441 HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
443 *ppv = NULL;
445 if(IsEqualGUID(&IID_IUnknown, riid)) {
446 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
447 *ppv = HTMLANCHOR(This);
448 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
449 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
450 *ppv = HTMLANCHOR(This);
451 }else if(IsEqualGUID(&IID_IHTMLAnchorElement, riid)) {
452 TRACE("(%p)->(IID_IHTMLAnchorElement %p)\n", This, ppv);
453 *ppv = HTMLANCHOR(This);
456 if(*ppv) {
457 IUnknown_AddRef((IUnknown*)*ppv);
458 return S_OK;
461 return HTMLElement_QI(&This->element.node, riid, ppv);
464 static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
466 HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
467 HTMLElement_destructor(&This->element.node);
470 #undef HTMLANCHOR_NODE_THIS
472 static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
473 HTMLAnchorElement_QI,
474 HTMLAnchorElement_destructor
477 HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
479 HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
481 HTMLElement_Init(&ret->element);
483 ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
484 ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
486 return &ret->element;