1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* DOM object representing values in DOM computed style */
9 #ifndef nsROCSSPrimitiveValue_h___
10 #define nsROCSSPrimitiveValue_h___
19 * Read-only CSS primitive value - a DOM object representing values in DOM
22 class nsROCSSPrimitiveValue final
: public mozilla::dom::CSSValue
{
50 void GetCssText(nsString
& aText
, mozilla::ErrorResult
& aRv
) final
;
51 uint16_t CssValueType() const final
;
54 uint16_t PrimitiveType();
56 // nsROCSSPrimitiveValue
57 nsROCSSPrimitiveValue();
59 void SetNumber(float aValue
);
60 void SetNumber(int32_t aValue
);
61 void SetNumber(uint32_t aValue
);
62 void SetPercent(float aValue
);
63 void SetDegree(float aValue
);
64 void SetPixels(float aValue
);
65 void SetAppUnits(nscoord aValue
);
66 void SetAppUnits(float aValue
);
67 void SetString(const nsACString
& aString
);
68 void SetString(const nsAString
& aString
);
71 void SetString(const char (&aString
)[N
]) {
72 SetString(nsLiteralCString(aString
));
75 void SetURI(nsIURI
* aURI
);
76 void SetTime(float aValue
);
79 virtual ~nsROCSSPrimitiveValue();
89 nsIURI
* MOZ_OWNING_REF mURI
;
93 inline nsROCSSPrimitiveValue
* mozilla::dom::CSSValue::AsPrimitiveValue() {
94 return CssValueType() == mozilla::dom::CSSValue::CSS_PRIMITIVE_VALUE
95 ? static_cast<nsROCSSPrimitiveValue
*>(this)
99 #endif /* nsROCSSPrimitiveValue_h___ */