109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)/* 209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * Copyright (C) 2014 Google Inc. All rights reserved. 309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * 409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without 509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * modification, are permitted provided that the following conditions are 609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * met: 709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * 809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * * Redistributions of source code must retain the above copyright 909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * notice, this list of conditions and the following disclaimer. 1009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * * Redistributions in binary form must reproduce the above 1109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer 1209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * in the documentation and/or other materials provided with the 1309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * distribution. 1409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * * Neither the name of Google Inc. nor the names of its 1509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * contributors may be used to endorse or promote products derived from 1609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * this software without specific prior written permission. 1709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * 1809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) */ 3009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 3109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#ifndef SVGLengthTearOff_h 3209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#define SVGLengthTearOff_h 3309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 34197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/ScriptWrappable.h" 3509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/svg/SVGLength.h" 3607a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch#include "core/svg/properties/SVGPropertyTearOff.h" 3709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 38c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 3909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 4007a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdochclass SVGLengthTearOff FINAL : public SVGPropertyTearOff<SVGLength>, public ScriptWrappable { 417242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci DEFINE_WRAPPERTYPEINFO(); 4209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)public: 4309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) // Forward declare these enums in the w3c naming scheme, for IDL generation 4409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) enum { 4509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_UNKNOWN = LengthTypeUnknown, 4609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_NUMBER = LengthTypeNumber, 4709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_PERCENTAGE = LengthTypePercentage, 4809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_EMS = LengthTypeEMS, 4909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_EXS = LengthTypeEXS, 5009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_PX = LengthTypePX, 5109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_CM = LengthTypeCM, 5209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_MM = LengthTypeMM, 5309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_IN = LengthTypeIN, 5409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_PT = LengthTypePT, 5509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVG_LENGTHTYPE_PC = LengthTypePC 5609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) }; 5709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 585d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles) static PassRefPtr<SVGLengthTearOff> create(PassRefPtr<SVGLength> target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName = QualifiedName::null()) 5909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) { 6009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) return adoptRef(new SVGLengthTearOff(target, contextElement, propertyIsAnimVal, attributeName)); 6109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) } 6209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 6309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVGLengthType unitType(); 6409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) SVGLengthMode unitMode(); 6509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) float value(ExceptionState&); 6609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void setValue(float value, ExceptionState&); 6709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) float valueInSpecifiedUnits(); 6809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void setValueInSpecifiedUnits(float value, ExceptionState&); 6909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) String valueAsString(); 7009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void setValueAsString(const String&, ExceptionState&); 7109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionState&); 7209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void convertToSpecifiedUnits(unsigned short unitType, ExceptionState&); 7309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 7409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)private: 755d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles) SVGLengthTearOff(PassRefPtr<SVGLength>, SVGElement* contextElement, PropertyIsAnimValType, const QualifiedName& attributeName = QualifiedName::null()); 7609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)}; 7709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 78c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 7909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 807242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#endif // SVGLengthTearOff_h 81