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_ANIMATION_HXX
25 #define INCLUDED_SLIDESHOW_ANIMATION_HXX
26 
27 #include <animatableshape.hxx>
28 #include <shapeattributelayer.hxx>
29 
30 
31 /* Definition of Animation interface */
32 
33 namespace slideshow
34 {
35     namespace internal
36     {
37         /** Interface defining a generic animation.
38 
39         	This interface is used by objects implementing the
40         	Activity interface to drive the animation effect. Objects
41         	implementing this interface will receive time-varying
42         	animation values, which they can forward to the
43         	appropriate attributes. The type of these animation values
44             is given in derived interfaces.
45 
46             @see NumberAnimation
47             @see ColorAnimation
48             @see PairAnimation
49          */
50         class Animation
51         {
52         public:
~Animation()53             virtual ~Animation() {}
54 
55             /** Notify that the animation going active soon.
56 
57                 Implementers should preload any buffers, and create
58                 any expensive objects at this time.
59 
60             	@param rShape
61                 Shape to apply this animation to.
62 
63             	@param rAttrLayer
64                 Attribute layer to play the animation on.
65              */
66             virtual void prefetch( const AnimatableShapeSharedPtr&     rShape,
67                                    const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0;
68 
69             /** Notify that the animation is about to begin.
70 
71                 Implementers are free to start accompanying effects,
72                 such as sounds, and the animation timer now.
73 
74             	@param rShape
75                 Shape to apply this animation to.
76 
77             	@param rAttrLayer
78                 Attribute layer to play the animation on.
79              */
80             virtual void start( const AnimatableShapeSharedPtr&		rShape,
81                                 const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0;
82 
83             /** Notify that the animation is about to end.
84              */
85             virtual void end() = 0;
86         };
87 
88         typedef ::boost::shared_ptr< Animation > AnimationSharedPtr;
89 
90     }
91 }
92 
93 #endif /* INCLUDED_SLIDESHOW_ANIMATION_HXX */
94