1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/animator.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,82 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __ANIMATOR_H__
1.20 +#define __ANIMATOR_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +
1.24 +const TUid KAnimatorInterfaceUid = {0x10204F59};
1.25 +
1.26 +class MAnimationDrawer;
1.27 +class CBitmapContext;
1.28 +class TAnimationConfig;
1.29 +
1.30 +/**
1.31 +Pure virtual base class for animators.
1.32 +
1.33 +Each data type supported by the animation framework is represented by an
1.34 +animator, which handles the data interpretation, timing and control. Each
1.35 +animator is provided in the form of an ECOM plugin.
1.36 +
1.37 +You do not need to instatiate animators in a client application. This is
1.38 +handled by the animation classes.
1.39 +
1.40 +@see CAnimation
1.41 +@publishedAll
1.42 +@released
1.43 +*/
1.44 +class CAnimator : public CBase
1.45 + {
1.46 +public:
1.47 + // ECOM instatiation and destruction:
1.48 + IMPORT_C static CAnimator* NewL(MAnimationDrawer* aRenderer);
1.49 + IMPORT_C virtual ~CAnimator();
1.50 + /** Starts the animation running.
1.51 + @see TAnimationConfig
1.52 + @param aConfig Runtime settings*/
1.53 + virtual void Start(const TAnimationConfig& aConfig) = 0;
1.54 + /** Stops the animation and rewinds it.*/
1.55 + virtual void Stop() = 0;
1.56 + /** Pauses the animation.*/
1.57 + virtual void Pause() = 0;
1.58 + /** Resumes a paused animation.*/
1.59 + virtual void Resume() = 0;
1.60 + /** Puts an animation on hold. */
1.61 + virtual void Hold() = 0;
1.62 + /** Restores a held animation and brings it back into synch. */
1.63 + virtual void Unhold() = 0;
1.64 + /** Receives data from a data provider. The mechanism by which data is
1.65 + actually passed depends on the animation type.
1.66 +
1.67 + @see MAnimationDataProviderObserver
1.68 + @param aEvent The event identifier
1.69 + @param aData A pointer to any data for the event
1.70 + @param aDataSize The length of the data in aData*/
1.71 + virtual void DataEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
1.72 + /** Called from the renderer and draws the animation.
1.73 + @param aBitmapContext The context on which the animation will be drawn*/
1.74 + virtual void Draw(CBitmapContext& aBitmapContext) const = 0;
1.75 + /** Called from the renderer and draws the mask for the animation.
1.76 + @param aBitmapContext The context on which the mask will be drawn*/
1.77 + virtual void DrawMask(CBitmapContext& aBitmapContext) const = 0;
1.78 +protected:
1.79 + /** Animator ECOM Plugin identifier */
1.80 + TUid iDtor_ID_Key;
1.81 + /** Data */
1.82 + TInt iLoop;
1.83 + };
1.84 +
1.85 +#endif //__ANIMATOR_H__