williamr@2: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __ANIMATIONMIXINS_H__ williamr@2: #define __ANIMATIONMIXINS_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: /** Interface from a data provider to an animation williamr@2: williamr@2: An animation which has a data provider receives information from it via this williamr@2: interface. williamr@2: williamr@2: You do not need to derive an implementation from this class unless you are williamr@2: writing a new animation type. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CAnimationDataProvider williamr@2: @see CAnimation williamr@2: @see CAnimator*/ williamr@2: class MAnimationDataProviderObserver williamr@2: { williamr@2: public: williamr@2: /** Receives an event from a data provider. williamr@2: @param aEvent The event code. williamr@2: @param aData Any data associated with the event. Can be NULL. williamr@2: @param aDataSize The size in bytes of the item pointed to by aData.*/ williamr@2: virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0; williamr@2: protected: williamr@2: IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1(); williamr@2: IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2(); williamr@2: }; williamr@2: williamr@2: class CAnimationTicker; williamr@2: williamr@2: /** Interface used by an animator to during the rendering process. williamr@2: williamr@2: A class implementing this interface is provided to an animator by an animation. williamr@2: It may or may not be the animation itself. williamr@2: williamr@2: You do not need to derive an implementation from this class unless you are williamr@2: writing a new animation type. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CAnimator*/ williamr@2: class MAnimationDrawer williamr@2: { williamr@2: public: williamr@2: /** Called by the animator when it needs to draw a new frame */ williamr@2: virtual void AnimatorDraw() = 0; williamr@2: /** Called by the animator when it is ready to begin running. williamr@2: @param aSize The size of the smallest bounding rectangle that will be required to render the animation */ williamr@2: virtual void AnimatorInitialisedL(const TSize& aSize) = 0; williamr@2: /** Called by the animator when it is no longer ready, usually in williamr@2: response to TAnimationEvent::EAnimationDataChanged */ williamr@2: virtual void AnimatorResetL() = 0; williamr@2: /** Called by the animator plugin loading routine to determine the type williamr@2: of data for which an animator is required. williamr@2: @return An 8 bit descriptor containing the data type.*/ williamr@2: virtual const TPtrC8 AnimatorDataType() const = 0; williamr@2: /** Called by the animator to obtain an AnimatorTicker, to which it will williamr@2: add itself whenever it is running. williamr@2: @return A reference to a CAnimationTicker.*/ williamr@2: virtual CAnimationTicker& AnimatorTicker() = 0; williamr@2: private: williamr@2: IMPORT_C virtual void MAnimationDrawer_Reserved1(); williamr@2: IMPORT_C virtual void MAnimationDrawer_Reserved2(); williamr@2: }; williamr@2: williamr@2: class CAnimation; williamr@2: williamr@2: /** Interface used by an animation to report events to the client application. williamr@2: williamr@2: An animation can inform the client application of particular events through this williamr@2: mechanism. Only errors are reported in this way in v9.1, but more events may williamr@2: be added in future. williamr@2: williamr@2: Use of this interface by the client application is optional. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CAnimation*/ williamr@2: class MAnimationObserver williamr@2: { williamr@2: public: williamr@2: /** Represents generic events which can be sent to the observer. */ williamr@2: enum TEvent williamr@2: { williamr@2: /** Indicates that an error has occurred in the data provider. williamr@2: For events of this type, aData is a pointer to a TInt error code. */ williamr@2: EDataProviderError, williamr@2: /** Indicates that the animator initialised (and therefore knows it's size) */ williamr@2: EAnimationInitialized=0x01, williamr@2: /** Any user defined animations introducing new events should use williamr@2: values greater than EReserved */ williamr@2: EReserved=0xFFFF, williamr@2: }; williamr@2: public: williamr@2: /** Receives events from an animation. williamr@2: williamr@2: The receiver is not required to take any action atall in response to this williamr@2: call. The receiver should not delete the animation whilst responding williamr@2: to this call. williamr@2: williamr@2: @param aSender A reference to the animation which sent the event. williamr@2: @param aEvent The event code. williamr@2: @param aData An event specific data item.*/ williamr@2: virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0; williamr@2: protected: williamr@2: IMPORT_C virtual void MAnimationObserver_Reserved1(); williamr@2: IMPORT_C virtual void MAnimationObserver_Reserved2(); williamr@2: }; williamr@2: williamr@2: /** Interface used for receiving animation ticks. williamr@2: williamr@2: Animators receive regular ticks, during which they perform any required processing. williamr@2: williamr@2: You do not need to derive an implementation from this class unless you are writing williamr@2: a new animator type. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CAnimator williamr@2: @see CAnimationTicker*/ williamr@2: class MAnimationTickee williamr@2: { williamr@2: public: williamr@2: /** This function is called regularly by any ticker to which the tickee williamr@2: has been added */ williamr@2: virtual void Tick() = 0; williamr@2: protected: williamr@2: IMPORT_C virtual void MAnimationTickee_Reserved1(); williamr@2: IMPORT_C virtual void MAnimationTickee_Reserved2(); williamr@2: }; williamr@2: williamr@2: /** Internal interface used by the ICL data loader to communicate with the williamr@2: ICL data provider. Not intended for user derivation. williamr@2: @internalComponent*/ williamr@2: class MICLAnimationDataLoaderObserver williamr@2: { williamr@2: public: williamr@2: enum TDataLoaderEvent williamr@2: { williamr@2: EImagePartialConvert, williamr@2: EImageConvertComplete, williamr@2: }; williamr@2: public: williamr@2: IMPORT_C virtual void DataLoaderEventL(TDataLoaderEvent aMessage, TInt aError) = 0; williamr@2: }; williamr@2: williamr@2: #endif //__ANIMATIONMIXINS_H__