CAknEcsDetector Class Reference

class CAknEcsDetector : public CBase

Central coordinating object in the emergency call system Objects of this class own the number queue and own the interface object to the stored emergency numbers.

A phone client session is also open while constructed

Inherits from

Public Member Functions
~CAknEcsDetector ()
IMPORT_C void AddChar ( TText )
TInt CallAttemptedCallback ( TAny *)
IMPORT_C void CloseEventSource ()
IMPORT_C TBool ConnectToEventSource ()
IMPORT_C TPtrC CurrentMatch ()
void HandlePhoneStatusL (const TInt )
IMPORT_C void HandleWsEventL (const TWsEvent &, CCoeControl *)
TInt IndexOfCurrentMatch ()
IMPORT_C CAknEcsDetector * NewL ()
IMPORT_C void Reset ()
IMPORT_C void SetBuffer (const TDesC &)
IMPORT_C void SetObserver ( MAknEcsObserver *)
IMPORT_C TState State ()
Protected Member Functions
CAknEcsDetector ()
TInt CancelMatch ( TAny *)
IMPORT_C void ConstructL ()
IMPORT_C TBool OfferEmergencyCall ()
IMPORT_C void ReportEvent ( TState )
IMPORT_C void SetState ( TState )
Private Member Functions
void AttemptEmergencyCall ()
void CaptureKeys ()
void DetermineState ()
void MakeServiceCallL ()
void RelinquishCapturedKeys ()
Inherited Functions
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()
Public Member Enumerations
enum TState {
ENotFullyConstructed , EEmpty , ENoMatch , EPartialMatch , ECompleteMatch , ECompleteMatchThenSendKey , ECallAttempted , EServiceNumMatch
}
Protected Member Enumerations
enum TBitFlagIndices { EEventSourceConnected  = 0, ETestMode }
Private Attributes
TInt iCapturedKey
CCoeEnv * iCoeEnv
CPhCltEmergencyCallObserver * iEmergencyCallObserver
TBitFlags16 iFlags
CIdle * iIdler
CPeriodic * iKeyTimeoutTimer
MAknEcsObserver * iObserver
CPhCltEmergencyCall * iPhCltEmergencyCall
CAknMatchingCharacterQueue * iQueue
TBool iServiceCallEnabled
TBuf < KAknEcsMaxMatchingLength > iSpare_3
TState iState

Constructor & Destructor Documentation

CAknEcsDetector()

IMPORT_C CAknEcsDetector ( ) [protected]

C++ constructor

~CAknEcsDetector()

IMPORT_C ~CAknEcsDetector ( ) [virtual]

C++ destructor

Member Functions Documentation

AddChar(TText)

IMPORT_C void AddChar ( TText aNewChar )

Add a character to the emergency call buffer. This should be fed with both numberic key presses and the Send key.

Parameters

TText aNewChar New character to emergency call buffer.

AttemptEmergencyCall()

void AttemptEmergencyCall ( ) [private]

Wraps up the code that acutally sets off the emergency call

CallAttemptedCallback(TAny *)

TInt CallAttemptedCallback ( TAny * aSelf ) [static]

This callback is called by a CIdle object to state that the call has been attempted. This is called outside the event loop in order allow self-deletion of the client object.

State is set to CallAttempted by this method.

Parameters

TAny * aSelf

CancelMatch(TAny *)

TInt CancelMatch ( TAny * aAny ) [protected, static]

Static method that can be used as a cancel callback to the detector

Parameters

TAny * aAny

CaptureKeys()

void CaptureKeys ( ) [private]

Wraps up the code to capture whatever keys are necessary when the emergency number

CloseEventSource()

IMPORT_C void CloseEventSource ( )

Closes the connection to the appui object opened by a previous call to ConnectToEventSource

ConnectToEventSource()

IMPORT_C TBool ConnectToEventSource ( )

This method attaches the Ecs Detector to the current appui and the registers itself for receiving all key presses parasitically. This method is called when there is no requirement for the ECS to keep synchronized with a visual buffer

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

2nd stage construction. All memory allocation is performed in this routine

CurrentMatch()

IMPORT_C TPtrC CurrentMatch ( ) const

Returns a pointer to the current matching number.

DetermineState()

void DetermineState ( ) [private]

Utility routine to determine the new state of the module.

HandlePhoneStatusL(const TInt)

void HandlePhoneStatusL ( const TInt aStatus ) [virtual]

It is called whenever status is retrieved (by the client).

Parameters

const TInt aStatus It is the status of the phone.

HandleWsEventL(const TWsEvent &, CCoeControl *)

IMPORT_C void HandleWsEventL ( const TWsEvent & aEvent,
CCoeControl * aDestination
) [virtual]

Handle and event coming from the AppUi. Default implementation handles all keys and updates the Status(), CurrentMatch() , and IndexOfCurrentMatch()

Parameters

const TWsEvent & aEvent
CCoeControl * aDestination

IndexOfCurrentMatch()

TInt IndexOfCurrentMatch ( ) const

Returns an index to the current character buffer where the emergency number match begins. This value is between 0 and KAknEcsMaxMatchingLength, even if there have been a large number characters input to the FIFO. Thus, it does not take account of characters that have fallen out of the FIFO.

The main use case for this is to allow clients to tell if the number was matched from the beginning of the buffer (value 0). Note that for emergency numbers of length KAknEcsMaxMatchingLength will ALWAYS return 0 if there is a complete match.

MakeServiceCallL()

void MakeServiceCallL ( ) [private]

Wraps up the code that actually initiates the service call

NewL()

IMPORT_C CAknEcsDetector * NewL ( ) [static]

Two phase constructor for Ecs detector Static method.

OfferEmergencyCall()

IMPORT_C TBool OfferEmergencyCall ( ) [protected, virtual]

Framework method that may be re-implemented in order to perform some check or put up UI before the phone call is made Implementation must not leave;

RelinquishCapturedKeys()

void RelinquishCapturedKeys ( ) [private]

Uncaptures Send key (if necessary)

ReportEvent(TState)

IMPORT_C void ReportEvent ( TState aNewState ) [protected, virtual]

Calls the observer

Parameters

TState aNewState

Reset()

IMPORT_C void Reset ( )

Reset the buffer to a just initialized state.

SetBuffer(const TDesC &)

IMPORT_C void SetBuffer ( const TDesC & aNewBuffer )

Set the entire contents of the emergency call buffer. A reset is performed first, and then the characters in the passed descriptor are added to the buffer. Emergency number is matched only if there is not other content in the string.

Parameters

const TDesC & aNewBuffer Emergency call buffer.

SetObserver(MAknEcsObserver *)

IMPORT_C void SetObserver ( MAknEcsObserver * aNewObserver )

Sets the obserever of the EcsDetector

Parameters

MAknEcsObserver * aNewObserver

SetState(TState)

IMPORT_C void SetState ( TState newState ) [protected]

Internal routine to set the state

Parameters

TState newState

State()

IMPORT_C TState State ( )

Returns the current state of the Ecs Detector

Member Enumerations Documentation

Enum TBitFlagIndices

Enumeration for the bit indices of iFlags Used for substates or state modifiers

Enumerators

EEventSourceConnected = 0
ETestMode

Enum TState

Enumeration to carry the state of the Ecs detector

Enumerators

ENotFullyConstructed
EEmpty
ENoMatch
EPartialMatch
ECompleteMatch
ECompleteMatchThenSendKey
ECallAttempted
EServiceNumMatch

Member Data Documentation

TInt iCapturedKey

TInt iCapturedKey [private]

CCoeEnv * iCoeEnv

CCoeEnv * iCoeEnv [private]

CPhCltEmergencyCallObserver * iEmergencyCallObserver

CPhCltEmergencyCallObserver * iEmergencyCallObserver [private]

Pointer to emergency call observer object

TBitFlags16 iFlags

TBitFlags16 iFlags [private]

CIdle * iIdler

CIdle * iIdler [private]

CPeriodic * iKeyTimeoutTimer

CPeriodic * iKeyTimeoutTimer [private]

MAknEcsObserver * iObserver

MAknEcsObserver * iObserver [private]

CPhCltEmergencyCall * iPhCltEmergencyCall

CPhCltEmergencyCall * iPhCltEmergencyCall [private]

Phone client interface of emergency call.

CAknMatchingCharacterQueue * iQueue

CAknMatchingCharacterQueue * iQueue [private]

TBool iServiceCallEnabled

TBool iServiceCallEnabled [private]

Boolean to check if service call is enabled during device or key lock

TBuf< KAknEcsMaxMatchingLength > iSpare_3

TBuf < KAknEcsMaxMatchingLength > iSpare_3 [private]

TState iState

TState iState [private]