|
1 /* |
|
2 * Copyright (c) 2002-2005 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: CPsetSAObserver handles all the queries to observer. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef PSETSAOBSERVER_H |
|
21 #define PSETSAOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32Property.h> |
|
26 #include <psetcalldiverting.h> |
|
27 #include <psvariables.h> |
|
28 #include <ctsydomaincrkeys.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MPsetNetworkInfoObserver; |
|
32 class MPsetDivertObserver; |
|
33 class CPSetSubscriberIdCheck; |
|
34 |
|
35 // CONSTANTS |
|
36 const TInt KCodeUnspecified(-1); |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Class is used to create params for NotifyDivertChange method. |
|
42 * |
|
43 * @lib phonesettings.dll |
|
44 * @since 3.2 |
|
45 */ |
|
46 class TCallDivertNotifySetting |
|
47 { |
|
48 public: // new |
|
49 |
|
50 void Initialize() |
|
51 { |
|
52 iPreviousCfStatus = KCFIndicatorUnknown; |
|
53 iCfActivated = EFalse; |
|
54 iVmbxDivert = EFalse; |
|
55 iBasicServiceCode = KCodeUnspecified; |
|
56 } |
|
57 |
|
58 public: //member data |
|
59 |
|
60 // Current status of divert. Note: GetCurrentDivertStatus returns |
|
61 // current status. |
|
62 TUnconditionalCFStatus iPreviousCfStatus; |
|
63 |
|
64 // ETrue if activating divert and EFalse if deactivating. |
|
65 TBool iCfActivated; |
|
66 |
|
67 // True if voice mailbox divert, otherwise false. |
|
68 TBool iVmbxDivert; |
|
69 |
|
70 // BasicServiceCode related to divert operation, see nwDefs.h |
|
71 // for more information. |
|
72 TInt iBasicServiceCode; |
|
73 }; |
|
74 |
|
75 /** |
|
76 * Class is used to exchange information to/from observer. |
|
77 * |
|
78 * @lib phonesettings.dll |
|
79 * @since 1.0 |
|
80 */ |
|
81 class CPsetSAObserver : public CActive |
|
82 { |
|
83 public: // constructor & destructor |
|
84 |
|
85 /** |
|
86 * First phase constructor. |
|
87 * |
|
88 * @return Returns the CPsetSAObserver-object |
|
89 */ |
|
90 IMPORT_C static CPsetSAObserver* NewL(); |
|
91 |
|
92 /* Destructor */ |
|
93 IMPORT_C ~CPsetSAObserver(); |
|
94 |
|
95 public: |
|
96 |
|
97 //Current call status. |
|
98 enum TPSetCallStatus |
|
99 { |
|
100 EPSetNoCallsActive = 0, |
|
101 EPSetCallActive |
|
102 }; |
|
103 |
|
104 /** |
|
105 * Queries if there is an active call. |
|
106 * |
|
107 * @return call status (active or not) |
|
108 */ |
|
109 IMPORT_C TInt IsCallActive(); |
|
110 |
|
111 |
|
112 //GPRS connection status. |
|
113 enum TPSetGPRSConnectionStatus |
|
114 { |
|
115 EPSetGPRSNotConnected = 0, |
|
116 EPSetGPRSConnectionActive |
|
117 }; |
|
118 |
|
119 /** |
|
120 * Queries if there is an active gprs connection. |
|
121 * |
|
122 * @return gprs connection status (active or not) |
|
123 */ |
|
124 IMPORT_C TInt IsGPRSConnected(); |
|
125 |
|
126 /** |
|
127 * Sets Network observer object. |
|
128 * |
|
129 * @param aObserver Reference to network observer. |
|
130 */ |
|
131 IMPORT_C void SetNetObserver( MPsetNetworkInfoObserver& aObserver ); |
|
132 |
|
133 /** |
|
134 * Notifies of Divert changes. If the activator is not sure of the |
|
135 * settings, CPsetSAObserver tries to deduce correct state. |
|
136 * |
|
137 * @param aAlsStatus Currently used line. |
|
138 * @param aDivertNotify set of divert params, see TCallDivertNotifySetting above. |
|
139 * @param aActivatorUncertain Call divert requester does not know for certain |
|
140 * all the values. |
|
141 */ |
|
142 IMPORT_C void NotifyDivertChange( TSelectedLine aAlsStatus, |
|
143 TCallDivertNotifySetting& aDivertNotify, const TInt& aActivatorUncertain ); |
|
144 |
|
145 /** |
|
146 * Returns whether there are active diverts and on what line. |
|
147 * |
|
148 * @param aStatus TCallForwardingStatus info. |
|
149 * @return KErrNone if successful else system wide error code if |
|
150 * get fails. |
|
151 */ |
|
152 IMPORT_C TInt GetCurrentDivertStatus( TUnconditionalCFStatus& aStatus ); |
|
153 |
|
154 private: // from CActive |
|
155 |
|
156 void RunL(); |
|
157 |
|
158 void DoCancel(); |
|
159 |
|
160 private: //new |
|
161 |
|
162 /** |
|
163 * Handles divert indicator cases when ALS if OFF. |
|
164 */ |
|
165 void HandleNoAlsIndicators( TCallDivertNotifySetting& aDivertNotify, |
|
166 const TInt& aActivatorUncertain ); |
|
167 |
|
168 /** |
|
169 * Handles divert indicator cases when ALS on and |
|
170 * ALS line 1 active. |
|
171 */ |
|
172 void HandlePrimaryLineIndicators( TCallDivertNotifySetting& aDivertNotify ); |
|
173 |
|
174 /** |
|
175 * Handles divert indicator cases when ALS on and |
|
176 * ALS line 2 active. |
|
177 */ |
|
178 void HandleSecondaryLineIndicators( TCallDivertNotifySetting& aDivertNotify ); |
|
179 |
|
180 /** |
|
181 * Set correct indicator value when divert activated |
|
182 * to voicemail (no ALS). |
|
183 */ |
|
184 void HandleVoiceMailBoxDivertActivation( |
|
185 TUnconditionalCFStatus& aStatus, |
|
186 const TInt aBsc ); |
|
187 |
|
188 /** |
|
189 * Set correct indicator value when diverted to some |
|
190 * other number than voicemail (no ALS). |
|
191 */ |
|
192 void HandleDivertActivation( |
|
193 TUnconditionalCFStatus& aStatus, |
|
194 const TInt aBsc ); |
|
195 |
|
196 /** |
|
197 * Set correct indicator value when deactivation |
|
198 * done (no ALS). |
|
199 */ |
|
200 void HandleDivertDeactivation( |
|
201 TUnconditionalCFStatus& aStatus, |
|
202 const TInt aBsc ); |
|
203 |
|
204 /** |
|
205 * Set correct indicator value when Primary line |
|
206 * activation done. |
|
207 */ |
|
208 void HandlePrimaryLineDivertActivation( |
|
209 TUnconditionalCFStatus& aStatus, |
|
210 const TInt aBsc ); |
|
211 |
|
212 /** |
|
213 * Set correct indicator value when Primary line |
|
214 * deactivation done. |
|
215 */ |
|
216 void HandlePrimaryLineDivertDeactivation( |
|
217 TUnconditionalCFStatus& aStatus, |
|
218 const TInt aBsc ); |
|
219 |
|
220 /** |
|
221 * Set correct indicator value when Secondary line |
|
222 * activation done. |
|
223 */ |
|
224 void HandleSecondaryLineDivertActivation( |
|
225 TUnconditionalCFStatus& aStatus, |
|
226 const TInt aBsc ); |
|
227 |
|
228 /** |
|
229 * Set correct indicator value when Secondary line |
|
230 * deactivation done. |
|
231 */ |
|
232 void HandleSecondaryLineDivertDeactivation( |
|
233 TUnconditionalCFStatus& aStatus, |
|
234 const TInt aBsc ); |
|
235 |
|
236 /** |
|
237 * Set correct indicator value when Primary line |
|
238 * activation done. |
|
239 */ |
|
240 void HandlePrimaryLineDualDivertActivation( |
|
241 TUnconditionalCFStatus& aStatus, |
|
242 const TInt aBsc ); |
|
243 |
|
244 /** |
|
245 * Set correct indicator value when Primary line |
|
246 * deactivation done. |
|
247 */ |
|
248 void HandlePrimaryLineDualDivertDeactivation( |
|
249 TUnconditionalCFStatus& aStatus, |
|
250 const TInt aBsc ); |
|
251 |
|
252 /** |
|
253 * Set correct indicator value when Secondary line |
|
254 * activation done. |
|
255 */ |
|
256 void HandleSecondaryLineDualDivertActivation( |
|
257 TUnconditionalCFStatus& aStatus, |
|
258 const TInt aBsc ); |
|
259 |
|
260 /** |
|
261 * Set correct indicator value when Secondary line |
|
262 * deactivation done. |
|
263 */ |
|
264 void HandleSecondaryLineDualDivertDeactivation( |
|
265 TUnconditionalCFStatus& aStatus, |
|
266 const TInt aBsc ); |
|
267 |
|
268 /** |
|
269 * Starts to listen to call alerting or call ringing events. |
|
270 */ |
|
271 void NotifyCallStartedL(); |
|
272 |
|
273 /** |
|
274 * Checks KTelephonyLVFlagDivertDualAffect status. |
|
275 */ |
|
276 TBool IsDivertDualAffectFeatureEnabledL(); |
|
277 |
|
278 private: // constructors |
|
279 |
|
280 void ConstructL(); |
|
281 |
|
282 CPsetSAObserver(); |
|
283 |
|
284 private: //member data |
|
285 |
|
286 //Observer for network related SS. |
|
287 MPsetNetworkInfoObserver* iNetObserver; |
|
288 |
|
289 // The Notify interface to Publish And Subscribe. |
|
290 RProperty iNotifyProperty; |
|
291 |
|
292 CRepository* iRepository; |
|
293 }; |
|
294 #endif // PSETSAOBSERVER_H |
|
295 // end of file |