CHwrRecognizer Class Reference

class CHwrRecognizer : public CBase

CHwrRecognizer class. Interface definiton for Hwr.

Inherits from

Public Member Functions
~CHwrRecognizer()
IMPORT_C TIntAddAuxiliaryRange(const TRecognitionRange &)
IMPORT_C TIntEnableGuideline(const TBool)
IMPORT_C TIntEnableRecognitionDictionary(const TBool)
IMPORT_C voidEnableWordRecognition(const TBool)
IMPORT_C TIntGetAuxCandidateNum()
IMPORT_C voidGetBottomGuideLinePos(TInt &)
IMPORT_C TIntGetCandidateNum()
IMPORT_C TIntGetDictVersion(TDes &)
IMPORT_C TIntGetEngineVersion(TDes &)
IMPORT_C TRecognitionRangeGetRange()
IMPORT_C voidGetTopGuideLinePos(TInt &)
IMPORT_C voidListAvailableLanguagesL(RArray< TInt > &)
IMPORT_C voidListGivenAvailableLanguagesL(TUid, RArray< TInt > &)
IMPORT_C voidListImplementationsL(const TLanguage, RArray< TUid > &)
IMPORT_C voidMcrAddStrokesL(const RArray< TPoint > &, RPointerArray< HBufC > &)
IMPORT_C voidMcrBeginSessionL()
IMPORT_C voidMcrEndSessionL(RPointerArray< HBufC > &)
IMPORT_C CHwrRecognizer *NewL(TInt)
IMPORT_C CHwrRecognizer *NewL(const TLanguage, TUid &)
IMPORT_C MTruiEngine *QueryUdmInterfaceL()
IMPORT_C TIntRecognize(const RArray< TPoint > &, RPointerArray< HBufC > &)
IMPORT_C TIntRecognizeWithCharSet(const RArray< TPoint > &, RPointerArray< HBufC > &, const TDesC &)
IMPORT_C voidRemoveAllAuxRange()
IMPORT_C TIntRemoveAuxiliaryRange(TInt)
IMPORT_C TIntSetAuxCandidateNum(TInt)
IMPORT_C TIntSetCandidateNum(TInt)
IMPORT_C voidSetFirstLetterOrder(const TLatinLetterOrder)
IMPORT_C TIntSetInputAreaSize(TSize &)
IMPORT_C voidSetNumberMode(const TAknEditorNumericKeymap)
IMPORT_C voidSetPermittedSymbolSet(const TDesC &)
IMPORT_C TIntSetRange(const TRecognitionRange &)
IMPORT_C TIntSetScreenSize(TSize &)
IMPORT_C TPointStrokeEndMark()
IMPORT_C TIntSymbolModelValid(const TDesC &, const RArray< TPoint > &, THwrUdmRange, TDes &)
Protected Member Functions
IMPORT_C voidGetModelIndexListL(TUdmType, RArray< TInt > &, const THwrUdmRange &)
IMPORT_C voidGetSymbolModelL(TUdmType, TInt, TPtrC &, RArray< TPoint > &, TInt &, TInt &)
IMPORT_C TBoolIsSupportUdm()
IMPORT_C voidLoadUdmL(TUdmType)
IMPORT_C voidUnLoadUdmL(TUdmType)
Private Member Functions
voidAppendMatchedLanguagesL(const TDesC8 &, RArray< TInt > &)
voidGetRanges(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 TIntAddAuxiliaryRange(const TRecognitionRange &aRange)

Appends an auxiliary range

Parameters

const TRecognitionRange & aRangeThe auxiliary range to be appended

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

voidAppendMatchedLanguagesL(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 & aImplementationDataThe string to extract.
RArray< TInt > & aResultThe result array that need to append.

EnableGuideline(const TBool)

IMPORT_C TIntEnableGuideline(const TBoolaFlag)

Tell the HWR engine whether guideline is on.

Parameters

const TBool aFlagETrue to enable guideline, and EFalse to diable.

EnableRecognitionDictionary(const TBool)

IMPORT_C TIntEnableRecognitionDictionary(const TBoolaFlag)

Tell the engine whether to use dictionary when doing reconition.

Parameters

const TBool aFlagETrue to enable recognition dictionary, and EFalse to diable.

EnableWordRecognition(const TBool)

IMPORT_C voidEnableWordRecognition(const TBoolaFlag)

Enable or disable word recognition

Parameters

const TBool aFlagThe word recognition flag, ETrue if enable word recognition, otherwise EFalse

GetAuxCandidateNum()

IMPORT_C TIntGetAuxCandidateNum()const

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

GetBottomGuideLinePos(TInt &)

IMPORT_C voidGetBottomGuideLinePos(TInt &aPos)

Set position of HWR bottom guideline

Parameters

TInt & aPosPosition to be set

GetCandidateNum()

IMPORT_C TIntGetCandidateNum()const

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

GetDictVersion(TDes &)

IMPORT_C TIntGetDictVersion(TDes &aVersion)

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

Parameters

TDes & aVersionContains recognition dictionary version string on return

GetEngineVersion(TDes &)

IMPORT_C TIntGetEngineVersion(TDes &aVersion)

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

Parameters

TDes & aVersionContains the engine version string on return

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

IMPORT_C voidGetModelIndexListL(TUdmTypeaType,
RArray< TInt > &aList,
const THwrUdmRange &aRange
)[protected]

Get the filterd models by THwrUdmRange, return the indexes.

Parameters

TUdmType aTypeShall set with the value TUdmType
RArray< TInt > & aListStore the indexes that fulfil the aRange
const THwrUdmRange & aRangeSepcifiy the rules that the modles shall belong to.

GetRange()

IMPORT_C TRecognitionRangeGetRange()

Get current recognition range of hwr engine

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

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

Utitlity function, parse a string to range values

Since
S60 v3.2

Parameters

const TDesC8 & aRangeDataThe string to convert
TInt & aLowerValueThe lower bound value.
TInt & aUpperValueThe upper bound value.

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

IMPORT_C voidGetSymbolModelL(TUdmTypeaType,
TIntaIndex,
TPtrC &aSymbolName,
RArray< TPoint > &aModel,
TInt &aHelpLine,
TInt &aBaseLine
)[protected]

Get the filterd models by THwrUdmRange, return the indexes.

Parameters

TUdmType aTypeShall set with the value TUdmType
TInt aIndexThe index of the model.
TPtrC & aSymbolNameSepcifiy the rules that the modles shall belong to.
RArray< TPoint > & aModelStore the strokes for the model.
TInt & aHelpLineStore the helpline.
TInt & aBaseLineStore the baseline.

GetTopGuideLinePos(TInt &)

IMPORT_C voidGetTopGuideLinePos(TInt &aPos)

Set position of HWR top guideline

Parameters

TInt & aPosPosition to be set

IsSupportUdm()

IMPORT_C TBoolIsSupportUdm()const [protected, virtual]

Retrieve whether the derived engine support UDM feature.

ListAvailableLanguagesL(RArray< TInt > &)

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

Get supported language list

Parameters

RArray< TInt > & aResultCarry the supported language list on return

ListGivenAvailableLanguagesL(TUid, RArray< TInt > &)

IMPORT_C voidListGivenAvailableLanguagesL(TUidaImpId,
RArray< TInt > &aResult
)[static]

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

Parameters

TUid aImpIdThe given implementation uid
RArray< TInt > & aResultCarry the supported language list on return

ListImplementationsL(const TLanguage, RArray< TUid > &)

IMPORT_C voidListImplementationsL(const TLanguageaLanguage,
RArray< TUid > &aImpIdList
)[static]

Get implementation uid list by supplied resolution parameters

Parameters

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

LoadUdmL(TUdmType)

IMPORT_C voidLoadUdmL(TUdmTypeaType)[protected]

Load the aType models to memory.

Parameters

TUdmType aTypeShall set with the value TUdmType

Match(const TDesC8 &, TInt)

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

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

Since
S60 v3.2

Parameters

const TDesC8 & aImplementationDataThe string to test.
TInt aValueThe value to test.

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

IMPORT_C voidMcrAddStrokesL(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 > & aTraceDataThe array of pen trace points, each stroke is ended by stroke end mark
RPointerArray< HBufC > & aResultCandidate buffer array

McrBeginSessionL()

IMPORT_C voidMcrBeginSessionL()

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

McrEndSessionL(RPointerArray< HBufC > &)

IMPORT_C voidMcrEndSessionL(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(TIntaImpId)[static]

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

Parameters

TInt aImpIdThe given implementation uid

NewL(const TLanguage, TUid &)

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

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

Parameters

const TLanguage aLanguageThe language should be support by implementation instance
TUid & aHwrImplUidCarray 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 TIntRecognize(const RArray< TPoint > &aTraceData,
RPointerArray< HBufC > &aResult
)

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

Parameters

const RArray< TPoint > & aTraceDataThe array of pen trace points, each stroke is ended by stroke end mark
RPointerArray< HBufC > & aResultCandidate buffer array

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

IMPORT_C TIntRecognizeWithCharSet(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 > & aTraceDataThe array of pen trace points, each stroke is ended by stroke end mark
RPointerArray< HBufC > & aResultCandidate buffer array
const TDesC & aCharSetThe small charset that primary range candidate should come from

RemoveAllAuxRange()

IMPORT_C voidRemoveAllAuxRange()

Remove all auxiliary recognition ranges

RemoveAuxiliaryRange(TInt)

IMPORT_C TIntRemoveAuxiliaryRange(TIntaIndex)

Remove an specified auxiliary recognition range.

Parameters

TInt aIndexThe index of auxiliary range to be deleted

SetAuxCandidateNum(TInt)

IMPORT_C TIntSetAuxCandidateNum(TIntaNumber)

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

Parameters

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

SetCandidateNum(TInt)

IMPORT_C TIntSetCandidateNum(TIntaNumber)

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

Parameters

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

SetFirstLetterOrder(const TLatinLetterOrder)

IMPORT_C voidSetFirstLetterOrder(const TLatinLetterOrderaOrder)

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 aOrderEUpperFirst if user wants upper case letter in the first, otherwise ELowerFirst

SetInputAreaSize(TSize &)

IMPORT_C TIntSetInputAreaSize(TSize &aSize)

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

Parameters

TSize & aSizeThe size of writing area

SetNumberMode(const TAknEditorNumericKeymap)

IMPORT_C voidSetNumberMode(const TAknEditorNumericKeymapaNumberMode)

Set number mode

Parameters

const TAknEditorNumericKeymap aNumberModeGiven number mode

SetPermittedSymbolSet(const TDesC &)

IMPORT_C voidSetPermittedSymbolSet(const TDesC &aSymbolSet)

Set permitted recognized character set

Parameters

const TDesC & aSymbolSet

SetRange(const TRecognitionRange &)

IMPORT_C TIntSetRange(const TRecognitionRange &aRange)

Set Hwr to given recognition range

Parameters

const TRecognitionRange & aRangeGiven recognition range

SetScreenSize(TSize &)

IMPORT_C TIntSetScreenSize(TSize &aSize)

Tell the HWR engine about the size of the touch screen

Parameters

TSize & aSizeThe size of touch screen

StrokeEndMark()

IMPORT_C TPointStrokeEndMark()const

Get the stroke end mark

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

IMPORT_C TIntSymbolModelValid(const TDesC &aSymbolName,
const RArray< TPoint > &aStrokes,
THwrUdmRangeaScriptType,
TDes &aSimilarSymbol
)[virtual]

Check wether the new symbol model is valid.

Parameters

const TDesC & aSymbolNameThe name of the symbol name.
const RArray< TPoint > & aStrokesStore the strokes for the model.
THwrUdmRange aScriptTypeThe script that the model shall belongs to .
TDes & aSimilarSymbolStore the characters recognized by aStrokes

UnLoadUdmL(TUdmType)

IMPORT_C voidUnLoadUdmL(TUdmTypeaType)[protected]

Free the momory of the aType models

Parameters

TUdmType aTypeShall 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]