Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / mshtml / htmlstyle3.c
blob56fd3df3bc764ba7197c0f7cbc700d80ad008098
1 /*
2 * Copyright 2009 Alistair Leslie-Hughes
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 <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "mshtml_private.h"
29 #include "htmlstyle.h"
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 #define HTMLSTYLE3_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle3, iface)
38 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
40 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
42 return IHTMLStyle_QueryInterface(HTMLSTYLE(This), riid, ppv);
45 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
47 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
49 return IHTMLStyle_AddRef(HTMLSTYLE(This));
52 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
54 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
56 return IHTMLStyle_Release(HTMLSTYLE(This));
59 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
61 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
62 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
65 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
66 LCID lcid, ITypeInfo **ppTInfo)
68 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
69 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
72 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
73 LPOLESTR *rgszNames, UINT cNames,
74 LCID lcid, DISPID *rgDispId)
76 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
77 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
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)
84 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
85 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
86 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
89 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
91 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
92 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
93 return E_NOTIMPL;
96 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
98 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
99 FIXME("(%p)->(%p)\n", This, p);
100 return E_NOTIMPL;
103 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
105 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
107 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
109 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
110 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
111 if(V_VT(&v) == VT_I4 && V_I4(&v) == 1)
112 return S_OK;
114 FIXME("stub for %s\n", debugstr_variant(&v));
115 return E_NOTIMPL;
118 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
120 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
121 FIXME("(%p)->(%p)\n", This, p);
122 return E_NOTIMPL;
125 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
127 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
129 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
131 return set_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, v, 0);
134 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
136 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
138 TRACE("(%p)->(%p)\n", This, p);
140 return get_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, p);
143 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
145 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
146 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
147 return E_NOTIMPL;
150 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
152 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
153 FIXME("(%p)->(%p)\n", This, p);
154 return E_NOTIMPL;
157 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
159 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
160 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
161 return E_NOTIMPL;
164 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
166 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
167 FIXME("(%p)->(%p)\n", This, p);
168 return E_NOTIMPL;
171 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
173 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
174 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
175 return E_NOTIMPL;
178 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
180 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
181 FIXME("(%p)->(%p)\n", This, p);
182 return E_NOTIMPL;
185 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
187 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
188 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
189 return E_NOTIMPL;
192 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
194 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
195 FIXME("(%p)->(%p)\n", This, p);
196 return E_NOTIMPL;
199 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
201 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
202 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
203 return E_NOTIMPL;
206 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
208 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
209 FIXME("(%p)->(%p)\n", This, p);
210 return E_NOTIMPL;
213 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
215 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
216 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
217 return E_NOTIMPL;
220 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
222 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
223 FIXME("(%p)->(%p)\n", This, p);
224 return E_NOTIMPL;
227 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
229 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
230 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
231 return E_NOTIMPL;
234 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
236 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
237 FIXME("(%p)->(%p)\n", This, p);
238 return E_NOTIMPL;
241 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
243 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
244 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
245 return E_NOTIMPL;
248 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
250 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
251 FIXME("(%p)->(%p)\n", This, p);
252 return E_NOTIMPL;
255 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
257 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
258 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
259 return E_NOTIMPL;
262 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
264 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
265 FIXME("(%p)->(%p)\n", This, p);
266 return E_NOTIMPL;
269 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
271 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
272 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
273 return E_NOTIMPL;
276 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
278 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
279 FIXME("(%p)->(%p)\n", This, p);
280 return E_NOTIMPL;
283 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
285 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
286 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
287 return E_NOTIMPL;
290 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
292 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
293 FIXME("(%p)->(%p)\n", This, p);
294 return E_NOTIMPL;
297 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
299 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
300 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
301 return E_NOTIMPL;
304 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
306 HTMLStyle *This = HTMLSTYLE3_THIS(iface);
307 FIXME("(%p)->(%p)\n", This, p);
308 return E_NOTIMPL;
311 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
312 HTMLStyle3_QueryInterface,
313 HTMLStyle3_AddRef,
314 HTMLStyle3_Release,
315 HTMLStyle3_GetTypeInfoCount,
316 HTMLStyle3_GetTypeInfo,
317 HTMLStyle3_GetIDsOfNames,
318 HTMLStyle3_Invoke,
319 HTMLStyle3_put_layoutFlow,
320 HTMLStyle3_get_layoutFlow,
321 HTMLStyle3_put_zoom,
322 HTMLStyle3_get_zoom,
323 HTMLStyle3_put_wordWrap,
324 HTMLStyle3_get_wordWrap,
325 HTMLStyle3_put_textUnderlinePosition,
326 HTMLStyle3_get_textUnderlinePosition,
327 HTMLStyle3_put_scrollbarBaseColor,
328 HTMLStyle3_get_scrollbarBaseColor,
329 HTMLStyle3_put_scrollbarFaceColor,
330 HTMLStyle3_get_scrollbarFaceColor,
331 HTMLStyle3_put_scrollbar3dLightColor,
332 HTMLStyle3_get_scrollbar3dLightColor,
333 HTMLStyle3_put_scrollbarShadowColor,
334 HTMLStyle3_get_scrollbarShadowColor,
335 HTMLStyle3_put_scrollbarHighlightColor,
336 HTMLStyle3_get_scrollbarHighlightColor,
337 HTMLStyle3_put_scrollbarDarkShadowColor,
338 HTMLStyle3_get_scrollbarDarkShadowColor,
339 HTMLStyle3_put_scrollbarArrowColor,
340 HTMLStyle3_get_scrollbarArrowColor,
341 HTMLStyle3_put_scrollbarTrackColor,
342 HTMLStyle3_get_scrollbarTrackColor,
343 HTMLStyle3_put_writingMode,
344 HTMLStyle3_get_writingMode,
345 HTMLStyle3_put_textAlignLast,
346 HTMLStyle3_get_textAlignLast,
347 HTMLStyle3_put_textKashidaSpace,
348 HTMLStyle3_get_textKashidaSpace
352 * IHTMLStyle4 Interface
354 #define HTMLSTYLE4_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle4, iface)
356 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
358 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
360 return IHTMLStyle_QueryInterface(HTMLSTYLE(This), riid, ppv);
363 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
365 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
367 return IHTMLStyle_AddRef(HTMLSTYLE(This));
370 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
372 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
374 return IHTMLStyle_Release(HTMLSTYLE(This));
377 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
379 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
380 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
383 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
384 LCID lcid, ITypeInfo **ppTInfo)
386 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
387 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
390 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
391 LPOLESTR *rgszNames, UINT cNames,
392 LCID lcid, DISPID *rgDispId)
394 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
395 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
398 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
399 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
400 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
402 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
403 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
404 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
407 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
409 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
410 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
411 return E_NOTIMPL;
414 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
416 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
417 FIXME("(%p)->(%p)\n", This, p);
418 return E_NOTIMPL;
421 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
423 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
425 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
427 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_HEIGHT, &v, 0);
430 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
432 HTMLStyle *This = HTMLSTYLE4_THIS(iface);
434 TRACE("(%p)->(%p)\n", This, p);
436 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_HEIGHT, p, 0);
439 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
440 HTMLStyle4_QueryInterface,
441 HTMLStyle4_AddRef,
442 HTMLStyle4_Release,
443 HTMLStyle4_GetTypeInfoCount,
444 HTMLStyle4_GetTypeInfo,
445 HTMLStyle4_GetIDsOfNames,
446 HTMLStyle4_Invoke,
447 HTMLStyle4_put_textOverflow,
448 HTMLStyle4_get_textOverflow,
449 HTMLStyle4_put_minHeight,
450 HTMLStyle4_get_minHeight
453 void HTMLStyle3_Init(HTMLStyle *This)
455 This->lpHTMLStyle3Vtbl = &HTMLStyle3Vtbl;
456 This->lpHTMLStyle4Vtbl = &HTMLStyle4Vtbl;