xref: /aoo4110/main/sd/inc/EffectMigration.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SD_EFFECT_MIGRATION_HXX
25 #define _SD_EFFECT_MIGRATION_HXX
26 
27 #include <com/sun/star/presentation/AnimationEffect.hpp>
28 #include <com/sun/star/presentation/AnimationSpeed.hpp>
29 #include <com/sun/star/presentation/FadeEffect.hpp>
30 
31 class SdPage;
32 class SvxShape;
33 class SdAnimationInfo;
34 class SdrObject;
35 class SdrPathObj;
36 class SdrObjGroup;
37 
38 namespace sd {
39 
40 /** this helper class gives various methods to convert effects from OOo 1.1
41 	and below to and from OOo 2.0 and above
42 */
43 class EffectMigration
44 {
45 public:
46 	static ::com::sun::star::presentation::AnimationSpeed ConvertDuration( double fDuration );
47 	static double ConvertAnimationSpeed( ::com::sun::star::presentation::AnimationSpeed eSpeed );
48 
49 	static bool ConvertPreset( const ::rtl::OUString& rPresetId, const ::rtl::OUString* pPresetSubType, ::com::sun::star::presentation::AnimationEffect& rEffect );
50 	static bool ConvertAnimationEffect( const ::com::sun::star::presentation::AnimationEffect& rEffect, ::rtl::OUString& rPresetId, ::rtl::OUString& rPresetSubType );
51 
52 public:
53 	void AddEffectFromAnimationInfo( SdrObject* pObject, SdAnimationInfo* pInfo );
54 
55 public:
56 	static void SetFadeEffect( SdPage* pPage, ::com::sun::star::presentation::FadeEffect eNewEffect);
57 	static ::com::sun::star::presentation::FadeEffect GetFadeEffect( const SdPage* pPage );
58 
59 public:
60 	static void SetAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue );
61 	static ::com::sun::star::presentation::AnimationEffect GetAnimationEffect( SvxShape* pShape );
62 	static void SetTextAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue );
63 	static ::com::sun::star::presentation::AnimationEffect GetTextAnimationEffect( SvxShape* pShape );
64 	static void SetAnimationSpeed( SvxShape* pShape, ::com::sun::star::presentation::AnimationSpeed eSpeed );
65 	static ::com::sun::star::presentation::AnimationSpeed GetAnimationSpeed( SvxShape* pShape );
66 	static void SetDimColor( SvxShape* pShape, sal_Int32 nColor );
67 	static sal_Int32 GetDimColor( SvxShape* pShape );
68 	static void SetDimHide( SvxShape* pShape, sal_Bool bDimHide );
69 	static sal_Bool GetDimHide( SvxShape* pShape );
70 	static void SetDimPrevious( SvxShape* pShape, sal_Bool bDimPrevious );
71 	static sal_Bool GetDimPrevious( SvxShape* pShape );
72 	static void SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos );
73 	static sal_Int32 GetPresentationOrder( SvxShape* pShape );
74 	static void UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInfo );
75 	static ::rtl::OUString GetSoundFile( SvxShape* pShape );
76 	static sal_Bool GetSoundOn( SvxShape* pShape );
77 
78 	static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj );
79     static void CreateAnimatedGroup(SdrObjGroup& rGroupObj, SdPage& rPage);
80 };
81 
82 } // end of namespace sd
83 
84 #endif
85