CBasicAnimation Class Reference

#include <mw/basicanimation.h>

Link against: animation.lib

class CBasicAnimation : public CAnimation, public MAnimationDrawer, public MAnimationDataProviderObserver, public CAnimation, public MAnimationDrawer, public MAnimationDataProviderObserver

Inherits from

Public Member Functions
~CBasicAnimation()
CAnimationDataProvider *DataProvider()
IMPORT_C voidDraw(CWindowGc &)
virtual voidFreeze()
virtual voidHold()
IMPORT_C CBasicAnimation *NewL(CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, MAnimationObserver *)
IMPORT_C CBasicAnimation *NewL(CAnimationDataProvider *, const TPoint &, RWsSession &, RWindow &, const TDesC8 &, MAnimationObserver *)
IMPORT_C CBasicAnimation *NewL(CAnimationDataProvider *, const TPoint &, MAnimationObserver *, const CCoeControl *)
IMPORT_C CBasicAnimation *NewL(CAnimationDataProvider *, const TPoint &, const TDesC8 &, MAnimationObserver *, const CCoeControl *)
virtual voidPause()
const TPoint &Position()
virtual voidResume()
IMPORT_C voidSetHostL(const CCoeControl *)
virtual voidSetPosition(const TPoint &)
const TSize &Size()
virtual voidStart(const TAnimationConfig &)
virtual voidStop()
virtual voidUnfreeze()
virtual voidUnhold()
Protected Member Functions
CBasicAnimation(CAnimationDataProvider *, const TPoint &, RWsSession *, RWindow *, MAnimationObserver *)
CBasicAnimation()
CBasicAnimation(CAnimationDataProvider *, const TPoint &, MAnimationObserver *)
virtual IMPORT_C voidCBasicAnimation_Reserved1()
virtual IMPORT_C voidCBasicAnimation_Reserved2()
voidConstructL(const TDesC8 &)
voidConstructL(const TDesC8 &, const CCoeControl *)
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 purely client side animations.

A basic animation accepts a data provider during construction, loads the appropriate animator plugin, and implements the interface defined in CAnimation.

A basic animation must be associated with an RWindow. Redraw events will be received by the client application whenever the animation needs to draw a new frame, and it is the applications responsibility to call Draw() while handling these events. It is also the client applications responsibility to handle visibility events and place the animation on hold when it isn't visible. This saves on CPU usage and ultimately prolongs battery life.

See also: CAnimationDataProvider

Constructor & Destructor Documentation

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

CBasicAnimation(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
RWsSession *aWs,
RWindow *aWindow,
MAnimationObserver *aObserver
)[protected]

CBasicAnimation ( )

CBasicAnimation()[protected]

CBasicAnimation ( CAnimationDataProvider *, const TPoint &, MAnimationObserver * )

CBasicAnimation(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
MAnimationObserver *aObserver
)[protected]

~CBasicAnimation ( )

IMPORT_C~CBasicAnimation()

Destructor.

Member Function Documentation

CBasicAnimation_Reserved1 ( )

IMPORT_C voidCBasicAnimation_Reserved1()[protected, virtual]

Reserved for future use

CBasicAnimation_Reserved2 ( )

IMPORT_C voidCBasicAnimation_Reserved2()[protected, virtual]

Reserved for future use

ConstructL ( const TDesC8 & )

voidConstructL(const TDesC8 &aDataType)[protected]

ConstructL ( const TDesC8 &, const CCoeControl * )

voidConstructL(const TDesC8 &aDataType,
const CCoeControl *aHost
)[protected]

DataProvider ( )

CAnimationDataProvider *DataProvider()[inline]

Provides an CAnimationDataProvider interface to the client application.

Return Value
iDataProvider A CAnimationDataProvider

Draw ( CWindowGc & )

IMPORT_C voidDraw(CWindowGc &aGc)const

This function should be called with a valid graphics context whenever a redraw event is received for the window this animation resides in.

The graphics context attributes will not be modified, which means effects such as opacity can be applied to it before the call to Draw.

Parameters
aGcA graphics context which will be used for blitting the animation frame onto the window

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 CBasicAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
RWsSession &aWs,
RWindow &aWindow,
MAnimationObserver *aObserver = 0
)[static]

Two stage constructor.

This creates and returns a new basic 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 animation in the window (top left corner)
aWsA session with the window server
aWindowThe window in which the animation will be drawn
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 CBasicAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
RWsSession &aWs,
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 animation in the window (top left corner)
aWsA session with the window server
aWindowThe window in which the animation will be drawn
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 CBasicAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
MAnimationObserver *aObserver,
const CCoeControl *aHost
)[static]

Two stage constructor. This creates and returns a new basic 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 animation in the window (top left corner)
aObserverAn optional receiver of animation events (such as errors)
aHostThe CCoeControl responsible for drawing this animation
Return Value
The new object

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

IMPORT_C CBasicAnimation *NewL(CAnimationDataProvider *aDataProvider,
const TPoint &aPoint,
const TDesC8 &aDataType,
MAnimationObserver *aObserver,
const CCoeControl *aHost
)[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 animation in the window (top left corner)
aDataTypeOverrides the data type specified by the data provider
aObserverAn optional receiver of animation events (such as errors)
aHostThe CCoeControl responsible for drawing this animation
Return Value
The new object

Pause ( )

voidPause()[virtual]

Reimplemented from CAnimation::Pause()

Implements CAnimation::Pause.

Position ( )

const TPoint &Position()const [inline]

Returns the current drawing position.

Return Value
ipoint const Tpoint&

Resume ( )

voidResume()[virtual]

Reimplemented from CAnimation::Resume()

Implements CAnimation::Resume.

SetHostL ( const CCoeControl * )

IMPORT_C voidSetHostL(const CCoeControl *aHost)

This function lets you set the host at a later stage if you haven't got access to it during construction, or if you for some reason need to change it in run time.

SetPosition ( const TPoint & )

voidSetPosition(const TPoint &aPoint)[virtual]
Parameters
aPointThe new location of the top left corner of the animation, relative to the window in which it is to be drawn

Size ( )

const TSize &Size()const [inline]

Gets the size of the smallest bounding rectangle that will be required to render the animation.

This function is called when the animator is ready to begin animating. The animator cannot be started until it has called this function.

Return Value
iSize The size of the smallest bounding rectangle

Start ( const TAnimationConfig & )

voidStart(const TAnimationConfig &aConfig)[virtual]

Implements CAnimation::Start.

Parameters
aConfigFlags and possibly data regarding the way in which the animation should be run

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.