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 NSSVGTEXTPATHFRAME_H
|
|
|
|
#define NSSVGTEXTPATHFRAME_H
|
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "gfxTypes.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsISVGChildFrame.h"
|
|
|
|
#include "nsLiteralString.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGTSpanFrame.h"
|
2012-03-20 05:15:55 -07:00
|
|
|
|
|
|
|
class gfxFlattenedPath;
|
|
|
|
class nsIAtom;
|
|
|
|
class nsIContent;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresShell;
|
|
|
|
class nsStyleContext;
|
2010-12-03 08:40:23 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
class SVGNumberList;
|
|
|
|
}
|
2007-04-26 08:46:29 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef nsSVGTSpanFrame nsSVGTextPathFrameBase;
|
|
|
|
|
2007-04-26 08:46:29 -07:00
|
|
|
class nsSVGTextPathFrame : public nsSVGTextPathFrameBase
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-03-20 05:15:55 -07:00
|
|
|
typedef mozilla::SVGNumberList SVGNumberList;
|
|
|
|
|
2007-07-25 02:16:02 -07:00
|
|
|
friend nsIFrame*
|
2009-01-19 10:31:34 -08:00
|
|
|
NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-07-25 02:16:02 -07:00
|
|
|
protected:
|
2007-03-22 10:30:00 -07:00
|
|
|
nsSVGTextPathFrame(nsStyleContext* aContext) : nsSVGTextPathFrameBase(aContext) {}
|
|
|
|
|
2007-07-25 02:16:02 -07:00
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
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::svgGFrame
|
|
|
|
*/
|
|
|
|
virtual nsIAtom* GetType() const;
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGTextPath"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsSVGTextPathFrame methods:
|
2007-04-16 13:57:09 -07:00
|
|
|
already_AddRefed<gfxFlattenedPath> GetFlattenedPath();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame *GetPathFrame();
|
|
|
|
|
2011-11-15 05:11:43 -08:00
|
|
|
/**
|
|
|
|
* Gets the scale by which offsets along this textPath must be scaled. This
|
|
|
|
* scaling is due to the user provided 'pathLength' attribute on the <path>
|
|
|
|
* element, which is a user provided estimate of the path length.
|
|
|
|
*/
|
|
|
|
gfxFloat GetOffsetScale();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the offset from the start of the path at which the first character
|
|
|
|
* should be positioned. The value returned already takes GetOffsetScale
|
|
|
|
* into account.
|
|
|
|
*/
|
2007-12-03 22:51:36 -08:00
|
|
|
gfxFloat GetStartOffset();
|
2011-11-15 05:11:43 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
|
2010-12-03 08:40:23 -08:00
|
|
|
virtual void GetXY(SVGUserUnitList *aX, SVGUserUnitList *aY);
|
|
|
|
virtual void GetDxDy(SVGUserUnitList *aDx, SVGUserUnitList *aDy);
|
|
|
|
virtual const SVGNumberList *GetRotate();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|