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