Revision: 201013 RCL_3 PDK_3.0.i
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 15:58:44 +0300
branchRCL_3
changeset 9 fc313e1df071
parent 8 b2f9a76933e1
child 11 6347473a7bb2
Revision: 201013 Kit: 201015
srsf/nssvasapi/nssvascore/src/vascvpbkhandler.cpp
voiceui/pbkinfoviewimpl/group/pbkinfoview.mmp
voiceui/pbkinfoviewimpl/inc/pbkinfoviewdialog.h
voiceui/pbkinfoviewimpl/inc/pbkinfoviewsindhandler.h
voiceui/pbkinfoviewimpl/src/pbkinfoviewdialog.cpp
voiceui/pbkinfoviewimpl/src/pbkinfoviewsindhandler.cpp
voiceui/vcommand/data/vcommand.rss
voiceui/vcommand/src/vcplaybackdialog.cpp
--- a/srsf/nssvasapi/nssvascore/src/vascvpbkhandler.cpp	Wed Mar 31 21:32:56 2010 +0300
+++ b/srsf/nssvasapi/nssvascore/src/vascvpbkhandler.cpp	Wed Apr 14 15:58:44 2010 +0300
@@ -1076,6 +1076,12 @@
         {
         accept = EFalse;
         }
+    else if ( aCommandType == EVoipCommand &&
+              aField.BestMatchingFieldType()->FieldTypeResId() != R_VPBK_FIELD_TYPE_MOBILEPHONEGEN &&
+              aField.BestMatchingFieldType()->FieldTypeResId() != R_VPBK_FIELD_TYPE_LANDPHONEGEN )
+        {
+        accept = EFalse;
+        }
         
     RUBY_DEBUG0( "CVasVPbkHandler::AcceptDefaultField EXIT" );
         
--- a/voiceui/pbkinfoviewimpl/group/pbkinfoview.mmp	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/pbkinfoviewimpl/group/pbkinfoview.mmp	Wed Apr 14 15:58:44 2010 +0300
@@ -82,6 +82,9 @@
 LIBRARY pbkeng.lib
 LIBRARY nssttscommon.lib
 
+LIBRARY VPbkEng.lib
+LIBRARY Pbk2Presentation.lib
+LIBRARY Pbk2CommonUI.lib
 //EXPORTUNFROZEN
 
 
--- a/voiceui/pbkinfoviewimpl/inc/pbkinfoviewdialog.h	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/pbkinfoviewimpl/inc/pbkinfoviewdialog.h	Wed Apr 14 15:58:44 2010 +0300
@@ -39,16 +39,17 @@
 */
 NONSHARABLE_CLASS (CPbkInfoViewDialog) : public CAknDialog, public MEikListBoxObserver
 	{
-	enum TInfoViewDialogIconIndex
+    enum TInfoViewDialogIconIndex
 		{
-	    EIconIndexMobile = 0,
-        EIconIndexPhone,
+		EIconIndexPhone = 0,
+		EIconIndexMobile,
 	    EIconIndexVideo,
+	    EIconIndexVoip,
 	    EIconIndexEmail,
-	    EIconIndexVoip,
+	    EIconIndexXsp,
 	    EIconIndexEmpty
-		};
-	
+		};	
+
     public:// Constructors and destructor
 
         /**
@@ -203,6 +204,11 @@
 	    */		
 		void CallInProgressNoteL();
 		
+		/**
+	    * Create field icons
+	    */			
+		void CreateFieldIconsL(CArrayPtr<CGulIcon>* aIconArray);
+		
 	private: // from MEikListBoxObserver
         /**
         * From MEikListBoxObserver, called by framework.
@@ -243,6 +249,9 @@
 		
 		// SIND handler
 		CPbkInfoViewSindHandler* iSindHandler;
+		
+		// Xsp flag
+		TBool isXsp;
     };
 
 #endif    // PBKINFOVIEWDIALOG_H
--- a/voiceui/pbkinfoviewimpl/inc/pbkinfoviewsindhandler.h	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/pbkinfoviewimpl/inc/pbkinfoviewsindhandler.h	Wed Apr 14 15:58:44 2010 +0300
@@ -120,6 +120,12 @@
          * @return TInt the icon id
          */
          TInt IconIdL( TInt aIndex );
+		 
+         /**
+         * Returns an field id
+		 * @return TInt the field id
+         */
+         TInt FieldIdL();
          
          /**
          * Calls CompareL and catches possible leaves
--- a/voiceui/pbkinfoviewimpl/src/pbkinfoviewdialog.cpp	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/pbkinfoviewimpl/src/pbkinfoviewdialog.cpp	Wed Apr 14 15:58:44 2010 +0300
@@ -38,6 +38,29 @@
 #include <aknnotewrappers.h>  // For information note
 #include <StringLoader.h>
 
+#include <MPbk2FieldPropertyArray.h>
+#include <VPbkEng.rsg>
+#include <CPbk2StoreConfiguration.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <CVPbkContactManager.h>
+#include <VPbkContactStoreUris.h>
+#include <CVPbkFieldTypeRefsList.h>	
+#include <CPbk2IconFactory.h>
+#include <Pbk2FieldPropertiesFactory.h>
+#include <MPbk2FieldProperty.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <PbkFields.hrh>
+
+const TUint KFieldIds[] = 
+    {
+    R_VPBK_FIELD_TYPE_LANDPHONEGEN,    
+    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,  
+    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
+    R_VPBK_FIELD_TYPE_VOIPGEN,
+    R_VPBK_FIELD_TYPE_EMAILGEN,
+    R_VPBK_FIELD_TYPE_IMPP
+    };
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -447,45 +470,13 @@
 	CleanupStack::PopAndDestroy( des );
     
     // Set icons
-	TFileName bitmapName;
-	CPbkInfoViewResHandler::GetBitmapFileName( bitmapName );
+
 	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray( KDefaultArraySize );
 	CleanupStack::PushL( icons );
 	
-	// NOTE: icons must be appended in the order of enumeration 
-	// TInfoViewDialogIconIndex
-	icons->AppendL( TDialogUtil::CreateIconL(
-	                KAknsIIDQgnPropNrtypMobile, bitmapName,
-	                EMbmAvkonQgn_prop_nrtyp_mobile, 
-	                EMbmAvkonQgn_prop_nrtyp_mobile_mask ) );
-	
-	icons->AppendL( TDialogUtil::CreateIconL( 
-	                KAknsIIDQgnPropNrtypPhone, bitmapName,
-	                EMbmAvkonQgn_prop_nrtyp_phone,
-	                EMbmAvkonQgn_prop_nrtyp_phone_mask ) );
-	                
-	icons->AppendL( TDialogUtil::CreateIconL( 
-	                KAknsIIDQgnPropFolderVideo, bitmapName,
-	                EMbmAvkonQgn_prop_nrtyp_video,
-	                EMbmAvkonQgn_prop_nrtyp_video_mask ) );
-	                
-	icons->AppendL( TDialogUtil::CreateIconL(
-	                KAknsIIDQgnPropMceEmailTitle, bitmapName,
-	                EMbmAvkonQgn_prop_nrtyp_email,
-	                EMbmAvkonQgn_prop_nrtyp_email_mask ) );
-	                
-	icons->AppendL( TDialogUtil::CreateIconL(
-	                KAknsIIDQgnIndiVoipCallActive, bitmapName,
-	                EMbmAvkonQgn_prop_nrtyp_voip,
-	                EMbmAvkonQgn_prop_nrtyp_voip_mask ) );
-	
-	icons->AppendL( TDialogUtil::CreateIconL(
-	                KAknsIIDQgnLogoEmpty, bitmapName,
-	                EMbmAvkonQgn_prop_empty,
-	                EMbmAvkonQgn_prop_empty_mask ) );
-	
-	iListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons );
-	CleanupStack::Pop( icons );
+	CreateFieldIconsL( icons );
+    
+    CleanupStack::Pop( icons );
 
 	CreateListBoxItemsL();
 	
@@ -543,7 +534,14 @@
 		    iconIndex = EIconIndexEmail;
 		    break;
 		case EPbkqgn_prop_nrtyp_voip:
-		    iconIndex = EIconIndexVoip;
+			if ( isXsp )
+				{
+				iconIndex = EIconIndexXsp;
+				}
+			else
+				{
+				iconIndex = EIconIndexVoip;
+				}
 		    break;
 		default:
 		    iconIndex = EIconIndexEmpty;    
@@ -576,6 +574,11 @@
 		HBufC* firstLine = iSindHandler->VoiceTagLabelLC( i );
 		// Phone number, email address, etc...
 		HBufC* secondLine = iSindHandler->VoiceTagValueL( i ).AllocLC();
+        isXsp = EFalse;
+		if( iSindHandler->FieldIdL() == EPbkFieldIdXsp )
+			{
+			isXsp = ETrue;
+			}
 		TInt iconIndex = IconIndex( iSindHandler->IconIdL( i ) );
 
 		TPtr ptr1 = firstLine->Des();
@@ -702,4 +705,59 @@
     CleanupStack::PopAndDestroy( noteText );
 	}
 
+void CPbkInfoViewDialog::CreateFieldIconsL(CArrayPtr<CGulIcon>* aIconArray)
+	{
+    CPbk2StoreConfiguration* configuration = CPbk2StoreConfiguration::NewL();
+    CleanupStack::PushL(configuration);
+	    
+    CVPbkContactStoreUriArray* uriArray = configuration->CurrentConfigurationL();
+    CleanupStack::PushL( uriArray ); 
+    if ( uriArray->IsIncluded(VPbkContactStoreUris::DefaultCntDbUri()) == EFalse )
+        {
+        uriArray->AppendL( VPbkContactStoreUris::DefaultCntDbUri() );	
+	    }    
+    
+    CVPbkContactManager* contactManager = CVPbkContactManager::NewL(*uriArray);
+    CleanupStack::PushL( contactManager );
+	    
+    TInt arraySize = sizeof KFieldIds / sizeof KFieldIds[0];
+    TInt count =0;
+    const MVPbkFieldType* fieldType = NULL;
+    CGulIcon* icon = NULL;
+			
+    CVPbkFieldTypeRefsList* fieldTypeList = CVPbkFieldTypeRefsList::NewL();
+    CleanupStack::PushL( fieldTypeList );
+    
+    for( count = 0; count < arraySize;  ++count )
+        {
+        fieldType = contactManager->FieldTypes().Find( KFieldIds[count] );
+        fieldTypeList->AppendL(*fieldType);	
+        }
+			
+    MPbk2FieldPropertyArray* propertyArray = Pbk2FieldPropertiesFactory::CreateLC(*fieldTypeList,
+                                                 &contactManager->FsSession() );
+    
+    CPbk2IconFactory* pbk2IconFactory = CPbk2IconFactory::NewL();
+    CleanupStack::PushL( pbk2IconFactory );
+    
+    for( count = 0; count < propertyArray->Count(); ++ count)
+        {
+        icon = pbk2IconFactory->CreateIconL( propertyArray->At(count).IconId());
+        aIconArray->AppendL(icon);
+        }
+
+	iListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( aIconArray );
+	
+    //Destroy: configuration,uriArray,contactManager
+    //fieldTypeList,propertyArray,pbk2IconFactory
+    CleanupStack::PopAndDestroy( 6,configuration ); 	
+    
+	TFileName bitmapName;
+	CPbkInfoViewResHandler::GetBitmapFileName( bitmapName );
+	
+	aIconArray->AppendL( TDialogUtil::CreateIconL(
+	                KAknsIIDQgnLogoEmpty, bitmapName,
+	                EMbmAvkonQgn_prop_empty,
+	                EMbmAvkonQgn_prop_empty_mask ) );
+	}
 //  End of File  
--- a/voiceui/pbkinfoviewimpl/src/pbkinfoviewsindhandler.cpp	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/pbkinfoviewimpl/src/pbkinfoviewsindhandler.cpp	Wed Apr 14 15:58:44 2010 +0300
@@ -33,7 +33,25 @@
 
 #include "rubydebug.h"
 
-
+// ----------------------------------------------------------------------------
+// RemapCommand
+// Remap command to the correct order.
+// @param aCommandId 
+// ----------------------------------------------------------------------------
+static TInt RemapCommand( TInt aCommandId )
+    {
+    switch (aCommandId)
+        {
+        case EEmailCommand:
+            return EMessageCommand;
+        case EVoipCommand:
+            return EEmailCommand;
+        case EMessageCommand:
+            return EVoipCommand;
+        default:
+            return aCommandId;
+        }
+    }
 // ================= MEMBER FUNCTIONS =======================
 
 inline CPbkInfoViewSindHandler::CPbkInfoViewSindHandler()
@@ -485,6 +503,16 @@
     }
 
 // ----------------------------------------------------------------------------
+// CPbkInfoViewSindHandler::FieldIdL
+// Returns an field id for the contact field.
+// @return TInt the field id
+// ----------------------------------------------------------------------------
+TInt CPbkInfoViewSindHandler::FieldIdL( )
+	{
+	return iPbkHandler->FieldIdL();
+	}
+
+// ----------------------------------------------------------------------------
 // CPbkInfoViewSindHandler::CreateVoiceTagListL
 // Fetches voice tag list from vas db.
 // @param aContactId Contact id for the contact whose voice tags are
@@ -812,26 +840,29 @@
         return 1;
         }
             
-    // compare the two neighbors
-    TInt ret = field1->Compare( *field2 );
-    
-    // Sorting for normal call, sms, and multimedia msg fields
-    if ( ret == 0)
-        {
-        TInt actionId1 = tag1.RRD()->IntArray()->At( KVasExtensionRrdLocation );
-        TInt actionId2 = tag2.RRD()->IntArray()->At( KVasExtensionRrdLocation );
-        
-        if ( actionId1 != actionId2 )
-            {
-            if ( actionId1 < actionId2 )
-                {
-                return -1;
-                }
-            return 1;
-            }
-        }
-        
-    return ret;
+//    // compare the two neighbors
+//    TInt ret = field1->Compare( *field2 );
+//    
+//    // Sorting for normal call, sms, and multimedia msg fields
+//    if ( ret == 0)
+//        {
+//        TInt actionId1 = tag1.RRD()->IntArray()->At( KVasExtensionRrdLocation );
+//        TInt actionId2 = tag2.RRD()->IntArray()->At( KVasExtensionRrdLocation );
+//        
+//        if ( actionId1 != actionId2 )
+//            {
+//            if ( actionId1 < actionId2 )
+//                {
+//                return -1;
+//                }
+//            return 1;
+//            }
+//        }
+//        
+//    return ret;
+    TInt cmdId1 = tag1.RRD()->IntArray()->At( KVasExtensionCommandRrdLocation );
+    TInt cmdId2 = tag2.RRD()->IntArray()->At( KVasExtensionCommandRrdLocation );
+    return ( RemapCommand( cmdId1 ) - RemapCommand( cmdId2 ));    
     }
 
 // -----------------------------------------------------------------------------
--- a/voiceui/vcommand/data/vcommand.rss	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/vcommand/data/vcommand.rss	Wed Apr 14 15:58:44 2010 +0300
@@ -275,7 +275,8 @@
     buttons = 
         {
         CBA_BUTTON {id=0;                    txt=""; },
-        CBA_BUTTON {id=EVCommandSoftKeyQuit; txt=text_softkey_quit;}
+        //CBA_BUTTON {id=EVCommandSoftKeyQuit; txt=text_softkey_quit;}
+        CBA_BUTTON {id=EAknSoftkeyDone; txt=text_softkey_quit;}
         };
     }
 
--- a/voiceui/vcommand/src/vcplaybackdialog.cpp	Wed Mar 31 21:32:56 2010 +0300
+++ b/voiceui/vcommand/src/vcplaybackdialog.cpp	Wed Apr 14 15:58:44 2010 +0300
@@ -142,7 +142,8 @@
         	break;
             }
             
-        case EVCommandSoftKeyQuit:
+        //case EVCommandSoftKeyQuit:
+        case EAknSoftkeyDone:
             {
             iOkToExit = ETrue;