phoneapp/phoneuivoipextension/src/cphonestatealertingvoip.cpp
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
child 74 d1c62c765e48
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Implementation of CPhoneStateAlertingVoIP class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include <mpeengineinfo.h>
       
    21 
       
    22 #include "cphonestatealertingvoip.h"
       
    23 #include "phonelogger.h"
       
    24 #include "mphonestatemachine.h"
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 //
       
    31 CPhoneStateAlertingVoIP::CPhoneStateAlertingVoIP( 
       
    32     MPhoneStateMachine& aStateMachine, 
       
    33     MPhoneViewCommandHandle& aViewCommandHandle,
       
    34     MPhoneCustomization& aPhoneCustomization ) : 
       
    35     CPhoneAlerting( &aStateMachine, &aViewCommandHandle, &aPhoneCustomization )
       
    36     {
       
    37     
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------
       
    41 // CPhoneStateAlertingVoIP::~CPhoneStateAlertingVoIP()
       
    42 // Destructor
       
    43 // (other items were commented in a header).
       
    44 // -----------------------------------------------------------
       
    45 
       
    46 CPhoneStateAlertingVoIP::~CPhoneStateAlertingVoIP()
       
    47     {
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------
       
    51 // CPhoneStateAlertingVoIP::ConstructL()
       
    52 // Constructor
       
    53 // (other items were commented in a header).
       
    54 // -----------------------------------------------------------
       
    55 //
       
    56 void CPhoneStateAlertingVoIP::ConstructL()
       
    57     {
       
    58     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneStateAlertingVoIP::ConstructL()");
       
    59     CPhoneAlerting::ConstructL();
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------
       
    63 // CPhoneStateAlertingVoIP::NewL()
       
    64 // Constructor
       
    65 // (other items were commented in a header).
       
    66 // -----------------------------------------------------------
       
    67 //
       
    68 CPhoneStateAlertingVoIP* CPhoneStateAlertingVoIP::NewL( 
       
    69     MPhoneStateMachine& aStateMachine, 
       
    70     MPhoneViewCommandHandle& aViewCommandHandle,
       
    71     MPhoneCustomization& aPhoneCustomization )
       
    72     {
       
    73     CPhoneStateAlertingVoIP* self = new (ELeave) 
       
    74         CPhoneStateAlertingVoIP( aStateMachine, aViewCommandHandle, aPhoneCustomization );
       
    75     
       
    76     CleanupStack::PushL( self );
       
    77     self->ConstructL();
       
    78     CleanupStack::Pop( self );
       
    79     
       
    80     return self;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------
       
    84 // CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL
       
    85 // -----------------------------------------------------------
       
    86 //
       
    87 void CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL( 
       
    88     const TInt aMessage, 
       
    89     TInt aCallId )
       
    90     {
       
    91     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
       
    92         "CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL() ");
       
    93     switch ( aMessage )
       
    94         {
       
    95         case MEngineMonitor::EPEMessageConnected:
       
    96             HandleConnectedL( aCallId );
       
    97             break;
       
    98         
       
    99         default:
       
   100             CPhoneAlerting::HandlePhoneEngineMessageL( 
       
   101                 aMessage, aCallId );
       
   102             break;
       
   103         }
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------
       
   107 // CPhoneStateAlertingVoIP::HandleConnectedL
       
   108 // -----------------------------------------------------------
       
   109 //
       
   110 void CPhoneStateAlertingVoIP::HandleConnectedL( TInt aCallId )
       
   111     {
       
   112     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
       
   113         "CPhoneStateAlertingVoIP::HandleConnectedL() ");
       
   114 
       
   115     if( iStateMachine->PhoneEngineInfo()->CallType( aCallId ) == EPECallTypeVoIP )
       
   116         {
       
   117         SetCallHeaderType( EPECallTypeVoIP );
       
   118         }
       
   119 
       
   120     CPhoneAlerting::HandleConnectedL( aCallId );        
       
   121     }
       
   122 
       
   123 // End of File