1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: animationfactory.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX
32 #define INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX
35 #include "numberanimation.hxx"
36 #include "enumanimation.hxx"
37 #include "coloranimation.hxx"
38 #include "stringanimation.hxx"
39 #include "boolanimation.hxx"
40 #include "pairanimation.hxx"
43 #include "shapeattributelayer.hxx"
44 #include "shapemanager.hxx"
46 #include <boost/noncopyable.hpp>
55 /* Definition of AnimationFactory class */
62 /** Factory for Animation objects
64 Given a SMIL XAnimate node, this factory generates the
65 appropriate Animation object from that, which will modify
66 the attribute as specified.
68 class AnimationFactory
: private boost::noncopyable
71 /** Classifies the attribute name.
73 This enum maps names to appropriate factory methods.
77 /// Unknown, prolly invalid name
78 CLASS_UNKNOWN_PROPERTY
,
79 /// Use createNumberPropertyAnimation
80 CLASS_NUMBER_PROPERTY
,
81 /// Use createEnumPropertyAnimation
83 /// Use createColorPropertyAnimation
85 /// Use createStringPropertyAnimation
86 CLASS_STRING_PROPERTY
,
87 /// Use createBoolPropertyAnimation
91 static AttributeClass
classifyAttributeName( const ::rtl::OUString
& rAttrName
);
93 /// Collection of flags common to all factory methods
96 /** Don't call enter/leaveAnimation for the Shape.
98 This is useful for set effects
103 static NumberAnimationSharedPtr
createNumberPropertyAnimation( const ::rtl::OUString
& rAttrName
,
104 const AnimatableShapeSharedPtr
& rShape
,
105 const ShapeManagerSharedPtr
& rShapeManager
,
106 const ::basegfx::B2DVector
& rSlideSize
,
109 static EnumAnimationSharedPtr
createEnumPropertyAnimation( const ::rtl::OUString
& rAttrName
,
110 const AnimatableShapeSharedPtr
& rShape
,
111 const ShapeManagerSharedPtr
& rShapeManager
,
112 const ::basegfx::B2DVector
& rSlideSize
,
115 static ColorAnimationSharedPtr
createColorPropertyAnimation( const ::rtl::OUString
& rAttrName
,
116 const AnimatableShapeSharedPtr
& rShape
,
117 const ShapeManagerSharedPtr
& rShapeManager
,
118 const ::basegfx::B2DVector
& rSlideSize
,
121 /** Create scale or move animation
123 @param nTransformType
125 animations::AnimationTransformType::TRANSLATE or
126 animations::AnimationTransformType::SCALE.
128 static PairAnimationSharedPtr
createPairPropertyAnimation( const AnimatableShapeSharedPtr
& rShape
,
129 const ShapeManagerSharedPtr
& rShapeManager
,
130 const ::basegfx::B2DVector
& rSlideSize
,
131 sal_Int16 nTransformType
,
134 static StringAnimationSharedPtr
createStringPropertyAnimation( const ::rtl::OUString
& rAttrName
,
135 const AnimatableShapeSharedPtr
& rShape
,
136 const ShapeManagerSharedPtr
& rShapeManager
,
137 const ::basegfx::B2DVector
& rSlideSize
,
140 static BoolAnimationSharedPtr
createBoolPropertyAnimation( const ::rtl::OUString
& rAttrName
,
141 const AnimatableShapeSharedPtr
& rShape
,
142 const ShapeManagerSharedPtr
& rShapeManager
,
143 const ::basegfx::B2DVector
& rSlideSize
,
146 static NumberAnimationSharedPtr
createPathMotionAnimation( const ::rtl::OUString
& rSVGDPath
,
148 const AnimatableShapeSharedPtr
& rShape
,
149 const ShapeManagerSharedPtr
& rShapeManager
,
150 const ::basegfx::B2DVector
& rSlideSize
,
153 // default: constructor/destructor disabed
160 #endif /* INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX */