epoc32/include/mw/sipprofilealrcontroller.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
2:2fe1408b6811 3:e1b950c65cb4
       
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : sipprofilealrcontroller.h
       
    16 * Part of       : SIP / SIP Profile Agent
       
    17 * Version       : SIP/6.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 #ifndef CSIPPROFILEALRCONTROLLER_H
       
    24 #define CSIPPROFILEALRCONTROLLER_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CSIPProfileRegistryBase;
       
    31 class MSipProfileAlrObserver;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 *  @publishedAll
       
    36 *  @released
       
    37 *
       
    38 *  This class provides functions to control 
       
    39 *  ALR (Application Level Roaming) for SIP profiles that have 
       
    40 *  a SNAP (Service Network Access Point) ID configured. 
       
    41 *  By default the clients allow automatic roaming between 
       
    42 *  IAPs (Internet Access Point) for a SIP profile. 
       
    43 *  The clients wanting to control the roaming must instantiate this class.
       
    44 *  After that all the IAP availability events received through 
       
    45 *  MSipProfileAlrObserver::AlrEvent must be allowed or disallowed.
       
    46 *
       
    47 *  @lib sipprofilecli.lib
       
    48 */
       
    49 class CSipProfileAlrController : public CBase
       
    50     {
       
    51     public: // Constructors and destructor
       
    52     
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         * @param aRegistry a SIP profile registry instance.
       
    56         * @param aObserver a observer for IAP migration events.
       
    57         */
       
    58         IMPORT_C static CSipProfileAlrController* NewL(
       
    59             CSIPProfileRegistryBase& aRegistry,
       
    60             MSipProfileAlrObserver& aObserver );
       
    61 
       
    62         /**
       
    63         * Two-phased constructor.
       
    64         * Constructs an object and adds the pointer to the cleanup stack.
       
    65         * @param aRegistry a SIP profile registry instance.
       
    66         * @param aObserver a observer for IAP migration events.
       
    67         */
       
    68         IMPORT_C static CSipProfileAlrController* NewLC(
       
    69             CSIPProfileRegistryBase& aRegistry,
       
    70             MSipProfileAlrObserver& aObserver );   
       
    71     
       
    72         /**
       
    73         * Destructor.
       
    74         */
       
    75         ~CSipProfileAlrController();
       
    76 
       
    77     public: // New functions
       
    78 
       
    79         /**
       
    80         * Allows SIP Profile Agent to start the migration 
       
    81         * to a new IAP for the profile.
       
    82         * If also all the other clients allow the migration,
       
    83         * migration will be started and all the clients are informed
       
    84         * with MSipProfileAlrObserver::AlrEvent(EMigrationStarted,...).
       
    85         * When MSipProfileAlrObserver::AlrEvent(EMigrationCompleted,...)
       
    86         * gets called the migration has been completed and
       
    87         * the related SIP profile has been registered via the new IAP. 
       
    88         * @param aProfileId the SIP profile id
       
    89         * @param aIapId the new IAP id. 
       
    90         */
       
    91         IMPORT_C void AllowMigrationL( TUint32 aProfileId,
       
    92                                        TUint32 aIapId );
       
    93 
       
    94         /**
       
    95         * Disallows SIP Profile Agent to migrate 
       
    96         * to a new IAP for the profile.
       
    97         * After the client calls this function all the clients are informed
       
    98         * with MSipProfileAlrObserver::AlrError(...).
       
    99         * @param aProfileId the SIP profile id
       
   100         * @param aIapId the new IAP id. 
       
   101         */
       
   102         IMPORT_C void DisallowMigrationL( TUint32 aProfileId,
       
   103                                           TUint32 aIapId );
       
   104                                           
       
   105         /**
       
   106         * Refreshes the list of available IAPs for 
       
   107         * the SNAP configured for the profile.
       
   108         * If a new better IAP is available, it is offered via
       
   109         * MSipProfileAlrObserver::AlrEvent(EIapAvailable,...).
       
   110         * This function should be called if migration 
       
   111         * to a IAP has been previously disallowed and the client wants to 
       
   112         * check whether the better IAP is still available.
       
   113         * @param aProfileId the SIP profile id 
       
   114         */
       
   115         IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId ); 
       
   116 
       
   117 
       
   118     private: // Constructors:
       
   119 
       
   120         CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry );        
       
   121         void ConstructL( MSipProfileAlrObserver& aObserver );
       
   122         
       
   123     private: // Data
       
   124     
       
   125     	CSIPProfileRegistryBase& iRegistry;
       
   126     
       
   127     private: // For testing purposes	
       
   128 
       
   129 	    friend class CSIPProfileAlrControllerTest;        
       
   130     };
       
   131 
       
   132 #endif // CSIPPROFILEALRCONTROLLER_H