1/* 2 * Copyright (C) 2011 Leo Yang <leoyang@webkit.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public License 15 * along with this library; see the file COPYING.LIB. If not, write to 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20#ifndef SVGGlyphRefElement_h 21#define SVGGlyphRefElement_h 22 23#if ENABLE(SVG) && ENABLE(SVG_FONTS) 24#include "SVGStyledElement.h" 25#include "SVGURIReference.h" 26 27namespace WebCore { 28 29class SVGGlyphRefElement FINAL : public SVGStyledElement, 30 public SVGURIReference { 31public: 32 static PassRefPtr<SVGGlyphRefElement> create(const QualifiedName&, Document*); 33 34 bool hasValidGlyphElement(String& glyphName) const; 35 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 36 37 // DOM interface 38 const AtomicString& glyphRef() const; 39 void setGlyphRef(const AtomicString&, ExceptionCode&); 40 float x() const { return m_x; } 41 void setX(float, ExceptionCode&); 42 float y() const { return m_y; } 43 void setY(float, ExceptionCode&); 44 float dx() const { return m_dx; } 45 void setDx(float, ExceptionCode&); 46 float dy() const { return m_dy; } 47 void setDy(float, ExceptionCode&); 48 49private: 50 SVGGlyphRefElement(const QualifiedName&, Document*); 51 52 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; } 53 54 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGlyphRefElement) 55 DECLARE_ANIMATED_STRING(Href, href) 56 END_DECLARE_ANIMATED_PROPERTIES 57 58 float m_x; 59 float m_y; 60 float m_dx; 61 float m_dy; 62}; 63 64} 65 66#endif 67#endif 68