voiceui/pbkinfoviewimpl/src/pbkinfoviewsindhandler.cpp
branchRCL_3
changeset 12 fc313e1df071
parent 0 bf1d17376201
child 15 6347473a7bb2
equal deleted inserted replaced
11:b2f9a76933e1 12:fc313e1df071
    31 #include <StringLoader.h>
    31 #include <StringLoader.h>
    32 #include <nssvascoreconstant.h>
    32 #include <nssvascoreconstant.h>
    33 
    33 
    34 #include "rubydebug.h"
    34 #include "rubydebug.h"
    35 
    35 
    36 
    36 // ----------------------------------------------------------------------------
       
    37 // RemapCommand
       
    38 // Remap command to the correct order.
       
    39 // @param aCommandId 
       
    40 // ----------------------------------------------------------------------------
       
    41 static TInt RemapCommand( TInt aCommandId )
       
    42     {
       
    43     switch (aCommandId)
       
    44         {
       
    45         case EEmailCommand:
       
    46             return EMessageCommand;
       
    47         case EVoipCommand:
       
    48             return EEmailCommand;
       
    49         case EMessageCommand:
       
    50             return EVoipCommand;
       
    51         default:
       
    52             return aCommandId;
       
    53         }
       
    54     }
    37 // ================= MEMBER FUNCTIONS =======================
    55 // ================= MEMBER FUNCTIONS =======================
    38 
    56 
    39 inline CPbkInfoViewSindHandler::CPbkInfoViewSindHandler()
    57 inline CPbkInfoViewSindHandler::CPbkInfoViewSindHandler()
    40     {
    58     {
    41     }
    59     }
   481        User::Leave( KErrNotFound );
   499        User::Leave( KErrNotFound );
   482        }
   500        }
   483        
   501        
   484     return iPbkContactItemField->IconId();
   502     return iPbkContactItemField->IconId();
   485     }
   503     }
       
   504 
       
   505 // ----------------------------------------------------------------------------
       
   506 // CPbkInfoViewSindHandler::FieldIdL
       
   507 // Returns an field id for the contact field.
       
   508 // @return TInt the field id
       
   509 // ----------------------------------------------------------------------------
       
   510 TInt CPbkInfoViewSindHandler::FieldIdL( )
       
   511 	{
       
   512 	return iPbkHandler->FieldIdL();
       
   513 	}
   486 
   514 
   487 // ----------------------------------------------------------------------------
   515 // ----------------------------------------------------------------------------
   488 // CPbkInfoViewSindHandler::CreateVoiceTagListL
   516 // CPbkInfoViewSindHandler::CreateVoiceTagListL
   489 // Fetches voice tag list from vas db.
   517 // Fetches voice tag list from vas db.
   490 // @param aContactId Contact id for the contact whose voice tags are
   518 // @param aContactId Contact id for the contact whose voice tags are
   810     else if ( !noExtension1 && noExtension2 )    
   838     else if ( !noExtension1 && noExtension2 )    
   811         {
   839         {
   812         return 1;
   840         return 1;
   813         }
   841         }
   814             
   842             
   815     // compare the two neighbors
   843 //    // compare the two neighbors
   816     TInt ret = field1->Compare( *field2 );
   844 //    TInt ret = field1->Compare( *field2 );
   817     
   845 //    
   818     // Sorting for normal call, sms, and multimedia msg fields
   846 //    // Sorting for normal call, sms, and multimedia msg fields
   819     if ( ret == 0)
   847 //    if ( ret == 0)
   820         {
   848 //        {
   821         TInt actionId1 = tag1.RRD()->IntArray()->At( KVasExtensionRrdLocation );
   849 //        TInt actionId1 = tag1.RRD()->IntArray()->At( KVasExtensionRrdLocation );
   822         TInt actionId2 = tag2.RRD()->IntArray()->At( KVasExtensionRrdLocation );
   850 //        TInt actionId2 = tag2.RRD()->IntArray()->At( KVasExtensionRrdLocation );
   823         
   851 //        
   824         if ( actionId1 != actionId2 )
   852 //        if ( actionId1 != actionId2 )
   825             {
   853 //            {
   826             if ( actionId1 < actionId2 )
   854 //            if ( actionId1 < actionId2 )
   827                 {
   855 //                {
   828                 return -1;
   856 //                return -1;
   829                 }
   857 //                }
   830             return 1;
   858 //            return 1;
   831             }
   859 //            }
   832         }
   860 //        }
   833         
   861 //        
   834     return ret;
   862 //    return ret;
       
   863     TInt cmdId1 = tag1.RRD()->IntArray()->At( KVasExtensionCommandRrdLocation );
       
   864     TInt cmdId2 = tag2.RRD()->IntArray()->At( KVasExtensionCommandRrdLocation );
       
   865     return ( RemapCommand( cmdId1 ) - RemapCommand( cmdId2 ));    
   835     }
   866     }
   836 
   867 
   837 // -----------------------------------------------------------------------------
   868 // -----------------------------------------------------------------------------
   838 // Tries to find a default contact item field
   869 // Tries to find a default contact item field
   839 // @param aContactItem A contact item
   870 // @param aContactItem A contact item