2 Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef SVGTextContentElement_h
22 #define SVGTextContentElement_h
25 #include "SVGExternalResourcesRequired.h"
26 #include "SVGLangSpace.h"
27 #include "SVGStyledElement.h"
32 extern char SVGTextContentElementIdentifier
[];
36 class SVGTextContentElement
: public SVGStyledElement
,
39 public SVGExternalResourcesRequired
{
41 enum SVGLengthAdjustType
{
42 LENGTHADJUST_UNKNOWN
= 0,
43 LENGTHADJUST_SPACING
= 1,
44 LENGTHADJUST_SPACINGANDGLYPHS
= 2
47 SVGTextContentElement(const QualifiedName
&, Document
*);
48 virtual ~SVGTextContentElement();
50 virtual bool isValid() const { return SVGTests::isValid(); }
51 virtual bool isTextContent() const { return true; }
53 unsigned getNumberOfChars() const;
54 float getComputedTextLength() const;
55 float getSubStringLength(unsigned charnum
, unsigned nchars
, ExceptionCode
&) const;
56 FloatPoint
getStartPositionOfChar(unsigned charnum
, ExceptionCode
&) const;
57 FloatPoint
getEndPositionOfChar(unsigned charnum
, ExceptionCode
&) const;
58 FloatRect
getExtentOfChar(unsigned charnum
, ExceptionCode
&) const;
59 float getRotationOfChar(unsigned charnum
, ExceptionCode
&) const;
60 int getCharNumAtPosition(const FloatPoint
&) const;
61 void selectSubString(unsigned charnum
, unsigned nchars
, ExceptionCode
&) const;
63 virtual void parseMappedAttribute(MappedAttribute
*);
65 bool isKnownAttribute(const QualifiedName
&);
68 ANIMATED_PROPERTY_DECLARATIONS(SVGTextContentElement
, SVGTextContentElementIdentifier
, SVGNames::textLengthAttrString
, SVGLength
, TextLength
, textLength
)
69 ANIMATED_PROPERTY_DECLARATIONS(SVGTextContentElement
, SVGTextContentElementIdentifier
, SVGNames::lengthAdjustAttrString
, int, LengthAdjust
, lengthAdjust
)
71 // SVGExternalResourcesRequired
72 ANIMATED_PROPERTY_DECLARATIONS(SVGTextContentElement
, SVGExternalResourcesRequiredIdentifier
,
73 SVGNames::externalResourcesRequiredAttrString
, bool,
74 ExternalResourcesRequired
, externalResourcesRequired
)
77 } // namespace WebCore