ws2_32/tests: Don't use socklen_t.
[wine/hacks.git] / dlls / mshtml / htmlcurstyle.c
blob5aaaece85c2c8ca001c15737261cf75b62303ea1
1 /*
2 * Copyright 2008 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 <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"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 struct HTMLCurrentStyle {
36 DispatchEx dispex;
37 const IHTMLCurrentStyleVtbl *lpIHTMLCurrentStyleVtbl;
39 LONG ref;
41 nsIDOMCSSStyleDeclaration *nsstyle;
44 #define HTMLCURSTYLE(x) ((IHTMLCurrentStyle*) &(x)->lpIHTMLCurrentStyleVtbl)
46 #define HTMLCURSTYLE_THIS(iface) DEFINE_THIS(HTMLCurrentStyle, IHTMLCurrentStyle, iface)
48 static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
50 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
52 *ppv = NULL;
54 if(IsEqualGUID(&IID_IUnknown, riid)) {
55 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
56 *ppv = HTMLCURSTYLE(This);
57 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
58 TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv);
59 *ppv = HTMLCURSTYLE(This);
60 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
61 return *ppv ? S_OK : E_NOINTERFACE;
64 if(*ppv) {
65 IUnknown_AddRef((IUnknown*)*ppv);
66 return S_OK;
69 WARN("unsupported %s\n", debugstr_guid(riid));
70 return E_NOINTERFACE;
73 static ULONG WINAPI HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
75 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
76 LONG ref = InterlockedIncrement(&This->ref);
78 TRACE("(%p) ref=%d\n", This, ref);
80 return ref;
83 static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
85 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
86 LONG ref = InterlockedDecrement(&This->ref);
88 TRACE("(%p) ref=%d\n", This, ref);
90 if(!ref) {
91 if(This->nsstyle)
92 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
93 heap_free(This);
96 return ref;
99 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
101 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
102 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
105 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
106 LCID lcid, ITypeInfo **ppTInfo)
108 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
109 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
112 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
113 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
115 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
116 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
119 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
120 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
121 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
123 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
124 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
125 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
128 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
130 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
132 TRACE("(%p)->(%p)\n", This, p);
134 return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p);
137 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
139 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
140 FIXME("(%p)->(%p)\n", This, p);
141 return E_NOTIMPL;
144 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
146 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
147 FIXME("(%p)->(%p)\n", This, p);
148 return E_NOTIMPL;
151 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
153 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
154 FIXME("(%p)->(%p)\n", This, p);
155 return E_NOTIMPL;
158 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
160 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
162 TRACE("(%p)->(%p)\n", This, p);
164 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_FAMILY, p);
167 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
169 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
170 TRACE("(%p)->(%p)\n", This, p);
171 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, p);
174 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
176 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
177 TRACE("(%p)->(%p)\n", This, p);
178 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, p);
181 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
183 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
184 TRACE("(%p)->(%p)\n", This, p);
185 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_WEIGHT, p, ATTR_STR_TO_INT);
188 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
190 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
191 TRACE("(%p)->(%p)\n", This, p);
192 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
195 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
197 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
198 TRACE("(%p)->(%p)\n", This, p);
199 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_IMAGE, p);
202 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
204 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
205 FIXME("(%p)->(%p)\n", This, p);
206 return E_NOTIMPL;
209 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
211 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
212 FIXME("(%p)->(%p)\n", This, p);
213 return E_NOTIMPL;
216 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
218 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
219 TRACE("(%p)->(%p)\n", This, p);
220 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_REPEAT, p);
223 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
225 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
226 FIXME("(%p)->(%p)\n", This, p);
227 return E_NOTIMPL;
230 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
232 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, p);
234 return E_NOTIMPL;
237 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
239 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
240 FIXME("(%p)->(%p)\n", This, p);
241 return E_NOTIMPL;
244 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
246 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
247 FIXME("(%p)->(%p)\n", This, p);
248 return E_NOTIMPL;
251 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
253 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
254 TRACE("(%p)->(%p)\n", This, p);
255 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_TOP_STYLE, p);
258 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
260 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
261 TRACE("(%p)->(%p)\n", This, p);
262 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_RIGHT_STYLE, p);
265 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
267 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
268 TRACE("(%p)->(%p)\n", This, p);
269 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_BOTTOM_STYLE, p);
272 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
274 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
275 TRACE("(%p)->(%p)\n", This, p);
276 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_LEFT_STYLE, p);
279 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
281 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
282 FIXME("(%p)->(%p)\n", This, p);
283 return E_NOTIMPL;
286 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
288 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
289 FIXME("(%p)->(%p)\n", This, p);
290 return E_NOTIMPL;
293 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
295 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
296 FIXME("(%p)->(%p)\n", This, p);
297 return E_NOTIMPL;
300 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
302 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
303 FIXME("(%p)->(%p)\n", This, p);
304 return E_NOTIMPL;
307 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
309 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
310 TRACE("(%p)->(%p)\n", This, p);
311 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
314 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
316 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
317 TRACE("(%p)->(%p)\n", This, p);
318 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
321 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
323 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
324 TRACE("(%p)->(%p)\n", This, p);
325 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
328 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
330 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
331 TRACE("(%p)->(%p)\n", This, p);
332 return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
335 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
337 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
338 TRACE("(%p)->(%p)\n", This, p);
339 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
342 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
344 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
345 FIXME("(%p)->(%p)\n", This, p);
346 return E_NOTIMPL;
349 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
351 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
352 FIXME("(%p)->(%p)\n", This, p);
353 return E_NOTIMPL;
356 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
358 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
359 FIXME("(%p)->(%p)\n", This, p);
360 return E_NOTIMPL;
363 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
365 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
366 TRACE("(%p)->(%p)\n", This, p);
367 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_ALIGN, p);
370 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
372 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
373 TRACE("(%p)->(%p)\n", This, p);
374 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_DECORATION, p);
377 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
379 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
381 TRACE("(%p)->(%p)\n", This, p);
383 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
386 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
388 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
389 FIXME("(%p)->(%p)\n", This, p);
390 return E_NOTIMPL;
393 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
395 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
396 TRACE("(%p)->(%p)\n", This, p);
397 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
400 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
402 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
403 FIXME("(%p)->(%p)\n", This, p);
404 return E_NOTIMPL;
407 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
409 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
410 FIXME("(%p)->(%p)\n", This, p);
411 return E_NOTIMPL;
414 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
416 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
417 FIXME("(%p)->(%p)\n", This, p);
418 return E_NOTIMPL;
421 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
423 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
424 TRACE("(%p)->(%p)\n", This, p);
425 return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
428 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
430 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
431 FIXME("(%p)->(%p)\n", This, p);
432 return E_NOTIMPL;
435 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
437 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
438 FIXME("(%p)->(%p)\n", This, p);
439 return E_NOTIMPL;
442 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
444 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
445 TRACE("(%p)->(%p)\n", This, p);
446 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
449 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
451 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
452 FIXME("(%p)->(%p)\n", This, p);
453 return E_NOTIMPL;
456 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
458 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
459 TRACE("(%p)->(%p)\n", This, p);
460 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
463 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
465 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
466 FIXME("(%p)->(%p)\n", This, p);
467 return E_NOTIMPL;
470 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
472 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
473 FIXME("(%p)->(%p)\n", This, p);
474 return E_NOTIMPL;
477 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
479 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
480 FIXME("(%p)->(%p)\n", This, p);
481 return E_NOTIMPL;
484 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
486 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
487 FIXME("(%p)->(%p)\n", This, p);
488 return E_NOTIMPL;
491 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
493 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
494 FIXME("(%p)->(%p)\n", This, p);
495 return E_NOTIMPL;
498 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
500 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
501 FIXME("(%p)->(%p)\n", This, p);
502 return E_NOTIMPL;
505 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
507 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
508 FIXME("(%p)->(%p)\n", This, p);
509 return E_NOTIMPL;
512 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
514 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
515 FIXME("(%p)->(%p)\n", This, p);
516 return E_NOTIMPL;
519 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
521 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
522 FIXME("(%p)->(%p)\n", This, p);
523 return E_NOTIMPL;
526 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
528 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
529 FIXME("(%p)->(%p)\n", This, p);
530 return E_NOTIMPL;
533 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
535 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
536 FIXME("(%p)->(%p)\n", This, p);
537 return E_NOTIMPL;
540 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
542 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
543 TRACE("(%p)->(%p)\n", This, p);
544 return get_nsstyle_attr(This->nsstyle, STYLEID_CURSOR, p);
547 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
549 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
550 FIXME("(%p)->(%p)\n", This, p);
551 return E_NOTIMPL;
554 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
556 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
557 FIXME("(%p)->(%p)\n", This, p);
558 return E_NOTIMPL;
561 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
563 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
564 FIXME("(%p)->(%p)\n", This, p);
565 return E_NOTIMPL;
568 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
570 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
571 FIXME("(%p)->(%p)\n", This, p);
572 return E_NOTIMPL;
575 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
576 LONG lFlags, VARIANT *AttributeValue)
578 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
579 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
580 return E_NOTIMPL;
583 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
585 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
587 return E_NOTIMPL;
590 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
592 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, p);
594 return E_NOTIMPL;
597 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
599 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
601 return E_NOTIMPL;
604 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
606 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
607 FIXME("(%p)->(%p)\n", This, p);
608 return E_NOTIMPL;
611 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
613 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
614 FIXME("(%p)->(%p)\n", This, p);
615 return E_NOTIMPL;
618 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
620 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
621 FIXME("(%p)->(%p)\n", This, p);
622 return E_NOTIMPL;
625 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
627 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
628 FIXME("(%p)->(%p)\n", This, p);
629 return E_NOTIMPL;
632 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
634 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
635 FIXME("(%p)->(%p)\n", This, p);
636 return E_NOTIMPL;
639 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
641 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
642 FIXME("(%p)->(%p)\n", This, p);
643 return E_NOTIMPL;
646 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
648 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
649 FIXME("(%p)->(%p)\n", This, p);
650 return E_NOTIMPL;
653 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
655 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
656 FIXME("(%p)->(%p)\n", This, p);
657 return E_NOTIMPL;
660 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
662 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
663 FIXME("(%p)->(%p)\n", This, p);
664 return E_NOTIMPL;
667 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
669 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
670 FIXME("(%p)->(%p)\n", This, p);
671 return E_NOTIMPL;
674 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
676 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
677 FIXME("(%p)->(%p)\n", This, p);
678 return E_NOTIMPL;
681 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
683 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
684 FIXME("(%p)->(%p)\n", This, p);
685 return E_NOTIMPL;
688 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
690 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
691 FIXME("(%p)->(%p)\n", This, p);
692 return E_NOTIMPL;
695 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
697 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
698 FIXME("(%p)->(%p)\n", This, p);
699 return E_NOTIMPL;
702 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
704 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
705 FIXME("(%p)->(%p)\n", This, p);
706 return E_NOTIMPL;
709 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
711 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
712 TRACE("(%p)->(%p)\n", This, p);
713 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, p);
716 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
718 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
719 TRACE("(%p)->(%p)\n", This, p);
720 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_COLOR, p);
723 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
725 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
726 FIXME("(%p)->(%p)\n", This, p);
727 return E_NOTIMPL;
730 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
732 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
733 FIXME("(%p)->(%p)\n", This, p);
734 return E_NOTIMPL;
737 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
739 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
740 FIXME("(%p)->(%p)\n", This, p);
741 return E_NOTIMPL;
744 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
746 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
747 FIXME("(%p)->(%p)\n", This, p);
748 return E_NOTIMPL;
751 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
753 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
754 FIXME("(%p)->(%p)\n", This, p);
755 return E_NOTIMPL;
758 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
760 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
761 FIXME("(%p)->(%p)\n", This, p);
762 return E_NOTIMPL;
765 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
767 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
768 FIXME("(%p)->(%p)\n", This, p);
769 return E_NOTIMPL;
772 #undef HTMLCURSTYLE_THIS
774 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
775 HTMLCurrentStyle_QueryInterface,
776 HTMLCurrentStyle_AddRef,
777 HTMLCurrentStyle_Release,
778 HTMLCurrentStyle_GetTypeInfoCount,
779 HTMLCurrentStyle_GetTypeInfo,
780 HTMLCurrentStyle_GetIDsOfNames,
781 HTMLCurrentStyle_Invoke,
782 HTMLCurrentStyle_get_position,
783 HTMLCurrentStyle_get_styleFloat,
784 HTMLCurrentStyle_get_color,
785 HTMLCurrentStyle_get_backgroundColor,
786 HTMLCurrentStyle_get_fontFamily,
787 HTMLCurrentStyle_get_fontStyle,
788 HTMLCurrentStyle_get_fontVariant,
789 HTMLCurrentStyle_get_fontWeight,
790 HTMLCurrentStyle_get_fontSize,
791 HTMLCurrentStyle_get_backgroundImage,
792 HTMLCurrentStyle_get_backgroundPositionX,
793 HTMLCurrentStyle_get_backgroundPositionY,
794 HTMLCurrentStyle_get_backgroundRepeat,
795 HTMLCurrentStyle_get_borderLeftColor,
796 HTMLCurrentStyle_get_borderTopColor,
797 HTMLCurrentStyle_get_borderRightColor,
798 HTMLCurrentStyle_get_borderBottomColor,
799 HTMLCurrentStyle_get_borderTopStyle,
800 HTMLCurrentStyle_get_borderRightStyle,
801 HTMLCurrentStyle_get_borderBottomStyle,
802 HTMLCurrentStyle_get_borderLeftStyle,
803 HTMLCurrentStyle_get_borderTopWidth,
804 HTMLCurrentStyle_get_borderRightWidth,
805 HTMLCurrentStyle_get_borderBottomWidth,
806 HTMLCurrentStyle_get_borderLeftWidth,
807 HTMLCurrentStyle_get_left,
808 HTMLCurrentStyle_get_top,
809 HTMLCurrentStyle_get_width,
810 HTMLCurrentStyle_get_height,
811 HTMLCurrentStyle_get_paddingLeft,
812 HTMLCurrentStyle_get_paddingTop,
813 HTMLCurrentStyle_get_paddingRight,
814 HTMLCurrentStyle_get_paddingBottom,
815 HTMLCurrentStyle_get_textAlign,
816 HTMLCurrentStyle_get_textDecoration,
817 HTMLCurrentStyle_get_display,
818 HTMLCurrentStyle_get_visibility,
819 HTMLCurrentStyle_get_zIndex,
820 HTMLCurrentStyle_get_letterSpacing,
821 HTMLCurrentStyle_get_lineHeight,
822 HTMLCurrentStyle_get_textIndent,
823 HTMLCurrentStyle_get_verticalAlign,
824 HTMLCurrentStyle_get_backgroundAttachment,
825 HTMLCurrentStyle_get_marginTop,
826 HTMLCurrentStyle_get_marginRight,
827 HTMLCurrentStyle_get_marginBottom,
828 HTMLCurrentStyle_get_marginLeft,
829 HTMLCurrentStyle_get_clear,
830 HTMLCurrentStyle_get_listStyleType,
831 HTMLCurrentStyle_get_listStylePosition,
832 HTMLCurrentStyle_get_listStyleImage,
833 HTMLCurrentStyle_get_clipTop,
834 HTMLCurrentStyle_get_clipRight,
835 HTMLCurrentStyle_get_clipBottom,
836 HTMLCurrentStyle_get_clipLeft,
837 HTMLCurrentStyle_get_overflow,
838 HTMLCurrentStyle_get_pageBreakBefore,
839 HTMLCurrentStyle_get_pageBreakAfter,
840 HTMLCurrentStyle_get_cursor,
841 HTMLCurrentStyle_get_tableLayout,
842 HTMLCurrentStyle_get_borderCollapse,
843 HTMLCurrentStyle_get_direction,
844 HTMLCurrentStyle_get_behavior,
845 HTMLCurrentStyle_getAttribute,
846 HTMLCurrentStyle_get_unicodeBidi,
847 HTMLCurrentStyle_get_right,
848 HTMLCurrentStyle_get_bottom,
849 HTMLCurrentStyle_get_imeMode,
850 HTMLCurrentStyle_get_rubyAlign,
851 HTMLCurrentStyle_get_rubyPosition,
852 HTMLCurrentStyle_get_rubyOverhang,
853 HTMLCurrentStyle_get_textAutospace,
854 HTMLCurrentStyle_get_lineBreak,
855 HTMLCurrentStyle_get_wordBreak,
856 HTMLCurrentStyle_get_textJustify,
857 HTMLCurrentStyle_get_textJustifyTrim,
858 HTMLCurrentStyle_get_textKashida,
859 HTMLCurrentStyle_get_blockDirection,
860 HTMLCurrentStyle_get_layoutGridChar,
861 HTMLCurrentStyle_get_layoutGridLine,
862 HTMLCurrentStyle_get_layoutGridMode,
863 HTMLCurrentStyle_get_layoutGridType,
864 HTMLCurrentStyle_get_borderStyle,
865 HTMLCurrentStyle_get_borderColor,
866 HTMLCurrentStyle_get_borderWidth,
867 HTMLCurrentStyle_get_padding,
868 HTMLCurrentStyle_get_margin,
869 HTMLCurrentStyle_get_accelerator,
870 HTMLCurrentStyle_get_overflowX,
871 HTMLCurrentStyle_get_overflowY,
872 HTMLCurrentStyle_get_textTransform
875 static const tid_t HTMLCurrentStyle_iface_tids[] = {
876 IHTMLCurrentStyle_tid,
877 IHTMLCurrentStyle2_tid,
878 IHTMLCurrentStyle3_tid,
879 IHTMLCurrentStyle4_tid,
882 static dispex_static_data_t HTMLCurrentStyle_dispex = {
883 NULL,
884 DispHTMLCurrentStyle_tid,
885 NULL,
886 HTMLCurrentStyle_iface_tids
889 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
891 nsIDOMCSSStyleDeclaration *nsstyle;
892 nsIDOMDocumentView *nsdocview;
893 nsIDOMAbstractView *nsview;
894 nsIDOMViewCSS *nsviewcss;
895 nsAString nsempty_str;
896 HTMLCurrentStyle *ret;
897 nsresult nsres;
899 if(!elem->node.doc->nsdoc) {
900 WARN("NULL nsdoc\n");
901 return E_UNEXPECTED;
904 nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
905 if(NS_FAILED(nsres)) {
906 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
907 return E_FAIL;
910 nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
911 nsIDOMDocumentView_Release(nsdocview);
912 if(NS_FAILED(nsres)) {
913 ERR("GetDefaultView failed: %08x\n", nsres);
914 return E_FAIL;
917 nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
918 nsIDOMAbstractView_Release(nsview);
919 if(NS_FAILED(nsres)) {
920 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
921 return E_FAIL;
924 nsAString_Init(&nsempty_str, NULL);
925 nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
926 nsIDOMViewCSS_Release(nsviewcss);
927 nsAString_Finish(&nsempty_str);
928 if(NS_FAILED(nsres)) {
929 ERR("GetComputedStyle failed: %08x\n", nsres);
930 return E_FAIL;
933 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
934 if(!ret) {
935 nsIDOMCSSStyleDeclaration_Release(nsstyle);
936 return E_OUTOFMEMORY;
939 ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
940 ret->ref = 1;
941 ret->nsstyle = nsstyle;
943 init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex);
945 *p = HTMLCURSTYLE(ret);
946 return S_OK;