LibreOffice Module slideshow (master) 1
effectrewinder.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_EFFECTREWINDER_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_EFFECTREWINDER_HXX
22
23#include <animationnode.hxx>
24#include <eventhandler.hxx>
26#include <event.hxx>
27#include <screenupdater.hxx>
28#include <com/sun/star/drawing/XDrawPage.hpp>
29
30#include <functional>
31#include <memory>
32
33namespace slideshow::internal {
34
35class EventMultiplexer;
36class EventQueue;
37class UserEventQueue;
38
49{
50public:
52 EventMultiplexer& rEventMultiplexer,
53 EventQueue& rEventQueue,
54 UserEventQueue& rUserEventQueue);
56
61 void dispose();
62
68 const css::uno::Reference<css::animations::XAnimationNode>& xRootNode);
69
72 void setCurrentSlide (
73 const css::uno::Reference<css::drawing::XDrawPage>& xSlide);
74
95 bool rewind (
96 const ::std::shared_ptr<ScreenUpdater::UpdateLock>& rpPaintLock,
97 const ::std::function<void ()>& rSlideRewindFunctor,
98 const ::std::function<void ()>& rPreviousSlideFunctor);
99
104
105private:
109
113
117
123
124 css::uno::Reference<css::animations::XAnimationNode> mxCurrentAnimationRootNode;
125 css::uno::Reference<css::drawing::XDrawPage> mxCurrentSlide;
126 ::std::shared_ptr<ScreenUpdater::UpdateLock> mpPaintLock;
127
129 bool mbHasAdvancedTimeSetting; // Slide has advanced time setting or not.
130
131 void initialize();
132
133 bool resetEffectCount();
137 bool notifyAnimationStart (const AnimationNodeSharedPtr& rpNode);
138
142 sal_Int32 countMainSequenceEffects();
143
147
158 void asynchronousRewind (
159 sal_Int32 nEffectCount,
160 const bool bRedisplayCurrentSlide,
161 const ::std::function<void ()>& rSlideRewindFunctor);
162
169 const ::std::function<void ()>& rPreviousSlideFunctor);
170};
171
172} // end of namespace ::slideshow::internal
173
174#endif
175
176/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Rewind single effects of the main effect sequence.
void asynchronousRewindToPreviousSlide(const ::std::function< void()> &rPreviousSlideFunctor)
Go to the previous slide and replay all of its main sequence effects (or effect groups).
EventHandlerSharedPtr mpSlideEndHandler
sal_Int32 countMainSequenceEffects()
Count the number of effects (or effect groups) in the main effect sequence.
void skipSingleMainSequenceEffects()
Skip the next main sequence effect.
css::uno::Reference< css::animations::XAnimationNode > mxCurrentAnimationRootNode
void asynchronousRewind(sal_Int32 nEffectCount, const bool bRedisplayCurrentSlide, const ::std::function< void()> &rSlideRewindFunctor)
Rewind the last effect of the main effect sequence by replaying all previous effects.
void setRootAnimationNode(const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
Store the root node of the animation tree.
sal_Int32 mnMainSequenceEffectCount
The number off main sequence effects so far.
css::uno::Reference< css::drawing::XDrawPage > mxCurrentSlide
bool notifyAnimationStart(const AnimationNodeSharedPtr &rpNode)
Called by listeners when an animation (not necessarily of a main sequence effect) starts.
void dispose()
Call Dispose() before the owner of an EffectRewinder object dies so that the EffectRewinder can relea...
void skipAllMainSequenceEffects()
Call this method after gotoPreviousEffect() triggered a slide change to the previous slide.
EffectRewinder(EventMultiplexer &rEventMultiplexer, EventQueue &rEventQueue, UserEventQueue &rUserEventQueue)
AnimationEventHandlerSharedPtr mpAnimationStartHandler
void setCurrentSlide(const css::uno::Reference< css::drawing::XDrawPage > &xSlide)
Store the XDrawPage to reach specific slide properties.
EventHandlerSharedPtr mpSlideStartHandler
EventSharedPtr mpAsynchronousRewindEvent
This is the currently scheduled event that executes the asynchronous part of the effect rewinding.
bool rewind(const ::std::shared_ptr< ScreenUpdater::UpdateLock > &rpPaintLock, const ::std::function< void()> &rSlideRewindFunctor, const ::std::function< void()> &rPreviousSlideFunctor)
Rewind one effect of the main effect sequence.
::std::shared_ptr< ScreenUpdater::UpdateLock > mpPaintLock
This class multiplexes user-activated and slide-show global events.
This class handles events in a presentation.
Definition: eventqueue.hxx:41
This class schedules user-activated events.
::std::shared_ptr< EventHandler > EventHandlerSharedPtr
::std::shared_ptr< AnimationNode > AnimationNodeSharedPtr
::std::shared_ptr< Event > EventSharedPtr
Definition: event.hxx:76
::std::shared_ptr< AnimationEventHandler > AnimationEventHandlerSharedPtr