1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX
29 #define INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX
30 
31 #include <com/sun/star/uno/Reference.hxx>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <basegfx/vector/b2dvector.hxx>
34 
35 #include "event.hxx"
36 #include "slideshowcontext.hxx"
37 #include "subsettableshapemanager.hxx"
38 #include "animationnode.hxx"
39 
40 namespace com { namespace sun { namespace star { namespace animations
41 {
42     class XAnimationNode;
43 } } } }
44 
45 
46 /* Definition of SlideAnimations class */
47 
48 namespace slideshow
49 {
50     namespace internal
51     {
52         /** This class generates and manages all animations of a slide.
53 
54         	Provided with the root animation node, this class imports
55         	the effect information and builds the event tree for all
56         	of the slide's animations.
57          */
58         class SlideAnimations
59         {
60         public:
61             /** Create an animation generator.
62 
63             	@param rContext
64                 Slide show context, passing on common parameters
65              */
66             SlideAnimations( const SlideShowContext&     rContext,
67                              const ::basegfx::B2DVector& rSlideSize );
68             ~SlideAnimations();
69 
70 			/** Import animations from a SMIL root animation node.
71 
72             	This method might take some time, depending on the
73             	complexity of the SMIL animation network to be
74             	imported.
75 
76             	@param xRootAnimationNode
77                 Root animation node for the effects to be
78                 generated. This is typically obtained from the
79                 XDrawPage's XAnimationNodeSupplier.
80 
81              */
82             bool importAnimations( const ::com::sun::star::uno::Reference<
83                                 	  ::com::sun::star::animations::XAnimationNode >&	xRootAnimationNode );
84 
85             /** Check, whether imported animations actually contain
86                 any effects.
87 
88                 @return true, if there are actual animations in the
89                 imported node tree.
90              */
91             bool isAnimated() const;
92 
93             /** Start the animations.
94 
95                 This method creates the network of events and
96                 activities for all animations. The events and
97                 activities are inserted into the constructor-provided
98                 queues. These queues are not explicitely cleared, if
99                 you rely on this object's effects to run without
100                 interference, you should clear the queues by yourself.
101 
102                 @return true, if all events have been successfully
103                 created.
104              */
105             bool start();
106 
107             /** End all animations.
108 
109             	This method force-ends all animations. If a slide end
110             	event has been registered, that is fired, too.
111              */
112             void end();
113 
114             /// Release all references. Does not notify anything.
115             void dispose();
116 
117         private:
118             SlideShowContext		 maContext;
119             const basegfx::B2DVector maSlideSize;
120             AnimationNodeSharedPtr   mpRootNode;
121 		};
122 	}
123 }
124 
125 #endif /* INCLUDED_SLIDESHOW_SLIDEANIMATIONS_HXX */
126