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 |
|
129 // CONSTANTS |
126 // CONSTANTS |
130 const TInt16 KStrokeHorizontalValue = 0x4e00; |
127 const TInt16 KStrokeHorizontalValue = 0x4e00; |
131 const TInt16 KStrokeVerticalValue = 0x4e28; |
128 const TInt16 KStrokeVerticalValue = 0x4e28; |
132 const TInt16 KStrokeDownToLeftValue = 0x4e3f; |
129 const TInt16 KStrokeDownToLeftValue = 0x4e3f; |
133 const TInt16 KStrokeDownToRightValue = 0x4e36; |
130 const TInt16 KStrokeDownToRightValue = 0x4e36; |
134 const TInt16 KStrokeBendingValue = 0x4e5b; |
131 const TInt16 KStrokeBendingValue = 0x4e5b; |
135 const TInt16 KStrokeQuestionValue = 0x003f; |
132 const TInt16 KStrokeQuestionValue = 0x003f; |
136 const TInt16 KStrokeUnicode = 0x2461; |
133 const TInt16 KStrokeUnicode = 0x2461; |
137 const TInt16 KZhuyinIndicator = 0x2462; |
134 const TInt16 KZhuyinIndicator = 0x2462; |
138 const TInt16 KPinyinIndicator = 0x2460; |
135 const TInt16 KPinyinIndicator = 0x2460; |
139 //const TInt16 KStrokeIndicator = 0x2461; |
|
140 const TInt16 KCanjieIndicator = 0x2463; |
136 const TInt16 KCanjieIndicator = 0x2463; |
141 const TInt16 KChineseTone1 = 0x02c9; |
137 const TInt16 KChineseTone1 = 0x02c9; |
142 const TInt16 KChineseTone2 = 0x02ca; |
138 const TInt16 KChineseTone2 = 0x02ca; |
143 const TInt16 KChineseTone3 = 0x02c7; |
139 const TInt16 KChineseTone3 = 0x02c7; |
144 const TInt16 KChineseTone4 = 0x02cb; |
140 const TInt16 KChineseTone4 = 0x02cb; |
145 const TInt16 KChineseTone0 = 0x02d9; |
141 const TInt16 KChineseTone0 = 0x02d9; |
146 |
|
147 const TUid KPtiSogouCoreUid = { 0x20031DD6 }; |
|
148 |
|
149 /** |
142 /** |
150 * CAknFepUIManagerChinese class. |
143 * CAknFepUIManagerChinese class. |
151 * |
144 * |
152 */ |
145 */ |
153 |
146 |
1172 void CAknFepUIManagerChinese::ChangeStateQwerty(TUIState aState) |
1165 void CAknFepUIManagerChinese::ChangeStateQwerty(TUIState aState) |
1173 { |
1166 { |
1174 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1167 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1175 TPtiKeyboardType kbdType = iFepMan->KeyboardLayout(); |
1168 TPtiKeyboardType kbdType = iFepMan->KeyboardLayout(); |
1176 #endif |
1169 #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 |
|
1182 switch(aState) |
1170 switch(aState) |
1183 { |
1171 { |
1184 case EQwerty: |
1172 case EQwerty: |
1185 if(iMode == EPinyin || iMode == EStroke || iMode == EZhuyin || iMode == ECangJie) |
1173 if(iMode == EPinyin || iMode == EStroke || iMode == EZhuyin || iMode == ECangJie) |
1186 { |
1174 { |
1309 EPtiKeyboardQwerty3x11 == kbdType || |
1297 EPtiKeyboardQwerty3x11 == kbdType || |
1310 EPtiKeyboardCustomQwerty == kbdType) |
1298 EPtiKeyboardCustomQwerty == kbdType) |
1311 { |
1299 { |
1312 iFepUiState = TAknFepInputStateEntryMiniQwertyStrokePhrase( |
1300 iFepUiState = TAknFepInputStateEntryMiniQwertyStrokePhrase( |
1313 this, iContainerPane); |
1301 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 } |
|
1322 } |
1302 } |
1323 else if (EPtiKeyboardHalfQwerty == kbdType) |
1303 else if (EPtiKeyboardHalfQwerty == kbdType) |
1324 { |
1304 { |
1325 iFepUiState= TAknFepInputStateEntryHalfQwertyStrokePhrase(this, iContainerPane); |
1305 iFepUiState= TAknFepInputStateEntryHalfQwertyStrokePhrase(this, iContainerPane); |
1326 } |
1306 } |
1419 if ( EPtiKeyboardQwerty4x10 == kbdType || |
1399 if ( EPtiKeyboardQwerty4x10 == kbdType || |
1420 EPtiKeyboardQwerty3x11 == kbdType || |
1400 EPtiKeyboardQwerty3x11 == kbdType || |
1421 EPtiKeyboardCustomQwerty == kbdType) |
1401 EPtiKeyboardCustomQwerty == kbdType) |
1422 { |
1402 { |
1423 iFepUiState = TAknFepUiInputStateCandidateMiniQwertyStrokePhrase(this, iContainerPane); |
1403 iFepUiState = TAknFepUiInputStateCandidateMiniQwertyStrokePhrase(this, iContainerPane); |
1424 // If sogou core is in use, set plugin to the state |
1404 } |
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 } |
|
1433 else if ( EPtiKeyboardHalfQwerty == kbdType ) |
1405 else if ( EPtiKeyboardHalfQwerty == kbdType ) |
1434 { |
1406 { |
1435 iFepUiState=TAknFepUiInputStateCandidateHalfQwertyChinesePhrase( this, iContainerPane); |
1407 iFepUiState=TAknFepUiInputStateCandidateHalfQwertyChinesePhrase( this, iContainerPane); |
1436 } |
1408 } |
1437 } |
1409 } |
1494 EPtiKeyboardQwerty3x11 == kbdType || |
1466 EPtiKeyboardQwerty3x11 == kbdType || |
1495 EPtiKeyboardCustomQwerty == kbdType) |
1467 EPtiKeyboardCustomQwerty == kbdType) |
1496 { |
1468 { |
1497 iFepUiState = TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1469 iFepUiState = TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1498 this, iContainerPane); |
1470 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 } |
|
1508 } |
1471 } |
1509 #ifdef __HALF_QWERTY_KEYPAD |
1472 #ifdef __HALF_QWERTY_KEYPAD |
1510 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1473 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1511 { |
1474 { |
1512 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1475 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1524 EPtiKeyboardCustomQwerty == kbdType) |
1487 EPtiKeyboardCustomQwerty == kbdType) |
1525 { |
1488 { |
1526 iFepUiState = |
1489 iFepUiState = |
1527 TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1490 TAknFepInputStatePredictiveCandidateMiniQwertyChinesePhrase( |
1528 this, iContainerPane); |
1491 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 } |
|
1537 } |
1492 } |
1538 #ifdef __HALF_QWERTY_KEYPAD |
1493 #ifdef __HALF_QWERTY_KEYPAD |
1539 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1494 else if( EPtiKeyboardHalfQwerty == kbdType ) |
1540 { |
1495 { |
1541 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1496 iFepUiState = TAknFepInputStatePredictiveCandidateHalfQwertyChinesePhrase( |
1572 EPtiKeyboardQwerty3x11 == kbdType || |
1527 EPtiKeyboardQwerty3x11 == kbdType || |
1573 EPtiKeyboardHalfQwerty == kbdType || |
1528 EPtiKeyboardHalfQwerty == kbdType || |
1574 EPtiKeyboardCustomQwerty == kbdType) |
1529 EPtiKeyboardCustomQwerty == kbdType) |
1575 { |
1530 { |
1576 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase/*TAknFepInputStatePredictiveInputQwertyPinyinPhrase*/(this, iContainerPane); |
1531 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 } |
|
1586 } |
1532 } |
1587 else |
1533 else |
1588 { |
1534 { |
1589 #endif |
1535 #endif |
1590 iFepUiState = TAknFepInputStatePredictiveInputQwertyPinyinPhrase( |
1536 iFepUiState = TAknFepInputStatePredictiveInputQwertyPinyinPhrase( |
1608 EPtiKeyboardHalfQwerty == kbdType || |
1554 EPtiKeyboardHalfQwerty == kbdType || |
1609 EPtiKeyboardCustomQwerty == kbdType) |
1555 EPtiKeyboardCustomQwerty == kbdType) |
1610 { |
1556 { |
1611 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase( |
1557 iFepUiState = TAknFepInputStatePredictiveInputMiniQwertyChinesePhrase( |
1612 this, iContainerPane); |
1558 this, iContainerPane); |
1613 // If sogou core is in use, set plugin to the state |
1559 } |
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 } |
|
1622 else |
1560 else |
1623 { |
1561 { |
1624 #endif |
1562 #endif |
1625 iFepUiState = TAknFepInputStatePredictiveInputQwertyStrokePhrase( |
1563 iFepUiState = TAknFepInputStatePredictiveInputQwertyStrokePhrase( |
1626 this, iContainerPane); |
1564 this, iContainerPane); |