2006-06-28 19:23:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
#ifndef NS_SVGTEXTCONTAINERFRAME_H
|
|
|
|
#define NS_SVGTEXTCONTAINERFRAME_H
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsISVGChildFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2006-06-28 19:23:40 +04:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "nsTArray.h"
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsFrameList;
|
2012-03-18 14:32:02 +04:00
|
|
|
class nsIDOMSVGRect;
|
2006-06-28 19:23:40 +04:00
|
|
|
class nsISVGGlyphFragmentNode;
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsStyleContext;
|
2011-05-07 21:08:41 +04:00
|
|
|
class nsSVGGlyphFrame;
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsSVGTextFrame;
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2012-12-23 08:54:25 +04:00
|
|
|
namespace mozilla {
|
2013-01-06 18:14:43 +04:00
|
|
|
class nsISVGPoint;
|
2012-12-23 08:54:25 +04:00
|
|
|
}
|
|
|
|
|
2009-05-29 14:15:40 +04:00
|
|
|
class nsSVGTextContainerFrame : public nsSVGDisplayContainerFrame
|
2006-06-28 19:23:40 +04:00
|
|
|
{
|
2011-05-03 11:45:30 +04:00
|
|
|
protected:
|
2006-06-28 19:23:40 +04:00
|
|
|
nsSVGTextContainerFrame(nsStyleContext* aContext) :
|
|
|
|
nsSVGDisplayContainerFrame(aContext) {}
|
|
|
|
|
2011-05-03 11:45:30 +04:00
|
|
|
public:
|
2008-04-08 16:51:19 +04:00
|
|
|
void NotifyGlyphMetricsChange();
|
2010-12-03 19:40:23 +03:00
|
|
|
virtual void GetXY(SVGUserUnitList *aX, SVGUserUnitList *aY);
|
|
|
|
virtual void GetDxDy(SVGUserUnitList *aDx, SVGUserUnitList *aDy);
|
|
|
|
virtual const SVGNumberList *GetRotate();
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsSVGTextContainerFrame)
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2009-01-12 22:20:59 +03:00
|
|
|
|
2006-11-14 03:48:33 +03:00
|
|
|
// nsIFrame
|
2011-08-25 00:54:30 +04:00
|
|
|
NS_IMETHOD InsertFrames(ChildListID aListID,
|
2007-08-03 12:39:12 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame *aOldFrame) MOZ_OVERRIDE;
|
2006-11-14 03:48:33 +03:00
|
|
|
|
2012-12-23 08:54:25 +04:00
|
|
|
NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
|
|
|
NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_IMETHOD GetExtentOfChar(uint32_t charnum, nsIDOMSVGRect **_retval);
|
|
|
|
NS_IMETHOD GetRotationOfChar(uint32_t charnum, float *_retval);
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Returns the number of characters in a string
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual uint32_t GetNumberOfChars();
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Determines the length of a string
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2009-05-29 14:15:40 +04:00
|
|
|
virtual float GetComputedTextLength();
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Determines the length of a substring
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual float GetSubStringLength(uint32_t charnum, uint32_t nchars);
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Get the character at the specified position
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2013-01-06 18:14:43 +04:00
|
|
|
virtual int32_t GetCharNumAtPosition(mozilla::nsISVGPoint *point);
|
2010-09-18 07:46:48 +04:00
|
|
|
void GetEffectiveXY(nsTArray<float> &aX, nsTArray<float> &aY);
|
|
|
|
void GetEffectiveDxDy(nsTArray<float> &aDx, nsTArray<float> &aDy);
|
|
|
|
void GetEffectiveRotate(nsTArray<float> &aRotate);
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2009-05-29 14:15:40 +04:00
|
|
|
protected:
|
2006-06-28 19:23:40 +04:00
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Returns the first child node for a frame
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2009-05-29 14:15:40 +04:00
|
|
|
nsISVGGlyphFragmentNode *
|
|
|
|
GetFirstGlyphFragmentChildNode();
|
2006-06-28 19:23:40 +04:00
|
|
|
|
|
|
|
/*
|
2009-05-29 14:15:40 +04:00
|
|
|
* Returns the next child node for a frame
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2009-05-29 14:15:40 +04:00
|
|
|
nsISVGGlyphFragmentNode *
|
|
|
|
GetNextGlyphFragmentChildNode(nsISVGGlyphFragmentNode *node);
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2010-09-18 07:46:48 +04:00
|
|
|
void CopyPositionList(nsTArray<float> *parentList,
|
2010-12-03 19:40:23 +03:00
|
|
|
SVGUserUnitList *selfList,
|
2010-09-18 07:46:48 +04:00
|
|
|
nsTArray<float> &dstList,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aOffset);
|
2010-09-18 07:46:48 +04:00
|
|
|
void CopyRotateList(nsTArray<float> *parentList,
|
2010-12-03 19:40:23 +03:00
|
|
|
const SVGNumberList *selfList,
|
2010-09-18 07:46:48 +04:00
|
|
|
nsTArray<float> &dstList,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aOffset);
|
|
|
|
uint32_t BuildPositionList(uint32_t aOffset, uint32_t aDepth);
|
2006-06-28 19:23:40 +04:00
|
|
|
|
2011-05-03 11:45:30 +04:00
|
|
|
void SetWhitespaceCompression();
|
2006-06-28 19:23:40 +04:00
|
|
|
private:
|
|
|
|
/*
|
2011-05-07 21:08:41 +04:00
|
|
|
* Returns the glyph frame containing a particular character
|
2006-06-28 19:23:40 +04:00
|
|
|
*/
|
2011-05-07 21:08:41 +04:00
|
|
|
static nsSVGGlyphFrame *
|
|
|
|
GetGlyphFrameAtCharNum(nsISVGGlyphFragmentNode* node,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t charnum,
|
|
|
|
uint32_t *offset);
|
2007-03-06 13:17:43 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns the text frame ancestor of this frame (or the frame itself
|
|
|
|
* if this is a text frame)
|
|
|
|
*/
|
|
|
|
nsSVGTextFrame * GetTextFrame();
|
2010-09-18 07:46:48 +04:00
|
|
|
nsTArray<float> mX;
|
|
|
|
nsTArray<float> mY;
|
|
|
|
nsTArray<float> mDx;
|
|
|
|
nsTArray<float> mDy;
|
|
|
|
nsTArray<float> mRotate;
|
2006-06-28 19:23:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|