comparison g23m/condat/ms/src/bmi/mmiSatCall.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544
32 Description: 27.22.4.13.3 SET UP CALL (display of icons) fails.
33 Solution: In the function sat_call_setup_exec() copied the icon data in to display_info structure
34 inorder to display on the call screen during SAT call setup.
35
36 25/10/00 Original Condat(UK) BMI version.
37 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed()
38
39 $End
40
41 *******************************************************************************/
42
43 #define ENTITY_MFW
44
45 /* includes */
46 #include <string.h>
47 #include <stdio.h>
48 #include <stdlib.h>
49
50 #if defined (NEW_FRAME)
51
52 #include "typedefs.h"
53 #include "vsi.h"
54 #include "pei.h"
55 #include "custom.h"
56 #include "gsm.h"
57
58 #else
59
60 #include "STDDEFS.H"
61 #include "custom.h"
62 #include "gsm.h"
63 #include "vsi.h"
64
65 #endif
66 #include "mfw_sys.h"
67
68 #include "mfw_mfw.h"
69 #include "mfw_win.h"
70 #include "mfw_kbd.h"
71 /* SPR#1428 - SH - New Editor changes */
72 #ifndef NEW_EDITOR
73 #include "mfw_edt.h"
74 #endif
75 #include "mfw_lng.h"
76 #include "mfw_icn.h"
77 #include "mfw_phb.h"
78 #include "mfw_sim.h"
79 #include "mfw_nm.h"
80 #include "mfw_sms.h"
81 #include "mfw_mnu.h"
82 #include "mfw_sat.h"
83 #include "mfw_tim.h"
84
85 #include "dspl.h"
86
87 #include "MmiMmi.h"
88 #include "MmiDummy.h"
89 #include "MmiDialogs.h"
90 #include "MmiLists.h"
91
92 #include "MmiMain.h"
93 #include "MmiStart.h"
94 #include "MmiPins.h"
95 #include "MmiMenu.h"
96 #include "MmiSoftKeys.h"
97 #include "MmiSounds.h"
98 #include "mmiCall.h"
99
100 #include "mmiSat_i.h"
101
102 #include "cus_aci.h"
103 #include "prim.h"
104 #ifndef PCM_2_FFS
105 #include "pcm.h"
106 #endif
107
108
109 #include "mmiColours.h"
110
111 /*********************************************************************
112 *
113 * SUB WINDOW SAT_CALL_SETUP
114 *
115 *********************************************************************/
116 typedef struct
117 {
118 T_MMI_CONTROL mmi_control;
119 T_MFW_HND parent_win;
120 T_MFW_HND win;
121 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */
122 T_SAT_call_setup_parameter * call_setup_parameter;
123 T_MFW_HND redial_tim;
124 } T_sat_call_setup;
125
126 extern BOOL sat_call_active; // Marcus: Issue 1812: 13/03/2003
127 // ADDED BY RAVI - 29-11-2005
128 extern UBYTE get_sat_redial_flag(void);
129 extern void set_sat_redial_flag(UBYTE flag);
130 // END RAVI - 29-11-2005
131
132 static void sat_call_setup_destroy (T_MFW_HND own_window);
133 static void sat_call_setup_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_call_setup_parameter * call_setup_parameter);
134 static void sat_call_setup_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
135 static int sat_call_setup_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc);
136
137 /*******************************************************************************
138
139 $Function: sat_call_setup_create
140
141 $Description: Creation of an instance for the SAT CALL dialog.Window must be
142 available after reception of SAT command only one instance.
143
144 $Returns: mfw window handler
145
146 $Arguments: parent_window - Parent window handler
147
148 *******************************************************************************/
149 T_MFW_HND sat_call_setup_create (T_MFW_HND parent_window)
150 {
151 T_sat_call_setup * data = (T_sat_call_setup *)ALLOC_MEMORY (sizeof (T_sat_call_setup));
152 T_MFW_WIN * win;
153
154 data->win = win_create (parent_window, 0, 0,NULL);
155 sat_set_call_setup_win(data->win);
156
157 if (data->win EQ NULL)
158 return NULL;
159
160 /*
161 * Create window handler
162 */
163 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_call_setup_exec;
164 data->mmi_control.data = data;
165 data->parent_win = parent_window;
166 win = ((T_MFW_HDR *)data->win)->data;
167 win->user = (MfwUserDataPtr)data;
168
169 /*
170 * return window handle
171 */
172 winShow(data->win);
173 return data->win;
174 }
175
176 /*******************************************************************************
177
178 $Function: sat_call_setup_destroy
179
180 $Description: Destroy the sat call dialog.
181
182 $Returns: none
183
184 $Arguments: own_window - Current window
185
186 *******************************************************************************/
187 static void sat_call_setup_destroy (T_MFW_HND own_window)
188 {
189 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data;
190 T_sat_call_setup * data = (T_sat_call_setup *)win_data->user;
191
192 if (own_window == NULL)
193 {
194 TRACE_EVENT ("Error : sat_call_setup_destroy called with NULL Pointer");
195 return;
196 }
197
198 if (data)
199 {
200 /*
201 * Delete WIN Handler
202 */
203 win_delete (data->win);
204 /*
205 * Free Memory
206 */
207 FREE_MEMORY ((void *)data, sizeof (T_sat_call_setup));
208 sat_set_call_setup_win(NULL);
209 }
210 }
211
212 /*******************************************************************************
213
214 $Function: sat_call_setup_exec
215
216 $Description: Dialog function for sat_call_setup_exec window.
217
218 $Returns: none
219
220 $Arguments: win - current window
221 event - window event
222 value - unique id
223 call_setup_parameter - call setup info
224
225 *******************************************************************************/
226 static void sat_call_setup_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_call_setup_parameter * call_setup_parameter)
227 {
228
229 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
230 T_sat_call_setup * data = (T_sat_call_setup *)win_data->user;
231
232 T_DISPLAY_DATA display_info;
233
234 TRACE_FUNCTION ("sat_call_setup_exec()");
235
236 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL))
237 return;
238
239 switch (event)
240 {
241 case SAT_CALL_ALERT:
242
243 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_ALERT");
244
245 /* start an info screen to accept or reject the call setup */
246 data->call_setup_parameter = call_setup_parameter;
247
248 /* SPR#1700 - DS - Modified so SAT will not display "Setup call?" if the first alpha id has been supplied by the SIM
249 */
250
251 if (call_setup_parameter->TextString) /* Alpha id supplied by SIM */
252 {
253 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, call_setup_parameter->TextString, NULL, COLOUR_STATUS);
254 //x0035544 Feb 07, 2006 DR:OMAPS00061467
255 #ifdef FF_MMI_SAT_ICON
256 if(call_setup_parameter->IconInfo.dst != NULL)
257 {
258 display_info.IconData.width = call_setup_parameter->IconInfo.width;
259 display_info.IconData.height = call_setup_parameter->IconInfo.height;
260 display_info.IconData.dst = call_setup_parameter->IconInfo.dst;
261 display_info.IconData.selfExplanatory = call_setup_parameter->IconInfo.selfExplanatory;
262 }
263 #endif
264
265 }
266
267 else /* No alpha id supplied so show "Setup call?" */
268 {
269 //x0035544 Mar 14, 2006 DR:OMAPS00061467
270 //added missing '?' to the string "Setup call" as below
271 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, "Setup call?", NULL, COLOUR_STATUS);
272 }
273 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_call_setup_cb, FOREVER, KEY_LEFT|KEY_RIGHT );
274
275
276 display_info.Identifier = event;
277 /*
278 * Call Info Screen
279 */
280 info_dialog (win, &display_info);
281 break;
282
283 case SAT_CALL_REDIAL:
284 /* attempt a redial if the timer has not yet elapsed */
285 /* if redial is not commanded by SAT_CALL_ALERT the timer will be NULL (see sat_call_setup_cb()) */
286 /* if the timer has already elapsed it is set to NULL (see sat_call_setup_tim_cb()) */
287
288 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_REDIAL");
289
290 if ((data->redial_tim NEQ NULL) || (call_setup_parameter->redialTime EQ FOREVER))
291
292 {
293 // ??? rsa according to ES we shall use a satAccept() at this point (but it returns an error)
294 if (!call_get_window())
295 call_create(0);
296 SEND_EVENT(call_get_window(),CALL_OUTGOING_SAT,0,call_setup_parameter);
297 }
298 else
299 {
300 SEND_EVENT(data->parent_win, SAT_CALL_END, 0, NULL); /* inform the parent */
301 }
302 break;
303
304 case SAT_CALL_END:
305
306 TRACE_EVENT("sat_call_setup_exec(): SAT_CALL_END");
307
308 /* SPR#1784 - DS - If call was a 'with redial' call, send a call reject to the SIM.
309 */
310 if (get_sat_redial_flag() == 1)
311 {
312 satReject();
313
314 /* Reset the satWithRedial flag */
315 set_sat_redial_flag(0);
316 }
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 }