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 voidAddChar(TText)
TInt CallAttemptedCallback(TAny *)
IMPORT_C voidCloseEventSource()
IMPORT_C TBoolConnectToEventSource()
IMPORT_C TPtrCCurrentMatch()
voidHandlePhoneStatusL(const TInt)
IMPORT_C voidHandleWsEventL(const TWsEvent &, CCoeControl *)
TInt IndexOfCurrentMatch()
IMPORT_C CAknEcsDetector *NewL()
IMPORT_C voidReset()
IMPORT_C voidSetBuffer(const TDesC &)
IMPORT_C voidSetObserver(MAknEcsObserver *)
IMPORT_C TStateState()
Protected Member Functions
CAknEcsDetector()
TInt CancelMatch(TAny *)
IMPORT_C voidConstructL()
IMPORT_C TBoolOfferEmergencyCall()
IMPORT_C voidReportEvent(TState)
IMPORT_C voidSetState(TState)
Private Member Functions
voidAttemptEmergencyCall()
voidCaptureKeys()
voidDetermineState()
voidMakeServiceCallL()
voidRelinquishCapturedKeys()
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
enumTState {
ENotFullyConstructed, EEmpty, ENoMatch, EPartialMatch, ECompleteMatch, ECompleteMatchThenSendKey, ECallAttempted, EServiceNumMatch
}
Protected Member Enumerations
enumTBitFlagIndices { 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_CCAknEcsDetector()[protected]

C++ constructor

~CAknEcsDetector()

IMPORT_C~CAknEcsDetector()[virtual]

C++ destructor

Member Functions Documentation

AddChar(TText)

IMPORT_C voidAddChar(TTextaNewChar)

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

Parameters

TText aNewCharNew character to emergency call buffer.

AttemptEmergencyCall()

voidAttemptEmergencyCall()[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()

voidCaptureKeys()[private]

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

CloseEventSource()

IMPORT_C voidCloseEventSource()

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

ConnectToEventSource()

IMPORT_C TBoolConnectToEventSource()

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 voidConstructL()[protected]

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

CurrentMatch()

IMPORT_C TPtrCCurrentMatch()const

Returns a pointer to the current matching number.

DetermineState()

voidDetermineState()[private]

Utility routine to determine the new state of the module.

HandlePhoneStatusL(const TInt)

voidHandlePhoneStatusL(const TIntaStatus)[virtual]

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

Parameters

const TInt aStatusIt is the status of the phone.

HandleWsEventL(const TWsEvent &, CCoeControl *)

IMPORT_C voidHandleWsEventL(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()

voidMakeServiceCallL()[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 TBoolOfferEmergencyCall()[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()

voidRelinquishCapturedKeys()[private]

Uncaptures Send key (if necessary)

ReportEvent(TState)

IMPORT_C voidReportEvent(TStateaNewState)[protected, virtual]

Calls the observer

Parameters

TState aNewState

Reset()

IMPORT_C voidReset()

Reset the buffer to a just initialized state.

SetBuffer(const TDesC &)

IMPORT_C voidSetBuffer(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 & aNewBufferEmergency call buffer.

SetObserver(MAknEcsObserver *)

IMPORT_C voidSetObserver(MAknEcsObserver *aNewObserver)

Sets the obserever of the EcsDetector

Parameters

MAknEcsObserver * aNewObserver

SetState(TState)

IMPORT_C voidSetState(TStatenewState)[protected]

Internal routine to set the state

Parameters

TState newState

State()

IMPORT_C TStateState()

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]