update dev300-m58
[ooovba.git] / slideshow / source / inc / animationnode.hxx
blob682962ee31d6ed07c5497190110f45e7b12a49dc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: animationnode.hxx,v $
10 * $Revision: 1.6.18.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_SLIDESHOW_ANIMATIONNODE_HXX
31 #define INCLUDED_SLIDESHOW_ANIMATIONNODE_HXX
33 #include "disposable.hxx"
35 #include <com/sun/star/animations/XAnimationNode.hpp>
36 #include <boost/shared_ptr.hpp>
38 namespace slideshow {
39 namespace internal {
41 /** This interface is used to mirror every XAnimateNode object
42 in the presentation core.
44 class AnimationNode : public Disposable
46 public:
47 /** The current state of this AnimationNode
49 enum NodeState {
50 /// Invalid state, node is disposed or otherwise invalid
51 INVALID =0,
52 /// Unresolved start time
53 UNRESOLVED =1,
54 /// Resolved start time, node will start eventually
55 RESOLVED =2,
56 /// Node is active
57 ACTIVE =4,
58 /// Node is frozen (no longer active, but changes remain in place)
59 FROZEN =8,
60 /// Node has completed an active lifecycle,
61 /// and any effect is removed from the document
62 ENDED =16
65 /** Query the corresponding XAnimationNode.
67 virtual ::com::sun::star::uno::Reference<
68 ::com::sun::star::animations::XAnimationNode >
69 getXAnimationNode() const = 0;
71 /** Init this node
73 If this node is not in state INVALID, init() sets up the
74 node state and schedules necessary events.
75 If this node has children, they have their init() called, too.
76 You will call this method whenever a slide is going to be
77 shown.
79 @return true, if init was successful; state has changed to UNRESOLVED
81 virtual bool init() = 0;
83 /** Resolve node start time
85 Nodes can have unresolved start times, i.e. indefinite
86 start time for container nodes, or child nodes whose
87 parent has not yet started. Calling this method fixes
88 the node's start time. This does not mean that this
89 node immediately starts its animations, that is only
90 the case for begin=0.0. The node will change its state
91 to RESOLVED.
93 @return true, if a start event was successfully scheduled.
95 virtual bool resolve() = 0;
97 /** Immediately start this node
99 This method starts the animation on this node, without
100 begin timeout. The node will change its state to ACTIVE.
102 @return true, if start was successful. This method
103 might return false, if e.g. a restart is not permitted
104 on this node.
106 virtual bool activate() = 0;
108 /** Immediately stop this node
110 This method stops the animation on this node. The node
111 will change its state to either ENDED or FROZEN,
112 depending on XAnimationNode attributes.
114 virtual void deactivate() = 0;
116 /** End the animation on this node
118 This method force-ends animation on this node. Parents
119 may call this for their children, if their active
120 duration ends. An ended animation will no longer have
121 any effect on the shape attributes. The node will
122 change its state to ENDED.
124 virtual void end() = 0;
126 /** Query node state
128 @return the current state of this animation node.
130 virtual NodeState getState() const = 0;
132 /** Register a deactivating listener
134 This method registers another AnimationNode as an
135 deactivating listener, which gets notified via a
136 notifyDeactivating() call. The node calls all
137 registered listener, when it leaves the ACTIVE state.
139 @param rNotifee AnimationNode to notify
141 virtual bool registerDeactivatingListener(
142 const ::boost::shared_ptr< AnimationNode >& rNotifee ) = 0;
144 /** Called to notify another AnimationNode's deactivation
146 @param rNotifier The instance who calls this method.
148 virtual void notifyDeactivating(
149 const ::boost::shared_ptr< AnimationNode >& rNotifier ) = 0;
151 /** Query node whether it has an animation pending.
153 @return true, if this node (or at least one of its children)
154 has an animation pending. Used to determine if the main
155 sequence is actually empty, or contains effects
157 virtual bool hasPendingAnimation() const = 0;
160 typedef ::boost::shared_ptr< AnimationNode > AnimationNodeSharedPtr;
162 } // namespace internal
163 } // namespace presentation
165 #endif /* INCLUDED_SLIDESHOW_ANIMATIONNODE_HXX */