S60 3rd Edition SDK for Symbian OS
Example Applications Guide

IMOpenAPIExampleMsg.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : IMOpenAPIExampleMsg.h
00004 *  Part of     : IMOpenAPIExample
00005 *  Interface   : 
00006 *  Description : 
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2005-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 __IMOPENAPIEXAMPLEMSG_H__
00017 #define __IMOPENAPIEXAMPLEMSG_H__
00018 
00019 // CONSTANTS
00020 const TInt KMaxProtocolStrLength = 25;
00021 const TInt KMaxUserIDLength = 50;
00022 const TInt KMaxInfoMsgLength = 100;
00023 
00024 /**
00025 * TGameState.
00026 * Used to define the game state. Using game state engine and UI take actions.
00027 */
00028 enum TGameState
00029                         {
00030                         EStateNotLogin,
00031                         EStateLoginIdle,
00032                         EStateSending,
00033                         EStateChallenged,
00034                         EStateReadytoStart,
00035                         EStateWaitingForOppMove,
00036                         EStateWaitingForOwnMove
00037                         };
00038                         
00039 /**
00040 * TGameSign.
00041 * Defines signs, 0 means cross sign, 1 means zero sign, 2 means empty.
00042 */
00043 enum TGameSign
00044                         {
00045                         ECrossSign = 0,
00046                         EZeroSign,
00047                         EEmptySign
00048                         };
00049                         
00050 /**
00051 * TInternalMsgID.
00052 * Internal message ids which model sends to UI
00053 */
00054 enum TInternalMsgID
00055                         {
00056                         Connected,
00057                         DisConnected,
00058                         ChallengeRec,
00059                         ChallengeSent,
00060                         MsgConfirmation,
00061                         Error,
00062                         PlayedIndexRec,
00063                         StartGameRec,
00064                         EndGameRec,
00065                         ChallengeAcceptedRec,
00066                         ChallengeRejectedRec,
00067             EndChallengeRec,
00068                         AlreadyInGameRec,
00069             YouWon,
00070             YouLost,
00071             GameDraw,
00072             StartGameWarning
00073                         };
00074 
00075 /**
00076 * TMsg.
00077 * Used to save messages in model
00078 */
00079 enum TMsg
00080                         {
00081                         MsgChallenge,
00082                         MsgChallengeAccepted,
00083                         MsgChallengeRejected,
00084                         MsgStartGameYourTurn,
00085             MsgStartGameOppTurn,
00086                         MsgExitGame,
00087                         MsgPlayedIndex,
00088                         MsgEndChallenge,
00089                         MsgAlreadyInGame
00090                         };
00091 
00092 
00093 
00094 /**
00095 * Constant strings used in message protocols.
00096 */
00097 _LIT(KChallenge, "Challenge");
00098 _LIT(KChallengeAccepted, "ChallengeAccepted");
00099 _LIT(KChallengeRejected, "ChallengeRejected");
00100 _LIT(KStartGameYourTurn, "StartGameYourTurn");
00101 _LIT(KStartGameOppTurn, "StartGameOppTurn");
00102 _LIT(KExitGame, "ExitGame");
00103 _LIT(KPlayedIndex, "PlayedIndex");
00104 _LIT(KEndChallenge, "EndChallenge");
00105 _LIT(KAlreadyInGame, "AlreadyInGame");
00106 
00107 #endif // __IMOPENAPIEXAMPLEMSG_H__
00108 
00109 // end of file
00110 

© Nokia 2006

Back to top