CSpriteAnimation Class Reference

#include <mw/spriteanimation.h>

Link against: animation.lib

class CSpriteAnimation : public CAnimation, public MAnimationDataProviderObserver, public CAnimation, public MAnimationDataProviderObserver

Inherits from

Public Member Functions
~CSpriteAnimation()
CAnimationDataProvider *DataProvider()
virtual voidFreeze()
virtual voidHold()
IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, MAnimationObserver *)
IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, const TDesC8 &, MAnimationObserver *)
IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *, const TPoint &, MAnimationObserver *, const CCoeControl *)
IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *, const TPoint &, const TDesC8 &, MAnimationObserver *, const CCoeControl *)
virtual voidPause()
virtual voidResume()
virtual IMPORT_C voidSetHostL(const CCoeControl *)
virtual voidSetPosition(const TPoint &)
IMPORT_C TSizeSize()
virtual voidStart(const TAnimationConfig &)
virtual voidStop()
virtual voidUnfreeze()
virtual voidUnhold()
Protected Member Functions
CSpriteAnimation()
CSpriteAnimation(CAnimationDataProvider *, RWsSession &)
CSpriteAnimation(CAnimationDataProvider *, MAnimationObserver *, const CCoeControl *)
virtual voidCSpriteAnimation_Reserved2()
voidConstructL(const TPoint &, RWindow &, const TDesC8 &, MAnimationObserver *)
voidConstructL(const TPoint &, const TDesC8 &)
voidConstructL()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
MAnimationDataProviderObserver::MAnimationDataProviderObserver_Reserved1()
MAnimationDataProviderObserver::MAnimationDataProviderObserver_Reserved2()

Detailed Description

Implementation of CAnimation for sprite based animations.

A sprite animation displays the image using a sprite, which is a server side graphic object. This is likely to be more efficient than a basic animation, and requires slightly less work in the client application. However, it also provides less control over the actual rendering of the image.

A sprite animation must be associated with an RWindow. However, no redraw events will be generated for it by the animation, and the client application does not need to take any action once the animation has started. Holding the animation when the sprite is not visible is handled automatically on the server side.

See also: CAnimationDataProvider

Constructor & Destructor Documentation

CSpriteAnimation ( )

CSpriteAnimation()[protected]

CSpriteAnimation ( CAnimationDataProvider *, RWsSession & )

CSpriteAnimation(CAnimationDataProvider *aDataProvider,
RWsSession &aWsSession
)[protected]

CSpriteAnimation ( CAnimationDataProvider *, MAnimationObserver *, const CCoeControl * )

CSpriteAnimation(CAnimationDataProvider *aDataProvider,
MAnimationObserver *aObserver,
const CCoeControl *aHost
)[protected]

~CSpriteAnimation ( )

IMPORT_C~CSpriteAnimation()

Destructor.

Member Function Documentation

CSpriteAnimation_Reserved2 ( )

voidCSpriteAnimation_Reserved2()[protected, virtual]

Reserved for future use

ConstructL ( const TPoint &, RWindow &, const TDesC8 &, MAnimationObserver * )

voidConstructL(const TPoint &aPoint,
RWindow &aWindow,
const TDesC8 &aDataType,
MAnimationObserver *aObserver
)[protected]

ConstructL ( const TPoint &, const TDesC8 & )

voidConstructL(const TPoint &aPoint,
const TDesC8 &aDataType
)[protected]

ConstructL ( )

voidConstructL()[protected]

DataProvider ( )

CAnimationDataProvider *DataProvider()[inline]

Provides an CSpriteAnimation DataProvider interface to the client application.

Return Value
iDataProvider A CAnimationDataProvider

Freeze ( )

voidFreeze()[virtual]

Reimplemented from CAnimation::Freeze()

Implements CAnimation::Freeze.

Hold ( )

voidHold()[virtual]

Reimplemented from CAnimation::Hold()

Implements CAnimation::Hold.

NewL ( CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, MAnimationObserver * )

IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
RWsSession &aWsSession,
RWindow &aWindow,
MAnimationObserver *aObserver = 0
)[static]

Two stage constructor.

This creates and returns a new sprite animation.

Parameters
aDataProviderThe data provider from which the animation contents will be obtained. The animation takes ownership of this object
aPointThe starting position of the sprite in the window
aWsSessionA session with the window server
aWindowThe window in which to draw the animation
aObserverAn optional receiver of animation events (such as errors)
Return Value
The new object

NewL ( CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, const TDesC8 &, MAnimationObserver * )

IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
RWsSession &aWsSession,
RWindow &aWindow,
const TDesC8 &aDataType,
MAnimationObserver *aObserver = 0
)[static]

Two stage constructor.

This is identical to the other NewL except that it allows an alternative data type to be specified. Unless you are trying to use a custom animator class the other form of constructor should be used.

Parameters
aDataProviderThe data provider from which the animation contents will be obtained. The animation takes ownership of this object
aPointThe starting position of the sprite in the window
aWsSessionA session with the window server
aWindowThe window in which to draw the animation
aDataTypeOverrides the data type specified by the data provider
aObserverAn optional receiver of animation events (such as errors)
Return Value
The new object

NewL ( CAnimationDataProvider *, const TPoint &, MAnimationObserver *, const CCoeControl * )

IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
MAnimationObserver *aObserver = NULL,
const CCoeControl *aHost = NULL
)[static]

Two stage constructor.

This creates and returns a new sprite animation.

Parameters
aDataProviderThe data provider from which the animation contents will be obtained. The animation takes ownership of this object
aPointThe starting position of the sprite in the window
aObserverAn optional receiver of animation events (such as errors)
Return Value
The new object

NewL ( CAnimationDataProvider *, const TPoint &, const TDesC8 &, MAnimationObserver *, const CCoeControl * )

IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
const TDesC8 &aDataType,
MAnimationObserver *aObserver = NULL,
const CCoeControl *aHost = NULL
)[static]

Two stage constructor.

This is identical to the other NewL except that it allows an alternative data type to be specified. Unless you are trying to use a custom animator class the other form of constructor should be used.

Parameters
aDataProviderThe data provider from which the animation contents will be obtained. The animation takes ownership of this object
aPointThe starting position of the sprite in the window
aDataTypeOverrides the data type specified by the data provider
aObserverAn optional receiver of animation events (such as errors)
Return Value
The new object

Pause ( )

voidPause()[virtual]

Reimplemented from CAnimation::Pause()

Implements CAnimation::Pause.

Resume ( )

voidResume()[virtual]

Reimplemented from CAnimation::Resume()

Implements CAnimation::Resume.

SetHostL ( const CCoeControl * )

IMPORT_C voidSetHostL(const CCoeControl *aHost)[virtual]

SetPosition ( const TPoint & )

voidSetPosition(const TPoint &aPoint)[virtual]
Parameters
aPointThe new coordinates of the animation (usually the top left corner)

Size ( )

IMPORT_C TSizeSize()const

Implements CAnimation::Size

Start ( const TAnimationConfig & )

voidStart(const TAnimationConfig &aConfig)[virtual]

Implements CAnimation::Start.

Parameters
aConfigSpecifies run time attributes of the animation

Stop ( )

voidStop()[virtual]

Reimplemented from CAnimation::Stop()

Implements CAnimation::Stop.

Unfreeze ( )

voidUnfreeze()[virtual]

Reimplemented from CAnimation::Unfreeze()

Implements CAnimation::Unfreeze.

Unhold ( )

voidUnhold()[virtual]

Reimplemented from CAnimation::Unhold()

Implements CAnimation::Unhold.