realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h
changeset 0 307788aac0a8
child 23 8798b8c7bbfb
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 * Name        : sipprflderegisterrequestedstate.h
       
    16 * Part of     : sip profile fsm 
       
    17 * Version     : %version: 2.1.1 %
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef CSIPPRFLDEREGISTERREQUESTEDSTATE_H
       
    29 #define CSIPPRFLDEREGISTERREQUESTEDSTATE_H
       
    30 
       
    31 //  INCLUDES
       
    32 #include "sipprflstatebase.h"
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class MSIPProfileContext;
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 /**
       
    40 * Reacts to events that are possible in "Deregister Requested" state. 
       
    41 * Profile is in this state if deregistration was requested and 
       
    42 * connection was suspended.
       
    43 */
       
    44 class CSIPPrflDeregisterRequestedState: public CSIPPrflStateBase
       
    45 	{
       
    46 	public:// Constructors and destructor		   
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         * @param aUser user for the state machine
       
    50         */
       
    51 		IMPORT_C static CSIPPrflDeregisterRequestedState* NewL(
       
    52 		    MSIPProfileFSMUser& aUser);
       
    53 
       
    54         /**
       
    55         * Destructor
       
    56         */
       
    57 		IMPORT_C ~CSIPPrflDeregisterRequestedState();
       
    58 
       
    59 	public://new functions
       
    60 		/**
       
    61 		* Links the states
       
    62 		* @param aInitState "Init" state
       
    63 		* @param aRegisteredState "Registered" state
       
    64 		* @param aDeregistrationInProgressState "Deregistration in Progress" state
       
    65 		*/
       
    66 		IMPORT_C void LinkStates(
       
    67 			CSIPPrflStateBase& aInitState,
       
    68 			CSIPPrflStateBase& aRegisteredState,
       
    69 			CSIPPrflStateBase& aDeregistrationInProgressState);
       
    70 
       
    71 	public://functions from base class
       
    72 		
       
    73 		CSIPConcreteProfile::TStatus ConcreteProfileState() const;
       
    74 		
       
    75 		/**
       
    76 		* Moves back the profile to "Registered" state
       
    77 		* @param aContext a profile context
       
    78 		*/
       
    79 		void RegisterL(
       
    80 			MSIPProfileContext& aContext);
       
    81 		
       
    82 		/**
       
    83 		* Indicates that refresh failed during the
       
    84 		* suspended connection. Moves profile to "Init" state.
       
    85 		* @param aContext a profile context
       
    86 		* @param aError an error
       
    87 		*/
       
    88 		void ErrorOccured(
       
    89 			MSIPProfileContext& aContext,
       
    90 			TInt aError);
       
    91 
       
    92 		/**
       
    93 		* Connection state has changed.
       
    94 		* Moves profile to "Init" state in case of inactive connection or to 
       
    95 		* "Deregistration In Progress" state in case of active connection.
       
    96 		* @param aContext a profile context
       
    97 		* @param aState indicates the current connection state
       
    98 		*/
       
    99 		void ConnectionStateChanged(
       
   100 			MSIPProfileContext& aContext,
       
   101 			CSIPConnection::TState aState);	
       
   102 
       
   103 	private:
       
   104 
       
   105 		CSIPPrflDeregisterRequestedState(MSIPProfileFSMUser& aUser);
       
   106 
       
   107 	private: // Data
       
   108 
       
   109 		CSIPPrflStateBase* iInitState;
       
   110 		CSIPPrflStateBase* iRegisteredState;
       
   111 		CSIPPrflStateBase* iDeregistrationInProgressState;
       
   112 	};
       
   113 
       
   114 #endif // CSIPPRFLDEREGISTERREQUESTEDSTATE_H