textinput/peninputfingerhwr/src/peninputfingerhwrwnd.cpp
branchRCL_3
changeset 21 ecbabf52600f
child 22 bd83ceabce89
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Implementation of main window of finger hwr.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE
       
    19 #include <peninputfingerhwrcn.rsg>
       
    20 #include <aknlayoutscalable_apps.cdl.h>
       
    21 #include <aknlayoutscalable_avkon.cdl.h>
       
    22 #include <peninputlayoutmultilineicf.h>
       
    23 #include <peninputdropdownlist.h>
       
    24 #include <peninputrepeatbutton.h>
       
    25 #include <AknLayoutDef.h>
       
    26 #include <AknUtils.h>
       
    27 #include <AknsUtils.h>
       
    28 #include <AknIconUtils.h>
       
    29 #include <coemain.h>
       
    30 #include <s32mem.h>
       
    31 #include <peninputlayoutchoicelist.h>
       
    32 #include <aknfeppeninputenums.h>
       
    33 #include <AknFepGlobalEnums.h>
       
    34 #include <peninputlayoutinputmodechoice.h>
       
    35 #include <peninputrepeatbutton.h>
       
    36 #include <peninputlayout.h>
       
    37 #include <peninputlayoutbubblectrl.h>
       
    38 #include <peninputlayoutvkb.h>
       
    39 
       
    40 #include <peninputmultiimagebutton.h>
       
    41 
       
    42 #include "peninputfingerhwrwnd.h"
       
    43 #include "peninputfingerhwrlafmanager.h"
       
    44 #include "peninputfingerhwrevent.h"
       
    45 #include "peninputfingerhwrcontrolid.h"
       
    46 #include "peninputfingerhwrstoreconstants.h"
       
    47 #include "peninputfingerhwrlayout.h"
       
    48 #include "peninputfingerhwrdatastore.h"
       
    49 #include "peninputlayouthwrwnd.h"
       
    50 
       
    51 #include "peninputmultipagevkb.h"
       
    52 #include "peninputfingerhwrrangeselector.h"
       
    53 #include "hbufcarray.h"
       
    54 
       
    55 const TUint32 KDefaultTextColor = 0x000000;
       
    56 const TUint KDefaultFrameColor = 0x000000;
       
    57 const TUint32 KDefaultWriteBoxBgColor = 0xdddddd;
       
    58 const TUint32 KDefaultWriteBoxFrameColor = 0x000000;
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // Symbian Constructor
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 CPeninputFingerHwrWnd* CPeninputFingerHwrWnd::NewL( CFepUiLayout* aFepUiLayout,
       
    65     TInt aControlId, TBool aLandscapeStyle )
       
    66     {
       
    67     CPeninputFingerHwrWnd* self = NewLC( aFepUiLayout, aControlId, aLandscapeStyle );
       
    68     CleanupStack::Pop( self );
       
    69 
       
    70     return self;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // Symbian Constructor
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 CPeninputFingerHwrWnd* CPeninputFingerHwrWnd::NewLC( CFepUiLayout* aFepUiLayout, 
       
    78     TInt aControlId, TBool aLandscapeStyle )
       
    79     {
       
    80     CPeninputFingerHwrWnd* self = new ( ELeave ) CPeninputFingerHwrWnd( aFepUiLayout, aControlId );
       
    81     CleanupStack::PushL( self );
       
    82     self->ConstructL( aLandscapeStyle );
       
    83 
       
    84     return self;
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // c++ destructor
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 CPeninputFingerHwrWnd::~CPeninputFingerHwrWnd()
       
    92     {
       
    93     //delete by it's owner
       
    94     iContextField    = NULL;
       
    95 
       
    96 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
    97     iFixEngSymbolList1 = NULL;
       
    98     iFixEngSymbolList2 = NULL;
       
    99 #endif
       
   100 
       
   101     iCandidateList   = NULL;
       
   102     iPredictList     = NULL;
       
   103     iWritingBox      = NULL;
       
   104     
       
   105     iCloseBtn        = NULL;
       
   106     iOptionBtn       = NULL;
       
   107     iImeSwitchBtn    = NULL;
       
   108     iBackspaceBtn    = NULL;
       
   109     iArrowLeftBtn    = NULL; 
       
   110     iArrowRightBtn   = NULL;
       
   111     iArrowUpBtn      = NULL;
       
   112     iArrowDownBtn    = NULL; 
       
   113     iRangeSpecialBtn = NULL;
       
   114     iRangeSelector   = NULL;
       
   115     
       
   116     iSctPage0Btn = NULL;
       
   117     iSctPage1Btn = NULL;
       
   118     iSctPage2Btn = NULL;
       
   119     
       
   120     iVirtualNumpad = NULL;
       
   121     iVirtualSctpad = NULL;    
       
   122     iVirtualSctpadFix = NULL;
       
   123     iRangeSelector = NULL;
       
   124     iInputModeSwitch = NULL; 
       
   125     
       
   126     delete iLafManager;
       
   127     iLafManager = NULL;
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------------------------
       
   131 // Construct control from resource.
       
   132 // ---------------------------------------------------------------------------
       
   133 //
       
   134 void CPeninputFingerHwrWnd::ConstructFromResourceL()
       
   135     {
       
   136     if ( iResourceId == KInvalidResId )
       
   137         {
       
   138         User::Leave( KErrArgument );
       
   139         }
       
   140 
       
   141     TResourceReader reader;
       
   142     CCoeEnv::Static()->CreateResourceReaderLC( reader, iResourceId );
       
   143 
       
   144     TInt supportskin = reader.ReadInt16();
       
   145     
       
   146     if ( iFirstTimeConstruct && ( supportskin != KNotSupportSkin ) )
       
   147         {
       
   148         UiLayout()->AddControlL( this );
       
   149         }
       
   150     
       
   151     // read shadow resources
       
   152     TInt32 shadow = reader.ReadInt32();
       
   153     ReadShadowInfoL( shadow );
       
   154     
       
   155     // read icf resource
       
   156     TInt32 icf = reader.ReadInt32();
       
   157     ReadICFInfoL( icf );
       
   158      
       
   159 
       
   160     if ( iFirstTimeConstruct )
       
   161         {
       
   162         const TInt32 boxwndResId = reader.ReadInt32();
       
   163         const TInt32 bgImageResId = reader.ReadInt32();
       
   164   
       
   165         ReadWritingBoxInfoL( boxwndResId );
       
   166         ReadBackgroundInfoL( bgImageResId );
       
   167         }
       
   168     else
       
   169         {
       
   170         CControlGroup::ConstructFromResourceL();
       
   171 
       
   172         const TInt32 boxwndResId = reader.ReadInt32();
       
   173         const TInt32 bgImageResId = reader.ReadInt32();
       
   174         ReadWritingBoxInfoL( boxwndResId );
       
   175         ReadBackgroundInfoL( bgImageResId );
       
   176         }    
       
   177 
       
   178     CleanupStack::PopAndDestroy(); // reader
       
   179 
       
   180     // read keypad image info
       
   181     if ( iVirtualNumpad )
       
   182         {
       
   183         TSize keysize = iLafManager->VirtualNumpadCellSize().Size();
       
   184         LoadVkbKeyImageL( iVirtualNumpad, R_FINGER_HWR_NUMPAD_IMAGE, keysize );
       
   185         
       
   186         RArray<TRect> rects;
       
   187         CleanupClosePushL( rects );
       
   188         iLafManager->GetVirtualKeyRects( rects );
       
   189         LoadVirtualNumpadKeysL( R_FINGER_HWR_NUMPAD, rects );
       
   190         CleanupStack::PopAndDestroy(); //rects
       
   191         }
       
   192     
       
   193     if ( iVirtualSctpad )
       
   194         {
       
   195         TSize keysize = iLafManager->VirtualSctpadCellSize().Size();
       
   196         LoadVkbKeyImageL( iVirtualSctpad, R_FINGER_HWR_SCTPAD_IMAGE, keysize );
       
   197         
       
   198         RArray<TRect> rects;
       
   199         CleanupClosePushL( rects );
       
   200         iLafManager->GetVirtualKeyRects( rects );
       
   201         LoadVirtualSctpadKeysL( R_FINGER_HWR_SCTPAD, rects );
       
   202         CleanupStack::PopAndDestroy(); //rects
       
   203         }
       
   204     
       
   205     if ( iVirtualSctpadFix )
       
   206         {
       
   207         TSize keysize = iLafManager->FixVirtualSctpadCellSize().Size();
       
   208         LoadVkbKeyImageL( iVirtualSctpadFix, R_FINGER_HWR_SCTPAD_IMAGE, keysize );
       
   209         
       
   210         RArray<TRect> rects;
       
   211         CleanupClosePushL( rects );
       
   212         iLafManager->GetFixVirtualKeyRects( rects );
       
   213         LoadFixVirtualSctpadKeysL( R_FINGER_HWR_SCTPAD_FIX, rects );
       
   214         CleanupStack::PopAndDestroy(); //rects        
       
   215         }
       
   216         
       
   217     if (!iFirstTimeConstruct)
       
   218     	{
       
   219     	Draw();
       
   220     	}
       
   221     
       
   222     iFirstTimeConstruct = EFalse;  
       
   223     }
       
   224 
       
   225 
       
   226 // ---------------------------------------------------------------------------
       
   227 // Draw window.
       
   228 // ---------------------------------------------------------------------------
       
   229 //
       
   230 void CPeninputFingerHwrWnd::Draw()
       
   231     { 
       
   232     DrawOpaqueMaskBackground( Rect() );
       
   233 
       
   234     if( BackgroundBmp() && BackgroundBmp()->SizeInPixels() != Rect().Size() )
       
   235         {
       
   236     	AknIconUtils::SetSize(BackgroundBmp(), Rect().Size(), EAspectRatioNotPreserved);
       
   237         }
       
   238 
       
   239 	DrawBackground();    
       
   240          
       
   241     CControlGroup::Draw();
       
   242     
       
   243     UpdateArea( Rect(), EFalse );
       
   244     }
       
   245 
       
   246 // ---------------------------------------------------------------------------
       
   247 // Resize.
       
   248 // ---------------------------------------------------------------------------
       
   249 //
       
   250 void CPeninputFingerHwrWnd::SizeChangedL( TBool /*aLandscapeStyle*/ )
       
   251     {
       
   252     iLafManager->ReadLafInfo();
       
   253     ResetLayoutL();
       
   254   
       
   255     if ( iLafManager->IsLandscape() )
       
   256         {
       
   257         iPredictList->SetCandExpandType( CFepCtrlDropdownList::ECandExpandUpward );
       
   258         }
       
   259     else
       
   260         {
       
   261         iPredictList->SetCandExpandType( CFepCtrlDropdownList::ECandExpandDownward );
       
   262         }    
       
   263             
       
   264     iCandidateList->SizeChanged( iLafManager->CandidateUnitWidth(),
       
   265             iLafManager->CandidateUnitHeight(), 
       
   266             iLafManager->CandidateUnitWidth(), 
       
   267             iLafManager->CandidateLTPos(), 
       
   268             KCandidateCountPerRow,
       
   269             1 );
       
   270             
       
   271     iPredictList->SizeChanged( iLafManager->CandidateUnitWidth(),
       
   272             iLafManager->CandidateUnitHeight(),
       
   273             iLafManager->CandidateUnitWidth(), 
       
   274             iLafManager->PredictiveLTPos(),
       
   275             KPredictiveCountPerRow,
       
   276             KPredictiveRowCount );
       
   277 
       
   278     if ( iFixEngSymbolList1 )
       
   279         {
       
   280         iFixEngSymbolList1->SizeChanged( iLafManager->CandidateUnitWidth(),
       
   281                 iLafManager->CandidateUnitHeight(), 
       
   282                 iLafManager->CandidateUnitWidth(), 
       
   283                 iLafManager->CandidateLTPos(), 
       
   284                 KCandidateCountPerRow,
       
   285                 1 );        
       
   286         }
       
   287     
       
   288     if ( iFixEngSymbolList2 )
       
   289         {
       
   290         iFixEngSymbolList2->SizeChanged( iLafManager->CandidateUnitWidth(),
       
   291                 iLafManager->CandidateUnitHeight(), 
       
   292                 iLafManager->CandidateUnitWidth(), 
       
   293                 iLafManager->PredictiveLTPos(), 
       
   294                 KPredictiveCountPerRow,
       
   295                 1 );             
       
   296         }
       
   297     
       
   298     iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(),
       
   299             iLafManager->IcfRightMargin(),
       
   300             iLafManager->IcfTopMargin(),
       
   301             iLafManager->IcfBottomMargin() );
       
   302     
       
   303     iContextField->SetLineSpace( iLafManager->IcfLineSpaceMargin() );                          
       
   304     iContextField->SizeChangedL( iLafManager->IcfRect(), 
       
   305             iLafManager->IcfTextHeight(),
       
   306             iLafManager->IcfFont()->FontMaxHeight(),
       
   307             iLafManager->IcfFont() );
       
   308 }
       
   309 
       
   310 // ---------------------------------------------------------------------------
       
   311 // accept editor's text alignment.
       
   312 // ---------------------------------------------------------------------------
       
   313 //
       
   314 void CPeninputFingerHwrWnd::SetTextAlignmentL( TInt aAlignment, TInt aLangId )  
       
   315     {
       
   316     if ( iContextField )
       
   317         {
       
   318         iContextField->SetTextAlignmentL( aAlignment, aLangId );
       
   319         }
       
   320     }
       
   321 
       
   322 // ---------------------------------------------------------------------------
       
   323 // accept editor's text
       
   324 // ---------------------------------------------------------------------------
       
   325 //
       
   326 void CPeninputFingerHwrWnd::SetEditorTextL( const TFepInputContextFieldData& aData )
       
   327     {
       
   328     if ( iContextField )
       
   329         {
       
   330         iContextField->SetTextL( aData );
       
   331         }
       
   332     }
       
   333 
       
   334 // ---------------------------------------------------------------------------
       
   335 // accept editor's promopt txt.
       
   336 // ---------------------------------------------------------------------------
       
   337 //
       
   338 void CPeninputFingerHwrWnd::SetPromptTextL( TUint8* aPromoptData )
       
   339     {
       
   340     RDesReadStream readStream;
       
   341 
       
   342     TPtr8 countPtr( aPromoptData, 2*sizeof( TInt ), 2*sizeof( TInt ) );
       
   343     readStream.Open( countPtr );
       
   344     CleanupClosePushL( readStream );
       
   345     const TInt dataCount = readStream.ReadInt32L();
       
   346     const TInt textCount = readStream.ReadInt32L();
       
   347     CleanupStack::PopAndDestroy( &readStream );
       
   348     
       
   349     TPtr8 ptr( aPromoptData+2*sizeof( TInt ), dataCount+textCount, dataCount+textCount );            
       
   350     readStream.Open( ptr );
       
   351     CleanupClosePushL( readStream );
       
   352     
       
   353     HBufC8* dataBuf = HBufC8::NewLC( dataCount );
       
   354     TPtr8 dataBufPtr = dataBuf->Des();
       
   355     readStream.ReadL( dataBufPtr, dataCount );
       
   356 
       
   357     TFepPromptText* pIcfData = reinterpret_cast<TFepPromptText*>( const_cast<TUint8*>( dataBufPtr.Ptr() ) );
       
   358 
       
   359     HBufC* textBuf;
       
   360     if ( textCount > 0 )
       
   361         {
       
   362         textBuf = HBufC::NewLC( textCount/2 );
       
   363         TPtr textBufPtr = textBuf->Des();
       
   364         readStream.ReadL( textBufPtr, textCount/2 );
       
   365         iContextField->SetPromptTextL( textBuf->Des(), ETrue );
       
   366         CleanupStack::PopAndDestroy( textBuf );
       
   367         }
       
   368     else
       
   369         {
       
   370         iContextField->SetPromptTextL( KNullDesC, ETrue );
       
   371         }
       
   372 
       
   373     CleanupStack::PopAndDestroy( dataBuf );
       
   374     CleanupStack::PopAndDestroy( &readStream );        
       
   375     }
       
   376  
       
   377 // ---------------------------------------------------------------------------
       
   378 // Dim option button
       
   379 // ---------------------------------------------------------------------------
       
   380 //
       
   381 void CPeninputFingerHwrWnd::SetEnableSettingBtn(const TBool aEnable)
       
   382     {
       
   383     if ( aEnable )    
       
   384         {
       
   385         iOptionBtn->SetDimmed(EFalse);
       
   386         }
       
   387     else
       
   388         {
       
   389         iOptionBtn->SetDimmed(ETrue);
       
   390         iOptionBtn->SetActive(EFalse);
       
   391         }
       
   392     
       
   393     }
       
   394 
       
   395 // ---------------------------------------------------------------------------
       
   396 // accept editor's bubble text.
       
   397 // ---------------------------------------------------------------------------
       
   398 //
       
   399 void CPeninputFingerHwrWnd::SetBubbleTextL( const TDesC& aInfo )
       
   400     {
       
   401     if ( aInfo.Length() > 0 )
       
   402         {
       
   403         iContextField->ShowBubble( aInfo, iContextField->MsgBubbleCtrl()->Rect() );
       
   404         }
       
   405     else
       
   406         {
       
   407         iContextField->HideBubble();
       
   408         }    
       
   409     }
       
   410 
       
   411 // ---------------------------------------------------------------------------
       
   412 // accept editor's char ranges restriction.
       
   413 // ---------------------------------------------------------------------------
       
   414 //
       
   415 void CPeninputFingerHwrWnd::SetPermittedRanges( const TInt aPermittedRanges )
       
   416     {
       
   417     if(aPermittedRanges == 0)
       
   418         return;
       
   419     
       
   420     iPermittedRanges = aPermittedRanges;
       
   421     
       
   422     iRangeSelector->SetPermittedRanges( aPermittedRanges );    
       
   423     }
       
   424 
       
   425 // ---------------------------------------------------------------------------
       
   426 // accept editor's number mapping restriction.
       
   427 // ---------------------------------------------------------------------------
       
   428 //
       
   429 void CPeninputFingerHwrWnd::SetNumericMapping( const TDesC& aNumMapping )
       
   430     {
       
   431     //format of aNumMapping is "0123456789******"
       
   432     
       
   433     //char offset in aNumMapping
       
   434     //cell 0 using aNumMapping[KNumOffsets[0]]
       
   435     //cell 1 using aNumMapping[KNumOffsets[1]]
       
   436     const TInt KNumOffsets[] = 
       
   437         {
       
   438          1,  2,  3, 15,
       
   439          4,  5,  6, 14,
       
   440          7,  8,  9, 13,
       
   441         10,  0, 11, 12
       
   442         };
       
   443     
       
   444     TInt maxMappingItemCount = sizeof(KNumOffsets)/sizeof(TInt);
       
   445     TInt mappingItemCount = aNumMapping.Length();
       
   446     
       
   447     //numberpad
       
   448     TInt keyCount = iVirtualNumpad->KeyArray().Count();
       
   449     for ( TInt i = 0; i < keyCount; i++ )
       
   450         {
       
   451         CVirtualKey* vk = iVirtualNumpad->KeyArray()[i];
       
   452         
       
   453         TInt offset = ( i < maxMappingItemCount ) ? KNumOffsets[i] : -1;
       
   454         
       
   455         if ( offset > -1  && offset < mappingItemCount )
       
   456             {
       
   457             TUint16 unicode = aNumMapping[offset];
       
   458             vk->SetKeyData( aNumMapping.Mid( offset,1 ) );
       
   459             vk->SetKeyScancode( unicode );
       
   460             vk->SetDimmed( EFalse );
       
   461             }
       
   462         else
       
   463             {
       
   464             vk->SetKeyData( KNullDesC );
       
   465             vk->SetKeyScancode( 0xFFFF );
       
   466             vk->SetDimmed( EFalse );
       
   467             }
       
   468         }
       
   469     
       
   470     //sctpad
       
   471     keyCount = iVirtualSctpad->KeyArray().Count();
       
   472     
       
   473     if ( iPermittedRanges == ERangeNumber )
       
   474         {
       
   475         for ( TInt i = 0; i < keyCount; i++ )
       
   476             {
       
   477             CVirtualKey* vk = iVirtualSctpad->KeyArray()[i];
       
   478             TInt pos = aNumMapping.Find( vk->KeyUnicodes() );
       
   479             vk->SetDimmed( pos == KErrNotFound );
       
   480             }
       
   481         }
       
   482     else
       
   483         {
       
   484         for ( TInt i = 0; i < keyCount; i++ )
       
   485             {
       
   486             CVirtualKey* vk = iVirtualSctpad->KeyArray()[i];
       
   487             vk->SetDimmed( EFalse );
       
   488             }        
       
   489         }
       
   490     
       
   491     //sync feedback
       
   492     UpdateAllVirtualKeysFeedback( CurrentCharRange() );
       
   493     }
       
   494 
       
   495 // ---------------------------------------------------------------------------
       
   496 // accept editor's input language.
       
   497 // ---------------------------------------------------------------------------
       
   498 //
       
   499 void CPeninputFingerHwrWnd::SetInputLanguage( const TInt aLanguageId )
       
   500     {
       
   501 	if ( iContextField )
       
   502 		{
       
   503 		iContextField->SetLanguageId( aLanguageId );
       
   504 		}
       
   505 	
       
   506     // special punctuations
       
   507     const TInt KSpecialPuncPos[] = { 14, 15 };
       
   508     const TInt KSpecialChsPunc[] = { 0x300A, 0x300B };
       
   509     const TInt KSpecialChtPunc[] = { 0x300C, 0x300D };
       
   510 
       
   511     TBool isCht = ( ELangHongKongChinese == aLanguageId ) || 
       
   512                   ( ELangTaiwanChinese == aLanguageId );
       
   513     
       
   514     TInt specialPuncCount = sizeof(KSpecialPuncPos)/sizeof(TInt);
       
   515     
       
   516     
       
   517     for ( TInt i = 0; i < specialPuncCount; i++ )
       
   518         {
       
   519         TInt keypos = KSpecialPuncPos[i];        
       
   520         TInt charcode = isCht ? KSpecialChtPunc[i] : KSpecialChsPunc[i];
       
   521 
       
   522         CVirtualKey* vk = iVirtualSctpad->KeyArray()[keypos];
       
   523         if ( vk )
       
   524             {
       
   525             TBuf<1> buf;
       
   526             buf.Append( charcode );
       
   527             vk->SetKeyData( buf );
       
   528             vk->SetKeyScancode( charcode );
       
   529             }
       
   530         }
       
   531     }
       
   532 
       
   533 // ---------------------------------------------------------------------------
       
   534 // get strokes from hwr writing box.
       
   535 // ---------------------------------------------------------------------------
       
   536 //
       
   537 const RArray<TPoint>& CPeninputFingerHwrWnd::StrokeList()
       
   538     {
       
   539     return iWritingBox->StrokeList();
       
   540     }
       
   541 
       
   542 // ---------------------------------------------------------------------------
       
   543 // set end mark of hwr
       
   544 // ---------------------------------------------------------------------------
       
   545 //
       
   546 void CPeninputFingerHwrWnd::SetStrokeEndMark( const TPoint& aEndMark )
       
   547     {
       
   548     iWritingBox->SetStrokeEndMark( aEndMark );
       
   549     }
       
   550 
       
   551 // ---------------------------------------------------------------------------
       
   552 // set pen color of hwr writing.
       
   553 // ---------------------------------------------------------------------------
       
   554 //
       
   555 void CPeninputFingerHwrWnd::SetBoxPenColor( const TInt aPenColor )
       
   556     {
       
   557     iWritingBox->SetPenColor( aPenColor );
       
   558     }
       
   559     
       
   560 // ---------------------------------------------------------------------------
       
   561 // set pen size of hwr writing.
       
   562 // ---------------------------------------------------------------------------
       
   563 //  
       
   564 void CPeninputFingerHwrWnd::SetBoxPenSize( const TSize aPenSize )
       
   565     {
       
   566     iWritingBox->SetPenSize( aPenSize );
       
   567     }
       
   568 
       
   569 // ---------------------------------------------------------------------------
       
   570 // set writing speed hwr writing.
       
   571 // ---------------------------------------------------------------------------
       
   572 //
       
   573 void CPeninputFingerHwrWnd::SetBoxWritingSpeed( const TTimeIntervalMicroSeconds32& aCharDelay )
       
   574     {
       
   575     iWritingBox->SetCharacterDelay( aCharDelay );
       
   576     iWritingBox->SetStrokeDelay( 90000 );   
       
   577     }
       
   578 
       
   579 // ---------------------------------------------------------------------------
       
   580 // retrieve rect of hwr writingbox.
       
   581 // ---------------------------------------------------------------------------
       
   582 //
       
   583 TRect CPeninputFingerHwrWnd::WritingBoxRect()
       
   584     {
       
   585     return iWritingBox->Rect();
       
   586     }
       
   587 
       
   588 
       
   589 // ---------------------------------------------------------------------------
       
   590 // Cancel wrting
       
   591 // ---------------------------------------------------------------------------
       
   592 //
       
   593 void CPeninputFingerHwrWnd::CancelWriting()
       
   594     {
       
   595     iWritingBox->CancelCharWriting();
       
   596     }
       
   597 
       
   598 // ---------------------------------------------------------------------------
       
   599 // Popup ime switch list.
       
   600 // ---------------------------------------------------------------------------
       
   601 //
       
   602 void CPeninputFingerHwrWnd::PopupImeSwitcher()
       
   603     {
       
   604     TRAP_IGNORE( iInputModeSwitch->PopUpSwitchListL( iImeSwitchBtn->Rect() ) );
       
   605     }
       
   606 
       
   607 
       
   608 // ---------------------------------------------------------------------------
       
   609 // show range selection list.
       
   610 // ---------------------------------------------------------------------------
       
   611 //
       
   612 void CPeninputFingerHwrWnd::ShowRangeDropList( TInt aDirect )
       
   613     {
       
   614     iRangeSelector->SetCurRange( iCurCharRangeNoSct, iCurCharRange == iCurCharRangeNoSct );
       
   615     iRangeSelector->Popup( aDirect );
       
   616     }
       
   617 
       
   618 // ---------------------------------------------------------------------------
       
   619 // cancel range selection.
       
   620 // ---------------------------------------------------------------------------
       
   621 //
       
   622 void CPeninputFingerHwrWnd::CancelRangeDropList()
       
   623     {
       
   624     iRangeSelector->CancelPopup();
       
   625     
       
   626     UpdateArea( Rect(), EFalse );
       
   627     }
       
   628 
       
   629 // ---------------------------------------------------------------------------
       
   630 // test whether the range selection list is visible.
       
   631 // ---------------------------------------------------------------------------
       
   632 //
       
   633 TBool CPeninputFingerHwrWnd::RangeDropListVisible()
       
   634     {
       
   635     return iRangeSelector ? iRangeSelector->IsPopup() : EFalse;
       
   636     }
       
   637 
       
   638 
       
   639 // ---------------------------------------------------------------------------
       
   640 // Change SCT page.
       
   641 // ---------------------------------------------------------------------------
       
   642 //
       
   643 void CPeninputFingerHwrWnd::ShowSctPage( TInt aPageNo, TInt aPos )
       
   644     {
       
   645     switch ( aPos )
       
   646         {
       
   647         case EPagePosPageNo:
       
   648             {
       
   649             iVirtualSctpad->NavToPage( aPageNo );
       
   650             }
       
   651             break;
       
   652         default:
       
   653             break;
       
   654         }
       
   655     UpdateSctPageButtonsUi();
       
   656     UpdateAllVirtualKeysFeedback( EFingerHwrSymbolRange );
       
   657     }
       
   658 
       
   659 // ---------------------------------------------------------------------------
       
   660 // sync sct paging buttons.
       
   661 // ---------------------------------------------------------------------------
       
   662 //
       
   663 void CPeninputFingerHwrWnd::UpdateSctPageButtonsUi()
       
   664     {
       
   665     TInt curpage = iVirtualSctpad->CurPageIndex();
       
   666     TInt pagecount = iVirtualSctpad->PageCount();
       
   667     
       
   668     iSctPage0Btn->Hide( curpage != 0 );
       
   669     iSctPage1Btn->Hide( curpage != 1 );
       
   670     iSctPage2Btn->Hide( curpage != 2 );
       
   671     
       
   672     }
       
   673 
       
   674 // ---------------------------------------------------------------------------
       
   675 // retrieve the ICF control.
       
   676 // ---------------------------------------------------------------------------
       
   677 //
       
   678 CFepLayoutMultiLineIcf* CPeninputFingerHwrWnd::Icf()
       
   679     {
       
   680     return iContextField;
       
   681     }
       
   682 
       
   683 // ---------------------------------------------------------------------------
       
   684 // retrieve the predictive List control. 
       
   685 // ---------------------------------------------------------------------------
       
   686 //
       
   687 CFepCtrlDropdownList* CPeninputFingerHwrWnd::PredictiveList()
       
   688     {
       
   689     return iPredictList;
       
   690     }  
       
   691 
       
   692 // ---------------------------------------------------------------------------
       
   693 // retrieve the candicate list control.
       
   694 // ---------------------------------------------------------------------------
       
   695 //
       
   696 CFepCtrlDropdownList* CPeninputFingerHwrWnd::CandidateList()
       
   697     {
       
   698     return iCandidateList;
       
   699     }
       
   700 
       
   701 // ---------------------------------------------------------------------------
       
   702 // cancel all popped list.
       
   703 // ---------------------------------------------------------------------------
       
   704 //
       
   705 void CPeninputFingerHwrWnd::CancelAllPopList()
       
   706     {
       
   707     if ( iRangeSelector->IsPopup() )
       
   708         {
       
   709         iRangeSelector->CancelPopup();
       
   710         }    
       
   711     }
       
   712 
       
   713 // ---------------------------------------------------------------------------
       
   714 // Update layout
       
   715 // ---------------------------------------------------------------------------
       
   716 //
       
   717 void CPeninputFingerHwrWnd::UpdateLayout( const TBool aIsStandby, const TBool aReloadCandicate, const TBool aReloadPredictive )
       
   718     {
       
   719     TRAP_IGNORE( UpdateLayoutL( aIsStandby, aReloadCandicate, aReloadPredictive ) );
       
   720     }
       
   721 
       
   722 // ---------------------------------------------------------------------------
       
   723 // Update layout
       
   724 // ---------------------------------------------------------------------------
       
   725 //
       
   726 void CPeninputFingerHwrWnd::UpdateLayoutL( const TBool aIsStandby, 
       
   727     const TBool aReloadCandicate, const TBool aReloadPredictive )
       
   728     {
       
   729     // Set the candidates when dropdown list is shown
       
   730     if ( !aIsStandby )
       
   731         {
       
   732         typedef CFepCtrlDropdownList::TListType TDropListType;
       
   733         
       
   734         CPeninputFingerHwrLayout* hwrLayout = NULL;
       
   735         hwrLayout = static_cast<CPeninputFingerHwrLayout*>( UiLayout() );
       
   736         CPeninputFingerHwrDataStore& datastore = hwrLayout->DataStore();
       
   737         
       
   738         const RPointerArray<HBufC>& candidates = datastore.Candidate();
       
   739         const RPointerArray<HBufC>& predictives = datastore.Predictive();
       
   740         
       
   741         TDropListType expandable = CFepCtrlDropdownList::EListExpandableWithBubble;
       
   742         TDropListType unexpandable = CFepCtrlDropdownList::EListNoExpandableWithBubble;
       
   743         
       
   744         if ( datastore.PrimaryRange() == ERangeNative )
       
   745             {
       
   746             iCandidateList->Hide( EFalse );
       
   747             iPredictList->Hide( EFalse );
       
   748             
       
   749             if ( aReloadCandicate )
       
   750                 {
       
   751                 iCandidateList->SetCandidatesL( candidates, unexpandable );
       
   752                 }
       
   753             
       
   754             SetCandHighlightCell();
       
   755 
       
   756             // Re draw preview bubble after drawing highlight cell
       
   757             iCandidateList->ReDrawBubble();
       
   758             iPredictList->ReDrawBubble();
       
   759                
       
   760             if ( aReloadPredictive )
       
   761                 {
       
   762                 iPredictList->SetCandidatesL( predictives, expandable );
       
   763                 }
       
   764             }
       
   765         else if ( datastore.PrimaryRange() == ERangeEnglish )
       
   766             {
       
   767 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   768             iCandidateList->Hide(EFalse);
       
   769             iPredictList->Hide(EFalse);
       
   770             
       
   771             if ( aReloadCandicate )
       
   772                 {
       
   773                 iCandidateList->SetCandidatesL( candidates, unexpandable );
       
   774                 }
       
   775             
       
   776             if ( aReloadPredictive )
       
   777                 {
       
   778                 TBool canExpand = datastore.PredictiveCount() > KCandidateCount;
       
   779                 TDropListType type = canExpand ? expandable : unexpandable;
       
   780                 iPredictList->SetCandidatesL( predictives, type );
       
   781                 }
       
   782             
       
   783             SetCandHighlightCell();
       
   784                  
       
   785             // Re draw preview bubble after drawing highlight cell
       
   786             iCandidateList->ReDrawBubble();
       
   787             iPredictList->ReDrawBubble();
       
   788             
       
   789 #else
       
   790 
       
   791             if(!iCandidateList->Hiden() && !iPredictList->Hiden())
       
   792                 {
       
   793                 if ( aReloadPredictive )
       
   794                     {
       
   795                     iCandidateList->SetCandidatesL( candidates, unexpandable );
       
   796                     iPredictList->SetCandidatesL( predictives, unexpandable );
       
   797                     }
       
   798                 iPredictList->SetHighlightCell( 0 );  
       
   799                 
       
   800                 // Re draw preview bubble after drawing highlight cell
       
   801                 iCandidateList->ReDrawBubble();
       
   802                 iPredictList->ReDrawBubble();
       
   803                 }
       
   804             
       
   805             if(!iFixEngSymbolList1->Hiden() && !iFixEngSymbolList2->Hiden())
       
   806                 {
       
   807                 iFixEngSymbolList1->SetCandidatesL( candidates, unexpandable );
       
   808                 iFixEngSymbolList2->SetCandidatesL( predictives,unexpandable );              
       
   809                 }
       
   810 #endif            
       
   811             }
       
   812         }
       
   813     else
       
   814         {
       
   815         // hide all the dropdown list in standby state
       
   816         iCandidateList->Hide( ETrue );
       
   817         iPredictList->Hide( ETrue );
       
   818         
       
   819         iCandidateList->ClearBubble();
       
   820         iPredictList->ClearBubble();
       
   821         
       
   822 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
   823         iFixEngSymbolList1->Hide( ETrue );
       
   824         iFixEngSymbolList2->Hide( ETrue );
       
   825 #endif
       
   826 
       
   827         }            
       
   828     
       
   829     iArrowLeftBtn->Hide( !aIsStandby );
       
   830     iArrowRightBtn->Hide( !aIsStandby );
       
   831     iArrowUpBtn->Hide( !aIsStandby );
       
   832     iArrowDownBtn->Hide( !aIsStandby );
       
   833     
       
   834     iOptionBtn->Hide( !aIsStandby );
       
   835     iImeSwitchBtn->Hide( !aIsStandby );
       
   836     }
       
   837 
       
   838 // ---------------------------------------------------------------------------
       
   839 // Set highlight candidate cell when expand another list.
       
   840 // ---------------------------------------------------------------------------
       
   841 // 
       
   842 void CPeninputFingerHwrWnd::SetCandHighlightCell()
       
   843     {
       
   844     // if expand predictive list upward before charactor time out,
       
   845     // the candidate list will cover on expand predictive list.
       
   846     // To avoid this problem, add this function.
       
   847     CPeninputFingerHwrLayout* hwrLayout = NULL;
       
   848     hwrLayout = static_cast<CPeninputFingerHwrLayout*>( UiLayout() );
       
   849     CPeninputFingerHwrDataStore& datastore = hwrLayout->DataStore();    
       
   850     
       
   851     CFepUiBaseCtrl* capCtrl = RootControl()->CtrlCapPointer();
       
   852     
       
   853     if(!(capCtrl && capCtrl->ControlId() == EHwrCtrlIdPredictiveList && 
       
   854          iPredictList->CandExpandType() == CFepCtrlDropdownList::ECandExpandUpward)) 
       
   855         {
       
   856         // Set and draw highlight cell
       
   857         iCandidateList->SetHighlightCell( 0, datastore.Highlight() );
       
   858         }
       
   859     else
       
   860         {
       
   861         // Just set the highlight cell without draw
       
   862         iCandidateList->SetHighlightCell( 0, datastore.Highlight(), EFalse );
       
   863         }
       
   864     }
       
   865       
       
   866      
       
   867 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
   868 // ---------------------------------------------------------------------------
       
   869 // hide or show two eng-symbol candidate lists.
       
   870 // ---------------------------------------------------------------------------
       
   871 //
       
   872 void CPeninputFingerHwrWnd::HideTwoRowEngSymbolList( const TBool aIsHide )
       
   873     {
       
   874     iCandidateList->Hide( !aIsHide );
       
   875     iPredictList->Hide( !aIsHide );
       
   876     iFixEngSymbolList1->Hide( aIsHide );
       
   877     iFixEngSymbolList2->Hide( aIsHide );
       
   878     }
       
   879 #endif
       
   880 
       
   881 // ---------------------------------------------------------------------------
       
   882 // dim arrow buttons.
       
   883 // ---------------------------------------------------------------------------
       
   884 //
       
   885 void CPeninputFingerHwrWnd::DimArrowKeys( TBool aDimArrow )
       
   886    {
       
   887    iArrowLeftBtn->SetDimmed( aDimArrow );   
       
   888    iArrowRightBtn->SetDimmed( aDimArrow );   
       
   889    iArrowUpBtn->SetDimmed( aDimArrow );   
       
   890    iArrowDownBtn->SetDimmed( aDimArrow ); 
       
   891    }
       
   892 
       
   893 // ---------------------------------------------------------------------------
       
   894 // change layout to specified char range.
       
   895 // ---------------------------------------------------------------------------
       
   896 //
       
   897 void CPeninputFingerHwrWnd::TryToChangeCharRange( TInt aCharRange )
       
   898     {
       
   899     //CancelPopup must be called before LayoutStandby????
       
   900     //if not, pointer is captured, unregister feedback area will failed.
       
   901     if ( iRangeSelector->IsPopup() )
       
   902         {
       
   903         iRangeSelector->CancelPopup();
       
   904         }
       
   905     
       
   906     if ( iCurCharRange != aCharRange )
       
   907         {
       
   908         switch ( aCharRange )
       
   909             {
       
   910             case EFingerHwrNativeRange:
       
   911                 {
       
   912                 iCurCharRange = EFingerHwrNativeRange;
       
   913                 iCurCharRangeNoSct = EFingerHwrNativeRange;
       
   914                 LayoutStandbyChinese();
       
   915                 }
       
   916                 break;
       
   917             case EFingerHwrEnglishRange:
       
   918                 {
       
   919                 iCurCharRange = EFingerHwrEnglishRange;
       
   920                 iCurCharRangeNoSct = EFingerHwrEnglishRange;
       
   921                 LayoutStandbyEnglish();
       
   922                 }
       
   923                 break;
       
   924             case EFingerHwrNumberRange:
       
   925                 {
       
   926                 iCurCharRange = EFingerHwrNumberRange;
       
   927                 iCurCharRangeNoSct = EFingerHwrNumberRange;
       
   928                 LayoutStandbyNumeric();
       
   929                 }
       
   930                 break;
       
   931             case EFingerHwrSymbolRange:
       
   932                 {
       
   933                 iCurCharRange = EFingerHwrSymbolRange;
       
   934                 LayoutStandbySymbol();
       
   935                 }
       
   936                 break; 
       
   937             default:
       
   938                 break;
       
   939             }
       
   940         TRAP_IGNORE(ReloadWritingGuideLinesL());
       
   941         }
       
   942 
       
   943     iRangeSelector->SetCurRange( iCurCharRangeNoSct, iCurCharRange == iCurCharRangeNoSct );
       
   944     }
       
   945 
       
   946 // ---------------------------------------------------------------------------
       
   947 // retrieve char range of layout, including sct.
       
   948 // ---------------------------------------------------------------------------
       
   949 //
       
   950 TInt CPeninputFingerHwrWnd::CurrentCharRange()
       
   951     {
       
   952     return iCurCharRange;
       
   953     }
       
   954 
       
   955 // ---------------------------------------------------------------------------
       
   956 // restore the char range saved before sct.
       
   957 // ---------------------------------------------------------------------------
       
   958 //
       
   959 TInt CPeninputFingerHwrWnd::RestoreNonSctLayout()
       
   960     {
       
   961     TInt rangeFlag = ERangeInvalid;
       
   962     
       
   963     switch ( iCurCharRangeNoSct )
       
   964         {
       
   965         case EFingerHwrNativeRange:
       
   966             {
       
   967             rangeFlag = ERangeNative;
       
   968             }
       
   969             break;
       
   970         case EFingerHwrEnglishRange:
       
   971             {
       
   972             rangeFlag = ERangeEnglish;
       
   973             }
       
   974             break;
       
   975         case EFingerHwrNumberRange:
       
   976             {
       
   977             rangeFlag = ERangeNumber;
       
   978             }
       
   979             break;
       
   980         default:
       
   981             {
       
   982             rangeFlag = ERangeInvalid;
       
   983             }
       
   984             break;
       
   985         }
       
   986     TryToChangeCharRange( iCurCharRangeNoSct );
       
   987     return rangeFlag;
       
   988     }
       
   989 
       
   990 // ---------------------------------------------------------------------------
       
   991 // c++ constructor
       
   992 // ---------------------------------------------------------------------------
       
   993 //
       
   994 CPeninputFingerHwrWnd::CPeninputFingerHwrWnd( 
       
   995     CFepUiLayout* aFepUiLayout, TInt aControlId )
       
   996     : CControlGroup( aFepUiLayout,aControlId ), iFirstTimeConstruct( ETrue )
       
   997     {
       
   998     iInEditWordQueryDlg = EFalse;
       
   999     }
       
  1000     
       
  1001 // ---------------------------------------------------------------------------
       
  1002 // Symbian second-phase constructor
       
  1003 // ---------------------------------------------------------------------------
       
  1004 //
       
  1005 void CPeninputFingerHwrWnd::ConstructL( TBool /*aLandscapeStyle*/ )
       
  1006     {
       
  1007     BaseConstructL();    
       
  1008     
       
  1009     iLafManager = CPeninputFingerHwrLAFManager::NewL();
       
  1010     iLafManager->ReadLafInfo();
       
  1011     
       
  1012     //crate writing 
       
  1013     CreateWritingBoxL();
       
  1014     
       
  1015     //create icf 
       
  1016     CreateContextFieldL();
       
  1017     
       
  1018     //create candidate lists
       
  1019     CreateCandidateListL();
       
  1020     
       
  1021     //create predictive lists
       
  1022     CreatePredictListL();
       
  1023     
       
  1024     //create virtual num pad
       
  1025     CreateVirtualNumpadL();
       
  1026     
       
  1027     //create virtual sct pad
       
  1028     CreateVirtualSctpadL();
       
  1029     
       
  1030     //create space and backspace virtual pad
       
  1031     CreateFixVirtualSctpadL();
       
  1032 
       
  1033     //create control buttons
       
  1034     CreateButtonsL();
       
  1035     
       
  1036     //create range selecor
       
  1037     iRangeSelector = CPeninputFingerHwrRangeSelector::NewL( 
       
  1038         UiLayout(), EHwrCtrlIdRangeSelector );
       
  1039     AddControlL( iRangeSelector );
       
  1040     
       
  1041     //create ime selector
       
  1042     iInputModeSwitch = CPeninputLayoutInputmodelChoice::NewL( 
       
  1043         UiLayout(), EHwrCtrlIdInputModeSwitcher, 
       
  1044         EPluginInputModeFingerHwr );
       
  1045     
       
  1046     iInputModeSwitch->SetListSkinID( KAknsIIDQsnFrList, KAknsIIDQsnFrPopupSub );
       
  1047     UiLayout()->AddControlL( iInputModeSwitch );
       
  1048     iInputModeSwitch->AddEventObserver( UiLayout() );    
       
  1049     
       
  1050     iCurCharRangeNoSct = EFingerHwrNativeRange;
       
  1051     iCurCharRange      = EFingerHwrNativeRange;
       
  1052     ResetLayoutL();
       
  1053     
       
  1054     LayoutStandbyChinese();
       
  1055     }
       
  1056     
       
  1057 // ---------------------------------------------------------------------------
       
  1058 // create icf.
       
  1059 // ---------------------------------------------------------------------------
       
  1060 //
       
  1061 void CPeninputFingerHwrWnd::CreateContextFieldL()
       
  1062     {
       
  1063     const CFont* icffont =iLafManager->IcfFont(); 
       
  1064     
       
  1065     iContextField = CFepLayoutMultiLineIcf::NewL( 
       
  1066         iLafManager->IcfRect(), 
       
  1067         UiLayout(), 
       
  1068         EHwrCtrlIdInputContextField, 
       
  1069         icffont->HeightInPixels(),
       
  1070         icffont->FontMaxHeight(),
       
  1071         icffont );
       
  1072 
       
  1073     iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(),
       
  1074                       iLafManager->IcfRightMargin(),
       
  1075                       iLafManager->IcfTopMargin(),
       
  1076                       iLafManager->IcfBottomMargin() );
       
  1077                       
       
  1078     iContextField->SetLineSpace( iLafManager->IcfLineSpaceMargin() );                         
       
  1079  
       
  1080     iContextField->SizeChangedL( iLafManager->IcfRect(), 
       
  1081                       iLafManager->IcfTextHeight(),
       
  1082                       iLafManager->IcfFont()->FontMaxHeight(),
       
  1083                       iLafManager->IcfFont() );
       
  1084 
       
  1085     TAknWindowLineLayout bubbleLineLayout = AknLayoutScalable_Apps::popup_char_count_window().LayoutLine();
       
  1086     TAknTextLineLayout bubbleTextLayout = AknLayoutScalable_Apps::popup_char_count_window_t1( 0 ).LayoutLine();
       
  1087     
       
  1088     iContextField->MsgBubbleCtrl()->SetTextFormat( bubbleTextLayout );
       
  1089     iContextField->MsgBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
       
  1090     //Change the ID when ID into release
       
  1091     iContextField->MsgBubbleCtrl()->SetBitmapParam( NULL,
       
  1092                                           NULL,
       
  1093                                           KAknsIIDQsnFrInputPreviewSideL,
       
  1094                                           KAknsIIDQsnFrInputPreviewMiddle,
       
  1095                                           KAknsIIDQsnFrInputPreviewSideR );  
       
  1096     iContextField->SetMsgBubbleCtrlSize( TSize( bubbleLineLayout.iW,bubbleLineLayout.iH ) );    
       
  1097     
       
  1098 
       
  1099     //transfer to headerPane
       
  1100     AddControlL( iContextField );
       
  1101     
       
  1102     //add layout as event observer
       
  1103     iContextField->AddEventObserver( UiLayout() );
       
  1104     iContextField->SetFocus();
       
  1105 
       
  1106     }
       
  1107 
       
  1108 // ---------------------------------------------------------------------------
       
  1109 // create candidate lists.
       
  1110 // ---------------------------------------------------------------------------
       
  1111 //
       
  1112 void CPeninputFingerHwrWnd::CreateCandidateListL()
       
  1113     {  
       
  1114     TDropdownListDrawInfo candiDrawInfo( 
       
  1115             KAknsIIDQsnFrFunctionButtonInactive, 
       
  1116             KAknsIIDQsnFrFunctionButtonNormal,
       
  1117             KAknsIIDQsnFrFunctionButtonPressed,
       
  1118             KAknsIIDQsnFrItutButtonCandiSideL,
       
  1119             KAknsIIDQsnFrItutButtonCandiMiddle,
       
  1120             KAknsIIDQsnFrItutButtonCandiSideR,
       
  1121             KAknsIIDQsnFrItutButtonCandiPressedSideL,
       
  1122             KAknsIIDQsnFrItutButtonCandiPressedMiddle,
       
  1123             KAknsIIDQsnFrItutButtonCandiPressedSideR,
       
  1124             TRgb( 194, 221, 242 ),
       
  1125             ETrue );
       
  1126 
       
  1127     TInt unitWidth = iLafManager->CandidateUnitWidth();
       
  1128     TInt unitHeight = iLafManager->CandidateUnitHeight();
       
  1129     TPoint ltPosition = iLafManager->CandidateLTPos();
       
  1130     iCandidateList = CFepCtrlDropdownList::NewL( UiLayout(),
       
  1131             EHwrCtrlIdCandidateList, 
       
  1132             R_FSHWR_CANDIDATE_DROP_DOWN_LIST, ltPosition, 
       
  1133             TSize(unitWidth, unitHeight), KCandidateCountPerRow, 1 );  
       
  1134             
       
  1135     AddControlL( iCandidateList );
       
  1136 
       
  1137     const CFont *font = iLafManager->CandidateFont();
       
  1138     TInt horizontalMargin = iLafManager->CandidateHorizontalMargin();
       
  1139     TInt verticalMargin = iLafManager->CandidateVerticalMargin();
       
  1140     iCandidateList->SetCellMargin( horizontalMargin, verticalMargin );
       
  1141     iCandidateList->SetFont( font );
       
  1142     
       
  1143     // set the needed events
       
  1144     iCandidateList->SetEventIdForCandidateSelected( EHwrEventCandidateSelected );
       
  1145     iCandidateList->AddEventObserver( UiLayout() );
       
  1146     
       
  1147     // hide the candidate list
       
  1148     iCandidateList->Hide( ETrue );
       
  1149     iCandidateList->SetDropdownListImgID( candiDrawInfo );
       
  1150     
       
  1151 
       
  1152 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
  1153     iFixEngSymbolList1 = CFepCtrlDropdownList::NewL( UiLayout(),
       
  1154                                                  EHwrCtrlIdFixEngSymbolList,
       
  1155                                                  R_FSHWR_CANDIDATE_DROP_DOWN_LIST,
       
  1156                                                  ltPosition,
       
  1157                                                  TSize( unitWidth, unitHeight ),
       
  1158                                                  KCandidateCountPerRow,
       
  1159                                                  1 );
       
  1160     
       
  1161     AddControlL( iFixEngSymbolList1 );
       
  1162     
       
  1163     iFixEngSymbolList1->SetCellMargin( horizontalMargin, verticalMargin );
       
  1164     iFixEngSymbolList1->SetFont( font );
       
  1165     iFixEngSymbolList1->SetEventIdForCandidateSelected( EHwrEventCandidateSelected );
       
  1166     iFixEngSymbolList1->AddEventObserver( UiLayout() );
       
  1167     
       
  1168     // hide the candidate list
       
  1169     iFixEngSymbolList1->Hide( ETrue );
       
  1170     iFixEngSymbolList1->SetDropdownListImgID( candiDrawInfo );
       
  1171     
       
  1172 #endif
       
  1173     }
       
  1174 
       
  1175 // ---------------------------------------------------------------------------
       
  1176 // create predictive lists.
       
  1177 // ---------------------------------------------------------------------------
       
  1178 //
       
  1179 void CPeninputFingerHwrWnd::CreatePredictListL()
       
  1180     {                                       
       
  1181     TDropdownListDrawInfo predicDrawInfo( 
       
  1182             KAknsIIDQsnFrFunctionButtonInactive, 
       
  1183             KAknsIIDQsnFrFunctionButtonNormal,
       
  1184             KAknsIIDQsnFrFunctionButtonPressed,
       
  1185             KAknsIIDQsnFrItutButtonComposeSideL,
       
  1186             KAknsIIDQsnFrItutButtonComposeMiddle,
       
  1187             KAknsIIDQsnFrItutButtonComposeSideR,
       
  1188             KAknsIIDQsnFrItutButtonComposePressedSideL,
       
  1189             KAknsIIDQsnFrItutButtonComposePressedSideR,
       
  1190             KAknsIIDQsnFrItutButtonComposePressedMiddle,
       
  1191             TRgb( 194, 221, 242 ),
       
  1192             ETrue );     
       
  1193 
       
  1194     TInt unitWidth = iLafManager->CandidateUnitWidth();
       
  1195     TInt unitHeight = iLafManager->CandidateUnitHeight();
       
  1196     TPoint ltPosition = iLafManager->PredictiveLTPos();
       
  1197     iPredictList = CFepCtrlDropdownList::NewL( UiLayout(),
       
  1198                                                EHwrCtrlIdPredictiveList,
       
  1199                                                R_FSHWR_PREDICT_DROP_DOWN_LIST,
       
  1200                                                ltPosition,
       
  1201                                                TSize( unitWidth, unitHeight ),
       
  1202                                                KPredictiveCountPerRow,
       
  1203                                                KPredictiveRowCount );  
       
  1204   
       
  1205     if ( iLafManager->IsLandscape() )
       
  1206         {
       
  1207         iPredictList->SetCandExpandType( CFepCtrlDropdownList::ECandExpandUpward );
       
  1208         }
       
  1209           
       
  1210     AddControlL( iPredictList );
       
  1211     
       
  1212     const CFont *font = iLafManager->CandidateFont();
       
  1213     TInt horizontalMargin = iLafManager->CandidateHorizontalMargin();
       
  1214     TInt verticalMargin = iLafManager->CandidateVerticalMargin();
       
  1215     iPredictList->SetCellMargin( horizontalMargin, verticalMargin );
       
  1216     iPredictList->SetFont( font );
       
  1217     
       
  1218     // set the needed events
       
  1219     iPredictList->SetEventIdForCandidateSelected( EHwrEventPredictiveSelected );
       
  1220     iPredictList->SetEventIdForNextPageCandidate( EHwrEventGetNextCandidatePage );
       
  1221     iPredictList->AddEventObserver( UiLayout() );
       
  1222     
       
  1223     // hide the predictive list
       
  1224     iPredictList->Hide( ETrue );
       
  1225     iPredictList->SetDropdownListImgID( predicDrawInfo );
       
  1226     
       
  1227     
       
  1228 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1229     TDropdownListDrawInfo candiDrawInfo( 
       
  1230             KAknsIIDQsnFrFunctionButtonInactive, 
       
  1231             KAknsIIDQsnFrFunctionButtonNormal,
       
  1232             KAknsIIDQsnFrFunctionButtonPressed,
       
  1233             KAknsIIDQsnFrItutButtonCandiSideL,
       
  1234             KAknsIIDQsnFrItutButtonCandiMiddle,
       
  1235             KAknsIIDQsnFrItutButtonCandiSideR,
       
  1236             KAknsIIDQsnFrItutButtonCandiPressedSideL,
       
  1237             KAknsIIDQsnFrItutButtonCandiPressedMiddle,
       
  1238             KAknsIIDQsnFrItutButtonCandiPressedSideR,
       
  1239             TRgb( 194, 221, 242 ),
       
  1240             ETrue );
       
  1241     
       
  1242     iFixEngSymbolList2 = CFepCtrlDropdownList::NewL( UiLayout(),
       
  1243                                                  EHwrCtrlIdFixEngSymbolList,
       
  1244                                                  R_FSHWR_CANDIDATE_DROP_DOWN_LIST,
       
  1245                                                  ltPosition,
       
  1246                                                  TSize( unitWidth, unitHeight ),
       
  1247                                                  KCandidateCountPerRow,
       
  1248                                                  1 );
       
  1249     
       
  1250     AddControlL( iFixEngSymbolList2 );
       
  1251     
       
  1252     iFixEngSymbolList2->SetCellMargin( horizontalMargin, verticalMargin );
       
  1253     iFixEngSymbolList2->SetFont( font );
       
  1254     iFixEngSymbolList2->SetEventIdForCandidateSelected( EHwrEventCandidateSelected );
       
  1255     iFixEngSymbolList2->AddEventObserver( UiLayout() );
       
  1256     
       
  1257     // hide the candidate list
       
  1258     iFixEngSymbolList2->Hide( ETrue );
       
  1259     iFixEngSymbolList2->SetDropdownListImgID( candiDrawInfo );
       
  1260 #endif  
       
  1261     }
       
  1262     
       
  1263 // ---------------------------------------------------------------------------
       
  1264 // create writing box.
       
  1265 // ---------------------------------------------------------------------------
       
  1266 //
       
  1267 void CPeninputFingerHwrWnd::CreateWritingBoxL()
       
  1268     {
       
  1269     iWritingBox = CTransparentHwrWnd::NewL( TRect( 0,0,0,0 ), UiLayout(), 
       
  1270                                             EHwrCtrlIdWritingBox, EFalse );
       
  1271     
       
  1272     AddControlL( iWritingBox );
       
  1273     
       
  1274     
       
  1275     //set it to window
       
  1276     iWritingBox->SetStrokeEndMark( TPoint( -1,0 ) );
       
  1277     iWritingBox->AddEventObserver( UiLayout() );
       
  1278     iWritingBox->EnableTraceOutsideWindow( EFalse );
       
  1279     iWritingBox->SetWndTransparencyFactor( 0 );
       
  1280 
       
  1281     iWritingBox->InstallPenTraceDecoratorL( KNullDesC );
       
  1282     }
       
  1283 
       
  1284 // ---------------------------------------------------------------------------
       
  1285 // create all function buttons.
       
  1286 // ---------------------------------------------------------------------------
       
  1287 //
       
  1288 void CPeninputFingerHwrWnd::CreateButtonsL()
       
  1289     {
       
  1290     iCloseBtn = CreateEventBtnL( EHwrCtrlIdClose, R_AKN_FEP_HWR_CLOSE );
       
  1291     iOptionBtn = CreateEventBtnL( EHwrCtrlIdLanguageOption, R_AKN_FEP_HWR_OPTION );
       
  1292     iImeSwitchBtn = CreateEventBtnL( EHwrCtrlIdVkbSwitcher, R_AKN_FEP_HWR_VKB );
       
  1293     
       
  1294     iBackspaceBtn = CreateRepBtnL( EHwrCtrlIdBackspace, R_AKN_FEP_HWR_BACK_SPACE, 
       
  1295         EHwrEventKeyBack, EKeyBackspace );
       
  1296     iArrowLeftBtn = CreateRepBtnL( EHwrCtrlIdArrowLeft, R_AKN_FEP_HWR_ARROWLEFT, 
       
  1297         EHwrEventNavKeyClicked, EKeyLeftArrow );
       
  1298     iArrowRightBtn = CreateRepBtnL( EHwrCtrlIdArrowRight, R_AKN_FEP_HWR_ARROWRIGHT, 
       
  1299         EHwrEventNavKeyClicked, EKeyRightArrow );
       
  1300     iArrowUpBtn = CreateRepBtnL( EHwrCtrlIdArrowUp, R_AKN_FEP_HWR_ARROWUP, 
       
  1301         EHwrEventNavKeyClicked, EKeyUpArrow );
       
  1302     iArrowDownBtn = CreateRepBtnL( EHwrCtrlIdArrowDown, R_AKN_FEP_HWR_ARROWDOWN, 
       
  1303         EHwrEventNavKeyClicked, EKeyDownArrow );
       
  1304     
       
  1305     iRangeSpecialBtn = CreateEventBtnL( EHwrCtrlIdSymbolButton, R_AKN_FEP_HWR_RANGE_SPECIAL );
       
  1306     
       
  1307     iSctPage0Btn  = CreateEventBtnL( EHwrCtrlIdSctPage0Btn, R_AKN_FEP_HWR_SCT_PAGE_1 );
       
  1308     iSctPage1Btn  = CreateEventBtnL( EHwrCtrlIdSctPage1Btn, R_AKN_FEP_HWR_SCT_PAGE_2 );
       
  1309     iSctPage2Btn  = CreateEventBtnL( EHwrCtrlIdSctPage2Btn, R_AKN_FEP_HWR_SCT_PAGE_3 );
       
  1310     }
       
  1311 
       
  1312 // ---------------------------------------------------------------------------
       
  1313 // create virtual number pad.
       
  1314 // ---------------------------------------------------------------------------
       
  1315 //
       
  1316 void CPeninputFingerHwrWnd::CreateVirtualNumpadL()
       
  1317     {
       
  1318     TFontSpec spec;
       
  1319 
       
  1320     iVirtualNumpad = CVirtualKeyboard::NewL( 
       
  1321         TRect( 0,0,0,0 ),
       
  1322         UiLayout(),
       
  1323         EHwrCtrlIdNumpad,
       
  1324         spec );
       
  1325     AddControlL( iVirtualNumpad );
       
  1326     iVirtualNumpad->AddEventObserver( UiLayout() );
       
  1327 
       
  1328     iVirtualNumpad->SetResourceId( KInvalidResId );
       
  1329     
       
  1330     // read keypad image info
       
  1331     TSize keysize = iLafManager->VirtualNumpadCellSize().Size();
       
  1332     
       
  1333     
       
  1334     LoadVkbKeyImageL( iVirtualNumpad, R_FINGER_HWR_NUMPAD_IMAGE, keysize );
       
  1335     
       
  1336     RArray<TRect> rects;
       
  1337     CleanupClosePushL( rects );
       
  1338     
       
  1339     iLafManager->GetVirtualKeyRects( rects );
       
  1340     LoadVirtualNumpadKeysL( R_FINGER_HWR_NUMPAD, rects );
       
  1341     
       
  1342     CleanupStack::PopAndDestroy(); //rects
       
  1343     
       
  1344     iVirtualNumpad->SetKeyTextColorGroup( EAknsCIQsnTextColorsCG65 );
       
  1345     iVirtualNumpad->SetDrawOpaqueBackground( EFalse );
       
  1346     
       
  1347     //set key to be 9 piece graphics
       
  1348     iVirtualNumpad->SetKeySkinId( EKeyBmpNormal, KAknsIIDQsnFrKeypadButtonFrNormal );
       
  1349     iVirtualNumpad->SetKeySkinId( EKeyBmpHighlight, KAknsIIDQsnFrKeypadButtonFrPressed );
       
  1350     iVirtualNumpad->SetKeySkinId( EKeyBmpDim, KAknsIIDQsnFrKeypadButtonFrInactive );    
       
  1351     }
       
  1352 
       
  1353 // ---------------------------------------------------------------------------
       
  1354 // create virtual sct pad.
       
  1355 // ---------------------------------------------------------------------------
       
  1356 //
       
  1357 void CPeninputFingerHwrWnd::CreateVirtualSctpadL()
       
  1358     {
       
  1359     TFontSpec spec;
       
  1360 
       
  1361     iVirtualSctpad = CMultiPageVirtualKeyboard::NewL( 
       
  1362         iLafManager->CtrlRect(EHwrCtrlIdSctpad),
       
  1363         UiLayout(),
       
  1364         EHwrCtrlIdSctpad,
       
  1365         spec );
       
  1366     AddControlL( iVirtualSctpad );
       
  1367     iVirtualSctpad->AddEventObserver( UiLayout() );
       
  1368     
       
  1369     iVirtualSctpad->SetResourceId( KInvalidResId );
       
  1370     
       
  1371     // read keypad image info
       
  1372     TSize keysize = iLafManager->VirtualSctpadCellSize().Size();
       
  1373 
       
  1374     LoadVkbKeyImageL( iVirtualSctpad, R_FINGER_HWR_SCTPAD_IMAGE, keysize );
       
  1375     
       
  1376     RArray<TRect> rects;
       
  1377     CleanupClosePushL( rects );
       
  1378     
       
  1379     iLafManager->GetVirtualKeyRects( rects );
       
  1380     LoadVirtualSctpadKeysL( R_FINGER_HWR_SCTPAD, rects );
       
  1381     
       
  1382     CleanupStack::PopAndDestroy();//rects
       
  1383     
       
  1384     TInt rows = iLafManager->VirtualSctpadRowCount();
       
  1385     TInt cols = iLafManager->VirtualSctpadColCount();
       
  1386     iVirtualSctpad->UpdatePaging( rows, cols );
       
  1387     
       
  1388     iVirtualSctpad->SetKeyTextColorGroup( EAknsCIQsnTextColorsCG65 );
       
  1389     iVirtualSctpad->SetDrawOpaqueBackground( EFalse );
       
  1390 
       
  1391     //set key to be 9 piece graphics
       
  1392     iVirtualSctpad->SetKeySkinId( EKeyBmpNormal, KAknsIIDQsnFrKeypadButtonFrNormal );
       
  1393     iVirtualSctpad->SetKeySkinId( EKeyBmpHighlight, KAknsIIDQsnFrKeypadButtonFrPressed );
       
  1394     iVirtualSctpad->SetKeySkinId( EKeyBmpDim, KAknsIIDQsnFrKeypadButtonFrInactive );
       
  1395     }
       
  1396 
       
  1397 
       
  1398 // ---------------------------------------------------------------------------
       
  1399 // create virtual sct pad.
       
  1400 // ---------------------------------------------------------------------------
       
  1401 //
       
  1402 void CPeninputFingerHwrWnd::CreateFixVirtualSctpadL()
       
  1403     {
       
  1404     TFontSpec spec;
       
  1405 
       
  1406     iVirtualSctpadFix = CVirtualKeyboard::NewL( 
       
  1407         iLafManager->CtrlRect(EHwrCtrlIdSctpadFix),
       
  1408         UiLayout(),
       
  1409         EHwrCtrlIdSctpadFix,
       
  1410         spec );
       
  1411     AddControlL( iVirtualSctpadFix );
       
  1412     iVirtualSctpadFix->AddEventObserver( UiLayout() );
       
  1413     
       
  1414     iVirtualSctpadFix->SetResourceId( KInvalidResId );
       
  1415     
       
  1416     // read keypad image info
       
  1417     TSize keysize = iLafManager->FixVirtualSctpadCellSize().Size();
       
  1418 
       
  1419     LoadVkbKeyImageL( iVirtualSctpadFix, R_FINGER_HWR_SCTPAD_IMAGE, keysize );
       
  1420     
       
  1421     RArray<TRect> rects;
       
  1422     CleanupClosePushL( rects );
       
  1423     
       
  1424     iLafManager->GetFixVirtualKeyRects( rects );
       
  1425     LoadFixVirtualSctpadKeysL( R_FINGER_HWR_SCTPAD_FIX, rects );
       
  1426     
       
  1427     CleanupStack::PopAndDestroy();//rects
       
  1428     
       
  1429     iVirtualSctpadFix->SetKeyTextColorGroup( EAknsCIQsnTextColorsCG65 );
       
  1430     iVirtualSctpadFix->SetDrawOpaqueBackground( EFalse );
       
  1431 
       
  1432     //set key to be 9 piece graphics
       
  1433     iVirtualSctpadFix->SetKeySkinId( EKeyBmpNormal, KAknsIIDQsnFrKeypadButtonFrNormal );
       
  1434     iVirtualSctpadFix->SetKeySkinId( EKeyBmpHighlight, KAknsIIDQsnFrKeypadButtonFrPressed );
       
  1435     iVirtualSctpadFix->SetKeySkinId( EKeyBmpDim, KAknsIIDQsnFrKeypadButtonFrInactive );    
       
  1436     }
       
  1437 
       
  1438 // ---------------------------------------------------------------------------
       
  1439 // EventButton creation helper.
       
  1440 // ---------------------------------------------------------------------------
       
  1441 //
       
  1442 CAknFepCtrlEventButton* CPeninputFingerHwrWnd::CreateEventBtnL( TInt aCtrlId, 
       
  1443     TInt32 aResId, TInt aEvent/*= 0xFFFF*/,TInt aUnicode/*=0*/ )
       
  1444     {
       
  1445     CAknFepCtrlEventButton* button = CAknFepCtrlEventButton::NewL( 
       
  1446         UiLayout(), aCtrlId, aEvent, aUnicode,
       
  1447         KAknsIIDQsnFrFunctionButtonNormal,
       
  1448         KAknsIIDQsnFrFunctionButtonPressed,
       
  1449         KAknsIIDQsnFrFunctionButtonInactive );
       
  1450     
       
  1451     button->SetResourceId( aResId );
       
  1452     button->ConstructFromResourceL();
       
  1453     button->AddEventObserver( UiLayout() );        
       
  1454     AddControlL( button );
       
  1455     return button;
       
  1456     }
       
  1457 
       
  1458 // ---------------------------------------------------------------------------
       
  1459 // RepeatButton creation helper.
       
  1460 // ---------------------------------------------------------------------------
       
  1461 //
       
  1462 CAknFepCtrlRepeatButton* CPeninputFingerHwrWnd::CreateRepBtnL( const TInt aCtrlId, 
       
  1463     TInt32 aResId, const TInt aEvent, const TInt aUnicode )
       
  1464     {
       
  1465     CAknFepCtrlRepeatButton* button = CAknFepCtrlRepeatButton::NewL( 
       
  1466         UiLayout(), aCtrlId, aEvent, aUnicode,
       
  1467         KAknsIIDQsnFrFunctionButtonNormal,
       
  1468         KAknsIIDQsnFrFunctionButtonPressed,
       
  1469         KAknsIIDQsnFrFunctionButtonInactive );
       
  1470     
       
  1471     button->SetResourceId( aResId );
       
  1472     button->ConstructFromResourceL( );
       
  1473     button->AddEventObserver( UiLayout() );
       
  1474     AddControlL( button );
       
  1475     
       
  1476     return button;
       
  1477     }
       
  1478 
       
  1479 // ---------------------------------------------------------------------------
       
  1480 // load virtual number pad images. 
       
  1481 // ---------------------------------------------------------------------------
       
  1482 //
       
  1483 void CPeninputFingerHwrWnd::LoadVkbKeyImageL( CVirtualKeyboard* aVkb, 
       
  1484     TInt aResId, const TSize& aKeySize )
       
  1485     {
       
  1486     TResourceReader reader;    
       
  1487     CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );      
       
  1488     
       
  1489     TPtrC bmpFileName = reader.ReadTPtrC();
       
  1490     TInt32 imgMajorSkinId = reader.ReadInt32();
       
  1491     TAknsItemID id;
       
  1492     
       
  1493     TSize keySize = aKeySize;
       
  1494     
       
  1495     for ( TInt index = 0; index <= EKeyBmpLastType ; index += 2 )
       
  1496         { 
       
  1497         // Get the image ids and mask ids from resource
       
  1498         TInt bmpId = reader.ReadInt16(); 
       
  1499         TInt bmpMskId = reader.ReadInt16();
       
  1500         
       
  1501         // read skin item id
       
  1502         const TInt skinitemid = reader.ReadInt16();
       
  1503         id.Set( TInt( imgMajorSkinId ), skinitemid );
       
  1504         
       
  1505         if ( bmpId != KInvalidImg )
       
  1506             {
       
  1507             CFbsBitmap* bmp = NULL;
       
  1508             CFbsBitmap* maskbmp = NULL;
       
  1509 
       
  1510             if ( bmpMskId != KInvalidImg )
       
  1511                 {
       
  1512                 AknsUtils::CreateIconL( UiLayout()->SkinInstance(),
       
  1513                    id, bmp, maskbmp, bmpFileName, bmpId, bmpMskId );
       
  1514                 
       
  1515                 // set maskbmp and size
       
  1516                 AknIconUtils::SetSize( maskbmp, keySize, EAspectRatioNotPreserved );
       
  1517                 aVkb->SetNonIrregularKeyBitmapL( 
       
  1518                         TVirtualKeyBmpType( EKeyBmpNormal + index + 1 ), maskbmp );
       
  1519                 }
       
  1520             else
       
  1521                 {
       
  1522                 AknsUtils::CreateIconL( UiLayout()->SkinInstance(), id, 
       
  1523                     bmp, bmpFileName, bmpId );
       
  1524                 }
       
  1525             // set bmp and size
       
  1526             AknIconUtils::SetSize( bmp, keySize, EAspectRatioNotPreserved );
       
  1527             aVkb->SetNonIrregularKeyBitmapL( 
       
  1528                 TVirtualKeyBmpType( EKeyBmpNormal + index ), bmp );
       
  1529             }       
       
  1530         }
       
  1531     // Pop and destroy reader
       
  1532     CleanupStack::PopAndDestroy( 1 );           
       
  1533     }
       
  1534 
       
  1535 
       
  1536 // ---------------------------------------------------------------------------
       
  1537 // create virtual key.
       
  1538 // ---------------------------------------------------------------------------
       
  1539 //
       
  1540 CVirtualKey* CPeninputFingerHwrWnd::CreateVkbKeyL( TResourceReader& aReader, 
       
  1541     const TRect aKeyRect )
       
  1542     {
       
  1543     CHBufCArray* keytexts = CHBufCArray::NewL();
       
  1544     CleanupStack::PushL( keytexts );
       
  1545     
       
  1546     for ( TInt i = 0; i <= EPosLast; i++ )
       
  1547         {
       
  1548         HBufC* unicode = aReader.ReadHBufCL();
       
  1549         keytexts->Array().AppendL( unicode );
       
  1550         }
       
  1551 
       
  1552     TInt keyscancode = aReader.ReadInt16();
       
  1553 
       
  1554     HBufC* text = keytexts->Array()[0];
       
  1555     
       
  1556     CVirtualKey* vk = NULL;
       
  1557     if ( text )
       
  1558         {
       
  1559         vk = CVirtualKey::NewL( *text, keyscancode, aKeyRect, aKeyRect, 0 );
       
  1560         }
       
  1561     else 
       
  1562         {
       
  1563         vk = CVirtualKey::NewL( KNullDesC, keyscancode, aKeyRect, aKeyRect, 0 );
       
  1564         }
       
  1565 
       
  1566     CleanupStack::PopAndDestroy( keytexts ); //keytexts
       
  1567 
       
  1568 
       
  1569     TRect innerrect = aKeyRect;
       
  1570     innerrect.Shrink( TSize(10, 10) );
       
  1571     vk->SetInnerRect( innerrect );
       
  1572     
       
  1573     return vk;
       
  1574     }
       
  1575 
       
  1576 
       
  1577 // ---------------------------------------------------------------------------
       
  1578 // update virtual key info.
       
  1579 // ---------------------------------------------------------------------------
       
  1580 //
       
  1581 void CPeninputFingerHwrWnd::UpdateVkbKeyL( CVirtualKey* aVirtualKey, 
       
  1582     TResourceReader& aReader, const TRect aKeyRect )
       
  1583     {
       
  1584     CHBufCArray* keytexts = CHBufCArray::NewL();
       
  1585     CleanupStack::PushL( keytexts );
       
  1586     
       
  1587     for ( TInt i = 0; i <= EPosLast; i++ )
       
  1588         {
       
  1589         HBufC* unicode = aReader.ReadHBufCL();
       
  1590         keytexts->Array().AppendL( unicode );
       
  1591         }
       
  1592 
       
  1593     TInt keyscancode = aReader.ReadInt16();
       
  1594 
       
  1595     HBufC* text = keytexts->Array()[0];
       
  1596     if ( text )
       
  1597         {
       
  1598         aVirtualKey->SetKeyData( *text );
       
  1599         }
       
  1600     else
       
  1601         {
       
  1602         aVirtualKey->SetKeyData( KNullDesC );
       
  1603         }
       
  1604     
       
  1605     aVirtualKey->SetKeyScancode( keyscancode );
       
  1606 
       
  1607     CleanupStack::PopAndDestroy( keytexts ); //keytexts
       
  1608 
       
  1609 
       
  1610     TRect innerrect = aKeyRect;
       
  1611     innerrect.Shrink( TSize(10,10) );
       
  1612     aVirtualKey->SetInnerRect( innerrect );
       
  1613    
       
  1614     }
       
  1615 
       
  1616 // ---------------------------------------------------------------------------
       
  1617 // load virtual number keys.
       
  1618 // ---------------------------------------------------------------------------
       
  1619 //
       
  1620 void CPeninputFingerHwrWnd::LoadVirtualNumpadKeysL( 
       
  1621     const TInt aResId, const RArray<TRect>& aCellRects )
       
  1622     {
       
  1623     iVirtualNumpad->SetResourceId( aResId );
       
  1624     
       
  1625     TAknTextLineLayout txtlayout = iLafManager->NumpadKeyTxtLayout();
       
  1626     iVirtualNumpad->SetTextLineLayout( txtlayout );
       
  1627     
       
  1628     TInt fontid = txtlayout.FontId();
       
  1629     const CFont* font = AknLayoutUtils::FontFromId( fontid );
       
  1630     iVirtualNumpad->SetFont( font );
       
  1631     
       
  1632 
       
  1633     TResourceReader reader;
       
  1634     CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
       
  1635 
       
  1636 
       
  1637     // construct keys
       
  1638     TInt resKeyCount = reader.ReadInt16();
       
  1639     TInt existsKeyCount = iVirtualNumpad->KeyArray().Count();
       
  1640     TInt rectCount = aCellRects.Count();
       
  1641     
       
  1642     for ( TInt i = 0; i < resKeyCount; i++ )
       
  1643         {
       
  1644         if ( i < existsKeyCount )
       
  1645             {
       
  1646             CVirtualKey* vk = iVirtualNumpad->KeyArray()[i];
       
  1647             UpdateVkbKeyL( vk, reader, aCellRects[i%rectCount] );
       
  1648             }
       
  1649         else
       
  1650             {
       
  1651             CVirtualKey* vk = CreateVkbKeyL( reader, aCellRects[i%rectCount] );
       
  1652             CleanupStack::PushL( vk );
       
  1653             iVirtualNumpad->AddKeyL( vk );
       
  1654             CleanupStack::Pop( vk );
       
  1655             }
       
  1656         }    
       
  1657     CleanupStack::PopAndDestroy( 1 ); // reader
       
  1658     
       
  1659     iVirtualNumpad->Draw();
       
  1660     iVirtualNumpad->UpdateArea( iVirtualNumpad->Rect() );
       
  1661     }
       
  1662 
       
  1663 
       
  1664 // ---------------------------------------------------------------------------
       
  1665 // load virtual sct keys.
       
  1666 // ---------------------------------------------------------------------------
       
  1667 //
       
  1668 void CPeninputFingerHwrWnd::LoadVirtualSctpadKeysL( const TInt aResId, 
       
  1669     const RArray<TRect>& aCellRects )
       
  1670     {
       
  1671     iVirtualSctpad->SetResourceId( aResId );
       
  1672     
       
  1673     TAknTextLineLayout txtlayout = iLafManager->SctpadKeyTxtLayout();
       
  1674     iVirtualSctpad->SetTextLineLayout( txtlayout );
       
  1675     
       
  1676     TInt fontid = txtlayout.FontId();
       
  1677     const CFont* font = AknLayoutUtils::FontFromId( fontid );
       
  1678     iVirtualSctpad->SetFont( font );
       
  1679     
       
  1680 
       
  1681     TResourceReader reader;
       
  1682     CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
       
  1683 
       
  1684     // construct keys
       
  1685     TInt resKeyCount = reader.ReadInt16();
       
  1686     TInt existsKeyCount = iVirtualSctpad->KeyArray().Count();
       
  1687     TInt rectCount = aCellRects.Count();
       
  1688     
       
  1689     for ( TInt i = 0; i < resKeyCount; i++ )
       
  1690         {
       
  1691         if ( i < existsKeyCount )
       
  1692             {
       
  1693             CVirtualKey* vk = iVirtualSctpad->KeyArray()[i];
       
  1694             UpdateVkbKeyL( vk, reader, aCellRects[i%rectCount] );
       
  1695             }
       
  1696         else
       
  1697             {
       
  1698             CVirtualKey* vk = CreateVkbKeyL( reader, aCellRects[i%rectCount] );
       
  1699             CleanupStack::PushL( vk );
       
  1700             iVirtualSctpad->AddKeyL( vk );
       
  1701             CleanupStack::Pop( vk );
       
  1702             }
       
  1703         }
       
  1704     
       
  1705     CleanupStack::PopAndDestroy( 1 ); // reader
       
  1706     
       
  1707     iVirtualSctpad->Draw();
       
  1708     iVirtualSctpad->UpdateArea( iVirtualSctpad->Rect() );
       
  1709     
       
  1710     }
       
  1711 
       
  1712 // ---------------------------------------------------------------------------
       
  1713 // load virtual sct keys.
       
  1714 // ---------------------------------------------------------------------------
       
  1715 //
       
  1716 void CPeninputFingerHwrWnd::LoadFixVirtualSctpadKeysL( const TInt aResId, 
       
  1717     const RArray<TRect>& aCellRects )
       
  1718     {
       
  1719     iVirtualSctpadFix->SetResourceId( aResId );
       
  1720     
       
  1721     TAknTextLineLayout txtlayout = iLafManager->FixSctpadKeyTxtLayout();
       
  1722     iVirtualSctpadFix->SetTextLineLayout( txtlayout );
       
  1723     
       
  1724     TInt fontid = txtlayout.FontId();
       
  1725     const CFont* font = AknLayoutUtils::FontFromId( fontid );
       
  1726     iVirtualSctpadFix->SetFont( font );
       
  1727     
       
  1728 
       
  1729     TResourceReader reader;
       
  1730     CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
       
  1731 
       
  1732     // construct keys
       
  1733     TInt resKeyCount = reader.ReadInt16();
       
  1734     TInt existsKeyCount = iVirtualSctpadFix->KeyArray().Count();
       
  1735     TInt rectCount = aCellRects.Count();
       
  1736     
       
  1737     for ( TInt i = 0; i < resKeyCount; i++ )
       
  1738         {
       
  1739         if ( i < existsKeyCount )
       
  1740             {
       
  1741             CVirtualKey* vk = iVirtualSctpadFix->KeyArray()[i];
       
  1742             UpdateVkbKeyL( vk, reader, aCellRects[i] );
       
  1743             }
       
  1744         else
       
  1745             {
       
  1746             CVirtualKey* vk = CreateVkbKeyL( reader, aCellRects[i] );
       
  1747             CleanupStack::PushL( vk );
       
  1748             iVirtualSctpadFix->AddKeyL( vk );
       
  1749             CleanupStack::Pop( vk );
       
  1750             }
       
  1751         }
       
  1752     
       
  1753     CleanupStack::PopAndDestroy( 1 ); // reader
       
  1754     
       
  1755     iVirtualSctpadFix->Draw();
       
  1756     iVirtualSctpadFix->UpdateArea( iVirtualSctpadFix->Rect() );
       
  1757     
       
  1758     }
       
  1759 
       
  1760 // ---------------------------------------------------------------------------
       
  1761 //  relayout full ui, reset all controls position. 
       
  1762 // ---------------------------------------------------------------------------
       
  1763 //
       
  1764 void CPeninputFingerHwrWnd::ResetLayoutL()
       
  1765     {
       
  1766     TRect rcScreen = iLafManager->LayoutRect();
       
  1767     SetRect( rcScreen );
       
  1768    
       
  1769     TRect rect;
       
  1770     
       
  1771     //Move ICF
       
  1772     rect = iLafManager->CtrlRect( iContextField->ControlId() );
       
  1773     iContextField->SetRect( rect );
       
  1774 
       
  1775     //Move Writing box
       
  1776     rect = iLafManager->CtrlRect( iWritingBox->ControlId() );
       
  1777     iWritingBox->SetRect( rect );
       
  1778     
       
  1779     //Move Virtual Numpad
       
  1780     if ( iVirtualNumpad )
       
  1781         {
       
  1782         rect = iLafManager->CtrlRect( iVirtualNumpad->ControlId() );
       
  1783         iVirtualNumpad->SetRect( rect );
       
  1784         
       
  1785         TAknTextLineLayout txtlayout = iLafManager->NumpadKeyTxtLayout();
       
  1786         iVirtualNumpad->SetTextLineLayout( txtlayout );
       
  1787 
       
  1788         const RPointerArray<CVirtualKey>& keys = iVirtualNumpad->KeyArray();
       
  1789         RArray<TRect> rects;
       
  1790         iLafManager->GetVirtualKeyRects( rects );
       
  1791         
       
  1792         const TInt count = keys.Count();
       
  1793         for ( TInt i = 0; i < count; i++ )
       
  1794             {
       
  1795             CVirtualKey* vk = keys[i];
       
  1796             vk->SetRect( rects[i] );
       
  1797             }
       
  1798         rects.Reset();
       
  1799         rects.Close();
       
  1800         }
       
  1801     
       
  1802     //move virtual Sctpad
       
  1803     if ( iVirtualSctpad )
       
  1804         {
       
  1805         rect = iLafManager->CtrlRect( iVirtualSctpad->ControlId() );
       
  1806         iVirtualSctpad->SetRect( rect );
       
  1807         
       
  1808         TAknTextLineLayout txtlayout = iLafManager->SctpadKeyTxtLayout();
       
  1809         iVirtualSctpad->SetTextLineLayout( txtlayout );
       
  1810         
       
  1811         const RPointerArray<CVirtualKey>& keys = iVirtualSctpad->KeyArray();
       
  1812         RArray<TRect> rects;
       
  1813         iLafManager->GetVirtualKeyRects( rects );
       
  1814         
       
  1815         TInt n = rects.Count(); //num of cells in one page
       
  1816         for ( TInt i = 0; i < keys.Count(); i++ )
       
  1817             {
       
  1818             CVirtualKey* vk = keys[i];
       
  1819             vk->SetRect( rects[i%n] );
       
  1820             }
       
  1821         rects.Reset();
       
  1822         rects.Close();
       
  1823         }
       
  1824 
       
  1825     //move virtual Sctpad 
       
  1826     if ( iVirtualSctpadFix )
       
  1827         {
       
  1828         rect = iLafManager->CtrlRect( iVirtualSctpadFix->ControlId() );
       
  1829         iVirtualSctpadFix->SetRect( rect );
       
  1830                 
       
  1831         TAknTextLineLayout txtlayout = iLafManager->FixSctpadKeyTxtLayout();
       
  1832         iVirtualSctpadFix->SetTextLineLayout( txtlayout );
       
  1833         
       
  1834         const RPointerArray<CVirtualKey>& keys = iVirtualSctpadFix->KeyArray();
       
  1835         RArray<TRect> rects;
       
  1836         iLafManager->GetFixVirtualKeyRects( rects );
       
  1837         
       
  1838         TInt n = rects.Count(); //
       
  1839         for ( TInt i = 0; i < keys.Count(); i++ )
       
  1840             {
       
  1841             CVirtualKey* vk = keys[i];
       
  1842             vk->SetRect( rects[i] );
       
  1843             }
       
  1844         rects.Reset();
       
  1845         rects.Close();
       
  1846         }
       
  1847     
       
  1848     //Move buttons
       
  1849     TSize siBtnPadding = iLafManager->ButtonInnerPadding();
       
  1850     TInt pdx = siBtnPadding.iWidth;
       
  1851     TInt pdy = siBtnPadding.iHeight;
       
  1852     
       
  1853     rect = iLafManager->CtrlRect( iCloseBtn->ControlId() );
       
  1854     MoveIconButton( iCloseBtn, rect, pdx, pdy, ETrue );
       
  1855    
       
  1856     rect = iLafManager->CtrlRect( iRangeSpecialBtn->ControlId() );
       
  1857     MoveIconButton( iRangeSpecialBtn, rect,  pdx, pdy, ETrue );
       
  1858     
       
  1859     rect = iLafManager->CtrlRect( iBackspaceBtn->ControlId() );
       
  1860     MoveIconButton( iBackspaceBtn, rect,  pdx, pdy, ETrue );
       
  1861 
       
  1862     rect = iLafManager->CtrlRect( iArrowUpBtn->ControlId() );
       
  1863     MoveIconButton( iArrowUpBtn, rect,  pdx, pdy, ETrue );
       
  1864     
       
  1865     rect = iLafManager->CtrlRect( iArrowLeftBtn->ControlId() );
       
  1866     MoveIconButton( iArrowLeftBtn, rect,  pdx, pdy, ETrue );
       
  1867     
       
  1868     rect = iLafManager->CtrlRect( iArrowRightBtn->ControlId() );
       
  1869     MoveIconButton( iArrowRightBtn,   rect,  pdx, pdy, ETrue );
       
  1870 
       
  1871     rect = iLafManager->CtrlRect( iArrowDownBtn->ControlId() );
       
  1872     MoveIconButton( iArrowDownBtn,    rect,  pdx, pdy, ETrue );
       
  1873     
       
  1874     rect = iLafManager->CtrlRect( iOptionBtn->ControlId() );
       
  1875     MoveIconButton( iOptionBtn, rect,  pdx, pdy, ETrue );
       
  1876     
       
  1877     rect = iLafManager->CtrlRect( iImeSwitchBtn->ControlId() );
       
  1878     MoveIconButton( iImeSwitchBtn,    rect,  pdx, pdy, ETrue );
       
  1879     
       
  1880     rect = iLafManager->CtrlRect( iSctPage0Btn->ControlId() );
       
  1881     MoveSwitchPageButton( iSctPage0Btn, rect,  pdx, pdy, ETrue );
       
  1882     
       
  1883     rect = iLafManager->CtrlRect( iSctPage1Btn->ControlId() );
       
  1884     MoveSwitchPageButton( iSctPage1Btn, rect,  pdx, pdy, ETrue );
       
  1885 
       
  1886     rect = iLafManager->CtrlRect( iSctPage2Btn->ControlId() );
       
  1887     MoveSwitchPageButton( iSctPage2Btn, rect,  pdx, pdy, ETrue );
       
  1888     
       
  1889     //save range buttons position
       
  1890     iRectOfRangeBtn = iLafManager->CtrlRect( iRangeSelector->ControlId() ); 
       
  1891     
       
  1892     //move range selector
       
  1893     iRangeSelector->SetRect( iRectOfRangeBtn );
       
  1894     iRangeSelector->SetBaseRect( iRectOfRangeBtn );
       
  1895     }
       
  1896 
       
  1897 
       
  1898 // ---------------------------------------------------------------------------
       
  1899 //  layout for chinese range standby.
       
  1900 // ---------------------------------------------------------------------------
       
  1901 //
       
  1902 void CPeninputFingerHwrWnd::LayoutStandbyChinese()
       
  1903     {
       
  1904     
       
  1905     iCandidateList->Hide( ETrue );
       
  1906     iPredictList->Hide( ETrue );
       
  1907     
       
  1908 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1909     iFixEngSymbolList1->Hide( ETrue );
       
  1910     iFixEngSymbolList2->Hide( ETrue );
       
  1911 #endif
       
  1912 
       
  1913     iWritingBox->Hide( EFalse );
       
  1914     iVirtualNumpad->Hide( ETrue );
       
  1915     iVirtualSctpad->Hide( ETrue );
       
  1916     iVirtualSctpadFix->Hide( ETrue );
       
  1917     
       
  1918     iArrowLeftBtn->Hide( EFalse );
       
  1919     iArrowRightBtn->Hide( EFalse );
       
  1920     iArrowUpBtn->Hide( EFalse );
       
  1921     iArrowDownBtn->Hide( EFalse );
       
  1922     iOptionBtn->Hide( EFalse );
       
  1923     iImeSwitchBtn->Hide( EFalse );    
       
  1924     
       
  1925     iSctPage0Btn->Hide( ETrue );
       
  1926     iSctPage1Btn->Hide( ETrue );
       
  1927     iSctPage2Btn->Hide( ETrue );
       
  1928     
       
  1929     iRangeSpecialBtn->SetHighlight( EFalse );
       
  1930     
       
  1931     UpdateAllVirtualKeysFeedback( EFingerHwrNativeRange );
       
  1932     }
       
  1933 
       
  1934 // ---------------------------------------------------------------------------
       
  1935 //  layout for english range standby.
       
  1936 // ---------------------------------------------------------------------------
       
  1937 //
       
  1938 void CPeninputFingerHwrWnd::LayoutStandbyEnglish()
       
  1939     {
       
  1940     iCandidateList->Hide( ETrue );
       
  1941     iPredictList->Hide( ETrue );
       
  1942     
       
  1943 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1944     iFixEngSymbolList1->Hide( ETrue );
       
  1945     iFixEngSymbolList2->Hide( ETrue );
       
  1946 #endif
       
  1947    
       
  1948     iWritingBox->Hide( EFalse );
       
  1949     iVirtualNumpad->Hide( ETrue );
       
  1950     iVirtualSctpad->Hide( ETrue );
       
  1951     iVirtualSctpadFix->Hide( ETrue );
       
  1952     
       
  1953     iArrowLeftBtn->Hide( EFalse );
       
  1954     iArrowRightBtn->Hide( EFalse );
       
  1955     iArrowUpBtn->Hide( EFalse );
       
  1956     iArrowDownBtn->Hide( EFalse );
       
  1957     iOptionBtn->Hide( EFalse );
       
  1958     iImeSwitchBtn->Hide( EFalse );      
       
  1959 
       
  1960     iSctPage0Btn->Hide( ETrue );
       
  1961     iSctPage1Btn->Hide( ETrue );
       
  1962     iSctPage2Btn->Hide( ETrue );
       
  1963     
       
  1964     iRangeSpecialBtn->SetHighlight( EFalse );
       
  1965     
       
  1966     UpdateAllVirtualKeysFeedback( EFingerHwrEnglishRange );
       
  1967     }
       
  1968 
       
  1969 // ---------------------------------------------------------------------------
       
  1970 //  layout for number range standby.
       
  1971 // ---------------------------------------------------------------------------
       
  1972 //
       
  1973 void CPeninputFingerHwrWnd::LayoutStandbyNumeric()
       
  1974     {
       
  1975     iCandidateList->Hide( ETrue );
       
  1976     iPredictList->Hide( ETrue );
       
  1977     
       
  1978 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
  1979     iFixEngSymbolList1->Hide( ETrue );
       
  1980     iFixEngSymbolList2->Hide( ETrue );
       
  1981 #endif
       
  1982    
       
  1983     iWritingBox->Hide( ETrue );
       
  1984     iVirtualNumpad->Hide( EFalse );
       
  1985     iVirtualSctpad->Hide( ETrue );
       
  1986     iVirtualSctpadFix->Hide( ETrue );
       
  1987     
       
  1988     iArrowLeftBtn->Hide( EFalse );
       
  1989     iArrowRightBtn->Hide( EFalse );
       
  1990     iArrowUpBtn->Hide( EFalse );
       
  1991     iArrowDownBtn->Hide( EFalse );
       
  1992     iOptionBtn->Hide( EFalse );
       
  1993     iImeSwitchBtn->Hide( EFalse );
       
  1994 
       
  1995     iSctPage0Btn->Hide( ETrue );
       
  1996     iSctPage1Btn->Hide( ETrue );
       
  1997     iSctPage2Btn->Hide( ETrue );
       
  1998     
       
  1999     iRangeSpecialBtn->SetHighlight( EFalse );
       
  2000     
       
  2001     UpdateAllVirtualKeysFeedback( EFingerHwrNumberRange );
       
  2002     }
       
  2003 
       
  2004 // ---------------------------------------------------------------------------
       
  2005 //  layout for symbol range standby.
       
  2006 // ---------------------------------------------------------------------------
       
  2007 //
       
  2008 void CPeninputFingerHwrWnd::LayoutStandbySymbol()
       
  2009     {
       
  2010     iCandidateList->Hide( ETrue );
       
  2011     iPredictList->Hide( ETrue );
       
  2012     
       
  2013 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  2014     iFixEngSymbolList1->Hide( ETrue );
       
  2015     iFixEngSymbolList2->Hide( ETrue );
       
  2016 #endif
       
  2017    
       
  2018     iWritingBox->Hide( ETrue );
       
  2019     iVirtualNumpad->Hide( ETrue );
       
  2020     iArrowLeftBtn->Hide( ETrue );
       
  2021     iArrowRightBtn->Hide( ETrue );
       
  2022     iArrowUpBtn->Hide( ETrue );
       
  2023     iArrowDownBtn->Hide( ETrue );
       
  2024     
       
  2025     iVirtualSctpad->Hide( EFalse );
       
  2026     iVirtualSctpadFix->Hide( EFalse );
       
  2027     iOptionBtn->Hide( EFalse );
       
  2028     iImeSwitchBtn->Hide( EFalse );  
       
  2029     
       
  2030     iRangeSpecialBtn->SetHighlight( ETrue );
       
  2031 
       
  2032     TInt pageno = ( iCurCharRangeNoSct == EFingerHwrNativeRange ) ? 0 : 1;
       
  2033     ShowSctPage( pageno, EPagePosPageNo );
       
  2034     
       
  2035     UpdateAllVirtualKeysFeedback( EFingerHwrSymbolRange );
       
  2036     
       
  2037     UiLayout()->RootControl()->ReDrawRect( iVirtualSctpadFix->Rect() );
       
  2038     UpdateArea( iVirtualSctpadFix->Rect() );
       
  2039     }
       
  2040 
       
  2041 
       
  2042 // ---------------------------------------------------------------------------
       
  2043 //  EventButton layout helper. Move button to specified rect.
       
  2044 // ---------------------------------------------------------------------------
       
  2045 //
       
  2046 void CPeninputFingerHwrWnd::MoveIconButton( CAknFepCtrlEventButton* aButton, 
       
  2047     const TRect& aRect, TInt aXPadding, TInt aYPadding, TBool aReloadImages )
       
  2048     {
       
  2049     if ( !aButton )
       
  2050         {
       
  2051         return;
       
  2052         }
       
  2053     
       
  2054     aButton->SetRect( aRect );
       
  2055     TRect rcInner = aRect;
       
  2056     if (  rcInner.Width()> rcInner.Height() )
       
  2057         {
       
  2058             TInt dx = ( rcInner.Width() - rcInner.Height() ) / 2;
       
  2059             rcInner.Move( dx, 0 );
       
  2060             rcInner.SetWidth( rcInner.Height() );
       
  2061         }
       
  2062     else
       
  2063         {
       
  2064         TInt dy = ( rcInner.Height() - rcInner.Width() ) / 2;
       
  2065         rcInner.Move( 0, dy );
       
  2066         rcInner.SetHeight( rcInner.Width() );        
       
  2067         }
       
  2068 
       
  2069     rcInner.Shrink( aXPadding, aYPadding );
       
  2070     aButton->SizeChanged( aRect, rcInner, aReloadImages );
       
  2071     }
       
  2072     
       
  2073 // ---------------------------------------------------------------------------
       
  2074 //  EventButton layout helper. 
       
  2075 // ---------------------------------------------------------------------------
       
  2076 //
       
  2077 void CPeninputFingerHwrWnd::MoveSwitchPageButton( CAknFepCtrlEventButton* aButton, 
       
  2078     const TRect& aRect, TInt aXPadding, TInt aYPadding, TBool aReloadImages )
       
  2079     {
       
  2080     if ( !aButton )
       
  2081         {
       
  2082         return;
       
  2083         }
       
  2084     
       
  2085     aButton->SetRect( aRect );
       
  2086     TRect rcInner = aRect;
       
  2087 
       
  2088     rcInner.Shrink( aXPadding + 5, aYPadding );
       
  2089     aButton->SizeChanged( aRect, rcInner, aReloadImages );
       
  2090     }    
       
  2091 
       
  2092 
       
  2093 // ---------------------------------------------------------------------------
       
  2094 //  Read control's shadow info.
       
  2095 // ---------------------------------------------------------------------------
       
  2096 //
       
  2097 void CPeninputFingerHwrWnd::ReadShadowInfoL( const TInt aResId )
       
  2098     {
       
  2099     TResourceReader resReader;
       
  2100     CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId );
       
  2101      
       
  2102     TPtrC bmpFileName = resReader.ReadTPtrC();
       
  2103     TInt32 imgMajorSkinId = resReader.ReadInt32();
       
  2104 
       
  2105     TAknsItemID id;
       
  2106     TInt skinitemid;
       
  2107     
       
  2108     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
       
  2109 
       
  2110     for ( TInt i = 0; i < KShadowBmpBr + 1; i++ )
       
  2111     	{
       
  2112         const TInt16 bmpId = resReader.ReadInt16();
       
  2113         const TInt16 bmpMskId = resReader.ReadInt16();
       
  2114         skinitemid = resReader.ReadInt16();
       
  2115         
       
  2116         id.Set( TInt( imgMajorSkinId ), skinitemid );
       
  2117     	
       
  2118         if ( bmpId != KInvalidImg )
       
  2119         	{
       
  2120             CFbsBitmap* shadowImg = NULL;
       
  2121             CFbsBitmap* shadowMaskImg = NULL;
       
  2122 
       
  2123             if ( bmpMskId != KInvalidImg )
       
  2124                 {
       
  2125                 AknsUtils::CreateIconL( skininstance, 
       
  2126                                        id,
       
  2127                                        shadowImg,
       
  2128                                        shadowMaskImg,
       
  2129                                        bmpFileName,
       
  2130                                        bmpId,
       
  2131                                        bmpMskId );
       
  2132                 }
       
  2133             else
       
  2134                 {
       
  2135                 AknsUtils::CreateIconL( skininstance,
       
  2136                                        id,
       
  2137                                        shadowImg,
       
  2138                                        bmpFileName,
       
  2139                                        bmpId );
       
  2140                 }
       
  2141             
       
  2142             SetShadowBmp( shadowImg, shadowMaskImg, TShadowBitmapIndex( i ) );
       
  2143         	}
       
  2144     	}
       
  2145     CleanupStack::PopAndDestroy( 1 ); // reader
       
  2146     
       
  2147     }
       
  2148     
       
  2149 // ---------------------------------------------------------------------------
       
  2150 //  Read control's background info.
       
  2151 // ---------------------------------------------------------------------------
       
  2152 //
       
  2153 void CPeninputFingerHwrWnd::ReadBackgroundInfoL( const TInt aResId )
       
  2154     {
       
  2155     if ( aResId == 0 )
       
  2156         return;
       
  2157     
       
  2158     if ( BackgroundBmp() )
       
  2159         {
       
  2160         CFbsBitmap* bkBmp = BackgroundBmp();
       
  2161         delete bkBmp;   
       
  2162         SetBackgroundBmp( NULL );
       
  2163         }
       
  2164     if ( BkMaskBmp() )
       
  2165         {
       
  2166         CFbsBitmap* bkMaskBmp = BkMaskBmp();
       
  2167         delete bkMaskBmp;
       
  2168         SetBackgroundMaskBmp( NULL );
       
  2169         }    
       
  2170 
       
  2171     TResourceReader resReader;
       
  2172     CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId ); 
       
  2173      
       
  2174     TPtrC bmpFileName = resReader.ReadTPtrC();
       
  2175     TInt32 imgMajorSkinId = resReader.ReadInt32();
       
  2176 
       
  2177     TAknsItemID id;
       
  2178     TInt skinitemid;
       
  2179     
       
  2180     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
       
  2181     const TInt16 bmpId = resReader.ReadInt16();
       
  2182     const TInt16 bmpMskId = resReader.ReadInt16();
       
  2183     skinitemid = resReader.ReadInt16();   
       
  2184     id.Set( TInt( imgMajorSkinId ), skinitemid );
       
  2185     
       
  2186     if ( bmpId != KInvalidImg )
       
  2187         {
       
  2188         CFbsBitmap* backgroundImg = NULL;
       
  2189         CFbsBitmap* backgroundMaskImg = NULL;
       
  2190         if ( bmpMskId != KInvalidImg )
       
  2191             {
       
  2192             AknsUtils::CreateIconL( skininstance, id, backgroundImg,
       
  2193                     backgroundMaskImg, bmpFileName, bmpId, bmpMskId );
       
  2194             }
       
  2195         else
       
  2196             {
       
  2197             AknsUtils::CreateIconL( skininstance, id, backgroundImg,
       
  2198                     bmpFileName, bmpId );
       
  2199             }
       
  2200        
       
  2201         SetBackgroundBmp( backgroundImg );
       
  2202         SetBackgroundMaskBmp( backgroundMaskImg );           
       
  2203         }
       
  2204     CleanupStack::PopAndDestroy( 1 ); //reader
       
  2205     }
       
  2206 
       
  2207 // ---------------------------------------------------------------------------
       
  2208 //  read icf appearance info.
       
  2209 // ---------------------------------------------------------------------------
       
  2210 //
       
  2211 void CPeninputFingerHwrWnd::ReadICFInfoL( const TInt aResId )
       
  2212     {
       
  2213     if ( aResId == 0 )
       
  2214         {
       
  2215         return;
       
  2216         }
       
  2217 
       
  2218     TResourceReader icfreader;
       
  2219     CCoeEnv::Static()->CreateResourceReaderLC( icfreader, aResId );
       
  2220          
       
  2221     TInt32 colorMajorSkinId = icfreader.ReadInt32();
       
  2222     TInt skinitemid = icfreader.ReadInt16();
       
  2223     TInt coloridx = icfreader.ReadInt16();
       
  2224 
       
  2225     TAknsItemID colorid;
       
  2226     colorid.Set( TInt( colorMajorSkinId ), skinitemid );
       
  2227 
       
  2228     TRgb icftextcolor;
       
  2229     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
       
  2230     TInt error = AknsUtils::GetCachedColor( skininstance, icftextcolor,
       
  2231             colorid, coloridx );
       
  2232 
       
  2233     if ( error != KErrNone )
       
  2234         {
       
  2235         icftextcolor = TRgb( KDefaultTextColor );
       
  2236         }
       
  2237 
       
  2238     iContextField->SetTextColorL( icftextcolor );    
       
  2239     
       
  2240     // Set highlight color
       
  2241     TRgb icfhightlightcolor;
       
  2242     error = AknsUtils::GetCachedColor( skininstance, 
       
  2243                                        icfhightlightcolor, 
       
  2244                                        KAknsIIDQsnHighlightColors,
       
  2245                                        EAknsCIQsnHighlightColorsCG2 ); 
       
  2246     if ( error == KErrNone ) 
       
  2247         {
       
  2248         iContextField->SetTextSelColorL( icfhightlightcolor );
       
  2249         }
       
  2250 
       
  2251     skinitemid = icfreader.ReadInt16();
       
  2252     coloridx = icfreader.ReadInt16();
       
  2253     
       
  2254     colorid.Set( TInt( colorMajorSkinId ), skinitemid );
       
  2255     
       
  2256     TRgb icfframecolor;
       
  2257     error = AknsUtils::GetCachedColor( skininstance, icfframecolor, 
       
  2258             colorid, coloridx );
       
  2259 
       
  2260     if ( error != KErrNone )
       
  2261         {
       
  2262     	icfframecolor = TRgb( KDefaultFrameColor );
       
  2263         }
       
  2264 
       
  2265     iContextField->SetBorderColor( icfframecolor );
       
  2266     iContextField->SetBgImgSkinId( KAknsIIDQgnGrafFepInputBg );
       
  2267     CleanupStack::PopAndDestroy( 1 ); // icfreader       
       
  2268     }
       
  2269 
       
  2270 // ---------------------------------------------------------------------------
       
  2271 //  read writingbox appearance info.
       
  2272 // ---------------------------------------------------------------------------
       
  2273 //
       
  2274 void CPeninputFingerHwrWnd::ReadWritingBoxInfoL( const TInt aResId )
       
  2275     {
       
  2276     if ( aResId == 0 )
       
  2277 	{
       
  2278 	return;
       
  2279 	}
       
  2280 
       
  2281     TResourceReader reader;
       
  2282     CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
       
  2283 
       
  2284     // get write box bg color
       
  2285     TInt32 colorMajorSkinId = reader.ReadInt32();
       
  2286     TInt skinitemid = reader.ReadInt16();
       
  2287     TInt coloridx = reader.ReadInt16();
       
  2288 
       
  2289     TAknsItemID colorid;
       
  2290     colorid.Set( TInt( colorMajorSkinId ), skinitemid );
       
  2291 
       
  2292     TRgb boxcolor;
       
  2293     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
       
  2294     TInt error = AknsUtils::GetCachedColor( skininstance, 
       
  2295                                            boxcolor, 
       
  2296                                            colorid, 
       
  2297                                            coloridx );
       
  2298 
       
  2299     if ( error != KErrNone )
       
  2300         {
       
  2301         boxcolor = TRgb( KDefaultWriteBoxBgColor );
       
  2302         }
       
  2303     
       
  2304     iWritingBoxBkColor = boxcolor;
       
  2305     iWritingBox->SetBkColor( boxcolor );
       
  2306 
       
  2307     skinitemid = reader.ReadInt16();
       
  2308     coloridx = reader.ReadInt16();
       
  2309     
       
  2310     colorid.Set( TInt( colorMajorSkinId ), skinitemid );
       
  2311     
       
  2312     TRgb boxframecolor;
       
  2313     error = AknsUtils::GetCachedColor( skininstance, 
       
  2314                                       boxframecolor, 
       
  2315                                       colorid, 
       
  2316                                       coloridx );
       
  2317 
       
  2318     if ( error != KErrNone )
       
  2319         {
       
  2320     	boxframecolor = TRgb( KDefaultWriteBoxFrameColor );
       
  2321         }
       
  2322     
       
  2323     iWritingBoxFrameColor = boxframecolor;
       
  2324     iWritingBox->SetFrameCol( boxframecolor );
       
  2325 
       
  2326     CleanupStack::PopAndDestroy(); // reader
       
  2327     
       
  2328     ReloadWritingGuideLinesL();
       
  2329     }
       
  2330     
       
  2331 // ---------------------------------------------------------------------------
       
  2332 //  update feedback state of all virtual keys.
       
  2333 // ---------------------------------------------------------------------------
       
  2334 //
       
  2335 void CPeninputFingerHwrWnd::UpdateAllVirtualKeysFeedback( TInt aType )
       
  2336     {
       
  2337     if ( !UiLayout()->SupportTactileFeedback() ) 
       
  2338         {
       
  2339         // return ; 
       
  2340         // CFepUiLayout::OnActivate() is incorrect
       
  2341         // SupportTactileFeedback return is false when touch is about to active
       
  2342         }
       
  2343     
       
  2344     TBool isNumpad = ( aType == EFingerHwrNumberRange ) ? ETrue : EFalse;
       
  2345     TBool isSctpad = ( aType == EFingerHwrSymbolRange ) ? ETrue : EFalse;
       
  2346     
       
  2347     //update numpad keys
       
  2348     TInt keyCount = iVirtualNumpad->KeyArray().Count();
       
  2349     for ( TInt i = 0; i < keyCount; i++ )
       
  2350         {
       
  2351         CVirtualKey* vk = iVirtualNumpad->KeyArray()[i];
       
  2352         TBool enable = !vk->Dimmed() &&  isNumpad;
       
  2353         iVirtualNumpad->EnableKeyFeedback( vk, enable );
       
  2354         }
       
  2355     
       
  2356     //update sctpad keys
       
  2357     keyCount = iVirtualSctpad->KeyArray().Count();
       
  2358     TInt pageSize = iVirtualSctpad->PageSize();
       
  2359     TInt curPage = iVirtualSctpad->CurPageIndex();
       
  2360     for ( TInt i = 0; i < keyCount; i++ )
       
  2361         {
       
  2362         CVirtualKey* vk = iVirtualSctpad->KeyArray()[i];
       
  2363         TInt page = i / pageSize;
       
  2364         TBool enable = !vk->Dimmed() &&  isSctpad && ( page == curPage );
       
  2365         iVirtualSctpad->EnableKeyFeedback( vk, enable );
       
  2366         }
       
  2367     }
       
  2368 
       
  2369 
       
  2370 void CPeninputFingerHwrWnd::ReloadWritingGuideLinesL()
       
  2371     {
       
  2372     TInt resid = -1;
       
  2373     
       
  2374     if( iCurCharRange == EFingerHwrNativeRange )
       
  2375         {
       
  2376         resid = R_FINGER_HWR_GUIDELINE_CHS;
       
  2377         }
       
  2378     else if( iCurCharRange == EFingerHwrEnglishRange )
       
  2379         {
       
  2380         resid = R_FINGER_HWR_GUIDELINE_ENG;
       
  2381         }
       
  2382     else 
       
  2383         {
       
  2384         return;
       
  2385         }
       
  2386 
       
  2387     TResourceReader reader;
       
  2388     CCoeEnv::Static()->CreateResourceReaderLC( reader, resid );
       
  2389 
       
  2390     TPtrC fileName = reader.ReadTPtrC();
       
  2391     TInt32 majorSkinId = reader.ReadInt32();
       
  2392     TInt16 indexOfColor = reader.ReadInt16();
       
  2393     
       
  2394     TInt16 imageid = reader.ReadInt16();
       
  2395     TInt16 maskid = reader.ReadInt16();
       
  2396     TInt16 skinid = reader.ReadInt16();
       
  2397     
       
  2398     TAknsItemID id;
       
  2399     id.Set( TInt( majorSkinId ), skinid );
       
  2400     
       
  2401     CFbsBitmap* bmpImage = NULL;
       
  2402     CFbsBitmap* bmpMask = NULL;
       
  2403     
       
  2404     //AknsUtils::CreateIconL(UiLayout()->SkinInstance(), id, bmpImage, bmpMask, bmpFileName, imageid,maskid);
       
  2405     
       
  2406     TRgb colorBkgnd = iWritingBoxBkColor;
       
  2407     TRgb colorGuideLine = AKN_LAF_COLOR( 0 ); 
       
  2408     if ( ETrue )
       
  2409         {
       
  2410         TRgb color1 = colorBkgnd;
       
  2411         TRgb color2 = colorGuideLine;
       
  2412         
       
  2413         TInt k = 64;
       
  2414         TInt brightness = Max( color1.Red(), color1.Green() );
       
  2415         brightness = Max( brightness, color1.Blue() );
       
  2416         
       
  2417         color2 = ( brightness > 128 ) ? TRgb(0,0,0) : TRgb(255,255,255);
       
  2418 
       
  2419         TInt r = ( color1.Red()  * ( 256 - k ) + color2.Red()   * k ) / 256;
       
  2420         TInt g = ( color1.Green()* ( 256 - k ) + color2.Green() * k ) / 256;
       
  2421         TInt b = ( color1.Blue() * ( 256 - k ) + color2.Blue()  * k ) / 256;
       
  2422 
       
  2423         colorGuideLine = TRgb(r,g,b);
       
  2424         }
       
  2425     
       
  2426     AknsUtils::CreateColorIconL( UiLayout()->SkinInstance(),
       
  2427             id, KAknsIIDQsnIconColors, -1,
       
  2428             bmpImage, bmpMask, fileName, imageid, maskid,
       
  2429             colorGuideLine );
       
  2430     
       
  2431     CleanupStack::PushL( bmpImage ); //1
       
  2432     CleanupStack::PushL( bmpMask );  //2
       
  2433     
       
  2434     TSize imgsize = iLafManager->CtrlRect(EHwrCtrlIdWritingBox).Size();
       
  2435     
       
  2436     AknIconUtils::SetSize( bmpImage, imgsize, EAspectRatioNotPreserved );
       
  2437     AknIconUtils::SetSize( bmpMask, imgsize, EAspectRatioNotPreserved );
       
  2438     
       
  2439     //prepare to merge
       
  2440     CFbsBitmap* bmpMerged = new(ELeave) CFbsBitmap();
       
  2441     CleanupStack::PushL( bmpMerged );   //3
       
  2442     bmpMerged->Create( imgsize, BitmapDevice()->DisplayMode() );
       
  2443     
       
  2444     CFbsBitmapDevice* dev=CFbsBitmapDevice::NewL( bmpMerged );
       
  2445     CleanupStack::PushL( dev );         //4
       
  2446     
       
  2447     CFbsBitGc* gc = CFbsBitGc::NewL();
       
  2448     CleanupStack::PushL( gc );          //5
       
  2449     
       
  2450     //merge image and mask to dest
       
  2451     TRect rcImage( TPoint(0,0), imgsize );
       
  2452     gc->Activate( dev );
       
  2453     gc->SetPenStyle( CGraphicsContext::ENullPen );
       
  2454     gc->SetBrushColor( colorBkgnd );
       
  2455     gc->SetBrushStyle( CGraphicsContext::ESolidBrush );
       
  2456     gc->DrawRect( rcImage );
       
  2457     gc->SetBrushStyle( CGraphicsContext::ENullBrush );
       
  2458     gc->BitBltMasked( TPoint(0,0), bmpImage, rcImage, bmpMask, EFalse );
       
  2459     
       
  2460     CleanupStack::PopAndDestroy( 2 ); //gc, dev
       
  2461     
       
  2462     iWritingBox->SetBackgroundBitmapL( bmpMerged );
       
  2463     iWritingBox->SetBackgroundMaskBitmapL( bmpMask );
       
  2464     
       
  2465     CleanupStack::Pop( 2 );           //bmpMerged, bmpMask
       
  2466     CleanupStack::PopAndDestroy( 1 ); //bmpImage
       
  2467     CleanupStack::PopAndDestroy();    //reader
       
  2468     
       
  2469     iWritingBox->ReDrawRect( iWritingBox->Rect() );
       
  2470     iWritingBox->UpdateArea( iWritingBox->Rect() );    
       
  2471     }
       
  2472 
       
  2473 void CPeninputFingerHwrWnd::ShowBubble(TInt aShow)
       
  2474     {
       
  2475     if (aShow > 0)
       
  2476         {
       
  2477     	TRect outrect,innerrect;          
       
  2478         
       
  2479         
       
  2480         
       
  2481         
       
  2482         iCandidateList->ShowBubble(ETrue);
       
  2483         iPredictList->ShowBubble(ETrue);
       
  2484          
       
  2485 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
  2486         iFixEngSymbolList1->ShowBubble(ETrue);
       
  2487         iFixEngSymbolList2->ShowBubble(ETrue);
       
  2488 #endif
       
  2489      	// Set priview popup size
       
  2490         iCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview);
       
  2491 
       
  2492     	outrect = iLafManager->PreviewBubbleRect();  
       
  2493     	innerrect = iLafManager->PreviewBubbleInnerRect();
       
  2494     	iCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout());
       
  2495     	iCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont());
       
  2496     	iCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
  2497     	iCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
  2498     	               innerrect.iTl.iY - outrect.iTl.iY,
       
  2499     	               outrect.iBr.iX - innerrect.iBr.iX,
       
  2500     	               outrect.iBr.iY - innerrect.iBr.iY);
       
  2501 
       
  2502         iPredictList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview);
       
  2503     	iPredictList->SetTextFormat(iLafManager->PreviewBubbleTextLayout());
       
  2504     	iPredictList->SetBubbleTextFont(iLafManager->PreviewBubbleFont());
       
  2505     	iPredictList->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
  2506     	iPredictList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
  2507     	               innerrect.iTl.iY - outrect.iTl.iY,
       
  2508     	               outrect.iBr.iX - innerrect.iBr.iX,
       
  2509     	               outrect.iBr.iY - innerrect.iBr.iY);
       
  2510 
       
  2511 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
  2512         iFixEngSymbolList1->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview);
       
  2513     	iFixEngSymbolList1->SetTextFormat(iLafManager->PreviewBubbleTextLayout());
       
  2514     	iFixEngSymbolList1->SetBubbleTextFont(iLafManager->PreviewBubbleFont());
       
  2515     	iFixEngSymbolList1->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
  2516     	iFixEngSymbolList1->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
  2517     	               innerrect.iTl.iY - outrect.iTl.iY,
       
  2518     	               outrect.iBr.iX - innerrect.iBr.iX,
       
  2519     	               outrect.iBr.iY - innerrect.iBr.iY);
       
  2520 
       
  2521         iFixEngSymbolList2->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview);
       
  2522     	iFixEngSymbolList2->SetTextFormat(iLafManager->PreviewBubbleTextLayout());
       
  2523     	iFixEngSymbolList2->SetBubbleTextFont(iLafManager->PreviewBubbleFont());
       
  2524     	iFixEngSymbolList2->SetBubbleSize(TSize(outrect.Width(),outrect.Height()));  // Read laf
       
  2525     	iFixEngSymbolList2->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
       
  2526     	               innerrect.iTl.iY - outrect.iTl.iY,
       
  2527     	               outrect.iBr.iX - innerrect.iBr.iX,
       
  2528     	               outrect.iBr.iY - innerrect.iBr.iY);
       
  2529 #endif
       
  2530  
       
  2531         }
       
  2532     else
       
  2533         {
       
  2534         iCandidateList->ShowBubble(EFalse);
       
  2535         iPredictList->ShowBubble(EFalse);
       
  2536 #ifndef RD_INTELLIGENT_TEXT_INPUT    
       
  2537         iFixEngSymbolList1->ShowBubble(EFalse);
       
  2538         iFixEngSymbolList2->ShowBubble(EFalse);
       
  2539 #endif             
       
  2540         }
       
  2541     }    
       
  2542 //  End Of File