realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflinitstate.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 14:01:23 +0300
changeset 27 740ceea8e153
parent 0 307788aac0a8
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
* Name        : sipprflinitstate.h
* Part of     : sip profile fsm
* Version     : %version: 2.1.1 %
*
*/




/**
 @internalComponent
*/

#ifndef CSIPPRFLINITSTATE_H
#define CSIPPRFLINITSTATE_H

//  INCLUDES
#include "sipprflstatebase.h"

// CLASS DECLARATION
/**
* Reacts to events that are possible in 
* "Init" state. Profile is in this state 
* before it is going to be registered.
*/
class CSIPPrflInitState: public CSIPPrflStateBase
	{
	public:// Constructors and destructor
        /**
        * Two-phased constructor.
        * @param aUser user for the state machine
        */
		IMPORT_C static CSIPPrflInitState* NewL(MSIPProfileFSMUser& aUser);

		/**
		* Destructor
		*/
		IMPORT_C ~CSIPPrflInitState();

	public://new functions
		/**
		* Links the states
		* @param aResolvingProxiesState "Resolving Proxies" state
		* @param aRegisterRequestedState "Register Requested" state
		* @param aRegistrationInProgressState "Registration In Progress" state
		*/
		IMPORT_C void LinkStates(
		    CSIPPrflStateBase& aResolvingProxiesState,
			CSIPPrflStateBase& aRegisterRequestedState,
			CSIPPrflStateBase& aRegistrationInProgressState);

	public://functions from base class
	
        CSIPConcreteProfile::TStatus ConcreteProfileState() const;
	
		/**
		* Registers the profile. 
		* Moves profile to "Resolving Proxies" state 
		* if dynamic proxy discovery has been enabled for the profile.
		* Otherwise moves profile toŽ"Register Requested" state in case 
		* of suspended or inactive or init connection or to 
		* "Registration In Progress" state in case of active connection.
		* according to the connection state.
		* @param aContext a profile context
		*/
		void RegisterL(
			MSIPProfileContext& aContext);
			
		/**
		* Checks if the profile  is in idle state.
		* @return ETrue if conditions are met.
		*/
		TBool IsIdle( MSIPProfileContext& aContext );	

	private:
	    /**
		* Constructor.
		*/
		CSIPPrflInitState(MSIPProfileFSMUser& aUser);

	private: // Data
	
	    CSIPPrflStateBase* iResolvingProxies;
		CSIPPrflStateBase* iRegisterRequested;
		CSIPPrflStateBase* iRegistrationInProgress;
	};

#endif // CSIPPRFLINITSTATE_H