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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __ANIMATIONMIXINS_H__
17 #define __ANIMATIONMIXINS_H__
20 #include <animationdataloaderobserver.h>
22 /** Interface from a data provider to an animation
24 An animation which has a data provider receives information from it via this
27 You do not need to derive an implementation from this class unless you are
28 writing a new animation type.
32 @see CAnimationDataProvider
35 class MAnimationDataProviderObserver
38 /** Receives an event from a data provider.
39 @param aEvent The event code.
40 @param aData Any data associated with the event. Can be NULL.
41 @param aDataSize The size in bytes of the item pointed to by aData.*/
42 virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
44 IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
45 IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
48 class CAnimationTicker;
50 /** Interface used by an animator to during the rendering process.
52 A class implementing this interface is provided to an animator by an animation.
53 It may or may not be the animation itself.
55 You do not need to derive an implementation from this class unless you are
56 writing a new animation type.
61 class MAnimationDrawer
64 /** Called by the animator when it needs to draw a new frame */
65 virtual void AnimatorDraw() = 0;
66 /** Called by the animator when it is ready to begin running.
67 @param aSize The size of the smallest bounding rectangle that will be required to render the animation */
68 virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
69 /** Called by the animator when it is no longer ready, usually in
70 response to TAnimationEvent::EAnimationDataChanged */
71 virtual void AnimatorResetL() = 0;
72 /** Called by the animator plugin loading routine to determine the type
73 of data for which an animator is required.
74 @return An 8 bit descriptor containing the data type.*/
75 virtual const TPtrC8 AnimatorDataType() const = 0;
76 /** Called by the animator to obtain an AnimatorTicker, to which it will
77 add itself whenever it is running.
78 @return A reference to a CAnimationTicker.*/
79 virtual CAnimationTicker& AnimatorTicker() = 0;
81 IMPORT_C virtual void MAnimationDrawer_Reserved1();
82 IMPORT_C virtual void MAnimationDrawer_Reserved2();
87 /** Interface used by an animation to report events to the client application.
89 An animation can inform the client application of particular events through this
90 mechanism. Only errors are reported in this way in v9.1, but more events may
93 Use of this interface by the client application is optional.
98 class MAnimationObserver
101 /** Represents generic events which can be sent to the observer. */
104 /** Indicates that an error has occurred in the data provider.
105 For events of this type, aData is a pointer to a TInt error code. */
107 /** Indicates that the animator initialised (and therefore knows it's size) */
108 EAnimationInitialized=0x01,
109 /** Any user defined animations introducing new events should use
110 values greater than EReserved */
114 /** Receives events from an animation.
116 The receiver is not required to take any action atall in response to this
117 call. The receiver should not delete the animation whilst responding
120 @param aSender A reference to the animation which sent the event.
121 @param aEvent The event code.
122 @param aData An event specific data item.*/
123 virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
125 IMPORT_C virtual void MAnimationObserver_Reserved1();
126 IMPORT_C virtual void MAnimationObserver_Reserved2();
129 /** Interface used for receiving animation ticks.
131 Animators receive regular ticks, during which they perform any required processing.
133 You do not need to derive an implementation from this class unless you are writing
139 @see CAnimationTicker*/
140 class MAnimationTickee
143 /** This function is called regularly by any ticker to which the tickee
145 virtual void Tick() = 0;
147 IMPORT_C virtual void MAnimationTickee_Reserved1();
148 IMPORT_C virtual void MAnimationTickee_Reserved2();
151 #endif //__ANIMATIONMIXINS_H__