Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from CBase:

Inherited from MAnimationDataProviderObserver:

See also:

Related Topics


Construction and destruction


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

IMPORT_C static 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(CAnimationDataProvider *,const TPoint &,RWsSession &,RWindow &,const TDesC8 &,MAnimationObserver *)

IMPORT_C static 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(CAnimationDataProvider *,const TPoint &,MAnimationObserver *,const CCoeControl *)

IMPORT_C static 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(CAnimationDataProvider *,const TPoint &,const TDesC8 &,MAnimationObserver *,const CCoeControl *)

IMPORT_C static 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()const

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(const TAnimationConfig &)

virtual void Start(const TAnimationConfig &aConfig);

Description

Implements CAnimation::Start(const TAnimationConfig &).

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(const TPoint &)

virtual void SetPosition(const TPoint &aPoint);

Description

Implements CAnimation::SetPosition(const TPoint &).

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(const CCoeControl *)

IMPORT_C virtual void SetHostL(const CCoeControl *aHost);

Description

Parameters

const CCoeControl *aHost


CSpriteAnimation_Reserved2()

protected: virtual void CSpriteAnimation_Reserved2();

Description

Reserved for future use


DataProviderEventL(TInt,TAny *,TInt)

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.