|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : SIPExStateConnecting.cpp 00004 * Part of : SIPExEngine 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 // INCLUDES 00017 #include "SIPExStateConnecting.h" 00018 #include "SIPExGameEngine.h" 00019 #include "SIPExSIPEngine.h" 00020 00021 #include <e32svr.h> 00022 00023 // ----------------------------------------------------------------------------- 00024 // TSIPExStateConnecting::SocketState 00025 // Changes the active state according the new state of the Socket engine. 00026 // If the socket is connected the game is reseted first and the turn is given 00027 // to the local user. 00028 // If not connected, info UI and set Registered to a new active state. 00029 // ----------------------------------------------------------------------------- 00030 // 00031 void TSIPExStateConnecting::SocketState( 00032 CSIPExEngine* aContext, 00033 TInt aNewState ) 00034 { 00035 switch (aNewState) 00036 { 00037 case CSIPExSocketEngine::ENotConnected: 00038 ChangeState( aContext, aContext->iStateRegistered ); 00039 aContext->InfoL( KNotConnected() ); 00040 break; 00041 case CSIPExSocketEngine::EConnected: 00042 if( aContext->Peer() == CSIPExEngine::EClient ) 00043 { 00044 aContext->ResetGame(); 00045 ChangeState( aContext, aContext->iStateLocal ); 00046 aContext->StatusInfoL( KYourMove() ); 00047 aContext->InfoL( KConnected() ); 00048 } 00049 break; 00050 case CSIPExSocketEngine::ETimedOut: 00051 ChangeState( aContext, aContext->iStateRegistered ); 00052 aContext->InfoL( KTimedOut() ); 00053 break; 00054 default: 00055 break; 00056 } 00057 } 00058 00059 // ----------------------------------------------------------------------------- 00060 // TSIPExStateInviting::EndGameL 00061 // The SIP Session will be ended. 00062 // ----------------------------------------------------------------------------- 00063 // 00064 void TSIPExStateConnecting::EndGameL( CSIPExEngine* aContext ) 00065 { 00066 aContext->SIPEngine()->EndSessionL(); 00067 } 00068 00069 00070 // End of file 00071
|
© Nokia 2006 |