CPtiEngine Class Reference

class CPtiEngine : public CBase

CPtiEngine class.

This is the main client side API for PtiEngine. The purpose of PtiEngine API is to provide a single calling point for low level (below UI) text input functionality. The API provides methods for querying and activating installed input languages, changing input modes and text cases and performing text input operations. The API contains set of methods for latin based, Chinese and Japanese text input. Some of the methods are common to all of those variants. PtiEngine also provides access to predictive text input functionality, in case there is need to use it directly without standard CEikEdwin / FEP chain (hence the name 'predictive text input engine') Predictive text engine integration is hidden behind PtiCore plugin API and is used through PtiEngine main API.

Usage: PtiEngine is created by calling CPtiEngine::NewL method. In typical use case there is no need to pass core uid parameter to NewL method. Constructor will load and set up available core objects.

Typical use cases:

Entering text in latin multitapping mode ----------------------------------------

CPtiEngine* aEngine = CPtiEngine::NewL() ; aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping); aEngine->AppendKeyPress(EPtiKey3); aEngine->AppendKeyPress(EPtiKey6); aEngine->AppendKeyPress(EPtiKey6); aEngine->AppendKeyPress(EPtiKey6); aEngine->AppendKeyPress(EPtiKey4); TBuf<100> temp; temp.Copy(aEngine-> CurrentWord() ); // At this point temp would contain // word "dog".

Entering text in latin predictive mode --------------------------------------

CPtiEngine* aEngine = CPtiEngine::NewL() ; aEngine->ActivateLanguageL(ELangEnglish, EPtiEnginePredicitve); aEngine->AppendKeyPress(EPtiKey8); aEngine->AppendKeyPress(EPtiKey4); aEngine->AppendKeyPress(EPtiKey4); aEngine->AppendKeyPress(EPtiKey7); TBuf<100> temp; temp.Copy(aEngine-> CurrentWord() ); // At this point temp would contain // (depending on the underlying engine) // word "this". temp.Copy(aEngine-> NextCandidate() ); // Move on to next candidate. aEngine-> CommitCurrentWord() ; // Tell engine that current word was accepted, // so that the underlyinbg engine keeps // frequency information up-to-date. Entering text in latin qwerty mode ----------------------------------

CPtiEngine* aEngine = CPtiEngine::NewL() ; aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwerty); aEngine->AppendKeyPress(EPtiKeyQwertyQ); aEngine->AppendKeyPress(EPtiKeyQwertyW); aEngine->AppendKeyPress(EPtiKeyQwertyE); aEngine->AppendKeyPress(EPtiKeyQwertyR); aEngine->AppendKeyPress(EPtiKeyQwertyT); aEngine->AppendKeyPress(EPtiKeyQwertyY); TBuf<100> temp; temp.Copy(aEngine-> CurrentWord() ); // At this point temp would contain // word "qwerty". // Next line requires that French key mappings are available in device. aEngine->ActivateLanguageL(ELangFrench, EPtiEngineQwerty); aEngine->SetCase(EPtiCaseUpper); aEngine-> ClearCurrentWord() ; aEngine->AppendKeyPress(EPtiKeyQwertyQ); aEngine->AppendKeyPress(EPtiKeyQwertyW); aEngine->AppendKeyPress(EPtiKeyQwertyE); aEngine->AppendKeyPress(EPtiKeyQwertyR); aEngine->AppendKeyPress(EPtiKeyQwertyT); aEngine->AppendKeyPress(EPtiKeyQwertyY); temp.Copy(aEngine-> CurrentWord() ); // At this point temp would contain // word "AZERTY".

Entering text in preditcive latin qwerty mode --------------------------------------------- CPtiEngine* aEngine = CPtiEngine::NewL() ; aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwertyPredictive); aEngine->AppendKeyPress(EPtiKeyQwertyE); aEngine->AppendKeyPress(EPtiKeyQwertyN); aEngine->AppendKeyPress(EPtiKeyQwertyT); aEngine->AppendKeyPress(EPtiKeyQwertyE); aEngine->AppendKeyPress(EPtiKeyQwertyR); aEngine->AppendKeyPress(EPtiKeyQwertyT); aEngine->AppendKeyPress(EPtiKeyQwertyA); TBuf<100> temp; temp.Copy(aEngine-> CurrentWord() ); // At this point temp would contain // for example word "entertainment", assuming the. // underlying prediction engine supports word completion.

Inherits from

Public Member Functions
~CPtiEngine ()
IMPORT_C TInt ActivateLanguageL ( TInt , TPtiEngineInputMode )
IMPORT_C TInt AddAutoSubstitutionEntry (const TDesC &, const TDesC &)
IMPORT_C TInt AddCoreL (const TDesC &, TBool )
IMPORT_C TInt AddCoreL (const TUid , TBool )
IMPORT_C TInt AddPhrase (const TDesC &)
IMPORT_C TInt AddUserDictionaryEntry ( MPtiUserDictionaryEntry &)
IMPORT_C TInt AddUserDictionaryEntry ( MPtiUserDictionaryEntry &, TInt )
IMPORT_C TPtrC AppendKeyPress ( TPtiKey )
IMPORT_C MPtiUserDictionary * AttachDefaultUserDictionaryL ( TUid , TInt )
IMPORT_C MPtiUserDictionary * AttachUserDictionaryL ( TDesC &)
IMPORT_C TUint32 AvailableCharConversions ()
IMPORT_C TInt CancelTimerActivity ()
IMPORT_C TPtrC CandidatePage ()
IMPORT_C TPtiTextCase Case ()
IMPORT_C TPtrC8 CaseSequence ()
IMPORT_C TInt CharConversion ( TPtiCharConversion , TAny *, TInt , TAny *)
IMPORT_C TPtiKey CharacterToKey ( TUint16 )
IMPORT_C void ClearCurrentWord ()
IMPORT_C void CloseCurrentLanguageL ()
IMPORT_C TInt CommitCurrentWord ()
IMPORT_C MPtiEngineCompositionDataInterface * CompositionData ()
IMPORT_C MPtiCoreInfo * CoreInfo ( TPtiEngineInputMode )
IMPORT_C void CreateDefaultUserDictionaryFileL ( TUid , TInt )
IMPORT_C TInt CreateUserDictionaryL ( TDesC &, CDesCArrayFlat *, TPtiEngineInputMode )
IMPORT_C TPtrC8 CurrentInputSequence ()
IMPORT_C MPtiLanguage * CurrentLanguage ()
IMPORT_C TPtrC CurrentWord ()
IMPORT_C MPtiUserDictionary * DefaultUserDictionary ( TPtiEngineInputMode )
IMPORT_C TInt DeleteAutoSubstitutionEntry (const TDesC &)
IMPORT_C TPtrC DeleteKeyPress ()
IMPORT_C TInt DetachUserDictionary ( TDesC &)
IMPORT_C TInt DetachUserDictionary ( TInt )
IMPORT_C void EnableToneMarks ( TBool )
IMPORT_C const RArray < TPtiNumericKeyBinding > & ExtendedNumericModeKeysForQwertyL ( TInt )
IMPORT_C const RArray < TPtiNumericKeyBinding > & ExtendedNumericModeKeysForQwertyL ( TInt , TPtiKeyboardType )
IMPORT_C TPtrC FirstCandidate ()
IMPORT_C TInt GetAutoSubstitutionEntry ( TInt , TDes &, TDes &)
IMPORT_C void GetAvailableLanguagesL ( CArrayFix < TInt > *)
IMPORT_C void GetAvailableLanguagesL ( RArray < TInt > &)
IMPORT_C TInt GetCandidateListL ( CDesCArray &)
IMPORT_C HBufC * GetCandidatesByInputString (const TDesC &, RPointerArray < HBufC > &, const TBool )
IMPORT_C TInt GetChinesePhraseCandidatesL ( CDesCArray &)
IMPORT_C void GetHwrAvailableLanguagesL ( RArray < TInt > &)
IMPORT_C MPtiHwrRecognizer * GetHwrRecognizerL ( TLanguage )
IMPORT_C MPtiHwrRecognizer * GetHwrRecognizerL ( TInt )
IMPORT_C MPtiLanguage * GetLanguage ( TInt )
IMPORT_C void GetLocalizedLanguageName ( TInt , TDes &)
IMPORT_C void GetModeNameIndexL ( TPtiChineseVariant , RArray < TInt > &)
IMPORT_C TInt GetNextWordCandidateListL ( CDesCArray &)
IMPORT_C void GetNumericModeKeysForQwertyL ( TInt , RArray < TPtiNumericKeyBinding > &)
IMPORT_C void GetNumericModeKeysForQwertyL ( TInt , RArray < TPtiNumericKeyBinding > &, TPtiKeyboardType )
IMPORT_C TPtrC GetPhoneticSpelling ( TInt )
IMPORT_C TInt GetPhoneticSpellingsL ( CDesCArray &)
IMPORT_C TInt GetSpelling ( TUint16 , TDes &, TPtiSpelling )
IMPORT_C TInt GetUserDictionaryEntry ( TInt , MPtiUserDictionaryEntry &)
IMPORT_C TInt HandleCommandL ( TPtiEngineCommand , TAny *)
IMPORT_C TBool IncrementToneMark ( TBool )
IMPORT_C TPtiEngineInputMode InputMode ()
IMPORT_C TBool IsQwertyBasedMode ( TPtiEngineInputMode )
IMPORT_C TBool IsToneMarkValidForSpelling ()
IMPORT_C TBool IsValidKey ( TPtiKey )
IMPORT_C TPtiKeyboardType KeyboardType ()
IMPORT_C void KeyboardTypesSupportedByLanguageL ( TInt , RArray < TPtiKeyboardType > &)
IMPORT_C TPtiKey LastEnteredKey ()
IMPORT_C void ListAvailablePhysicalKeyboardsL ( RArray < TPtiKeyboardType > &)
IMPORT_C RArray < TUid > & ListHwrRecognizerL ( TLanguage )
IMPORT_C void MappingDataForKey ( TPtiKey , TDes &, TPtiTextCase )
IMPORT_C void MarkAutoCapitalized ()
IMPORT_C TBool MoreCandidatePages ()
IMPORT_C CPtiEngine * NewL ( TBool )
IMPORT_C CPtiEngine * NewL (const TDesC &, TBool )
IMPORT_C CPtiEngine * NewL (const TUid , TBool )
IMPORT_C TPtrC NextCandidate ()
IMPORT_C TBool NextCandidatePage ()
IMPORT_C TInt NumberOfAutoSubstitutionEntries ()
IMPORT_C TInt NumberOfCandidates ()
IMPORT_C TInt NumberOfEntriesInUserDictionary ()
IMPORT_C TInt NumberOfLanguages ()
IMPORT_C MPtiObserver * Observer ()
IMPORT_C TInt PhoneticSpellingCount ()
IMPORT_C TPtrC PreviousCandidate ()
IMPORT_C TBool PreviousCandidatePage ()
IMPORT_C HBufC8 * ReadSecondaryDataFileL ( TUid , TInt )
IMPORT_C TPtrC ReadingTextL ()
IMPORT_C TInt RemoveEntryFromUserDictionary ( MPtiUserDictionaryEntry &)
IMPORT_C TInt RemoveEntryFromUserDictionary ( MPtiUserDictionaryEntry &, TInt )
IMPORT_C void ResetToneMark ()
IMPORT_C TBool SelectPhoneticSpelling ( TInt )
IMPORT_C TInt SelectedPhoneticSpelling ()
IMPORT_C TInt SetAutoSubstitution ( TBool )
IMPORT_C void SetCandidatePageLength ( TInt )
IMPORT_C void SetCase ( TPtiTextCase )
IMPORT_C TInt SetCurrentWord ( TPtrC )
IMPORT_C TInt SetExternalKeyMapL ( TPtiEngineInputMode , TPtiKey , TDesC &, TPtiTextCase )
IMPORT_C TInt SetInputMode ( TPtiEngineInputMode )
IMPORT_C TInt SetKeyboardType ( TPtiKeyboardType )
IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates ( TInt )
IMPORT_C TInt SetNumberCandidateStatus ( TBool )
IMPORT_C void SetObserver ( MPtiObserver *)
IMPORT_C TBool SetPredictiveChineseChar (const TDesC &)
IMPORT_C TInt SetReordering ( TBool )
IMPORT_C TBool SetToneMark ( TInt )
IMPORT_C TBool ToneMark ( TText &)
IMPORT_C void WriteSecondaryDataFileL ( TUid , TInt , HBufC8 *)
Private Member Functions
CPtiEngine ()
void ConstructL ( TBool )
void ConstructL (const TUid , TBool )
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
CPtiEngineImpl * iImpl

Constructor & Destructor Documentation

CPtiEngine()

CPtiEngine ( ) [private]

~CPtiEngine()

IMPORT_C ~CPtiEngine ( )

Destructor.

Member Functions Documentation

ActivateLanguageL(TInt, TPtiEngineInputMode)

IMPORT_C TInt ActivateLanguageL ( TInt aEpocLanguageID,
TPtiEngineInputMode aMode = EPtiEngineInputModeNone
)

Activates language in requested input mode. After calling this method language is ready to be used with all input modes it supports.

Since
S60 V2.6

Parameters

TInt aEpocLanguageID Language to be activated.
TPtiEngineInputMode aMode = EPtiEngineInputModeNone Input mode after activation. If thise is left to default value, then default input mode is activated.

AddAutoSubstitutionEntry(const TDesC &, const TDesC &)

IMPORT_C TInt AddAutoSubstitutionEntry ( const TDesC & aShortcut,
const TDesC & aSubstituition
)

Adds new auto substitution entry to database. If entry for given shorcut already exists, then the old entry will be automatically deleted.

Since
S60 V5.0

Parameters

const TDesC & aShortcut Shortcut part for new entry.
const TDesC & aSubstituition

AddCoreL(const TDesC &, TBool)

IMPORT_C TInt AddCoreL ( const TDesC & aFileName,
TBool aUseDefaultUserDictionary = EFalse
)

DEPRECATED (will leave if called).

Parameters

const TDesC & aFileName
TBool aUseDefaultUserDictionary = EFalse

AddCoreL(const TUid, TBool)

IMPORT_C TInt AddCoreL ( const TUid aCoreUid,
TBool aUseDefaultUserDictionary = EFalse
)

Loads and constructs new core object. Core object is added to the list of available cores and is ready to be used after that.

Since
S60 V2.6

Parameters

const TUid aCoreUid Uid for core plugin.
TBool aUseDefaultUserDictionary = EFalse ....

AddPhrase(const TDesC &)

IMPORT_C TInt AddPhrase ( const TDesC & aNewPhrase )

Some prediction engines support next word prediction feature but require database to be pre-filled with suitable phrase data. This method adds one new phrase or sentence to phrase dictionary. Active core object needs to support phrase based next word prediction, otherwise an error code is returned.

Since
S60 V5.0

Parameters

const TDesC & aNewPhrase New phrase to be added to phrase dictionary.

AddUserDictionaryEntry(MPtiUserDictionaryEntry &)

IMPORT_C TInt AddUserDictionaryEntry ( MPtiUserDictionaryEntry & aEntry )

Adds new entry (in most cases a word) to default user dictionary of currently active core object.

Since
S60 V2.6

Parameters

MPtiUserDictionaryEntry & aEntry An entry to be added to dictionary.

AddUserDictionaryEntry(MPtiUserDictionaryEntry &, TInt)

IMPORT_C TInt AddUserDictionaryEntry ( MPtiUserDictionaryEntry & aEntry,
TInt aId
)

Adds entry to specific user dictionary.

Since
S60 V2.6

Parameters

MPtiUserDictionaryEntry & aEntry An entry to be added to dictionary.
TInt aId User dictionary id.

AppendKeyPress(TPtiKey)

IMPORT_C TPtrC AppendKeyPress ( TPtiKey aKey )

This method handles key press and forwards it to correct core object depending on active language and input mode. The current word buffer is updated accordingly. If input sequence buffer has reached its maximum length then nothing will be done.

Since
S60 V2.6

Parameters

TPtiKey aKey Key code.

AttachDefaultUserDictionaryL(TUid, TInt)

IMPORT_C MPtiUserDictionary * AttachDefaultUserDictionaryL ( TUid aCoreUid,
TInt aSymbolClass
)

Attach default user dictionary.

Since
S60 V2.6

Parameters

TUid aCoreUid Uid for owner core object.
TInt aSymbolClass Symbol class for udb data.

AttachUserDictionaryL(TDesC &)

IMPORT_C MPtiUserDictionary * AttachUserDictionaryL ( TDesC & aFileName )

Attach user dictionary in given file to core for requested input mode.

Since
S60 V2.6

Parameters

TDesC & aFileName User dictionary file name.

AvailableCharConversions()

IMPORT_C TUint32 AvailableCharConversions ( ) const

Returns value indicating currently available character conversions.

Since
S60 V2.6

CancelTimerActivity()

IMPORT_C TInt CancelTimerActivity ( )

Front end processeor uses this method for indicating PtiEngine that all key press related timers should be canceled.

Since
S60 V2.6

CandidatePage()

IMPORT_C TPtrC CandidatePage ( )

Returns pointer to current Chinese candidate page.

Since
S60 V2.6

Case()

IMPORT_C TPtiTextCase Case ( ) const

Returns active text case.

Since
S60 V2.6

CaseSequence()

IMPORT_C TPtrC8 CaseSequence ( )

Returns text case buffer. Case buffer contains shift state for each key press used for producing active word, ie. it remembers case values for each AppendKeyPress call. Case buffer is cleared when active word is commited or cleared. Return value is TPtrC8 containing string of EPtiTextCase values.

Since
S60 V5.0

CharConversion(TPtiCharConversion, TAny *, TInt, TAny *)

IMPORT_C TInt CharConversion ( TPtiCharConversion aType,
TAny * aInput,
TInt aInputLength,
TAny * aOutput
)

Converts given string of characters to one coding system to another. See definition of TPtiCharConversion for list of supported conversion types. It is possible that only a small subset of supported conversion types is actually available at run time (that depends on available core objects). AvailableCharConversions() method can be used for querying available conversion types before using this method.

Since
S60 V2.6

Parameters

TPtiCharConversion aType Requested conversion type.
TAny * aInput Input string. This parameter may point to either 8-bit or 16-bit data depending on conversion type.
TInt aInputLength Number of characters in input string.
TAny * aOutput Output string. This parameter may pint to either 8-bit or 16-bit data depending on conversion type.

CharacterToKey(TUint16)

IMPORT_C TPtiKey CharacterToKey ( TUint16 aChar )

Returns key for given character. Returned key depends on current language and input mode.

Since
S60 V2.6

Parameters

TUint16 aChar Requested character.

ClearCurrentWord()

IMPORT_C void ClearCurrentWord ( )

Clears current word buffer. Calling this method means that current word was reject and will not be part of edited text. Either this method or CommitCurrentWord() must be called before starting a new word.

Since
S60 V2.6

CloseCurrentLanguageL()

IMPORT_C void CloseCurrentLanguageL ( )

Closes active language. After calling this method there won't be active language and most PtiEngine API methods will return error until ActivateLanguageL is called again. Core objects for active language are asked to release related resources.

Since
S60 V2.6

CommitCurrentWord()

IMPORT_C TInt CommitCurrentWord ( )

Commits current word. Commiting means that core object is isntructed to end inline editing operation and accepted active word as part of edited text. Core object may then update frequency information, add unrecognized word to user dictioary or perform any other operation related to commiting a word. Word buffer is cleared. Either this method or ClearCurrentWord() must be called before starting a new word.

Since
S60 V2.6

CompositionData()

IMPORT_C MPtiEngineCompositionDataInterface * CompositionData ( )

Returns pointer to composition data interface (used with Japanese input).

Since
S60 V2.6

ConstructL(TBool)

void ConstructL ( TBool aUseDefaultUserDictionary ) [private]

Parameters

TBool aUseDefaultUserDictionary

ConstructL(const TUid, TBool)

void ConstructL ( const TUid aCoreUid,
TBool aUseDefaultUserDictionary
) [private]

Parameters

const TUid aCoreUid
TBool aUseDefaultUserDictionary

CoreInfo(TPtiEngineInputMode)

IMPORT_C MPtiCoreInfo * CoreInfo ( TPtiEngineInputMode aMode ) const

Returns core info structure for given input mode.

Since
S60 V2.6

Parameters

TPtiEngineInputMode aMode

CreateDefaultUserDictionaryFileL(TUid, TInt)

IMPORT_C void CreateDefaultUserDictionaryFileL ( TUid aCoreUid,
TInt aSymbolClass
)

Creates empty user default dictionary file for given core object and initializes it to PtiEngine user dictionary format. If file already exists, then this method does nothing. Normally this method is only used by core objects.

Since
S60 V3.0

Parameters

TUid aCoreUid Uid for requesting core object.
TInt aSymbolClass Symbol class for udb data.

CreateUserDictionaryL(TDesC &, CDesCArrayFlat *, TPtiEngineInputMode)

IMPORT_C TInt CreateUserDictionaryL ( TDesC & aFileName,
CDesCArrayFlat * aWords,
TPtiEngineInputMode aMode
)

Creates new user dictionary file, inserts given list of words into it and attaches it to active core object for requested input mode. Active language must support requested input mode.

Since
S60 V2.6

Parameters

TDesC & aFileName File name for new user dictionary.
CDesCArrayFlat * aWords A list of words to be inserted to new user dictionary.
TPtiEngineInputMode aMode Input mode for core object.

CurrentInputSequence()

IMPORT_C TPtrC8 CurrentInputSequence ( ) const

Returns current input sequence (a list of key presses). Bytes in returned descriptor are TPtiKey enum values.

Since
S60 V2.6

CurrentLanguage()

IMPORT_C MPtiLanguage * CurrentLanguage ( )

Returns pointer to currently active language.

Since
S60 V2.6

CurrentWord()

IMPORT_C TPtrC CurrentWord ( )

Returns pointer to current word buffer.

Since
S60 V2.6

DefaultUserDictionary(TPtiEngineInputMode)

IMPORT_C MPtiUserDictionary * DefaultUserDictionary ( TPtiEngineInputMode aMode )

Returns default user dictionary for given input mode.

Since
S60 V2.6

Parameters

TPtiEngineInputMode aMode

DeleteAutoSubstitutionEntry(const TDesC &)

IMPORT_C TInt DeleteAutoSubstitutionEntry ( const TDesC & aShortcut )

Remove auto substitution entry.

Since
S60 V5.0

Parameters

const TDesC & aShortcut Shortcut for auto substitution entry to be removed.

DeleteKeyPress()

IMPORT_C TPtrC DeleteKeyPress ( )

Deletes last character in current word buffer and updates candidate list accordingly.

Since
S60 V2.6

DetachUserDictionary(TDesC &)

IMPORT_C TInt DetachUserDictionary ( TDesC & aFileName )

Detaches currently attached user dictionary.

Since
S60 V2.6

Parameters

TDesC & aFileName User dictionary file name.

DetachUserDictionary(TInt)

IMPORT_C TInt DetachUserDictionary ( TInt aId )

Detaches currently attached user dictionary.

Since
S60 V2.6

Parameters

TInt aId User dictionary id.

EnableToneMarks(TBool)

IMPORT_C void EnableToneMarks ( TBool aValue )

Enables or disables tone marks.

Since
S60 V2.6

Parameters

TBool aValue A boolean value specifying whether tone marks will be on or off.

ExtendedNumericModeKeysForQwertyL(TInt)

IMPORT_C const RArray < TPtiNumericKeyBinding > & ExtendedNumericModeKeysForQwertyL ( TInt aLanguage )

This method is same as GetNumericModeKeysForQwertyL, expect that instead of returning strict list of key bindings used in phone number editor, it returns list of all possible characters used in any of the "number only" editor variations. Returned list includes key bindings for characters: "*+pw#1234567890;.,-E?/" (Not necessarily in this order). See also GetNumericModeKeysForQwertyL.

This version first tries to return mappings according to currently active physical keyboard. It current keyboard is not qwerty based, it searches data for the first qwerty based keyboard type it can find. That is done in same order as keyboard types are defined in PtiDefs.h. There is also another version this method, which gets keyboard type as a parameter.

Since
S60 V3.2

Parameters

TInt aLanguage Language id for requested mappings.

ExtendedNumericModeKeysForQwertyL(TInt, TPtiKeyboardType)

IMPORT_C const RArray < TPtiNumericKeyBinding > & ExtendedNumericModeKeysForQwertyL ( TInt aLanguage,
TPtiKeyboardType aKeyboardType
)

Same as previous version of ExtendedNumericModeKeysForQwertyL (see description above), but keyboard type is given as a parameter and mappings are return only for given keyboard type.

Since
S60 V5.0

Parameters

TInt aLanguage Language id for requested mappings.
TPtiKeyboardType aKeyboardType keyboard type.

FirstCandidate()

IMPORT_C TPtrC FirstCandidate ( )

Returns pointer to first word in candidate list. If there isn't any candidate words the returned pointer will point to empty descriptor.

Since
S60 V2.6

GetAutoSubstitutionEntry(TInt, TDes &, TDes &)

IMPORT_C TInt GetAutoSubstitutionEntry ( TInt aIndex,
TDes & aShortcut,
TDes & aSubstitution
)

Return auto substitution entry for given index.

Since
S60 V5.0

Parameters

TInt aIndex Index for entry to be returned.
TDes & aShortcut Shortcut part of the result entry will be stored here.
TDes & aSubstitution Substitution part of result entry will be stored here.

GetAvailableLanguagesL(CArrayFix< TInt > *)

IMPORT_C void GetAvailableLanguagesL ( CArrayFix < TInt > * aResult )

Returns list of available input languages.

Since
S60 V2.6

Parameters

CArrayFix < TInt > * aResult List to be filled with language codes.

GetAvailableLanguagesL(RArray< TInt > &)

IMPORT_C void GetAvailableLanguagesL ( RArray < TInt > & aResult )

Returns list of available input languages.

Since
S60 V2.6

Parameters

RArray < TInt > & aResult List to be filled with language codes.

GetCandidateListL(CDesCArray &)

IMPORT_C TInt GetCandidateListL ( CDesCArray & aList )

Returns list of candidate words for current input sequence. If word completion feature is on, then words accepted to result list may contain more letters than the number of key presses in current input sequence.

Since
S60 V2.6

Parameters

CDesCArray & aList a list to be filled with candidate words.

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

IMPORT_C HBufC * GetCandidatesByInputString ( const TDesC & aInputString,
RPointerArray < HBufC > & aList,
const TBool aIsPredictive
)

Parameters

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

GetChinesePhraseCandidatesL(CDesCArray &)

IMPORT_C TInt GetChinesePhraseCandidatesL ( CDesCArray & aList )

Fills list with phrase candidates for currently selected phonetic spelling.

Since
S60 V2.6

Parameters

CDesCArray & aList A descriptor list to be filled with phrase candidates. Any previous items in aList are cleared.

GetHwrAvailableLanguagesL(RArray< TInt > &)

IMPORT_C void GetHwrAvailableLanguagesL ( RArray < TInt > & aResult )

Get hwr available languages list

Since
S60 V4.0

Parameters

RArray < TInt > & aResult Carry the hwr available languages list on return

GetHwrRecognizerL(TLanguage)

IMPORT_C MPtiHwrRecognizer * GetHwrRecognizerL ( TLanguage aLanguage )

Get first hwr implementation support the specified language

Since
S60 V4.0

Parameters

TLanguage aLanguage The language that hwr implementation supported

GetHwrRecognizerL(TInt)

IMPORT_C MPtiHwrRecognizer * GetHwrRecognizerL ( TInt aImpId )

Get hwr implementation by give implementation uid

Since
S60 V4.0

Parameters

TInt aImpId Given specific implementation uid

GetLanguage(TInt)

IMPORT_C MPtiLanguage * GetLanguage ( TInt aCode ) const

Returns pointer to requested language.

Since
S60 V2.6

Parameters

TInt aCode Language code for requested language.

GetLocalizedLanguageName(TInt, TDes &)

IMPORT_C void GetLocalizedLanguageName ( TInt aLangCode,
TDes & aResult
)

Returns localized language name for given language. This method is quite inefficient (always reads name table from resource file), when possible use Getlanguage()->LocalizedName() instead. This method can be used also when requested language is not among available input languages.

Since
S60 V2.6

Parameters

TInt aLangCode
TDes & aResult

GetModeNameIndexL(TPtiChineseVariant, RArray< TInt > &)

IMPORT_C void GetModeNameIndexL ( TPtiChineseVariant aVariant,
RArray < TInt > & aResult
)

Returns mode name index table for given Chinese variant.

Since
S60 V2.6

Parameters

TPtiChineseVariant aVariant Chinese variant to be queried.
RArray < TInt > & aResult Resulting index table.

GetNextWordCandidateListL(CDesCArray &)

IMPORT_C TInt GetNextWordCandidateListL ( CDesCArray & aList )

Returns next word candidate list. This method requires that current core object supports next word prediction feature and it is turned on.

Since
S60 V2.6

Parameters

CDesCArray & aList A List to be filled with next word cadidates.

GetNumericModeKeysForQwertyL(TInt, RArray< TPtiNumericKeyBinding > &)

IMPORT_C void GetNumericModeKeysForQwertyL ( TInt aLanguage,
RArray < TPtiNumericKeyBinding > & aResult
)

Qwerty input mode has different keymapping layout for each language. Therefore the characters for numeric input mode may be mapped to different keys depending on language. There are several situations where client application needs to know which key and case combination produce numeric characters for given language. This convinience method can be used for extracting that information easily (it is also possible to achieve same result directly via CPtiCoreLanguage object). Result array will be left empty if requested language is not available or it doesn't support qwerty input mode. Returned list includes key bindings for characters: "0123456789pw+#*" (Not necessarily in this order). See also ExtendedNumericModeKeysForQwertyL.

This version first tries to return mappings according to currently active physical keyboard. It current keyboard is not qwerty based, it searches data for the first qwerty based keyboard type it can find. That is done in same order as keyboard types are defined in PtiDefs.h. There is also another version this method, which gets keyboard type as a parameter.

Since
S60 V3.1

Parameters

TInt aLanguage Language id for requested mappings.
RArray < TPtiNumericKeyBinding > & aResult Array for storing resulting mappings.

GetNumericModeKeysForQwertyL(TInt, RArray< TPtiNumericKeyBinding > &, TPtiKeyboardType)

IMPORT_C void GetNumericModeKeysForQwertyL ( TInt aLanguage,
RArray < TPtiNumericKeyBinding > & aResult,
TPtiKeyboardType aKeyboardType
)

Same as previous version of GetNumericModeKeysForQwertyL (see description above) but keyboard type is given as a parameter and mappings are return only for given keyboard type.

Since
S60 V5.0

Parameters

TInt aLanguage Language id for requested mappings.
RArray < TPtiNumericKeyBinding > & aResult Array for storing resulting mappings.
TPtiKeyboardType aKeyboardType keyboard type.

GetPhoneticSpelling(TInt)

IMPORT_C TPtrC GetPhoneticSpelling ( TInt aIndex ) const

Returns phonetic spelling for current input.

Since
S60 V2.6

Parameters

TInt aIndex Index of requested phonetic spelling.

GetPhoneticSpellingsL(CDesCArray &)

IMPORT_C TInt GetPhoneticSpellingsL ( CDesCArray & aList )

Fills list with all the phonetic spellings for current input sequence.

Since
S60 V2.6

Parameters

CDesCArray & aList A descriptor list to be filled with phonetic spellings. Any previous items in aList are cleared.

GetSpelling(TUint16, TDes &, TPtiSpelling)

IMPORT_C TInt GetSpelling ( TUint16 aInput,
TDes & aOutput,
TPtiSpelling aType
)

Returns alternate spelling for given character.

Since
S60 V2.6

Parameters

TUint16 aInput a character to be converted to requested spelling.
TDes & aOutput output will be stored to this descriptor.
TPtiSpelling aType spelling type

GetUserDictionaryEntry(TInt, MPtiUserDictionaryEntry &)

IMPORT_C TInt GetUserDictionaryEntry ( TInt aIndex,
MPtiUserDictionaryEntry & aResult
)

Returns entry for given index in default user dictionary.

Since
S60 V2.6

Parameters

TInt aIndex An index for requested entry.
MPtiUserDictionaryEntry & aResult Result will be stored here.

HandleCommandL(TPtiEngineCommand, TAny *)

IMPORT_C TInt HandleCommandL ( TPtiEngineCommand aCommand,
TAny * aParams = NULL
)

General command handling method. This method can be used for controlling core objects that require more information than just sequence of key presses.

Since
S60 V2.6

Parameters

TPtiEngineCommand aCommand A command to be handled.
TAny * aParams = NULL Possible input data or parameters for command.

IncrementToneMark(TBool)

IMPORT_C TBool IncrementToneMark ( TBool aOverrideInvalid )

Cycles to next tone mark in core related tone mark list.

Since
S60 V2.6

Parameters

TBool aOverrideInvalid Indicates whether invalid tone marks should be skipped.

InputMode()

IMPORT_C TPtiEngineInputMode InputMode ( ) const

Returns active input mode.

Since
S60 V2.6

IsQwertyBasedMode(TPtiEngineInputMode)

IMPORT_C TBool IsQwertyBasedMode ( TPtiEngineInputMode aMode ) const

A convinience method for cheking qwerty based input mode.

Since
S60 V3.0

Parameters

TPtiEngineInputMode aMode Input mode to be checked.

IsToneMarkValidForSpelling()

IMPORT_C TBool IsToneMarkValidForSpelling ( ) const

Returns boolean value indicating whether current tone mark is valid for spelling.

Since
S60 V2.6

IsValidKey(TPtiKey)

IMPORT_C TBool IsValidKey ( TPtiKey aKey ) const

Returns a boolean value indicating whether given scan code is allowed for current input mode.

Since
S60 V5.0

Parameters

TPtiKey aKey A key to be queried.

KeyboardType()

IMPORT_C TPtiKeyboardType KeyboardType ( ) const

Returns currently selected qwerty keyboard type.

Since
S60 V5.0

KeyboardTypesSupportedByLanguageL(TInt, RArray< TPtiKeyboardType > &)

IMPORT_C void KeyboardTypesSupportedByLanguageL ( TInt aLanguage,
RArray < TPtiKeyboardType > & aResult
)

Lists keyboard blocks available in keymapping data for given language.

Since
S60 V5.0

Parameters

TInt aLanguage A language to be queried.
RArray < TPtiKeyboardType > & aResult Resulting list of keyboard types will we stored here.

LastEnteredKey()

IMPORT_C TPtiKey LastEnteredKey ( ) const

Returns last entered key press.

Since
S60 V2.6

ListAvailablePhysicalKeyboardsL(RArray< TPtiKeyboardType > &)

IMPORT_C void ListAvailablePhysicalKeyboardsL ( RArray < TPtiKeyboardType > & aResult ) [static]

Returns a list containing keyboard type values for all available physical keyboards connected to the device. Keyboard doesn't have to be active at calling time to be included in the output list.

Since
S60 V5.0

Parameters

RArray < TPtiKeyboardType > & aResult An array to be filled with available keyboard types.

ListHwrRecognizerL(TLanguage)

IMPORT_C RArray < TUid > & ListHwrRecognizerL ( TLanguage aLanguage )

Get hwr implementation uid list which support given language

Since
S60 V4.0

Parameters

TLanguage aLanguage The language that hwr implementation supported

MappingDataForKey(TPtiKey, TDes &, TPtiTextCase)

IMPORT_C void MappingDataForKey ( TPtiKey aKey,
TDes & aResult,
TPtiTextCase aCase
)

Returns keymapping data for given key. Returned data depends on active language and input mode. Result string will be empty if there isn't key mapping adta available.

Since
S60 V3.0

Parameters

TPtiKey aKey A key to be queried.
TDes & aResult Resulting mapping data.
TPtiTextCase aCase

MarkAutoCapitalized()

IMPORT_C void MarkAutoCapitalized ( )

Some core objects may provide different set of results depending on whether the auto captitalization feature was used for entering the word or not. There is now way to tell on core level whether the word was auto-capitalizedby FEP or capitalized normally by the user. This method can be used to incicate core object that auto-capitalization was used for current input sequence. Clearing or commiting the word will cancel the effect of this method.

Since
S60 V5.0

MoreCandidatePages()

IMPORT_C TBool MoreCandidatePages ( )

Returns a boolean value indicating whether there are more candidate pages available.

Since
S60 V2.6

NewL(TBool)

IMPORT_C CPtiEngine * NewL ( TBool aUseDefaultUserDictionary = EFalse ) [static]

Two phase constructor.

Parameters

TBool aUseDefaultUserDictionary = EFalse

NewL(const TDesC &, TBool)

IMPORT_C CPtiEngine * NewL ( const TDesC & aCoreName,
TBool aUseDefaultUserDictionary = EFalse
) [static]

Two phase constructor.

NOTE: THIS METHOD IS DEPRECATED AND WILL LEAVE WHEN CALLED.

Parameters

const TDesC & aCoreName
TBool aUseDefaultUserDictionary = EFalse

NewL(const TUid, TBool)

IMPORT_C CPtiEngine * NewL ( const TUid aCoreUid,
TBool aUseDefaultUserDictionary = EFalse
) [static]

Two phase constructor.

Parameters

const TUid aCoreUid
TBool aUseDefaultUserDictionary = EFalse

NextCandidate()

IMPORT_C TPtrC NextCandidate ( )

Returns pointer to next word in candidate list. FirstCandidate() must be called before calling this method. Returns pointer to empty descriptor if there isn't more candidates available.

Since
S60 V2.6

NextCandidatePage()

IMPORT_C TBool NextCandidatePage ( )

Changes to next Chinese candidate page.

Since
S60 V2.6

NumberOfAutoSubstitutionEntries()

IMPORT_C TInt NumberOfAutoSubstitutionEntries ( ) const

Returns the number of auto substitution entries in auto subst db.

Since
S60 V5.0

NumberOfCandidates()

IMPORT_C TInt NumberOfCandidates ( )

Returns number of candidate words for current input sequence.

Since
S60 V2.6

NumberOfEntriesInUserDictionary()

IMPORT_C TInt NumberOfEntriesInUserDictionary ( )

Returns number of entries in default user dictionary.

Since
S60 V2.6

NumberOfLanguages()

IMPORT_C TInt NumberOfLanguages ( ) const

Returns number of available input languages.

Since
S60 V2.6

Observer()

IMPORT_C MPtiObserver * Observer ( )

Returns current observer.

Since
S60 V2.6

PhoneticSpellingCount()

IMPORT_C TInt PhoneticSpellingCount ( ) const

Returns a value specifying how many phonetic spellings there is available for current input.

Since
S60 V2.6

PreviousCandidate()

IMPORT_C TPtrC PreviousCandidate ( )

Returns pointer to previous word in candidate list. If there isn't previous candidate available ( NextCandidate() wasn't succesfully called) then the return value will point to an empty string.

Since
S60 V2.6

PreviousCandidatePage()

IMPORT_C TBool PreviousCandidatePage ( )

Changes to previous Chinese candidate page.

Since
S60 V2.6

ReadSecondaryDataFileL(TUid, TInt)

IMPORT_C HBufC8 * ReadSecondaryDataFileL ( TUid aCoreUid,
TInt aIndexNumber
)

Returns a heap buffer containing data from given secondary data file. Returns null if file is not found.

Since
S60 V3.0

Parameters

TUid aCoreUid Uid number for requesting core object.
TInt aIndexNumber Index number (see CreateDefaultUserDictionaryFileL).

ReadingTextL()

IMPORT_C TPtrC ReadingTextL ( )

Returns reading text for Japanese input.

Since
S60 V2.6

RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry &)

IMPORT_C TInt RemoveEntryFromUserDictionary ( MPtiUserDictionaryEntry & aEntry )

Removes entry from default user dictionary of currently active core object.

Since
S60 V2.6

Parameters

MPtiUserDictionaryEntry & aEntry an entry to be removed from default dictionary.

RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry &, TInt)

IMPORT_C TInt RemoveEntryFromUserDictionary ( MPtiUserDictionaryEntry & aEntry,
TInt aId
)

Removes word from specific user dictionary.

Since
S60 V2.6

Parameters

MPtiUserDictionaryEntry & aEntry an entry to be removed from default dictionary.
TInt aId User dictionary id.

ResetToneMark()

IMPORT_C void ResetToneMark ( )

Resets tone mark.

Since
S60 V2.6

SelectPhoneticSpelling(TInt)

IMPORT_C TBool SelectPhoneticSpelling ( TInt aIndex )

Selects given phonetic spelling for current input.

Since
S60 V2.6

Parameters

TInt aIndex Index of requested phonetic spelling.

SelectedPhoneticSpelling()

IMPORT_C TInt SelectedPhoneticSpelling ( ) const

Returns the index of currently selected phonetic spelling.

Since
S60 V2.6

SetAutoSubstitution(TBool)

IMPORT_C TInt SetAutoSubstitution ( TBool aStatus )

Turns auto substitution feature on or off. Auto substitution feature replaces predefined strings with other strings. For example, if user types xmas, it could be auto substituted with Christmas.

Since
S60 V5.0

Parameters

TBool aStatus New status for auto substituiton feature

SetCandidatePageLength(TInt)

IMPORT_C void SetCandidatePageLength ( TInt aLength )

Sets length of Chinese candidate page.

Since
S60 V2.6

Parameters

TInt aLength Length of Chinese candidate page.

SetCase(TPtiTextCase)

IMPORT_C void SetCase ( TPtiTextCase aCase )

Sets text case.

Since
S60 V2.6
EPtiCaseLower Normal lower text case EPtiCaseUpper Normal capitalized text case EPtiCaseChrLower Lower text case when Chr key is being held EPtiCaseChrUpper Upper text case when Chr key is being held EPtiCaseFnLower Lower text case when Fn key is being held EPtiCaseFnUpper Upper text case when Fn key is being held

Parameters

TPtiTextCase aCase Text case to be set. Possible values are:

SetCurrentWord(TPtrC)

IMPORT_C TInt SetCurrentWord ( TPtrC aWord )

Fills text buffer with given word, refreshes current input sequence and asks current core object to update candidate list accordingly.

Since
S60 V2.6

Parameters

TPtrC aWord a word to be set as current word.

SetExternalKeyMapL(TPtiEngineInputMode, TPtiKey, TDesC &, TPtiTextCase)

IMPORT_C TInt SetExternalKeyMapL ( TPtiEngineInputMode aMode,
TPtiKey aKey,
TDesC & aKeyMap,
TPtiTextCase aCase
)

Replaces key map for single key.

Since
S60 V2.6

Parameters

TPtiEngineInputMode aMode Input mode of key map.
TPtiKey aKey Key to be replaced.
TDesC & aKeyMap New key sequence for aKey.
TPtiTextCase aCase

SetInputMode(TPtiEngineInputMode)

IMPORT_C TInt SetInputMode ( TPtiEngineInputMode aMode )

Activates requested input mode for active language.

Since
S60 V2.6

Parameters

TPtiEngineInputMode aMode requested input mode.

SetKeyboardType(TPtiKeyboardType)

IMPORT_C TInt SetKeyboardType ( TPtiKeyboardType aType )

Sets keyboard type for non-virtual keyboard. Keyboard type specifies which set of key mapping data is used.

Since
S60 V5.0

Parameters

TPtiKeyboardType aType New keyboard type.

SetMaxLengthForAutoCompletedCandidates(TInt)

IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates ( TInt aMaxLength )

Sets the maximum length for auto completed words. This method can be used when the client needs to be sure that all provided word completions will fit into remaining editor buffer. When the number of key presses in an input sequence exceeds the value given in aMaxLength, core will automatically reset this value to "no limit".

Since
S60 V5.0

Parameters

TInt aMaxLength The maximum length fo auto completed candinates. Value 0 means no limit.

SetNumberCandidateStatus(TBool)

IMPORT_C TInt SetNumberCandidateStatus ( TBool aStatus )

Sets a boolean value indicating whether number candidates are included to predictive candidate list. Number candidates are strings containing only digits. Number candidate feature must be supported by active prediction engine, otherwise this setting will be ignored.

Since
S60 V5.0

Parameters

TBool aStatus A boolean value indicating whether number candidates are included to cadidate list.

SetObserver(MPtiObserver *)

IMPORT_C void SetObserver ( MPtiObserver * aObserver )

Sets observer. See PtiObserver.h for observer API details.

Since
S60 V2.6

Parameters

MPtiObserver * aObserver A observer to be set.

SetPredictiveChineseChar(const TDesC &)

IMPORT_C TBool SetPredictiveChineseChar ( const TDesC & aChar )

Selects Chinese character (meaning that user has accepted character to be inserted into editor). Predictive candidate lists will be updated with Chinese characters associated to selected character. Associated charcaters can be accessed via ... CandidatePage() -methods. Return value can be ignored in current implementation.

Since
S60 V2.6

Parameters

const TDesC & aChar A character to be selected.

SetReordering(TBool)

IMPORT_C TInt SetReordering ( TBool aStatus )

Turns reordering feature on or off. This method can be used only if active core object supports reordering feature. It is also possible that core object supports reordering feature, but it can't be turned off. Reordeing feature keeps track of usage frequency for entered words and promotes most frequently used words in the candidate list. Details depend on underlying prediction engine.

Since
S60 V2.6

Parameters

TBool aStatus New status for reordering feature.

SetToneMark(TInt)

IMPORT_C TBool SetToneMark ( TInt aToneMark )

Sets tone mark directly. This method is used if client wants to override default core dependant tone mark set or traditional cycle-through tone mark system doesn't suit its porposes.

Since
S60 V2.8

Parameters

TInt aToneMark Tone mark to be set.

ToneMark(TText &)

IMPORT_C TBool ToneMark ( TText & aToneMark ) const

Returns unicode value for current tone mark.

Since
S60 V2.6

Parameters

TText & aToneMark resulting tone mark is store here.

WriteSecondaryDataFileL(TUid, TInt, HBufC8 *)

IMPORT_C void WriteSecondaryDataFileL ( TUid aCoreUid,
TInt aIndexNumber,
HBufC8 * aData
)

Creates secondary data file for given core object. Existing file will be overwritten. This data file may contain any additional data that the core object needs to store between sessions (for example used word dictionary, if the engine keeps reordering data in separate memory area).

Since
S60 V3.0

Parameters

TUid aCoreUid Uid number for requesting core object.
TInt aIndexNumber Index number. Core object may use this parameter for numerating data files if it needs more than one of then. Otherwise zero.
HBufC8 * aData

Member Data Documentation

CPtiEngineImpl * iImpl

CPtiEngineImpl * iImpl [private]