sipexgameengine.cpp

来自「an example for sip for symbian」· C++ 代码 · 共 703 行 · 第 1/2 页

CPP
703
字号
EXPORT_C void CSIPExEngine::InviteL( const TDesC& aAddress )
    {
    iActiveState->InviteL( this, aAddress );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::EnableProfile
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::EnableProfileL()
    {
    iActiveState->EnableProfileL( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::DisableProfile
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::DisableProfileL()
    {
    iActiveState->DisableProfileL( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::SendInstantMsgL
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::SendInstantMsgL( 
    const TDesC& aAddress, 
    const TDesC& aMsg )
    {
    iActiveState->SendInstantMsgL( this, aAddress, aMsg );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::EndGameL
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::EndGameL()
    {
    iActiveState->EndGameL( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::DrawCursor
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C TBool CSIPExEngine::DrawCursor()
    {
    return iActiveState->DrawCursor();
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::DrawBoard
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C TBool CSIPExEngine::DrawBoard()
    {
    return iActiveState->DrawBoard();
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::CursorLeft
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::CursorLeft() 
    {
    iActiveState->CursorLeft( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::CursorRight
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::CursorRight() 
    {
    iActiveState->CursorRight( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::CursorPressed
// Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::CursorPressed() 
    {
    iActiveState->CursorPressed( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::MoveCursorL
// Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
EXPORT_C void CSIPExEngine::MoveCursorL( const TInt aNewValue )
    {
    iActiveState->MoveCursorL( this, aNewValue );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::CalculatePos
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
TInt CSIPExEngine::CalculatePos() 
    {
    return iActiveState->CalculatePos( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::IsWin
// From MSIPExGameEngine. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
TInt CSIPExEngine::IsWin( const TInt aX, const TInt aY )
    {
    return iActiveState->IsWin( this, aX, aY );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::Moves
// Getter function for the iMoves.
// -----------------------------------------------------------------------------
//
TInt CSIPExEngine::Moves()
    {
    return iMoves;
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::Peer
// Getter function for the iPeer.
// -----------------------------------------------------------------------------
//
CSIPExEngine::TPeer CSIPExEngine::Peer()
    {
    return iPeer;
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::SetPeer
// Sets a new value to the iPeer.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::SetPeer( TPeer aPeer )
    {
    iPeer = aPeer;
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::AcceptInvitationL
// Asks from game observer whether user accept the invitation or not.
// -----------------------------------------------------------------------------
//
TBool CSIPExEngine::AcceptInvitationL( const TDesC8& aFrom )
    {
    HBufC* from = HBufC::NewLC( aFrom.Length() );
    from->Des().Copy( aFrom );
    TBool retVal = iGameObserver.AcceptInvitationL( *from );
    CleanupStack::PopAndDestroy( from );
    return retVal;
    }

// ----------------------------------------------------------------------------
// From Socket Observer
// ----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// CSIPExEngine::SocketState
// From MSIPExSocketEngineObserver. Redirects the call to the active state object.
// Called when the socket engine's state changes.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::SocketState( TInt aNewState )
    {
    iActiveState->SocketState( this, aNewState );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::SocketData
// From MSIPExSocketEngineObserver. Redirects the call to the active state object.
// Called when data has arrived from the socket.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::SocketData( TDesC8& aData ) 
    {
    iActiveState->SocketData( this, aData );
    }

// ----------------------------------------------------------------------------
// From SIP Observer
// ----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// CSIPExEngine::InviteReceived
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InviteReceived( const TDesC8& aFrom, const TUint32 aIapId )
    {
    iActiveState->InviteReceived( this, aFrom, aIapId );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::InviteAcceptedByRemote
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InviteAcceptedByRemote( 
    const TInetAddr& aIPAddress, 
    const TUint32 aIapId )
    {
    iActiveState->InviteAcceptedByRemote( this, aIPAddress, aIapId );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::InviteAcceptedByUs
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InviteAcceptedByUs()
    {
    iActiveState->InviteAcceptedByUs( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::InviteDeclinedByRemote
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InviteDeclinedByRemote( const TInt aResponse )
    {
    iActiveState->InviteDeclinedByRemote( this, aResponse );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::InviteReceivedByRemote
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InviteReceivedByRemote( const TInt aResponse )
    {
    iActiveState->InviteReceivedByRemote( this, aResponse );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::EngineError
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::EngineError( TInt aError )
    {
    iActiveState->EngineError( this, aError );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::InvitationCancelled
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::InvitationCancelled()
    {
    iActiveState->InvitationCancelled( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::CancelFailed
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::CancelFailed()
    {
    iActiveState->CancelFailed( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::SessionEnded
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::SessionEnded()
    {
    iActiveState->SessionEnded( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::ConnectionLost
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::ConnectionLost()
    {
    iActiveState->ConnectionLost( this );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::ProfileEnabled
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::ProfileEnabled( TUint32 aSIPProfileId )
    {
    iActiveState->ProfileEnabled( this, aSIPProfileId );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::ProfileError
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::ProfileError( TInt aError )
    {
    iActiveState->ProfileError( this, aError );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::IMReceived
// From MSIPExSIPEngineObserver. Redirects the call to the active state object.
// -----------------------------------------------------------------------------
//
void CSIPExEngine::IMReceived( const TDesC8& aFrom,
				 const TDesC8& aMessage )
    {
    iActiveState->IMReceived( this, aFrom, aMessage );
    }

// -----------------------------------------------------------------------------
// CSIPExEngine::WriteLog
// From MSIPExSIPEngineObserver. Logs SIP engine events
// -----------------------------------------------------------------------------
//
void CSIPExEngine::WriteLog( const TDesC8& aLog )
    {
    if( iNotifier )
        {
        TRAPD( ignore, iNotifier->ShowInfoL( aLog ) );
        }
    }


// End of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?