phoneengine/phonemodel/src/cpeparseremergencynumberhandler.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2008 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:  CPEParserEmergencyNumberHandler class methods implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "cpeclientcallrequestmonitor.h"
       
    22 #include "cpemessagehandler.h"
       
    23 #include "cpeparseremergencynumberhandler.h"
       
    24 #include <mpecallhandling.h>
       
    25 #include <mpedatastore.h>
       
    26 #include <talogger.h>
       
    27 
       
    28 
       
    29 // ================= MEMBER FUNCTIONS =======================================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler( 
       
    38         CPEMessageHandler& aOwner, 
       
    39         MPECallHandling& aCallHandling,
       
    40         MPEDataStore& aDataStore
       
    41         ) : iOwner( aOwner ), 
       
    42             iCallHandling( aCallHandling ),
       
    43             iDataStore( aDataStore )
       
    44     {
       
    45     TEFLOGSTRING( KTAOBJECT, "PE CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler" )
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL
       
    50 // Process dial to number.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL( 
       
    54         const TDesC& aNumber
       
    55         )
       
    56     {
       
    57     TEFLOGSTRING2( KTAINT, 
       
    58         "PE CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL, number: %S", 
       
    59         &aNumber);
       
    60     /* 
       
    61     * DTMF string is nulled here because if this not done here it is possible that
       
    62     * some old DTMF string is send when emergency call connects(for more information
       
    63     * about connect handling see CPEMessageHandler class HandleConnectedState method ).
       
    64     */
       
    65     iDataStore.SetDtmfStringCommand( KNullDesC() );
       
    66     
       
    67     if ( aNumber.Length() == 0 )
       
    68         {
       
    69         User::Leave( ECCPErrorInvalidPhoneNumber );
       
    70         }
       
    71 
       
    72     if ( iDataStore.CallOriginCommand() != EPECallOriginPhone )
       
    73         {
       
    74         iOwner.SetClientInformation( KPEEmergencyCallId, aNumber );
       
    75         }
       
    76 
       
    77     iDataStore.SetPhoneNumber( aNumber );
       
    78     iOwner.HandleDialEmergencyCall( EFalse );
       
    79 
       
    80     iOwner.SetGsmParserErrorCode( KErrNone );
       
    81     }
       
    82     
       
    83 //  End of File