realtimenetprots/sipfw/ProfileAgent/Server/Src/sipprofilestatewaitforpermission.h
changeset 0 307788aac0a8
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        : sipprofilestatewaitforpermission.h
       
    16 * Part of     : Sip Profile Server
       
    17 * Interface   : private
       
    18 * Class provides functionality for registration state automation
       
    19 * Version     : 1.0
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27  @internalComponent
       
    28 */
       
    29 
       
    30 #ifndef CSIPPROFILERESTATEWAITFORPERMISSION_H
       
    31 #define CSIPPROFILERESTATEWAITFORPERMISSION_H
       
    32 
       
    33 //  INCLUDES
       
    34 #include "sip.h"
       
    35 #include "SipProfileState.h"
       
    36 #include "sipconcreteprofile.h"
       
    37 #include <e32base.h>
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 *  Class provides functionality for profile state automation
       
    45 *  "Wait for IAP migration permission" state.
       
    46 *  @lib 
       
    47 */
       
    48 class CSIPProfileStateWaitForPermission: public CSIPProfileState
       
    49 	{
       
    50    	public:  // Constructors and destructor
       
    51 
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         static CSIPProfileStateWaitForPermission*
       
    56         	NewL(CSIPPluginDirector& aDirector);
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CSIPProfileStateWaitForPermission();
       
    62 
       
    63 	public: // From CSIPProfileState
       
    64 
       
    65 		CSIPConcreteProfile::TStatus Name() const;
       
    66 
       
    67 		void EnableL(CSIPProfileCacheItem& aItem,
       
    68 					 const MSIPExtendedConcreteProfileObserver& aObserver);
       
    69 
       
    70 		void EnableSnapInUseL(CSIPProfileCacheItem& aItem,
       
    71 			const MSIPExtendedConcreteProfileObserver& aObserver,
       
    72 			TUint32 aSnapId);
       
    73 
       
    74 		void DisableL(CSIPProfileCacheItem& aItem,
       
    75 					  const MSIPExtendedConcreteProfileObserver& aObserver);
       
    76 
       
    77 		void RegistrationStatusEventL(
       
    78 			CSIPProfileCacheItem& aItem,
       
    79 			CSIPConcreteProfile::TStatus aStatus);
       
    80 
       
    81 		TBool ErrorOccurred(CSIPProfileCacheItem& aItem, TInt aError);
       
    82 
       
    83 		void IapAvailableL(CSIPProfileCacheItem& aItem,
       
    84 					       TUint32 aSnapId,
       
    85 						   TUint32 aNewIapId);
       
    86 
       
    87 		void ClientAllowsMigrationL(CSIPProfileCacheItem& aItem,
       
    88 			TUint32 aIapId,
       
    89 			const MSIPExtendedConcreteProfileObserver& aObserver);
       
    90 
       
    91 		void ClientDisallowsMigrationL(CSIPProfileCacheItem& aItem,
       
    92 			TUint32 aIapId,
       
    93 			const MSIPExtendedConcreteProfileObserver& aObserver);
       
    94 
       
    95 		void MigrationIsAllowedL(CSIPProfileCacheItem& aItem, TUint32 aIapId);
       
    96 
       
    97 		void MigrationIsDisallowedL(CSIPProfileCacheItem& aItem,
       
    98 									TUint32 aIapId);
       
    99 
       
   100 		TBool IsAlrState() const;
       
   101 
       
   102 		void ShutdownInitiated(CSIPProfileCacheItem& aItem);
       
   103 
       
   104     public: // New functions
       
   105 	
       
   106         /**
       
   107         * Sets next automaton states, ownership is not transferred
       
   108         * @param aWaitForIAP Wait for IAP state
       
   109         * @param aMigratingToNewIAP Migrating to new IAP state
       
   110         * @param aRegInProg Registration in progress state
       
   111         * @param aRegistered Registered state
       
   112         * @param aUnregInProg Unregistration in progress state
       
   113         * @param aUnregistered Unregistered state
       
   114         */
       
   115 		void SetNeighbourStates(CSIPProfileState& aWaitForIAP,
       
   116 								CSIPProfileState& aMigratingToNewIAP,
       
   117 								CSIPProfileState& aRegInProg,
       
   118 							    CSIPProfileState& aRegistered,
       
   119 							    CSIPProfileState& aUnregInProg,
       
   120 							    CSIPProfileState& aUnregistered); 		
       
   121 
       
   122    private:
       
   123 
       
   124         /**
       
   125         * Constructor
       
   126         */
       
   127         CSIPProfileStateWaitForPermission(CSIPPluginDirector& aDirector);		
       
   128 
       
   129 		void SetClientPermissionL(CSIPProfileCacheItem& aItem,
       
   130 			TUint32 aIapId,
       
   131 			const MSIPExtendedConcreteProfileObserver& aObserver,
       
   132 			TBool aAllowMigration) const;
       
   133 
       
   134 	private: // Data
       
   135 
       
   136 		// Neighbour states, not owned
       
   137 		CSIPProfileState* iWaitForIAP;
       
   138 		CSIPProfileState* iMigratingToNewIAP;
       
   139 		CSIPProfileState* iRegInProg;
       
   140 		CSIPProfileState* iRegistered;
       
   141 		CSIPProfileState* iUnregInProg;
       
   142 		CSIPProfileState* iUnregistered;
       
   143 		
       
   144 	private: // For testing purposes
       
   145 #ifdef CPPUNIT_TEST
       
   146 		friend class CSIPProfileStateWaitForPermissionTest;
       
   147 #endif
       
   148 	};
       
   149 
       
   150 #endif // CSIPPROFILERESTATEWAITFORPERMISSION_H