Bug 1700051: part 46) Const-qualify `mozInlineSpellStatus::mAnchorRange`. r=smaug
[gecko.git] / dom / svg / SVGTextContentElement.h
blob697c016a41ecd6ab843cece1c3bd791ad8c88e1e
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 DOM_SVG_SVGTEXTCONTENTELEMENT_H_
8 #define DOM_SVG_SVGTEXTCONTENTELEMENT_H_
10 #include "mozilla/dom/SVGGraphicsElement.h"
11 #include "SVGAnimatedEnumeration.h"
12 #include "SVGAnimatedLength.h"
14 namespace mozilla {
16 class SVGTextFrame;
18 namespace dom {
20 struct DOMPointInit;
21 class DOMSVGAnimatedEnumeration;
22 class DOMSVGPoint;
23 class SVGRect;
25 using SVGTextContentElementBase = SVGGraphicsElement;
27 class SVGTextContentElement : public SVGTextContentElementBase {
28 friend class mozilla::SVGTextFrame;
30 public:
31 using FragmentOrElement::TextLength;
33 // WebIDL
34 already_AddRefed<DOMSVGAnimatedLength> TextLength();
35 already_AddRefed<DOMSVGAnimatedEnumeration> LengthAdjust();
36 MOZ_CAN_RUN_SCRIPT int32_t GetNumberOfChars();
37 MOZ_CAN_RUN_SCRIPT float GetComputedTextLength();
38 MOZ_CAN_RUN_SCRIPT
39 void SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
40 MOZ_CAN_RUN_SCRIPT
41 float GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
42 MOZ_CAN_RUN_SCRIPT
43 already_AddRefed<DOMSVGPoint> GetStartPositionOfChar(uint32_t charnum,
44 ErrorResult& rv);
45 MOZ_CAN_RUN_SCRIPT
46 already_AddRefed<DOMSVGPoint> GetEndPositionOfChar(uint32_t charnum,
47 ErrorResult& rv);
48 MOZ_CAN_RUN_SCRIPT
49 already_AddRefed<SVGRect> GetExtentOfChar(uint32_t charnum, ErrorResult& rv);
50 MOZ_CAN_RUN_SCRIPT float GetRotationOfChar(uint32_t charnum, ErrorResult& rv);
51 MOZ_CAN_RUN_SCRIPT int32_t GetCharNumAtPosition(const DOMPointInit& aPoint);
53 protected:
54 explicit SVGTextContentElement(
55 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
56 : SVGTextContentElementBase(std::move(aNodeInfo)) {}
58 MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrame();
59 MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrameForNonLayoutDependentQuery();
60 MOZ_CAN_RUN_SCRIPT mozilla::Maybe<int32_t>
61 GetNonLayoutDependentNumberOfChars();
63 enum { LENGTHADJUST };
64 virtual SVGAnimatedEnumeration* EnumAttributes() = 0;
65 static SVGEnumMapping sLengthAdjustMap[];
66 static EnumInfo sEnumInfo[1];
68 enum { TEXTLENGTH };
69 virtual SVGAnimatedLength* LengthAttributes() = 0;
70 static LengthInfo sLengthInfo[1];
73 } // namespace dom
74 } // namespace mozilla
76 #endif // DOM_SVG_SVGTEXTCONTENTELEMENT_H_