phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchercontainer.cpp
branchRCL_3
changeset 39 a6539d1e8e43
parent 32 2828b4d142c0
child 45 34879f5cfc63
equal deleted inserted replaced
35:4ae315f230bc 39:a6539d1e8e43
   445     {
   445     {
   446     // Make sure timer can be canceled before user do any operation.
   446     // Make sure timer can be canceled before user do any operation.
   447     iPlugin.CancelTimer();
   447     iPlugin.CancelTimer();
   448     
   448     
   449     TInt index;
   449     TInt index;
   450     if ( iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) )
   450     // start iLongTapDetector in listbox area and handle PointerEvent when dragged
       
   451     if ( iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, index )
       
   452         || ( aPointerEvent.iType == TPointerEvent::EDrag ) )
   451         {
   453         {
   452         if ( iLongTapDetector )
   454         if ( iLongTapDetector )
   453             {
   455             {
   454             iLongTapDetector->PointerEventL( aPointerEvent );
   456             iLongTapDetector->PointerEventL( aPointerEvent );
   455             }
   457             }
   469 // ----------------------------------------------------------------------------
   471 // ----------------------------------------------------------------------------
   470 //
   472 //
   471 void CCCAppCommLauncherContainer::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, 
   473 void CCCAppCommLauncherContainer::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, 
   472                                  	const TPoint& /*aPenEventScreenLocation*/ )
   474                                  	const TPoint& /*aPenEventScreenLocation*/ )
   473     {
   475     {
   474     CCAContactorService* contactorService = iPlugin.ContactorService();
   476     if ( iPlugin.CommandState().IsRunning() )
   475     if ( contactorService )
   477         {
   476         {
   478         return;
   477         if ( contactorService->IsBusy() )
   479         }
   478             {
   480     else if ( CommMethodsAvailable() )
   479             return;
   481         {
   480             }
   482         TPtrC fullName;
   481         else if ( CommMethodsAvailable() )
   483         iPlugin.ContactHandler().ContactFieldItemDataL(
   482             {
   484             CCmsContactFieldItem::ECmsFullName, fullName );
   483             TPtrC fullName;
   485 
   484             iPlugin.ContactHandler().ContactFieldItemDataL(
   486         TUint paramFlag = 0;//CCAContactorService::TCSParameter::EEnableDefaults;
   485                 CCmsContactFieldItem::ECmsFullName, fullName );
   487     
   486 
   488         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector
   487             TUint paramFlag = 0;//CCAContactorService::TCSParameter::EEnableDefaults;
   489             contactActionType = iPlugin.Container().SelectedCommunicationMethod();
   488         
   490         
   489             VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector
   491         if ( !iLongTap && contactActionType
   490                 contactActionType = iPlugin.Container().SelectedCommunicationMethod();
   492                         == VPbkFieldTypeSelectorFactory::EFindOnMapSelector )
       
   493             {  
       
   494             iLongTap = ETrue;    
       
   495             DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap );
       
   496             }
       
   497         else
       
   498             {
       
   499             CCAContactorService::TCSParameter param(
       
   500                 contactActionType,
       
   501                 *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
       
   502                 paramFlag, 
       
   503                 fullName );
       
   504                
       
   505             iPlugin.ExecuteServiceL( param );   
   491             
   506             
   492             if ( !iLongTap && contactActionType
   507             //The Timer can be started after user selected any call item
   493                             == VPbkFieldTypeSelectorFactory::EFindOnMapSelector )
   508             if ( iPlugin.ContactorService()->IsSelected() && 
   494                 {  
   509                 (contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
   495                 iLongTap = ETrue;    
   510                  contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
   496                 DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap );
   511                  contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
       
   512                 {
       
   513                 iPlugin.StartTimerL();
   497                 }
   514                 }
   498             else
   515             
   499                 {
   516             
   500                 CCAContactorService::TCSParameter param(
   517             CleanupStack::PopAndDestroy( 1 );// contactlinkarray
   501                     contactActionType,
       
   502                     *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
       
   503                     paramFlag, 
       
   504                     fullName );
       
   505                    
       
   506                 contactorService->ExecuteServiceL( param );   
       
   507                 
       
   508                 //The Timer can be started after user selected any call item
       
   509                 if ( contactorService->IsSelected() && 
       
   510                 	(contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
       
   511                      contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
       
   512                      contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
       
   513                     {
       
   514                     iPlugin.StartTimerL();
       
   515                     }
       
   516                 
       
   517                 
       
   518                 CleanupStack::PopAndDestroy( 1 );// contactlinkarray
       
   519                 }
       
   520             }
   518             }
   521         }
   519         }
   522     }
   520     }
   523 
   521 
   524 // ----------------------------------------------------------------------------
   522 // ----------------------------------------------------------------------------
   550         {
   548         {
   551         executeContactAction = ETrue;
   549         executeContactAction = ETrue;
   552         iHasBeenDragged = EFalse;
   550         iHasBeenDragged = EFalse;
   553         }
   551         }
   554 
   552 
   555     CCAContactorService* contactorService = iPlugin.ContactorService();
   553     if ( executeContactAction && iPlugin.CommandState().IsRunning() )
   556 
       
   557     if ( executeContactAction && contactorService && contactorService->IsBusy())
       
   558         {
   554         {
   559         executeContactAction = EFalse;
   555         executeContactAction = EFalse;
   560         }
   556         }
   561 
   557 
   562     if (executeContactAction)
   558     if (executeContactAction)
   576                 iLongTap = EFalse;
   572                 iLongTap = EFalse;
   577                 }
   573                 }
   578         	}
   574         	}
   579         else
   575         else
   580         	{
   576         	{
   581         	if(contactorService)
   577             TPtrC fullName;
   582         	    {
   578 
   583                 TPtrC fullName;
   579             iPlugin.ContactHandler().ContactFieldItemDataL(
   584     
   580                 CCmsContactFieldItem::ECmsFullName, fullName);
   585                 iPlugin.ContactHandler().ContactFieldItemDataL(
   581 
   586                     CCmsContactFieldItem::ECmsFullName, fullName);
   582             TUint paramFlag = CCAContactorService::TCSParameter::EEnableDefaults;
   587     
   583 
   588                 TUint paramFlag = CCAContactorService::TCSParameter::EEnableDefaults;
   584             CCAContactorService::TCSParameter param(
   589     
   585                 contactActionType,
   590                 CCAContactorService::TCSParameter param(
   586                 *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
   591                     contactActionType,
   587                 paramFlag,
   592                     *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
   588                 fullName);
   593                     paramFlag,
   589         
   594                     fullName);
   590             iPlugin.ExecuteServiceL(param);
   595             
   591             
   596                 contactorService->ExecuteServiceL(param);
   592             //The Timer can be started after user selected any call item
   597                 
   593             if ( iPlugin.ContactorService()->IsSelected() && 
   598                 //The Timer can be started after user selected any call item
   594                 (contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
   599                 if ( contactorService->IsSelected() && 
   595                  contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
   600                 	(contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
   596                  contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
   601                      contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
   597                 {
   602                      contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
   598                 iPlugin.StartTimerL();
   603                     {
   599                 }
   604                     iPlugin.StartTimerL();
   600             
   605                     }
   601             CleanupStack::PopAndDestroy(1);// contactlinkarray
   606                 
   602             }
   607                 CleanupStack::PopAndDestroy(1);// contactlinkarray
       
   608         	    }
       
   609         	}
       
   610         }
   603         }
   611     }
   604     }
   612 
   605 
   613 // ----------------------------------------------------------------------------
   606 // ----------------------------------------------------------------------------
   614 // CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL()
   607 // CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL()