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