1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* DOM object representing color values in DOM computed style */
8 #ifndef nsDOMCSSRGBColor_h__
9 #define nsDOMCSSRGBColor_h__
11 #include "mozilla/Attributes.h"
12 #include "nsAutoPtr.h"
13 #include "nsWrapperCache.h"
15 class nsROCSSPrimitiveValue
;
17 class nsDOMCSSRGBColor
: public nsWrapperCache
20 nsDOMCSSRGBColor(nsROCSSPrimitiveValue
* aRed
,
21 nsROCSSPrimitiveValue
* aGreen
,
22 nsROCSSPrimitiveValue
* aBlue
,
23 nsROCSSPrimitiveValue
* aAlpha
,
26 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMCSSRGBColor
)
28 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMCSSRGBColor
)
30 bool HasAlpha() const { return mHasAlpha
; }
32 // RGBColor webidl interface
33 nsROCSSPrimitiveValue
* Red() const
37 nsROCSSPrimitiveValue
* Green() const
41 nsROCSSPrimitiveValue
* Blue() const
45 nsROCSSPrimitiveValue
* Alpha() const
50 nsISupports
* GetParentObject() const
55 virtual JSObject
*WrapObject(JSContext
*cx
)
56 MOZ_OVERRIDE MOZ_FINAL
;
59 virtual ~nsDOMCSSRGBColor(void);
61 nsRefPtr
<nsROCSSPrimitiveValue
> mRed
;
62 nsRefPtr
<nsROCSSPrimitiveValue
> mGreen
;
63 nsRefPtr
<nsROCSSPrimitiveValue
> mBlue
;
64 nsRefPtr
<nsROCSSPrimitiveValue
> mAlpha
;
68 #endif // nsDOMCSSRGBColor_h__