mshtml: Add VT_I4 support to set_nsstyle_attr_var.
[wine] / dlls / mshtml / htmlstyle3.c
1 /*
2  * Copyright 2009 Alistair Leslie-Hughes
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "mshtml_private.h"
29 #include "htmlstyle.h"
30
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35
36 #define HTMLSTYLE3_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle3, iface)
37
38 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
39 {
40     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
41
42     return IHTMLStyle_QueryInterface(HTMLSTYLE(This), riid, ppv);
43 }
44
45 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
46 {
47     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
48
49     return IHTMLStyle_AddRef(HTMLSTYLE(This));
50 }
51
52 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
53 {
54     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
55
56     return IHTMLStyle_Release(HTMLSTYLE(This));
57 }
58
59 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
60 {
61     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
62     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
63 }
64
65 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
66                                               LCID lcid, ITypeInfo **ppTInfo)
67 {
68     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
69     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
70 }
71
72 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
73                                                 LPOLESTR *rgszNames, UINT cNames,
74                                                 LCID lcid, DISPID *rgDispId)
75 {
76     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
77     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
78 }
79
80 static HRESULT WINAPI HTMLStyle3_Invoke(IHTMLStyle3 *iface, DISPID dispIdMember,
81                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
82                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
83 {
84     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
85     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
86             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
87 }
88
89 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
90 {
91     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
92     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
93     return E_NOTIMPL;
94 }
95
96 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
97 {
98     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
99     FIXME("(%p)->(%p)\n", This, p);
100     return E_NOTIMPL;
101 }
102
103 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
104 {
105     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
106     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
107     return E_NOTIMPL;
108 }
109
110 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
111 {
112     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
113     FIXME("(%p)->(%p)\n", This, p);
114     return E_NOTIMPL;
115 }
116
117 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
118 {
119     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
120     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
121     return E_NOTIMPL;
122 }
123
124 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
125 {
126     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
127     FIXME("(%p)->(%p)\n", This, p);
128     return E_NOTIMPL;
129 }
130
131 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
132 {
133     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
134     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
135     return E_NOTIMPL;
136 }
137
138 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
139 {
140     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
141     FIXME("(%p)->(%p)\n", This, p);
142     return E_NOTIMPL;
143 }
144
145 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
146 {
147     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
148     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
149     return E_NOTIMPL;
150 }
151
152 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
153 {
154     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
155     FIXME("(%p)->(%p)\n", This, p);
156     return E_NOTIMPL;
157 }
158
159 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
160 {
161     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
162     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
163     return E_NOTIMPL;
164 }
165
166 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
167 {
168     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
169     FIXME("(%p)->(%p)\n", This, p);
170     return E_NOTIMPL;
171 }
172
173 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
174 {
175     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
176     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
177     return E_NOTIMPL;
178 }
179
180 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
181 {
182     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
183     FIXME("(%p)->(%p)\n", This, p);
184     return E_NOTIMPL;
185 }
186
187 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
188 {
189     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
190     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
191     return E_NOTIMPL;
192 }
193
194 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
195 {
196     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
197     FIXME("(%p)->(%p)\n", This, p);
198     return E_NOTIMPL;
199 }
200
201 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
202 {
203     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
204     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
205     return E_NOTIMPL;
206 }
207
208 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
209 {
210     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
211     FIXME("(%p)->(%p)\n", This, p);
212     return E_NOTIMPL;
213 }
214
215 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
216 {
217     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
218     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
219     return E_NOTIMPL;
220 }
221
222 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
223 {
224     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
225     FIXME("(%p)->(%p)\n", This, p);
226     return E_NOTIMPL;
227 }
228
229 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
230 {
231     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
232     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
233     return E_NOTIMPL;
234 }
235
236 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
237 {
238     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
239     FIXME("(%p)->(%p)\n", This, p);
240     return E_NOTIMPL;
241 }
242
243 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
244 {
245     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
246     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
247     return E_NOTIMPL;
248 }
249
250 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
251 {
252     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
253     FIXME("(%p)->(%p)\n", This, p);
254     return E_NOTIMPL;
255 }
256
257 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
258 {
259     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
260     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
261     return E_NOTIMPL;
262 }
263
264 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
265 {
266     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
267     FIXME("(%p)->(%p)\n", This, p);
268     return E_NOTIMPL;
269 }
270
271 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
272 {
273     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
274     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
275     return E_NOTIMPL;
276 }
277
278 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
279 {
280     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
281     FIXME("(%p)->(%p)\n", This, p);
282     return E_NOTIMPL;
283 }
284
285 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
286 {
287     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
288     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
289     return E_NOTIMPL;
290 }
291
292 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
293 {
294     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
295     FIXME("(%p)->(%p)\n", This, p);
296     return E_NOTIMPL;
297 }
298
299 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
300     HTMLStyle3_QueryInterface,
301     HTMLStyle3_AddRef,
302     HTMLStyle3_Release,
303     HTMLStyle3_GetTypeInfoCount,
304     HTMLStyle3_GetTypeInfo,
305     HTMLStyle3_GetIDsOfNames,
306     HTMLStyle3_Invoke,
307     HTMLStyle3_put_layoutFlow,
308     HTMLStyle3_get_layoutFlow,
309     HTMLStyle3_put_zoom,
310     HTMLStyle3_get_zoom,
311     HTMLStyle3_put_wordWrap,
312     HTMLStyle3_get_wordWrap,
313     HTMLStyle3_put_textUnderlinePosition,
314     HTMLStyle3_get_textUnderlinePosition,
315     HTMLStyle3_put_scrollbarBaseColor,
316     HTMLStyle3_get_scrollbarBaseColor,
317     HTMLStyle3_put_scrollbarFaceColor,
318     HTMLStyle3_get_scrollbarFaceColor,
319     HTMLStyle3_put_scrollbar3dLightColor,
320     HTMLStyle3_get_scrollbar3dLightColor,
321     HTMLStyle3_put_scrollbarShadowColor,
322     HTMLStyle3_get_scrollbarShadowColor,
323     HTMLStyle3_put_scrollbarHighlightColor,
324     HTMLStyle3_get_scrollbarHighlightColor,
325     HTMLStyle3_put_scrollbarDarkShadowColor,
326     HTMLStyle3_get_scrollbarDarkShadowColor,
327     HTMLStyle3_put_scrollbarArrowColor,
328     HTMLStyle3_get_scrollbarArrowColor,
329     HTMLStyle3_put_scrollbarTrackColor,
330     HTMLStyle3_get_scrollbarTrackColor,
331     HTMLStyle3_put_writingMode,
332     HTMLStyle3_get_writingMode,
333     HTMLStyle3_put_textAlignLast,
334     HTMLStyle3_get_textAlignLast,
335     HTMLStyle3_put_textKashidaSpace,
336     HTMLStyle3_get_textKashidaSpace
337 };
338
339 /*
340  * IHTMLStyle4 Interface
341  */
342 #define HTMLSTYLE4_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle4, iface)
343
344 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
345 {
346     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
347
348     return IHTMLStyle_QueryInterface(HTMLSTYLE(This), riid, ppv);
349 }
350
351 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
352 {
353     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
354
355     return IHTMLStyle_AddRef(HTMLSTYLE(This));
356 }
357
358 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
359 {
360     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
361
362     return IHTMLStyle_Release(HTMLSTYLE(This));
363 }
364
365 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
366 {
367     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
368     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
369 }
370
371 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
372                                               LCID lcid, ITypeInfo **ppTInfo)
373 {
374     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
375     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
376 }
377
378 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
379                                                 LPOLESTR *rgszNames, UINT cNames,
380                                                 LCID lcid, DISPID *rgDispId)
381 {
382     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
383     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
384 }
385
386 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
387                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
388                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
389 {
390     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
391     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
392             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
393 }
394
395 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
396 {
397     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
398     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
399     return E_NOTIMPL;
400 }
401
402 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
403 {
404     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
405     FIXME("(%p)->(%p)\n", This, p);
406     return E_NOTIMPL;
407 }
408
409 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
410 {
411     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
412     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
413     return E_NOTIMPL;
414 }
415
416 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
417 {
418     HTMLStyle *This = HTMLSTYLE4_THIS(iface);
419     FIXME("(%p)->(%p)\n", This, p);
420     return E_NOTIMPL;
421 }
422
423 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
424     HTMLStyle4_QueryInterface,
425     HTMLStyle4_AddRef,
426     HTMLStyle4_Release,
427     HTMLStyle4_GetTypeInfoCount,
428     HTMLStyle4_GetTypeInfo,
429     HTMLStyle4_GetIDsOfNames,
430     HTMLStyle4_Invoke,
431     HTMLStyle4_put_textOverflow,
432     HTMLStyle4_get_textOverflow,
433     HTMLStyle4_put_minHeight,
434     HTMLStyle4_get_minHeight
435 };
436
437 void HTMLStyle3_Init(HTMLStyle *This)
438 {
439     This->lpHTMLStyle3Vtbl = &HTMLStyle3Vtbl;
440     This->lpHTMLStyle4Vtbl = &HTMLStyle4Vtbl;
441 }