File indexing completed on 2024-04-28 11:39:09

0001 /*
0002     Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
0003                   2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
0004     Copyright (C) 2007 Eric Seidel <eric@webkit.org>
0005     Copyright (C) 2008 Apple Inc. All Rights Reserved.
0006 
0007     This file is part of the KDE project
0008 
0009     This library is free software; you can redistribute it and/or
0010     modify it under the terms of the GNU Library General Public
0011     License as published by the Free Software Foundation; either
0012     version 2 of the License, or (at your option) any later version.
0013 
0014     This library is distributed in the hope that it will be useful,
0015     but WITHOUT ANY WARRANTY; without even the implied warranty of
0016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017     Library General Public License for more details.
0018 
0019     You should have received a copy of the GNU Library General Public License
0020     along with this library; see the file COPYING.LIB.  If not, write to
0021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022     Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #ifndef SVGAnimateTransformElement_h
0026 #define SVGAnimateTransformElement_h
0027 #if ENABLE(SVG) && ENABLE(SVG_ANIMATION)
0028 
0029 #include "SVGAnimationElement.h"
0030 #include "SVGTransform.h"
0031 #include "SVGTransformDistance.h"
0032 
0033 namespace WebCore
0034 {
0035 
0036 class AffineTransform;
0037 
0038 class SVGAnimateTransformElement : public SVGAnimationElement
0039 {
0040 public:
0041     SVGAnimateTransformElement(const QualifiedName &, Document *);
0042     virtual ~SVGAnimateTransformElement();
0043 
0044     virtual bool hasValidTarget() const;
0045 
0046     virtual void parseMappedAttribute(MappedAttribute *);
0047 
0048 protected:
0049     virtual const SVGElement *contextElement() const
0050     {
0051         return this;
0052     }
0053 
0054 private:
0055     virtual void resetToBaseValue(const String &);
0056     virtual bool calculateFromAndToValues(const String &fromString, const String &toString);
0057     virtual bool calculateFromAndByValues(const String &fromString, const String &byString);
0058     virtual void calculateAnimatedValue(float percentage, unsigned repeat, SVGSMILElement *resultElement);
0059     virtual void applyResultsToTarget();
0060     virtual float calculateDistance(const String &fromString, const String &toString);
0061 
0062     SVGTransform parseTransformValue(const String &) const;
0063 
0064     SVGTransform::SVGTransformType m_type;
0065 
0066     unsigned m_baseIndexInTransformList;
0067 
0068     SVGTransform m_toTransform;
0069     SVGTransform m_fromTransform;
0070 };
0071 
0072 } // namespace WebCore
0073 
0074 #endif // ENABLE(SVG)
0075 #endif // SVGAnimateTransformElement_h
0076