explorer: add a navbar to explorer
[wine/gsoc_explorer.git] / dlls / mshtml / htmlcurstyle.c
blobff8e0759685ed5f5fa47abd9134feff6e1b971a5
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 IHTMLCurrentStyle IHTMLCurrentStyle_iface;
39 LONG ref;
41 nsIDOMCSSStyleDeclaration *nsstyle;
44 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle(IHTMLCurrentStyle *iface)
46 return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle_iface);
49 static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
51 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
53 *ppv = NULL;
55 if(IsEqualGUID(&IID_IUnknown, riid)) {
56 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
57 *ppv = &This->IHTMLCurrentStyle_iface;
58 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
59 TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv);
60 *ppv = &This->IHTMLCurrentStyle_iface;
61 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
62 return *ppv ? S_OK : E_NOINTERFACE;
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 HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
76 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
77 LONG ref = InterlockedIncrement(&This->ref);
79 TRACE("(%p) ref=%d\n", This, ref);
81 return ref;
84 static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
86 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
87 LONG ref = InterlockedDecrement(&This->ref);
89 TRACE("(%p) ref=%d\n", This, ref);
91 if(!ref) {
92 if(This->nsstyle)
93 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
94 release_dispex(&This->dispex);
95 heap_free(This);
98 return ref;
101 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
103 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
104 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
107 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
108 LCID lcid, ITypeInfo **ppTInfo)
110 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
111 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
114 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
115 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
117 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
118 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
119 lcid, rgDispId);
122 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
123 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
124 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
126 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
127 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
128 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
131 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
133 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
135 TRACE("(%p)->(%p)\n", This, p);
137 return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p);
140 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
142 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
143 FIXME("(%p)->(%p)\n", This, p);
144 return E_NOTIMPL;
147 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
149 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
150 TRACE("(%p)->(%p)\n", This, p);
151 return get_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, p, 0);
154 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
156 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
157 TRACE("(%p)->(%p)\n", This, p);
158 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, p, 0);
161 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
163 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
165 TRACE("(%p)->(%p)\n", This, p);
167 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_FAMILY, p);
170 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
172 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
173 TRACE("(%p)->(%p)\n", This, p);
174 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, p);
177 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
179 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
180 TRACE("(%p)->(%p)\n", This, p);
181 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, p);
184 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
186 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
187 TRACE("(%p)->(%p)\n", This, p);
188 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_WEIGHT, p, ATTR_STR_TO_INT);
191 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
193 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
194 TRACE("(%p)->(%p)\n", This, p);
195 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
198 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
200 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
201 TRACE("(%p)->(%p)\n", This, p);
202 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_IMAGE, p);
205 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
207 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
208 FIXME("(%p)->(%p)\n", This, p);
209 return E_NOTIMPL;
212 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
214 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
215 FIXME("(%p)->(%p)\n", This, p);
216 return E_NOTIMPL;
219 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
221 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
222 TRACE("(%p)->(%p)\n", This, p);
223 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_REPEAT, p);
226 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
228 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
229 TRACE("(%p)->(%p)\n", This, p);
230 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
233 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
235 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
236 TRACE("(%p)->(%p)\n", This, p);
237 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
240 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
242 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
243 TRACE("(%p)->(%p)\n", This, p);
244 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
247 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
249 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
250 TRACE("(%p)->(%p)\n", This, p);
251 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
254 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
256 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
257 TRACE("(%p)->(%p)\n", This, p);
258 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_TOP_STYLE, p);
261 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
263 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
264 TRACE("(%p)->(%p)\n", This, p);
265 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_RIGHT_STYLE, p);
268 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
270 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
271 TRACE("(%p)->(%p)\n", This, p);
272 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_BOTTOM_STYLE, p);
275 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
277 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
278 TRACE("(%p)->(%p)\n", This, p);
279 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_LEFT_STYLE, p);
282 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
284 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
285 TRACE("(%p)->(%p)\n", This, p);
286 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
289 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
291 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
292 TRACE("(%p)->(%p)\n", This, p);
293 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
296 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
298 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
299 TRACE("(%p)->(%p)\n", This, p);
300 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
303 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
305 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
306 TRACE("(%p)->(%p)\n", This, p);
307 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
310 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
312 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
313 TRACE("(%p)->(%p)\n", This, p);
314 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
317 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
319 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
320 TRACE("(%p)->(%p)\n", This, p);
321 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
324 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
326 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
327 TRACE("(%p)->(%p)\n", This, p);
328 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
331 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
333 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
334 TRACE("(%p)->(%p)\n", This, p);
335 return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
338 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
340 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
341 TRACE("(%p)->(%p)\n", This, p);
342 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
345 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
347 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
348 TRACE("(%p)->(%p)\n", This, p);
349 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, p, 0);
352 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
354 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
355 TRACE("(%p)->(%p)\n", This, p);
356 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, p, 0);
359 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
361 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
362 TRACE("(%p)->(%p)\n", This, p);
363 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, p, 0);
366 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
368 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
369 TRACE("(%p)->(%p)\n", This, p);
370 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_ALIGN, p);
373 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
375 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
376 TRACE("(%p)->(%p)\n", This, p);
377 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_DECORATION, p);
380 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
382 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
384 TRACE("(%p)->(%p)\n", This, p);
386 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
389 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
391 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
393 TRACE("(%p)->(%p)\n", This, p);
395 return get_nsstyle_attr(This->nsstyle, STYLEID_VISIBILITY, p);
398 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
400 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
401 TRACE("(%p)->(%p)\n", This, p);
402 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
405 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
407 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
408 TRACE("(%p)->(%p)\n", This, p);
409 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
412 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
414 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
415 TRACE("(%p)->(%p)\n", This, p);
416 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, p, 0);
419 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
421 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
422 TRACE("(%p)->(%p)\n", This, p);
423 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, p, 0);
426 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
428 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
429 TRACE("(%p)->(%p)\n", This, p);
430 return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
433 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
435 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
436 FIXME("(%p)->(%p)\n", This, p);
437 return E_NOTIMPL;
440 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
442 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
443 TRACE("(%p)->(%p)\n", This, p);
444 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
447 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
449 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
450 TRACE("(%p)->(%p)\n", This, p);
451 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
454 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
456 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
457 TRACE("(%p)->(%p)\n", This, p);
458 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, p, 0);
461 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
463 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
464 TRACE("(%p)->(%p)\n", This, p);
465 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
468 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
470 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
471 FIXME("(%p)->(%p)\n", This, p);
472 return E_NOTIMPL;
475 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
477 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
478 FIXME("(%p)->(%p)\n", This, p);
479 return E_NOTIMPL;
482 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
484 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
485 FIXME("(%p)->(%p)\n", This, p);
486 return E_NOTIMPL;
489 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
491 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
492 FIXME("(%p)->(%p)\n", This, p);
493 return E_NOTIMPL;
496 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
498 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
499 FIXME("(%p)->(%p)\n", This, p);
500 return E_NOTIMPL;
503 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
505 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
506 FIXME("(%p)->(%p)\n", This, p);
507 return E_NOTIMPL;
510 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
512 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
513 FIXME("(%p)->(%p)\n", This, p);
514 return E_NOTIMPL;
517 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
519 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
520 FIXME("(%p)->(%p)\n", This, p);
521 return E_NOTIMPL;
524 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
526 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
527 TRACE("(%p)->(%p)\n", This, p);
528 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, p);
531 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
533 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
534 FIXME("(%p)->(%p)\n", This, p);
535 return E_NOTIMPL;
538 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
540 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
541 FIXME("(%p)->(%p)\n", This, p);
542 return E_NOTIMPL;
545 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
547 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
548 TRACE("(%p)->(%p)\n", This, p);
549 return get_nsstyle_attr(This->nsstyle, STYLEID_CURSOR, p);
552 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
554 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
555 FIXME("(%p)->(%p)\n", This, p);
556 return E_NOTIMPL;
559 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
561 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
562 FIXME("(%p)->(%p)\n", This, p);
563 return E_NOTIMPL;
566 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
568 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
569 FIXME("(%p)->(%p)\n", This, p);
570 return E_NOTIMPL;
573 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
575 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
576 FIXME("(%p)->(%p)\n", This, p);
577 return E_NOTIMPL;
580 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
581 LONG lFlags, VARIANT *AttributeValue)
583 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
584 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
585 return E_NOTIMPL;
588 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
590 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
591 FIXME("(%p)->(%p)\n", This, p);
592 return E_NOTIMPL;
595 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
597 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
598 TRACE("(%p)->(%p)\n", This, p);
599 return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
602 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
604 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
605 TRACE("(%p)->(%p)\n", This, p);
606 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0);
609 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
611 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
612 FIXME("(%p)->(%p)\n", This, p);
613 return E_NOTIMPL;
616 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
618 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
619 FIXME("(%p)->(%p)\n", This, p);
620 return E_NOTIMPL;
623 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
625 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
626 FIXME("(%p)->(%p)\n", This, p);
627 return E_NOTIMPL;
630 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
632 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
633 FIXME("(%p)->(%p)\n", This, p);
634 return E_NOTIMPL;
637 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
639 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
640 FIXME("(%p)->(%p)\n", This, p);
641 return E_NOTIMPL;
644 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
646 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
647 FIXME("(%p)->(%p)\n", This, p);
648 return E_NOTIMPL;
651 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
653 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
654 FIXME("(%p)->(%p)\n", This, p);
655 return E_NOTIMPL;
658 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
660 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
661 FIXME("(%p)->(%p)\n", This, p);
662 return E_NOTIMPL;
665 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
667 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
668 FIXME("(%p)->(%p)\n", This, p);
669 return E_NOTIMPL;
672 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
674 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
675 FIXME("(%p)->(%p)\n", This, p);
676 return E_NOTIMPL;
679 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
681 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
682 FIXME("(%p)->(%p)\n", This, p);
683 return E_NOTIMPL;
686 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
688 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
689 FIXME("(%p)->(%p)\n", This, p);
690 return E_NOTIMPL;
693 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
695 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
696 FIXME("(%p)->(%p)\n", This, p);
697 return E_NOTIMPL;
700 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
702 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
703 FIXME("(%p)->(%p)\n", This, p);
704 return E_NOTIMPL;
707 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
709 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
710 FIXME("(%p)->(%p)\n", This, p);
711 return E_NOTIMPL;
714 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
716 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
717 TRACE("(%p)->(%p)\n", This, p);
718 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, p);
721 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
723 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
724 TRACE("(%p)->(%p)\n", This, p);
725 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_COLOR, p);
728 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
730 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
731 TRACE("(%p)->(%p)\n", This, p);
732 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_WIDTH, p);
735 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
737 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
738 TRACE("(%p)->(%p)\n", This, p);
739 return get_nsstyle_attr(This->nsstyle, STYLEID_PADDING, p);
742 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
744 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
745 TRACE("(%p)->(%p)\n", This, p);
746 return get_nsstyle_attr(This->nsstyle, STYLEID_MARGIN, p);
749 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
751 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
752 FIXME("(%p)->(%p)\n", This, p);
753 return E_NOTIMPL;
756 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
758 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
759 FIXME("(%p)->(%p)\n", This, p);
760 return E_NOTIMPL;
763 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
765 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
766 FIXME("(%p)->(%p)\n", This, p);
767 return E_NOTIMPL;
770 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
772 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
773 FIXME("(%p)->(%p)\n", This, p);
774 return E_NOTIMPL;
777 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
778 HTMLCurrentStyle_QueryInterface,
779 HTMLCurrentStyle_AddRef,
780 HTMLCurrentStyle_Release,
781 HTMLCurrentStyle_GetTypeInfoCount,
782 HTMLCurrentStyle_GetTypeInfo,
783 HTMLCurrentStyle_GetIDsOfNames,
784 HTMLCurrentStyle_Invoke,
785 HTMLCurrentStyle_get_position,
786 HTMLCurrentStyle_get_styleFloat,
787 HTMLCurrentStyle_get_color,
788 HTMLCurrentStyle_get_backgroundColor,
789 HTMLCurrentStyle_get_fontFamily,
790 HTMLCurrentStyle_get_fontStyle,
791 HTMLCurrentStyle_get_fontVariant,
792 HTMLCurrentStyle_get_fontWeight,
793 HTMLCurrentStyle_get_fontSize,
794 HTMLCurrentStyle_get_backgroundImage,
795 HTMLCurrentStyle_get_backgroundPositionX,
796 HTMLCurrentStyle_get_backgroundPositionY,
797 HTMLCurrentStyle_get_backgroundRepeat,
798 HTMLCurrentStyle_get_borderLeftColor,
799 HTMLCurrentStyle_get_borderTopColor,
800 HTMLCurrentStyle_get_borderRightColor,
801 HTMLCurrentStyle_get_borderBottomColor,
802 HTMLCurrentStyle_get_borderTopStyle,
803 HTMLCurrentStyle_get_borderRightStyle,
804 HTMLCurrentStyle_get_borderBottomStyle,
805 HTMLCurrentStyle_get_borderLeftStyle,
806 HTMLCurrentStyle_get_borderTopWidth,
807 HTMLCurrentStyle_get_borderRightWidth,
808 HTMLCurrentStyle_get_borderBottomWidth,
809 HTMLCurrentStyle_get_borderLeftWidth,
810 HTMLCurrentStyle_get_left,
811 HTMLCurrentStyle_get_top,
812 HTMLCurrentStyle_get_width,
813 HTMLCurrentStyle_get_height,
814 HTMLCurrentStyle_get_paddingLeft,
815 HTMLCurrentStyle_get_paddingTop,
816 HTMLCurrentStyle_get_paddingRight,
817 HTMLCurrentStyle_get_paddingBottom,
818 HTMLCurrentStyle_get_textAlign,
819 HTMLCurrentStyle_get_textDecoration,
820 HTMLCurrentStyle_get_display,
821 HTMLCurrentStyle_get_visibility,
822 HTMLCurrentStyle_get_zIndex,
823 HTMLCurrentStyle_get_letterSpacing,
824 HTMLCurrentStyle_get_lineHeight,
825 HTMLCurrentStyle_get_textIndent,
826 HTMLCurrentStyle_get_verticalAlign,
827 HTMLCurrentStyle_get_backgroundAttachment,
828 HTMLCurrentStyle_get_marginTop,
829 HTMLCurrentStyle_get_marginRight,
830 HTMLCurrentStyle_get_marginBottom,
831 HTMLCurrentStyle_get_marginLeft,
832 HTMLCurrentStyle_get_clear,
833 HTMLCurrentStyle_get_listStyleType,
834 HTMLCurrentStyle_get_listStylePosition,
835 HTMLCurrentStyle_get_listStyleImage,
836 HTMLCurrentStyle_get_clipTop,
837 HTMLCurrentStyle_get_clipRight,
838 HTMLCurrentStyle_get_clipBottom,
839 HTMLCurrentStyle_get_clipLeft,
840 HTMLCurrentStyle_get_overflow,
841 HTMLCurrentStyle_get_pageBreakBefore,
842 HTMLCurrentStyle_get_pageBreakAfter,
843 HTMLCurrentStyle_get_cursor,
844 HTMLCurrentStyle_get_tableLayout,
845 HTMLCurrentStyle_get_borderCollapse,
846 HTMLCurrentStyle_get_direction,
847 HTMLCurrentStyle_get_behavior,
848 HTMLCurrentStyle_getAttribute,
849 HTMLCurrentStyle_get_unicodeBidi,
850 HTMLCurrentStyle_get_right,
851 HTMLCurrentStyle_get_bottom,
852 HTMLCurrentStyle_get_imeMode,
853 HTMLCurrentStyle_get_rubyAlign,
854 HTMLCurrentStyle_get_rubyPosition,
855 HTMLCurrentStyle_get_rubyOverhang,
856 HTMLCurrentStyle_get_textAutospace,
857 HTMLCurrentStyle_get_lineBreak,
858 HTMLCurrentStyle_get_wordBreak,
859 HTMLCurrentStyle_get_textJustify,
860 HTMLCurrentStyle_get_textJustifyTrim,
861 HTMLCurrentStyle_get_textKashida,
862 HTMLCurrentStyle_get_blockDirection,
863 HTMLCurrentStyle_get_layoutGridChar,
864 HTMLCurrentStyle_get_layoutGridLine,
865 HTMLCurrentStyle_get_layoutGridMode,
866 HTMLCurrentStyle_get_layoutGridType,
867 HTMLCurrentStyle_get_borderStyle,
868 HTMLCurrentStyle_get_borderColor,
869 HTMLCurrentStyle_get_borderWidth,
870 HTMLCurrentStyle_get_padding,
871 HTMLCurrentStyle_get_margin,
872 HTMLCurrentStyle_get_accelerator,
873 HTMLCurrentStyle_get_overflowX,
874 HTMLCurrentStyle_get_overflowY,
875 HTMLCurrentStyle_get_textTransform
878 static const tid_t HTMLCurrentStyle_iface_tids[] = {
879 IHTMLCurrentStyle_tid,
880 IHTMLCurrentStyle2_tid,
881 IHTMLCurrentStyle3_tid,
882 IHTMLCurrentStyle4_tid,
885 static dispex_static_data_t HTMLCurrentStyle_dispex = {
886 NULL,
887 DispHTMLCurrentStyle_tid,
888 NULL,
889 HTMLCurrentStyle_iface_tids
892 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
894 nsIDOMCSSStyleDeclaration *nsstyle;
895 nsIDOMDocumentView *nsdocview;
896 nsIDOMAbstractView *nsview;
897 nsIDOMViewCSS *nsviewcss;
898 nsAString nsempty_str;
899 HTMLCurrentStyle *ret;
900 nsresult nsres;
902 if(!elem->node.doc->nsdoc) {
903 WARN("NULL nsdoc\n");
904 return E_UNEXPECTED;
907 nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
908 if(NS_FAILED(nsres)) {
909 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
910 return E_FAIL;
913 nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
914 nsIDOMDocumentView_Release(nsdocview);
915 if(NS_FAILED(nsres)) {
916 ERR("GetDefaultView failed: %08x\n", nsres);
917 return E_FAIL;
920 nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
921 nsIDOMAbstractView_Release(nsview);
922 if(NS_FAILED(nsres)) {
923 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
924 return E_FAIL;
927 nsAString_Init(&nsempty_str, NULL);
928 nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
929 nsIDOMViewCSS_Release(nsviewcss);
930 nsAString_Finish(&nsempty_str);
931 if(NS_FAILED(nsres)) {
932 ERR("GetComputedStyle failed: %08x\n", nsres);
933 return E_FAIL;
936 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
937 if(!ret) {
938 nsIDOMCSSStyleDeclaration_Release(nsstyle);
939 return E_OUTOFMEMORY;
942 ret->IHTMLCurrentStyle_iface.lpVtbl = &HTMLCurrentStyleVtbl;
943 ret->ref = 1;
944 ret->nsstyle = nsstyle;
946 init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLCurrentStyle_iface, &HTMLCurrentStyle_dispex);
948 *p = &ret->IHTMLCurrentStyle_iface;
949 return S_OK;