epoc32/include/mw/animationmixins.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100 (2010-03-31)
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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@4
    20
#include <animationdataloaderobserver.h>
williamr@2
    21
williamr@2
    22
/** Interface from a data provider to an animation
williamr@2
    23
williamr@2
    24
An animation which has a data provider receives information from it via this
williamr@2
    25
interface.
williamr@2
    26
williamr@2
    27
You do not need to derive an implementation from this class unless you are
williamr@2
    28
writing a new animation type.
williamr@2
    29
williamr@2
    30
@publishedAll 
williamr@2
    31
@released
williamr@2
    32
@see CAnimationDataProvider
williamr@2
    33
@see CAnimation
williamr@2
    34
@see CAnimator*/
williamr@2
    35
class MAnimationDataProviderObserver
williamr@2
    36
	{
williamr@2
    37
public:
williamr@2
    38
	/** Receives an event from a data provider.
williamr@2
    39
	@param aEvent The event code.
williamr@2
    40
	@param aData Any data associated with the event. Can be NULL.
williamr@2
    41
	@param aDataSize The size in bytes of the item pointed to by aData.*/
williamr@2
    42
	virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
williamr@2
    43
protected:
williamr@2
    44
	IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
williamr@2
    45
	IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
williamr@2
    46
	};
williamr@2
    47
williamr@2
    48
class CAnimationTicker;
williamr@2
    49
williamr@2
    50
/** Interface used by an animator to during the rendering process.
williamr@2
    51
williamr@2
    52
A class implementing this interface is provided to an animator by an animation.
williamr@2
    53
It may or may not be the animation itself.
williamr@2
    54
williamr@2
    55
You do not need to derive an implementation from this class unless you are
williamr@2
    56
writing a new animation type.
williamr@2
    57
williamr@2
    58
@publishedAll 
williamr@2
    59
@released
williamr@2
    60
@see CAnimator*/
williamr@2
    61
class MAnimationDrawer
williamr@2
    62
	{
williamr@2
    63
public:
williamr@2
    64
	/** Called by the animator when it needs to draw a new frame */
williamr@2
    65
	virtual void AnimatorDraw() = 0;
williamr@2
    66
	/** Called by the animator when it is ready to begin running. 
williamr@2
    67
	@param aSize The size of the smallest bounding rectangle that will be required to render the animation */
williamr@2
    68
	virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
williamr@2
    69
	/** Called by the animator when it is no longer ready, usually in
williamr@2
    70
	response to TAnimationEvent::EAnimationDataChanged */
williamr@2
    71
	virtual void AnimatorResetL() = 0;
williamr@2
    72
	/** Called by the animator plugin loading routine to determine the type
williamr@2
    73
	of data for which an animator is required.
williamr@2
    74
	@return An 8 bit descriptor containing the data type.*/
williamr@2
    75
	virtual const TPtrC8 AnimatorDataType() const = 0;
williamr@2
    76
	/** Called by the animator to obtain an AnimatorTicker, to which it will
williamr@2
    77
	add itself whenever it is running.
williamr@2
    78
	@return A reference to a CAnimationTicker.*/
williamr@2
    79
	virtual CAnimationTicker& AnimatorTicker() = 0;
williamr@2
    80
private:
williamr@2
    81
	IMPORT_C virtual void MAnimationDrawer_Reserved1();
williamr@2
    82
	IMPORT_C virtual void MAnimationDrawer_Reserved2();
williamr@2
    83
	};
williamr@2
    84
williamr@2
    85
class CAnimation;
williamr@2
    86
williamr@2
    87
/** Interface used by an animation to report events to the client application.
williamr@2
    88
williamr@2
    89
An animation can inform the client application of particular events through this
williamr@2
    90
mechanism.  Only errors are reported in this way in v9.1, but more events may
williamr@2
    91
be added in future.
williamr@2
    92
williamr@2
    93
Use of this interface by the client application is optional.
williamr@2
    94
williamr@2
    95
@publishedAll 
williamr@2
    96
@released
williamr@2
    97
@see CAnimation*/
williamr@2
    98
class MAnimationObserver
williamr@2
    99
	{
williamr@2
   100
public:
williamr@2
   101
	/** Represents generic events which can be sent to the observer. */
williamr@2
   102
	enum TEvent
williamr@2
   103
		{
williamr@2
   104
		/** Indicates that an error has occurred in the data provider.
williamr@2
   105
		For events of this type, aData is a pointer to a TInt error code. */
williamr@2
   106
		EDataProviderError,
williamr@2
   107
		/** Indicates that the animator initialised (and therefore knows it's size) */
williamr@2
   108
		EAnimationInitialized=0x01,
williamr@2
   109
		/** Any user defined animations introducing new events should use
williamr@2
   110
		values greater than EReserved */
williamr@2
   111
		EReserved=0xFFFF,
williamr@2
   112
		};
williamr@2
   113
public:
williamr@2
   114
	/** Receives events from an animation.
williamr@2
   115
	
williamr@2
   116
	The receiver is not required to take any action atall in response to this
williamr@2
   117
	call.  The receiver should not delete the animation whilst responding
williamr@2
   118
	to this call.
williamr@2
   119
	
williamr@2
   120
	@param aSender A reference to the animation which sent the event.
williamr@2
   121
	@param aEvent The event code.
williamr@2
   122
	@param aData An event specific data item.*/
williamr@2
   123
	virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
williamr@2
   124
protected:
williamr@2
   125
	IMPORT_C virtual void MAnimationObserver_Reserved1();
williamr@2
   126
	IMPORT_C virtual void MAnimationObserver_Reserved2();
williamr@2
   127
	};
williamr@2
   128
williamr@2
   129
/** Interface used for receiving animation ticks.
williamr@2
   130
williamr@2
   131
Animators receive regular ticks, during which they perform any required processing.
williamr@2
   132
williamr@2
   133
You do not need to derive an implementation from this class unless you are writing
williamr@2
   134
a new animator type.
williamr@2
   135
williamr@2
   136
@publishedAll 
williamr@2
   137
@released
williamr@2
   138
@see CAnimator
williamr@2
   139
@see CAnimationTicker*/
williamr@2
   140
class MAnimationTickee
williamr@2
   141
	{
williamr@2
   142
public:
williamr@2
   143
	/** This function is called regularly by any ticker to which the tickee
williamr@2
   144
	has been added */
williamr@2
   145
	virtual void Tick() = 0;
williamr@2
   146
protected:
williamr@2
   147
	IMPORT_C virtual void MAnimationTickee_Reserved1();
williamr@2
   148
	IMPORT_C virtual void MAnimationTickee_Reserved2();
williamr@2
   149
	};
williamr@2
   150
williamr@2
   151
#endif //__ANIMATIONMIXINS_H__