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