textinput/peninputgenericvkb/src/peninputgenericvkbwindow.cpp
branchRCL_3
changeset 5 a47de9135b21
parent 3 f5a1e66df979
child 7 6defe5d1bd39
equal deleted inserted replaced
3:f5a1e66df979 5:a47de9135b21
    74       "z:\\resource\\plugins\\peninputvkbwindow.RSC" );
    74       "z:\\resource\\plugins\\peninputvkbwindow.RSC" );
    75 _LIT( KConfigurationResourceFile, 
    75 _LIT( KConfigurationResourceFile, 
    76       "z:\\resource\\plugins\\peninputvkbwindowconfiginfo_" );
    76       "z:\\resource\\plugins\\peninputvkbwindowconfiginfo_" );
    77 _LIT( KResourceFileExtName, ".RSC" );
    77 _LIT( KResourceFileExtName, ".RSC" );
    78 
    78 
       
    79 _LIT(KEmptyString, "");
       
    80 
    79 // ======== MEMBER FUNCTIONS ========
    81 // ======== MEMBER FUNCTIONS ========
    80 
    82 
    81 // --------------------------------------------------------------------------
    83 // --------------------------------------------------------------------------
    82 // CPeninputGenericVkbWindow::CPeninputGenericVkbWindow
    84 // CPeninputGenericVkbWindow::CPeninputGenericVkbWindow
    83 // (other items were commented in a header)
    85 // (other items were commented in a header)
    89     : CPeninputLayoutWindowExt( aUiLayout, aLayoutContext ),
    91     : CPeninputLayoutWindowExt( aUiLayout, aLayoutContext ),
    90       iUiStateMgr(aUiStateMgr),
    92       iUiStateMgr(aUiStateMgr),
    91       iPopupInited(EFalse),
    93       iPopupInited(EFalse),
    92       iPopupSet(EFalse),
    94       iPopupSet(EFalse),
    93       iLafMgr(NULL),
    95       iLafMgr(NULL),
    94       iFirstConstruct(ETrue)
    96       iFirstConstruct(ETrue),
       
    97       iIndiWithText( EFalse )
    95     {
    98     {
    96     }
    99     }
    97 
   100 
    98 // --------------------------------------------------------------------------
   101 // --------------------------------------------------------------------------
    99 // CPeninputGenericVkbWindow::NewL
   102 // CPeninputGenericVkbWindow::NewL
   124     iUnits.Close();
   127     iUnits.Close();
   125     
   128     
   126     delete iLafMgr;
   129     delete iLafMgr;
   127     iLafMgr = NULL;
   130     iLafMgr = NULL;
   128     delete iBmpRotator;
   131     delete iBmpRotator;
       
   132     iAccentCmdList.Close();
   129     }
   133     }
   130 void CPeninputGenericVkbWindow::ConstructL()
   134 void CPeninputGenericVkbWindow::ConstructL()
   131     {
   135     {
   132     iBmpRotator = CPeninputSyncBitmapRotator::NewL();
   136     iBmpRotator = CPeninputSyncBitmapRotator::NewL();
   133     iLafMgr = CPeninputGenericVkbLafMgr::NewL();
   137     iLafMgr = CPeninputGenericVkbLafMgr::NewL();
   153     
   157     
   154     TInt* data = ( TInt* ) aEventData.Ptr(); 
   158     TInt* data = ( TInt* ) aEventData.Ptr(); 
   155     
   159     
   156     switch ( aEventType )
   160     switch ( aEventType )
   157         {
   161         {
       
   162         case EPeninputLayoutEventMultiRange:
       
   163             {
       
   164             if ( aCtrl->ControlId() == EPeninutWindowCtrlIdMultiRangeBtn )
       
   165                 {
       
   166                 PopupChoiceList();
       
   167                 }
       
   168             }
       
   169             break;
   158         case EPeninputLayoutVkbEventResetShift: 
   170         case EPeninputLayoutVkbEventResetShift: 
   159             {
   171             {
   160             HandleShiftAndCapslockBtnClicked();
   172             HandleShiftAndCapslockBtnClicked();
   161             }
   173             }
   162             break;  
   174             break;  
   163         case EPenInputLayoutEventClosePopup:
   175         case EPenInputLayoutEventClosePopup:
   164         	{
   176         	{
   165             if ( iPopupWnd && !iPopupWnd->Hiden() )
   177             if ( iPopupWnd && !iPopupWnd->Hiden() )
   166                 {
   178                 {
   167                 iPopupWnd->CloseWindow();
   179                 iPopupWnd->CloseWindow();
   168                 ResetAccentButton();
   180                 if ( iLayoutContext->LayoutType() != EPluginInputModeFSQ )
       
   181                     {
       
   182                     ResetAccentButton();
       
   183                     }
   169                 iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   184                 iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   170                 }
   185                 }
   171         	}
   186         	}
   172             break;
   187             break;
   173         case EEventChoiceSelected:
   188         case EEventChoiceSelected:
   177 
   192 
   178             if ( event->iIndex != KPeninputVkbWndInvalidIndex )
   193             if ( event->iIndex != KPeninputVkbWndInvalidIndex )
   179                 {
   194                 {
   180                 if (aCtrl->ControlId() == EPeninutWindowCtrlIdAccentPopupWindow)
   195                 if (aCtrl->ControlId() == EPeninutWindowCtrlIdAccentPopupWindow)
   181                     {
   196                     {
   182                     TInt currentRange = CPeninputDataConverter::AnyToInt(
   197                     if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ )
   183                                       iLayoutContext->RequestData(EPeninputDataTypeCurrentRange));
       
   184                     TInt currentAccent = CPeninputDataConverter::AnyToInt(
       
   185                                       iLayoutContext->RequestData(EPeninputDataTypeCurrentAccent));
       
   186                 
       
   187                     if ((currentRange == ERangeAccent) && (currentAccent == event->iIndex))
       
   188                         {
   198                         {
   189 						iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   199                         TRAP_IGNORE( HandleRangeListSelectedL( aCtrl, aEventData ));
   190                         return;
       
   191                         }
   200                         }
   192 
   201                     else
   193                     iLayoutContext->SetData( EPeninputDataTypeCurrentAccent, &(event->iIndex));
   202                         {
   194                                          
   203                         TInt currentRange = CPeninputDataConverter::AnyToInt(
   195                     // Active range, update rangebar and vkb layout
   204                                           iLayoutContext->RequestData(EPeninputDataTypeCurrentRange));
   196                     //ChangeRange( ERangeAccent, EPeninputVkbLayoutAccented1 + 2 * event->iIndex);
   205                         TInt currentAccent = CPeninputDataConverter::AnyToInt(
   197                     (currentRange == ERangeAccent) ? ChangeRange(ERangeAccent, 
   206                                           iLayoutContext->RequestData(EPeninputDataTypeCurrentAccent));
   198                                        EPeninputVkbLayoutAccented1 + 2 * event->iIndex, EFalse) :
   207                     
   199                                                      ChangeRange(ERangeAccent, 
   208                         if ((currentRange == ERangeAccent) && (currentAccent == event->iIndex))
   200                                        EPeninputVkbLayoutAccented1 + 2 * event->iIndex, ETrue);
   209                             {
       
   210                             iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
       
   211                             return;
       
   212                             }
       
   213     
       
   214                         iLayoutContext->SetData( EPeninputDataTypeCurrentAccent, &(event->iIndex));
       
   215                                              
       
   216                         // Active range, update rangebar and vkb layout
       
   217                         //ChangeRange( ERangeAccent, EPeninputVkbLayoutAccented1 + 2 * event->iIndex);
       
   218                         (currentRange == ERangeAccent) ? ChangeRange(ERangeAccent, 
       
   219                                            EPeninputVkbLayoutAccented1 + 2 * event->iIndex, EFalse) :
       
   220                                                          ChangeRange(ERangeAccent, 
       
   221                                            EPeninputVkbLayoutAccented1 + 2 * event->iIndex, ETrue);
       
   222                         }
   201                     }
   223                     }
   202                 else if (aCtrl->ControlId() == EPeninutWindowCtrlIdSwitcherPopupWindow)
   224                 else if (aCtrl->ControlId() == EPeninutWindowCtrlIdSwitcherPopupWindow)
   203                     {
   225                     {
   204                     if (iLayoutContext->LayoutType() != event->iCommand)
   226                     if (iLayoutContext->LayoutType() != event->iCommand)
   205                         {
   227                         {
   218                     TRAP_IGNORE( HandleCandidateListSelectedL( aCtrl, aEventData ) );
   240                     TRAP_IGNORE( HandleCandidateListSelectedL( aCtrl, aEventData ) );
   219                     }
   241                     }
   220                 }
   242                 }
   221             else
   243             else
   222                 {
   244                 {
   223                 ResetAccentButton();   
   245                 if ( iLayoutContext->LayoutType() != EPluginInputModeFSQ )
       
   246                     {
       
   247                     ResetAccentButton();
       
   248                     }
   224                 }
   249                 }
   225             iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   250             iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   226             }
   251             }
   227             break;
   252             break;
   228         case EPeninputLayoutEventToHwr:
   253         case EPeninputLayoutEventToHwr:
   427     icf->MsgBubbleCtrl()->SetBitmapParam(NULL,
   452     icf->MsgBubbleCtrl()->SetBitmapParam(NULL,
   428     									  NULL,
   453     									  NULL,
   429     									  KAknsIIDQsnFrInputPreviewSideL,
   454     									  KAknsIIDQsnFrInputPreviewSideL,
   430     									  KAknsIIDQsnFrInputPreviewMiddle,
   455     									  KAknsIIDQsnFrInputPreviewMiddle,
   431     									  KAknsIIDQsnFrInputPreviewSideR);  
   456     									  KAknsIIDQsnFrInputPreviewSideR);  
       
   457     icf->MsgBubbleCtrl()->SetTextL( KEmptyString );
   432     icf->InfoBubbleCtrl()->SetTextFormat(iBubbleTextLayout);
   458     icf->InfoBubbleCtrl()->SetTextFormat(iBubbleTextLayout);
   433     icf->InfoBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
   459     icf->InfoBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
   434     icf->InfoBubbleCtrl()->SetBitmapParam(NULL,
   460     icf->InfoBubbleCtrl()->SetBitmapParam(NULL,
   435     									  NULL,
   461     									  NULL,
   436     									  KAknsIIDQsnFrInputPreviewSideL,
   462     									  KAknsIIDQsnFrInputPreviewSideL,
   440         {
   466         {
   441         icf->SetMsgBubbleCtrlSize(TSize(iBubbleSize.iW,iBubbleSize.iH));
   467         icf->SetMsgBubbleCtrlSize(TSize(iBubbleSize.iW,iBubbleSize.iH));
   442         icf->SetInfoBubbleCtrlSize(TSize(iBubbleSize.iW,iBubbleSize.iH));
   468         icf->SetInfoBubbleCtrlSize(TSize(iBubbleSize.iW,iBubbleSize.iH));
   443         }
   469         }
   444         
   470         
   445     // Range bar
   471     if ( !( iLayoutContext->LayoutType() == EPluginInputModeFSQ ))
   446     AddRangeBarL();
   472         {
       
   473         // Range bar
       
   474         AddRangeBarL();
       
   475         }
   447 
   476 
   448     // Vkb control
   477     // Vkb control
   449     iVkbCtrl = CPeninputVkbCtrlExt::NewL( TRect(), UiLayout(), 
   478     iVkbCtrl = CPeninputVkbCtrlExt::NewL( TRect(), UiLayout(), 
   450         EPeninutWindowCtrlIdVkbCtrl, NULL  );
   479         EPeninutWindowCtrlIdVkbCtrl, NULL  );
   451     iVkbCtrl->SetResourceId( R_PENINPUT_LAYOUT_VKB_KEYBOARD );
   480     iVkbCtrl->SetResourceId( R_PENINPUT_LAYOUT_VKB_KEYBOARD );
   525 	    spaceButton->SetImageFrameId( KAknsIIDQsnFrKeypadButtonFrNormal, 
   554 	    spaceButton->SetImageFrameId( KAknsIIDQsnFrKeypadButtonFrNormal, 
   526 	                                  KAknsIIDQsnFrKeypadButtonFrPressed,
   555 	                                  KAknsIIDQsnFrKeypadButtonFrPressed,
   527 	                                  KAknsIIDQsnFrKeypadButtonFrInactive );
   556 	                                  KAknsIIDQsnFrKeypadButtonFrInactive );
   528 	    }
   557 	    }
   529 	
   558 	
   530     // Switch to hwr button  
   559 	if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ )
   531     AddButtonL( EPeninutWindowCtrlIdSwitchToHwrBtn, 
   560 	    {
   532                 EPeninputLayoutEventToHwr, 
   561         // Switch to hwr button  
   533                 R_PENINPUT_LAYOUT_VKB_HWR );
   562         AddButtonL( EPeninutWindowCtrlIdMultiRangeBtn, 
       
   563                     EPeninputLayoutEventMultiRange, 
       
   564                     R_PENINPUT_LAYOUT_FSQ_MULTIRANGE );
       
   565 	    }
       
   566 	else
       
   567 	    {
       
   568 	    // Switch to hwr button  
       
   569 	    AddButtonL( EPeninutWindowCtrlIdSwitchToHwrBtn, 
       
   570                     EPeninputLayoutEventToHwr, 
       
   571                     R_PENINPUT_LAYOUT_VKB_HWR );
       
   572 	    }
   534                   
   573                   
   535     // Add popup window
   574     // Add popup window
   536     AddPopupWindowL();
   575     AddPopupWindowL();
   537   
   576   
   538     }
   577     }
   555 void CPeninputGenericVkbWindow::ChangeClientSize()
   594 void CPeninputGenericVkbWindow::ChangeClientSize()
   556     {
   595     {
   557     if ( !iPopupWnd->Hiden() )
   596     if ( !iPopupWnd->Hiden() )
   558         {
   597         {
   559         iPopupWnd->CloseWindow();
   598         iPopupWnd->CloseWindow();
   560         ResetAccentButton();
   599         if ( iLayoutContext->LayoutType() != EPluginInputModeFSQ )
       
   600             {
       
   601             ResetAccentButton();
       
   602             }
   561         iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   603         iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
   562         }
   604         }
   563         
   605         
   564     PopupWindowSizeChange();
   606     PopupWindowSizeChange();
   565             
   607             
   681     iLastUsedTotalRows = keyRows;
   723     iLastUsedTotalRows = keyRows;
   682     
   724     
   683     TRect winRect( Rect().iTl, iLafMgr->EntirePaneRect().Size());
   725     TRect winRect( Rect().iTl, iLafMgr->EntirePaneRect().Size());
   684         
   726         
   685     SetWindowRect(winRect);  
   727     SetWindowRect(winRect);  
   686     ReorgnizeTitleBar();
   728     //ReorgnizeTitleBar();
       
   729     ReorgnizeICFAndButtons();
   687     
   730     
   688     const TInt count = controlList.Count();
   731     const TInt count = controlList.Count();
   689     TInt controlID = 0;
   732     TInt controlID = 0;
   690     CFepUiBaseCtrl* ctrl = NULL;
   733     CFepUiBaseCtrl* ctrl = NULL;
   691     TRect rect;
   734     TRect rect;
   895 // (other items were commented in a header)
   938 // (other items were commented in a header)
   896 // --------------------------------------------------------------------------
   939 // --------------------------------------------------------------------------
   897 //
   940 //
   898 void CPeninputGenericVkbWindow::PopupChoiceList()
   941 void CPeninputGenericVkbWindow::PopupChoiceList()
   899     {
   942     {
   900     CFepUiBaseCtrl* accentBtn = Control( EPeninutWindowCtrlIdAccentedBtn );
   943     if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ )
   901     
   944         {
   902     if ( accentBtn )
   945         TRAP_IGNORE( PopupRangeListL());
   903         {
   946         }
   904         if(!iPopupInited)
   947     else
   905             TRAP_IGNORE(DoIdleConstructL());
   948         {
   906         iPopupWnd->Display( accentBtn->Rect() );
   949         CFepUiBaseCtrl* accentBtn = Control( EPeninutWindowCtrlIdAccentedBtn );
   907         iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStatePopup );
   950         
   908         }
   951         if ( accentBtn )
       
   952             {
       
   953             if(!iPopupInited)
       
   954                 TRAP_IGNORE(DoIdleConstructL());
       
   955             iPopupWnd->Display( accentBtn->Rect() );
       
   956             iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStatePopup );
       
   957             }
       
   958         }
       
   959     }
       
   960 // ---------------------------------------------------------------------------
       
   961 // Show range list
       
   962 // ---------------------------------------------------------------------------
       
   963 //
       
   964 void CPeninputGenericVkbWindow::PopupRangeListL()
       
   965     {
       
   966     if ( !iPopupInited )
       
   967         {
       
   968         TRAP_IGNORE( DoIdleConstructL() );
       
   969         }
       
   970     
       
   971 
       
   972     iPopupWnd->ClearItemsL();
       
   973     RArray<CFepLayoutChoiceList::SItem> items;
       
   974     PrepareRangeListItems( items );
       
   975     TInt count = items.Count();
       
   976     for ( TInt i = 0; i < count; i++ )
       
   977         {
       
   978         iPopupWnd->AddItemL( items[i] );
       
   979         }
       
   980     items.Close();
       
   981 
       
   982     if ( iPopupWnd->ItemsCount() < 1 ) 
       
   983         {
       
   984         return;
       
   985         }
       
   986     
       
   987     if ( iPopupWnd->ItemsCount() < 2 )
       
   988         {
       
   989         const CFepLayoutChoiceList::SItem* item = iPopupWnd->ItemByIndex( 0 );
       
   990         CFepLayoutChoiceList::SEvent event;
       
   991         event.iIndex = 0;
       
   992         event.iCommand = item->iCommand;
       
   993         TPtrC ptr;
       
   994         ptr.Set(reinterpret_cast<TText*>(&event), sizeof(event));
       
   995         HandleRangeListSelectedL( iPopupWnd, ptr );
       
   996         return;
       
   997         }
       
   998     
       
   999     CFepUiBaseCtrl* btn = Control( EPeninutWindowCtrlIdMultiRangeBtn );    
       
  1000     iPopupWnd->SetListColumnNumWithLafL( iPopupWnd->ItemsCount() );    
       
  1001     iPopupWnd->SetCurrentFocusedIndex( - 1 ); //no active item
       
  1002     iPopupWnd->Display( btn->Rect() );
       
  1003     iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStatePopup );    
       
  1004     }
       
  1005 
       
  1006 // ---------------------------------------------------------------------------
       
  1007 // Handle range list event
       
  1008 // ---------------------------------------------------------------------------
       
  1009 //
       
  1010 void CPeninputGenericVkbWindow::HandleRangeListSelectedL( CFepUiBaseCtrl* /*aCtrl*/, 
       
  1011                                                        const TDesC& aData )
       
  1012     {
       
  1013     CFepLayoutChoiceList::SEvent* event = 
       
  1014         (CFepLayoutChoiceList::SEvent*)aData.Ptr();
       
  1015     
       
  1016     TInt index = -1;
       
  1017     TInt range = ERangeInvalid;
       
  1018 
       
  1019     if ( event->iCommand == EPeninputVkbLayoutNativeChar )
       
  1020         {
       
  1021         range = ERangeNative;
       
  1022         }
       
  1023 
       
  1024     else if ( event->iCommand == EPeninputVkbLayoutNativeNumber )
       
  1025         {
       
  1026         range = ERangeNativeNumber;
       
  1027         }
       
  1028     
       
  1029     else if ( event->iCommand == EPeninputVkbLayoutLatinChar )
       
  1030         {
       
  1031         range = ERangeEnglish;
       
  1032         }
       
  1033     
       
  1034     else if ( event->iCommand == EPeninputVkbLayoutLatinNumber )
       
  1035         {
       
  1036         range = ERangeNumber;
       
  1037         }
       
  1038     
       
  1039     else if ( event->iCommand == EPeninputVkbLayoutSymbol )
       
  1040         {
       
  1041         range = ERangeSymbol;
       
  1042         }
       
  1043 
       
  1044     else if ( event->iCommand == EPeninputVkbLayoutAccented1 )
       
  1045         {
       
  1046         index = 0;
       
  1047         range = ERangeAccent;
       
  1048         }
       
  1049     
       
  1050     else if ( event->iCommand == EPeninputVkbLayoutAccented2 )
       
  1051         {
       
  1052         index = 1;
       
  1053         range = ERangeAccent;
       
  1054         }
       
  1055     
       
  1056     else if ( event->iCommand == EPeninputVkbLayoutAccented3 )
       
  1057         {
       
  1058         index = 2;
       
  1059         range = ERangeAccent;
       
  1060         }
       
  1061         
       
  1062     TInt currentRange = IntContext( EPeninputDataTypeCurrentRange );
       
  1063     TInt currentAccent = IntContext( EPeninputDataTypeCurrentAccent );
       
  1064 
       
  1065     if ( currentRange == range )
       
  1066         {
       
  1067         if ( range != ERangeAccent || currentAccent == index )
       
  1068             {
       
  1069             iUiStateMgr->SetCurrentUiState( EPeninputVkbUiStateStandby );
       
  1070             return;
       
  1071             }
       
  1072         }
       
  1073 
       
  1074     iLayoutContext->SetData( EPeninputDataTypeCurrentAccent, &index );
       
  1075 
       
  1076     if ( range != ERangeAccent )
       
  1077         {
       
  1078         ChangeRange( range );
       
  1079         }
       
  1080     else
       
  1081         {
       
  1082         ChangeRange( ERangeAccent, 
       
  1083                 EPeninputVkbLayoutAccented1 + 2 * index, ETrue );
       
  1084         }
       
  1085     UpdateRangeCtrlsL();
       
  1086     }
       
  1087 
       
  1088 // ---------------------------------------------------------------------------
       
  1089 // Update state of range button
       
  1090 // ---------------------------------------------------------------------------
       
  1091 //
       
  1092 void CPeninputGenericVkbWindow::UpdateRangeCtrlsL()
       
  1093     {
       
  1094     CAknFepCtrlCommonButton* rangeBtn = 
       
  1095         static_cast<CAknFepCtrlCommonButton*>( 
       
  1096                 Control(EPeninutWindowCtrlIdMultiRangeBtn));
       
  1097     if ( !rangeBtn )
       
  1098         {
       
  1099         return;
       
  1100         }
       
  1101     
       
  1102     RArray<CFepLayoutChoiceList::SItem> items;
       
  1103     PrepareRangeListItems( items );
       
  1104     TInt count = items.Count();
       
  1105     items.Close();
       
  1106     
       
  1107     TInt languageId = IntContext( EPeninputDataTypeInputLanguage );
       
  1108     TInt range = IntContext( EPeninputDataTypeCurrentRange );
       
  1109 
       
  1110     TInt resId = -1;
       
  1111     TInt aplhaRangeResId = -1;
       
  1112     TInt numberRangeResId = -1;
       
  1113     GetRangeIconResource( languageId, aplhaRangeResId, numberRangeResId );
       
  1114     
       
  1115     if ( range == ERangeEnglish || range == ERangeNative ) 
       
  1116         {
       
  1117         resId = aplhaRangeResId;
       
  1118         }
       
  1119     else
       
  1120         {
       
  1121         resId = numberRangeResId; 
       
  1122         }
       
  1123         
       
  1124     rangeBtn->SetResourceId( resId );
       
  1125     rangeBtn->ConstructFromResourceL();
       
  1126     rangeBtn->SetDimmed( count < 1 );    
       
  1127     }
       
  1128 
       
  1129 // ---------------------------------------------------------------------------
       
  1130 // Get resource ids of range button icon
       
  1131 // ---------------------------------------------------------------------------
       
  1132 //
       
  1133 void CPeninputGenericVkbWindow::GetRangeIconResource( TInt aLangId, 
       
  1134                                                       TInt& aAlphaRange, 
       
  1135                                                       TInt& aOtherRange  )
       
  1136     {   
       
  1137     switch ( aLangId )
       
  1138         {
       
  1139         case ELangRussian:    //Cyrillic
       
  1140         case ELangBulgarian:
       
  1141         case ELangUkrainian:
       
  1142             {
       
  1143             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_CYRILLIC_ALPHA;
       
  1144             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_CYRILLIC_NUMERIC;
       
  1145             }
       
  1146             break;
       
  1147         case ELangGreek:       //Greek
       
  1148         case ELangCyprusGreek:
       
  1149             {
       
  1150             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_GREEK_ALPHA;
       
  1151             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_GREEK_NUMERIC;
       
  1152             }
       
  1153             break;        
       
  1154         case ELangHebrew:     //Hebrew
       
  1155             {
       
  1156             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_HEBREW_ALPHA;
       
  1157             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_HEBREW_NUMERIC;
       
  1158             }
       
  1159             break;  
       
  1160         case ELangArabic:     //Arabic
       
  1161         case ELangFarsi:      //Farsi
       
  1162         case ELangUrdu:       //Urdu
       
  1163             {
       
  1164             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_ARABIC_ALPHA;
       
  1165             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_ARABIC_NUMERIC;
       
  1166             }
       
  1167             break;
       
  1168         case ELangThai:       //Thai
       
  1169             {
       
  1170             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_THAI_ALPHA;
       
  1171             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_THAI_NUMERIC;
       
  1172             }
       
  1173             break;
       
  1174         default:              //others       
       
  1175             {
       
  1176             aAlphaRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_LATIN_ALPHA;
       
  1177             aOtherRange = R_PENINPUT_LAYOUT_VKB_RANGECTRL_LATIN_NUMERIC;
       
  1178             }
       
  1179         }
       
  1180     }
       
  1181 
       
  1182 // ---------------------------------------------------------------------------
       
  1183 // Prepare range list items
       
  1184 // ---------------------------------------------------------------------------
       
  1185 //
       
  1186 void CPeninputGenericVkbWindow::PrepareRangeListItems( 
       
  1187                      RArray<CFepLayoutChoiceList::SItem>& aRangeItems )
       
  1188     {
       
  1189     aRangeItems.Reset();
       
  1190     TInt currentRange = IntContext( EPeninputDataTypeCurrentRange );
       
  1191     TInt permittedRange = IntContext( EPeninputDataTypePermittedRange );
       
  1192     TInt currentAccent = IntContext( EPeninputDataTypeCurrentAccent );
       
  1193     
       
  1194     CPeninputRangeBarInfo* rbinfo= ConfigInfo()->RangeBarInfo();
       
  1195     CPeninputRangeInfo* rgninfo = NULL;
       
  1196    
       
  1197     //add accent items
       
  1198     if ( permittedRange & ERangeAccent )
       
  1199         {
       
  1200         rgninfo = rbinfo->FindRange( ERangeAccent );
       
  1201         if ( rgninfo )
       
  1202             {
       
  1203             for ( TInt i = 0; i < iAccentCmdList.Count(); i++ )
       
  1204                 {
       
  1205                 if( currentRange != ERangeAccent || currentAccent != i )
       
  1206                     {
       
  1207                     aRangeItems.Append( iAccentCmdList[i] );
       
  1208                     }
       
  1209                 }
       
  1210             }
       
  1211         }
       
  1212     
       
  1213     //add range items  
       
  1214     CFepLayoutChoiceList::SItem item;
       
  1215     
       
  1216     if ( permittedRange & ERangeNative )
       
  1217         {
       
  1218         rgninfo = rbinfo->FindRange( ERangeNative );
       
  1219         if ( rgninfo && currentRange != ERangeNative )
       
  1220             {
       
  1221             item.iCommand = EPeninputVkbLayoutNativeChar;
       
  1222             item.iText.Copy( iRangeLabels.iLabelNativeChar );
       
  1223             aRangeItems.Append( item );
       
  1224             }
       
  1225         }
       
  1226     
       
  1227     if ( permittedRange & ERangeNativeNumber )
       
  1228         {
       
  1229         rgninfo = rbinfo->FindRange( ERangeNativeNumber );
       
  1230         if ( rgninfo && currentRange != ERangeNativeNumber )
       
  1231             {
       
  1232             item.iCommand = EPeninputVkbLayoutNativeNumber;
       
  1233             item.iText.Copy( iRangeLabels.iLabelNativeNumber );
       
  1234             aRangeItems.Append( item );
       
  1235             }
       
  1236         }
       
  1237    
       
  1238     if ( permittedRange & ERangeEnglish )
       
  1239         {
       
  1240         rgninfo = rbinfo->FindRange( ERangeEnglish );
       
  1241         if ( rgninfo && currentRange != ERangeEnglish )
       
  1242             {
       
  1243             item.iCommand = EPeninputVkbLayoutLatinChar;
       
  1244             item.iText.Copy( iRangeLabels.iLabelLatinChar );
       
  1245             aRangeItems.Append( item );
       
  1246             }
       
  1247         }
       
  1248     
       
  1249     if ( permittedRange & ERangeNumber )
       
  1250         {
       
  1251         rgninfo = rbinfo->FindRange( ERangeNumber );
       
  1252         if ( rgninfo && currentRange != ERangeNumber )
       
  1253             {
       
  1254             item.iCommand = EPeninputVkbLayoutLatinNumber;
       
  1255             item.iText.Copy( iRangeLabels.iLabelLatinNumber );
       
  1256             aRangeItems.Append( item );
       
  1257             }
       
  1258         }  
       
  1259     }
       
  1260 
       
  1261 // ---------------------------------------------------------------------------
       
  1262 // Load range labels for range list
       
  1263 // ---------------------------------------------------------------------------
       
  1264 //
       
  1265 void CPeninputGenericVkbWindow::ConstructRangeLabelListL( TInt /*aLangId*/ )
       
  1266     {
       
  1267     iRangeLabels.iLabelNativeChar.Zero();
       
  1268     iRangeLabels.iLabelNativeNumber.Zero();
       
  1269     iRangeLabels.iLabelLatinChar.Zero();
       
  1270     iRangeLabels.iLabelLatinNumber.Zero();
       
  1271     iRangeLabels.iLabelSymbol.Zero();
       
  1272     iRangeLabels.iLabelAccent.Zero();
       
  1273     
       
  1274     TInt resid = R_PENINPUT_LAYOUT_VKB_RANGES;
       
  1275     
       
  1276     TResourceReader reader;   
       
  1277     CCoeEnv::Static()->CreateResourceReaderLC( reader, resid );
       
  1278     TPtrC ptr1 = reader.ReadTPtrC();
       
  1279     TPtrC ptr2 = reader.ReadTPtrC();
       
  1280     TPtrC ptr3 = reader.ReadTPtrC();
       
  1281     TPtrC ptr4 = reader.ReadTPtrC();
       
  1282     TPtrC ptr5 = reader.ReadTPtrC();
       
  1283     TPtrC ptr6 = reader.ReadTPtrC();
       
  1284     
       
  1285     iRangeLabels.iLabelNativeChar.Copy( ptr1 );
       
  1286     iRangeLabels.iLabelNativeNumber.Copy( ptr2 );
       
  1287     iRangeLabels.iLabelLatinChar.Copy( ptr3 );
       
  1288     iRangeLabels.iLabelLatinNumber.Copy( ptr4 );
       
  1289     iRangeLabels.iLabelSymbol.Copy( ptr5 );
       
  1290     iRangeLabels.iLabelAccent.Copy( ptr6 );
       
  1291     
       
  1292     CleanupStack::PopAndDestroy( 1 ); //reader        
       
  1293     }
       
  1294 
       
  1295 // ---------------------------------------------------------------------------
       
  1296 // Utils to get context value 
       
  1297 // ---------------------------------------------------------------------------
       
  1298 //
       
  1299 TInt CPeninputGenericVkbWindow::IntContext( TPeninputDataType aDataIndex )
       
  1300     {
       
  1301     return CPeninputDataConverter::AnyToInt( 
       
  1302                            iLayoutContext->RequestData( aDataIndex ));
   909     }
  1303     }
   910 
  1304 
   911 // --------------------------------------------------------------------------
  1305 // --------------------------------------------------------------------------
   912 // CPeninputGenericVkbWindow::ResetAccentButton
  1306 // CPeninputGenericVkbWindow::ResetAccentButton
   913 // (other items were commented in a header)
  1307 // (other items were commented in a header)
  1244 // (other items were commented in a header).
  1638 // (other items were commented in a header).
  1245 // -----------------------------------------------------------------------------
  1639 // -----------------------------------------------------------------------------
  1246 //    
  1640 //    
  1247 void  CPeninputGenericVkbWindow::SetSwitchlistSecretFlag(TBool aSecret)
  1641 void  CPeninputGenericVkbWindow::SetSwitchlistSecretFlag(TBool aSecret)
  1248     {
  1642     {
  1249 	static_cast<CPeninputLayoutInputmodelChoice*>
  1643     CPeninputLayoutInputmodelChoice* choiceList = 
  1250 	    	(Control(EPeninutWindowCtrlIdSwitcherPopupWindow))->SetSecretEditor(aSecret);    
  1644         static_cast<CPeninputLayoutInputmodelChoice*>( 
       
  1645             Control(EPeninutWindowCtrlIdSwitcherPopupWindow ));
       
  1646         
       
  1647     if ( choiceList )
       
  1648         {
       
  1649         choiceList->SetSecretEditor( aSecret );
       
  1650         }
  1251 	//disable or enable arrow keys of FSQ in secret editor.    	
  1651 	//disable or enable arrow keys of FSQ in secret editor.    	
  1252     }
  1652     }
  1253     
  1653     
  1254 // ---------------------------------------------------------------------------
  1654 // ---------------------------------------------------------------------------
  1255 // CPeninputGenericVkbWindow::DimArrowKeys
  1655 // CPeninputGenericVkbWindow::DimArrowKeys
  1678 void CPeninputGenericVkbWindow::UpdateLafData()
  2078 void CPeninputGenericVkbWindow::UpdateLafData()
  1679     {
  2079     {
  1680     TRAP_IGNORE( iLafMgr->UpdateLafDataL() );
  2080     TRAP_IGNORE( iLafMgr->UpdateLafDataL() );
  1681     }
  2081     }
  1682 
  2082 
  1683 void CPeninputGenericVkbWindow::ReorgnizeTitleBar()
  2083 void CPeninputGenericVkbWindow::ReorgnizeICFAndButtons()
  1684 	{
  2084 	{
  1685     TRect rect;
  2085     TRect rect;
  1686     
  2086     
  1687     TPoint winPoint = Rect().iTl;
  2087     TPoint winPoint = Rect().iTl;
  1688     TPoint LafPoint = iLafMgr->EntirePaneRect().iTl;
  2088     TPoint LafPoint = iLafMgr->EntirePaneRect().iTl;
  1719           		rect, 
  2119           		rect, 
  1720 				icfConfig.iTextLineHeight,
  2120 				icfConfig.iTextLineHeight,
  1721 				icfFont->FontMaxHeight(),
  2121 				icfFont->FontMaxHeight(),
  1722 				icfFont));
  2122 				icfFont));
  1723 
  2123 
       
  2124     if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ )
       
  2125         {
       
  2126         iLafMgr->GetButtonRect( 
       
  2127                 EPeninutWindowCtrlIdMultiRangeBtn, exRect, inRect );
       
  2128         exRect.Move(x, y); 
       
  2129         inRect.Move(x, y);
       
  2130         static_cast<CAknFepCtrlEventButton*>
       
  2131             ( Control( EPeninutWindowCtrlIdMultiRangeBtn ))->SizeChanged( 
       
  2132               exRect, inRect, ETrue );
       
  2133             
       
  2134         TRAP_IGNORE( icf->MsgBubbleCtrl()->SetTextL( KEmptyString ));
       
  2135         iIndiWithText = EFalse;
       
  2136         IndiBubbleWithoutText();
       
  2137         }
  1724     
  2138     
  1725     iLafMgr->GetButtonRect(EPeninutWindowCtrlIdOptionBtn,exRect ,inRect);
  2139     iLafMgr->GetButtonRect(EPeninutWindowCtrlIdOptionBtn,exRect ,inRect);
  1726     exRect.Move(x, y); 
  2140     exRect.Move(x, y); 
  1727     inRect.Move(x, y);
  2141     inRect.Move(x, y);
  1728     static_cast<CAknFepCtrlEventButton*>
  2142     static_cast<CAknFepCtrlEventButton*>
  1883 		}
  2297 		}
  1884 	iPopupWnd->SetListColumnNumWithLafL( iPopupWnd->ItemsCount() );
  2298 	iPopupWnd->SetListColumnNumWithLafL( iPopupWnd->ItemsCount() );
  1885     iPopupInited = ETrue;
  2299     iPopupInited = ETrue;
  1886     iPopupSet = ETrue;
  2300     iPopupSet = ETrue;
  1887 	}
  2301 	}
       
  2302 // ---------------------------------------------------------------------------
       
  2303 // Load accent labels for range list
       
  2304 // ---------------------------------------------------------------------------
       
  2305 //
       
  2306 void CPeninputGenericVkbWindow::ConstructFSQAccentListL( TInt aLangId )
       
  2307     {  
       
  2308     iAccentCmdList.Reset();
       
  2309     
       
  2310     TBool is10x3 = ( aLangId == ELangEnglish ) || ( aLangId == ELangAmerican )
       
  2311                    || ( aLangId == ELangDutch)  || (aLangId == ELangTagalog ) 
       
  2312                    || ( aLangId == ELangIndonesian) || (aLangId == ELangMalay );
       
  2313     
       
  2314     if ( aLangId == ELangVietnamese )
       
  2315         {
       
  2316         _LIT( KVietAccentList1, "\x00E0 - \x013A" );
       
  2317         _LIT( KVietAccentList2, "\x013C - \x017E" );
       
  2318         
       
  2319         CFepLayoutChoiceList::SItem item;
       
  2320 
       
  2321         item.iCommand = EPeninputVkbLayoutAccented1;
       
  2322         item.iText.Copy( KVietAccentList1 );      
       
  2323         iAccentCmdList.Append( item );
       
  2324         
       
  2325         item.iCommand = EPeninputVkbLayoutAccented2;
       
  2326         item.iText.Copy( KVietAccentList2 );
       
  2327         iAccentCmdList.Append( item );
       
  2328         }
       
  2329     
       
  2330     // 10X3
       
  2331     else if ( is10x3 )
       
  2332         {
       
  2333         _LIT( KVietAccentList1, "\x00E0 - \x0121" );
       
  2334         _LIT( KVietAccentList2, "\x0123 - \x014F" );
       
  2335         _LIT( KVietAccentList3, "\x0151 - \x017E" );
       
  2336         
       
  2337         CFepLayoutChoiceList::SItem item;
       
  2338 
       
  2339         item.iCommand = EPeninputVkbLayoutAccented1;
       
  2340         item.iText.Copy( KVietAccentList1 );
       
  2341         iAccentCmdList.Append( item );
       
  2342         
       
  2343         item.iCommand = EPeninputVkbLayoutAccented2;
       
  2344         item.iText.Copy( KVietAccentList2 );
       
  2345         iAccentCmdList.Append( item );
       
  2346 
       
  2347         
       
  2348         item.iCommand = EPeninputVkbLayoutAccented3;
       
  2349         item.iText.Copy( KVietAccentList3 );
       
  2350         iAccentCmdList.Append( item );
       
  2351         }
       
  2352     //10X4
       
  2353     else
       
  2354         {
       
  2355         // Add item
       
  2356         TResourceReader reader;
       
  2357         CFepLayoutChoiceList::SItem item;
       
  2358 
       
  2359         item.iCommand = EPeninputVkbLayoutAccented1;
       
  2360         CCoeEnv::Static()->CreateResourceReaderLC( reader, R_PENINPUT_VKB_ACCENT1 );
       
  2361         TPtrC p1 = reader.ReadTPtrC();
       
  2362         item.iText.Copy( p1 );
       
  2363         iAccentCmdList.Append( item );
       
  2364         CleanupStack::PopAndDestroy( 1 ); //reader
       
  2365         
       
  2366         item.iCommand = EPeninputVkbLayoutAccented2;
       
  2367         CCoeEnv::Static()->CreateResourceReaderLC( reader, R_PENINPUT_VKB_ACCENT2 );
       
  2368         TPtrC p2 = reader.ReadTPtrC();
       
  2369         item.iText.Copy( p2 );
       
  2370         iAccentCmdList.Append( item );
       
  2371         CleanupStack::PopAndDestroy( 1 ); //reader
       
  2372         
       
  2373         item.iCommand = EPeninputVkbLayoutAccented3;
       
  2374         CCoeEnv::Static()->CreateResourceReaderLC( reader, R_PENINPUT_VKB_ACCENT3 );
       
  2375         TPtrC p3 = reader.ReadTPtrC();
       
  2376         item.iText.Copy( p3 );
       
  2377         iAccentCmdList.Append( item );
       
  2378         CleanupStack::PopAndDestroy( 1 );//reader          
       
  2379         }
       
  2380 
       
  2381     iPopupInited = ETrue;
       
  2382     iPopupSet = ETrue;
       
  2383     }
  1888 void CPeninputGenericVkbWindow::UpdateICFTextL()
  2384 void CPeninputGenericVkbWindow::UpdateICFTextL()
  1889     {
  2385     {
  1890     CFepLayoutMultiLineIcf* icf = 
  2386     CFepLayoutMultiLineIcf* icf = 
  1891         static_cast<CFepLayoutMultiLineIcf*>(Control(EPeninputWindowCtrlIdMultiLineICF));
  2387         static_cast<CFepLayoutMultiLineIcf*>(Control(EPeninputWindowCtrlIdMultiLineICF));
  1892     if( icf )
  2388     if( icf )
  2099                                 KAknsIIDQsnTextColors,
  2595                                 KAknsIIDQsnTextColors,
  2100                                 EAknsCIQsnTextColorsCG64 );
  2596                                 EAknsCIQsnTextColorsCG64 );
  2101     return matchlistcolor;
  2597     return matchlistcolor;
  2102     }
  2598     }
  2103 
  2599 
       
  2600 void CPeninputGenericVkbWindow::SetIndiBubbleImageL( const TInt aImgID1,
       
  2601                                               const TInt aMaskID1,
       
  2602                                               const TInt aImgID2,
       
  2603                                               const TInt aMaskID2 )
       
  2604     {
       
  2605     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
       
  2606 
       
  2607     CFbsBitmap* bmp1 = NULL;
       
  2608     CFbsBitmap* mask1 = NULL;
       
  2609     
       
  2610     TInt colorIndex = EAknsCIQsnIconColorsCG30;
       
  2611 
       
  2612     AknsUtils::CreateColorIconL(skininstance,
       
  2613                                 KAknsIIDQsnIconColors,
       
  2614                                 KAknsIIDQsnIconColors,
       
  2615                                 colorIndex,
       
  2616                                 bmp1,
       
  2617                                 mask1,
       
  2618                                 AknIconUtils::AvkonIconFileName(),
       
  2619                                 aImgID1,
       
  2620                                 aMaskID1,
       
  2621                                 KRgbGray);
       
  2622     CleanupStack::PushL( bmp1 );
       
  2623     CleanupStack::PushL( mask1 );
       
  2624                                 
       
  2625     AknIconUtils::GetContentDimensions(bmp1, iIndicatorSize);
       
  2626 
       
  2627     CFbsBitmap* bmp2 = NULL;
       
  2628     CFbsBitmap* mask2 = NULL;
       
  2629     AknsUtils::CreateColorIconL(skininstance,
       
  2630                                 KAknsIIDQsnIconColors,
       
  2631                                 KAknsIIDQsnIconColors,
       
  2632                                 colorIndex,
       
  2633                                 bmp2,
       
  2634                                 mask2,
       
  2635                                 AknIconUtils::AvkonIconFileName(),
       
  2636                                 aImgID2,
       
  2637                                 aMaskID2,
       
  2638                                 KRgbGray);
       
  2639  
       
  2640     CleanupStack::PushL( bmp2 );
       
  2641     CleanupStack::PushL( mask2 );
       
  2642     
       
  2643     AknIconUtils::GetContentDimensions(bmp2, iIndicatorTextSize);
       
  2644     
       
  2645     TRect boundRect;
       
  2646     if ( iIndiWithText )
       
  2647         {
       
  2648         boundRect = iLafMgr->IndiIconRectWithText();
       
  2649         }
       
  2650     else
       
  2651         {
       
  2652         boundRect = iLafMgr->IndiIconRectWithoutText();
       
  2653         }
       
  2654     
       
  2655     TRect imgrect, textrect;
       
  2656     
       
  2657     CalIndicatorRect(boundRect, imgrect, textrect, EIndiAlignCenter);
       
  2658     AknIconUtils::SetSize(bmp1, imgrect.Size(), EAspectRatioNotPreserved);
       
  2659     AknIconUtils::SetSize(mask1, imgrect.Size(), EAspectRatioNotPreserved);
       
  2660     AknIconUtils::SetSize(bmp2, textrect.Size(), EAspectRatioNotPreserved);
       
  2661     AknIconUtils::SetSize(mask2, textrect.Size(), EAspectRatioNotPreserved);
       
  2662 
       
  2663     CFbsBitmap* bmp3 = AknPenImageUtils::CombineTwoImagesL(bmp1, bmp2, bmp1->DisplayMode());
       
  2664     CFbsBitmap* mask3 = AknPenImageUtils::CombineTwoImagesL(mask1, mask2, EGray256);
       
  2665     
       
  2666     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
       
  2667                                    (Control(EPeninputWindowCtrlIdMultiLineICF));
       
  2668     icf->MsgBubbleCtrl()->SetBitmapParam( bmp3, mask3, 
       
  2669                     KAknsIIDQsnFrInputPreviewSideL,
       
  2670                     KAknsIIDQsnFrInputPreviewMiddle,
       
  2671                     KAknsIIDQsnFrInputPreviewSideR );
       
  2672     
       
  2673     CleanupStack::PopAndDestroy( mask2 );
       
  2674     CleanupStack::PopAndDestroy( bmp2 );
       
  2675     CleanupStack::PopAndDestroy( mask1 );
       
  2676     CleanupStack::PopAndDestroy( bmp1 );
       
  2677     }
       
  2678 
       
  2679 void CPeninputGenericVkbWindow::CalIndicatorRect(const TRect& aBoundRect,
       
  2680                                           TRect& aRealRect1,
       
  2681                                           TRect& aRealRect2,
       
  2682                                           TIndicatorAlign aAlign) 
       
  2683     {
       
  2684     TInt imgAspectText = iIndicatorTextSize.iWidth / iIndicatorTextSize.iHeight;
       
  2685     TInt imgAspectIndi = iIndicatorSize.iWidth / iIndicatorSize.iHeight;
       
  2686     TSize imgSizeText( aBoundRect.Size().iHeight * imgAspectText, 
       
  2687                        aBoundRect.Size().iHeight );
       
  2688     TSize imgSizeIndi( aBoundRect.Size().iHeight * imgAspectIndi, 
       
  2689                                aBoundRect.Size().iHeight );
       
  2690     // check if the length of img > bound rect width
       
  2691     TInt nTotalWidth = imgSizeText.iWidth + imgSizeIndi.iWidth;
       
  2692     if( nTotalWidth > aBoundRect.Size().iWidth )
       
  2693         {
       
  2694         TReal nAspect = (TReal)imgSizeText.iWidth / nTotalWidth;
       
  2695         imgSizeText.iWidth = aBoundRect.Size().iWidth * nAspect;
       
  2696         imgSizeIndi.iWidth = aBoundRect.Size().iWidth - imgSizeText.iWidth;
       
  2697         imgSizeText.iHeight = imgSizeText.iWidth / imgAspectText;
       
  2698         // make sure the height of two rect is equal
       
  2699         imgSizeIndi.iHeight = imgSizeText.iHeight;
       
  2700         }
       
  2701     if( aAlign == EIndiAlignRight )
       
  2702         {
       
  2703         aRealRect2 = TRect(TPoint( aBoundRect.iBr.iX - imgSizeText.iWidth, aBoundRect.iTl.iY),
       
  2704                        imgSizeText);
       
  2705         aRealRect1 = TRect(TPoint(aRealRect2.iTl.iX - imgSizeIndi.iWidth, aRealRect2.iTl.iY),
       
  2706                        imgSizeIndi);
       
  2707         }
       
  2708     else if( aAlign == EIndiAlignCenter )
       
  2709         {
       
  2710         TInt offsetX = ( aBoundRect.Size().iWidth - imgSizeText.iWidth - imgSizeIndi.iWidth ) / 2;
       
  2711         TInt offsetY = ( aBoundRect.Size().iHeight - imgSizeText.iHeight ) / 2;
       
  2712         aRealRect2 = TRect( TPoint( aBoundRect.iBr.iX - imgSizeText.iWidth - offsetX, 
       
  2713                                    aBoundRect.iTl.iY + offsetY),
       
  2714                             imgSizeText );
       
  2715         aRealRect1 = TRect( TPoint(aRealRect2.iTl.iX - imgSizeIndi.iWidth, aRealRect2.iTl.iY),
       
  2716                        imgSizeIndi );
       
  2717         }
       
  2718     else if( aAlign == EIndiAlignLeft )
       
  2719         {
       
  2720         aRealRect1 = TRect( aBoundRect.iTl, imgSizeIndi );
       
  2721         aRealRect2 = TRect( TPoint( aRealRect1.iBr.iX, aRealRect1.iTl.iY ), imgSizeText );
       
  2722         }
       
  2723     }
       
  2724 
       
  2725 void CPeninputGenericVkbWindow::IndiBubbleWithText()
       
  2726     {
       
  2727     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
       
  2728                            (Control(EPeninputWindowCtrlIdMultiLineICF));
       
  2729     if ( icf )
       
  2730         {
       
  2731         TAknTextLineLayout textLine = iLafMgr->IndiText();
       
  2732         TRect bubbleRect = iLafMgr->IndiPaneRectWithText();
       
  2733         TRect iconRect = iLafMgr->IndiIconRectWithText();
       
  2734         TSize offset( 60, 6 );
       
  2735         TSize size( iconRect.Width(), iconRect.Height());
       
  2736         
       
  2737         icf->MsgBubbleCtrl()->SetRect( bubbleRect );
       
  2738         icf->MsgBubbleCtrl()->SetIconOffsetAndSize( offset, size );
       
  2739         icf->MsgBubbleCtrl()->SetTextFormat( textLine );
       
  2740         icf->MsgBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
       
  2741         }
       
  2742     }
       
  2743 
       
  2744 void CPeninputGenericVkbWindow::IndiBubbleWithoutText()
       
  2745     {
       
  2746     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
       
  2747                                (Control(EPeninputWindowCtrlIdMultiLineICF));
       
  2748     if ( icf )
       
  2749         {
       
  2750         TRect bubbleRect = iLafMgr->IndiPaneRectWithoutText();
       
  2751         TRect iconRect = iLafMgr->IndiIconRectWithoutText();
       
  2752         TSize offset( 0, 6 );
       
  2753         TSize size( iconRect.Width(), iconRect.Height());
       
  2754         
       
  2755         icf->MsgBubbleCtrl()->SetRect( bubbleRect );
       
  2756         icf->MsgBubbleCtrl()->SetIconOffsetAndSize( offset, size );
       
  2757         }
       
  2758     }
       
  2759 
       
  2760 void CPeninputGenericVkbWindow::SetIndiWithTextFlag( TBool aFlag )
       
  2761     {
       
  2762     iIndiWithText = aFlag;
       
  2763     }
       
  2764 
       
  2765 void CPeninputGenericVkbWindow::UpdateIndiBubbleL( TUint8* aData )
       
  2766     {
       
  2767     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
       
  2768                                (Control(EPeninputWindowCtrlIdMultiLineICF));
       
  2769     
       
  2770     RDesReadStream readStream;
       
  2771     TFepIndicatorInfo indicatorData;
       
  2772 
       
  2773     TPtr8 countPtr( aData, 4*sizeof(TInt), 4*sizeof(TInt) );            
       
  2774     readStream.Open(countPtr);
       
  2775     CleanupClosePushL(readStream);
       
  2776 
       
  2777     indicatorData.iIndicatorImgID = readStream.ReadInt32L();
       
  2778     indicatorData.iIndicatorMaskID = readStream.ReadInt32L();
       
  2779     indicatorData.iIndicatorTextImgID = readStream.ReadInt32L();
       
  2780     indicatorData.iIndicatorTextMaskID = readStream.ReadInt32L();
       
  2781 
       
  2782     CleanupStack::PopAndDestroy(&readStream);
       
  2783     
       
  2784     if ( indicatorData.iIndicatorImgID != 0 && 
       
  2785         indicatorData.iIndicatorMaskID != 0 && 
       
  2786         indicatorData.iIndicatorTextImgID != 0 &&
       
  2787         indicatorData.iIndicatorTextMaskID != 0 )
       
  2788         { 
       
  2789         SetIndicatorData( indicatorData );
       
  2790         
       
  2791         if ( icf )
       
  2792             {
       
  2793             SetIndiBubbleImageL( indicatorData.iIndicatorImgID,
       
  2794                     indicatorData.iIndicatorMaskID,
       
  2795                     indicatorData.iIndicatorTextImgID,
       
  2796                     indicatorData.iIndicatorTextMaskID );
       
  2797                  
       
  2798             TBuf<100> text;
       
  2799             icf->MsgBubbleCtrl()->GetText( text );
       
  2800             icf->ShowBubble( text, icf->MsgBubbleCtrl()->Rect());
       
  2801             }
       
  2802         }
       
  2803     }
  2104 // End Of File
  2804 // End Of File