uiservicetab/vimpstui/src/cvimpstuisinglelistboxtabviewcontrol.cpp
branchRCL_3
changeset 9 9fdee5e1da30
parent 6 78867dafe7eb
child 10 d20aea8a18b6
equal deleted inserted replaced
8:796276a1bdcc 9:9fdee5e1da30
    29 #include "vimpstui.hrh"
    29 #include "vimpstui.hrh"
    30 #include "cvimpstuitabbedview.h"
    30 #include "cvimpstuitabbedview.h"
    31 #include "mvimpstengine.h"
    31 #include "mvimpstengine.h"
    32 #include "cvimpststoragemanagerfactory.h"
    32 #include "cvimpststoragemanagerfactory.h"
    33 #include "mvimpststorageserviceview.h"
    33 #include "mvimpststorageserviceview.h"
    34 #include "vimpstdebugtrace.h"
    34 
    35 // system include
    35 // system include
    36 #include 	<aknenv.h>
    36 #include 	<aknenv.h>
    37 #include	<aknlists.h>
    37 #include	<aknlists.h>
    38 #include    <AknIconArray.h>
    38 #include    <AknIconArray.h>
    39 #include	<eikclbd.h> 
    39 #include	<eikclbd.h> 
    46 #include <vimpstuires.rsg>
    46 #include <vimpstuires.rsg>
    47 
    47 
    48 
    48 
    49 #include    <MVPbkContactStoreListObserver.h>
    49 #include    <MVPbkContactStoreListObserver.h>
    50 #include    "mvimpstenginepresencesubservice.h"
    50 #include    "mvimpstenginepresencesubservice.h"
       
    51 #include "uiservicetabtracer.h"
    51 
    52 
    52 #include <aknlayoutscalable_avkon.cdl.h>
    53 #include <aknlayoutscalable_avkon.cdl.h>
    53 // imlauncher
    54 // imlauncher
    54 #include <imcvlauncher.h>
    55 #include <imcvlauncher.h>
    55 const TInt KTextLimit( 40 ); // Text-limit for find-field
    56 const TInt KTextLimit( 40 ); // Text-limit for find-field
    91 // CVIMPSTUiSingleListBoxTabViewControl::ConstructL
    92 // CVIMPSTUiSingleListBoxTabViewControl::ConstructL
    92 // --------------------------------------------------------------------------
    93 // --------------------------------------------------------------------------
    93 //
    94 //
    94 void CVIMPSTUiSingleListBoxTabViewControl::ConstructL()
    95 void CVIMPSTUiSingleListBoxTabViewControl::ConstructL()
    95     {
    96     {
       
    97 	TRACER_AUTO;
    96     CreateWindowL();
    98     CreateWindowL();
    97    
    99    
    98     // register to get the call back for any array data change
   100     // register to get the call back for any array data change
    99      iArrayProcess.AddObserver(this); 
   101      iArrayProcess.AddObserver(this); 
   100     
   102     
   152         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, 
   154         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, 
   153         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   155         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   154         CVIMPSTUiBrandData& aBrandHandler,
   156         CVIMPSTUiBrandData& aBrandHandler,
   155         MVIMPSTEngine& aEngine)
   157         MVIMPSTEngine& aEngine)
   156     {
   158     {
       
   159 	TRACER_AUTO;
   157     CVIMPSTUiSingleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler,
   160     CVIMPSTUiSingleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler,
   158     			aCommandHandler, aServiceId, aBrandHandler,aEngine);
   161     			aCommandHandler, aServiceId, aBrandHandler,aEngine);
   159     CleanupStack::Pop(self);
   162     CleanupStack::Pop(self);
   160     return self;
   163     return self;
   161     }
   164     }
   169         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler,
   172         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler,
   170         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   173         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   171         CVIMPSTUiBrandData& aBrandHandler,
   174         CVIMPSTUiBrandData& aBrandHandler,
   172         MVIMPSTEngine& aEngine)
   175         MVIMPSTEngine& aEngine)
   173     {
   176     {
       
   177 	TRACER_AUTO;
   174     CVIMPSTUiSingleListBoxTabViewControl* self =
   178     CVIMPSTUiSingleListBoxTabViewControl* self =
   175         new (ELeave) CVIMPSTUiSingleListBoxTabViewControl(aTabbedView,aKeyEventHandler,
   179         new (ELeave) CVIMPSTUiSingleListBoxTabViewControl(aTabbedView,aKeyEventHandler,
   176         aCommandHandler, aServiceId, aBrandHandler,aEngine);
   180         aCommandHandler, aServiceId, aBrandHandler,aEngine);
   177     CleanupStack::PushL(self);
   181     CleanupStack::PushL(self);
   178     self->ConstructL();
   182     self->ConstructL();
   515 // --------------------------------------------------------------------------
   519 // --------------------------------------------------------------------------
   516 //
   520 //
   517 void CVIMPSTUiSingleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId)
   521 void CVIMPSTUiSingleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId)
   518     {
   522     {
   519     HBufC* msgText;
   523     HBufC* msgText;
   520     TRACE( T_LIT("CVIMPSTUiSingleListBoxTabViewControl:SetListEmptyTextL:Start"));    
   524     TRACER_AUTO;    
   521     // Get Service Name from Engine , load string from resource and display.
   525     // Get Service Name from Engine , load string from resource and display.
   522     // This text is shown to tell the user to restart phone to get the service again.
   526     // This text is shown to tell the user to restart phone to get the service again.
   523     TPtrC serviceNamePtr(iEngine.ServiceName());
   527     TPtrC serviceNamePtr(iEngine.ServiceName());
   524     msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv);
   528     msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv);
   525     iListBox->View()->SetListEmptyTextL(*msgText);
   529     iListBox->View()->SetListEmptyTextL(*msgText);
   526     TRACE( T_LIT("Display Text %S"), msgText );
   530     TRACE( "Display Text %S", msgText );
   527     TRACE( T_LIT("CVIMPSTUiSingleListBoxTabViewControl:SetListEmptyTextL:End"));
   531     
   528     CleanupStack::PopAndDestroy(msgText);
   532     CleanupStack::PopAndDestroy(msgText);
   529     }
   533     }
   530 
   534 
   531 // ---------------------------------------------------------
   535 // ---------------------------------------------------------
   532 // CVIMPSTUiSingleListBoxTabViewControl::LoadBitmapsL
   536 // CVIMPSTUiSingleListBoxTabViewControl::LoadBitmapsL
   641 //
   645 //
   642 void CVIMPSTUiSingleListBoxTabViewControl::SendMessageL()
   646 void CVIMPSTUiSingleListBoxTabViewControl::SendMessageL()
   643 	{
   647 	{
   644 	TInt index = CurrentItemIndex();   
   648 	TInt index = CurrentItemIndex();   
   645 	TPtrC seletctedItem = iArrayProcess.GetItemUserId(index) ;
   649 	TPtrC seletctedItem = iArrayProcess.GetItemUserId(index) ;
   646 	if( index< 0 || !(seletctedItem.Length()) )
   650 	if( index< 0 )
   647 		{
   651 		{
   648 		// return if item not found or there is no user id.
   652 		// return if item not found.
   649 		return;	
   653 		return;	
   650 		}
   654 		}
       
   655       if(seletctedItem.Length())
       
   656 		{
   651    // No need to check for the presence of the contact as in singleline 
   657    // No need to check for the presence of the contact as in singleline 
   652    // list box there is no presence, hence directly open the ocnversation view.
   658    // list box there is no presence, hence directly open the ocnversation view.
   653     TVwsViewId activeViewId;
   659     TVwsViewId activeViewId;
   654     CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId );
   660     CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId );
   655     
   661     
   656     iArrayProcess.ResetPendingMsg( index );
   662     iArrayProcess.ResetPendingMsg( index );
   657     // imlauncher call for luanching the conversationview with seletced user id
   663     // imlauncher call for luanching the conversationview with seletced user id
   658     IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem );  
   664     IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem );  
       
   665 		}
       
   666 	else
       
   667 		{
       
   668 	      //When there is no XSP Id present it comes to here
       
   669 		//Displaying a note that there is no XSP ID
       
   670 	      HBufC* note = NULL;
       
   671 	      note = StringLoader::LoadLC( R_QTN_SERVTAB_NOXSP_ERROR );
       
   672 	      VIMPSTUtilsDialog::DisplayNoteDialogL( *note );
       
   673 		CleanupStack::PopAndDestroy( note );
       
   674 		}
   659 	}
   675 	}
   660 // ---------------------------------------------------------
   676 // ---------------------------------------------------------
   661 // CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL
   677 // CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL
   662 // (other items were commented in a header).
   678 // (other items were commented in a header).
   663 // ---------------------------------------------------------
   679 // ---------------------------------------------------------
   664 //
   680 //
   665 void CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL( 
   681 void CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL( 
   666 				TInt aIndex, TVIMPSTEnums::TItem aType)
   682 				TInt aIndex, TVIMPSTEnums::TItem aType)
   667     {
   683     {
       
   684 	TRACER_AUTO;
   668     TInt index = KErrNotFound;
   685     TInt index = KErrNotFound;
   669     if( aIndex < 0 )
   686     if( aIndex < 0 )
   670     	{
   687     	{
   671     	aIndex = CurrentItemIndex()<0?0:CurrentItemIndex();		
   688     	aIndex = CurrentItemIndex()<0?0:CurrentItemIndex();		
   672     	}
   689     	}
   731 // (other items were commented in a header).
   748 // (other items were commented in a header).
   732 // ---------------------------------------------------------
   749 // ---------------------------------------------------------
   733 //
   750 //
   734 void CVIMPSTUiSingleListBoxTabViewControl::ActivateFindPaneL()
   751 void CVIMPSTUiSingleListBoxTabViewControl::ActivateFindPaneL()
   735     {
   752     {
       
   753 	TRACER_AUTO;
   736     if( !iFindbox )
   754     if( !iFindbox )
   737         {
   755         {
   738         iFindbox = CAknSearchField::NewL( *this,
   756         iFindbox = CAknSearchField::NewL( *this,
   739                 CAknSearchField::ESearch,
   757                 CAknSearchField::ESearch,
   740                 NULL, KTextLimit );
   758                 NULL, KTextLimit );
   765 // (other items were commented in a header).
   783 // (other items were commented in a header).
   766 // ---------------------------------------------------------
   784 // ---------------------------------------------------------
   767 //
   785 //
   768 void CVIMPSTUiSingleListBoxTabViewControl::DeactivateFindPaneL()
   786 void CVIMPSTUiSingleListBoxTabViewControl::DeactivateFindPaneL()
   769     {
   787     {
       
   788 	TRACER_AUTO;
   770     if( !iFindbox )
   789     if( !iFindbox )
   771 	    {
   790 	    {
   772 	    return;	
   791 	    return;	
   773 	    }
   792 	    }
   774     static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() )
   793     static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() )
   985 // Updates Softkeys according to current focus.
  1004 // Updates Softkeys according to current focus.
   986 // ---------------------------------------------------------
  1005 // ---------------------------------------------------------
   987 //
  1006 //
   988 void CVIMPSTUiSingleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ )
  1007 void CVIMPSTUiSingleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ )
   989     {
  1008     {
       
  1009 	TRACER_AUTO;
   990     TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY;
  1010     TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY;
   991     iCurrentCmdToExe = -1;
  1011     iCurrentCmdToExe = -1;
   992     if( !iCbaLock )
  1012     if( !iCbaLock )
   993         {
  1013         {
   994         TInt index = CurrentItemIndex();
  1014         TInt index = CurrentItemIndex();