2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-01-06 18:14:43 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#ifndef DOM_SVG_SVGTEXTCONTENTELEMENT_H_
|
|
|
|
#define DOM_SVG_SVGTEXTCONTENTELEMENT_H_
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedEnumeration.h"
|
2019-04-09 23:04:33 +03:00
|
|
|
#include "SVGAnimatedLength.h"
|
2013-07-07 11:27:51 +04:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
2020-06-24 01:59:34 +03:00
|
|
|
class SVGTextFrame;
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
namespace dom {
|
|
|
|
|
2019-06-16 12:12:40 +03:00
|
|
|
struct DOMPointInit;
|
2020-09-10 19:38:31 +03:00
|
|
|
class DOMSVGAnimatedEnumeration;
|
2020-08-25 17:38:32 +03:00
|
|
|
class DOMSVGPoint;
|
2019-06-20 17:03:54 +03:00
|
|
|
class SVGRect;
|
2013-03-26 19:53:13 +04:00
|
|
|
|
2020-07-15 13:37:55 +03:00
|
|
|
using SVGTextContentElementBase = SVGGraphicsElement;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
class SVGTextContentElement : public SVGTextContentElementBase {
|
2020-06-24 01:59:34 +03:00
|
|
|
friend class mozilla::SVGTextFrame;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
public:
|
|
|
|
using FragmentOrElement::TextLength;
|
|
|
|
|
|
|
|
// WebIDL
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedLength> TextLength();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> LengthAdjust();
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT int32_t GetNumberOfChars();
|
|
|
|
MOZ_CAN_RUN_SCRIPT float GetComputedTextLength();
|
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2013-04-01 13:43:38 +04:00
|
|
|
void SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2013-01-06 18:14:43 +04:00
|
|
|
float GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2020-08-25 17:38:32 +03:00
|
|
|
already_AddRefed<DOMSVGPoint> GetStartPositionOfChar(uint32_t charnum,
|
2013-01-06 18:14:43 +04:00
|
|
|
ErrorResult& rv);
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2020-08-25 17:38:32 +03:00
|
|
|
already_AddRefed<DOMSVGPoint> GetEndPositionOfChar(uint32_t charnum,
|
2013-01-06 18:14:43 +04:00
|
|
|
ErrorResult& rv);
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2019-06-20 17:03:54 +03:00
|
|
|
already_AddRefed<SVGRect> GetExtentOfChar(uint32_t charnum, ErrorResult& rv);
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT float GetRotationOfChar(uint32_t charnum, ErrorResult& rv);
|
2019-06-16 12:12:40 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT int32_t GetCharNumAtPosition(const DOMPointInit& aPoint);
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
protected:
|
2018-09-21 23:45:49 +03:00
|
|
|
explicit SVGTextContentElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
|
|
|
|
: SVGTextContentElementBase(std::move(aNodeInfo)) {}
|
2013-01-06 18:14:43 +04:00
|
|
|
|
2018-01-12 07:01:20 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrame();
|
|
|
|
MOZ_CAN_RUN_SCRIPT SVGTextFrame* GetSVGTextFrameForNonLayoutDependentQuery();
|
|
|
|
MOZ_CAN_RUN_SCRIPT mozilla::Maybe<int32_t>
|
|
|
|
GetNonLayoutDependentNumberOfChars();
|
2013-07-07 11:27:51 +04:00
|
|
|
|
|
|
|
enum { LENGTHADJUST };
|
2019-04-04 20:40:56 +03:00
|
|
|
virtual SVGAnimatedEnumeration* EnumAttributes() = 0;
|
2019-01-02 21:24:11 +03:00
|
|
|
static SVGEnumMapping sLengthAdjustMap[];
|
2013-07-07 11:27:51 +04:00
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
|
|
|
|
enum { TEXTLENGTH };
|
2019-04-09 23:04:33 +03:00
|
|
|
virtual SVGAnimatedLength* LengthAttributes() = 0;
|
2013-07-07 11:27:51 +04:00
|
|
|
static LengthInfo sLengthInfo[1];
|
2013-01-06 18:14:43 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#endif // DOM_SVG_SVGTEXTCONTENTELEMENT_H_
|