S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExState.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExState.h
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 #ifndef __TSIPEXSTATE_H__
00017 #define __TSIPEXSTATE_H__
00018 
00019 // INCLUDES
00020 #include    "SIPExSocketEngine.h"
00021 #include    "SIPExGameEngine.h"
00022 #include    <e32base.h>
00023 #include    <in_sock.h>
00024 
00025 // FORWARD DECLARATIONS
00026 
00027 // CLASS DECLARATIONS
00028 /**
00029 * The abstract base class for all states.
00030 */
00031 class TSIPExState 
00032     {
00033     public: // New functions
00034 
00035         /**
00036         * ChangeState
00037         * Changing the active state.
00038         * @param aContext The pointer to the game engine.
00039         * @param aNewState The new active state.
00040         */
00041         void ChangeState( CSIPExEngine* aContext, TSIPExState* aNewState );
00042 
00043         /**
00044         * Info
00045         * Non leaving function for setting info text.
00046         * @param aContext The pointer to the game engine.
00047         * @param aText A text to set to the info
00048         */
00049         void Info( CSIPExEngine* aContext, const TDesC& aText );
00050 
00051         /**
00052         * StatusInfo
00053         * Non leaving function for setting status info text.
00054         * @param aContext The pointer to the game engine.
00055         * @param aText A text to set to the info
00056         */
00057         void StatusInfo( CSIPExEngine* aContext, const TDesC& aText );
00058 
00059         /**
00060         * CombineAndShowInfoL
00061         * Combines a descriptor and a number value as one descriptor.
00062         * The result descriptor is set to info view.
00063         * The max length of the new desc is 64.
00064         * @param aContext The pointer to the game engine.
00065         * @param aText A text part.
00066         * @param aNum A number part.
00067         */
00068         void CombineAndShowInfoL( CSIPExEngine* aContext, const TDesC& aText, TInt aNum );
00069 
00070     public:
00071         // ----------------------------------------------------------------------------
00072         // From SIP Observer
00073         // ----------------------------------------------------------------------------
00074 
00075         /**
00076         * InviteReceived
00077         * From MSIPExSIPEngineObserver.
00078         */
00079         virtual void InviteReceived( CSIPExEngine* aContext, 
00080                 const TDesC8& aFrom, const TUint32 aIapId );
00081             
00082         /**
00083         * InviteAcceptedByRemote
00084         * From MSIPExSIPEngineObserver.
00085         */
00086         virtual void InviteAcceptedByRemote( CSIPExEngine* aContext, const TInetAddr& aIPAddress, const TUint32 aIapId );
00087             
00088         /**
00089         * InviteDeclinedByRemote
00090         * From MSIPExSIPEngineObserver.
00091         */
00092         virtual void InviteDeclinedByRemote( CSIPExEngine* aContext, const TInt aResponse );
00093 
00094         /**
00095         * InviteReceivedByRemote
00096         * From MSIPExSIPEngineObserver.
00097         */
00098         virtual void InviteReceivedByRemote( CSIPExEngine* aContext, const TInt aResponse );
00099 
00100         /**
00101         * InviteAcceptedByUs
00102         * From MSIPExSIPEngineObserver.
00103         */
00104         virtual void InviteAcceptedByUs( CSIPExEngine* aContext );
00105             
00106         /**
00107         * InvitationCancelled
00108         * From MSIPExSIPEngineObserver.
00109         */
00110         virtual void InvitationCancelled( CSIPExEngine* aContext);
00111             
00112         /**
00113         * CancelFailed
00114         * From MSIPExSIPEngineObserver.
00115         */
00116         virtual void CancelFailed( CSIPExEngine* aContext );
00117 
00118         /**
00119         * ProfileEnabled
00120         * From MSIPExSIPEngineObserver.
00121         */
00122         virtual void ProfileEnabled( CSIPExEngine* aContext, TUint32 aSIPProfileId );
00123 
00124         /**
00125         * IMReceived
00126         * From MSIPExSIPEngineObserver.
00127         */
00128         virtual void IMReceived( CSIPExEngine* aContext, const TDesC8& aFrom,
00129             const TDesC8& aMessage );
00130 
00131         /**
00132         * SessionEnded
00133         * From MSIPExSIPEngineObserver.
00134         */
00135         virtual void SessionEnded( CSIPExEngine* aContext );
00136             
00137         /**
00138         * ConnectionLost
00139         * From MSIPExSIPEngineObserver.
00140         */
00141         virtual void ConnectionLost( CSIPExEngine* aContext );
00142             
00143         /**
00144         * ProfileError
00145         * From MSIPExSIPEngineObserver.
00146         */
00147         virtual void ProfileError( CSIPExEngine* aContext, TInt aError );
00148 
00149         /**
00150         * EngineError
00151         * From MSIPExSIPEngineObserver.
00152         */
00153         void EngineError( CSIPExEngine* aContext, TInt aError );
00154             
00155         // ----------------------------------------------------------------------------
00156         // From Socket engine
00157         // ----------------------------------------------------------------------------
00158 
00159         /**
00160         * SocketState
00161         * From MSIPExSocketEngineObserver.
00162         */
00163         virtual void SocketState( CSIPExEngine* aContext, TInt aNewState );
00164 
00165         /**
00166         * SocketData
00167         * From MSIPExSocketEngineObserver.
00168         */
00169         virtual void SocketData( CSIPExEngine* aContext, TDesC8& aData );
00170             
00171         // ----------------------------------------------------------------------------
00172         // From Game Engine
00173         // ----------------------------------------------------------------------------
00174         
00175         /**
00176         * InviteL
00177         * Called when user invites the remote user to the game.
00178         */
00179         virtual void InviteL( CSIPExEngine* aContext, const TDesC& aAddress );
00180 
00181         /**
00182         * DrawCursor
00183         * Tells whether we should draw the cursor or not.
00184         */
00185         virtual TBool DrawCursor();
00186 
00187         /**
00188         * DrawBoard
00189         * Tells whether we should draw the board or not.
00190         */
00191         virtual TBool DrawBoard();
00192 
00193         /**
00194         * CalculatePos
00195         * Calculates the next free place in cursor's column.
00196         */
00197         virtual TInt CalculatePos( CSIPExEngine* aContext );
00198 
00199         /**
00200         * IsWin
00201         * Checks the if the move is winning move.
00202         */
00203         virtual TInt IsWin( CSIPExEngine* aContext, const TInt aX, const TInt aY );
00204 
00205         /**
00206         * EnableProfile
00207         * Virtual function.
00208         */
00209         virtual void EnableProfileL( CSIPExEngine* aContext );
00210 
00211         /**
00212         * DisableProfile
00213         * Virtual function.
00214         */
00215         virtual void DisableProfileL( CSIPExEngine* aContext );
00216 
00217         /**
00218         * CursorPressed
00219         * Virtual function.
00220         */
00221         virtual void CursorPressed( CSIPExEngine* aContext );
00222             
00223         /**
00224         * CursorRight
00225         * Virtual function.
00226         */
00227         virtual void CursorRight( CSIPExEngine* aContext );
00228 
00229         /**
00230         * CursorLeft
00231         * Virtual function.
00232         */
00233         virtual void CursorLeft(  CSIPExEngine* aContext );
00234 
00235         /**
00236         * MoveCursorL
00237         * Virtual function
00238         */
00239         virtual void MoveCursorL( CSIPExEngine* aContext, const TInt aNewPosition );
00240 
00241         /**
00242         * SendInstantMsgL
00243         * Virtual function.
00244         */
00245         virtual void SendInstantMsgL( CSIPExEngine* aContext, 
00246             const TDesC& aAddress, const TDesC& aMsg );
00247 
00248         /**
00249         * EndGameL
00250         * Virtual function.
00251         */
00252         virtual void EndGameL( CSIPExEngine* aContext );
00253     };
00254 
00255 #endif // __TSIPEXSTATE_H__
00256 
00257 // End of file

© Nokia 2006

Back to top