xref: /aoo42x/main/sd/inc/EffectMigration.hxx (revision c45d927a)
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 
37 namespace sd {
38 
39 /** this helper class gives various methods to convert effects from OOo 1.1
40 	and below to and from OOo 2.0 and above
41 */
42 class EffectMigration
43 {
44 public:
45 	static ::com::sun::star::presentation::AnimationSpeed ConvertDuration( double fDuration );
46 	static double ConvertAnimationSpeed( ::com::sun::star::presentation::AnimationSpeed eSpeed );
47 
48 	static bool ConvertPreset( const ::rtl::OUString& rPresetId, const ::rtl::OUString* pPresetSubType, ::com::sun::star::presentation::AnimationEffect& rEffect );
49 	static bool ConvertAnimationEffect( const ::com::sun::star::presentation::AnimationEffect& rEffect, ::rtl::OUString& rPresetId, ::rtl::OUString& rPresetSubType );
50 
51 public:
52 	void AddEffectFromAnimationInfo( SdrObject* pObject, SdAnimationInfo* pInfo );
53 
54 public:
55 	static void SetFadeEffect( SdPage* pPage, ::com::sun::star::presentation::FadeEffect eNewEffect);
56 	static ::com::sun::star::presentation::FadeEffect GetFadeEffect( const SdPage* pPage );
57 
58 public:
59 	static void SetAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue );
60 	static ::com::sun::star::presentation::AnimationEffect GetAnimationEffect( SvxShape* pShape );
61 	static void SetTextAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue );
62 	static ::com::sun::star::presentation::AnimationEffect GetTextAnimationEffect( SvxShape* pShape );
63 	static void SetAnimationSpeed( SvxShape* pShape, ::com::sun::star::presentation::AnimationSpeed eSpeed );
64 	static ::com::sun::star::presentation::AnimationSpeed GetAnimationSpeed( SvxShape* pShape );
65 	static void SetDimColor( SvxShape* pShape, sal_Int32 nColor );
66 	static sal_Int32 GetDimColor( SvxShape* pShape );
67 	static void SetDimHide( SvxShape* pShape, sal_Bool bDimHide );
68 	static sal_Bool GetDimHide( SvxShape* pShape );
69 	static void SetDimPrevious( SvxShape* pShape, sal_Bool bDimPrevious );
70 	static sal_Bool GetDimPrevious( SvxShape* pShape );
71 	static void SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos );
72 	static sal_Int32 GetPresentationOrder( SvxShape* pShape );
73 	static void UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInfo );
74 	static ::rtl::OUString GetSoundFile( SvxShape* pShape );
75 	static sal_Bool GetSoundOn( SvxShape* pShape );
76 
77 	static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj );
78 };
79 
80 } // end of namespace sd
81 
82 #endif
83