Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
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
18 {
19 public:
20 nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
21 nsROCSSPrimitiveValue* aGreen,
22 nsROCSSPrimitiveValue* aBlue,
23 nsROCSSPrimitiveValue* aAlpha,
24 bool aHasAlpha);
26 virtual ~nsDOMCSSRGBColor(void);
28 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMCSSRGBColor)
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMCSSRGBColor)
32 bool HasAlpha() const { return mHasAlpha; }
34 // RGBColor webidl interface
35 nsROCSSPrimitiveValue* Red() const
36 {
37 return mRed;
38 }
39 nsROCSSPrimitiveValue* Green() const
40 {
41 return mGreen;
42 }
43 nsROCSSPrimitiveValue* Blue() const
44 {
45 return mBlue;
46 }
47 nsROCSSPrimitiveValue* Alpha() const
48 {
49 return mAlpha;
50 }
52 nsISupports* GetParentObject() const
53 {
54 return nullptr;
55 }
57 virtual JSObject *WrapObject(JSContext *cx)
58 MOZ_OVERRIDE MOZ_FINAL;
60 private:
61 nsRefPtr<nsROCSSPrimitiveValue> mRed;
62 nsRefPtr<nsROCSSPrimitiveValue> mGreen;
63 nsRefPtr<nsROCSSPrimitiveValue> mBlue;
64 nsRefPtr<nsROCSSPrimitiveValue> mAlpha;
65 bool mHasAlpha;
66 };
68 #endif // nsDOMCSSRGBColor_h__