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>
25 #include <boost/shared_ptr.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 ::com::sun::star::uno::Reference
<
57 ::com::sun::star::animations::XAnimationNode
>
58 getXAnimationNode() const = 0;
62 If this node is not in state INVALID, init() sets up the
63 node state and schedules necessary events.
64 If this node has children, they have their init() called, too.
65 You will call this method whenever a slide is going to be
68 @return true, if init was successful; state has changed to UNRESOLVED
70 virtual bool init() = 0;
72 /** Resolve node start time
74 Nodes can have unresolved start times, i.e. indefinite
75 start time for container nodes, or child nodes whose
76 parent has not yet started. Calling this method fixes
77 the node's start time. This does not mean that this
78 node immediately starts its animations, that is only
79 the case for begin=0.0. The node will change its state
82 @return true, if a start event was successfully scheduled.
84 virtual bool resolve() = 0;
86 /** Immediately start this node
88 This method starts the animation on this node, without
89 begin timeout. The node will change its state to ACTIVE.
91 @return true, if start was successful. This method
92 might return false, if e.g. a restart is not permitted
95 virtual bool activate() = 0;
97 /** Immediately stop this node
99 This method stops the animation on this node. The node
100 will change its state to either ENDED or FROZEN,
101 depending on XAnimationNode attributes.
103 virtual void deactivate() = 0;
105 /** End the animation on this node
107 This method force-ends animation on this node. Parents
108 may call this for their children, if their active
109 duration ends. An ended animation will no longer have
110 any effect on the shape attributes. The node will
111 change its state to ENDED.
113 virtual void end() = 0;
117 @return the current state of this animation node.
119 virtual NodeState
getState() const = 0;
121 /** Register a deactivating listener
123 This method registers another AnimationNode as an
124 deactivating listener, which gets notified via a
125 notifyDeactivating() call. The node calls all
126 registered listener, when it leaves the ACTIVE state.
128 @param rNotifee AnimationNode to notify
130 virtual bool registerDeactivatingListener(
131 const ::boost::shared_ptr
< AnimationNode
>& rNotifee
) = 0;
133 /** Called to notify another AnimationNode's deactivation
135 @param rNotifier The instance who calls this method.
137 virtual void notifyDeactivating(
138 const ::boost::shared_ptr
< AnimationNode
>& rNotifier
) = 0;
140 /** Query node whether it has an animation pending.
142 @return true, if this node (or at least one of its children)
143 has an animation pending. Used to determine if the main
144 sequence is actually empty, or contains effects
146 virtual bool hasPendingAnimation() const = 0;
149 typedef ::boost::shared_ptr
< AnimationNode
> AnimationNodeSharedPtr
;
151 } // namespace internal
152 } // namespace presentation
154 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_ANIMATIONNODE_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */