equal
deleted
inserted
replaced
121 #include <PtiDefs.h> |
121 #include <PtiDefs.h> |
122 |
122 |
123 #include <avkon.rsg> //phrase creation |
123 #include <avkon.rsg> //phrase creation |
124 #include <aknfep.rsg> |
124 #include <aknfep.rsg> |
125 |
125 |
|
126 #include "aknfepuiinputminiqwertysogoupinyinphraseplugin.h" |
|
127 #include "aknfepuiinputminiqwertysogoustrokephraseplugin.h" |
|
128 |
126 // CONSTANTS |
129 // CONSTANTS |
127 const TInt16 KStrokeHorizontalValue = 0x4e00; |
130 const TInt16 KStrokeHorizontalValue = 0x4e00; |
128 const TInt16 KStrokeVerticalValue = 0x4e28; |
131 const TInt16 KStrokeVerticalValue = 0x4e28; |
129 const TInt16 KStrokeDownToLeftValue = 0x4e3f; |
132 const TInt16 KStrokeDownToLeftValue = 0x4e3f; |
130 const TInt16 KStrokeDownToRightValue = 0x4e36; |
133 const TInt16 KStrokeDownToRightValue = 0x4e36; |
138 const TInt16 KChineseTone1 = 0x02c9; |
141 const TInt16 KChineseTone1 = 0x02c9; |
139 const TInt16 KChineseTone2 = 0x02ca; |
142 const TInt16 KChineseTone2 = 0x02ca; |
140 const TInt16 KChineseTone3 = 0x02c7; |
143 const TInt16 KChineseTone3 = 0x02c7; |
141 const TInt16 KChineseTone4 = 0x02cb; |
144 const TInt16 KChineseTone4 = 0x02cb; |
142 const TInt16 KChineseTone0 = 0x02d9; |
145 const TInt16 KChineseTone0 = 0x02d9; |
|
146 |
|
147 const TUid KPtiSogouCoreUid = { 0x20031DD6 }; |
|
148 |
143 /** |
149 /** |
144 * CAknFepUIManagerChinese class. |
150 * CAknFepUIManagerChinese class. |
145 * |
151 * |
146 */ |
152 */ |
147 |
153 |
1166 void CAknFepUIManagerChinese::ChangeStateQwerty(TUIState aState) |
1172 void CAknFepUIManagerChinese::ChangeStateQwerty(TUIState aState) |
1167 { |
1173 { |
1168 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1174 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1169 TPtiKeyboardType kbdType = iFepMan->KeyboardLayout(); |
1175 TPtiKeyboardType kbdType = iFepMan->KeyboardLayout(); |
1170 #endif |
1176 #endif |
|
1177 |
|
1178 // Get current core id. It is used to judge whether sogou core is in use. |
|
1179 TInt coreID = 0; |
|
1180 TRAP_IGNORE( coreID = PtiEngine()->HandleCommandL( EPtiCommandGetCoreID )); |
|
1181 |
1171 switch(aState) |
1182 switch(aState) |
1172 { |
1183 { |
1173 case EQwerty: |
1184 case EQwerty: |
1174 if(iMode == EPinyin || iMode == EStroke || iMode == EZhuyin || iMode == ECangJie) |
1185 if(iMode == EPinyin || iMode == EStroke || iMode == EZhuyin || iMode == ECangJie) |
1175 { |
1186 { |
1298 EPtiKeyboardQwerty3x11 == kbdType || |
1309 EPtiKeyboardQwerty3x11 == kbdType || |
1299 EPtiKeyboardCustomQwerty == kbdType) |
1310 EPtiKeyboardCustomQwerty == kbdType) |
1300 { |
1311 { |
1301 iFepUiState = TAknFepInputStateEntryMiniQwertyStrokePhrase( |
1312 iFepUiState = TAknFepInputStateEntryMiniQwertyStrokePhrase( |
1302 this, iContainerPane); |
1313 this, iContainerPane); |
|
1314 // If sogou core is in use, set plugin to the state |
|
1315 // machine and enable the plugin. |
|
1316 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1317 { |
|
1318 TAknFepInputMiniQwertySogouStrokePhrasePlugin plugin( this, iContainerPane, EEntry ); |
|
1319 plugin.Enable( ETrue ); |
|
1320 iFepUiState.SetStrokePlugin( plugin ); |
|
1321 } |
1303 } |
1322 } |
1304 else if (EPtiKeyboardHalfQwerty == kbdType) |
1323 else if (EPtiKeyboardHalfQwerty == kbdType) |
1305 { |
1324 { |
1306 iFepUiState= TAknFepInputStateEntryHalfQwertyStrokePhrase(this, iContainerPane); |
1325 iFepUiState= TAknFepInputStateEntryHalfQwertyStrokePhrase(this, iContainerPane); |
1307 } |
1326 } |
1400 if ( EPtiKeyboardQwerty4x10 == kbdType || |
1419 if ( EPtiKeyboardQwerty4x10 == kbdType || |
1401 EPtiKeyboardQwerty3x11 == kbdType || |
1420 EPtiKeyboardQwerty3x11 == kbdType || |
1402 EPtiKeyboardCustomQwerty == kbdType) |
1421 EPtiKeyboardCustomQwerty == kbdType) |
1403 { |
1422 { |
1404 iFepUiState = TAknFepUiInputStateCandidateMiniQwertyStrokePhrase(this, iContainerPane); |
1423 iFepUiState = TAknFepUiInputStateCandidateMiniQwertyStrokePhrase(this, iContainerPane); |
1405 } |
1424 // If sogou core is in use, set plugin to the state |
|
1425 // machine and enable the plugin. |
|
1426 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1427 { |
|
1428 TAknFepInputMiniQwertySogouStrokePhrasePlugin plugin( this, iContainerPane, ECandidate ); |
|
1429 plugin.Enable( ETrue ); |
|
1430 iFepUiState.SetStrokePlugin( plugin ); |
|
1431 } |
|
1432 } |
1406 else if ( EPtiKeyboardHalfQwerty == kbdType ) |
1433 else if ( EPtiKeyboardHalfQwerty == kbdType ) |
1407 { |
1434 { |
1408 iFepUiState=TAknFepUiInputStateCandidateHalfQwertyChinesePhrase( this, iContainerPane); |
1435 iFepUiState=TAknFepUiInputStateCandidateHalfQwertyChinesePhrase( this, iContainerPane); |
1409 } |
1436 } |
1410 } |
1437 } |
1467 EPtiKeyboardQwerty3x11 == kbdType || |
1494 EPtiKeyboardQwerty3x11 == kbdType || |
1468 EPtiKeyboardCustomQwerty == kbdType) |
1495 EPtiKeyboardCustomQwerty == kbdType) |
1469 { |
1496 { |
1470 iFepUiState = TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1497 iFepUiState = TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1471 this, iContainerPane); |
1498 this, iContainerPane); |
|
1499 |
|
1500 // If sogou core is in use, set plugin to the state |
|
1501 // machine and enable the plugin. |
|
1502 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1503 { |
|
1504 TAknFepInputMiniQwertySogouPinyinPhrasePlugin plugin( this, iContainerPane, EPredictiveCandidate ); |
|
1505 plugin.Enable( ETrue ); |
|
1506 iFepUiState.SetPlugin( plugin ); |
|
1507 } |
1472 } |
1508 } |
1473 #ifdef __HALF_QWERTY_KEYPAD |
1509 #ifdef __HALF_QWERTY_KEYPAD |
1474 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1510 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1475 { |
1511 { |
1476 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1512 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1488 EPtiKeyboardCustomQwerty == kbdType) |
1524 EPtiKeyboardCustomQwerty == kbdType) |
1489 { |
1525 { |
1490 iFepUiState = |
1526 iFepUiState = |
1491 TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1527 TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1492 this, iContainerPane); |
1528 this, iContainerPane); |
|
1529 // If sogou core is in use, set plugin to the state |
|
1530 // machine and enable the plugin. |
|
1531 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1532 { |
|
1533 TAknFepInputMiniQwertySogouStrokePhrasePlugin plugin( this, iContainerPane, EPredictiveCandidate ); |
|
1534 plugin.Enable( ETrue ); |
|
1535 iFepUiState.SetStrokePlugin( plugin ); |
|
1536 } |
1493 } |
1537 } |
1494 #ifdef __HALF_QWERTY_KEYPAD |
1538 #ifdef __HALF_QWERTY_KEYPAD |
1495 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1539 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1496 { |
1540 { |
1497 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1541 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1528 EPtiKeyboardQwerty3x11 == kbdType || |
1572 EPtiKeyboardQwerty3x11 == kbdType || |
1529 EPtiKeyboardHalfQwerty == kbdType || |
1573 EPtiKeyboardHalfQwerty == kbdType || |
1530 EPtiKeyboardCustomQwerty == kbdType) |
1574 EPtiKeyboardCustomQwerty == kbdType) |
1531 { |
1575 { |
1532 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase/*TAknFepInputStatePredictiveInputQwertyPinyinPhrase*/(this, iContainerPane); |
1576 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase/*TAknFepInputStatePredictiveInputQwertyPinyinPhrase*/(this, iContainerPane); |
|
1577 |
|
1578 // If sogou core is in use, set plugin to the state |
|
1579 // machine and enable the plugin. |
|
1580 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1581 { |
|
1582 TAknFepInputMiniQwertySogouPinyinPhrasePlugin plugin( this, iContainerPane, EPredictiveInput ); |
|
1583 plugin.Enable( ETrue ); |
|
1584 iFepUiState.SetPlugin( plugin ); |
|
1585 } |
1533 } |
1586 } |
1534 else |
1587 else |
1535 { |
1588 { |
1536 #endif |
1589 #endif |
1537 iFepUiState = TAknFepInputStatePredictiveInputQwertyPinyinPhrase( |
1590 iFepUiState = TAknFepInputStatePredictiveInputQwertyPinyinPhrase( |
1555 EPtiKeyboardHalfQwerty == kbdType || |
1608 EPtiKeyboardHalfQwerty == kbdType || |
1556 EPtiKeyboardCustomQwerty == kbdType) |
1609 EPtiKeyboardCustomQwerty == kbdType) |
1557 { |
1610 { |
1558 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase( |
1611 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase( |
1559 this, iContainerPane); |
1612 this, iContainerPane); |
1560 } |
1613 // If sogou core is in use, set plugin to the state |
|
1614 // machine and enable the plugin. |
|
1615 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1616 { |
|
1617 TAknFepInputMiniQwertySogouStrokePhrasePlugin plugin( this, iContainerPane, EPredictiveInput ); |
|
1618 plugin.Enable( ETrue ); |
|
1619 iFepUiState.SetStrokePlugin( plugin ); |
|
1620 } |
|
1621 } |
1561 else |
1622 else |
1562 { |
1623 { |
1563 #endif |
1624 #endif |
1564 iFepUiState = TAknFepInputStatePredictiveInputQwertyStrokePhrase( |
1625 iFepUiState = TAknFepInputStatePredictiveInputQwertyStrokePhrase( |
1565 this, iContainerPane); |
1626 this, iContainerPane); |
1670 { |
1731 { |
1671 iFepUiState = |
1732 iFepUiState = |
1672 TAknFepInputStateEditingMiniQwertyStrokePhrase( |
1733 TAknFepInputStateEditingMiniQwertyStrokePhrase( |
1673 this, |
1734 this, |
1674 iContainerPane); |
1735 iContainerPane); |
|
1736 |
|
1737 // If sogou core is in use, set plugin to the state |
|
1738 // machine and enable the plugin. |
|
1739 if ( TUid::Uid( coreID ) == KPtiSogouCoreUid ) |
|
1740 { |
|
1741 TAknFepInputMiniQwertySogouStrokePhrasePlugin plugin( this, iContainerPane, EMiniQwertyEdit ); |
|
1742 plugin.Enable( ETrue ); |
|
1743 iFepUiState.SetStrokePlugin( plugin ); |
|
1744 } |
1675 } |
1745 } |
1676 #endif |
1746 #endif |
1677 } |
1747 } |
1678 break; |
1748 break; |
1679 default: |
1749 default: |