CHwrRecognizer Class Reference

class CHwrRecognizer : public CBase

CHwrRecognizer class. Interface definiton for Hwr.

Inherits from

Public Member Functions
~CHwrRecognizer ()
IMPORT_C TInt AddAuxiliaryRange (const TRecognitionRange &)
IMPORT_C TInt EnableGuideline (const TBool )
IMPORT_C TInt EnableRecognitionDictionary (const TBool )
IMPORT_C void EnableWordRecognition (const TBool )
IMPORT_C TInt GetAuxCandidateNum ()
IMPORT_C void GetBottomGuideLinePos ( TInt &)
IMPORT_C TInt GetCandidateNum ()
IMPORT_C TInt GetDictVersion ( TDes &)
IMPORT_C TInt GetEngineVersion ( TDes &)
IMPORT_C TRecognitionRange GetRange ()
IMPORT_C void GetTopGuideLinePos ( TInt &)
IMPORT_C void ListAvailableLanguagesL ( RArray < TInt > &)
IMPORT_C void ListGivenAvailableLanguagesL ( TUid , RArray < TInt > &)
IMPORT_C void ListImplementationsL (const TLanguage , RArray < TUid > &)
IMPORT_C void McrAddStrokesL (const RArray < TPoint > &, RPointerArray < HBufC > &)
IMPORT_C void McrBeginSessionL ()
IMPORT_C void McrEndSessionL ( RPointerArray < HBufC > &)
IMPORT_C CHwrRecognizer * NewL ( TInt )
IMPORT_C CHwrRecognizer * NewL (const TLanguage , TUid &)
IMPORT_C MTruiEngine * QueryUdmInterfaceL ()
IMPORT_C TInt Recognize (const RArray < TPoint > &, RPointerArray < HBufC > &)
IMPORT_C TInt RecognizeWithCharSet (const RArray < TPoint > &, RPointerArray < HBufC > &, const TDesC &)
IMPORT_C void RemoveAllAuxRange ()
IMPORT_C TInt RemoveAuxiliaryRange ( TInt )
IMPORT_C TInt SetAuxCandidateNum ( TInt )
IMPORT_C TInt SetCandidateNum ( TInt )
IMPORT_C void SetFirstLetterOrder (const TLatinLetterOrder )
IMPORT_C TInt SetInputAreaSize ( TSize &)
IMPORT_C void SetNumberMode (const TAknEditorNumericKeymap )
IMPORT_C void SetPermittedSymbolSet (const TDesC &)
IMPORT_C TInt SetRange (const TRecognitionRange &)
IMPORT_C TInt SetScreenSize ( TSize &)
IMPORT_C TPoint StrokeEndMark ()
IMPORT_C TInt SymbolModelValid (const TDesC &, const RArray < TPoint > &, THwrUdmRange , TDes &)
Protected Member Functions
IMPORT_C void GetModelIndexListL ( TUdmType , RArray < TInt > &, const THwrUdmRange &)
IMPORT_C void GetSymbolModelL ( TUdmType , TInt , TPtrC &, RArray < TPoint > &, TInt &, TInt &)
IMPORT_C TBool IsSupportUdm ()
IMPORT_C void LoadUdmL ( TUdmType )
IMPORT_C void UnLoadUdmL ( TUdmType )
Private Member Functions
void AppendMatchedLanguagesL (const TDesC8 &, RArray < TInt > &)
void GetRanges (const TDesC8 &, TInt &, TInt &)
TBool Match (const TDesC8 &, TInt )
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()
Private Attributes
TUid iDtor_ID_Key
CTruiPtiEngine * iUdmEngine

Constructor & Destructor Documentation

~CHwrRecognizer()

IMPORT_C ~CHwrRecognizer ( ) [virtual]

Destructor

Member Functions Documentation

AddAuxiliaryRange(const TRecognitionRange &)

IMPORT_C TInt AddAuxiliaryRange ( const TRecognitionRange & aRange )

Appends an auxiliary range

Parameters

const TRecognitionRange & aRange The auxiliary range to be appended

AppendMatchedLanguagesL(const TDesC8 &, RArray< TInt > &)

void AppendMatchedLanguagesL ( const TDesC8 & aImplementationData,
RArray < TInt > & aResult
) [private, static]

Utitlity function, extract the languages and append them to array

Since
S60 v3.2

Parameters

const TDesC8 & aImplementationData The string to extract.
RArray < TInt > & aResult The result array that need to append.

EnableGuideline(const TBool)

IMPORT_C TInt EnableGuideline ( const TBool aFlag )

Tell the HWR engine whether guideline is on.

Parameters

const TBool aFlag ETrue to enable guideline, and EFalse to diable.

EnableRecognitionDictionary(const TBool)

IMPORT_C TInt EnableRecognitionDictionary ( const TBool aFlag )

Tell the engine whether to use dictionary when doing reconition.

Parameters

const TBool aFlag ETrue to enable recognition dictionary, and EFalse to diable.

EnableWordRecognition(const TBool)

IMPORT_C void EnableWordRecognition ( const TBool aFlag )

Enable or disable word recognition

Parameters

const TBool aFlag The word recognition flag, ETrue if enable word recognition, otherwise EFalse

GetAuxCandidateNum()

IMPORT_C TInt GetAuxCandidateNum ( ) const

Retrieve the current each secondary candidate number need to be returned each time

GetBottomGuideLinePos(TInt &)

IMPORT_C void GetBottomGuideLinePos ( TInt & aPos )

Set position of HWR bottom guideline

Parameters

TInt & aPos Position to be set

GetCandidateNum()

IMPORT_C TInt GetCandidateNum ( ) const

Retrieve the current primary candidate number need to be returned each time

GetDictVersion(TDes &)

IMPORT_C TInt GetDictVersion ( TDes & aVersion )

Retrieve an ASCII string that describes the version information of the basic recognition dictionary

Parameters

TDes & aVersion Contains recognition dictionary version string on return

GetEngineVersion(TDes &)

IMPORT_C TInt GetEngineVersion ( TDes & aVersion )

Retrieve an ASCII string that describes the version information of the current HWR engine

Parameters

TDes & aVersion Contains the engine version string on return

GetModelIndexListL(TUdmType, RArray< TInt > &, const THwrUdmRange &)

IMPORT_C void GetModelIndexListL ( TUdmType aType,
RArray < TInt > & aList,
const THwrUdmRange & aRange
) [protected]

Get the filterd models by THwrUdmRange , return the indexes.

Parameters

TUdmType aType Shall set with the value TUdmType
RArray < TInt > & aList Store the indexes that fulfil the aRange
const THwrUdmRange & aRange Sepcifiy the rules that the modles shall belong to.

GetRange()

IMPORT_C TRecognitionRange GetRange ( )

Get current recognition range of hwr engine

GetRanges(const TDesC8 &, TInt &, TInt &)

void GetRanges ( const TDesC8 & aRangeData,
TInt & aLowerValue,
TInt & aUpperValue
) [private, static]

Utitlity function, parse a string to range values

Since
S60 v3.2

Parameters

const TDesC8 & aRangeData The string to convert
TInt & aLowerValue The lower bound value.
TInt & aUpperValue The upper bound value.

GetSymbolModelL(TUdmType, TInt, TPtrC &, RArray< TPoint > &, TInt &, TInt &)

IMPORT_C void GetSymbolModelL ( TUdmType aType,
TInt aIndex,
TPtrC & aSymbolName,
RArray < TPoint > & aModel,
TInt & aHelpLine,
TInt & aBaseLine
) [protected]

Get the filterd models by THwrUdmRange , return the indexes.

Parameters

TUdmType aType Shall set with the value TUdmType
TInt aIndex The index of the model.
TPtrC & aSymbolName Sepcifiy the rules that the modles shall belong to.
RArray < TPoint > & aModel Store the strokes for the model.
TInt & aHelpLine Store the helpline.
TInt & aBaseLine Store the baseline.

GetTopGuideLinePos(TInt &)

IMPORT_C void GetTopGuideLinePos ( TInt & aPos )

Set position of HWR top guideline

Parameters

TInt & aPos Position to be set

IsSupportUdm()

IMPORT_C TBool IsSupportUdm ( ) const [protected, virtual]

Retrieve whether the derived engine support UDM feature.

ListAvailableLanguagesL(RArray< TInt > &)

IMPORT_C void ListAvailableLanguagesL ( RArray < TInt > & aResult ) [static]

Get supported language list

Parameters

RArray < TInt > & aResult Carry the supported language list on return

ListGivenAvailableLanguagesL(TUid, RArray< TInt > &)

IMPORT_C void ListGivenAvailableLanguagesL ( TUid aImpId,
RArray < TInt > & aResult
) [static]

Get supported language list of given hwr implementation instance specified by given implementation uid

Parameters

TUid aImpId The given implementation uid
RArray < TInt > & aResult Carry the supported language list on return

ListImplementationsL(const TLanguage, RArray< TUid > &)

IMPORT_C void ListImplementationsL ( const TLanguage aLanguage,
RArray < TUid > & aImpIdList
) [static]

Get implementation uid list by supplied resolution parameters

Parameters

const TLanguage aLanguage
RArray < TUid > & aImpIdList The array carry the implementation uid list

LoadUdmL(TUdmType)

IMPORT_C void LoadUdmL ( TUdmType aType ) [protected]

Load the aType models to memory.

Parameters

TUdmType aType Shall set with the value TUdmType

Match(const TDesC8 &, TInt)

TBool Match ( const TDesC8 & aImplementationData,
TInt aValue
) [private, static]

Utitlity function, indicates whether the value is included in a string.

Since
S60 v3.2

Parameters

const TDesC8 & aImplementationData The string to test.
TInt aValue The value to test.

McrAddStrokesL(const RArray< TPoint > &, RPointerArray< HBufC > &)

IMPORT_C void McrAddStrokesL ( const RArray < TPoint > & aTraceData,
RPointerArray < HBufC > & aResult
)

Get the character candidates from the HWR engine based on the input strokes by MCR

Parameters

const RArray < TPoint > & aTraceData The array of pen trace points, each stroke is ended by stroke end mark
RPointerArray < HBufC > & aResult Candidate buffer array

McrBeginSessionL()

IMPORT_C void McrBeginSessionL ( )

Tell the engine that a new MCR session has been started.

McrEndSessionL(RPointerArray< HBufC > &)

IMPORT_C void McrEndSessionL ( RPointerArray < HBufC > & aResult )

Tell the engine that a new MCR session need to be ended, return the last result.

Parameters

RPointerArray < HBufC > & aResult

NewL(TInt)

IMPORT_C CHwrRecognizer * NewL ( TInt aImpId ) [static]

Two phase constructor, create instance of implementation by implementation uid.

Parameters

TInt aImpId The given implementation uid

NewL(const TLanguage, TUid &)

IMPORT_C CHwrRecognizer * NewL ( const TLanguage aLanguage,
TUid & aHwrImplUid
) [static]

Two phase constructor, create instance of implementation by given language.

Parameters

const TLanguage aLanguage The language should be support by implementation instance
TUid & aHwrImplUid Carray the implementation uid on return

QueryUdmInterfaceL()

IMPORT_C MTruiEngine * QueryUdmInterfaceL ( )

Retrieve MTruiEngine interface pointer if the derived engine support UDM feature.

Recognize(const RArray< TPoint > &, RPointerArray< HBufC > &)

IMPORT_C TInt Recognize ( const RArray < TPoint > & aTraceData,
RPointerArray < HBufC > & aResult
)

Get the character candidates from the HWR engine based on the input strokes

Parameters

const RArray < TPoint > & aTraceData The array of pen trace points, each stroke is ended by stroke end mark
RPointerArray < HBufC > & aResult Candidate buffer array

RecognizeWithCharSet(const RArray< TPoint > &, RPointerArray< HBufC > &, const TDesC &)

IMPORT_C TInt RecognizeWithCharSet ( const RArray < TPoint > & aTraceData,
RPointerArray < HBufC > & aResult,
const TDesC & aCharSet
)

Get the character candidates from the HWR engine based on the input strokes

Parameters

const RArray < TPoint > & aTraceData The array of pen trace points, each stroke is ended by stroke end mark
RPointerArray < HBufC > & aResult Candidate buffer array
const TDesC & aCharSet The small charset that primary range candidate should come from

RemoveAllAuxRange()

IMPORT_C void RemoveAllAuxRange ( )

Remove all auxiliary recognition ranges

RemoveAuxiliaryRange(TInt)

IMPORT_C TInt RemoveAuxiliaryRange ( TInt aIndex )

Remove an specified auxiliary recognition range.

Parameters

TInt aIndex The index of auxiliary range to be deleted

SetAuxCandidateNum(TInt)

IMPORT_C TInt SetAuxCandidateNum ( TInt aNumber )

Set the number of each secondary candidates the HWR engine should return each time

Parameters

TInt aNumber The number of each secondary candidates that HWR engine should return each time

SetCandidateNum(TInt)

IMPORT_C TInt SetCandidateNum ( TInt aNumber )

Set the number of primary candidate candidates the HWR engine should return each time

Parameters

TInt aNumber The number of primary candidates that HWR engine should return each time

SetFirstLetterOrder(const TLatinLetterOrder)

IMPORT_C void SetFirstLetterOrder ( const TLatinLetterOrder aOrder )

Specify whether small case or upper case letter will be the first one in candidate list when the first two letters are the same if case is ignored

Parameters

const TLatinLetterOrder aOrder EUpperFirst if user wants upper case letter in the first, otherwise ELowerFirst

SetInputAreaSize(TSize &)

IMPORT_C TInt SetInputAreaSize ( TSize & aSize )

Tell the HWR engine about the size of the writing area used to input character

Parameters

TSize & aSize The size of writing area

SetNumberMode(const TAknEditorNumericKeymap)

IMPORT_C void SetNumberMode ( const TAknEditorNumericKeymap aNumberMode )

Set number mode

Parameters

const TAknEditorNumericKeymap aNumberMode Given number mode

SetPermittedSymbolSet(const TDesC &)

IMPORT_C void SetPermittedSymbolSet ( const TDesC & aSymbolSet )

Set permitted recognized character set

Parameters

const TDesC & aSymbolSet

SetRange(const TRecognitionRange &)

IMPORT_C TInt SetRange ( const TRecognitionRange & aRange )

Set Hwr to given recognition range

Parameters

const TRecognitionRange & aRange Given recognition range

SetScreenSize(TSize &)

IMPORT_C TInt SetScreenSize ( TSize & aSize )

Tell the HWR engine about the size of the touch screen

Parameters

TSize & aSize The size of touch screen

StrokeEndMark()

IMPORT_C TPoint StrokeEndMark ( ) const

Get the stroke end mark

SymbolModelValid(const TDesC &, const RArray< TPoint > &, THwrUdmRange, TDes &)

IMPORT_C TInt SymbolModelValid ( const TDesC & aSymbolName,
const RArray < TPoint > & aStrokes,
THwrUdmRange aScriptType,
TDes & aSimilarSymbol
) [virtual]

Check wether the new symbol model is valid.

Parameters

const TDesC & aSymbolName The name of the symbol name.
const RArray < TPoint > & aStrokes Store the strokes for the model.
THwrUdmRange aScriptType The script that the model shall belongs to .
TDes & aSimilarSymbol Store the characters recognized by aStrokes

UnLoadUdmL(TUdmType)

IMPORT_C void UnLoadUdmL ( TUdmType aType ) [protected]

Free the momory of the aType models

Parameters

TUdmType aType Shall set with the value TUdmType

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key [private]

instance identifier key

CTruiPtiEngine * iUdmEngine

CTruiPtiEngine * iUdmEngine [private]