1.1 --- a/epoc32/include/mw/ptiengine.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/ptiengine.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,1283 @@
1.4 -ptiengine.h
1.5 +/*
1.6 +* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Predective text input engine API header
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +
1.30 +
1.31 +
1.32 +
1.33 +
1.34 +
1.35 +
1.36 +#ifndef _PTI_ENGINE_H
1.37 +#define _PTI_ENGINE_H
1.38 +
1.39 +// INCLUDES
1.40 +#include <e32base.h>
1.41 +#include <badesca.h>
1.42 +#include "PtiDefs.h"
1.43 +#include "PtiObserver.h"
1.44 +#include "PtiLanguage.h"
1.45 +
1.46 +// FORWARD DECLARATIONS
1.47 +class CPtiUserDictionary;
1.48 +class MPtiUserDictionary;
1.49 +class MPtiEngineCompositionDataInterface;
1.50 +class MPtiUserDictionaryEntry;
1.51 +class CPtiEngineImpl;
1.52 +class MPtiHwrRecognizer;
1.53 +
1.54 +/**
1.55 +* CPtiEngine class.
1.56 +*
1.57 +* This is the main client side API for PtiEngine. The purpose of PtiEngine API is
1.58 +* to provide a single calling point for low level (below UI) text input functionality.
1.59 +* The API provides methods for querying and activating installed input languages, changing
1.60 +* input modes and text cases and performing text input operations. The API contains
1.61 +* set of methods for latin based, Chinese and Japanese text input. Some of the methods
1.62 +* are common to all of those variants. PtiEngine also provides access to predictive
1.63 +* text input functionality, in case there is need to use it directly without
1.64 +* standard CEikEdwin / FEP chain (hence the name 'predictive text input engine')
1.65 +* Predictive text engine integration is hidden behind PtiCore plugin API and is used
1.66 +* through PtiEngine main API.
1.67 +*
1.68 +* Usage:
1.69 +* PtiEngine is created by calling CPtiEngine::NewL method. In typical use case
1.70 +* there is no need to pass core uid parameter to NewL method.
1.71 +* Constructor will load and set up available core objects.
1.72 +*
1.73 +* Typical use cases:
1.74 +*
1.75 +* Entering text in latin multitapping mode
1.76 +* ----------------------------------------
1.77 +*
1.78 +* CPtiEngine* aEngine = CPtiEngine::NewL();
1.79 +* aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping);
1.80 +* aEngine->AppendKeyPress(EPtiKey3);
1.81 +* aEngine->AppendKeyPress(EPtiKey6);
1.82 +* aEngine->AppendKeyPress(EPtiKey6);
1.83 +* aEngine->AppendKeyPress(EPtiKey6);
1.84 +* aEngine->AppendKeyPress(EPtiKey4);
1.85 +* TBuf<100> temp;
1.86 +* temp.Copy(aEngine->CurrentWord()); // At this point temp would contain
1.87 +* // word "dog".
1.88 +*
1.89 +* Entering text in latin predictive mode
1.90 +* --------------------------------------
1.91 +*
1.92 +* CPtiEngine* aEngine = CPtiEngine::NewL();
1.93 +* aEngine->ActivateLanguageL(ELangEnglish, EPtiEnginePredicitve);
1.94 +* aEngine->AppendKeyPress(EPtiKey8);
1.95 +* aEngine->AppendKeyPress(EPtiKey4);
1.96 +* aEngine->AppendKeyPress(EPtiKey4);
1.97 +* aEngine->AppendKeyPress(EPtiKey7);
1.98 +* TBuf<100> temp;
1.99 +* temp.Copy(aEngine->CurrentWord()); // At this point temp would contain
1.100 +* // (depending on the underlying engine)
1.101 +* // word "this".
1.102 +* temp.Copy(aEngine->NextCandidate()); // Move on to next candidate.
1.103 +* aEngine->CommitCurrentWord(); // Tell engine that current word was accepted,
1.104 +* // so that the underlyinbg engine keeps
1.105 +* // frequency information up-to-date.
1.106 +* Entering text in latin qwerty mode
1.107 +* ----------------------------------
1.108 +*
1.109 +* CPtiEngine* aEngine = CPtiEngine::NewL();
1.110 +* aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwerty);
1.111 +* aEngine->AppendKeyPress(EPtiKeyQwertyQ);
1.112 +* aEngine->AppendKeyPress(EPtiKeyQwertyW);
1.113 +* aEngine->AppendKeyPress(EPtiKeyQwertyE);
1.114 +* aEngine->AppendKeyPress(EPtiKeyQwertyR);
1.115 +* aEngine->AppendKeyPress(EPtiKeyQwertyT);
1.116 +* aEngine->AppendKeyPress(EPtiKeyQwertyY);
1.117 +* TBuf<100> temp;
1.118 +* temp.Copy(aEngine->CurrentWord()); // At this point temp would contain
1.119 +* // word "qwerty".
1.120 +* // Next line requires that French key mappings are available in device.
1.121 +* aEngine->ActivateLanguageL(ELangFrench, EPtiEngineQwerty);
1.122 +* aEngine->SetCase(EPtiCaseUpper);
1.123 +* aEngine->ClearCurrentWord();
1.124 +* aEngine->AppendKeyPress(EPtiKeyQwertyQ);
1.125 +* aEngine->AppendKeyPress(EPtiKeyQwertyW);
1.126 +* aEngine->AppendKeyPress(EPtiKeyQwertyE);
1.127 +* aEngine->AppendKeyPress(EPtiKeyQwertyR);
1.128 +* aEngine->AppendKeyPress(EPtiKeyQwertyT);
1.129 +* aEngine->AppendKeyPress(EPtiKeyQwertyY);
1.130 +* temp.Copy(aEngine->CurrentWord()); // At this point temp would contain
1.131 +* // word "AZERTY".
1.132 +*
1.133 +* Entering text in preditcive latin qwerty mode
1.134 +* ---------------------------------------------
1.135 +* CPtiEngine* aEngine = CPtiEngine::NewL();
1.136 +* aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwertyPredictive);
1.137 +* aEngine->AppendKeyPress(EPtiKeyQwertyE);
1.138 +* aEngine->AppendKeyPress(EPtiKeyQwertyN);
1.139 +* aEngine->AppendKeyPress(EPtiKeyQwertyT);
1.140 +* aEngine->AppendKeyPress(EPtiKeyQwertyE);
1.141 +* aEngine->AppendKeyPress(EPtiKeyQwertyR);
1.142 +* aEngine->AppendKeyPress(EPtiKeyQwertyT);
1.143 +* aEngine->AppendKeyPress(EPtiKeyQwertyA);
1.144 +* TBuf<100> temp;
1.145 +* temp.Copy(aEngine->CurrentWord()); // At this point temp would contain
1.146 +* // for example word "entertainment", assuming the.
1.147 +* // underlying prediction engine supports word completion.
1.148 +*
1.149 +*/
1.150 +NONSHARABLE_CLASS(CPtiEngine) : public CBase
1.151 + {
1.152 + public:
1.153 + /**
1.154 + * Two phase constructor.
1.155 + *
1.156 + * @param aUseDefaultUserDictionary
1.157 + * @return
1.158 + */
1.159 + IMPORT_C static CPtiEngine* NewL(TBool aUseDefaultUserDictionary = EFalse);
1.160 +
1.161 + /**
1.162 + * Two phase constructor.
1.163 + *
1.164 + * NOTE: THIS METHOD IS DEPRECATED AND WILL LEAVE WHEN CALLED.
1.165 + */
1.166 + IMPORT_C static CPtiEngine* NewL(const TDesC& aCoreName, TBool aUseDefaultUserDictionary = EFalse);
1.167 +
1.168 + /**
1.169 + * Two phase constructor.
1.170 + *
1.171 + * @param aCoreUid
1.172 + * @param aUseDefaultUserDictionary
1.173 + * @return
1.174 + */
1.175 + IMPORT_C static CPtiEngine* NewL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse);
1.176 +
1.177 + /**
1.178 + * Destructor.
1.179 + */
1.180 + IMPORT_C ~CPtiEngine();
1.181 +
1.182 + /**
1.183 + * Activates language in requested input mode. After calling this method
1.184 + * language is ready to be used with all input modes it supports.
1.185 + *
1.186 + * @since S60 V2.6
1.187 + * @param aEpocLanguageID Language to be activated.
1.188 + * @param aMode Input mode after activation. If thise is left to default
1.189 + * value, then default input mode is activated.
1.190 + * @return KErrNone if success or system wide error code.
1.191 + */
1.192 + IMPORT_C TInt ActivateLanguageL(TInt aEpocLanguageID, TPtiEngineInputMode aMode = EPtiEngineInputModeNone);
1.193 +
1.194 + /**
1.195 + * Closes active language. After calling this method there
1.196 + * won't be active language and most PtiEngine API methods
1.197 + * will return error until ActivateLanguageL is called again.
1.198 + * Core objects for active language are asked to release
1.199 + * related resources.
1.200 + *
1.201 + * @since S60 V2.6
1.202 + */
1.203 + IMPORT_C void CloseCurrentLanguageL();
1.204 +
1.205 + /**
1.206 + * Returns core info structure for given input mode.
1.207 + *
1.208 + * @since S60 V2.6
1.209 + * @return Pointer to core info object.
1.210 + * NULL if core for given input mode was not found.
1.211 + */
1.212 + IMPORT_C MPtiCoreInfo* CoreInfo(TPtiEngineInputMode aMode) const;
1.213 +
1.214 + /**
1.215 + * Returns pointer to currently active language.
1.216 + *
1.217 + * @since S60 V2.6
1.218 + * @return Pointer to currently active language object.
1.219 + */
1.220 + IMPORT_C MPtiLanguage* CurrentLanguage();
1.221 +
1.222 + /**
1.223 + * Returns pointer to requested language.
1.224 + *
1.225 + * @since S60 V2.6
1.226 + * @param aCode Language code for requested language.
1.227 + * @return Pointer to requested language object.
1.228 + * NULL if no language for given code.
1.229 + */
1.230 + IMPORT_C MPtiLanguage* GetLanguage(TInt aCode) const;
1.231 +
1.232 + /**
1.233 + * Returns number of candidate words for current
1.234 + * input sequence.
1.235 + *
1.236 + * @since S60 V2.6
1.237 + * @return number of cadidate words.
1.238 + */
1.239 + IMPORT_C TInt NumberOfCandidates();
1.240 +
1.241 + /**
1.242 + * This method handles key press and forwards it to
1.243 + * correct core object depending on active language and
1.244 + * input mode. The current word buffer is updated accordingly.
1.245 + * If input sequence buffer has reached its maximum length
1.246 + * then nothing will be done.
1.247 + *
1.248 + * @since S60 V2.6
1.249 + * @param aKey Key code.
1.250 + * @return Pointer to current word buffer.
1.251 + */
1.252 + IMPORT_C TPtrC AppendKeyPress(TPtiKey aKey);
1.253 +
1.254 + /**
1.255 + * Deletes last character in current word buffer and updates
1.256 + * candidate list accordingly.
1.257 + *
1.258 + * @since S60 V2.6
1.259 + * @return Pointer to current word buffer.
1.260 + */
1.261 + IMPORT_C TPtrC DeleteKeyPress();
1.262 +
1.263 + /**
1.264 + * DEPRECATED (will leave if called).
1.265 + */
1.266 + IMPORT_C TInt AddCoreL(const TDesC& aFileName, TBool aUseDefaultUserDictionary = EFalse);
1.267 +
1.268 + /**
1.269 + * Loads and constructs new core object. Core object is added
1.270 + * to the list of available cores and is ready to be used
1.271 + * after that.
1.272 + *
1.273 + * @since S60 V2.6
1.274 + * @param aCoreUid Uid for core plugin.
1.275 + * @param aUseDefaultUserDictionary ....
1.276 + * @return KErrNone if operation was successful or system
1.277 + * wide error code.
1.278 + */
1.279 + IMPORT_C TInt AddCoreL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse);
1.280 +
1.281 + /**
1.282 + * Returns list of candidate words for current input sequence.
1.283 + * If word completion feature is on, then words accepted to
1.284 + * result list may contain more letters than the number
1.285 + * of key presses in current input sequence.
1.286 + *
1.287 + * @since S60 V2.6
1.288 + * @param aList a list to be filled with candidate words.
1.289 + * @return KErrNone if success, otherwise system wide error
1.290 + * code.
1.291 + */
1.292 + IMPORT_C TInt GetCandidateListL(CDesCArray& aList);
1.293 +
1.294 + /**
1.295 + * Returns next word candidate list. This method requires that
1.296 + * current core object supports next word prediction feature
1.297 + * and it is turned on.
1.298 + *
1.299 + * @since S60 V2.6
1.300 + * @param aList A List to be filled with next word cadidates.
1.301 + * @return KErrNone if list was successfully filled.
1.302 + * KErrNotSupported if current predictive core doesn't
1.303 + * support next word prediction or
1.304 + * the feature is not turned on.
1.305 + */
1.306 + IMPORT_C TInt GetNextWordCandidateListL(CDesCArray& aList);
1.307 +
1.308 + /**
1.309 + * Returns pointer to first word in candidate list.
1.310 + * If there isn't any candidate words the returned pointer
1.311 + * will point to empty descriptor.
1.312 + *
1.313 + * @since S60 V2.6
1.314 + * @return Pointer to first word in candidate list.
1.315 + */
1.316 + IMPORT_C TPtrC FirstCandidate();
1.317 +
1.318 + /**
1.319 + * Returns pointer to next word in candidate list.
1.320 + * FirstCandidate() must be called before calling
1.321 + * this method. Returns pointer to empty descriptor if there
1.322 + * isn't more candidates available.
1.323 + *
1.324 + * @since S60 V2.6
1.325 + * @return Pointer to next word in candidate list.
1.326 + */
1.327 + IMPORT_C TPtrC NextCandidate();
1.328 +
1.329 + /**
1.330 + * Returns pointer to previous word in candidate list.
1.331 + * If there isn't previous candidate available
1.332 + * (NextCandidate() wasn't succesfully called) then the
1.333 + * return value will point to an empty string.
1.334 + *
1.335 + * @since S60 V2.6
1.336 + * @return Pointer to previous word in candidate list.
1.337 + */
1.338 + IMPORT_C TPtrC PreviousCandidate();
1.339 +
1.340 + /**
1.341 + * Activates requested input mode for active language.
1.342 + *
1.343 + * @since S60 V2.6
1.344 + * @param aMode requested input mode.
1.345 + * @return KErrNone if input mode was activated.
1.346 + * KErrNotSupported if current language doesn't
1.347 + * support requested input mode.
1.348 + */
1.349 + IMPORT_C TInt SetInputMode(TPtiEngineInputMode aMode);
1.350 +
1.351 + /**
1.352 + * Returns active input mode.
1.353 + *
1.354 + * @since S60 V2.6
1.355 + * @return Current input mode.
1.356 + */
1.357 + IMPORT_C TPtiEngineInputMode InputMode() const;
1.358 +
1.359 + /**
1.360 + * Turns reordering feature on or off. This method can be used only
1.361 + * if active core object supports reordering feature.
1.362 + * It is also possible that core object supports reordering feature,
1.363 + * but it can't be turned off. Reordeing feature keeps track
1.364 + * of usage frequency for entered words and promotes most frequently
1.365 + * used words in the candidate list. Details depend on underlying
1.366 + * prediction engine.
1.367 + *
1.368 + * @since S60 V2.6
1.369 + * @param aStatus New status for reordering feature.
1.370 + * @return KErrNone if success, otherwise an error code.
1.371 + */
1.372 + IMPORT_C TInt SetReordering(TBool aStatus);
1.373 +
1.374 + /**
1.375 + * Fills text buffer with given word, refreshes
1.376 + * current input sequence and asks current core object
1.377 + * to update candidate list accordingly.
1.378 + *
1.379 + * @since S60 V2.6
1.380 + * @param aWord a word to be set as current word.
1.381 + * @return KErrNone if success, otherwise system wide error code.
1.382 + */
1.383 + IMPORT_C TInt SetCurrentWord(TPtrC aWord);
1.384 +
1.385 + /**
1.386 + * Returns pointer to current word buffer.
1.387 + *
1.388 + * @since S60 V2.6
1.389 + * @return Pointer to current word buffer.
1.390 + */
1.391 + IMPORT_C TPtrC CurrentWord();
1.392 +
1.393 + /**
1.394 + * Clears current word buffer. Calling this method means
1.395 + * that current word was reject and will not be part of edited
1.396 + * text. Either this method or CommitCurrentWord() must be called
1.397 + * before starting a new word.
1.398 + *
1.399 + * @since S60 V2.6
1.400 + */
1.401 + IMPORT_C void ClearCurrentWord();
1.402 +
1.403 + /**
1.404 + * Sets text case.
1.405 + *
1.406 + * @since S60 V2.6
1.407 + * @param aCase Text case to be set. Possible values are:
1.408 + *
1.409 + * EPtiCaseLower Normal lower text case
1.410 + * EPtiCaseUpper Normal capitalized text case
1.411 + * EPtiCaseChrLower Lower text case when Chr key is being held
1.412 + * EPtiCaseChrUpper Upper text case when Chr key is being held
1.413 + * EPtiCaseFnLower Lower text case when Fn key is being held
1.414 + * EPtiCaseFnUpper Upper text case when Fn key is being held
1.415 + */
1.416 + IMPORT_C void SetCase(TPtiTextCase aCase);
1.417 +
1.418 + /**
1.419 + * Returns active text case.
1.420 + *
1.421 + * @since S60 V2.6
1.422 + * @return Current text case.
1.423 + */
1.424 + IMPORT_C TPtiTextCase Case() const;
1.425 +
1.426 + /**
1.427 + * Returns list of available input languages.
1.428 + *
1.429 + * @since S60 V2.6
1.430 + * @param aResult List to be filled with language codes.
1.431 + */
1.432 + IMPORT_C void GetAvailableLanguagesL(CArrayFix<TInt>* aResult);
1.433 +
1.434 + /**
1.435 + * Returns list of available input languages.
1.436 + *
1.437 + * @since S60 V2.6
1.438 + * @param aResult List to be filled with language codes.
1.439 + */
1.440 + IMPORT_C void GetAvailableLanguagesL(RArray<TInt>& aResult);
1.441 +
1.442 + /**
1.443 + * Returns number of available input languages.
1.444 + *
1.445 + * @since S60 V2.6
1.446 + * @return Number of available languages.
1.447 + */
1.448 + IMPORT_C TInt NumberOfLanguages() const;
1.449 +
1.450 + /**
1.451 + * Creates new user dictionary file, inserts given list of
1.452 + * words into it and attaches it to active core
1.453 + * object for requested input mode. Active language must
1.454 + * support requested input mode.
1.455 + *
1.456 + * @since S60 V2.6
1.457 + * @param aFileName File name for new user dictionary.
1.458 + * @param aWords A list of words to be inserted to new
1.459 + * user dictionary.
1.460 + * @param aMode Input mode for core object.
1.461 + * @return KErrNone if success, otherwise system wide error
1.462 + * code.
1.463 + */
1.464 + IMPORT_C TInt CreateUserDictionaryL(TDesC& aFileName, CDesCArrayFlat* aWords, TPtiEngineInputMode aMode);
1.465 +
1.466 + /**
1.467 + * Attach user dictionary in given file to core for requested
1.468 + * input mode.
1.469 + *
1.470 + * @since S60 V2.6
1.471 + * @param aFileName User dictionary file name.
1.472 + * @return Pointer to user dictionary object. NULL if failure.
1.473 + */
1.474 + IMPORT_C MPtiUserDictionary* AttachUserDictionaryL(TDesC& aFileName);
1.475 +
1.476 + /**
1.477 + * Attach default user dictionary.
1.478 + *
1.479 + * @since S60 V2.6
1.480 + * @param aCoreUid Uid for owner core object.
1.481 + * @param aSymbolClass Symbol class for udb data.
1.482 + * @return Pointer to user dictionary object. NULL if failure.
1.483 + */
1.484 + IMPORT_C MPtiUserDictionary* AttachDefaultUserDictionaryL(TUid aCoreUid, TInt aSymbolClass);
1.485 +
1.486 + /**
1.487 + * Detaches currently attached user dictionary.
1.488 + *
1.489 + * @since S60 V2.6
1.490 + * @param aFileName User dictionary file name.
1.491 + * @return KErrNone if success, otherwise system wide error code.
1.492 + */
1.493 + IMPORT_C TInt DetachUserDictionary(TDesC& aFileName);
1.494 +
1.495 + /**
1.496 + * Detaches currently attached user dictionary.
1.497 + *
1.498 + * @since S60 V2.6
1.499 + * @param aId User dictionary id.
1.500 + * @return KErrNone if success, otherwise system wide error code.
1.501 + */
1.502 + IMPORT_C TInt DetachUserDictionary(TInt aId);
1.503 +
1.504 + /**
1.505 + * Returns localized language name for given language. This method
1.506 + * is quite inefficient (always reads name table from resource file),
1.507 + * when possible use Getlanguage()->LocalizedName() instead.
1.508 + * This method can be used also when requested language is
1.509 + * not among available input languages.
1.510 + *
1.511 + * @since S60 V2.6
1.512 + * @param Epoc language code.
1.513 + * @return Localized language name.
1.514 + */
1.515 + IMPORT_C void GetLocalizedLanguageName(TInt aLangCode, TDes& aResult);
1.516 +
1.517 + /**
1.518 + * Commits current word. Commiting means that core object is isntructed
1.519 + * to end inline editing operation and accepted active word as part of edited
1.520 + * text. Core object may then update frequency information, add unrecognized
1.521 + * word to user dictioary or perform any other operation related to commiting a word.
1.522 + * Word buffer is cleared. Either this method or ClearCurrentWord() must
1.523 + * be called before starting a new word.
1.524 + *
1.525 + * @since S60 V2.6
1.526 + * @return KErrNone if success.
1.527 + * KErrNoActiveLanguage if no active language.
1.528 + */
1.529 + IMPORT_C TInt CommitCurrentWord();
1.530 +
1.531 + /**
1.532 + * Converts given string of characters to one coding
1.533 + * system to another. See definition of TPtiCharConversion
1.534 + * for list of supported conversion types. It is possible
1.535 + * that only a small subset of supported conversion types
1.536 + * is actually available at run time (that depends on
1.537 + * available core objects). AvailableCharConversions()
1.538 + * method can be used for querying available conversion
1.539 + * types before using this method.
1.540 + *
1.541 + * @since S60 V2.6
1.542 + * @param aType Requested conversion type.
1.543 + * @param aInput Input string. This parameter may point to
1.544 + * either 8-bit or 16-bit data depending
1.545 + * on conversion type.
1.546 + * @param aInputLength Number of characters in input string.
1.547 + * @param aOutput Output string. This parameter may pint to
1.548 + * either 8-bit or 16-bit data depending
1.549 + * on conversion type.
1.550 + */
1.551 + IMPORT_C TInt CharConversion(TPtiCharConversion aType,
1.552 + TAny* aInput,
1.553 + TInt aInputLength,
1.554 + TAny* aOutput);
1.555 +
1.556 + /**
1.557 + * Returns value indicating currently available
1.558 + * character conversions.
1.559 + *
1.560 + * @since S60 V2.6
1.561 + * @return Currently available character conversions. There
1.562 + * is a bit set for each available char conversion.
1.563 + * See definition of TPtiCharConversion.
1.564 + */
1.565 + IMPORT_C TUint32 AvailableCharConversions() const;
1.566 +
1.567 + /**
1.568 + * Replaces key map for single key.
1.569 + *
1.570 + * @since S60 V2.6
1.571 + * @param aMode Input mode of key map.
1.572 + * @param aKey Key to be replaced.
1.573 + * @param aKeyMap New key sequence for aKey.
1.574 + * @return KErrNone if success, otherwise system wide error code.
1.575 + */
1.576 + IMPORT_C TInt SetExternalKeyMapL(TPtiEngineInputMode aMode,
1.577 + TPtiKey aKey,
1.578 + TDesC& aKeyMap,
1.579 + TPtiTextCase aCase);
1.580 +
1.581 + /**
1.582 + * Returns last entered key press.
1.583 + *
1.584 + * @since S60 V2.6
1.585 + * @return last entered key press.
1.586 + */
1.587 + IMPORT_C TPtiKey LastEnteredKey() const;
1.588 +
1.589 + /**
1.590 + * Returns current input sequence (a list of key presses).
1.591 + * Bytes in returned descriptor are TPtiKey enum values.
1.592 + *
1.593 + * @since S60 V2.6
1.594 + * @return a descriptor containing current input sequence.
1.595 + */
1.596 + IMPORT_C TPtrC8 CurrentInputSequence() const;
1.597 +
1.598 + /**
1.599 + * Returns alternate spelling for given character.
1.600 + *
1.601 + * @since S60 V2.6
1.602 + * @param aInput a character to be converted to requested spelling.
1.603 + * @param aOutput output will be stored to this descriptor.
1.604 + * @param aType spelling type
1.605 + * @return KErrNone if operation was successful,
1.606 + * KErrNotSupported if requested spelling type is not supported.
1.607 + */
1.608 + IMPORT_C TInt GetSpelling(TUint16 aInput, TDes& aOutput, TPtiSpelling aType);
1.609 +
1.610 + /**
1.611 + * Front end processeor uses this method for indicating
1.612 + * PtiEngine that all key press related timers should be
1.613 + * canceled.
1.614 + *
1.615 + * @since S60 V2.6
1.616 + * @return KErrNone if timers were successfully canceled.
1.617 + * KErrNotFound if no active timers were found.
1.618 + */
1.619 + IMPORT_C TInt CancelTimerActivity();
1.620 +
1.621 + /**
1.622 + * Returns key for given character. Returned key
1.623 + * depends on current language and input mode.
1.624 + *
1.625 + * @since S60 V2.6
1.626 + * @param aChar Requested character.
1.627 + * @return Key for requested character. EPtiKeyNone if
1.628 + * no key was found for given character.
1.629 + */
1.630 + IMPORT_C TPtiKey CharacterToKey(TUint16 aChar);
1.631 +
1.632 + /**
1.633 + * Adds new entry (in most cases a word) to default user dictionary of
1.634 + * currently active core object.
1.635 + *
1.636 + * @since S60 V2.6
1.637 + * @param aEntry An entry to be added to dictionary.
1.638 + * @return KErrNone if success, otherwise system wide error code.
1.639 + */
1.640 + IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry);
1.641 +
1.642 + /**
1.643 + * Adds entry to specific user dictionary.
1.644 + *
1.645 + * @since S60 V2.6
1.646 + * @param aEntry An entry to be added to dictionary.
1.647 + * @param aId User dictionary id.
1.648 + * @return KErrNone if success, otherwise system wide error code.
1.649 + */
1.650 + IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry, TInt aId);
1.651 +
1.652 + /**
1.653 + * Removes entry from default user dictionary of currently active core
1.654 + * object.
1.655 + *
1.656 + * @since S60 V2.6
1.657 + * @param aEntry an entry to be removed from default dictionary.
1.658 + * @return KErrNone if success, otherwise system wide error code.
1.659 + */
1.660 + IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry);
1.661 +
1.662 + /**
1.663 + * Removes word from specific user dictionary.
1.664 + *
1.665 + * @since S60 V2.6
1.666 + * @param aEntry an entry to be removed from default dictionary.
1.667 + * @param aId User dictionary id.
1.668 + * @return KErrNone if success, otherwise system wide error code.
1.669 + */
1.670 + IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry, TInt aId);
1.671 +
1.672 + /**
1.673 + * Returns number of entries in default user dictionary.
1.674 + *
1.675 + * @since S60 V2.6
1.676 + * @return Number of entries in default user dictionary.
1.677 + * KErrNotSupported if core can't return requested value.
1.678 + */
1.679 + IMPORT_C TInt NumberOfEntriesInUserDictionary();
1.680 +
1.681 + /**
1.682 + * Returns entry for given index in default user dictionary.
1.683 + *
1.684 + * @since S60 V2.6
1.685 + * @param aIndex An index for requested entry.
1.686 + * @param aResult Result will be stored here.
1.687 + * @return KErrNone if success, otherwise system wide error code.
1.688 + */
1.689 + IMPORT_C TInt GetUserDictionaryEntry(TInt aIndex, MPtiUserDictionaryEntry& aResult);
1.690 +
1.691 + /**
1.692 + * Returns default user dictionary for given input mode.
1.693 + *
1.694 + * @since S60 V2.6
1.695 + * @return User dictionary for given input mode.
1.696 + * NULL if wasn't found.
1.697 + */
1.698 + IMPORT_C MPtiUserDictionary* DefaultUserDictionary(TPtiEngineInputMode aMode);
1.699 +
1.700 + /**
1.701 + * Sets observer. See PtiObserver.h for observer API details.
1.702 + *
1.703 + * @since S60 V2.6
1.704 + * @param aObserver A observer to be set.
1.705 + */
1.706 + IMPORT_C void SetObserver(MPtiObserver* aObserver);
1.707 +
1.708 + /**
1.709 + * Returns current observer.
1.710 + *
1.711 + * @since S60 V2.6
1.712 + * @return Pointer to current observer object.
1.713 + */
1.714 + IMPORT_C MPtiObserver* Observer();
1.715 +
1.716 + /**
1.717 + * General command handling method. This method can be used for
1.718 + * controlling core objects that require more information than
1.719 + * just sequence of key presses.
1.720 + *
1.721 + * @since S60 V2.6
1.722 + * @param aCommand A command to be handled.
1.723 + * @param aParams Possible input data or parameters for command.
1.724 + * @return KErrNone if success, otherwise an error code.
1.725 + */
1.726 + IMPORT_C TInt HandleCommandL(TPtiEngineCommand aCommand, TAny* aParams = NULL);
1.727 +
1.728 + /**
1.729 + * Returns pointer to current Chinese candidate page.
1.730 + *
1.731 + * @since S60 V2.6
1.732 + * @return Pointer to current Chinese candidate page.
1.733 + */
1.734 + IMPORT_C TPtrC CandidatePage();
1.735 +
1.736 + /**
1.737 + * Changes to next Chinese candidate page.
1.738 + *
1.739 + * @since S60 V2.6
1.740 + * @return ETrue if success.
1.741 + * EFalse if there are no more candidate pages.
1.742 + */
1.743 + IMPORT_C TBool NextCandidatePage();
1.744 +
1.745 + /**
1.746 + * Changes to previous Chinese candidate page.
1.747 + *
1.748 + * @since S60 V2.6
1.749 + * @return ETrue if success.
1.750 + * EFalse if current candidate page is first.
1.751 + */
1.752 + IMPORT_C TBool PreviousCandidatePage();
1.753 +
1.754 + /**
1.755 + * Returns a boolean value indicating whether there are more
1.756 + * candidate pages available.
1.757 + *
1.758 + * @since S60 V2.6
1.759 + * @return ETrue if there are more candidate pages available.
1.760 + * EFalse otherwise.
1.761 + */
1.762 + IMPORT_C TBool MoreCandidatePages();
1.763 +
1.764 + /**
1.765 + * Sets length of Chinese candidate page.
1.766 + *
1.767 + * @since S60 V2.6
1.768 + * @param aLength Length of Chinese candidate page.
1.769 + */
1.770 + IMPORT_C void SetCandidatePageLength(TInt aLength);
1.771 +
1.772 + /**
1.773 + * Returns phonetic spelling for current input.
1.774 + *
1.775 + * @since S60 V2.6
1.776 + * @param aIndex Index of requested phonetic spelling.
1.777 + * @return Pointer to phonetic spelling.
1.778 + */
1.779 + IMPORT_C TPtrC GetPhoneticSpelling(TInt aIndex) const;
1.780 +
1.781 + /**
1.782 + * Returns a value specifying how many phonetic spellings
1.783 + * there is available for current input.
1.784 + *
1.785 + * @since S60 V2.6
1.786 + * @return Number of phonetic spellings available for
1.787 + * current input.
1.788 + */
1.789 + IMPORT_C TInt PhoneticSpellingCount() const;
1.790 +
1.791 + /**
1.792 + * Selects given phonetic spelling for current input.
1.793 + *
1.794 + * @since S60 V2.6
1.795 + * @param aIndex Index of requested phonetic spelling.
1.796 + */
1.797 + IMPORT_C TBool SelectPhoneticSpelling(TInt aIndex);
1.798 +
1.799 + /**
1.800 + * Returns the index of currently selected phonetic spelling.
1.801 + *
1.802 + * @since S60 V2.6
1.803 + * @return The index of currently selected phonetic spelling.
1.804 + * Returned value is negative if there isn't phonetic
1.805 + * spelling available.
1.806 + */
1.807 + IMPORT_C TInt SelectedPhoneticSpelling() const;
1.808 +
1.809 + /**
1.810 + * Enables or disables tone marks.
1.811 + *
1.812 + * @since S60 V2.6
1.813 + * @param aValue A boolean value specifying whether tone marks
1.814 + * will be on or off.
1.815 + */
1.816 + IMPORT_C void EnableToneMarks(TBool aValue);
1.817 +
1.818 + /**
1.819 + * Resets tone mark.
1.820 + *
1.821 + * @since S60 V2.6
1.822 + */
1.823 + IMPORT_C void ResetToneMark();
1.824 +
1.825 + /**
1.826 + * Returns unicode value for current tone mark.
1.827 + *
1.828 + * @since S60 V2.6
1.829 + * @param aToneMark resulting tone mark is store here.
1.830 + * @return ETrue if tone mark was available.
1.831 + * EFalse otherwise.
1.832 + */
1.833 + IMPORT_C TBool ToneMark(TText& aToneMark) const;
1.834 +
1.835 + /**
1.836 + * Returns boolean value indicating whether current tone mark
1.837 + * is valid for spelling.
1.838 + *
1.839 + * @since S60 V2.6
1.840 + * @return ETrue if tone mark is valid for spelling.
1.841 + * EFalse otherwise
1.842 + */
1.843 + IMPORT_C TBool IsToneMarkValidForSpelling() const;
1.844 +
1.845 + /**
1.846 + * Cycles to next tone mark in core related tone mark list.
1.847 + *
1.848 + * @since S60 V2.6
1.849 + * @param aOverrideInvalid Indicates whether invalid tone marks
1.850 + * should be skipped.
1.851 + * @return ETrue If new tone mark was found and set.
1.852 + * EFalse Otherwise.
1.853 + */
1.854 + IMPORT_C TBool IncrementToneMark(TBool aOverrideInvalid);
1.855 +
1.856 + /**
1.857 + * Selects Chinese character (meaning that user has accepted character to be
1.858 + * inserted into editor). Predictive candidate lists will be updated with
1.859 + * Chinese characters associated to selected character. Associated charcaters
1.860 + * can be accessed via ...CandidatePage() -methods. Return value can be
1.861 + * ignored in current implementation.
1.862 + *
1.863 + * @since S60 V2.6
1.864 + * @param aChar A character to be selected.
1.865 + * @return Please ignore the return value.
1.866 + */
1.867 + IMPORT_C TBool SetPredictiveChineseChar(const TDesC& aChar);
1.868 +
1.869 + /**
1.870 + * Returns pointer to composition data interface (used with Japanese input).
1.871 + *
1.872 + * @since S60 V2.6
1.873 + * @return Pointer to composition data interface.
1.874 + */
1.875 + IMPORT_C MPtiEngineCompositionDataInterface* CompositionData();
1.876 +
1.877 + /**
1.878 + * Returns reading text for Japanese input.
1.879 + *
1.880 + * @since S60 V2.6
1.881 + * @return Reading text for Japanese input.
1.882 + */
1.883 + IMPORT_C TPtrC ReadingTextL();
1.884 +
1.885 + /**
1.886 + * Returns mode name index table for given Chinese variant.
1.887 + *
1.888 + * @since S60 V2.6
1.889 + * @param aVariant Chinese variant to be queried.
1.890 + * @param aResult Resulting index table.
1.891 + */
1.892 + IMPORT_C void GetModeNameIndexL(TPtiChineseVariant aVariant, RArray<TInt>& aResult);
1.893 +
1.894 + /**
1.895 + * Fills list with all the phonetic spellings for current
1.896 + * input sequence.
1.897 + *
1.898 + * @since S60 V2.6
1.899 + * @param aList A descriptor list to be filled with
1.900 + * phonetic spellings. Any previous items in aList are cleared.
1.901 + * @return Number of items in list.
1.902 + */
1.903 + IMPORT_C TInt GetPhoneticSpellingsL(CDesCArray& aList);
1.904 +
1.905 + /**
1.906 + * Fills list with phrase candidates for currently
1.907 + * selected phonetic spelling.
1.908 + *
1.909 + * @since S60 V2.6
1.910 + * @param aList A descriptor list to be filled with
1.911 + * phrase candidates. Any previous items in aList are cleared.
1.912 + * @return Number of items in list.
1.913 + */
1.914 + IMPORT_C TInt GetChinesePhraseCandidatesL(CDesCArray& aList);
1.915 +
1.916 + /**
1.917 + * Sets tone mark directly. This method is used if client wants
1.918 + * to override default core dependant tone mark set or traditional
1.919 + * cycle-through tone mark system doesn't suit its porposes.
1.920 + *
1.921 + * @since S60 V2.8
1.922 + * @param aToneMark Tone mark to be set.
1.923 + * @return ETrue if tone mark was legal, ie. produced candidates.
1.924 + * EFalse otherwise.
1.925 + */
1.926 + IMPORT_C TBool SetToneMark(TInt aToneMark);
1.927 +
1.928 + /**
1.929 + * A convinience method for cheking qwerty based input mode.
1.930 + *
1.931 + * @since S60 V3.0
1.932 + * @param aMode Input mode to be checked.
1.933 + * @return ETrue If aMode is qwerty based input mode.
1.934 + * EFalse Otherwise.
1.935 + */
1.936 + IMPORT_C TBool IsQwertyBasedMode(TPtiEngineInputMode aMode) const;
1.937 +
1.938 + /**
1.939 + * Creates empty user default dictionary file for given core object
1.940 + * and initializes it to PtiEngine user dictionary format. If file already
1.941 + * exists, then this method does nothing. Normally this method is
1.942 + * only used by core objects.
1.943 + *
1.944 + * @since S60 V3.0
1.945 + * @param aCoreUid Uid for requesting core object.
1.946 + * @param aSymbolClass Symbol class for udb data.
1.947 + */
1.948 + IMPORT_C void CreateDefaultUserDictionaryFileL(TUid aCoreUid, TInt aSymbolClass);
1.949 +
1.950 + /**
1.951 + * Creates secondary data file for given core object. Existing file will be overwritten.
1.952 + * This data file may contain any additional data that the core object needs to store
1.953 + * between sessions (for example used word dictionary, if the engine keeps reordering data in
1.954 + * separate memory area).
1.955 + *
1.956 + * @since S60 V3.0
1.957 + * @param aCoreUid Uid number for requesting core object.
1.958 + * @param aIndexNumber Index number. Core object may use this parameter for numerating data files
1.959 + * if it needs more than one of then. Otherwise zero.
1.960 + */
1.961 + IMPORT_C void WriteSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber, HBufC8* aData);
1.962 +
1.963 + /**
1.964 + * Returns a heap buffer containing data from given secondary data file.
1.965 + * Returns null if file is not found.
1.966 + *
1.967 + * @since S60 V3.0
1.968 + * @param aCoreUid Uid number for requesting core object.
1.969 + * @param aIndexNumber Index number (see CreateDefaultUserDictionaryFileL).
1.970 + * @return A heap buffer conataining requested data.
1.971 + * NULL if file not found.
1.972 + */
1.973 + IMPORT_C HBufC8* ReadSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber);
1.974 +
1.975 + /**
1.976 + * Returns keymapping data for given key. Returned data depends on active
1.977 + * language and input mode. Result string will be empty if there isn't
1.978 + * key mapping adta available.
1.979 + *
1.980 + * @since S60 V3.0
1.981 + * @param aKey A key to be queried.
1.982 + * @param aResult Resulting mapping data.
1.983 + */
1.984 + IMPORT_C void MappingDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase);
1.985 +
1.986 + /**
1.987 + * Qwerty input mode has different keymapping layout for each language. Therefore
1.988 + * the characters for numeric input mode may be mapped to different keys depending
1.989 + * on language. There are several situations where client application needs to know
1.990 + * which key and case combination produce numeric characters for given language.
1.991 + * This convinience method can be used for extracting that information easily
1.992 + * (it is also possible to achieve same result directly via CPtiCoreLanguage object).
1.993 + * Result array will be left empty if requested language is not available or it doesn't
1.994 + * support qwerty input mode.
1.995 + * Returned list includes key bindings for characters: "0123456789pw+#*"
1.996 + * (Not necessarily in this order).
1.997 + * See also ExtendedNumericModeKeysForQwertyL.
1.998 + *
1.999 + * This version first tries to return mappings according to currently
1.1000 + * active physical keyboard. It current keyboard is not qwerty based,
1.1001 + * it searches data for the first qwerty based keyboard type it can find.
1.1002 + * That is done in same order as keyboard types are defined in PtiDefs.h.
1.1003 + * There is also another version this method, which gets keyboard type as a
1.1004 + * parameter.
1.1005 + *
1.1006 + * @since S60 V3.1
1.1007 + * @param aLanguage Language id for requested mappings.
1.1008 + * @param aResult Array for storing resulting mappings.
1.1009 + */
1.1010 + IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, RArray<TPtiNumericKeyBinding>& aResult);
1.1011 +
1.1012 + IMPORT_C HBufC* GetCandidatesByInputString(const TDesC& aInputString,
1.1013 + RPointerArray<HBufC>& aList,
1.1014 + const TBool aIsPredictive);
1.1015 + /**
1.1016 + * Get first hwr implementation support the specified language
1.1017 + *
1.1018 + * @since S60 V4.0
1.1019 + * @param aLanguage The language that hwr implementation supported
1.1020 + * @return The pointer points to hwr implementation instance
1.1021 + */
1.1022 + IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TLanguage aLanguage);
1.1023 +
1.1024 + /**
1.1025 + * Get hwr implementation by give implementation uid
1.1026 + *
1.1027 + * @since S60 V4.0
1.1028 + * @param aImpId Given specific implementation uid
1.1029 + * @return The pointer points to hwr implementation instance
1.1030 + */
1.1031 + IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TInt aImpId);
1.1032 +
1.1033 + /**
1.1034 + * Get hwr implementation uid list which support given language
1.1035 + *
1.1036 + * @since S60 V4.0
1.1037 + * @param aLanguage The language that hwr implementation supported
1.1038 + * @return The array of implementation uid list
1.1039 + */
1.1040 + IMPORT_C RArray<TUid>& ListHwrRecognizerL(TLanguage aLanguage);
1.1041 +
1.1042 + /**
1.1043 + * Get hwr available languages list
1.1044 + *
1.1045 + * @since S60 V4.0
1.1046 + * @param aResult Carry the hwr available languages list on return
1.1047 + * @return None
1.1048 + */
1.1049 + IMPORT_C void GetHwrAvailableLanguagesL(RArray<TInt>& aResult);
1.1050 +
1.1051 + /**
1.1052 + * Returns a list containing keyboard type values for all available
1.1053 + * physical keyboards connected to the device. Keyboard doesn't have to be
1.1054 + * active at calling time to be included in the output list.
1.1055 + *
1.1056 + * @since S60 V5.0
1.1057 + * @param aResult An array to be filled with available keyboard types.
1.1058 + */
1.1059 + IMPORT_C static void ListAvailablePhysicalKeyboardsL(RArray<TPtiKeyboardType>& aResult);
1.1060 +
1.1061 + /**
1.1062 + * This method is same as GetNumericModeKeysForQwertyL, expect that instead of returning
1.1063 + * strict list of key bindings used in phone number editor, it returns list of all
1.1064 + * possible characters used in any of the "number only" editor variations.
1.1065 + * Returned list includes key bindings for characters: "*+pw#1234567890;.,-E?/"
1.1066 + * (Not necessarily in this order).
1.1067 + * See also GetNumericModeKeysForQwertyL.
1.1068 + *
1.1069 + * This version first tries to return mappings according to currently
1.1070 + * active physical keyboard. It current keyboard is not qwerty based,
1.1071 + * it searches data for the first qwerty based keyboard type it can find.
1.1072 + * That is done in same order as keyboard types are defined in PtiDefs.h.
1.1073 + * There is also another version this method, which gets keyboard type as a
1.1074 + * parameter.
1.1075 + *
1.1076 + * @since S60 V3.2
1.1077 + * @param aLanguage Language id for requested mappings.
1.1078 + * @param aResult Array for storing resulting mappings.
1.1079 + */
1.1080 + IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage);
1.1081 +
1.1082 + /**
1.1083 + * Turns auto substitution feature on or off. Auto substitution
1.1084 + * feature replaces predefined strings with other strings. For example,
1.1085 + * if user types xmas, it could be auto substituted with Christmas.
1.1086 + *
1.1087 + * @since S60 V5.0
1.1088 + * @param aStatus New status for auto substituiton feature
1.1089 + * @return KErrNone or system wide error code.
1.1090 + */
1.1091 + IMPORT_C TInt SetAutoSubstitution(TBool aStatus);
1.1092 +
1.1093 + /**
1.1094 + * Adds new auto substitution entry to database. If entry for given shorcut
1.1095 + * already exists, then the old entry will be automatically deleted.
1.1096 + *
1.1097 + * @since S60 V5.0
1.1098 + * @param aShortcut Shortcut part for new entry.
1.1099 + * @param aSubstitution Substitution part for new entry.
1.1100 + * @return KErrNone or system wide error code.
1.1101 + */
1.1102 + IMPORT_C TInt AddAutoSubstitutionEntry(const TDesC& aShortcut,
1.1103 + const TDesC& aSubstituition);
1.1104 +
1.1105 + /**
1.1106 + * Remove auto substitution entry.
1.1107 + *
1.1108 + * @since S60 V5.0
1.1109 + * @param aShortcut Shortcut for auto substitution entry to be removed.
1.1110 + * @return KErrNone or system wide error code.
1.1111 + * KErrNotFound if given shortcut was nout found.
1.1112 + */
1.1113 + IMPORT_C TInt DeleteAutoSubstitutionEntry(const TDesC& aShortcut);
1.1114 +
1.1115 + /**
1.1116 + * Returns the number of auto substitution entries in auto subst db.
1.1117 + *
1.1118 + * @since S60 V5.0
1.1119 + * @return Number of entries in auto substitution db. Zero if the
1.1120 + * feature is not supported or is not activated.
1.1121 + */
1.1122 + IMPORT_C TInt NumberOfAutoSubstitutionEntries() const;
1.1123 +
1.1124 + /**
1.1125 + * Return auto substitution entry for given index.
1.1126 + *
1.1127 + * @since S60 V5.0
1.1128 + * @param aIndex Index for entry to be returned.
1.1129 + * @param aShortcut Shortcut part of the result entry will be stored here.
1.1130 + * @param aSubstitution Substitution part of result entry will be stored here.
1.1131 + * @return KErrNone or system wide error code.
1.1132 + */
1.1133 + IMPORT_C TInt GetAutoSubstitutionEntry(TInt aIndex, TDes& aShortcut,
1.1134 + TDes& aSubstitution);
1.1135 + /**
1.1136 + * Returns currently selected qwerty keyboard type.
1.1137 + *
1.1138 + * @since S60 V5.0
1.1139 + * @return Currently selected keyboard type.
1.1140 + */
1.1141 + IMPORT_C TPtiKeyboardType KeyboardType() const;
1.1142 +
1.1143 + /**
1.1144 + * Sets keyboard type for non-virtual keyboard. Keyboard type specifies which
1.1145 + * set of key mapping data is used.
1.1146 + *
1.1147 + * @since S60 V5.0
1.1148 + * @param aType New keyboard type.
1.1149 + * @return KErrNone if successful
1.1150 + * KErrNotSupported if currently selected language/input mode combination
1.1151 + * does not allow given keyboard type, or mapping
1.1152 + * data doesn't contain block for it.
1.1153 + */
1.1154 + IMPORT_C TInt SetKeyboardType(TPtiKeyboardType aType);
1.1155 +
1.1156 + /**
1.1157 + * Lists keyboard blocks available in keymapping data for given language.
1.1158 + *
1.1159 + * @since S60 V5.0
1.1160 + * @param aLanguage A language to be queried.
1.1161 + * @param aResult Resulting list of keyboard types will we stored here.
1.1162 + */
1.1163 + IMPORT_C void KeyboardTypesSupportedByLanguageL(TInt aLanguage,
1.1164 + RArray<TPtiKeyboardType>& aResult);
1.1165 + /**
1.1166 + * Same as previous version of GetNumericModeKeysForQwertyL (see description above) but
1.1167 + * keyboard type is given as a parameter and mappings are return only for given keyboard
1.1168 + * type.
1.1169 + *
1.1170 + * @since S60 V5.0
1.1171 + * @param aLanguage Language id for requested mappings.
1.1172 + * @param aResult Array for storing resulting mappings.
1.1173 + * @param aKeyboardType keyboard type.
1.1174 + */
1.1175 + IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage,
1.1176 + RArray<TPtiNumericKeyBinding>& aResult,
1.1177 + TPtiKeyboardType aKeyboardType);
1.1178 + /**
1.1179 + * Same as previous version of ExtendedNumericModeKeysForQwertyL (see description above), but
1.1180 + * keyboard type is given as a parameter and mappings are return only for given keyboard
1.1181 + * type.
1.1182 + *
1.1183 + * @since S60 V5.0
1.1184 + * @param aLanguage Language id for requested mappings.
1.1185 + * @param aKeyboardType keyboard type.
1.1186 + * @param aResult Array for storing resulting mappings.
1.1187 + */
1.1188 + IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage,
1.1189 + TPtiKeyboardType aKeyboardType);
1.1190 +
1.1191 + /**
1.1192 + * Sets a boolean value indicating whether number candidates are included to
1.1193 + * predictive candidate list. Number candidates are strings containing only digits.
1.1194 + * Number candidate feature must be supported by active prediction engine,
1.1195 + * otherwise this setting will be ignored.
1.1196 + *
1.1197 + * @since S60 V5.0
1.1198 + * @param aStatus A boolean value indicating whether number candidates
1.1199 + * are included to cadidate list.
1.1200 + * @return KErrNone or a system wide error code.
1.1201 + */
1.1202 + IMPORT_C TInt SetNumberCandidateStatus(TBool aStatus);
1.1203 +
1.1204 + /**
1.1205 + * Returns a boolean value indicating whether given scan code is allowed for
1.1206 + * current input mode.
1.1207 + *
1.1208 + * @since S60 V5.0
1.1209 + * @param aKey A key to be queried.
1.1210 + * @return ETrue if given scan code is allowed fore currently active input mode.
1.1211 + * EFalse otherwise.
1.1212 + */
1.1213 + IMPORT_C TBool IsValidKey(TPtiKey aKey) const;
1.1214 +
1.1215 + /**
1.1216 + * Sets the maximum length for auto completed words. This method can be used when the
1.1217 + * client needs to be sure that all provided word completions will fit into remaining
1.1218 + * editor buffer. When the number of key presses in an input sequence exceeds the value
1.1219 + * given in aMaxLength, core will automatically reset this value to "no limit".
1.1220 + *
1.1221 + * @since S60 V5.0
1.1222 + * @param aMaxLength The maximum length fo auto completed candinates.
1.1223 + * Value 0 means no limit.
1.1224 + * @return KErrNone If the operation succeeded.
1.1225 + * Otherwise system wide error code.
1.1226 + */
1.1227 + IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates(TInt aMaxLength);
1.1228 +
1.1229 + /**
1.1230 + * Some core objects may provide different set of results depending on whether
1.1231 + * the auto captitalization feature was used for entering the word or not. There is
1.1232 + * now way to tell on core level whether the word was auto-capitalizedby FEP or
1.1233 + * capitalized normally by the user. This method can be used to incicate
1.1234 + * core object that auto-capitalization was used for current input sequence.
1.1235 + * Clearing or commiting the word will cancel the effect of this method.
1.1236 + *
1.1237 + * @since S60 V5.0
1.1238 + */
1.1239 + IMPORT_C void MarkAutoCapitalized();
1.1240 +
1.1241 + /**
1.1242 + * Returns text case buffer. Case buffer contains shift state
1.1243 + * for each key press used for producing active word, ie. it remembers
1.1244 + * case values for each AppendKeyPress call. Case buffer is
1.1245 + * cleared when active word is commited or cleared. Return
1.1246 + * value is TPtrC8 containing string of EPtiTextCase values.
1.1247 + *
1.1248 + * @since S60 V5.0
1.1249 + * @return A string of EPtiTextCase values.
1.1250 + */
1.1251 + IMPORT_C TPtrC8 CaseSequence();
1.1252 +
1.1253 + /**
1.1254 + * Some prediction engines support next word prediction feature but
1.1255 + * require database to be pre-filled with suitable phrase data.
1.1256 + * This method adds one new phrase or sentence to phrase dictionary.
1.1257 + * Active core object needs to support phrase based next word prediction,
1.1258 + * otherwise an error code is returned.
1.1259 + *
1.1260 + * @since S60 V5.0
1.1261 + * @param aNewPhrase New phrase to be added to phrase dictionary.
1.1262 + * @return KErrNone or system wide error code.
1.1263 + */
1.1264 + IMPORT_C TInt AddPhrase(const TDesC& aNewPhrase);
1.1265 +
1.1266 +#ifdef __DUAL_LANGUAGE_SUPPORT__
1.1267 + /**
1.1268 + * Activates specified secondary input language in current input mode.
1.1269 + *
1.1270 + * @since S60 V5.0
1.1271 + * @param aEpocLanguageID Language to be activated.
1.1272 + * @return KErrNone if success or system wide error code.
1.1273 + */
1.1274 + IMPORT_C TInt SetSecondaryInputL(TInt aEpocLanguageID);
1.1275 +#endif //__DUAL_LANGUAGE_SUPPORT__
1.1276 + private:
1.1277 + CPtiEngine();
1.1278 + void ConstructL(TBool aUseDefaultUserDictionary);
1.1279 + void ConstructL(const TUid aCoreUid, TBool aUseDefaultUserDictionary);
1.1280 +
1.1281 + private:
1.1282 + CPtiEngineImpl* iImpl;
1.1283 + };
1.1284 +
1.1285 +#endif _PTI_ENGINE_H
1.1286 +
1.1287 +// End of file