uiservicetab/vimpstui/src/cvimpstuiblockviewcontrol.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 10 78867dafe7eb
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    26 #include	<aknlists.h>
    26 #include	<aknlists.h>
    27 #include	<eikclbd.h> 
    27 #include	<eikclbd.h> 
    28 #include <vimpstuires.rsg>
    28 #include <vimpstuires.rsg>
    29 
    29 
    30 #include <MPbk2KeyEventHandler.h>
    30 #include <MPbk2KeyEventHandler.h>
       
    31 #include "uiservicetabtracer.h"
    31 
    32 
    32 
    33 
    33 // ================= MEMBER FUNCTIONS =======================
    34 // ================= MEMBER FUNCTIONS =======================
    34 
    35 
    35 
    36 
    53 // CVIMPSTUiBlockViewControl::ConstructL
    54 // CVIMPSTUiBlockViewControl::ConstructL
    54 // --------------------------------------------------------------------------
    55 // --------------------------------------------------------------------------
    55 //
    56 //
    56 void CVIMPSTUiBlockViewControl::ConstructL()
    57 void CVIMPSTUiBlockViewControl::ConstructL()
    57     {
    58     {
       
    59 	TRACER_AUTO;
    58     CreateWindowL();
    60     CreateWindowL();
    59     iItemArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity );   
    61     iItemArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity );   
    60     // Create listbox
    62     // Create listbox
    61     iListBox = new ( ELeave ) CAknSingleGraphicStyleListBox;
    63     iListBox = new ( ELeave ) CAknSingleGraphicStyleListBox;
    62     iListBox->ConstructL( this, EAknListBoxSelectionList );
    64     iListBox->ConstructL( this, EAknListBoxSelectionList );
   199 // CVIMPSTUiBlockViewControl::UpdateBlockedListL()
   201 // CVIMPSTUiBlockViewControl::UpdateBlockedListL()
   200 // ---------------------------------------------------------
   202 // ---------------------------------------------------------
   201 //
   203 //
   202 void CVIMPSTUiBlockViewControl::UpdateBlockedListL()
   204 void CVIMPSTUiBlockViewControl::UpdateBlockedListL()
   203     {
   205     {
       
   206 	TRACER_AUTO;
   204 	iItemArray->Reset();
   207 	iItemArray->Reset();
   205 	
   208 	
   206 	TInt granularity( iItemArray->Count() );
   209 	TInt granularity( iItemArray->Count() );
   207 	++granularity;
   210 	++granularity;
   208 	
   211 	
   267 // (other items were commented in a header).
   270 // (other items were commented in a header).
   268 // ---------------------------------------------------------
   271 // ---------------------------------------------------------
   269 //
   272 //
   270 HBufC* CVIMPSTUiBlockViewControl::GetFocusedContactLC() const
   273 HBufC* CVIMPSTUiBlockViewControl::GetFocusedContactLC() const
   271 	{
   274 	{
       
   275 	TRACER_AUTO;
   272 	HBufC* retText = NULL;
   276 	HBufC* retText = NULL;
   273 	TInt curIndex = iListBox->CurrentItemIndex();
   277 	TInt curIndex = iListBox->CurrentItemIndex();
   274 	if(KErrNotFound != curIndex)
   278 	if(KErrNotFound != curIndex)
   275 	    {
   279 	    {
   276 	    TPtrC ptr= iItemArray->MdcaPoint(curIndex);
   280 	    TPtrC ptr= iItemArray->MdcaPoint(curIndex);
   300 // (other items were commented in a header).
   304 // (other items were commented in a header).
   301 // ---------------------------------------------------------
   305 // ---------------------------------------------------------
   302 //
   306 //
   303 void CVIMPSTUiBlockViewControl::SetCurrentIndex(TInt aIndex)
   307 void CVIMPSTUiBlockViewControl::SetCurrentIndex(TInt aIndex)
   304 	{
   308 	{
       
   309 	TRACER_AUTO;
   305 	if(aIndex>0)
   310 	if(aIndex>0)
   306 		{
   311 		{
   307 	    TInt blockedCount = iListBox->Model()->NumberOfItems();
   312 	    TInt blockedCount = iListBox->Model()->NumberOfItems();
   308 		if(blockedCount > 0)
   313 		if(blockedCount > 0)
   309 			{
   314 			{
   319 // Updates Softkeys according to current focus.
   324 // Updates Softkeys according to current focus.
   320 // ---------------------------------------------------------
   325 // ---------------------------------------------------------
   321 //
   326 //
   322 void CVIMPSTUiBlockViewControl::UpdateCbaL()
   327 void CVIMPSTUiBlockViewControl::UpdateCbaL()
   323     {
   328     {
       
   329 	TRACER_AUTO;
   324     TInt cbaRes = R_SERVTAB_SOFTKEYS_EMPTY_EMPTY__BACK;    
   330     TInt cbaRes = R_SERVTAB_SOFTKEYS_EMPTY_EMPTY__BACK;    
   325     if ( !iCba ) 
   331     if ( !iCba ) 
   326 	    {
   332 	    {
   327 	    iCba = CEikButtonGroupContainer::Current();
   333 	    iCba = CEikButtonGroupContainer::Current();
   328 	    }
   334 	    }
   341 // ---------------------------------------------------------
   347 // ---------------------------------------------------------
   342 //
   348 //
   343 TKeyResponse CVIMPSTUiBlockViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent,
   349 TKeyResponse CVIMPSTUiBlockViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent,
   344 													TEventCode aType )
   350 													TEventCode aType )
   345 	{
   351 	{
       
   352 	TRACER_AUTO;
   346 	if ( !aKeyEvent.iCode ) 
   353 	if ( !aKeyEvent.iCode ) 
   347 	        {
   354 	        {
   348 	        //The character code generated 
   355 	        //The character code generated 
   349 	        //for an EEventKey, or 0 for a down or up event.
   356 	        //for an EEventKey, or 0 for a down or up event.
   350 	        //For down or up key return key consumed.. handle only the events
   357 	        //For down or up key return key consumed.. handle only the events
   407 // See header for details. 
   414 // See header for details. 
   408 // ---------------------------------------------------------------------------
   415 // ---------------------------------------------------------------------------
   409 //
   416 //
   410 void CVIMPSTUiBlockViewControl::SetEmptyTextsToListboxL()
   417 void CVIMPSTUiBlockViewControl::SetEmptyTextsToListboxL()
   411     {    
   418     {    
       
   419 	TRACER_AUTO;
   412     HBufC* emptyFinal = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGD);
   420     HBufC* emptyFinal = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGD);
   413     CleanupStack::PushL(emptyFinal);
   421     CleanupStack::PushL(emptyFinal);
   414     iListBox->View()->SetListEmptyTextL( *emptyFinal );
   422     iListBox->View()->SetListEmptyTextL( *emptyFinal );
   415     CleanupStack::PopAndDestroy(emptyFinal);
   423     CleanupStack::PopAndDestroy(emptyFinal);
   416     }
   424     }
   419 // CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL()
   427 // CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL()
   420 // See header for details. 
   428 // See header for details. 
   421 // ---------------------------------------------------------------------------
   429 // ---------------------------------------------------------------------------
   422 //
   430 //
   423 void CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL()
   431 void CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL()
   424     {    
   432     {   
       
   433 	TRACER_AUTO;
   425     HBufC* updating = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGDTO);
   434     HBufC* updating = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGDTO);
   426     CleanupStack::PushL(updating);
   435     CleanupStack::PushL(updating);
   427     iListBox->View()->SetListEmptyTextL( *updating );
   436     iListBox->View()->SetListEmptyTextL( *updating );
   428     CleanupStack::PopAndDestroy(updating);
   437     CleanupStack::PopAndDestroy(updating);
   429     }
   438     }