1aaef562fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3aaef562fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4aaef562fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5aaef562fSAndrew Rist  * distributed with this work for additional information
6aaef562fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7aaef562fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8aaef562fSAndrew Rist  * "License"); you may not use this file except in compliance
9aaef562fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10aaef562fSAndrew Rist  *
11aaef562fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12aaef562fSAndrew Rist  *
13aaef562fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14aaef562fSAndrew Rist  * software distributed under the License is distributed on an
15aaef562fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16aaef562fSAndrew Rist  * KIND, either express or implied.  See the License for the
17aaef562fSAndrew Rist  * specific language governing permissions and limitations
18aaef562fSAndrew Rist  * under the License.
19aaef562fSAndrew Rist  *
20aaef562fSAndrew Rist  *************************************************************/
21aaef562fSAndrew Rist 
22aaef562fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX
25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
29cdf0e10cSrcweir #include <basegfx/vector/b2dvector.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "event.hxx"
32cdf0e10cSrcweir #include "slideshowcontext.hxx"
33cdf0e10cSrcweir #include "subsettableshapemanager.hxx"
34cdf0e10cSrcweir #include "animationnode.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace animations
37cdf0e10cSrcweir {
38cdf0e10cSrcweir     class XAnimationNode;
39cdf0e10cSrcweir } } } }
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 
42cdf0e10cSrcweir /* Definition of SlideAnimations class */
43cdf0e10cSrcweir 
44cdf0e10cSrcweir namespace slideshow
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     namespace internal
47cdf0e10cSrcweir     {
48cdf0e10cSrcweir         /** This class generates and manages all animations of a slide.
49cdf0e10cSrcweir 
50cdf0e10cSrcweir         	Provided with the root animation node, this class imports
51cdf0e10cSrcweir         	the effect information and builds the event tree for all
52cdf0e10cSrcweir         	of the slide's animations.
53cdf0e10cSrcweir          */
54cdf0e10cSrcweir         class SlideAnimations
55cdf0e10cSrcweir         {
56cdf0e10cSrcweir         public:
57cdf0e10cSrcweir             /** Create an animation generator.
58cdf0e10cSrcweir 
59cdf0e10cSrcweir             	@param rContext
60cdf0e10cSrcweir                 Slide show context, passing on common parameters
61cdf0e10cSrcweir              */
62cdf0e10cSrcweir             SlideAnimations( const SlideShowContext&     rContext,
63cdf0e10cSrcweir                              const ::basegfx::B2DVector& rSlideSize );
64cdf0e10cSrcweir             ~SlideAnimations();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 			/** Import animations from a SMIL root animation node.
67cdf0e10cSrcweir 
68cdf0e10cSrcweir             	This method might take some time, depending on the
69cdf0e10cSrcweir             	complexity of the SMIL animation network to be
70cdf0e10cSrcweir             	imported.
71cdf0e10cSrcweir 
72cdf0e10cSrcweir             	@param xRootAnimationNode
73cdf0e10cSrcweir                 Root animation node for the effects to be
74cdf0e10cSrcweir                 generated. This is typically obtained from the
75cdf0e10cSrcweir                 XDrawPage's XAnimationNodeSupplier.
76cdf0e10cSrcweir 
77cdf0e10cSrcweir              */
78cdf0e10cSrcweir             bool importAnimations( const ::com::sun::star::uno::Reference<
79cdf0e10cSrcweir                                 	  ::com::sun::star::animations::XAnimationNode >&	xRootAnimationNode );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir             /** Check, whether imported animations actually contain
82cdf0e10cSrcweir                 any effects.
83cdf0e10cSrcweir 
84cdf0e10cSrcweir                 @return true, if there are actual animations in the
85cdf0e10cSrcweir                 imported node tree.
86cdf0e10cSrcweir              */
87cdf0e10cSrcweir             bool isAnimated() const;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir             /** Start the animations.
90cdf0e10cSrcweir 
91cdf0e10cSrcweir                 This method creates the network of events and
92cdf0e10cSrcweir                 activities for all animations. The events and
93cdf0e10cSrcweir                 activities are inserted into the constructor-provided
94*6d53c851Smseidel                 queues. These queues are not explicitly cleared, if
95cdf0e10cSrcweir                 you rely on this object's effects to run without
96cdf0e10cSrcweir                 interference, you should clear the queues by yourself.
97cdf0e10cSrcweir 
98cdf0e10cSrcweir                 @return true, if all events have been successfully
99cdf0e10cSrcweir                 created.
100cdf0e10cSrcweir              */
101cdf0e10cSrcweir             bool start();
102cdf0e10cSrcweir 
103cdf0e10cSrcweir             /** End all animations.
104cdf0e10cSrcweir 
105cdf0e10cSrcweir             	This method force-ends all animations. If a slide end
106cdf0e10cSrcweir             	event has been registered, that is fired, too.
107cdf0e10cSrcweir              */
108cdf0e10cSrcweir             void end();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir             /// Release all references. Does not notify anything.
111cdf0e10cSrcweir             void dispose();
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         private:
114cdf0e10cSrcweir             SlideShowContext		 maContext;
115cdf0e10cSrcweir             const basegfx::B2DVector maSlideSize;
116cdf0e10cSrcweir             AnimationNodeSharedPtr   mpRootNode;
117cdf0e10cSrcweir 		};
118cdf0e10cSrcweir 	}
119cdf0e10cSrcweir }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX */
122