1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/animationmixins.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,165 @@
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 __ANIMATIONMIXINS_H__
1.20 +#define __ANIMATIONMIXINS_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +
1.24 +/** Interface from a data provider to an animation
1.25 +
1.26 +An animation which has a data provider receives information from it via this
1.27 +interface.
1.28 +
1.29 +You do not need to derive an implementation from this class unless you are
1.30 +writing a new animation type.
1.31 +
1.32 +@publishedAll
1.33 +@released
1.34 +@see CAnimationDataProvider
1.35 +@see CAnimation
1.36 +@see CAnimator*/
1.37 +class MAnimationDataProviderObserver
1.38 + {
1.39 +public:
1.40 + /** Receives an event from a data provider.
1.41 + @param aEvent The event code.
1.42 + @param aData Any data associated with the event. Can be NULL.
1.43 + @param aDataSize The size in bytes of the item pointed to by aData.*/
1.44 + virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
1.45 +protected:
1.46 + IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
1.47 + IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
1.48 + };
1.49 +
1.50 +class CAnimationTicker;
1.51 +
1.52 +/** Interface used by an animator to during the rendering process.
1.53 +
1.54 +A class implementing this interface is provided to an animator by an animation.
1.55 +It may or may not be the animation itself.
1.56 +
1.57 +You do not need to derive an implementation from this class unless you are
1.58 +writing a new animation type.
1.59 +
1.60 +@publishedAll
1.61 +@released
1.62 +@see CAnimator*/
1.63 +class MAnimationDrawer
1.64 + {
1.65 +public:
1.66 + /** Called by the animator when it needs to draw a new frame */
1.67 + virtual void AnimatorDraw() = 0;
1.68 + /** Called by the animator when it is ready to begin running.
1.69 + @param aSize The size of the smallest bounding rectangle that will be required to render the animation */
1.70 + virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
1.71 + /** Called by the animator when it is no longer ready, usually in
1.72 + response to TAnimationEvent::EAnimationDataChanged */
1.73 + virtual void AnimatorResetL() = 0;
1.74 + /** Called by the animator plugin loading routine to determine the type
1.75 + of data for which an animator is required.
1.76 + @return An 8 bit descriptor containing the data type.*/
1.77 + virtual const TPtrC8 AnimatorDataType() const = 0;
1.78 + /** Called by the animator to obtain an AnimatorTicker, to which it will
1.79 + add itself whenever it is running.
1.80 + @return A reference to a CAnimationTicker.*/
1.81 + virtual CAnimationTicker& AnimatorTicker() = 0;
1.82 +private:
1.83 + IMPORT_C virtual void MAnimationDrawer_Reserved1();
1.84 + IMPORT_C virtual void MAnimationDrawer_Reserved2();
1.85 + };
1.86 +
1.87 +class CAnimation;
1.88 +
1.89 +/** Interface used by an animation to report events to the client application.
1.90 +
1.91 +An animation can inform the client application of particular events through this
1.92 +mechanism. Only errors are reported in this way in v9.1, but more events may
1.93 +be added in future.
1.94 +
1.95 +Use of this interface by the client application is optional.
1.96 +
1.97 +@publishedAll
1.98 +@released
1.99 +@see CAnimation*/
1.100 +class MAnimationObserver
1.101 + {
1.102 +public:
1.103 + /** Represents generic events which can be sent to the observer. */
1.104 + enum TEvent
1.105 + {
1.106 + /** Indicates that an error has occurred in the data provider.
1.107 + For events of this type, aData is a pointer to a TInt error code. */
1.108 + EDataProviderError,
1.109 + /** Indicates that the animator initialised (and therefore knows it's size) */
1.110 + EAnimationInitialized=0x01,
1.111 + /** Any user defined animations introducing new events should use
1.112 + values greater than EReserved */
1.113 + EReserved=0xFFFF,
1.114 + };
1.115 +public:
1.116 + /** Receives events from an animation.
1.117 +
1.118 + The receiver is not required to take any action atall in response to this
1.119 + call. The receiver should not delete the animation whilst responding
1.120 + to this call.
1.121 +
1.122 + @param aSender A reference to the animation which sent the event.
1.123 + @param aEvent The event code.
1.124 + @param aData An event specific data item.*/
1.125 + virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
1.126 +protected:
1.127 + IMPORT_C virtual void MAnimationObserver_Reserved1();
1.128 + IMPORT_C virtual void MAnimationObserver_Reserved2();
1.129 + };
1.130 +
1.131 +/** Interface used for receiving animation ticks.
1.132 +
1.133 +Animators receive regular ticks, during which they perform any required processing.
1.134 +
1.135 +You do not need to derive an implementation from this class unless you are writing
1.136 +a new animator type.
1.137 +
1.138 +@publishedAll
1.139 +@released
1.140 +@see CAnimator
1.141 +@see CAnimationTicker*/
1.142 +class MAnimationTickee
1.143 + {
1.144 +public:
1.145 + /** This function is called regularly by any ticker to which the tickee
1.146 + has been added */
1.147 + virtual void Tick() = 0;
1.148 +protected:
1.149 + IMPORT_C virtual void MAnimationTickee_Reserved1();
1.150 + IMPORT_C virtual void MAnimationTickee_Reserved2();
1.151 + };
1.152 +
1.153 +/** Internal interface used by the ICL data loader to communicate with the
1.154 +ICL data provider. Not intended for user derivation.
1.155 +@internalComponent*/
1.156 +class MICLAnimationDataLoaderObserver
1.157 + {
1.158 +public:
1.159 + enum TDataLoaderEvent
1.160 + {
1.161 + EImagePartialConvert,
1.162 + EImageConvertComplete,
1.163 + };
1.164 +public:
1.165 + IMPORT_C virtual void DataLoaderEventL(TDataLoaderEvent aMessage, TInt aError) = 0;
1.166 + };
1.167 +
1.168 +#endif //__ANIMATIONMIXINS_H__