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"
32 #include "shapeattributelayer.hxx"
33 #include "shapemanager.hxx"
35 /* Definition of AnimationFactory class */
42 /** Factory for Animation objects
44 Given a SMIL XAnimate node, this factory generates the
45 appropriate Animation object from that, which will modify
46 the attribute as specified.
48 namespace AnimationFactory
50 /** Classifies the attribute name.
52 This enum maps names to appropriate factory methods.
56 /// Unknown, prolly invalid name
57 CLASS_UNKNOWN_PROPERTY
,
58 /// Use createNumberPropertyAnimation
59 CLASS_NUMBER_PROPERTY
,
60 /// Use createEnumPropertyAnimation
62 /// Use createColorPropertyAnimation
64 /// Use createStringPropertyAnimation
65 CLASS_STRING_PROPERTY
,
66 /// Use createBoolPropertyAnimation
70 AttributeClass
classifyAttributeName( const OUString
& rAttrName
);
72 /// Collection of flags common to all factory methods
75 /** Don't call enter/leaveAnimation for the Shape.
77 This is useful for set effects
82 NumberAnimationSharedPtr
createNumberPropertyAnimation( const OUString
& rAttrName
,
83 const AnimatableShapeSharedPtr
& rShape
,
84 const ShapeManagerSharedPtr
& rShapeManager
,
85 const ::basegfx::B2DVector
& rSlideSize
,
88 EnumAnimationSharedPtr
createEnumPropertyAnimation( const OUString
& rAttrName
,
89 const AnimatableShapeSharedPtr
& rShape
,
90 const ShapeManagerSharedPtr
& rShapeManager
,
91 const ::basegfx::B2DVector
& rSlideSize
,
94 ColorAnimationSharedPtr
createColorPropertyAnimation( const OUString
& rAttrName
,
95 const AnimatableShapeSharedPtr
& rShape
,
96 const ShapeManagerSharedPtr
& rShapeManager
,
97 const ::basegfx::B2DVector
& rSlideSize
,
100 /** Create scale or move animation
102 @param nTransformType
104 animations::AnimationTransformType::TRANSLATE or
105 animations::AnimationTransformType::SCALE.
107 PairAnimationSharedPtr
createPairPropertyAnimation( const AnimatableShapeSharedPtr
& rShape
,
108 const ShapeManagerSharedPtr
& rShapeManager
,
109 const ::basegfx::B2DVector
& rSlideSize
,
110 sal_Int16 nTransformType
,
113 StringAnimationSharedPtr
createStringPropertyAnimation( const OUString
& rAttrName
,
114 const AnimatableShapeSharedPtr
& rShape
,
115 const ShapeManagerSharedPtr
& rShapeManager
,
116 const ::basegfx::B2DVector
& rSlideSize
,
119 BoolAnimationSharedPtr
createBoolPropertyAnimation( const OUString
& rAttrName
,
120 const AnimatableShapeSharedPtr
& rShape
,
121 const ShapeManagerSharedPtr
& rShapeManager
,
122 const ::basegfx::B2DVector
& rSlideSize
,
125 NumberAnimationSharedPtr
createPathMotionAnimation( const OUString
& rSVGDPath
,
127 const AnimatableShapeSharedPtr
& rShape
,
128 const ShapeManagerSharedPtr
& rShapeManager
,
129 const ::basegfx::B2DVector
& rSlideSize
,
135 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONFACTORY_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */