|
1 /* |
|
2 * Copyright (c) 2002-2008 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: Utility methods for SAT command handling. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef M_MSATUTILS_H |
|
21 #define M_MSATUTILS_H |
|
22 |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <etelsat.h> |
|
26 #include "MSatRefreshSubSession.h" |
|
27 #include "SatSOpcodes.h" |
|
28 #include "msatasynctosync.h" |
|
29 |
|
30 class MUiSessionLaunchObserver; |
|
31 class MSatApi; |
|
32 class MSatUiSession; |
|
33 class MSatEventObserver; |
|
34 class MSatSystemState; |
|
35 class MSatShellController; |
|
36 class MSatSUiClientHandler; |
|
37 class MSatCommand; |
|
38 class CSatClientServiceReq; |
|
39 class MSatEventMonitorContainer; |
|
40 class MSatEventMonitorUtils; |
|
41 class MSatSSimSubscriberId; |
|
42 class MSatBIPUtils; |
|
43 class MSatBIPEventNotifier; |
|
44 class RMobilePhone; |
|
45 class RMmCustomAPI; |
|
46 class MSatMediatorEventProvider; |
|
47 class MSatMultiModeApi; |
|
48 |
|
49 /** |
|
50 * Utility methods for SAT command handling. |
|
51 * |
|
52 * @lib SatServer |
|
53 * @since S60 v3.0 |
|
54 */ |
|
55 class MSatUtils |
|
56 { |
|
57 |
|
58 public: |
|
59 |
|
60 /** For notifying SAT commands/events */ |
|
61 enum TSatEvent |
|
62 { |
|
63 /** Originator: CSetUpMenuHandler */ |
|
64 /** Listeners: None */ |
|
65 ESetUpMenuExecuting, |
|
66 |
|
67 /** Originator: CSimSessionEndHandler */ |
|
68 /** Listeners: CSetUpMenuHandler */ |
|
69 ESimSessionEndExecuting, |
|
70 |
|
71 /** Originator: CSelectItemHandler */ |
|
72 /** Listeners: None */ |
|
73 ESelectItemExecuting, |
|
74 |
|
75 /** Originator: CSetUpCallHandler */ |
|
76 /** Listeners: None */ |
|
77 ESetUpCallExecuting, |
|
78 |
|
79 /** Originator: CDisplayTextHandler */ |
|
80 /** Listeners: None */ |
|
81 EDisplayTextExecuting, |
|
82 |
|
83 /** Originator: CLaunchBrowserHandler */ |
|
84 /** Listeners: None */ |
|
85 ELaunchBrowserExecuting, |
|
86 |
|
87 /** Originator: CGetInputHandler */ |
|
88 /** Listeners: None */ |
|
89 EGetInputExecuting, |
|
90 |
|
91 /** Originator: CGetInkeyHandler */ |
|
92 /** Listeners: None */ |
|
93 EGetInkeyExecuting, |
|
94 |
|
95 /** Originator: CSetUpEventListHandler */ |
|
96 /** Listeners: None */ |
|
97 ESetUpEventListExecuting, |
|
98 |
|
99 /** Originator: CSetUpIdleModeTextHandler */ |
|
100 /** Listeners: None */ |
|
101 ESetUpIdleModeTextExecuting, |
|
102 |
|
103 /** Originator: CSendDtmfHandler */ |
|
104 /** Listeners: None */ |
|
105 ESendDtmfExecuting, |
|
106 |
|
107 /** Originator: CSendSsHandler */ |
|
108 /** Listeners: None */ |
|
109 ESendSsExecuting, |
|
110 |
|
111 /** Originator: CSendUssdHandler */ |
|
112 /** Listeners: None */ |
|
113 ESendUssdExecuting, |
|
114 |
|
115 /** Originator: CPlayToneHandler */ |
|
116 /** Listeners: None */ |
|
117 EPlayToneExecuting, |
|
118 |
|
119 /** Originator: CProvideLocalInfoHandler */ |
|
120 /** Listeners: None */ |
|
121 ELocalInfoExecuting, |
|
122 |
|
123 /** Originator: CRefreshHandler */ |
|
124 /** Listeners: CClearScreenHandler */ |
|
125 ERefreshExecuting, |
|
126 |
|
127 /** Originator: CCallControlHandler */ |
|
128 /** Listeners: CSetUpCallHandler */ |
|
129 /** CSendSsHandler */ |
|
130 /** CSendUssdHandler */ |
|
131 ECallControlExecuting, |
|
132 |
|
133 /** Originator: CSendSmHandler */ |
|
134 /** Listeners: None */ |
|
135 ESendSmExecuting, |
|
136 |
|
137 /** Originator: CMoSmControlHandler */ |
|
138 /** Listener: CSendSmHandler */ |
|
139 EMoSmControlExecuting, |
|
140 |
|
141 /** Originator: CMoSmControlHandler */ |
|
142 /** Listener: CSendSmHandler */ |
|
143 EMoSmControlDone, |
|
144 |
|
145 /** Originator: CCallControlHandler */ |
|
146 /** Listeners: CSetUpCallHandler */ |
|
147 /** CSendSsHandler */ |
|
148 /** CSendUssdHandler */ |
|
149 ECallControlDone, |
|
150 |
|
151 /** Originator: CSatSSession */ |
|
152 /** Listeners: CSatCommandContainer */ |
|
153 ESatUiClosed, |
|
154 |
|
155 /** Originator: CSatSSession */ |
|
156 /** Listeners: CSetUpMenuHandler */ |
|
157 ESatUiLaunched, |
|
158 |
|
159 /** originators: CSendSmHandler */ |
|
160 /** Listeners: CSatSUiSubSession */ |
|
161 ESmsSent, |
|
162 |
|
163 /** Originators: CSetUpCallHandler */ |
|
164 /** CSelectItemHandler */ |
|
165 /** Listeners CSimSessionEndHandler */ |
|
166 ESessionTerminatedByUser, |
|
167 |
|
168 /** Originators: CSatCommandHandler */ |
|
169 /** Listeners: CSimSessionEndHandler */ |
|
170 EDestroySimSessionEndTimer, |
|
171 |
|
172 /** Originators: CSatCommandHandler */ |
|
173 /** Listeners: CSimSessionEndHandler */ |
|
174 EDelaySimSessionEnd, |
|
175 |
|
176 /** Originators: CDisplayTextHandler */ |
|
177 /** Listeners: CSetUpMenuHandler */ |
|
178 ESetUpMenuNeeded, |
|
179 |
|
180 /** Originators: CCallControlHandler */ |
|
181 /** CMoSmControlHandler*/ |
|
182 /** Listeners: CSimSessionEndHandler */ |
|
183 ESimSessionEndCallBack, |
|
184 |
|
185 /** Originators: CSatIconSubSession */ |
|
186 /** Listeners: CSetUpIdleModeTextHandler */ |
|
187 EIdleModeResponseSuccess, |
|
188 |
|
189 /** Originators: CSatIconSubSession */ |
|
190 /** Listeners: CSetUpIdleModeTextHandler */ |
|
191 EIdleModeResponseSuccessNoIcon, |
|
192 |
|
193 /** Originators: CSatIconSubSession */ |
|
194 /** Listeners: CSetUpIdleModeTextHandler */ |
|
195 EIdleModeResponseBeyondCapabilities, |
|
196 |
|
197 /** Originators: CSatIconSubSession */ |
|
198 /** Listeners: CSetUpIdleModeTextHandler */ |
|
199 EIdleModeResponseUnableToProcess, |
|
200 |
|
201 /** Originator: CSatSRefreshSubSession. */ |
|
202 /** Listeners: CRefreshHandler */ |
|
203 ERefreshAllowed, |
|
204 |
|
205 /** Originator: CSatSRefreshSubSession. */ |
|
206 /** Listeners: CRefreshHandler */ |
|
207 ERefreshNotAllowed, |
|
208 |
|
209 /** Originator: CSatSRefreshSubSession. */ |
|
210 /** Listeners: CRefreshHandler */ |
|
211 ERefreshEFRead, |
|
212 |
|
213 /** Originator: CSatSRefreshSubSession. */ |
|
214 /** Listeners: CRefreshHandler */ |
|
215 ERefreshAdditionalEFRead, |
|
216 |
|
217 /** Originators: CSatSSimSubscriberId */ |
|
218 /** Listeners: CSatCommandContainer */ |
|
219 ECmccSimDetected, |
|
220 |
|
221 /** Originators: CSatCommandContainer */ |
|
222 /** Listeners: CSetUpMenuHandler */ |
|
223 EApplNameUpdated, |
|
224 |
|
225 /** Originators: COpenChannelHandler */ |
|
226 /** Listeners: CReceiveDataHandler */ |
|
227 /** CSendDataHandler */ |
|
228 EOpenChannelExecuting, |
|
229 |
|
230 /** Originators: CCloseChannelHandler */ |
|
231 /** Listeners: None */ |
|
232 ECloseChannelExecuting, |
|
233 |
|
234 /** Originators: CGetChannelStatusHandler */ |
|
235 /** Listeners: None */ |
|
236 EGetChannelStatusExecuting, |
|
237 |
|
238 /** Originators: CSendDataHandler */ |
|
239 /** Listeners: None */ |
|
240 ESendDataExecuting, |
|
241 |
|
242 /** Originators: CReceiveDataHandler */ |
|
243 /** Listeners: None */ |
|
244 EReceiveDataExecuting, |
|
245 |
|
246 /** Originators: CDisplayTextHandler */ |
|
247 /** Listeners: CSimSessionEndHandler */ |
|
248 ESustainedTextInDisplay, |
|
249 |
|
250 /** Originators: CDisplayTextHandler */ |
|
251 /** Listeners: CSimSessionEndHandler */ |
|
252 ESustainedTextRemoved, |
|
253 |
|
254 /** Originators: COpenChannelHandler */ |
|
255 /** Listeners: CSimSessionEndHandler */ |
|
256 EDataChannelsActive, |
|
257 |
|
258 /** Originators: CCloseChannelHandler */ |
|
259 /** Listeners: CSimSessionEndHandler */ |
|
260 EDataChannelsInactive, |
|
261 |
|
262 /** Originators: CSendDataHandler */ |
|
263 /** CReceiveDataHandler */ |
|
264 /** Listeners: CSatSEventMoniotorContainer */ |
|
265 EBipCommandExecuting, |
|
266 EBipCommandDoneExecuting, |
|
267 |
|
268 /** Originators: CSatSUiSubSession */ |
|
269 /** Listeners: Command handlers */ |
|
270 ECommandCancelled, |
|
271 ECancelledUsingEndKey, |
|
272 |
|
273 /** Originators: CRefreshHandler */ |
|
274 /** Listeners: CSetUpIdleModeTextHandler */ |
|
275 ESimInitDone, |
|
276 |
|
277 /** Originators: CRefreshRequiredHandler */ |
|
278 /** Listeners: CSetUpMenuHandler */ |
|
279 /** CSetUpIdleModeTextHandler */ |
|
280 /** CSetUpEventListHandler */ |
|
281 ESimResetCalled, |
|
282 |
|
283 /** Originators: CRefreshHandler */ |
|
284 /** Listeners: CSetUpIdleModeTextHandler */ |
|
285 /** CSetUpEventListHandler */ |
|
286 ESimResetCancelled, |
|
287 |
|
288 /** Originator: CSatUiSubSession */ |
|
289 /** Listeners: CLaunchBrowserHandler */ |
|
290 ESetUpMenuRequested, |
|
291 |
|
292 /** Originator: CSatClientServiceReq */ |
|
293 /** Listeners: CSatSUiClientHandler */ |
|
294 EBringSatUiToForeGround, |
|
295 |
|
296 /** Originator: CSatSAPChangeObserver */ |
|
297 /** Listeners: CSetUpMenuHandler */ |
|
298 EAddSatUiCalled, |
|
299 ERemoveSatUiCalled |
|
300 |
|
301 }; |
|
302 |
|
303 |
|
304 /** |
|
305 * Gives USAT API. |
|
306 * |
|
307 * @since S60 v3.0 |
|
308 * @return Reference to USAT API wrapper. |
|
309 */ |
|
310 virtual MSatApi& USatAPI() = 0; |
|
311 |
|
312 /** |
|
313 * Gives reference to system state interface |
|
314 * |
|
315 * @since S60 v3.0 |
|
316 * @return Reference to system state interface. |
|
317 */ |
|
318 virtual MSatSystemState& SystemState() = 0; |
|
319 |
|
320 /** |
|
321 * Gives reference to MSatSUiClientHandler |
|
322 * |
|
323 * @since S60 v3.0 |
|
324 * @return Pointer to sat ui handler. |
|
325 */ |
|
326 virtual MSatSUiClientHandler& SatUiHandler() = 0; |
|
327 |
|
328 /** |
|
329 * Registers observer for event. Same observer will not be added |
|
330 * more than once for one event. |
|
331 * |
|
332 * @since S60 v3.0 |
|
333 * @param aObserver Pointer of observer instance. Panic will occur if |
|
334 * aObserver is NULL. |
|
335 * @param aEvent Event, which will cause the notification of observer. |
|
336 */ |
|
337 virtual void RegisterL( |
|
338 MSatEventObserver* aObserver, |
|
339 TSatEvent aEvent ) = 0; |
|
340 |
|
341 /** |
|
342 * Notifies event to all registered observers. |
|
343 * |
|
344 * @since S60 v3.0 |
|
345 * @param aEvent Event to be notified. |
|
346 */ |
|
347 virtual void NotifyEvent( TSatEvent aEvent ) = 0; |
|
348 |
|
349 /** |
|
350 * From MSatEventObserver.Sends UI Event Notification, |
|
351 * if UI session is found |
|
352 * |
|
353 * @since S60 v3.1 |
|
354 * @param aEvenId, identifies the event |
|
355 * @param aEventStatus, status of the event |
|
356 * @param aEventError, possible error value |
|
357 */ |
|
358 virtual void NotifyUiEvent( |
|
359 TInt aEventId, |
|
360 TInt aEventStatus, |
|
361 TInt aEventError ) = 0; |
|
362 |
|
363 /** |
|
364 * Unregisters the event notification. |
|
365 * |
|
366 * @since S60 v3.0 |
|
367 * @param aObserver Observer of the event |
|
368 * @param aEvent Event to be unregistered. |
|
369 */ |
|
370 virtual void UnregisterEvent( |
|
371 MSatEventObserver* aObserver, |
|
372 TSatEvent aEvent ) = 0; |
|
373 |
|
374 /** |
|
375 * Removes observer from event observers |
|
376 * |
|
377 * @since S60 v3.0 |
|
378 * @param aObserver Observer to removed |
|
379 */ |
|
380 virtual void UnregisterEventObserver( |
|
381 MSatEventObserver* aObserver ) = 0; |
|
382 |
|
383 /** |
|
384 * Gives number of executing commands currently. |
|
385 * In practise there can be only one executing proactive |
|
386 * command, but envelopes can be executing same time. |
|
387 * |
|
388 * @since S60 v3.0 |
|
389 * @return Number of executing command handlers. |
|
390 */ |
|
391 virtual TInt NumberOfExecutingCommandHandlers() = 0; |
|
392 |
|
393 /** |
|
394 * Gets the sim application name. |
|
395 * |
|
396 * @since S60 v3.0 |
|
397 * @return Sat application name. |
|
398 */ |
|
399 virtual const TDesC& SatAppName() const = 0; |
|
400 |
|
401 /** |
|
402 * Gets the name for the APN |
|
403 * |
|
404 * @since S60 v3.0 |
|
405 * @return Sat application name. |
|
406 */ |
|
407 virtual const TDesC& BipApnName() const = 0; |
|
408 |
|
409 /** |
|
410 * Restores default SIM Application name. |
|
411 * |
|
412 * @since S60 v3.1 |
|
413 */ |
|
414 virtual void RestoreSatAppNameL() = 0; |
|
415 |
|
416 /** |
|
417 * Sets the sim application name. |
|
418 * |
|
419 * @since S60 v3.0 |
|
420 * @param aName New name of Sat application |
|
421 */ |
|
422 virtual void SetSatAppNameL( const TDesC& aName ) = 0; |
|
423 |
|
424 /** |
|
425 * Gets all refresh subsession. |
|
426 * @return Pointer array of Refresh Sub sessions. |
|
427 */ |
|
428 virtual const RPointerArray<MSatRefreshSubSession>& |
|
429 RefreshSubSessions() = 0; |
|
430 |
|
431 /** |
|
432 * Registers new service request handler |
|
433 * |
|
434 * @since S60 v3.0 |
|
435 * @param aRequest A Request this service request listens |
|
436 * @param aResponse A Response for this service request |
|
437 * @param aCommand A Command handler for request |
|
438 */ |
|
439 virtual void RegisterServiceRequestL( |
|
440 TSatServerRequest aRequest, |
|
441 TSatServerRequest aResponse, |
|
442 MSatCommand* aCommand ) = 0; |
|
443 |
|
444 /** |
|
445 * Gets all registered service requests |
|
446 * |
|
447 * @since S60 v3.0 |
|
448 * @return Pointer array of registered Client Service requests |
|
449 */ |
|
450 virtual CArrayPtrFlat<CSatClientServiceReq>* |
|
451 ServiceRequests() = 0; |
|
452 |
|
453 /** |
|
454 * Gives pointer to event monitor container |
|
455 * |
|
456 * @since S60 v3.0 |
|
457 * @return Pointer to MSatEventMonitorContainer API |
|
458 */ |
|
459 virtual MSatEventMonitorContainer* EventMonitors() = 0; |
|
460 |
|
461 /** |
|
462 * Gives reference to subscriber id. |
|
463 * |
|
464 * @since S60 v3.0 |
|
465 * @return SIM subscriber id API reference |
|
466 */ |
|
467 virtual MSatSSimSubscriberId& SimSubscriberId() = 0; |
|
468 |
|
469 /** |
|
470 * Gives reference to BIP Utils interface. |
|
471 * |
|
472 * @since S60 v3.0 |
|
473 * @return Reference to BIP Utils interface. |
|
474 */ |
|
475 virtual MSatBIPUtils& BipUtils() = 0; |
|
476 |
|
477 /** |
|
478 * Gives reference to BIP Event notifier interface. |
|
479 * |
|
480 * @since S60 v3.0 |
|
481 * @return Reference to BIP Event notifier interface. |
|
482 */ |
|
483 virtual MSatBIPEventNotifier& BipEventNotifier() = 0; |
|
484 |
|
485 /** |
|
486 * Gives reference to active RMmCustomApi session |
|
487 * |
|
488 * @since S60 v3.1 |
|
489 * @return Reference to active RMmCustomApi server session |
|
490 */ |
|
491 virtual RMmCustomAPI* CustomApi() = 0; |
|
492 |
|
493 |
|
494 /** |
|
495 * Gives reference to MSatMultiModeApi |
|
496 * |
|
497 * @since S60 v5.0 |
|
498 * @return Reference to MSatMultiModeApi |
|
499 */ |
|
500 virtual MSatMultiModeApi& MultiModeApi() = 0; |
|
501 |
|
502 /** |
|
503 * Sends SAT Mediator event to Mediator Event Provider interface. |
|
504 * |
|
505 * @since S60 v3.1 |
|
506 * @param aData packaged data to mediator event consumer |
|
507 * @return KErrNone or error code. |
|
508 */ |
|
509 virtual TInt RaiseSatEvent( const TDesC8& aData ) = 0; |
|
510 |
|
511 /** |
|
512 * Checks Cover UI support for SAT Mediator Event. |
|
513 * |
|
514 * @since S60 v3.1 |
|
515 * @return ETrue if supported. |
|
516 */ |
|
517 virtual TBool CoverUiSupported() = 0; |
|
518 |
|
519 /** |
|
520 * Gives pointer to MSatAsyncToSync interface. |
|
521 * |
|
522 * @since S60 v5.0.1 |
|
523 * @return a MSatAsyncToSync Pointer to CreateAsyncToSyncHelper object. |
|
524 */ |
|
525 virtual MSatAsyncToSync* CreateAsyncToSyncHelper() = 0; |
|
526 |
|
527 protected: |
|
528 |
|
529 MSatUtils() {}; |
|
530 |
|
531 virtual ~MSatUtils() {}; |
|
532 |
|
533 private: |
|
534 |
|
535 /** |
|
536 * Prohibit copy constructor if not deriving from CBase. |
|
537 * |
|
538 * @since S60 v3.0 |
|
539 * @param const reference to MSatUtils. |
|
540 */ |
|
541 MSatUtils( const MSatUtils& ); |
|
542 |
|
543 /** |
|
544 * Prohibit assigment operator if not deriving from CBase. |
|
545 * |
|
546 * @since S60 v3.0 |
|
547 * @param const reference to MSatUtils. |
|
548 */ |
|
549 MSatUtils& operator=( const MSatUtils& ); |
|
550 |
|
551 }; |
|
552 |
|
553 #endif // M_MSATUTILS_H |
|
554 |