1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_ACTIVITYPARAMETERS_HXX 29*cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_ACTIVITYPARAMETERS_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "event.hxx" 32*cdf0e10cSrcweir #include "eventqueue.hxx" 33*cdf0e10cSrcweir #include "expressionnode.hxx" 34*cdf0e10cSrcweir #include "wakeupevent.hxx" 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir #include <boost/optional.hpp> 37*cdf0e10cSrcweir #include <vector> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir namespace slideshow { 40*cdf0e10cSrcweir namespace internal { 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir /** Parameter struct for animation activities 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir This struct contains all common parameters needed to 45*cdf0e10cSrcweir initialize the activities generated by the ActivityFactory. 46*cdf0e10cSrcweir */ 47*cdf0e10cSrcweir struct ActivityParameters 48*cdf0e10cSrcweir { 49*cdf0e10cSrcweir /** Create 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir @param rEndEvent 52*cdf0e10cSrcweir Event to be fired, when the activity ends. 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir @param rEventQueue 55*cdf0e10cSrcweir Queue to add end event to 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir @param nMinDuration 58*cdf0e10cSrcweir Minimal duration of the activity (might actually be 59*cdf0e10cSrcweir longer because of nMinNumberOfFrames). Note that this 60*cdf0e10cSrcweir duration must always be the <em>simple</em> duration, 61*cdf0e10cSrcweir i.e. without any repeat. 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir @param rRepeats 64*cdf0e10cSrcweir Number of repeats. If this parameter is invalid, 65*cdf0e10cSrcweir infinite repeat is assumed. 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir @param nAccelerationFraction 68*cdf0e10cSrcweir Value between 0 and 1, denoting the fraction of the 69*cdf0e10cSrcweir total simple duration, which the animation should 70*cdf0e10cSrcweir accelerate. 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir @param nDecelerationFraction 73*cdf0e10cSrcweir Value between 0 and 1, denoting the fraction of the 74*cdf0e10cSrcweir total simple duration, which the animation should 75*cdf0e10cSrcweir decelerate. Note that the ranges 76*cdf0e10cSrcweir [0,nAccelerationFraction] and 77*cdf0e10cSrcweir [nDecelerationFraction,1] must be non-overlapping! 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir @param bAutoReverse 80*cdf0e10cSrcweir When true, at the end of the simple duration, the 81*cdf0e10cSrcweir animation plays reversed to the start value. Note that 82*cdf0e10cSrcweir nMinDuration still specifies the simple duration, 83*cdf0e10cSrcweir i.e. when bAutoReverse is true, the implicit duration 84*cdf0e10cSrcweir doubles. 85*cdf0e10cSrcweir */ 86*cdf0e10cSrcweir ActivityParameters( 87*cdf0e10cSrcweir const EventSharedPtr& rEndEvent, 88*cdf0e10cSrcweir EventQueue& rEventQueue, 89*cdf0e10cSrcweir ActivitiesQueue& rActivitiesQueue, 90*cdf0e10cSrcweir double nMinDuration, 91*cdf0e10cSrcweir ::boost::optional<double> const& rRepeats, 92*cdf0e10cSrcweir double nAccelerationFraction, 93*cdf0e10cSrcweir double nDecelerationFraction, 94*cdf0e10cSrcweir sal_uInt32 nMinNumberOfFrames, 95*cdf0e10cSrcweir bool bAutoReverse ) 96*cdf0e10cSrcweir : mrEndEvent( rEndEvent ), 97*cdf0e10cSrcweir mpWakeupEvent(), 98*cdf0e10cSrcweir mrEventQueue( rEventQueue ), 99*cdf0e10cSrcweir mrActivitiesQueue( rActivitiesQueue ), 100*cdf0e10cSrcweir mpFormula(), 101*cdf0e10cSrcweir maDiscreteTimes(), 102*cdf0e10cSrcweir mnMinDuration( nMinDuration ), 103*cdf0e10cSrcweir mrRepeats( rRepeats ), 104*cdf0e10cSrcweir mnAccelerationFraction( nAccelerationFraction ), 105*cdf0e10cSrcweir mnDecelerationFraction( nDecelerationFraction ), 106*cdf0e10cSrcweir mnMinNumberOfFrames( nMinNumberOfFrames ), 107*cdf0e10cSrcweir mbAutoReverse( bAutoReverse ) {} 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir /// End event to fire, when activity is over 110*cdf0e10cSrcweir const EventSharedPtr& mrEndEvent; 111*cdf0e10cSrcweir /// Wakeup event to use for discrete activities 112*cdf0e10cSrcweir WakeupEventSharedPtr mpWakeupEvent; 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir /// EventQueue to add events to 115*cdf0e10cSrcweir EventQueue& mrEventQueue; 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir /// ActivitiesQueue to add events to 118*cdf0e10cSrcweir ActivitiesQueue& mrActivitiesQueue; 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir /// Optional formula 121*cdf0e10cSrcweir ExpressionNodeSharedPtr mpFormula; 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir /// Key times, for discrete and key time activities 124*cdf0e10cSrcweir ::std::vector< double > maDiscreteTimes; 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir /// Total duration of activity (including all repeats) 127*cdf0e10cSrcweir const double mnMinDuration; 128*cdf0e10cSrcweir ::boost::optional<double> const& mrRepeats; 129*cdf0e10cSrcweir const double mnAccelerationFraction; 130*cdf0e10cSrcweir const double mnDecelerationFraction; 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir /// Minimal number of frames this activity must render 133*cdf0e10cSrcweir const sal_uInt32 mnMinNumberOfFrames; 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir /// When true, activity is played reversed after mnDuration. 136*cdf0e10cSrcweir const bool mbAutoReverse; 137*cdf0e10cSrcweir }; 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir } // namespace internal 140*cdf0e10cSrcweir } // namespace presentation 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_ACTIVITYPARAMETERS_HXX */ 143*cdf0e10cSrcweir 144