S60 3rd Edition SDK for Symbian OS
Example Applications Guide

TSIPExStateIdle Class Reference

#include <SIPExStateIdle.h>

Inheritance diagram for TSIPExStateIdle:

TSIPExState List of all members.

Public Member Functions

 TSIPExStateIdle ()
virtual void EnableProfileL (CSIPExEngine *aContext)
virtual void SessionEnded (CSIPExEngine *aContext)
virtual void InviteReceived (CSIPExEngine *aContext, const TDesC8 &aFrom, const TUint32 aIapId)

Public Attributes

TBool iEnded

Detailed Description

The state is valid when the profile haven't been enabled yet.

Definition at line 27 of file SIPExStateIdle.h.


Constructor & Destructor Documentation

TSIPExStateIdle::TSIPExStateIdle (   )  [inline]
 

Constructor

Definition at line 35 of file SIPExStateIdle.h.

00035 : iEnded( EFalse ) {}


Member Function Documentation

void TSIPExStateIdle::EnableProfileL (  CSIPExEngine *  aContext  )  [virtual]
 

EnableProfile From TSIPExState

Reimplemented from TSIPExState.

Definition at line 28 of file SIPExStateIdle.cpp.

References TSIPExState::ChangeState(), CSIPExSIPEngine::EnableProfileL(), CSIPExEngine::InfoL(), CSIPExEngine::iStateRegistering, and CSIPExEngine::SIPEngine().

00029     {
00030     // Notify UI
00031     aContext->InfoL( KEnablingProfile() );
00032 
00033     // The registration is required
00034     if( !aContext->SIPEngine()->EnableProfileL() )
00035         {
00036         ChangeState( aContext, aContext->iStateRegistering );
00037         }
00038     // The profile was succesfully enabled and registered
00039     else
00040         {
00041         aContext->InfoL( KProfileEnabled() );
00042         ChangeState( aContext, aContext->iStateRegistered );
00043         }
00044     }

void TSIPExStateIdle::SessionEnded (  CSIPExEngine *  aContext  )  [virtual]
 

SessionEnded From TSIPExState

Reimplemented from TSIPExState.

Definition at line 51 of file SIPExStateIdle.cpp.

References iEnded, and TSIPExState::Info().

00052     {
00053     // Keep track whether session ended while accept dialog was shown to user.
00054     iEnded = ETrue;
00055     
00056     Info( aContext, KSessionEnded() );
00057     }

void TSIPExStateIdle::InviteReceived (  CSIPExEngine *  aContext,
const TDesC8 &  aFrom,
const TUint32  aIapId
)  [virtual]
 

InviteReceived From TSIPExState

Reimplemented from TSIPExState.

Definition at line 66 of file SIPExStateIdle.cpp.

References CSIPExEngine::AcceptInvitationL(), CSIPExSIPEngine::AcceptInviteL(), TSIPExState::ChangeState(), iEnded, TSIPExState::Info(), CSIPExEngine::iStateAcceptingSIP, CSIPExEngine::ResetGame(), CSIPExEngine::SetPeer(), CSIPExEngine::SIPEngine(), CSIPExEngine::SocketEngineL(), and CSIPExSocketEngine::StartListeningL().

00070     {
00071     iEnded = EFalse;
00072     
00073     TBool retVal( EFalse );
00074     TRAPD( ignore, retVal = aContext->AcceptInvitationL( aFrom ) );
00075     if ( iEnded )
00076         {
00077         return;
00078         }
00079     if( retVal )
00080         {
00081         ChangeState( aContext, aContext->iStateAcceptingSIP );
00082         // The game data is reseted
00083         aContext->ResetGame();
00084         // The role for the peer is set
00085         aContext->SetPeer( CSIPExEngine::EServer );
00086         // Start listen incoming connections
00087         TInetAddr addr;
00088         TRAP( ignore, 
00089                 addr = aContext->SocketEngineL()->StartListeningL( aIapId ) );
00090         // Signal SIP engine
00091         TRAP( ignore, aContext->SIPEngine()->AcceptInviteL( addr ) );
00092         Info( aContext, KWaitingRemoteConn() );
00093         }
00094     else 
00095         {
00096         // Signal SIP engine
00097         TRAP( ignore, aContext->SIPEngine()->DeclineInviteL() );
00098         Info( aContext, KInviteDeclined() );
00099         }
00100     }


© Nokia 2006

Back to top