textinput/peninputgenericitut/src/peninputitutchnuistatestrokezhuyincomposition.cpp
branchRCL_3
changeset 8 4eb1ae11334f
parent 7 6defe5d1bd39
equal deleted inserted replaced
7:6defe5d1bd39 8:4eb1ae11334f
    27 #include "peninputitutchnuistatestrokezhuyincomposition.h"
    27 #include "peninputitutchnuistatestrokezhuyincomposition.h"
    28 #include "peninputgenericitutuimgrbase.h"
    28 #include "peninputgenericitutuimgrbase.h"
    29 #include "peninputgenericitutdatamgr.h"
    29 #include "peninputgenericitutdatamgr.h"
    30 #include "peninputgenericitutlayoutcontext.h"
    30 #include "peninputgenericitutlayoutcontext.h"
    31 #include "peninputgenericitutconverter.h"
    31 #include "peninputgenericitutconverter.h"
       
    32 #include "peninputgenericitutwindowmanager.h"
    32 
    33 
    33 CChnItutUiStateStrokeZhuyinComposition* CChnItutUiStateStrokeZhuyinComposition::NewL(
    34 CChnItutUiStateStrokeZhuyinComposition* CChnItutUiStateStrokeZhuyinComposition::NewL(
    34     CGenericItutUiMgrBase* aOwner)
    35     CGenericItutUiMgrBase* aOwner)
    35     {
    36     {
    36     CChnItutUiStateStrokeZhuyinComposition* self = 
    37     CChnItutUiStateStrokeZhuyinComposition* self = 
   114 void CChnItutUiStateStrokeZhuyinComposition::OnExit()
   115 void CChnItutUiStateStrokeZhuyinComposition::OnExit()
   115     {
   116     {
   116     // hide dropdownlist & reset its status
   117     // hide dropdownlist & reset its status
   117     CFepCtrlDropdownList* candlist = 
   118     CFepCtrlDropdownList* candlist = 
   118         static_cast<CFepCtrlDropdownList*>(iOwner->LayoutContext()->Control(ECtrlIdStdCandsList));
   119         static_cast<CFepCtrlDropdownList*>(iOwner->LayoutContext()->Control(ECtrlIdStdCandsList));
   119     candlist->ResetAndClear(CFepCtrlDropdownList::EListExpandable);
       
   120     iOwner->DataMgr()->ClearChnCandidates(EItutCandidates);
   120     iOwner->DataMgr()->ClearChnCandidates(EItutCandidates);
   121     candlist->Hide(ETrue);
   121     candlist->Hide(ETrue);
   122 
   122 
   123     CFepInputContextField* spellctrl = 
   123     CFepInputContextField* spellctrl = 
   124         static_cast<CFepInputContextField*>(iOwner->LayoutContext()->Control(ECtrlIdSpellICF));
   124         static_cast<CFepInputContextField*>(iOwner->LayoutContext()->Control(ECtrlIdSpellICF));
   125 
       
   126     spellctrl->Hide(ETrue);
   125     spellctrl->Hide(ETrue);
   127 
       
   128     //show indicator 
       
   129     iOwner->LayoutContext()->Control(ECtrlIdIndicator)->Hide(EFalse);
       
   130     // Hide ICF, Backspace, Arrow contrls when exit to avoid flick
       
   131     iOwner->LayoutContext()->Control(ECtrlIdICF)->Hide( ETrue );
       
   132     iOwner->LayoutContext()->Control(ECtrlIdBackspace)->Hide(ETrue);
       
   133     iOwner->LayoutContext()->ShowArrowBtn(0);
       
   134     iOwner->DataMgr()->PtiEngine()->ClearCurrentWord();
   126     iOwner->DataMgr()->PtiEngine()->ClearCurrentWord();
   135     }
   127     }
   136 
   128 
   137 TBool CChnItutUiStateStrokeZhuyinComposition::HandleKeyL(TInt /*aCmd*/, TInt aKey)
   129 TBool CChnItutUiStateStrokeZhuyinComposition::HandleKeyL(TInt /*aCmd*/, TInt aKey)
   138     {
   130     {
   283             }
   275             }
   284             break;
   276             break;
   285         // consume star key at zhuyin composition state
   277         // consume star key at zhuyin composition state
   286         case EEventRawKeyDownEvent:
   278         case EEventRawKeyDownEvent:
   287             {
   279             {
   288             const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
   280             if ( iOwner->UiManager()->IsAllowHandleRawKeyEvent())
   289             
   281             	{
   290             if (key->iScanCode == EStdKeyNkpAsterisk && iOwner->DataMgr()->InputMode() == EZhuyin)
   282 				const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
   291                 {
   283 				
   292                 HandleKeyL(ECmdPenInputFingerKeyPress, EPtiKeyStar);
   284 				if (key->iScanCode == EStdKeyNkpAsterisk && iOwner->DataMgr()->InputMode() == EZhuyin)
   293                 return ETrue;
   285 					{
   294                 }
   286 					HandleKeyL(ECmdPenInputFingerKeyPress, EPtiKeyStar);
       
   287 					return ETrue;
       
   288 					}
       
   289             	}
   295             }
   290             }
   296             break;
   291             break;
   297         case EEventRawKeyUpEvent:
   292         case EEventRawKeyUpEvent:
   298             {
   293             {
   299             const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
   294             if ( iOwner->UiManager()->IsAllowHandleRawKeyEvent())
   300             
   295             	{
   301             if (key->iScanCode == EStdKeyNkpAsterisk && iOwner->DataMgr()->InputMode() == EZhuyin)
   296 				const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
   302                 {
   297 				
   303                 return ETrue;
   298 				if (key->iScanCode == EStdKeyNkpAsterisk && iOwner->DataMgr()->InputMode() == EZhuyin)
   304                 }
   299 					{
       
   300 					return ETrue;
       
   301 					}
       
   302             	}
   305             }
   303             }
   306             break;
   304             break;
   307         default:
   305         default:
   308             break;
   306             break;
   309         }
   307         }