Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/SVGTextContentElement.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_SVGTextContentElement_h
8
#define mozilla_dom_SVGTextContentElement_h
9
10
#include "mozilla/dom/SVGGraphicsElement.h"
11
#include "mozilla/dom/SVGAnimatedEnumeration.h"
12
#include "nsSVGEnum.h"
13
#include "nsSVGLength2.h"
14
15
class SVGTextFrame;
16
17
namespace mozilla {
18
class nsISVGPoint;
19
20
namespace dom {
21
22
class SVGIRect;
23
24
typedef SVGGraphicsElement SVGTextContentElementBase;
25
26
class SVGTextContentElement : public SVGTextContentElementBase
27
{
28
  friend class ::SVGTextFrame;
29
public:
30
  using FragmentOrElement::TextLength;
31
32
  // WebIDL
33
  already_AddRefed<SVGAnimatedLength> TextLength();
34
  already_AddRefed<SVGAnimatedEnumeration> LengthAdjust();
35
  MOZ_CAN_RUN_SCRIPT int32_t GetNumberOfChars();
36
  MOZ_CAN_RUN_SCRIPT float GetComputedTextLength();
37
  MOZ_CAN_RUN_SCRIPT
38
  void SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
39
  MOZ_CAN_RUN_SCRIPT
40
  float GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
41
  MOZ_CAN_RUN_SCRIPT
42
  already_AddRefed<nsISVGPoint> GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv);
43
  MOZ_CAN_RUN_SCRIPT
44
  already_AddRefed<nsISVGPoint> GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv);
45
  MOZ_CAN_RUN_SCRIPT
46
  already_AddRefed<SVGIRect> GetExtentOfChar(uint32_t charnum, ErrorResult& rv);
47
  MOZ_CAN_RUN_SCRIPT float GetRotationOfChar(uint32_t charnum, ErrorResult& rv);
48
  MOZ_CAN_RUN_SCRIPT int32_t GetCharNumAtPosition(nsISVGPoint& point);
49
50
protected:
51
52
  explicit SVGTextContentElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
53
    : SVGTextContentElementBase(std::move(aNodeInfo))
54
0
  {}
55
56
  MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrame();
57
  MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrameForNonLayoutDependentQuery();
58
  MOZ_CAN_RUN_SCRIPT mozilla::Maybe<int32_t> GetNonLayoutDependentNumberOfChars();
59
60
  enum { LENGTHADJUST };
61
  virtual nsSVGEnum* EnumAttributes() = 0;
62
  static nsSVGEnumMapping sLengthAdjustMap[];
63
  static EnumInfo sEnumInfo[1];
64
65
  enum { TEXTLENGTH };
66
  virtual nsSVGLength2* LengthAttributes() = 0;
67
  static LengthInfo sLengthInfo[1];
68
};
69
70
} // namespace dom
71
} // namespace mozilla
72
73
#endif // mozilla_dom_SVGTextContentElement_h