1 | /* |
2 | * Copyright (C) 2011 Leo Yang <leoyang@webkit.org> |
3 | * Copyright (C) 2018-2019 Apple Inc. All rights reserved. |
4 | * |
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. |
9 | * |
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. |
14 | * |
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. |
19 | */ |
20 | |
21 | #pragma once |
22 | |
23 | #if ENABLE(SVG_FONTS) |
24 | |
25 | #include "SVGElement.h" |
26 | #include "SVGURIReference.h" |
27 | |
28 | namespace WebCore { |
29 | |
30 | class SVGGlyphRefElement final : public SVGElement, public SVGURIReference { |
31 | WTF_MAKE_ISO_ALLOCATED(SVGGlyphRefElement); |
32 | public: |
33 | static Ref<SVGGlyphRefElement> create(const QualifiedName&, Document&); |
34 | |
35 | bool hasValidGlyphElement(String& glyphName) const; |
36 | |
37 | float x() const { return m_x; } |
38 | void setX(float); |
39 | float y() const { return m_y; } |
40 | void setY(float); |
41 | float dx() const { return m_dx; } |
42 | void setDx(float); |
43 | float dy() const { return m_dy; } |
44 | void setDy(float); |
45 | |
46 | private: |
47 | SVGGlyphRefElement(const QualifiedName&, Document&); |
48 | |
49 | using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphRefElement, SVGElement, SVGURIReference>; |
50 | const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } |
51 | |
52 | void parseAttribute(const QualifiedName&, const AtomicString&) final; |
53 | bool rendererIsNeeded(const RenderStyle&) final { return false; } |
54 | |
55 | float m_x { 0 }; |
56 | float m_y { 0 }; |
57 | float m_dx { 0 }; |
58 | float m_dy { 0 }; |
59 | PropertyRegistry m_propertyRegistry { *this }; |
60 | }; |
61 | |
62 | } |
63 | |
64 | #endif |
65 | |