Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <W32ADLL.H>

Class CAnim

class CAnim : public CBase, public MEventHandler;

Description

Server side animated object base interface.

Animations implement this interface, which is called by the window server to pass commands from clients, perform a step in the animation, or to pass window server events (if required) so that the animation can handle them before the application.

The functions are all pure virtual, and must be implemented in the derived class to provide server side behaviour. The functions will be called by the window server with optional arguments passed in from the client side animation class RAnim.

You should derive from CWindowAnim, CFreeTimerWindowAnim or CSpriteAnim, depending on whether the animation is to draw to a sprite or a window, rather than directly from this class.

The derived class is constructed in the DLL factory class CAnimDll::CreateInstanceL(TInt) function.

The operation to perform an animation step is called by the window server on a timer. The timing properties are set through an MAnimGeneralFunctions member, which also provides other utility functions.

Derivation

Members

Defined in CAnim:

Inherited from CBase:

Inherited from MEventHandler:


Member functions


CommandReplyL(TInt,TAny *)

virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs)=0;

Description

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.

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(TInt).

Return value

TInt

Value passed back to client side function when this function completes. Typically this would be KErrNone or another of the system-wide error codes. However any value may be returned to the client side.

See also:


Command(TInt,TAny *)

virtual void Command(TInt aOpcode, TAny *aArgs)=0;

Description

Implements client-side initiated commands.

The window server calls this function in response to application calls to the client side command function RAnim::Command(TInt,const TPtrC8 &). 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.

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(TInt,const TPtrC8 &).

See also:


Animate(TDateTime *)

virtual void Animate(TDateTime *aDateTime)=0;

Description

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 CAnim::Animate(TDateTime *), 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.


HandleNotification(const TWsEvent &)

inline virtual void HandleNotification(const TWsEvent &);

Description

Parameters

const TWsEvent &


Reserved1()const

private: inline virtual void Reserved1() const;

Description


Reserved2()const

private: inline virtual void Reserved2() const;

Description


Reserved3()const

private: inline virtual void Reserved3() const;

Description

[Top]


Member data


iFunctions

protected: MAnimGeneralFunctions * iFunctions;

Description

Pointer to a class containing functions implemented by the window server.

These are available to any CAnim derived class.

Note that this value is automatically set for you by the animation framework. You do not need to assign a value to this pointer.