textinput/peninputgenericitut/src/peninputgenericitutwindowmanager.cpp
branchRCL_3
changeset 44 ecbabf52600f
equal deleted inserted replaced
43:ebd48d2de13c 44:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  drop-down list control
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <aknlayoutscalable_apps.cdl.h>
       
    20 #include <peninputgeneralitutnew.rsg>
       
    21 #include <peninputitutconfig_chinese.rsg>
       
    22 #include <skinlayout.cdl.h>
       
    23 #include <AknsDrawUtils.h>
       
    24 #include <AknsUtils.h>
       
    25 #include <AknUtils.h> 
       
    26 #include <peninputrawkeybutton.h>
       
    27 #include <peninputrepeatbutton.h>
       
    28 #include <peninputcommonbutton.h>
       
    29 #include "peninputrepeatbuttonex.h"
       
    30 #include <AknFepGlobalEnums.h>
       
    31 #include <aknfeppeninputenums.h>
       
    32 #include <peninputdropdownlist.h>
       
    33 #include <peninputlayoutchoicelist.h>
       
    34 #include <peninputscrollablelist.h>
       
    35 #include <s32mem.h>
       
    36 #include <peninputlabel.h>
       
    37 #include <peninputlayoutinputmodechoice.h>
       
    38 #include <peninputlayoutbubblectrl.h>
       
    39 #include <peninputlayoutchoicelist.h>
       
    40 
       
    41 #include "peninputgenericitutwindowmanager.h"
       
    42 #include "peninputgenericitutwindow.h"
       
    43 #include "peninputgenericitutdatamgr.h"
       
    44 #include "peninputgenericitutuimgrbase.h"
       
    45 #include "peninputgenericitutuistatebase.h"
       
    46 #include "peninputgenericitutconverter.h"
       
    47 
       
    48 _LIT(KEmptyString, "");
       
    49 const TInt KPeriodicTimerIntervalSec(2500000);
       
    50 /* Teleca change end, 18.05.2009 ssal */
       
    51 
       
    52 const TInt KSCTPreventTime = 1000 * 1000;
       
    53 
       
    54 TInt PreventSCTTimerCallback( TAny* aData )
       
    55 	{
       
    56 	CGenericItutWindowManager* windowMgr = 
       
    57 			static_cast<CGenericItutWindowManager*>( aData );
       
    58 	windowMgr->SetAllowHandleRawKeyEventFlag( ETrue );
       
    59 	windowMgr->StopPreventSCTTimer();
       
    60 	return 0;
       
    61 	}
       
    62 
       
    63 CGenericItutWindowManager* CGenericItutWindowManager::NewL(CGenericItutUiLayout* aLayoutOwner,
       
    64                                                            CGenericItutDataMgr* aDataMgr)
       
    65     {
       
    66     CGenericItutWindowManager* layout = new (ELeave) 
       
    67                                                 CGenericItutWindowManager(aLayoutOwner,aDataMgr);
       
    68     CleanupStack::PushL(layout);
       
    69     layout->ConstructL();
       
    70     CleanupStack::Pop(layout);
       
    71     return layout;
       
    72     }
       
    73 
       
    74 CGenericItutWindowManager::CGenericItutWindowManager(CGenericItutUiLayout* aLayoutOwner,
       
    75                                                      CGenericItutDataMgr* aDataMgr)
       
    76                                           :iLayoutOwner(aLayoutOwner),
       
    77                                            iDataMgr(aDataMgr),
       
    78                                            iLastRawKeyDown(EStdKeyNull),
       
    79                                            iAllowHandleRawKeyEvent( ETrue ),
       
    80                                            iPreventCSTTimer( NULL )
       
    81                                            
       
    82     {
       
    83     iInEditWordQueryDlg = EFalse;
       
    84     }
       
    85 
       
    86 CGenericItutWindowManager::~CGenericItutWindowManager()
       
    87     {
       
    88     delete iWindow;
       
    89     /* Teleca change begin, 18.05.2009 ssal */
       
    90     if (iInfoTimer)
       
    91     	{
       
    92     	iInfoTimer->Cancel();
       
    93     	}
       
    94    	delete iInfoTimer;
       
    95     /* Teleca change end, 18.05.2009 ssal */
       
    96    	
       
    97 	iPreventCSTTimer->Cancel();
       
    98 	delete iPreventCSTTimer;
       
    99     }
       
   100 
       
   101 void CGenericItutWindowManager::SetPropertyL(MItutPropertySubscriber::TItutProperty aPropertyName, 
       
   102                                         const TDesC& aPropertyValue)
       
   103     {
       
   104     iWindow->SetPropertyL(aPropertyName, aPropertyValue);
       
   105     
       
   106     }
       
   107 
       
   108 void CGenericItutWindowManager::ConstructL()
       
   109     {
       
   110     iWindow = CGenericItutWindow::NewL(this, iLayoutOwner,iDataMgr);
       
   111     /* Teleca change begin, 18.05.2009 ssal */
       
   112     iInfoTimer = CPeriodic::NewL(CActive::EPriorityStandard);
       
   113     /* Teleca change end, 18.05.2009 ssal */
       
   114     
       
   115     iPreventCSTTimer = CPeriodic::NewL( CActive::EPriorityStandard );
       
   116     }
       
   117 
       
   118 void CGenericItutWindowManager::SimulateRawEvent(TInt aScanCode, TRawEvent::TType aType)
       
   119     {
       
   120     iLayoutOwner->SimulateRawEvent(aScanCode, aType);
       
   121     }
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 // Simulate raw event to window server immediately.
       
   125 // simulating raw event command won't be scheduled by AO 
       
   126 // because it won't be added into CPeninputAnimObj::iAnimCmd.
       
   127 // ---------------------------------------------------------------------------
       
   128 //    
       
   129 void CGenericItutWindowManager::SimulateImmeRawEvent( TInt aScanCode, TRawEvent::TType aType )
       
   130 	{
       
   131 	iLayoutOwner->SimulateImmeRawEvent(aScanCode, aType );
       
   132 	}
       
   133 
       
   134 void CGenericItutWindowManager::ShowInputModeSwitchL()
       
   135     {
       
   136     iWindow->DisplayInputmodeSwitchL();   
       
   137     }
       
   138                 
       
   139 void CGenericItutWindowManager::HandleCtrlEventL(TInt aEventType, 
       
   140                                                  CFepUiBaseCtrl* aCtrl, 
       
   141                                                  const TDesC& aEventData)
       
   142     {
       
   143     switch(aEventType)
       
   144         {
       
   145         case EEventRawKeyDownEvent:
       
   146             {
       
   147             if ( iAllowHandleRawKeyEvent )
       
   148             	{
       
   149 				const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
       
   150 				SimulateRawEvent(key->iScanCode,TRawEvent::EKeyDown);
       
   151 				SetLastRawKeyDown(key->iScanCode, ETrue, aCtrl);
       
   152             	}
       
   153             }
       
   154             break;
       
   155         case EEventRawKeyUpEvent:
       
   156             {
       
   157             if ( iAllowHandleRawKeyEvent )
       
   158             	{
       
   159 				const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr());
       
   160 				SimulateRawEvent(key->iScanCode,TRawEvent::EKeyUp);
       
   161 				SetLastRawKeyDown(key->iScanCode, EFalse, aCtrl);
       
   162             	}
       
   163             }
       
   164             break;
       
   165         case EItutCmdEnterSpellMode:
       
   166             {
       
   167             StartPreventSCTTimer();
       
   168             iLayoutOwner->SignalOwner(ESignalEnterSpellMode);
       
   169             }
       
   170             break;        
       
   171         case EEventButtonUp:
       
   172             {
       
   173             if ( iAllowHandleRawKeyEvent )
       
   174             	{
       
   175 				//from pen input switch button
       
   176 				if (aCtrl->ControlId() == ECtrlIdSwitch)
       
   177 					{
       
   178 					TRAP_IGNORE( iWindow->Icf()->UpdateSecretTextL() );
       
   179 					ShowInputModeSwitchL();
       
   180 					}
       
   181 				else if (aCtrl->ControlId() == ECtrlIdArrowUp)
       
   182 					{
       
   183 					TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL(
       
   184 															  CFepLayoutMultiLineIcf::EArrowUp));
       
   185 					}
       
   186 				else if (aCtrl->ControlId() == ECtrlIdArrowDown)
       
   187 					{
       
   188 					TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL(
       
   189 															  CFepLayoutMultiLineIcf::EArrowDown));
       
   190 					}
       
   191 				else if (aCtrl->ControlId() == ECtrlIdClose)
       
   192 					{
       
   193 					iLayoutOwner->SignalOwner(ESignalLayoutClosed);
       
   194 					}
       
   195 				else if (aCtrl->ControlId() == ECtrlIdOptions)
       
   196 					{
       
   197 					iLayoutOwner->SignalOwner(ESignalLaunchOptionsMenu);
       
   198 	//                static_cast<CAknFepCtrlCommonButton*>(aCtrl)->SetDimmed(ETrue);
       
   199 					}
       
   200 				else if (aCtrl->ControlId() == ECtrlIdIndicator)
       
   201 					{
       
   202 					iLayoutOwner->SignalOwner(ESignalGetEditMenuData);
       
   203 					}
       
   204             	}
       
   205             }
       
   206             break;
       
   207         case EItutCmdArrowUp:
       
   208             {
       
   209             if (aCtrl->ControlId() == ECtrlIdArrowUp)
       
   210                 {
       
   211                 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL(
       
   212                                                           CFepLayoutMultiLineIcf::EArrowUp));
       
   213                 }
       
   214             }
       
   215             break;
       
   216         case EItutCmdArrowDown:
       
   217             {
       
   218             if (aCtrl->ControlId() == ECtrlIdArrowDown)
       
   219                 {
       
   220                 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL(
       
   221                                                           CFepLayoutMultiLineIcf::EArrowDown));
       
   222                 }
       
   223             }
       
   224             break;
       
   225         case EEventChoiceSelected:
       
   226             {
       
   227             CFepLayoutChoiceList::SEvent* event = 
       
   228                 (CFepLayoutChoiceList::SEvent*)aEventData.Ptr();
       
   229                 
       
   230             if (aCtrl->ControlId() == ECtrlIdInputSwitch)
       
   231                 {
       
   232                 if (event->iIndex == -1)
       
   233                     {
       
   234                     iWindow->InputModeSwitch()->CloseWindow();
       
   235                     break;
       
   236                     }
       
   237 
       
   238                 if (EPluginInputModeItut != event->iCommand)
       
   239                     {
       
   240                     TBool switchByMode = ETrue;
       
   241                     TInt  mode = event->iCommand;
       
   242 
       
   243                     TBuf<8> buf;
       
   244                     buf.Append(reinterpret_cast<TText*>(&switchByMode), 
       
   245                                sizeof(TBool)/sizeof(TText));
       
   246                     buf.Append(reinterpret_cast<TText*>(&mode), 
       
   247                                sizeof(TInt)/sizeof(TText));
       
   248                     iLayoutOwner->SignalOwner(ESignalLayoutUIChanged,buf);
       
   249                     }
       
   250                 }
       
   251             else if (aCtrl->ControlId() == ECtrlIdMatchSelection)
       
   252                 {
       
   253                 if (event->iCommand == EItutCmdPredictItemSelected)
       
   254                     ReportItemSelected(ESignalSelectMatchSelectionText, event->iIndex, ETrue);
       
   255                 else if (event->iCommand == EItutCmdEnterSpellMode)
       
   256                 	{
       
   257 					StartPreventSCTTimer();
       
   258                     iLayoutOwner->SignalOwner(ESignalEnterSpellMode);
       
   259                 	}
       
   260                 }
       
   261             else if (aCtrl->ControlId() == ECtrlIdEditorMenu)
       
   262                 {
       
   263                 if (event->iIndex == -1)
       
   264                     {
       
   265                     iWindow->EditorMenu()->CloseWindow();
       
   266                     break;
       
   267                     }
       
   268                 else
       
   269                     {                        
       
   270                     TInt command = event->iCommand;
       
   271                     TBuf<8> buf;
       
   272                     buf.Append(reinterpret_cast<TText*>(&command), sizeof(TInt)/sizeof(TText));
       
   273                     iLayoutOwner->SignalOwner(ESignalEditorMenuCommand,buf);
       
   274                     }
       
   275                 }                
       
   276             }
       
   277             break;
       
   278         case EEventCapturePointer:
       
   279             {
       
   280             if (iRawKeyDown)
       
   281                 {
       
   282                 SimulateRawEvent(iLastRawKeyDown, TRawEvent::EKeyUp);
       
   283                 iRawKeyCtrl->CancelPointerDownL();
       
   284                 SetLastRawKeyDown(iLastRawKeyDown, EFalse, NULL);
       
   285                 }
       
   286             }
       
   287             break;
       
   288         default:
       
   289             break;
       
   290         };
       
   291     }
       
   292 
       
   293 TInt CGenericItutWindowManager::OnAppEditorTextComing(const TFepInputContextFieldData& aData)
       
   294     {
       
   295     TRAPD(err, iWindow->Icf()->SetTextL(aData));
       
   296 
       
   297     if (!iWindow->MatchSelection()->Hiden())
       
   298         {
       
   299         iWindow->MatchSelection()->Draw();
       
   300         }
       
   301     
       
   302     return err;
       
   303     }
       
   304 
       
   305 void CGenericItutWindowManager::SetPromptTextL(TUint8* aData)
       
   306     {
       
   307     iWindow->SetPromptTextL(aData);
       
   308     }
       
   309 
       
   310 TBool CGenericItutWindowManager::HandleCommandL(TInt aCmd, TUint8* aData)
       
   311     {
       
   312     TBool handle = EFalse;
       
   313     TInt* data = (TInt*) aData;
       
   314     switch (aCmd)
       
   315         {
       
   316         case ECmdPenInputIsSecretText:
       
   317             {
       
   318             iWindow->Icf()->SetTextIsSecret(*aData);
       
   319             CPeninputLayoutInputmodelChoice* choice = 
       
   320                 iWindow->InputModeSwitch();
       
   321             if ( choice )
       
   322                 {
       
   323                 choice->SetSecretEditor(*aData);
       
   324                 }
       
   325             }
       
   326             break;
       
   327         case ECmdPenInputIsNumberGrouping:
       
   328             {
       
   329             iWindow->Icf()->SetNumberGrouping(*aData);
       
   330             }
       
   331             break;
       
   332         case ECmdPenInputDimArrowKeys:
       
   333             {
       
   334             TBool IsDimArrowKeys = *aData;
       
   335             DimArrowKeys( IsDimArrowKeys );
       
   336             }
       
   337             break;
       
   338         case ECmdPenInputFingerMatchIndicator:
       
   339             {
       
   340             if ( iDataMgr->IsPortraitWest() && ( !iDataMgr->IsChineseSpellMode()))
       
   341                 {
       
   342                 iWindow->UpdateIndiBubbleL( aData );
       
   343                 }
       
   344             else
       
   345                 {
       
   346                 UpdateIndicatorL( aData );
       
   347                 }
       
   348             handle = ETrue;
       
   349             }
       
   350             break;
       
   351         case ECmdPenInputSetPromptText:
       
   352             {
       
   353             SetPromptTextL(aData);
       
   354             handle = ETrue;
       
   355             }
       
   356             break;
       
   357         case ECmdPenInputSendEditMenuData:
       
   358             {
       
   359             // Show menu command list
       
   360             iWindow->ShowEditorMenuL(data);
       
   361             }
       
   362             break;
       
   363         case ECmdPenInputEnableSettingBtn:
       
   364             {
       
   365             CAknFepCtrlCommonButton * optionsbtn;
       
   366             TBool enable = *data;            
       
   367             optionsbtn = static_cast<CAknFepCtrlCommonButton *>(iWindow->Control(ECtrlIdOptions));
       
   368             if(optionsbtn && !enable)
       
   369                 {
       
   370                 optionsbtn->SetDimmed(ETrue);
       
   371                 handle = ETrue;
       
   372                 iDimOperationBtn = ETrue;
       
   373                 }
       
   374             else if(optionsbtn && enable)
       
   375                 {
       
   376                 optionsbtn->SetDimmed(EFalse);
       
   377                 handle = ETrue;
       
   378                 iDimOperationBtn = EFalse;
       
   379                 }
       
   380             break;
       
   381             }
       
   382 
       
   383         case ECmdPenInputEnableIndicatorButton:
       
   384             {
       
   385             if ( NULL != static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdIndicator)))
       
   386                 {
       
   387                 if (*data)
       
   388                     {
       
   389                     static_cast<CAknFepCtrlCommonButton*>(
       
   390                                                   Control(ECtrlIdIndicator))->SetDimmed(EFalse);
       
   391                     }
       
   392                 else
       
   393                     {
       
   394                     static_cast<CAknFepCtrlCommonButton*>(
       
   395                                                   Control(ECtrlIdIndicator))->SetDimmed(ETrue);
       
   396                     }
       
   397                 }
       
   398             }
       
   399         break;
       
   400         case ECmdPenInputSymbolOfHardKeyOne:
       
   401             {
       
   402             iWindow->SetHardKeyOneSymbol(aData);
       
   403             handle = ETrue;
       
   404             }
       
   405             break;
       
   406         case ECmdPenInputRotation:
       
   407             {
       
   408             if (iWindow->InputModeSwitch())
       
   409                 {
       
   410                 iWindow->InputModeSwitch()->CloseWindow();    
       
   411                 }
       
   412             
       
   413             if (iWindow->EditorMenu()) 
       
   414                 {
       
   415                 iWindow->EditorMenu()->CloseWindow();    
       
   416                 }
       
   417             }
       
   418         break;
       
   419 
       
   420         case ECmdPenInputInEditWordQueryDlg:
       
   421             {
       
   422             iInEditWordQueryDlg = *data;
       
   423             }
       
   424             break;
       
   425         case ECmdPeninputSpellICFDisplayContent:
       
   426         	{
       
   427         	iWindow->SetSpellDisplayContentL( aData );
       
   428         	handle = ETrue;
       
   429         	}
       
   430         	break;
       
   431         default:
       
   432         break;
       
   433             
       
   434         };
       
   435     return handle;
       
   436     }
       
   437 
       
   438 
       
   439 TInt CGenericItutWindowManager::SizeChanged(TBool aIcfOverlap)
       
   440     {
       
   441     return iWindow->SizeChanged(aIcfOverlap);
       
   442     }
       
   443 
       
   444 void CGenericItutWindowManager::SubmitText(const TDesC& aEventData)
       
   445     {
       
   446     iLayoutOwner->SignalOwner(ESignalKeyEvent, aEventData);
       
   447     }
       
   448 
       
   449 TInt CGenericItutWindowManager::OnSkinChange()
       
   450     {
       
   451     TRAPD(err,
       
   452           iWindow->ConstructSpellCtrlFromResourceL(); 
       
   453           iWindow->ConstructItutKeypadFromResourceL(iWindow->ItutKeypad()->ResourceId());
       
   454           iWindow->ConstructIcfFromResourceL());
       
   455    
       
   456     iWindow->OnSkinChange();
       
   457     return err;
       
   458     }
       
   459 
       
   460 void CGenericItutWindowManager::ShowArrowBtn(TInt aShowFlag)
       
   461     {
       
   462     iWindow->Control(ECtrlIdArrowLeft)->Hide(!(EBtnArrowLeft & aShowFlag));
       
   463     iWindow->Control(ECtrlIdArrowRight)->Hide(!(EBtnArrowRight & aShowFlag));
       
   464     iWindow->Control(ECtrlIdArrowUp)->Hide(!(EBtnArrowUp & aShowFlag));
       
   465     iWindow->Control(ECtrlIdArrowDown)->Hide(!(EBtnArrowDown & aShowFlag));
       
   466     }
       
   467     
       
   468 CFepUiLayout* CGenericItutWindowManager::UiLayout()
       
   469     {
       
   470     return iLayoutOwner;
       
   471     }
       
   472     
       
   473 void CGenericItutWindowManager::HandleAppInfoChangeL(const TDesC& aInfo)
       
   474     {
       
   475     CGenericItutUiLayout * itutLayoutOwner;
       
   476     itutLayoutOwner = static_cast<CGenericItutUiLayout *>(UiLayout());
       
   477     if ( aInfo.Length() > 0 && 
       
   478          itutLayoutOwner->UiMgr()->CurrentState() &&
       
   479          itutLayoutOwner->UiMgr()->CurrentState()->StateType() !=
       
   480             CGenericItutUiMgrBase::EStateSpelling && 
       
   481          !iInEditWordQueryDlg)
       
   482         {
       
   483         if ( iDataMgr->IsPortraitWest() && (!iDataMgr->IsChineseSpellMode()))
       
   484             {
       
   485                   //iWindow->Icf()->HideBubble();
       
   486             iWindow->SetIndiWithTextFlag( ETrue );
       
   487             iWindow->IndiBubbleWithText();
       
   488             }
       
   489         else
       
   490             {
       
   491                   //iWindow->Icf()->HideBubble();
       
   492                   iWindow->MsgBubbleForChinese();
       
   493             }
       
   494         iWindow->Icf()->ShowBubble(aInfo,iWindow->Icf()->MsgBubbleCtrl()->Rect());
       
   495         }
       
   496     else
       
   497         {
       
   498         if ((!iDataMgr->IsPortraitWest()) || iDataMgr->IsChineseSpellMode())
       
   499             {
       
   500             iWindow->Icf()->HideBubble();
       
   501             }
       
   502         else
       
   503             {
       
   504                   if ( itutLayoutOwner->UiMgr()->CurrentState() &&
       
   505                        itutLayoutOwner->UiMgr()->CurrentState()->StateType() !=
       
   506                               CGenericItutUiMgrBase::EStateSpelling )
       
   507                         {
       
   508                         //iWindow->Icf()->HideBubble();
       
   509                         iWindow->SetIndiWithTextFlag( EFalse );
       
   510                         iWindow->IndiBubbleWithoutText();
       
   511                         }
       
   512             
       
   513             iWindow->Icf()->ShowBubble( KEmptyString, 
       
   514                     iWindow->Icf()->MsgBubbleCtrl()->Rect());
       
   515             }
       
   516         }
       
   517     }
       
   518 
       
   519 /* Teleca change begin, 19.05.2009 ssal */
       
   520 void CGenericItutWindowManager::DisplayWarningNote(const TDesC& aInfo)
       
   521     {
       
   522 	if (!iInfoTimer->IsActive())
       
   523 		{
       
   524 		iInfoTimer->Start(KPeriodicTimerIntervalSec,
       
   525                           KPeriodicTimerIntervalSec, 
       
   526                           TCallBack(CGenericItutWindowManager::HideByteWarningBubble, this));
       
   527 		}	                                       
       
   528     iWindow->Icf()->ShowByteWarningBubble(aInfo);
       
   529     }
       
   530 /* Teleca change end, 19.05.2009 ssal */
       
   531 void CGenericItutWindowManager::ApplyVariantLafDataL(TBool aResolutionChange)
       
   532     {
       
   533     iWindow->ApplyVariantLafDataL(aResolutionChange);
       
   534     }
       
   535 
       
   536 void CGenericItutWindowManager::CreateChineseSpecificCtrlsIfNeededL()
       
   537     {
       
   538     iWindow->CreateChineseSpecificCtrlsIfNeededL();   
       
   539     }
       
   540     
       
   541 void CGenericItutWindowManager::SetLanguageL(TInt aLanguage)
       
   542     {
       
   543     iWindow->Icf()->SetLanguageId(aLanguage);    
       
   544     }
       
   545     
       
   546 void CGenericItutWindowManager::SetLastRawKeyDown(TInt aScanCode,  TBool aKeyDown, 
       
   547                                                   CFepUiBaseCtrl* aCtrl)
       
   548     {
       
   549     !aKeyDown ? iLastRawKeyDown = EStdKeyNull : iLastRawKeyDown = aScanCode;
       
   550     iRawKeyDown = aKeyDown;
       
   551     iRawKeyCtrl = aCtrl;
       
   552     } 
       
   553     
       
   554 void CGenericItutWindowManager::ResetIndicatorL(CFepUiBaseCtrl* aIndicator)
       
   555 	{
       
   556     iWindow->SetIndicatorImageL(aIndicator, 
       
   557                        iDataMgr->IndicatorData().iIndicatorImgID,
       
   558                        iDataMgr->IndicatorData().iIndicatorMaskID,
       
   559                        iDataMgr->IndicatorData().iIndicatorTextImgID,
       
   560                        iDataMgr->IndicatorData().iIndicatorTextMaskID);
       
   561 	}
       
   562 
       
   563 void CGenericItutWindowManager::UpdateIndicatorL(TUint8* aData)
       
   564     {
       
   565     iWindow->UpdateIndicatorL(aData);
       
   566     }
       
   567 
       
   568 void CGenericItutWindowManager::ReportItemSelected(TInt aCmdId, TInt aIdx, TBool aCommit)
       
   569     {
       
   570     TBuf<8> buf;
       
   571     buf.Append(reinterpret_cast<TText*>(&aIdx), sizeof(TInt)/sizeof(TText));
       
   572     buf.Append(reinterpret_cast<TText*>(&aCommit), sizeof(TBool)/sizeof(TText));
       
   573 
       
   574     iLayoutOwner->SignalOwner(aCmdId, buf);
       
   575     }
       
   576     
       
   577 CFepUiBaseCtrl* CGenericItutWindowManager::Control(TInt aCtrlId)  
       
   578     {
       
   579     return iWindow->Control(aCtrlId);   
       
   580     }
       
   581 
       
   582 void CGenericItutWindowManager::OnActivate()
       
   583     {
       
   584     //static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(EFalse);
       
   585     if (iDimOperationBtn)
       
   586         {
       
   587         static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(ETrue);    
       
   588         }
       
   589     else
       
   590         {
       
   591         static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(EFalse);      
       
   592         }
       
   593     }
       
   594 void CGenericItutWindowManager::DimArrowKeys( TBool aDimArrow )
       
   595     {
       
   596     if (iDataMgr->IsChinese())
       
   597         {
       
   598         CAknFepCtrlRawKeyButton * leftbtn;
       
   599         CAknFepCtrlRawKeyButton * rightbtn;
       
   600         CAknFepCtrlRawKeyButton * upbtn;
       
   601         CAknFepCtrlRawKeyButton * downbtn;
       
   602         leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowLeft));
       
   603         rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowRight));
       
   604         upbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowUp));
       
   605         downbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowDown));
       
   606 
       
   607         leftbtn->SetDimmed(aDimArrow);   
       
   608         rightbtn->SetDimmed(aDimArrow);   
       
   609         upbtn->SetDimmed(aDimArrow);   
       
   610         downbtn->SetDimmed(aDimArrow);   
       
   611 
       
   612         }
       
   613     else
       
   614         {
       
   615         CAknFepCtrlRawKeyButton * leftbtn;
       
   616         CAknFepCtrlRawKeyButton * rightbtn;
       
   617         leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowLeft));
       
   618         rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowRight));
       
   619 
       
   620         leftbtn->SetDimmed(aDimArrow);   
       
   621         rightbtn->SetDimmed(aDimArrow);   
       
   622         }                
       
   623     }
       
   624     
       
   625 void CGenericItutWindowManager::ShowBubble(TInt aShow)
       
   626     {
       
   627     CFepCtrlDropdownList* spell = 
       
   628         static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdSpellCandsList));
       
   629     CFepCtrlDropdownList* standard = 
       
   630         static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdStdCandsList));
       
   631     CFepCtrlDropdownList* punctuation = 
       
   632         static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdPuncCandsList));
       
   633     
       
   634     if (aShow > 0)
       
   635         {
       
   636     	TRect outrect,innerrect;
       
   637     	outrect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(EPreviewBubbleRect));  
       
   638     	innerrect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(EPreviewBubbleInnerRect));
       
   639         TAknTextLineLayout bubbleTextLayout = 
       
   640             TItutDataConverter::AnyToTextLine(iDataMgr->RequestData(EPreviewBubbleTextlayout));
       
   641         CFont* bubbleFont = TItutDataConverter::AnyToFont(iDataMgr->RequestData(EPreviewBubbleFont));
       
   642         
       
   643         if( spell )
       
   644             {
       
   645             spell->ShowBubble(ETrue);
       
   646             spell->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); 	
       
   647          	
       
   648         	spell->SetTextFormat(bubbleTextLayout);
       
   649         	spell->SetBubbleTextFont(bubbleFont);
       
   650         	spell->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
   651         	spell->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
   652         	               innerrect.iTl.iY - outrect.iTl.iY,
       
   653         	               outrect.iBr.iX - innerrect.iBr.iX,
       
   654         	               outrect.iBr.iY - innerrect.iBr.iY);
       
   655             }
       
   656         
       
   657         if( standard )
       
   658             {
       
   659             standard->ShowBubble(ETrue);
       
   660             standard->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); 	
       
   661          	
       
   662         	standard->SetTextFormat(bubbleTextLayout);
       
   663         	standard->SetBubbleTextFont(bubbleFont);
       
   664         	standard->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
   665         	standard->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
   666         	               innerrect.iTl.iY - outrect.iTl.iY,
       
   667         	               outrect.iBr.iX - innerrect.iBr.iX,
       
   668         	               outrect.iBr.iY - innerrect.iBr.iY);
       
   669             }
       
   670     
       
   671         if ( punctuation )
       
   672             {
       
   673             punctuation->ShowBubble(ETrue);
       
   674             punctuation->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); 	
       
   675          	
       
   676         	punctuation->SetTextFormat(bubbleTextLayout);
       
   677         	punctuation->SetBubbleTextFont(bubbleFont);
       
   678         	punctuation->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
   679         	punctuation->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
   680         	               innerrect.iTl.iY - outrect.iTl.iY,
       
   681         	               outrect.iBr.iX - innerrect.iBr.iX,
       
   682         	               outrect.iBr.iY - innerrect.iBr.iY);
       
   683             }
       
   684         }
       
   685     else
       
   686         {
       
   687         if( spell )
       
   688             {
       
   689             spell->ShowBubble(EFalse);
       
   690             }
       
   691         if( standard )
       
   692             {
       
   693             standard->ShowBubble(EFalse);
       
   694             }
       
   695         if ( punctuation )
       
   696             {
       
   697             punctuation->ShowBubble(EFalse);
       
   698             }
       
   699         }
       
   700     }    
       
   701 /* Teleca change begin, 18.05.2009 ssal */
       
   702 TInt CGenericItutWindowManager::HideByteWarningBubble(TAny* aPointer)
       
   703     {
       
   704     CGenericItutWindowManager* manager = static_cast<CGenericItutWindowManager*>(aPointer);
       
   705     manager->HideByteWarningBubble();
       
   706     return KErrNone;
       
   707     }
       
   708        
       
   709 TBool CGenericItutWindowManager::IsAllowHandleRawKeyEvent()
       
   710 	{
       
   711 	return iAllowHandleRawKeyEvent;
       
   712 	}
       
   713 
       
   714 void CGenericItutWindowManager::SetAllowHandleRawKeyEventFlag( TBool aFlag )
       
   715 	{
       
   716 	iAllowHandleRawKeyEvent = aFlag;
       
   717 	}
       
   718 
       
   719 void CGenericItutWindowManager::StartPreventSCTTimer()
       
   720 	{
       
   721 	iAllowHandleRawKeyEvent =  EFalse;
       
   722 	
       
   723 	TTimeIntervalMicroSeconds32 t = KSCTPreventTime;
       
   724 	iPreventCSTTimer->Start( t, t, 
       
   725 			TCallBack(PreventSCTTimerCallback, this));
       
   726 	}
       
   727 
       
   728 void CGenericItutWindowManager::StopPreventSCTTimer()
       
   729 	{
       
   730 	iPreventCSTTimer->Cancel();
       
   731 	}
       
   732 
       
   733 void CGenericItutWindowManager::HideByteWarningBubble()
       
   734     {
       
   735     if (!iInfoTimer)
       
   736         {
       
   737         return;
       
   738         }
       
   739         
       
   740     if (iInfoTimer->IsActive())
       
   741         {
       
   742         iInfoTimer->Cancel();
       
   743         iWindow->Icf()->HideInfoBubble();
       
   744         }
       
   745     }    
       
   746 
       
   747 void CGenericItutWindowManager::CreateKoreanSpecificCtrlsIfNeededL()
       
   748     {
       
   749     iWindow->CreateKoreanSpecificCtrlsIfNeededL();
       
   750     }
       
   751 // End Of File