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 NSSVGTSPANFRAME_H
7 #define NSSVGTSPANFRAME_H
9 #include "mozilla/Attributes.h"
10 #include "gfxMatrix.h"
12 #include "nsISVGGlyphFragmentNode.h"
13 #include "nsLiteralString.h"
14 #include "nsQueryFrame.h"
15 #include "nsSVGTextContainerFrame.h"
22 class nsSVGGlyphFrame
;
28 typedef nsSVGTextContainerFrame nsSVGTSpanFrameBase
;
30 class nsSVGTSpanFrame
: public nsSVGTSpanFrameBase
,
31 public nsISVGGlyphFragmentNode
34 NS_NewSVGTSpanFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
36 nsSVGTSpanFrame(nsStyleContext
* aContext
) :
37 nsSVGTSpanFrameBase(aContext
) {}
41 NS_DECL_FRAMEARENA_HELPERS
45 virtual void Init(nsIContent
* aContent
,
47 nsIFrame
* aPrevInFlow
) MOZ_OVERRIDE
;
50 NS_IMETHOD
AttributeChanged(int32_t aNameSpaceID
,
55 * Get the "type" of the frame
57 * @see nsGkAtoms::svgTSpanFrame
59 virtual nsIAtom
* GetType() const;
62 NS_IMETHOD
GetFrameName(nsAString
& aResult
) const
64 return MakeFrameName(NS_LITERAL_STRING("SVGTSpan"), aResult
);
67 // nsSVGContainerFrame methods:
68 virtual gfxMatrix
GetCanvasTM(uint32_t aFor
);
70 // nsISVGGlyphFragmentNode interface:
71 virtual uint32_t GetNumberOfChars();
72 virtual float GetComputedTextLength() MOZ_OVERRIDE
;
73 virtual float GetSubStringLength(uint32_t charnum
, uint32_t fragmentChars
) MOZ_OVERRIDE
;
74 virtual int32_t GetCharNumAtPosition(mozilla::nsISVGPoint
*point
) MOZ_OVERRIDE
;
75 NS_IMETHOD_(nsSVGGlyphFrame
*) GetFirstGlyphFrame() MOZ_OVERRIDE
;
76 NS_IMETHOD_(nsSVGGlyphFrame
*) GetNextGlyphFrame() MOZ_OVERRIDE
;
77 NS_IMETHOD_(void) SetWhitespaceCompression(bool aCompressWhitespace
) MOZ_OVERRIDE
;