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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_SVGTextContentElement_h
|
|
|
|
#define mozilla_dom_SVGTextContentElement_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2013-07-07 11:27:51 +04:00
|
|
|
#include "mozilla/dom/SVGAnimatedEnumeration.h"
|
|
|
|
#include "nsSVGEnum.h"
|
|
|
|
#include "nsSVGLength2.h"
|
|
|
|
|
|
|
|
static const unsigned short SVG_LENGTHADJUST_UNKNOWN = 0;
|
|
|
|
static const unsigned short SVG_LENGTHADJUST_SPACING = 1;
|
|
|
|
static const unsigned short SVG_LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
2013-12-20 20:38:51 +04:00
|
|
|
class SVGTextFrame;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
class nsISVGPoint;
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-26 19:53:13 +04:00
|
|
|
class SVGIRect;
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
typedef SVGGraphicsElement SVGTextContentElementBase;
|
|
|
|
|
|
|
|
class SVGTextContentElement : public SVGTextContentElementBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using FragmentOrElement::TextLength;
|
|
|
|
|
|
|
|
// WebIDL
|
2013-07-07 11:27:51 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength> TextLength();
|
|
|
|
already_AddRefed<SVGAnimatedEnumeration> LengthAdjust();
|
2013-01-06 18:14:43 +04:00
|
|
|
int32_t GetNumberOfChars();
|
|
|
|
float GetComputedTextLength();
|
2013-04-01 13:43:38 +04:00
|
|
|
void SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
|
2013-01-06 18:14:43 +04:00
|
|
|
float GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
|
|
|
|
already_AddRefed<nsISVGPoint> GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv);
|
|
|
|
already_AddRefed<nsISVGPoint> GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv);
|
2013-03-26 19:53:13 +04:00
|
|
|
already_AddRefed<SVGIRect> GetExtentOfChar(uint32_t charnum, ErrorResult& rv);
|
2013-01-06 18:14:43 +04:00
|
|
|
float GetRotationOfChar(uint32_t charnum, ErrorResult& rv);
|
|
|
|
int32_t GetCharNumAtPosition(nsISVGPoint& point);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGTextContentElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-01-06 18:14:43 +04:00
|
|
|
: SVGTextContentElementBase(aNodeInfo)
|
|
|
|
{}
|
|
|
|
|
2013-12-20 20:38:51 +04:00
|
|
|
SVGTextFrame* GetSVGTextFrame();
|
2017-01-17 08:45:43 +03:00
|
|
|
SVGTextFrame* GetSVGTextFrameForNonLayoutDependentQuery();
|
|
|
|
mozilla::Maybe<int32_t> GetNonLayoutDependentNumberOfChars();
|
2013-07-07 11:27:51 +04:00
|
|
|
|
|
|
|
enum { LENGTHADJUST };
|
2013-07-24 04:01:35 +04:00
|
|
|
virtual nsSVGEnum* EnumAttributes() = 0;
|
2013-07-07 11:27:51 +04:00
|
|
|
static nsSVGEnumMapping sLengthAdjustMap[];
|
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
|
|
|
|
enum { TEXTLENGTH };
|
2013-07-24 04:01:35 +04:00
|
|
|
virtual nsSVGLength2* 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
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGTextContentElement_h
|