1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __ANIMATIONMIXINS_H__
17 #define __ANIMATIONMIXINS_H__
21 /** Interface from a data provider to an animation
23 An animation which has a data provider receives information from it via this
26 You do not need to derive an implementation from this class unless you are
27 writing a new animation type.
31 @see CAnimationDataProvider
34 class MAnimationDataProviderObserver
37 /** Receives an event from a data provider.
38 @param aEvent The event code.
39 @param aData Any data associated with the event. Can be NULL.
40 @param aDataSize The size in bytes of the item pointed to by aData.*/
41 virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
43 IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
44 IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
47 class CAnimationTicker;
49 /** Interface used by an animator to during the rendering process.
51 A class implementing this interface is provided to an animator by an animation.
52 It may or may not be the animation itself.
54 You do not need to derive an implementation from this class unless you are
55 writing a new animation type.
60 class MAnimationDrawer
63 /** Called by the animator when it needs to draw a new frame */
64 virtual void AnimatorDraw() = 0;
65 /** Called by the animator when it is ready to begin running.
66 @param aSize The size of the smallest bounding rectangle that will be required to render the animation */
67 virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
68 /** Called by the animator when it is no longer ready, usually in
69 response to TAnimationEvent::EAnimationDataChanged */
70 virtual void AnimatorResetL() = 0;
71 /** Called by the animator plugin loading routine to determine the type
72 of data for which an animator is required.
73 @return An 8 bit descriptor containing the data type.*/
74 virtual const TPtrC8 AnimatorDataType() const = 0;
75 /** Called by the animator to obtain an AnimatorTicker, to which it will
76 add itself whenever it is running.
77 @return A reference to a CAnimationTicker.*/
78 virtual CAnimationTicker& AnimatorTicker() = 0;
80 IMPORT_C virtual void MAnimationDrawer_Reserved1();
81 IMPORT_C virtual void MAnimationDrawer_Reserved2();
86 /** Interface used by an animation to report events to the client application.
88 An animation can inform the client application of particular events through this
89 mechanism. Only errors are reported in this way in v9.1, but more events may
92 Use of this interface by the client application is optional.
97 class MAnimationObserver
100 /** Represents generic events which can be sent to the observer. */
103 /** Indicates that an error has occurred in the data provider.
104 For events of this type, aData is a pointer to a TInt error code. */
106 /** Indicates that the animator initialised (and therefore knows it's size) */
107 EAnimationInitialized=0x01,
108 /** Any user defined animations introducing new events should use
109 values greater than EReserved */
113 /** Receives events from an animation.
115 The receiver is not required to take any action atall in response to this
116 call. The receiver should not delete the animation whilst responding
119 @param aSender A reference to the animation which sent the event.
120 @param aEvent The event code.
121 @param aData An event specific data item.*/
122 virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
124 IMPORT_C virtual void MAnimationObserver_Reserved1();
125 IMPORT_C virtual void MAnimationObserver_Reserved2();
128 /** Interface used for receiving animation ticks.
130 Animators receive regular ticks, during which they perform any required processing.
132 You do not need to derive an implementation from this class unless you are writing
138 @see CAnimationTicker*/
139 class MAnimationTickee
142 /** This function is called regularly by any ticker to which the tickee
144 virtual void Tick() = 0;
146 IMPORT_C virtual void MAnimationTickee_Reserved1();
147 IMPORT_C virtual void MAnimationTickee_Reserved2();
150 /** Internal interface used by the ICL data loader to communicate with the
151 ICL data provider. Not intended for user derivation.
153 class MICLAnimationDataLoaderObserver
156 enum TDataLoaderEvent
158 EImagePartialConvert,
159 EImageConvertComplete,
162 IMPORT_C virtual void DataLoaderEventL(TDataLoaderEvent aMessage, TInt aError) = 0;
165 #endif //__ANIMATIONMIXINS_H__