uiservicetab/vimpstui/src/cvimpstuidoublelistboxtabviewcontrol.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 10 78867dafe7eb
child 16 d20aea8a18b6
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    44 // Pbk2
    44 // Pbk2
    45 #include <MPbk2KeyEventHandler.h>
    45 #include <MPbk2KeyEventHandler.h>
    46 #include <vimpstuires.rsg>
    46 #include <vimpstuires.rsg>
    47 
    47 
    48 #include <aknlayoutscalable_avkon.cdl.h>
    48 #include <aknlayoutscalable_avkon.cdl.h>
    49 #include "vimpstdebugtrace.h"
    49 #include "uiservicetabtracer.h"
    50 // imlauncher
    50 // imlauncher
    51 #include <imcvlauncher.h>
    51 #include <imcvlauncher.h>
    52 const TInt KTextLimit( 40 ); // Text-limit for find-field
    52 const TInt KTextLimit( 40 ); // Text-limit for find-field
    53 
    53 
    54 const TInt KMinContact(1);   // minmimum number of contacts to show findpane
    54 const TInt KMinContact(1);   // minmimum number of contacts to show findpane
    84 // CVIMPSTUiDoubleListBoxTabViewControl::ConstructL
    84 // CVIMPSTUiDoubleListBoxTabViewControl::ConstructL
    85 // --------------------------------------------------------------------------
    85 // --------------------------------------------------------------------------
    86 //
    86 //
    87 void CVIMPSTUiDoubleListBoxTabViewControl::ConstructL()
    87 void CVIMPSTUiDoubleListBoxTabViewControl::ConstructL()
    88     {
    88     {
       
    89 	TRACER_AUTO;
    89     CreateWindowL();
    90     CreateWindowL();
    90     // register to get the call back for any array data change
    91     // register to get the call back for any array data change
    91     iArrayProcess.AddObserver(this);  
    92     iArrayProcess.AddObserver(this);  
    92     // this to make sure that if user id changed storage should be refresh with new user id
    93     // this to make sure that if user id changed storage should be refresh with new user id
    93     // Initialize the listbox
    94     // Initialize the listbox
   143         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, 
   144         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, 
   144         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   145         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   145         CVIMPSTUiBrandData& aBrandHandler,
   146         CVIMPSTUiBrandData& aBrandHandler,
   146         MVIMPSTEngine& aEngine)
   147         MVIMPSTEngine& aEngine)
   147     {
   148     {
       
   149 	TRACER_AUTO;
   148     CVIMPSTUiDoubleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler,
   150     CVIMPSTUiDoubleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler,
   149     			aCommandHandler, aServiceId, aBrandHandler,aEngine);
   151     			aCommandHandler, aServiceId, aBrandHandler,aEngine);
   150     CleanupStack::Pop(self);
   152     CleanupStack::Pop(self);
   151     return self;
   153     return self;
   152     }
   154     }
   160         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler,
   162         (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler,
   161         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   163         MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId,
   162         CVIMPSTUiBrandData& aBrandHandler,
   164         CVIMPSTUiBrandData& aBrandHandler,
   163         MVIMPSTEngine& aEngine)
   165         MVIMPSTEngine& aEngine)
   164     {
   166     {
       
   167 	TRACER_AUTO;
   165     CVIMPSTUiDoubleListBoxTabViewControl* self =
   168     CVIMPSTUiDoubleListBoxTabViewControl* self =
   166         new (ELeave) CVIMPSTUiDoubleListBoxTabViewControl(aTabbedView,aKeyEventHandler,
   169         new (ELeave) CVIMPSTUiDoubleListBoxTabViewControl(aTabbedView,aKeyEventHandler,
   167         aCommandHandler, aServiceId, aBrandHandler,aEngine);
   170         aCommandHandler, aServiceId, aBrandHandler,aEngine);
   168     CleanupStack::PushL(self);
   171     CleanupStack::PushL(self);
   169     self->ConstructL();
   172     self->ConstructL();
   190 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL
   193 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL
   191 // --------------------------------------------------------------------------
   194 // --------------------------------------------------------------------------
   192 //
   195 //
   193 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& aUserId ) 
   196 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& aUserId ) 
   194     {
   197     {
   195     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL  Start") );
   198 	TRACER_AUTO;
   196     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL aUserId = %S "), &aUserId );
   199     TRACE( "aUserId = %S ", &aUserId );
   197     CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
   200     CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
   198     TPtrC loginUserId = iArrayProcess.LoginUserIdFromStoreL();
   201     TPtrC loginUserId = iArrayProcess.LoginUserIdFromStoreL();
   199     TInt Avindex = 0;
   202     TInt Avindex = 0;
   200     CGulIcon* newIcon = NULL;
   203     CGulIcon* newIcon = NULL;
   201     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL loginUserId = %S "), &loginUserId );
   204     TRACE( "loginUserId = %S ", &loginUserId );
   202     if( KErrNone == loginUserId.Compare( aUserId ) )
   205     if( KErrNone == loginUserId.Compare( aUserId ) )
   203         {
   206         {
   204         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if ownuserid") );
   207         TRACE( "inside if ownuserid" );
   205         TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL();
   208         TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL();
   206         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after iArrayProcess.OwnAvatarContentL()") );
   209         TRACE( "after iArrayProcess.OwnAvatarContentL()" );
   207         Avindex = iArrayProcess.OwnAvatarIndexL();
   210         Avindex = iArrayProcess.OwnAvatarIndexL();
   208         if( avatardata.Length() )
   211         if( avatardata.Length() )
   209             {
   212             {
   210             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL avatardata.Length()") );
   213             TRACE( "avatardata.Length()" );
   211             newIcon = AvatarToIconL( avatardata );
   214             newIcon = AvatarToIconL( avatardata );
   212             }
   215             }
   213         if( newIcon ) // there is a new avatar icon 
   216         if( newIcon ) // there is a new avatar icon 
   214             {
   217             {
   215             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL newIcon") );
   218             TRACE("newIcon" );
   216             CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();
   219             CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();
   217             if( Avindex ) // if there is old icon already
   220             if( Avindex ) // if there is old icon already
   218                 {
   221                 {
   219                 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL Avindex ") );
   222                 TRACE( "Avindex " );
   220                 // delete the old icon compress the array and insert at the same position
   223                 // delete the old icon compress the array and insert at the same position
   221                 currentIconArray->Delete( Avindex );
   224                 currentIconArray->Delete( Avindex );
   222                 currentIconArray->Compress();
   225                 currentIconArray->Compress();
   223                 currentIconArray->InsertL( Avindex , newIcon);
   226                 currentIconArray->InsertL( Avindex , newIcon);
   224                 }
   227                 }
   225             else 
   228             else 
   226                 { 
   229                 { 
   227                 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else of Avindex ") );
   230                 TRACE( "else of Avindex " );
   228                 // if there is no old icon append at the last
   231                 // if there is no old icon append at the last
   229                 currentIconArray->AppendL( newIcon);
   232                 currentIconArray->AppendL( newIcon);
   230                 // set the index to cenrep
   233                 // set the index to cenrep
   231                 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL currentIconArray->Count()-1 = %d "),currentIconArray->Count()-1  );
   234                 TRACE( " currentIconArray->Count()-1 = %d ",currentIconArray->Count()-1  );
   232                 iArrayProcess.SetOwnAvatarIndexL( currentIconArray->Count()-1 );
   235                 iArrayProcess.SetOwnAvatarIndexL( currentIconArray->Count()-1 );
   233                 }
   236                 }
   234             }
   237             }
   235         else 
   238         else 
   236             {
   239             {
   237             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else of avatar got cleared.") );
   240             TRACE( "else of avatar got cleared." );
   238             // avatar got cleared just  set the icon index to '0'
   241             // avatar got cleared just  set the icon index to '0'
   239             // icon what was added still remains in the  listbox icon array
   242             // icon what was added still remains in the  listbox icon array
   240             // dont delete the old icon, because that needs to modify the whole 
   243             // dont delete the old icon, because that needs to modify the whole 
   241             // indexes of the  other contacts. 
   244             // indexes of the  other contacts. 
   242             // "keeping the icon is better than changing all contacts indexes"
   245             // "keeping the icon is better than changing all contacts indexes"
   244             iArrayProcess.SetOwnAvatarIndexL( KErrNone );
   247             iArrayProcess.SetOwnAvatarIndexL( KErrNone );
   245             }
   248             }
   246         }
   249         }
   247     else
   250     else
   248         {
   251         {
   249         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else  not own id") );
   252         TRACE( " else  not own id" );
   250         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL else  not own id aUserId = %S"),&aUserId );
   253         TRACE( " else  not own id aUserId = %S",&aUserId );
   251         TInt index = iArrayProcess.GetSelectedItemIndex( aUserId );//Get the index from storage.
   254         TInt index = iArrayProcess.GetSelectedItemIndex( aUserId );//Get the index from storage.
   252         
   255         
   253         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after GetSelectedItemIndex") );
   256         TRACE( " after GetSelectedItemIndex" );
   254         TPtrC8 avatardata = iArrayProcess.AvatarContent( index );
   257         TPtrC8 avatardata = iArrayProcess.AvatarContent( index );
   255         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after iArrayProcess.AvatarContent") );
   258         TRACE("after iArrayProcess.AvatarContent" );
   256         Avindex = iArrayProcess.AvatarIndex(index);
   259         Avindex = iArrayProcess.AvatarIndex(index);
   257         TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL after Avindex = %d"),Avindex );
   260         TRACE( " after Avindex = %d",Avindex );
   258         if( avatardata.Length() )
   261         if( avatardata.Length() )
   259             {
   262             {
   260             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if avatardata.Length()") );
   263             TRACE( "inside if avatardata.Length()" );
   261             newIcon = AvatarToIconL( avatardata );
   264             newIcon = AvatarToIconL( avatardata );
   262             }
   265             }
   263         if( newIcon ) // there is a new avatar icon 
   266         if( newIcon ) // there is a new avatar icon 
   264             {
   267             {
   265             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside if newIcon") );
   268             TRACE( "inside if newIcon" );
   266             CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();
   269             CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();
   267             if( Avindex ) // if there is old icon already
   270             if( Avindex ) // if there is old icon already
   268                 {
   271                 {
   269                 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside Avindex") );
   272                 TRACE( " inside Avindex" );
   270                 // delete the old icon compress the array and insert at the same position
   273                 // delete the old icon compress the array and insert at the same position
   271                 currentIconArray->Delete( Avindex );
   274                 currentIconArray->Delete( Avindex );
   272                 currentIconArray->Compress();
   275                 currentIconArray->Compress();
   273                 currentIconArray->InsertL( Avindex , newIcon);
   276                 currentIconArray->InsertL( Avindex , newIcon);
   274                 }
   277                 }
   275             else 
   278             else 
   276                 { 
   279                 { 
   277                 TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL inside Avindex else") );
   280                 TRACE( " inside Avindex else" );
   278                 // if there is no old icon append at the last
   281                 // if there is no old icon append at the last
   279                 currentIconArray->AppendL( newIcon);
   282                 currentIconArray->AppendL( newIcon);
   280                 // set the index to cenrep
   283                 // set the index to cenrep
   281                 iArrayProcess.SetAvatarIndex(index, currentIconArray->Count()-1 );
   284                 iArrayProcess.SetAvatarIndex(index, currentIconArray->Count()-1 );
   282                 }
   285                 }
   283             }
   286             }
   284         else 
   287         else 
   285             {
   288             {
   286             TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL  avatar got cleared") );
   289             TRACE( " avatar got cleared" );
   287             // avatar got cleared just  set the icon index to '0'
   290             // avatar got cleared just  set the icon index to '0'
   288             // icon what was added still remains in the  listbox icon array
   291             // icon what was added still remains in the  listbox icon array
   289             // dont delete the old icon, because that needs to modify the whole 
   292             // dont delete the old icon, because that needs to modify the whole 
   290             // indexes of the  other contacts. 
   293             // indexes of the  other contacts. 
   291             // "keeping the icon is better than changing all contacts indexes"
   294             // "keeping the icon is better than changing all contacts indexes"
   293             iArrayProcess.SetAvatarIndex( index , KErrNone );
   296             iArrayProcess.SetAvatarIndex( index , KErrNone );
   294             }
   297             }
   295         }
   298         }
   296 
   299 
   297     iListBox->DrawNow();
   300     iListBox->DrawNow();
   298     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL  End") );
   301     
   299     }	
   302     }	
   300 // ---------------------------------------------------------
   303 // ---------------------------------------------------------
   301 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition
   304 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition
   302 // ---------------------------------------------------------
   305 // ---------------------------------------------------------
   303 //
   306 //
   314 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition
   317 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition
   315 // ---------------------------------------------------------
   318 // ---------------------------------------------------------
   316 //
   319 //
   317 void CVIMPSTUiDoubleListBoxTabViewControl::HandleDeletionL(TVIMPSTEnums::TItem aType , TInt aIndex )
   320 void CVIMPSTUiDoubleListBoxTabViewControl::HandleDeletionL(TVIMPSTEnums::TItem aType , TInt aIndex )
   318 	{
   321 	{
       
   322 	TRACER_AUTO;
   319 	if(iListBox)
   323 	if(iListBox)
   320 		{
   324 		{
   321 		iListBox->HandleItemRemovalL();  
   325 		iListBox->HandleItemRemovalL();  
   322 		TInt count = iListBox->Model()->NumberOfItems();
   326 		TInt count = iListBox->Model()->NumberOfItems();
   323 		if( count == aIndex )
   327 		if( count == aIndex )
   332 // CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL
   336 // CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL
   333 // --------------------------------------------------------------------------
   337 // --------------------------------------------------------------------------
   334 //
   338 //
   335 void CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL()
   339 void CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL()
   336     {
   340     {
       
   341 	TRACER_AUTO;
   337     if(iListBox)
   342     if(iListBox)
   338   	 	{
   343   	 	{
   339         iListBox->HandleItemAdditionL();  
   344         iListBox->HandleItemAdditionL();  
   340         TInt index  = CurrentItemIndex();
   345         TInt index  = CurrentItemIndex();
   341     	TVIMPSTEnums::TItem type = iArrayProcess.GetType(index);
   346     	TVIMPSTEnums::TItem type = iArrayProcess.GetType(index);
   413 // CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl
   418 // CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl
   414 // --------------------------------------------------------------------------
   419 // --------------------------------------------------------------------------
   415 //
   420 //
   416 CCoeControl* CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl(TInt aIndex) const
   421 CCoeControl* CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl(TInt aIndex) const
   417     {
   422     {
       
   423 	TRACER_AUTO;
   418    // return iListBox;
   424    // return iListBox;
   419     switch ( aIndex )
   425     switch ( aIndex )
   420         {
   426         {
   421         // the caller wants to have the first control
   427         // the caller wants to have the first control
   422         // so it's always listbox
   428         // so it's always listbox
   447 // --------------------------------------------------------------------------
   453 // --------------------------------------------------------------------------
   448 //
   454 //
   449 TKeyResponse CVIMPSTUiDoubleListBoxTabViewControl::OfferKeyEventL
   455 TKeyResponse CVIMPSTUiDoubleListBoxTabViewControl::OfferKeyEventL
   450         (const TKeyEvent& aKeyEvent,TEventCode aType)
   456         (const TKeyEvent& aKeyEvent,TEventCode aType)
   451     {
   457     {
       
   458 	TRACER_AUTO;
   452     if ( !aKeyEvent.iCode ) 
   459     if ( !aKeyEvent.iCode ) 
   453         {
   460         {
   454         //The character code generated 
   461         //The character code generated 
   455         //for an EEventKey, or 0 for a down or up event.
   462         //for an EEventKey, or 0 for a down or up event.
   456         //For down or up key return key consumed.. handle only the events
   463         //For down or up key return key consumed.. handle only the events
   545 // CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex
   552 // CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex
   546 // --------------------------------------------------------------------------
   553 // --------------------------------------------------------------------------
   547 //
   554 //
   548 TInt CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex() const
   555 TInt CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex() const
   549     {
   556     {
       
   557 	TRACER_AUTO;
   550     if( !iListBox )
   558     if( !iListBox )
   551         {
   559         {
   552         return KErrNotFound;
   560         return KErrNotFound;
   553         }
   561         }
   554     if( !iListBox->View() )
   562     if( !iListBox->View() )
   578 // CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex
   586 // CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex
   579 // --------------------------------------------------------------------------
   587 // --------------------------------------------------------------------------
   580 //
   588 //
   581 void CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex(TInt aIndex)
   589 void CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex(TInt aIndex)
   582     {
   590     {
       
   591 	TRACER_AUTO;
   583     if (iListBox->CurrentItemIndex() != aIndex &&
   592     if (iListBox->CurrentItemIndex() != aIndex &&
   584         aIndex >= 0 &&
   593         aIndex >= 0 &&
   585         aIndex < iListBox->Model()->NumberOfItems() )
   594         aIndex < iListBox->Model()->NumberOfItems() )
   586         {
   595         {
   587         iListBox->SetCurrentItemIndex(aIndex);
   596         iListBox->SetCurrentItemIndex(aIndex);
   606 // --------------------------------------------------------------------------
   615 // --------------------------------------------------------------------------
   607 //
   616 //
   608 void CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId)
   617 void CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId)
   609     {
   618     {
   610     HBufC* msgText;
   619     HBufC* msgText;
   611     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl:SetListEmptyTextL:Start"));  
   620     TRACER_AUTO;  
   612     // Get Service Name from Engine , load string from resource and display.
   621     // Get Service Name from Engine , load string from resource and display.
   613     // This text is shown to tell the user to restart phone to get the service again.
   622     // This text is shown to tell the user to restart phone to get the service again.
   614     TPtrC serviceNamePtr(iEngine.ServiceName());
   623     TPtrC serviceNamePtr(iEngine.ServiceName());
   615     msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv);
   624     msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv);
   616     iListBox->View()->SetListEmptyTextL(*msgText);
   625     iListBox->View()->SetListEmptyTextL(*msgText);
   617     TRACE( T_LIT("Display Text %S"), msgText );
   626     TRACE("Display Text %S", msgText );
   618     TRACE( T_LIT("CVIMPSTUiDoubleListBoxTabViewControl:SetListEmptyTextL:End"));
   627     
   619     CleanupStack::PopAndDestroy(msgText);
   628     CleanupStack::PopAndDestroy(msgText);
   620     }
   629     }
   621 
   630 
   622 // ---------------------------------------------------------
   631 // ---------------------------------------------------------
   623 // CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL
   632 // CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL
   625 // ---------------------------------------------------------
   634 // ---------------------------------------------------------
   626 //
   635 //
   627 void CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL()
   636 void CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL()
   628     {
   637     {
   629   
   638   
   630     
   639 	TRACER_AUTO;
   631 	CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
   640 	CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
   632 	if ( !listBoxData )
   641 	if ( !listBoxData )
   633 		{
   642 		{
   634 		//No listbox data
   643 		//No listbox data
   635 		User::Leave( KErrNotFound );
   644 		User::Leave( KErrNotFound );
   701 // ---------------------------------------------------------
   710 // ---------------------------------------------------------
   702 //
   711 //
   703 void CVIMPSTUiDoubleListBoxTabViewControl::HandleListBoxEventL(
   712 void CVIMPSTUiDoubleListBoxTabViewControl::HandleListBoxEventL(
   704         CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
   713         CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
   705     {
   714     {
       
   715 	TRACER_AUTO;
   706     iTabbedView.UpdateToolbarL();
   716     iTabbedView.UpdateToolbarL();
   707     switch(aEventType)
   717     switch(aEventType)
   708         {
   718         {
   709         case EEventItemSingleClicked:
   719         case EEventItemSingleClicked:
   710 
   720 
   781 // (other items were commented in a header).
   791 // (other items were commented in a header).
   782 // ---------------------------------------------------------
   792 // ---------------------------------------------------------
   783 //
   793 //
   784 void CVIMPSTUiDoubleListBoxTabViewControl::SendMessageL()
   794 void CVIMPSTUiDoubleListBoxTabViewControl::SendMessageL()
   785 	{
   795 	{
       
   796 	TRACER_AUTO;
   786 //	TInt index = iListBox->CurrentItemIndex();
   797 //	TInt index = iListBox->CurrentItemIndex();
   787 	TInt index = CurrentItemIndex();        
   798 	TInt index = CurrentItemIndex();        
   788 	if( index< 0 )
   799 	if( index< 0 )
   789 		{
   800 		{
   790 		// return if item not found
   801 		// return if item not found
   827             UpdateCbaL();
   838             UpdateCbaL();
   828             // imlauncher call for luanching the conversationview with seletced user id
   839             // imlauncher call for luanching the conversationview with seletced user id
   829             IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem, itemName, contactLink);
   840             IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem, itemName, contactLink);
   830             }
   841             }
   831 	    }
   842 	    }
       
   843 	else
       
   844 		{
       
   845 	     //When there is no XSP Id present it comes to here
       
   846 	     //Displaying a note that there is no XSP ID
       
   847 			HBufC* note = NULL;
       
   848 	        note = StringLoader::LoadLC( R_QTN_SERVTAB_NOXSP_ERROR );
       
   849 	        VIMPSTUtilsDialog::DisplayNoteDialogL( *note );
       
   850 	        CleanupStack::PopAndDestroy( note );
       
   851 		}
   832 	
   852 	
   833 	}
   853 	}
   834 // ---------------------------------------------------------
   854 // ---------------------------------------------------------
   835 // CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL
   855 // CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL
   836 // (other items were commented in a header).
   856 // (other items were commented in a header).
   837 // ---------------------------------------------------------
   857 // ---------------------------------------------------------
   838 //
   858 //
   839 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL( 
   859 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL( 
   840 				TInt aIndex, TVIMPSTEnums::TItem aType)
   860 				TInt aIndex, TVIMPSTEnums::TItem aType)
   841     {
   861     {
       
   862 	TRACER_AUTO;
   842     TInt index = KErrNotFound;
   863     TInt index = KErrNotFound;
   843      if( aIndex < 0 )
   864      if( aIndex < 0 )
   844     	{
   865     	{
   845     	aIndex = CurrentItemIndex()<0?0:CurrentItemIndex();	
   866     	aIndex = CurrentItemIndex()<0?0:CurrentItemIndex();	
   846     	}
   867     	}
   905 // (other items were commented in a header).
   926 // (other items were commented in a header).
   906 // ---------------------------------------------------------
   927 // ---------------------------------------------------------
   907 //
   928 //
   908 void CVIMPSTUiDoubleListBoxTabViewControl::ActivateFindPaneL()
   929 void CVIMPSTUiDoubleListBoxTabViewControl::ActivateFindPaneL()
   909     {
   930     {
       
   931 	TRACER_AUTO;
   910     if( !iFindbox )
   932     if( !iFindbox )
   911         {
   933         {
   912         // Use EAdaptiveSearch so that we can search according to columns.
   934         // Use EAdaptiveSearch so that we can search according to columns.
   913         iFindbox = CAknSearchField::NewL( *this,
   935         iFindbox = CAknSearchField::NewL( *this,
   914                 CAknSearchField::EAdaptiveSearch,
   936                 CAknSearchField::EAdaptiveSearch,
   946 // (other items were commented in a header).
   968 // (other items were commented in a header).
   947 // ---------------------------------------------------------
   969 // ---------------------------------------------------------
   948 //
   970 //
   949 void CVIMPSTUiDoubleListBoxTabViewControl::DeactivateFindPaneL()
   971 void CVIMPSTUiDoubleListBoxTabViewControl::DeactivateFindPaneL()
   950     {
   972     {
       
   973 	TRACER_AUTO;
   951     if( !iFindbox )
   974     if( !iFindbox )
   952 	    {
   975 	    {
   953 	    return;	
   976 	    return;	
   954 	    }
   977 	    }
   955     static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() )
   978     static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() )
  1001 // (other items were commented in a header).
  1024 // (other items were commented in a header).
  1002 // ---------------------------------------------------------
  1025 // ---------------------------------------------------------
  1003 //
  1026 //
  1004 void CVIMPSTUiDoubleListBoxTabViewControl::SetLayout()
  1027 void CVIMPSTUiDoubleListBoxTabViewControl::SetLayout()
  1005     {
  1028     {
       
  1029 	TRACER_AUTO;
  1006     const TRect rect( Rect() );
  1030     const TRect rect( Rect() );
  1007     if( iListBox && iFindPaneIsVisible )
  1031     if( iListBox && iFindPaneIsVisible )
  1008         {
  1032         {
  1009 
  1033 
  1010         TAknWindowLineLayout empty;
  1034         TAknWindowLineLayout empty;
  1098 // ---------------------------------------------------------
  1122 // ---------------------------------------------------------
  1099 // CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible()
  1123 // CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible()
  1100 // Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found 
  1124 // Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found 
  1101 // ---------------------------------------------------------
  1125 // ---------------------------------------------------------
  1102 void CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible()
  1126 void CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible()
  1103     {  
  1127     { 
       
  1128 	TRACER_AUTO;
  1104     TInt count = iArrayProcess.Count();
  1129     TInt count = iArrayProcess.Count();
  1105     TInt index = CurrentItemIndex();
  1130     TInt index = CurrentItemIndex();
  1106     if( index == count )
  1131     if( index == count )
  1107         {   
  1132         {   
  1108         if( iLastItemFlag )
  1133         if( iLastItemFlag )
  1144 // CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL
  1169 // CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL
  1145 // 
  1170 // 
  1146 // ------------------------------------------------------------------------
  1171 // ------------------------------------------------------------------------
  1147 CGulIcon* CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL( const TDesC8& aAvatarContent )
  1172 CGulIcon* CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL( const TDesC8& aAvatarContent )
  1148     {
  1173     {
       
  1174 	TRACER_AUTO;
  1149     CGulIcon* newIcon = NULL;
  1175     CGulIcon* newIcon = NULL;
  1150     CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL();
  1176     CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL();
  1151     CleanupStack::PushL( imageHandler );
  1177     CleanupStack::PushL( imageHandler );
  1152     // pass the avatar content and mimetype as NULL
  1178     // pass the avatar content and mimetype as NULL
  1153     // mimetype will be recognised by the UTILS  class
  1179     // mimetype will be recognised by the UTILS  class
  1183 // Updates Softkeys according to current focus.
  1209 // Updates Softkeys according to current focus.
  1184 // ---------------------------------------------------------
  1210 // ---------------------------------------------------------
  1185 //
  1211 //
  1186 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ )
  1212 void CVIMPSTUiDoubleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ )
  1187     {
  1213     {
       
  1214 	TRACER_AUTO;
  1188     TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY;
  1215     TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY;
  1189     iCurrentCmdToExe = -1;
  1216     iCurrentCmdToExe = -1;
  1190     if( !iCbaLock )
  1217     if( !iCbaLock )
  1191         {
  1218         {
  1192         TInt index = CurrentItemIndex();
  1219         TInt index = CurrentItemIndex();
  1365 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarDeleteL()
  1392 // CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarDeleteL()
  1366 // Saves the Contact ID in iFocussedID
  1393 // Saves the Contact ID in iFocussedID
  1367 // ---------------------------------------------------------
  1394 // ---------------------------------------------------------
  1368 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarDeleteL( const TDesC& aUserId )
  1395 void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarDeleteL( const TDesC& aUserId )
  1369 	{
  1396 	{
       
  1397 	TRACER_AUTO;
  1370 	TInt index = iArrayProcess.GetSelectedItemIndex(aUserId );//Get the index from storage.
  1398 	TInt index = iArrayProcess.GetSelectedItemIndex(aUserId );//Get the index from storage.
  1371 	if(index >= 0)
  1399 	if(index >= 0)
  1372 		{
  1400 		{
  1373 		CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
  1401 		CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData();
  1374 		CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();
  1402 		CArrayPtr<CGulIcon>* currentIconArray = listBoxData->IconArray();