File indexing completed on 2024-04-28 15:24:42
0001 /* 0002 Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 0003 0004 This file is part of the KDE project 0005 0006 This library is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Library General Public 0008 License as published by the Free Software Foundation; either 0009 version 2 of the License, or (at your option) any later version. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Library General Public License for more details. 0015 0016 You should have received a copy of the GNU Library General Public License 0017 along with this library; see the file COPYING.LIB. If not, write to 0018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 Boston, MA 02110-1301, USA. 0020 */ 0021 0022 #ifndef SVGTextPathElement_h 0023 #define SVGTextPathElement_h 0024 0025 #if ENABLE(SVG) 0026 #include "SVGTextContentElement.h" 0027 0028 #include "SVGURIReference.h" 0029 0030 namespace WebCore 0031 { 0032 enum SVGTextPathMethodType { 0033 SVG_TEXTPATH_METHODTYPE_UNKNOWN = 0, 0034 SVG_TEXTPATH_METHODTYPE_ALIGN = 1, 0035 SVG_TEXTPATH_METHODTYPE_STRETCH = 2 0036 }; 0037 0038 enum SVGTextPathSpacingType { 0039 SVG_TEXTPATH_SPACINGTYPE_UNKNOWN = 0, 0040 SVG_TEXTPATH_SPACINGTYPE_AUTO = 1, 0041 SVG_TEXTPATH_SPACINGTYPE_EXACT = 2 0042 }; 0043 0044 class SVGTextPathElement : public SVGTextContentElement, 0045 public SVGURIReference 0046 { 0047 public: 0048 // Forward declare these enums in the w3c naming scheme, for IDL generation 0049 enum { 0050 TEXTPATH_METHODTYPE_UNKNOWN = SVG_TEXTPATH_METHODTYPE_UNKNOWN, 0051 TEXTPATH_METHODTYPE_ALIGN = SVG_TEXTPATH_METHODTYPE_ALIGN, 0052 TEXTPATH_METHODTYPE_STRETCH = SVG_TEXTPATH_METHODTYPE_STRETCH, 0053 TEXTPATH_SPACINGTYPE_UNKNOWN = SVG_TEXTPATH_SPACINGTYPE_UNKNOWN, 0054 TEXTPATH_SPACINGTYPE_AUTO = SVG_TEXTPATH_SPACINGTYPE_AUTO, 0055 TEXTPATH_SPACINGTYPE_EXACT = SVG_TEXTPATH_SPACINGTYPE_EXACT 0056 }; 0057 0058 SVGTextPathElement(const QualifiedName &, Document *); 0059 virtual ~SVGTextPathElement(); 0060 0061 void insertedIntoDocument() override; 0062 0063 void parseMappedAttribute(MappedAttribute *) override; 0064 bool rendererIsNeeded(RenderStyle *style) override 0065 { 0066 return StyledElement::rendererIsNeeded(style); 0067 } 0068 RenderObject *createRenderer(RenderArena *, RenderStyle *) override; 0069 0070 bool childShouldCreateRenderer(Node *) const override; 0071 0072 // KHTML ElementImpl pure virtual method 0073 quint32 id() const override 0074 { 0075 return SVGNames::textPathTag.id(); 0076 } 0077 protected: 0078 const SVGElement *contextElement() const override 0079 { 0080 return this; 0081 } 0082 0083 private: 0084 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href) 0085 0086 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGLength, SVGLength, StartOffset, startOffset) 0087 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, int, int, Method, method) 0088 ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, int, int, Spacing, spacing) 0089 }; 0090 0091 } // namespace WebCore 0092 0093 #endif // ENABLE(SVG) 0094 #endif 0095