textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutbutton.cpp
branchRCL_3
changeset 20 ebd48d2de13c
parent 12 5e18d8c489d6
child 21 ecbabf52600f
equal deleted inserted replaced
19:ac7e4d1d9209 20:ebd48d2de13c
    13 *
    13 *
    14 * Description:  Implementation for button base and dragbar
    14 * Description:  Implementation for button base and dragbar
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <featmgr.h>
       
    19 #include <AknFepGlobalEnums.h>
    18 #include <AknFepGlobalEnums.h>
    20 #include "peninputlayoutbutton.h"
    19 #include "peninputlayoutbutton.h"
    21 #include "peninputlayouttimer.h"
    20 #include "peninputlayouttimer.h"
    22 #include "peninputlayout.h"
    21 #include "peninputlayout.h"
    23 
    22 
    46     CleanupStack::PushL(btn);
    45     CleanupStack::PushL(btn);
    47     btn->BaseConstructL();
    46     btn->BaseConstructL();
    48     CleanupStack::Pop(btn);
    47     CleanupStack::Pop(btn);
    49     return btn;    
    48     return btn;    
    50     }
    49     }
    51 
    50     
    52 // ---------------------------------------------------------------------------
       
    53 // CButtonBase::BaseConstructL
       
    54 // Do base contruction
       
    55 // ---------------------------------------------------------------------------
       
    56 //
       
    57 EXPORT_C void CButtonBase::BaseConstructL()
       
    58     {
       
    59     CFepUiBaseCtrl::BaseConstructL();
       
    60     
       
    61     //tap accuracy enhancement
       
    62     if( FeatureManager::FeatureSupported( KFeatureIdFfCapacitiveDisplay ))
       
    63         {
       
    64         EnableExtResponseArea( ETrue, TRect(TPoint(10,10),TSize(10,10)) );
       
    65         }
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    69 // CButtonBase::CButtonBase
    52 // CButtonBase::CButtonBase
    70 // C++ default constructor
    53 // C++ default constructor
    71 // (other items were commented in a header).
    54 // (other items were commented in a header).
    72 // ---------------------------------------------------------------------------
    55 // ---------------------------------------------------------------------------
    88     const TRgb KDefaultButtonBackCol = TRgb(230,230,230);
    71     const TRgb KDefaultButtonBackCol = TRgb(230,230,230);
    89 #endif
    72 #endif
    90     
    73     
    91     SetBkColor(KDefaultButtonBackCol);
    74     SetBkColor(KDefaultButtonBackCol);
    92 
    75 
    93     //todo code refactoring needed, move to BaseConstructL
       
    94 #ifdef RD_TACTILE_FEEDBACK     
    76 #ifdef RD_TACTILE_FEEDBACK     
    95     //Advanced Tactile feedback REQ417-47932
    77     //Advanced Tactile feedback REQ417-47932
    96     if(aUiLayout)
    78     if(aUiLayout)
    97     	{
    79     	{
    98     	if (aUiLayout->PenInputType() == EPluginInputModeFSQ||
    80     	if (aUiLayout->PenInputType() == EPluginInputModeFSQ||
   101     		SetTactileFeedbackType(ETouchFeedbackBasicButton);
    83     		SetTactileFeedbackType(ETouchFeedbackBasicButton);
   102     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackBasicButton);
    84     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackBasicButton);
   103     		}
    85     		}
   104     	else
    86     	else
   105     		{
    87     		{
   106     		SetTactileFeedbackType(ETouchFeedbackSensitiveInput);
    88     		SetTactileFeedbackType(ETouchFeedbackSensitiveKeypad);
   107     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackSensitiveInput);
    89     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackSensitiveKeypad);
   108     		}
    90     		}
   109     	}       
    91     	}       
   110 #endif //RD_TACTILE_FEEDBACK     
    92 #endif //RD_TACTILE_FEEDBACK     
   111     }
    93     }
   112 
    94 
   356 // (other items were commented in a header).
   338 // (other items were commented in a header).
   357 // ---------------------------------------------------------------------------
   339 // ---------------------------------------------------------------------------
   358 //
   340 //
   359 EXPORT_C void CButtonBase::SetDimmed(TBool aDimFlag)
   341 EXPORT_C void CButtonBase::SetDimmed(TBool aDimFlag)
   360     {
   342     {
   361     if(iDimmed == aDimFlag)
       
   362         return;
       
   363     //Remove its active flag if dim an active button.
   343     //Remove its active flag if dim an active button.
   364     if(aDimFlag && IsActive())
   344     if(aDimFlag && IsActive())
   365         SetActive(EFalse);
   345         SetActive(EFalse);
   366     iDimmed = aDimFlag;
   346     iDimmed = aDimFlag;
   367     if(iDimmed)
   347     if(iDimmed)