2 * Copyright 2012 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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 IHTMLLinkElement IHTMLLinkElement_iface;
39 static inline HTMLLinkElement *impl_from_IHTMLLinkElement(IHTMLLinkElement *iface)
41 return CONTAINING_RECORD(iface, HTMLLinkElement, IHTMLLinkElement_iface);
44 static HRESULT WINAPI HTMLLinkElement_QueryInterface(IHTMLLinkElement *iface,
45 REFIID riid, void **ppv)
47 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
49 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
52 static ULONG WINAPI HTMLLinkElement_AddRef(IHTMLLinkElement *iface)
54 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
56 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
59 static ULONG WINAPI HTMLLinkElement_Release(IHTMLLinkElement *iface)
61 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
63 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
66 static HRESULT WINAPI HTMLLinkElement_GetTypeInfoCount(IHTMLLinkElement *iface, UINT *pctinfo)
68 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
70 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
73 static HRESULT WINAPI HTMLLinkElement_GetTypeInfo(IHTMLLinkElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
78 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
82 static HRESULT WINAPI HTMLLinkElement_GetIDsOfNames(IHTMLLinkElement *iface, REFIID riid,
83 LPOLESTR *rgszNames, UINT cNames,
84 LCID lcid, DISPID *rgDispId)
86 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
88 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
89 cNames, lcid, rgDispId);
92 static HRESULT WINAPI HTMLLinkElement_Invoke(IHTMLLinkElement *iface, DISPID dispIdMember,
93 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
94 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
96 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
98 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
99 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
102 static HRESULT WINAPI HTMLLinkElement_put_href(IHTMLLinkElement *iface, BSTR v)
104 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
105 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
109 static HRESULT WINAPI HTMLLinkElement_get_href(IHTMLLinkElement *iface, BSTR *p)
111 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
112 FIXME("(%p)->(%p)\n", This, p);
116 static HRESULT WINAPI HTMLLinkElement_put_rel(IHTMLLinkElement *iface, BSTR v)
118 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
119 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
123 static HRESULT WINAPI HTMLLinkElement_get_rel(IHTMLLinkElement *iface, BSTR *p)
125 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
126 FIXME("(%p)->(%p)\n", This, p);
130 static HRESULT WINAPI HTMLLinkElement_put_rev(IHTMLLinkElement *iface, BSTR v)
132 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
133 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
137 static HRESULT WINAPI HTMLLinkElement_get_rev(IHTMLLinkElement *iface, BSTR *p)
139 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
140 FIXME("(%p)->(%p)\n", This, p);
144 static HRESULT WINAPI HTMLLinkElement_put_type(IHTMLLinkElement *iface, BSTR v)
146 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
147 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
151 static HRESULT WINAPI HTMLLinkElement_get_type(IHTMLLinkElement *iface, BSTR *p)
153 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
154 FIXME("(%p)->(%p)\n", This, p);
158 static HRESULT WINAPI HTMLLinkElement_get_readyState(IHTMLLinkElement *iface, BSTR *p)
160 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
161 FIXME("(%p)->(%p)\n", This, p);
165 static HRESULT WINAPI HTMLLinkElement_put_onreadystatechange(IHTMLLinkElement *iface, VARIANT v)
167 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
168 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
172 static HRESULT WINAPI HTMLLinkElement_get_onreadystatechange(IHTMLLinkElement *iface, VARIANT *p)
174 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
175 FIXME("(%p)->(%p)\n", This, p);
179 static HRESULT WINAPI HTMLLinkElement_put_onload(IHTMLLinkElement *iface, VARIANT v)
181 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
182 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
186 static HRESULT WINAPI HTMLLinkElement_get_onload(IHTMLLinkElement *iface, VARIANT *p)
188 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
189 FIXME("(%p)->(%p)\n", This, p);
193 static HRESULT WINAPI HTMLLinkElement_put_onerror(IHTMLLinkElement *iface, VARIANT v)
195 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
196 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
200 static HRESULT WINAPI HTMLLinkElement_get_onerror(IHTMLLinkElement *iface, VARIANT *p)
202 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
203 FIXME("(%p)->(%p)\n", This, p);
207 static HRESULT WINAPI HTMLLinkElement_get_styleSheet(IHTMLLinkElement *iface, IHTMLStyleSheet **p)
209 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
210 FIXME("(%p)->(%p)\n", This, p);
214 static HRESULT WINAPI HTMLLinkElement_put_disabled(IHTMLLinkElement *iface, VARIANT_BOOL v)
216 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
217 FIXME("(%p)->(%x)\n", This, v);
221 static HRESULT WINAPI HTMLLinkElement_get_disabled(IHTMLLinkElement *iface, VARIANT_BOOL *p)
223 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
224 FIXME("(%p)->(%p)\n", This, p);
228 static HRESULT WINAPI HTMLLinkElement_put_media(IHTMLLinkElement *iface, BSTR v)
230 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
231 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
235 static HRESULT WINAPI HTMLLinkElement_get_media(IHTMLLinkElement *iface, BSTR *p)
237 HTMLLinkElement *This = impl_from_IHTMLLinkElement(iface);
238 FIXME("(%p)->(%p)\n", This, p);
242 static const IHTMLLinkElementVtbl HTMLLinkElementVtbl = {
243 HTMLLinkElement_QueryInterface,
244 HTMLLinkElement_AddRef,
245 HTMLLinkElement_Release,
246 HTMLLinkElement_GetTypeInfoCount,
247 HTMLLinkElement_GetTypeInfo,
248 HTMLLinkElement_GetIDsOfNames,
249 HTMLLinkElement_Invoke,
250 HTMLLinkElement_put_href,
251 HTMLLinkElement_get_href,
252 HTMLLinkElement_put_rel,
253 HTMLLinkElement_get_rel,
254 HTMLLinkElement_put_rev,
255 HTMLLinkElement_get_rev,
256 HTMLLinkElement_put_type,
257 HTMLLinkElement_get_type,
258 HTMLLinkElement_get_readyState,
259 HTMLLinkElement_put_onreadystatechange,
260 HTMLLinkElement_get_onreadystatechange,
261 HTMLLinkElement_put_onload,
262 HTMLLinkElement_get_onload,
263 HTMLLinkElement_put_onerror,
264 HTMLLinkElement_get_onerror,
265 HTMLLinkElement_get_styleSheet,
266 HTMLLinkElement_put_disabled,
267 HTMLLinkElement_get_disabled,
268 HTMLLinkElement_put_media,
269 HTMLLinkElement_get_media
272 static inline HTMLLinkElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
274 return CONTAINING_RECORD(iface, HTMLLinkElement, element.node);
277 static HRESULT HTMLLinkElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
279 HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
281 if(IsEqualGUID(&IID_IHTMLLinkElement, riid)) {
282 TRACE("(%p)->(IID_IHTMLLinkElement %p)\n", This, ppv);
283 *ppv = &This->IHTMLLinkElement_iface;
285 return HTMLElement_QI(&This->element.node, riid, ppv);
288 IUnknown_AddRef((IUnknown*)*ppv);
292 static void HTMLLinkElement_destructor(HTMLDOMNode *iface)
294 HTMLLinkElement *This = impl_from_HTMLDOMNode(iface);
296 HTMLElement_destructor(&This->element.node);
299 static const NodeImplVtbl HTMLLinkElementImplVtbl = {
301 HTMLLinkElement_destructor,
303 HTMLElement_handle_event,
304 HTMLElement_get_attr_col
307 static const tid_t HTMLLinkElement_iface_tids[] = {
309 IHTMLLinkElement_tid,
312 static dispex_static_data_t HTMLLinkElement_dispex = {
314 DispHTMLLinkElement_tid,
316 HTMLLinkElement_iface_tids
319 HRESULT HTMLLinkElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
321 HTMLLinkElement *ret;
323 ret = heap_alloc_zero(sizeof(*ret));
325 return E_OUTOFMEMORY;
327 ret->IHTMLLinkElement_iface.lpVtbl = &HTMLLinkElementVtbl;
328 ret->element.node.vtbl = &HTMLLinkElementImplVtbl;
330 HTMLElement_Init(&ret->element, doc, nselem, &HTMLLinkElement_dispex);
332 *elem = &ret->element;