Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: SpriteAnimation.h
Link against: animation.lib

Class CSpriteAnimation

class CSpriteAnimation : public CAnimation, public MAnimationDataProviderObserver;

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.

Derivation

Members

Defined in CSpriteAnimation:
CSpriteAnimation_Reserved2(), DataProvider(), DataProviderEventL(), Freeze(), Hold(), NewL(), NewL(), NewL(), NewL(), Pause(), Resume(), SetHostL(), SetPosition(), Size(), Start(), Stop(), Unfreeze(), Unhold(), ~CSpriteAnimation()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from MAnimationDataProviderObserver:
MAnimationDataProviderObserver_Reserved1(), MAnimationDataProviderObserver_Reserved2()

See also

See also:


Construction and destruction


NewL()

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

Description

Two stage constructor.

This creates and returns a new sprite animation.

Parameters

CAnimationDataProvider *aDataProvider

The data provider from which the animation contents will be obtained. The animation takes ownership of this object

const TPoint &aPoint

The starting position of the sprite in the window

RWsSession &aWsSession

A session with the window server

RWindow &aWindow

The window in which to draw the animation

MAnimationObserver *aObserver

An optional receiver of animation events (such as errors)

Return value

CSpriteAnimation *

The new object


NewL()

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

Description

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

CAnimationDataProvider *aDataProvider

The data provider from which the animation contents will be obtained. The animation takes ownership of this object

const TPoint &aPoint

The starting position of the sprite in the window

RWsSession &aWsSession

A session with the window server

RWindow &aWindow

The window in which to draw the animation

const TDesC8 &aDataType

Overrides the data type specified by the data provider

MAnimationObserver *aObserver

An optional receiver of animation events (such as errors)

Return value

CSpriteAnimation *

The new object


NewL()

static IMPORT_C CSpriteAnimation *NewL(CAnimationDataProvider *aDataProvider, const TPoint &aPoint, MAnimationObserver *aObserver=0, const CCoeControl *aHost=0);

Description

Two stage constructor.

This creates and returns a new sprite animation.

Parameters

CAnimationDataProvider *aDataProvider

The data provider from which the animation contents will be obtained. The animation takes ownership of this object

const TPoint &aPoint

The starting position of the sprite in the window

MAnimationObserver *aObserver

An optional receiver of animation events (such as errors)

const CCoeControl *aHost

Return value

CSpriteAnimation *

The new object


NewL()

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

Description

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

CAnimationDataProvider *aDataProvider

The data provider from which the animation contents will be obtained. The animation takes ownership of this object

const TPoint &aPoint

The starting position of the sprite in the window

const TDesC8 &aDataType

Overrides the data type specified by the data provider

MAnimationObserver *aObserver

An optional receiver of animation events (such as errors)

const CCoeControl *aHost

Return value

CSpriteAnimation *

The new object


~CSpriteAnimation()

IMPORT_C ~CSpriteAnimation();

Description

Destructor.

[Top]


Member functions


Size()

IMPORT_C TSize Size() const;

Description

Implements CAnimation::Size

Return value

TSize


DataProvider()

inline CAnimationDataProvider *DataProvider();

Description

Provides an CSpriteAnimation DataProvider interface to the client application.

Return value

CAnimationDataProvider *

iDataProvider A CAnimationDataProvider


Start()

virtual void Start(const TAnimationConfig &aConfig);

Description

Implements CAnimation::Start.

Parameters

const TAnimationConfig &aConfig

Specifies run time attributes of the animation


Stop()

virtual void Stop();

Description

Implements CAnimation::Stop.


Pause()

virtual void Pause();

Description

Implements CAnimation::Pause.


Resume()

virtual void Resume();

Description

Implements CAnimation::Resume.


Hold()

virtual void Hold();

Description

Implements CAnimation::Hold.


Unhold()

virtual void Unhold();

Description

Implements CAnimation::Unhold.


SetPosition()

virtual void SetPosition(const TPoint &aPoint);

Description

Implements CAnimation::SetPosition.

Parameters

const TPoint &aPoint

The new coordinates of the animation (usually the top left corner)


Freeze()

virtual void Freeze();

Description

Implements CAnimation::Freeze.


Unfreeze()

virtual void Unfreeze();

Description

Implements CAnimation::Unfreeze.


SetHostL()

virtual IMPORT_C void SetHostL(const CCoeControl *aHost);

Description

Parameters

const CCoeControl *aHost


CSpriteAnimation_Reserved2()

protected: virtual void CSpriteAnimation_Reserved2();

Description

Reserved for future use


DataProviderEventL()

private: virtual void DataProviderEventL(TInt aEvent, TAny *aData, TInt aDataSize);

Description

Receives an event from a data provider.

Parameters

TInt aEvent

The event code.

TAny *aData

Any data associated with the event. Can be NULL.

TInt aDataSize

The size in bytes of the item pointed to by aData.