2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef NSSVGTSPANFRAME_H
|
|
|
|
#define NSSVGTSPANFRAME_H
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2009-04-28 21:31:34 -07:00
|
|
|
#include "gfxMatrix.h"
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsISVGGlyphFragmentNode.h"
|
|
|
|
#include "nsLiteralString.h"
|
|
|
|
#include "nsQueryFrame.h"
|
|
|
|
#include "nsSVGTextContainerFrame.h"
|
|
|
|
|
|
|
|
class nsIAtom;
|
|
|
|
class nsIContent;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresShell;
|
|
|
|
class nsStyleContext;
|
|
|
|
class nsSVGGlyphFrame;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-12-22 20:54:25 -08:00
|
|
|
namespace mozilla {
|
2013-01-06 06:14:43 -08:00
|
|
|
class nsISVGPoint;
|
2012-12-22 20:54:25 -08:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef nsSVGTextContainerFrame nsSVGTSpanFrameBase;
|
|
|
|
|
|
|
|
class nsSVGTSpanFrame : public nsSVGTSpanFrameBase,
|
|
|
|
public nsISVGGlyphFragmentNode
|
|
|
|
{
|
|
|
|
friend nsIFrame*
|
2009-01-19 10:31:34 -08:00
|
|
|
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
nsSVGTSpanFrame(nsStyleContext* aContext) :
|
2010-04-13 01:58:09 -07:00
|
|
|
nsSVGTSpanFrameBase(aContext) {}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-09 08:35:24 -08:00
|
|
|
public:
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2009-01-12 11:20:59 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// nsIFrame:
|
2009-01-19 10:31:34 -08:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
#endif
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t aModType);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsGkAtoms::svgTSpanFrame
|
|
|
|
*/
|
|
|
|
virtual nsIAtom* GetType() const;
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGTSpan"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
// nsSVGContainerFrame methods:
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual gfxMatrix GetCanvasTM(uint32_t aFor);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// nsISVGGlyphFragmentNode interface:
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint32_t GetNumberOfChars();
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual float GetComputedTextLength() MOZ_OVERRIDE;
|
|
|
|
virtual float GetSubStringLength(uint32_t charnum, uint32_t fragmentChars) MOZ_OVERRIDE;
|
2013-01-06 06:14:43 -08:00
|
|
|
virtual int32_t GetCharNumAtPosition(mozilla::nsISVGPoint *point) MOZ_OVERRIDE;
|
2012-09-14 09:10:08 -07:00
|
|
|
NS_IMETHOD_(nsSVGGlyphFrame *) GetFirstGlyphFrame() MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(nsSVGGlyphFrame *) GetNextGlyphFrame() MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(void) SetWhitespaceCompression(bool aCompressWhitespace) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|