Bug 1444460 [wpt PR 9948] - gyroscope: Rename LocalCoordinateSystem to GyroscopeLocal...
[gecko.git] / dom / svg / SVGAngle.h
blobd91fd6c57b55c977f1c4c251278e9aec44831dcd
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"
14 class nsSVGAngle;
16 namespace mozilla {
17 namespace dom {
19 class SVGAngle final : public nsWrapperCache
21 public:
22 typedef enum {
23 BaseValue,
24 AnimValue,
25 CreatedValue
26 } AngleType;
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)
36 // WebIDL
37 nsSVGElement* GetParentObject() { return mSVGElement; }
38 virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
39 uint16_t UnitType() const;
40 float Value() 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);
49 protected:
50 ~SVGAngle();
52 nsSVGAngle* mVal; // if mType is CreatedValue, we own the angle. Otherwise, the element does.
53 RefPtr<nsSVGElement> mSVGElement;
54 AngleType mType;
57 } //namespace dom
58 } //namespace mozilla
60 #endif // mozilla_dom_SVGAngle_h