williamr@2: /* williamr@2: * Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0"" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Predective text input engine API header williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef _PTI_ENGINE_H williamr@2: #define _PTI_ENGINE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include "PtiDefs.h" williamr@2: #include "PtiObserver.h" williamr@2: #include "PtiLanguage.h" williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CPtiUserDictionary; williamr@2: class MPtiUserDictionary; williamr@2: class MPtiEngineCompositionDataInterface; williamr@2: class MPtiUserDictionaryEntry; williamr@2: class CPtiEngineImpl; williamr@2: class MPtiHwrRecognizer; williamr@2: williamr@2: /** williamr@2: * CPtiEngine class. williamr@2: * williamr@2: * This is the main client side API for PtiEngine. The purpose of PtiEngine API is williamr@2: * to provide a single calling point for low level (below UI) text input functionality. williamr@2: * The API provides methods for querying and activating installed input languages, changing williamr@2: * input modes and text cases and performing text input operations. The API contains williamr@2: * set of methods for latin based, Chinese and Japanese text input. Some of the methods williamr@2: * are common to all of those variants. PtiEngine also provides access to predictive williamr@2: * text input functionality, in case there is need to use it directly without williamr@2: * standard CEikEdwin / FEP chain (hence the name 'predictive text input engine') williamr@2: * Predictive text engine integration is hidden behind PtiCore plugin API and is used williamr@2: * through PtiEngine main API. williamr@2: * williamr@2: * Usage: williamr@2: * PtiEngine is created by calling CPtiEngine::NewL method. In typical use case williamr@2: * there is no need to pass core uid parameter to NewL method. williamr@2: * Constructor will load and set up available core objects. williamr@2: * williamr@2: * Typical use cases: williamr@2: * williamr@2: * Entering text in latin multitapping mode williamr@2: * ---------------------------------------- williamr@2: * williamr@2: * CPtiEngine* aEngine = CPtiEngine::NewL(); williamr@2: * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping); williamr@2: * aEngine->AppendKeyPress(EPtiKey3); williamr@2: * aEngine->AppendKeyPress(EPtiKey6); williamr@2: * aEngine->AppendKeyPress(EPtiKey6); williamr@2: * aEngine->AppendKeyPress(EPtiKey6); williamr@2: * aEngine->AppendKeyPress(EPtiKey4); williamr@2: * TBuf<100> temp; williamr@2: * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain williamr@2: * // word "dog". williamr@2: * williamr@2: * Entering text in latin predictive mode williamr@2: * -------------------------------------- williamr@2: * williamr@2: * CPtiEngine* aEngine = CPtiEngine::NewL(); williamr@2: * aEngine->ActivateLanguageL(ELangEnglish, EPtiEnginePredicitve); williamr@2: * aEngine->AppendKeyPress(EPtiKey8); williamr@2: * aEngine->AppendKeyPress(EPtiKey4); williamr@2: * aEngine->AppendKeyPress(EPtiKey4); williamr@2: * aEngine->AppendKeyPress(EPtiKey7); williamr@2: * TBuf<100> temp; williamr@2: * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain williamr@2: * // (depending on the underlying engine) williamr@2: * // word "this". williamr@2: * temp.Copy(aEngine->NextCandidate()); // Move on to next candidate. williamr@2: * aEngine->CommitCurrentWord(); // Tell engine that current word was accepted, williamr@2: * // so that the underlyinbg engine keeps williamr@2: * // frequency information up-to-date. williamr@2: * Entering text in latin qwerty mode williamr@2: * ---------------------------------- williamr@2: * williamr@2: * CPtiEngine* aEngine = CPtiEngine::NewL(); williamr@2: * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwerty); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyQ); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyW); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyE); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyR); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyT); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyY); williamr@2: * TBuf<100> temp; williamr@2: * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain williamr@2: * // word "qwerty". williamr@2: * // Next line requires that French key mappings are available in device. williamr@2: * aEngine->ActivateLanguageL(ELangFrench, EPtiEngineQwerty); williamr@2: * aEngine->SetCase(EPtiCaseUpper); williamr@2: * aEngine->ClearCurrentWord(); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyQ); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyW); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyE); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyR); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyT); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyY); williamr@2: * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain williamr@2: * // word "AZERTY". williamr@2: * williamr@2: * Entering text in preditcive latin qwerty mode williamr@2: * --------------------------------------------- williamr@2: * CPtiEngine* aEngine = CPtiEngine::NewL(); williamr@2: * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwertyPredictive); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyE); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyN); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyT); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyE); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyR); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyT); williamr@2: * aEngine->AppendKeyPress(EPtiKeyQwertyA); williamr@2: * TBuf<100> temp; williamr@2: * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain williamr@2: * // for example word "entertainment", assuming the. williamr@2: * // underlying prediction engine supports word completion. williamr@2: * williamr@2: */ williamr@2: NONSHARABLE_CLASS(CPtiEngine) : public CBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Two phase constructor. williamr@2: * williamr@2: * @param aUseDefaultUserDictionary williamr@2: * @return williamr@2: */ williamr@2: IMPORT_C static CPtiEngine* NewL(TBool aUseDefaultUserDictionary = EFalse); williamr@2: williamr@2: /** williamr@2: * Two phase constructor. williamr@2: * williamr@2: * NOTE: THIS METHOD IS DEPRECATED AND WILL LEAVE WHEN CALLED. williamr@2: */ williamr@2: IMPORT_C static CPtiEngine* NewL(const TDesC& aCoreName, TBool aUseDefaultUserDictionary = EFalse); williamr@2: williamr@2: /** williamr@2: * Two phase constructor. williamr@2: * williamr@2: * @param aCoreUid williamr@2: * @param aUseDefaultUserDictionary williamr@2: * @return williamr@2: */ williamr@2: IMPORT_C static CPtiEngine* NewL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CPtiEngine(); williamr@2: williamr@2: /** williamr@2: * Activates language in requested input mode. After calling this method williamr@2: * language is ready to be used with all input modes it supports. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aEpocLanguageID Language to be activated. williamr@2: * @param aMode Input mode after activation. If thise is left to default williamr@2: * value, then default input mode is activated. williamr@2: * @return KErrNone if success or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt ActivateLanguageL(TInt aEpocLanguageID, TPtiEngineInputMode aMode = EPtiEngineInputModeNone); williamr@2: williamr@2: /** williamr@2: * Closes active language. After calling this method there williamr@2: * won't be active language and most PtiEngine API methods williamr@2: * will return error until ActivateLanguageL is called again. williamr@2: * Core objects for active language are asked to release williamr@2: * related resources. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: */ williamr@2: IMPORT_C void CloseCurrentLanguageL(); williamr@2: williamr@2: /** williamr@2: * Returns core info structure for given input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to core info object. williamr@2: * NULL if core for given input mode was not found. williamr@2: */ williamr@2: IMPORT_C MPtiCoreInfo* CoreInfo(TPtiEngineInputMode aMode) const; williamr@2: williamr@2: /** williamr@2: * Returns pointer to currently active language. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to currently active language object. williamr@2: */ williamr@2: IMPORT_C MPtiLanguage* CurrentLanguage(); williamr@2: williamr@2: /** williamr@2: * Returns pointer to requested language. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aCode Language code for requested language. williamr@2: * @return Pointer to requested language object. williamr@2: * NULL if no language for given code. williamr@2: */ williamr@2: IMPORT_C MPtiLanguage* GetLanguage(TInt aCode) const; williamr@2: williamr@2: /** williamr@2: * Returns number of candidate words for current williamr@2: * input sequence. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return number of cadidate words. williamr@2: */ williamr@2: IMPORT_C TInt NumberOfCandidates(); williamr@2: williamr@2: /** williamr@2: * This method handles key press and forwards it to williamr@2: * correct core object depending on active language and williamr@2: * input mode. The current word buffer is updated accordingly. williamr@2: * If input sequence buffer has reached its maximum length williamr@2: * then nothing will be done. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aKey Key code. williamr@2: * @return Pointer to current word buffer. williamr@2: */ williamr@2: IMPORT_C TPtrC AppendKeyPress(TPtiKey aKey); williamr@2: williamr@2: /** williamr@2: * Deletes last character in current word buffer and updates williamr@2: * candidate list accordingly. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to current word buffer. williamr@2: */ williamr@2: IMPORT_C TPtrC DeleteKeyPress(); williamr@2: williamr@2: /** williamr@2: * DEPRECATED (will leave if called). williamr@2: */ williamr@2: IMPORT_C TInt AddCoreL(const TDesC& aFileName, TBool aUseDefaultUserDictionary = EFalse); williamr@2: williamr@2: /** williamr@2: * Loads and constructs new core object. Core object is added williamr@2: * to the list of available cores and is ready to be used williamr@2: * after that. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aCoreUid Uid for core plugin. williamr@2: * @param aUseDefaultUserDictionary .... williamr@2: * @return KErrNone if operation was successful or system williamr@2: * wide error code. williamr@2: */ williamr@2: IMPORT_C TInt AddCoreL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse); williamr@2: williamr@2: /** williamr@2: * Returns list of candidate words for current input sequence. williamr@2: * If word completion feature is on, then words accepted to williamr@2: * result list may contain more letters than the number williamr@2: * of key presses in current input sequence. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aList a list to be filled with candidate words. williamr@2: * @return KErrNone if success, otherwise system wide error williamr@2: * code. williamr@2: */ williamr@2: IMPORT_C TInt GetCandidateListL(CDesCArray& aList); williamr@2: williamr@2: /** williamr@2: * Returns next word candidate list. This method requires that williamr@2: * current core object supports next word prediction feature williamr@2: * and it is turned on. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aList A List to be filled with next word cadidates. williamr@2: * @return KErrNone if list was successfully filled. williamr@2: * KErrNotSupported if current predictive core doesn't williamr@2: * support next word prediction or williamr@2: * the feature is not turned on. williamr@2: */ williamr@2: IMPORT_C TInt GetNextWordCandidateListL(CDesCArray& aList); williamr@2: williamr@2: /** williamr@2: * Returns pointer to first word in candidate list. williamr@2: * If there isn't any candidate words the returned pointer williamr@2: * will point to empty descriptor. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to first word in candidate list. williamr@2: */ williamr@2: IMPORT_C TPtrC FirstCandidate(); williamr@2: williamr@2: /** williamr@2: * Returns pointer to next word in candidate list. williamr@2: * FirstCandidate() must be called before calling williamr@2: * this method. Returns pointer to empty descriptor if there williamr@2: * isn't more candidates available. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to next word in candidate list. williamr@2: */ williamr@2: IMPORT_C TPtrC NextCandidate(); williamr@2: williamr@2: /** williamr@2: * Returns pointer to previous word in candidate list. williamr@2: * If there isn't previous candidate available williamr@2: * (NextCandidate() wasn't succesfully called) then the williamr@2: * return value will point to an empty string. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to previous word in candidate list. williamr@2: */ williamr@2: IMPORT_C TPtrC PreviousCandidate(); williamr@2: williamr@2: /** williamr@2: * Activates requested input mode for active language. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aMode requested input mode. williamr@2: * @return KErrNone if input mode was activated. williamr@2: * KErrNotSupported if current language doesn't williamr@2: * support requested input mode. williamr@2: */ williamr@2: IMPORT_C TInt SetInputMode(TPtiEngineInputMode aMode); williamr@2: williamr@2: /** williamr@2: * Returns active input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Current input mode. williamr@2: */ williamr@2: IMPORT_C TPtiEngineInputMode InputMode() const; williamr@2: williamr@2: /** williamr@2: * Turns reordering feature on or off. This method can be used only williamr@2: * if active core object supports reordering feature. williamr@2: * It is also possible that core object supports reordering feature, williamr@2: * but it can't be turned off. Reordeing feature keeps track williamr@2: * of usage frequency for entered words and promotes most frequently williamr@2: * used words in the candidate list. Details depend on underlying williamr@2: * prediction engine. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aStatus New status for reordering feature. williamr@2: * @return KErrNone if success, otherwise an error code. williamr@2: */ williamr@2: IMPORT_C TInt SetReordering(TBool aStatus); williamr@2: williamr@2: /** williamr@2: * Fills text buffer with given word, refreshes williamr@2: * current input sequence and asks current core object williamr@2: * to update candidate list accordingly. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aWord a word to be set as current word. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetCurrentWord(TPtrC aWord); williamr@2: williamr@2: /** williamr@2: * Returns pointer to current word buffer. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to current word buffer. williamr@2: */ williamr@2: IMPORT_C TPtrC CurrentWord(); williamr@2: williamr@2: /** williamr@2: * Clears current word buffer. Calling this method means williamr@2: * that current word was reject and will not be part of edited williamr@2: * text. Either this method or CommitCurrentWord() must be called williamr@2: * before starting a new word. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: */ williamr@2: IMPORT_C void ClearCurrentWord(); williamr@2: williamr@2: /** williamr@2: * Sets text case. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aCase Text case to be set. Possible values are: williamr@2: * williamr@2: * EPtiCaseLower Normal lower text case williamr@2: * EPtiCaseUpper Normal capitalized text case williamr@2: * EPtiCaseChrLower Lower text case when Chr key is being held williamr@2: * EPtiCaseChrUpper Upper text case when Chr key is being held williamr@2: * EPtiCaseFnLower Lower text case when Fn key is being held williamr@2: * EPtiCaseFnUpper Upper text case when Fn key is being held williamr@2: */ williamr@2: IMPORT_C void SetCase(TPtiTextCase aCase); williamr@2: williamr@2: /** williamr@2: * Returns active text case. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Current text case. williamr@2: */ williamr@2: IMPORT_C TPtiTextCase Case() const; williamr@2: williamr@2: /** williamr@2: * Returns list of available input languages. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aResult List to be filled with language codes. williamr@2: */ williamr@2: IMPORT_C void GetAvailableLanguagesL(CArrayFix* aResult); williamr@2: williamr@2: /** williamr@2: * Returns list of available input languages. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aResult List to be filled with language codes. williamr@2: */ williamr@2: IMPORT_C void GetAvailableLanguagesL(RArray& aResult); williamr@2: williamr@2: /** williamr@2: * Returns number of available input languages. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Number of available languages. williamr@2: */ williamr@2: IMPORT_C TInt NumberOfLanguages() const; williamr@2: williamr@2: /** williamr@2: * Creates new user dictionary file, inserts given list of williamr@2: * words into it and attaches it to active core williamr@2: * object for requested input mode. Active language must williamr@2: * support requested input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aFileName File name for new user dictionary. williamr@2: * @param aWords A list of words to be inserted to new williamr@2: * user dictionary. williamr@2: * @param aMode Input mode for core object. williamr@2: * @return KErrNone if success, otherwise system wide error williamr@2: * code. williamr@2: */ williamr@2: IMPORT_C TInt CreateUserDictionaryL(TDesC& aFileName, CDesCArrayFlat* aWords, TPtiEngineInputMode aMode); williamr@2: williamr@2: /** williamr@2: * Attach user dictionary in given file to core for requested williamr@2: * input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aFileName User dictionary file name. williamr@2: * @return Pointer to user dictionary object. NULL if failure. williamr@2: */ williamr@2: IMPORT_C MPtiUserDictionary* AttachUserDictionaryL(TDesC& aFileName); williamr@2: williamr@2: /** williamr@2: * Attach default user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aCoreUid Uid for owner core object. williamr@2: * @param aSymbolClass Symbol class for udb data. williamr@2: * @return Pointer to user dictionary object. NULL if failure. williamr@2: */ williamr@2: IMPORT_C MPtiUserDictionary* AttachDefaultUserDictionaryL(TUid aCoreUid, TInt aSymbolClass); williamr@2: williamr@2: /** williamr@2: * Detaches currently attached user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aFileName User dictionary file name. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt DetachUserDictionary(TDesC& aFileName); williamr@2: williamr@2: /** williamr@2: * Detaches currently attached user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aId User dictionary id. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt DetachUserDictionary(TInt aId); williamr@2: williamr@2: /** williamr@2: * Returns localized language name for given language. This method williamr@2: * is quite inefficient (always reads name table from resource file), williamr@2: * when possible use Getlanguage()->LocalizedName() instead. williamr@2: * This method can be used also when requested language is williamr@2: * not among available input languages. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param Epoc language code. williamr@2: * @return Localized language name. williamr@2: */ williamr@2: IMPORT_C void GetLocalizedLanguageName(TInt aLangCode, TDes& aResult); williamr@2: williamr@2: /** williamr@2: * Commits current word. Commiting means that core object is isntructed williamr@2: * to end inline editing operation and accepted active word as part of edited williamr@2: * text. Core object may then update frequency information, add unrecognized williamr@2: * word to user dictioary or perform any other operation related to commiting a word. williamr@2: * Word buffer is cleared. Either this method or ClearCurrentWord() must williamr@2: * be called before starting a new word. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return KErrNone if success. williamr@2: * KErrNoActiveLanguage if no active language. williamr@2: */ williamr@2: IMPORT_C TInt CommitCurrentWord(); williamr@2: williamr@2: /** williamr@2: * Converts given string of characters to one coding williamr@2: * system to another. See definition of TPtiCharConversion williamr@2: * for list of supported conversion types. It is possible williamr@2: * that only a small subset of supported conversion types williamr@2: * is actually available at run time (that depends on williamr@2: * available core objects). AvailableCharConversions() williamr@2: * method can be used for querying available conversion williamr@2: * types before using this method. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aType Requested conversion type. williamr@2: * @param aInput Input string. This parameter may point to williamr@2: * either 8-bit or 16-bit data depending williamr@2: * on conversion type. williamr@2: * @param aInputLength Number of characters in input string. williamr@2: * @param aOutput Output string. This parameter may pint to williamr@2: * either 8-bit or 16-bit data depending williamr@2: * on conversion type. williamr@2: */ williamr@2: IMPORT_C TInt CharConversion(TPtiCharConversion aType, williamr@2: TAny* aInput, williamr@2: TInt aInputLength, williamr@2: TAny* aOutput); williamr@2: williamr@2: /** williamr@2: * Returns value indicating currently available williamr@2: * character conversions. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Currently available character conversions. There williamr@2: * is a bit set for each available char conversion. williamr@2: * See definition of TPtiCharConversion. williamr@2: */ williamr@2: IMPORT_C TUint32 AvailableCharConversions() const; williamr@2: williamr@2: /** williamr@2: * Replaces key map for single key. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aMode Input mode of key map. williamr@2: * @param aKey Key to be replaced. williamr@2: * @param aKeyMap New key sequence for aKey. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetExternalKeyMapL(TPtiEngineInputMode aMode, williamr@2: TPtiKey aKey, williamr@2: TDesC& aKeyMap, williamr@2: TPtiTextCase aCase); williamr@2: williamr@2: /** williamr@2: * Returns last entered key press. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return last entered key press. williamr@2: */ williamr@2: IMPORT_C TPtiKey LastEnteredKey() const; williamr@2: williamr@2: /** williamr@2: * Returns current input sequence (a list of key presses). williamr@2: * Bytes in returned descriptor are TPtiKey enum values. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return a descriptor containing current input sequence. williamr@2: */ williamr@2: IMPORT_C TPtrC8 CurrentInputSequence() const; williamr@2: williamr@2: /** williamr@2: * Returns alternate spelling for given character. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aInput a character to be converted to requested spelling. williamr@2: * @param aOutput output will be stored to this descriptor. williamr@2: * @param aType spelling type williamr@2: * @return KErrNone if operation was successful, williamr@2: * KErrNotSupported if requested spelling type is not supported. williamr@2: */ williamr@2: IMPORT_C TInt GetSpelling(TUint16 aInput, TDes& aOutput, TPtiSpelling aType); williamr@2: williamr@2: /** williamr@2: * Front end processeor uses this method for indicating williamr@2: * PtiEngine that all key press related timers should be williamr@2: * canceled. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return KErrNone if timers were successfully canceled. williamr@2: * KErrNotFound if no active timers were found. williamr@2: */ williamr@2: IMPORT_C TInt CancelTimerActivity(); williamr@2: williamr@2: /** williamr@2: * Returns key for given character. Returned key williamr@2: * depends on current language and input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aChar Requested character. williamr@2: * @return Key for requested character. EPtiKeyNone if williamr@2: * no key was found for given character. williamr@2: */ williamr@2: IMPORT_C TPtiKey CharacterToKey(TUint16 aChar); williamr@2: williamr@2: /** williamr@2: * Adds new entry (in most cases a word) to default user dictionary of williamr@2: * currently active core object. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aEntry An entry to be added to dictionary. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry); williamr@2: williamr@2: /** williamr@2: * Adds entry to specific user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aEntry An entry to be added to dictionary. williamr@2: * @param aId User dictionary id. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry, TInt aId); williamr@2: williamr@2: /** williamr@2: * Removes entry from default user dictionary of currently active core williamr@2: * object. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aEntry an entry to be removed from default dictionary. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry); williamr@2: williamr@2: /** williamr@2: * Removes word from specific user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aEntry an entry to be removed from default dictionary. williamr@2: * @param aId User dictionary id. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry, TInt aId); williamr@2: williamr@2: /** williamr@2: * Returns number of entries in default user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Number of entries in default user dictionary. williamr@2: * KErrNotSupported if core can't return requested value. williamr@2: */ williamr@2: IMPORT_C TInt NumberOfEntriesInUserDictionary(); williamr@2: williamr@2: /** williamr@2: * Returns entry for given index in default user dictionary. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aIndex An index for requested entry. williamr@2: * @param aResult Result will be stored here. williamr@2: * @return KErrNone if success, otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt GetUserDictionaryEntry(TInt aIndex, MPtiUserDictionaryEntry& aResult); williamr@2: williamr@2: /** williamr@2: * Returns default user dictionary for given input mode. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return User dictionary for given input mode. williamr@2: * NULL if wasn't found. williamr@2: */ williamr@2: IMPORT_C MPtiUserDictionary* DefaultUserDictionary(TPtiEngineInputMode aMode); williamr@2: williamr@2: /** williamr@2: * Sets observer. See PtiObserver.h for observer API details. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aObserver A observer to be set. williamr@2: */ williamr@2: IMPORT_C void SetObserver(MPtiObserver* aObserver); williamr@2: williamr@2: /** williamr@2: * Returns current observer. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to current observer object. williamr@2: */ williamr@2: IMPORT_C MPtiObserver* Observer(); williamr@2: williamr@2: /** williamr@2: * General command handling method. This method can be used for williamr@2: * controlling core objects that require more information than williamr@2: * just sequence of key presses. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aCommand A command to be handled. williamr@2: * @param aParams Possible input data or parameters for command. williamr@2: * @return KErrNone if success, otherwise an error code. williamr@2: */ williamr@2: IMPORT_C TInt HandleCommandL(TPtiEngineCommand aCommand, TAny* aParams = NULL); williamr@2: williamr@2: /** williamr@2: * Returns pointer to current Chinese candidate page. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to current Chinese candidate page. williamr@2: */ williamr@2: IMPORT_C TPtrC CandidatePage(); williamr@2: williamr@2: /** williamr@2: * Changes to next Chinese candidate page. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return ETrue if success. williamr@2: * EFalse if there are no more candidate pages. williamr@2: */ williamr@2: IMPORT_C TBool NextCandidatePage(); williamr@2: williamr@2: /** williamr@2: * Changes to previous Chinese candidate page. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return ETrue if success. williamr@2: * EFalse if current candidate page is first. williamr@2: */ williamr@2: IMPORT_C TBool PreviousCandidatePage(); williamr@2: williamr@2: /** williamr@2: * Returns a boolean value indicating whether there are more williamr@2: * candidate pages available. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return ETrue if there are more candidate pages available. williamr@2: * EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool MoreCandidatePages(); williamr@2: williamr@2: /** williamr@2: * Sets length of Chinese candidate page. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aLength Length of Chinese candidate page. williamr@2: */ williamr@2: IMPORT_C void SetCandidatePageLength(TInt aLength); williamr@2: williamr@2: /** williamr@2: * Returns phonetic spelling for current input. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aIndex Index of requested phonetic spelling. williamr@2: * @return Pointer to phonetic spelling. williamr@2: */ williamr@2: IMPORT_C TPtrC GetPhoneticSpelling(TInt aIndex) const; williamr@2: williamr@2: /** williamr@2: * Returns a value specifying how many phonetic spellings williamr@2: * there is available for current input. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Number of phonetic spellings available for williamr@2: * current input. williamr@2: */ williamr@2: IMPORT_C TInt PhoneticSpellingCount() const; williamr@2: williamr@2: /** williamr@2: * Selects given phonetic spelling for current input. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aIndex Index of requested phonetic spelling. williamr@2: */ williamr@2: IMPORT_C TBool SelectPhoneticSpelling(TInt aIndex); williamr@2: williamr@2: /** williamr@2: * Returns the index of currently selected phonetic spelling. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return The index of currently selected phonetic spelling. williamr@2: * Returned value is negative if there isn't phonetic williamr@2: * spelling available. williamr@2: */ williamr@2: IMPORT_C TInt SelectedPhoneticSpelling() const; williamr@2: williamr@2: /** williamr@2: * Enables or disables tone marks. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aValue A boolean value specifying whether tone marks williamr@2: * will be on or off. williamr@2: */ williamr@2: IMPORT_C void EnableToneMarks(TBool aValue); williamr@2: williamr@2: /** williamr@2: * Resets tone mark. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: */ williamr@2: IMPORT_C void ResetToneMark(); williamr@2: williamr@2: /** williamr@2: * Returns unicode value for current tone mark. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aToneMark resulting tone mark is store here. williamr@2: * @return ETrue if tone mark was available. williamr@2: * EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool ToneMark(TText& aToneMark) const; williamr@2: williamr@2: /** williamr@2: * Returns boolean value indicating whether current tone mark williamr@2: * is valid for spelling. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return ETrue if tone mark is valid for spelling. williamr@2: * EFalse otherwise williamr@2: */ williamr@2: IMPORT_C TBool IsToneMarkValidForSpelling() const; williamr@2: williamr@2: /** williamr@2: * Cycles to next tone mark in core related tone mark list. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aOverrideInvalid Indicates whether invalid tone marks williamr@2: * should be skipped. williamr@2: * @return ETrue If new tone mark was found and set. williamr@2: * EFalse Otherwise. williamr@2: */ williamr@2: IMPORT_C TBool IncrementToneMark(TBool aOverrideInvalid); williamr@2: williamr@2: /** williamr@2: * Selects Chinese character (meaning that user has accepted character to be williamr@2: * inserted into editor). Predictive candidate lists will be updated with williamr@2: * Chinese characters associated to selected character. Associated charcaters williamr@2: * can be accessed via ...CandidatePage() -methods. Return value can be williamr@2: * ignored in current implementation. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aChar A character to be selected. williamr@2: * @return Please ignore the return value. williamr@2: */ williamr@2: IMPORT_C TBool SetPredictiveChineseChar(const TDesC& aChar); williamr@2: williamr@2: /** williamr@2: * Returns pointer to composition data interface (used with Japanese input). williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Pointer to composition data interface. williamr@2: */ williamr@2: IMPORT_C MPtiEngineCompositionDataInterface* CompositionData(); williamr@2: williamr@2: /** williamr@2: * Returns reading text for Japanese input. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return Reading text for Japanese input. williamr@2: */ williamr@2: IMPORT_C TPtrC ReadingTextL(); williamr@2: williamr@2: /** williamr@2: * Returns mode name index table for given Chinese variant. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aVariant Chinese variant to be queried. williamr@2: * @param aResult Resulting index table. williamr@2: */ williamr@2: IMPORT_C void GetModeNameIndexL(TPtiChineseVariant aVariant, RArray& aResult); williamr@2: williamr@2: /** williamr@2: * Fills list with all the phonetic spellings for current williamr@2: * input sequence. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aList A descriptor list to be filled with williamr@2: * phonetic spellings. Any previous items in aList are cleared. williamr@2: * @return Number of items in list. williamr@2: */ williamr@2: IMPORT_C TInt GetPhoneticSpellingsL(CDesCArray& aList); williamr@2: williamr@2: /** williamr@2: * Fills list with phrase candidates for currently williamr@2: * selected phonetic spelling. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @param aList A descriptor list to be filled with williamr@2: * phrase candidates. Any previous items in aList are cleared. williamr@2: * @return Number of items in list. williamr@2: */ williamr@2: IMPORT_C TInt GetChinesePhraseCandidatesL(CDesCArray& aList); williamr@2: williamr@2: /** williamr@2: * Sets tone mark directly. This method is used if client wants williamr@2: * to override default core dependant tone mark set or traditional williamr@2: * cycle-through tone mark system doesn't suit its porposes. williamr@2: * williamr@2: * @since S60 V2.8 williamr@2: * @param aToneMark Tone mark to be set. williamr@2: * @return ETrue if tone mark was legal, ie. produced candidates. williamr@2: * EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool SetToneMark(TInt aToneMark); williamr@2: williamr@2: /** williamr@2: * A convinience method for cheking qwerty based input mode. williamr@2: * williamr@2: * @since S60 V3.0 williamr@2: * @param aMode Input mode to be checked. williamr@2: * @return ETrue If aMode is qwerty based input mode. williamr@2: * EFalse Otherwise. williamr@2: */ williamr@2: IMPORT_C TBool IsQwertyBasedMode(TPtiEngineInputMode aMode) const; williamr@2: williamr@2: /** williamr@2: * Creates empty user default dictionary file for given core object williamr@2: * and initializes it to PtiEngine user dictionary format. If file already williamr@2: * exists, then this method does nothing. Normally this method is williamr@2: * only used by core objects. williamr@2: * williamr@2: * @since S60 V3.0 williamr@2: * @param aCoreUid Uid for requesting core object. williamr@2: * @param aSymbolClass Symbol class for udb data. williamr@2: */ williamr@2: IMPORT_C void CreateDefaultUserDictionaryFileL(TUid aCoreUid, TInt aSymbolClass); williamr@2: williamr@2: /** williamr@2: * Creates secondary data file for given core object. Existing file will be overwritten. williamr@2: * This data file may contain any additional data that the core object needs to store williamr@2: * between sessions (for example used word dictionary, if the engine keeps reordering data in williamr@2: * separate memory area). williamr@2: * williamr@2: * @since S60 V3.0 williamr@2: * @param aCoreUid Uid number for requesting core object. williamr@2: * @param aIndexNumber Index number. Core object may use this parameter for numerating data files williamr@2: * if it needs more than one of then. Otherwise zero. williamr@2: */ williamr@2: IMPORT_C void WriteSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber, HBufC8* aData); williamr@2: williamr@2: /** williamr@2: * Returns a heap buffer containing data from given secondary data file. williamr@2: * Returns null if file is not found. williamr@2: * williamr@2: * @since S60 V3.0 williamr@2: * @param aCoreUid Uid number for requesting core object. williamr@2: * @param aIndexNumber Index number (see CreateDefaultUserDictionaryFileL). williamr@2: * @return A heap buffer conataining requested data. williamr@2: * NULL if file not found. williamr@2: */ williamr@2: IMPORT_C HBufC8* ReadSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber); williamr@2: williamr@2: /** williamr@2: * Returns keymapping data for given key. Returned data depends on active williamr@2: * language and input mode. Result string will be empty if there isn't williamr@2: * key mapping adta available. williamr@2: * williamr@2: * @since S60 V3.0 williamr@2: * @param aKey A key to be queried. williamr@2: * @param aResult Resulting mapping data. williamr@2: */ williamr@2: IMPORT_C void MappingDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase); williamr@2: williamr@2: /** williamr@2: * Qwerty input mode has different keymapping layout for each language. Therefore williamr@2: * the characters for numeric input mode may be mapped to different keys depending williamr@2: * on language. There are several situations where client application needs to know williamr@2: * which key and case combination produce numeric characters for given language. williamr@2: * This convinience method can be used for extracting that information easily williamr@2: * (it is also possible to achieve same result directly via CPtiCoreLanguage object). williamr@2: * Result array will be left empty if requested language is not available or it doesn't williamr@2: * support qwerty input mode. williamr@2: * Returned list includes key bindings for characters: "0123456789pw+#*" williamr@2: * (Not necessarily in this order). williamr@2: * See also ExtendedNumericModeKeysForQwertyL. williamr@2: * williamr@2: * This version first tries to return mappings according to currently williamr@2: * active physical keyboard. It current keyboard is not qwerty based, williamr@2: * it searches data for the first qwerty based keyboard type it can find. williamr@2: * That is done in same order as keyboard types are defined in PtiDefs.h. williamr@2: * There is also another version this method, which gets keyboard type as a williamr@2: * parameter. williamr@2: * williamr@2: * @since S60 V3.1 williamr@2: * @param aLanguage Language id for requested mappings. williamr@2: * @param aResult Array for storing resulting mappings. williamr@2: */ williamr@2: IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, RArray& aResult); williamr@2: williamr@2: IMPORT_C HBufC* GetCandidatesByInputString(const TDesC& aInputString, williamr@2: RPointerArray& aList, williamr@2: const TBool aIsPredictive); williamr@2: /** williamr@2: * Get first hwr implementation support the specified language williamr@2: * williamr@2: * @since S60 V4.0 williamr@2: * @param aLanguage The language that hwr implementation supported williamr@2: * @return The pointer points to hwr implementation instance williamr@2: */ williamr@2: IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TLanguage aLanguage); williamr@2: williamr@2: /** williamr@2: * Get hwr implementation by give implementation uid williamr@2: * williamr@2: * @since S60 V4.0 williamr@2: * @param aImpId Given specific implementation uid williamr@2: * @return The pointer points to hwr implementation instance williamr@2: */ williamr@2: IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TInt aImpId); williamr@2: williamr@2: /** williamr@2: * Get hwr implementation uid list which support given language williamr@2: * williamr@2: * @since S60 V4.0 williamr@2: * @param aLanguage The language that hwr implementation supported williamr@2: * @return The array of implementation uid list williamr@2: */ williamr@2: IMPORT_C RArray& ListHwrRecognizerL(TLanguage aLanguage); williamr@2: williamr@2: /** williamr@2: * Get hwr available languages list williamr@2: * williamr@2: * @since S60 V4.0 williamr@2: * @param aResult Carry the hwr available languages list on return williamr@2: * @return None williamr@2: */ williamr@2: IMPORT_C void GetHwrAvailableLanguagesL(RArray& aResult); williamr@2: williamr@2: /** williamr@2: * Returns a list containing keyboard type values for all available williamr@2: * physical keyboards connected to the device. Keyboard doesn't have to be williamr@2: * active at calling time to be included in the output list. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aResult An array to be filled with available keyboard types. williamr@2: */ williamr@2: IMPORT_C static void ListAvailablePhysicalKeyboardsL(RArray& aResult); williamr@2: williamr@2: /** williamr@2: * This method is same as GetNumericModeKeysForQwertyL, expect that instead of returning williamr@2: * strict list of key bindings used in phone number editor, it returns list of all williamr@2: * possible characters used in any of the "number only" editor variations. williamr@2: * Returned list includes key bindings for characters: "*+pw#1234567890;.,-E?/" williamr@2: * (Not necessarily in this order). williamr@2: * See also GetNumericModeKeysForQwertyL. williamr@2: * williamr@2: * This version first tries to return mappings according to currently williamr@2: * active physical keyboard. It current keyboard is not qwerty based, williamr@2: * it searches data for the first qwerty based keyboard type it can find. williamr@2: * That is done in same order as keyboard types are defined in PtiDefs.h. williamr@2: * There is also another version this method, which gets keyboard type as a williamr@2: * parameter. williamr@2: * williamr@2: * @since S60 V3.2 williamr@2: * @param aLanguage Language id for requested mappings. williamr@2: * @param aResult Array for storing resulting mappings. williamr@2: */ williamr@2: IMPORT_C const RArray& ExtendedNumericModeKeysForQwertyL(TInt aLanguage); williamr@2: williamr@2: /** williamr@2: * Turns auto substitution feature on or off. Auto substitution williamr@2: * feature replaces predefined strings with other strings. For example, williamr@2: * if user types xmas, it could be auto substituted with Christmas. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aStatus New status for auto substituiton feature williamr@2: * @return KErrNone or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetAutoSubstitution(TBool aStatus); williamr@2: williamr@2: /** williamr@2: * Adds new auto substitution entry to database. If entry for given shorcut williamr@2: * already exists, then the old entry will be automatically deleted. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aShortcut Shortcut part for new entry. williamr@2: * @param aSubstitution Substitution part for new entry. williamr@2: * @return KErrNone or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt AddAutoSubstitutionEntry(const TDesC& aShortcut, williamr@2: const TDesC& aSubstituition); williamr@2: williamr@2: /** williamr@2: * Remove auto substitution entry. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aShortcut Shortcut for auto substitution entry to be removed. williamr@2: * @return KErrNone or system wide error code. williamr@2: * KErrNotFound if given shortcut was nout found. williamr@2: */ williamr@2: IMPORT_C TInt DeleteAutoSubstitutionEntry(const TDesC& aShortcut); williamr@2: williamr@2: /** williamr@2: * Returns the number of auto substitution entries in auto subst db. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @return Number of entries in auto substitution db. Zero if the williamr@2: * feature is not supported or is not activated. williamr@2: */ williamr@2: IMPORT_C TInt NumberOfAutoSubstitutionEntries() const; williamr@2: williamr@2: /** williamr@2: * Return auto substitution entry for given index. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aIndex Index for entry to be returned. williamr@2: * @param aShortcut Shortcut part of the result entry will be stored here. williamr@2: * @param aSubstitution Substitution part of result entry will be stored here. williamr@2: * @return KErrNone or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt GetAutoSubstitutionEntry(TInt aIndex, TDes& aShortcut, williamr@2: TDes& aSubstitution); williamr@2: /** williamr@2: * Returns currently selected qwerty keyboard type. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @return Currently selected keyboard type. williamr@2: */ williamr@2: IMPORT_C TPtiKeyboardType KeyboardType() const; williamr@2: williamr@2: /** williamr@2: * Sets keyboard type for non-virtual keyboard. Keyboard type specifies which williamr@2: * set of key mapping data is used. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aType New keyboard type. williamr@2: * @return KErrNone if successful williamr@2: * KErrNotSupported if currently selected language/input mode combination williamr@2: * does not allow given keyboard type, or mapping williamr@2: * data doesn't contain block for it. williamr@2: */ williamr@2: IMPORT_C TInt SetKeyboardType(TPtiKeyboardType aType); williamr@2: williamr@2: /** williamr@2: * Lists keyboard blocks available in keymapping data for given language. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aLanguage A language to be queried. williamr@2: * @param aResult Resulting list of keyboard types will we stored here. williamr@2: */ williamr@2: IMPORT_C void KeyboardTypesSupportedByLanguageL(TInt aLanguage, williamr@2: RArray& aResult); williamr@2: /** williamr@2: * Same as previous version of GetNumericModeKeysForQwertyL (see description above) but williamr@2: * keyboard type is given as a parameter and mappings are return only for given keyboard williamr@2: * type. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aLanguage Language id for requested mappings. williamr@2: * @param aResult Array for storing resulting mappings. williamr@2: * @param aKeyboardType keyboard type. williamr@2: */ williamr@2: IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, williamr@2: RArray& aResult, williamr@2: TPtiKeyboardType aKeyboardType); williamr@2: /** williamr@2: * Same as previous version of ExtendedNumericModeKeysForQwertyL (see description above), but williamr@2: * keyboard type is given as a parameter and mappings are return only for given keyboard williamr@2: * type. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aLanguage Language id for requested mappings. williamr@2: * @param aKeyboardType keyboard type. williamr@2: * @param aResult Array for storing resulting mappings. williamr@2: */ williamr@2: IMPORT_C const RArray& ExtendedNumericModeKeysForQwertyL(TInt aLanguage, williamr@2: TPtiKeyboardType aKeyboardType); williamr@2: williamr@2: /** williamr@2: * Sets a boolean value indicating whether number candidates are included to williamr@2: * predictive candidate list. Number candidates are strings containing only digits. williamr@2: * Number candidate feature must be supported by active prediction engine, williamr@2: * otherwise this setting will be ignored. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aStatus A boolean value indicating whether number candidates williamr@2: * are included to cadidate list. williamr@2: * @return KErrNone or a system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetNumberCandidateStatus(TBool aStatus); williamr@2: williamr@2: /** williamr@2: * Returns a boolean value indicating whether given scan code is allowed for williamr@2: * current input mode. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aKey A key to be queried. williamr@2: * @return ETrue if given scan code is allowed fore currently active input mode. williamr@2: * EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool IsValidKey(TPtiKey aKey) const; williamr@2: williamr@2: /** williamr@2: * Sets the maximum length for auto completed words. This method can be used when the williamr@2: * client needs to be sure that all provided word completions will fit into remaining williamr@2: * editor buffer. When the number of key presses in an input sequence exceeds the value williamr@2: * given in aMaxLength, core will automatically reset this value to "no limit". williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aMaxLength The maximum length fo auto completed candinates. williamr@2: * Value 0 means no limit. williamr@2: * @return KErrNone If the operation succeeded. williamr@2: * Otherwise system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates(TInt aMaxLength); williamr@2: williamr@2: /** williamr@2: * Some core objects may provide different set of results depending on whether williamr@2: * the auto captitalization feature was used for entering the word or not. There is williamr@2: * now way to tell on core level whether the word was auto-capitalizedby FEP or williamr@2: * capitalized normally by the user. This method can be used to incicate williamr@2: * core object that auto-capitalization was used for current input sequence. williamr@2: * Clearing or commiting the word will cancel the effect of this method. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: */ williamr@2: IMPORT_C void MarkAutoCapitalized(); williamr@2: williamr@2: /** williamr@2: * Returns text case buffer. Case buffer contains shift state williamr@2: * for each key press used for producing active word, ie. it remembers williamr@2: * case values for each AppendKeyPress call. Case buffer is williamr@2: * cleared when active word is commited or cleared. Return williamr@2: * value is TPtrC8 containing string of EPtiTextCase values. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @return A string of EPtiTextCase values. williamr@2: */ williamr@2: IMPORT_C TPtrC8 CaseSequence(); williamr@2: williamr@2: /** williamr@2: * Some prediction engines support next word prediction feature but williamr@2: * require database to be pre-filled with suitable phrase data. williamr@2: * This method adds one new phrase or sentence to phrase dictionary. williamr@2: * Active core object needs to support phrase based next word prediction, williamr@2: * otherwise an error code is returned. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aNewPhrase New phrase to be added to phrase dictionary. williamr@2: * @return KErrNone or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt AddPhrase(const TDesC& aNewPhrase); williamr@2: williamr@4: #ifdef FF_DUAL_LANGUAGE_SUPPORT williamr@2: /** williamr@2: * Activates specified secondary input language in current input mode. williamr@2: * williamr@2: * @since S60 V5.0 williamr@2: * @param aEpocLanguageID Language to be activated. williamr@2: * @return KErrNone if success or system wide error code. williamr@2: */ williamr@2: IMPORT_C TInt SetSecondaryInputL(TInt aEpocLanguageID); williamr@4: #endif //FF_DUAL_LANGUAGE_SUPPORT williamr@2: private: williamr@2: CPtiEngine(); williamr@2: void ConstructL(TBool aUseDefaultUserDictionary); williamr@2: void ConstructL(const TUid aCoreUid, TBool aUseDefaultUserDictionary); williamr@2: williamr@2: private: williamr@2: CPtiEngineImpl* iImpl; williamr@2: }; williamr@2: williamr@2: #endif _PTI_ENGINE_H williamr@2: williamr@2: // End of file