textinput/peninputgenericvkb/src/peninputgenericvkbwindow.cpp
branchRCL_3
changeset 9 e6a39382bb9c
parent 7 6defe5d1bd39
child 11 c8fb4cf7b3ae
equal deleted inserted replaced
8:4eb1ae11334f 9:e6a39382bb9c
  1407     TPtrC bmpFileName = aRes.ReadTPtrC();        
  1407     TPtrC bmpFileName = aRes.ReadTPtrC();        
  1408     TInt32 imgMajorSkinId = aRes.ReadInt32();
  1408     TInt32 imgMajorSkinId = aRes.ReadInt32();
  1409 
  1409 
  1410     TAknsItemID id;
  1410     TAknsItemID id;
  1411     
  1411     
  1412     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  1412     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  1413 
  1413 
  1414     TInt popWinBmpId = aRes.ReadInt16();
  1414     TInt popWinBmpId = aRes.ReadInt16();
  1415     TInt popWinBmpMaskId = aRes.ReadInt16();
  1415     TInt popWinBmpMaskId = aRes.ReadInt16();
  1416     TInt popWinBmpSkinId = aRes.ReadInt16();
  1416     TInt popWinBmpSkinId = aRes.ReadInt16();
  1417     
  1417     
  1691        && iArrowLeftButton && iArrowRightButton)
  1691        && iArrowLeftButton && iArrowRightButton)
  1692         {
  1692         {
  1693         iArrowLeftButton->SetDimmed( aDimArrow );
  1693         iArrowLeftButton->SetDimmed( aDimArrow );
  1694         iArrowRightButton->SetDimmed( aDimArrow );
  1694         iArrowRightButton->SetDimmed( aDimArrow );
  1695         }	    	
  1695         }	    	
       
  1696     }
       
  1697 
       
  1698 void CPeninputGenericVkbWindow::DimEnterKey( TBool aDimmed )
       
  1699     {
       
  1700 	CAknFepCtrlEventButton* enterBtn = static_cast<CAknFepCtrlEventButton*>
       
  1701 	                              ( Control(EPeninutWindowCtrlIdEnterBtn) );	
       
  1702     if(iLayoutContext->LayoutType() == EPluginInputModeFSQ 
       
  1703        && enterBtn )
       
  1704         {
       
  1705         enterBtn->SetDimmed( aDimmed );        
       
  1706         }
  1696     }
  1707     }
  1697 
  1708 
  1698 // ---------------------------------------------------------------------------
  1709 // ---------------------------------------------------------------------------
  1699 // CAknFepVkbWindow::PopupAccentWindow
  1710 // CAknFepVkbWindow::PopupAccentWindow
  1700 // (other items were commented in a header).
  1711 // (other items were commented in a header).
  2363         
  2374         
  2364         item.iCommand = EPeninputVkbLayoutAccented2;
  2375         item.iCommand = EPeninputVkbLayoutAccented2;
  2365         item.iText.Copy( KVietAccentList2 );
  2376         item.iText.Copy( KVietAccentList2 );
  2366         iAccentCmdList.Append( item );
  2377         iAccentCmdList.Append( item );
  2367         }
  2378         }
  2368     
  2379     else if( aLangId == ELangRussian || aLangId == ELangUkrainian || aLangId == ELangBulgarian )
       
  2380     	{
       
  2381         _LIT( KCyrillicAccent, "\x00E0 - \x017E" );
       
  2382         CFepLayoutChoiceList::SItem item;
       
  2383 
       
  2384         item.iCommand = EPeninputVkbLayoutAccented1;
       
  2385         item.iText.Copy( KCyrillicAccent );      
       
  2386         iAccentCmdList.Append( item );        
       
  2387     	}
  2369     // 10X3
  2388     // 10X3
  2370     else if ( is10x3 )
  2389     else if ( is10x3 )
  2371         {
  2390         {
  2372         _LIT( KVietAccentList1, "\x00E0 - \x0121" );
  2391         _LIT( KVietAccentList1, "\x00E0 - \x0121" );
  2373         _LIT( KVietAccentList2, "\x0123 - \x014F" );
  2392         _LIT( KVietAccentList2, "\x0123 - \x014F" );
  2512 	
  2531 	
  2513 // --------------------------------------------------------------------------
  2532 // --------------------------------------------------------------------------
  2514 // Show candidate list
  2533 // Show candidate list
  2515 // --------------------------------------------------------------------------
  2534 // --------------------------------------------------------------------------
  2516 //
  2535 //
  2517 void CPeninputGenericVkbWindow::ShowCandidateListL( const CDesCArray* aItemArray,
  2536 void CPeninputGenericVkbWindow::ShowCandidateListL( TInt aAlign, const CDesCArray* aItemArray,
  2518                                                    TInt aActiveIndex )
  2537                                                    TInt aActiveIndex )
  2519     {
  2538     {
  2520     if ( !iCandidateList )
  2539     if ( !iCandidateList )
  2521         {
  2540         {
  2522         return;
  2541         return;
  2523         }                
  2542         }                
  2524     iCandidateList->ClearItemsL();
  2543     iCandidateList->ClearItemsL();
       
  2544 	iCandidateList->SetTextAlignment((CGraphicsContext::TTextAlign) aAlign);
       
  2545 
  2525     if ( aItemArray )
  2546     if ( aItemArray )
  2526         {        
  2547         {
  2527         for ( TInt i = 0; i < aItemArray->Count(); i++ )
  2548 		CFepLayoutChoiceList::SItem item;
  2528             {
  2549 		item.iCommand = 0;
  2529             CFepLayoutChoiceList::SItem item;
  2550 		
  2530             item.iCommand = 0;
  2551         for (TInt i = 0; i < aItemArray->Count(); ++i)
  2531             if ( (*aItemArray)[i].Length() <= item.iText.MaxLength() )
  2552             {
       
  2553             if ((*aItemArray)[i].Length() <= item.iText.MaxLength())
  2532                 {
  2554                 {
  2533                 item.iText.Copy( (*aItemArray)[i] );
  2555                 item.iText.Copy((*aItemArray)[i]);
  2534                 }
  2556                 }
  2535             else
  2557             else
  2536                 {
  2558                 {
  2537                 // Given longer than maxlength, display the part of less than max
  2559                 // Given longer than maxlength, display the part of less than max
  2538                 item.iText.Copy( (*aItemArray)[i].Left( item.iText.MaxLength() ) );
  2560                 item.iText.Copy((*aItemArray)[i].Left(item.iText.MaxLength()));
  2539                 }
  2561                 }
       
  2562 			
  2540             iCandidateList->AddItemL( item );
  2563             iCandidateList->AddItemL( item );
  2541             }
  2564             }
  2542         }
  2565         }
  2543     iCandidateList->SetCurrentFocusedIndex( aActiveIndex );
  2566     iCandidateList->SetCurrentFocusedIndex( aActiveIndex );
  2544     
  2567     
  2610 // Retrieve text color from skin for candidiate list.
  2633 // Retrieve text color from skin for candidiate list.
  2611 // --------------------------------------------------------------------------
  2634 // --------------------------------------------------------------------------
  2612 //
  2635 //
  2613 TRgb CPeninputGenericVkbWindow::CandidateListTextColor()
  2636 TRgb CPeninputGenericVkbWindow::CandidateListTextColor()
  2614     {
  2637     {
  2615     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  2638     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  2616     TRgb matchlistcolor = KRgbBlack;
  2639     TRgb matchlistcolor = KRgbBlack;
  2617     AknsUtils::GetCachedColor( skininstance, 
  2640     AknsUtils::GetCachedColor( skininstance, 
  2618                                 matchlistcolor, 
  2641                                 matchlistcolor, 
  2619                                 KAknsIIDQsnTextColors,
  2642                                 KAknsIIDQsnTextColors,
  2620                                 EAknsCIQsnTextColorsCG43 );
  2643                                 EAknsCIQsnTextColorsCG43 );
  2625 // Retrieve text color from skin for autocompletion part.
  2648 // Retrieve text color from skin for autocompletion part.
  2626 // --------------------------------------------------------------------------
  2649 // --------------------------------------------------------------------------
  2627 //
  2650 //
  2628 TRgb CPeninputGenericVkbWindow::AutoCompletionPartColor()
  2651 TRgb CPeninputGenericVkbWindow::AutoCompletionPartColor()
  2629     {
  2652     {
  2630     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  2653     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  2631     TRgb matchlistcolor = KRgbBlack;
  2654     TRgb matchlistcolor = KRgbBlack;
  2632     AknsUtils::GetCachedColor( skininstance, 
  2655     AknsUtils::GetCachedColor( skininstance, 
  2633                                 matchlistcolor, 
  2656                                 matchlistcolor, 
  2634                                 KAknsIIDQsnTextColors,
  2657                                 KAknsIIDQsnTextColors,
  2635                                 EAknsCIQsnTextColorsCG64 );
  2658                                 EAknsCIQsnTextColorsCG64 );
  2639 void CPeninputGenericVkbWindow::SetIndiBubbleImageL( const TInt aImgID1,
  2662 void CPeninputGenericVkbWindow::SetIndiBubbleImageL( const TInt aImgID1,
  2640                                               const TInt aMaskID1,
  2663                                               const TInt aMaskID1,
  2641                                               const TInt aImgID2,
  2664                                               const TInt aImgID2,
  2642                                               const TInt aMaskID2 )
  2665                                               const TInt aMaskID2 )
  2643     {
  2666     {
  2644     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  2667     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  2645 
  2668 
  2646     CFbsBitmap* bmp1 = NULL;
  2669     CFbsBitmap* bmp1 = NULL;
  2647     CFbsBitmap* mask1 = NULL;
  2670     CFbsBitmap* mask1 = NULL;
  2648     
  2671     
  2649     TInt colorIndex = EAknsCIQsnIconColorsCG30;
  2672     TInt colorIndex = EAknsCIQsnIconColorsCG30;