1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SD_EFFECT_MIGRATION_HXX 29 #define _SD_EFFECT_MIGRATION_HXX 30 31 #include <com/sun/star/presentation/AnimationEffect.hpp> 32 #include <com/sun/star/presentation/AnimationSpeed.hpp> 33 #include <com/sun/star/presentation/FadeEffect.hpp> 34 35 class SdPage; 36 class SvxShape; 37 class SdAnimationInfo; 38 class SdrObject; 39 class SdrPathObj; 40 41 namespace sd { 42 43 /** this helper class gives various methods to convert effects from OOo 1.1 44 and below to and from OOo 2.0 and above 45 */ 46 class EffectMigration 47 { 48 public: 49 static ::com::sun::star::presentation::AnimationSpeed ConvertDuration( double fDuration ); 50 static double ConvertAnimationSpeed( ::com::sun::star::presentation::AnimationSpeed eSpeed ); 51 52 static bool ConvertPreset( const ::rtl::OUString& rPresetId, const ::rtl::OUString* pPresetSubType, ::com::sun::star::presentation::AnimationEffect& rEffect ); 53 static bool ConvertAnimationEffect( const ::com::sun::star::presentation::AnimationEffect& rEffect, ::rtl::OUString& rPresetId, ::rtl::OUString& rPresetSubType ); 54 55 public: 56 void AddEffectFromAnimationInfo( SdrObject* pObject, SdAnimationInfo* pInfo ); 57 58 public: 59 static void SetFadeEffect( SdPage* pPage, ::com::sun::star::presentation::FadeEffect eNewEffect); 60 static ::com::sun::star::presentation::FadeEffect GetFadeEffect( const SdPage* pPage ); 61 62 public: 63 static void SetAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue ); 64 static ::com::sun::star::presentation::AnimationEffect GetAnimationEffect( SvxShape* pShape ); 65 static void SetTextAnimationEffect( SvxShape* pShape, ::com::sun::star::presentation::AnimationEffect eValue ); 66 static ::com::sun::star::presentation::AnimationEffect GetTextAnimationEffect( SvxShape* pShape ); 67 static void SetAnimationSpeed( SvxShape* pShape, ::com::sun::star::presentation::AnimationSpeed eSpeed ); 68 static ::com::sun::star::presentation::AnimationSpeed GetAnimationSpeed( SvxShape* pShape ); 69 static void SetDimColor( SvxShape* pShape, sal_Int32 nColor ); 70 static sal_Int32 GetDimColor( SvxShape* pShape ); 71 static void SetDimHide( SvxShape* pShape, sal_Bool bDimHide ); 72 static sal_Bool GetDimHide( SvxShape* pShape ); 73 static void SetDimPrevious( SvxShape* pShape, sal_Bool bDimPrevious ); 74 static sal_Bool GetDimPrevious( SvxShape* pShape ); 75 static void SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos ); 76 static sal_Int32 GetPresentationOrder( SvxShape* pShape ); 77 static void UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInfo ); 78 static ::rtl::OUString GetSoundFile( SvxShape* pShape ); 79 static sal_Bool GetSoundOn( SvxShape* pShape ); 80 81 static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj ); 82 }; 83 84 } // end of namespace sd 85 86 #endif 87