voiceui/voiceuivoicerecognition/src/vuicresultsstate.cpp
branchRCL_3
changeset 15 6347473a7bb2
parent 0 bf1d17376201
equal deleted inserted replaced
12:fc313e1df071 15:6347473a7bb2
    39 
    39 
    40 #include "vuicvoicerecogdialogimpl.h"
    40 #include "vuicvoicerecogdialogimpl.h"
    41 #include "vuicnbestlistdialog.h"
    41 #include "vuicnbestlistdialog.h"
    42 #include "vuicttsplayer.h"
    42 #include "vuicttsplayer.h"
    43 #include "vuivoiceicondefs.h"
    43 #include "vuivoiceicondefs.h"
       
    44 
       
    45 #include <CVPbkContactStoreUriArray.h>
       
    46 #include <CVPbkContactManager.h>
       
    47 #include <VPbkContactStoreUris.h>
       
    48 #include <TVPbkContactStoreUriPtr.h>
       
    49 #include <CVPbkContactIdConverter.h>
       
    50 #include <MVPbkContactStore.h>
       
    51 #include <MVPbkContactStoreList.h>
    44 
    52 
    45 #include "rubydebug.h"
    53 #include "rubydebug.h"
    46 
    54 
    47 _LIT( KTab, "\t" );
    55 _LIT( KTab, "\t" );
    48     
    56     
   729 
   737 
   730     MCCAParameter* parameter = TCCAFactory::NewParameterL();
   738     MCCAParameter* parameter = TCCAFactory::NewParameterL();
   731     CleanupClosePushL( *parameter );
   739     CleanupClosePushL( *parameter );
   732 
   740 
   733     parameter->SetConnectionFlag( MCCAParameter::ENormal );
   741     parameter->SetConnectionFlag( MCCAParameter::ENormal );
   734     parameter->SetContactDataFlag( MCCAParameter::EContactId );
   742     parameter->SetContactDataFlag( MCCAParameter::EContactLink );
   735 
   743         
   736     TBuf<10> idString;
   744     // Create a Contact Manager and bind it with the default contact database 
   737     idString.Num( DataStorage().Tag()->RRD()->IntArray()->At( KVasContactIdRrdLocation ) );
   745     CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewL();
   738 
   746     CleanupStack::PushL( uriArray );
   739     parameter->SetContactDataL( idString );
   747     
       
   748     TVPbkContactStoreUriPtr uri( VPbkContactStoreUris::DefaultCntDbUri() );
       
   749     uriArray->AppendL( uri );  
       
   750     
       
   751     CVPbkContactManager* contactManager = CVPbkContactManager::NewL(*uriArray);
       
   752     CleanupStack::PushL( contactManager );
       
   753     
       
   754     // Find Contacts Model store URI from the contact manager (copied from Phonebook app)
       
   755     MVPbkContactStore* defaultStore = contactManager->ContactStoresL().Find( uri );
       
   756     User::LeaveIfNull( defaultStore );
       
   757     
       
   758     // Create a ContactIdConverter object for the ContactId-to-ContactLink conversion 
       
   759     CVPbkContactIdConverter* idConverter = CVPbkContactIdConverter::NewL( *defaultStore );
       
   760     CleanupStack::PushL( idConverter );
       
   761     
       
   762     MVPbkContactLink* link = idConverter->IdentifierToLinkLC(
       
   763             DataStorage().Tag()->RRD()->IntArray()->At( KVasContactIdRrdLocation ));
       
   764     
       
   765     HBufC8*  link8  = link->PackLC(); 
       
   766     HBufC16* link16 = HBufC16::NewLC( link8->Length() );
       
   767     link16->Des().Copy( *link8 );
       
   768 
       
   769     parameter->SetContactDataL( link16->Des() );
   740 
   770 
   741     iConnection->LaunchAppL( *parameter, this );
   771     iConnection->LaunchAppL( *parameter, this );
   742     
   772     
   743     CleanupStack::Pop(); // parameter
   773     CleanupStack::PopAndDestroy(6,uriArray);    
       
   774     CleanupStack::Pop();//parameter
   744     }
   775     }
   745     
   776     
   746 // End of File
   777 // End of File
   747 
   778