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;
45 const IHTMLStyleSheetsCollectionVtbl *lpHTMLStyleSheetsCollectionVtbl;
49 nsIDOMStyleSheetList *nslist;
50 } HTMLStyleSheetsCollection;
52 #define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
53 #define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl);
55 #define HTMLSTYLESHEETSCOL_THIS(iface) \
56 DEFINE_THIS(HTMLStyleSheetsCollection, HTMLStyleSheetsCollection, iface)
58 static HRESULT WINAPI HTMLStyleSheetsCollection_QueryInterface(IHTMLStyleSheetsCollection *iface,
59 REFIID riid, void **ppv)
61 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
65 if(IsEqualGUID(&IID_IUnknown, riid)) {
66 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
67 *ppv = HTMLSTYLESHEETSCOL(This);
68 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
69 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
70 *ppv = HTMLSTYLESHEETSCOL(This);
71 }else if(IsEqualGUID(&IID_IHTMLStyleSheetsCollection, riid)) {
72 TRACE("(%p)->(IID_IHTMLStyleSheetsCollection %p)\n", This, ppv);
73 *ppv = HTMLSTYLESHEETSCOL(This);
77 IUnknown_AddRef((IUnknown*)*ppv);
81 WARN("unsupported %s\n", debugstr_guid(riid));
85 static ULONG WINAPI HTMLStyleSheetsCollection_AddRef(IHTMLStyleSheetsCollection *iface)
87 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
88 LONG ref = InterlockedIncrement(&This->ref);
90 TRACE("(%p) ref=%d\n", This, ref);
95 static ULONG WINAPI HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection *iface)
97 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
98 LONG ref = InterlockedDecrement(&This->ref);
100 TRACE("(%p) ref=%d\n", This, ref);
108 static HRESULT WINAPI HTMLStyleSheetsCollection_GetTypeInfoCount(IHTMLStyleSheetsCollection *iface,
111 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
112 FIXME("(%p)->(%p)\n", This, pctinfo);
116 static HRESULT WINAPI HTMLStyleSheetsCollection_GetTypeInfo(IHTMLStyleSheetsCollection *iface,
117 UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
119 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
120 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
124 static HRESULT WINAPI HTMLStyleSheetsCollection_GetIDsOfNames(IHTMLStyleSheetsCollection *iface,
125 REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
127 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
128 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
133 static HRESULT WINAPI HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollection *iface,
134 DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
135 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
137 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
138 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
139 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
143 static HRESULT WINAPI HTMLStyleSheetsCollection_get_length(IHTMLStyleSheetsCollection *iface,
146 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
149 TRACE("(%p)->(%p)\n", This, p);
152 nsIDOMStyleSheetList_GetLength(This->nslist, &len);
158 static HRESULT WINAPI HTMLStyleSheetsCollection_get__newEnum(IHTMLStyleSheetsCollection *iface,
161 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
162 FIXME("(%p)->(%p)\n", This, p);
166 static HRESULT WINAPI HTMLStyleSheetsCollection_item(IHTMLStyleSheetsCollection *iface,
167 VARIANT *pvarIndex, VARIANT *pvarResult)
169 HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
170 FIXME("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
174 #undef HTMLSTYLESHEETSCOL_THIS
176 static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl = {
177 HTMLStyleSheetsCollection_QueryInterface,
178 HTMLStyleSheetsCollection_AddRef,
179 HTMLStyleSheetsCollection_Release,
180 HTMLStyleSheetsCollection_GetTypeInfoCount,
181 HTMLStyleSheetsCollection_GetTypeInfo,
182 HTMLStyleSheetsCollection_GetIDsOfNames,
183 HTMLStyleSheetsCollection_Invoke,
184 HTMLStyleSheetsCollection_get_length,
185 HTMLStyleSheetsCollection_get__newEnum,
186 HTMLStyleSheetsCollection_item
189 IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList *nslist)
191 HTMLStyleSheetsCollection *ret = mshtml_alloc(sizeof(HTMLStyleSheetsCollection));
193 ret->lpHTMLStyleSheetsCollectionVtbl = &HTMLStyleSheetsCollectionVtbl;
197 nsIDOMStyleSheetList_AddRef(nslist);
198 ret->nslist = nslist;
200 return HTMLSTYLESHEETSCOL(ret);
203 #define HTMLSTYLESHEET_THIS(iface) DEFINE_THIS(HTMLStyleSheet, HTMLStyleSheet, iface)
205 static HRESULT WINAPI HTMLStyleSheet_QueryInterface(IHTMLStyleSheet *iface, REFIID riid, void **ppv)
207 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
211 if(IsEqualGUID(&IID_IUnknown, riid)) {
212 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
213 *ppv = HTMLSTYLESHEET(This);
214 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
215 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
216 *ppv = HTMLSTYLESHEET(This);
217 }else if(IsEqualGUID(&IID_IHTMLStyleSheet, riid)) {
218 TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This, ppv);
219 *ppv = HTMLSTYLESHEET(This);
223 IUnknown_AddRef((IUnknown*)*ppv);
227 WARN("unsupported %s\n", debugstr_guid(riid));
228 return E_NOINTERFACE;
231 static ULONG WINAPI HTMLStyleSheet_AddRef(IHTMLStyleSheet *iface)
233 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
234 LONG ref = InterlockedIncrement(&This->ref);
236 TRACE("(%p) ref=%d\n", This, ref);
241 static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface)
243 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
244 LONG ref = InterlockedDecrement(&This->ref);
246 TRACE("(%p) ref=%d\n", This, ref);
254 static HRESULT WINAPI HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet *iface, UINT *pctinfo)
256 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
257 FIXME("(%p)->(%p)\n", This, pctinfo);
261 static HRESULT WINAPI HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet *iface, UINT iTInfo,
262 LCID lcid, ITypeInfo **ppTInfo)
264 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
265 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
269 static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFIID riid,
270 LPOLESTR *rgszNames, UINT cNames,
271 LCID lcid, DISPID *rgDispId)
273 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
274 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
279 static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispIdMember,
280 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
281 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
283 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
284 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
285 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
289 static HRESULT WINAPI HTMLStyleSheet_put_title(IHTMLStyleSheet *iface, BSTR v)
291 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
292 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
296 static HRESULT WINAPI HTMLStyleSheet_get_title(IHTMLStyleSheet *iface, BSTR *p)
298 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
299 FIXME("(%p)->(%p)\n", This, p);
303 static HRESULT WINAPI HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet *iface,
306 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
307 FIXME("(%p)->(%p)\n", This, p);
311 static HRESULT WINAPI HTMLStyleSheet_get_owningElement(IHTMLStyleSheet *iface, IHTMLElement **p)
313 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
314 FIXME("(%p)->(%p)\n", This, p);
318 static HRESULT WINAPI HTMLStyleSheet_put_disabled(IHTMLStyleSheet *iface, VARIANT_BOOL v)
320 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
321 FIXME("(%p)->(%x)\n", This, v);
325 static HRESULT WINAPI HTMLStyleSheet_get_disabled(IHTMLStyleSheet *iface, VARIANT_BOOL *p)
327 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
328 FIXME("(%p)->(%p)\n", This, p);
332 static HRESULT WINAPI HTMLStyleSheet_get_readOnly(IHTMLStyleSheet *iface, VARIANT_BOOL *p)
334 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
335 FIXME("(%p)->(%p)\n", This, p);
339 static HRESULT WINAPI HTMLStyleSheet_get_imports(IHTMLStyleSheet *iface,
340 IHTMLStyleSheetsCollection **p)
342 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
347 static HRESULT WINAPI HTMLStyleSheet_put_href(IHTMLStyleSheet *iface, BSTR v)
349 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
350 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
354 static HRESULT WINAPI HTMLStyleSheet_get_href(IHTMLStyleSheet *iface, BSTR *p)
356 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
361 static HRESULT WINAPI HTMLStyleSheet_get_type(IHTMLStyleSheet *iface, BSTR *p)
363 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
364 FIXME("(%p)->(%p)\n", This, p);
368 static HRESULT WINAPI HTMLStyleSheet_get_id(IHTMLStyleSheet *iface, BSTR *p)
370 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
371 FIXME("(%p)->(%p)\n", This, p);
375 static HRESULT WINAPI HTMLStyleSheet_addImport(IHTMLStyleSheet *iface, BSTR bstrURL,
376 long lIndex, long *plIndex)
378 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
379 FIXME("(%p)->(%s %ld %p)\n", This, debugstr_w(bstrURL), lIndex, plIndex);
383 static HRESULT WINAPI HTMLStyleSheet_addRule(IHTMLStyleSheet *iface, BSTR bstrSelector,
384 BSTR bstrStyle, long lIndex, long *plIndex)
386 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
387 FIXME("(%p)->(%s %s %ld %p)\n", This, debugstr_w(bstrSelector), debugstr_w(bstrStyle),
392 static HRESULT WINAPI HTMLStyleSheet_removeImport(IHTMLStyleSheet *iface, long lIndex)
394 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
395 FIXME("(%p)->(%ld)\n", This, lIndex);
399 static HRESULT WINAPI HTMLStyleSheet_removeRule(IHTMLStyleSheet *iface, long lIndex)
401 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
402 FIXME("(%p)->(%ld)\n", This, lIndex);
406 static HRESULT WINAPI HTMLStyleSheet_put_media(IHTMLStyleSheet *iface, BSTR v)
408 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
409 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
413 static HRESULT WINAPI HTMLStyleSheet_get_media(IHTMLStyleSheet *iface, BSTR *p)
415 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
416 FIXME("(%p)->(%p)\n", This, p);
420 static HRESULT WINAPI HTMLStyleSheet_put_cssText(IHTMLStyleSheet *iface, BSTR v)
422 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
423 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
427 static HRESULT WINAPI HTMLStyleSheet_get_cssText(IHTMLStyleSheet *iface, BSTR *p)
429 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
430 FIXME("(%p)->(%p)\n", This, p);
434 static HRESULT WINAPI HTMLStyleSheet_get_rules(IHTMLStyleSheet *iface,
435 IHTMLStyleSheetRulesCollection **p)
437 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
438 FIXME("(%p)->(%p)\n", This, p);
442 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = {
443 HTMLStyleSheet_QueryInterface,
444 HTMLStyleSheet_AddRef,
445 HTMLStyleSheet_Release,
446 HTMLStyleSheet_GetTypeInfoCount,
447 HTMLStyleSheet_GetTypeInfo,
448 HTMLStyleSheet_GetIDsOfNames,
449 HTMLStyleSheet_Invoke,
450 HTMLStyleSheet_put_title,
451 HTMLStyleSheet_get_title,
452 HTMLStyleSheet_get_parentStyleSheet,
453 HTMLStyleSheet_get_owningElement,
454 HTMLStyleSheet_put_disabled,
455 HTMLStyleSheet_get_disabled,
456 HTMLStyleSheet_get_readOnly,
457 HTMLStyleSheet_get_imports,
458 HTMLStyleSheet_put_href,
459 HTMLStyleSheet_get_href,
460 HTMLStyleSheet_get_type,
461 HTMLStyleSheet_get_id,
462 HTMLStyleSheet_addImport,
463 HTMLStyleSheet_addRule,
464 HTMLStyleSheet_removeImport,
465 HTMLStyleSheet_removeRule,
466 HTMLStyleSheet_put_media,
467 HTMLStyleSheet_get_media,
468 HTMLStyleSheet_put_cssText,
469 HTMLStyleSheet_get_cssText,
470 HTMLStyleSheet_get_rules
473 IHTMLStyleSheet *HTMLStyleSheet_Create(void)
475 HTMLStyleSheet *ret = mshtml_alloc(sizeof(HTMLStyleSheet));
477 ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl;
480 return HTMLSTYLESHEET(ret);