2 * Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: PtiLanguage class definitions.
31 #ifndef _PTI_KEY_MAPPINGS_H
32 #define _PTI_KEY_MAPPINGS_H
38 const TInt KPtiKeyDataDeadKeySeparator = 0xffff;
39 const TInt KPtiPinyinMarker = 0x2460;
40 const TInt KPtiStrokeMarker = 0x2461;
41 const TInt KPtiZhuyinMarker = 0x2462;
42 const TInt KPtiCangjieMarker = 0x2463;
43 const TInt KPtiGetAllMarker = 0x2464;
45 // FORWARD DECLARATIONS
49 // CPtiQwertyKeymappingsExtension
52 NONSHARABLE_CLASS(CPtiQwertyKeymappingsExtension) : public CBase
55 static CPtiQwertyKeymappingsExtension* NewL();
56 ~CPtiQwertyKeymappingsExtension();
59 CPtiQwertyKeymappingsExtension();
62 TUint16 iLastChar; // for Vietnamese
63 TInt16 iLastTone; // for Vietnamese
64 TUint16 iReplaced; // for Vietnamese
65 TPtiTextCase iVowelCase; // for Vietnamese
66 TPtiKey iLastToneKey; // for Vietnamese
83 // TPtiReplacedMapping
86 const TInt KMaxReplacedMappingCharacters = 5;
87 class TPtiReplacedMapping
92 TPtiEngineInputMode iMode;
93 TPtiKeyboardType iKeyboardType;
95 TUint16 iChrs[KMaxReplacedMappingCharacters];
102 * Interface class for PtiEngine keymapping functionality.
104 class MPtiKeyMappings
107 virtual ~MPtiKeyMappings() {}
110 * Starts mapping new key. Will return first character bound to given
111 * key in given text case.
113 * @param aKey A key to be mapped.
114 * @param aCase Text case for mapping operation.
115 * @param aMode Input mode for mapping. This is needed if keymapping data contains
116 * characters for several input modes (used mainly with Chinese
117 * modes). This value will be matched to possible input mode control
118 * characters in keymapping data.
119 * @return First character bound to requested key.
121 virtual TUint16 StartMapping(TPtiKey aKey,
123 TPtiEngineInputMode aMode = EPtiEngineInputModeNone) = 0;
126 * Continues keymapping sequence. This method should be called when key event
127 * comes in while multitapping timer is active. Takes care of cycling through
128 * multitapping candidates associated for given key.
131 * @param aKey A key to be mapped.
132 * @param aAppend Refernce to boolen variable. This will be set to ETrue if current character in
133 * editor should be replaced (new multitapping candidate was found) and
134 * to EFalse if new character should inserted instead.
135 * @param aCase Text case for mapping operation.
136 * @return Next character assosiated to given key or the first character if aKey
137 * was different key than previous key press.
139 virtual TUint16 NextKey(TPtiKey aKey, TBool &aAppend, TPtiTextCase aCase) = 0;
142 * Returns PtiEngine key code for last StartMapping() call.
145 * @return PtiEngine key code for last StartMapping() call.
147 virtual TPtiKey CurrentKey() = 0;
150 * Replaces keymapping data for given key and case.
153 * @param aKey A key to be replaced.
154 * @param aMap New keymapping data for aKey,
155 * @param aCase Text case for replaced data.
156 * @return KErrNone or system wide error code.
158 virtual TInt ReplaceKeyMapL(TPtiKey aKey, TDesC& aMap, TPtiTextCase aCase) = 0;
161 * Returns key code for key which produces given unicode character (if found).
164 * @param aChar A character to be queried.
165 * @return Key code for aChar. EPtiKeyNone, if not found.
167 virtual TPtiKey KeyForCharacter(TUint16 aChar) = 0;
170 * Returns all keymapping data for current key, excluding first character
171 * (which is expected to be "get all"-control character).
173 * @param aCase Text case for which data will be returned.
174 * @return Constant descriptor pointing to keymap data.
177 virtual TPtrC GetAll(TPtiTextCase aCase) = 0;
184 * Base class for keymapping implementation classes.
185 * Handles locally replaced keymappings.
187 class CPtiMappings : public CBase
191 CPtiMappings(CPtiKeyMapData* aData);
193 inline CPtiKeyMapData* KeyMapData() const;
196 virtual TInt WriteData(TInt16*);
198 virtual TInt ChunkDataSize() const;
200 IMPORT_C TPtiKeyboardType KeyboardType() const;
203 TInt FindReplacedMapping(TPtiKey aKey, TPtiTextCase aCase, TPtiEngineInputMode aMode) const;
204 void ReplaceKeyMapLocalL(TPtiKey aKey, TDesC& aMap, TPtiTextCase aCase, TPtiEngineInputMode aMode);
207 TPtrC DataForKeyLocal(TPtiKey aKey, TPtiTextCase aCase, TPtiEngineInputMode aMode) const;
211 TPtiEngineInputMode iCurrentMode;
213 RArray<TPtiReplacedMapping> iReplacedMappings;
214 CPtiKeyMapData* iKeyMapData; // Not owned
215 TPtiKeyboardType iKeyboardType;
222 * Keymappings implementation class for itu-t keyboard
224 NONSHARABLE_CLASS(CPtiKeyMappings) : public CPtiMappings, public MPtiKeyMappings
228 * DEPRECATED. Leaves with KErrNotSupported.
230 IMPORT_C static CPtiKeyMappings* NewL(TDesC& aData);
233 * DEPRECATED. Leaves with KErrNotSupported.
235 IMPORT_C static CPtiKeyMappings* NewL(TInt16* aData);
240 IMPORT_C static CPtiKeyMappings* NewL(CPtiKeyMapData* aData);
242 IMPORT_C ~CPtiKeyMappings();
245 * Start mapping for given key.
247 * @param aKey Key code for key.
248 * @param aCase Cuurrent text case.
249 * @param aMode Current input mode. Default value works for most cases.
250 * @return First character for given key.
252 IMPORT_C virtual TUint16 StartMapping(TPtiKey aKey,
254 TPtiEngineInputMode aMode = EPtiEngineInputModeNone);
257 * Continues keymapping sequence. This method should be called when key event
258 * comes in while multitapping timer is active. Takes care of cycling through
259 * multitapping candidates associated for given key.
262 * @param aKey A key to be mapped.
263 * @param Refernce to boolen variable. This will be set to ETrue if current character in
264 * editor should be replaced (new multitapping candidate was found) and
265 * to EFalse if new character should inserted instead.
266 * @param aCase Text case for mapping operation.
267 * @return Next character assosiated to given key or the first character if aKey
268 * was different key than previous key press.
270 IMPORT_C TUint16 NextKey(TPtiKey aKey, TBool &aAppend, TPtiTextCase aCase);
273 * Returns key code for key currently being mapped (relates to StartMapping and NextKey).
275 * @return Key code for key currently being mapped.
277 inline TPtiKey CurrentKey();
280 * Replaces keymapping data for given key.
282 * @param aKey Key code for key to be replaced.
283 * @param aMap New keymapping data for aKey.
284 * @param aCase Text case.
285 * @return KErrNone if succesfull
286 * Otherwise system wide error code.
288 IMPORT_C TInt ReplaceKeyMapL(TPtiKey aKey, TDesC& aMap, TPtiTextCase aCase);
291 * Scans through keymapping data and returns key code for given character.
293 * @param aChar A character to be queried.
294 * @return Key code for mtaching key.
295 * EPtiKeyNone if no matching keys found.
297 IMPORT_C TPtiKey KeyForCharacter(TUint16 aChar);
300 * Returns keymapping data for given key.
302 * @param aKey A key to be queried.
303 * @param aResult Descritor where resulting data is stored.
304 * @param aCase Text case
306 IMPORT_C void GetDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase);
309 * Returns all keymapping data for current key, excluding first character
310 * (which is expected to be "get all"-control character).
312 * @param aCase Text case for which data will be returned.
313 * @return Constant descriptor pointing to keymap data.
316 TPtrC GetAll(TPtiTextCase aCase);
320 CPtiKeyMappings(CPtiKeyMapData* aData);
321 TUint16 NextChar(TPtiTextCase aCase);
322 inline void KeyCodeToInternal(TPtiKey aKey);
323 inline void DeQwertyfyCaseValue(TPtiTextCase& aCase);
328 * CPtiQwertyKeyMappings
330 * Keymappings implementation class for qwerty keyboard.
332 NONSHARABLE_CLASS(CPtiQwertyKeyMappings) : public CPtiMappings, public MPtiKeyMappings
336 * DEPRECATED. Will leave with KErrNotSupported.
338 IMPORT_C static CPtiQwertyKeyMappings* NewL(TDesC& aData);
341 * DEPRECATED. Will leave with KErrNotSupported.
343 IMPORT_C static CPtiQwertyKeyMappings* NewL(TInt16* aData);
348 IMPORT_C static CPtiQwertyKeyMappings* NewL(CPtiKeyMapData* aData);
350 IMPORT_C ~CPtiQwertyKeyMappings();
353 * Start mapping for given key.
355 * @param aKey Key code for key.
356 * @param aCase Cuurrent text case.
357 * @param aMode Current input mode. Default value works for most cases.
358 * @return First character for given key.
360 IMPORT_C TUint16 StartMapping(TPtiKey aKey,
362 TPtiEngineInputMode aMode = EPtiEngineInputModeNone);
365 * Continues keymapping sequence. This method should be called when key event
366 * comes in while multitapping timer is active. Takes care of cycling through
367 * multitapping candidates associated for given key.
370 * @param aKey A key to be mapped.
371 * @param aAppend Refernce to boolen variable. This will be set to ETrue if current character in
372 * editor should be replaced (new chr-case character was found) and
373 * to EFalse if new character should inserted instead.
374 * @param aCase Text case for mapping operation.
375 * @return Next character assosiated to given key or the first character if aKey
376 * was different key than previous key press.
378 IMPORT_C TUint16 NextKey(TPtiKey aKey, TBool &aAppend, TPtiTextCase aCase);
381 * Returns key code for key currently being mapped (relates to StartMapping and NextKey).
383 * @return Key code for key currently being mapped.
385 inline TPtiKey CurrentKey();
388 * Replaces keymapping data for given key.
390 * @param aKey Key code for key to be replaced.
391 * @param aMap New keymapping data for aKey.
392 * @param aCase Text case.
393 * @return KErrNone if succesfull
394 * Otherwise system wide error code.
396 IMPORT_C TInt ReplaceKeyMapL(TPtiKey aKey, TDesC& aMap, TPtiTextCase aCase);
399 * Scans through keymapping data and returns key code for given character.
401 * @param aChar A character to be queried.
402 * @return Key code for mtaching key.
403 * EPtiKeyNone if no matching keys found.
405 IMPORT_C TPtiKey KeyForCharacter(TUint16 aChar);
408 * Returns keymapping data for given key.
410 * @param aKey A key to be queried.
411 * @param aResult Descritor where resulting data is stored.
412 * @param aCase Text case
414 IMPORT_C void GetDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase);
417 TInt WriteData(TInt16* aDest);
420 TInt ChunkDataSize() const;
423 inline TBool DeadKeyRootFlag() const;
426 inline TUint16 DeadKeyRootChar() const;
429 inline TBool VowelSequenceFlag() const;
432 inline TUint16 VowelSequenceResult() const;
435 inline void ClearVowelSequence();
438 inline TInt16 DeadKey() const;
441 inline void ClearDeadKey();
444 inline void ClearLastChar();
447 inline void SetLastChar(TInt aLastChar);
450 inline TInt GetLastChar() const;
453 inline TUint16 ReplacedCharacter();
456 inline void SetLastKey(TPtiKey aKey);
459 inline TPtiTextCase VowelCase() const;
462 inline void ResetVietnameseVowelSequenceAndToneMarks();
465 inline TPtiKey LastKey() const;
468 * Returns all keymapping data for current key, excluding first character
469 * (which is expected to be "get all"-control character).
471 * @param aCase Text case for which data will be returned.
472 * @return Constant descriptor pointing to keymap data.
475 TPtrC GetAll(TPtiTextCase aCase);
478 inline void SetFlag(TInt aFlag);
481 inline void ResetFlag(TInt aFlag);
484 * Fills given array with numeric mode mappings defined in keymap data file.
485 * Resultin array contains those mappings that are given with "numeric_mode_key"
486 * tag in keymap data file.
489 * @param aResult An array to be filled with numeric mode mappings.
491 void GetNumericModeKeysFromDataL(RArray<TPtiNumericKeyBinding>& aResult);
494 * Set keyboard type to be used with qwerty keymappings. Default
495 * type is EPtiKeyboardStandard4x12 (Nokia E70 style).
497 * @param aKeyboardType Keyboard type to be set.
498 * @return KErrNone if keyboard type was set.
499 * EErrNotSupported if mapping data does not have block for given keyboard type.
501 IMPORT_C TInt SetKeyboardType(TPtiKeyboardType aKeyboardType);
504 * Returns a boolean value indicating whether there is data block available for
505 * given keyboard type.
507 * @param aKeyboardType Keyboard type.
508 * @return ETrue if there is data block for given keyboard type.
511 IMPORT_C TBool HasDataBlockForKeyboardType(TPtiKeyboardType aKeyboardType) const;
516 EDeadKeyRootFlag = 0x01,
517 EVowelSeqFlag = 0x02,
518 EPrevKeyInUpperCase = 0x04,
519 ETrackVietnameseToneMarksAndVowels = 0x08
523 CPtiQwertyKeyMappings();
524 CPtiQwertyKeyMappings(CPtiKeyMapData* aData);
527 TUint16 NextChar(TPtiTextCase aCase);
528 void KeyCodeToInternal(TPtiKey aKey);
529 TUint16 GetDeadKeyChar(TPtiKey aKey, TPtiTextCase aCase);
530 inline TInt DeadKeyIndex(TUint16 aDeadKeyUnicode);
531 inline TBool IsDeadKeyCode(TUint16 aChar) const;
532 inline TBool IsModeControlChar(TUint16 aChar) const;
533 TUint16 GetCharForMode(TPtiEngineInputMode aMode, TPtrC aChars, TBool aSkipFirst);
534 TBool DoesModeCharMatchToInputMode(TUint16 aChar, TPtiEngineInputMode aMode) const;
535 TUint16 VowelSequence(TPtiKey aKey1, TPtiKey aKey2, TPtiTextCase aCase) const;
536 TUint16 VietnameseToneMark(TUint16 aPrevChar, TPtiKey aKey);
537 TUint16 RepeatingVowelSequence(TPtiKey aKey);
538 TPtiKey VowelSeqRootKey(TUint16 aChar);
539 inline TBool ChineseChrModeConversionNeeded(TPtiTextCase aCase, TPtiEngineInputMode aMode) const;
540 inline TBool IsChnSpecialCharKey(TPtiKey aKey) const;
543 RArray<TPtiKeyMapping> iReservedArray;
546 TUint16 iDeadKeyRootChar;
547 TUint16 iVowelSeqResult;
550 CPtiQwertyKeymappingsExtension* iExtension;
555 * CPtiHalfQwertyKeyMappings
557 * Keymappings implementation class for half qwerty keyboard
560 NONSHARABLE_CLASS(CPtiHalfQwertyKeyMappings) : public CPtiKeyMappings
563 IMPORT_C static CPtiHalfQwertyKeyMappings* NewL(CPtiKeyMapData* aData);
564 IMPORT_C ~CPtiHalfQwertyKeyMappings();
566 public: // From MPtiKeyMappings
567 IMPORT_C TInt ReplaceKeyMapL(TPtiKey aKey, TDesC& aMap, TPtiTextCase aCase);
568 IMPORT_C TPtiKey KeyForCharacter(TUint16 aChar);
569 IMPORT_C TPtrC GetAll(TPtiTextCase aCase);
572 * Fills given array with numeric mode mappings defined in keymap data file.
573 * Resultin array contains those mappings that are given with "numeric_mode_key"
574 * tag in keymap data file.
577 * @param aResult An array to be filled with numeric mode mappings.
579 void GetNumericModeKeysFromDataL(RArray<TPtiNumericKeyBinding>& aResult);
582 * Returns keymapping data for given key.
585 * @param aKey A key to be queried.
586 * @param aResult Descritor where resulting data is stored.
587 * @param aCase Text case
589 IMPORT_C void GetDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase);
591 * Starts mapping new key. Will return first character bound to given
592 * key in given text case.
594 * @param aKey A key to be mapped.
595 * @param aCase Text case for mapping operation.
596 * @param aMode Input mode for mapping. This is needed if keymapping data contains
597 * characters for several input modes (used mainly with Chinese
598 * modes). This value will be matched to possible input mode control
599 * characters in keymapping data.
600 * @return First character bound to requested key.
602 IMPORT_C TUint16 StartMapping(TPtiKey aKey, TPtiTextCase aCase,
603 TPtiEngineInputMode aMode = EPtiEngineInputModeNone);
606 * Continues keymapping sequence. This method should be called when key event
607 * comes in while multitapping timer is active. Takes care of cycling through
608 * multitapping candidates associated for given key.
611 * @param aKey A key to be mapped.
612 * @param aAppend Refernce to boolen variable. This will be set to ETrue if current character in
613 * editor should be replaced (new chr-case character was found) and
614 * to EFalse if new character should inserted instead.
615 * @param aCase Text case for mapping operation.
616 * @return Next character assosiated to given key or the first character if aKey
617 * was different key than previous key press.
619 IMPORT_C TUint16 NextKey(TPtiKey aKey, TBool &aAppend, TPtiTextCase aCase);
621 TUint16 NextChar(TPtiTextCase aCase);
624 CPtiHalfQwertyKeyMappings(CPtiKeyMapData* aData);
627 // ---------------------------------------------------------------------------
628 // CPtiKeyMappings::CurrentKey
630 // ---------------------------------------------------------------------------
632 inline TPtiKey CPtiKeyMappings::CurrentKey()
637 // ---------------------------------------------------------------------------
638 // CPtiQwertyKeyMappings::CurrentKey
640 // ---------------------------------------------------------------------------
642 inline TPtiKey CPtiQwertyKeyMappings::CurrentKey()
647 // ---------------------------------------------------------------------------
648 // CPtiQwertyKeyMappings::DeadKeyIndex
650 // ---------------------------------------------------------------------------
652 inline TInt CPtiQwertyKeyMappings::DeadKeyIndex(TUint16 aDeadKeyUnicode)
654 return (aDeadKeyUnicode & 0x00ff);
657 // ---------------------------------------------------------------------------
658 // CPtiQwertyKeyMappings::IsDeadKeyCode
660 // ---------------------------------------------------------------------------
662 inline TBool CPtiQwertyKeyMappings::IsDeadKeyCode(TUint16 aChar) const
664 if (((aChar & 0xff00) == 0xf000) &&
665 ((aChar & 0xff) <= 5))
673 // ---------------------------------------------------------------------------
674 // CPtiQwertyKeyMappings::DeadKeyRootFlag
676 // ---------------------------------------------------------------------------
678 inline TBool CPtiQwertyKeyMappings::DeadKeyRootFlag() const
680 return (iFlags & EDeadKeyRootFlag) != 0;
683 // ---------------------------------------------------------------------------
684 // CPtiQwertyKeyMappings::IsModeControlChar
686 // ---------------------------------------------------------------------------
688 inline TBool CPtiQwertyKeyMappings::IsModeControlChar(TUint16 aChar) const
690 if ((aChar == KPtiPinyinMarker) ||
691 (aChar == KPtiStrokeMarker) ||
692 (aChar == KPtiZhuyinMarker) ||
693 (aChar == KPtiCangjieMarker))
701 // ---------------------------------------------------------------------------
702 // CPtiQwertyKeyMappings::VowelSequenceFlag
704 // ---------------------------------------------------------------------------
706 inline TBool CPtiQwertyKeyMappings::VowelSequenceFlag() const
708 return (iFlags & EVowelSeqFlag) != 0;
711 // ---------------------------------------------------------------------------
712 // CPtiQwertyKeyMappings::SetFlag
714 // ---------------------------------------------------------------------------
716 inline void CPtiQwertyKeyMappings::SetFlag(TInt aFlag)
721 // ---------------------------------------------------------------------------
722 // CPtiQwertyKeyMappings::ResertFlag
724 // ---------------------------------------------------------------------------
726 inline void CPtiQwertyKeyMappings::ResetFlag(TInt aFlag)
731 // ---------------------------------------------------------------------------
732 // CPtiQwertyKeyMappings::VowelSequenceResult
734 // ---------------------------------------------------------------------------
736 inline TUint16 CPtiQwertyKeyMappings::VowelSequenceResult() const
738 return iVowelSeqResult;
741 // ---------------------------------------------------------------------------
742 // CPtiQwertyKeyMappings::ClearVowelSequence
744 // ---------------------------------------------------------------------------
746 inline void CPtiQwertyKeyMappings::ClearVowelSequence()
748 iLastKey = EPtiKeyNone;
751 // ---------------------------------------------------------------------------
752 // CPtiQwertyKeyMappings::DeadKeyRootChar
754 // ---------------------------------------------------------------------------
756 inline TUint16 CPtiQwertyKeyMappings::DeadKeyRootChar() const
758 return iDeadKeyRootChar;
761 // ---------------------------------------------------------------------------
762 // CPtiQwertyKeyMappings::DeadKey
764 // ---------------------------------------------------------------------------
766 inline TInt16 CPtiQwertyKeyMappings::DeadKey() const
771 // ---------------------------------------------------------------------------
772 // CPtiQwertyKeyMappings::ClearDeadKey
774 // ---------------------------------------------------------------------------
776 inline void CPtiQwertyKeyMappings::ClearDeadKey()
781 // ---------------------------------------------------------------------------
782 // CPtiQwertyKeyMappings::ClearLastChar
784 // ---------------------------------------------------------------------------
786 inline void CPtiQwertyKeyMappings::ClearLastChar()
788 iExtension->iLastChar = 0;
791 // ---------------------------------------------------------------------------
792 // CPtiQwertyKeyMappings::SetLastChar
794 // ---------------------------------------------------------------------------
796 inline void CPtiQwertyKeyMappings::SetLastChar(TInt aLastChar)
798 iExtension->iLastChar = (TUint16)aLastChar;
801 // ---------------------------------------------------------------------------
802 // CPtiQwertyKeyMappings::GetLastChar
804 // ---------------------------------------------------------------------------
806 inline TInt CPtiQwertyKeyMappings::GetLastChar() const
808 return iExtension->iLastChar;
811 // ---------------------------------------------------------------------------
812 // CPtiQwertyKeyMappings::ReplacedCharacter
814 // ---------------------------------------------------------------------------
816 inline TUint16 CPtiQwertyKeyMappings::ReplacedCharacter()
818 return iExtension->iReplaced;
821 // ---------------------------------------------------------------------------
822 // CPtiQwertyKeyMappings::SetLastKey
824 // ---------------------------------------------------------------------------
826 inline void CPtiQwertyKeyMappings::SetLastKey(TPtiKey aKey)
831 // ---------------------------------------------------------------------------
832 // CPtiQwertyKeyMappings::KeyCodeToInternal
834 // ---------------------------------------------------------------------------
836 inline void CPtiKeyMappings::KeyCodeToInternal(TPtiKey aKey)
841 // ---------------------------------------------------------------------------
842 // CPtiQwertyKeyMappings::VowelCase
844 // ---------------------------------------------------------------------------
846 inline TPtiTextCase CPtiQwertyKeyMappings::VowelCase() const
848 return iExtension->iVowelCase;
851 // ---------------------------------------------------------------------------
852 // CPtiQwertyKeyMappings::ResetVietnameseVowelSequenceAndToneMarks
854 // ---------------------------------------------------------------------------
856 inline void CPtiQwertyKeyMappings::ResetVietnameseVowelSequenceAndToneMarks()
858 iExtension->iLastChar = 0;
859 iExtension->iReplaced = 0;
860 iExtension->iLastTone = 0;
862 iLastKey = EPtiKeyNone;
863 ResetFlag(EVowelSeqFlag);
866 // ---------------------------------------------------------------------------
867 // CPtiQwertyKeyMappings::LastKey
869 // ---------------------------------------------------------------------------
871 inline TPtiKey CPtiQwertyKeyMappings::LastKey() const
876 // ---------------------------------------------------------------------------
877 // CPtiQwertyKeyMappings::ChineseChrModeConversionNeeded
879 // ---------------------------------------------------------------------------
881 inline TBool CPtiQwertyKeyMappings::ChineseChrModeConversionNeeded(TPtiTextCase aCase,
882 TPtiEngineInputMode aMode) const
884 if (aCase == EPtiCaseChrLower &&
885 (aMode == EPtiEnginePinyinQwerty || aMode == EPtiEnginePinyinPhraseQwerty ||
886 aMode == EPtiEngineStrokeQwerty || aMode ==EPtiEngineNormalCangjieQwerty ||
887 aMode == EPtiEngineZhuyinQwerty || aMode == EPtiEngineZhuyinPhraseQwerty ||
888 aMode == EPtiEngineStrokePhraseQwerty))
896 // ---------------------------------------------------------------------------
897 // CPtiKeyMappings::DeQwertyfyCaseValue
899 // ---------------------------------------------------------------------------
901 inline void CPtiKeyMappings::DeQwertyfyCaseValue(TPtiTextCase& aCase)
903 if (aCase == EPtiCaseChrLower)
905 aCase = EPtiCaseLower;
907 else if (aCase == EPtiCaseChrUpper)
909 aCase = EPtiCaseUpper;
913 // ---------------------------------------------------------------------------
914 // CPtiKeyMappings::KeyMapData
916 // ---------------------------------------------------------------------------
918 inline CPtiKeyMapData* CPtiMappings::KeyMapData() const
923 // ---------------------------------------------------------------------------
924 // CPtiKeyMappings::IsChnSpecialCharKey
926 // ---------------------------------------------------------------------------
928 inline TBool CPtiQwertyKeyMappings::IsChnSpecialCharKey(TPtiKey aKey) const
930 if (aKey == EPtiKeyQwertyPlus ||
931 aKey == EPtiKeyQwertyMinus ||
932 aKey == EPtiKeyQwertyComma ||
933 aKey == EPtiKeyQwertySemicolon ||
934 aKey == EPtiKeyQwertyFullstop ||
935 aKey == EPtiKeyQwertyHash ||
936 aKey == EPtiKeyQwertySlash ||
937 aKey == EPtiKeyQwertyApostrophe)
945 #endif // _PTI_KEY_MAPPINGS_H