1/* 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 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#ifndef SVGViewElement_h 22#define SVGViewElement_h 23 24#include "SVGAnimatedBoolean.h" 25#include "SVGAnimatedPreserveAspectRatio.h" 26#include "SVGAnimatedRect.h" 27#include "SVGElement.h" 28#include "SVGExternalResourcesRequired.h" 29#include "SVGFitToViewBox.h" 30#include "SVGStringList.h" 31#include "SVGZoomAndPan.h" 32 33namespace WebCore { 34 35class SVGViewElement final : public SVGElement, 36 public SVGExternalResourcesRequired, 37 public SVGFitToViewBox, 38 public SVGZoomAndPan { 39public: 40 static PassRefPtr<SVGViewElement> create(const QualifiedName&, Document&); 41 42 using SVGElement::ref; 43 using SVGElement::deref; 44 45 SVGStringList& viewTarget() { return m_viewTarget; } 46 SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } 47 void setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); } 48 49private: 50 SVGViewElement(const QualifiedName&, Document&); 51 52 // FIXME: svgAttributeChanged missing. 53 bool isSupportedAttribute(const QualifiedName&); 54 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 55 56 virtual bool rendererIsNeeded(const RenderStyle&) override { return false; } 57 58 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGViewElement) 59 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired) 60 DECLARE_ANIMATED_RECT(ViewBox, viewBox) 61 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) 62 END_DECLARE_ANIMATED_PROPERTIES 63 64 SVGZoomAndPanType m_zoomAndPan; 65 SVGStringList m_viewTarget; 66}; 67 68NODE_TYPE_CASTS(SVGViewElement) 69 70} // namespace WebCore 71 72#endif 73