2 * Copyright 2010 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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 const IHTMLStyleElementVtbl *lpIHTMLStyleElementVtbl;
41 #define HTMLSTYLE(x) (&(x)->lpIHTMLStyleElementVtbl)
43 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyleElement, IHTMLStyleElement, iface)
45 static HRESULT WINAPI HTMLStyleElement_QueryInterface(IHTMLStyleElement *iface,
46 REFIID riid, void **ppv)
48 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
50 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
53 static ULONG WINAPI HTMLStyleElement_AddRef(IHTMLStyleElement *iface)
55 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
57 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
60 static ULONG WINAPI HTMLStyleElement_Release(IHTMLStyleElement *iface)
62 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
64 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
67 static HRESULT WINAPI HTMLStyleElement_GetTypeInfoCount(IHTMLStyleElement *iface, UINT *pctinfo)
69 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
70 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
73 static HRESULT WINAPI HTMLStyleElement_GetTypeInfo(IHTMLStyleElement *iface, UINT iTInfo,
74 LCID lcid, ITypeInfo **ppTInfo)
76 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
77 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
80 static HRESULT WINAPI HTMLStyleElement_GetIDsOfNames(IHTMLStyleElement *iface, REFIID riid,
81 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
83 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
84 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
87 static HRESULT WINAPI HTMLStyleElement_Invoke(IHTMLStyleElement *iface, DISPID dispIdMember,
88 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
89 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
91 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
92 return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
93 pVarResult, pExcepInfo, puArgErr);
96 static HRESULT WINAPI HTMLStyleElement_put_type(IHTMLStyleElement *iface, BSTR v)
98 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
99 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
103 static HRESULT WINAPI HTMLStyleElement_get_type(IHTMLStyleElement *iface, BSTR *p)
105 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
106 FIXME("(%p)->(%p)\n", This, p);
110 static HRESULT WINAPI HTMLStyleElement_get_readyState(IHTMLStyleElement *iface, BSTR *p)
112 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
113 FIXME("(%p)->(%p)\n", This, p);
117 static HRESULT WINAPI HTMLStyleElement_put_onreadystatechange(IHTMLStyleElement *iface, VARIANT v)
119 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
120 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
124 static HRESULT WINAPI HTMLStyleElement_get_onreadystatechange(IHTMLStyleElement *iface, VARIANT *p)
126 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
127 FIXME("(%p)->(%p)\n", This, p);
131 static HRESULT WINAPI HTMLStyleElement_put_onload(IHTMLStyleElement *iface, VARIANT v)
133 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
134 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
138 static HRESULT WINAPI HTMLStyleElement_get_onload(IHTMLStyleElement *iface, VARIANT *p)
140 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
141 FIXME("(%p)->(%p)\n", This, p);
145 static HRESULT WINAPI HTMLStyleElement_put_onerror(IHTMLStyleElement *iface, VARIANT v)
147 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
148 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
152 static HRESULT WINAPI HTMLStyleElement_get_onerror(IHTMLStyleElement *iface, VARIANT *p)
154 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
155 FIXME("(%p)->(%p)\n", This, p);
159 static HRESULT WINAPI HTMLStyleElement_get_styleSheet(IHTMLStyleElement *iface, IHTMLStyleSheet **p)
161 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
162 FIXME("(%p)->(%p)\n", This, p);
166 static HRESULT WINAPI HTMLStyleElement_put_disabled(IHTMLStyleElement *iface, VARIANT_BOOL v)
168 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
169 FIXME("(%p)->(%x)\n", This, v);
173 static HRESULT WINAPI HTMLStyleElement_get_disabled(IHTMLStyleElement *iface, VARIANT_BOOL *p)
175 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
176 FIXME("(%p)->(%p)\n", This, p);
180 static HRESULT WINAPI HTMLStyleElement_put_media(IHTMLStyleElement *iface, BSTR v)
182 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
183 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
187 static HRESULT WINAPI HTMLStyleElement_get_media(IHTMLStyleElement *iface, BSTR *p)
189 HTMLStyleElement *This = HTMLSTYLE_THIS(iface);
190 FIXME("(%p)->(%p)\n", This, p);
194 #undef HTMLSTYLE_THIS
196 static const IHTMLStyleElementVtbl HTMLStyleElementVtbl = {
197 HTMLStyleElement_QueryInterface,
198 HTMLStyleElement_AddRef,
199 HTMLStyleElement_Release,
200 HTMLStyleElement_GetTypeInfoCount,
201 HTMLStyleElement_GetTypeInfo,
202 HTMLStyleElement_GetIDsOfNames,
203 HTMLStyleElement_Invoke,
204 HTMLStyleElement_put_type,
205 HTMLStyleElement_get_type,
206 HTMLStyleElement_get_readyState,
207 HTMLStyleElement_put_onreadystatechange,
208 HTMLStyleElement_get_onreadystatechange,
209 HTMLStyleElement_put_onload,
210 HTMLStyleElement_get_onload,
211 HTMLStyleElement_put_onerror,
212 HTMLStyleElement_get_onerror,
213 HTMLStyleElement_get_styleSheet,
214 HTMLStyleElement_put_disabled,
215 HTMLStyleElement_get_disabled,
216 HTMLStyleElement_put_media,
217 HTMLStyleElement_get_media
220 #define HTMLSTYLE_NODE_THIS(iface) DEFINE_THIS2(HTMLStyleElement, element.node, iface)
222 static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
224 HTMLStyleElement *This = HTMLSTYLE_NODE_THIS(iface);
226 if(IsEqualGUID(&IID_IUnknown, riid)) {
227 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
228 *ppv = HTMLSTYLE(This);
229 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
230 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
231 *ppv = HTMLSTYLE(This);
232 }else if(IsEqualGUID(&IID_IHTMLStyleElement, riid)) {
233 TRACE("(%p)->(IID_IHTMLStyleElement %p)\n", This, ppv);
234 *ppv = HTMLSTYLE(This);
236 return HTMLElement_QI(&This->element.node, riid, ppv);
239 IUnknown_AddRef((IUnknown*)*ppv);
243 static void HTMLStyleElement_destructor(HTMLDOMNode *iface)
245 HTMLStyleElement *This = HTMLSTYLE_NODE_THIS(iface);
247 HTMLElement_destructor(&This->element.node);
250 #undef HTMLSTYLE_NODE_THIS
252 static const NodeImplVtbl HTMLStyleElementImplVtbl = {
254 HTMLStyleElement_destructor,
258 static const tid_t HTMLStyleElement_iface_tids[] = {
260 IHTMLStyleElement_tid,
263 static dispex_static_data_t HTMLStyleElement_dispex = {
265 DispHTMLStyleElement_tid,
267 HTMLStyleElement_iface_tids
270 HRESULT HTMLStyleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
272 HTMLStyleElement *ret;
274 ret = heap_alloc_zero(sizeof(*ret));
276 return E_OUTOFMEMORY;
278 ret->lpIHTMLStyleElementVtbl = &HTMLStyleElementVtbl;
279 ret->element.node.vtbl = &HTMLStyleElementImplVtbl;
281 HTMLElement_Init(&ret->element, doc, nselem, &HTMLStyleElement_dispex);
282 *elem = &ret->element;