phonecmdhandler/phonecmdhnlr/src/PhoneHandlerMultipartyCall.cpp
changeset 12 ae8abd0db65c
parent 0 ff3b6d0fd310
child 13 e32024264ebb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include    "PhoneHandlerMultipartyCall.h"
    20 #include    "PhoneHandlerMultipartyCall.h" 
    21 #include 	"PhoneHandlerControl.h"
    21 #include    "PhoneHandlerControl.h" 
    22 #include 	"PhoneHandlerDebug.h"
    22 #include    "PhoneHandlerDebug.h" 
    23 #include 	<RemConCallHandlingTarget.h>
    23 #include    <RemConCallHandlingTarget.h> 
    24 #include	<CPhCltCommandHandler.h>
    24 #include    <cphcltcommandhandler.h> 
    25 
    25 
    26 // EXTERNAL DATA STRUCTURES
    26 // EXTERNAL DATA STRUCTURES
    27 
    27 
    28 // EXTERNAL FUNCTION PROTOTYPES  
    28 // EXTERNAL FUNCTION PROTOTYPES  
    29 
    29 
    48 // C++ default constructor can NOT contain any code, that
    48 // C++ default constructor can NOT contain any code, that
    49 // might leave.
    49 // might leave.
    50 // -----------------------------------------------------------------------------
    50 // -----------------------------------------------------------------------------
    51 //
    51 //
    52 CPhoneHandlerMultipartyCall::CPhoneHandlerMultipartyCall(
    52 CPhoneHandlerMultipartyCall::CPhoneHandlerMultipartyCall(
    53 							CPhoneHandlerControl& aControl,
    53                             CPhoneHandlerControl& aControl,
    54 							TRemConExtCallHandlingApiOperationId aOperation )
    54                             TRemConExtCallHandlingApiOperationId aOperation )
    55 : iControl( aControl ), 
    55 : iControl( aControl ), 
    56   iOperation( aOperation )
    56   iOperation( aOperation )
    57     {
    57     {
    58     }
    58     }
    59 
    59 
    63 // -----------------------------------------------------------------------------
    63 // -----------------------------------------------------------------------------
    64 //
    64 //
    65 void CPhoneHandlerMultipartyCall::ConstructL()
    65 void CPhoneHandlerMultipartyCall::ConstructL()
    66     {
    66     {
    67     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::ConstructL() start" );
    67     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::ConstructL() start" );
    68 	    
    68         
    69     LoadServiceL();
    69     LoadServiceL();
    70     
    70     
    71     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::ConstructL() end" );
    71     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::ConstructL() end" );
    72 	}
    72     }
    73 
    73 
    74 // -----------------------------------------------------------------------------
    74 // -----------------------------------------------------------------------------
    75 // CPhoneHandlerMultipartyCall::NewL
    75 // CPhoneHandlerMultipartyCall::NewL
    76 // Two-phased constructor.
    76 // Two-phased constructor.
    77 // -----------------------------------------------------------------------------
    77 // -----------------------------------------------------------------------------
    78 //
    78 //
    79 CPhoneHandlerMultipartyCall* CPhoneHandlerMultipartyCall::NewL( 
    79 CPhoneHandlerMultipartyCall* CPhoneHandlerMultipartyCall::NewL( 
    80 			CPhoneHandlerControl& aControl,
    80             CPhoneHandlerControl& aControl,
    81 			TRemConExtCallHandlingApiOperationId aOperation )
    81             TRemConExtCallHandlingApiOperationId aOperation )
    82     {
    82     {
    83     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::NewL()" );
    83     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::NewL()" );
    84 	    
    84         
    85     CPhoneHandlerMultipartyCall* self = 
    85     CPhoneHandlerMultipartyCall* self = 
    86     	new( ELeave ) CPhoneHandlerMultipartyCall( aControl, aOperation );
    86         new( ELeave ) CPhoneHandlerMultipartyCall( aControl, aOperation );
    87     
    87     
    88     CleanupStack::PushL( self );
    88     CleanupStack::PushL( self );
    89     self->ConstructL();
    89     self->ConstructL();
    90     CleanupStack::Pop( self );
    90     CleanupStack::Pop( self );
    91 
    91 
    95     
    95     
    96 // Destructor
    96 // Destructor
    97 CPhoneHandlerMultipartyCall::~CPhoneHandlerMultipartyCall()
    97 CPhoneHandlerMultipartyCall::~CPhoneHandlerMultipartyCall()
    98     {
    98     {
    99     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::~CPhoneHandlerMultipartyCall()" );
    99     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::~CPhoneHandlerMultipartyCall()" );
   100 	
   100     
   101     }
   101     }
   102 
   102 
   103 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   104 // CPhoneHandlerMultipartyCall::Process
   104 // CPhoneHandlerMultipartyCall::Process
   105 // Starts to process service.
   105 // Starts to process service.
   106 // (other items were commented in a header).
   106 // (other items were commented in a header).
   107 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   108 //
   108 //
   109 void CPhoneHandlerMultipartyCall::Process()
   109 void CPhoneHandlerMultipartyCall::Process()
   110 	{
   110     {
   111 	COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::Process()" );
   111     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::Process()" );
   112 	
   112     
   113 	/*
   113     /*
   114 	if( iControl.SwitchCall() )
   114     if( iControl.SwitchCall() )
   115 		{
   115         {
   116 		iCommandHandler->Chld( GetStatus(), EPhCltChldTwo, 0 ); 
   116         iCommandHandler->Chld( GetStatus(), EPhCltChldTwo, 0 ); 
   117 		}
   117         }
   118 	else
   118     else
   119 		{ */
   119         { */
   120 		// get command
   120         // get command
   121 		TInt command = const_cast<TInt&>( iControl.ChldCommand() );
   121         TInt command = const_cast<TInt&>( iControl.ChldCommand() );
   122 
   122 
   123 		// get number
   123         // get number
   124 		TInt number = const_cast<TInt&>( iControl.ChldCallNumber() );
   124         TInt number = const_cast<TInt&>( iControl.ChldCallNumber() );
   125 		
   125         
   126 		iCommandHandler->Chld( GetStatus(),
   126         iCommandHandler->Chld( GetStatus(),
   127 							   static_cast<TPhCltChldCommand>( command ),
   127                                static_cast<TPhCltChldCommand>( command ),
   128 							   number ); 
   128                                number ); 
   129 		//}
   129         //}
   130 		
   130         
   131 	Activate();		
   131     Activate();     
   132 	}
   132     }
   133 
   133 
   134 // -----------------------------------------------------------------------------
   134 // -----------------------------------------------------------------------------
   135 // CPhoneHandlerMultipartyCall::Delete
   135 // CPhoneHandlerMultipartyCall::Delete
   136 // (other items were commented in a header).
   136 // (other items were commented in a header).
   137 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   138 //
   138 //
   139 void CPhoneHandlerMultipartyCall::Delete()
   139 void CPhoneHandlerMultipartyCall::Delete()
   140 	{
   140     {
   141 	COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::Delete()" );
   141     COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::Delete()" );
   142 		
   142         
   143 	delete this;
   143     delete this;
   144 	}
   144     }
   145 
   145 
   146 // -----------------------------------------------------------------------------
   146 // -----------------------------------------------------------------------------
   147 // CPhoneHandlerMultipartyCall::RequestCompleted
   147 // CPhoneHandlerMultipartyCall::RequestCompleted
   148 // Handler for completed asynchronous calls.
   148 // Handler for completed asynchronous calls.
   149 // (other items were commented in a header).
   149 // (other items were commented in a header).
   150 // -----------------------------------------------------------------------------
   150 // -----------------------------------------------------------------------------
   151 //
   151 //
   152 void CPhoneHandlerMultipartyCall::RequestCompleted( const TInt aError )
   152 void CPhoneHandlerMultipartyCall::RequestCompleted( const TInt aError )
   153     {
   153     {
   154     COM_TRACE_2( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::RequestCompleted() aError=%d, iState=%d", aError, iState );
   154     COM_TRACE_2( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::RequestCompleted() aError=%d, iState=%d", aError, iState );
   155 	    
   155         
   156 	switch( iState )
   156     switch( iState )
   157 		{
   157         {
   158 		case EPhoneHandlerState1:
   158         case EPhoneHandlerState1:
   159 			{
   159             {
   160 			NextState();
   160             NextState();
   161 			iControl.CommandInitiator().SendResponse( GetStatus(), 
   161             iControl.CommandInitiator().SendResponse( GetStatus(), 
   162 													  iOperation,
   162                                                       iOperation,
   163 													  aError );
   163                                                       aError );
   164 			Activate();
   164             Activate();
   165 			break;
   165             break;
   166 			}
   166             }
   167 			
   167             
   168 		case EPhoneHandlerState2:
   168         case EPhoneHandlerState2:
   169 			{
   169             {
   170 			IdleState();
   170             IdleState();
   171 			delete this;
   171             delete this;
   172 			break;
   172             break;
   173 			}
   173             }
   174 			
   174             
   175 		default:
   175         default:
   176 			{
   176             {
   177 			COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::RequestCompleted() Unspecified state" );
   177             COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerMultipartyCall::RequestCompleted() Unspecified state" );
   178 			break;
   178             break;
   179 			}
   179             }
   180 		};
   180         };
   181 	}
   181     }
   182     
   182     
   183 // ========================== OTHER EXPORTED FUNCTIONS =========================
   183 // ========================== OTHER EXPORTED FUNCTIONS =========================
   184 
   184 
   185 //  End of File  
   185 //  End of File