phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchermenuhandler.cpp
branchRCL_3
changeset 39 a6539d1e8e43
parent 35 4ae315f230bc
child 45 34879f5cfc63
equal deleted inserted replaced
35:4ae315f230bc 39:a6539d1e8e43
    51     {
    51     {
    52     CCA_DP(KCommLauncherLogFile, CCA_L("~CCCAppCommLauncherMenuHandler()"));
    52     CCA_DP(KCommLauncherLogFile, CCA_L("~CCCAppCommLauncherMenuHandler()"));
    53     // iView is deleted through the alfdisplay
    53     // iView is deleted through the alfdisplay
    54     delete iPbkCmd;
    54     delete iPbkCmd;
    55     delete iAiwServiceHandler;
    55     delete iAiwServiceHandler;
    56     delete iInputBlock;
    56     if ( iInputBlock )
       
    57         {
       
    58         iInputBlock->Cancel();
       
    59         }    
    57     }
    60     }
    58 
    61 
    59 // ---------------------------------------------------------------------------
    62 // ---------------------------------------------------------------------------
    60 // CCCAppCommLauncherMenuHandler::CCCAppCommLauncherMenuHandler()
    63 // CCCAppCommLauncherMenuHandler::CCCAppCommLauncherMenuHandler()
    61 // ---------------------------------------------------------------------------
    64 // ---------------------------------------------------------------------------
   402             iPlugin.Container().SelectedCommunicationMethod(),
   405             iPlugin.Container().SelectedCommunicationMethod(),
   403             *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
   406             *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
   404             paramFlag,
   407             paramFlag,
   405             fullName );
   408             fullName );
   406 
   409 
   407         CCAContactorService* contactorService = iPlugin.ContactorService();
   410         iPlugin.ExecuteServiceL( param );
   408         contactorService->ExecuteServiceL( param );
       
   409         CleanupStack::PopAndDestroy( 1 );// contactlinkarray
   411         CleanupStack::PopAndDestroy( 1 );// contactlinkarray
   410     	}
   412     	}
   411     
   413     
   412     CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoSelectCmdL()"));
   414     CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoSelectCmdL()"));
   413     }
   415     }
   418 //
   420 //
   419 void CCCAppCommLauncherMenuHandler::DoEditCmdL()
   421 void CCCAppCommLauncherMenuHandler::DoEditCmdL()
   420     {
   422     {
   421     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DoEditCmdL()"));
   423     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DoEditCmdL()"));
   422 
   424 
       
   425     TCCAppCommandState& cmdState( iPlugin.CommandState() );
       
   426     cmdState.SetRunningAndPushCleanupL();
       
   427     
   423     // Avoid user input during Edit command execution
   428     // Avoid user input during Edit command execution
   424     if( iInputBlock )
   429     if( iInputBlock )
   425         {
   430         {
   426         iInputBlock->Cancel();
   431         iInputBlock->Cancel();
   427         }
   432         }
   444         KAiwCmdAssign,
   449         KAiwCmdAssign,
   445         inParamList,
   450         inParamList,
   446         iAiwServiceHandler->OutParamListL(), NULL, this );
   451         iAiwServiceHandler->OutParamListL(), NULL, this );
   447 
   452 
   448    CleanupStack::PopAndDestroy( popAndDestroyUs );
   453    CleanupStack::PopAndDestroy( popAndDestroyUs );
       
   454    // Async AIW command -> set state to not running in HandleNotifyL.
       
   455    cmdState.PopCleanup();
   449 
   456 
   450    CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoEditCmdL()"));
   457    CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoEditCmdL()"));
   451     }
   458     }
   452 
   459 
   453 // ---------------------------------------------------------------------------
   460 // ---------------------------------------------------------------------------
   456 //
   463 //
   457 void CCCAppCommLauncherMenuHandler::DoAiwCommandL( TInt aCmdId, TInt aServiceId )
   464 void CCCAppCommLauncherMenuHandler::DoAiwCommandL( TInt aCmdId, TInt aServiceId )
   458     {
   465     {
   459     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DoAiwCommandL()"));
   466     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DoAiwCommandL()"));
   460 
   467 
       
   468     // Command state is checked in CCCAppCommLauncherPlugin::HandleCommandL 
       
   469     // before calling the menuhandler.
       
   470     TCCAppCommandState& cmdState( iPlugin.CommandState() );
       
   471     cmdState.SetRunningAndPushCleanupL();
       
   472     
   461     CAiwGenericParamList& inParamList = iAiwServiceHandler->InParamListL();
   473     CAiwGenericParamList& inParamList = iAiwServiceHandler->InParamListL();
   462     TInt popAndDestroyUs = 0;
   474     TInt popAndDestroyUs = 0;
   463 
   475 
   464     switch( aServiceId )
   476     switch( aServiceId )
   465         {
   477         {
   474         aCmdId,
   486         aCmdId,
   475         inParamList,
   487         inParamList,
   476         iAiwServiceHandler->OutParamListL(), NULL, NULL );// not needed (so far)
   488         iAiwServiceHandler->OutParamListL(), NULL, NULL );// not needed (so far)
   477 
   489 
   478    CleanupStack::PopAndDestroy( popAndDestroyUs );
   490    CleanupStack::PopAndDestroy( popAndDestroyUs );
       
   491    // Synchronous AIW call -> state to not running.
       
   492    cmdState.SetNotRunningAndPopCleanup();
   479 
   493 
   480    CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoAiwCommandL()"));
   494    CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DoAiwCommandL()"));
   481    }
   495    }
   482 
   496 
   483 // ---------------------------------------------------------------------------
   497 // ---------------------------------------------------------------------------
   507     TInt aCmdId,
   521     TInt aCmdId,
   508     TInt aEventId,
   522     TInt aEventId,
   509     CAiwGenericParamList& aEventParamList,
   523     CAiwGenericParamList& aEventParamList,
   510     const CAiwGenericParamList& /*aInParamList*/ )
   524     const CAiwGenericParamList& /*aInParamList*/ )
   511     {
   525     {
       
   526     if ( aEventId == KAiwEventCompleted || 
       
   527          aEventId == KAiwEventCanceled ||
       
   528          aEventId == KAiwEventError )
       
   529         {
       
   530         iPlugin.CommandState().SetNotRunning();
       
   531         }
       
   532     
   512     TInt returnValue = KErrNone;
   533     TInt returnValue = KErrNone;
   513     TInt index = 0;
   534     TInt index = 0;
   514     const TAiwGenericParam* param = aEventParamList.FindFirst(index,
   535     const TAiwGenericParam* param = aEventParamList.FindFirst(index,
   515         EGenericParamContactLinkArray);
   536         EGenericParamContactLinkArray);
   516     
   537