1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef NSSVGTEXTPATHFRAME_H
7 #define NSSVGTEXTPATHFRAME_H
12 #include "nsISVGChildFrame.h"
13 #include "nsLiteralString.h"
14 #include "nsQueryFrame.h"
15 #include "nsSVGTSpanFrame.h"
17 class gfxFlattenedPath
;
28 typedef nsSVGTSpanFrame nsSVGTextPathFrameBase
;
30 class nsSVGTextPathFrame
: public nsSVGTextPathFrameBase
32 typedef mozilla::SVGNumberList SVGNumberList
;
35 NS_NewSVGTextPathFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
37 nsSVGTextPathFrame(nsStyleContext
* aContext
) : nsSVGTextPathFrameBase(aContext
) {}
40 NS_DECL_FRAMEARENA_HELPERS
44 virtual void Init(nsIContent
* aContent
,
46 nsIFrame
* aPrevInFlow
) MOZ_OVERRIDE
;
49 NS_IMETHOD
AttributeChanged(int32_t aNameSpaceID
,
53 * Get the "type" of the frame
55 * @see nsGkAtoms::svgGFrame
57 virtual nsIAtom
* GetType() const;
60 NS_IMETHOD
GetFrameName(nsAString
& aResult
) const
62 return MakeFrameName(NS_LITERAL_STRING("SVGTextPath"), aResult
);
66 // nsSVGTextPathFrame methods:
67 already_AddRefed
<gfxFlattenedPath
> GetFlattenedPath();
68 nsIFrame
*GetPathFrame();
71 * Gets the scale by which offsets along this textPath must be scaled. This
72 * scaling is due to the user provided 'pathLength' attribute on the <path>
73 * element, which is a user provided estimate of the path length.
75 gfxFloat
GetOffsetScale();
78 * Gets the offset from the start of the path at which the first character
79 * should be positioned. The value returned already takes GetOffsetScale
82 gfxFloat
GetStartOffset();
86 virtual void GetXY(SVGUserUnitList
*aX
, SVGUserUnitList
*aY
);
87 virtual void GetDxDy(SVGUserUnitList
*aDx
, SVGUserUnitList
*aDy
);
88 virtual const SVGNumberList
*GetRotate();