textinput/peninputvkbcn/ctrlsrc/peninputvkbwindow.cpp
branchRCL_3
changeset 9 e6a39382bb9c
parent 7 6defe5d1bd39
child 12 5e18d8c489d6
equal deleted inserted replaced
8:4eb1ae11334f 9:e6a39382bb9c
   791     GetPopupWndInfoFromRes(reader);
   791     GetPopupWndInfoFromRes(reader);
   792       
   792       
   793     CleanupStack::PopAndDestroy(); // reader
   793     CleanupStack::PopAndDestroy(); // reader
   794 
   794 
   795     //add item
   795     //add item
   796     
       
   797     CFepLayoutChoiceList::SItem item;
   796     CFepLayoutChoiceList::SItem item;
   798 
   797 
   799     item.iCommand = EAknFepVkbVkbAccented1;
   798     item.iCommand = EAknFepVkbVkbAccented1;
   800     CCoeEnv::Static()->CreateResourceReaderLC( reader, R_PENINPUT_VKB_ACCENT1 );
   799     CCoeEnv::Static()->CreateResourceReaderLC( reader, R_PENINPUT_VKB_ACCENT1 );
   801     TPtrC p1 = reader.ReadTPtrC();
   800     TPtrC p1 = reader.ReadTPtrC();
   861         iArrowLeftButton->SetDimmed( aDimArrow );
   860         iArrowLeftButton->SetDimmed( aDimArrow );
   862         iArrowRightButton->SetDimmed( aDimArrow );
   861         iArrowRightButton->SetDimmed( aDimArrow );
   863         iClientArea->DimArrowKeys( aDimArrow );
   862         iClientArea->DimArrowKeys( aDimArrow );
   864         }	    	
   863         }	    	
   865     }
   864     }
   866     
   865 
       
   866 void CAknFepVkbWindow::DimEnterKey( TBool aDimmed )
       
   867     {
       
   868 	CAknFepCtrlEventButton* enterBtn = static_cast<CAknFepCtrlEventButton*>
       
   869 	                              ( Control(EAknFepVkbCtrlIdEnterBtn) );	
       
   870     if( UiLayout()->PenInputType() == EPluginInputModeFSQ 
       
   871        && enterBtn )
       
   872         {
       
   873         enterBtn->SetDimmed( aDimmed );        
       
   874         }
       
   875     }
       
   876 
   867 // --------------------------------------------------------------------------
   877 // --------------------------------------------------------------------------
   868 // CAknFepVkbWindow::GetPopupWndInfoFromRes
   878 // CAknFepVkbWindow::GetPopupWndInfoFromRes
   869 // (other items were commented in a header)
   879 // (other items were commented in a header)
   870 // --------------------------------------------------------------------------
   880 // --------------------------------------------------------------------------
   871 //
   881 //
   874     TPtrC bmpFileName = aReader.ReadTPtrC();
   884     TPtrC bmpFileName = aReader.ReadTPtrC();
   875     TInt32 imgMajorSkinId = aReader.ReadInt32();
   885     TInt32 imgMajorSkinId = aReader.ReadInt32();
   876 
   886 
   877     TAknsItemID id;
   887     TAknsItemID id;
   878     
   888     
   879     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
   889     MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
   880 
   890 
   881     TInt popWinBmpId = aReader.ReadInt16();
   891     TInt popWinBmpId = aReader.ReadInt16();
   882     TInt popWinBmpMaskId = aReader.ReadInt16();
   892     TInt popWinBmpMaskId = aReader.ReadInt16();
   883     TInt popWinBmpSkinId = aReader.ReadInt16();
   893     TInt popWinBmpSkinId = aReader.ReadInt16();
   884     
   894     
  1272 	
  1282 	
  1273 // --------------------------------------------------------------------------
  1283 // --------------------------------------------------------------------------
  1274 // Show candidate list
  1284 // Show candidate list
  1275 // --------------------------------------------------------------------------
  1285 // --------------------------------------------------------------------------
  1276 //
  1286 //
  1277 void CAknFepVkbWindow::ShowCandidateListOnFSQL( const CDesCArray* aItemArray,
  1287 void CAknFepVkbWindow::ShowCandidateListOnFSQL(TInt aAlign, const CDesCArray* aItemArray,
  1278                                                    TInt aActiveIndex )
  1288                                                    TInt aActiveIndex)
  1279     {
  1289     {
  1280     if ( UiLayout()->PenInputType() != EPluginInputModeFSQ )
  1290     if (UiLayout()->PenInputType() != EPluginInputModeFSQ)
  1281         {
       
  1282         return;
  1291         return;
  1283         }                
  1292              
  1284     iCandidateList->ClearItemsL();
  1293     iCandidateList->ClearItemsL();
  1285     if ( aItemArray )
  1294     iCandidateList->SetTextAlignment((CGraphicsContext::TTextAlign) aAlign);
  1286         {        
  1295 
  1287         for ( TInt i = 0; i < aItemArray->Count(); i++ )
  1296     if (aItemArray)
  1288             {
  1297         {
  1289             CFepLayoutChoiceList::SItem item;
  1298 		CFepLayoutChoiceList::SItem item;
  1290             item.iCommand = 0;
  1299 		item.iCommand = 0;
  1291             if ( (*aItemArray)[i].Length() <= item.iText.MaxLength() )
  1300 		
       
  1301         for (TInt i = 0; i < aItemArray->Count(); ++i)
       
  1302             {
       
  1303             if ((*aItemArray)[i].Length() <= item.iText.MaxLength())
  1292                 {
  1304                 {
  1293                 item.iText.Copy( (*aItemArray)[i] );
  1305                 item.iText.Copy((*aItemArray)[i]);
  1294                 }
  1306                 }
  1295             else
  1307             else
  1296                 {
  1308                 {
  1297                 // Given longer than maxlength, display the part of less than max
  1309                 // Given longer than maxlength, display the part of less than max
  1298                 item.iText.Copy( (*aItemArray)[i].Left( item.iText.MaxLength() ) );
  1310                 item.iText.Copy((*aItemArray)[i].Left(item.iText.MaxLength()));
  1299                 }
  1311                 }
  1300             iCandidateList->AddItemL( item );
  1312             iCandidateList->AddItemL(item);
  1301             }
  1313             }
  1302         
  1314 
  1303 			iCandidateList->SetCurrentFocusedIndex( aActiveIndex );
  1315         iCandidateList->SetCurrentFocusedIndex(aActiveIndex);
  1304         }
  1316         }
  1305     
  1317     
  1306     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
  1318     CFepLayoutMultiLineIcf* icf = static_cast<CFepLayoutMultiLineIcf*>
  1307          (Control(EPeninputWindowCtrlIdMultiLineICF)); 
  1319          (Control(EPeninputWindowCtrlIdMultiLineICF)); 
  1308 
  1320 
  1309     TPoint posBelow( 0, 0 );
  1321     TPoint posBelow(0, 0);
  1310     TPoint posRight( 0, 0 );
  1322     TPoint posRight(0, 0);
  1311     posBelow = posRight = icf->Rect().iTl;
  1323     posBelow = posRight = icf->Rect().iTl;
  1312     icf->InlineTextPos( posBelow, posRight );
  1324     icf->InlineTextPos(posBelow, posRight);
  1313     TPoint tlPos = posRight;
  1325     TPoint tlPos = posRight;
  1314     iCandidateList->Display( TRect( tlPos, tlPos ), 
  1326     iCandidateList->Display(TRect(tlPos, tlPos), 
  1315                              CFepLayoutPopupWnd::EDispBottomRight );
  1327                             CFepLayoutPopupWnd::EDispBottomRight);
  1316     }
  1328     }
  1317 
  1329 
  1318 // --------------------------------------------------------------------------
  1330 // --------------------------------------------------------------------------
  1319 // Handle candidate list selected events.
  1331 // Handle candidate list selected events.
  1320 // --------------------------------------------------------------------------
  1332 // --------------------------------------------------------------------------
  1321 //
  1333 //
  1322 void CAknFepVkbWindow::HandleCandidateListSelectedOnFSQL
  1334 void CAknFepVkbWindow::HandleCandidateListSelectedOnFSQL
  1323                          ( CFepUiBaseCtrl* aCtrl, const TDesC& aEventData )
  1335                          ( CFepUiBaseCtrl* /*aCtrl*/, const TDesC& aEventData )
  1324     {
  1336     {
  1325     if ( UiLayout()->PenInputType() != EPluginInputModeFSQ )
  1337     if ( UiLayout()->PenInputType() != EPluginInputModeFSQ )
  1326         {
  1338         {
  1327         return;
  1339         return;
  1328         }
  1340         }
  1379 const TRgb CAknFepVkbWindow::CandidateListTextColorOnFSQ()
  1391 const TRgb CAknFepVkbWindow::CandidateListTextColorOnFSQ()
  1380     {
  1392     {
  1381     TRgb matchlistcolor = KRgbBlack;
  1393     TRgb matchlistcolor = KRgbBlack;
  1382     if ( UiLayout()->PenInputType() == EPluginInputModeFSQ )
  1394     if ( UiLayout()->PenInputType() == EPluginInputModeFSQ )
  1383         {
  1395         {
  1384         MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  1396         MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  1385         AknsUtils::GetCachedColor( skininstance, 
  1397         AknsUtils::GetCachedColor( skininstance, 
  1386                                     matchlistcolor, 
  1398                                     matchlistcolor, 
  1387                                     KAknsIIDQsnTextColors,
  1399                                     KAknsIIDQsnTextColors,
  1388                                     EAknsCIQsnTextColorsCG43 );
  1400                                     EAknsCIQsnTextColorsCG43 );
  1389         }
  1401         }
  1398 const TRgb CAknFepVkbWindow::AutoCompletionPartColorOnFSQ()
  1410 const TRgb CAknFepVkbWindow::AutoCompletionPartColorOnFSQ()
  1399     {
  1411     {
  1400     TRgb matchlistcolor = KRgbBlack;
  1412     TRgb matchlistcolor = KRgbBlack;
  1401     if ( UiLayout()->PenInputType() == EPluginInputModeFSQ )
  1413     if ( UiLayout()->PenInputType() == EPluginInputModeFSQ )
  1402         {
  1414         {
  1403         MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
  1415         MAknsSkinInstance* skininstance = UiLayout()->SkinInstance();
  1404         AknsUtils::GetCachedColor( skininstance, 
  1416         AknsUtils::GetCachedColor( skininstance, 
  1405                                     matchlistcolor, 
  1417                                     matchlistcolor, 
  1406                                     KAknsIIDQsnTextColors,
  1418                                     KAknsIIDQsnTextColors,
  1407                                     EAknsCIQsnTextColorsCG64 );
  1419                                     EAknsCIQsnTextColorsCG64 );
  1408         }
  1420         }