|
1 /* |
|
2 * Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Predective text input engine API header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 #ifndef _PTI_ENGINE_H |
|
33 #define _PTI_ENGINE_H |
|
34 |
|
35 // INCLUDES |
|
36 #include <e32base.h> |
|
37 #include <badesca.h> |
|
38 #include "PtiDefs.h" |
|
39 #include "PtiObserver.h" |
|
40 #include "PtiLanguage.h" |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CPtiUserDictionary; |
|
44 class MPtiUserDictionary; |
|
45 class MPtiEngineCompositionDataInterface; |
|
46 class MPtiUserDictionaryEntry; |
|
47 class CPtiEngineImpl; |
|
48 class MPtiHwrRecognizer; |
|
49 |
|
50 /** |
|
51 * CPtiEngine class. |
|
52 * |
|
53 * This is the main client side API for PtiEngine. The purpose of PtiEngine API is |
|
54 * to provide a single calling point for low level (below UI) text input functionality. |
|
55 * The API provides methods for querying and activating installed input languages, changing |
|
56 * input modes and text cases and performing text input operations. The API contains |
|
57 * set of methods for latin based, Chinese and Japanese text input. Some of the methods |
|
58 * are common to all of those variants. PtiEngine also provides access to predictive |
|
59 * text input functionality, in case there is need to use it directly without |
|
60 * standard CEikEdwin / FEP chain (hence the name 'predictive text input engine') |
|
61 * Predictive text engine integration is hidden behind PtiCore plugin API and is used |
|
62 * through PtiEngine main API. |
|
63 * |
|
64 * Usage: |
|
65 * PtiEngine is created by calling CPtiEngine::NewL method. In typical use case |
|
66 * there is no need to pass core uid parameter to NewL method. |
|
67 * Constructor will load and set up available core objects. |
|
68 * |
|
69 * Typical use cases: |
|
70 * |
|
71 * Entering text in latin multitapping mode |
|
72 * ---------------------------------------- |
|
73 * |
|
74 * CPtiEngine* aEngine = CPtiEngine::NewL(); |
|
75 * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping); |
|
76 * aEngine->AppendKeyPress(EPtiKey3); |
|
77 * aEngine->AppendKeyPress(EPtiKey6); |
|
78 * aEngine->AppendKeyPress(EPtiKey6); |
|
79 * aEngine->AppendKeyPress(EPtiKey6); |
|
80 * aEngine->AppendKeyPress(EPtiKey4); |
|
81 * TBuf<100> temp; |
|
82 * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain |
|
83 * // word "dog". |
|
84 * |
|
85 * Entering text in latin predictive mode |
|
86 * -------------------------------------- |
|
87 * |
|
88 * CPtiEngine* aEngine = CPtiEngine::NewL(); |
|
89 * aEngine->ActivateLanguageL(ELangEnglish, EPtiEnginePredicitve); |
|
90 * aEngine->AppendKeyPress(EPtiKey8); |
|
91 * aEngine->AppendKeyPress(EPtiKey4); |
|
92 * aEngine->AppendKeyPress(EPtiKey4); |
|
93 * aEngine->AppendKeyPress(EPtiKey7); |
|
94 * TBuf<100> temp; |
|
95 * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain |
|
96 * // (depending on the underlying engine) |
|
97 * // word "this". |
|
98 * temp.Copy(aEngine->NextCandidate()); // Move on to next candidate. |
|
99 * aEngine->CommitCurrentWord(); // Tell engine that current word was accepted, |
|
100 * // so that the underlyinbg engine keeps |
|
101 * // frequency information up-to-date. |
|
102 * Entering text in latin qwerty mode |
|
103 * ---------------------------------- |
|
104 * |
|
105 * CPtiEngine* aEngine = CPtiEngine::NewL(); |
|
106 * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwerty); |
|
107 * aEngine->AppendKeyPress(EPtiKeyQwertyQ); |
|
108 * aEngine->AppendKeyPress(EPtiKeyQwertyW); |
|
109 * aEngine->AppendKeyPress(EPtiKeyQwertyE); |
|
110 * aEngine->AppendKeyPress(EPtiKeyQwertyR); |
|
111 * aEngine->AppendKeyPress(EPtiKeyQwertyT); |
|
112 * aEngine->AppendKeyPress(EPtiKeyQwertyY); |
|
113 * TBuf<100> temp; |
|
114 * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain |
|
115 * // word "qwerty". |
|
116 * // Next line requires that French key mappings are available in device. |
|
117 * aEngine->ActivateLanguageL(ELangFrench, EPtiEngineQwerty); |
|
118 * aEngine->SetCase(EPtiCaseUpper); |
|
119 * aEngine->ClearCurrentWord(); |
|
120 * aEngine->AppendKeyPress(EPtiKeyQwertyQ); |
|
121 * aEngine->AppendKeyPress(EPtiKeyQwertyW); |
|
122 * aEngine->AppendKeyPress(EPtiKeyQwertyE); |
|
123 * aEngine->AppendKeyPress(EPtiKeyQwertyR); |
|
124 * aEngine->AppendKeyPress(EPtiKeyQwertyT); |
|
125 * aEngine->AppendKeyPress(EPtiKeyQwertyY); |
|
126 * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain |
|
127 * // word "AZERTY". |
|
128 * |
|
129 * Entering text in preditcive latin qwerty mode |
|
130 * --------------------------------------------- |
|
131 * CPtiEngine* aEngine = CPtiEngine::NewL(); |
|
132 * aEngine->ActivateLanguageL(ELangEnglish, EPtiEngineQwertyPredictive); |
|
133 * aEngine->AppendKeyPress(EPtiKeyQwertyE); |
|
134 * aEngine->AppendKeyPress(EPtiKeyQwertyN); |
|
135 * aEngine->AppendKeyPress(EPtiKeyQwertyT); |
|
136 * aEngine->AppendKeyPress(EPtiKeyQwertyE); |
|
137 * aEngine->AppendKeyPress(EPtiKeyQwertyR); |
|
138 * aEngine->AppendKeyPress(EPtiKeyQwertyT); |
|
139 * aEngine->AppendKeyPress(EPtiKeyQwertyA); |
|
140 * TBuf<100> temp; |
|
141 * temp.Copy(aEngine->CurrentWord()); // At this point temp would contain |
|
142 * // for example word "entertainment", assuming the. |
|
143 * // underlying prediction engine supports word completion. |
|
144 * |
|
145 */ |
|
146 NONSHARABLE_CLASS(CPtiEngine) : public CBase |
|
147 { |
|
148 public: |
|
149 /** |
|
150 * Two phase constructor. |
|
151 * |
|
152 * @param aUseDefaultUserDictionary |
|
153 * @return |
|
154 */ |
|
155 IMPORT_C static CPtiEngine* NewL(TBool aUseDefaultUserDictionary = EFalse); |
|
156 |
|
157 /** |
|
158 * Two phase constructor. |
|
159 * |
|
160 * NOTE: THIS METHOD IS DEPRECATED AND WILL LEAVE WHEN CALLED. |
|
161 */ |
|
162 IMPORT_C static CPtiEngine* NewL(const TDesC& aCoreName, TBool aUseDefaultUserDictionary = EFalse); |
|
163 |
|
164 /** |
|
165 * Two phase constructor. |
|
166 * |
|
167 * @param aCoreUid |
|
168 * @param aUseDefaultUserDictionary |
|
169 * @return |
|
170 */ |
|
171 IMPORT_C static CPtiEngine* NewL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse); |
|
172 |
|
173 /** |
|
174 * Destructor. |
|
175 */ |
|
176 IMPORT_C ~CPtiEngine(); |
|
177 |
|
178 /** |
|
179 * Activates language in requested input mode. After calling this method |
|
180 * language is ready to be used with all input modes it supports. |
|
181 * |
|
182 * @since S60 V2.6 |
|
183 * @param aEpocLanguageID Language to be activated. |
|
184 * @param aMode Input mode after activation. If thise is left to default |
|
185 * value, then default input mode is activated. |
|
186 * @return KErrNone if success or system wide error code. |
|
187 */ |
|
188 IMPORT_C TInt ActivateLanguageL(TInt aEpocLanguageID, TPtiEngineInputMode aMode = EPtiEngineInputModeNone); |
|
189 |
|
190 /** |
|
191 * Closes active language. After calling this method there |
|
192 * won't be active language and most PtiEngine API methods |
|
193 * will return error until ActivateLanguageL is called again. |
|
194 * Core objects for active language are asked to release |
|
195 * related resources. |
|
196 * |
|
197 * @since S60 V2.6 |
|
198 */ |
|
199 IMPORT_C void CloseCurrentLanguageL(); |
|
200 |
|
201 /** |
|
202 * Returns core info structure for given input mode. |
|
203 * |
|
204 * @since S60 V2.6 |
|
205 * @return Pointer to core info object. |
|
206 * NULL if core for given input mode was not found. |
|
207 */ |
|
208 IMPORT_C MPtiCoreInfo* CoreInfo(TPtiEngineInputMode aMode) const; |
|
209 |
|
210 /** |
|
211 * Returns pointer to currently active language. |
|
212 * |
|
213 * @since S60 V2.6 |
|
214 * @return Pointer to currently active language object. |
|
215 */ |
|
216 IMPORT_C MPtiLanguage* CurrentLanguage(); |
|
217 |
|
218 /** |
|
219 * Returns pointer to requested language. |
|
220 * |
|
221 * @since S60 V2.6 |
|
222 * @param aCode Language code for requested language. |
|
223 * @return Pointer to requested language object. |
|
224 * NULL if no language for given code. |
|
225 */ |
|
226 IMPORT_C MPtiLanguage* GetLanguage(TInt aCode) const; |
|
227 |
|
228 /** |
|
229 * Returns number of candidate words for current |
|
230 * input sequence. |
|
231 * |
|
232 * @since S60 V2.6 |
|
233 * @return number of cadidate words. |
|
234 */ |
|
235 IMPORT_C TInt NumberOfCandidates(); |
|
236 |
|
237 /** |
|
238 * This method handles key press and forwards it to |
|
239 * correct core object depending on active language and |
|
240 * input mode. The current word buffer is updated accordingly. |
|
241 * If input sequence buffer has reached its maximum length |
|
242 * then nothing will be done. |
|
243 * |
|
244 * @since S60 V2.6 |
|
245 * @param aKey Key code. |
|
246 * @return Pointer to current word buffer. |
|
247 */ |
|
248 IMPORT_C TPtrC AppendKeyPress(TPtiKey aKey); |
|
249 |
|
250 /** |
|
251 * Deletes last character in current word buffer and updates |
|
252 * candidate list accordingly. |
|
253 * |
|
254 * @since S60 V2.6 |
|
255 * @return Pointer to current word buffer. |
|
256 */ |
|
257 IMPORT_C TPtrC DeleteKeyPress(); |
|
258 |
|
259 /** |
|
260 * DEPRECATED (will leave if called). |
|
261 */ |
|
262 IMPORT_C TInt AddCoreL(const TDesC& aFileName, TBool aUseDefaultUserDictionary = EFalse); |
|
263 |
|
264 /** |
|
265 * Loads and constructs new core object. Core object is added |
|
266 * to the list of available cores and is ready to be used |
|
267 * after that. |
|
268 * |
|
269 * @since S60 V2.6 |
|
270 * @param aCoreUid Uid for core plugin. |
|
271 * @param aUseDefaultUserDictionary .... |
|
272 * @return KErrNone if operation was successful or system |
|
273 * wide error code. |
|
274 */ |
|
275 IMPORT_C TInt AddCoreL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse); |
|
276 |
|
277 /** |
|
278 * Returns list of candidate words for current input sequence. |
|
279 * If word completion feature is on, then words accepted to |
|
280 * result list may contain more letters than the number |
|
281 * of key presses in current input sequence. |
|
282 * |
|
283 * @since S60 V2.6 |
|
284 * @param aList a list to be filled with candidate words. |
|
285 * @return KErrNone if success, otherwise system wide error |
|
286 * code. |
|
287 */ |
|
288 IMPORT_C TInt GetCandidateListL(CDesCArray& aList); |
|
289 |
|
290 /** |
|
291 * Returns next word candidate list. This method requires that |
|
292 * current core object supports next word prediction feature |
|
293 * and it is turned on. |
|
294 * |
|
295 * @since S60 V2.6 |
|
296 * @param aList A List to be filled with next word cadidates. |
|
297 * @return KErrNone if list was successfully filled. |
|
298 * KErrNotSupported if current predictive core doesn't |
|
299 * support next word prediction or |
|
300 * the feature is not turned on. |
|
301 */ |
|
302 IMPORT_C TInt GetNextWordCandidateListL(CDesCArray& aList); |
|
303 |
|
304 /** |
|
305 * Returns pointer to first word in candidate list. |
|
306 * If there isn't any candidate words the returned pointer |
|
307 * will point to empty descriptor. |
|
308 * |
|
309 * @since S60 V2.6 |
|
310 * @return Pointer to first word in candidate list. |
|
311 */ |
|
312 IMPORT_C TPtrC FirstCandidate(); |
|
313 |
|
314 /** |
|
315 * Returns pointer to next word in candidate list. |
|
316 * FirstCandidate() must be called before calling |
|
317 * this method. Returns pointer to empty descriptor if there |
|
318 * isn't more candidates available. |
|
319 * |
|
320 * @since S60 V2.6 |
|
321 * @return Pointer to next word in candidate list. |
|
322 */ |
|
323 IMPORT_C TPtrC NextCandidate(); |
|
324 |
|
325 /** |
|
326 * Returns pointer to previous word in candidate list. |
|
327 * If there isn't previous candidate available |
|
328 * (NextCandidate() wasn't succesfully called) then the |
|
329 * return value will point to an empty string. |
|
330 * |
|
331 * @since S60 V2.6 |
|
332 * @return Pointer to previous word in candidate list. |
|
333 */ |
|
334 IMPORT_C TPtrC PreviousCandidate(); |
|
335 |
|
336 /** |
|
337 * Activates requested input mode for active language. |
|
338 * |
|
339 * @since S60 V2.6 |
|
340 * @param aMode requested input mode. |
|
341 * @return KErrNone if input mode was activated. |
|
342 * KErrNotSupported if current language doesn't |
|
343 * support requested input mode. |
|
344 */ |
|
345 IMPORT_C TInt SetInputMode(TPtiEngineInputMode aMode); |
|
346 |
|
347 /** |
|
348 * Returns active input mode. |
|
349 * |
|
350 * @since S60 V2.6 |
|
351 * @return Current input mode. |
|
352 */ |
|
353 IMPORT_C TPtiEngineInputMode InputMode() const; |
|
354 |
|
355 /** |
|
356 * Turns reordering feature on or off. This method can be used only |
|
357 * if active core object supports reordering feature. |
|
358 * It is also possible that core object supports reordering feature, |
|
359 * but it can't be turned off. Reordeing feature keeps track |
|
360 * of usage frequency for entered words and promotes most frequently |
|
361 * used words in the candidate list. Details depend on underlying |
|
362 * prediction engine. |
|
363 * |
|
364 * @since S60 V2.6 |
|
365 * @param aStatus New status for reordering feature. |
|
366 * @return KErrNone if success, otherwise an error code. |
|
367 */ |
|
368 IMPORT_C TInt SetReordering(TBool aStatus); |
|
369 |
|
370 /** |
|
371 * Fills text buffer with given word, refreshes |
|
372 * current input sequence and asks current core object |
|
373 * to update candidate list accordingly. |
|
374 * |
|
375 * @since S60 V2.6 |
|
376 * @param aWord a word to be set as current word. |
|
377 * @return KErrNone if success, otherwise system wide error code. |
|
378 */ |
|
379 IMPORT_C TInt SetCurrentWord(TPtrC aWord); |
|
380 |
|
381 /** |
|
382 * Returns pointer to current word buffer. |
|
383 * |
|
384 * @since S60 V2.6 |
|
385 * @return Pointer to current word buffer. |
|
386 */ |
|
387 IMPORT_C TPtrC CurrentWord(); |
|
388 |
|
389 /** |
|
390 * Clears current word buffer. Calling this method means |
|
391 * that current word was reject and will not be part of edited |
|
392 * text. Either this method or CommitCurrentWord() must be called |
|
393 * before starting a new word. |
|
394 * |
|
395 * @since S60 V2.6 |
|
396 */ |
|
397 IMPORT_C void ClearCurrentWord(); |
|
398 |
|
399 /** |
|
400 * Sets text case. |
|
401 * |
|
402 * @since S60 V2.6 |
|
403 * @param aCase Text case to be set. Possible values are: |
|
404 * |
|
405 * EPtiCaseLower Normal lower text case |
|
406 * EPtiCaseUpper Normal capitalized text case |
|
407 * EPtiCaseChrLower Lower text case when Chr key is being held |
|
408 * EPtiCaseChrUpper Upper text case when Chr key is being held |
|
409 * EPtiCaseFnLower Lower text case when Fn key is being held |
|
410 * EPtiCaseFnUpper Upper text case when Fn key is being held |
|
411 */ |
|
412 IMPORT_C void SetCase(TPtiTextCase aCase); |
|
413 |
|
414 /** |
|
415 * Returns active text case. |
|
416 * |
|
417 * @since S60 V2.6 |
|
418 * @return Current text case. |
|
419 */ |
|
420 IMPORT_C TPtiTextCase Case() const; |
|
421 |
|
422 /** |
|
423 * Returns list of available input languages. |
|
424 * |
|
425 * @since S60 V2.6 |
|
426 * @param aResult List to be filled with language codes. |
|
427 */ |
|
428 IMPORT_C void GetAvailableLanguagesL(CArrayFix<TInt>* aResult); |
|
429 |
|
430 /** |
|
431 * Returns list of available input languages. |
|
432 * |
|
433 * @since S60 V2.6 |
|
434 * @param aResult List to be filled with language codes. |
|
435 */ |
|
436 IMPORT_C void GetAvailableLanguagesL(RArray<TInt>& aResult); |
|
437 |
|
438 /** |
|
439 * Returns number of available input languages. |
|
440 * |
|
441 * @since S60 V2.6 |
|
442 * @return Number of available languages. |
|
443 */ |
|
444 IMPORT_C TInt NumberOfLanguages() const; |
|
445 |
|
446 /** |
|
447 * Creates new user dictionary file, inserts given list of |
|
448 * words into it and attaches it to active core |
|
449 * object for requested input mode. Active language must |
|
450 * support requested input mode. |
|
451 * |
|
452 * @since S60 V2.6 |
|
453 * @param aFileName File name for new user dictionary. |
|
454 * @param aWords A list of words to be inserted to new |
|
455 * user dictionary. |
|
456 * @param aMode Input mode for core object. |
|
457 * @return KErrNone if success, otherwise system wide error |
|
458 * code. |
|
459 */ |
|
460 IMPORT_C TInt CreateUserDictionaryL(TDesC& aFileName, CDesCArrayFlat* aWords, TPtiEngineInputMode aMode); |
|
461 |
|
462 /** |
|
463 * Attach user dictionary in given file to core for requested |
|
464 * input mode. |
|
465 * |
|
466 * @since S60 V2.6 |
|
467 * @param aFileName User dictionary file name. |
|
468 * @return Pointer to user dictionary object. NULL if failure. |
|
469 */ |
|
470 IMPORT_C MPtiUserDictionary* AttachUserDictionaryL(TDesC& aFileName); |
|
471 |
|
472 /** |
|
473 * Attach default user dictionary. |
|
474 * |
|
475 * @since S60 V2.6 |
|
476 * @param aCoreUid Uid for owner core object. |
|
477 * @param aSymbolClass Symbol class for udb data. |
|
478 * @return Pointer to user dictionary object. NULL if failure. |
|
479 */ |
|
480 IMPORT_C MPtiUserDictionary* AttachDefaultUserDictionaryL(TUid aCoreUid, TInt aSymbolClass); |
|
481 |
|
482 /** |
|
483 * Detaches currently attached user dictionary. |
|
484 * |
|
485 * @since S60 V2.6 |
|
486 * @param aFileName User dictionary file name. |
|
487 * @return KErrNone if success, otherwise system wide error code. |
|
488 */ |
|
489 IMPORT_C TInt DetachUserDictionary(TDesC& aFileName); |
|
490 |
|
491 /** |
|
492 * Detaches currently attached user dictionary. |
|
493 * |
|
494 * @since S60 V2.6 |
|
495 * @param aId User dictionary id. |
|
496 * @return KErrNone if success, otherwise system wide error code. |
|
497 */ |
|
498 IMPORT_C TInt DetachUserDictionary(TInt aId); |
|
499 |
|
500 /** |
|
501 * Returns localized language name for given language. This method |
|
502 * is quite inefficient (always reads name table from resource file), |
|
503 * when possible use Getlanguage()->LocalizedName() instead. |
|
504 * This method can be used also when requested language is |
|
505 * not among available input languages. |
|
506 * |
|
507 * @since S60 V2.6 |
|
508 * @param Epoc language code. |
|
509 * @return Localized language name. |
|
510 */ |
|
511 IMPORT_C void GetLocalizedLanguageName(TInt aLangCode, TDes& aResult); |
|
512 |
|
513 /** |
|
514 * Commits current word. Commiting means that core object is isntructed |
|
515 * to end inline editing operation and accepted active word as part of edited |
|
516 * text. Core object may then update frequency information, add unrecognized |
|
517 * word to user dictioary or perform any other operation related to commiting a word. |
|
518 * Word buffer is cleared. Either this method or ClearCurrentWord() must |
|
519 * be called before starting a new word. |
|
520 * |
|
521 * @since S60 V2.6 |
|
522 * @return KErrNone if success. |
|
523 * KErrNoActiveLanguage if no active language. |
|
524 */ |
|
525 IMPORT_C TInt CommitCurrentWord(); |
|
526 |
|
527 /** |
|
528 * Converts given string of characters to one coding |
|
529 * system to another. See definition of TPtiCharConversion |
|
530 * for list of supported conversion types. It is possible |
|
531 * that only a small subset of supported conversion types |
|
532 * is actually available at run time (that depends on |
|
533 * available core objects). AvailableCharConversions() |
|
534 * method can be used for querying available conversion |
|
535 * types before using this method. |
|
536 * |
|
537 * @since S60 V2.6 |
|
538 * @param aType Requested conversion type. |
|
539 * @param aInput Input string. This parameter may point to |
|
540 * either 8-bit or 16-bit data depending |
|
541 * on conversion type. |
|
542 * @param aInputLength Number of characters in input string. |
|
543 * @param aOutput Output string. This parameter may pint to |
|
544 * either 8-bit or 16-bit data depending |
|
545 * on conversion type. |
|
546 */ |
|
547 IMPORT_C TInt CharConversion(TPtiCharConversion aType, |
|
548 TAny* aInput, |
|
549 TInt aInputLength, |
|
550 TAny* aOutput); |
|
551 |
|
552 /** |
|
553 * Returns value indicating currently available |
|
554 * character conversions. |
|
555 * |
|
556 * @since S60 V2.6 |
|
557 * @return Currently available character conversions. There |
|
558 * is a bit set for each available char conversion. |
|
559 * See definition of TPtiCharConversion. |
|
560 */ |
|
561 IMPORT_C TUint32 AvailableCharConversions() const; |
|
562 |
|
563 /** |
|
564 * Replaces key map for single key. |
|
565 * |
|
566 * @since S60 V2.6 |
|
567 * @param aMode Input mode of key map. |
|
568 * @param aKey Key to be replaced. |
|
569 * @param aKeyMap New key sequence for aKey. |
|
570 * @return KErrNone if success, otherwise system wide error code. |
|
571 */ |
|
572 IMPORT_C TInt SetExternalKeyMapL(TPtiEngineInputMode aMode, |
|
573 TPtiKey aKey, |
|
574 TDesC& aKeyMap, |
|
575 TPtiTextCase aCase); |
|
576 |
|
577 /** |
|
578 * Returns last entered key press. |
|
579 * |
|
580 * @since S60 V2.6 |
|
581 * @return last entered key press. |
|
582 */ |
|
583 IMPORT_C TPtiKey LastEnteredKey() const; |
|
584 |
|
585 /** |
|
586 * Returns current input sequence (a list of key presses). |
|
587 * Bytes in returned descriptor are TPtiKey enum values. |
|
588 * |
|
589 * @since S60 V2.6 |
|
590 * @return a descriptor containing current input sequence. |
|
591 */ |
|
592 IMPORT_C TPtrC8 CurrentInputSequence() const; |
|
593 |
|
594 /** |
|
595 * Returns alternate spelling for given character. |
|
596 * |
|
597 * @since S60 V2.6 |
|
598 * @param aInput a character to be converted to requested spelling. |
|
599 * @param aOutput output will be stored to this descriptor. |
|
600 * @param aType spelling type |
|
601 * @return KErrNone if operation was successful, |
|
602 * KErrNotSupported if requested spelling type is not supported. |
|
603 */ |
|
604 IMPORT_C TInt GetSpelling(TUint16 aInput, TDes& aOutput, TPtiSpelling aType); |
|
605 |
|
606 /** |
|
607 * Front end processeor uses this method for indicating |
|
608 * PtiEngine that all key press related timers should be |
|
609 * canceled. |
|
610 * |
|
611 * @since S60 V2.6 |
|
612 * @return KErrNone if timers were successfully canceled. |
|
613 * KErrNotFound if no active timers were found. |
|
614 */ |
|
615 IMPORT_C TInt CancelTimerActivity(); |
|
616 |
|
617 /** |
|
618 * Returns key for given character. Returned key |
|
619 * depends on current language and input mode. |
|
620 * |
|
621 * @since S60 V2.6 |
|
622 * @param aChar Requested character. |
|
623 * @return Key for requested character. EPtiKeyNone if |
|
624 * no key was found for given character. |
|
625 */ |
|
626 IMPORT_C TPtiKey CharacterToKey(TUint16 aChar); |
|
627 |
|
628 /** |
|
629 * Adds new entry (in most cases a word) to default user dictionary of |
|
630 * currently active core object. |
|
631 * |
|
632 * @since S60 V2.6 |
|
633 * @param aEntry An entry to be added to dictionary. |
|
634 * @return KErrNone if success, otherwise system wide error code. |
|
635 */ |
|
636 IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry); |
|
637 |
|
638 /** |
|
639 * Adds entry to specific user dictionary. |
|
640 * |
|
641 * @since S60 V2.6 |
|
642 * @param aEntry An entry to be added to dictionary. |
|
643 * @param aId User dictionary id. |
|
644 * @return KErrNone if success, otherwise system wide error code. |
|
645 */ |
|
646 IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry, TInt aId); |
|
647 |
|
648 /** |
|
649 * Removes entry from default user dictionary of currently active core |
|
650 * object. |
|
651 * |
|
652 * @since S60 V2.6 |
|
653 * @param aEntry an entry to be removed from default dictionary. |
|
654 * @return KErrNone if success, otherwise system wide error code. |
|
655 */ |
|
656 IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry); |
|
657 |
|
658 /** |
|
659 * Removes word from specific user dictionary. |
|
660 * |
|
661 * @since S60 V2.6 |
|
662 * @param aEntry an entry to be removed from default dictionary. |
|
663 * @param aId User dictionary id. |
|
664 * @return KErrNone if success, otherwise system wide error code. |
|
665 */ |
|
666 IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry, TInt aId); |
|
667 |
|
668 /** |
|
669 * Returns number of entries in default user dictionary. |
|
670 * |
|
671 * @since S60 V2.6 |
|
672 * @return Number of entries in default user dictionary. |
|
673 * KErrNotSupported if core can't return requested value. |
|
674 */ |
|
675 IMPORT_C TInt NumberOfEntriesInUserDictionary(); |
|
676 |
|
677 /** |
|
678 * Returns entry for given index in default user dictionary. |
|
679 * |
|
680 * @since S60 V2.6 |
|
681 * @param aIndex An index for requested entry. |
|
682 * @param aResult Result will be stored here. |
|
683 * @return KErrNone if success, otherwise system wide error code. |
|
684 */ |
|
685 IMPORT_C TInt GetUserDictionaryEntry(TInt aIndex, MPtiUserDictionaryEntry& aResult); |
|
686 |
|
687 /** |
|
688 * Returns default user dictionary for given input mode. |
|
689 * |
|
690 * @since S60 V2.6 |
|
691 * @return User dictionary for given input mode. |
|
692 * NULL if wasn't found. |
|
693 */ |
|
694 IMPORT_C MPtiUserDictionary* DefaultUserDictionary(TPtiEngineInputMode aMode); |
|
695 |
|
696 /** |
|
697 * Sets observer. See PtiObserver.h for observer API details. |
|
698 * |
|
699 * @since S60 V2.6 |
|
700 * @param aObserver A observer to be set. |
|
701 */ |
|
702 IMPORT_C void SetObserver(MPtiObserver* aObserver); |
|
703 |
|
704 /** |
|
705 * Returns current observer. |
|
706 * |
|
707 * @since S60 V2.6 |
|
708 * @return Pointer to current observer object. |
|
709 */ |
|
710 IMPORT_C MPtiObserver* Observer(); |
|
711 |
|
712 /** |
|
713 * General command handling method. This method can be used for |
|
714 * controlling core objects that require more information than |
|
715 * just sequence of key presses. |
|
716 * |
|
717 * @since S60 V2.6 |
|
718 * @param aCommand A command to be handled. |
|
719 * @param aParams Possible input data or parameters for command. |
|
720 * @return KErrNone if success, otherwise an error code. |
|
721 */ |
|
722 IMPORT_C TInt HandleCommandL(TPtiEngineCommand aCommand, TAny* aParams = NULL); |
|
723 |
|
724 /** |
|
725 * Returns pointer to current Chinese candidate page. |
|
726 * |
|
727 * @since S60 V2.6 |
|
728 * @return Pointer to current Chinese candidate page. |
|
729 */ |
|
730 IMPORT_C TPtrC CandidatePage(); |
|
731 |
|
732 /** |
|
733 * Changes to next Chinese candidate page. |
|
734 * |
|
735 * @since S60 V2.6 |
|
736 * @return ETrue if success. |
|
737 * EFalse if there are no more candidate pages. |
|
738 */ |
|
739 IMPORT_C TBool NextCandidatePage(); |
|
740 |
|
741 /** |
|
742 * Changes to previous Chinese candidate page. |
|
743 * |
|
744 * @since S60 V2.6 |
|
745 * @return ETrue if success. |
|
746 * EFalse if current candidate page is first. |
|
747 */ |
|
748 IMPORT_C TBool PreviousCandidatePage(); |
|
749 |
|
750 /** |
|
751 * Returns a boolean value indicating whether there are more |
|
752 * candidate pages available. |
|
753 * |
|
754 * @since S60 V2.6 |
|
755 * @return ETrue if there are more candidate pages available. |
|
756 * EFalse otherwise. |
|
757 */ |
|
758 IMPORT_C TBool MoreCandidatePages(); |
|
759 |
|
760 /** |
|
761 * Sets length of Chinese candidate page. |
|
762 * |
|
763 * @since S60 V2.6 |
|
764 * @param aLength Length of Chinese candidate page. |
|
765 */ |
|
766 IMPORT_C void SetCandidatePageLength(TInt aLength); |
|
767 |
|
768 /** |
|
769 * Returns phonetic spelling for current input. |
|
770 * |
|
771 * @since S60 V2.6 |
|
772 * @param aIndex Index of requested phonetic spelling. |
|
773 * @return Pointer to phonetic spelling. |
|
774 */ |
|
775 IMPORT_C TPtrC GetPhoneticSpelling(TInt aIndex) const; |
|
776 |
|
777 /** |
|
778 * Returns a value specifying how many phonetic spellings |
|
779 * there is available for current input. |
|
780 * |
|
781 * @since S60 V2.6 |
|
782 * @return Number of phonetic spellings available for |
|
783 * current input. |
|
784 */ |
|
785 IMPORT_C TInt PhoneticSpellingCount() const; |
|
786 |
|
787 /** |
|
788 * Selects given phonetic spelling for current input. |
|
789 * |
|
790 * @since S60 V2.6 |
|
791 * @param aIndex Index of requested phonetic spelling. |
|
792 */ |
|
793 IMPORT_C TBool SelectPhoneticSpelling(TInt aIndex); |
|
794 |
|
795 /** |
|
796 * Returns the index of currently selected phonetic spelling. |
|
797 * |
|
798 * @since S60 V2.6 |
|
799 * @return The index of currently selected phonetic spelling. |
|
800 * Returned value is negative if there isn't phonetic |
|
801 * spelling available. |
|
802 */ |
|
803 IMPORT_C TInt SelectedPhoneticSpelling() const; |
|
804 |
|
805 /** |
|
806 * Enables or disables tone marks. |
|
807 * |
|
808 * @since S60 V2.6 |
|
809 * @param aValue A boolean value specifying whether tone marks |
|
810 * will be on or off. |
|
811 */ |
|
812 IMPORT_C void EnableToneMarks(TBool aValue); |
|
813 |
|
814 /** |
|
815 * Resets tone mark. |
|
816 * |
|
817 * @since S60 V2.6 |
|
818 */ |
|
819 IMPORT_C void ResetToneMark(); |
|
820 |
|
821 /** |
|
822 * Returns unicode value for current tone mark. |
|
823 * |
|
824 * @since S60 V2.6 |
|
825 * @param aToneMark resulting tone mark is store here. |
|
826 * @return ETrue if tone mark was available. |
|
827 * EFalse otherwise. |
|
828 */ |
|
829 IMPORT_C TBool ToneMark(TText& aToneMark) const; |
|
830 |
|
831 /** |
|
832 * Returns boolean value indicating whether current tone mark |
|
833 * is valid for spelling. |
|
834 * |
|
835 * @since S60 V2.6 |
|
836 * @return ETrue if tone mark is valid for spelling. |
|
837 * EFalse otherwise |
|
838 */ |
|
839 IMPORT_C TBool IsToneMarkValidForSpelling() const; |
|
840 |
|
841 /** |
|
842 * Cycles to next tone mark in core related tone mark list. |
|
843 * |
|
844 * @since S60 V2.6 |
|
845 * @param aOverrideInvalid Indicates whether invalid tone marks |
|
846 * should be skipped. |
|
847 * @return ETrue If new tone mark was found and set. |
|
848 * EFalse Otherwise. |
|
849 */ |
|
850 IMPORT_C TBool IncrementToneMark(TBool aOverrideInvalid); |
|
851 |
|
852 /** |
|
853 * Selects Chinese character (meaning that user has accepted character to be |
|
854 * inserted into editor). Predictive candidate lists will be updated with |
|
855 * Chinese characters associated to selected character. Associated charcaters |
|
856 * can be accessed via ...CandidatePage() -methods. Return value can be |
|
857 * ignored in current implementation. |
|
858 * |
|
859 * @since S60 V2.6 |
|
860 * @param aChar A character to be selected. |
|
861 * @return Please ignore the return value. |
|
862 */ |
|
863 IMPORT_C TBool SetPredictiveChineseChar(const TDesC& aChar); |
|
864 |
|
865 /** |
|
866 * Returns pointer to composition data interface (used with Japanese input). |
|
867 * |
|
868 * @since S60 V2.6 |
|
869 * @return Pointer to composition data interface. |
|
870 */ |
|
871 IMPORT_C MPtiEngineCompositionDataInterface* CompositionData(); |
|
872 |
|
873 /** |
|
874 * Returns reading text for Japanese input. |
|
875 * |
|
876 * @since S60 V2.6 |
|
877 * @return Reading text for Japanese input. |
|
878 */ |
|
879 IMPORT_C TPtrC ReadingTextL(); |
|
880 |
|
881 /** |
|
882 * Returns mode name index table for given Chinese variant. |
|
883 * |
|
884 * @since S60 V2.6 |
|
885 * @param aVariant Chinese variant to be queried. |
|
886 * @param aResult Resulting index table. |
|
887 */ |
|
888 IMPORT_C void GetModeNameIndexL(TPtiChineseVariant aVariant, RArray<TInt>& aResult); |
|
889 |
|
890 /** |
|
891 * Fills list with all the phonetic spellings for current |
|
892 * input sequence. |
|
893 * |
|
894 * @since S60 V2.6 |
|
895 * @param aList A descriptor list to be filled with |
|
896 * phonetic spellings. Any previous items in aList are cleared. |
|
897 * @return Number of items in list. |
|
898 */ |
|
899 IMPORT_C TInt GetPhoneticSpellingsL(CDesCArray& aList); |
|
900 |
|
901 /** |
|
902 * Fills list with phrase candidates for currently |
|
903 * selected phonetic spelling. |
|
904 * |
|
905 * @since S60 V2.6 |
|
906 * @param aList A descriptor list to be filled with |
|
907 * phrase candidates. Any previous items in aList are cleared. |
|
908 * @return Number of items in list. |
|
909 */ |
|
910 IMPORT_C TInt GetChinesePhraseCandidatesL(CDesCArray& aList); |
|
911 |
|
912 /** |
|
913 * Sets tone mark directly. This method is used if client wants |
|
914 * to override default core dependant tone mark set or traditional |
|
915 * cycle-through tone mark system doesn't suit its porposes. |
|
916 * |
|
917 * @since S60 V2.8 |
|
918 * @param aToneMark Tone mark to be set. |
|
919 * @return ETrue if tone mark was legal, ie. produced candidates. |
|
920 * EFalse otherwise. |
|
921 */ |
|
922 IMPORT_C TBool SetToneMark(TInt aToneMark); |
|
923 |
|
924 /** |
|
925 * A convinience method for cheking qwerty based input mode. |
|
926 * |
|
927 * @since S60 V3.0 |
|
928 * @param aMode Input mode to be checked. |
|
929 * @return ETrue If aMode is qwerty based input mode. |
|
930 * EFalse Otherwise. |
|
931 */ |
|
932 IMPORT_C TBool IsQwertyBasedMode(TPtiEngineInputMode aMode) const; |
|
933 |
|
934 /** |
|
935 * Creates empty user default dictionary file for given core object |
|
936 * and initializes it to PtiEngine user dictionary format. If file already |
|
937 * exists, then this method does nothing. Normally this method is |
|
938 * only used by core objects. |
|
939 * |
|
940 * @since S60 V3.0 |
|
941 * @param aCoreUid Uid for requesting core object. |
|
942 * @param aSymbolClass Symbol class for udb data. |
|
943 */ |
|
944 IMPORT_C void CreateDefaultUserDictionaryFileL(TUid aCoreUid, TInt aSymbolClass); |
|
945 |
|
946 /** |
|
947 * Creates secondary data file for given core object. Existing file will be overwritten. |
|
948 * This data file may contain any additional data that the core object needs to store |
|
949 * between sessions (for example used word dictionary, if the engine keeps reordering data in |
|
950 * separate memory area). |
|
951 * |
|
952 * @since S60 V3.0 |
|
953 * @param aCoreUid Uid number for requesting core object. |
|
954 * @param aIndexNumber Index number. Core object may use this parameter for numerating data files |
|
955 * if it needs more than one of then. Otherwise zero. |
|
956 */ |
|
957 IMPORT_C void WriteSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber, HBufC8* aData); |
|
958 |
|
959 /** |
|
960 * Returns a heap buffer containing data from given secondary data file. |
|
961 * Returns null if file is not found. |
|
962 * |
|
963 * @since S60 V3.0 |
|
964 * @param aCoreUid Uid number for requesting core object. |
|
965 * @param aIndexNumber Index number (see CreateDefaultUserDictionaryFileL). |
|
966 * @return A heap buffer conataining requested data. |
|
967 * NULL if file not found. |
|
968 */ |
|
969 IMPORT_C HBufC8* ReadSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber); |
|
970 |
|
971 /** |
|
972 * Returns keymapping data for given key. Returned data depends on active |
|
973 * language and input mode. Result string will be empty if there isn't |
|
974 * key mapping adta available. |
|
975 * |
|
976 * @since S60 V3.0 |
|
977 * @param aKey A key to be queried. |
|
978 * @param aResult Resulting mapping data. |
|
979 */ |
|
980 IMPORT_C void MappingDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase); |
|
981 |
|
982 /** |
|
983 * Qwerty input mode has different keymapping layout for each language. Therefore |
|
984 * the characters for numeric input mode may be mapped to different keys depending |
|
985 * on language. There are several situations where client application needs to know |
|
986 * which key and case combination produce numeric characters for given language. |
|
987 * This convinience method can be used for extracting that information easily |
|
988 * (it is also possible to achieve same result directly via CPtiCoreLanguage object). |
|
989 * Result array will be left empty if requested language is not available or it doesn't |
|
990 * support qwerty input mode. |
|
991 * Returned list includes key bindings for characters: "0123456789pw+#*" |
|
992 * (Not necessarily in this order). |
|
993 * See also ExtendedNumericModeKeysForQwertyL. |
|
994 * |
|
995 * This version first tries to return mappings according to currently |
|
996 * active physical keyboard. It current keyboard is not qwerty based, |
|
997 * it searches data for the first qwerty based keyboard type it can find. |
|
998 * That is done in same order as keyboard types are defined in PtiDefs.h. |
|
999 * There is also another version this method, which gets keyboard type as a |
|
1000 * parameter. |
|
1001 * |
|
1002 * @since S60 V3.1 |
|
1003 * @param aLanguage Language id for requested mappings. |
|
1004 * @param aResult Array for storing resulting mappings. |
|
1005 */ |
|
1006 IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, RArray<TPtiNumericKeyBinding>& aResult); |
|
1007 |
|
1008 IMPORT_C HBufC* GetCandidatesByInputString(const TDesC& aInputString, |
|
1009 RPointerArray<HBufC>& aList, |
|
1010 const TBool aIsPredictive); |
|
1011 /** |
|
1012 * Get first hwr implementation support the specified language |
|
1013 * |
|
1014 * @since S60 V4.0 |
|
1015 * @param aLanguage The language that hwr implementation supported |
|
1016 * @return The pointer points to hwr implementation instance |
|
1017 */ |
|
1018 IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TLanguage aLanguage); |
|
1019 |
|
1020 /** |
|
1021 * Get hwr implementation by give implementation uid |
|
1022 * |
|
1023 * @since S60 V4.0 |
|
1024 * @param aImpId Given specific implementation uid |
|
1025 * @return The pointer points to hwr implementation instance |
|
1026 */ |
|
1027 IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TInt aImpId); |
|
1028 |
|
1029 /** |
|
1030 * Get hwr implementation uid list which support given language |
|
1031 * |
|
1032 * @since S60 V4.0 |
|
1033 * @param aLanguage The language that hwr implementation supported |
|
1034 * @return The array of implementation uid list |
|
1035 */ |
|
1036 IMPORT_C RArray<TUid>& ListHwrRecognizerL(TLanguage aLanguage); |
|
1037 |
|
1038 /** |
|
1039 * Get hwr available languages list |
|
1040 * |
|
1041 * @since S60 V4.0 |
|
1042 * @param aResult Carry the hwr available languages list on return |
|
1043 * @return None |
|
1044 */ |
|
1045 IMPORT_C void GetHwrAvailableLanguagesL(RArray<TInt>& aResult); |
|
1046 |
|
1047 /** |
|
1048 * Returns a list containing keyboard type values for all available |
|
1049 * physical keyboards connected to the device. Keyboard doesn't have to be |
|
1050 * active at calling time to be included in the output list. |
|
1051 * |
|
1052 * @since S60 V5.0 |
|
1053 * @param aResult An array to be filled with available keyboard types. |
|
1054 */ |
|
1055 IMPORT_C static void ListAvailablePhysicalKeyboardsL(RArray<TPtiKeyboardType>& aResult); |
|
1056 |
|
1057 /** |
|
1058 * This method is same as GetNumericModeKeysForQwertyL, expect that instead of returning |
|
1059 * strict list of key bindings used in phone number editor, it returns list of all |
|
1060 * possible characters used in any of the "number only" editor variations. |
|
1061 * Returned list includes key bindings for characters: "*+pw#1234567890;.,-E?/" |
|
1062 * (Not necessarily in this order). |
|
1063 * See also GetNumericModeKeysForQwertyL. |
|
1064 * |
|
1065 * This version first tries to return mappings according to currently |
|
1066 * active physical keyboard. It current keyboard is not qwerty based, |
|
1067 * it searches data for the first qwerty based keyboard type it can find. |
|
1068 * That is done in same order as keyboard types are defined in PtiDefs.h. |
|
1069 * There is also another version this method, which gets keyboard type as a |
|
1070 * parameter. |
|
1071 * |
|
1072 * @since S60 V3.2 |
|
1073 * @param aLanguage Language id for requested mappings. |
|
1074 * @param aResult Array for storing resulting mappings. |
|
1075 */ |
|
1076 IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage); |
|
1077 |
|
1078 /** |
|
1079 * Turns auto substitution feature on or off. Auto substitution |
|
1080 * feature replaces predefined strings with other strings. For example, |
|
1081 * if user types xmas, it could be auto substituted with Christmas. |
|
1082 * |
|
1083 * @since S60 V5.0 |
|
1084 * @param aStatus New status for auto substituiton feature |
|
1085 * @return KErrNone or system wide error code. |
|
1086 */ |
|
1087 IMPORT_C TInt SetAutoSubstitution(TBool aStatus); |
|
1088 |
|
1089 /** |
|
1090 * Adds new auto substitution entry to database. If entry for given shorcut |
|
1091 * already exists, then the old entry will be automatically deleted. |
|
1092 * |
|
1093 * @since S60 V5.0 |
|
1094 * @param aShortcut Shortcut part for new entry. |
|
1095 * @param aSubstitution Substitution part for new entry. |
|
1096 * @return KErrNone or system wide error code. |
|
1097 */ |
|
1098 IMPORT_C TInt AddAutoSubstitutionEntry(const TDesC& aShortcut, |
|
1099 const TDesC& aSubstituition); |
|
1100 |
|
1101 /** |
|
1102 * Remove auto substitution entry. |
|
1103 * |
|
1104 * @since S60 V5.0 |
|
1105 * @param aShortcut Shortcut for auto substitution entry to be removed. |
|
1106 * @return KErrNone or system wide error code. |
|
1107 * KErrNotFound if given shortcut was nout found. |
|
1108 */ |
|
1109 IMPORT_C TInt DeleteAutoSubstitutionEntry(const TDesC& aShortcut); |
|
1110 |
|
1111 /** |
|
1112 * Returns the number of auto substitution entries in auto subst db. |
|
1113 * |
|
1114 * @since S60 V5.0 |
|
1115 * @return Number of entries in auto substitution db. Zero if the |
|
1116 * feature is not supported or is not activated. |
|
1117 */ |
|
1118 IMPORT_C TInt NumberOfAutoSubstitutionEntries() const; |
|
1119 |
|
1120 /** |
|
1121 * Return auto substitution entry for given index. |
|
1122 * |
|
1123 * @since S60 V5.0 |
|
1124 * @param aIndex Index for entry to be returned. |
|
1125 * @param aShortcut Shortcut part of the result entry will be stored here. |
|
1126 * @param aSubstitution Substitution part of result entry will be stored here. |
|
1127 * @return KErrNone or system wide error code. |
|
1128 */ |
|
1129 IMPORT_C TInt GetAutoSubstitutionEntry(TInt aIndex, TDes& aShortcut, |
|
1130 TDes& aSubstitution); |
|
1131 /** |
|
1132 * Returns currently selected qwerty keyboard type. |
|
1133 * |
|
1134 * @since S60 V5.0 |
|
1135 * @return Currently selected keyboard type. |
|
1136 */ |
|
1137 IMPORT_C TPtiKeyboardType KeyboardType() const; |
|
1138 |
|
1139 /** |
|
1140 * Sets keyboard type for non-virtual keyboard. Keyboard type specifies which |
|
1141 * set of key mapping data is used. |
|
1142 * |
|
1143 * @since S60 V5.0 |
|
1144 * @param aType New keyboard type. |
|
1145 * @return KErrNone if successful |
|
1146 * KErrNotSupported if currently selected language/input mode combination |
|
1147 * does not allow given keyboard type, or mapping |
|
1148 * data doesn't contain block for it. |
|
1149 */ |
|
1150 IMPORT_C TInt SetKeyboardType(TPtiKeyboardType aType); |
|
1151 |
|
1152 /** |
|
1153 * Lists keyboard blocks available in keymapping data for given language. |
|
1154 * |
|
1155 * @since S60 V5.0 |
|
1156 * @param aLanguage A language to be queried. |
|
1157 * @param aResult Resulting list of keyboard types will we stored here. |
|
1158 */ |
|
1159 IMPORT_C void KeyboardTypesSupportedByLanguageL(TInt aLanguage, |
|
1160 RArray<TPtiKeyboardType>& aResult); |
|
1161 /** |
|
1162 * Same as previous version of GetNumericModeKeysForQwertyL (see description above) but |
|
1163 * keyboard type is given as a parameter and mappings are return only for given keyboard |
|
1164 * type. |
|
1165 * |
|
1166 * @since S60 V5.0 |
|
1167 * @param aLanguage Language id for requested mappings. |
|
1168 * @param aResult Array for storing resulting mappings. |
|
1169 * @param aKeyboardType keyboard type. |
|
1170 */ |
|
1171 IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, |
|
1172 RArray<TPtiNumericKeyBinding>& aResult, |
|
1173 TPtiKeyboardType aKeyboardType); |
|
1174 /** |
|
1175 * Same as previous version of ExtendedNumericModeKeysForQwertyL (see description above), but |
|
1176 * keyboard type is given as a parameter and mappings are return only for given keyboard |
|
1177 * type. |
|
1178 * |
|
1179 * @since S60 V5.0 |
|
1180 * @param aLanguage Language id for requested mappings. |
|
1181 * @param aKeyboardType keyboard type. |
|
1182 * @param aResult Array for storing resulting mappings. |
|
1183 */ |
|
1184 IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage, |
|
1185 TPtiKeyboardType aKeyboardType); |
|
1186 |
|
1187 /** |
|
1188 * Sets a boolean value indicating whether number candidates are included to |
|
1189 * predictive candidate list. Number candidates are strings containing only digits. |
|
1190 * Number candidate feature must be supported by active prediction engine, |
|
1191 * otherwise this setting will be ignored. |
|
1192 * |
|
1193 * @since S60 V5.0 |
|
1194 * @param aStatus A boolean value indicating whether number candidates |
|
1195 * are included to cadidate list. |
|
1196 * @return KErrNone or a system wide error code. |
|
1197 */ |
|
1198 IMPORT_C TInt SetNumberCandidateStatus(TBool aStatus); |
|
1199 |
|
1200 /** |
|
1201 * Returns a boolean value indicating whether given scan code is allowed for |
|
1202 * current input mode. |
|
1203 * |
|
1204 * @since S60 V5.0 |
|
1205 * @param aKey A key to be queried. |
|
1206 * @return ETrue if given scan code is allowed fore currently active input mode. |
|
1207 * EFalse otherwise. |
|
1208 */ |
|
1209 IMPORT_C TBool IsValidKey(TPtiKey aKey) const; |
|
1210 |
|
1211 /** |
|
1212 * Sets the maximum length for auto completed words. This method can be used when the |
|
1213 * client needs to be sure that all provided word completions will fit into remaining |
|
1214 * editor buffer. When the number of key presses in an input sequence exceeds the value |
|
1215 * given in aMaxLength, core will automatically reset this value to "no limit". |
|
1216 * |
|
1217 * @since S60 V5.0 |
|
1218 * @param aMaxLength The maximum length fo auto completed candinates. |
|
1219 * Value 0 means no limit. |
|
1220 * @return KErrNone If the operation succeeded. |
|
1221 * Otherwise system wide error code. |
|
1222 */ |
|
1223 IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates(TInt aMaxLength); |
|
1224 |
|
1225 /** |
|
1226 * Some core objects may provide different set of results depending on whether |
|
1227 * the auto captitalization feature was used for entering the word or not. There is |
|
1228 * now way to tell on core level whether the word was auto-capitalizedby FEP or |
|
1229 * capitalized normally by the user. This method can be used to incicate |
|
1230 * core object that auto-capitalization was used for current input sequence. |
|
1231 * Clearing or commiting the word will cancel the effect of this method. |
|
1232 * |
|
1233 * @since S60 V5.0 |
|
1234 */ |
|
1235 IMPORT_C void MarkAutoCapitalized(); |
|
1236 |
|
1237 /** |
|
1238 * Returns text case buffer. Case buffer contains shift state |
|
1239 * for each key press used for producing active word, ie. it remembers |
|
1240 * case values for each AppendKeyPress call. Case buffer is |
|
1241 * cleared when active word is commited or cleared. Return |
|
1242 * value is TPtrC8 containing string of EPtiTextCase values. |
|
1243 * |
|
1244 * @since S60 V5.0 |
|
1245 * @return A string of EPtiTextCase values. |
|
1246 */ |
|
1247 IMPORT_C TPtrC8 CaseSequence(); |
|
1248 |
|
1249 /** |
|
1250 * Some prediction engines support next word prediction feature but |
|
1251 * require database to be pre-filled with suitable phrase data. |
|
1252 * This method adds one new phrase or sentence to phrase dictionary. |
|
1253 * Active core object needs to support phrase based next word prediction, |
|
1254 * otherwise an error code is returned. |
|
1255 * |
|
1256 * @since S60 V5.0 |
|
1257 * @param aNewPhrase New phrase to be added to phrase dictionary. |
|
1258 * @return KErrNone or system wide error code. |
|
1259 */ |
|
1260 IMPORT_C TInt AddPhrase(const TDesC& aNewPhrase); |
|
1261 |
|
1262 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
1263 /** |
|
1264 * Activates specified secondary input language in current input mode. |
|
1265 * |
|
1266 * @since S60 V5.0 |
|
1267 * @param aEpocLanguageID Language to be activated. |
|
1268 * @return KErrNone if success or system wide error code. |
|
1269 */ |
|
1270 IMPORT_C TInt SetSecondaryInputL(TInt aEpocLanguageID); |
|
1271 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
1272 private: |
|
1273 CPtiEngine(); |
|
1274 void ConstructL(TBool aUseDefaultUserDictionary); |
|
1275 void ConstructL(const TUid aCoreUid, TBool aUseDefaultUserDictionary); |
|
1276 |
|
1277 private: |
|
1278 CPtiEngineImpl* iImpl; |
|
1279 }; |
|
1280 |
|
1281 #endif _PTI_ENGINE_H |
|
1282 |
|
1283 // End of file |