tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / slideshow / source / engine / activities / activityparameters.hxx
blob9df7628385309a2607455c66ec72bbef704d1345
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 <optional>
29 #include <vector>
31 namespace slideshow::internal {
33 /** Parameter struct for animation activities
35 This struct contains all common parameters needed to
36 initialize the activities generated by the ActivityFactory.
38 struct ActivityParameters
40 /** Create
42 @param rEndEvent
43 Event to be fired, when the activity ends.
45 @param rEventQueue
46 Queue to add end event to
48 @param nMinDuration
49 Minimal duration of the activity (might actually be
50 longer because of nMinNumberOfFrames). Note that this
51 duration must always be the <em>simple</em> duration,
52 i.e. without any repeat.
54 @param rRepeats
55 Number of repeats. If this parameter is invalid,
56 infinite repeat is assumed.
58 @param nAccelerationFraction
59 Value between 0 and 1, denoting the fraction of the
60 total simple duration, which the animation should
61 accelerate.
63 @param nDecelerationFraction
64 Value between 0 and 1, denoting the fraction of the
65 total simple duration, which the animation should
66 decelerate. Note that the ranges
67 [0,nAccelerationFraction] and
68 [nDecelerationFraction,1] must be non-overlapping!
70 @param bAutoReverse
71 When true, at the end of the simple duration, the
72 animation plays reversed to the start value. Note that
73 nMinDuration still specifies the simple duration,
74 i.e. when bAutoReverse is true, the implicit duration
75 doubles.
77 ActivityParameters(
78 const EventSharedPtr& rEndEvent,
79 EventQueue& rEventQueue,
80 ActivitiesQueue& rActivitiesQueue,
81 double nMinDuration,
82 ::std::optional<double> const& rRepeats,
83 double nAccelerationFraction,
84 double nDecelerationFraction,
85 sal_uInt32 nMinNumberOfFrames,
86 bool bAutoReverse )
87 : mrEndEvent( rEndEvent ),
88 mpWakeupEvent(),
89 mrEventQueue( rEventQueue ),
90 mrActivitiesQueue( rActivitiesQueue ),
91 mpFormula(),
92 maDiscreteTimes(),
93 mnMinDuration( nMinDuration ),
94 mrRepeats( rRepeats ),
95 mnAccelerationFraction( nAccelerationFraction ),
96 mnDecelerationFraction( nDecelerationFraction ),
97 mnMinNumberOfFrames( nMinNumberOfFrames ),
98 mbAutoReverse( bAutoReverse ) {}
100 /// End event to fire, when activity is over
101 const EventSharedPtr& mrEndEvent;
102 /// Wakeup event to use for discrete activities
103 WakeupEventSharedPtr mpWakeupEvent;
105 /// EventQueue to add events to
106 EventQueue& mrEventQueue;
108 /// ActivitiesQueue to add events to
109 ActivitiesQueue& mrActivitiesQueue;
111 /// Optional formula
112 std::shared_ptr<ExpressionNode> mpFormula;
114 /// Key times, for discrete and key time activities
115 ::std::vector< double > maDiscreteTimes;
117 /// Total duration of activity (including all repeats)
118 const double mnMinDuration;
119 ::std::optional<double> const& mrRepeats;
120 const double mnAccelerationFraction;
121 const double mnDecelerationFraction;
123 /// Minimal number of frames this activity must render
124 const sal_uInt32 mnMinNumberOfFrames;
126 /// When true, activity is played reversed after mnDuration.
127 const bool mbAutoReverse;
130 } // namespace presentation::internal
132 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_ACTIVITYPARAMETERS_HXX
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */