MAnimGeneralFunctions Class Reference

#include <w32adll.h>

class MAnimGeneralFunctions
Public Member Enumerations
enumanonymous { ENumberOfExtendedInterfaces, EWindowExtensionInterface, EEventExtentionInterface, EInterfaceCount }
enumTAnimSync { ESyncNone, ESyncFlash, ESyncSecond, ESyncMinute, ESyncDay }
Public Member Functions
pure virtual voidAnimate(TDateTime *)
pure virtual const RThread &Client()
pure virtual voidCloseFont(CFbsFont *)
pure virtual CFbsBitmap *DuplicateBitmapL(TInt)
pure virtual CFbsFont *DuplicateFontL(TInt)
MAnimGeneralFunctionsEventExtension *EventExtension()
pure virtual TAny *ExtendedInterface(TInt)
pure virtual TBool FlashStateOn()
pure virtual voidGetRawEvents(TBool)
pure virtual const RMessagePtr2 *Message()
TInt NumberOfExtendedInterfaces()
pure virtual voidPanic()
pure virtual voidPostKeyEvent(const TKeyEvent &)
pure virtual voidPostRawEvent(const TRawEvent &)
pure virtual TInt RegisterForNotifications(TUint32)
pure virtual voidReplyBuf(const TDesC8 &)
pure virtual voidReplyBuf(const TDesC16 &)
pure virtual const CFbsScreenDevice *ScreenDevice()
pure virtual voidSetInterval(TInt)
pure virtual voidSetNextInterval(TInt)
pure virtual voidSetSync(TAnimSync)
pure virtual TAnimSync Sync()
pure virtual TDateTime SystemTime()
MAnimGeneralFunctionsWindowExtension *WindowExtension()

Detailed Description

General animation utility functions interface.

The interface provides functions to set the animation timing, event functions, and other general functions.

You do not have to create an object of this type. The class is implemented by the window server and provides utility functions to all CAnim-derived classes via the CAnim::iFunctions pointer.

It is not intended for user derivation.

Member Enumeration Documentation

Enum anonymous

Enum TAnimSync

Animation synchronisation flags.

The animation can be synchronised to any of these values; the Animate() call will take place at the start of the new unit (day, hour, etc...).

EnumeratorValueDescription
ESyncNone

Not synchronised. Animate() is called after some number of flash cycles - set by SetSync().

ESyncFlash

Animate() every flash tick. This occurs twice a second, on the second and after 7/12ths of a second, e.g. the function is called in a flash-on (7/12 seconds) - flash-off (5/12 seconds) cycle.

ESyncSecond

Animate() called as soon after every second as system activity allows.

ESyncMinute

Animate() called as soon after every minute as system activity allows.

ESyncDay

Animate() called as soon after midnight every dayas system activity allows.

Member Function Documentation

Animate ( TDateTime * )

voidAnimate(TDateTime *aDateTime)[pure virtual]

Calls the DLL's Animate() function then deactivates the graphics context.

This allows users to do drawing from their own active object.

Note:

If the user calls the CAnim-derived classes' Animate() function directly, or otherwise does drawing from their own active object, then this will not deactivate the graphics context. This causes the window server to panic the client.

Alternatively, use CFreeTimerWindowAnim, which allows you to deactivate the graphics context yourself.

Parameters
aDateTimeThe parameter passed into the animation DLL's Animate() function.

Client ( )

const RThread &Client()[pure virtual]

Gets a reference to the calling client's thread.

Return Value
A reference to the calling client's thread.

CloseFont ( CFbsFont * )

voidCloseFont(CFbsFont *)[pure virtual]

Closes a duplicate font.

See also: DuplicateFontL()

DuplicateBitmapL ( TInt )

CFbsBitmap *DuplicateBitmapL(TIntaHandle)[pure virtual]

Creates and duplicates a bitmap from a handle.

This function might be used to duplicate client side bitmaps on the server side.

Parameters
aHandleA handle to the bitmap to be duplicated.
Return Value
A pointer to the duplicate bitmap.

DuplicateFontL ( TInt )

CFbsFont *DuplicateFontL(TIntaHandle)[pure virtual]

Creates and duplicates a font from a handle.

This function might be used to duplicate client side fonts on the server side.

Parameters
aHandleA handle to the font to be duplicated.
Return Value
A pointer to the duplicate font.

EventExtension ( )

MAnimGeneralFunctionsEventExtension *EventExtension()[inline]

Gets access to EventExtension utility functions.

Return Value
A pointer to a class containing functions for working with Event.

ExtendedInterface ( TInt )

TAny *ExtendedInterface(TIntaInterface)[pure virtual]

Returns an extension interface, maybe extended further in the future.

Return Value
A pointer to the extension interface. When aInterface=0 (ENumberOfExtendedInterfaces), the number of interfaces is returned (currently 2). When aInterface=1 (EWindowExtensionInterface), a pointer to the Window Extension interface is returned. When aInterface=2 (EEventExtentionInterface), a pointer to the Event Extension interface is returned.

FlashStateOn ( )

TBool FlashStateOn()const [pure virtual]

Tests the flash cyclestate.

The flash cycle has 2 states: on (7/12 second) or off (5/12 second).

Return Value
ETrue if in the on part of the flash cycle, otherwise EFalse.

GetRawEvents ( TBool )

voidGetRawEvents(TBoolaGetEvents)const [pure virtual]

Switches animation raw event handling on and off.

If raw event handling is switched on, then raw events, e.g. pointer, key, or power events are all offered to the animation event handling code's MEventHandler::OfferRawEvent().

If Animation works in a window for which advanced pointers have been enabled, then after switching on raw event handling it will receive pointer events from all detected pointers. Otherwise it will receive events only from one emulated pointer.

See also: RWindowBase::EnableAdvancedPointers()

Parameters
aGetEventsIf ETrue, raw events are passed to the animation event handling code. If EFalse, events are not passed to the animation.

Message ( )

const RMessagePtr2 *Message()[pure virtual]

Get the address of an object which can retrieve information from and send information to the client-side.

See also: RMessagePtr2

Return Value
A pointer to RMessagePtr2. Complete must be called on the returned object (or a copy of it) if and only if Message is called from an override of CAnim's CommandReplyL which has been caused by a client-side RAnim::AsyncCommandReply call. If Message is called outside an override of CAnim's CommandReplyL or outside an override of CWindowAnim's ConstructL or CSpriteAnim's ConstructL, the it returns NULL.

NumberOfExtendedInterfaces ( )

TInt NumberOfExtendedInterfaces()[inline]

Panic ( )

voidPanic()const [pure virtual]

Panics the client.

This will result in the client thread being destroyed.

PostKeyEvent ( const TKeyEvent & )

voidPostKeyEvent(const TKeyEvent &aRawEvent)const [pure virtual]

Posts a key event.

The function is similar to PostRawEvent() but should be used for posting key events.

Parameters
aRawEventThe key event.

PostRawEvent ( const TRawEvent & )

voidPostRawEvent(const TRawEvent &aRawEvent)const [pure virtual]

Posts a raw event, just as if it had come from the kernel.

If aRawEvent has pointer-related type (move, switch on, down, up or out of range), then its Z coordinate and iPointerNumber fields will be validated and may be overwritten by WSERV in order to guarantee correct behaviour depending on: 1. Pointer Pressure and Proximity support on current platform. 2. Multiple pointers support on current platform. 3. Animation's awareness of these fields. If Animation works in a window for which advanced pointers have been enabled, it is assumed that it has initialized these fields. Otherwise WSERV will assume that these fields have not been provided and may overwrite them with most appropriate values. For more information about event validation, please refer to System Documentation.

See also: RWindowBase::EnableAdvancedPointers()

Parameters
aRawEventThe raw event

RegisterForNotifications ( TUint32 )

TInt RegisterForNotifications(TUint32aNotifications)[pure virtual]

Register to receive notifications.

Parameters
aNotificationsA bitset of TAnimNotifications values indicating which notifications are required
Return Value
One of the system wide error codes

ReplyBuf ( const TDesC8 & )

voidReplyBuf(const TDesC8 &aDes)[pure virtual]

Send a reply to the client process in response to a request from the client.

See also: RAnim::CommandReply()

Parameters
aDesThe data to be sent back to the client

ReplyBuf ( const TDesC16 & )

voidReplyBuf(const TDesC16 &aDes)[pure virtual]

Send a reply to the client process in response to a request from the client.

See also: RAnim::CommandReply()

Parameters
aDesThe data to be sent back to the client

ScreenDevice ( )

const CFbsScreenDevice *ScreenDevice()[pure virtual]

Gets a pointer to the screen device.

For example, this might be used to gain access to twips to pixel conversion functions.

Return Value
A pointer to the screen device.

SetInterval ( TInt )

voidSetInterval(TIntaInterval)[pure virtual]

Sets the repeat interval.

If the synchronisation mode is TAnimSync::ESyncNone, then the Animate() function is called at intervals defined by some number of flash ticks. There are two flash ticks a second, with a 7/12 second - 5/12 second cycle. If the function is called when the synchronisation mode is not TAnimSync::ESyncNone, then the window server panics the client.

If the new interval is greater than the current countdown, then the call does not affect the current countdown. For example, if the countdown has 10 flash ticks remaining, and the interval is set to 20, the new interval does not apply until the current countdown is complete.

However if the new interval is less the current countdown, then the new interval applies immediately i.e. the countdown is reset to the interval value.

If the interval is set to zero the countdown stops, and the Animate() function is no longer called.

Parameters
aIntervalThe number of flash ticks between calls to the Animate() function.

SetNextInterval ( TInt )

voidSetNextInterval(TIntaInterval)[pure virtual]

Sets the next interval.

This function immediately resets the current countdown to the specified number of flash ticks, irrespective of its current value. After the countdown expires, the interval returns to its usual rate. Note that this may be zero (i.e. not at all).

To call this function, the synchronisation mode must be TAnimSync::ESyncNone, otherwise the window server panics the client.

Note: there are two flash ticks a second, with a 7/12 second - 5/12 second cycle.

See also: SetInterval()

Parameters
aIntervalThe interval to the next Animate(). If the value is less than 1, it automatically gets set to 1.

SetSync ( TAnimSync )

voidSetSync(TAnimSyncaSyncMode)[pure virtual]

Sets the synchronisation mode.

This determines the time intervals between calls to the Animate() function.

Parameters
aSyncModeThe synchronisation mode.

Sync ( )

TAnimSync Sync()const [pure virtual]

Gets the current synchronisation mode.

Return Value
The current sync mode.

SystemTime ( )

TDateTime SystemTime()const [pure virtual]

Gets the system time as it was when Animate() was last called.

Return Value
The system time when Animate() was last called.

WindowExtension ( )

MAnimGeneralFunctionsWindowExtension *WindowExtension()[inline]

Gets access to Window Extension utility functions.

Return Value
A pointer to a class containing functions for working with Window.