multimediacommsengine/mmcesrv/mmceserver/inc/mcenatsipstatemachine.h
changeset 0 1bce908db942
child 11 2a28ef775f15
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMCENATSIPSTATEMACHINE_H
       
    21 #define CMCENATSIPSTATEMACHINE_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "mcesrv.h"
       
    25 #include "mcenatstate.h"
       
    26 #include "mceclientserver.h"
       
    27 #include "mcedefs.h"
       
    28 
       
    29 //  FORWARD DECLARATION
       
    30 class TMceNatStateTransitionEvent;
       
    31 
       
    32 /**
       
    33 *  MCE SIP state machine
       
    34 *
       
    35 *  @lib 
       
    36 *  @since
       
    37 */
       
    38 class CMceNatSipStateMachine : public CBase
       
    39 	{
       
    40 public: // Constructors and destructor
       
    41 
       
    42 	/**
       
    43 	* Two-phased constructor.
       
    44 	*/
       
    45 	static CMceNatSipStateMachine* NewL();
       
    46 
       
    47 	/**
       
    48 	* Two-phased constructor.
       
    49 	*/
       
    50 	static CMceNatSipStateMachine* NewLC();
       
    51 
       
    52 	/**
       
    53 	* Destructor.
       
    54 	*/
       
    55 	~CMceNatSipStateMachine();
       
    56 
       
    57 
       
    58 public: //New
       
    59 
       
    60 	/**
       
    61 	* return a state by index
       
    62 	* @param aNewState next state
       
    63 	*/
       
    64     void NewStateL( TMceNatStateTransitionEvent& aEvent,
       
    65                     TMceNatStateIndex aNewState );
       
    66 
       
    67 	/**
       
    68 	* processes message
       
    69 	* @param aEvent event
       
    70 	*/
       
    71     void ProcessL( TMceNatStateTransitionEvent& aEvent );
       
    72 
       
    73 	/**
       
    74 	* checks if event is accepted by current state.
       
    75 	* @param aEvent event
       
    76 	*/
       
    77     TBool Accept( TMceNatStateTransitionEvent& aEvent );
       
    78 
       
    79 	/**
       
    80 	* returns the current state index.
       
    81 	* @return state index, if not found KErrNotFound returned
       
    82 	*/
       
    83     TInt State() const;
       
    84     
       
    85 	/**
       
    86 	* Sets current state as Idle.
       
    87 	*/
       
    88     void ErrorOccurred();
       
    89     
       
    90 private:
       
    91 
       
    92 	CMceNatSipStateMachine();
       
    93     
       
    94 	void ConstructL();
       
    95 
       
    96 
       
    97 private: // Data
       
    98 
       
    99     // Current state index
       
   100     TMceNatStateIndex iCurrentState;
       
   101     
       
   102     // Array containing all state - objects.
       
   103     RPointerArray<CMceNatState> iStates;
       
   104     
       
   105 	//definitions for unit testing
       
   106 	MCESRV_UT_DEFINITIONS
       
   107 	
       
   108 	};
       
   109 
       
   110 #endif // CMCENATSIPSTATEMACHINE_H
       
   111 
       
   112 // End of File