realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnmanager.h
branchRCL_3
changeset 9 1e1cc61f56c3
child 16 43c4dec3cb1f
equal deleted inserted replaced
4:dd3853b8dc3f 9:1e1cc61f56c3
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : sipapnmanager.h
       
    15 // Part of     : SIP Profile Server
       
    16 // implementation
       
    17 // Version     : 1.0
       
    18 //
       
    19 
       
    20 
       
    21 #ifndef CSIPAPNMANAGER_H
       
    22 #define CSIPAPNMANAGER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CSIPApnConfigurationHandler;
       
    29 
       
    30 // OBSERVER
       
    31 class MSIPApnChangeObserver
       
    32     {
       
    33 public:
       
    34     /**
       
    35     * Called when apn change completed successfully or failed so fatally
       
    36     * that there's no change expected any further on that IAPId.
       
    37     */
       
    38     virtual void ApnChanged( const TDesC8& aApn, TUint32 aIapId, TInt aError ) = 0;
       
    39     };
       
    40 
       
    41 // CLASS DEFINITION
       
    42 /**
       
    43  * 
       
    44  */
       
    45 class CSIPApnManager : public CBase
       
    46 	{
       
    47 	public: // Constructors and destructor
       
    48 
       
    49 		static CSIPApnManager* NewL( MSIPApnChangeObserver& aObserver );
       
    50 
       
    51 		~CSIPApnManager();
       
    52 
       
    53     public: // New methods
       
    54 
       
    55         // Update the cached primary or secondary APN
       
    56         void UpdateApnL( TUint32 aIapId, TBool aIsPrimaryApn, const TDesC8& aApn );
       
    57         
       
    58         TBool IsFailed( TUint32 aIapId );
       
    59         void SetFailed( TUint32 aIapId ,TBool aIsFailed, TBool aIsFatalFailure );
       
    60 
       
    61         TBool IsPrimaryApnInUse( TUint32 aIapId );
       
    62         
       
    63 		void WriteApnL( TUint32 aIapId, TBool aIsPrimaryApn, const TDesC8* aApn );
       
    64 		
       
    65 		TBool HasPendingTasks() const;
       
    66 		
       
    67 		/*
       
    68 		 * Checks whether the IAPId is ModemBearer
       
    69 		 */
       
    70 		TBool IsIapGPRSL( TUint32 aIapId );
       
    71 
       
    72 	private: // Constructors
       
    73 
       
    74 		CSIPApnManager( MSIPApnChangeObserver& aObserver );		
       
    75     
       
    76         void ConstructL();
       
    77     
       
    78     private:
       
    79         
       
    80         CSIPApnConfigurationHandler* FindIapIdHandler( TUint32 aIapId );
       
    81  
       
    82         void SetApnL( const TDesC8& aApn, 
       
    83                       TBool aUseSecureAuthentication, 
       
    84                       TBool aAllowAsync,
       
    85                       TUint32 aIapId);
       
    86         
       
    87         void CreateHandlerL( TUint32 aIapId );
       
    88 
       
    89     private: // Data
       
    90 	
       
    91 	    MSIPApnChangeObserver&                     iObserver;
       
    92 	    RPointerArray<CSIPApnConfigurationHandler> iHandlers;
       
    93 	    TBool                                      iInitialApnChangeFailed;
       
    94 	    
       
    95 #ifdef CPPUNIT_TEST	
       
    96 	    friend class CSIPApnManagerTest;
       
    97 #endif
       
    98 
       
    99 	};
       
   100 
       
   101 #endif // CSIPAPNMANAGER_H