S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExStateInviting.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExStateInviting.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    "SIPExStateInviting.h"
00018 #include    "SIPExGameEngine.h"
00019 #include    "SIPExSIPEngine.h"
00020 
00021 // -----------------------------------------------------------------------------
00022 // TSIPExStateInviting::InviteAcceptedByRemote
00023 // Resets game, sets the peer to client and starts to connect to the remote 
00024 // peer. The active state is changed to the Connecting
00025 // -----------------------------------------------------------------------------
00026 //
00027 void TSIPExStateInviting::InviteAcceptedByRemote( 
00028     CSIPExEngine* aContext, 
00029     const TInetAddr& aIPAddress, 
00030     const TUint32 aIapId )
00031     {
00032     Info( aContext, K200Received() ); 
00033     Info( aContext, KSendingAck() ); 
00034     ChangeState( aContext, aContext->iStateConnecting );
00035     aContext->ResetGame();
00036     aContext->SetPeer( CSIPExEngine::EClient );
00037     aContext->SocketEngineL()->ConnectL( aIapId, aIPAddress );
00038     aContext->InfoL( KConnecting() );
00039     }
00040 
00041 // -----------------------------------------------------------------------------
00042 // TSIPExStateInviting::InviteDeclinedByRemote
00043 // The active state is changed to the Registered and the UI is notified.
00044 // -----------------------------------------------------------------------------
00045 //  
00046 void TSIPExStateInviting::InviteDeclinedByRemote( 
00047     CSIPExEngine* aContext, 
00048     const TInt aResponse )
00049     {
00050     ChangeState( aContext, aContext->iStateRegistered );
00051     TRAPD( ignore, 
00052         CombineAndShowInfoL( aContext, KInviteDeclinedByRemote(), aResponse ) );
00053     StatusInfo( aContext, KGameOver() );
00054     }
00055 
00056 // -----------------------------------------------------------------------------
00057 // TSIPExStateInviting::InvitationCancelled
00058 // Notifies the UI and changes the active state to the Registered.
00059 // -----------------------------------------------------------------------------
00060 //          
00061 void TSIPExStateInviting::InvitationCancelled( CSIPExEngine* aContext ) 
00062     {
00063     ChangeState( aContext, aContext->iStateRegistered );
00064     Info( aContext, KInvitationCancelled() );
00065     StatusInfo( aContext, KGameOver() );
00066     }
00067 
00068 // -----------------------------------------------------------------------------
00069 // TSIPExStateInviting::EndGameL
00070 // The SIP session will be ended.
00071 // -----------------------------------------------------------------------------
00072 //
00073 void TSIPExStateInviting::EndGameL( CSIPExEngine* aContext )
00074     {
00075     aContext->SIPEngine()->CancelInviteL();
00076     }
00077 // End of file
00078 

© Nokia 2006

Back to top