wined3d: Cleanup device_map_fixed_function_samplers().
[wine/gsoc_dplay.git] / dlls / mshtml / htmlstylesheet.c
blob0f0ef12c3f9e8743f2c3ccf98e8c1d0d6a5b04b6
1 /*
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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winnls.h"
30 #include "ole2.h"
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 #include "mshtml_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
39 typedef struct {
40 const IHTMLStyleSheetVtbl *lpHTMLStyleSheetVtbl;
41 LONG ref;
42 } HTMLStyleSheet;
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);
52 *ppv = NULL;
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);
65 if(*ppv) {
66 IUnknown_AddRef((IUnknown*)*ppv);
67 return S_OK;
70 WARN("unsupported %s\n", debugstr_guid(riid));
71 return E_NOINTERFACE;
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);
81 return 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);
91 if(!ref)
92 mshtml_free(This);
94 return ref;
97 static HRESULT WINAPI HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet *iface, UINT *pctinfo)
99 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
100 FIXME("(%p)->(%p)\n", This, pctinfo);
101 return E_NOTIMPL;
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);
109 return E_NOTIMPL;
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,
118 lcid, rgDispId);
119 return E_NOTIMPL;
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);
129 return E_NOTIMPL;
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));
136 return E_NOTIMPL;
139 static HRESULT WINAPI HTMLStyleSheet_get_title(IHTMLStyleSheet *iface, BSTR *p)
141 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, p);
143 return E_NOTIMPL;
146 static HRESULT WINAPI HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet *iface,
147 IHTMLStyleSheet **p)
149 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
151 return E_NOTIMPL;
154 static HRESULT WINAPI HTMLStyleSheet_get_owningElement(IHTMLStyleSheet *iface, IHTMLElement **p)
156 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
157 FIXME("(%p)->(%p)\n", This, p);
158 return E_NOTIMPL;
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);
165 return E_NOTIMPL;
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);
172 return E_NOTIMPL;
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);
179 return E_NOTIMPL;
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);
187 return E_NOTIMPL;
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));
194 return E_NOTIMPL;
197 static HRESULT WINAPI HTMLStyleSheet_get_href(IHTMLStyleSheet *iface, BSTR *p)
199 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
200 FIXME("(%p)->(%p)\n", This, p);
201 return E_NOTIMPL;
204 static HRESULT WINAPI HTMLStyleSheet_get_type(IHTMLStyleSheet *iface, BSTR *p)
206 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
207 FIXME("(%p)->(%p)\n", This, p);
208 return E_NOTIMPL;
211 static HRESULT WINAPI HTMLStyleSheet_get_id(IHTMLStyleSheet *iface, BSTR *p)
213 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
214 FIXME("(%p)->(%p)\n", This, p);
215 return E_NOTIMPL;
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);
223 return E_NOTIMPL;
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),
231 lIndex, plIndex);
232 return E_NOTIMPL;
235 static HRESULT WINAPI HTMLStyleSheet_removeImport(IHTMLStyleSheet *iface, long lIndex)
237 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
238 FIXME("(%p)->(%ld)\n", This, lIndex);
239 return E_NOTIMPL;
242 static HRESULT WINAPI HTMLStyleSheet_removeRule(IHTMLStyleSheet *iface, long lIndex)
244 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
245 FIXME("(%p)->(%ld)\n", This, lIndex);
246 return E_NOTIMPL;
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));
253 return E_NOTIMPL;
256 static HRESULT WINAPI HTMLStyleSheet_get_media(IHTMLStyleSheet *iface, BSTR *p)
258 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
259 FIXME("(%p)->(%p)\n", This, p);
260 return E_NOTIMPL;
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));
267 return E_NOTIMPL;
270 static HRESULT WINAPI HTMLStyleSheet_get_cssText(IHTMLStyleSheet *iface, BSTR *p)
272 HTMLStyleSheet *This = HTMLSTYLESHEET_THIS(iface);
273 FIXME("(%p)->(%p)\n", This, p);
274 return E_NOTIMPL;
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);
282 return E_NOTIMPL;
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;
321 ret->ref = 1;
323 return HTMLSTYLESHEET(ret);