mshtml: Implement IHTMLCurrentStyle_get_position.
[wine/wine-gecko.git] / dlls / mshtml / htmlcurstyle.c
blobbcff9433d99027ab8c5859e8c1a9cba1acae82c7
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);
161 FIXME("(%p)->(%p)\n", This, p);
162 return E_NOTIMPL;
165 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
167 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
168 FIXME("(%p)->(%p)\n", This, p);
169 return E_NOTIMPL;
172 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
174 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
175 FIXME("(%p)->(%p)\n", This, p);
176 return E_NOTIMPL;
179 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
181 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
182 FIXME("(%p)->(%p)\n", This, p);
183 return E_NOTIMPL;
186 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
188 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
189 FIXME("(%p)->(%p)\n", This, p);
190 return E_NOTIMPL;
193 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
195 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
196 FIXME("(%p)->(%p)\n", This, p);
197 return E_NOTIMPL;
200 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
202 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
203 FIXME("(%p)->(%p)\n", This, p);
204 return E_NOTIMPL;
207 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
209 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
210 FIXME("(%p)->(%p)\n", This, p);
211 return E_NOTIMPL;
214 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
216 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
217 FIXME("(%p)->(%p)\n", This, p);
218 return E_NOTIMPL;
221 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
223 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
224 FIXME("(%p)->(%p)\n", This, p);
225 return E_NOTIMPL;
228 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
230 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
231 FIXME("(%p)->(%p)\n", This, p);
232 return E_NOTIMPL;
235 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
237 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
238 FIXME("(%p)->(%p)\n", This, p);
239 return E_NOTIMPL;
242 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
244 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
245 FIXME("(%p)->(%p)\n", This, p);
246 return E_NOTIMPL;
249 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
251 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
252 FIXME("(%p)->(%p)\n", This, p);
253 return E_NOTIMPL;
256 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
258 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
259 FIXME("(%p)->(%p)\n", This, p);
260 return E_NOTIMPL;
263 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
265 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
266 FIXME("(%p)->(%p)\n", This, p);
267 return E_NOTIMPL;
270 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
272 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
273 FIXME("(%p)->(%p)\n", This, p);
274 return E_NOTIMPL;
277 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
279 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
280 FIXME("(%p)->(%p)\n", This, p);
281 return E_NOTIMPL;
284 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
286 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
287 FIXME("(%p)->(%p)\n", This, p);
288 return E_NOTIMPL;
291 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
293 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
294 FIXME("(%p)->(%p)\n", This, p);
295 return E_NOTIMPL;
298 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
300 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
301 FIXME("(%p)->(%p)\n", This, p);
302 return E_NOTIMPL;
305 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
307 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
308 FIXME("(%p)->(%p)\n", This, p);
309 return E_NOTIMPL;
312 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
314 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
315 FIXME("(%p)->(%p)\n", This, p);
316 return E_NOTIMPL;
319 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
321 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
322 FIXME("(%p)->(%p)\n", This, p);
323 return E_NOTIMPL;
326 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
328 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
329 FIXME("(%p)->(%p)\n", This, p);
330 return E_NOTIMPL;
333 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
335 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
336 FIXME("(%p)->(%p)\n", This, p);
337 return E_NOTIMPL;
340 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
342 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
343 FIXME("(%p)->(%p)\n", This, p);
344 return E_NOTIMPL;
347 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
349 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
350 FIXME("(%p)->(%p)\n", This, p);
351 return E_NOTIMPL;
354 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
356 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
357 FIXME("(%p)->(%p)\n", This, p);
358 return E_NOTIMPL;
361 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
363 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
364 FIXME("(%p)->(%p)\n", This, p);
365 return E_NOTIMPL;
368 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
370 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
371 FIXME("(%p)->(%p)\n", This, p);
372 return E_NOTIMPL;
375 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
377 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
379 TRACE("(%p)->(%p)\n", This, p);
381 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
384 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
386 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
387 FIXME("(%p)->(%p)\n", This, p);
388 return E_NOTIMPL;
391 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
393 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
394 FIXME("(%p)->(%p)\n", This, p);
395 return E_NOTIMPL;
398 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
400 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
401 FIXME("(%p)->(%p)\n", This, p);
402 return E_NOTIMPL;
405 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
407 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
408 FIXME("(%p)->(%p)\n", This, p);
409 return E_NOTIMPL;
412 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
414 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
415 FIXME("(%p)->(%p)\n", This, p);
416 return E_NOTIMPL;
419 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
421 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
422 FIXME("(%p)->(%p)\n", This, p);
423 return E_NOTIMPL;
426 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
428 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
429 FIXME("(%p)->(%p)\n", This, p);
430 return E_NOTIMPL;
433 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
435 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
436 FIXME("(%p)->(%p)\n", This, p);
437 return E_NOTIMPL;
440 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
442 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
443 FIXME("(%p)->(%p)\n", This, p);
444 return E_NOTIMPL;
447 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
449 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
450 FIXME("(%p)->(%p)\n", This, p);
451 return E_NOTIMPL;
454 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
456 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
457 FIXME("(%p)->(%p)\n", This, p);
458 return E_NOTIMPL;
461 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
463 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
464 FIXME("(%p)->(%p)\n", This, p);
465 return E_NOTIMPL;
468 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
470 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
471 FIXME("(%p)->(%p)\n", This, p);
472 return E_NOTIMPL;
475 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
477 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
478 FIXME("(%p)->(%p)\n", This, p);
479 return E_NOTIMPL;
482 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
484 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
485 FIXME("(%p)->(%p)\n", This, p);
486 return E_NOTIMPL;
489 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
491 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
492 FIXME("(%p)->(%p)\n", This, p);
493 return E_NOTIMPL;
496 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
498 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
499 FIXME("(%p)->(%p)\n", This, p);
500 return E_NOTIMPL;
503 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
505 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
506 FIXME("(%p)->(%p)\n", This, p);
507 return E_NOTIMPL;
510 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
512 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
513 FIXME("(%p)->(%p)\n", This, p);
514 return E_NOTIMPL;
517 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
519 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
520 FIXME("(%p)->(%p)\n", This, p);
521 return E_NOTIMPL;
524 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
526 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
527 FIXME("(%p)->(%p)\n", This, p);
528 return E_NOTIMPL;
531 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
533 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
534 FIXME("(%p)->(%p)\n", This, p);
535 return E_NOTIMPL;
538 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
540 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
541 FIXME("(%p)->(%p)\n", This, p);
542 return E_NOTIMPL;
545 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
547 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
548 FIXME("(%p)->(%p)\n", This, p);
549 return E_NOTIMPL;
552 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
554 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
555 FIXME("(%p)->(%p)\n", This, p);
556 return E_NOTIMPL;
559 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
561 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
562 FIXME("(%p)->(%p)\n", This, p);
563 return E_NOTIMPL;
566 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
568 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
569 FIXME("(%p)->(%p)\n", This, p);
570 return E_NOTIMPL;
573 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
574 LONG lFlags, VARIANT *AttributeValue)
576 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
577 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
578 return E_NOTIMPL;
581 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
583 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
584 FIXME("(%p)->(%p)\n", This, p);
585 return E_NOTIMPL;
588 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
590 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
591 FIXME("(%p)->(%p)\n", This, p);
592 return E_NOTIMPL;
595 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
597 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
598 FIXME("(%p)->(%p)\n", This, p);
599 return E_NOTIMPL;
602 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
604 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
605 FIXME("(%p)->(%p)\n", This, p);
606 return E_NOTIMPL;
609 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
611 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
612 FIXME("(%p)->(%p)\n", This, p);
613 return E_NOTIMPL;
616 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
618 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
619 FIXME("(%p)->(%p)\n", This, p);
620 return E_NOTIMPL;
623 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
625 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
626 FIXME("(%p)->(%p)\n", This, p);
627 return E_NOTIMPL;
630 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
632 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
633 FIXME("(%p)->(%p)\n", This, p);
634 return E_NOTIMPL;
637 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
639 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
640 FIXME("(%p)->(%p)\n", This, p);
641 return E_NOTIMPL;
644 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
646 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
647 FIXME("(%p)->(%p)\n", This, p);
648 return E_NOTIMPL;
651 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
653 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
654 FIXME("(%p)->(%p)\n", This, p);
655 return E_NOTIMPL;
658 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
660 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
661 FIXME("(%p)->(%p)\n", This, p);
662 return E_NOTIMPL;
665 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
667 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
668 FIXME("(%p)->(%p)\n", This, p);
669 return E_NOTIMPL;
672 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
674 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
675 FIXME("(%p)->(%p)\n", This, p);
676 return E_NOTIMPL;
679 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
681 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
682 FIXME("(%p)->(%p)\n", This, p);
683 return E_NOTIMPL;
686 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
688 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
689 FIXME("(%p)->(%p)\n", This, p);
690 return E_NOTIMPL;
693 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
695 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
696 FIXME("(%p)->(%p)\n", This, p);
697 return E_NOTIMPL;
700 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
702 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
703 FIXME("(%p)->(%p)\n", This, p);
704 return E_NOTIMPL;
707 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
709 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
710 FIXME("(%p)->(%p)\n", This, p);
711 return E_NOTIMPL;
714 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
716 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
717 FIXME("(%p)->(%p)\n", This, p);
718 return E_NOTIMPL;
721 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
723 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
724 FIXME("(%p)->(%p)\n", This, p);
725 return E_NOTIMPL;
728 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
730 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
731 FIXME("(%p)->(%p)\n", This, p);
732 return E_NOTIMPL;
735 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
737 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
738 FIXME("(%p)->(%p)\n", This, p);
739 return E_NOTIMPL;
742 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
744 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
745 FIXME("(%p)->(%p)\n", This, p);
746 return E_NOTIMPL;
749 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
751 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
752 FIXME("(%p)->(%p)\n", This, p);
753 return E_NOTIMPL;
756 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
758 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
759 FIXME("(%p)->(%p)\n", This, p);
760 return E_NOTIMPL;
763 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
765 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
766 FIXME("(%p)->(%p)\n", This, p);
767 return E_NOTIMPL;
770 #undef HTMLCURSTYLE_THIS
772 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
773 HTMLCurrentStyle_QueryInterface,
774 HTMLCurrentStyle_AddRef,
775 HTMLCurrentStyle_Release,
776 HTMLCurrentStyle_GetTypeInfoCount,
777 HTMLCurrentStyle_GetTypeInfo,
778 HTMLCurrentStyle_GetIDsOfNames,
779 HTMLCurrentStyle_Invoke,
780 HTMLCurrentStyle_get_position,
781 HTMLCurrentStyle_get_styleFloat,
782 HTMLCurrentStyle_get_color,
783 HTMLCurrentStyle_get_backgroundColor,
784 HTMLCurrentStyle_get_fontFamily,
785 HTMLCurrentStyle_get_fontStyle,
786 HTMLCurrentStyle_get_fontVariant,
787 HTMLCurrentStyle_get_fontWeight,
788 HTMLCurrentStyle_get_fontSize,
789 HTMLCurrentStyle_get_backgroundImage,
790 HTMLCurrentStyle_get_backgroundPositionX,
791 HTMLCurrentStyle_get_backgroundPositionY,
792 HTMLCurrentStyle_get_backgroundRepeat,
793 HTMLCurrentStyle_get_borderLeftColor,
794 HTMLCurrentStyle_get_borderTopColor,
795 HTMLCurrentStyle_get_borderRightColor,
796 HTMLCurrentStyle_get_borderBottomColor,
797 HTMLCurrentStyle_get_borderTopStyle,
798 HTMLCurrentStyle_get_borderRightStyle,
799 HTMLCurrentStyle_get_borderBottomStyle,
800 HTMLCurrentStyle_get_borderLeftStyle,
801 HTMLCurrentStyle_get_borderTopWidth,
802 HTMLCurrentStyle_get_borderRightWidth,
803 HTMLCurrentStyle_get_borderBottomWidth,
804 HTMLCurrentStyle_get_borderLeftWidth,
805 HTMLCurrentStyle_get_left,
806 HTMLCurrentStyle_get_top,
807 HTMLCurrentStyle_get_width,
808 HTMLCurrentStyle_get_height,
809 HTMLCurrentStyle_get_paddingLeft,
810 HTMLCurrentStyle_get_paddingTop,
811 HTMLCurrentStyle_get_paddingRight,
812 HTMLCurrentStyle_get_paddingBottom,
813 HTMLCurrentStyle_get_textAlign,
814 HTMLCurrentStyle_get_textDecoration,
815 HTMLCurrentStyle_get_display,
816 HTMLCurrentStyle_get_visibility,
817 HTMLCurrentStyle_get_zIndex,
818 HTMLCurrentStyle_get_letterSpacing,
819 HTMLCurrentStyle_get_lineHeight,
820 HTMLCurrentStyle_get_textIndent,
821 HTMLCurrentStyle_get_verticalAlign,
822 HTMLCurrentStyle_get_backgroundAttachment,
823 HTMLCurrentStyle_get_marginTop,
824 HTMLCurrentStyle_get_marginRight,
825 HTMLCurrentStyle_get_marginBottom,
826 HTMLCurrentStyle_get_marginLeft,
827 HTMLCurrentStyle_get_clear,
828 HTMLCurrentStyle_get_listStyleType,
829 HTMLCurrentStyle_get_listStylePosition,
830 HTMLCurrentStyle_get_listStyleImage,
831 HTMLCurrentStyle_get_clipTop,
832 HTMLCurrentStyle_get_clipRight,
833 HTMLCurrentStyle_get_clipBottom,
834 HTMLCurrentStyle_get_clipLeft,
835 HTMLCurrentStyle_get_overflow,
836 HTMLCurrentStyle_get_pageBreakBefore,
837 HTMLCurrentStyle_get_pageBreakAfter,
838 HTMLCurrentStyle_get_cursor,
839 HTMLCurrentStyle_get_tableLayout,
840 HTMLCurrentStyle_get_borderCollapse,
841 HTMLCurrentStyle_get_direction,
842 HTMLCurrentStyle_get_behavior,
843 HTMLCurrentStyle_getAttribute,
844 HTMLCurrentStyle_get_unicodeBidi,
845 HTMLCurrentStyle_get_right,
846 HTMLCurrentStyle_get_bottom,
847 HTMLCurrentStyle_get_imeMode,
848 HTMLCurrentStyle_get_rubyAlign,
849 HTMLCurrentStyle_get_rubyPosition,
850 HTMLCurrentStyle_get_rubyOverhang,
851 HTMLCurrentStyle_get_textAutospace,
852 HTMLCurrentStyle_get_lineBreak,
853 HTMLCurrentStyle_get_wordBreak,
854 HTMLCurrentStyle_get_textJustify,
855 HTMLCurrentStyle_get_textJustifyTrim,
856 HTMLCurrentStyle_get_textKashida,
857 HTMLCurrentStyle_get_blockDirection,
858 HTMLCurrentStyle_get_layoutGridChar,
859 HTMLCurrentStyle_get_layoutGridLine,
860 HTMLCurrentStyle_get_layoutGridMode,
861 HTMLCurrentStyle_get_layoutGridType,
862 HTMLCurrentStyle_get_borderStyle,
863 HTMLCurrentStyle_get_borderColor,
864 HTMLCurrentStyle_get_borderWidth,
865 HTMLCurrentStyle_get_padding,
866 HTMLCurrentStyle_get_margin,
867 HTMLCurrentStyle_get_accelerator,
868 HTMLCurrentStyle_get_overflowX,
869 HTMLCurrentStyle_get_overflowY,
870 HTMLCurrentStyle_get_textTransform
873 static const tid_t HTMLCurrentStyle_iface_tids[] = {
874 IHTMLCurrentStyle_tid,
877 static dispex_static_data_t HTMLCurrentStyle_dispex = {
878 NULL,
879 DispHTMLCurrentStyle_tid,
880 NULL,
881 HTMLCurrentStyle_iface_tids
884 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
886 nsIDOMCSSStyleDeclaration *nsstyle;
887 nsIDOMDocumentView *nsdocview;
888 nsIDOMAbstractView *nsview;
889 nsIDOMViewCSS *nsviewcss;
890 nsAString nsempty_str;
891 HTMLCurrentStyle *ret;
892 nsresult nsres;
894 if(!elem->node.doc->nsdoc) {
895 WARN("NULL nsdoc\n");
896 return E_UNEXPECTED;
899 nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
900 if(NS_FAILED(nsres)) {
901 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
902 return E_FAIL;
905 nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
906 nsIDOMDocumentView_Release(nsdocview);
907 if(NS_FAILED(nsres)) {
908 ERR("GetDefaultView failed: %08x\n", nsres);
909 return E_FAIL;
912 nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
913 nsIDOMAbstractView_Release(nsview);
914 if(NS_FAILED(nsres)) {
915 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
916 return E_FAIL;
919 nsAString_Init(&nsempty_str, NULL);
920 nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
921 nsIDOMViewCSS_Release(nsviewcss);
922 nsAString_Finish(&nsempty_str);
923 if(NS_FAILED(nsres)) {
924 ERR("GetComputedStyle failed: %08x\n", nsres);
925 return E_FAIL;
928 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
929 if(!ret) {
930 nsIDOMCSSStyleDeclaration_Release(nsstyle);
931 return E_OUTOFMEMORY;
934 ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
935 ret->ref = 1;
936 ret->nsstyle = nsstyle;
938 init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex);
940 *p = HTMLCURSTYLE(ret);
941 return S_OK;