textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutvkbkeyctrl.cpp
branchRCL_3
changeset 56 8152b1f1763a
parent 50 5a1685599b76
equal deleted inserted replaced
50:5a1685599b76 56:8152b1f1763a
   104 void CVirtualKeyCtrl::ConstructL()
   104 void CVirtualKeyCtrl::ConstructL()
   105     {
   105     {
   106     BaseConstructL();
   106     BaseConstructL();
   107     
   107     
   108     //tap accuracy enhancement
   108     //tap accuracy enhancement
   109     if ( FeatureManager::FeatureSupported( KFeatureIdFfCapacitiveDisplay ))
   109     if( FeatureManager::FeatureSupported( KFeatureIdFfCapacitiveDisplay ))
   110         {
   110         {
   111         TMargins margins;
   111         TMargins margins;
   112         UiLayout()->GetKeyExtResponseArea( margins );
   112         UiLayout()->GetKeyExtResponseArea( margins );
   113         TPoint topLeftMargin( margins.iLeft, margins.iTop );
   113         TPoint topLeftMargin( margins.iLeft, margins.iTop );
   114         TSize bottomRightMargin( margins.iRight, margins.iBottom );
   114         TSize bottomRightMargin( margins.iRight, margins.iBottom );
   149 			    
   149 			    
   150 			    // replace the shift text to shift icon			        
   150 			    // replace the shift text to shift icon			        
   151 				if( iKeyboard->ShiftIcon() &&
   151 				if( iKeyboard->ShiftIcon() &&
   152 					iKeyInfo->KeyUnicodes(TVirtualKeyTextPos(i)) == KKeyShiftCharacter )
   152 					iKeyInfo->KeyUnicodes(TVirtualKeyTextPos(i)) == KKeyShiftCharacter )
   153 					{
   153 					{
   154 				    // Get the rect of the shift icon
   154 					//CFbsBitGc* gc = GetGc();//static_cast<CFbsBitGc*>(BitGc());
   155 					TRect shiftIconDrawRect = iKeyboard->ShiftIconRect();
       
   156 					shiftIconDrawRect.Move( iKeyboard->Rect().iTl );
       
   157 					AknPenInputDrawUtils::DrawColorIcon( iKeyboard->ShiftIcon(),
   155 					AknPenInputDrawUtils::DrawColorIcon( iKeyboard->ShiftIcon(),
   158 														 *aGc,
   156 														 *aGc,
   159 														 shiftIconDrawRect );	
   157 														 textLayout.TextRect() );	
   160 					}
   158 					}
   161 				else if(iKeyboard->StarIcon() &&
   159 				else if(iKeyboard->StarIcon() &&
   162 						iKeyInfo->KeyUnicodes(TVirtualKeyTextPos(i)) == KKeyStarCharacter )
   160 						iKeyInfo->KeyUnicodes(TVirtualKeyTextPos(i)) == KKeyStarCharacter )
   163 					{
   161 					{
   164 					// Get the size of the icon
   162 					// Get the size of the icon
   165 					TSize starIconSize = iKeyboard->StarIcon()->Bitmap()->SizeInPixels();
   163 					TSize starIconSize = iKeyboard->StarIcon()->Bitmap()->SizeInPixels();
   166 					// Get the rect of draw icon area
   164 					// Get the rect of draw icon area
   167 					TRect drawIconRect = iKeyboard->StarIconRect();
   165 					TRect drawIconRect = textLayout.TextRect();
   168 					drawIconRect.Move( iKeyboard->Rect().iTl );
       
   169 					
       
   170 					// When the size of icon is different with the size of draw icon area,
   166 					// When the size of icon is different with the size of draw icon area,
   171 					// because the icon is drew from the left top coordinate of the draw
   167 					// because the icon is drew from the left top coordinate of the draw
   172 					// icon area, so the icon will not be drew in the center. In this case,
   168 					// icon area, so the icon will not be drew in the center. In this case,
   173 					// we need to adjust the top left coordinate of draw icon rect to 
   169 					// we need to adjust the top left coordinate of draw icon rect to 
   174 					// make sure that the icon will be drew in the center of the key
   170 					// make sure that the icon will be drew in the center of the key
  1120 	
  1116 	
  1121 void CVirtualKeyCtrl::UpdateChangedArea(TBool aFlag)
  1117 void CVirtualKeyCtrl::UpdateChangedArea(TBool aFlag)
  1122     {
  1118     {
  1123     struct SData
  1119     struct SData
  1124         {
  1120         {
  1125     	TUint32 ctrl;
       
  1126         TBool flag;
  1121         TBool flag;
  1127         CFbsBitmap* bmp;
  1122         CFbsBitmap* bmp;
  1128         TRect pos;
  1123         TRect pos;
  1129         } data;
  1124         } data;
  1130         
       
  1131     data.ctrl = (TUint32)this;
       
  1132     data.flag = aFlag;
  1125     data.flag = aFlag;
  1133     data.bmp = Keyboard()->Bitmap();//aFlag ? Keyboard()->iBitmap : 0;
  1126     data.bmp = Keyboard()->Bitmap();//aFlag ? Keyboard()->iBitmap : 0;
  1134     data.pos = Rect();
  1127     data.pos = Rect();
  1135     TPtrC ptr;
  1128     TPtrC ptr;
  1136     ptr.Set(reinterpret_cast<const TUint16*>(&data),sizeof(data)/sizeof(TUint16));
  1129     ptr.Set(reinterpret_cast<const TUint16*>(&data),sizeof(data)/sizeof(TUint16));