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 10cdf0e10cSrcweir * 11*aaef562fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 20*aaef562fSAndrew Rist *************************************************************/ 21*aaef562fSAndrew Rist 22*aaef562fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_ANIMATION_HXX 25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_ANIMATION_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <animatableshape.hxx> 28cdf0e10cSrcweir #include <shapeattributelayer.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir 31cdf0e10cSrcweir /* Definition of Animation interface */ 32cdf0e10cSrcweir 33cdf0e10cSrcweir namespace slideshow 34cdf0e10cSrcweir { 35cdf0e10cSrcweir namespace internal 36cdf0e10cSrcweir { 37cdf0e10cSrcweir /** Interface defining a generic animation. 38cdf0e10cSrcweir 39cdf0e10cSrcweir This interface is used by objects implementing the 40cdf0e10cSrcweir Activity interface to drive the animation effect. Objects 41cdf0e10cSrcweir implementing this interface will receive time-varying 42cdf0e10cSrcweir animation values, which they can forward to the 43cdf0e10cSrcweir appropriate attributes. The type of these animation values 44cdf0e10cSrcweir is given in derived interfaces. 45cdf0e10cSrcweir 46cdf0e10cSrcweir @see NumberAnimation 47cdf0e10cSrcweir @see ColorAnimation 48cdf0e10cSrcweir @see PairAnimation 49cdf0e10cSrcweir */ 50cdf0e10cSrcweir class Animation 51cdf0e10cSrcweir { 52cdf0e10cSrcweir public: ~Animation()53cdf0e10cSrcweir virtual ~Animation() {} 54cdf0e10cSrcweir 55cdf0e10cSrcweir /** Notify that the animation going active soon. 56cdf0e10cSrcweir 57cdf0e10cSrcweir Implementers should preload any buffers, and create 58cdf0e10cSrcweir any expensive objects at this time. 59cdf0e10cSrcweir 60cdf0e10cSrcweir @param rShape 61cdf0e10cSrcweir Shape to apply this animation to. 62cdf0e10cSrcweir 63cdf0e10cSrcweir @param rAttrLayer 64cdf0e10cSrcweir Attribute layer to play the animation on. 65cdf0e10cSrcweir */ 66cdf0e10cSrcweir virtual void prefetch( const AnimatableShapeSharedPtr& rShape, 67cdf0e10cSrcweir const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0; 68cdf0e10cSrcweir 69cdf0e10cSrcweir /** Notify that the animation is about to begin. 70cdf0e10cSrcweir 71cdf0e10cSrcweir Implementers are free to start accompanying effects, 72cdf0e10cSrcweir such as sounds, and the animation timer now. 73cdf0e10cSrcweir 74cdf0e10cSrcweir @param rShape 75cdf0e10cSrcweir Shape to apply this animation to. 76cdf0e10cSrcweir 77cdf0e10cSrcweir @param rAttrLayer 78cdf0e10cSrcweir Attribute layer to play the animation on. 79cdf0e10cSrcweir */ 80cdf0e10cSrcweir virtual void start( const AnimatableShapeSharedPtr& rShape, 81cdf0e10cSrcweir const ShapeAttributeLayerSharedPtr& rAttrLayer ) = 0; 82cdf0e10cSrcweir 83cdf0e10cSrcweir /** Notify that the animation is about to end. 84cdf0e10cSrcweir */ 85cdf0e10cSrcweir virtual void end() = 0; 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir typedef ::boost::shared_ptr< Animation > AnimationSharedPtr; 89cdf0e10cSrcweir 90cdf0e10cSrcweir } 91cdf0e10cSrcweir } 92cdf0e10cSrcweir 93cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_ANIMATION_HXX */ 94