2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipprofilealrcontroller.h
16 * Part of : SIP / SIP Profile Agent
23 #ifndef CSIPPROFILEALRCONTROLLER_H
24 #define CSIPPROFILEALRCONTROLLER_H
29 // FORWARD DECLARATIONS
30 class CSIPProfileRegistryBase;
31 class MSipProfileAlrObserver;
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.
47 * @lib sipprofilecli.lib
49 class CSipProfileAlrController : public CBase
51 public: // Constructors and destructor
54 * Two-phased constructor.
55 * @param aRegistry a SIP profile registry instance.
56 * @param aObserver a observer for IAP migration events.
58 IMPORT_C static CSipProfileAlrController* NewL(
59 CSIPProfileRegistryBase& aRegistry,
60 MSipProfileAlrObserver& aObserver );
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.
68 IMPORT_C static CSipProfileAlrController* NewLC(
69 CSIPProfileRegistryBase& aRegistry,
70 MSipProfileAlrObserver& aObserver );
75 ~CSipProfileAlrController();
77 public: // New functions
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.
91 IMPORT_C void AllowMigrationL( TUint32 aProfileId,
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.
102 IMPORT_C void DisallowMigrationL( TUint32 aProfileId,
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
115 IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId );
118 private: // Constructors:
120 CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry );
121 void ConstructL( MSipProfileAlrObserver& aObserver );
125 CSIPProfileRegistryBase& iRegistry;
127 private: // For testing purposes
129 friend class CSIPProfileAlrControllerTest;
133 #endif // CSIPPROFILEALRCONTROLLER_H