CPtiEngine Class Reference

API published in: S60 3rd Ed

Link against: ptiengine.lib

Capability Information

Required Capabilities

None


#include <ptiengine.h>

Detailed Description

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 for 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')

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".


Public Member Functions

IMPORT_C  ~CPtiEngine ()
  Destructor.
IMPORT_C TInt  ActivateLanguageL (TInt aEpocLanguageID, TPtiEngineInputMode aMode=EPtiEngineInputModeNone)
  Activates language in requested input mode.
IMPORT_C void  CloseCurrentLanguageL ()
  Closes current active language.
IMPORT_C MPtiCoreInfo CoreInfo (TPtiEngineInputMode aMode) const
  Returns core info struct for given input mode.
IMPORT_C MPtiLanguage CurrentLanguage ()
  Returns pointer to constant language object representing currently active language.
IMPORT_C MPtiLanguage GetLanguage (TInt aCode) const
  Returns pointer to constant language object representing given language code.
IMPORT_C TInt  NumberOfCandidates ()
  Returns number of candidate words for current input sequence.
IMPORT_C TPtrC  AppendKeyPress (TPtiKey aKey)
  This method handles key press and forwards it to right core depending on currently selected language and input mode.
IMPORT_C TPtrC  DeleteKeyPress ()
  Deletes last character in current word buffer and updates candidate list accordingly.
IMPORT_C TInt  AddCoreL (const TDesC &aFileName, TBool aUseDefaultUserDictionary=EFalse)
  DEPRECATED (will leave if called).
IMPORT_C TInt  AddCoreL (const TUid aCoreUid, TBool aUseDefaultUserDictionary=EFalse)
  Loads and constructs new core object.
IMPORT_C TInt  GetCandidateListL (CDesCArray &aList)
  Returns list of candidate words for current input sequence.
IMPORT_C TInt  GetNextWordCandidateListL (CDesCArray &aList)
  Returns next word candidate list.
IMPORT_C TPtrC  FirstCandidate ()
  Returns pointer to first word in candidate list.
IMPORT_C TPtrC  NextCandidate ()
  Returns pointer to next word in candidate list.
IMPORT_C TPtrC  PreviousCandidate ()
  Returns pointer to previous word in candidate list.
IMPORT_C TInt  SetInputMode (TPtiEngineInputMode aMode)
  Activates given input mode for current language.
IMPORT_C TPtiEngineInputMode  InputMode () const
  Returns current input mode.
IMPORT_C TInt  SetReordering (TBool aStatus)
  Turns reordering feature on or off.
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.
IMPORT_C TPtrC  CurrentWord ()
  Returns pointer to current word buffer.
IMPORT_C void  ClearCurrentWord ()
  Clears current word buffer.
IMPORT_C void  SetCase (TPtiTextCase aCase)
  Sets text case.
IMPORT_C TPtiTextCase  Case () const
  Returns current text case.
IMPORT_C void  GetAvailableLanguagesL (CArrayFix< TInt > *aResult)
  Returns list of available languages.
IMPORT_C void  GetAvailableLanguagesL (RArray< TInt > &aResult)
  Returns list of available languages.
IMPORT_C TInt  NumberOfLanguages () const
  Returns number of available languages.
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 currently active core object for requested input mode.
IMPORT_C MPtiUserDictionary AttachUserDictionaryL (TDesC &aFileName)
  Attach user dictionary in given file to core for given input mode.
IMPORT_C MPtiUserDictionary AttachDefaultUserDictionaryL (TUid aCoreUid, TInt aSymbolClass)
  Attach default user dictionary for input mode.
IMPORT_C TInt  DetachUserDictionary (TDesC &aFileName)
  Detaches currently attached user dictionary.
IMPORT_C TInt  DetachUserDictionary (TInt aId)
  Detaches currently attached user dictionary.
IMPORT_C void  GetLocalizedLanguageName (TInt aLangCode, TDes &aResult)
  Returns localized language name for given language.
IMPORT_C TInt  CommitCurrentWord ()
  Commits current word.
IMPORT_C TInt  CharConversion (TPtiCharConversion aType, TAny *aInput, TInt aInputLength, TAny *aOutput)
  Converts given string of characters to one coding system to another.
IMPORT_C TUint32  AvailableCharConversions () const
  Returns value indicating currently available character conversions.
IMPORT_C TInt  SetExternalKeyMapL (TPtiEngineInputMode aMode, TPtiKey aKey, TDesC &aKeyMap, TPtiTextCase aCase)
  Replaces key map for single key.
IMPORT_C TPtiKey  LastEnteredKey () const
  Returns last entered key press.
IMPORT_C TPtrC8  CurrentInputSequence () const
  Returns current input sequence (a list of key presses).
IMPORT_C TInt  GetSpelling (TUint16 aInput, TDes &aOutput, TPtiSpelling aType)
  Returns alternate spelling for given character.
IMPORT_C TInt  CancelTimerActivity ()
  Front end processeor uses this method for indicating PtiEngine that all key press related timers should be canceled.
IMPORT_C TPtiKey  CharacterToKey (TUint16 aChar)
  Returns key for given character.
IMPORT_C TInt  AddUserDictionaryEntry (MPtiUserDictionaryEntry &aEntry)
  Adds new entry (in most cases a word) to default user dictionary of currently active core object.
IMPORT_C TInt  AddUserDictionaryEntry (MPtiUserDictionaryEntry &aEntry, TInt aId)
  Adds entry to specific user dictionary.
IMPORT_C TInt  RemoveEntryFromUserDictionary (MPtiUserDictionaryEntry &aEntry)
  Removes entry from default user dictionary of currently active core object.
IMPORT_C TInt  RemoveEntryFromUserDictionary (MPtiUserDictionaryEntry &aEntry, TInt aId)
  Removes word from specific user dictionary.
IMPORT_C TInt  NumberOfEntriesInUserDictionary ()
  Returns number of entries in default user dictionary.
IMPORT_C TInt  GetUserDictionaryEntry (TInt aIndex, MPtiUserDictionaryEntry &aResult)
  Returns entry for given index in default user dictionary.
IMPORT_C MPtiUserDictionary DefaultUserDictionary (TPtiEngineInputMode aMode)
  Returns default user dictionary for given input mode.
IMPORT_C void  SetObserver (MPtiObserver *aObserver)
  Sets observer.
IMPORT_C MPtiObserver Observer ()
  Returns current observer.
IMPORT_C TInt  HandleCommandL (TPtiEngineCommand aCommand, TAny *aParams=NULL)
  General command handling method.
IMPORT_C TPtrC  CandidatePage ()
  Returns pointer to current Chinese candidate page.
IMPORT_C TBool  NextCandidatePage ()
  Changes to next Chinese candidate page.
IMPORT_C TBool  PreviousCandidatePage ()
  Changes to previous Chinese candidate page.
IMPORT_C TBool  MoreCandidatePages ()
  Returns a boolean value indicating whether there are more candidate pages available.
IMPORT_C void  SetCandidatePageLength (TInt aLength)
  Sets length of Chinese candidate page.
IMPORT_C TPtrC  GetPhoneticSpelling (TInt aIndex) const
  Returns phonetic spelling for current input.
IMPORT_C TInt  PhoneticSpellingCount () const
  Returns a value specifying how many phonetic spellings there is available for current input.
IMPORT_C TBool  SelectPhoneticSpelling (TInt aIndex)
  Selects given phonetic spelling for current input.
IMPORT_C TInt  SelectedPhoneticSpelling () const
  Returns the index of currently selected phonetic spelling.
IMPORT_C void  EnableToneMarks (TBool aValue)
  Enables or disables tone marks.
IMPORT_C void  ResetToneMark ()
  Resets tone mark.
IMPORT_C TBool  ToneMark (TText &aToneMark) const
  Returns unicode value for current tone mark.
IMPORT_C TBool  IsToneMarkValidForSpelling () const
  Returns boolean value indicating whether current tone mark is valid for spelling.
IMPORT_C TBool  IncrementToneMark (TBool aOverrideInvalid)
  Cycles to next tone mark in core related tone mark list.
IMPORT_C TBool  SetPredictiveChineseChar (const TDesC &aChar)
  Selects Chinese character (meaning that user has accepted character to be inserted into editor).
IMPORT_C MPtiEngineCompositionDataInterface CompositionData ()
  Returns pointer to composition data interface (used with Japanese input).
IMPORT_C TPtrC  ReadingTextL ()
  Returns reading text for Japanese input.
IMPORT_C void  GetModeNameIndexL (TPtiChineseVariant aVariant, RArray< TInt > &aResult)
  Returns mode name index table for given Chinese variant.
IMPORT_C TInt  GetPhoneticSpellingsL (CDesCArray &aList)
  Fills list with all the phonetic spellings for current input sequence.
IMPORT_C TInt  GetChinesePhraseCandidatesL (CDesCArray &aList)
  Fills list with phrase candidates for currently selected phonetic spelling.
IMPORT_C TBool  SetToneMark (TInt aToneMark)
  Sets tone mark directly.
TBool  IsQwertyBasedMode (TPtiEngineInputMode aMode) const
  A convinience method for cheking qwerty based input mode.
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.
IMPORT_C void  WriteSecondaryDataFileL (TUid aCoreUid, TInt aIndexNumber, HBufC8 *aData)
  Creates secondary data file for given core object.
IMPORT_C HBufC8 *  ReadSecondaryDataFileL (TUid aCoreUid, TInt aIndexNumber)
  Returns a heap buffer containing data from given secondary data file.
IMPORT_C void  MappingDataForKey (TPtiKey aKey, TDes &aResult, TPtiTextCase aCase)
  Returns keymapping data for given key.
IMPORT_C void  GetNumericModeKeysForQwertyL (TInt aLanguage, RArray< TPtiNumericKeyBinding > &aResult)
  Qwerty input mode has different keymapping layout for each language.
IMPORT_C HBufC *  GetCandidatesByInputString (const TDesC &aInputString, RPointerArray< HBufC > &aList, const TBool aIsPredictive)
IMPORT_C MPtiHwrRecognizer *  GetHwrRecognizerL (TLanguage aLanguage)
  Get first hwr implementation support the specified language.
IMPORT_C MPtiHwrRecognizer *  GetHwrRecognizerL (TInt aImpId)
  Get hwr implementation by give implementation uid.
IMPORT_C RArray< TUid > &  ListHwrRecognizerL (TLanguage aLanguage)
  Get hwr implementation uid list which support given language.
IMPORT_C void  GetHwrAvailableLanguagesL (RArray< TInt > &aResult)
  Get hwr available languages list.

Static Public Member Functions

static IMPORT_C CPtiEngine NewL (TBool aUseDefaultUserDictionary=EFalse)
  Two phase constructor.
static IMPORT_C CPtiEngine NewL (const TDesC &aCoreName, TBool aUseDefaultUserDictionary=EFalse)
  Two phase constructor.
static IMPORT_C CPtiEngine NewL (const TUid aCoreUid, TBool aUseDefaultUserDictionary=EFalse)
  Two phase constructor.

Constructor & Destructor Documentation

IMPORT_C CPtiEngine::~CPtiEngine  ) 
 

Destructor.


Member Function Documentation

IMPORT_C TInt CPtiEngine::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.

Parameters:
aEpocLanguageID  Language to be activated.
aMode  Input mode after activation. If thise is left to default value, then default input mode is activated.
Returns:
KErrNone if success or system wide error code.
IMPORT_C TInt CPtiEngine::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.

Parameters:
aCoreUid  Uid for core plugin.
aUseDefaultUserDictionary  ....
Returns:
KErrNone if operation was successful or system wide error code.
IMPORT_C TInt CPtiEngine::AddCoreL const TDesC &  aFileName,
TBool  aUseDefaultUserDictionary = EFalse
 

DEPRECATED (will leave if called).

IMPORT_C TInt CPtiEngine::AddUserDictionaryEntry MPtiUserDictionaryEntry aEntry,
TInt  aId
 

Adds entry to specific user dictionary.

Parameters:
aEntry  An entry to be added to dictionary.
aId  User dictionary id.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::AddUserDictionaryEntry MPtiUserDictionaryEntry aEntry  ) 
 

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

Parameters:
aEntry  An entry to be added to dictionary.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TPtrC CPtiEngine::AppendKeyPress TPtiKey  aKey  ) 
 

This method handles key press and forwards it to right core depending on currently selected 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.

Parameters:
aKey  Key code.
Returns:
Pointer to current word buffer.
IMPORT_C MPtiUserDictionary* CPtiEngine::AttachDefaultUserDictionaryL TUid  aCoreUid,
TInt  aSymbolClass
 

Attach default user dictionary for input mode.

Parameters:
aCoreUid  Uid for owner core object.
aSymbolClass  Symbol class for udb data.
Returns:
Pointer to user dictionary object. NULL if failure.
IMPORT_C MPtiUserDictionary* CPtiEngine::AttachUserDictionaryL TDesC &  aFileName  ) 
 

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

Parameters:
aFileName  User dictionary file name.
Returns:
Pointer to user dictionary object. NULL if failure.
IMPORT_C TUint32 CPtiEngine::AvailableCharConversions  )  const
 

Returns value indicating currently available character conversions.

Returns:
Currently available character conversions. There is a bit set for each available char conversion. See definition of TPtiCharConversion.
IMPORT_C TInt CPtiEngine::CancelTimerActivity  ) 
 

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

Returns:
KErrNone if timers were successfully canceled. KErrNotFound if no active timers were found.
IMPORT_C TPtrC CPtiEngine::CandidatePage  ) 
 

Returns pointer to current Chinese candidate page.

Returns:
Pointer to current Chinese candidate page.
IMPORT_C TPtiTextCase CPtiEngine::Case  )  const
 

Returns current text case.

Returns:
Current text case.
IMPORT_C TPtiKey CPtiEngine::CharacterToKey TUint16  aChar  ) 
 

Returns key for given character.

Returned key depends on current language and input mode.

Parameters:
aChar  Requested character.
Returns:
Key for requested character. EPtiKeyNone if no key was found for given character.
IMPORT_C TInt CPtiEngine::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.

Parameters:
aType  Requested conversion type.
aInput  Input string. This parameter may point to either 8-bit or 16-bit data depending on conversion type.
aInputLength  Number of characters in input string.
aOutput  Output string. This parameter may pint to either 8-bit or 16-bit data depending on conversion type.
IMPORT_C void CPtiEngine::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.

IMPORT_C void CPtiEngine::CloseCurrentLanguageL  ) 
 

Closes current 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.

IMPORT_C TInt CPtiEngine::CommitCurrentWord  ) 
 

Commits current word.

Commiting means that core object is informed that current word was accepted to be part of edited text. Word buffer is cleared. Either this method or ClearCurrentWord() must be called before starting a new word.

Returns:
KErrNone if success. KErrNoActiveLanguage if no active language.
IMPORT_C MPtiEngineCompositionDataInterface* CPtiEngine::CompositionData  ) 
 

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

Returns:
Pointer to composition data interface.
IMPORT_C MPtiCoreInfo* CPtiEngine::CoreInfo TPtiEngineInputMode  aMode  )  const
 

Returns core info struct for given input mode.

Core depends on current language.

Returns:
Pointer to core info object. NULL if core for given input mode was not found.
IMPORT_C void CPtiEngine::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.

Parameters:
aCoreUid  Uid for requesting core object.
aSymbolClass  Symbol class for udb data.
IMPORT_C TInt CPtiEngine::CreateUserDictionaryL TDesC &  aFileName,
CDesCArrayFlat *  aWords,
TPtiEngineInputMode  aMode
 

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

Active language must support requested input mode.

Parameters:
aFileName  File name for new user dictionary.
aWords  A list of words to be inserted to new user dictionary.
aMode  Input mode for core object.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TPtrC8 CPtiEngine::CurrentInputSequence  )  const
 

Returns current input sequence (a list of key presses).

Bytes in returned descriptor are TPtiKey enum values.

Returns:
a descriptor containing current input sequence.
IMPORT_C MPtiLanguage* CPtiEngine::CurrentLanguage  ) 
 

Returns pointer to constant language object representing currently active language.

Returns:
Pointer to currently active language object.
IMPORT_C TPtrC CPtiEngine::CurrentWord  ) 
 

Returns pointer to current word buffer.

Returns:
Pointer to current word buffer.
IMPORT_C MPtiUserDictionary* CPtiEngine::DefaultUserDictionary TPtiEngineInputMode  aMode  ) 
 

Returns default user dictionary for given input mode.

Returns:
User dictionary for given input mode. NULL if wasn't found.
IMPORT_C TPtrC CPtiEngine::DeleteKeyPress  ) 
 

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

Returns:
Pointer to current word buffer.
IMPORT_C TInt CPtiEngine::DetachUserDictionary TInt  aId  ) 
 

Detaches currently attached user dictionary.

Parameters:
aId  User dictionary id.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::DetachUserDictionary TDesC &  aFileName  ) 
 

Detaches currently attached user dictionary.

Parameters:
aFileName  User dictionary file name.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C void CPtiEngine::EnableToneMarks TBool  aValue  ) 
 

Enables or disables tone marks.

Parameters:
aValue  A boolean value specifying whether tone marks will be on or off.
IMPORT_C TPtrC CPtiEngine::FirstCandidate  ) 
 

Returns pointer to first word in candidate list.

If there isn't any candidate words the returned pointer will point to empty descriptor.

Returns:
Pointer to first word in candidate list.
IMPORT_C void CPtiEngine::GetAvailableLanguagesL RArray< TInt > &  aResult  ) 
 

Returns list of available languages.

Parameters:
aResult  List to be filled with language codes.
IMPORT_C void CPtiEngine::GetAvailableLanguagesL CArrayFix< TInt > *  aResult  ) 
 

Returns list of available languages.

Parameters:
aResult  List to be filled with language codes.
IMPORT_C TInt CPtiEngine::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.

Parameters:
aList  a list to be filled with candidate words.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C HBufC* CPtiEngine::GetCandidatesByInputString const TDesC &  aInputString,
RPointerArray< HBufC > &  aList,
const TBool  aIsPredictive
 
IMPORT_C TInt CPtiEngine::GetChinesePhraseCandidatesL CDesCArray &  aList  ) 
 

Fills list with phrase candidates for currently selected phonetic spelling.

Parameters:
aList  A descriptor list to be filled with phrase candidates. Any previous items in aList are cleared.
Returns:
Number of items in list.
IMPORT_C void CPtiEngine::GetHwrAvailableLanguagesL RArray< TInt > &  aResult  ) 
 

Get hwr available languages list.

Parameters:
aResult  Carry the hwr available languages list on return
Returns:
None
IMPORT_C MPtiHwrRecognizer* CPtiEngine::GetHwrRecognizerL TInt  aImpId  ) 
 

Get hwr implementation by give implementation uid.

Parameters:
aImpId  Given specific implementation uid
Returns:
The pointer points to hwr implementation instance
IMPORT_C MPtiHwrRecognizer* CPtiEngine::GetHwrRecognizerL TLanguage  aLanguage  ) 
 

Get first hwr implementation support the specified language.

Parameters:
aLanguage  The language that hwr implementation supported
Returns:
The pointer points to hwr implementation instance
IMPORT_C MPtiLanguage* CPtiEngine::GetLanguage TInt  aCode  )  const
 

Returns pointer to constant language object representing given language code.

Parameters:
aCode  Language code for requested language.
Returns:
Pointer to requested language object. NULL if no language for given code.
IMPORT_C void CPtiEngine::GetLocalizedLanguageName TInt  aLangCode,
TDes &  aResult
 

Returns localized language name for given language.

This method is quite inefficient (first 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 languages.

Parameters:
Epoc  language code.
Returns:
Localized language name.
IMPORT_C void CPtiEngine::GetModeNameIndexL TPtiChineseVariant  aVariant,
RArray< TInt > &  aResult
 

Returns mode name index table for given Chinese variant.

Parameters:
aVariant  Chinese variant to be queried.
aResult  Resulting index table.
IMPORT_C TInt CPtiEngine::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.

Parameters:
aList  A List to be filled with next word cadidates.
Returns:
KErrNone if list was successfully filled. KErrNotSupported if current predictive core doesn't support next word prediction or the feature is not turned on.
IMPORT_C void CPtiEngine::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.

Parameters:
aLanguage  Language id for requested mappings.
aResult  Array for storing resulting mappings.
IMPORT_C TPtrC CPtiEngine::GetPhoneticSpelling TInt  aIndex  )  const
 

Returns phonetic spelling for current input.

Parameters:
aIndex  Index of requested phonetic spelling.
Returns:
Pointer to phonetic spelling.
IMPORT_C TInt CPtiEngine::GetPhoneticSpellingsL CDesCArray &  aList  ) 
 

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

Parameters:
aList  A descriptor list to be filled with phonetic spellings. Any previous items in aList are cleared.
Returns:
Number of items in list.
IMPORT_C TInt CPtiEngine::GetSpelling TUint16  aInput,
TDes &  aOutput,
TPtiSpelling  aType
 

Returns alternate spelling for given character.

Parameters:
aInput  a character to be converted to requested spelling.
aOutput  output will be stored to this descriptor.
aType  spelling type
Returns:
KErrNone if operation was successful, KErrNotSupported if requested spelling type is not supported.
IMPORT_C TInt CPtiEngine::GetUserDictionaryEntry TInt  aIndex,
MPtiUserDictionaryEntry aResult
 

Returns entry for given index in default user dictionary.

Parameters:
aIndex  An index for requested entry.
aResult  Result will be stored here.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::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.

Parameters:
aCommand  A command to be handled.
aParams  Possible input data or parameters for command.
Returns:
KErrNone if success, otherwise an error code.
IMPORT_C TBool CPtiEngine::IncrementToneMark TBool  aOverrideInvalid  ) 
 

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

Parameters:
aOverrideInvalid  Indicates whether invalid tone marks should be skipped.
Returns:
ETrue If new tone mark was found and set. EFalse Otherwise.
IMPORT_C TPtiEngineInputMode CPtiEngine::InputMode  )  const
 

Returns current input mode.

Returns:
Current input mode.
TBool CPtiEngine::IsQwertyBasedMode TPtiEngineInputMode  aMode  )  const [inline]
 

A convinience method for cheking qwerty based input mode.

Parameters:
aMode  Input mode to be checked.
Returns:
ETrue If aMode is qwerty based input mode. EFalse Otherwise.
IMPORT_C TBool CPtiEngine::IsToneMarkValidForSpelling  )  const
 

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

Returns:
ETrue if tone mark is valid for spelling. EFalse otherwise
IMPORT_C TPtiKey CPtiEngine::LastEnteredKey  )  const
 

Returns last entered key press.

Returns:
last entered key press.
IMPORT_C RArray<TUid>& CPtiEngine::ListHwrRecognizerL TLanguage  aLanguage  ) 
 

Get hwr implementation uid list which support given language.

Parameters:
aLanguage  The language that hwr implementation supported
Returns:
The array of implementation uid list
IMPORT_C void CPtiEngine::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.

Parameters:
aKey  A key to be queried.
aResult  Resulting mapping data.
IMPORT_C TBool CPtiEngine::MoreCandidatePages  ) 
 

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

Returns:
ETrue if there are more candidate pages available. EFalse otherwise.
static IMPORT_C CPtiEngine* CPtiEngine::NewL const TUid  aCoreUid,
TBool  aUseDefaultUserDictionary = EFalse
[static]
 

Two phase constructor.

Parameters:
aCoreUid 
aUseDefaultUserDictionary 
Returns:
static IMPORT_C CPtiEngine* CPtiEngine::NewL const TDesC &  aCoreName,
TBool  aUseDefaultUserDictionary = EFalse
[static]
 

Two phase constructor.

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

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

Two phase constructor.

Parameters:
aUseDefaultUserDictionary 
Returns:
IMPORT_C TPtrC CPtiEngine::NextCandidate  ) 
 

Returns pointer to next word in candidate list.

Cycles over to the first candidate in the list after reaching the last candidate. When that happens, the framework calls MPtiObserver::FirstWordInSelectionList() for an observer given with CPtiEngine::SetObserver()

Returns:
Pointer to next word in candidate list.
IMPORT_C TBool CPtiEngine::NextCandidatePage  ) 
 

Changes to next Chinese candidate page.

Returns:
ETrue if success. EFalse if there are no more candidate pages.
IMPORT_C TInt CPtiEngine::NumberOfCandidates  ) 
 

Returns number of candidate words for current input sequence.

Returns:
number of cadidate words.
IMPORT_C TInt CPtiEngine::NumberOfEntriesInUserDictionary  ) 
 

Returns number of entries in default user dictionary.

Returns:
Number of entries in default user dictionary. KErrNotSupported if core can't return requested value.
IMPORT_C TInt CPtiEngine::NumberOfLanguages  )  const
 

Returns number of available languages.

Returns:
Number of available languages.
IMPORT_C MPtiObserver* CPtiEngine::Observer  ) 
 

Returns current observer.

Returns:
Pointer to current observer object.
IMPORT_C TInt CPtiEngine::PhoneticSpellingCount  )  const
 

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

Returns:
Number of phonetic spellings available for current input.
IMPORT_C TPtrC CPtiEngine::PreviousCandidate  ) 
 

Returns pointer to previous word in candidate list.

Cycles over to the last candidate in the list after reaching the first candidate. When that happens, the framework calls MPtiObserver::LastWordInSelectionList() for an observer given with CPtiEngine::SetObserver().

Returns:
Pointer to previous word in candidate list.
IMPORT_C TBool CPtiEngine::PreviousCandidatePage  ) 
 

Changes to previous Chinese candidate page.

Returns:
ETrue if success. EFalse if current candidate page is first.
IMPORT_C TPtrC CPtiEngine::ReadingTextL  ) 
 

Returns reading text for Japanese input.

Returns:
Reading text for Japanese input.
IMPORT_C HBufC8* CPtiEngine::ReadSecondaryDataFileL TUid  aCoreUid,
TInt  aIndexNumber
 

Returns a heap buffer containing data from given secondary data file.

Returns null if file is not found.

Parameters:
aCoreUid  Uid number for requesting core object.
aIndexNumber  Index number (see CreateDefaultUserDictionaryFileL).
Returns:
A heap buffer conataining requested data. NULL if file not found.
IMPORT_C TInt CPtiEngine::RemoveEntryFromUserDictionary MPtiUserDictionaryEntry aEntry,
TInt  aId
 

Removes word from specific user dictionary.

Parameters:
aEntry  an entry to be removed from default dictionary.
aId  User dictionary id.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::RemoveEntryFromUserDictionary MPtiUserDictionaryEntry aEntry  ) 
 

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

Parameters:
aEntry  an entry to be removed from default dictionary.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C void CPtiEngine::ResetToneMark  ) 
 

Resets tone mark.

IMPORT_C TInt CPtiEngine::SelectedPhoneticSpelling  )  const
 

Returns the index of currently selected phonetic spelling.

Returns:
The index of currently selected phonetic spelling. Returned value is negative if there isn't phonetic spelling available.
IMPORT_C TBool CPtiEngine::SelectPhoneticSpelling TInt  aIndex  ) 
 

Selects given phonetic spelling for current input.

Parameters:
aIndex  Index of requested phonetic spelling.
IMPORT_C void CPtiEngine::SetCandidatePageLength TInt  aLength  ) 
 

Sets length of Chinese candidate page.

Parameters:
aLength  Length of Chinese candidate page.
IMPORT_C void CPtiEngine::SetCase TPtiTextCase  aCase  ) 
 

Sets text case.

Parameters:
aCase  Text case to be set. Either EPtiCaseUpper or EPtiCaseLower.
IMPORT_C TInt CPtiEngine::SetCurrentWord TPtrC  aWord  ) 
 

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

Parameters:
aWord  a word to be set as current word.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::SetExternalKeyMapL TPtiEngineInputMode  aMode,
TPtiKey  aKey,
TDesC &  aKeyMap,
TPtiTextCase  aCase
 

Replaces key map for single key.

Parameters:
aMode  Input mode of key map.
aKey  Key to be replaced.
aKeyMap  New key sequence for aKey.
Returns:
KErrNone if success, otherwise system wide error code.
IMPORT_C TInt CPtiEngine::SetInputMode TPtiEngineInputMode  aMode  ) 
 

Activates given input mode for current language.

Parameters:
aMode  requested input mode.
Returns:
KErrNone if input mode was activated. KErrNoSuitableCore if current language doesn't support requested input mode.
IMPORT_C void CPtiEngine::SetObserver MPtiObserver aObserver  ) 
 

Sets observer.

Parameters:
aObserver  A observer to be set.
IMPORT_C TBool CPtiEngine::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.

Parameters:
aChar  A character to be selected.
Returns:
Please ignore the return value.
IMPORT_C TInt CPtiEngine::SetReordering TBool  aStatus  ) 
 

Turns reordering feature on or off.

This method can be used only if currently 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 makes it possible for most frequently used words to have higher priority in candidate list. Details depend on underlying prediction engine.

Parameters:
aStatus  New status for reordering feature.
Returns:
KErrNone if success, otherwise an error code.
IMPORT_C TBool CPtiEngine::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.

Parameters:
aToneMark  Tone mark to be set.
Returns:
ETrue if tone mark was legal, ie. produced candidates. EFalse otherwise.
IMPORT_C TBool CPtiEngine::ToneMark TText &  aToneMark  )  const
 

Returns unicode value for current tone mark.

Parameters:
aToneMark  resulting tone mark is store here.
Returns:
ETrue if tone mark was available. EFalse otherwise.
IMPORT_C void CPtiEngine::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).

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

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top