2013-01-06 14:14:43 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 07:27:51 +00: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 14:14:43 +00:00
|
|
|
|
2013-12-20 16:38:51 +00:00
|
|
|
class SVGTextFrame;
|
2013-01-06 14:14:43 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
class nsISVGPoint;
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-26 15:53:13 +00:00
|
|
|
class SVGIRect;
|
|
|
|
|
2013-01-06 14:14:43 +00:00
|
|
|
typedef SVGGraphicsElement SVGTextContentElementBase;
|
|
|
|
|
|
|
|
class SVGTextContentElement : public SVGTextContentElementBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using FragmentOrElement::TextLength;
|
|
|
|
|
|
|
|
// WebIDL
|
2013-07-07 07:27:51 +00:00
|
|
|
already_AddRefed<SVGAnimatedLength> TextLength();
|
|
|
|
already_AddRefed<SVGAnimatedEnumeration> LengthAdjust();
|
2013-01-06 14:14:43 +00:00
|
|
|
int32_t GetNumberOfChars();
|
|
|
|
float GetComputedTextLength();
|
2013-04-01 09:43:38 +00:00
|
|
|
void SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv);
|
2013-01-06 14:14:43 +00: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 15:53:13 +00:00
|
|
|
already_AddRefed<SVGIRect> GetExtentOfChar(uint32_t charnum, ErrorResult& rv);
|
2013-01-06 14:14:43 +00:00
|
|
|
float GetRotationOfChar(uint32_t charnum, ErrorResult& rv);
|
|
|
|
int32_t GetCharNumAtPosition(nsISVGPoint& point);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGTextContentElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-01-06 14:14:43 +00:00
|
|
|
: SVGTextContentElementBase(aNodeInfo)
|
|
|
|
{}
|
|
|
|
|
2013-12-20 16:38:51 +00:00
|
|
|
SVGTextFrame* GetSVGTextFrame();
|
2013-07-07 07:27:51 +00:00
|
|
|
|
|
|
|
enum { LENGTHADJUST };
|
2013-07-24 00:01:35 +00:00
|
|
|
virtual nsSVGEnum* EnumAttributes() = 0;
|
2013-07-07 07:27:51 +00:00
|
|
|
static nsSVGEnumMapping sLengthAdjustMap[];
|
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
|
|
|
|
enum { TEXTLENGTH };
|
2013-07-24 00:01:35 +00:00
|
|
|
virtual nsSVGLength2* LengthAttributes() = 0;
|
2013-07-07 07:27:51 +00:00
|
|
|
static LengthInfo sLengthInfo[1];
|
2013-01-06 14:14:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGTextContentElement_h
|