2 * Copyright 2006 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
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 #include "mshtml_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
40 const IHTMLStyleSheetVtbl *lpHTMLStyleSheetVtbl;
44 #define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
46 #define HTMLSTYLESHEET_THIS(iface) DEFINE_THIS(HTMLStyleSheet, HTMLStyleSheet, iface)
48 static HRESULT WINAPI HTMLStyleSheet_QueryInterface(IHTMLStyleSheet *iface, REFIID riid, void **ppv)
50 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
54 if(IsEqualGUID(&IID_IUnknown, riid)) {
55 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
56 *ppv = HTMLSTYLESHEET(This);
57 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
58 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
59 *ppv = HTMLSTYLESHEET(This);
60 }else if(IsEqualGUID(&IID_IHTMLStyleSheet, riid)) {
61 TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This, ppv);
62 *ppv = HTMLSTYLESHEET(This);
66 IUnknown_AddRef((IUnknown*)*ppv);
70 WARN("unsupported %s\n", debugstr_guid(riid));
74 static ULONG WINAPI HTMLStyleSheet_AddRef(IHTMLStyleSheet *iface)
76 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
77 LONG ref = InterlockedIncrement(&This->ref);
79 TRACE("(%p) ref=%d\n", This, ref);
84 static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface)
86 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
87 LONG ref = InterlockedDecrement(&This->ref);
89 TRACE("(%p) ref=%d\n", This, ref);
97 static HRESULT WINAPI HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet *iface, UINT *pctinfo)
99 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
100 FIXME("(%p)->(%p)\n", This, pctinfo);
104 static HRESULT WINAPI HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet *iface, UINT iTInfo,
105 LCID lcid, ITypeInfo **ppTInfo)
107 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
108 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
112 static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFIID riid,
113 LPOLESTR *rgszNames, UINT cNames,
114 LCID lcid, DISPID *rgDispId)
116 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
117 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
122 static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispIdMember,
123 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
124 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
126 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
127 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
128 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
132 static HRESULT WINAPI HTMLStyleSheet_put_title(IHTMLStyleSheet *iface, BSTR v)
134 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
135 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
139 static HRESULT WINAPI HTMLStyleSheet_get_title(IHTMLStyleSheet *iface, BSTR *p)
141 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, p);
146 static HRESULT WINAPI HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet *iface,
149 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
154 static HRESULT WINAPI HTMLStyleSheet_get_owningElement(IHTMLStyleSheet *iface, IHTMLElement **p)
156 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
157 FIXME("(%p)->(%p)\n", This, p);
161 static HRESULT WINAPI HTMLStyleSheet_put_disabled(IHTMLStyleSheet *iface, VARIANT_BOOL v)
163 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
164 FIXME("(%p)->(%x)\n", This, v);
168 static HRESULT WINAPI HTMLStyleSheet_get_disabled(IHTMLStyleSheet *iface, VARIANT_BOOL *p)
170 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
171 FIXME("(%p)->(%p)\n", This, p);
175 static HRESULT WINAPI HTMLStyleSheet_get_readOnly(IHTMLStyleSheet *iface, VARIANT_BOOL *p)
177 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
178 FIXME("(%p)->(%p)\n", This, p);
182 static HRESULT WINAPI HTMLStyleSheet_get_imports(IHTMLStyleSheet *iface,
183 IHTMLStyleSheetsCollection **p)
185 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
186 FIXME("(%p)->(%p)\n", This, p);
190 static HRESULT WINAPI HTMLStyleSheet_put_href(IHTMLStyleSheet *iface, BSTR v)
192 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
193 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
197 static HRESULT WINAPI HTMLStyleSheet_get_href(IHTMLStyleSheet *iface, BSTR *p)
199 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
200 FIXME("(%p)->(%p)\n", This, p);
204 static HRESULT WINAPI HTMLStyleSheet_get_type(IHTMLStyleSheet *iface, BSTR *p)
206 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
207 FIXME("(%p)->(%p)\n", This, p);
211 static HRESULT WINAPI HTMLStyleSheet_get_id(IHTMLStyleSheet *iface, BSTR *p)
213 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
214 FIXME("(%p)->(%p)\n", This, p);
218 static HRESULT WINAPI HTMLStyleSheet_addImport(IHTMLStyleSheet *iface, BSTR bstrURL,
219 long lIndex, long *plIndex)
221 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
222 FIXME("(%p)->(%s %ld %p)\n", This, debugstr_w(bstrURL), lIndex, plIndex);
226 static HRESULT WINAPI HTMLStyleSheet_addRule(IHTMLStyleSheet *iface, BSTR bstrSelector,
227 BSTR bstrStyle, long lIndex, long *plIndex)
229 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
230 FIXME("(%p)->(%s %s %ld %p)\n", This, debugstr_w(bstrSelector), debugstr_w(bstrStyle),
235 static HRESULT WINAPI HTMLStyleSheet_removeImport(IHTMLStyleSheet *iface, long lIndex)
237 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
238 FIXME("(%p)->(%ld)\n", This, lIndex);
242 static HRESULT WINAPI HTMLStyleSheet_removeRule(IHTMLStyleSheet *iface, long lIndex)
244 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
245 FIXME("(%p)->(%ld)\n", This, lIndex);
249 static HRESULT WINAPI HTMLStyleSheet_put_media(IHTMLStyleSheet *iface, BSTR v)
251 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
252 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
256 static HRESULT WINAPI HTMLStyleSheet_get_media(IHTMLStyleSheet *iface, BSTR *p)
258 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
259 FIXME("(%p)->(%p)\n", This, p);
263 static HRESULT WINAPI HTMLStyleSheet_put_cssText(IHTMLStyleSheet *iface, BSTR v)
265 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
266 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
270 static HRESULT WINAPI HTMLStyleSheet_get_cssText(IHTMLStyleSheet *iface, BSTR *p)
272 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
273 FIXME("(%p)->(%p)\n", This, p);
277 static HRESULT WINAPI HTMLStyleSheet_get_rules(IHTMLStyleSheet *iface,
278 IHTMLStyleSheetRulesCollection **p)
280 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
281 FIXME("(%p)->(%p)\n", This, p);
285 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = {
286 HTMLStyleSheet_QueryInterface,
287 HTMLStyleSheet_AddRef,
288 HTMLStyleSheet_Release,
289 HTMLStyleSheet_GetTypeInfoCount,
290 HTMLStyleSheet_GetTypeInfo,
291 HTMLStyleSheet_GetIDsOfNames,
292 HTMLStyleSheet_Invoke,
293 HTMLStyleSheet_put_title,
294 HTMLStyleSheet_get_title,
295 HTMLStyleSheet_get_parentStyleSheet,
296 HTMLStyleSheet_get_owningElement,
297 HTMLStyleSheet_put_disabled,
298 HTMLStyleSheet_get_disabled,
299 HTMLStyleSheet_get_readOnly,
300 HTMLStyleSheet_get_imports,
301 HTMLStyleSheet_put_href,
302 HTMLStyleSheet_get_href,
303 HTMLStyleSheet_get_type,
304 HTMLStyleSheet_get_id,
305 HTMLStyleSheet_addImport,
306 HTMLStyleSheet_addRule,
307 HTMLStyleSheet_removeImport,
308 HTMLStyleSheet_removeRule,
309 HTMLStyleSheet_put_media,
310 HTMLStyleSheet_get_media,
311 HTMLStyleSheet_put_cssText,
312 HTMLStyleSheet_get_cssText,
313 HTMLStyleSheet_get_rules
316 IHTMLStyleSheet *HTMLStyleSheet_Create(void)
318 HTMLStyleSheet *ret = mshtml_alloc(sizeof(HTMLStyleSheet));
320 ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl;
323 return HTMLSTYLESHEET(ret);