1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONNODE_HXX
20 #define INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONNODE_HXX
22 #include "disposable.hxx"
24 #include <com/sun/star/animations/XAnimationNode.hpp>
30 /** This interface is used to mirror every XAnimateNode object
31 in the presentation core.
33 class AnimationNode
: public Disposable
36 /** The current state of this AnimationNode
39 /// Invalid state, node is disposed or otherwise invalid
41 /// Unresolved start time
43 /// Resolved start time, node will start eventually
47 /// Node is frozen (no longer active, but changes remain in place)
49 /// Node has completed an active lifecycle,
50 /// and any effect is removed from the document
54 /** Query the corresponding XAnimationNode.
56 virtual css::uno::Reference
< css::animations::XAnimationNode
>
57 getXAnimationNode() const = 0;
61 If this node is not in state INVALID, init() sets up the
62 node state and schedules necessary events.
63 If this node has children, they have their init() called, too.
64 You will call this method whenever a slide is going to be
67 @return true, if init was successful; state has changed to UNRESOLVED
69 virtual bool init() = 0;
71 /** Resolve node start time
73 Nodes can have unresolved start times, i.e. indefinite
74 start time for container nodes, or child nodes whose
75 parent has not yet started. Calling this method fixes
76 the node's start time. This does not mean that this
77 node immediately starts its animations, that is only
78 the case for begin=0.0. The node will change its state
81 @return true, if a start event was successfully scheduled.
83 virtual bool resolve() = 0;
85 /** Immediately start this node
87 This method starts the animation on this node, without
88 begin timeout. The node will change its state to ACTIVE.
90 virtual void activate() = 0;
92 /** Immediately stop this node
94 This method stops the animation on this node. The node
95 will change its state to either ENDED or FROZEN,
96 depending on XAnimationNode attributes.
98 virtual void deactivate() = 0;
100 /** End the animation on this node
102 This method force-ends animation on this node. Parents
103 may call this for their children, if their active
104 duration ends. An ended animation will no longer have
105 any effect on the shape attributes. The node will
106 change its state to ENDED.
108 virtual void end() = 0;
112 @return the current state of this animation node.
114 virtual NodeState
getState() const = 0;
116 /** Register a deactivating listener
118 This method registers another AnimationNode as an
119 deactivating listener, which gets notified via a
120 notifyDeactivating() call. The node calls all
121 registered listener, when it leaves the ACTIVE state.
123 @param rNotifee AnimationNode to notify
125 virtual bool registerDeactivatingListener(
126 const ::std::shared_ptr
< AnimationNode
>& rNotifee
) = 0;
128 /** Called to notify another AnimationNode's deactivation
130 @param rNotifier The instance who calls this method.
132 virtual void notifyDeactivating(
133 const ::std::shared_ptr
< AnimationNode
>& rNotifier
) = 0;
135 /** Query node whether it has an animation pending.
137 @return true, if this node (or at least one of its children)
138 has an animation pending. Used to determine if the main
139 sequence is actually empty, or contains effects
141 virtual bool hasPendingAnimation() const = 0;
144 typedef ::std::shared_ptr
< AnimationNode
> AnimationNodeSharedPtr
;
146 } // namespace internal
147 } // namespace presentation
149 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONNODE_HXX
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */