realtimenetprots/sipfw/ProfileAgent/Server/Inc/sipalrhandler.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          : sipalrhandler.h
       
    16 * Part of       : SIP / SIP Profile Server
       
    17 * Version       : SIP/6.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 #ifndef CSIPALRHANDLER_H
       
    24 #define CSIPALRHANDLER_H
       
    25 
       
    26 /**
       
    27 *@internalComponent
       
    28 */
       
    29 
       
    30 //  INCLUDES
       
    31 #include <e32base.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CSIPProfileCacheItem;
       
    35 class MSIPExtendedConcreteProfileObserver;
       
    36 class MSipProfileErrorHandler;
       
    37 class CSipAlrMonitor;
       
    38 class CSipSystemStateMonitor;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42 * The default implementation for SIP ALR Monitor.
       
    43 *
       
    44 * @lib sipsrofilesrv.exe
       
    45 */
       
    46 class CSipAlrHandler : public CBase
       
    47     {
       
    48 	public: // Constructors and destructor
       
    49 
       
    50     	static CSipAlrHandler* NewL(
       
    51     	    MSipProfileErrorHandler& aErrorHandler,
       
    52     	    CSipSystemStateMonitor* aSystemStateMonitor);
       
    53 
       
    54     	~CSipAlrHandler();
       
    55     		
       
    56     public: // New functions
       
    57 
       
    58         void EnableProfileL( 
       
    59             CSIPProfileCacheItem& aProfile,
       
    60             const MSIPExtendedConcreteProfileObserver& aObserver);
       
    61 
       
    62         void DisableProfileL( 
       
    63             CSIPProfileCacheItem& aProfile,
       
    64             const MSIPExtendedConcreteProfileObserver& aObserver);
       
    65 
       
    66         void AllowMigrationL(
       
    67             CSIPProfileCacheItem& aProfile,
       
    68             TUint32 aIapId,
       
    69             const MSIPExtendedConcreteProfileObserver& aObserver);
       
    70 
       
    71         void DisallowMigrationL(
       
    72             CSIPProfileCacheItem& aProfile,
       
    73             TUint32 aIapId,
       
    74             const MSIPExtendedConcreteProfileObserver& aObserver);
       
    75 
       
    76         void RefreshIapAvailabilityL(
       
    77             CSIPProfileCacheItem& aProfile);
       
    78 
       
    79 		/**
       
    80         * Loads the plug-in if not yet loaded
       
    81 		* @return ALR monitor plug-in, ownership is not transferred.
       
    82         */
       
    83         CSipAlrMonitor& AlrMonitorL();
       
    84 
       
    85 	private: // Constructors
       
    86 	
       
    87 	    CSipAlrHandler(
       
    88 	        MSipProfileErrorHandler& aErrorHandler,
       
    89 	        CSipSystemStateMonitor* aSystemStateMonitor);
       
    90 
       
    91     private: // New functions
       
    92 
       
    93 		/**
       
    94         * Handles possible errors during disable or enable
       
    95 		* @param aItem profile item to be handled
       
    96 		* @param aErr error code to be handled
       
    97 		* @param aOwnError internal error code
       
    98         */
       
    99 		void HandleErrorL(CSIPProfileCacheItem& aItem,
       
   100 						  TInt aErr,
       
   101 						  TInt aOwnError);
       
   102 
       
   103     private: // Data
       
   104 
       
   105         // ALR monitor plug-in, owned.
       
   106         CSipAlrMonitor* iAlrMonitor;
       
   107         MSipProfileErrorHandler& iErrorHandler;
       
   108         CSipSystemStateMonitor* iSystemStateMonitor; // Not owned
       
   109        
       
   110     private: // For testing purposes		
       
   111 #ifdef CPPUNIT_TEST 
       
   112         friend class CSipAlrHandlerTest;
       
   113         friend class CSIPProfileStateRegInProgTest;
       
   114         friend class CSIPProfileStateWaitForPermissionTest;
       
   115         friend class CSIPProfileStateMigratingToNewIAPTest;
       
   116 #endif
       
   117     };
       
   118 
       
   119 #endif // CSIPALRHANDLER_H