wintrust: Use path in WIN_TRUST_SUBJECT_FILE structure rather than assuming a path...
[wine] / dlls / mshtml / htmlanchor.c
1 /*
2  * Copyright 2007 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20 #include <stdio.h>
21
22 #define COBJMACROS
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28
29 #include "wine/debug.h"
30
31 #include "mshtml_private.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 typedef struct {
36     HTMLElement element;
37
38     const IHTMLAnchorElementVtbl *lpHTMLAnchorElementVtbl;
39 } HTMLAnchorElement;
40
41 #define HTMLANCHOR(x)  ((IHTMLAnchorElement*)  &(x)->lpHTMLAnchorElementVtbl)
42
43 #define HTMLANCHOR_THIS(iface) DEFINE_THIS(HTMLAnchorElement, HTMLAnchorElement, iface)
44
45 static HRESULT WINAPI HTMLAnchorElement_QueryInterface(IHTMLAnchorElement *iface,
46         REFIID riid, void **ppv)
47 {
48     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
49
50     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
51 }
52
53 static ULONG WINAPI HTMLAnchorElement_AddRef(IHTMLAnchorElement *iface)
54 {
55     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
56
57     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
58 }
59
60 static ULONG WINAPI HTMLAnchorElement_Release(IHTMLAnchorElement *iface)
61 {
62     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
63
64     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
65 }
66
67 static HRESULT WINAPI HTMLAnchorElement_GetTypeInfoCount(IHTMLAnchorElement *iface, UINT *pctinfo)
68 {
69     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
70     FIXME("(%p)->(%p)\n", This, pctinfo);
71     return E_NOTIMPL;
72 }
73
74 static HRESULT WINAPI HTMLAnchorElement_GetTypeInfo(IHTMLAnchorElement *iface, UINT iTInfo,
75                                               LCID lcid, ITypeInfo **ppTInfo)
76 {
77     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
78     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
79     return E_NOTIMPL;
80 }
81
82 static HRESULT WINAPI HTMLAnchorElement_GetIDsOfNames(IHTMLAnchorElement *iface, REFIID riid,
83                                                 LPOLESTR *rgszNames, UINT cNames,
84                                                 LCID lcid, DISPID *rgDispId)
85 {
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;
90 }
91
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)
95 {
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;
100 }
101
102 static HRESULT WINAPI HTMLAnchorElement_put_href(IHTMLAnchorElement *iface, BSTR v)
103 {
104     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
105     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
106     return E_NOTIMPL;
107 }
108
109 static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR *p)
110 {
111     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
112     FIXME("(%p)->(%p)\n", This, p);
113     return E_NOTIMPL;
114 }
115
116 static HRESULT WINAPI HTMLAnchorElement_put_target(IHTMLAnchorElement *iface, BSTR v)
117 {
118     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
119     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
120     return E_NOTIMPL;
121 }
122
123 static HRESULT WINAPI HTMLAnchorElement_get_target(IHTMLAnchorElement *iface, BSTR *p)
124 {
125     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
126     FIXME("(%p)->(%p)\n", This, p);
127     return E_NOTIMPL;
128 }
129
130 static HRESULT WINAPI HTMLAnchorElement_put_rel(IHTMLAnchorElement *iface, BSTR v)
131 {
132     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
133     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
134     return E_NOTIMPL;
135 }
136
137 static HRESULT WINAPI HTMLAnchorElement_get_rel(IHTMLAnchorElement *iface, BSTR *p)
138 {
139     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
140     FIXME("(%p)->(%p)\n", This, p);
141     return E_NOTIMPL;
142 }
143
144 static HRESULT WINAPI HTMLAnchorElement_put_rev(IHTMLAnchorElement *iface, BSTR v)
145 {
146     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
147     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
148     return E_NOTIMPL;
149 }
150
151 static HRESULT WINAPI HTMLAnchorElement_get_rev(IHTMLAnchorElement *iface, BSTR *p)
152 {
153     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
154     FIXME("(%p)->(%p)\n", This, p);
155     return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI HTMLAnchorElement_put_urn(IHTMLAnchorElement *iface, BSTR v)
159 {
160     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
161     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
162     return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI HTMLAnchorElement_get_urn(IHTMLAnchorElement *iface, BSTR *p)
166 {
167     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
168     FIXME("(%p)->(%p)\n", This, p);
169     return E_NOTIMPL;
170 }
171
172 static HRESULT WINAPI HTMLAnchorElement_put_Methods(IHTMLAnchorElement *iface, BSTR v)
173 {
174     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
175     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
176     return E_NOTIMPL;
177 }
178
179 static HRESULT WINAPI HTMLAnchorElement_get_Methods(IHTMLAnchorElement *iface, BSTR *p)
180 {
181     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
182     FIXME("(%p)->(%p)\n", This, p);
183     return E_NOTIMPL;
184 }
185
186 static HRESULT WINAPI HTMLAnchorElement_put_name(IHTMLAnchorElement *iface, BSTR v)
187 {
188     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
189     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
190     return E_NOTIMPL;
191 }
192
193 static HRESULT WINAPI HTMLAnchorElement_get_name(IHTMLAnchorElement *iface, BSTR *p)
194 {
195     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
196     FIXME("(%p)->(%p)\n", This, p);
197     return E_NOTIMPL;
198 }
199
200 static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR v)
201 {
202     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
203     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
204     return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
208 {
209     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
210     FIXME("(%p)->(%p)\n", This, p);
211     return E_NOTIMPL;
212 }
213
214 static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
215 {
216     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
217     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
218     return E_NOTIMPL;
219 }
220
221 static HRESULT WINAPI HTMLAnchorElement_get_hostname(IHTMLAnchorElement *iface, BSTR *p)
222 {
223     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
224     FIXME("(%p)->(%p)\n", This, p);
225     return E_NOTIMPL;
226 }
227
228 static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface, BSTR v)
229 {
230     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
231     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
232     return E_NOTIMPL;
233 }
234
235 static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
236 {
237     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
238     FIXME("(%p)->(%p)\n", This, p);
239     return E_NOTIMPL;
240 }
241
242 static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
243 {
244     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
245     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
246     return E_NOTIMPL;
247 }
248
249 static HRESULT WINAPI HTMLAnchorElement_get_port(IHTMLAnchorElement *iface, BSTR *p)
250 {
251     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
252     FIXME("(%p)->(%p)\n", This, p);
253     return E_NOTIMPL;
254 }
255
256 static HRESULT WINAPI HTMLAnchorElement_put_protocol(IHTMLAnchorElement *iface, BSTR v)
257 {
258     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
259     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
260     return E_NOTIMPL;
261 }
262
263 static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface, BSTR *p)
264 {
265     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
266     FIXME("(%p)->(%p)\n", This, p);
267     return E_NOTIMPL;
268 }
269
270 static HRESULT WINAPI HTMLAnchorElement_put_search(IHTMLAnchorElement *iface, BSTR v)
271 {
272     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
273     FIXME("(%p)->(%p)\n", This, debugstr_w(v));
274     return E_NOTIMPL;
275 }
276
277 static HRESULT WINAPI HTMLAnchorElement_get_search(IHTMLAnchorElement *iface, BSTR *p)
278 {
279     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
280     FIXME("(%p)->(%p)\n", This, p);
281     return E_NOTIMPL;
282 }
283
284 static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR v)
285 {
286     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
287     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
288     return E_NOTIMPL;
289 }
290
291 static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
292 {
293     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
294     FIXME("(%p)->(%p)\n", This, p);
295     return E_NOTIMPL;
296 }
297
298 static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)
299 {
300     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
301     FIXME("(%p)->()\n", This);
302     return E_NOTIMPL;
303 }
304
305 static HRESULT WINAPI HTMLAnchorElement_get_onblur(IHTMLAnchorElement *iface, VARIANT *p)
306 {
307     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
308     FIXME("(%p)->(%p)\n", This, p);
309     return E_NOTIMPL;
310 }
311
312 static HRESULT WINAPI HTMLAnchorElement_put_onfocus(IHTMLAnchorElement *iface, VARIANT v)
313 {
314     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
315     FIXME("(%p)->()\n", This);
316     return E_NOTIMPL;
317 }
318
319 static HRESULT WINAPI HTMLAnchorElement_get_onfocus(IHTMLAnchorElement *iface, VARIANT *p)
320 {
321     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
322     FIXME("(%p)->(%p)\n", This, p);
323     return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI HTMLAnchorElement_put_accessKey(IHTMLAnchorElement *iface, BSTR v)
327 {
328     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
329     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
330     return E_NOTIMPL;
331 }
332
333 static HRESULT WINAPI HTMLAnchorElement_get_accessKey(IHTMLAnchorElement *iface, BSTR *p)
334 {
335     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
336     FIXME("(%p)->(%p)\n", This, p);
337     return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI HTMLAnchorElement_get_protocolLong(IHTMLAnchorElement *iface, BSTR *p)
341 {
342     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
343     FIXME("(%p)->(%p)\n", This, p);
344     return E_NOTIMPL;
345 }
346
347 static HRESULT WINAPI HTMLAnchorElement_get_mimeType(IHTMLAnchorElement *iface, BSTR *p)
348 {
349     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
350     FIXME("(%p)->(%p)\n", This, p);
351     return E_NOTIMPL;
352 }
353
354 static HRESULT WINAPI HTMLAnchorElement_get_nameProp(IHTMLAnchorElement *iface, BSTR *p)
355 {
356     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
357     FIXME("(%p)->(%p)\n", This, p);
358     return E_NOTIMPL;
359 }
360
361 static HRESULT WINAPI HTMLAnchorElement_put_tabIndex(IHTMLAnchorElement *iface, short v)
362 {
363     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
364     FIXME("(%p)->()\n", This);
365     return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI HTMLAnchorElement_get_tabIndex(IHTMLAnchorElement *iface, short *p)
369 {
370     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
371     FIXME("(%p)->(%p)\n", This, p);
372     return E_NOTIMPL;
373 }
374
375 static HRESULT WINAPI HTMLAnchorElement_focus(IHTMLAnchorElement *iface)
376 {
377     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
378     FIXME("(%p)\n", This);
379     return E_NOTIMPL;
380 }
381
382 static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
383 {
384     HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
385     FIXME("(%p)\n", This);
386     return E_NOTIMPL;
387 }
388
389 #undef HTMLANCHOR_THIS
390
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
440 };
441
442 #define HTMLANCHOR_NODE_THIS(iface) DEFINE_THIS2(HTMLAnchorElement, element.node, iface)
443
444 static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
445 {
446     HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
447
448     *ppv = NULL;
449
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);
459     }
460
461     if(*ppv) {
462         IUnknown_AddRef((IUnknown*)*ppv);
463         return S_OK;
464     }
465
466     return HTMLElement_QI(&This->element.node, riid, ppv);
467 }
468
469 static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
470 {
471     HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
472     HTMLElement_destructor(&This->element.node);
473 }
474
475 #undef HTMLANCHOR_NODE_THIS
476
477 static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
478     HTMLAnchorElement_QI,
479     HTMLAnchorElement_destructor
480 };
481
482 HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
483 {
484     HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
485
486     HTMLElement_Init(&ret->element);
487
488     ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
489     ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
490
491     return &ret->element;
492 }