phoneplugins/csplugin/src/cspclientvoicecall.cpp
branchRCL_3
changeset 61 41a7f70b3818
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Implements class CSPClientVoiceCall which provides call functionality
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <etelmm.h>
       
    20 #include <etel.h>
       
    21 #include <mccpcallobserver.h>
       
    22 #include <cccecallparameters.h>
       
    23 
       
    24 #include "cspclientvoicecall.h"
       
    25 #include "csplogger.h"
       
    26 #include "csppanic.pan"
       
    27 #include "cspconsts.h"
       
    28 #include "mcspcommoninfo.h"
       
    29 
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // CSPClientVoiceCall::NewL Two phased construction.
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 CSPClientVoiceCall* CSPClientVoiceCall::NewL( const TDesC& aName, 
       
    36                           RMobileLine& aLine,  
       
    37                           const CCCECallParameters& aParams,
       
    38                           MCSPCommonInfo& aCommonInfo )
       
    39     {
       
    40     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::NewL <");
       
    41     
       
    42     CSPClientVoiceCall* self = new ( ELeave ) CSPClientVoiceCall( aLine,
       
    43                                             aName,
       
    44                                             aCommonInfo );
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL( aParams );
       
    47     CleanupStack::Pop( self );
       
    48     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::NewL >");
       
    49     return self;
       
    50     }
       
    51     
       
    52 // ---------------------------------------------------------------------------
       
    53 // CSPClientVoiceCall::~CSPClientVoiceCall
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 CSPClientVoiceCall::~CSPClientVoiceCall()
       
    57     {
       
    58     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::~CSPClientVoiceCall");
       
    59     }
       
    60   
       
    61 // ---------------------------------------------------------------------------
       
    62 // CSPClientVoiceCall::CSPClientVoiceCall
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CSPClientVoiceCall::CSPClientVoiceCall( RMobileLine& aLine,
       
    66                   const TDesC& aName,
       
    67                   MCSPCommonInfo& aCommonInfo ):
       
    68                   CSPVoiceCall( aLine,
       
    69                      ETrue, aName, 
       
    70                      aCommonInfo, EFalse )
       
    71     {
       
    72     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::CSPClientVoiceCall");
       
    73     
       
    74     // Set client call flag(s)
       
    75     iClientCallIndicated = EFalse; 
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // CSPClientVoiceCall::ConstructL
       
    80 // Constructing CSPClientVoiceCall for MT call.
       
    81 // ---------------------------------------------------------------------------
       
    82 //    
       
    83 void CSPClientVoiceCall::ConstructL( const CCCECallParameters& aParams )
       
    84     {
       
    85     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::ConstructL <");
       
    86     CSPVoiceCall::ConstructL( aParams ); 
       
    87     CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::ConstructL >");
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // CSPClientVoiceCall::NotifyCallStateChanged
       
    92 // Notifies observers about state changes
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 void CSPClientVoiceCall::NotifyCallStateChanged(
       
    96             MCCPCallObserver::TCCPCallState aState ) 
       
    97     {
       
    98     CSPLOGSTRING2(CSPINT, 
       
    99             "CSPClientVoiceCall::NotifyCallStateChanged state: %d", 
       
   100             aState);
       
   101     
       
   102     // Client call is indicated during dialling state 
       
   103     if ( aState == MCCPCallObserver::ECCPStateDialling )
       
   104         {
       
   105         IndicateClientCall(); 
       
   106         }
       
   107     
       
   108     CSPVoiceCall::NotifyCallStateChanged( aState );  
       
   109     }
       
   110     
       
   111 // ---------------------------------------------------------------------------
       
   112 // CSPClientVoiceCall::NotifyCallStateChangedWithInband
       
   113 // Notifies observers about state changes
       
   114 // ---------------------------------------------------------------------------
       
   115 //
       
   116 void CSPClientVoiceCall::NotifyCallStateChangedWithInband(
       
   117             MCCPCallObserver::TCCPCallState aState ) 
       
   118     {
       
   119     CSPLOGSTRING2(CSPINT, 
       
   120             "CSPClientVoiceCall::NotifyCallStateChangedWithInband state: %d", 
       
   121             aState);
       
   122 
       
   123     // Client call is indicated during dialling state
       
   124     if ( aState == MCCPCallObserver::ECCPStateDialling )
       
   125         {
       
   126         IndicateClientCall(); 
       
   127         }
       
   128 
       
   129     CSPVoiceCall::NotifyCallStateChangedWithInband( aState );  
       
   130     }
       
   131 
       
   132 // ---------------------------------------------------------------------------
       
   133 // CSPClientVoiceCall::IndicateClientCall
       
   134 // Indicate dialling if needed 
       
   135 // ---------------------------------------------------------------------------
       
   136 //  
       
   137 void CSPClientVoiceCall::IndicateClientCall()
       
   138     {
       
   139     // Can be done only once for each call and possible duplicate 
       
   140     // notifies are blocked 
       
   141     if ( !iClientCallIndicated )
       
   142         {
       
   143         iClientCallIndicated = ETrue;
       
   144 
       
   145         CSPLOGSTRING(CSPINT, 
       
   146             "CSPClientVoiceCall::IndicateClientCall indicate client call")
       
   147         
       
   148         iCommonInfo.IndicateClientCall( this );
       
   149         
       
   150         CSPLOGSTRING(CSPINT, 
       
   151             "CSPClientVoiceCall::IndicateClientCall IndicateClientCall completed")                
       
   152         }
       
   153     else 
       
   154         {
       
   155         CSPLOGSTRING(CSPERROR, 
       
   156             "CSPClientVoiceCall::IndicateClientCall already indicated")
       
   157         }        
       
   158     }
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CSPClientVoiceCall::OpenCallHandleL
       
   162 // ---------------------------------------------------------------------------
       
   163 //    
       
   164 void CSPClientVoiceCall::OpenCallHandleL()
       
   165     {
       
   166     CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::OpenCallHandleL <");
       
   167 
       
   168     // Client call, open existing call handle 
       
   169     OpenExistingCallL( iName ); 
       
   170     
       
   171     CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::OpenCallHandleL >");
       
   172     }
       
   173 
       
   174 // ---------------------------------------------------------------------------
       
   175 // CSPClientVoiceCall::UpdateCallInfoImpl
       
   176 // Update call info including remote party name and number data  
       
   177 // ---------------------------------------------------------------------------
       
   178 //    
       
   179 void CSPClientVoiceCall::UpdateCallInfoImpl( const RMobileCall::TMobileCallInfoV7& aCallInfo )
       
   180     {
       
   181     CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::UpdateCallInfoImpl <");    
       
   182 
       
   183     // Call was added by ETel monitor, update info accordingly 
       
   184     UpdateCallNameNumberInfo( aCallInfo, ETrue );     
       
   185     UpdateCallOrigin( aCallInfo );
       
   186     
       
   187     CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::UpdateCallInfoImpl >");
       
   188     }
       
   189 
       
   190 // End of File