1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef INCLUDED_SLIDESHOW_ANIMATION_HXX 29 #define INCLUDED_SLIDESHOW_ANIMATION_HXX 30 31 #include <animatableshape.hxx> 32 #include <shapeattributelayer.hxx> 33 34 35 /* Definition of Animation interface */ 36 37 namespace slideshow 38 { 39 namespace internal 40 { 41 /** Interface defining a generic animation. 42 43 This interface is used by objects implementing the 44 Activity interface to drive the animation effect. Objects 45 implementing this interface will receive time-varying 46 animation values, which they can forward to the 47 appropriate attributes. The type of these animation values 48 is given in derived interfaces. 49 50 @see NumberAnimation 51 @see ColorAnimation 52 @see PairAnimation 53 */ 54 class Animation 55 { 56 public: 57 virtual ~Animation() {} 58 59 /** Notify that the animation going active soon. 60 61 Implementers should preload any buffers, and create 62 any expensive objects at this time. 63 64 @param rShape 65 Shape to apply this animation to. 66 67 @param rAttrLayer 68 Attribute layer to play the animation on. 69 */ 70 virtual void prefetch( const AnimatableShapeSharedPtr& rShape, 71 const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0; 72 73 /** Notify that the animation is about to begin. 74 75 Implementers are free to start accompanying effects, 76 such as sounds, and the animation timer now. 77 78 @param rShape 79 Shape to apply this animation to. 80 81 @param rAttrLayer 82 Attribute layer to play the animation on. 83 */ 84 virtual void start( const AnimatableShapeSharedPtr& rShape, 85 const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0; 86 87 /** Notify that the animation is about to end. 88 */ 89 virtual void end() = 0; 90 }; 91 92 typedef ::boost::shared_ptr< Animation > AnimationSharedPtr; 93 94 } 95 } 96 97 #endif /* INCLUDED_SLIDESHOW_ANIMATION_HXX */ 98