22#include <com/sun/star/animations/AnimationRestart.hpp>
23#include <com/sun/star/animations/AnimationFill.hpp>
37bool isRepeatIndefinite(
const uno::Reference<animations::XAnimationNode>& xNode)
39 return xNode->getRepeatCount().hasValue() &&
isIndefiniteTiming(xNode->getRepeatCount());
42bool isRestart(
const uno::Reference<animations::XAnimationNode>& xNode)
44 sal_Int16 nRestart = xNode->getRestart();
45 return nRestart == animations::AnimationRestart::WHEN_NOT_ACTIVE ||
46 nRestart == animations::AnimationRestart::ALWAYS;
54 :
BaseNode( xNode, rParent, rContext ),
56 mnFinishedChildren(0),
58 mbRepeatIndefinite(isRepeatIndefinite(xNode)),
59 mbRestart(isRestart(xNode)),
93 if (eDestState ==
FROZEN) {
122 if (pNode->registerDeactivatingListener(
getSelf() )) {
130 VectorOfNodes::const_iterator
const iEnd(
maChildren.end() );
131 VectorOfNodes::const_iterator
const iFind(
132 std::find(
maChildren.begin(), iEnd, pNode ) );
133 return (iFind != iEnd);
139 OSL_ASSERT( pChildNode->getState() ==
FROZEN ||
140 pChildNode->getState() ==
ENDED );
147 OSL_FAIL(
"unknown notifier!" );
175 "BaseContainerNode::repeat");
180 if (
getFillMode() == animations::AnimationFill::REMOVE)
207 std::dynamic_pointer_cast<BaseNode>(
i);
209 "Node connection: n" <<
std::vector< Reference< XAnimationNode > > maChildren
virtual void end()=0
End the animation on this node.
virtual bool hasPendingAnimation() const =0
Query node whether it has an animation pending.
NodeState
The current state of this AnimationNode.
@ FROZEN
Node is frozen (no longer active, but changes remain in place)
@ INVALID
Invalid state, node is disposed or otherwise invalid.
@ ENDED
Node has completed an active lifecycle, and any effect is removed from the document.
virtual void deactivate()=0
Immediately stop this node.
virtual bool init()=0
Init this node.
virtual void removeEffect()=0
Called by the container to remove the animation effect to make the painted shape correct if it restar...
virtual bool init_st() override
bool notifyDeactivatedChild(AnimationNodeSharedPtr const &pChildNode)
bool isDurationIndefinite() const
virtual void activate_st() override=0
bool isChildNode(AnimationNodeSharedPtr const &pNode) const
void appendChildNode(AnimationNodeSharedPtr const &pNode)
Add given child node to this container.
::std::size_t mnFinishedChildren
const bool mbRepeatIndefinite
void forEachChildNode(FuncT func, int nodeStateMask) const
virtual void deactivate_st(NodeState eDestState) override
virtual void showState() const override
virtual bool hasPendingAnimation() const override
Query node whether it has an animation pending.
BaseContainerNode(css::uno::Reference< css::animations::XAnimationNode > const &xNode, BaseContainerNodeSharedPtr const &pParent, NodeContext const &rContext)
virtual void dispose() override
Dispose all object references.
This interface extends AnimationNode with some file-private accessor methods.
virtual void showState() const
virtual css::uno::Reference< css::animations::XAnimationNode > getXAnimationNode() const override
Query the corresponding XAnimationNode.
SlideShowContext const & getContext() const
sal_Int16 getFillMode()
Get the node's fill mode.
bool checkValidNode() const
::std::shared_ptr< BaseNode > const & getSelf() const
virtual void dispose() override
Dispose all object references.
virtual NodeState getState() const override
Query node state.
virtual void deactivate() override
Immediately stop this node.
virtual void dispose()=0
Dispose all object references.
bool addEvent(const EventSharedPtr &event)
Add the given event to the queue.
#define makeDelay(f, t, d)
#define SAL_INFO(area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
::std::shared_ptr< BaseContainerNode > BaseContainerNodeSharedPtr
bool isIndefiniteTiming(const uno::Any &rAny)
::std::shared_ptr< AnimationNode > AnimationNodeSharedPtr
::std::shared_ptr< Event > EventSharedPtr
::std::shared_ptr< BaseNode > BaseNodeSharedPtr
OUString debugGetNodeName(const BaseNode *pNode)
EventQueue & mrEventQueue