MPtiCore Class Reference

class MPtiCore

This is abstract base class of all PtiEngine core objects. A PtiEngine core object implements set of input modes and input related services for a set of languages. This class defines core side PtiEngine API.

Public Member Functions
TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry &, CPtiUserDictionary *)
voidAppendKeyPress(TPtiKey)
TInt AttachUserDictionary(CPtiUserDictionary *)
TInt CancelTimerActivity()
voidClearBuffer()
TInt CloseLanguageL()
TInt CommitCurrentWord()
MPtiEngineCompositionDataInterface *CompositionData()
TInt Convert(TPtiCharConversion, TAny *, TInt, TAny *)
CPtiUserDictionary *CreateEmptyUserDictionaryL(TInt)
voidDeleteKeyPress()
TBool DetachUserDictionary(CPtiUserDictionary *)
voidDropLanguages(CArrayPtrFlat< CPtiCoreLanguage > *)
TInt GetCandidateListL(CDesCArray &)
TPtrC GetCandidatePage()
HBufC *GetCandidatesByInputString(const TDesC &, RPointerArray< HBufC > &, const TBool)
MPtiCoreInfo *GetCoreInfo()
TPtrC GetCurrentWord()
TInt GetFirstCandidate(TDes &)
TInt GetNextCandidate(TDes &)
TInt GetNextWordCandidateListL(CDesCArray &)
TPtrC GetPhoneticSpelling(TInt)
TInt GetPreviousCandidate(TDes &)
TInt GetSpelling(TUint16, TDes &, TPtiSpelling)
TInt GetUserDictionaryEntry(TInt, MPtiUserDictionaryEntry &, CPtiUserDictionary *)
TInt HandleCommandL(TPtiEngineCommand, TAny *)
voidInitializeL(CPtiEngine *, TDes *, CArrayPtrFlat< CPtiCoreLanguage > *, TBool)
TBool IsToneMarkValidForSpelling()
TBool MoreCandidatePages()
TBool NextCandidatePage()
TInt NumberOfCandidates()
TInt NumberOfEntriesInUserDictionary(CPtiUserDictionary *)
TInt OpenLanguageL(CPtiCoreLanguage *)
TInt PhoneticSpellingCount()
TBool PreviousCandidatePage()
TPtrC ReadingTextL()
TInt RemoveUserDictionaryEntry(MPtiUserDictionaryEntry &, CPtiUserDictionary *)
TBool SelectPhoneticSpelling(TInt)
TInt SelectedPhoneticSpelling()
voidSetCandidatePageLength(TInt)
TInt SetCurrentInputSequence(TPtrC8)
TInt SetExternalKeyMapL(TPtiEngineInputMode, TPtiKey, TDesC &, TPtiTextCase)
TBool SetPredictiveChineseChar(const TDesC &)
TInt SetReordering(TBool)
TBool SetToneMark(TInt)
TBool ToneMark(TText &)

Member Functions Documentation

AddUserDictionaryEntry(MPtiUserDictionaryEntry &, CPtiUserDictionary *)

TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry &aEntry,
CPtiUserDictionary *aDict
)[pure virtual]

Parameters

MPtiUserDictionaryEntry & aEntry
CPtiUserDictionary * aDict

AppendKeyPress(TPtiKey)

voidAppendKeyPress(TPtiKeyaKey)[pure virtual]

This is the single most important core API method, most of the text input functionality will be utilize this method. Call to this method indicates core object that a key was pressed and it should act accordingly and fill the output buffer.

Since
2.6

Parameters

TPtiKey aKeyEnum value for pressed key.

AttachUserDictionary(CPtiUserDictionary *)

TInt AttachUserDictionary(CPtiUserDictionary *aDict)[pure virtual]

Parameters

CPtiUserDictionary * aDict

CancelTimerActivity()

TInt CancelTimerActivity()[pure virtual]

Cancels all on-going core obejct timner activity.

Since
2.6

ClearBuffer()

voidClearBuffer()[pure virtual]

Call to this method notifys core object that input buffer was cleared.

Since
2.6

CloseLanguageL()

TInt CloseLanguageL()[pure virtual]

Closes currently activate language and frees resources associated to it.

Since
2.6

CommitCurrentWord()

TInt CommitCurrentWord()[pure virtual]

Commits current word. Commiting means that user has added current word as part of text. Frequency information and other related attributes can then be updated.

Since
2.6

CompositionData()

MPtiEngineCompositionDataInterface *CompositionData()[pure virtual]

Convert(TPtiCharConversion, TAny *, TInt, TAny *)

TInt Convert(TPtiCharConversionaType,
TAny *aInput,
TIntaInputLength,
TAny *aOutput
)[pure virtual]

Converts given string from one character set to another. Possible conversion types are defined in PtiDefs.h

Since
2.6

Parameters

TPtiCharConversion aTypeConversion type.
TAny * aInputPointer to input string to be converted.
TInt aInputLengthLength of input buffer.
TAny * aOutputpointer to output buffer.

CreateEmptyUserDictionaryL(TInt)

CPtiUserDictionary *CreateEmptyUserDictionaryL(TIntaMaxSize)[pure virtual]

Parameters

TInt aMaxSize

DeleteKeyPress()

voidDeleteKeyPress()[pure virtual]

Indicates core object that it should perform 'delete key press'-operation.

Since
2.6

DetachUserDictionary(CPtiUserDictionary *)

TBool DetachUserDictionary(CPtiUserDictionary *aDict)[pure virtual]

Parameters

CPtiUserDictionary * aDict

DropLanguages(CArrayPtrFlat< CPtiCoreLanguage > *)

voidDropLanguages(CArrayPtrFlat< CPtiCoreLanguage > *aLanguageList)[pure virtual]

Removes languages associated to this core object from given language list. Languages not associated to this core abject are not touched.

Since
2.6

Parameters

CArrayPtrFlat< CPtiCoreLanguage > * aLanguageListA language list to be cleaned.

GetCandidateListL(CDesCArray &)

TInt GetCandidateListL(CDesCArray &aList)[pure virtual]

Returns a list of candidate words for currently entered key sequence.

Since
2.6

Parameters

CDesCArray & aListA list to be filled with candidate words.

GetCandidatePage()

TPtrC GetCandidatePage()[pure virtual]

GetCandidatesByInputString(const TDesC &, RPointerArray< HBufC > &, const TBool)

HBufC *GetCandidatesByInputString(const TDesC &aInputString,
RPointerArray< HBufC > &aList,
const TBoolaIsPredictive
)[pure virtual]

Parameters

const TDesC & aInputString
RPointerArray< HBufC > & aList
const TBool aIsPredictive

GetCoreInfo()

MPtiCoreInfo *GetCoreInfo()[pure virtual]

Returns a pointer core info structure. Core info struct contains useful information about core object and its features.

GetCurrentWord()

TPtrC GetCurrentWord()const [pure virtual]

Returns the contents of text buffer.

Since
2.6

GetFirstCandidate(TDes &)

TInt GetFirstCandidate(TDes &aResult)[pure virtual]

Returns first word in list of candidate words for current input sequence.

Since
2.6

Parameters

TDes & aResultA descriptor where resulting word will be stored.

GetNextCandidate(TDes &)

TInt GetNextCandidate(TDes &aResult)[pure virtual]

Returns next word in list of candidate words for current input sequence.

Since
2.6

Parameters

TDes & aResultA descriptor where resulting word will be stored.

GetNextWordCandidateListL(CDesCArray &)

TInt GetNextWordCandidateListL(CDesCArray &aList)[pure virtual]

Returns next word candidate list. Next word candidates are words potentially related to currently selected candidate. Next word prediction feature must supported by the engine and turned on.

Since
2.6

Parameters

CDesCArray & aList

GetPhoneticSpelling(TInt)

TPtrC GetPhoneticSpelling(TIntaIndex)const [pure virtual]

Parameters

TInt aIndex

GetPreviousCandidate(TDes &)

TInt GetPreviousCandidate(TDes &aResult)[pure virtual]

Returns previous word in list of candidate words for current input sequence.

Since
2.6

Parameters

TDes & aResultA descriptor where resulting word will be stored.

GetSpelling(TUint16, TDes &, TPtiSpelling)

TInt GetSpelling(TUint16aInput,
TDes &aOutput,
TPtiSpellingaType
)[pure virtual]

Returns alternate spelling for given unicode characters. Possible conversion types are defined in header PtiDefs.h.

2.6 A character to be converted. Resulting alternate spelling will be stored here. Spelling conversion type.

Parameters

TUint16 aInput
TDes & aOutput
TPtiSpelling aType

GetUserDictionaryEntry(TInt, MPtiUserDictionaryEntry &, CPtiUserDictionary *)

TInt GetUserDictionaryEntry(TIntaIndex,
MPtiUserDictionaryEntry &aResult,
CPtiUserDictionary *aDict
)[pure virtual]

Parameters

TInt aIndex
MPtiUserDictionaryEntry & aResult
CPtiUserDictionary * aDict

HandleCommandL(TPtiEngineCommand, TAny *)

TInt HandleCommandL(TPtiEngineCommandaCommand,
TAny *aParams
)[pure virtual]

A generic command handling method for extending PtiEngine API without adding new base class methods. It is recommended to use this only in force major situations, where there is no other way.

Since
2.6

Parameters

TPtiEngineCommand aCommandA Command id value. Platform wide command ids are defined in PtiDefs.h.
TAny * aParamsTAny pointer for passing any required parameters.

InitializeL(CPtiEngine *, TDes *, CArrayPtrFlat< CPtiCoreLanguage > *, TBool)

voidInitializeL(CPtiEngine *aOwner,
TDes *aTextBuffer,
CArrayPtrFlat< CPtiCoreLanguage > *aLanguageList,
TBoolaUseDefautUserDictionary
)[pure virtual]

Initialized core object. This method is called by PtiEngine framework when core object is loaded.

Since
2.6

Parameters

CPtiEngine * aOwnerPointer to onwing PtiEngine framework instance.
TDes * aTextBufferA pointer to PtiEngine main text buffer.
CArrayPtrFlat< CPtiCoreLanguage > * aLanguageListA language list to be filled with language bindings to this core onbject
TBool aUseDefautUserDictionaryA boolean value indicating whether default user dictionary shoulkd be used (in case this core object supports user dictionaries).

IsToneMarkValidForSpelling()

TBool IsToneMarkValidForSpelling()[pure virtual]

MoreCandidatePages()

TBool MoreCandidatePages()[pure virtual]

NextCandidatePage()

TBool NextCandidatePage()[pure virtual]

NumberOfCandidates()

TInt NumberOfCandidates()[pure virtual]

Returns number of candidates for currently entered key sequence.

Since
2.6

NumberOfEntriesInUserDictionary(CPtiUserDictionary *)

TInt NumberOfEntriesInUserDictionary(CPtiUserDictionary *aDict)[pure virtual]

Parameters

CPtiUserDictionary * aDict

OpenLanguageL(CPtiCoreLanguage *)

TInt OpenLanguageL(CPtiCoreLanguage *aLanguage)[pure virtual]

Opens resources for given language and itinialized them.

Since
2.6

Parameters

CPtiCoreLanguage * aLanguageSymbian OS language code a language to be initialized.

PhoneticSpellingCount()

TInt PhoneticSpellingCount()const [pure virtual]

PreviousCandidatePage()

TBool PreviousCandidatePage()[pure virtual]

ReadingTextL()

TPtrC ReadingTextL()[pure virtual]

RemoveUserDictionaryEntry(MPtiUserDictionaryEntry &, CPtiUserDictionary *)

TInt RemoveUserDictionaryEntry(MPtiUserDictionaryEntry &aEntry,
CPtiUserDictionary *aDict
)[pure virtual]

Parameters

MPtiUserDictionaryEntry & aEntry
CPtiUserDictionary * aDict

SelectPhoneticSpelling(TInt)

TBool SelectPhoneticSpelling(TIntaIndex)[pure virtual]

Parameters

TInt aIndex

SelectedPhoneticSpelling()

TInt SelectedPhoneticSpelling()const [pure virtual]

SetCandidatePageLength(TInt)

voidSetCandidatePageLength(TIntaLength)[pure virtual]

Parameters

TInt aLength

SetCurrentInputSequence(TPtrC8)

TInt SetCurrentInputSequence(TPtrC8aInput)[pure virtual]

Sets current input sequence. The end result of this operation must be same as if user had entered keys in input array as individual key presses.

Since
2.6

Parameters

TPtrC8 aInputAn array containing sequence of key presses (type TPtiKey).

SetExternalKeyMapL(TPtiEngineInputMode, TPtiKey, TDesC &, TPtiTextCase)

TInt SetExternalKeyMapL(TPtiEngineInputModeaMode,
TPtiKeyaKey,
TDesC &aKeyMap,
TPtiTextCaseaCase
)[pure virtual]

Re-defines keymappings for given key / input mode / case combination. Previous keymapping will be deleted and new mappings will be used instead.

Since
2.6

Parameters

TPtiEngineInputMode aModeInput mode for new key mapping.
TPtiKey aKeyA key to be replaced.
TDesC & aKeyMapNew keymapping data for aKey.
TPtiTextCase aCaseText case to be replaced.

SetPredictiveChineseChar(const TDesC &)

TBool SetPredictiveChineseChar(const TDesC &aChar)[pure virtual]

Parameters

const TDesC & aChar

SetReordering(TBool)

TInt SetReordering(TBoolaStatus)[pure virtual]

Turns reoreding feature on or off. Reordering means that prediction engine maintains frequency information for used words and modifys the order of candidate list based on that information. This feature may not be supported by all prediction engines.

Since
2.6

Parameters

TBool aStatusNew status for reorderinf feature.

SetToneMark(TInt)

TBool SetToneMark(TIntaToneMark)[pure virtual]

Parameters

TInt aToneMark

ToneMark(TText &)

TBool ToneMark(TText &aToneMark)const [pure virtual]

Parameters

TText & aToneMark