urlmon: Add new IE7 QUERYOPTION.
[wine.git] / dlls / mshtml / htmlanchor.c
blob866329176ebfa68a7409090ce33930302aaecef3
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 FIXME("(%p)->(%p)\n", This, pctinfo);
71 return E_NOTIMPL;
74 static HRESULT WINAPI HTMLAnchorElement_GetTypeInfo(IHTMLAnchorElement *iface, UINT iTInfo,
75 LCID lcid, ITypeInfo **ppTInfo)
77 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
78 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
79 return E_NOTIMPL;
82 static HRESULT WINAPI HTMLAnchorElement_GetIDsOfNames(IHTMLAnchorElement *iface, REFIID riid,
83 LPOLESTR *rgszNames, UINT cNames,
84 LCID lcid, DISPID *rgDispId)
86 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
87 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
88 lcid, rgDispId);
89 return E_NOTIMPL;
92 static HRESULT WINAPI HTMLAnchorElement_Invoke(IHTMLAnchorElement *iface, DISPID dispIdMember,
93 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
94 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
96 HTMLAnchorElement *This = HTMLANCHOR_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);
99 return E_NOTIMPL;
102 static HRESULT WINAPI HTMLAnchorElement_put_href(IHTMLAnchorElement *iface, BSTR v)
104 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
105 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
106 return E_NOTIMPL;
109 static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR *p)
111 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
112 FIXME("(%p)->(%p)\n", This, p);
113 return E_NOTIMPL;
116 static HRESULT WINAPI HTMLAnchorElement_put_target(IHTMLAnchorElement *iface, BSTR v)
118 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
119 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
120 return E_NOTIMPL;
123 static HRESULT WINAPI HTMLAnchorElement_get_target(IHTMLAnchorElement *iface, BSTR *p)
125 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
126 FIXME("(%p)->(%p)\n", This, p);
127 return E_NOTIMPL;
130 static HRESULT WINAPI HTMLAnchorElement_put_rel(IHTMLAnchorElement *iface, BSTR v)
132 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
133 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
134 return E_NOTIMPL;
137 static HRESULT WINAPI HTMLAnchorElement_get_rel(IHTMLAnchorElement *iface, BSTR *p)
139 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
140 FIXME("(%p)->(%p)\n", This, p);
141 return E_NOTIMPL;
144 static HRESULT WINAPI HTMLAnchorElement_put_rev(IHTMLAnchorElement *iface, BSTR v)
146 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
147 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
148 return E_NOTIMPL;
151 static HRESULT WINAPI HTMLAnchorElement_get_rev(IHTMLAnchorElement *iface, BSTR *p)
153 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
154 FIXME("(%p)->(%p)\n", This, p);
155 return E_NOTIMPL;
158 static HRESULT WINAPI HTMLAnchorElement_put_urn(IHTMLAnchorElement *iface, BSTR v)
160 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
161 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
162 return E_NOTIMPL;
165 static HRESULT WINAPI HTMLAnchorElement_get_urn(IHTMLAnchorElement *iface, BSTR *p)
167 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
168 FIXME("(%p)->(%p)\n", This, p);
169 return E_NOTIMPL;
172 static HRESULT WINAPI HTMLAnchorElement_put_Methods(IHTMLAnchorElement *iface, BSTR v)
174 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
175 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
176 return E_NOTIMPL;
179 static HRESULT WINAPI HTMLAnchorElement_get_Methods(IHTMLAnchorElement *iface, BSTR *p)
181 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
182 FIXME("(%p)->(%p)\n", This, p);
183 return E_NOTIMPL;
186 static HRESULT WINAPI HTMLAnchorElement_put_name(IHTMLAnchorElement *iface, BSTR v)
188 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
189 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
190 return E_NOTIMPL;
193 static HRESULT WINAPI HTMLAnchorElement_get_name(IHTMLAnchorElement *iface, BSTR *p)
195 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
196 FIXME("(%p)->(%p)\n", This, p);
197 return E_NOTIMPL;
200 static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR v)
202 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
203 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
204 return E_NOTIMPL;
207 static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
209 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
210 FIXME("(%p)->(%p)\n", This, p);
211 return E_NOTIMPL;
214 static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
216 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
217 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
218 return E_NOTIMPL;
221 static HRESULT WINAPI HTMLAnchorElement_get_hostname(IHTMLAnchorElement *iface, BSTR *p)
223 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
224 FIXME("(%p)->(%p)\n", This, p);
225 return E_NOTIMPL;
228 static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface, BSTR v)
230 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
231 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
232 return E_NOTIMPL;
235 static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
237 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
238 FIXME("(%p)->(%p)\n", This, p);
239 return E_NOTIMPL;
242 static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
244 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
245 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
246 return E_NOTIMPL;
249 static HRESULT WINAPI HTMLAnchorElement_get_port(IHTMLAnchorElement *iface, BSTR *p)
251 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
252 FIXME("(%p)->(%p)\n", This, p);
253 return E_NOTIMPL;
256 static HRESULT WINAPI HTMLAnchorElement_put_protocol(IHTMLAnchorElement *iface, BSTR v)
258 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
259 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
260 return E_NOTIMPL;
263 static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface, BSTR *p)
265 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
266 FIXME("(%p)->(%p)\n", This, p);
267 return E_NOTIMPL;
270 static HRESULT WINAPI HTMLAnchorElement_put_search(IHTMLAnchorElement *iface, BSTR v)
272 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
273 FIXME("(%p)->(%p)\n", This, debugstr_w(v));
274 return E_NOTIMPL;
277 static HRESULT WINAPI HTMLAnchorElement_get_search(IHTMLAnchorElement *iface, BSTR *p)
279 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
280 FIXME("(%p)->(%p)\n", This, p);
281 return E_NOTIMPL;
284 static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR v)
286 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
287 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
288 return E_NOTIMPL;
291 static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
293 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
294 FIXME("(%p)->(%p)\n", This, p);
295 return E_NOTIMPL;
298 static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)
300 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
301 FIXME("(%p)->()\n", This);
302 return E_NOTIMPL;
305 static HRESULT WINAPI HTMLAnchorElement_get_onblur(IHTMLAnchorElement *iface, VARIANT *p)
307 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
308 FIXME("(%p)->(%p)\n", This, p);
309 return E_NOTIMPL;
312 static HRESULT WINAPI HTMLAnchorElement_put_onfocus(IHTMLAnchorElement *iface, VARIANT v)
314 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
315 FIXME("(%p)->()\n", This);
316 return E_NOTIMPL;
319 static HRESULT WINAPI HTMLAnchorElement_get_onfocus(IHTMLAnchorElement *iface, VARIANT *p)
321 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
322 FIXME("(%p)->(%p)\n", This, p);
323 return E_NOTIMPL;
326 static HRESULT WINAPI HTMLAnchorElement_put_accessKey(IHTMLAnchorElement *iface, BSTR v)
328 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
329 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
330 return E_NOTIMPL;
333 static HRESULT WINAPI HTMLAnchorElement_get_accessKey(IHTMLAnchorElement *iface, BSTR *p)
335 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
336 FIXME("(%p)->(%p)\n", This, p);
337 return E_NOTIMPL;
340 static HRESULT WINAPI HTMLAnchorElement_get_protocolLong(IHTMLAnchorElement *iface, BSTR *p)
342 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
344 return E_NOTIMPL;
347 static HRESULT WINAPI HTMLAnchorElement_get_mimeType(IHTMLAnchorElement *iface, BSTR *p)
349 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
350 FIXME("(%p)->(%p)\n", This, p);
351 return E_NOTIMPL;
354 static HRESULT WINAPI HTMLAnchorElement_get_nameProp(IHTMLAnchorElement *iface, BSTR *p)
356 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
358 return E_NOTIMPL;
361 static HRESULT WINAPI HTMLAnchorElement_put_tabIndex(IHTMLAnchorElement *iface, short v)
363 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
364 FIXME("(%p)->()\n", This);
365 return E_NOTIMPL;
368 static HRESULT WINAPI HTMLAnchorElement_get_tabIndex(IHTMLAnchorElement *iface, short *p)
370 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
371 FIXME("(%p)->(%p)\n", This, p);
372 return E_NOTIMPL;
375 static HRESULT WINAPI HTMLAnchorElement_focus(IHTMLAnchorElement *iface)
377 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
378 FIXME("(%p)\n", This);
379 return E_NOTIMPL;
382 static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
384 HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
385 FIXME("(%p)\n", This);
386 return E_NOTIMPL;
389 #undef HTMLANCHOR_THIS
391 static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
392 HTMLAnchorElement_QueryInterface,
393 HTMLAnchorElement_AddRef,
394 HTMLAnchorElement_Release,
395 HTMLAnchorElement_GetTypeInfoCount,
396 HTMLAnchorElement_GetTypeInfo,
397 HTMLAnchorElement_GetIDsOfNames,
398 HTMLAnchorElement_Invoke,
399 HTMLAnchorElement_put_href,
400 HTMLAnchorElement_get_href,
401 HTMLAnchorElement_put_target,
402 HTMLAnchorElement_get_target,
403 HTMLAnchorElement_put_rel,
404 HTMLAnchorElement_get_rel,
405 HTMLAnchorElement_put_rev,
406 HTMLAnchorElement_get_rev,
407 HTMLAnchorElement_put_urn,
408 HTMLAnchorElement_get_urn,
409 HTMLAnchorElement_put_Methods,
410 HTMLAnchorElement_get_Methods,
411 HTMLAnchorElement_put_name,
412 HTMLAnchorElement_get_name,
413 HTMLAnchorElement_put_host,
414 HTMLAnchorElement_get_host,
415 HTMLAnchorElement_put_hostname,
416 HTMLAnchorElement_get_hostname,
417 HTMLAnchorElement_put_pathname,
418 HTMLAnchorElement_get_pathname,
419 HTMLAnchorElement_put_port,
420 HTMLAnchorElement_get_port,
421 HTMLAnchorElement_put_protocol,
422 HTMLAnchorElement_get_protocol,
423 HTMLAnchorElement_put_search,
424 HTMLAnchorElement_get_search,
425 HTMLAnchorElement_put_hash,
426 HTMLAnchorElement_get_hash,
427 HTMLAnchorElement_put_onblur,
428 HTMLAnchorElement_get_onblur,
429 HTMLAnchorElement_put_onfocus,
430 HTMLAnchorElement_get_onfocus,
431 HTMLAnchorElement_put_accessKey,
432 HTMLAnchorElement_get_accessKey,
433 HTMLAnchorElement_get_protocolLong,
434 HTMLAnchorElement_get_mimeType,
435 HTMLAnchorElement_get_nameProp,
436 HTMLAnchorElement_put_tabIndex,
437 HTMLAnchorElement_get_tabIndex,
438 HTMLAnchorElement_focus,
439 HTMLAnchorElement_blur
442 #define HTMLANCHOR_NODE_THIS(iface) DEFINE_THIS2(HTMLAnchorElement, element.node, iface)
444 static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
446 HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
448 *ppv = NULL;
450 if(IsEqualGUID(&IID_IUnknown, riid)) {
451 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
452 *ppv = HTMLANCHOR(This);
453 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
454 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
455 *ppv = HTMLANCHOR(This);
456 }else if(IsEqualGUID(&IID_IHTMLAnchorElement, riid)) {
457 TRACE("(%p)->(IID_IHTMLAnchorElement %p)\n", This, ppv);
458 *ppv = HTMLANCHOR(This);
461 if(*ppv) {
462 IUnknown_AddRef((IUnknown*)*ppv);
463 return S_OK;
466 return HTMLElement_QI(&This->element.node, riid, ppv);
469 static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
471 HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
472 HTMLElement_destructor(&This->element.node);
475 #undef HTMLANCHOR_NODE_THIS
477 static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
478 HTMLAnchorElement_QI,
479 HTMLAnchorElement_destructor
482 HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
484 HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
486 HTMLElement_Init(&ret->element);
488 ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
489 ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
491 return &ret->element;