merge the formfield patch from ooo-build
[ooovba.git] / slideshow / source / inc / animationfactory.hxx
blob4a038cba709505dcaded98933775166fb501f2bd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: animationfactory.hxx,v $
10 * $Revision: 1.7 $
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"
42 #include "shape.hxx"
43 #include "shapeattributelayer.hxx"
44 #include "shapemanager.hxx"
46 #include <boost/noncopyable.hpp>
49 namespace rtl
51 class OUString;
55 /* Definition of AnimationFactory class */
57 namespace slideshow
59 namespace internal
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.
67 */
68 class AnimationFactory : private boost::noncopyable
70 public:
71 /** Classifies the attribute name.
73 This enum maps names to appropriate factory methods.
75 enum AttributeClass
77 /// Unknown, prolly invalid name
78 CLASS_UNKNOWN_PROPERTY,
79 /// Use createNumberPropertyAnimation
80 CLASS_NUMBER_PROPERTY,
81 /// Use createEnumPropertyAnimation
82 CLASS_ENUM_PROPERTY,
83 /// Use createColorPropertyAnimation
84 CLASS_COLOR_PROPERTY,
85 /// Use createStringPropertyAnimation
86 CLASS_STRING_PROPERTY,
87 /// Use createBoolPropertyAnimation
88 CLASS_BOOL_PROPERTY
91 static AttributeClass classifyAttributeName( const ::rtl::OUString& rAttrName );
93 /// Collection of flags common to all factory methods
94 enum FactoryFlags
96 /** Don't call enter/leaveAnimation for the Shape.
98 This is useful for set effects
100 FLAG_NO_SPRITE = 1
103 static NumberAnimationSharedPtr createNumberPropertyAnimation( const ::rtl::OUString& rAttrName,
104 const AnimatableShapeSharedPtr& rShape,
105 const ShapeManagerSharedPtr& rShapeManager,
106 const ::basegfx::B2DVector& rSlideSize,
107 int nFlags=0 );
109 static EnumAnimationSharedPtr createEnumPropertyAnimation( const ::rtl::OUString& rAttrName,
110 const AnimatableShapeSharedPtr& rShape,
111 const ShapeManagerSharedPtr& rShapeManager,
112 const ::basegfx::B2DVector& rSlideSize,
113 int nFlags=0 );
115 static ColorAnimationSharedPtr createColorPropertyAnimation( const ::rtl::OUString& rAttrName,
116 const AnimatableShapeSharedPtr& rShape,
117 const ShapeManagerSharedPtr& rShapeManager,
118 const ::basegfx::B2DVector& rSlideSize,
119 int nFlags=0 );
121 /** Create scale or move animation
123 @param nTransformType
124 Must be one of
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,
132 int nFlags=0 );
134 static StringAnimationSharedPtr createStringPropertyAnimation( const ::rtl::OUString& rAttrName,
135 const AnimatableShapeSharedPtr& rShape,
136 const ShapeManagerSharedPtr& rShapeManager,
137 const ::basegfx::B2DVector& rSlideSize,
138 int nFlags=0 );
140 static BoolAnimationSharedPtr createBoolPropertyAnimation( const ::rtl::OUString& rAttrName,
141 const AnimatableShapeSharedPtr& rShape,
142 const ShapeManagerSharedPtr& rShapeManager,
143 const ::basegfx::B2DVector& rSlideSize,
144 int nFlags=0 );
146 static NumberAnimationSharedPtr createPathMotionAnimation( const ::rtl::OUString& rSVGDPath,
147 sal_Int16 nAdditive,
148 const AnimatableShapeSharedPtr& rShape,
149 const ShapeManagerSharedPtr& rShapeManager,
150 const ::basegfx::B2DVector& rSlideSize,
151 int nFlags=0);
152 private:
153 // default: constructor/destructor disabed
154 AnimationFactory();
155 ~AnimationFactory();
160 #endif /* INCLUDED_SLIDESHOW_ANIMATIONFACTORY_HXX */