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