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_SHAPEMANAGER_HXX
25 #define INCLUDED_SLIDESHOW_SHAPEMANAGER_HXX
26 
27 #include "disposable.hxx"
28 #include <com/sun/star/uno/Reference.hxx>
29 #include <boost/shared_ptr.hpp>
30 
31 namespace com {  namespace sun { namespace star { namespace drawing {
32     class XShape;
33 } } } }
34 
35 /* Definition of ShapeManager interface */
36 
37 namespace slideshow
38 {
39     namespace internal
40     {
41         class HyperlinkArea;
42         class AnimatableShape;
43         class Shape;
44 
45         /** ShapeManager interface
46 
47             Implementers of this interface manage appearance and
48             animation of slideshow shapes.
49          */
50         class ShapeManager : public Disposable
51         {
52         public:
53             /** Notify the ShapeManager that the given Shape starts an
54                 animation now.
55 
56 				This method enters animation mode for the Shape. If
57 				the shape is already in animation mode, the call is
58 				counted, and the shape only leaves animation mode
59 				after a corresponding number of leaveAnimationMode()
60 				calls.
61              */
62             virtual void enterAnimationMode( const boost::shared_ptr<AnimatableShape>& rShape ) = 0;
63 
64             /** Notify the ShapeManager that the given Shape is no
65                 longer animated.
66 
67 				When called a corresponding number of times as
68 				enterAnimationMode() for a given shape, this methods
69 				ends animation mode for the given Shape. It is illegal
70 				to call this method more often than
71 				enterAnimationMode().
72              */
73             virtual void leaveAnimationMode( const boost::shared_ptr<AnimatableShape>& rShape ) = 0;
74 
75             /** Notify that a shape needs an update
76 
77             	This method notifies the ShapeManager that a shape
78             	update is necessary. Use this if e.g. a running
79             	animation changed the shape appearance.
80 
81                 @param rShape
82                 Shape which needs an update
83              */
84             virtual void notifyShapeUpdate( const boost::shared_ptr<Shape>& rShape ) = 0;
85 
86             /** Lookup a Shape from an XShape model object
87 
88             	This method looks up the internal shape map for one
89             	representing the given XShape.
90 
91                 @param xShape
92                 The XShape object, for which the representing Shape
93                 should be looked up.
94              */
95             virtual boost::shared_ptr<Shape> lookupShape(
96                 ::com::sun::star::uno::Reference<
97                     ::com::sun::star::drawing::XShape > const & xShape ) const = 0;
98 
99             /** Register given shape as a hyperlink target
100 
101                 @param rArea
102                 Hyperlink sensitive area. Will participate in
103                 hyperlink region lookup. Must be in absolute user
104                 space coordinates.
105              */
106             virtual void addHyperlinkArea( const boost::shared_ptr<HyperlinkArea>& rArea ) = 0;
107 
108             /** Unregister given shape as a hyperlink target
109 
110                 @param rArea
111                 Hyperlink sensitive area. Will cease to participate in
112                 hyperlink region lookup.
113              */
114             virtual void removeHyperlinkArea( const boost::shared_ptr<HyperlinkArea>& rArea ) = 0;
115         };
116 
117         typedef ::boost::shared_ptr< ShapeManager > ShapeManagerSharedPtr;
118     }
119 }
120 
121 #endif /* INCLUDED_SLIDESHOW_SHAPEMANAGER_HXX */
122