CBitmapAnim Class Reference

class CBitmapAnim : public CFreeTimerWindowAnim

class CBitmapAnim

This class encapsulates the enire animation: attributes and frames.

Public Member Functions
~CBitmapAnim()
CBitmapAnim *NewL()
Private Member Functions
CBitmapAnim()
voidAnimate(TDateTime *)
voidAppendFrameL(const TFrameData &)
TRect CalcFrameRect(TInt)
voidClearFrameData()
voidClearFrameNow(TInt)
voidCommand(TInt, TAny *)
TInt CommandReplyL(TInt, TAny *)
voidConstructL(TAny *, TBool)
TInt Count()
voidDisplayFrame(TInt)
voidDisplayNextFrameL()
voidDrawBitmap(TInt, TBool)
voidFlashFrame(TBool)
voidFocusChanged(TBool)
TBool FrameNeedsRedrawing(const TRegion *, TRect)
TBool IsFrameDisplayable()
TBool IsFrozen()
TBool IsRunning()
TBool OfferRawEvent(const TRawEvent &)
voidRedraw()
voidRenderFrameBackground(TInt)
voidResetAnimation()
voidResetFrameArray()
voidSetBackgroundFrameL(TFrameData)
voidSetFlash(TBmpAnimAttributes)
voidSetFrameInterval(TBmpAnimAttributes)
TInt SetIndexFrame(SBitmapAnimIndexFrame)
voidSetNumberOfCycles(SBitmapAnimNumberOfCycles)
voidSetPlayMode(TBmpAnimAttributes)
voidSetPosition(SBitmapAnimNewPosition)
voidStartAnimationL()
voidStopAnimation()
voidUpdateCurrentIndex()
TRect WindowRect()
Inherited Functions
CAnim::HandleNotification(const TWsEvent &)
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()
CFreeTimerWindowAnim::WindowFunctions()
CWindowAnim::CWindowAnim()
Private Member Enumerations
enumTAnimateFlags {
ERunning = 0x0001, EFlashing = 0x0002, EFrozen = 0x0004, EPlayModeCycle = 0x0010, EPlayModeBounce = 0x0020, EPlayForwards = 0x0040, EPlayBackwards = 0x0080, EFlash = 0x0100, ENoBitmapWindowRestoring = 0x0800, EDisplayLastFrameWhenFinished = 0x4000
}
Private Attributes
CBitmapAnimTimer *iAnimTimer
CBitmapAnimFrameData *iBackgroundFrame
RPointerArray< CBitmapAnimFrameData >iBitmapAnimFrameDataArray
TInt iDummy
TInt iFlags
CBitmapAnimFlashTimer *iFlashTimer
TTimeIntervalMicroSeconds32 iFrameInterval
TInt iIndex
TInt iNumberOfCycles
TPoint iPosition
TInt iWindowConfig
Inherited Attributes
CAnim::iFunctions
CWindowAnim::iGc
CWindowAnim::iWindowFunctions

Constructor & Destructor Documentation

CBitmapAnim()

CBitmapAnim()[private]

~CBitmapAnim()

~CBitmapAnim()

Member Functions Documentation

Animate(TDateTime *)

voidAnimate(TDateTime *aDateTime)[private, virtual]

Main animation function, called by the window server.

The drawing code which implements a given animation should be provided here.

This function is called at a frequency determined by the SetSync() helper function. Note that if sync is not set, then this function will never be called. This effect can be exploited to use the animation framework, with its server side speed, for what are strictly not animations, e.g. for streaming video images.

The aDateTime parameter will be null if the current time (as determined by the window server) matches the time implied by the sync period, modulo normalisation, otherwise it will contain a valid (non-normalised) time.

Normalisation is to some specified granularity, for example if one minute is specified as the animation frequency, then in effect the window server will decide whether the implied time is correct to the minute, but not to the second.

Implied time is the time implied by the (normalised) actual time of the previous animation call plus the sync interval. For example if the last call was at time 't' and the sync interval is 1 second then if the time at this call is t + 1 second, then actual time and implied time match and the value placed into aDateTime will be NULL.

Cases in which the two may not match include, for example, system time having been reset between animation calls (perhaps British Summer Time or other daylight saving time has just come into effect). The intention is that when system time changes, a mechanism is provided to alert the animation code and allow it to reset itself. The assumption is that somewhere in its initialisation code, the animation will have performed a CAnimFunctions utility call to set a base time, which is then implicitly tracked by incrementing by a suitable interval; when aDateTime is non-NULL after a call to Animate(), base time should be reset.

Parameters

TDateTime * aDateTimeNull if the current time w.r.t. the window server matches the time implied by the synch period. Otherwise a valid (non-normalised) time.

AppendFrameL(const TFrameData &)

voidAppendFrameL(const TFrameData &aFrameData)[private]

Parameters

const TFrameData & aFrameData

CalcFrameRect(TInt)

TRect CalcFrameRect(TIntaIndex)[private]

Parameters

TInt aIndex

ClearFrameData()

voidClearFrameData()[private]

ClearFrameNow(TInt)

voidClearFrameNow(TIntaIndex)[private]

Parameters

TInt aIndex

Command(TInt, TAny *)

voidCommand(TIntaOpcode,
TAny *aArgs
)[private, virtual]

Implements client-side initiated commands.

The window server calls this function in response to application calls to the client side command function RAnim::Command(). The arguments passed to the function by the window server are the same as were used on the client side function call.

Because this function does not return errors, it is not safe for commands which might leave.

RAnim

Parameters

TInt aOpcodeOpcode understood by the class
TAny * aArgsArguments packaged on the client side, for example as a struct of a type determined by the aOpcode argument. These mirror the aArgs argument passed in to RAnim::Command().

CommandReplyL(TInt, TAny *)

TInt CommandReplyL(TIntaOpcode,
TAny *aArgs
)[private, virtual]

Implements client-side initiated commands, returning a value.

The window server calls this function in response to application calls to the client side command function RAnim::CommandReplyL(). The arguments passed to the function by the window server are the same as were used on the client side function call.

This function returns values to the client side, and should be used to return error codes for commands which might leave.

RAnim

Parameters

TInt aOpcodeOpcode understood by the class.
TAny * aArgsArguments packaged on the client side, for example as a struct of a type determined by the aOpcode argument. These mirror the aArgs argument passed in to RAnim::CommandReply().

ConstructL(TAny *, TBool)

voidConstructL(TAny *aArgs,
TBoolaHasFocus
)[private, virtual]

Server side construction and initialisation of an animation class.

Note: the aHasFocus argument allows the animation to start in a known focus state. For example, an animation may or may not have focus, depending on how it was started. Together with the FocusChanged() function, this allows an animation to always know its focus state.

Parameters

TAny * aArgsPackaged arguments which may be required during construction. These are transferred from the aParams argument of the client side constructor's RAnim::Construct().
TBool aHasFocusSpecifies whether or not the animation has window server focus.

Count()

TInt Count()const [private, inline]

DisplayFrame(TInt)

voidDisplayFrame(TIntaPreviousIndex = -1)[private]

Parameters

TInt aPreviousIndex = -1

DisplayNextFrameL()

voidDisplayNextFrameL()[private, virtual]

DrawBitmap(TInt, TBool)

voidDrawBitmap(TIntaPreviousIndex = -1,
TBoolaRedraw = EFalse
)[private]

Parameters

TInt aPreviousIndex = -1
TBool aRedraw = EFalse

FlashFrame(TBool)

voidFlashFrame(TBoolaFlash)[private, virtual]

Parameters

TBool aFlash

FocusChanged(TBool)

voidFocusChanged(TBoolaState)[private, virtual]

Notifies change of focus.

The function is called by the window server to notify a change of focus, allowing the animation code to track whether it does or does not have focus, and to change its appearance accordingly.

Parameters

TBool aStateIndicates whether the focus has or has not changed.

FrameNeedsRedrawing(const TRegion *, TRect)

TBool FrameNeedsRedrawing(const TRegion *aRedrawRegion,
TRectaFrameScreenRect
)[private, static]

Parameters

const TRegion * aRedrawRegion
TRect aFrameScreenRect

IsFrameDisplayable()

TBool IsFrameDisplayable()const [private, inline]

IsFrozen()

TBool IsFrozen()const [private, inline]

IsRunning()

TBool IsRunning()const [private, inline]

NewL()

CBitmapAnim *NewL()[static]

OfferRawEvent(const TRawEvent &)

TBool OfferRawEvent(const TRawEvent &aRawEvent)[private, virtual]

Parameters

const TRawEvent & aRawEvent

Redraw()

voidRedraw()[private, virtual]

Redraws the objects.

The function is called by the window server when it needs to redraw the object. The object must provide all the low level drawing code.

RenderFrameBackground(TInt)

voidRenderFrameBackground(TIntaIndex)[private]

Parameters

TInt aIndex

ResetAnimation()

voidResetAnimation()[private]

ResetFrameArray()

voidResetFrameArray()[private]

SetBackgroundFrameL(TFrameData)

voidSetBackgroundFrameL(TFrameDataaFrameDataArg)[private]

Parameters

TFrameData aFrameDataArg

SetFlash(TBmpAnimAttributes)

voidSetFlash(TBmpAnimAttributesaFlash)[private]

Parameters

TBmpAnimAttributes aFlash

SetFrameInterval(TBmpAnimAttributes)

voidSetFrameInterval(TBmpAnimAttributesaFrameInterval)[private]

Parameters

TBmpAnimAttributes aFrameInterval

SetIndexFrame(SBitmapAnimIndexFrame)

TInt SetIndexFrame(SBitmapAnimIndexFrameaIndexFrame)[private]

Parameters

SBitmapAnimIndexFrame aIndexFrame

SetNumberOfCycles(SBitmapAnimNumberOfCycles)

voidSetNumberOfCycles(SBitmapAnimNumberOfCyclesaNumberOfCycles)[private]

Parameters

SBitmapAnimNumberOfCycles aNumberOfCycles

SetPlayMode(TBmpAnimAttributes)

voidSetPlayMode(TBmpAnimAttributesaPlayMode)[private]

Parameters

TBmpAnimAttributes aPlayMode

SetPosition(SBitmapAnimNewPosition)

voidSetPosition(SBitmapAnimNewPositionaNewPosition)[private]

Parameters

SBitmapAnimNewPosition aNewPosition

StartAnimationL()

voidStartAnimationL()[private]

StopAnimation()

voidStopAnimation()[private]

UpdateCurrentIndex()

voidUpdateCurrentIndex()[private]

WindowRect()

TRect WindowRect()const [private, inline]

Member Enumerations Documentation

Enum TAnimateFlags

Enumerators

ERunning = 0x0001
EFlashing = 0x0002
EFrozen = 0x0004
EPlayModeCycle = 0x0010
EPlayModeBounce = 0x0020
EPlayForwards = 0x0040
EPlayBackwards = 0x0080
EFlash = 0x0100
ENoBitmapWindowRestoring = 0x0800
EDisplayLastFrameWhenFinished = 0x4000

Member Data Documentation

CBitmapAnimTimer * iAnimTimer

CBitmapAnimTimer *iAnimTimer[private]

CBitmapAnimFrameData * iBackgroundFrame

CBitmapAnimFrameData *iBackgroundFrame[private]

RPointerArray< CBitmapAnimFrameData > iBitmapAnimFrameDataArray

RPointerArray< CBitmapAnimFrameData >iBitmapAnimFrameDataArray[private]

TInt iDummy

TInt iDummy[private]

TInt iFlags

TInt iFlags[private]

CBitmapAnimFlashTimer * iFlashTimer

CBitmapAnimFlashTimer *iFlashTimer[private]

TTimeIntervalMicroSeconds32 iFrameInterval

TTimeIntervalMicroSeconds32 iFrameInterval[private]

TInt iIndex

TInt iIndex[private]

TInt iNumberOfCycles

TInt iNumberOfCycles[private]

TPoint iPosition

TPoint iPosition[private]

TInt iWindowConfig

TInt iWindowConfig[private]