LibreOffice Module slideshow (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
slideshow::internal::EffectRewinder Class Reference

Rewind single effects of the main effect sequence. More...

#include <effectrewinder.hxx>

Collaboration diagram for slideshow::internal::EffectRewinder:
[legend]

Public Member Functions

 EffectRewinder (EventMultiplexer &rEventMultiplexer, EventQueue &rEventQueue, UserEventQueue &rUserEventQueue)
 
 ~EffectRewinder ()
 
void dispose ()
 Call Dispose() before the owner of an EffectRewinder object dies so that the EffectRewinder can release all references to the owner. More...
 
void setRootAnimationNode (const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
 Store the root node of the animation tree. More...
 
void setCurrentSlide (const css::uno::Reference< css::drawing::XDrawPage > &xSlide)
 Store the XDrawPage to reach specific slide properties. More...
 
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. More...
 
void skipAllMainSequenceEffects ()
 Call this method after gotoPreviousEffect() triggered a slide change to the previous slide. More...
 

Private Member Functions

void initialize ()
 
bool resetEffectCount ()
 
bool notifyAnimationStart (const AnimationNodeSharedPtr &rpNode)
 Called by listeners when an animation (not necessarily of a main sequence effect) starts. More...
 
sal_Int32 countMainSequenceEffects ()
 Count the number of effects (or effect groups) in the main effect sequence. More...
 
void skipSingleMainSequenceEffects ()
 Skip the next main sequence effect. More...
 
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. More...
 
void asynchronousRewindToPreviousSlide (const ::std::function< void()> &rPreviousSlideFunctor)
 Go to the previous slide and replay all of its main sequence effects (or effect groups). More...
 

Private Attributes

EventMultiplexermrEventMultiplexer
 
EventQueuemrEventQueue
 
UserEventQueuemrUserEventQueue
 
EventHandlerSharedPtr mpSlideStartHandler
 
EventHandlerSharedPtr mpSlideEndHandler
 
AnimationEventHandlerSharedPtr mpAnimationStartHandler
 
sal_Int32 mnMainSequenceEffectCount
 The number off main sequence effects so far. More...
 
EventSharedPtr mpAsynchronousRewindEvent
 This is the currently scheduled event that executes the asynchronous part of the effect rewinding. More...
 
css::uno::Reference< css::animations::XAnimationNode > mxCurrentAnimationRootNode
 
css::uno::Reference< css::drawing::XDrawPage > mxCurrentSlide
 
::std::shared_ptr< ScreenUpdater::UpdateLockmpPaintLock
 
bool mbNonUserTriggeredMainSequenceEffectSeen
 
bool mbHasAdvancedTimeSetting
 

Detailed Description

Rewind single effects of the main effect sequence.

A rewind is initiated by calling the Rewind() method. Part of the processing is done asynchronously. Multiple EventQueue::update() calls may be necessary to finish a rewind.

Remember to call SetRootAnimationNode() when switching to a different slide so that the EffectRewinder can determine the number of main sequence effects.

Definition at line 48 of file effectrewinder.hxx.

Constructor & Destructor Documentation

◆ EffectRewinder()

slideshow::internal::EffectRewinder::EffectRewinder ( EventMultiplexer rEventMultiplexer,
EventQueue rEventQueue,
UserEventQueue rUserEventQueue 
)

Definition at line 71 of file effectrewinder.cxx.

References initialize().

◆ ~EffectRewinder()

slideshow::internal::EffectRewinder::~EffectRewinder ( )

Definition at line 118 of file effectrewinder.cxx.

References dispose().

Member Function Documentation

◆ asynchronousRewind()

void slideshow::internal::EffectRewinder::asynchronousRewind ( sal_Int32  nEffectCount,
const bool  bRedisplayCurrentSlide,
const ::std::function< void()> &  rSlideRewindFunctor 
)
private

Rewind the last effect of the main effect sequence by replaying all previous effects.

Parameters
nEffectCountThe number of main sequence effects to replay.
bRedisplayCurrentSlideWhen <TRUE> then the current slide is redisplayed before the effects are replayed.
rSlideRewindFunctorThis functor is used to redisplay the current slide.

Definition at line 346 of file effectrewinder.cxx.

References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), slideshow::internal::UserEventQueue::callSkipEffectEventHandler(), slideshow::internal::EventQueue::forceEmpty(), makeEvent, mbHasAdvancedTimeSetting, mbNonUserTriggeredMainSequenceEffectSeen, mpAsynchronousRewindEvent, mpPaintLock, mrEventQueue, mrUserEventQueue, and skipSingleMainSequenceEffects().

Referenced by asynchronousRewind(), rewind(), and skipAllMainSequenceEffects().

◆ asynchronousRewindToPreviousSlide()

void slideshow::internal::EffectRewinder::asynchronousRewindToPreviousSlide ( const ::std::function< void()> &  rPreviousSlideFunctor)
private

Go to the previous slide and replay all of its main sequence effects (or effect groups).

Parameters
rPreviousSlideFunctorThis functor is used to go to the previous slide.

Definition at line 393 of file effectrewinder.cxx.

References mpAsynchronousRewindEvent.

Referenced by rewind().

◆ countMainSequenceEffects()

sal_Int32 slideshow::internal::EffectRewinder::countMainSequenceEffects ( )
private

Count the number of effects (or effect groups) in the main effect sequence.

Definition at line 254 of file effectrewinder.cxx.

References aEvent, and mxCurrentAnimationRootNode.

Referenced by skipAllMainSequenceEffects().

◆ dispose()

void slideshow::internal::EffectRewinder::dispose ( void  )

◆ initialize()

void slideshow::internal::EffectRewinder::initialize ( )
private

◆ notifyAnimationStart()

bool slideshow::internal::EffectRewinder::notifyAnimationStart ( const AnimationNodeSharedPtr rpNode)
private

Called by listeners when an animation (not necessarily of a main sequence effect) starts.

Definition at line 313 of file effectrewinder.cxx.

References aEvent, mbNonUserTriggeredMainSequenceEffectSeen, and mnMainSequenceEffectCount.

Referenced by initialize().

◆ resetEffectCount()

bool slideshow::internal::EffectRewinder::resetEffectCount ( )
private

Definition at line 306 of file effectrewinder.cxx.

References mnMainSequenceEffectCount.

Referenced by initialize().

◆ rewind()

bool slideshow::internal::EffectRewinder::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.

When the current slide has not effects or no main sequence effect has yet been played then switch to the previous slide and replay all of its main sequence effects. The caller has to pass two functors that redisplay the current slide or switch to the previous slide so that it does not have to expose its internals to us. Only one of the two functors is called.

Parameters
rpPaintLockThis paint lock is released after the whole asynchronous process of rewinding the current effect is completed. It prevents intermediate repaints that would show partial replay of effects.
rSlideRewindFunctorThis functor is called when the current slide is to be redisplayed. When it is called then the other functor is not called.
rPreviousSlideFunctorThis functor is called to switch to the previous slide. When it is called then the other functor is not called.

Definition at line 173 of file effectrewinder.cxx.

References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), asynchronousRewindToPreviousSlide(), slideshow::internal::UserEventQueue::callSkipEffectEventHandler(), slideshow::internal::EventQueue::forceEmpty(), makeEvent, mbHasAdvancedTimeSetting, mnMainSequenceEffectCount, mpAsynchronousRewindEvent, mpPaintLock, mrEventQueue, and mrUserEventQueue.

◆ setCurrentSlide()

void slideshow::internal::EffectRewinder::setCurrentSlide ( const css::uno::Reference< css::drawing::XDrawPage > &  xSlide)

Store the XDrawPage to reach specific slide properties.

Definition at line 158 of file effectrewinder.cxx.

References slideshow::internal::getPropertyValue(), mbHasAdvancedTimeSetting, and mxCurrentSlide.

◆ setRootAnimationNode()

void slideshow::internal::EffectRewinder::setRootAnimationNode ( const css::uno::Reference< css::animations::XAnimationNode > &  xRootNode)

Store the root node of the animation tree.

It is used in CountMainSequenceEffects() to count the number of main sequence effects (or effect groups.)

Definition at line 152 of file effectrewinder.cxx.

References mxCurrentAnimationRootNode.

◆ skipAllMainSequenceEffects()

void slideshow::internal::EffectRewinder::skipAllMainSequenceEffects ( )

Call this method after gotoPreviousEffect() triggered a slide change to the previous slide.

Definition at line 232 of file effectrewinder.cxx.

References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), countMainSequenceEffects(), makeEvent, mpAsynchronousRewindEvent, and mrEventQueue.

◆ skipSingleMainSequenceEffects()

void slideshow::internal::EffectRewinder::skipSingleMainSequenceEffects ( )
private

Member Data Documentation

◆ mbHasAdvancedTimeSetting

bool slideshow::internal::EffectRewinder::mbHasAdvancedTimeSetting
private

Definition at line 129 of file effectrewinder.hxx.

Referenced by asynchronousRewind(), rewind(), and setCurrentSlide().

◆ mbNonUserTriggeredMainSequenceEffectSeen

bool slideshow::internal::EffectRewinder::mbNonUserTriggeredMainSequenceEffectSeen
private

Definition at line 128 of file effectrewinder.hxx.

Referenced by asynchronousRewind(), and notifyAnimationStart().

◆ mnMainSequenceEffectCount

sal_Int32 slideshow::internal::EffectRewinder::mnMainSequenceEffectCount
private

The number off main sequence effects so far.

Definition at line 116 of file effectrewinder.hxx.

Referenced by notifyAnimationStart(), resetEffectCount(), and rewind().

◆ mpAnimationStartHandler

AnimationEventHandlerSharedPtr slideshow::internal::EffectRewinder::mpAnimationStartHandler
private

Definition at line 112 of file effectrewinder.hxx.

Referenced by dispose(), and initialize().

◆ mpAsynchronousRewindEvent

EventSharedPtr slideshow::internal::EffectRewinder::mpAsynchronousRewindEvent
private

This is the currently scheduled event that executes the asynchronous part of the effect rewinding.

It is also used as flag that prevents nested rewinds.

Definition at line 122 of file effectrewinder.hxx.

Referenced by asynchronousRewind(), asynchronousRewindToPreviousSlide(), dispose(), rewind(), and skipAllMainSequenceEffects().

◆ mpPaintLock

::std::shared_ptr<ScreenUpdater::UpdateLock> slideshow::internal::EffectRewinder::mpPaintLock
private

Definition at line 126 of file effectrewinder.hxx.

Referenced by asynchronousRewind(), and rewind().

◆ mpSlideEndHandler

EventHandlerSharedPtr slideshow::internal::EffectRewinder::mpSlideEndHandler
private

Definition at line 111 of file effectrewinder.hxx.

Referenced by dispose(), and initialize().

◆ mpSlideStartHandler

EventHandlerSharedPtr slideshow::internal::EffectRewinder::mpSlideStartHandler
private

Definition at line 110 of file effectrewinder.hxx.

Referenced by dispose(), and initialize().

◆ mrEventMultiplexer

EventMultiplexer& slideshow::internal::EffectRewinder::mrEventMultiplexer
private

Definition at line 106 of file effectrewinder.hxx.

Referenced by dispose(), initialize(), and skipSingleMainSequenceEffects().

◆ mrEventQueue

EventQueue& slideshow::internal::EffectRewinder::mrEventQueue
private

◆ mrUserEventQueue

UserEventQueue& slideshow::internal::EffectRewinder::mrUserEventQueue
private

Definition at line 108 of file effectrewinder.hxx.

Referenced by asynchronousRewind(), rewind(), and skipSingleMainSequenceEffects().

◆ mxCurrentAnimationRootNode

css::uno::Reference<css::animations::XAnimationNode> slideshow::internal::EffectRewinder::mxCurrentAnimationRootNode
private

Definition at line 124 of file effectrewinder.hxx.

Referenced by countMainSequenceEffects(), and setRootAnimationNode().

◆ mxCurrentSlide

css::uno::Reference<css::drawing::XDrawPage> slideshow::internal::EffectRewinder::mxCurrentSlide
private

Definition at line 125 of file effectrewinder.hxx.

Referenced by setCurrentSlide().


The documentation for this class was generated from the following files: