|
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: The observer interface for the Sat Client. Register a |
|
15 * concrete impl of this to receive SAT events from the session |
|
16 * object. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef MSATUIOBSERVER_H |
|
22 #define MSATUIOBSERVER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32svr.h> |
|
26 #include <badesca.h> // for descriptor arrays |
|
27 #include <etelsat.h> |
|
28 |
|
29 /** |
|
30 * The UI response codes, enumerations values are from ETSI 11.14 specification. |
|
31 */ |
|
32 enum TSatUiResponse |
|
33 { |
|
34 ESatFailure = -1, // OOM or other error |
|
35 ESatSuccess = 0x00, // success |
|
36 ESatSuccessToneNotPlayed = 0x09, // Warning and game tones are |
|
37 // disabled from current profile |
|
38 ESatSessionTerminatedByUser = 0x10, // user exited the app |
|
39 ESatBackwardModeRequestedByUser = 0x11, // user pressed back |
|
40 ESatNoResponseFromUser = 0x12, // no response from user |
|
41 EHelpRequestedByUser = 0x13, // help request from the UI |
|
42 EPCmdNotAcceptedByUser = 0x22, |
|
43 ESatCmdDataNotUnderstood = 0x32 |
|
44 }; |
|
45 |
|
46 /** |
|
47 * Tone values are dictated by ETSI 11.14. |
|
48 * Use by the SAT Play Tone command. |
|
49 */ |
|
50 |
|
51 enum TSatTone |
|
52 { |
|
53 ESatToneNotSet = -1, |
|
54 ESatDialTone = 0x01, |
|
55 ESatCalledSubscriberBusy = 0x02, |
|
56 ESatCongestion = 0x03, |
|
57 ESatRadioPathAcknowledge = 0x04, |
|
58 ESatRadioPathNotAvailableCallDropped = 0x05, |
|
59 ESatErrorSpecialInfo = 0x06, |
|
60 ESatCallWaitingTone = 0x07, |
|
61 ESatRingingTone = 0x08, |
|
62 ESatGeneralBeep = 0x10, |
|
63 ESatPositiveTone = 0x11, |
|
64 ESatNegativeTone = 0x12, |
|
65 ESatUserSelectedToneIncomingSpeech = 0x13, |
|
66 ESatUserSelectedToneIncomingSms = 0x14 |
|
67 }; |
|
68 |
|
69 enum TSatAlphaIdStatus |
|
70 { |
|
71 ESatAlphaIdNotNull, |
|
72 ESatAlphaIdNull, |
|
73 ESatAlphaIdNotProvided |
|
74 }; |
|
75 |
|
76 /** |
|
77 * ControlResult can be used e.g. to supply |
|
78 * Call Control / MO Short Message Control result |
|
79 * from SIM to UI Client |
|
80 */ |
|
81 |
|
82 enum TSatControlResult |
|
83 { |
|
84 ESatAllowedNoModification, |
|
85 ESatNotAllowed, |
|
86 ESatAllowedWithModifications |
|
87 }; |
|
88 |
|
89 /** |
|
90 * The SAT next action indicators, localized by the UI. |
|
91 * Values commented out will not be used, with accordance to ETSI 11.14. |
|
92 */ |
|
93 |
|
94 enum TSatAction |
|
95 { |
|
96 //ESatNoAction = 0x00, |
|
97 //ESatRefreshAction = 0x01, |
|
98 //ESatMoreTimeAction = 0x02, |
|
99 //ESatPollIntervalAction = 0x03, |
|
100 //ESatPollingOffAction = 0x04, |
|
101 //ESatSetUpEventListAction = 0x05, |
|
102 ESatSetUpCallAction = 0x10, |
|
103 ESatSendSsAction = 0x11, |
|
104 ESatSendUssdAction = 0x12, |
|
105 ESatSendSmAction = 0x13, |
|
106 //ESatSendDtmfAction = 0x14, |
|
107 ESatLaunchBrowserAction = 0x15, |
|
108 ESatPlayToneAction = 0x20, |
|
109 ESatDisplayTextAction = 0x21, |
|
110 ESatGetInkeyAction = 0x22, |
|
111 ESatGetInputAction = 0x23, |
|
112 ESatSelectItemAction = 0x24, |
|
113 ESatSetUpMenuAction = 0x25, |
|
114 //ESatProvideLocalInformationAction = 0x26, |
|
115 //ESatTimerManagementAction = 0x27, |
|
116 ESatSetUpIdleModeTextAction = 0x28, |
|
117 ESatPerformCardApduAction = 0x30, |
|
118 ESatPowerOnCardAction = 0x31, |
|
119 ESatPowerOffCardAction = 0x32, |
|
120 ESatGetReaderStatusAction = 0x33, |
|
121 //ESatRunAtCommandAction = 0x34, |
|
122 ESatEndOfSimSession = 0x81 |
|
123 }; |
|
124 |
|
125 /** |
|
126 * The SAT input commands' data formats. |
|
127 */ |
|
128 enum TSatCharacterSet |
|
129 { |
|
130 ESatDigitOnly, |
|
131 ESatCharSmsDefaultAlphabet, |
|
132 ESatCharUcs2Alphabet, |
|
133 ESatYesNo |
|
134 }; |
|
135 |
|
136 /** |
|
137 * Dictates how the icons should be used. |
|
138 */ |
|
139 enum TSatIconQualifier |
|
140 { |
|
141 ESatIconQualifierNotSet,// Icon qualifier is not set |
|
142 ESatENoIconId, // Icon qualifier not present |
|
143 ESatSelfExplanatory, // Icon qualifier is self explanatory |
|
144 // (to display instead of the alpha id or text |
|
145 // string) |
|
146 ESatNotSelfExplanatory // Icon qualifier is not self explanatory |
|
147 // (to display along the alpha id or text string) |
|
148 }; |
|
149 |
|
150 /** |
|
151 * Identifies the quering command |
|
152 */ |
|
153 enum TSatSQueryCommand |
|
154 { |
|
155 ESatSSendSmQuery, |
|
156 ESatSSendSsQuery, |
|
157 ESatSSendUssdQuery, |
|
158 ESatSRefreshQuery, |
|
159 ESatSLaunchBrowserQuery, |
|
160 ESatOpenChannelQuery, |
|
161 ESatSSetUpCallQuery |
|
162 }; |
|
163 |
|
164 /** |
|
165 * Identifies the notification command |
|
166 */ |
|
167 enum TSatSNotifyCommand |
|
168 { |
|
169 ESatSSendDataNotify, |
|
170 ESatSReceiveDataNotify, |
|
171 ESatSCloseChannelNotify, |
|
172 ESatSMoSmControlNotify, |
|
173 ESatSCallControlNotify, |
|
174 ESatSSendSsNotify, |
|
175 ESatSSendUssdNotify, |
|
176 ESatSSendDtmfNotify, |
|
177 ESatSSendSmsNotify |
|
178 }; |
|
179 |
|
180 /** |
|
181 * The icon id struct. |
|
182 */ |
|
183 struct TSatIconId |
|
184 { |
|
185 TUint8 iIdentifier; // Identifies the EF_IMG in SIM. |
|
186 TSatIconQualifier iIconQualifier; |
|
187 }; |
|
188 |
|
189 /** |
|
190 * Specifies whether soft keys is the preferred selection mode or not. |
|
191 */ |
|
192 enum TSatSelectionPreference |
|
193 { |
|
194 ESatSelectionPreferenceNotSet, |
|
195 ESatNoSelectionPreference, |
|
196 ESatSoftKeyPreferred |
|
197 }; |
|
198 |
|
199 enum TSatBIPCommandIdentifier |
|
200 { |
|
201 ESendDataIdentier, |
|
202 EReceiveDataIdentifier, |
|
203 ECloseChannelIdentifier |
|
204 }; |
|
205 |
|
206 enum TSatSessionTerminationType |
|
207 { |
|
208 ESessionCancel, |
|
209 EEndKeyUsed |
|
210 }; |
|
211 |
|
212 // Codes for event notifications. |
|
213 enum TSatSEvent |
|
214 { |
|
215 ESatSRefreshStartEvent, |
|
216 ESatSRefreshEndEvent, |
|
217 ESatSSmEndEvent, |
|
218 ESatSClearScreenEvent, |
|
219 ESatSCloseSatUiAppEvent, |
|
220 ESatSsEndEvent, |
|
221 ESatSsErrorEvent, |
|
222 ESatSDtmfEndEvent |
|
223 }; |
|
224 |
|
225 enum TSatSEventStatus |
|
226 { |
|
227 ESatEventNone, |
|
228 ESatEventCompleteOk, |
|
229 ESatEventFailure, |
|
230 ESatEventCancel |
|
231 }; |
|
232 |
|
233 /** |
|
234 * An abstract observer interface. |
|
235 * Register to receive SAT events from the session object. |
|
236 * |
|
237 * @lib SatClient.lib |
|
238 * @since Series 60 2.0 |
|
239 */ |
|
240 class MSatUiObserver |
|
241 { |
|
242 public: // New functions |
|
243 |
|
244 /** |
|
245 * Notification of the SAT Display Text command. |
|
246 * @param aText The text string to be displayed. |
|
247 * @param aSimApplicationName Sim Application name |
|
248 * @param aIconId The id of icon. |
|
249 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
250 * @param aSustainedText Indicates is this text sustained ie. no timers |
|
251 * used if ETrue. |
|
252 * @param aDuration Duration for showing the text |
|
253 * @param aWaitUserToClear Indication if user is needed to clear |
|
254 * message |
|
255 * @return The response of the UI to this command. |
|
256 */ |
|
257 virtual TSatUiResponse DisplayTextL( |
|
258 const TDesC& aText, |
|
259 const TDesC& aSimApplicationName, |
|
260 const TSatIconId& aIconId, |
|
261 TBool& aRequestedIconDisplayed, |
|
262 const TBool aSustainedText, |
|
263 const TTimeIntervalSeconds aDuration, |
|
264 const TBool aWaitUserToClear ) = 0; |
|
265 |
|
266 /** |
|
267 * Notification of the SAT Get Inkey command. |
|
268 * @param aText The query text. |
|
269 * @param aCharacterSet The character range allowed. |
|
270 * @param aInput The input character. |
|
271 * @param aHelpIsAvailable indicates if help can be requested. |
|
272 * @param aIconId The id of icon. |
|
273 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
274 * @param aDuration Duration for showing the dialog. |
|
275 * @param aImmediateDigitResponse Indication if Immediate digit response |
|
276 * is needed. |
|
277 * @return The response of the UI to this command. |
|
278 */ |
|
279 virtual TSatUiResponse GetInkeyL( |
|
280 const TDesC& aText, |
|
281 const TSatCharacterSet aCharacterSet, |
|
282 TChar& aInput, |
|
283 const TBool aHelpIsAvailable, |
|
284 const TSatIconId& aIconId, |
|
285 TBool& aRequestedIconDisplayed, |
|
286 TUint& aDuration, |
|
287 const TBool aImmediateDigitResponse ) = 0; |
|
288 |
|
289 /** |
|
290 * Notification of the SAT Get Input command. |
|
291 * @param aText The query text. |
|
292 * @param aCharacterSet The character range allowed. |
|
293 * @param aInput The input string. |
|
294 * @param aMaxLength The maximum length of the input allowed. |
|
295 * @param aMinLength The minimum length of the input allowed. |
|
296 * @param aHideInput A flag indicating if the input should be hidden. |
|
297 * @param aHelpIsAvailable indicates if help can be requested. |
|
298 * @param aIconId The id of icon. |
|
299 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
300 * @return The response of the UI to this command. |
|
301 */ |
|
302 virtual TSatUiResponse GetInputL( |
|
303 const TDesC& aText, |
|
304 const TSatCharacterSet aCharacterSet, |
|
305 TDes& aInput, |
|
306 const TInt aMinLength, |
|
307 const TInt aMaxLength, |
|
308 const TBool aHideInput, |
|
309 const TBool aHelpIsAvailable, |
|
310 const TSatIconId& aIconId, |
|
311 TBool& aRequestedIconDisplayed ) = 0; |
|
312 |
|
313 /** |
|
314 * Notification of the SAT Set Up Menu command. |
|
315 * @param aText The query text. |
|
316 * @param aMenuItems The array of menu item captions. |
|
317 * @param aMenuItemNextActions The array of menu item next action |
|
318 * indicator captions. |
|
319 * @param aHelpIsAvailable indicates if help can be requested. |
|
320 * @param aIconId The id of icon. |
|
321 * @param aMenuIcons List of icon identifiers for menu items. |
|
322 * @param aIconListQualifier Indicates how to use icons in the icon |
|
323 * list. |
|
324 * @param aSelectionPreference Specifies is the soft keys preferred. |
|
325 * @return The response of the UI to this command. |
|
326 */ |
|
327 virtual TSatUiResponse SetUpMenuL( |
|
328 const TDesC& aText, |
|
329 const MDesCArray& aMenuItems, |
|
330 const CArrayFixFlat<TSatAction>* aMenuItemNextActions, |
|
331 const TBool aHelpIsAvailable, |
|
332 const TSatIconId& aIconId, |
|
333 const CArrayFixFlat<TInt>* aMenuIcons, |
|
334 const enum TSatIconQualifier aIconListQualifier, |
|
335 const enum TSatSelectionPreference aSelectionPreference ) = 0; |
|
336 |
|
337 /** |
|
338 * Notification of the SAT Select Item command. |
|
339 * @param aText The query text. |
|
340 * @param aMenuItems The array of menu item captions. |
|
341 * @param aMenuItemNextActions The array of menu item next action |
|
342 * indicator codes. |
|
343 * @param aDefaultItem The item selected by default. |
|
344 * @param aSelection The item index selected by the user. |
|
345 * @param aHelpIsAvailable indicates if help can be requested. |
|
346 * @param aIconId The id of title icon. |
|
347 * @param aMenuIcons List of icon identifiers for menu items. |
|
348 * @param aIconListQualifier Indicates how to use icons in the icon |
|
349 * list. |
|
350 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
351 * @param aSelectionPreference Specifies is the soft keys preferred. |
|
352 * @return The response of the UI to this command. |
|
353 */ |
|
354 virtual TSatUiResponse SelectItemL( |
|
355 const TDesC& aText, |
|
356 const MDesCArray& aMenuItems, |
|
357 const CArrayFixFlat<TSatAction>* aMenuItemNextActions, |
|
358 const TInt aDefaultItem, TUint8& aSelection, |
|
359 const TBool aHelpIsAvailable, |
|
360 const TSatIconId& aIconId, |
|
361 const CArrayFixFlat<TInt>* aMenuIcons, |
|
362 const enum TSatIconQualifier aIconListQualifier, |
|
363 TBool& aRequestedIconDisplayed, |
|
364 const enum TSatSelectionPreference aSelectionPreference ) = 0; |
|
365 |
|
366 /** |
|
367 * Notification of the SAT Play Tone command. |
|
368 * @param aText The text to be displayed. |
|
369 * @param aTone The tone to be played. |
|
370 * @param aDuration The duration of the tone to be played. |
|
371 * @param aIconId The id of icon. |
|
372 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
373 * @return The response of the UI to this command. |
|
374 */ |
|
375 virtual TSatUiResponse PlayTone( |
|
376 const TDesC& aText, |
|
377 const TSatTone aTone, |
|
378 const TTimeIntervalMicroSeconds aDuration, |
|
379 const TSatIconId& aIconId, |
|
380 TBool& aRequestedIconDisplayed ) = 0; |
|
381 |
|
382 |
|
383 /** |
|
384 * General confirmation request |
|
385 * @param aCommandId ID of the quering command |
|
386 * @param aAlphaIdStatus Alpha Identifier status |
|
387 * @param aText The text to be displayed. |
|
388 * @param aAdditionalText Additional text to be used in queries. |
|
389 * @param aActionAccepted Indicates whether the command was accepted. |
|
390 * @param aIconId The id of icon. |
|
391 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
392 * @param aTerminatedByUser Informs if end key is used. |
|
393 */ |
|
394 virtual void ConfirmCommand( |
|
395 const TSatSQueryCommand aCommandId, |
|
396 const TSatAlphaIdStatus aAlphaIdStatus, |
|
397 const TDesC& aText, |
|
398 const TDesC& aAdditionalText, |
|
399 TBool& aActionAccepted, |
|
400 const TSatIconId& aIconId, |
|
401 TBool& aRequestedIconDisplayed, |
|
402 TBool& aTerminatedByUser ) = 0; |
|
403 |
|
404 /** |
|
405 * General notification |
|
406 * @param aCommandId ID of the notifying command |
|
407 * @param aAlphaIdStatus Alpha Identifier status |
|
408 * @param aText Alpha Identifier |
|
409 * @param aIconId The id of icon. |
|
410 * @param aRequestedIconDisplayed Informs if icon is not used. |
|
411 * @param aControlResult Control result of the MoSm and CallControl |
|
412 * @return The response of the UI to this command. |
|
413 */ |
|
414 virtual TSatUiResponse Notification( |
|
415 const TSatSNotifyCommand aCommandId, |
|
416 const TSatAlphaIdStatus aAlphaIdStatus, |
|
417 const TDesC& aText, |
|
418 const TSatIconId& aIconId, |
|
419 TBool& aRequestedIconDisplayed, |
|
420 const TSatControlResult aControlResult ) = 0; |
|
421 |
|
422 /** |
|
423 * General event notification. Used for example to tell UI that command |
|
424 * has completed its execution. |
|
425 * @param aEventId, identifies the event |
|
426 * @param aEventStatus, status of the event, used as additional info for |
|
427 * the event |
|
428 * @param aError, possible error code that may affect on event handling. |
|
429 * This is also used as additional info |
|
430 */ |
|
431 virtual void EventNotification( |
|
432 const TSatSEvent aEventId, |
|
433 const TSatSEventStatus aEventStatus, |
|
434 const TInt aError ) = 0; |
|
435 }; |
|
436 |
|
437 #endif // MSATUIOBSERVER_H |