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 ()
void Animate ( TDateTime *)
void AppendFrameL (const TFrameData &)
TRect CalcFrameRect ( TInt )
void ClearFrameData ()
void ClearFrameNow ( TInt )
void Command ( TInt , TAny *)
TInt CommandReplyL ( TInt , TAny *)
void ConstructL ( TAny *, TBool )
TInt Count ()
void DisplayFrame ( TInt )
void DisplayNextFrameL ()
void DrawBitmap ( TInt , TBool )
void FlashFrame ( TBool )
void FocusChanged ( TBool )
TBool FrameNeedsRedrawing (const TRegion *, TRect )
TBool IsFrameDisplayable ()
TBool IsFrozen ()
TBool IsRunning ()
TBool OfferRawEvent (const TRawEvent &)
void Redraw ()
void RenderFrameBackground ( TInt )
void ResetAnimation ()
void ResetFrameArray ()
void SetBackgroundFrameL ( TFrameData )
void SetFlash ( TBmpAnimAttributes )
void SetFrameInterval ( TBmpAnimAttributes )
TInt SetIndexFrame ( SBitmapAnimIndexFrame )
void SetNumberOfCycles ( SBitmapAnimNumberOfCycles )
void SetPlayMode ( TBmpAnimAttributes )
void SetPosition ( SBitmapAnimNewPosition )
void StartAnimationL ()
void StopAnimation ()
void UpdateCurrentIndex ()
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
enum TAnimateFlags {
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 *)

void Animate ( 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 * aDateTime Null 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 &)

void AppendFrameL ( const TFrameData & aFrameData ) [private]

Parameters

const TFrameData & aFrameData

CalcFrameRect(TInt)

TRect CalcFrameRect ( TInt aIndex ) [private]

Parameters

TInt aIndex

ClearFrameData()

void ClearFrameData ( ) [private]

ClearFrameNow(TInt)

void ClearFrameNow ( TInt aIndex ) [private]

Parameters

TInt aIndex

Command(TInt, TAny *)

void Command ( TInt aOpcode,
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 aOpcode Opcode understood by the class
TAny * aArgs Arguments 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 ( TInt aOpcode,
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 aOpcode Opcode understood by the class.
TAny * aArgs Arguments 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)

void ConstructL ( TAny * aArgs,
TBool aHasFocus
) [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 * aArgs Packaged arguments which may be required during construction. These are transferred from the aParams argument of the client side constructor's RAnim::Construct().
TBool aHasFocus Specifies whether or not the animation has window server focus.

Count()

TInt Count ( ) const [private, inline]

DisplayFrame(TInt)

void DisplayFrame ( TInt aPreviousIndex = -1 ) [private]

Parameters

TInt aPreviousIndex = -1

DisplayNextFrameL()

void DisplayNextFrameL ( ) [private, virtual]

DrawBitmap(TInt, TBool)

void DrawBitmap ( TInt aPreviousIndex = -1,
TBool aRedraw = EFalse
) [private]

Parameters

TInt aPreviousIndex = -1
TBool aRedraw = EFalse

FlashFrame(TBool)

void FlashFrame ( TBool aFlash ) [private, virtual]

Parameters

TBool aFlash

FocusChanged(TBool)

void FocusChanged ( TBool aState ) [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 aState Indicates whether the focus has or has not changed.

FrameNeedsRedrawing(const TRegion *, TRect)

TBool FrameNeedsRedrawing ( const TRegion * aRedrawRegion,
TRect aFrameScreenRect
) [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()

void Redraw ( ) [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)

void RenderFrameBackground ( TInt aIndex ) [private]

Parameters

TInt aIndex

ResetAnimation()

void ResetAnimation ( ) [private]

ResetFrameArray()

void ResetFrameArray ( ) [private]

SetBackgroundFrameL(TFrameData)

void SetBackgroundFrameL ( TFrameData aFrameDataArg ) [private]

Parameters

TFrameData aFrameDataArg

SetFlash(TBmpAnimAttributes)

void SetFlash ( TBmpAnimAttributes aFlash ) [private]

Parameters

TBmpAnimAttributes aFlash

SetFrameInterval(TBmpAnimAttributes)

void SetFrameInterval ( TBmpAnimAttributes aFrameInterval ) [private]

Parameters

TBmpAnimAttributes aFrameInterval

SetIndexFrame(SBitmapAnimIndexFrame)

TInt SetIndexFrame ( SBitmapAnimIndexFrame aIndexFrame ) [private]

Parameters

SBitmapAnimIndexFrame aIndexFrame

SetNumberOfCycles(SBitmapAnimNumberOfCycles)

void SetNumberOfCycles ( SBitmapAnimNumberOfCycles aNumberOfCycles ) [private]

Parameters

SBitmapAnimNumberOfCycles aNumberOfCycles

SetPlayMode(TBmpAnimAttributes)

void SetPlayMode ( TBmpAnimAttributes aPlayMode ) [private]

Parameters

TBmpAnimAttributes aPlayMode

SetPosition(SBitmapAnimNewPosition)

void SetPosition ( SBitmapAnimNewPosition aNewPosition ) [private]

Parameters

SBitmapAnimNewPosition aNewPosition

StartAnimationL()

void StartAnimationL ( ) [private]

StopAnimation()

void StopAnimation ( ) [private]

UpdateCurrentIndex()

void UpdateCurrentIndex ( ) [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]