comparison src/ui3/bmi/mmiSatCall.c @ 420:e8ddbb0837ed

src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Jan 2018 03:09:00 +0000
parents
children
comparison
equal deleted inserted replaced
419:59143cd42ec7 420:e8ddbb0837ed
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI
14 $Module: SMS
15 $File: mmiSatInfo.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25 Implementation of MMI SIM Application Toolkit (SAT)
26
27 ********************************************************************************
28
29 $History: mmiSatInfo.c
30
31 Nov 17, 2006 REF:DR:OMAPS00104580 x0039928
32 Description: CT GCF - TC27.22.4.13.1 Seq 1.10 - PROACTIVE SIM COMMANDS:
33 SET UP CALL (NORMAL) - Call Set-up Failed
34 Solution: Removed the Redial flag enabling.
35
36 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544
37 Description: 27.22.4.13.3 SET UP CALL (display of icons) fails.
38 Solution: In the function sat_call_setup_exec() copied the icon data in to display_info structure
39 inorder to display on the call screen during SAT call setup.
40
41 25/10/00 Original Condat(UK) BMI version.
42 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed()
43
44 $End
45
46 *******************************************************************************/
47
48 #define ENTITY_MFW
49
50 /* includes */
51 #include <string.h>
52 #include <stdio.h>
53 #include <stdlib.h>
54
55 #if defined (NEW_FRAME)
56
57 #include "typedefs.h"
58 #include "vsi.h"
59 #include "pei.h"
60 #include "custom.h"
61 #include "gsm.h"
62
63 #else
64
65 #include "STDDEFS.H"
66 #include "custom.h"
67 #include "gsm.h"
68 #include "vsi.h"
69
70 #endif
71 #include "mfw_sys.h"
72
73 #include "mfw_mfw.h"
74 #include "mfw_win.h"
75 #include "mfw_kbd.h"
76 /* SPR#1428 - SH - New Editor changes */
77 #ifndef NEW_EDITOR
78 #include "mfw_edt.h"
79 #endif
80 #include "mfw_lng.h"
81 #include "mfw_icn.h"
82 #include "mfw_phb.h"
83 #include "mfw_sim.h"
84 #include "mfw_nm.h"
85 #include "mfw_sms.h"
86 #include "mfw_mnu.h"
87 #include "mfw_sat.h"
88 #include "mfw_tim.h"
89
90 #include "dspl.h"
91
92 #include "MmiMmi.h"
93 #include "MmiDummy.h"
94 #include "MmiDialogs.h"
95 #include "MmiLists.h"
96
97 #include "MmiMain.h"
98 #include "MmiStart.h"
99 #include "MmiPins.h"
100 #include "MmiMenu.h"
101 #include "MmiSoftKeys.h"
102 #include "MmiSounds.h"
103 #include "mmiCall.h"
104
105 #include "mmiSat_i.h"
106
107 #include "cus_aci.h"
108 #include "prim.h"
109 #ifndef PCM_2_FFS
110 #include "pcm.h"
111 #endif
112
113
114 #include "mmiColours.h"
115
116 /*********************************************************************
117 *
118 * SUB WINDOW SAT_CALL_SETUP
119 *
120 *********************************************************************/
121 typedef struct
122 {
123 T_MMI_CONTROL mmi_control;
124 T_MFW_HND parent_win;
125 T_MFW_HND win;
126 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */
127 T_SAT_call_setup_parameter * call_setup_parameter;
128 T_MFW_HND redial_tim;
129 } T_sat_call_setup;
130
131 extern BOOL sat_call_active; // Marcus: Issue 1812: 13/03/2003
132 /* Nov 17, 2006 REF:DR:OMAPS00104580 x0039928
133 -Deleted Redial flag enabling/disabling code*/
134
135 static void sat_call_setup_destroy (T_MFW_HND own_window);
136 static void sat_call_setup_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_call_setup_parameter * call_setup_parameter);
137 static void sat_call_setup_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
138 static int sat_call_setup_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc);
139
140 /*******************************************************************************
141
142 $Function: sat_call_setup_create
143
144 $Description: Creation of an instance for the SAT CALL dialog.Window must be
145 available after reception of SAT command only one instance.
146
147 $Returns: mfw window handler
148
149 $Arguments: parent_window - Parent window handler
150
151 *******************************************************************************/
152 T_MFW_HND sat_call_setup_create (T_MFW_HND parent_window)
153 {
154 T_sat_call_setup * data = (T_sat_call_setup *)ALLOC_MEMORY (sizeof (T_sat_call_setup));
155 T_MFW_WIN * win;
156
157 data->win = win_create (parent_window, 0, 0,NULL);
158 sat_set_call_setup_win(data->win);
159
160 if (data->win EQ NULL)
161 return NULL;
162
163 /*
164 * Create window handler
165 */
166 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_call_setup_exec;
167 data->mmi_control.data = data;
168 data->parent_win = parent_window;
169 win = ((T_MFW_HDR *)data->win)->data;
170 win->user = (MfwUserDataPtr)data;
171
172 /*
173 * return window handle
174 */
175 winShow(data->win);
176 return data->win;
177 }
178
179 /*******************************************************************************
180
181 $Function: sat_call_setup_destroy
182
183 $Description: Destroy the sat call dialog.
184
185 $Returns: none
186
187 $Arguments: own_window - Current window
188
189 *******************************************************************************/
190 static void sat_call_setup_destroy (T_MFW_HND own_window)
191 {
192 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data;
193 T_sat_call_setup * data = (T_sat_call_setup *)win_data->user;
194
195 if (own_window == NULL)
196 {
197 TRACE_EVENT ("Error : sat_call_setup_destroy called with NULL Pointer");
198 return;
199 }
200
201 if (data)
202 {
203 /*
204 * Delete WIN Handler
205 */
206 win_delete (data->win);
207 /*
208 * Free Memory
209 */
210 FREE_MEMORY ((void *)data, sizeof (T_sat_call_setup));
211 sat_set_call_setup_win(NULL);
212 }
213 }
214
215 /*******************************************************************************
216
217 $Function: sat_call_setup_exec
218
219 $Description: Dialog function for sat_call_setup_exec window.
220
221 $Returns: none
222
223 $Arguments: win - current window
224 event - window event
225 value - unique id
226 call_setup_parameter - call setup info
227
228 *******************************************************************************/
229 static void sat_call_setup_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_call_setup_parameter * call_setup_parameter)
230 {
231
232 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
233 T_sat_call_setup * data = (T_sat_call_setup *)win_data->user;
234
235 T_DISPLAY_DATA display_info;
236
237 TRACE_FUNCTION ("sat_call_setup_exec()");
238
239 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL))
240 return;
241
242 switch (event)
243 {
244 case SAT_CALL_ALERT:
245
246 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_ALERT");
247
248 /* start an info screen to accept or reject the call setup */
249 data->call_setup_parameter = call_setup_parameter;
250
251 /* SPR#1700 - DS - Modified so SAT will not display "Setup call?" if the first alpha id has been supplied by the SIM
252 */
253
254 if (call_setup_parameter->TextString) /* Alpha id supplied by SIM */
255 {
256 /* 01-06-2006, x0045876 (OMAPS00070741) */
257 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, call_setup_parameter->TextString, " ", COLOUR_STATUS);
258 //x0035544 Feb 07, 2006 DR:OMAPS00061467
259 #ifdef FF_MMI_SAT_ICON
260 if(call_setup_parameter->IconInfo.dst != NULL)
261 {
262 display_info.IconData.width = call_setup_parameter->IconInfo.width;
263 display_info.IconData.height = call_setup_parameter->IconInfo.height;
264 display_info.IconData.dst = call_setup_parameter->IconInfo.dst;
265 display_info.IconData.selfExplanatory = call_setup_parameter->IconInfo.selfExplanatory;
266 }
267 #endif
268
269 }
270
271 else /* No alpha id supplied so show "Setup call?" */
272 {
273 //x0035544 Mar 14, 2006 DR:OMAPS00061467
274 //added missing '?' to the string "Setup call" as below
275 /* 01-06-2006, x0045876 (OMAPS00070741) */
276 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, "Setup call?", " ", COLOUR_STATUS);
277 }
278 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_call_setup_cb, FOREVER, KEY_LEFT|KEY_RIGHT );
279
280
281 display_info.Identifier = event;
282 /* 01-06-2006, x0045876 (Wrapping of text is enabled) */
283 display_info.WrapStrings=WRAP_STRING_2;
284 /*
285 * Call Info Screen
286 */
287 info_dialog (win, &display_info);
288 break;
289
290 case SAT_CALL_REDIAL:
291 /* attempt a redial if the timer has not yet elapsed */
292 /* if redial is not commanded by SAT_CALL_ALERT the timer will be NULL (see sat_call_setup_cb()) */
293 /* if the timer has already elapsed it is set to NULL (see sat_call_setup_tim_cb()) */
294
295 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_REDIAL");
296
297 if ((data->redial_tim NEQ NULL) || (call_setup_parameter->redialTime EQ FOREVER))
298
299 {
300 // ??? rsa according to ES we shall use a satAccept() at this point (but it returns an error)
301 if (!call_get_window())
302 call_create(0);
303 SEND_EVENT(call_get_window(),CALL_OUTGOING_SAT,0,call_setup_parameter);
304 }
305 else
306 {
307 SEND_EVENT(data->parent_win, SAT_CALL_END, 0, NULL); /* inform the parent */
308 }
309 break;
310
311 case SAT_CALL_END:
312
313 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_END");
314
315 /* Nov 17, 2006 REF:DR:OMAPS00104580 x0039928
316 -Deleted Redial flag enabling/disabling code*/
317
318 /* clean up after end of call */
319 sat_call_setup_destroy(win);
320 break;
321
322 default:
323 TRACE_EVENT("sat_call_setup_exec() unexpected event");
324 return;
325 }
326
327 }
328
329 /*******************************************************************************
330
331 $Function: sat_call_setup_cb
332
333 $Description: Callback function information dialog.
334
335 $Returns: none
336
337 $Arguments: win - current window
338 identifier - unique id
339 reason - window event id
340
341 *******************************************************************************/
342
343 static void sat_call_setup_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
344 {
345 T_MFW_WIN * info_win_data = ((T_MFW_HDR *) win)->data;
346 T_sat_call_setup * data = (T_sat_call_setup *)info_win_data->user;
347
348 TRACE_FUNCTION("sat_call_setup_cb()");
349
350 if ((win EQ NULL) || (info_win_data EQ NULL) || (data EQ NULL))
351 return;
352
353 switch (reason)
354 {
355 case INFO_KCD_LEFT: /* the user has accepted the call setup */
356 /* start the call */
357 sat_call_active = TRUE; // Marcus: Issue 1812: 13/03/2003
358 if (!call_get_window())
359 call_create(0);
360 SEND_EVENT(call_get_window(),CALL_OUTGOING_SAT,0,data->call_setup_parameter);
361 satAccept();
362
363 /* create and start the redial timer handler */
364 if ((data->call_setup_parameter->redialTime NEQ 0) &&
365 (data->call_setup_parameter->redialTime NEQ FOREVER))
366 {
367 data->redial_tim =
368 tim_create (win, data->call_setup_parameter->redialTime, (T_MFW_CB)sat_call_setup_tim_cb);
369 tim_start (data->redial_tim);
370 }
371 else
372 {
373 data->redial_tim = NULL; /* timer not used */
374 }
375
376 /* destroying will be done in response to SAT_CALL_END */
377 SEND_EVENT(data->parent_win, SAT_CALL_END, 0, NULL); // Marcus: Issue 1812: 13/03/2003
378 break;
379 case INFO_KCD_RIGHT: /* the user has rejected the call setup */
380 TRACE_EVENT("sat_call_setup_cb(): User rejected call setup");
381 satReject();
382 data->redial_tim = NULL; /* timer not used */
383 SEND_EVENT(data->parent_win, SAT_CALL_END, 0, NULL); /* inform the parent who will take care of destroying */
384 break;
385 default:
386 break;
387 }
388 }
389
390 /*******************************************************************************
391
392 $Function: sat_call_setup_tim_cb
393
394 $Description: Callback function for the redial timer.
395
396 $Returns: Execution status
397
398 $Arguments: event - window event
399 tc - timer info
400
401 *******************************************************************************/
402 static int sat_call_setup_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc)
403 {
404 T_MFW_HND win = mfw_parent (mfw_header());
405 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
406 T_sat_call_setup * data = (T_sat_call_setup *)win_data->user;
407
408 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL))
409 return MFW_EVENT_CONSUMED;
410
411 data->redial_tim = NULL; /* timer has elapsed */
412 return MFW_EVENT_CONSUMED;
413 }