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 #ifndef mozilla_dom_SVGAngle_h
8 #define mozilla_dom_SVGAngle_h
10 #include "nsWrapperCache.h"
11 #include "nsSVGElement.h"
12 #include "mozilla/Attributes.h"
19 class SVGAngle final
: public nsWrapperCache
28 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAngle
)
29 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAngle
)
31 SVGAngle(nsSVGAngle
* aVal
, nsSVGElement
*aSVGElement
, AngleType aType
)
32 : mVal(aVal
), mSVGElement(aSVGElement
), mType(aType
)
37 nsSVGElement
* GetParentObject() { return mSVGElement
; }
38 virtual JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
39 uint16_t UnitType() const;
41 void GetValueAsString(nsAString
& aValue
);
42 void SetValue(float aValue
, ErrorResult
& rv
);
43 float ValueInSpecifiedUnits() const;
44 void SetValueInSpecifiedUnits(float aValue
, ErrorResult
& rv
);
45 void SetValueAsString(const nsAString
& aValue
, ErrorResult
& rv
);
46 void NewValueSpecifiedUnits(uint16_t unitType
, float value
, ErrorResult
& rv
);
47 void ConvertToSpecifiedUnits(uint16_t unitType
, ErrorResult
& rv
);
52 nsSVGAngle
* mVal
; // if mType is CreatedValue, we own the angle. Otherwise, the element does.
53 RefPtr
<nsSVGElement
> mSVGElement
;
60 #endif // mozilla_dom_SVGAngle_h