1*aaef562fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*aaef562fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*aaef562fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*aaef562fSAndrew Rist * distributed with this work for additional information 6*aaef562fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*aaef562fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*aaef562fSAndrew Rist * "License"); you may not use this file except in compliance 9*aaef562fSAndrew Rist * with the License. You may obtain a copy of the License at 10*aaef562fSAndrew Rist * 11*aaef562fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*aaef562fSAndrew Rist * 13*aaef562fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*aaef562fSAndrew Rist * software distributed under the License is distributed on an 15*aaef562fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*aaef562fSAndrew Rist * KIND, either express or implied. See the License for the 17*aaef562fSAndrew Rist * specific language governing permissions and limitations 18*aaef562fSAndrew Rist * under the License. 19*aaef562fSAndrew Rist * 20*aaef562fSAndrew Rist *************************************************************/ 21*aaef562fSAndrew Rist 22*aaef562fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_TRANSITIONFACTORY_HXX 25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_TRANSITIONFACTORY_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/animations/XTransitionFilter.hpp> 28cdf0e10cSrcweir #include <com/sun/star/presentation/XTransitionFactory.hpp> 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include "animatableshape.hxx" 31cdf0e10cSrcweir #include "rgbcolor.hxx" 32cdf0e10cSrcweir #include "slide.hxx" 33cdf0e10cSrcweir #include "screenupdater.hxx" 34cdf0e10cSrcweir #include "animationactivity.hxx" 35cdf0e10cSrcweir #include "activitiesfactory.hxx" 36cdf0e10cSrcweir #include "numberanimation.hxx" 37cdf0e10cSrcweir #include "transitioninfo.hxx" 38cdf0e10cSrcweir #include "soundplayer.hxx" 39cdf0e10cSrcweir 40cdf0e10cSrcweir #include <boost/utility.hpp> 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace slideshow 43cdf0e10cSrcweir { 44cdf0e10cSrcweir namespace internal 45cdf0e10cSrcweir { 46cdf0e10cSrcweir /* Definition of Transitionfactory class */ 47cdf0e10cSrcweir class TransitionFactory : private boost::noncopyable 48cdf0e10cSrcweir { 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir /** Create a transition effect for shapes. 51cdf0e10cSrcweir 52cdf0e10cSrcweir This method creates an AnimationActivity, which, when 53cdf0e10cSrcweir run, performs the requested transition effect on the 54cdf0e10cSrcweir given shape. 55cdf0e10cSrcweir 56cdf0e10cSrcweir @param rParms 57cdf0e10cSrcweir Collection of activity parameters, see ActivitiesFactory 58cdf0e10cSrcweir 59cdf0e10cSrcweir @param rShape 60cdf0e10cSrcweir Shape to animate 61cdf0e10cSrcweir 62cdf0e10cSrcweir @param rShapeManager 63cdf0e10cSrcweir ShapeManager, to manage shape animation 64cdf0e10cSrcweir 65cdf0e10cSrcweir @param xTransition 66cdf0e10cSrcweir The transition effect 67cdf0e10cSrcweir 68cdf0e10cSrcweir @return the created activity, or NULL for no 69cdf0e10cSrcweir transition effect 70cdf0e10cSrcweir */ 71cdf0e10cSrcweir static AnimationActivitySharedPtr createShapeTransition( 72cdf0e10cSrcweir const ActivitiesFactory::CommonParameters& rParms, 73cdf0e10cSrcweir const AnimatableShapeSharedPtr& rShape, 74cdf0e10cSrcweir const ShapeManagerSharedPtr& rShapeManager, 75cdf0e10cSrcweir const ::basegfx::B2DVector& rSlideSize, 76cdf0e10cSrcweir ::com::sun::star::uno::Reference< 77cdf0e10cSrcweir ::com::sun::star::animations::XTransitionFilter > const& xTransition ); 78cdf0e10cSrcweir 79cdf0e10cSrcweir 80cdf0e10cSrcweir /** Create a transition effect for slides. 81cdf0e10cSrcweir 82cdf0e10cSrcweir This method creates a NumberAnimation, which, 83cdf0e10cSrcweir when run, performs the requested transition effect 84cdf0e10cSrcweir with the slide bitmaps. 85cdf0e10cSrcweir 86cdf0e10cSrcweir @param rEnteringBitmap 87cdf0e10cSrcweir Bitmap of the slide which 'enters' the screen. 88cdf0e10cSrcweir 89cdf0e10cSrcweir @param rLeavingBitmap 90cdf0e10cSrcweir Bitmap of the slide which 'leaves' the screen. 91cdf0e10cSrcweir 92cdf0e10cSrcweir @param nTransitionType 93cdf0e10cSrcweir Type of the transition (see XTransitionFilter) 94cdf0e10cSrcweir 95cdf0e10cSrcweir @param nTransitionSubType 96cdf0e10cSrcweir Subtype of the transition (see XTransitionFilter) 97cdf0e10cSrcweir 98cdf0e10cSrcweir @param bTransitionDirection 99cdf0e10cSrcweir Direction of the transition (see XTransitionFilter) 100cdf0e10cSrcweir 101cdf0e10cSrcweir @param rTransitionFadeColor 102cdf0e10cSrcweir Optional fade color for the transition 103cdf0e10cSrcweir 104cdf0e10cSrcweir @return the created animation, or NULL for no 105cdf0e10cSrcweir transition effect 106cdf0e10cSrcweir */ 107cdf0e10cSrcweir static NumberAnimationSharedPtr createSlideTransition( 108cdf0e10cSrcweir const SlideSharedPtr& rLeavingSlide, 109cdf0e10cSrcweir const SlideSharedPtr& rEnteringSlide, 110cdf0e10cSrcweir const UnoViewContainer& rViewContainer, 111cdf0e10cSrcweir ScreenUpdater& rScreenUpdater, 112cdf0e10cSrcweir EventMultiplexer& rEventMultiplexer, 113cdf0e10cSrcweir const com::sun::star::uno::Reference< 114cdf0e10cSrcweir com::sun::star::presentation::XTransitionFactory>& 115cdf0e10cSrcweir xOptionalFactory, 116cdf0e10cSrcweir sal_Int16 nTransitionType, 117cdf0e10cSrcweir sal_Int16 nTransitionSubType, 118cdf0e10cSrcweir bool bTransitionDirection, 119cdf0e10cSrcweir const RGBColor& rTransitionFadeColor, 120cdf0e10cSrcweir const SoundPlayerSharedPtr& rSoundPlayer ); 121cdf0e10cSrcweir 122cdf0e10cSrcweir private: 123cdf0e10cSrcweir static const TransitionInfo* getTransitionInfo( 124cdf0e10cSrcweir sal_Int16 nTransitionType, sal_Int16 nTransitionSubType ); 125cdf0e10cSrcweir static const TransitionInfo* getRandomTransitionInfo(); 126cdf0e10cSrcweir 127cdf0e10cSrcweir static AnimationActivitySharedPtr createShapeTransition( 128cdf0e10cSrcweir const ActivitiesFactory::CommonParameters& rParms, 129cdf0e10cSrcweir const AnimatableShapeSharedPtr& rShape, 130cdf0e10cSrcweir const ShapeManagerSharedPtr& rShapeManager, 131cdf0e10cSrcweir const ::basegfx::B2DVector& rSlideSize, 132cdf0e10cSrcweir ::com::sun::star::uno::Reference< 133cdf0e10cSrcweir ::com::sun::star::animations::XTransitionFilter > const& xTransition, 134cdf0e10cSrcweir sal_Int16 nTransitionType, 135cdf0e10cSrcweir sal_Int16 nTransitionSubType ); 136cdf0e10cSrcweir 137cdf0e10cSrcweir // static factory 138cdf0e10cSrcweir TransitionFactory(); 139cdf0e10cSrcweir ~TransitionFactory(); 140cdf0e10cSrcweir }; 141cdf0e10cSrcweir } 142cdf0e10cSrcweir } 143cdf0e10cSrcweir 144cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_TRANSITIONFACTORY_HXX */ 145