SVGTextContentElement.h [plain text]
#ifndef SVGTextContentElement_h
#define SVGTextContentElement_h
#if ENABLE(SVG)
#include "SVGAnimatedBoolean.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledElement.h"
#include "SVGTests.h"
namespace WebCore {
class SVGTextContentElement : public SVGStyledElement,
public SVGTests,
public SVGLangSpace,
public SVGExternalResourcesRequired {
public:
enum SVGLengthAdjustType {
LENGTHADJUST_UNKNOWN = 0,
LENGTHADJUST_SPACING = 1,
LENGTHADJUST_SPACINGANDGLYPHS = 2
};
unsigned getNumberOfChars() const;
float getComputedTextLength() const;
float getSubStringLength(unsigned charnum, unsigned nchars, ExceptionCode&) const;
FloatPoint getStartPositionOfChar(unsigned charnum, ExceptionCode&) const;
FloatPoint getEndPositionOfChar(unsigned charnum, ExceptionCode&) const;
FloatRect getExtentOfChar(unsigned charnum, ExceptionCode&) const;
float getRotationOfChar(unsigned charnum, ExceptionCode&) const;
int getCharNumAtPosition(const FloatPoint&) const;
void selectSubString(unsigned charnum, unsigned nchars, ExceptionCode&) const;
static SVGTextContentElement* elementFromRenderer(RenderObject*);
SVGLength& specifiedTextLength() { return m_specifiedTextLength; }
PassRefPtr<SVGAnimatedLength> textLengthAnimated();
protected:
SVGTextContentElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
virtual void parseMappedAttribute(Attribute*);
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
virtual bool selfHasRelativeLengths() const;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
private:
virtual bool isTextContent() const { return true; }
void synchronizeTextLength();
SVGLength m_specifiedTextLength;
mutable SVGSynchronizableAnimatedProperty<SVGLength> m_textLength;
DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust)
DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
};
}
#endif // ENABLE(SVG)
#endif