1*aaef562fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*aaef562fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*aaef562fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*aaef562fSAndrew Rist * distributed with this work for additional information 6*aaef562fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*aaef562fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*aaef562fSAndrew Rist * "License"); you may not use this file except in compliance 9*aaef562fSAndrew Rist * with the License. You may obtain a copy of the License at 10*aaef562fSAndrew Rist * 11*aaef562fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*aaef562fSAndrew Rist * 13*aaef562fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*aaef562fSAndrew Rist * software distributed under the License is distributed on an 15*aaef562fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*aaef562fSAndrew Rist * KIND, either express or implied. See the License for the 17*aaef562fSAndrew Rist * specific language governing permissions and limitations 18*aaef562fSAndrew Rist * under the License. 19*aaef562fSAndrew Rist * 20*aaef562fSAndrew Rist *************************************************************/ 21*aaef562fSAndrew Rist 22*aaef562fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_SHAPEMANAGER_HXX 25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_SHAPEMANAGER_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "disposable.hxx" 28cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 29cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 30cdf0e10cSrcweir 31cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace drawing { 32cdf0e10cSrcweir class XShape; 33cdf0e10cSrcweir } } } } 34cdf0e10cSrcweir 35cdf0e10cSrcweir /* Definition of ShapeManager interface */ 36cdf0e10cSrcweir 37cdf0e10cSrcweir namespace slideshow 38cdf0e10cSrcweir { 39cdf0e10cSrcweir namespace internal 40cdf0e10cSrcweir { 41cdf0e10cSrcweir class HyperlinkArea; 42cdf0e10cSrcweir class AnimatableShape; 43cdf0e10cSrcweir class Shape; 44cdf0e10cSrcweir 45cdf0e10cSrcweir /** ShapeManager interface 46cdf0e10cSrcweir 47cdf0e10cSrcweir Implementers of this interface manage appearance and 48cdf0e10cSrcweir animation of slideshow shapes. 49cdf0e10cSrcweir */ 50cdf0e10cSrcweir class ShapeManager : public Disposable 51cdf0e10cSrcweir { 52cdf0e10cSrcweir public: 53cdf0e10cSrcweir /** Notify the ShapeManager that the given Shape starts an 54cdf0e10cSrcweir animation now. 55cdf0e10cSrcweir 56cdf0e10cSrcweir This method enters animation mode for the Shape. If 57cdf0e10cSrcweir the shape is already in animation mode, the call is 58cdf0e10cSrcweir counted, and the shape only leaves animation mode 59cdf0e10cSrcweir after a corresponding number of leaveAnimationMode() 60cdf0e10cSrcweir calls. 61cdf0e10cSrcweir */ 62cdf0e10cSrcweir virtual void enterAnimationMode( const boost::shared_ptr<AnimatableShape>& rShape ) = 0; 63cdf0e10cSrcweir 64cdf0e10cSrcweir /** Notify the ShapeManager that the given Shape is no 65cdf0e10cSrcweir longer animated. 66cdf0e10cSrcweir 67cdf0e10cSrcweir When called a corresponding number of times as 68cdf0e10cSrcweir enterAnimationMode() for a given shape, this methods 69cdf0e10cSrcweir ends animation mode for the given Shape. It is illegal 70cdf0e10cSrcweir to call this method more often than 71cdf0e10cSrcweir enterAnimationMode(). 72cdf0e10cSrcweir */ 73cdf0e10cSrcweir virtual void leaveAnimationMode( const boost::shared_ptr<AnimatableShape>& rShape ) = 0; 74cdf0e10cSrcweir 75cdf0e10cSrcweir /** Notify that a shape needs an update 76cdf0e10cSrcweir 77cdf0e10cSrcweir This method notifies the ShapeManager that a shape 78cdf0e10cSrcweir update is necessary. Use this if e.g. a running 79cdf0e10cSrcweir animation changed the shape appearance. 80cdf0e10cSrcweir 81cdf0e10cSrcweir @param rShape 82cdf0e10cSrcweir Shape which needs an update 83cdf0e10cSrcweir */ 84cdf0e10cSrcweir virtual void notifyShapeUpdate( const boost::shared_ptr<Shape>& rShape ) = 0; 85cdf0e10cSrcweir 86cdf0e10cSrcweir /** Lookup a Shape from an XShape model object 87cdf0e10cSrcweir 88cdf0e10cSrcweir This method looks up the internal shape map for one 89cdf0e10cSrcweir representing the given XShape. 90cdf0e10cSrcweir 91cdf0e10cSrcweir @param xShape 92cdf0e10cSrcweir The XShape object, for which the representing Shape 93cdf0e10cSrcweir should be looked up. 94cdf0e10cSrcweir */ 95cdf0e10cSrcweir virtual boost::shared_ptr<Shape> lookupShape( 96cdf0e10cSrcweir ::com::sun::star::uno::Reference< 97cdf0e10cSrcweir ::com::sun::star::drawing::XShape > const & xShape ) const = 0; 98cdf0e10cSrcweir 99cdf0e10cSrcweir /** Register given shape as a hyperlink target 100cdf0e10cSrcweir 101cdf0e10cSrcweir @param rArea 102cdf0e10cSrcweir Hyperlink sensitive area. Will participate in 103cdf0e10cSrcweir hyperlink region lookup. Must be in absolute user 104cdf0e10cSrcweir space coordinates. 105cdf0e10cSrcweir */ 106cdf0e10cSrcweir virtual void addHyperlinkArea( const boost::shared_ptr<HyperlinkArea>& rArea ) = 0; 107cdf0e10cSrcweir 108cdf0e10cSrcweir /** Unregister given shape as a hyperlink target 109cdf0e10cSrcweir 110cdf0e10cSrcweir @param rArea 111cdf0e10cSrcweir Hyperlink sensitive area. Will cease to participate in 112cdf0e10cSrcweir hyperlink region lookup. 113cdf0e10cSrcweir */ 114cdf0e10cSrcweir virtual void removeHyperlinkArea( const boost::shared_ptr<HyperlinkArea>& rArea ) = 0; 115cdf0e10cSrcweir }; 116cdf0e10cSrcweir 117cdf0e10cSrcweir typedef ::boost::shared_ptr< ShapeManager > ShapeManagerSharedPtr; 118cdf0e10cSrcweir } 119cdf0e10cSrcweir } 120cdf0e10cSrcweir 121cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_SHAPEMANAGER_HXX */ 122