textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutbasecontrol.cpp
branchRCL_3
changeset 21 ecbabf52600f
parent 20 ebd48d2de13c
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
    57                         iAllowOverlap(EFalse),
    57                         iAllowOverlap(EFalse),
    58                         iUiLayout(aUiLayout),
    58                         iUiLayout(aUiLayout),
    59                         iOwnWndCtrl(ETrue),
    59                         iOwnWndCtrl(ETrue),
    60                         iOrdinalPos(EOrderNomal)
    60                         iOrdinalPos(EOrderNomal)
    61     {
    61     {
    62 #ifdef RD_TACTILE_FEEDBACK
    62     //todo code refactoring needed, move to BaseConstructL
    63     iReservered1 = reinterpret_cast<TInt>(new CFepUiBaseCtrlExtension(ETouchFeedbackNone));
    63     iExtension = new CFepUiBaseCtrlExtension();
    64 #endif // RD_TACTILE_FEEDBACK    
    64    
    65     iPenSize.SetSize(1,1);        
    65     iPenSize.SetSize(1,1);        
    66     iBorderSize.SetSize(KDefaultFrameWidth,KDefaultFrameWidth);
    66     iBorderSize.SetSize(KDefaultFrameWidth,KDefaultFrameWidth);
    67     iValidRegion.AddRect(iRect);
    67     iValidRegion.AddRect(iRect);
    68     iClipRegion.AddRect(iRect);
    68     iClipRegion.AddRect(iRect);
    69     }
    69     }
    92                     iIsActive(EFalse),
    92                     iIsActive(EFalse),
    93                     iAllowOverlap(EFalse),
    93                     iAllowOverlap(EFalse),
    94                     iUiLayout(aUiLayout),
    94                     iUiLayout(aUiLayout),
    95                     iOwnWndCtrl(aOwnership)
    95                     iOwnWndCtrl(aOwnership)
    96     {
    96     {
    97 #ifdef RD_TACTILE_FEEDBACK
    97     //todo code refactoring needed, move to BaseConstructL
    98     iReservered1 = reinterpret_cast<TInt>(new CFepUiBaseCtrlExtension(ETouchFeedbackNone));
    98     iExtension = new CFepUiBaseCtrlExtension();
    99 #endif // RD_TACTILE_FEEDBACK
    99     
   100     iRect = aControl->Rect();
   100     iRect = aControl->Rect();
   101     iControlId = aControl->UniqueHandle();
   101     iControlId = aControl->UniqueHandle();
   102     iValidRegion.AddRect(iRect);
   102     iValidRegion.AddRect(iRect);
   103     iClipRegion.AddRect(iRect);
   103     iClipRegion.AddRect(iRect);
   104     }
   104     }
   126     
   126     
   127 #ifdef RD_TACTILE_FEEDBACK     
   127 #ifdef RD_TACTILE_FEEDBACK     
   128     //de-register the area for tactile feedback
   128     //de-register the area for tactile feedback
   129     //if(aUiLayout) //there must be aUiLayout
   129     //if(aUiLayout) //there must be aUiLayout
   130     UiLayout()->DeRegisterFeedbackArea(reinterpret_cast<TInt>(this), Rect());   
   130     UiLayout()->DeRegisterFeedbackArea(reinterpret_cast<TInt>(this), Rect());   
   131 	delete reinterpret_cast<CFepUiBaseCtrlExtension*>(iReservered1);       
       
   132 #endif // RD_TACTILE_FEEDBACK 
   131 #endif // RD_TACTILE_FEEDBACK 
       
   132     
       
   133     delete iExtension; 
   133     }
   134     }
   134 
   135 
   135 // ---------------------------------------------------------------------------
   136 // ---------------------------------------------------------------------------
   136 // CFepUiBaseCtrl::BaseConstructL
   137 // CFepUiBaseCtrl::BaseConstructL
   137 // Handle UI event
   138 // Handle UI event
   182 // ---------------------------------------------------------------------------
   183 // ---------------------------------------------------------------------------
   183 //
   184 //
   184 EXPORT_C void CFepUiBaseCtrl::SetTactileFeedbackType(TInt aTactileType)
   185 EXPORT_C void CFepUiBaseCtrl::SetTactileFeedbackType(TInt aTactileType)
   185 	{
   186 	{
   186 #ifdef RD_TACTILE_FEEDBACK
   187 #ifdef RD_TACTILE_FEEDBACK
   187 	reinterpret_cast<CFepUiBaseCtrlExtension*>(iReservered1)->SetTactileFeedbackType(aTactileType);
   188     iExtension->SetTactileFeedbackType(aTactileType);
   188 #endif // RD_TACTILE_FEEDBACK 
   189 #endif // RD_TACTILE_FEEDBACK 
   189 	}
   190 	}
   190 
   191 
   191 
   192 
   192 // ---------------------------------------------------------------------------
   193 // ---------------------------------------------------------------------------
   319 // (other items were commented in a header).
   320 // (other items were commented in a header).
   320 // ---------------------------------------------------------------------------
   321 // ---------------------------------------------------------------------------
   321 //    	
   322 //    	
   322 EXPORT_C void CFepUiBaseCtrl::DrawMaskBackground(TBool aBmpStretchFlag)
   323 EXPORT_C void CFepUiBaseCtrl::DrawMaskBackground(TBool aBmpStretchFlag)
   323 	{
   324 	{
   324 	DrawBackgroundToDevice(iRect,MaskBitmapDevice(), iBkMaskBmp, iMaskBkCol,
   325 	DrawBackgroundToDevice(iRect,MaskBitmapDevice(), BkMaskBmp(), iMaskBkCol,
   325 	                       iBorderColor,aBmpStretchFlag);
   326 	                       iBorderColor,aBmpStretchFlag);
   326 	}
   327 	}
   327 
   328 
   328 // ---------------------------------------------------------------------------
   329 // ---------------------------------------------------------------------------
   329 // CFepUiBaseCtrl::DrawOpaqueMaskBackground
   330 // CFepUiBaseCtrl::DrawOpaqueMaskBackground
   332 // ---------------------------------------------------------------------------
   333 // ---------------------------------------------------------------------------
   333 //    		
   334 //    		
   334 EXPORT_C void CFepUiBaseCtrl::DrawOpaqueMaskBackground(TBool aBmpStretchFlag)
   335 EXPORT_C void CFepUiBaseCtrl::DrawOpaqueMaskBackground(TBool aBmpStretchFlag)
   335 	{
   336 	{
   336 	const TRgb KOpaqueMask = TRgb(KOpaqueColor);
   337 	const TRgb KOpaqueMask = TRgb(KOpaqueColor);
   337 	DrawBackgroundToDevice(iRect,MaskBitmapDevice(), iBkMaskBmp, KOpaqueMask,
   338 	DrawBackgroundToDevice(iRect,MaskBitmapDevice(), BkMaskBmp(), KOpaqueMask,
   338 	                       KOpaqueMask,aBmpStretchFlag);
   339 	                       KOpaqueMask,aBmpStretchFlag);
   339 	}
   340 	}
   340 
   341 
   341 // ---------------------------------------------------------------------------
   342 // ---------------------------------------------------------------------------
   342 // CFepUiBaseCtrl::DrawOpaqueMaskBackground
   343 // CFepUiBaseCtrl::DrawOpaqueMaskBackground
   345 // ---------------------------------------------------------------------------
   346 // ---------------------------------------------------------------------------
   346 //    		
   347 //    		
   347 EXPORT_C void CFepUiBaseCtrl::DrawOpaqueMaskBackground(const TRect aRect, TBool aBmpStretchFlag)
   348 EXPORT_C void CFepUiBaseCtrl::DrawOpaqueMaskBackground(const TRect aRect, TBool aBmpStretchFlag)
   348 	{
   349 	{
   349 	const TRgb KOpaqueMask = TRgb(KOpaqueColor);
   350 	const TRgb KOpaqueMask = TRgb(KOpaqueColor);
   350 	DrawBackgroundToDevice(aRect, MaskBitmapDevice(), iBkMaskBmp,
   351 	DrawBackgroundToDevice(aRect, MaskBitmapDevice(), BkMaskBmp(),
   351 	                       KOpaqueMask, KOpaqueMask, aBmpStretchFlag);
   352 	                       KOpaqueMask, KOpaqueMask, aBmpStretchFlag);
   352 	}
   353 	}
   353 
   354 
   354 // ---------------------------------------------------------------------------
   355 // ---------------------------------------------------------------------------
   355 // CFepUiBaseCtrl::DrawTransparentMaskBackground
   356 // CFepUiBaseCtrl::DrawTransparentMaskBackground
   359 //    		
   360 //    		
   360 EXPORT_C void CFepUiBaseCtrl::DrawTransparentMaskBackground(const TRect& aRect,
   361 EXPORT_C void CFepUiBaseCtrl::DrawTransparentMaskBackground(const TRect& aRect,
   361                                                             TBool aBmpStretchFlag)
   362                                                             TBool aBmpStretchFlag)
   362 	{
   363 	{
   363 	const TRgb KOpaqueMask = TRgb(KTransparentColor);
   364 	const TRgb KOpaqueMask = TRgb(KTransparentColor);
   364 	DrawBackgroundToDevice(aRect, MaskBitmapDevice(), iBkMaskBmp, KTransparentColor,
   365 	DrawBackgroundToDevice(aRect, MaskBitmapDevice(), BkMaskBmp(), KTransparentColor,
   365 	                       KTransparentColor, aBmpStretchFlag);
   366 	                       KTransparentColor, aBmpStretchFlag);
   366 	}
   367 	}
   367 	
   368 	
   368 // ---------------------------------------------------------------------------
   369 // ---------------------------------------------------------------------------
   369 // CFepUiBaseCtrl::ClearRect
   370 // CFepUiBaseCtrl::ClearRect
   533 // (other items were commented in a header).
   534 // (other items were commented in a header).
   534 // ---------------------------------------------------------------------------
   535 // ---------------------------------------------------------------------------
   535 //           
   536 //           
   536 EXPORT_C TBool CFepUiBaseCtrl::Contains(const TPoint& aPt)
   537 EXPORT_C TBool CFepUiBaseCtrl::Contains(const TPoint& aPt)
   537     {
   538     {
       
   539     if( iExtension->iExtResponseAreaActive )
       
   540         {
       
   541         return iExtension->iExtResponseArea.Contains( aPt );
       
   542         }
       
   543    
   538     return iRect.Contains(aPt);
   544     return iRect.Contains(aPt);
   539     //return iValidRegion.Contains(aPt);
   545     //return iValidRegion.Contains(aPt);
   540     }
   546     }
   541 
   547 
   542 // ---------------------------------------------------------------------------
   548 // ---------------------------------------------------------------------------
   690     {
   696     {
   691     return IsOnTopOf(aCtrl);
   697     return IsOnTopOf(aCtrl);
   692     }
   698     }
   693 
   699 
   694 TBool CFepUiBaseCtrl::IsOnTopOf(CFepUiBaseCtrl* aCtrl)
   700 TBool CFepUiBaseCtrl::IsOnTopOf(CFepUiBaseCtrl* aCtrl)
   695     {
   701     {     
   696     __ASSERT_DEBUG(aCtrl,EUiNullParam);
   702     ASSERT(aCtrl);      
   697     
       
   698     return OrderPos() < aCtrl->OrderPos();
   703     return OrderPos() < aCtrl->OrderPos();
   699     }
   704     }
   700     
   705     
   701     
   706     
   702 TBool CFepUiBaseCtrl::Overlapped(CFepUiBaseCtrl* aCtrl)
   707 TBool CFepUiBaseCtrl::Overlapped(CFepUiBaseCtrl* aCtrl)
   765 // (other items were commented in a header).
   770 // (other items were commented in a header).
   766 // ---------------------------------------------------------------------------
   771 // ---------------------------------------------------------------------------
   767 //      
   772 //      
   768 EXPORT_C CFepUiBaseCtrl* CFepUiBaseCtrl::HandlePointerDownEventL(const TPoint& aPoint)
   773 EXPORT_C CFepUiBaseCtrl* CFepUiBaseCtrl::HandlePointerDownEventL(const TPoint& aPoint)
   769     {
   774     {
       
   775     if ( iExtension->iExtResponseAreaEnabled ) 
       
   776         {
       
   777         ActiveExtResponseArea();
       
   778         }
       
   779     
   770     iPointerDown = ETrue;
   780     iPointerDown = ETrue;
   771     if(iWndControl)
   781     if(iWndControl)
   772         {
   782         {
   773         TPointerEvent event;
   783         TPointerEvent event;
   774         event.iType = TPointerEvent::EButton1Down;
   784         event.iType = TPointerEvent::EButton1Down;
   789 // ---------------------------------------------------------------------------
   799 // ---------------------------------------------------------------------------
   790 //    
   800 //    
   791 EXPORT_C CFepUiBaseCtrl* CFepUiBaseCtrl::HandlePointerUpEventL(
   801 EXPORT_C CFepUiBaseCtrl* CFepUiBaseCtrl::HandlePointerUpEventL(
   792                                                          const TPoint& aPoint)
   802                                                          const TPoint& aPoint)
   793     {
   803     {
       
   804     if ( iExtension->iExtResponseAreaActive )
       
   805         {
       
   806         CancelExtResponseArea();
       
   807         }
       
   808     
   794     iPointerDown = EFalse;
   809     iPointerDown = EFalse;
   795     if(iWndControl)
   810     if(iWndControl)
   796         {
   811         {
   797         TPointerEvent event;
   812         TPointerEvent event;
   798         event.iType = TPointerEvent::EButton1Up;
   813         event.iType = TPointerEvent::EButton1Up;
   843 // (other items were commented in a header).
   858 // (other items were commented in a header).
   844 // ---------------------------------------------------------------------------
   859 // ---------------------------------------------------------------------------
   845 //    
   860 //    
   846 EXPORT_C void CFepUiBaseCtrl::CancelPointerDownL()
   861 EXPORT_C void CFepUiBaseCtrl::CancelPointerDownL()
   847     {
   862     {
       
   863     if ( iExtension->iExtResponseAreaActive )
       
   864         {
       
   865         CancelExtResponseArea();
       
   866         }
       
   867     
   848     if (PointerDown())
   868     if (PointerDown())
   849         {
   869         {
   850         iPointerDown = EFalse;
   870         iPointerDown = EFalse;
   851         iPointerLeft = EFalse;
   871         iPointerLeft = EFalse;
   852         //HandlePointerLeave(TPoint(0, 0));
   872         //HandlePointerLeave(TPoint(0, 0));
   986 // Handle pointer leave event
  1006 // Handle pointer leave event
   987 // ---------------------------------------------------------------------------
  1007 // ---------------------------------------------------------------------------
   988 //           
  1008 //           
   989 EXPORT_C void CFepUiBaseCtrl::HandlePointerLeave(const TPoint& /*aPt*/)
  1009 EXPORT_C void CFepUiBaseCtrl::HandlePointerLeave(const TPoint& /*aPt*/)
   990     {
  1010     {
       
  1011     if ( iExtension->iExtResponseAreaActive )
       
  1012         {
       
  1013         CancelExtResponseArea();
       
  1014         }
       
  1015     
   991     iPointerDown = EFalse;
  1016     iPointerDown = EFalse;
   992     iPointerLeft = ETrue;
  1017     iPointerLeft = ETrue;
   993     //report event
  1018     //report event
   994     ReportEvent(EEventPointerLeftControl);
  1019     ReportEvent(EEventPointerLeftControl);
   995     Draw();
  1020     Draw();
  1000 // Handle pointer enter event
  1025 // Handle pointer enter event
  1001 // ---------------------------------------------------------------------------
  1026 // ---------------------------------------------------------------------------
  1002 //           
  1027 //           
  1003 EXPORT_C void CFepUiBaseCtrl::HandlePointerEnter(const TPoint& aPt)
  1028 EXPORT_C void CFepUiBaseCtrl::HandlePointerEnter(const TPoint& aPt)
  1004     {
  1029     {
       
  1030     if ( iExtension->iExtResponseAreaEnabled ) 
       
  1031         {
       
  1032         ActiveExtResponseArea();
       
  1033         }
       
  1034     
  1005     iPointerDown = ETrue;
  1035     iPointerDown = ETrue;
  1006     iPointerLeft = EFalse;
  1036     iPointerLeft = EFalse;
  1007     TRAP_IGNORE(HandlePointerMoveEventL(aPt));
  1037     TRAP_IGNORE(HandlePointerMoveEventL(aPt));
  1008     //report event
  1038     //report event
  1009     ReportEvent(EEventPointerEnterControl);
  1039     ReportEvent(EEventPointerEnterControl);
  1226     iShadowBmp[aIndex+KShadowBitmapTotalNum] = aMaskBmp;
  1256     iShadowBmp[aIndex+KShadowBitmapTotalNum] = aMaskBmp;
  1227     }
  1257     }
  1228 
  1258 
  1229 EXPORT_C TBool CFepUiBaseCtrl::AbleToDraw()
  1259 EXPORT_C TBool CFepUiBaseCtrl::AbleToDraw()
  1230 	{
  1260 	{
  1231     return UiLayout()->LayoutReady() && Ready() && !WholeHiden() && Rect().Size() != TSize(0,0);
  1261     return UiLayout()->LayoutReady() && Ready()  
       
  1262             && (!UiLayout()->iExtension->iDisableDrawing)
       
  1263                     && !WholeHiden() && Rect().Size() != TSize(0,0);
  1232 	}
  1264 	}
  1233 
  1265 
  1234 // ---------------------------------------------------------------------------
  1266 // ---------------------------------------------------------------------------
  1235 // Get extension
  1267 // Get extension
  1236 // ---------------------------------------------------------------------------
  1268 // ---------------------------------------------------------------------------
  1237 //    
  1269 //    
  1238 EXPORT_C TInt CFepUiBaseCtrl::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
  1270 EXPORT_C TInt CFepUiBaseCtrl::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
  1239     {
  1271     {    
  1240     //not implemented, use CBase's
  1272     if( KFepCtrlExtId == aExtensionId)
       
  1273         {
       
  1274         a0 = iExtension;
       
  1275         return KErrNone;
       
  1276         }
  1241     return CBase::Extension_(aExtensionId, a0, a1);
  1277     return CBase::Extension_(aExtensionId, a0, a1);
  1242     }
  1278     }
  1243     
  1279     
  1244 // ---------------------------------------------------------------------------
  1280 // ---------------------------------------------------------------------------
  1245 // CFepUiBaseCtrl::WholeHiden
  1281 // CFepUiBaseCtrl::WholeHiden
  1317     }
  1353     }
  1318 
  1354 
  1319 
  1355 
  1320 EXPORT_C void CFepUiBaseCtrl::SetParent(CFepUiBaseCtrl* aParent)
  1356 EXPORT_C void CFepUiBaseCtrl::SetParent(CFepUiBaseCtrl* aParent)
  1321     {
  1357     {
  1322     //parent control must be type of control group.
  1358     //ASSERT(aParent == NULL || aParent->IsKindOfControl(ECtrlControlGroup));
  1323     if(aParent)
       
  1324         {
       
  1325         __ASSERT_DEBUG(aParent->IsKindOfControl(ECtrlControlGroup),EUiLayoutBadParentType);
       
  1326         }
       
  1327     iParentCtrl = aParent;
  1359     iParentCtrl = aParent;
  1328     }
  1360     }
  1329 
  1361 
  1330 EXPORT_C void CFepUiBaseCtrl::SetOrdinalPos(TInt aPos)
  1362 EXPORT_C void CFepUiBaseCtrl::SetOrdinalPos(TInt aPos)
  1331     {
  1363     {
  1338     if(ParentCtrl())
  1370     if(ParentCtrl())
  1339         order += ParentCtrl()->AbsOrderPos();
  1371         order += ParentCtrl()->AbsOrderPos();
  1340     return order;    
  1372     return order;    
  1341     }
  1373     }
  1342 
  1374 
  1343 
  1375 void CFepUiBaseCtrl::CreateOwnDeviceL(CFbsBitmap* aBmp, CFbsBitmap* aMaskBmp)
       
  1376     {
       
  1377     if(iExtension->iBitmap)
       
  1378         return;
       
  1379     User::LeaveIfError( aBmp->Create( Rect().Size(), iLayoutOwner->BitmapDevice()->DisplayMode() ) );
       
  1380     
       
  1381     iExtension->iBitmap = aBmp;
       
  1382     CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(aBmp);
       
  1383     
       
  1384     iExtension->SetBmpDevice(dev); 
       
  1385 
       
  1386     CFbsBitGc* gc = CFbsBitGc::NewL();
       
  1387     gc->Reset();
       
  1388     iExtension->SetGc(gc);
       
  1389     
       
  1390     if(iExtension->iMaskBitmap || !aMaskBmp)
       
  1391         return;
       
  1392     
       
  1393     User::LeaveIfError( aMaskBmp->Create( Rect().Size(), iLayoutOwner->MaskBmpDevice()->DisplayMode() ) );
       
  1394     
       
  1395     iExtension->iMaskBitmap = aMaskBmp;
       
  1396     dev = CFbsBitmapDevice::NewL(aMaskBmp);
       
  1397     
       
  1398     iExtension->SetMaskBmpDevice(dev); 
       
  1399         
       
  1400     }
       
  1401     
       
  1402 void CFepUiBaseCtrl::ResizeDeviceL()
       
  1403     {
       
  1404     if(iExtension->BitmapDevice())
       
  1405         iExtension->BitmapDevice()->Resize( Rect().Size());
       
  1406     //gc must be adjusted
       
  1407     if(iExtension->Gc())
       
  1408         {
       
  1409         iExtension->Gc()->Activate(iExtension->BitmapDevice());
       
  1410         iExtension->Gc()->Resized();
       
  1411         }
       
  1412     }
       
  1413     
       
  1414 // ---------------------------------------------------------------------------
       
  1415 // get graphics context for sprite or window
       
  1416 // ---------------------------------------------------------------------------
       
  1417 //   
       
  1418 EXPORT_C CBitmapContext* CFepUiBaseCtrl::BitGc()
       
  1419     {
       
  1420 
       
  1421 
       
  1422     if(iUiLayout->NotDrawToLayoutDevice() && iExtension->Gc())
       
  1423         return iExtension->Gc();
       
  1424     else
       
  1425 	    return iLayoutOwner->BitmapContext();
       
  1426     }
       
  1427 
       
  1428 // ---------------------------------------------------------------------------
       
  1429 // get Bitmap device for sprite or window
       
  1430 // ---------------------------------------------------------------------------
       
  1431 //
       
  1432 EXPORT_C CFbsBitmapDevice* CFepUiBaseCtrl::BitmapDevice()
       
  1433     {
       
  1434 
       
  1435 
       
  1436     if(iUiLayout->NotDrawToLayoutDevice() && iExtension->BitmapDevice())
       
  1437         return iExtension->BitmapDevice();
       
  1438     else   
       
  1439         return iLayoutOwner->BitmapDevice();
       
  1440     }
       
  1441 
       
  1442 // ---------------------------------------------------------------------------
       
  1443 // get Mask bitmap device for sprite or window
       
  1444 // ---------------------------------------------------------------------------
       
  1445 //
       
  1446 EXPORT_C CFbsBitmapDevice* CFepUiBaseCtrl::MaskBitmapDevice()
       
  1447     {
       
  1448 
       
  1449     if(iUiLayout->NotDrawToLayoutDevice() && iExtension->MaskBitmapDevice())
       
  1450         return iExtension->MaskBitmapDevice();
       
  1451     else    
       
  1452 
       
  1453         return iLayoutOwner->MaskBmpDevice();
       
  1454     }
       
  1455 
       
  1456 // ---------------------------------------------------------------------------
       
  1457 // get control background maks bmp
       
  1458 // ---------------------------------------------------------------------------
       
  1459 //
       
  1460 EXPORT_C  CFbsBitmap* CFepUiBaseCtrl::BkMaskBmp()
       
  1461     {
       
  1462     if(iUiLayout->NotDrawToLayoutDevice() && iExtension->MaskBitmap())
       
  1463         return iExtension->MaskBitmap();
       
  1464     else 
       
  1465         return iBkMaskBmp;
       
  1466     }
       
  1467 
       
  1468 
       
  1469 // ---------------------------------------------------------------------------
       
  1470 // CFepUiBaseCtrl::EnableExtResponseArea
       
  1471 // Enable/disable extra response area support
       
  1472 // ---------------------------------------------------------------------------
       
  1473 //  
       
  1474 EXPORT_C void CFepUiBaseCtrl::EnableExtResponseArea( TBool aEnable, 
       
  1475                                                      const TRect& aExtMargin )
       
  1476     {
       
  1477     iExtension->iExtResponseAreaEnabled = aEnable;
       
  1478     iExtension->iExtResponseAreaMargin = aExtMargin;
       
  1479     }
       
  1480 
       
  1481 // ---------------------------------------------------------------------------
       
  1482 // CFepUiBaseCtrl::EnableExtResponseArea
       
  1483 // Active extra response area
       
  1484 // ---------------------------------------------------------------------------
       
  1485 //  
       
  1486 EXPORT_C void CFepUiBaseCtrl::ActiveExtResponseArea()
       
  1487     {
       
  1488     if ( iExtension->iExtResponseAreaEnabled )
       
  1489         {
       
  1490         TRect response = Rect();
       
  1491         response.iTl -= iExtension->iExtResponseAreaMargin.iTl;
       
  1492         response.iBr += iExtension->iExtResponseAreaMargin.Size();
       
  1493         
       
  1494         UpdateExtResponseArea( response );
       
  1495         }    
       
  1496     }
       
  1497 
       
  1498 // ---------------------------------------------------------------------------
       
  1499 // CFepUiBaseCtrl::EnableExtResponseArea
       
  1500 // Cancel extra response area
       
  1501 // ---------------------------------------------------------------------------
       
  1502 //  
       
  1503 EXPORT_C void CFepUiBaseCtrl::CancelExtResponseArea()
       
  1504     {
       
  1505     iExtension->iExtResponseAreaActive = EFalse;
       
  1506     
       
  1507     CFepUiBaseCtrl* parent = ParentCtrl();
       
  1508     if( parent && parent->IsKindOfControl(ECtrlControlGroup) )
       
  1509         {
       
  1510         parent->CancelExtResponseArea();
       
  1511         }    
       
  1512     }
       
  1513 
       
  1514 // ---------------------------------------------------------------------------
       
  1515 // CFepUiBaseCtrl::EnableExtResponseArea
       
  1516 // Update extra response area
       
  1517 // ---------------------------------------------------------------------------
       
  1518 //
       
  1519 void CFepUiBaseCtrl::UpdateExtResponseArea( const TRect& aRect )
       
  1520     {
       
  1521     if ( aRect.iTl.iX < Rect().iTl.iX || aRect.iTl.iY < Rect().iTl.iY ||
       
  1522          aRect.iBr.iX > Rect().iBr.iX || aRect.iBr.iY > Rect().iBr.iY )
       
  1523         {
       
  1524         iExtension->iExtResponseAreaActive = ETrue;
       
  1525         iExtension->iExtResponseArea = Rect();
       
  1526         iExtension->iExtResponseArea.BoundingRect( aRect );
       
  1527 
       
  1528         //update parent
       
  1529         CFepUiBaseCtrl* parent = ParentCtrl();
       
  1530         if ( parent && parent->IsKindOfControl( ECtrlControlGroup ) )
       
  1531             {
       
  1532             parent->UpdateExtResponseArea( iExtension->iExtResponseArea );
       
  1533             }
       
  1534         }
       
  1535     }
  1344 
  1536 
  1345 // ---------------------------------------------------------------------------
  1537 // ---------------------------------------------------------------------------
  1346 // CFepUiBaseCtrl::CFepUiBaseCtrlExtension
  1538 // CFepUiBaseCtrl::CFepUiBaseCtrlExtension
  1347 // 
  1539 // 
  1348 // ---------------------------------------------------------------------------
  1540 // ---------------------------------------------------------------------------
  1349 //
  1541 //
  1350 
  1542 
  1351 CFepUiBaseCtrl::CFepUiBaseCtrlExtension::CFepUiBaseCtrlExtension(TInt aTactileType)
  1543 CFepUiBaseCtrl::CFepUiBaseCtrlExtension::CFepUiBaseCtrlExtension()
  1352 	{
  1544 	{
  1353 #ifdef RD_TACTILE_FEEDBACK
  1545 #ifdef RD_TACTILE_FEEDBACK
  1354 	iTactileType = aTactileType;
  1546 	iTactileType = ETouchFeedbackNone;
  1355 #endif // RD_TACTILE_FEEDBACK 
  1547 #endif // RD_TACTILE_FEEDBACK 
       
  1548 	
       
  1549 	//temp code, can be removed after refactoring of CFepUiBaseCtrl::iExtension
       
  1550     iExtResponseAreaActive = EFalse;
       
  1551     iExtResponseArea.SetRect( TPoint(0,0), TSize(0,0) );
       
  1552     iExtResponseAreaEnabled = EFalse;
       
  1553     iExtResponseAreaMargin.SetRect( TPoint(0,0), TSize(0,0) );
  1356 	}
  1554 	}
  1357 
  1555 
       
  1556 CFepUiBaseCtrl::CFepUiBaseCtrlExtension::~CFepUiBaseCtrlExtension()
       
  1557     {
       
  1558     //delete iBitmap;
       
  1559     delete iGc;
       
  1560     delete  iBitmapDevice;
       
  1561     delete iMaskBitmapDevice;
       
  1562     }
       
  1563 	
  1358 void CFepUiBaseCtrl::CFepUiBaseCtrlExtension::SetTactileFeedbackType(TInt aTactileType)
  1564 void CFepUiBaseCtrl::CFepUiBaseCtrlExtension::SetTactileFeedbackType(TInt aTactileType)
  1359 	{
  1565 	{
  1360 #ifdef RD_TACTILE_FEEDBACK
  1566 #ifdef RD_TACTILE_FEEDBACK
  1361 	iTactileType = aTactileType;
  1567 	iTactileType = aTactileType;
  1362 #endif // RD_TACTILE_FEEDBACK 
  1568 #endif // RD_TACTILE_FEEDBACK