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_SOURCE_INC_ANIMATIONFACTORY_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_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"
31 #include "shapemanager.hxx"
33 namespace box2d::utils
{ typedef ::std::shared_ptr
< class box2DWorld
> Box2DWorldSharedPtr
; }
35 /* Definition of AnimationFactory class */
37 namespace slideshow::internal
40 /** Factory for Animation objects
42 Given a SMIL XAnimate node, this factory generates the
43 appropriate Animation object from that, which will modify
44 the attribute as specified.
46 namespace AnimationFactory
48 /** Classifies the attribute name.
50 This enum maps names to appropriate factory methods.
54 /// Unknown, prolly invalid name
55 CLASS_UNKNOWN_PROPERTY
,
56 /// Use createNumberPropertyAnimation
57 CLASS_NUMBER_PROPERTY
,
58 /// Use createEnumPropertyAnimation
60 /// Use createColorPropertyAnimation
62 /// Use createStringPropertyAnimation
63 CLASS_STRING_PROPERTY
,
64 /// Use createBoolPropertyAnimation
68 AttributeClass
classifyAttributeName( const OUString
& rAttrName
);
70 /// Collection of flags common to all factory methods
73 /** Don't call enter/leaveAnimation for the Shape.
75 This is useful for set effects
80 NumberAnimationSharedPtr
createNumberPropertyAnimation( const OUString
& rAttrName
,
81 const AnimatableShapeSharedPtr
& rShape
,
82 const ShapeManagerSharedPtr
& rShapeManager
,
83 const ::basegfx::B2DVector
& rSlideSize
,
84 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
87 EnumAnimationSharedPtr
createEnumPropertyAnimation( const OUString
& rAttrName
,
88 const AnimatableShapeSharedPtr
& rShape
,
89 const ShapeManagerSharedPtr
& rShapeManager
,
90 const ::basegfx::B2DVector
& rSlideSize
,
91 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
94 ColorAnimationSharedPtr
createColorPropertyAnimation( const OUString
& rAttrName
,
95 const AnimatableShapeSharedPtr
& rShape
,
96 const ShapeManagerSharedPtr
& rShapeManager
,
97 const ::basegfx::B2DVector
& rSlideSize
,
98 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
101 /** Create scale or move animation
103 @param nTransformType
105 animations::AnimationTransformType::TRANSLATE or
106 animations::AnimationTransformType::SCALE.
108 PairAnimationSharedPtr
createPairPropertyAnimation( const AnimatableShapeSharedPtr
& rShape
,
109 const ShapeManagerSharedPtr
& rShapeManager
,
110 const ::basegfx::B2DVector
& rSlideSize
,
111 sal_Int16 nTransformType
,
114 StringAnimationSharedPtr
createStringPropertyAnimation( const OUString
& rAttrName
,
115 const AnimatableShapeSharedPtr
& rShape
,
116 const ShapeManagerSharedPtr
& rShapeManager
,
117 const ::basegfx::B2DVector
& rSlideSize
,
118 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
121 BoolAnimationSharedPtr
createBoolPropertyAnimation( const OUString
& rAttrName
,
122 const AnimatableShapeSharedPtr
& rShape
,
123 const ShapeManagerSharedPtr
& rShapeManager
,
124 const ::basegfx::B2DVector
& rSlideSize
,
125 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
128 NumberAnimationSharedPtr
createPathMotionAnimation( const OUString
& rSVGDPath
,
130 const AnimatableShapeSharedPtr
& rShape
,
131 const ShapeManagerSharedPtr
& rShapeManager
,
132 const ::basegfx::B2DVector
& rSlideSize
,
133 const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
136 NumberAnimationSharedPtr
createPhysicsAnimation( const box2d::utils::Box2DWorldSharedPtr
& pBox2DWorld
,
137 const double fDuration
,
138 const ShapeManagerSharedPtr
& rShapeManager
,
139 const ::basegfx::B2DVector
& rSlideSize
,
140 const ::basegfx::B2DVector
& rStartVelocity
,
141 const double fDensity
,
142 const double fBounciness
,
148 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONFACTORY_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */