push 15b96ea46b12fa9aa8d3d4072be1bf1f7af34661
[wine/hacks.git] / dlls / mshtml / htmlcurstyle.c
blob8bb56f3a46ac0affc40a07a34792dc8771ac9da6
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 typedef struct {
36 DispatchEx dispex;
37 const IHTMLCurrentStyleVtbl *lpIHTMLCurrentStyleVtbl;
39 LONG ref;
41 nsIDOMCSSStyleDeclaration *nsstyle;
42 } HTMLCurrentStyle;
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 FIXME("(%p)\n", This);
103 return E_NOTIMPL;
106 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
107 LCID lcid, ITypeInfo **ppTInfo)
109 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
110 FIXME("(%p)\n", This);
111 return E_NOTIMPL;
114 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
115 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
117 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
118 FIXME("(%p)\n", This);
119 return E_NOTIMPL;
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 = HTMLCURSTYLE_THIS(iface);
127 FIXME("(%p)\n", This);
128 return E_NOTIMPL;
131 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
133 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
134 FIXME("(%p)->(%p)\n", This, p);
135 return E_NOTIMPL;
138 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
140 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
141 FIXME("(%p)->(%p)\n", This, p);
142 return E_NOTIMPL;
145 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
147 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
148 FIXME("(%p)->(%p)\n", This, p);
149 return E_NOTIMPL;
152 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
154 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
155 FIXME("(%p)->(%p)\n", This, p);
156 return E_NOTIMPL;
159 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
161 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
162 FIXME("(%p)->(%p)\n", This, p);
163 return E_NOTIMPL;
166 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
168 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
169 FIXME("(%p)->(%p)\n", This, p);
170 return E_NOTIMPL;
173 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
175 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
176 FIXME("(%p)->(%p)\n", This, p);
177 return E_NOTIMPL;
180 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
182 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
183 FIXME("(%p)->(%p)\n", This, p);
184 return E_NOTIMPL;
187 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
189 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
190 FIXME("(%p)->(%p)\n", This, p);
191 return E_NOTIMPL;
194 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
196 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
197 FIXME("(%p)->(%p)\n", This, p);
198 return E_NOTIMPL;
201 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
203 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
204 FIXME("(%p)->(%p)\n", This, p);
205 return E_NOTIMPL;
208 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
210 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
211 FIXME("(%p)->(%p)\n", This, p);
212 return E_NOTIMPL;
215 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
217 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
218 FIXME("(%p)->(%p)\n", This, p);
219 return E_NOTIMPL;
222 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
224 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
225 FIXME("(%p)->(%p)\n", This, p);
226 return E_NOTIMPL;
229 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
231 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
232 FIXME("(%p)->(%p)\n", This, p);
233 return E_NOTIMPL;
236 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
238 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
239 FIXME("(%p)->(%p)\n", This, p);
240 return E_NOTIMPL;
243 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
245 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
246 FIXME("(%p)->(%p)\n", This, p);
247 return E_NOTIMPL;
250 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
252 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
253 FIXME("(%p)->(%p)\n", This, p);
254 return E_NOTIMPL;
257 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
259 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
260 FIXME("(%p)->(%p)\n", This, p);
261 return E_NOTIMPL;
264 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
266 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
267 FIXME("(%p)->(%p)\n", This, p);
268 return E_NOTIMPL;
271 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
273 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
274 FIXME("(%p)->(%p)\n", This, p);
275 return E_NOTIMPL;
278 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
280 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
281 FIXME("(%p)->(%p)\n", This, p);
282 return E_NOTIMPL;
285 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
287 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
288 FIXME("(%p)->(%p)\n", This, p);
289 return E_NOTIMPL;
292 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
294 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
295 FIXME("(%p)->(%p)\n", This, p);
296 return E_NOTIMPL;
299 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
301 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
302 FIXME("(%p)->(%p)\n", This, p);
303 return E_NOTIMPL;
306 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
308 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
309 FIXME("(%p)->(%p)\n", This, p);
310 return E_NOTIMPL;
313 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
315 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
316 FIXME("(%p)->(%p)\n", This, p);
317 return E_NOTIMPL;
320 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
322 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
323 FIXME("(%p)->(%p)\n", This, p);
324 return E_NOTIMPL;
327 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
329 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
330 FIXME("(%p)->(%p)\n", This, p);
331 return E_NOTIMPL;
334 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
336 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
337 FIXME("(%p)->(%p)\n", This, p);
338 return E_NOTIMPL;
341 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
343 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, p);
345 return E_NOTIMPL;
348 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
350 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
351 FIXME("(%p)->(%p)\n", This, p);
352 return E_NOTIMPL;
355 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
357 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
358 FIXME("(%p)->(%p)\n", This, p);
359 return E_NOTIMPL;
362 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
364 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
365 FIXME("(%p)->(%p)\n", This, p);
366 return E_NOTIMPL;
369 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
371 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
372 FIXME("(%p)->(%p)\n", This, p);
373 return E_NOTIMPL;
376 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
378 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
380 TRACE("(%p)->(%p)\n", This, p);
382 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
385 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
387 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
388 FIXME("(%p)->(%p)\n", This, p);
389 return E_NOTIMPL;
392 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
394 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
395 FIXME("(%p)->(%p)\n", This, p);
396 return E_NOTIMPL;
399 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
401 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
402 FIXME("(%p)->(%p)\n", This, p);
403 return E_NOTIMPL;
406 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
408 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
409 FIXME("(%p)->(%p)\n", This, p);
410 return E_NOTIMPL;
413 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
415 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
416 FIXME("(%p)->(%p)\n", This, p);
417 return E_NOTIMPL;
420 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
422 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
423 FIXME("(%p)->(%p)\n", This, p);
424 return E_NOTIMPL;
427 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
429 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
430 FIXME("(%p)->(%p)\n", This, p);
431 return E_NOTIMPL;
434 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
436 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
437 FIXME("(%p)->(%p)\n", This, p);
438 return E_NOTIMPL;
441 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
443 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
444 FIXME("(%p)->(%p)\n", This, p);
445 return E_NOTIMPL;
448 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
450 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
451 FIXME("(%p)->(%p)\n", This, p);
452 return E_NOTIMPL;
455 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
457 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
458 FIXME("(%p)->(%p)\n", This, p);
459 return E_NOTIMPL;
462 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
464 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
465 FIXME("(%p)->(%p)\n", This, p);
466 return E_NOTIMPL;
469 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
471 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
472 FIXME("(%p)->(%p)\n", This, p);
473 return E_NOTIMPL;
476 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
478 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
479 FIXME("(%p)->(%p)\n", This, p);
480 return E_NOTIMPL;
483 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
485 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
486 FIXME("(%p)->(%p)\n", This, p);
487 return E_NOTIMPL;
490 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
492 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
493 FIXME("(%p)->(%p)\n", This, p);
494 return E_NOTIMPL;
497 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
499 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
500 FIXME("(%p)->(%p)\n", This, p);
501 return E_NOTIMPL;
504 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
506 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
507 FIXME("(%p)->(%p)\n", This, p);
508 return E_NOTIMPL;
511 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
513 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
514 FIXME("(%p)->(%p)\n", This, p);
515 return E_NOTIMPL;
518 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
520 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
521 FIXME("(%p)->(%p)\n", This, p);
522 return E_NOTIMPL;
525 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
527 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
528 FIXME("(%p)->(%p)\n", This, p);
529 return E_NOTIMPL;
532 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
534 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
535 FIXME("(%p)->(%p)\n", This, p);
536 return E_NOTIMPL;
539 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
541 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
542 FIXME("(%p)->(%p)\n", This, p);
543 return E_NOTIMPL;
546 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
548 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
549 FIXME("(%p)->(%p)\n", This, p);
550 return E_NOTIMPL;
553 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
555 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
556 FIXME("(%p)->(%p)\n", This, p);
557 return E_NOTIMPL;
560 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
562 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
563 FIXME("(%p)->(%p)\n", This, p);
564 return E_NOTIMPL;
567 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
569 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
570 FIXME("(%p)->(%p)\n", This, p);
571 return E_NOTIMPL;
574 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
575 LONG lFlags, VARIANT *AttributeValue)
577 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
578 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
579 return E_NOTIMPL;
582 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
584 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
585 FIXME("(%p)->(%p)\n", This, p);
586 return E_NOTIMPL;
589 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
591 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
592 FIXME("(%p)->(%p)\n", This, p);
593 return E_NOTIMPL;
596 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
598 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
599 FIXME("(%p)->(%p)\n", This, p);
600 return E_NOTIMPL;
603 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
605 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
606 FIXME("(%p)->(%p)\n", This, p);
607 return E_NOTIMPL;
610 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
612 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
613 FIXME("(%p)->(%p)\n", This, p);
614 return E_NOTIMPL;
617 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
619 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
620 FIXME("(%p)->(%p)\n", This, p);
621 return E_NOTIMPL;
624 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
626 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
627 FIXME("(%p)->(%p)\n", This, p);
628 return E_NOTIMPL;
631 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
633 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
634 FIXME("(%p)->(%p)\n", This, p);
635 return E_NOTIMPL;
638 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
640 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
641 FIXME("(%p)->(%p)\n", This, p);
642 return E_NOTIMPL;
645 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
647 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
648 FIXME("(%p)->(%p)\n", This, p);
649 return E_NOTIMPL;
652 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
654 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
655 FIXME("(%p)->(%p)\n", This, p);
656 return E_NOTIMPL;
659 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
661 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
662 FIXME("(%p)->(%p)\n", This, p);
663 return E_NOTIMPL;
666 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
668 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
669 FIXME("(%p)->(%p)\n", This, p);
670 return E_NOTIMPL;
673 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
675 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
676 FIXME("(%p)->(%p)\n", This, p);
677 return E_NOTIMPL;
680 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
682 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
683 FIXME("(%p)->(%p)\n", This, p);
684 return E_NOTIMPL;
687 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
689 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
690 FIXME("(%p)->(%p)\n", This, p);
691 return E_NOTIMPL;
694 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
696 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
697 FIXME("(%p)->(%p)\n", This, p);
698 return E_NOTIMPL;
701 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
703 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
704 FIXME("(%p)->(%p)\n", This, p);
705 return E_NOTIMPL;
708 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
710 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
711 FIXME("(%p)->(%p)\n", This, p);
712 return E_NOTIMPL;
715 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
717 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
718 FIXME("(%p)->(%p)\n", This, p);
719 return E_NOTIMPL;
722 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
724 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
725 FIXME("(%p)->(%p)\n", This, p);
726 return E_NOTIMPL;
729 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
731 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
732 FIXME("(%p)->(%p)\n", This, p);
733 return E_NOTIMPL;
736 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
738 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
739 FIXME("(%p)->(%p)\n", This, p);
740 return E_NOTIMPL;
743 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
745 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
746 FIXME("(%p)->(%p)\n", This, p);
747 return E_NOTIMPL;
750 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
752 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
753 FIXME("(%p)->(%p)\n", This, p);
754 return E_NOTIMPL;
757 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
759 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
760 FIXME("(%p)->(%p)\n", This, p);
761 return E_NOTIMPL;
764 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
766 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
767 FIXME("(%p)->(%p)\n", This, p);
768 return E_NOTIMPL;
771 #undef HTMLCURSTYLE_THIS
773 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
774 HTMLCurrentStyle_QueryInterface,
775 HTMLCurrentStyle_AddRef,
776 HTMLCurrentStyle_Release,
777 HTMLCurrentStyle_GetTypeInfoCount,
778 HTMLCurrentStyle_GetTypeInfo,
779 HTMLCurrentStyle_GetIDsOfNames,
780 HTMLCurrentStyle_Invoke,
781 HTMLCurrentStyle_get_position,
782 HTMLCurrentStyle_get_styleFloat,
783 HTMLCurrentStyle_get_color,
784 HTMLCurrentStyle_get_backgroundColor,
785 HTMLCurrentStyle_get_fontFamily,
786 HTMLCurrentStyle_get_fontStyle,
787 HTMLCurrentStyle_get_fontVariant,
788 HTMLCurrentStyle_get_fontWeight,
789 HTMLCurrentStyle_get_fontSize,
790 HTMLCurrentStyle_get_backgroundImage,
791 HTMLCurrentStyle_get_backgroundPositionX,
792 HTMLCurrentStyle_get_backgroundPositionY,
793 HTMLCurrentStyle_get_backgroundRepeat,
794 HTMLCurrentStyle_get_borderLeftColor,
795 HTMLCurrentStyle_get_borderTopColor,
796 HTMLCurrentStyle_get_borderRightColor,
797 HTMLCurrentStyle_get_borderBottomColor,
798 HTMLCurrentStyle_get_borderTopStyle,
799 HTMLCurrentStyle_get_borderRightStyle,
800 HTMLCurrentStyle_get_borderBottomStyle,
801 HTMLCurrentStyle_get_borderLeftStyle,
802 HTMLCurrentStyle_get_borderTopWidth,
803 HTMLCurrentStyle_get_borderRightWidth,
804 HTMLCurrentStyle_get_borderBottomWidth,
805 HTMLCurrentStyle_get_borderLeftWidth,
806 HTMLCurrentStyle_get_left,
807 HTMLCurrentStyle_get_top,
808 HTMLCurrentStyle_get_width,
809 HTMLCurrentStyle_get_height,
810 HTMLCurrentStyle_get_paddingLeft,
811 HTMLCurrentStyle_get_paddingTop,
812 HTMLCurrentStyle_get_paddingRight,
813 HTMLCurrentStyle_get_paddingBottom,
814 HTMLCurrentStyle_get_textAlign,
815 HTMLCurrentStyle_get_textDecoration,
816 HTMLCurrentStyle_get_display,
817 HTMLCurrentStyle_get_visibility,
818 HTMLCurrentStyle_get_zIndex,
819 HTMLCurrentStyle_get_letterSpacing,
820 HTMLCurrentStyle_get_lineHeight,
821 HTMLCurrentStyle_get_textIndent,
822 HTMLCurrentStyle_get_verticalAlign,
823 HTMLCurrentStyle_get_backgroundAttachment,
824 HTMLCurrentStyle_get_marginTop,
825 HTMLCurrentStyle_get_marginRight,
826 HTMLCurrentStyle_get_marginBottom,
827 HTMLCurrentStyle_get_marginLeft,
828 HTMLCurrentStyle_get_clear,
829 HTMLCurrentStyle_get_listStyleType,
830 HTMLCurrentStyle_get_listStylePosition,
831 HTMLCurrentStyle_get_listStyleImage,
832 HTMLCurrentStyle_get_clipTop,
833 HTMLCurrentStyle_get_clipRight,
834 HTMLCurrentStyle_get_clipBottom,
835 HTMLCurrentStyle_get_clipLeft,
836 HTMLCurrentStyle_get_overflow,
837 HTMLCurrentStyle_get_pageBreakBefore,
838 HTMLCurrentStyle_get_pageBreakAfter,
839 HTMLCurrentStyle_get_cursor,
840 HTMLCurrentStyle_get_tableLayout,
841 HTMLCurrentStyle_get_borderCollapse,
842 HTMLCurrentStyle_get_direction,
843 HTMLCurrentStyle_get_behavior,
844 HTMLCurrentStyle_getAttribute,
845 HTMLCurrentStyle_get_unicodeBidi,
846 HTMLCurrentStyle_get_right,
847 HTMLCurrentStyle_get_bottom,
848 HTMLCurrentStyle_get_imeMode,
849 HTMLCurrentStyle_get_rubyAlign,
850 HTMLCurrentStyle_get_rubyPosition,
851 HTMLCurrentStyle_get_rubyOverhang,
852 HTMLCurrentStyle_get_textAutospace,
853 HTMLCurrentStyle_get_lineBreak,
854 HTMLCurrentStyle_get_wordBreak,
855 HTMLCurrentStyle_get_textJustify,
856 HTMLCurrentStyle_get_textJustifyTrim,
857 HTMLCurrentStyle_get_textKashida,
858 HTMLCurrentStyle_get_blockDirection,
859 HTMLCurrentStyle_get_layoutGridChar,
860 HTMLCurrentStyle_get_layoutGridLine,
861 HTMLCurrentStyle_get_layoutGridMode,
862 HTMLCurrentStyle_get_layoutGridType,
863 HTMLCurrentStyle_get_borderStyle,
864 HTMLCurrentStyle_get_borderColor,
865 HTMLCurrentStyle_get_borderWidth,
866 HTMLCurrentStyle_get_padding,
867 HTMLCurrentStyle_get_margin,
868 HTMLCurrentStyle_get_accelerator,
869 HTMLCurrentStyle_get_overflowX,
870 HTMLCurrentStyle_get_overflowY,
871 HTMLCurrentStyle_get_textTransform
874 static const tid_t HTMLCurrentStyle_iface_tids[] = {
875 IHTMLCurrentStyle_tid,
878 static dispex_static_data_t HTMLCurrentStyle_dispex = {
879 NULL,
880 DispHTMLCurrentStyle_tid,
881 NULL,
882 HTMLCurrentStyle_iface_tids
885 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
887 nsIDOMCSSStyleDeclaration *nsstyle;
888 nsIDOMDocumentView *nsdocview;
889 nsIDOMAbstractView *nsview;
890 nsIDOMViewCSS *nsviewcss;
891 nsIDOMDocument *nsdoc;
892 nsAString nsempty_str;
893 HTMLCurrentStyle *ret;
894 nsresult nsres;
896 nsres = nsIWebNavigation_GetDocument(elem->node.doc->nscontainer->navigation, &nsdoc);
897 if(NS_FAILED(nsres)) {
898 ERR("GetDocument failed: %08x\n", nsres);
899 return E_FAIL;
902 nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
903 nsIDOMDocument_Release(nsdoc);
904 if(NS_FAILED(nsres)) {
905 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
906 return E_FAIL;
909 nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
910 nsIDOMDocumentView_Release(nsdocview);
911 if(NS_FAILED(nsres)) {
912 ERR("GetDefaultView failed: %08x\n", nsres);
913 return E_FAIL;
916 nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
917 nsIDOMAbstractView_Release(nsview);
918 if(NS_FAILED(nsres)) {
919 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
920 return E_FAIL;
923 nsAString_Init(&nsempty_str, NULL);
924 nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
925 nsIDOMViewCSS_Release(nsviewcss);
926 nsAString_Finish(&nsempty_str);
927 if(NS_FAILED(nsres)) {
928 ERR("GetComputedStyle failed: %08x\n", nsres);
929 return E_FAIL;
932 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
933 if(!ret) {
934 nsIDOMCSSStyleDeclaration_Release(nsstyle);
935 return E_OUTOFMEMORY;
938 ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
939 ret->ref = 1;
940 ret->nsstyle = nsstyle;
942 init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex);
944 *p = HTMLCURSTYLE(ret);
945 return S_OK;