williamr@2
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __ANIMATIONMIXINS_H__
|
williamr@2
|
17 |
#define __ANIMATIONMIXINS_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
|
williamr@2
|
21 |
/** Interface from a data provider to an animation
|
williamr@2
|
22 |
|
williamr@2
|
23 |
An animation which has a data provider receives information from it via this
|
williamr@2
|
24 |
interface.
|
williamr@2
|
25 |
|
williamr@2
|
26 |
You do not need to derive an implementation from this class unless you are
|
williamr@2
|
27 |
writing a new animation type.
|
williamr@2
|
28 |
|
williamr@2
|
29 |
@publishedAll
|
williamr@2
|
30 |
@released
|
williamr@2
|
31 |
@see CAnimationDataProvider
|
williamr@2
|
32 |
@see CAnimation
|
williamr@2
|
33 |
@see CAnimator*/
|
williamr@2
|
34 |
class MAnimationDataProviderObserver
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
public:
|
williamr@2
|
37 |
/** Receives an event from a data provider.
|
williamr@2
|
38 |
@param aEvent The event code.
|
williamr@2
|
39 |
@param aData Any data associated with the event. Can be NULL.
|
williamr@2
|
40 |
@param aDataSize The size in bytes of the item pointed to by aData.*/
|
williamr@2
|
41 |
virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
|
williamr@2
|
42 |
protected:
|
williamr@2
|
43 |
IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
|
williamr@2
|
44 |
IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
|
williamr@2
|
45 |
};
|
williamr@2
|
46 |
|
williamr@2
|
47 |
class CAnimationTicker;
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/** Interface used by an animator to during the rendering process.
|
williamr@2
|
50 |
|
williamr@2
|
51 |
A class implementing this interface is provided to an animator by an animation.
|
williamr@2
|
52 |
It may or may not be the animation itself.
|
williamr@2
|
53 |
|
williamr@2
|
54 |
You do not need to derive an implementation from this class unless you are
|
williamr@2
|
55 |
writing a new animation type.
|
williamr@2
|
56 |
|
williamr@2
|
57 |
@publishedAll
|
williamr@2
|
58 |
@released
|
williamr@2
|
59 |
@see CAnimator*/
|
williamr@2
|
60 |
class MAnimationDrawer
|
williamr@2
|
61 |
{
|
williamr@2
|
62 |
public:
|
williamr@2
|
63 |
/** Called by the animator when it needs to draw a new frame */
|
williamr@2
|
64 |
virtual void AnimatorDraw() = 0;
|
williamr@2
|
65 |
/** Called by the animator when it is ready to begin running.
|
williamr@2
|
66 |
@param aSize The size of the smallest bounding rectangle that will be required to render the animation */
|
williamr@2
|
67 |
virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
|
williamr@2
|
68 |
/** Called by the animator when it is no longer ready, usually in
|
williamr@2
|
69 |
response to TAnimationEvent::EAnimationDataChanged */
|
williamr@2
|
70 |
virtual void AnimatorResetL() = 0;
|
williamr@2
|
71 |
/** Called by the animator plugin loading routine to determine the type
|
williamr@2
|
72 |
of data for which an animator is required.
|
williamr@2
|
73 |
@return An 8 bit descriptor containing the data type.*/
|
williamr@2
|
74 |
virtual const TPtrC8 AnimatorDataType() const = 0;
|
williamr@2
|
75 |
/** Called by the animator to obtain an AnimatorTicker, to which it will
|
williamr@2
|
76 |
add itself whenever it is running.
|
williamr@2
|
77 |
@return A reference to a CAnimationTicker.*/
|
williamr@2
|
78 |
virtual CAnimationTicker& AnimatorTicker() = 0;
|
williamr@2
|
79 |
private:
|
williamr@2
|
80 |
IMPORT_C virtual void MAnimationDrawer_Reserved1();
|
williamr@2
|
81 |
IMPORT_C virtual void MAnimationDrawer_Reserved2();
|
williamr@2
|
82 |
};
|
williamr@2
|
83 |
|
williamr@2
|
84 |
class CAnimation;
|
williamr@2
|
85 |
|
williamr@2
|
86 |
/** Interface used by an animation to report events to the client application.
|
williamr@2
|
87 |
|
williamr@2
|
88 |
An animation can inform the client application of particular events through this
|
williamr@2
|
89 |
mechanism. Only errors are reported in this way in v9.1, but more events may
|
williamr@2
|
90 |
be added in future.
|
williamr@2
|
91 |
|
williamr@2
|
92 |
Use of this interface by the client application is optional.
|
williamr@2
|
93 |
|
williamr@2
|
94 |
@publishedAll
|
williamr@2
|
95 |
@released
|
williamr@2
|
96 |
@see CAnimation*/
|
williamr@2
|
97 |
class MAnimationObserver
|
williamr@2
|
98 |
{
|
williamr@2
|
99 |
public:
|
williamr@2
|
100 |
/** Represents generic events which can be sent to the observer. */
|
williamr@2
|
101 |
enum TEvent
|
williamr@2
|
102 |
{
|
williamr@2
|
103 |
/** Indicates that an error has occurred in the data provider.
|
williamr@2
|
104 |
For events of this type, aData is a pointer to a TInt error code. */
|
williamr@2
|
105 |
EDataProviderError,
|
williamr@2
|
106 |
/** Indicates that the animator initialised (and therefore knows it's size) */
|
williamr@2
|
107 |
EAnimationInitialized=0x01,
|
williamr@2
|
108 |
/** Any user defined animations introducing new events should use
|
williamr@2
|
109 |
values greater than EReserved */
|
williamr@2
|
110 |
EReserved=0xFFFF,
|
williamr@2
|
111 |
};
|
williamr@2
|
112 |
public:
|
williamr@2
|
113 |
/** Receives events from an animation.
|
williamr@2
|
114 |
|
williamr@2
|
115 |
The receiver is not required to take any action atall in response to this
|
williamr@2
|
116 |
call. The receiver should not delete the animation whilst responding
|
williamr@2
|
117 |
to this call.
|
williamr@2
|
118 |
|
williamr@2
|
119 |
@param aSender A reference to the animation which sent the event.
|
williamr@2
|
120 |
@param aEvent The event code.
|
williamr@2
|
121 |
@param aData An event specific data item.*/
|
williamr@2
|
122 |
virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
|
williamr@2
|
123 |
protected:
|
williamr@2
|
124 |
IMPORT_C virtual void MAnimationObserver_Reserved1();
|
williamr@2
|
125 |
IMPORT_C virtual void MAnimationObserver_Reserved2();
|
williamr@2
|
126 |
};
|
williamr@2
|
127 |
|
williamr@2
|
128 |
/** Interface used for receiving animation ticks.
|
williamr@2
|
129 |
|
williamr@2
|
130 |
Animators receive regular ticks, during which they perform any required processing.
|
williamr@2
|
131 |
|
williamr@2
|
132 |
You do not need to derive an implementation from this class unless you are writing
|
williamr@2
|
133 |
a new animator type.
|
williamr@2
|
134 |
|
williamr@2
|
135 |
@publishedAll
|
williamr@2
|
136 |
@released
|
williamr@2
|
137 |
@see CAnimator
|
williamr@2
|
138 |
@see CAnimationTicker*/
|
williamr@2
|
139 |
class MAnimationTickee
|
williamr@2
|
140 |
{
|
williamr@2
|
141 |
public:
|
williamr@2
|
142 |
/** This function is called regularly by any ticker to which the tickee
|
williamr@2
|
143 |
has been added */
|
williamr@2
|
144 |
virtual void Tick() = 0;
|
williamr@2
|
145 |
protected:
|
williamr@2
|
146 |
IMPORT_C virtual void MAnimationTickee_Reserved1();
|
williamr@2
|
147 |
IMPORT_C virtual void MAnimationTickee_Reserved2();
|
williamr@2
|
148 |
};
|
williamr@2
|
149 |
|
williamr@2
|
150 |
/** Internal interface used by the ICL data loader to communicate with the
|
williamr@2
|
151 |
ICL data provider. Not intended for user derivation.
|
williamr@2
|
152 |
@internalComponent*/
|
williamr@2
|
153 |
class MICLAnimationDataLoaderObserver
|
williamr@2
|
154 |
{
|
williamr@2
|
155 |
public:
|
williamr@2
|
156 |
enum TDataLoaderEvent
|
williamr@2
|
157 |
{
|
williamr@2
|
158 |
EImagePartialConvert,
|
williamr@2
|
159 |
EImageConvertComplete,
|
williamr@2
|
160 |
};
|
williamr@2
|
161 |
public:
|
williamr@2
|
162 |
IMPORT_C virtual void DataLoaderEventL(TDataLoaderEvent aMessage, TInt aError) = 0;
|
williamr@2
|
163 |
};
|
williamr@2
|
164 |
|
williamr@2
|
165 |
#endif //__ANIMATIONMIXINS_H__
|