1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX
21 #define INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX
24 #include "numberanimation.hxx"
25 #include "enumanimation.hxx"
26 #include "coloranimation.hxx"
27 #include "stringanimation.hxx"
28 #include "boolanimation.hxx"
29 #include "pairanimation.hxx"
32 #include "shapeattributelayer.hxx"
33 #include "shapemanager.hxx"
35 #include <boost/noncopyable.hpp>
40 /* Definition of AnimationFactory class */
47 /** Factory for Animation objects
49 Given a SMIL XAnimate node, this factory generates the
50 appropriate Animation object from that, which will modify
51 the attribute as specified.
53 class AnimationFactory
: private boost::noncopyable
56 /** Classifies the attribute name.
58 This enum maps names to appropriate factory methods.
62 /// Unknown, prolly invalid name
63 CLASS_UNKNOWN_PROPERTY
,
64 /// Use createNumberPropertyAnimation
65 CLASS_NUMBER_PROPERTY
,
66 /// Use createEnumPropertyAnimation
68 /// Use createColorPropertyAnimation
70 /// Use createStringPropertyAnimation
71 CLASS_STRING_PROPERTY
,
72 /// Use createBoolPropertyAnimation
76 static AttributeClass
classifyAttributeName( const OUString
& rAttrName
);
78 /// Collection of flags common to all factory methods
81 /** Don't call enter/leaveAnimation for the Shape.
83 This is useful for set effects
88 static NumberAnimationSharedPtr
createNumberPropertyAnimation( const OUString
& rAttrName
,
89 const AnimatableShapeSharedPtr
& rShape
,
90 const ShapeManagerSharedPtr
& rShapeManager
,
91 const ::basegfx::B2DVector
& rSlideSize
,
94 static EnumAnimationSharedPtr
createEnumPropertyAnimation( const OUString
& rAttrName
,
95 const AnimatableShapeSharedPtr
& rShape
,
96 const ShapeManagerSharedPtr
& rShapeManager
,
97 const ::basegfx::B2DVector
& rSlideSize
,
100 static ColorAnimationSharedPtr
createColorPropertyAnimation( const OUString
& rAttrName
,
101 const AnimatableShapeSharedPtr
& rShape
,
102 const ShapeManagerSharedPtr
& rShapeManager
,
103 const ::basegfx::B2DVector
& rSlideSize
,
106 /** Create scale or move animation
108 @param nTransformType
110 animations::AnimationTransformType::TRANSLATE or
111 animations::AnimationTransformType::SCALE.
113 static PairAnimationSharedPtr
createPairPropertyAnimation( const AnimatableShapeSharedPtr
& rShape
,
114 const ShapeManagerSharedPtr
& rShapeManager
,
115 const ::basegfx::B2DVector
& rSlideSize
,
116 sal_Int16 nTransformType
,
119 static StringAnimationSharedPtr
createStringPropertyAnimation( const OUString
& rAttrName
,
120 const AnimatableShapeSharedPtr
& rShape
,
121 const ShapeManagerSharedPtr
& rShapeManager
,
122 const ::basegfx::B2DVector
& rSlideSize
,
125 static BoolAnimationSharedPtr
createBoolPropertyAnimation( const OUString
& rAttrName
,
126 const AnimatableShapeSharedPtr
& rShape
,
127 const ShapeManagerSharedPtr
& rShapeManager
,
128 const ::basegfx::B2DVector
& rSlideSize
,
131 static NumberAnimationSharedPtr
createPathMotionAnimation( const OUString
& rSVGDPath
,
133 const AnimatableShapeSharedPtr
& rShape
,
134 const ShapeManagerSharedPtr
& rShapeManager
,
135 const ::basegfx::B2DVector
& rSlideSize
,
138 // default: constructor/destructor disabed
145 #endif /* INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX */
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */