2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
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.
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.
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.
20 #ifndef SVGAnimatorFactory_h
21 #define SVGAnimatorFactory_h
23 #if ENABLE(SVG) && ENABLE(SVG_ANIMATION)
24 #include "SVGAnimatedAngle.h"
25 #include "SVGAnimatedBoolean.h"
26 #include "SVGAnimatedColor.h"
27 #include "SVGAnimatedInteger.h"
28 #include "SVGAnimatedLength.h"
29 #include "SVGAnimatedLengthList.h"
30 #include "SVGAnimatedNumber.h"
31 #include "SVGAnimatedNumberList.h"
32 #include "SVGAnimatedNumberOptionalNumber.h"
33 #include "SVGAnimatedPath.h"
34 #include "SVGAnimatedPointList.h"
35 #include "SVGAnimatedPreserveAspectRatio.h"
36 #include "SVGAnimatedRect.h"
37 #include "SVGAnimatedString.h"
41 class SVGAnimationElement;
43 class SVGAnimatorFactory {
45 static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedPropertyType attributeType)
47 ASSERT(animationElement);
48 ASSERT(contextElement);
50 switch (attributeType) {
52 return adoptPtr(new SVGAnimatedAngleAnimator(animationElement, contextElement));
54 return adoptPtr(new SVGAnimatedBooleanAnimator(animationElement, contextElement));
56 return adoptPtr(new SVGAnimatedColorAnimator(animationElement, contextElement));
58 return adoptPtr(new SVGAnimatedIntegerAnimator(animationElement, contextElement));
60 return adoptPtr(new SVGAnimatedLengthAnimator(animationElement, contextElement));
61 case AnimatedLengthList:
62 return adoptPtr(new SVGAnimatedLengthListAnimator(animationElement, contextElement));
64 return adoptPtr(new SVGAnimatedNumberAnimator(animationElement, contextElement));
65 case AnimatedNumberList:
66 return adoptPtr(new SVGAnimatedNumberListAnimator(animationElement, contextElement));
67 case AnimatedNumberOptionalNumber:
68 return adoptPtr(new SVGAnimatedNumberOptionalNumberAnimator(animationElement, contextElement));
70 return adoptPtr(new SVGAnimatedPathAnimator(animationElement, contextElement));
72 return adoptPtr(new SVGAnimatedPointListAnimator(animationElement, contextElement));
73 case AnimatedPreserveAspectRatio:
74 return adoptPtr(new SVGAnimatedPreserveAspectRatioAnimator(animationElement, contextElement));
76 return adoptPtr(new SVGAnimatedRectAnimator(animationElement, contextElement));
78 return adoptPtr(new SVGAnimatedStringAnimator(animationElement, contextElement));
79 case AnimatedEnumeration: // FIXME: Implementation needed.
80 case AnimatedTransformList: // FIXME: Implementation needed.
90 SVGAnimatorFactory() { }
94 } // namespace WebCore
96 #endif // ENABLE(SVG) && ENABLE(SVG_ANIMATION)
97 #endif // SVGAnimatorFactory_h