Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / activities / activityparameters.hxx
blob0644ccf859131602d9b01eb39f7bb032729ebe56
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_ACTIVITYPARAMETERS_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_ACTIVITYPARAMETERS_HXX
23 #include <event.hxx>
24 #include <eventqueue.hxx>
25 #include <expressionnode.hxx>
26 #include <wakeupevent.hxx>
28 #include <boost/optional.hpp>
29 #include <vector>
31 namespace slideshow {
32 namespace internal {
34 /** Parameter struct for animation activities
36 This struct contains all common parameters needed to
37 initialize the activities generated by the ActivityFactory.
39 struct ActivityParameters
41 /** Create
43 @param rEndEvent
44 Event to be fired, when the activity ends.
46 @param rEventQueue
47 Queue to add end event to
49 @param nMinDuration
50 Minimal duration of the activity (might actually be
51 longer because of nMinNumberOfFrames). Note that this
52 duration must always be the <em>simple</em> duration,
53 i.e. without any repeat.
55 @param rRepeats
56 Number of repeats. If this parameter is invalid,
57 infinite repeat is assumed.
59 @param nAccelerationFraction
60 Value between 0 and 1, denoting the fraction of the
61 total simple duration, which the animation should
62 accelerate.
64 @param nDecelerationFraction
65 Value between 0 and 1, denoting the fraction of the
66 total simple duration, which the animation should
67 decelerate. Note that the ranges
68 [0,nAccelerationFraction] and
69 [nDecelerationFraction,1] must be non-overlapping!
71 @param bAutoReverse
72 When true, at the end of the simple duration, the
73 animation plays reversed to the start value. Note that
74 nMinDuration still specifies the simple duration,
75 i.e. when bAutoReverse is true, the implicit duration
76 doubles.
78 ActivityParameters(
79 const EventSharedPtr& rEndEvent,
80 EventQueue& rEventQueue,
81 ActivitiesQueue& rActivitiesQueue,
82 double nMinDuration,
83 ::boost::optional<double> const& rRepeats,
84 double nAccelerationFraction,
85 double nDecelerationFraction,
86 sal_uInt32 nMinNumberOfFrames,
87 bool bAutoReverse )
88 : mrEndEvent( rEndEvent ),
89 mpWakeupEvent(),
90 mrEventQueue( rEventQueue ),
91 mrActivitiesQueue( rActivitiesQueue ),
92 mpFormula(),
93 maDiscreteTimes(),
94 mnMinDuration( nMinDuration ),
95 mrRepeats( rRepeats ),
96 mnAccelerationFraction( nAccelerationFraction ),
97 mnDecelerationFraction( nDecelerationFraction ),
98 mnMinNumberOfFrames( nMinNumberOfFrames ),
99 mbAutoReverse( bAutoReverse ) {}
101 /// End event to fire, when activity is over
102 const EventSharedPtr& mrEndEvent;
103 /// Wakeup event to use for discrete activities
104 WakeupEventSharedPtr mpWakeupEvent;
106 /// EventQueue to add events to
107 EventQueue& mrEventQueue;
109 /// ActivitiesQueue to add events to
110 ActivitiesQueue& mrActivitiesQueue;
112 /// Optional formula
113 std::shared_ptr<ExpressionNode> mpFormula;
115 /// Key times, for discrete and key time activities
116 ::std::vector< double > maDiscreteTimes;
118 /// Total duration of activity (including all repeats)
119 const double mnMinDuration;
120 ::boost::optional<double> const& mrRepeats;
121 const double mnAccelerationFraction;
122 const double mnDecelerationFraction;
124 /// Minimal number of frames this activity must render
125 const sal_uInt32 mnMinNumberOfFrames;
127 /// When true, activity is played reversed after mnDuration.
128 const bool mbAutoReverse;
131 } // namespace internal
132 } // namespace presentation
134 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_ACTIVITYPARAMETERS_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */