uiservicetab/vimpstui/src/cvimpstuitabbedview.cpp
branchRCL_3
changeset 9 9fdee5e1da30
parent 7 bef90b82da71
child 10 d20aea8a18b6
equal deleted inserted replaced
8:796276a1bdcc 9:9fdee5e1da30
    89 //CCA
    89 //CCA
    90 #include <mccaparameter.h>
    90 #include <mccaparameter.h>
    91 #include <ccafactory.h>
    91 #include <ccafactory.h>
    92 #include <mccaconnection.h>
    92 #include <mccaconnection.h>
    93 
    93 
    94 #include "vimpstdebugprint.h"
    94 #include "uiservicetabtracer.h"
    95 
    95 
    96 //AIW - VOIP
    96 //AIW - VOIP
    97 #include <aiwdialdataext.h>
    97 #include <aiwdialdataext.h>
    98 #include <aknPopup.h>
    98 #include <aknPopup.h>
    99 #include <AiwCommon.hrh>
    99 #include <AiwCommon.hrh>
  1476 // --------------------------------------------------------------------------
  1476 // --------------------------------------------------------------------------
  1477 // CVIMPSTUiTabbedView::ShowErrorNoteL
  1477 // CVIMPSTUiTabbedView::ShowErrorNoteL
  1478 // --------------------------------------------------------------------------
  1478 // --------------------------------------------------------------------------
  1479 void CVIMPSTUiTabbedView::ShowErrorNoteL(TInt aError )
  1479 void CVIMPSTUiTabbedView::ShowErrorNoteL(TInt aError )
  1480 	{
  1480 	{
       
  1481 	TRACER_AUTO;
  1481 	HBufC* textResource = NULL;
  1482 	HBufC* textResource = NULL;
  1482 	switch( aError)
  1483 	switch( aError)
  1483 		{
  1484 		{
  1484 		case EErrExistInBlockList:
  1485 		case EErrExistInBlockList:
  1485 			{
  1486 			{
  1631 // CVIMPSTUiTabbedView::AddContactL
  1632 // CVIMPSTUiTabbedView::AddContactL
  1632 // --------------------------------------------------------------------------
  1633 // --------------------------------------------------------------------------
  1633 //
  1634 //
  1634 void CVIMPSTUiTabbedView::AddContactL( const TInt aResouceId, const TDesC& aUserId )
  1635 void CVIMPSTUiTabbedView::AddContactL( const TInt aResouceId, const TDesC& aUserId )
  1635     {
  1636     {
       
  1637 	TRACER_AUTO;
  1636     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId);    
  1638     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId);    
  1637     if (storage)
  1639     if (storage)
  1638         {
  1640         {
  1639         if (!storage->IsLocalStore())
  1641         if (!storage->IsLocalStore())
  1640             {
  1642             {
  1739 // CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL
  1741 // CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL
  1740 // --------------------------------------------------------------------------
  1742 // --------------------------------------------------------------------------
  1741 //
  1743 //
  1742 void CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL(TInt aCommand )
  1744 void CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL(TInt aCommand )
  1743 	{
  1745 	{
       
  1746 	TRACER_AUTO;
  1744 	TInt index = CurrentItemIndex();
  1747 	TInt index = CurrentItemIndex();
  1745 	if( index <= 0 )
  1748 	if( index <= 0 )
  1746 		{
  1749 		{
  1747 		return;
  1750 		return;
  1748 		}
  1751 		}
  1785 // CVIMPSTUiTabbedView::EditContactL
  1788 // CVIMPSTUiTabbedView::EditContactL
  1786 // --------------------------------------------------------------------------
  1789 // --------------------------------------------------------------------------
  1787 //
  1790 //
  1788 void CVIMPSTUiTabbedView::EditContactL()
  1791 void CVIMPSTUiTabbedView::EditContactL()
  1789     {
  1792     {
       
  1793 	TRACER_AUTO;
  1790     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId);    
  1794     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId);    
  1791     if (storage)
  1795     if (storage)
  1792         {        
  1796         {        
  1793         if( storage->IsLocalStore())
  1797         if( storage->IsLocalStore())
  1794             {
  1798             {
  1832 // --------------------------------------------------------------------------
  1836 // --------------------------------------------------------------------------
  1833 // CVIMPSTUiTabbedView::AddContactL
  1837 // CVIMPSTUiTabbedView::AddContactL
  1834 // --------------------------------------------------------------------------
  1838 // --------------------------------------------------------------------------
  1835 void CVIMPSTUiTabbedView::AddContactL(RPointerArray<HBufC> aContacts)
  1839 void CVIMPSTUiTabbedView::AddContactL(RPointerArray<HBufC> aContacts)
  1836     {
  1840     {
       
  1841 	TRACER_AUTO;
  1837     TInt count = aContacts.Count();
  1842     TInt count = aContacts.Count();
  1838 
  1843 
  1839     switch( count )
  1844     switch( count )
  1840         {
  1845         {
  1841         case 0://no xsp found.
  1846         case 0://no xsp found.
  1890 // CVIMPSTUiTabbedView::CopyToPhoneBookL
  1895 // CVIMPSTUiTabbedView::CopyToPhoneBookL
  1891 // --------------------------------------------------------------------------
  1896 // --------------------------------------------------------------------------
  1892 //
  1897 //
  1893 void CVIMPSTUiTabbedView::CopyToPhoneBookL()
  1898 void CVIMPSTUiTabbedView::CopyToPhoneBookL()
  1894     {
  1899     {
       
  1900 	TRACER_AUTO;
  1895     TInt index = CurrentItemIndex();
  1901     TInt index = CurrentItemIndex();
  1896 
  1902 
  1897     TPtrC name( KNullDesC );
  1903     TPtrC name( KNullDesC );
  1898     if( index <= 0 )
  1904     if( index <= 0 )
  1899         {
  1905         {
  1920 // CVIMPSTUiTabbedView::DeleteContactL
  1926 // CVIMPSTUiTabbedView::DeleteContactL
  1921 // --------------------------------------------------------------------------
  1927 // --------------------------------------------------------------------------
  1922 //
  1928 //
  1923 void CVIMPSTUiTabbedView:: DeleteContactL()
  1929 void CVIMPSTUiTabbedView:: DeleteContactL()
  1924     {
  1930     {
       
  1931 	TRACER_AUTO;
  1925     TInt index = CurrentItemIndex();
  1932     TInt index = CurrentItemIndex();
  1926     HBufC* deletePrompt = NULL;
  1933     HBufC* deletePrompt = NULL;
  1927     TPtrC name( KNullDesC );
  1934     TPtrC name( KNullDesC );
  1928 
  1935 
  1929     if(iContainer)
  1936     if(iContainer)
  1964 // (other items were commented in a header).
  1971 // (other items were commented in a header).
  1965 // -----------------------------------------------------------------------------
  1972 // -----------------------------------------------------------------------------
  1966 //
  1973 //
  1967 void CVIMPSTUiTabbedView::ChangeStatusProcessL()
  1974 void CVIMPSTUiTabbedView::ChangeStatusProcessL()
  1968     {
  1975     {
       
  1976 	TRACER_AUTO;
  1969     if( iEngine.ServiceState() )
  1977     if( iEngine.ServiceState() )
  1970         {
  1978         {
  1971         // Check variation
  1979         // Check variation
  1972         TInt showAppearOffline = 1;
  1980         TInt showAppearOffline = 1;
  1973         TInt showAway = 1 ;   
  1981         TInt showAway = 1 ;   
  2189 // CVIMPSTUiTabbedView::LoadOwnStatusIconsL
  2197 // CVIMPSTUiTabbedView::LoadOwnStatusIconsL
  2190 // ---------------------------------------------------------
  2198 // ---------------------------------------------------------
  2191 //
  2199 //
  2192 CAknIconArray* CVIMPSTUiTabbedView::LoadOwnStatusIconsL()
  2200 CAknIconArray* CVIMPSTUiTabbedView::LoadOwnStatusIconsL()
  2193     {
  2201     {
  2194 
  2202 	TRACER_AUTO;
  2195     CAknIconArray* icons = iBrandHandler->LoadOwnStatusIconsLC();
  2203     CAknIconArray* icons = iBrandHandler->LoadOwnStatusIconsLC();
  2196     CleanupStack::Pop( icons );
  2204     CleanupStack::Pop( icons );
  2197     return icons;
  2205     return icons;
  2198     }
  2206     }
  2199 
  2207 
  2203 // ---------------------------------------------------------
  2211 // ---------------------------------------------------------
  2204 //
  2212 //
  2205 TInt CVIMPSTUiTabbedView::AskStatusMessageL( TVIMPSTEnums::TOnlineStatus aStatus,
  2213 TInt CVIMPSTUiTabbedView::AskStatusMessageL( TVIMPSTEnums::TOnlineStatus aStatus,
  2206         TBool aUpdateToNetwork )
  2214         TBool aUpdateToNetwork )
  2207     {
  2215     {
       
  2216 	TRACER_AUTO;
  2208     CDesCArray* statusMessages = new( ELeave )CDesCArrayFlat(4);
  2217     CDesCArray* statusMessages = new( ELeave )CDesCArrayFlat(4);
  2209     CleanupStack::PushL( statusMessages );
  2218     CleanupStack::PushL( statusMessages );
  2210 
  2219 
  2211     HBufC* firstLine = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_NEW_MESSAGE );
  2220     HBufC* firstLine = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_NEW_MESSAGE );
  2212     statusMessages->AppendL( *firstLine );
  2221     statusMessages->AppendL( *firstLine );
  2285 // (other items were commented in a header).
  2294 // (other items were commented in a header).
  2286 // -----------------------------------------------------------------------------
  2295 // -----------------------------------------------------------------------------
  2287 //
  2296 //
  2288 void CVIMPSTUiTabbedView::ReadStatusMessagesL( CDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus)
  2297 void CVIMPSTUiTabbedView::ReadStatusMessagesL( CDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus)
  2289     {
  2298     {
       
  2299 	TRACER_AUTO;
  2290     RBuf buffer;
  2300     RBuf buffer;
  2291     buffer.CreateL( RProperty::KMaxPropertySize );
  2301     buffer.CreateL( RProperty::KMaxPropertySize );
  2292     CleanupClosePushL( buffer );
  2302     CleanupClosePushL( buffer );
  2293             TInt err(KErrNone);
  2303             TInt err(KErrNone);
  2294             switch ( aStatus )
  2304             switch ( aStatus )
  2366 // -----------------------------------------------------------------------------
  2376 // -----------------------------------------------------------------------------
  2367 //
  2377 //
  2368 
  2378 
  2369 void CVIMPSTUiTabbedView::WriteStatusMessagesL( MDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus )
  2379 void CVIMPSTUiTabbedView::WriteStatusMessagesL( MDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus )
  2370     {
  2380     {
  2371 
  2381 	TRACER_AUTO;
  2372     TPtrC firstLine = aArray.MdcaPoint( 0 );
  2382     TPtrC firstLine = aArray.MdcaPoint( 0 );
  2373     TInt countOfMessages( 0 );
  2383     TInt countOfMessages( 0 );
  2374     TInt arrayCount( aArray.MdcaCount() );
  2384     TInt arrayCount( aArray.MdcaCount() );
  2375     TInt index( 0 );
  2385     TInt index( 0 );
  2376 
  2386 
  2440 // (other items were commented in a header).
  2450 // (other items were commented in a header).
  2441 // -----------------------------------------------------------------------------
  2451 // -----------------------------------------------------------------------------
  2442 //
  2452 //
  2443 void CVIMPSTUiTabbedView::ChangeOwnAvatarL(const TDesC& aFileName, const TDesC8& aMimeType )
  2453 void CVIMPSTUiTabbedView::ChangeOwnAvatarL(const TDesC& aFileName, const TDesC8& aMimeType )
  2444 	{
  2454 	{
       
  2455 	TRACER_AUTO;
  2445 	MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface();
  2456 	MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface();
  2446 	TAvatarData avatarData;
  2457 	TAvatarData avatarData;
  2447 	avatarData.iStatus = arrayprocess.GetOnlineStatusL(0);
  2458 	avatarData.iStatus = arrayprocess.GetOnlineStatusL(0);
  2448 	avatarData.iStatusText.Copy( arrayprocess.StatusTextL(0) );
  2459 	avatarData.iStatusText.Copy( arrayprocess.StatusTextL(0) );
  2449 	avatarData.iFileName.Set(aFileName);
  2460 	avatarData.iFileName.Set(aFileName);
  2465 // CVIMPSTUiTabbedView::SearchContactsL
  2476 // CVIMPSTUiTabbedView::SearchContactsL
  2466 // --------------------------------------------------------------------------
  2477 // --------------------------------------------------------------------------
  2467 //
  2478 //
  2468 void CVIMPSTUiTabbedView:: SearchContactsL()
  2479 void CVIMPSTUiTabbedView:: SearchContactsL()
  2469 	{
  2480 	{
       
  2481 	TRACER_AUTO;
  2470 	CVIMPSTUiSearchFieldArray& fieldArray = iExtensionService.GetSearchFieldArray(); 
  2482 	CVIMPSTUiSearchFieldArray& fieldArray = iExtensionService.GetSearchFieldArray(); 
  2471 
  2483 
  2472 	if( !fieldArray.Count() )
  2484 	if( !fieldArray.Count() )
  2473 		{
  2485 		{
  2474 		return;	
  2486 		return;	
  2495 // CVIMPSTUiTabbedView::LaunchViewL()
  2507 // CVIMPSTUiTabbedView::LaunchViewL()
  2496 // ---------------------------------------------------------------------------
  2508 // ---------------------------------------------------------------------------
  2497 // 
  2509 // 
  2498 void CVIMPSTUiTabbedView::LaunchViewL( TInt aViewId )
  2510 void CVIMPSTUiTabbedView::LaunchViewL( TInt aViewId )
  2499     {
  2511     {
       
  2512 	TRACER_AUTO;
  2500 
  2513 
  2501     CPbk2ViewState* state = CPbk2ViewState::NewLC( );
  2514     CPbk2ViewState* state = CPbk2ViewState::NewLC( );
  2502 
  2515 
  2503     TInt searchViewId;
  2516     TInt searchViewId;
  2504     TInt err = iMapper.GetNewView( 
  2517     TInt err = iMapper.GetNewView( 
  2516 // CVIMPSTUiTabbedView::CreateToolBarL
  2529 // CVIMPSTUiTabbedView::CreateToolBarL
  2517 // ---------------------------------------------------------
  2530 // ---------------------------------------------------------
  2518 //
  2531 //
  2519 void CVIMPSTUiTabbedView::CreateToolBarL()
  2532 void CVIMPSTUiTabbedView::CreateToolBarL()
  2520     {
  2533     {
       
  2534 	TRACER_AUTO;
  2521     if ( AknLayoutUtils::PenEnabled() )
  2535     if ( AknLayoutUtils::PenEnabled() )
  2522         {
  2536         {
  2523         TInt resourceId = 0;
  2537         TInt resourceId = 0;
  2524         if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM) && 
  2538         if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM) && 
  2525                 !iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip))
  2539                 !iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip))
  2562 // CVIMPSTUiTabbedView::UpdateToolbarL
  2576 // CVIMPSTUiTabbedView::UpdateToolbarL
  2563 // ---------------------------------------------------------
  2577 // ---------------------------------------------------------
  2564 //
  2578 //
  2565 void CVIMPSTUiTabbedView::UpdateToolbarL()
  2579 void CVIMPSTUiTabbedView::UpdateToolbarL()
  2566     {
  2580     {
       
  2581 	TRACER_AUTO;
  2567     if ( AknLayoutUtils::PenEnabled() && iFixedToolbar && iContainer )    
  2582     if ( AknLayoutUtils::PenEnabled() && iFixedToolbar && iContainer )    
  2568         {
  2583         {
  2569         TInt currentItemIndex = iContainer->CurrentItemIndex();        
  2584         TInt currentItemIndex = iContainer->CurrentItemIndex();        
  2570         TVIMPSTEnums::TItem itemType = iCommandHandler.GetProcessInterface().GetType(currentItemIndex);         
  2585         TVIMPSTEnums::TItem itemType = iCommandHandler.GetProcessInterface().GetType(currentItemIndex);         
  2571         TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(currentItemIndex);        
  2586         TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(currentItemIndex);        
  2697 // CVIMPSTUiTabbedView::OfferToolbarEventL
  2712 // CVIMPSTUiTabbedView::OfferToolbarEventL
  2698 // ---------------------------------------------------------
  2713 // ---------------------------------------------------------
  2699 //        
  2714 //        
  2700 void CVIMPSTUiTabbedView::OfferToolbarEventL( TInt aCommand )
  2715 void CVIMPSTUiTabbedView::OfferToolbarEventL( TInt aCommand )
  2701     {
  2716     {
       
  2717 	TRACER_AUTO;
  2702     if ( AknLayoutUtils::PenEnabled() )
  2718     if ( AknLayoutUtils::PenEnabled() )
  2703         {
  2719         {
  2704         switch( aCommand )
  2720         switch( aCommand )
  2705             {
  2721             {
  2706             case ECmdToolbarVoipCall:
  2722             case ECmdToolbarVoipCall:
  2752 // CVIMPSTUiTabbedView::ProcessFriendRequestL
  2768 // CVIMPSTUiTabbedView::ProcessFriendRequestL
  2753 // ---------------------------------------------------------
  2769 // ---------------------------------------------------------
  2754 // 
  2770 // 
  2755 void CVIMPSTUiTabbedView::ProcessFriendRequestL()
  2771 void CVIMPSTUiTabbedView::ProcessFriendRequestL()
  2756     {
  2772     {
       
  2773 	TRACER_AUTO;
  2757     TInt index = CurrentItemIndex();    
  2774     TInt index = CurrentItemIndex();    
  2758     if( index <= 0 )
  2775     if( index <= 0 )
  2759         {
  2776         {
  2760         // return if item not found
  2777         // return if item not found
  2761         return; 
  2778         return; 
  2891 // ---------------------------------------------------------
  2908 // ---------------------------------------------------------
  2892 // CVIMPSTUiSearchView::ShowURLQueryL()
  2909 // CVIMPSTUiSearchView::ShowURLQueryL()
  2893 // ---------------------------------------------------------
  2910 // ---------------------------------------------------------
  2894 //
  2911 //
  2895 void CVIMPSTUiTabbedView::ShowURLQueryL( )
  2912 void CVIMPSTUiTabbedView::ShowURLQueryL( )
  2896     {    
  2913     {   
       
  2914 	TRACER_AUTO;
  2897     // Open browser with the specified URL
  2915     // Open browser with the specified URL
  2898     RBuf buffer;
  2916     RBuf buffer;
  2899     buffer.CreateL( RProperty::KMaxPropertySize );
  2917     buffer.CreateL( RProperty::KMaxPropertySize );
  2900     CleanupClosePushL( buffer );
  2918     CleanupClosePushL( buffer );
  2901     iSettingsStore->GetL(iServiceId, EServiceURLLink, buffer);      
  2919     iSettingsStore->GetL(iServiceId, EServiceURLLink, buffer);      
  2924 // CVIMPSTUiTabbedView::LoginL
  2942 // CVIMPSTUiTabbedView::LoginL
  2925 // -----------------------------------------------------------------------------
  2943 // -----------------------------------------------------------------------------
  2926 //
  2944 //
  2927 void CVIMPSTUiTabbedView::LoginL()
  2945 void CVIMPSTUiTabbedView::LoginL()
  2928     {
  2946     {
       
  2947 	TRACER_AUTO;
  2929     TBool IsPasswordSet = iEngine.IsPasswordAvailableL();
  2948     TBool IsPasswordSet = iEngine.IsPasswordAvailableL();
  2930 
  2949 
  2931     if(iUserId)
  2950     if(iUserId)
  2932         {
  2951         {
  2933         delete iUserId;
  2952         delete iUserId;
  2983 // CVIMPSTUiTabbedView::IsURLQueryToBeShownL
  3002 // CVIMPSTUiTabbedView::IsURLQueryToBeShownL
  2984 // -----------------------------------------------------------------------------
  3003 // -----------------------------------------------------------------------------
  2985 //
  3004 //
  2986 TBool CVIMPSTUiTabbedView::IsURLQueryToBeShownL()
  3005 TBool CVIMPSTUiTabbedView::IsURLQueryToBeShownL()
  2987     {
  3006     {
       
  3007 	TRACER_AUTO;
  2988     TBool urlQueryShown = EFalse;
  3008     TBool urlQueryShown = EFalse;
  2989     
  3009     
  2990     RBuf buffer;
  3010     RBuf buffer;
  2991     buffer.CreateL( RProperty::KMaxPropertySize );
  3011     buffer.CreateL( RProperty::KMaxPropertySize );
  2992     CleanupClosePushL( buffer );
  3012     CleanupClosePushL( buffer );
  3011 //               1 -> create new
  3031 //               1 -> create new
  3012 // ---------------------------------------------------------------------------
  3032 // ---------------------------------------------------------------------------
  3013 //
  3033 //
  3014 void CVIMPSTUiTabbedView::ShowUseExistingOrCreateNewMenuL( TInt& aMenuChoise )
  3034 void CVIMPSTUiTabbedView::ShowUseExistingOrCreateNewMenuL( TInt& aMenuChoise )
  3015     {
  3035     {
       
  3036 	TRACER_AUTO;
  3016     TInt rvalue( KErrGeneral );
  3037     TInt rvalue( KErrGeneral );
  3017 
  3038 
  3018     CAknSinglePopupMenuStyleListBox* accountList =
  3039     CAknSinglePopupMenuStyleListBox* accountList =
  3019     new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  3040     new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  3020     CleanupStack::PushL( accountList );
  3041     CleanupStack::PushL( accountList );
  3072 //               1 -> update existing
  3093 //               1 -> update existing
  3073 // ---------------------------------------------------------------------------
  3094 // ---------------------------------------------------------------------------
  3074 //
  3095 //
  3075 TInt CVIMPSTUiTabbedView::ShowNewUpdateQueryL()
  3096 TInt CVIMPSTUiTabbedView::ShowNewUpdateQueryL()
  3076     {
  3097     {
       
  3098 	TRACER_AUTO;
  3077     TInt retValue( KErrCancel );
  3099     TInt retValue( KErrCancel );
  3078 
  3100 
  3079     CAknSinglePopupMenuStyleListBox* selectionList =
  3101     CAknSinglePopupMenuStyleListBox* selectionList =
  3080                 new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  3102                 new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  3081     CleanupStack::PushL( selectionList );
  3103     CleanupStack::PushL( selectionList );
  3124 // CVIMPSTUiTabbedView::ShowLoginDialogL
  3146 // CVIMPSTUiTabbedView::ShowLoginDialogL
  3125 // ---------------------------------------------------------------------------
  3147 // ---------------------------------------------------------------------------
  3126 //
  3148 //
  3127 void CVIMPSTUiTabbedView::ShowLoginDialogL( TDes& aUserName, TDes& aPassword )
  3149 void CVIMPSTUiTabbedView::ShowLoginDialogL( TDes& aUserName, TDes& aPassword )
  3128     {
  3150     {
       
  3151 	TRACER_AUTO;
  3129     HBufC* userName = HBufC::NewLC( KUsernameMaxLength );
  3152     HBufC* userName = HBufC::NewLC( KUsernameMaxLength );
  3130     HBufC* passWord = HBufC::NewLC( KPasswordMaxLength );
  3153     HBufC* passWord = HBufC::NewLC( KPasswordMaxLength );
  3131 
  3154 
  3132     TPtr ptrUserName = userName->Des(); 
  3155     TPtr ptrUserName = userName->Des(); 
  3133     TPtr ptrPassWord = passWord->Des();
  3156     TPtr ptrPassWord = passWord->Des();
  3194 // CVIMPSTUiTabbedView::CloseConversation
  3217 // CVIMPSTUiTabbedView::CloseConversation
  3195 // ---------------------------------------------------------------------------
  3218 // ---------------------------------------------------------------------------
  3196 //
  3219 //
  3197 void CVIMPSTUiTabbedView::CloseConversationL()
  3220 void CVIMPSTUiTabbedView::CloseConversationL()
  3198     {
  3221     {
       
  3222 	TRACER_AUTO;
  3199     TInt index = CurrentItemIndex();    
  3223     TInt index = CurrentItemIndex();    
  3200     if( index <= 0 )
  3224     if( index <= 0 )
  3201         {
  3225         {
  3202         // return if item not found
  3226         // return if item not found
  3203         return; 
  3227         return; 
  3228 // ( Reserved for future use )
  3252 // ( Reserved for future use )
  3229 // ----------------------------------------------------
  3253 // ----------------------------------------------------
  3230 //
  3254 //
  3231 void CVIMPSTUiTabbedView::HandleServerAppExit( TInt /*aReason*/ )
  3255 void CVIMPSTUiTabbedView::HandleServerAppExit( TInt /*aReason*/ )
  3232     {
  3256     {
       
  3257 	TRACER_AUTO;
  3233     TInt error = KErrNone;
  3258     TInt error = KErrNone;
  3234     TRAPD(leaveErr,error = ShowTermsofuseL());
  3259     TRAPD(leaveErr,error = ShowTermsofuseL());
  3235     if(KErrNone == error && KErrNone == leaveErr)
  3260     if(KErrNone == error && KErrNone == leaveErr)
  3236         {
  3261         {
  3237         TRAP_IGNORE(iCommandHandler.HandleCommandL(ELoginService, this, &iServiceId)); 
  3262         TRAP_IGNORE(iCommandHandler.HandleCommandL(ELoginService, this, &iServiceId)); 
  3243 // ( Reserved for future use )
  3268 // ( Reserved for future use )
  3244 // ----------------------------------------------------
  3269 // ----------------------------------------------------
  3245 //
  3270 //
  3246 TInt CVIMPSTUiTabbedView::ShowTermsofuseL()
  3271 TInt CVIMPSTUiTabbedView::ShowTermsofuseL()
  3247     {
  3272     {
       
  3273 	TRACER_AUTO;
  3248     TInt retVal = KErrNone;
  3274     TInt retVal = KErrNone;
  3249     // get the  ETOUDlgOff if its set don't show TOU dialog else show TOU 
  3275     // get the  ETOUDlgOff if its set don't show TOU dialog else show TOU 
  3250     TInt termsOfUseDisabled = KErrNone;
  3276     TInt termsOfUseDisabled = KErrNone;
  3251     iSettingsStore->GetL(iServiceId, ETOUDlgOff, termsOfUseDisabled);
  3277     iSettingsStore->GetL(iServiceId, ETOUDlgOff, termsOfUseDisabled);
  3252     if( !termsOfUseDisabled)
  3278     if( !termsOfUseDisabled)
  3270 // ( Reserved for future use )
  3296 // ( Reserved for future use )
  3271 // ----------------------------------------------------
  3297 // ----------------------------------------------------
  3272 //
  3298 //
  3273 void CVIMPSTUiTabbedView::MakeVoipCallL()
  3299 void CVIMPSTUiTabbedView::MakeVoipCallL()
  3274     {
  3300     {
       
  3301 	TRACER_AUTO;
  3275     // making voip call will take in three steps
  3302     // making voip call will take in three steps
  3276     // pop up the selection dialog
  3303     // pop up the selection dialog
  3277     // select adress
  3304     // select adress
  3278     // create a call
  3305     // create a call
  3279     TInt index = CurrentItemIndex();  
  3306     TInt index = CurrentItemIndex();  
  3317 // ---------------------------------------------------------
  3344 // ---------------------------------------------------------
  3318 // CVIMPSTUiTabbedView::ExecuteAiwCallL
  3345 // CVIMPSTUiTabbedView::ExecuteAiwCallL
  3319 // ---------------------------------------------------------
  3346 // ---------------------------------------------------------
  3320 void CVIMPSTUiTabbedView::ExecuteAiwCallL( const TDesC& aSelectedAddress )
  3347 void CVIMPSTUiTabbedView::ExecuteAiwCallL( const TDesC& aSelectedAddress )
  3321 	{
  3348 	{
       
  3349 	TRACER_AUTO;
  3322 	//aSelectedAdress will be an xsp id of format "ServiceName:UserId"
  3350 	//aSelectedAdress will be an xsp id of format "ServiceName:UserId"
  3323 	//here we need to truncate the servicename and pass only the UserId
  3351 	//here we need to truncate the servicename and pass only the UserId
  3324     //Find if aSelectedAdress of type "ServiceName:UserId"
  3352     //Find if aSelectedAdress of type "ServiceName:UserId"
  3325 	//if true, then remove the service part
  3353 	//if true, then remove the service part
  3326     TInt phoneNumberStart = aSelectedAddress.Locate(':');
  3354     TInt phoneNumberStart = aSelectedAddress.Locate(':');
  3367 // ---------------------------------------------------------
  3395 // ---------------------------------------------------------
  3368 //
  3396 //
  3369 
  3397 
  3370 void CVIMPSTUiTabbedView::LaunchHelpL( const TDesC& aContext )
  3398 void CVIMPSTUiTabbedView::LaunchHelpL( const TDesC& aContext )
  3371     {
  3399     {
       
  3400 	TRACER_AUTO;
  3372     CArrayFix< TCoeHelpContext >* cntx = new( ELeave ) CArrayFixFlat< TCoeHelpContext >( KHelpContextSize );
  3401     CArrayFix< TCoeHelpContext >* cntx = new( ELeave ) CArrayFixFlat< TCoeHelpContext >( KHelpContextSize );
  3373     CleanupStack::PushL( cntx );
  3402     CleanupStack::PushL( cntx );
  3374 
  3403 
  3375     TUid KHelpUid = { KHELPUID };
  3404     TUid KHelpUid = { KHELPUID };
  3376     cntx->AppendL( TCoeHelpContext( KHelpUid, aContext ) );
  3405     cntx->AppendL( TCoeHelpContext( KHelpUid, aContext ) );
  3393 // CVIMPSTUiTabbedView::CancelLoginSupportedL()
  3422 // CVIMPSTUiTabbedView::CancelLoginSupportedL()
  3394 // ----------------------------------------------------
  3423 // ----------------------------------------------------
  3395 //
  3424 //
  3396 TBool CVIMPSTUiTabbedView::CancelLoginSupportedL()
  3425 TBool CVIMPSTUiTabbedView::CancelLoginSupportedL()
  3397     {
  3426     {
       
  3427 	TRACER_AUTO;
  3398     TInt cancelNotSupported(KErrNone);
  3428     TInt cancelNotSupported(KErrNone);
  3399     TBool returnValue = ETrue;
  3429     TBool returnValue = ETrue;
  3400     // read from the cenrep settings 
  3430     // read from the cenrep settings 
  3401     TInt err = iSettingsStore->GetL(iServiceId, EServiceCancelLoginNotSupported,cancelNotSupported);
  3431     TInt err = iSettingsStore->GetL(iServiceId, EServiceCancelLoginNotSupported,cancelNotSupported);
  3402     // if any error  OR  cancelNotSupported = 1 then 
  3432     // if any error  OR  cancelNotSupported = 1 then 
  3412 // CVIMPSTUiTabbedView::ChangeConnectionSupportedL()
  3442 // CVIMPSTUiTabbedView::ChangeConnectionSupportedL()
  3413 // ----------------------------------------------------
  3443 // ----------------------------------------------------
  3414 //
  3444 //
  3415 TBool CVIMPSTUiTabbedView::ChangeConnectionSupportedL()
  3445 TBool CVIMPSTUiTabbedView::ChangeConnectionSupportedL()
  3416     {
  3446     {
       
  3447 	TRACER_AUTO;
  3417     TInt changeConnectionSupported(KErrNone);
  3448     TInt changeConnectionSupported(KErrNone);
  3418     TBool returnValue = ETrue;
  3449     TBool returnValue = ETrue;
  3419     // read from the cenrep settings 
  3450     // read from the cenrep settings 
  3420     TInt err = iSettingsStore->GetL(iServiceId, EServiceChangeConnectionNotSupported,changeConnectionSupported);
  3451     TInt err = iSettingsStore->GetL(iServiceId, EServiceChangeConnectionNotSupported,changeConnectionSupported);
  3421     // if any error  OR  cancelNotSupported = 1 then 
  3452     // if any error  OR  cancelNotSupported = 1 then 
  3434         TInt aCmdId,
  3465         TInt aCmdId,
  3435         TInt aEventId,
  3466         TInt aEventId,
  3436         CAiwGenericParamList& aEventParamList,
  3467         CAiwGenericParamList& aEventParamList,
  3437         const CAiwGenericParamList& /* aInParamList */)
  3468         const CAiwGenericParamList& /* aInParamList */)
  3438 	{
  3469 	{
       
  3470 	TRACER_AUTO;
  3439 	TInt result = 0;
  3471 	TInt result = 0;
  3440 		if( (aCmdId == KAiwCmdSelect) && (aEventId == KAiwEventCompleted && iSelectedAction == ECreateXSPCall ))
  3472 		if( (aCmdId == KAiwCmdSelect) && (aEventId == KAiwEventCompleted && iSelectedAction == ECreateXSPCall ))
  3441 			{
  3473 			{
  3442 			if( iQueryResult )
  3474 			if( iQueryResult )
  3443 				{
  3475 				{
  3525 // CVIMPSTUiTabbedView::BlockContactL
  3557 // CVIMPSTUiTabbedView::BlockContactL
  3526 // --------------------------------------------------------------------------
  3558 // --------------------------------------------------------------------------
  3527 //
  3559 //
  3528 void CVIMPSTUiTabbedView::BlockContactL(TBool aBlock /* = EFalse */)
  3560 void CVIMPSTUiTabbedView::BlockContactL(TBool aBlock /* = EFalse */)
  3529     {
  3561     {
       
  3562 	TRACER_AUTO;
  3530     TInt index = CurrentItemIndex();
  3563     TInt index = CurrentItemIndex();
  3531     if(iContainer)
  3564     if(iContainer)
  3532         {
  3565         {
  3533         iContainer->CheckAndSetLastItemFlag();
  3566         iContainer->CheckAndSetLastItemFlag();
  3534         }
  3567         }
  3579 // --------------------------------------------------------------------------
  3612 // --------------------------------------------------------------------------
  3580 // CVIMPSTUiTabbedView::ShowBlockedContactListL
  3613 // CVIMPSTUiTabbedView::ShowBlockedContactListL
  3581 // --------------------------------------------------------------------------
  3614 // --------------------------------------------------------------------------
  3582 void CVIMPSTUiTabbedView::ShowBlockedContactListL()
  3615 void CVIMPSTUiTabbedView::ShowBlockedContactListL()
  3583 	{
  3616 	{
       
  3617 	TRACER_AUTO;
  3584 	if(!iIsToolBarHidden)
  3618 	if(!iIsToolBarHidden)
  3585 	    {
  3619 	    {
  3586 	    ShowHideFixedToolbarL(EFalse);
  3620 	    ShowHideFixedToolbarL(EFalse);
  3587 	    }
  3621 	    }
  3588 
  3622 
  3598 // --------------------------------------------------------------------------
  3632 // --------------------------------------------------------------------------
  3599 // CVIMPSTUiTabbedView::HandleContactSelectionCompleteL
  3633 // CVIMPSTUiTabbedView::HandleContactSelectionCompleteL
  3600 // --------------------------------------------------------------------------
  3634 // --------------------------------------------------------------------------
  3601 void CVIMPSTUiTabbedView::HandleContactSelectionCompleteL()
  3635 void CVIMPSTUiTabbedView::HandleContactSelectionCompleteL()
  3602 	{
  3636 	{
  3603 	 CHAT_DP_FUNC_ENTER("CVIMPSTUiTabbedView::HandleContactSelectionCompleteL");
  3637 	TRACER_AUTO;
       
  3638 	
  3604 	 if( iWaitNote )
  3639 	 if( iWaitNote )
  3605 	        {
  3640 	        {
  3606 	        delete iWaitNote;
  3641 	        delete iWaitNote;
  3607 	        iWaitNote = NULL;
  3642 	        iWaitNote = NULL;
  3608 	        }
  3643 	        }
  3610         {
  3645         {
  3611         iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse );
  3646         iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse );
  3612 
  3647 
  3613         if ( iSelectedData.iPackedLinks )                     //add the selected contact to the service tab
  3648         if ( iSelectedData.iPackedLinks )                     //add the selected contact to the service tab
  3614             {
  3649             {
  3615             CHAT_DP_FUNC_DP("CVIMPSTUiTabbedView","process contact");
  3650             TRACE("process contact");
  3616             if( iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptCreateNew )
  3651             if( iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptCreateNew )
  3617                    {
  3652                    {
  3618                  iCommandHandler.HandleCommandL( ECmdProcessAcceptedContactNew, this, (TAny*)&iSelectedData );
  3653                  iCommandHandler.HandleCommandL( ECmdProcessAcceptedContactNew, this, (TAny*)&iSelectedData );
  3619                    }
  3654                    }
  3620             else
  3655             else
  3627         iSelectedData.iXSPList.ResetAndDestroy();
  3662         iSelectedData.iXSPList.ResetAndDestroy();
  3628        
  3663        
  3629         //invitation has been accepted using update existing contact
  3664         //invitation has been accepted using update existing contact
  3630         // updation is successful
  3665         // updation is successful
  3631         // send accepted request to command/engine/server   
  3666         // send accepted request to command/engine/server   
  3632         CHAT_DP_FUNC_DP("HandleSessionContextEventL","frnrequest accepted");
  3667         TRACE("frnrequest accepted");
  3633         iCommandHandler.HandleCommandL(EFriendAccpeted, this, iFriendRequestId );
  3668         iCommandHandler.HandleCommandL(EFriendAccpeted, this, iFriendRequestId );
  3634         }
  3669         }
  3635      else if(  iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew ||  iSelectedAction == CVIMPSTUiTabbedView::EContactAddFromContacts)
  3670      else if(  iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew ||  iSelectedAction == CVIMPSTUiTabbedView::EContactAddFromContacts)
  3636          {
  3671          {
  3637          MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ;
  3672          MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ;
  3650              iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse );
  3685              iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse );
  3651              }
  3686              }
  3652 
  3687 
  3653          if ( iSelectedData.iPackedLinks )                     //add the selected contact to the service tab
  3688          if ( iSelectedData.iPackedLinks )                     //add the selected contact to the service tab
  3654              {
  3689              {
  3655              CHAT_DP_FUNC_DP("CVIMPSTUiTabbedView","process contact");
  3690            TRACE("process contact");
  3656              if( iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew )
  3691              if( iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew )
  3657                  {
  3692                  {
  3658                  iCommandHandler.HandleCommandL( ECmdProcessSelectedContactNew, this, (TAny*)&iSelectedData );
  3693                  iCommandHandler.HandleCommandL( ECmdProcessSelectedContactNew, this, (TAny*)&iSelectedData );
  3659                  }
  3694                  }
  3660              else
  3695              else
  3680 		 ExecuteAiwCallL(*iQueryResult );
  3715 		 ExecuteAiwCallL(*iQueryResult );
  3681 		 delete iQueryResult;
  3716 		 delete iQueryResult;
  3682 		 iQueryResult = NULL;	
  3717 		 iQueryResult = NULL;	
  3683 		 }
  3718 		 }
  3684     iSelectedAction = KErrNotFound;  // This is to clear the previous selected action.
  3719     iSelectedAction = KErrNotFound;  // This is to clear the previous selected action.
  3685     CHAT_DP_FUNC_DONE("CVIMPSTUiTabbedView::HandleContactSelectionCompleteL");  
  3720       
  3686 	}
  3721 	}
  3687 
  3722 
  3688 // --------------------------------------------------------------------------
  3723 // --------------------------------------------------------------------------
  3689 // CVIMPSTUiTabbedView::LaunchSettingsViewL
  3724 // CVIMPSTUiTabbedView::LaunchSettingsViewL
  3690 // --------------------------------------------------------------------------
  3725 // --------------------------------------------------------------------------
  3701     **************************************************************************************
  3736     **************************************************************************************
  3702     CSC team agreed to provide new generic CSC view launcher API, once CSC provide new API
  3737     CSC team agreed to provide new generic CSC view launcher API, once CSC provide new API
  3703     below code need to remove and new API will be called.
  3738     below code need to remove and new API will be called.
  3704     ***************************************************************************************
  3739     ***************************************************************************************
  3705     */
  3740     */
  3706         
  3741 	TRACER_AUTO; 
  3707     _LIT(KStartupParams, "ACTION=4 SERID=");
  3742     _LIT(KStartupParams, "ACTION=4 SERID=");
  3708     _LIT8(KStartupParams8, "ACTION=4 SERID=");
  3743     _LIT8(KStartupParams8, "ACTION=4 SERID=");
  3709     //Take CSC UID (In future if this UID change , we also need to change it otherwise we will not be able
  3744     //Take CSC UID (In future if this UID change , we also need to change it otherwise we will not be able
  3710     //to launch CSC settings.
  3745     //to launch CSC settings.
  3711     const TUid KCSCAppUid = { 0x10275458 };
  3746     const TUid KCSCAppUid = { 0x10275458 };
  3753 // CVIMPSTUiTabbedView::ReInitializeServiceHandlerL()
  3788 // CVIMPSTUiTabbedView::ReInitializeServiceHandlerL()
  3754 // --------------------------------------------------------------------------
  3789 // --------------------------------------------------------------------------
  3755 
  3790 
  3756 void CVIMPSTUiTabbedView::ReInitializeServiceHandlerL()
  3791 void CVIMPSTUiTabbedView::ReInitializeServiceHandlerL()
  3757     {
  3792     {
       
  3793 	TRACER_AUTO;
  3758     if(iIsServiceHandleReSet )
  3794     if(iIsServiceHandleReSet )
  3759         {
  3795         {
  3760         if(iServiceHandler)
  3796         if(iServiceHandler)
  3761             {
  3797             {
  3762             iServiceHandler->AttachL( R_IM_APP_INTEREST );
  3798             iServiceHandler->AttachL( R_IM_APP_INTEREST );
  3774 	// CVIMPSTUiTabbedView::LaunchFetchDialogL()
  3810 	// CVIMPSTUiTabbedView::LaunchFetchDialogL()
  3775 	// --------------------------------------------------------------------------
  3811 	// --------------------------------------------------------------------------
  3776 
  3812 
  3777 void CVIMPSTUiTabbedView::LaunchFetchDialogL()
  3813 void CVIMPSTUiTabbedView::LaunchFetchDialogL()
  3778     {
  3814     {
       
  3815 	TRACER_AUTO;
  3779     iSelectedAction = EContactAddFromContacts;
  3816     iSelectedAction = EContactAddFromContacts;
  3780     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ;
  3817     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ;
  3781     TBool localStore = EFalse;
  3818     TBool localStore = EFalse;
  3782     if( storage )
  3819     if( storage )
  3783         {
  3820         {
  3805 	// CVIMPSTUiTabbedView::ExecuteSingleItemFetchL
  3842 	// CVIMPSTUiTabbedView::ExecuteSingleItemFetchL
  3806 	// --------------------------------------------------------------------------
  3843 	// --------------------------------------------------------------------------
  3807 
  3844 
  3808 void CVIMPSTUiTabbedView::ExecuteSingleItemFetchL( TAiwSingleEntrySelectionDataV2 aData )
  3845 void CVIMPSTUiTabbedView::ExecuteSingleItemFetchL( TAiwSingleEntrySelectionDataV2 aData )
  3809     {
  3846     {
       
  3847 	TRACER_AUTO;
  3810     if(iAiwParamList)
  3848     if(iAiwParamList)
  3811            {
  3849            {
  3812            delete iAiwParamList;
  3850            delete iAiwParamList;
  3813            iAiwParamList = NULL;
  3851            iAiwParamList = NULL;
  3814            }        
  3852            }        
  3831 // --------------------------------------------------------------------------
  3869 // --------------------------------------------------------------------------
  3832 // CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL
  3870 // CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL
  3833 // --------------------------------------------------------------------------
  3871 // --------------------------------------------------------------------------
  3834 void CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL( TAiwMultipleEntrySelectionDataV2 aData )
  3872 void CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL( TAiwMultipleEntrySelectionDataV2 aData )
  3835     {
  3873     {
       
  3874 	TRACER_AUTO;
  3836     if(iAiwParamList)
  3875     if(iAiwParamList)
  3837         {
  3876         {
  3838         delete iAiwParamList;
  3877         delete iAiwParamList;
  3839         iAiwParamList = NULL;
  3878         iAiwParamList = NULL;
  3840         }        
  3879         }