williamr@2: /* williamr@2: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Name : sipprofilealrcontroller.h williamr@2: * Part of : SIP / SIP Profile Agent williamr@2: * Version : SIP/6.0 williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSIPPROFILEALRCONTROLLER_H williamr@2: #define CSIPPROFILEALRCONTROLLER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSIPProfileRegistryBase; williamr@2: class MSipProfileAlrObserver; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * @publishedAll williamr@2: * @released williamr@2: * williamr@2: * This class provides functions to control williamr@2: * ALR (Application Level Roaming) for SIP profiles that have williamr@2: * a SNAP (Service Network Access Point) ID configured. williamr@2: * By default the clients allow automatic roaming between williamr@2: * IAPs (Internet Access Point) for a SIP profile. williamr@2: * The clients wanting to control the roaming must instantiate this class. williamr@2: * After that all the IAP availability events received through williamr@2: * MSipProfileAlrObserver::AlrEvent must be allowed or disallowed. williamr@2: * williamr@2: * @lib sipprofilecli.lib williamr@2: */ williamr@2: class CSipProfileAlrController : public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * @param aRegistry a SIP profile registry instance. williamr@2: * @param aObserver a observer for IAP migration events. williamr@2: */ williamr@2: IMPORT_C static CSipProfileAlrController* NewL( williamr@2: CSIPProfileRegistryBase& aRegistry, williamr@2: MSipProfileAlrObserver& aObserver ); williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * Constructs an object and adds the pointer to the cleanup stack. williamr@2: * @param aRegistry a SIP profile registry instance. williamr@2: * @param aObserver a observer for IAP migration events. williamr@2: */ williamr@2: IMPORT_C static CSipProfileAlrController* NewLC( williamr@2: CSIPProfileRegistryBase& aRegistry, williamr@2: MSipProfileAlrObserver& aObserver ); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: ~CSipProfileAlrController(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Allows SIP Profile Agent to start the migration williamr@2: * to a new IAP for the profile. williamr@2: * If also all the other clients allow the migration, williamr@2: * migration will be started and all the clients are informed williamr@2: * with MSipProfileAlrObserver::AlrEvent(EMigrationStarted,...). williamr@2: * When MSipProfileAlrObserver::AlrEvent(EMigrationCompleted,...) williamr@2: * gets called the migration has been completed and williamr@2: * the related SIP profile has been registered via the new IAP. williamr@2: * @param aProfileId the SIP profile id williamr@2: * @param aIapId the new IAP id. williamr@2: */ williamr@2: IMPORT_C void AllowMigrationL( TUint32 aProfileId, williamr@2: TUint32 aIapId ); williamr@2: williamr@2: /** williamr@2: * Disallows SIP Profile Agent to migrate williamr@2: * to a new IAP for the profile. williamr@2: * After the client calls this function all the clients are informed williamr@2: * with MSipProfileAlrObserver::AlrError(...). williamr@2: * @param aProfileId the SIP profile id williamr@2: * @param aIapId the new IAP id. williamr@2: */ williamr@2: IMPORT_C void DisallowMigrationL( TUint32 aProfileId, williamr@2: TUint32 aIapId ); williamr@2: williamr@2: /** williamr@2: * Refreshes the list of available IAPs for williamr@2: * the SNAP configured for the profile. williamr@2: * If a new better IAP is available, it is offered via williamr@2: * MSipProfileAlrObserver::AlrEvent(EIapAvailable,...). williamr@2: * This function should be called if migration williamr@2: * to a IAP has been previously disallowed and the client wants to williamr@2: * check whether the better IAP is still available. williamr@2: * @param aProfileId the SIP profile id williamr@2: */ williamr@2: IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId ); williamr@2: williamr@2: williamr@2: private: // Constructors: williamr@2: williamr@2: CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry ); williamr@2: void ConstructL( MSipProfileAlrObserver& aObserver ); williamr@2: williamr@2: private: // Data williamr@2: williamr@2: CSIPProfileRegistryBase& iRegistry; williamr@2: williamr@2: private: // For testing purposes williamr@4: #ifdef CPPUNIT_TEST williamr@2: friend class CSIPProfileAlrControllerTest; williamr@4: #endif williamr@2: }; williamr@2: williamr@2: #endif // CSIPPROFILEALRCONTROLLER_H