textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutbutton.cpp
branchRCL_3
changeset 21 ecbabf52600f
parent 20 ebd48d2de13c
child 22 bd83ceabce89
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
    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>
    18 #include <AknFepGlobalEnums.h>
    19 #include <AknFepGlobalEnums.h>
    19 #include "peninputlayoutbutton.h"
    20 #include "peninputlayoutbutton.h"
    20 #include "peninputlayouttimer.h"
    21 #include "peninputlayouttimer.h"
    21 #include "peninputlayout.h"
    22 #include "peninputlayout.h"
    22 
    23 
    45     CleanupStack::PushL(btn);
    46     CleanupStack::PushL(btn);
    46     btn->BaseConstructL();
    47     btn->BaseConstructL();
    47     CleanupStack::Pop(btn);
    48     CleanupStack::Pop(btn);
    48     return btn;    
    49     return btn;    
    49     }
    50     }
    50     
    51 
       
    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 
    51 // ---------------------------------------------------------------------------
    68 // ---------------------------------------------------------------------------
    52 // CButtonBase::CButtonBase
    69 // CButtonBase::CButtonBase
    53 // C++ default constructor
    70 // C++ default constructor
    54 // (other items were commented in a header).
    71 // (other items were commented in a header).
    55 // ---------------------------------------------------------------------------
    72 // ---------------------------------------------------------------------------
    71     const TRgb KDefaultButtonBackCol = TRgb(230,230,230);
    88     const TRgb KDefaultButtonBackCol = TRgb(230,230,230);
    72 #endif
    89 #endif
    73     
    90     
    74     SetBkColor(KDefaultButtonBackCol);
    91     SetBkColor(KDefaultButtonBackCol);
    75 
    92 
       
    93     //todo code refactoring needed, move to BaseConstructL
    76 #ifdef RD_TACTILE_FEEDBACK     
    94 #ifdef RD_TACTILE_FEEDBACK     
    77     //Advanced Tactile feedback REQ417-47932
    95     //Advanced Tactile feedback REQ417-47932
    78     if(aUiLayout)
    96     if(aUiLayout)
    79     	{
    97     	{
    80     	if (aUiLayout->PenInputType() == EPluginInputModeFSQ||
    98     	if (aUiLayout->PenInputType() == EPluginInputModeFSQ||
    83     		SetTactileFeedbackType(ETouchFeedbackBasicButton);
   101     		SetTactileFeedbackType(ETouchFeedbackBasicButton);
    84     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackBasicButton);
   102     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackBasicButton);
    85     		}
   103     		}
    86     	else
   104     	else
    87     		{
   105     		{
    88     		SetTactileFeedbackType(ETouchFeedbackSensitiveKeypad);
   106     		SetTactileFeedbackType(ETouchFeedbackSensitiveInput);
    89     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackSensitiveKeypad);
   107     		aUiLayout->RegisterFeedbackArea(reinterpret_cast<TInt>(this),aRect,ETouchFeedbackSensitiveInput);
    90     		}
   108     		}
    91     	}       
   109     	}       
    92 #endif //RD_TACTILE_FEEDBACK     
   110 #endif //RD_TACTILE_FEEDBACK     
    93     }
   111     }
    94 
   112 
   338 // (other items were commented in a header).
   356 // (other items were commented in a header).
   339 // ---------------------------------------------------------------------------
   357 // ---------------------------------------------------------------------------
   340 //
   358 //
   341 EXPORT_C void CButtonBase::SetDimmed(TBool aDimFlag)
   359 EXPORT_C void CButtonBase::SetDimmed(TBool aDimFlag)
   342     {
   360     {
       
   361     if(iDimmed == aDimFlag)
       
   362         return;
   343     //Remove its active flag if dim an active button.
   363     //Remove its active flag if dim an active button.
   344     if(aDimFlag && IsActive())
   364     if(aDimFlag && IsActive())
   345         SetActive(EFalse);
   365         SetActive(EFalse);
   346     iDimmed = aDimFlag;
   366     iDimmed = aDimFlag;
   347     if(iDimmed)
   367     if(iDimmed)