KHtml

SVGTextPathElement.h
1 /*
2  Copyright (C) 2007 Nikolas Zimmermann <[email protected]>
3 
4  This file is part of the KDE project
5 
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.
10 
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.
15 
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.
20 */
21 
22 #ifndef SVGTextPathElement_h
23 #define SVGTextPathElement_h
24 
25 #if ENABLE(SVG)
26 #include "SVGTextContentElement.h"
27 
28 #include "SVGURIReference.h"
29 
30 namespace WebCore
31 {
32 enum SVGTextPathMethodType {
33  SVG_TEXTPATH_METHODTYPE_UNKNOWN = 0,
34  SVG_TEXTPATH_METHODTYPE_ALIGN = 1,
35  SVG_TEXTPATH_METHODTYPE_STRETCH = 2
36 };
37 
38 enum SVGTextPathSpacingType {
39  SVG_TEXTPATH_SPACINGTYPE_UNKNOWN = 0,
40  SVG_TEXTPATH_SPACINGTYPE_AUTO = 1,
41  SVG_TEXTPATH_SPACINGTYPE_EXACT = 2
42 };
43 
44 class SVGTextPathElement : public SVGTextContentElement,
45  public SVGURIReference
46 {
47 public:
48  // Forward declare these enums in the w3c naming scheme, for IDL generation
49  enum {
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
56  };
57 
58  SVGTextPathElement(const QualifiedName &, Document *);
59  virtual ~SVGTextPathElement();
60 
61  void insertedIntoDocument() override;
62 
63  void parseMappedAttribute(MappedAttribute *) override;
64  bool rendererIsNeeded(RenderStyle *style) override
65  {
66  return StyledElement::rendererIsNeeded(style);
67  }
68  RenderObject *createRenderer(RenderArena *, RenderStyle *) override;
69 
70  bool childShouldCreateRenderer(Node *) const override;
71 
72  // KHTML ElementImpl pure virtual method
73  quint32 id() const override
74  {
75  return SVGNames::textPathTag.id();
76  }
77 protected:
78  const SVGElement *contextElement() const override
79  {
80  return this;
81  }
82 
83 private:
84  ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
85 
86  ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGLength, SVGLength, StartOffset, startOffset)
87  ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, int, int, Method, method)
88  ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, int, int, Spacing, spacing)
89 };
90 
91 } // namespace WebCore
92 
93 #endif // ENABLE(SVG)
94 #endif
95 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:48:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.