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

This interface extends AnimationNode with some file-private accessor methods. More...

#include <basenode.hxx>

Inheritance diagram for slideshow::internal::BaseNode:
[legend]
Collaboration diagram for slideshow::internal::BaseNode:
[legend]

Classes

class  StateTransition
 state transition handling More...
 

Public Member Functions

 BaseNode (css::uno::Reference< css::animations::XAnimationNode > const &xNode, BaseContainerNodeSharedPtr pParent, NodeContext const &rContext)
 
 BaseNode (const BaseNode &)=delete
 
BaseNodeoperator= (const BaseNode &)=delete
 
void setSelf (const BaseNodeSharedPtr &rSelf)
 Provide the node with a shared_ptr to itself. More...
 
virtual void showState () const
 
virtual const char * getDescription () const
 
const ::std::shared_ptr< BaseContainerNode > & getParentNode () const
 
virtual void dispose () override
 Dispose all object references. More...
 
virtual bool init () override
 Init this node. More...
 
virtual bool resolve () override
 Resolve node start time. More...
 
virtual void activate () override
 Immediately start this node. More...
 
virtual void deactivate () override
 Immediately stop this node. More...
 
virtual void end () override
 End the animation on this node. More...
 
virtual css::uno::Reference< css::animations::XAnimationNode > getXAnimationNode () const override
 Query the corresponding XAnimationNode. More...
 
virtual NodeState getState () const override
 Query node state. More...
 
virtual bool registerDeactivatingListener (const AnimationNodeSharedPtr &rNotifee) override
 Register a deactivating listener. More...
 
virtual void notifyDeactivating (const AnimationNodeSharedPtr &rNotifier) override
 Called to notify another AnimationNode's deactivation. More...
 
bool isMainSequenceRootNode () const
 
sal_Int16 getFillMode ()
 Get the node's fill mode. More...
 
virtual void removeEffect () override
 Called by the container to remove the animation effect to make the painted shape correct if it restart because of repeat or rewind ( fill mode is AnimationFill::REMOVE ) to start state. More...
 
- Public Member Functions inherited from slideshow::internal::AnimationNode
virtual css::uno::Reference< css::animations::XAnimationNode > getXAnimationNode () const =0
 Query the corresponding XAnimationNode. More...
 
virtual bool init ()=0
 Init this node. More...
 
virtual bool resolve ()=0
 Resolve node start time. More...
 
virtual void activate ()=0
 Immediately start this node. More...
 
virtual void deactivate ()=0
 Immediately stop this node. More...
 
virtual void end ()=0
 End the animation on this node. More...
 
virtual NodeState getState () const =0
 Query node state. More...
 
virtual bool registerDeactivatingListener (const AnimationNodeSharedPtr &rNotifee)=0
 Register a deactivating listener. More...
 
virtual void notifyDeactivating (const AnimationNodeSharedPtr &rNotifier)=0
 Called to notify another AnimationNode's deactivation. More...
 
virtual void removeEffect ()=0
 Called by the container to remove the animation effect to make the painted shape correct if it restart because of repeat or rewind ( fill mode is AnimationFill::REMOVE ) to start state. More...
 
virtual bool hasPendingAnimation () const =0
 Query node whether it has an animation pending. More...
 
- Public Member Functions inherited from slideshow::internal::Disposable
virtual ~Disposable ()
 
virtual void dispose ()=0
 Dispose all object references. More...
 

Protected Member Functions

void scheduleDeactivationEvent (EventSharedPtr const &pEvent=EventSharedPtr())
 
SlideShowContext const & getContext () const
 
::std::shared_ptr< BaseNode > const & getSelf () const
 
bool checkValidNode () const
 

Private Member Functions

virtual bool init_st ()
 
virtual bool resolve_st ()
 
virtual void activate_st ()
 
virtual void deactivate_st (NodeState eDestState)
 
void notifyEndListeners () const
 notifies More...
 
sal_Int16 getRestartMode ()
 Get the node's restart mode. More...
 
sal_Int16 getRestartDefaultMode () const
 Get the default restart mode. More...
 
sal_Int16 getFillDefaultMode () const
 Get the default fill mode. More...
 
bool isTransition (NodeState eFromState, NodeState eToState, bool debugAssert=true) const
 
bool inStateOrTransition (int mask) const
 

Private Attributes

SlideShowContext maContext
 
::std::vector< AnimationNodeSharedPtrmaDeactivatingListeners
 
css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode
 
::std::shared_ptr< BaseContainerNodempParent
 
::std::shared_ptr< BaseNodempSelf
 
const intmpStateTransitionTable
 
const double mnStartDelay
 
NodeState meCurrState
 
int meCurrentStateTransition
 
EventSharedPtr mpCurrentEvent
 
const bool mbIsMainSequenceRootNode
 

Friends

class StateTransition
 

Additional Inherited Members

- Public Types inherited from slideshow::internal::AnimationNode
enum  NodeState {
  INVALID = 0 ,
  UNRESOLVED = 1 ,
  RESOLVED = 2 ,
  ACTIVE = 4 ,
  FROZEN = 8 ,
  ENDED = 16
}
 The current state of this AnimationNode. More...
 

Detailed Description

This interface extends AnimationNode with some file-private accessor methods.

Definition at line 81 of file basenode.hxx.

Constructor & Destructor Documentation

◆ BaseNode() [1/2]

slideshow::internal::BaseNode::BaseNode ( css::uno::Reference< css::animations::XAnimationNode > const &  xNode,
BaseContainerNodeSharedPtr  pParent,
NodeContext const &  rContext 
)

◆ BaseNode() [2/2]

slideshow::internal::BaseNode::BaseNode ( const BaseNode )
delete

Member Function Documentation

◆ activate()

void slideshow::internal::BaseNode::activate ( )
overridevirtual

◆ activate_st()

void slideshow::internal::BaseNode::activate_st ( )
privatevirtual

◆ checkValidNode()

bool slideshow::internal::BaseNode::checkValidNode ( ) const
inlineprotected

◆ deactivate()

void slideshow::internal::BaseNode::deactivate ( )
overridevirtual

◆ deactivate_st()

void slideshow::internal::BaseNode::deactivate_st ( NodeState  eDestState)
privatevirtual

◆ dispose()

void slideshow::internal::BaseNode::dispose ( )
overridevirtual

◆ end()

void slideshow::internal::BaseNode::end ( )
overridevirtual

End the animation on this node.

This method force-ends animation on this node. Parents may call this for their children, if their active duration ends. An ended animation will no longer have any effect on the shape attributes. The node will change its state to ENDED.

Implements slideshow::internal::AnimationNode.

Definition at line 597 of file basenode.cxx.

References checkValidNode(), slideshow::internal::BaseNode::StateTransition::commit(), deactivate_st(), slideshow::internal::AnimationNode::ENDED, slideshow::internal::BaseNode::StateTransition::enter(), slideshow::internal::BaseNode::StateTransition::FORCE, slideshow::internal::AnimationNode::FROZEN, inStateOrTransition(), isTransition(), meCurrState, mpCurrentEvent, and notifyEndListeners().

Referenced by deactivate().

◆ getContext()

SlideShowContext const & slideshow::internal::BaseNode::getContext ( ) const
inlineprotected

◆ getDescription()

const char * slideshow::internal::BaseNode::getDescription ( ) const
virtual

◆ getFillDefaultMode()

sal_Int16 slideshow::internal::BaseNode::getFillDefaultMode ( ) const
private

Get the default fill mode.

If this node's default mode is AnimationFill::DEFAULT, this method recursively calls the parent node.

Definition at line 386 of file basenode.cxx.

References mpParent, and mxAnimationNode.

Referenced by getFillMode().

◆ getFillMode()

sal_Int16 slideshow::internal::BaseNode::getFillMode ( )

◆ getParentNode()

const ::std::shared_ptr< BaseContainerNode > & slideshow::internal::BaseNode::getParentNode ( ) const
inline

Definition at line 106 of file basenode.hxx.

References mpParent.

◆ getRestartDefaultMode()

sal_Int16 slideshow::internal::BaseNode::getRestartDefaultMode ( ) const
private

Get the default restart mode.

If this node's default mode is AnimationRestart::DEFAULT, this method recursively calls the parent node.

Definition at line 397 of file basenode.cxx.

References mpParent, and mxAnimationNode.

Referenced by getRestartMode().

◆ getRestartMode()

sal_Int16 slideshow::internal::BaseNode::getRestartMode ( )
private

Get the node's restart mode.

Definition at line 356 of file basenode.cxx.

References getRestartDefaultMode(), and mxAnimationNode.

◆ getSelf()

::std::shared_ptr< BaseNode > const & slideshow::internal::BaseNode::getSelf ( ) const
inlineprotected

◆ getState()

AnimationNode::NodeState slideshow::internal::BaseNode::getState ( ) const
overridevirtual

Query node state.

Returns
the current state of this animation node.

Implements slideshow::internal::AnimationNode.

Definition at line 655 of file basenode.cxx.

References meCurrState.

Referenced by slideshow::internal::BaseContainerNode::notifyDeactivatedChild(), slideshow::internal::BaseContainerNode::repeat(), and showState().

◆ getXAnimationNode()

uno::Reference< animations::XAnimationNode > slideshow::internal::BaseNode::getXAnimationNode ( ) const
overridevirtual

Query the corresponding XAnimationNode.

Implements slideshow::internal::AnimationNode.

Definition at line 408 of file basenode.cxx.

References mxAnimationNode.

Referenced by slideshow::internal::AnimationAudioNode::activate_st(), and slideshow::internal::BaseContainerNode::init_st().

◆ init()

bool slideshow::internal::BaseNode::init ( )
overridevirtual

Init this node.

If this node is not in state INVALID, init() sets up the node state and schedules necessary events. If this node has children, they have their init() called, too. You will call this method whenever a slide is going to be shown.

Returns
true, if init was successful; state has changed to UNRESOLVED

Implements slideshow::internal::AnimationNode.

Definition at line 413 of file basenode.cxx.

References checkValidNode(), init_st(), meCurrState, mpCurrentEvent, and slideshow::internal::AnimationNode::UNRESOLVED.

◆ init_st()

bool slideshow::internal::BaseNode::init_st ( )
privatevirtual

Reimplemented in slideshow::internal::AnimationBaseNode, and slideshow::internal::BaseContainerNode.

Definition at line 426 of file basenode.cxx.

Referenced by init().

◆ inStateOrTransition()

bool slideshow::internal::BaseNode::inStateOrTransition ( int  mask) const
inlineprivate

Definition at line 185 of file basenode.hxx.

References meCurrentStateTransition, and meCurrState.

Referenced by activate(), deactivate(), end(), and resolve().

◆ isMainSequenceRootNode()

bool slideshow::internal::BaseNode::isMainSequenceRootNode ( ) const
inline

◆ isTransition()

bool slideshow::internal::BaseNode::isTransition ( NodeState  eFromState,
NodeState  eToState,
bool  debugAssert = true 
) const
inlineprivate

◆ notifyDeactivating()

void slideshow::internal::BaseNode::notifyDeactivating ( const AnimationNodeSharedPtr rNotifier)
overridevirtual

Called to notify another AnimationNode's deactivation.

Parameters
rNotifierThe instance who calls this method.

Implements slideshow::internal::AnimationNode.

Reimplemented in slideshow::internal::ParallelTimeContainer, slideshow::internal::SequentialTimeContainer, and slideshow::internal::BaseContainerNode.

Definition at line 627 of file basenode.cxx.

References slideshow::internal::AnimationNode::ENDED, and slideshow::internal::AnimationNode::FROZEN.

◆ notifyEndListeners()

void slideshow::internal::BaseNode::notifyEndListeners ( ) const
private

notifies

  • all registered deactivation listeners
  • single animation end (every node)
  • slide animations (if main sequence root node)

Definition at line 634 of file basenode.cxx.

References isMainSequenceRootNode(), maContext, maDeactivatingListeners, mpSelf, slideshow::internal::SlideShowContext::mrEventMultiplexer, slideshow::internal::EventMultiplexer::notifyAnimationEnd(), and slideshow::internal::EventMultiplexer::notifySlideAnimationsEnd().

Referenced by deactivate(), and end().

◆ operator=()

BaseNode & slideshow::internal::BaseNode::operator= ( const BaseNode )
delete

◆ registerDeactivatingListener()

bool slideshow::internal::BaseNode::registerDeactivatingListener ( const AnimationNodeSharedPtr rNotifee)
overridevirtual

Register a deactivating listener.

This method registers another AnimationNode as an deactivating listener, which gets notified via a notifyDeactivating() call. The node calls all registered listener, when it leaves the ACTIVE state.

Parameters
rNotifeeAnimationNode to notify

Implements slideshow::internal::AnimationNode.

Definition at line 660 of file basenode.cxx.

References checkValidNode(), ENSURE_OR_RETURN_FALSE, and maDeactivatingListeners.

◆ removeEffect()

virtual void slideshow::internal::BaseNode::removeEffect ( )
inlineoverridevirtual

Called by the container to remove the animation effect to make the painted shape correct if it restart because of repeat or rewind ( fill mode is AnimationFill::REMOVE ) to start state.

Implements slideshow::internal::AnimationNode.

Reimplemented in slideshow::internal::AnimationBaseNode.

Definition at line 130 of file basenode.hxx.

◆ resolve()

bool slideshow::internal::BaseNode::resolve ( )
overridevirtual

Resolve node start time.

Nodes can have unresolved start times, i.e. indefinite start time for container nodes, or child nodes whose parent has not yet started. Calling this method fixes the node's start time. This does not mean that this node immediately starts its animations, that is only the case for begin=0.0. The node will change its state to RESOLVED.

Returns
true, if a start event was successfully scheduled.

Implements slideshow::internal::AnimationNode.

Definition at line 431 of file basenode.cxx.

References slideshow::internal::AnimationNode::ACTIVE, slideshow::internal::EventQueue::addEvent(), checkValidNode(), slideshow::internal::BaseNode::StateTransition::commit(), slideshow::internal::BaseNode::StateTransition::enter(), slideshow::internal::generateEvent(), uno::Any::hasValue(), inStateOrTransition(), isTransition(), maContext, makeDelay, meCurrState, mnStartDelay, mpCurrentEvent, mpSelf, slideshow::internal::SlideShowContext::mrEventQueue, mxAnimationNode, resolve_st(), and slideshow::internal::AnimationNode::RESOLVED.

◆ resolve_st()

bool slideshow::internal::BaseNode::resolve_st ( )
privatevirtual

Reimplemented in slideshow::internal::AnimationBaseNode.

Definition at line 488 of file basenode.cxx.

Referenced by resolve().

◆ scheduleDeactivationEvent()

void slideshow::internal::BaseNode::scheduleDeactivationEvent ( EventSharedPtr const &  pEvent = EventSharedPtr())
protected

◆ setSelf()

void slideshow::internal::BaseNode::setSelf ( const BaseNodeSharedPtr rSelf)

Provide the node with a shared_ptr to itself.

Since implementation has to create objects which need a shared_ptr to this node, and a pointee cannot retrieve a shared_ptr to itself internally, have to set that from the outside.

Definition at line 674 of file basenode.cxx.

References ENSURE_OR_THROW, and mpSelf.

◆ showState()

void slideshow::internal::BaseNode::showState ( ) const
virtual

Friends And Related Function Documentation

◆ StateTransition

friend class StateTransition
friend

Definition at line 191 of file basenode.hxx.

Member Data Documentation

◆ maContext

SlideShowContext slideshow::internal::BaseNode::maContext
private

◆ maDeactivatingListeners

::std::vector< AnimationNodeSharedPtr > slideshow::internal::BaseNode::maDeactivatingListeners
private

Definition at line 196 of file basenode.hxx.

Referenced by dispose(), notifyEndListeners(), and registerDeactivatingListener().

◆ mbIsMainSequenceRootNode

const bool slideshow::internal::BaseNode::mbIsMainSequenceRootNode
private

Definition at line 205 of file basenode.hxx.

Referenced by isMainSequenceRootNode().

◆ meCurrentStateTransition

int slideshow::internal::BaseNode::meCurrentStateTransition
private

◆ meCurrState

NodeState slideshow::internal::BaseNode::meCurrState
private

◆ mnStartDelay

const double slideshow::internal::BaseNode::mnStartDelay
private

Definition at line 201 of file basenode.hxx.

Referenced by resolve().

◆ mpCurrentEvent

EventSharedPtr slideshow::internal::BaseNode::mpCurrentEvent
private

Definition at line 204 of file basenode.hxx.

Referenced by deactivate(), dispose(), end(), init(), resolve(), and scheduleDeactivationEvent().

◆ mpParent

::std::shared_ptr< BaseContainerNode > slideshow::internal::BaseNode::mpParent
private

Definition at line 198 of file basenode.hxx.

Referenced by dispose(), getFillDefaultMode(), getParentNode(), and getRestartDefaultMode().

◆ mpSelf

::std::shared_ptr< BaseNode > slideshow::internal::BaseNode::mpSelf
private

◆ mpStateTransitionTable

const int* slideshow::internal::BaseNode::mpStateTransitionTable
private

Definition at line 200 of file basenode.hxx.

Referenced by isTransition().

◆ mxAnimationNode

css::uno::Reference< css::animations::XAnimationNode > slideshow::internal::BaseNode::mxAnimationNode
private

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