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_ANIMATABLESHAPE_HXX
25 #define INCLUDED_SLIDESHOW_ANIMATABLESHAPE_HXX
26 
27 #include <boost/shared_ptr.hpp>
28 
29 #include "shape.hxx"
30 
31 
32 namespace slideshow
33 {
34     namespace internal
35     {
36         /** Represents an animatable shape.
37 
38             This interface adds animation handling methods to a
39             shape. It allows transparent switching between
40             sprite-based viewing and static painting, depending on
41             whether animations are currently running.
42          */
43         class AnimatableShape : public Shape
44         {
45         public:
46             // Animation methods
47             //------------------------------------------------------------------
48 
49             /** Notify the Shape that an animation starts now
50 
51 				This method enters animation mode on all registered
52 				views.
53 
54                 @attention This method is supposed to be called only
55                 from the LayerManager, since it might involve shifting
56                 shapes between different layers (and removing this
57                 shape from the background layer in the first place)
58              */
59             virtual void enterAnimationMode() = 0;
60 
61             /** Notify the Shape that it is no longer animated
62 
63 				This methods requests the Shape to end animation mode
64 				on all registered views, if called more or equal the
65 				times enterAnimationMode() was called. That is, the
66 				Shape only leaves animation mode, if all requested
67 				enterAnimationMode() call sites have issued their
68 				matching leaveAnimationMode().
69 
70                 @attention This method is supposed to be called only
71                 from the LayerManager, since it might involve shifting
72                 shapes between different layers (and adding this
73                 shape to the background layer again)
74              */
75             virtual void leaveAnimationMode() = 0;
76 
77         };
78 
79         typedef ::boost::shared_ptr< AnimatableShape > AnimatableShapeSharedPtr;
80 
81     }
82 }
83 
84 #endif /* INCLUDED_SLIDESHOW_ANIMATABLESHAPE_HXX */
85