phonecmdhandler/phonecmdhnlr/src/PhoneHandlerAnswerCall.cpp
changeset 0 ff3b6d0fd310
child 12 ae8abd0db65c
child 43 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Handles answer call key press. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "PhoneHandlerAnswerCall.h"
       
    21 #include 	"PhoneHandlerControl.h"
       
    22 #include 	"PhoneHandlerDebug.h"
       
    23 #include 	<RemConCallHandlingTarget.h>
       
    24 
       
    25 #include	<CPhCltCommandHandler.h>
       
    26 
       
    27 // EXTERNAL DATA STRUCTURES
       
    28 
       
    29 // EXTERNAL FUNCTION PROTOTYPES  
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // LOCAL CONSTANTS AND MACROS
       
    36 
       
    37 // MODULE DATA STRUCTURES
       
    38 
       
    39 // LOCAL FUNCTION PROTOTYPES
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 
       
    43 // ============================= LOCAL FUNCTIONS ===============================
       
    44 
       
    45 // ============================ MEMBER FUNCTIONS ===============================
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CPhoneHandlerAnswerCall::CPhoneHandlerAnswerCall
       
    49 // C++ default constructor can NOT contain any code, that
       
    50 // might leave.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 CPhoneHandlerAnswerCall::CPhoneHandlerAnswerCall( 
       
    54 							CPhoneHandlerControl& aControl, 
       
    55         					TRemConExtCallHandlingApiOperationId aOperation )
       
    56 : iControl( aControl ),
       
    57   iOperation( aOperation )
       
    58     {
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CPhoneHandlerAnswerCall::ConstructL
       
    63 // Symbian 2nd phase constructor can leave.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void CPhoneHandlerAnswerCall::ConstructL()
       
    67     {
       
    68     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::ConstructL() start" );
       
    69 	    
       
    70     LoadServiceL();
       
    71     
       
    72     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::ConstructL() end" );
       
    73 	}
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CPhoneHandlerAnswerCall::NewL
       
    77 // Two-phased constructor.
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 CPhoneHandlerAnswerCall* CPhoneHandlerAnswerCall::NewL( 
       
    81 							CPhoneHandlerControl& aControl, 
       
    82         					TRemConExtCallHandlingApiOperationId aOperation )
       
    83     {
       
    84     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::NewL() start" );
       
    85 	    
       
    86     CPhoneHandlerAnswerCall* self = new( ELeave ) CPhoneHandlerAnswerCall( 
       
    87     												aControl, 
       
    88     												aOperation );
       
    89     
       
    90     CleanupStack::PushL( self );
       
    91     self->ConstructL();
       
    92     CleanupStack::Pop( self );
       
    93 
       
    94 	COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::NewL() end" );
       
    95 	
       
    96     return self;
       
    97     }
       
    98 
       
    99 // Destructor
       
   100 CPhoneHandlerAnswerCall::~CPhoneHandlerAnswerCall()
       
   101     {
       
   102     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::~CPhoneHandlerAnswerCall()" );
       
   103 	
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CPhoneHandlerAnswerCall::Process
       
   108 // Starts to process service.
       
   109 // (other items were commented in a header).
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 void CPhoneHandlerAnswerCall::Process()
       
   113 	{
       
   114 	COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::Process()" );
       
   115 		
       
   116 	iCommandHandler->Ata( GetStatus() );
       
   117 	Activate(); 	
       
   118 	}
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // CPhoneHandlerAnswerCall::Delete
       
   122 // (other items were commented in a header).
       
   123 // -----------------------------------------------------------------------------
       
   124 //
       
   125 void CPhoneHandlerAnswerCall::Delete()
       
   126 	{
       
   127 	COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::Delete()" );
       
   128 		
       
   129 	delete this;
       
   130 	}
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CPhoneHandlerAnswerCall::RequestCompleted
       
   134 // Handler for completed asynchronous calls.
       
   135 // (other items were commented in a header).
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 void CPhoneHandlerAnswerCall::RequestCompleted( const TInt aError )
       
   139     {
       
   140     COM_TRACE_2( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::RequestCompleted() aError=%d, iState=%d", aError, iState );
       
   141 	    
       
   142 	switch( iState )
       
   143 		{
       
   144 		case EPhoneHandlerState1:
       
   145 			{
       
   146 			NextState();
       
   147 			iControl.CommandInitiator().SendResponse( GetStatus(), 
       
   148 													  iOperation,
       
   149 													  aError );
       
   150 			Activate();
       
   151 			break;
       
   152 			}
       
   153 			
       
   154 		case EPhoneHandlerState2:
       
   155 			{
       
   156 			IdleState();
       
   157 			delete this; 
       
   158 			break;
       
   159 			}
       
   160 			
       
   161 		default:
       
   162 			{
       
   163 			COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerAnswerCall::RequestCompleted() Unspecified state" );
       
   164 			break;
       
   165 			}
       
   166 		};
       
   167 	}
       
   168     
       
   169 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   170 
       
   171 //  End of File