|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
#include <SIPExStateRemote.h>
Inheritance diagram for TSIPExStateRemote:

Public Member Functions | |
| virtual void | SocketData (CSIPExEngine *aContext, TDesC8 &aData) |
| virtual void | SendInstantMsgL (CSIPExEngine *aContext, const TDesC &aAddress, const TDesC &aMsg) |
| virtual void | DisableProfileL (CSIPExEngine *aContext) |
| virtual void | EndGameL (CSIPExEngine *aContext) |
Definition at line 27 of file SIPExStateRemote.h.
|
||||||||||||
|
SocketData From TSIPExState Reimplemented from TSIPExState. Definition at line 26 of file SIPExStateRemote.cpp. References TSIPExState::ChangeState(), CSIPExEngine::IncreaseMovesBy(), CSIPExEngine::iStateRegistered, CSIPExEngine::IsWin(), CSIPExEngine::Moves(), CSIPExEngine::SetCursor(), CSIPExEngine::SetRemote(), and TSIPExState::StatusInfo(). 00027 { 00028 // The length is fixed to 4. Format is "x, y". 00029 if ( aData.Length() == 4 ) 00030 { 00031 TBuf<1> buffer; 00032 buffer.Copy( aData.Mid( 0, 1 ) ); 00033 TLex lex( buffer ); 00034 TInt x( 0 ); 00035 TInt y( 0 ); 00036 lex.Val( x ); 00037 buffer.Copy( aData.Mid( 3, 1 ) ); 00038 lex.Assign( buffer ); 00039 lex.Val( y ); 00040 00041 aContext->SetRemote( x, y ); 00042 aContext->IncreaseMovesBy( 1 ); 00043 00044 TInt ret = aContext->IsWin(x,y); 00045 aContext->SetCursor( x ); 00046 if (ret > 0) 00047 { 00048 ChangeState( aContext, aContext->iStateRegistered ); 00049 StatusInfo( aContext, KYouLose() ); 00050 } 00051 else if ( aContext->Moves() == KMaxMoves) 00052 { 00053 ChangeState( aContext, aContext->iStateRegistered ); 00054 StatusInfo( aContext, KGameTie() ); 00055 } 00056 else 00057 { 00058 ChangeState( aContext, aContext->iStateLocal ); 00059 StatusInfo( aContext, KYourMove() ); 00060 } 00061 } 00062 else 00063 { 00064 HBufC* buf = HBufC::NewLC( aData.Length() ); 00065 buf->Des().Copy( aData ); 00066 aContext->InfoL( *buf ); 00067 CleanupStack::PopAndDestroy( buf ); 00068 } 00069 }
|
|
||||||||||||||||
|
SendInstantMsgL From TSIPExState Reimplemented from TSIPExState. Definition at line 76 of file SIPExStateRemote.cpp. References CSIPExSIPEngine::CreateIML(), and CSIPExEngine::SIPEngine(). 00078 { 00079 HBufC8* addr = HBufC8::NewLC( aAddress.Length() ); 00080 addr->Des().Copy( aAddress ); 00081 00082 HBufC8* msg = HBufC8::NewLC( aMsg.Length() ); 00083 msg->Des().Copy( aMsg ); 00084 00085 aContext->SIPEngine()->CreateIML( *msg, *addr ); 00086 00087 CleanupStack::PopAndDestroy( msg ); 00088 CleanupStack::PopAndDestroy( addr ); 00089 }
|
|
|
DisableProfile From TSIPExState Reimplemented from TSIPExState. Definition at line 96 of file SIPExStateRemote.cpp. References CSIPExEngine::InfoL(). 00097 { 00098 aContext->InfoL( KGameAlreadyRunning() ); 00099 }
|
|
|
EndGameL From TSIPExState Reimplemented from TSIPExState. Definition at line 107 of file SIPExStateRemote.cpp. References CSIPExSIPEngine::EndSessionL(), and CSIPExEngine::SIPEngine(). 00108 { 00109 aContext->SIPEngine()->EndSessionL(); 00110 }
|
|
© Nokia 2006 |