CTactileAreaRegistry Class Reference

class CTactileAreaRegistry : public CBase

Access to area registry from server side.

This class defines the interface that is used from server side for managing area registry (e.g. handling connect and disconnect requests)

The main purpose of this class is to do hit testing of pointer events, for knowing if feedback should be triggered based on the pointer event.

This class also implements bookkeeping of created window groups and corresponding window server connection handles. This information is used for finding correct application's registry entries when a pointer event arrives (application usually has only one window group, but some pop-up controls create additional ones).

tactilearearegistry.lib
Since
S60 v5.0

Inherits from

Constructor & Destructor Documentation

CTactileAreaRegistry()

CTactileAreaRegistry ( ) [private]

~CTactileAreaRegistry()

~CTactileAreaRegistry ( ) [virtual]

Member Functions Documentation

ChunkIndexByWindowGroupId(TInt)

TInt ChunkIndexByWindowGroupId ( TInt aWgIdentifier ) const [private]

Finds the correct shared memory chunk based on window group id.

This is used for performing first phase of hit testing.

Parameters

TInt aWgIdentifier - Identifier of the window group, which chunk is searched.

ConnectionHandleByWgId(TInt)

TUint ConnectionHandleByWgId ( TInt aWgIdentifier ) const [private]

Finds window server client's connection handle based on given window group identifier.

This is used for finding correct shared memory chunk based on window group identifier.

Parameters

TInt aWgIdentifier - The window group identifier.

HandleConnectL(const TTactileFeedbackConnectData &)

IMPORT_C void HandleConnectL ( const TTactileFeedbackConnectData & aData )

Handles connection requests from client application. This has to be called for every application that connects to the click plugin.

Area registry immediately tries to connect to the chunk created by client application. This function leaves with Standard Symbian OS error codes in case connection fails.

Parameters

const TTactileFeedbackConnectData & aData - The data sent by client application.

HandleDisconnect(const TTactileFeedbackDisconnectData &)

IMPORT_C void HandleDisconnect ( const TTactileFeedbackDisconnectData & aData )

Handles disconnect request from client application. This has to be called for every application that disconnects from the click plugin.

Parameters

const TTactileFeedbackDisconnectData & aData - The data sent by client application.

HandleWindowGroupClosed(TInt)

IMPORT_C void HandleWindowGroupClosed ( TInt aIdentifier )

Clears stored information about a window group that is closed.

This function has to be called when click plugin receives a notification about closed window group.

Parameters

TInt aIdentifier - Window group identifier of the window group that was closed.

HandleWindowGroupCreated(TInt, TUint)

IMPORT_C void HandleWindowGroupCreated ( TInt aIdentifier,
TUint aConnectionHandle
)

Records information about a newly created window group.

This function has to be called when click plugin receives a notification about created window group.

Parameters

TInt aIdentifier - Identifier of the created window group.
TUint aConnectionHandle - Connection handle of the window server client, who created the window group.

HitTestChunk(RChunk &, const TPointerEvent &, TInt, TUint32)

TTouchLogicalFeedback HitTestChunk ( RChunk & aChunk,
const TPointerEvent & aPointerEvent,
TInt aWgIdentifier,
TUint32 aWindowHandle
) [private]

This function is used for hit testing one chunk.

It is assumed that the given chunk is the chunk of that application, where pointer event shall be delivered.

Parameters

RChunk & aChunk
const TPointerEvent & aPointerEvent - The pointer event.
TInt aWgIdentifier - Identifier of the window group, where pointer event hit.
TUint32 aWindowHandle - Handle number of the window, where pointer event hit.

HitTestPointerEvent(const TPointerEvent &, TInt, TUint32)

IMPORT_C TTouchLogicalFeedback HitTestPointerEvent ( const TPointerEvent & aPointerEvent,
TInt aWgIdentifier,
TUint32 aWindowHandle
)

Does hit testing of given pointer event against area registry content.

Hit testing is done in three phases:

1. First this function uses window group identifier for finding the application, which shall receive the pointer event (registry contents has to be grouped by applicaitons because window identifiers are only unique inside one application)

2. Window handle is used for finding those registry entries, which are registered to the same window where pointer event hit now (coordinates are window -relative).

3. Window's registry entries are hit tested one by one against the given pointer event, and in case a match is found, then corresponding registry entries feedback type is returned.

Parameters

const TPointerEvent & aPointerEvent - The pointer event.
TInt aWgIdentifier - Identifier of the window group, where pointer event hit.
TUint32 aWindowHandle - Handle number of the window, where pointer event hit.

HitTestRegistryEntry(const TPointerEvent &, const TFeedbackChunkAreaEntry &, TInt, TUint32, TTouchLogicalFeedback &)

TBool HitTestRegistryEntry ( const TPointerEvent & aPointerEvent,
const TFeedbackChunkAreaEntry & aEntry,
TInt aWgIdentifier,
TUint32 aWindowHandle,
TTouchLogicalFeedback & aFeedback
) [private]

This function checks whether given pointer event and area registry entry match, and sets feedback type accordingly in case they match.

It is assumed that pointer event shall hit that window, where given area is registered (as coordinates are window-relative).

Notice that feedback is actually returned in reference parameter aFeedback, and the main return value of the function tells whether hit testing should be continued on next possible area or not. This is because feedback can be "None" even if pointer event hit the feedback area (because "None" is a valid type for feedback areas)

Parameters

const TPointerEvent & aPointerEvent - The pointer event.
const TFeedbackChunkAreaEntry & aEntry - Area registry entry, representing feedback area in same window where pointer event hit.
TInt aWgIdentifier - Identifier of the window group, where pointer event hit.
TUint32 aWindowHandle - Handle number of the window, where pointer event hit.
TTouchLogicalFeedback & aFeedback

NewL()

IMPORT_C CTactileAreaRegistry * NewL ( ) [static]

Member Data Documentation

RArray< TTactileAreaChunk > iChunkArray

RArray < TTactileAreaChunk > iChunkArray [private]

Array of chunk handles and identifying window group identifiers. Each entry in the array represents one application and its registered feedback areas.

TTactilePenDownEvent iLastPenDown

TTactilePenDownEvent iLastPenDown [private]

Information about last received pen down event. This can be used for determining whether pen up event should produde feedback or not.

RSemaphore iTactileSemaphore

RSemaphore iTactileSemaphore [private]

Handle to the global semaphore, which is used for mutual exclusion when accessing shared memory chunks.

RArray< TTactileWgroupItem > iWgArray

RArray < TTactileWgroupItem > iWgArray [private]

Here we store the information about created window groups. For each group we also store the connection handle, so that we can know into which application newly created window groups belong.