S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExGameEngine.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExGameEngine.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    "SIPExGameEngine.h"
00018 #include    "SIPExStateViewNotifier.h"
00019 #include    "SIPExGameObserver.h"
00020 #include    "SIPExStateAcceptingSIP.h"
00021 #include    "SIPExStateConnecting.h"
00022 #include    "SIPExStateIdle.h"
00023 #include    "SIPExStateInviting.h"
00024 #include    "SIPExStateLocal.h"
00025 #include    "SIPExStateRemote.h"
00026 #include    "SIPExStateRegistering.h"
00027 #include    "SIPExStateRegistered.h"
00028 #include    "SIPExSocketEngine.h"
00029 #include    "SIPExSIPEngine.h"
00030 #include    "SIPExEngine.pan"
00031 #include    <in_sock.h> // TInetAddr
00032 
00033 // Remove exports in unit test build
00034 #ifdef CPPUNIT_TEST
00035 #undef EXPORT_C
00036 #define EXPORT_C
00037 #endif
00038 
00039 // CONSTANTS
00040 const TUid KUidSIPExApp = { 0xA00001EB };
00041 
00042 // -----------------------------------------------------------------------------
00043 // CSIPExEngine::NewL
00044 // Static constructor.
00045 // -----------------------------------------------------------------------------
00046 //
00047 EXPORT_C CSIPExEngine* CSIPExEngine::NewL( MSIPExGameObserver& aGameObserver )
00048     {
00049     CSIPExEngine* self = NewLC( aGameObserver );
00050     CleanupStack::Pop(self);
00051     return self;
00052     }
00053 
00054 // -----------------------------------------------------------------------------
00055 // CSIPExEngine::NewLC
00056 // Static constructor. The instance is left to the CleanupStack.
00057 // -----------------------------------------------------------------------------
00058 //    
00059 EXPORT_C CSIPExEngine* CSIPExEngine::NewLC( MSIPExGameObserver& aGameObserver )
00060     {
00061     CSIPExEngine* self = new (ELeave) CSIPExEngine( aGameObserver );
00062     CleanupStack::PushL(self);
00063     self->ConstructL();
00064     return self;
00065     }
00066 
00067 // -----------------------------------------------------------------------------
00068 // CSIPExEngine::CSIPExEngine
00069 // C++ default constructor. Initializes the observer member variable.
00070 // -----------------------------------------------------------------------------
00071 //
00072 CSIPExEngine::CSIPExEngine( MSIPExGameObserver& aGameObserver )
00073 : iGameObserver( aGameObserver )
00074     {
00075     }
00076 
00077 // -----------------------------------------------------------------------------
00078 // CSIPExEngine::~CSIPExEngine
00079 // Destructor. Destroy all members.
00080 // -----------------------------------------------------------------------------
00081 //
00082 EXPORT_C CSIPExEngine::~CSIPExEngine()
00083     {
00084     DestroySocketEngine();
00085     delete iSIPEngine;
00086 
00087     // Delete all state objects
00088     delete iStateIdle;
00089     delete iStateRegistering;
00090     delete iStateRegistered;
00091     delete iStateInviting;
00092     delete iStateConnecting;
00093     delete iStateLocal;
00094     delete iStateRemote;
00095     delete iStateAcceptingSIP;
00096     }
00097 
00098 // -----------------------------------------------------------------------------
00099 // CSIPExEngine::ConstructL
00100 // Symbian 2nd phase constructor can leave.
00101 // Initializes the game data, socket and sip engines and all state objects.
00102 // -----------------------------------------------------------------------------
00103 //
00104 void CSIPExEngine::ConstructL()
00105     {
00106     // Init all state objects
00107     iStateIdle          = new (ELeave) TSIPExStateIdle;
00108     iStateRegistering   = new (ELeave) TSIPExStateRegistering;
00109     iStateRegistered    = new (ELeave) TSIPExStateRegistered;
00110     iStateInviting      = new (ELeave) TSIPExStateInviting;
00111     iStateConnecting    = new (ELeave) TSIPExStateConnecting;
00112     iStateLocal         = new (ELeave) TSIPExStateLocal;
00113     iStateRemote        = new (ELeave) TSIPExStateRemote;
00114     iStateAcceptingSIP  = new (ELeave) TSIPExStateAcceptingSIP;
00115 
00116     iSocketEngine = CSIPExSocketEngine::NewL( *this );
00117     iSIPEngine = CSIPExSIPEngine::NewL( KUidSIPExApp, this );
00118 
00119     // Set the first state as active state
00120     iActiveState = iStateIdle;
00121 
00122     // Reset game data
00123     ResetGame();
00124     }
00125 
00126 
00127 // ----------------------------------------------------------------------------
00128 // New functions.
00129 // ----------------------------------------------------------------------------
00130 
00131 // -----------------------------------------------------------------------------
00132 // CSIPExEngine::SetViewNotifier
00133 // Sets a new reference to the iNotifier.
00134 // -----------------------------------------------------------------------------
00135 //
00136 EXPORT_C void CSIPExEngine::SetViewNotifier( MSIPExStateViewNotifier& aNotifier )
00137     {
00138     iNotifier = &aNotifier;
00139     }
00140 
00141 // -----------------------------------------------------------------------------
00142 // CSIPExEngine::ResetGame
00143 // Resets the game area, moves and cursor position.
00144 // -----------------------------------------------------------------------------
00145 //
00146 void CSIPExEngine::ResetGame()
00147     {
00148     for ( TInt i=0 ; i < KBoxCountX; i++ ) 
00149         {
00150                 for ( TInt j=0 ; j < KBoxCountY; j++ ) 
00151             {
00152                         iBoard[i][j] = -1;
00153             }
00154         }
00155 
00156         iCursor = 0;
00157     iMoves = 0;
00158     iPeer = EUnknown;
00159     }
00160 
00161 // -----------------------------------------------------------------------------
00162 // CSIPExEngine::SetBoard
00163 // Sets the value (aValue) to the board to the place specified in aX and aY.
00164 // -----------------------------------------------------------------------------
00165 //
00166 void CSIPExEngine::SetBoard( const TInt aX, const TInt aY, const TInt aValue )
00167     {
00168     __ASSERT_DEBUG( aX < KBoxCountX && aY < KBoxCountY, 
00169                     Panic( EBoardValueOOR ) );
00170     iBoard[ aX ][ aY ] = aValue;
00171     }
00172 
00173 // -----------------------------------------------------------------------------
00174 // CSIPExEngine::IncreaseMovesBy
00175 // Increases the iMoves by aAmount.
00176 // -----------------------------------------------------------------------------
00177 //
00178 void CSIPExEngine::IncreaseMovesBy( const TInt aAmount )
00179     {
00180     iMoves += aAmount;
00181     }
00182 
00183 // -----------------------------------------------------------------------------
00184 // CSIPExEngine::BoardValue
00185 // Returns the board value from the specified place.
00186 // -----------------------------------------------------------------------------
00187 //
00188 EXPORT_C TInt CSIPExEngine::BoardValue( TInt aX, TInt aY )
00189     {
00190     __ASSERT_DEBUG( aX < KBoxCountX && aY < KBoxCountY, 
00191                     Panic( EBoardValueOOR ) );
00192     return iBoard[ aX ][ aY ];
00193     }
00194 
00195 // -----------------------------------------------------------------------------
00196 // CSIPExEngine::Cursor
00197 // Returns the iCursor value.
00198 // -----------------------------------------------------------------------------
00199 //
00200 EXPORT_C TInt CSIPExEngine::Cursor()
00201     {
00202     return iCursor;
00203     }
00204 
00205 // -----------------------------------------------------------------------------
00206 // CSIPExEngine::SetCursor
00207 // Sets a new value to the iCursor.
00208 // -----------------------------------------------------------------------------
00209 //
00210 void CSIPExEngine::SetCursor( const TInt aNewValue )
00211     {
00212     iCursor = aNewValue;
00213     }
00214 
00215 // -----------------------------------------------------------------------------
00216 // CSIPExEngine::ChangeState
00217 // Changes a new value to the iActiveState and notifies the game observer.
00218 // -----------------------------------------------------------------------------
00219 //
00220 void CSIPExEngine::ChangeState( TSIPExState& aNewState )
00221     {
00222     iActiveState = &aNewState;
00223 
00224     TEngineState state( EIdle );
00225     if( iActiveState == iStateIdle || iActiveState == iStateRegistering )
00226         {
00227         state = EIdle;
00228         }
00229     else if( iActiveState == iStateRegistered )
00230         {
00231         state = EEnabled;
00232         }
00233     else if ( iActiveState == iStateInviting ||
00234               iActiveState == iStateAcceptingSIP ||
00235               iActiveState == iStateConnecting )
00236         {
00237         state = EActivating;
00238         }
00239     else if( iActiveState == iStateLocal || iActiveState == iStateRemote )      
00240         {
00241         state = EActive;
00242         }
00243     else { /*Nothing to do*/ }
00244 
00245     iGameObserver.GameStateChanged( state );
00246     }
00247 
00248 // -----------------------------------------------------------------------------
00249 // CSIPExEngine::SendMessage
00250 // Formats and sends the message to the socket.
00251 // -----------------------------------------------------------------------------
00252 //
00253 void CSIPExEngine::SendMessage( const TInt aX, const TInt aY )
00254     {
00255     __ASSERT_DEBUG( aX < KBoxCountX && aY < KBoxCountY, 
00256                     Panic( EBoardValueOOR ) );
00257 
00258     TBuf8<8> msg;
00259     msg.Format( KMoveFormatStr(), aX, aY );
00260 
00261     iSocketEngine->Write( msg );
00262     }
00263 
00264 // -----------------------------------------------------------------------------
00265 // CSIPExEngine::Info
00266 // Calls the view notifier.
00267 // -----------------------------------------------------------------------------
00268 //
00269 void CSIPExEngine::InfoL( const TDesC& aInfoTxt )
00270     {
00271     __ASSERT_DEBUG( iNotifier, Panic( ENoGameViewNotifier ) );
00272 
00273     iNotifier->ShowInfoL( aInfoTxt );
00274     }
00275 
00276 // -----------------------------------------------------------------------------
00277 // CSIPExEngine::StatusInfo
00278 // Calls the view notifier.
00279 // -----------------------------------------------------------------------------
00280 //
00281 void CSIPExEngine::StatusInfoL( const TDesC& aTxt )
00282     {
00283     __ASSERT_DEBUG( iNotifier, Panic( ENoGameViewNotifier ) );
00284 
00285     iNotifier->ShowStatusInfoL( aTxt );
00286     }
00287 
00288 // -----------------------------------------------------------------------------
00289 // CSIPExEngine::SetRemote
00290 // Sets the remote peer move to the board into the specified place.
00291 // -----------------------------------------------------------------------------
00292 //
00293 void CSIPExEngine::SetRemote( const TInt aX, const TInt aY )
00294     {
00295     SetBoard( aX, aY, 2 );
00296     }
00297 
00298 // -----------------------------------------------------------------------------
00299 // CSIPExEngine::DestroySocketEngine
00300 // Deletes the socket engine.
00301 // -----------------------------------------------------------------------------
00302 //
00303 void CSIPExEngine::DestroySocketEngine()
00304     {
00305     delete iSocketEngine;
00306     iSocketEngine = NULL;
00307     }
00308 
00309 // -----------------------------------------------------------------------------
00310 // CSIPExEngine::SIPEngine
00311 // Returns the pointer to the SIP engine. The ownership is not transfered.
00312 // -----------------------------------------------------------------------------
00313 //
00314 CSIPExSIPEngine* CSIPExEngine::SIPEngine() 
00315     { 
00316     return iSIPEngine; 
00317     }
00318 
00319 // -----------------------------------------------------------------------------
00320 // CSIPExEngine::SocketEngine
00321 // Returns the pointer to the socket engine. The ownership is not transfered.
00322 // The engine will be created if not already done.
00323 // -----------------------------------------------------------------------------
00324 //
00325 CSIPExSocketEngine* CSIPExEngine::SocketEngineL() 
00326     { 
00327     if( !iSocketEngine )
00328         {
00329         iSocketEngine = CSIPExSocketEngine::NewL( *this );
00330         }
00331     return iSocketEngine;
00332     }
00333 
00334 // -----------------------------------------------------------------------------
00335 // CSIPExEngine::GameObserver
00336 // Returns the reference to the game observer.
00337 // -----------------------------------------------------------------------------
00338 //
00339 MSIPExGameObserver& CSIPExEngine::GameObserver()
00340     { 
00341     return iGameObserver; 
00342     }
00343 
00344 // ----------------------------------------------------------------------------
00345 // From Game engine
00346 // ----------------------------------------------------------------------------
00347 
00348 // -----------------------------------------------------------------------------
00349 // CSIPExEngine::InviteL
00350 // From MSIPExGameEngine. Redirects the call to the active state object.
00351 // -----------------------------------------------------------------------------
00352 //
00353 EXPORT_C void CSIPExEngine::InviteL( const TDesC& aAddress )
00354     {
00355     iActiveState->InviteL( this, aAddress );
00356     }
00357 
00358 // -----------------------------------------------------------------------------
00359 // CSIPExEngine::EnableProfile
00360 // From MSIPExGameEngine. Redirects the call to the active state object.
00361 // -----------------------------------------------------------------------------
00362 //
00363 EXPORT_C void CSIPExEngine::EnableProfileL()
00364     {
00365     iActiveState->EnableProfileL( this );
00366     }
00367 
00368 // -----------------------------------------------------------------------------
00369 // CSIPExEngine::DisableProfile
00370 // From MSIPExGameEngine. Redirects the call to the active state object.
00371 // -----------------------------------------------------------------------------
00372 //
00373 EXPORT_C void CSIPExEngine::DisableProfileL()
00374     {
00375     iActiveState->DisableProfileL( this );
00376     }
00377 
00378 // -----------------------------------------------------------------------------
00379 // CSIPExEngine::SendInstantMsgL
00380 // From MSIPExGameEngine. Redirects the call to the active state object.
00381 // -----------------------------------------------------------------------------
00382 //
00383 EXPORT_C void CSIPExEngine::SendInstantMsgL( 
00384     const TDesC& aAddress, 
00385     const TDesC& aMsg )
00386     {
00387     iActiveState->SendInstantMsgL( this, aAddress, aMsg );
00388     }
00389 
00390 // -----------------------------------------------------------------------------
00391 // CSIPExEngine::EndGameL
00392 // From MSIPExGameEngine. Redirects the call to the active state object.
00393 // -----------------------------------------------------------------------------
00394 //
00395 EXPORT_C void CSIPExEngine::EndGameL()
00396     {
00397     iActiveState->EndGameL( this );
00398     }
00399 
00400 // -----------------------------------------------------------------------------
00401 // CSIPExEngine::DrawCursor
00402 // From MSIPExGameEngine. Redirects the call to the active state object.
00403 // -----------------------------------------------------------------------------
00404 //
00405 EXPORT_C TBool CSIPExEngine::DrawCursor()
00406     {
00407     return iActiveState->DrawCursor();
00408     }
00409 
00410 // -----------------------------------------------------------------------------
00411 // CSIPExEngine::DrawBoard
00412 // From MSIPExGameEngine. Redirects the call to the active state object.
00413 // -----------------------------------------------------------------------------
00414 //
00415 EXPORT_C TBool CSIPExEngine::DrawBoard()
00416     {
00417     return iActiveState->DrawBoard();
00418     }
00419 
00420 // -----------------------------------------------------------------------------
00421 // CSIPExEngine::CursorLeft
00422 // From MSIPExGameEngine. Redirects the call to the active state object.
00423 // -----------------------------------------------------------------------------
00424 //
00425 EXPORT_C void CSIPExEngine::CursorLeft() 
00426     {
00427     iActiveState->CursorLeft( this );
00428     }
00429 
00430 // -----------------------------------------------------------------------------
00431 // CSIPExEngine::CursorRight
00432 // From MSIPExGameEngine. Redirects the call to the active state object.
00433 // -----------------------------------------------------------------------------
00434 //
00435 EXPORT_C void CSIPExEngine::CursorRight() 
00436     {
00437     iActiveState->CursorRight( this );
00438     }
00439 
00440 // -----------------------------------------------------------------------------
00441 // CSIPExEngine::CursorPressed
00442 // Redirects the call to the active state object.
00443 // -----------------------------------------------------------------------------
00444 //
00445 EXPORT_C void CSIPExEngine::CursorPressed() 
00446     {
00447     iActiveState->CursorPressed( this );
00448     }
00449 
00450 // -----------------------------------------------------------------------------
00451 // CSIPExEngine::MoveCursorL
00452 // Redirects the call to the active state object.
00453 // -----------------------------------------------------------------------------
00454 //
00455 EXPORT_C void CSIPExEngine::MoveCursorL( const TInt aNewValue )
00456     {
00457     iActiveState->MoveCursorL( this, aNewValue );
00458     }
00459 
00460 // -----------------------------------------------------------------------------
00461 // CSIPExEngine::CalculatePos
00462 // From MSIPExGameEngine. Redirects the call to the active state object.
00463 // -----------------------------------------------------------------------------
00464 //
00465 TInt CSIPExEngine::CalculatePos() 
00466     {
00467     return iActiveState->CalculatePos( this );
00468     }
00469 
00470 // -----------------------------------------------------------------------------
00471 // CSIPExEngine::IsWin
00472 // From MSIPExGameEngine. Redirects the call to the active state object.
00473 // -----------------------------------------------------------------------------
00474 //
00475 TInt CSIPExEngine::IsWin( const TInt aX, const TInt aY )
00476     {
00477     return iActiveState->IsWin( this, aX, aY );
00478     }
00479 
00480 // -----------------------------------------------------------------------------
00481 // CSIPExEngine::Moves
00482 // Getter function for the iMoves.
00483 // -----------------------------------------------------------------------------
00484 //
00485 TInt CSIPExEngine::Moves()
00486     {
00487     return iMoves;
00488     }
00489 
00490 // -----------------------------------------------------------------------------
00491 // CSIPExEngine::Peer
00492 // Getter function for the iPeer.
00493 // -----------------------------------------------------------------------------
00494 //
00495 CSIPExEngine::TPeer CSIPExEngine::Peer()
00496     {
00497     return iPeer;
00498     }
00499 
00500 // -----------------------------------------------------------------------------
00501 // CSIPExEngine::SetPeer
00502 // Sets a new value to the iPeer.
00503 // -----------------------------------------------------------------------------
00504 //
00505 void CSIPExEngine::SetPeer( TPeer aPeer )
00506     {
00507     iPeer = aPeer;
00508     }
00509 
00510 // -----------------------------------------------------------------------------
00511 // CSIPExEngine::AcceptInvitationL
00512 // Asks from game observer whether user accept the invitation or not.
00513 // -----------------------------------------------------------------------------
00514 //
00515 TBool CSIPExEngine::AcceptInvitationL( const TDesC8& aFrom )
00516     {
00517     HBufC* from = HBufC::NewLC( aFrom.Length() );
00518     from->Des().Copy( aFrom );
00519     TBool retVal = iGameObserver.AcceptInvitationL( *from );
00520     CleanupStack::PopAndDestroy( from );
00521     return retVal;
00522     }
00523 
00524 // ----------------------------------------------------------------------------
00525 // From Socket Observer
00526 // ----------------------------------------------------------------------------
00527 
00528 // -----------------------------------------------------------------------------
00529 // CSIPExEngine::SocketState
00530 // From MSIPExSocketEngineObserver. Redirects the call to the active state object.
00531 // Called when the socket engine's state changes.
00532 // -----------------------------------------------------------------------------
00533 //
00534 void CSIPExEngine::SocketState( TInt aNewState )
00535     {
00536     iActiveState->SocketState( this, aNewState );
00537     }
00538 
00539 // -----------------------------------------------------------------------------
00540 // CSIPExEngine::SocketData
00541 // From MSIPExSocketEngineObserver. Redirects the call to the active state object.
00542 // Called when data has arrived from the socket.
00543 // -----------------------------------------------------------------------------
00544 //
00545 void CSIPExEngine::SocketData( TDesC8& aData ) 
00546     {
00547     iActiveState->SocketData( this, aData );
00548     }
00549 
00550 // ----------------------------------------------------------------------------
00551 // From SIP Observer
00552 // ----------------------------------------------------------------------------
00553 
00554 // -----------------------------------------------------------------------------
00555 // CSIPExEngine::InviteReceived
00556 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00557 // -----------------------------------------------------------------------------
00558 //
00559 void CSIPExEngine::InviteReceived( const TDesC8& aFrom, const TUint32 aIapId )
00560     {
00561     iActiveState->InviteReceived( this, aFrom, aIapId );
00562     }
00563 
00564 // -----------------------------------------------------------------------------
00565 // CSIPExEngine::InviteAcceptedByRemote
00566 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00567 // -----------------------------------------------------------------------------
00568 //
00569 void CSIPExEngine::InviteAcceptedByRemote( 
00570     const TInetAddr& aIPAddress, 
00571     const TUint32 aIapId )
00572     {
00573     iActiveState->InviteAcceptedByRemote( this, aIPAddress, aIapId );
00574     }
00575 
00576 // -----------------------------------------------------------------------------
00577 // CSIPExEngine::InviteAcceptedByUs
00578 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00579 // -----------------------------------------------------------------------------
00580 //
00581 void CSIPExEngine::InviteAcceptedByUs()
00582     {
00583     iActiveState->InviteAcceptedByUs( this );
00584     }
00585 
00586 // -----------------------------------------------------------------------------
00587 // CSIPExEngine::InviteDeclinedByRemote
00588 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00589 // -----------------------------------------------------------------------------
00590 //
00591 void CSIPExEngine::InviteDeclinedByRemote( const TInt aResponse )
00592     {
00593     iActiveState->InviteDeclinedByRemote( this, aResponse );
00594     }
00595 
00596 // -----------------------------------------------------------------------------
00597 // CSIPExEngine::InviteReceivedByRemote
00598 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00599 // -----------------------------------------------------------------------------
00600 //
00601 void CSIPExEngine::InviteReceivedByRemote( const TInt aResponse )
00602     {
00603     iActiveState->InviteReceivedByRemote( this, aResponse );
00604     }
00605 
00606 // -----------------------------------------------------------------------------
00607 // CSIPExEngine::EngineError
00608 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00609 // -----------------------------------------------------------------------------
00610 //
00611 void CSIPExEngine::EngineError( TInt aError )
00612     {
00613     iActiveState->EngineError( this, aError );
00614     }
00615 
00616 // -----------------------------------------------------------------------------
00617 // CSIPExEngine::InvitationCancelled
00618 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00619 // -----------------------------------------------------------------------------
00620 //
00621 void CSIPExEngine::InvitationCancelled()
00622     {
00623     iActiveState->InvitationCancelled( this );
00624     }
00625 
00626 // -----------------------------------------------------------------------------
00627 // CSIPExEngine::CancelFailed
00628 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00629 // -----------------------------------------------------------------------------
00630 //
00631 void CSIPExEngine::CancelFailed()
00632     {
00633     iActiveState->CancelFailed( this );
00634     }
00635 
00636 // -----------------------------------------------------------------------------
00637 // CSIPExEngine::SessionEnded
00638 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00639 // -----------------------------------------------------------------------------
00640 //
00641 void CSIPExEngine::SessionEnded()
00642     {
00643     iActiveState->SessionEnded( this );
00644     }
00645 
00646 // -----------------------------------------------------------------------------
00647 // CSIPExEngine::ConnectionLost
00648 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00649 // -----------------------------------------------------------------------------
00650 //
00651 void CSIPExEngine::ConnectionLost()
00652     {
00653     iActiveState->ConnectionLost( this );
00654     }
00655 
00656 // -----------------------------------------------------------------------------
00657 // CSIPExEngine::ProfileEnabled
00658 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00659 // -----------------------------------------------------------------------------
00660 //
00661 void CSIPExEngine::ProfileEnabled( TUint32 aSIPProfileId )
00662     {
00663     iActiveState->ProfileEnabled( this, aSIPProfileId );
00664     }
00665 
00666 // -----------------------------------------------------------------------------
00667 // CSIPExEngine::ProfileError
00668 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00669 // -----------------------------------------------------------------------------
00670 //
00671 void CSIPExEngine::ProfileError( TInt aError )
00672     {
00673     iActiveState->ProfileError( this, aError );
00674     }
00675 
00676 // -----------------------------------------------------------------------------
00677 // CSIPExEngine::IMReceived
00678 // From MSIPExSIPEngineObserver. Redirects the call to the active state object.
00679 // -----------------------------------------------------------------------------
00680 //
00681 void CSIPExEngine::IMReceived( const TDesC8& aFrom,
00682                                  const TDesC8& aMessage )
00683     {
00684     iActiveState->IMReceived( this, aFrom, aMessage );
00685     }
00686 
00687 // -----------------------------------------------------------------------------
00688 // CSIPExEngine::WriteLog
00689 // From MSIPExSIPEngineObserver. Logs SIP engine events
00690 // -----------------------------------------------------------------------------
00691 //
00692 void CSIPExEngine::WriteLog( const TDesC8& aLog )
00693     {
00694     if( iNotifier )
00695         {
00696         TRAPD( ignore, iNotifier->ShowInfoL( aLog ) );
00697         }
00698     }
00699 
00700 
00701 // End of file
00702 

© Nokia 2006

Back to top