epoc32/include/mw/sipprofilealrcontroller.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/sipprofilealrcontroller.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,132 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* Name          : sipprofilealrcontroller.h
    1.19 +* Part of       : SIP / SIP Profile Agent
    1.20 +* Version       : SIP/6.0 
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +
    1.26 +#ifndef CSIPPROFILEALRCONTROLLER_H
    1.27 +#define CSIPPROFILEALRCONTROLLER_H
    1.28 +
    1.29 +// INCLUDES
    1.30 +#include <e32base.h>
    1.31 +
    1.32 +// FORWARD DECLARATIONS
    1.33 +class CSIPProfileRegistryBase;
    1.34 +class MSipProfileAlrObserver;
    1.35 +
    1.36 +// CLASS DECLARATION
    1.37 +/**
    1.38 +*  @publishedAll
    1.39 +*  @released
    1.40 +*
    1.41 +*  This class provides functions to control 
    1.42 +*  ALR (Application Level Roaming) for SIP profiles that have 
    1.43 +*  a SNAP (Service Network Access Point) ID configured. 
    1.44 +*  By default the clients allow automatic roaming between 
    1.45 +*  IAPs (Internet Access Point) for a SIP profile. 
    1.46 +*  The clients wanting to control the roaming must instantiate this class.
    1.47 +*  After that all the IAP availability events received through 
    1.48 +*  MSipProfileAlrObserver::AlrEvent must be allowed or disallowed.
    1.49 +*
    1.50 +*  @lib sipprofilecli.lib
    1.51 +*/
    1.52 +class CSipProfileAlrController : public CBase
    1.53 +    {
    1.54 +    public: // Constructors and destructor
    1.55 +    
    1.56 +        /**
    1.57 +        * Two-phased constructor.
    1.58 +        * @param aRegistry a SIP profile registry instance.
    1.59 +        * @param aObserver a observer for IAP migration events.
    1.60 +        */
    1.61 +        IMPORT_C static CSipProfileAlrController* NewL(
    1.62 +            CSIPProfileRegistryBase& aRegistry,
    1.63 +            MSipProfileAlrObserver& aObserver );
    1.64 +
    1.65 +        /**
    1.66 +        * Two-phased constructor.
    1.67 +        * Constructs an object and adds the pointer to the cleanup stack.
    1.68 +        * @param aRegistry a SIP profile registry instance.
    1.69 +        * @param aObserver a observer for IAP migration events.
    1.70 +        */
    1.71 +        IMPORT_C static CSipProfileAlrController* NewLC(
    1.72 +            CSIPProfileRegistryBase& aRegistry,
    1.73 +            MSipProfileAlrObserver& aObserver );   
    1.74 +    
    1.75 +        /**
    1.76 +        * Destructor.
    1.77 +        */
    1.78 +        ~CSipProfileAlrController();
    1.79 +
    1.80 +    public: // New functions
    1.81 +
    1.82 +        /**
    1.83 +        * Allows SIP Profile Agent to start the migration 
    1.84 +        * to a new IAP for the profile.
    1.85 +        * If also all the other clients allow the migration,
    1.86 +        * migration will be started and all the clients are informed
    1.87 +        * with MSipProfileAlrObserver::AlrEvent(EMigrationStarted,...).
    1.88 +        * When MSipProfileAlrObserver::AlrEvent(EMigrationCompleted,...)
    1.89 +        * gets called the migration has been completed and
    1.90 +        * the related SIP profile has been registered via the new IAP. 
    1.91 +        * @param aProfileId the SIP profile id
    1.92 +        * @param aIapId the new IAP id. 
    1.93 +        */
    1.94 +        IMPORT_C void AllowMigrationL( TUint32 aProfileId,
    1.95 +                                       TUint32 aIapId );
    1.96 +
    1.97 +        /**
    1.98 +        * Disallows SIP Profile Agent to migrate 
    1.99 +        * to a new IAP for the profile.
   1.100 +        * After the client calls this function all the clients are informed
   1.101 +        * with MSipProfileAlrObserver::AlrError(...).
   1.102 +        * @param aProfileId the SIP profile id
   1.103 +        * @param aIapId the new IAP id. 
   1.104 +        */
   1.105 +        IMPORT_C void DisallowMigrationL( TUint32 aProfileId,
   1.106 +                                          TUint32 aIapId );
   1.107 +                                          
   1.108 +        /**
   1.109 +        * Refreshes the list of available IAPs for 
   1.110 +        * the SNAP configured for the profile.
   1.111 +        * If a new better IAP is available, it is offered via
   1.112 +        * MSipProfileAlrObserver::AlrEvent(EIapAvailable,...).
   1.113 +        * This function should be called if migration 
   1.114 +        * to a IAP has been previously disallowed and the client wants to 
   1.115 +        * check whether the better IAP is still available.
   1.116 +        * @param aProfileId the SIP profile id 
   1.117 +        */
   1.118 +        IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId ); 
   1.119 +
   1.120 +
   1.121 +    private: // Constructors:
   1.122 +
   1.123 +        CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry );        
   1.124 +        void ConstructL( MSipProfileAlrObserver& aObserver );
   1.125 +        
   1.126 +    private: // Data
   1.127 +    
   1.128 +    	CSIPProfileRegistryBase& iRegistry;
   1.129 +    
   1.130 +    private: // For testing purposes	
   1.131 +
   1.132 +	    friend class CSIPProfileAlrControllerTest;        
   1.133 +    };
   1.134 +
   1.135 +#endif // CSIPPROFILEALRCONTROLLER_H