phoneuis/TelephonyDeviceMode/src/CTelDMCallStateListener.cpp
changeset 21 92ab7f8d0eab
parent 0 5f000ab63145
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
    17 
    17 
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include    "CTelDMCallStateListener.h"
    21 #include    "CTelDMCallStateListener.h"
    22 #include 	"MTelDMCallStateObserver.h"
    22 #include    "MTelDMCallStateObserver.h"
    23 #include	"MTelDMAccessory.h" 
    23 #include    "MTelDMAccessory.h"
    24 
    24 
    25 #include    <ctsydomainpskeys.h>
    25 #include    <ctsydomainpskeys.h>
    26 
    26 
    27 // MODULE DATA STRUCTURES
    27 // MODULE DATA STRUCTURES
    28  
    28  
    76 //    
    76 //    
    77 void CTelDMCallStateListener::ConstructL()
    77 void CTelDMCallStateListener::ConstructL()
    78     {
    78     {
    79     /// Attach to key. Start listening call state changes.
    79     /// Attach to key. Start listening call state changes.
    80     iProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
    80     iProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
    81     IssueRequest();                   		      
    81     IssueRequest();                               
    82       
    82       
    83     }
    83     }
    84  
    84  
    85 // -----------------------------------------------------------------------------
    85 // -----------------------------------------------------------------------------
    86 // CTelDMCallStateListener::HandleChange
    86 // CTelDMCallStateListener::HandleChange
    90 void CTelDMCallStateListener::HandleChange()
    90 void CTelDMCallStateListener::HandleChange()
    91     {
    91     {
    92     TInt err( KErrNone );
    92     TInt err( KErrNone );
    93     iCallState = KErrNone;
    93     iCallState = KErrNone;
    94     err = RProperty::Get( KPSUidCtsyCallInformation, 
    94     err = RProperty::Get( KPSUidCtsyCallInformation, 
    95     						KCTsyCallState,
    95                             KCTsyCallState,
    96         					iCallState );
    96                             iCallState );
    97     if ( err == KErrNone )
    97     if ( err == KErrNone )
    98         { 					
    98         {                   
    99 	    for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
    99         for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
   100 		    {
   100             {
   101 		    TRAP_IGNORE( iObserverArray[ i ]->CallStateChangedL(iCallState) );
   101             TRAP_IGNORE( iObserverArray[ i ]->CallStateChangedL(iCallState) );
   102 		    }
   102             }
   103         }
   103         }
   104     } 
   104     } 
   105   
   105   
   106 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   107 // CTelDMCallStateListener::RunL
   107 // CTelDMCallStateListener::RunL
   144 // -----------------------------------------------------------------------------
   144 // -----------------------------------------------------------------------------
   145 // CTelDMCallStateListener::AddObserver
   145 // CTelDMCallStateListener::AddObserver
   146 // 
   146 // 
   147 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   148 void CTelDMCallStateListener::AddObserverL( MTelDMCallStateObserver& 
   148 void CTelDMCallStateListener::AddObserverL( MTelDMCallStateObserver& 
   149 															aCallStateObserver )
   149                                                             aCallStateObserver )
   150     {
   150     {
   151     if ( iObserverArray.Find( &aCallStateObserver ) != KErrNone )
   151     if ( iObserverArray.Find( &aCallStateObserver ) != KErrNone )
   152         {
   152         {
   153         User::LeaveIfError( iObserverArray.Append( &aCallStateObserver ) );
   153         User::LeaveIfError( iObserverArray.Append( &aCallStateObserver ) );
   154         }
   154         }