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