Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/svg/SVGAngle.h
Line
Count
Source (jump to first uncovered line)
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/. */
6
7
#ifndef mozilla_dom_SVGAngle_h
8
#define mozilla_dom_SVGAngle_h
9
10
#include "nsWrapperCache.h"
11
#include "nsSVGElement.h"
12
#include "mozilla/Attributes.h"
13
14
class nsSVGAngle;
15
16
namespace mozilla {
17
namespace dom {
18
19
class SVGAngle final : public nsWrapperCache
20
{
21
public:
22
  typedef enum {
23
    BaseValue,
24
    AnimValue,
25
    CreatedValue
26
  } AngleType;
27
28
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAngle)
29
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAngle)
30
31
  SVGAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement, AngleType aType)
32
    : mVal(aVal), mSVGElement(aSVGElement), mType(aType)
33
0
  {
34
0
  }
35
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);
48
49
protected:
50
  ~SVGAngle();
51
52
  nsSVGAngle* mVal; // if mType is CreatedValue, we own the angle.  Otherwise, the element does.
53
  RefPtr<nsSVGElement> mSVGElement;
54
  AngleType mType;
55
};
56
57
} //namespace dom
58
} //namespace mozilla
59
60
#endif // mozilla_dom_SVGAngle_h