2 Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 This file is part of the KDE project
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef SVGTextPathElement_h
23 #define SVGTextPathElement_h
26 #include "SVGTextContentElement.h"
28 #include "SVGURIReference.h"
32 enum SVGTextPathMethodType
{
33 SVG_TEXTPATH_METHODTYPE_UNKNOWN
= 0,
34 SVG_TEXTPATH_METHODTYPE_ALIGN
= 1,
35 SVG_TEXTPATH_METHODTYPE_STRETCH
= 2
38 enum SVGTextPathSpacingType
{
39 SVG_TEXTPATH_SPACINGTYPE_UNKNOWN
= 0,
40 SVG_TEXTPATH_SPACINGTYPE_AUTO
= 1,
41 SVG_TEXTPATH_SPACINGTYPE_EXACT
= 2
44 class SVGTextPathElement
: public SVGTextContentElement
,
45 public SVGURIReference
48 // Forward declare these enums in the w3c naming scheme, for IDL generation
50 TEXTPATH_METHODTYPE_UNKNOWN
= SVG_TEXTPATH_METHODTYPE_UNKNOWN
,
51 TEXTPATH_METHODTYPE_ALIGN
= SVG_TEXTPATH_METHODTYPE_ALIGN
,
52 TEXTPATH_METHODTYPE_STRETCH
= SVG_TEXTPATH_METHODTYPE_STRETCH
,
53 TEXTPATH_SPACINGTYPE_UNKNOWN
= SVG_TEXTPATH_SPACINGTYPE_UNKNOWN
,
54 TEXTPATH_SPACINGTYPE_AUTO
= SVG_TEXTPATH_SPACINGTYPE_AUTO
,
55 TEXTPATH_SPACINGTYPE_EXACT
= SVG_TEXTPATH_SPACINGTYPE_EXACT
58 SVGTextPathElement(const QualifiedName
&, Document
*);
59 virtual ~SVGTextPathElement();
61 virtual void insertedIntoDocument();
63 virtual void parseMappedAttribute(MappedAttribute
*);
64 virtual bool rendererIsNeeded(RenderStyle
* style
) { return StyledElement::rendererIsNeeded(style
); }
65 virtual RenderObject
* createRenderer(RenderArena
*, RenderStyle
*);
67 bool childShouldCreateRenderer(Node
*) const;
69 // KHTML ElementImpl pure virtual method
70 virtual quint32
id() const { return SVGNames::textPathTag
.id(); }
71 virtual DOMString
tagName() const { return SVGNames::textPathTag
.tagName(); }
74 virtual const SVGElement
* contextElement() const { return this; }
77 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference
, String
, Href
, href
)
79 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement
, SVGLength
, SVGLength
, StartOffset
, startOffset
)
80 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement
, int, int, Method
, method
)
81 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement
, int, int, Spacing
, spacing
)
84 } // namespace WebCore