emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp
changeset 2 5253a20d2a1e
parent 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
1:12c456ceeff2 2:5253a20d2a1e
   681 void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete(
   681 void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete(
   682 	    MVPbkContactOperationBase& aOperation,
   682 	    MVPbkContactOperationBase& aOperation,
   683 	    MVPbkStoreContact* aContact )
   683 	    MVPbkStoreContact* aContact )
   684 	{
   684 	{
   685     FUNC_LOG;
   685     FUNC_LOG;
   686 	TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) );
   686 //inform also client in case of error to enable client's actions (i.e. return search priority)
       
   687 //	TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) );
       
   688     TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) );
       
   689     if ( error != KErrNone )
       
   690         {
       
   691         TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error ));
       
   692         }
       
   693 //
   687 	}
   694 	}
   688 
   695 
   689 void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL(
   696 void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL(
   690 		    MVPbkContactOperationBase& aOperation,
   697 		    MVPbkContactOperationBase& aOperation,
   691 		    MVPbkStoreContact* aContact )
   698 		    MVPbkStoreContact* aContact )
   803 				{
   810 				{
   804 				MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC );
   811 				MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC );
   805 				}
   812 				}
   806 			else
   813 			else
   807 				{
   814 				{
       
   815 // user cancelled operation - inform client to enable its actions (i.e. return search priority)
       
   816                 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrCancel );
   808 				iState = EContactHandlerIdle;
   817 				iState = EContactHandlerIdle;
   809 				}
   818 				}
   810 			}
   819 			}
   811 		else 
   820 		else 
   812 			{
   821 			{
   815 	            RemoteContactQueryL();
   824 	            RemoteContactQueryL();
   816 	            }
   825 	            }
   817 	        else
   826 	        else
   818 	            {
   827 	            {
   819 	            TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );					
   828 	            TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );					
       
   829 //no phone number found - inform client to enable its actions (i.e. return search priority)
       
   830                 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound );
   820 	            }
   831 	            }
   821 			iState = EContactHandlerIdle;
   832 			iState = EContactHandlerIdle;
   822 			}
   833 			}
   823 		
   834 		
   824 		CleanupStack::PopAndDestroy( aContact );
   835 		CleanupStack::PopAndDestroy( aContact );
  1787 	TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY );
  1798 	TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY );
  1788 	if ( answer )	
  1799 	if ( answer )	
  1789 		{
  1800 		{
  1790 		LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress );
  1801 		LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress );
  1791 		}
  1802 		}
       
  1803     else // user cancelled operation inform client to enable its actions (i.e. return search priority)
       
  1804         {
       
  1805         ObserverOperationErrorL( CurrentCommand(), KErrCancel );
       
  1806         }
       
  1807 
  1792 	}
  1808 	}
  1793 
  1809 
  1794 TContactHandlerCmd CFSEmailUiContactHandler::CurrentCommand()
  1810 TContactHandlerCmd CFSEmailUiContactHandler::CurrentCommand()
  1795 	{
  1811 	{
  1796     FUNC_LOG;
  1812     FUNC_LOG;
  1816 
  1832 
  1817 void CFSEmailUiContactHandler::ClearObservers()
  1833 void CFSEmailUiContactHandler::ClearObservers()
  1818     {
  1834     {
  1819     iHandlerObserver = NULL;
  1835     iHandlerObserver = NULL;
  1820     }
  1836     }
  1821 	
  1837 
  1822 	
  1838 // <cmail> call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) 
       
  1839 void CFSEmailUiContactHandler::ObserverOperationErrorL( TContactHandlerCmd aCmd, TInt aErrorCode )
       
  1840     {
       
  1841     if( ( iHandlerObserver ) && ( KErrNone != aErrorCode ) )
       
  1842         {
       
  1843         iHandlerObserver->OperationErrorL( aCmd, aErrorCode ); 
       
  1844         iHandlerObserver = NULL;
       
  1845         }
       
  1846     }
       
  1847