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 *)
void AppendKeyPress ( TPtiKey )
TInt AttachUserDictionary ( CPtiUserDictionary *)
TInt CancelTimerActivity ()
void ClearBuffer ()
TInt CloseLanguageL ()
TInt CommitCurrentWord ()
MPtiEngineCompositionDataInterface * CompositionData ()
TInt Convert ( TPtiCharConversion , TAny *, TInt , TAny *)
CPtiUserDictionary * CreateEmptyUserDictionaryL ( TInt )
void DeleteKeyPress ()
TBool DetachUserDictionary ( CPtiUserDictionary *)
void DropLanguages ( 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 *)
void InitializeL ( 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 ()
void SetCandidatePageLength ( 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]

AppendKeyPress(TPtiKey)

void AppendKeyPress ( TPtiKey aKey ) [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 aKey Enum 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()

void ClearBuffer ( ) [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 ( TPtiCharConversion aType,
TAny * aInput,
TInt aInputLength,
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 aType Conversion type.
TAny * aInput Pointer to input string to be converted.
TInt aInputLength Length of input buffer.
TAny * aOutput pointer to output buffer.

CreateEmptyUserDictionaryL(TInt)

CPtiUserDictionary * CreateEmptyUserDictionaryL ( TInt aMaxSize ) [pure virtual]

Parameters

TInt aMaxSize

DeleteKeyPress()

void DeleteKeyPress ( ) [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 > *)

void DropLanguages ( 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 > * aLanguageList A 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 & aList A 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 TBool aIsPredictive
) [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 & aResult A 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 & aResult A 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 ( TInt aIndex ) 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 & aResult A descriptor where resulting word will be stored.

GetSpelling(TUint16, TDes &, TPtiSpelling)

TInt GetSpelling ( TUint16 aInput,
TDes & aOutput,
TPtiSpelling aType
) [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 ( TInt aIndex,
MPtiUserDictionaryEntry & aResult,
CPtiUserDictionary * aDict
) [pure virtual]

Parameters

TInt aIndex
MPtiUserDictionaryEntry & aResult
CPtiUserDictionary * aDict

HandleCommandL(TPtiEngineCommand, TAny *)

TInt HandleCommandL ( TPtiEngineCommand aCommand,
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 aCommand A Command id value. Platform wide command ids are defined in PtiDefs.h.
TAny * aParams TAny pointer for passing any required parameters.

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

void InitializeL ( CPtiEngine * aOwner,
TDes * aTextBuffer,
CArrayPtrFlat < CPtiCoreLanguage > * aLanguageList,
TBool aUseDefautUserDictionary
) [pure virtual]

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

Since
2.6

Parameters

CPtiEngine * aOwner Pointer to onwing PtiEngine framework instance.
TDes * aTextBuffer A pointer to PtiEngine main text buffer.
CArrayPtrFlat < CPtiCoreLanguage > * aLanguageList A language list to be filled with language bindings to this core onbject
TBool aUseDefautUserDictionary A 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 * aLanguage Symbian 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]

SelectPhoneticSpelling(TInt)

TBool SelectPhoneticSpelling ( TInt aIndex ) [pure virtual]

Parameters

TInt aIndex

SelectedPhoneticSpelling()

TInt SelectedPhoneticSpelling ( ) const [pure virtual]

SetCandidatePageLength(TInt)

void SetCandidatePageLength ( TInt aLength ) [pure virtual]

Parameters

TInt aLength

SetCurrentInputSequence(TPtrC8)

TInt SetCurrentInputSequence ( TPtrC8 aInput ) [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 aInput An array containing sequence of key presses (type TPtiKey).

SetExternalKeyMapL(TPtiEngineInputMode, TPtiKey, TDesC &, TPtiTextCase)

TInt SetExternalKeyMapL ( TPtiEngineInputMode aMode,
TPtiKey aKey,
TDesC & aKeyMap,
TPtiTextCase aCase
) [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 aMode Input mode for new key mapping.
TPtiKey aKey A key to be replaced.
TDesC & aKeyMap New keymapping data for aKey.
TPtiTextCase aCase Text case to be replaced.

SetPredictiveChineseChar(const TDesC &)

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

Parameters

const TDesC & aChar

SetReordering(TBool)

TInt SetReordering ( TBool aStatus ) [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 aStatus New status for reorderinf feature.

SetToneMark(TInt)

TBool SetToneMark ( TInt aToneMark ) [pure virtual]

Parameters

TInt aToneMark

ToneMark(TText &)

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

Parameters

TText & aToneMark