meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp
branchRCL_3
changeset 10 f5907b1a1053
parent 8 e1b6206813b4
equal deleted inserted replaced
8:e1b6206813b4 10:f5907b1a1053
    32 #include <CVPbkContactFieldIterator.h>
    32 #include <CVPbkContactFieldIterator.h>
    33 #include <MVPbkContactFieldTextData.h>
    33 #include <MVPbkContactFieldTextData.h>
    34 #include <MVPbkContactLink.h>
    34 #include <MVPbkContactLink.h>
    35 
    35 
    36 //Remote Contact Lookup
    36 //Remote Contact Lookup
    37 //<cmail>
    37 #include <cpbk2remotecontactlookupaccounts.h>
    38 #include "cpbkxremotecontactlookupenv.h"
    38 #include <pbk2remotecontactlookupfactory.h>
    39 #include <cntitem.h>
       
    40 #include <CPbk2SortOrderManager.h>
    39 #include <CPbk2SortOrderManager.h>
    41 
    40 
    42 // Aiw launcher
    41 // Aiw launcher
    43 #include <AiwCommon.hrh>
    42 #include <AiwCommon.hrh>
    44 #include <AiwContactSelectionDataTypes.h>
    43 #include <AiwContactSelectionDataTypes.h>
    45 #include <AiwServiceHandler.h>
    44 #include <AiwServiceHandler.h>
    46 #include <AiwGenericParam.h>
    45 #include <AiwGenericParam.h>
    47 
    46 
    48 //FS Email framework
    47 //FS Email framework
    49 #include "cfsmailbox.h"
    48 #include "cfsmailbox.h"
    50 //</cmail>
       
    51 
    49 
    52 //MRUI
    50 //MRUI
    53 #include <esmrgui.rsg>
    51 #include <esmrgui.rsg>
    54 #include "cesmrcontactmanagerhandler.h"
    52 #include "cesmrcontactmanagerhandler.h"
    55 #include "cesmrclslistshandler.h"
    53 #include "cesmrclslistshandler.h"
   612 // CESMRContactHandler::DoRemoteLookupL
   610 // CESMRContactHandler::DoRemoteLookupL
   613 // -----------------------------------------------------------------------------
   611 // -----------------------------------------------------------------------------
   614 //
   612 //
   615 void CESMRContactHandler::DoRemoteLookupL( const TDesC& aQueryString,
   613 void CESMRContactHandler::DoRemoteLookupL( const TDesC& aQueryString,
   616     CPbkxRemoteContactLookupServiceUiContext::TResult& aResult,
   614     CPbkxRemoteContactLookupServiceUiContext::TResult& aResult,
   617     CPbkxRemoteContactLookupServiceUiContext::TMode aContext )
   615     CPbkxRemoteContactLookupServiceUiContext::TMode aLookupMode )
   618     {
   616     {
   619     FUNC_LOG;
   617     FUNC_LOG;
   620     TUid protocolUid = TUid::Null();
   618     TUid protocolUid = TUid::Null();
   621     TUint accountId = 0;
   619     TUint accountUid = 0;
   622     
   620     DelayedMailBoxL().GetRCLInfo( protocolUid, accountUid );
   623     DelayedMailBoxL().GetRCLInfo( protocolUid, accountId );
   621     const TPbkxRemoteContactLookupProtocolAccountId accountId =
   624     const TPbkxRemoteContactLookupProtocolAccountId KAccountId( protocolUid, accountId );
   622         TPbkxRemoteContactLookupProtocolAccountId( protocolUid, accountUid );
   625 
   623 
   626     CPbkxRemoteContactLookupEnv* env = CPbkxRemoteContactLookupEnv::NewL();
   624     CPbkxRemoteContactLookupServiceUiContext::TContextParams params = 
   627     CleanupStack::PushL( env );
   625         { accountId, aLookupMode }; 
   628 
   626 
   629     MPbkxRemoteContactLookupServiceUi* serviceUi = env->ServiceUiL();
   627     CPbkxRemoteContactLookupServiceUiContext* context =
   630 
   628         Pbk2RemoteContactLookupFactory::NewContextL( params );
   631     // If you want test with RCL dummyContactDatabase, KAccountId = serviceUi->DefaultAccountIdL();
   629     CleanupStack::PushL( context );
   632     MPbkxRemoteContactLookupServiceUi::TContextParams params = { KAccountId, aContext };
   630 
   633 
   631     context->ExecuteL( aQueryString, aResult );
   634     CPbkxRemoteContactLookupServiceUiContext* ctx( NULL );
   632     CleanupStack::PopAndDestroy( context );
   635     TRAPD( error, ctx = serviceUi->NewContextL( params ) );
       
   636 
       
   637     User::LeaveIfError( error );
       
   638 
       
   639     CleanupStack::PushL( ctx );
       
   640 
       
   641     ctx->ExecuteL( aQueryString, aResult );
       
   642 
       
   643     CleanupStack::PopAndDestroy( ctx );
       
   644     CleanupStack::PopAndDestroy( env );
       
   645     }
   633     }
   646 
   634 
   647 // -----------------------------------------------------------------------------
   635 // -----------------------------------------------------------------------------
   648 // CESMRContactHandler::VPbkSingleContactOperationCompleteL
   636 // CESMRContactHandler::VPbkSingleContactOperationCompleteL
   649 // -----------------------------------------------------------------------------
   637 // -----------------------------------------------------------------------------