comparison src/ui/bmi/mmiSatInput.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children 6b740edabc07
comparison
equal deleted inserted replaced
91:c3d28a37caad 92:c0052fe355d3
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 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. 8 disclosed to any third party without the express permission of the owner.
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI 13 $Project code: BMI
14 $Module: SMS 14 $Module: SMS
15 $File: mmiSatInput.c 15 $File: mmiSatInput.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 25/10/00 19 $Date: 25/10/00
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
25 Implementation of MMI SIM Application Toolkit (SAT) 25 Implementation of MMI SIM Application Toolkit (SAT)
26 26
27 ******************************************************************************** 27 ********************************************************************************
28 28
29 $History: mmiSatInput.c 29 $History: mmiSatInput.c
30 30
31 Oct 09, 2006 DR: OMAPS00092083 - x0047075 (Archana). 31 Oct 09, 2006 DR: OMAPS00092083 - x0047075 (Archana).
32 Description: CT-PTCRB[27.22.4.1.5]-MS Resets while Icon Display 32 Description: CT-PTCRB[27.22.4.1.5]-MS Resets while Icon Display
33 Solution : If the sat icon is present which is self explanatory then editor buffer is intialized to blank. 33 Solution : If the sat icon is present which is self explanatory then editor buffer is intialized to blank.
34 34
35 Feb 02, 2006 DR: OMAPS00061468 - x0035544. 35 Feb 02, 2006 DR: OMAPS00061468 - x0035544.
36 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails 36 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails
37 Solution : SAT SET UP IDLE MODE TEXT (Icon) support added. 37 Solution : SAT SET UP IDLE MODE TEXT (Icon) support added.
38 38
39 Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S. 39 Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S.
40 Description: SAT Icon support 40 Description: SAT Icon support
41 Solution : SAT icon support added. 41 Solution : SAT icon support added.
42 42
43 Nov 09, 2005 REF: OMAPS00043190 - x0018858 43 Nov 09, 2005 REF: OMAPS00043190 - x0018858
44 Description: PTCRB - 27.22.4.1.4 (DISPLAY TEXT (Sustained text) Fails in 1900 DISPLAY TEXT 44 Description: PTCRB - 27.22.4.1.4 (DISPLAY TEXT (Sustained text) Fails in 1900 DISPLAY TEXT
45 (Sustained text) 45 (Sustained text)
46 Solution: Have added a new global variable to store the handle of the window and then release 46 Solution: Have added a new global variable to store the handle of the window and then release
47 it when a higher priority call event comes in. 47 it when a higher priority call event comes in.
48 48
49 a0876501 (Shashi Shekar B.S.) 03-Oct-2005 MMI-SPR-34554: 49 a0876501 (Shashi Shekar B.S.) 03-Oct-2005 MMI-SPR-34554:
50 Terminal Response for Get Inkey (Yes/No) response correctly sent now. 50 Terminal Response for Get Inkey (Yes/No) response correctly sent now.
51 51
52 25/10/00 Original Condat(UK) BMI version. 52 25/10/00 Original Condat(UK) BMI version.
53 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed() 53 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed()
54 $End 54 $End
55 55
56 *******************************************************************************/ 56 *******************************************************************************/
57 57
58 #define ENTITY_MFW 58 #define ENTITY_MFW
138 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT event); 138 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT event);
139 #else /* NEW_EDITOR */ 139 #else /* NEW_EDITOR */
140 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, USHORT event); 140 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, USHORT event);
141 #endif /* NEW_EDITOR */ 141 #endif /* NEW_EDITOR */
142 142
143 #ifdef EASY_TEXT_ENABLED 143 #ifdef EASY_TEXT_ENABLED
144 #include "MmiChineseInput.h" /* SPR#1700 - DS - Added to implement Chinese Editor support in SAT */ 144 #include "MmiChineseInput.h" /* SPR#1700 - DS - Added to implement Chinese Editor support in SAT */
145 #endif 145 #endif
146 146
147 #define TRACE_SAT_STRING /* SPR#1700 - DS - Debug flag for tracing SAT String */ 147 #define TRACE_SAT_STRING /* SPR#1700 - DS - Debug flag for tracing SAT String */
148 148
161 #ifdef NEW_EDITOR 161 #ifdef NEW_EDITOR
162 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 162 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
163 #else 163 #else
164 T_EDITOR_DATA editor_data; 164 T_EDITOR_DATA editor_data;
165 #endif 165 #endif
166 char *edt_buffer; /* buffer for editor */ 166 char *edt_buffer; /* buffer for editor */
167 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ 167 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */
168 T_MFW_HND win_editor; /* SPR#2490 - DS - Store editor window */ 168 T_MFW_HND win_editor; /* SPR#2490 - DS - Store editor window */
169 } T_sat_get_key; 169 } T_sat_get_key;
170 170
171 #if (BOARD==61) 171 #if (BOARD==61)
172 // ADDED BY RAVI - 29-11-2005 - OMAPS00042166 172 // ADDED BY RAVI - 29-11-2005 - OMAPS00042166
173 extern void sat_add_unicode_tag_if_needed(char* string); 173 extern void sat_add_unicode_tag_if_needed(char* string);
179 179
180 /******************************************************************************* 180 /*******************************************************************************
181 181
182 $Function: sat_get_key_create 182 $Function: sat_get_key_create
183 183
184 $Description: Creation of an instance for the SAT GET KEY dialog.Window must 184 $Description: Creation of an instance for the SAT GET KEY dialog.Window must
185 be available after reception of SAT command,only one instance. 185 be available after reception of SAT command,only one instance.
186 186
187 187
188 $Returns: mfw window handler 188 $Returns: mfw window handler
189 189
190 $Arguments: parent_window - Parent window handler 190 $Arguments: parent_window - Parent window handler
191 191
192 *******************************************************************************/ 192 *******************************************************************************/
193 193
194 T_MFW_HND sat_get_key_create (T_MFW_HND parent_window) 194 T_MFW_HND sat_get_key_create (T_MFW_HND parent_window)
195 { 195 {
196 T_sat_get_key * data = (T_sat_get_key *)ALLOC_MEMORY (sizeof (T_sat_get_key)); 196 T_sat_get_key * data = (T_sat_get_key *)ALLOC_MEMORY (sizeof (T_sat_get_key));
208 data->mmi_control.data = data; 208 data->mmi_control.data = data;
209 win = ((T_MFW_HDR *)data->win)->data; 209 win = ((T_MFW_HDR *)data->win)->data;
210 win->user = (MfwUserDataPtr)data; 210 win->user = (MfwUserDataPtr)data;
211 211
212 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ 212 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */
213 213
214 /* 214 /*
215 * return window handle 215 * return window handle
216 */ 216 */
217 win_show(data->win); 217 win_show(data->win);
218 return data->win; 218 return data->win;
222 222
223 $Function: sat_get_key_destroy 223 $Function: sat_get_key_destroy
224 224
225 $Description: Destroy the sat get inkey dialog. 225 $Description: Destroy the sat get inkey dialog.
226 226
227 227
228 $Returns: none 228 $Returns: none
229 229
230 $Arguments: own_window - window handler 230 $Arguments: own_window - window handler
231 231
232 *******************************************************************************/ 232 *******************************************************************************/
233 233
234 static void sat_get_key_destroy (T_MFW_HND own_window) 234 static void sat_get_key_destroy (T_MFW_HND own_window)
235 { 235 {
236 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; 236 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data;
256 256
257 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 257 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460
258 #ifdef FF_MMI_SAT_ICON 258 #ifdef FF_MMI_SAT_ICON
259 if (data->editor_data.editor_attr.TitleIcon.data != NULL) 259 if (data->editor_data.editor_attr.TitleIcon.data != NULL)
260 { 260 {
261 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width * 261 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width *
262 data->editor_data.editor_attr.TitleIcon.height); 262 data->editor_data.editor_attr.TitleIcon.height);
263 data->editor_data.editor_attr.TitleIcon.data = NULL; 263 data->editor_data.editor_attr.TitleIcon.data = NULL;
264 } 264 }
265 #endif 265 #endif
266 /* SPR#1428 - SH - New Editor changes */ 266 /* SPR#1428 - SH - New Editor changes */
267 #ifdef NEW_EDITOR 267 #ifdef NEW_EDITOR
268 sat_destroy_TEXT_ASCIIZ ((char *)data->editor_data.TitleString); /* label */ 268 sat_destroy_TEXT_ASCIIZ ((char *)data->editor_data.TitleString); /* label */
269 269
270 if (data->win_editor) 270 if (data->win_editor)
283 283
284 $Function: sat_get_key_exec 284 $Function: sat_get_key_exec
285 285
286 $Description: Dialog function for sat_get_key_exec window. 286 $Description: Dialog function for sat_get_key_exec window.
287 287
288 288
289 $Returns: none 289 $Returns: none
290 290
291 $Arguments: win - window handler 291 $Arguments: win - window handler
292 event -window event 292 event -window event
293 value - unique id 293 value - unique id
294 sat_command - Sat command info 294 sat_command - Sat command info
295 295
296 *******************************************************************************/ 296 *******************************************************************************/
297 297
298 static void sat_get_key_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) 298 static void sat_get_key_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command)
299 { 299 {
300 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 300 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
327 SAT_GET_KEY_BUFFER_SIZE * sizeof(char)); 327 SAT_GET_KEY_BUFFER_SIZE * sizeof(char));
328 328
329 /* SPR#1428 - SH - New Editor changes */ 329 /* SPR#1428 - SH - New Editor changes */
330 #ifdef NEW_EDITOR 330 #ifdef NEW_EDITOR
331 /* 331 /*
332 * Setup an Editor to get a single key 332 * Setup an Editor to get a single key
333 */ 333 */
334 334
335 AUI_edit_SetDefault(&data->editor_data); 335 AUI_edit_SetDefault(&data->editor_data);
336 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); 336 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT);
337 337
338 /* SPR#2490 - DS - Initialise editor window reference */ 338 /* SPR#2490 - DS - Initialise editor window reference */
339 data->win_editor = NULL; 339 data->win_editor = NULL;
340 340
341 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0) 341 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0)
342 { 342 {
343 leftSK = TxtHelp; /* help available */ 343 leftSK = TxtHelp; /* help available */
344 } 344 }
345 else 345 else
351 /* yes/no decision */ 351 /* yes/no decision */
352 leftSK = TxtYes; 352 leftSK = TxtYes;
353 rightSK = TxtNo; 353 rightSK = TxtNo;
354 mode = ED_MODE_READONLY; /* treat as read-only, thus ignoring normal keys */ 354 mode = ED_MODE_READONLY; /* treat as read-only, thus ignoring normal keys */
355 cursor = ED_CURSOR_NONE; 355 cursor = ED_CURSOR_NONE;
356 } 356 }
357 else 357 else
358 { 358 {
359 /* normal single key request */ 359 /* normal single key request */
360 leftSK = TxtSoftOK; 360 leftSK = TxtSoftOK;
361 rightSK = TxtSoftBack; 361 rightSK = TxtSoftBack;
362 if ((sat_command->qual & SAT_M_INKEY_ALPHA) EQ 0) /* 0=digits, 1=alpha */ 362 if ((sat_command->qual & SAT_M_INKEY_ALPHA) EQ 0) /* 0=digits, 1=alpha */
380 { 380 {
381 textStr = NULL; /* no label */ 381 textStr = NULL; /* no label */
382 } 382 }
383 383
384 AUI_edit_SetTextStr(&data->editor_data, leftSK, rightSK, TxtNull, textStr); 384 AUI_edit_SetTextStr(&data->editor_data, leftSK, rightSK, TxtNull, textStr);
385 385
386 AUI_edit_SetEvents(&data->editor_data, event, FALSE /*SPR#2490 - DS*/, TWENTY_SECS, (T_AUI_EDIT_CB)sat_editor_cb); 386 AUI_edit_SetEvents(&data->editor_data, event, FALSE /*SPR#2490 - DS*/, TWENTY_SECS, (T_AUI_EDIT_CB)sat_editor_cb);
387 AUI_edit_SetMode(&data->editor_data, mode, cursor); 387 AUI_edit_SetMode(&data->editor_data, mode, cursor);
388 388
389 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0) 389 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0)
390 { 390 {
391 AUI_edit_SetAltTextStr(&data->editor_data, 1, TxtHelp, FALSE, TxtNull); /* help available */ 391 AUI_edit_SetAltTextStr(&data->editor_data, 1, TxtHelp, FALSE, TxtNull); /* help available */
392 } 392 }
393 393
394 /* provide an empty zero terminated buffer */ 394 /* provide an empty zero terminated buffer */
395 data->edt_buffer[0] = '\0'; 395 data->edt_buffer[0] = '\0';
396 396
397 /* SPR#1559 - SH - Set appropriate editor size */ 397 /* SPR#1559 - SH - Set appropriate editor size */
398 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_buffer, strlen(data->edt_buffer)+1+1 /* SPR#2321 - DS - Display key */); 398 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_buffer, strlen(data->edt_buffer)+1+1 /* SPR#2321 - DS - Display key */);
399 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 399 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460
400 #ifdef FF_MMI_SAT_ICON 400 #ifdef FF_MMI_SAT_ICON
401 /*Check if the SAT command has icon*/ 401 /*Check if the SAT command has icon*/
402 if(sat_command->c.text.icon.qual != 0xFF) 402 if(sat_command->c.text.icon.qual != 0xFF)
403 { 403 {
404 /* Copy the icon data to the editor attributes*/ 404 /* Copy the icon data to the editor attributes*/
405 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.text.iconInfo.width; 405 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.text.iconInfo.width;
406 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.text.iconInfo.height; 406 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.text.iconInfo.height;
407 407
408 icon_length = sat_command->c.text.iconInfo.width * sat_command->c.text.iconInfo.height; 408 icon_length = sat_command->c.text.iconInfo.width * sat_command->c.text.iconInfo.height;
409 409
410 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length); 410 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length);
411 411
412 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.text.iconInfo.dst, icon_length); 412 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.text.iconInfo.dst, icon_length);
413 data->editor_data.editor_attr.TitleIcon.isTitle = TRUE; 413 data->editor_data.editor_attr.TitleIcon.isTitle = TRUE;
414 414
416 if(sat_command->c.text.icon.qual == 0x00) 416 if(sat_command->c.text.icon.qual == 0x00)
417 { 417 {
418 /* Icon is self-explanatory. Do not display the text*/ 418 /* Icon is self-explanatory. Do not display the text*/
419 data->editor_data.editor_attr.TitleIcon.selfExplanatory = TRUE; 419 data->editor_data.editor_attr.TitleIcon.selfExplanatory = TRUE;
420 } 420 }
421 421
422 /* Free the memory of icon data that we got through the SATK command*/ 422 /* Free the memory of icon data that we got through the SATK command*/
423 mfwFree((U8 *)sat_command->c.text.iconInfo.dst, icon_length); 423 mfwFree((U8 *)sat_command->c.text.iconInfo.dst, icon_length);
424 sat_command->c.text.iconInfo.dst = NULL; 424 sat_command->c.text.iconInfo.dst = NULL;
425 } 425 }
426 #endif 426 #endif
437 sat_done (sat_command, sat_res); 437 sat_done (sat_command, sat_res);
438 sat_get_key_destroy (data->win); 438 sat_get_key_destroy (data->win);
439 } 439 }
440 #else /* NEW_EDITOR */ 440 #else /* NEW_EDITOR */
441 /* 441 /*
442 * Setup an Editor to get a single key 442 * Setup an Editor to get a single key
443 */ 443 */
444 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0) 444 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0)
445 { 445 {
446 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */ 446 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */
447 } 447 }
453 { 453 {
454 /* yes/no decision */ 454 /* yes/no decision */
455 data->editor_data.LeftSoftKey = TxtYes; 455 data->editor_data.LeftSoftKey = TxtYes;
456 data->editor_data.RightSoftKey = TxtNo; 456 data->editor_data.RightSoftKey = TxtNo;
457 data->editor_data.mode = E_EDIT_READ_ONLY_MODE; /* treat as read-only, thus ignoring normal keys */ 457 data->editor_data.mode = E_EDIT_READ_ONLY_MODE; /* treat as read-only, thus ignoring normal keys */
458 } 458 }
459 else 459 else
460 { 460 {
461 /* normal single key request */ 461 /* normal single key request */
462 data->editor_data.LeftSoftKey = TxtSoftOK; 462 data->editor_data.LeftSoftKey = TxtSoftOK;
463 data->editor_data.RightSoftKey = TxtSoftBack; 463 data->editor_data.RightSoftKey = TxtSoftBack;
464 if ((sat_command->qual & SAT_M_INKEY_ALPHA) EQ 0) /* 0=digits, 1=alpha */ 464 if ((sat_command->qual & SAT_M_INKEY_ALPHA) EQ 0) /* 0=digits, 1=alpha */
479 else 479 else
480 { 480 {
481 data->editor_data.TextString = NULL; /* no label */ 481 data->editor_data.TextString = NULL; /* no label */
482 } 482 }
483 data->editor_data.min_enter = 0; /* get a single key */ 483 data->editor_data.min_enter = 0; /* get a single key */
484 data->editor_data.timeout = TWENTY_SECS; 484 data->editor_data.timeout = TWENTY_SECS;
485 data->editor_data.Identifier = event; 485 data->editor_data.Identifier = event;
486 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0) 486 if ((sat_command->qual & SAT_M_INKEY_HELP_AVAIL) NEQ 0)
487 { 487 {
488 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */ 488 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */
489 } 489 }
490 else 490 else
491 { 491 {
492 data->editor_data.AlternateLeftSoftKey = 0; /* no help available */ 492 data->editor_data.AlternateLeftSoftKey = 0; /* no help available */
493 } 493 }
494 data->editor_data.hide = FALSE; 494 data->editor_data.hide = FALSE;
495 495
496 496
497 /* provide an empty zero terminated buffer */ 497 /* provide an empty zero terminated buffer */
498 data->edt_buffer[0] = '\0'; 498 data->edt_buffer[0] = '\0';
499 499
500 /* 500 /*
501 * Start the Editor 501 * Start the Editor
502 */ 502 */
503 if (editor_start_common (win, data->edt_buffer, 3, &data->editor_data, (T_EDIT_CB)sat_editor_cb) == NULL) 503 if (editor_start_common (win, data->edt_buffer, 3, &data->editor_data, (T_EDIT_CB)sat_editor_cb) == NULL)
504 { 504 {
513 /* sbh - all window types are being provided with this event to destroy the window */ 513 /* sbh - all window types are being provided with this event to destroy the window */
514 case SAT_DESTROY_WINDOW: 514 case SAT_DESTROY_WINDOW:
515 sat_get_key_destroy (data->win); 515 sat_get_key_destroy (data->win);
516 break; 516 break;
517 /* ...sbh */ 517 /* ...sbh */
518 518
519 default: 519 default:
520 TRACE_EVENT ("sim_get_key_exec() unexpected event"); 520 TRACE_EVENT ("sim_get_key_exec() unexpected event");
521 break; 521 break;
522 } 522 }
523 } 523 }
536 #ifdef NEW_EDITOR 536 #ifdef NEW_EDITOR
537 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 537 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
538 #else 538 #else
539 T_EDITOR_DATA editor_data; 539 T_EDITOR_DATA editor_data;
540 #endif 540 #endif
541 char *edt_buffer; /* buffer for editor */ 541 char *edt_buffer; /* buffer for editor */
542 U16 max_chars; 542 U16 max_chars;
543 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ 543 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */
544 T_MFW_HND chinese_edit_win; /* SPR#1700 - DS - Chinese editor window reference */ 544 T_MFW_HND chinese_edit_win; /* SPR#1700 - DS - Chinese editor window reference */
545 T_MFW_HND win_editor; /* SPR#2490 - DS - Store editor window */ 545 T_MFW_HND win_editor; /* SPR#2490 - DS - Store editor window */
546 546
547 } T_sat_get_string; 547 } T_sat_get_string;
548 548
549 typedef struct { 549 typedef struct {
550 T_SAT_TXT txt; 550 T_SAT_TXT txt;
551 UBYTE buffer[1]; /* open array */ 551 UBYTE buffer[1]; /* open array */
552 } T_sat_get_string_result; /* NOTE: txt and buffer shall be packed */ 552 } T_sat_get_string_result; /* NOTE: txt and buffer shall be packed */
553 553
554 static void sat_get_string_destroy (T_MFW_HND own_window); 554 static void sat_get_string_destroy (T_MFW_HND own_window);
555 static void sat_get_string_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command); 555 static void sat_get_string_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command);
556 556
558 558
559 /******************************************************************************* 559 /*******************************************************************************
560 560
561 $Function: sat_get_string_create 561 $Function: sat_get_string_create
562 562
563 $Description: Creation of an instance for the SAT GET STRING dialog.Window must 563 $Description: Creation of an instance for the SAT GET STRING dialog.Window must
564 be available after reception of SAT command,only one instance. 564 be available after reception of SAT command,only one instance.
565 565
566 566
567 $Returns: window 567 $Returns: window
568 568
569 $Arguments: parent_window - parent window 569 $Arguments: parent_window - parent window
570 *******************************************************************************/ 570 *******************************************************************************/
571 T_MFW_HND sat_get_string_create (T_MFW_HND parent_window) 571 T_MFW_HND sat_get_string_create (T_MFW_HND parent_window)
572 { 572 {
600 600
601 $Function: sat_get_string_destroy 601 $Function: sat_get_string_destroy
602 602
603 $Description: Destroy the sat get string dialog. 603 $Description: Destroy the sat get string dialog.
604 604
605 605
606 $Returns: none 606 $Returns: none
607 607
608 $Arguments: own_window - current window. 608 $Arguments: own_window - current window.
609 *******************************************************************************/ 609 *******************************************************************************/
610 static void sat_get_string_destroy (T_MFW_HND own_window) 610 static void sat_get_string_destroy (T_MFW_HND own_window)
624 { 624 {
625 /* 625 /*
626 * Delete WIN Handler 626 * Delete WIN Handler
627 */ 627 */
628 win_delete (data->win); 628 win_delete (data->win);
629 629
630 /* 630 /*
631 * Free Memory 631 * Free Memory
632 */ 632 */
633 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */ 633 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */
634 && (data->sat_command->qual & SAT_M_INPUT_UCS2) /* Unicode input requested */ 634 && (data->sat_command->qual & SAT_M_INPUT_UCS2) /* Unicode input requested */
635 && (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)) 635 && (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE))
636 { 636 {
637 FREE_MEMORY ((U8 *)data->edt_buffer, 637 FREE_MEMORY ((U8 *)data->edt_buffer,
638 (U16)sizeof(U16) + (data->max_chars * sizeof(U16))); 638 (U16)sizeof(U16) + (data->max_chars * sizeof(U16)));
639 639
640 /* SPR#1700 - DS - Destroy Chinese editor */ 640 /* SPR#1700 - DS - Destroy Chinese editor */
641 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED) 641 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED)
642 if (data->chinese_edit_win) 642 if (data->chinese_edit_win)
653 } 653 }
654 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 654 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460
655 #ifdef FF_MMI_SAT_ICON 655 #ifdef FF_MMI_SAT_ICON
656 if (data->editor_data.editor_attr.TitleIcon.data != NULL) 656 if (data->editor_data.editor_attr.TitleIcon.data != NULL)
657 { 657 {
658 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width * 658 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width *
659 data->editor_data.editor_attr.TitleIcon.height); 659 data->editor_data.editor_attr.TitleIcon.height);
660 data->editor_data.editor_attr.TitleIcon.data = NULL; 660 data->editor_data.editor_attr.TitleIcon.data = NULL;
661 } 661 }
662 #endif 662 #endif
663 /* SPR#1428 - SH - New Editor changes */ 663 /* SPR#1428 - SH - New Editor changes */
681 681
682 $Function: sat_get_string_exec 682 $Function: sat_get_string_exec
683 683
684 $Description: Dialog function for sat_get_string window. 684 $Description: Dialog function for sat_get_string window.
685 685
686 686
687 $Returns: none 687 $Returns: none
688 688
689 $Arguments: win - window handle 689 $Arguments: win - window handle
690 event - window event 690 event - window event
691 value - unique id 691 value - unique id
716 { 716 {
717 case SAT_GET_STRING: 717 case SAT_GET_STRING:
718 718
719 /* SPR#1700 - DS - Modifed to handle Chinese/Unicode 719 /* SPR#1700 - DS - Modifed to handle Chinese/Unicode
720 */ 720 */
721 721
722 data->sat_command = sat_command; /* save a pointer to the parameter for later use in callbacks */ 722 data->sat_command = sat_command; /* save a pointer to the parameter for later use in callbacks */
723 inp = (T_SAT_INPUT *)&sat_command->c.inp; 723 inp = (T_SAT_INPUT *)&sat_command->c.inp;
724 724
725 /* SPR#2321 - DS - Max buffer size of 160 chars for SAT STRING (Get Input) */ 725 /* SPR#2321 - DS - Max buffer size of 160 chars for SAT STRING (Get Input) */
726 if ((U16)inp->rspMax > 160) 726 if ((U16)inp->rspMax > 160)
730 } 730 }
731 else 731 else
732 { 732 {
733 data->max_chars = (U16)(inp->rspMax)+1; 733 data->max_chars = (U16)(inp->rspMax)+1;
734 } 734 }
735 735
736 /* allocate a buffer to hold the edited chars + terminator */ 736 /* allocate a buffer to hold the edited chars + terminator */
737 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */ 737 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */
738 && (data->sat_command->qual & SAT_M_INPUT_UCS2) /* Unicode input requested */ 738 && (data->sat_command->qual & SAT_M_INPUT_UCS2) /* Unicode input requested */
739 && (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)) 739 && (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE))
740 { 740 {
743 } 743 }
744 else /* Ascii */ 744 else /* Ascii */
745 { 745 {
746 data->edt_buffer = (char *)ALLOC_MEMORY (data->max_chars * sizeof(char)); 746 data->edt_buffer = (char *)ALLOC_MEMORY (data->max_chars * sizeof(char));
747 } 747 }
748 748
749 #ifdef TRACE_SAT_STRING 749 #ifdef TRACE_SAT_STRING
750 TRACE_EVENT_P3("rspMax %d, max_chars %d, defRsp.code %02x", inp->rspMax, data->max_chars, inp->defRsp.code); 750 TRACE_EVENT_P3("rspMax %d, max_chars %d, defRsp.code %02x", inp->rspMax, data->max_chars, inp->defRsp.code);
751 #endif /* TRACE_SAT_STRING */ 751 #endif /* TRACE_SAT_STRING */
752 752
753 /*MC, SPR940/2 if we are a expecting unicode response. This, of course assumes we're getting the correct DCS*/ 753 /*MC, SPR940/2 if we are a expecting unicode response. This, of course assumes we're getting the correct DCS*/
761 defRsp = &inp->defRsp; 761 defRsp = &inp->defRsp;
762 firstDefRespChar = *((UBYTE*)defRsp+defRsp->text); 762 firstDefRespChar = *((UBYTE*)defRsp+defRsp->text);
763 763
764 #ifdef TRACE_SAT_STRING 764 #ifdef TRACE_SAT_STRING
765 TRACE_EVENT_P2("prompt.len %d, defRsp->len %d", inp->prompt.len, defRsp->len); 765 TRACE_EVENT_P2("prompt.len %d, defRsp->len %d", inp->prompt.len, defRsp->len);
766 #endif /* TRACE_SAT_STRING */ 766 #endif /* TRACE_SAT_STRING */
767 767
768 if (defRsp->len > 0) /* default response available? */ 768 if (defRsp->len > 0) /* default response available? */
769 { 769 {
770 if (firstDefRespChar != 0x00) 770 if (firstDefRespChar != 0x00)
771 { 771 {
772 /* provide a zero terminated buffer, initially containing the default response */ 772 /* provide a zero terminated buffer, initially containing the default response */
781 else 781 else
782 { 782 {
783 /* no default response: provide an empty buffer */ 783 /* no default response: provide an empty buffer */
784 data->edt_buffer[0] = '\0'; 784 data->edt_buffer[0] = '\0';
785 } 785 }
786 786
787 /* SPR#1428 - SH - New Editor changes */ 787 /* SPR#1428 - SH - New Editor changes */
788 #ifdef NEW_EDITOR 788 #ifdef NEW_EDITOR
789 789
790 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED) 790 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED)
791 /* If chinese is selected use the chinese editor */ 791 /* If chinese is selected use the chinese editor */
798 798
799 /* Initialise the Chinese editor window reference */ 799 /* Initialise the Chinese editor window reference */
800 data->chinese_edit_win = NULL; 800 data->chinese_edit_win = NULL;
801 801
802 TRACE_EVENT("Setup Chinese SAT String editor"); 802 TRACE_EVENT("Setup Chinese SAT String editor");
803 803
804 chinese_data.TextString = (char*) data->edt_buffer; 804 chinese_data.TextString = (char*) data->edt_buffer;
805 805
806 if (inp->prompt.len > 0) 806 if (inp->prompt.len > 0)
807 { 807 {
808 textStr = (UBYTE *)sat_create_TEXT_ASCIIZ (&inp->prompt); /* label */ 808 textStr = (UBYTE *)sat_create_TEXT_ASCIIZ (&inp->prompt); /* label */
812 } 812 }
813 else 813 else
814 { 814 {
815 textStr = NULL; /* no label */ 815 textStr = NULL; /* no label */
816 } 816 }
817 817
818 /* Setup Chinese editor data */ 818 /* Setup Chinese editor data */
819 chinese_data.Callback = (T_AUI_EDIT_CB)sat_editor_cb; 819 chinese_data.Callback = (T_AUI_EDIT_CB)sat_editor_cb;
820 chinese_data.Identifier = event; 820 chinese_data.Identifier = event;
821 chinese_data.LeftSoftKey = TxtSoftOK; 821 chinese_data.LeftSoftKey = TxtSoftOK;
822 chinese_data.DestroyEditor = FALSE; 822 chinese_data.DestroyEditor = FALSE;
825 } 825 }
826 else 826 else
827 #endif /* CHINESE_MMI && EASY_TEXT_ENABLED */ 827 #endif /* CHINESE_MMI && EASY_TEXT_ENABLED */
828 { 828 {
829 /* 829 /*
830 * Setup an Editor to get a string 830 * Setup an Editor to get a string
831 */ 831 */
832 AUI_edit_SetDefault(&data->editor_data); 832 AUI_edit_SetDefault(&data->editor_data);
833 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); 833 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT);
834 834
835 /* SPR#2490 - DS - Initialise editor window reference */ 835 /* SPR#2490 - DS - Initialise editor window reference */
836 data->win_editor = NULL; 836 data->win_editor = NULL;
837 837
838 if ((sat_command->qual & SAT_M_INPUT_HELP_AVAIL) NEQ 0) 838 if ((sat_command->qual & SAT_M_INPUT_HELP_AVAIL) NEQ 0)
839 { 839 {
840 AUI_edit_SetAltTextStr(&data->editor_data, inp->rspMin, TxtHelp, FALSE, TxtNull); /* help available */ 840 AUI_edit_SetAltTextStr(&data->editor_data, inp->rspMin, TxtHelp, FALSE, TxtNull); /* help available */
841 } 841 }
842 else 842 else
881 #ifdef FF_MMI_SAT_ICON 881 #ifdef FF_MMI_SAT_ICON
882 /*Check if the SAT command has icon*/ 882 /*Check if the SAT command has icon*/
883 if(sat_command->c.inp.prompt.icon.qual != 0xFF) 883 if(sat_command->c.inp.prompt.icon.qual != 0xFF)
884 { 884 {
885 /* Copy the icon data to the editor attributes*/ 885 /* Copy the icon data to the editor attributes*/
886 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.inp.prompt.iconInfo.width; 886 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.inp.prompt.iconInfo.width;
887 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.inp.prompt.iconInfo.height; 887 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.inp.prompt.iconInfo.height;
888 888
889 icon_length = sat_command->c.inp.prompt.iconInfo.width * sat_command->c.inp.prompt.iconInfo.height; 889 icon_length = sat_command->c.inp.prompt.iconInfo.width * sat_command->c.inp.prompt.iconInfo.height;
890 890
891 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length); 891 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length);
892 892
893 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.inp.prompt.iconInfo.dst, icon_length); 893 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.inp.prompt.iconInfo.dst, icon_length);
894 data->editor_data.editor_attr.TitleIcon.isTitle = TRUE; 894 data->editor_data.editor_attr.TitleIcon.isTitle = TRUE;
895 895
902 /* Free the memory of icon data that we got through the SATK command*/ 902 /* Free the memory of icon data that we got through the SATK command*/
903 mfwFree((U8 *)sat_command->c.inp.prompt.iconInfo.dst, icon_length); 903 mfwFree((U8 *)sat_command->c.inp.prompt.iconInfo.dst, icon_length);
904 sat_command->c.inp.prompt.iconInfo.dst = NULL; 904 sat_command->c.inp.prompt.iconInfo.dst = NULL;
905 } 905 }
906 #endif 906 #endif
907 907
908 /* 908 /*
909 * Start the Editor 909 * Start the Editor
910 */ 910 */
911 /* SPR#2490 - DS - Store editor window reference */ 911 /* SPR#2490 - DS - Store editor window reference */
912 data->win_editor = AUI_edit_Start(win, &data->editor_data); 912 data->win_editor = AUI_edit_Start(win, &data->editor_data);
918 sat_get_string_destroy (data->win); 918 sat_get_string_destroy (data->win);
919 } 919 }
920 } 920 }
921 #else /* NEW_EDITOR */ 921 #else /* NEW_EDITOR */
922 /* 922 /*
923 * Setup an Editor to get a string 923 * Setup an Editor to get a string
924 */ 924 */
925 data->editor_data.LeftSoftKey = TxtSoftOK; 925 data->editor_data.LeftSoftKey = TxtSoftOK;
926 if ((sat_command->qual & SAT_M_INPUT_HELP_AVAIL) NEQ 0) 926 if ((sat_command->qual & SAT_M_INPUT_HELP_AVAIL) NEQ 0)
927 { 927 {
928 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */ 928 data->editor_data.AlternateLeftSoftKey = TxtHelp; /* help available */
950 else 950 else
951 { 951 {
952 data->editor_data.TextString = NULL; /* no label */ 952 data->editor_data.TextString = NULL; /* no label */
953 } 953 }
954 data->editor_data.min_enter = inp->rspMin; 954 data->editor_data.min_enter = inp->rspMin;
955 data->editor_data.timeout = TWENTY_SECS; 955 data->editor_data.timeout = TWENTY_SECS;
956 data->editor_data.Identifier = event; 956 data->editor_data.Identifier = event;
957 957
958 /* 958 /*
959 * Start the Editor 959 * Start the Editor
960 */ 960 */
961 if (editor_start_common (win, data->edt_buffer, data->max_chars, &data->editor_data, (T_EDIT_CB)sat_editor_cb) == NULL) 961 if (editor_start_common (win, data->edt_buffer, data->max_chars, &data->editor_data, (T_EDIT_CB)sat_editor_cb) == NULL)
962 { 962 {
969 break; 969 break;
970 970
971 /* sbh - all window types are being provided with this event to destroy the window */ 971 /* sbh - all window types are being provided with this event to destroy the window */
972 case SAT_DESTROY_WINDOW: 972 case SAT_DESTROY_WINDOW:
973 973
974 TRACE_EVENT("SAT_DESTROY_WINDOW"); 974 TRACE_EVENT("SAT_DESTROY_WINDOW");
975 975
976 if (data->win) 976 if (data->win)
977 { 977 {
978 sat_get_string_destroy (data->win); 978 sat_get_string_destroy (data->win);
979 data->win = NULL; 979 data->win = NULL;
980 } 980 }
981 break; 981 break;
982 /* ...sbh */ 982 /* ...sbh */
983 983
984 default: 984 default:
985 TRACE_EVENT ("sat_get_string_exec() unexpected event"); 985 TRACE_EVENT ("sat_get_string_exec() unexpected event");
986 break; 986 break;
987 } 987 }
988 } 988 }
1000 #ifdef NEW_EDITOR 1000 #ifdef NEW_EDITOR
1001 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 1001 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
1002 #else 1002 #else
1003 T_EDITOR_DATA editor_data; 1003 T_EDITOR_DATA editor_data;
1004 #endif 1004 #endif
1005 char *info_buffer; /* buffer for info */ 1005 char *info_buffer; /* buffer for info */
1006 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ 1006 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */
1007 } T_sat_display_text; 1007 } T_sat_display_text;
1008 1008
1009 //Nov 09, 2005 REF: OMAPS00043190 - x0018858 1009 //Nov 09, 2005 REF: OMAPS00043190 - x0018858
1010 // Added a globale variable to store the handle since it will not be possible to add structure elements 1010 // Added a globale variable to store the handle since it will not be possible to add structure elements
1011 // for all type of windows 1011 // for all type of windows
1012 T_MFW_HND satDisplayTextWin = NULL; 1012 T_MFW_HND satDisplayTextWin = NULL;
1013 1013
1014 static void sat_display_text_destroy (T_MFW_HND own_window); 1014 static void sat_display_text_destroy (T_MFW_HND own_window);
1015 static void sat_display_text_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command); 1015 static void sat_display_text_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command);
1016 1016
1017 /******************************************************************************* 1017 /*******************************************************************************
1018 1018
1019 $Function: sat_display_text_create 1019 $Function: sat_display_text_create
1020 1020
1021 $Description: Creation of an instance for the SAT DISPLAY TEXT dialog.Window 1021 $Description: Creation of an instance for the SAT DISPLAY TEXT dialog.Window
1022 must be available after reception of SAT command,only one instance. 1022 must be available after reception of SAT command,only one instance.
1023 1023
1024 $Returns: Window handle 1024 $Returns: Window handle
1025 1025
1026 $Arguments: parent_window - parent window 1026 $Arguments: parent_window - parent window
1045 data->mmi_control.data = data; 1045 data->mmi_control.data = data;
1046 win = ((T_MFW_HDR *)data->win)->data; 1046 win = ((T_MFW_HDR *)data->win)->data;
1047 win->user = (MfwUserDataPtr)data; 1047 win->user = (MfwUserDataPtr)data;
1048 1048
1049 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ 1049 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */
1050 1050
1051 /* 1051 /*
1052 * return window handle 1052 * return window handle
1053 */ 1053 */
1054 win_show(data->win); 1054 win_show(data->win);
1055 1055
1089 */ 1089 */
1090 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 1090 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460
1091 #ifdef FF_MMI_SAT_ICON 1091 #ifdef FF_MMI_SAT_ICON
1092 if (data->editor_data.editor_attr.TitleIcon.data != NULL) 1092 if (data->editor_data.editor_attr.TitleIcon.data != NULL)
1093 { 1093 {
1094 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width * 1094 FREE_MEMORY((U8 *)data->editor_data.editor_attr.TitleIcon.data, data->editor_data.editor_attr.TitleIcon.width *
1095 data->editor_data.editor_attr.TitleIcon.height); 1095 data->editor_data.editor_attr.TitleIcon.height);
1096 data->editor_data.editor_attr.TitleIcon.data = NULL; 1096 data->editor_data.editor_attr.TitleIcon.data = NULL;
1097 } 1097 }
1098 #endif 1098 #endif
1099 1099
1100 sat_destroy_TEXT_ASCIIZ (data->info_buffer); /* displayed text */ 1100 sat_destroy_TEXT_ASCIIZ (data->info_buffer); /* displayed text */
1101 FREE_MEMORY ((U8 *)data, sizeof (T_sat_display_text)); 1101 FREE_MEMORY ((U8 *)data, sizeof (T_sat_display_text));
1102 } 1102 }
1103 } 1103 }
1104 1104
1137 data->sat_command = sat_command; 1137 data->sat_command = sat_command;
1138 1138
1139 /* SPR#1428 - SH - New Editor changes */ 1139 /* SPR#1428 - SH - New Editor changes */
1140 #ifdef NEW_EDITOR 1140 #ifdef NEW_EDITOR
1141 /* 1141 /*
1142 * Setup an Editor to display a string 1142 * Setup an Editor to display a string
1143 */ 1143 */
1144 AUI_edit_SetDefault(&data->editor_data); 1144 AUI_edit_SetDefault(&data->editor_data);
1145 /* SPR#1559 - SH - Now use ZONE_FULLSOFTKEYS */ 1145 /* SPR#1559 - SH - Now use ZONE_FULLSOFTKEYS */
1146 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULLSOFTKEYS, COLOUR_EDITOR, EDITOR_FONT); 1146 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULLSOFTKEYS, COLOUR_EDITOR, EDITOR_FONT);
1147 AUI_edit_SetTextStr(&data->editor_data, TxtSoftOK, TxtSoftBack, TxtNull, NULL); 1147 AUI_edit_SetTextStr(&data->editor_data, TxtSoftOK, TxtSoftBack, TxtNull, NULL);
1148 1148
1149 AUI_edit_SetMode(&data->editor_data, ED_MODE_READONLY, ED_CURSOR_NONE); 1149 AUI_edit_SetMode(&data->editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
1150 1150
1151 if ((data->sat_command->qual & SAT_M_TEXT_WAIT) NEQ 0) 1151 if ((data->sat_command->qual & SAT_M_TEXT_WAIT) NEQ 0)
1152 { 1152 {
1153 AUI_edit_SetEvents(&data->editor_data, SAT_DISPLAY_TEXT_WAIT, TRUE, TWO_MIN, (T_AUI_EDIT_CB)sat_editor_cb); 1153 AUI_edit_SetEvents(&data->editor_data, SAT_DISPLAY_TEXT_WAIT, TRUE, TWO_MIN, (T_AUI_EDIT_CB)sat_editor_cb);
1154 } 1154 }
1155 else 1155 else
1164 { 1164 {
1165 /* Icon is self-explanatory. No need to display text for this case.*/ 1165 /* Icon is self-explanatory. No need to display text for this case.*/
1166 if(sat_command->c.text.icon.qual == 0x00) 1166 if(sat_command->c.text.icon.qual == 0x00)
1167 { 1167 {
1168 /* Icon is self-explanatory. Do not display the text. 1168 /* Icon is self-explanatory. Do not display the text.
1169 Only for SAT commands that use ATB editor directly, 1169 Only for SAT commands that use ATB editor directly,
1170 we pass NULL as the text string, i.e., there is no Title string. 1170 we pass NULL as the text string, i.e., there is no Title string.
1171 The string is embedded as part of ATB string in these cases. 1171 The string is embedded as part of ATB string in these cases.
1172 For commands using AUI editor for Title string display, 1172 For commands using AUI editor for Title string display,
1173 we pass the string & it is not displayed based on 'selfExplanatory' flag. 1173 we pass the string & it is not displayed based on 'selfExplanatory' flag.
1174 */ 1174 */
1178 else 1178 else
1179 /* provide a buffer, containing the string to be displayed */ 1179 /* provide a buffer, containing the string to be displayed */
1180 data->info_buffer = sat_create_TEXT_ASCIIZ (&sat_command->c.text); 1180 data->info_buffer = sat_create_TEXT_ASCIIZ (&sat_command->c.text);
1181 1181
1182 /* Copy the icon data to the editor*/ 1182 /* Copy the icon data to the editor*/
1183 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.text.iconInfo.width; 1183 data->editor_data.editor_attr.TitleIcon.width = sat_command->c.text.iconInfo.width;
1184 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.text.iconInfo.height; 1184 data->editor_data.editor_attr.TitleIcon.height = sat_command->c.text.iconInfo.height;
1185 1185
1186 icon_length = sat_command->c.inp.prompt.iconInfo.width * sat_command->c.inp.prompt.iconInfo.height; 1186 icon_length = sat_command->c.inp.prompt.iconInfo.width * sat_command->c.inp.prompt.iconInfo.height;
1187 1187
1188 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length); 1188 data->editor_data.editor_attr.TitleIcon.data = (char *)ALLOC_MEMORY (icon_length);
1189 1189
1190 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.inp.prompt.iconInfo.dst, icon_length); 1190 memcpy(data->editor_data.editor_attr.TitleIcon.data, sat_command->c.inp.prompt.iconInfo.dst, icon_length);
1191 data->editor_data.editor_attr.TitleIcon.isTitle = FALSE; 1191 data->editor_data.editor_attr.TitleIcon.isTitle = FALSE;
1192 data->editor_data.editor_attr.TitleIcon.display_type = SAT_ICON_DISPLAY_TEXT; 1192 data->editor_data.editor_attr.TitleIcon.display_type = SAT_ICON_DISPLAY_TEXT;
1206 #endif 1206 #endif
1207 1207
1208 #if 0 /* SPR#2340 - DS - Trace out buffer contents */ 1208 #if 0 /* SPR#2340 - DS - Trace out buffer contents */
1209 for (i=0; i<sat_command->c.text.len+2+2 /* include tag+whole string+terminator */; i++) 1209 for (i=0; i<sat_command->c.text.len+2+2 /* include tag+whole string+terminator */; i++)
1210 TRACE_EVENT_P2("SAT info_buffer[%d]: 0x%02x", i, data->info_buffer[i]); 1210 TRACE_EVENT_P2("SAT info_buffer[%d]: 0x%02x", i, data->info_buffer[i]);
1211 #endif 1211 #endif
1212 1212
1213 /* 1213 /*
1214 * Start the Editor 1214 * Start the Editor
1215 */ 1215 */
1216 1216
1217 /* SPR#1559 - SH - Check for unicode strings */ 1217 /* SPR#1559 - SH - Check for unicode strings */
1218 1218
1219 /*Oct 09, 2006 DRT: OMAPS00092083 - x0047075(Archana) 1219 /*Oct 09, 2006 DRT: OMAPS00092083 - x0047075(Archana)
1220 Descrption:CT-PTCRB[27.22.4.1.5]-MS Resets while Icon Display 1220 Descrption:CT-PTCRB[27.22.4.1.5]-MS Resets while Icon Display
1221 Solution : If the sat icon is present which is self explanatory then editor buffer is intialized to blank.*/ 1221 Solution : If the sat icon is present which is self explanatory then editor buffer is intialized to blank.*/
1222 if(data->info_buffer == NULL) 1222 if(data->info_buffer == NULL)
1223 { 1223 {
1224 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE*)"", 1); 1224 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE*)"", 1);
1225 } 1225 }
1226 else if (data->info_buffer[0]== (char)0x80) /* x0039928 - Lint warning fix */ 1226 else if (data->info_buffer[0]== (char)0x80) /* x0039928 - Lint warning fix */
1227 { 1227 {
1228 /* SPR#2340 - DS - Len is number of characters, NOT number of bytes */ 1228 /* SPR#2340 - DS - Len is number of characters, NOT number of bytes */
1229 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_UNICODE, (UBYTE *)&data->info_buffer[2], ( (sat_command->c.text.len)/2+1 )); 1229 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_UNICODE, (UBYTE *)&data->info_buffer[2], ( (sat_command->c.text.len)/2+1 ));
1230 } 1230 }
1233 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->info_buffer, sat_command->c.text.len+1); 1233 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->info_buffer, sat_command->c.text.len+1);
1234 } 1234 }
1235 1235
1236 TRACE_EVENT_P2("Editor len: %d, size: %d", data->editor_data.editor_attr.text.len, data->editor_data.editor_attr.size); 1236 TRACE_EVENT_P2("Editor len: %d, size: %d", data->editor_data.editor_attr.text.len, data->editor_data.editor_attr.size);
1237 //Nov 09, 2005 REF: OMAPS00043190 - x0018858 1237 //Nov 09, 2005 REF: OMAPS00043190 - x0018858
1238 // Store the handle of the editor in a globale variable for further use. A global variable has to be used here 1238 // Store the handle of the editor in a globale variable for further use. A global variable has to be used here
1239 // since there is no other way to access this element in the other applications. 1239 // since there is no other way to access this element in the other applications.
1240 satDisplayTextWin=AUI_edit_Start(win, &data->editor_data); 1240 satDisplayTextWin=AUI_edit_Start(win, &data->editor_data);
1241 if ( satDisplayTextWin == NULL) 1241 if ( satDisplayTextWin == NULL)
1242 { 1242 {
1243 sat_res[SAT_ERR_INDEX] = SAT_RES_IMPOSSIBLE; 1243 sat_res[SAT_ERR_INDEX] = SAT_RES_IMPOSSIBLE;
1246 sat_display_text_destroy (satDisplayTextWin); 1246 sat_display_text_destroy (satDisplayTextWin);
1247 } 1247 }
1248 break; 1248 break;
1249 #else /* NEW_EDITOR */ 1249 #else /* NEW_EDITOR */
1250 /* 1250 /*
1251 * Setup an Editor to display a string 1251 * Setup an Editor to display a string
1252 */ 1252 */
1253 data->editor_data.LeftSoftKey = TxtSoftOK; 1253 data->editor_data.LeftSoftKey = TxtSoftOK;
1254 data->editor_data.AlternateLeftSoftKey = TxtNull; 1254 data->editor_data.AlternateLeftSoftKey = TxtNull;
1255 data->editor_data.RightSoftKey = TxtSoftBack; 1255 data->editor_data.RightSoftKey = TxtSoftBack;
1256 data->editor_data.hide = FALSE; 1256 data->editor_data.hide = FALSE;
1257 data->editor_data.mode = E_EDIT_READ_ONLY_MODE; 1257 data->editor_data.mode = E_EDIT_READ_ONLY_MODE;
1258 data->editor_data.TextId = TxtNull; 1258 data->editor_data.TextId = TxtNull;
1259 data->editor_data.TextString = NULL; /* no label */ 1259 data->editor_data.TextString = NULL; /* no label */
1260 data->editor_data.min_enter = 0; 1260 data->editor_data.min_enter = 0;
1261 if ((data->sat_command->qual & SAT_M_TEXT_WAIT) NEQ 0) 1261 if ((data->sat_command->qual & SAT_M_TEXT_WAIT) NEQ 0)
1262 { 1262 {
1287 1287
1288 /* SH - all window types are being provided with this event to destroy the window */ 1288 /* SH - all window types are being provided with this event to destroy the window */
1289 case SAT_DESTROY_WINDOW: 1289 case SAT_DESTROY_WINDOW:
1290 sat_display_text_destroy (data->win); 1290 sat_display_text_destroy (data->win);
1291 break; 1291 break;
1292 1292
1293 default: 1293 default:
1294 TRACE_EVENT ("sim_display_text_exec() unexpected event"); 1294 TRACE_EVENT ("sim_display_text_exec() unexpected event");
1295 break; 1295 break;
1296 } 1296 }
1297 } 1297 }
1299 1299
1300 /******************************************************************************* 1300 /*******************************************************************************
1301 1301
1302 $Function: sat_ASCII_to_TEXT 1302 $Function: sat_ASCII_to_TEXT
1303 1303
1304 $Description: This routine converts an ASCIIZ string into an MFW SAT text 1304 $Description: This routine converts an ASCIIZ string into an MFW SAT text
1305 descriptor the coding scheme is taken accordign to the code in <txt> 1305 descriptor the coding scheme is taken accordign to the code in <txt>
1306 1306
1307 $Returns: none 1307 $Returns: none
1308 1308
1309 $Arguments: txt - text info 1309 $Arguments: txt - text info
1310 destination - text destination 1310 destination - text destination
1311 source - text source 1311 source - text source
1312 1312
1313 *******************************************************************************/ 1313 *******************************************************************************/
1314 1314
1315 static void sat_ASCII_to_TEXT (T_SAT_TXT * txt, UBYTE * destination, UBYTE * source) 1315 static void sat_ASCII_to_TEXT (T_SAT_TXT * txt, UBYTE * destination, UBYTE * source)
1316 { 1316 {
1317 UBYTE * temp_buffer; 1317 UBYTE * temp_buffer;
1318 1318
1319 switch (txt->code) 1319 switch (txt->code)
1320 { 1320 {
1321 case MFW_DCS_7bits: 1321 case MFW_DCS_7bits:
1322 temp_buffer = (UBYTE *)ALLOC_MEMORY(txt->len+1); 1322 temp_buffer = (UBYTE *)ALLOC_MEMORY(txt->len+1);
1323 sat_ascii_to_gsm ((char *)temp_buffer, (char *)source, (U16)(txt->len)); 1323 sat_ascii_to_gsm ((char *)temp_buffer, (char *)source, (U16)(txt->len));
1324 utl_cvt8To7 (temp_buffer, txt->len, destination, 0); 1324 utl_cvt8To7 (temp_buffer, txt->len, destination, 0);
1325 FREE_MEMORY ((U8 *)temp_buffer, txt->len+1); 1325 FREE_MEMORY ((U8 *)temp_buffer, txt->len+1);
1326 break; 1326 break;
1327 case MFW_DCS_8bits: 1327 case MFW_DCS_8bits:
1348 1348
1349 1349
1350 $Returns: none 1350 $Returns: none
1351 1351
1352 $Arguments: txt - text info 1352 $Arguments: txt - text info
1353 destination - text destination 1353 destination - text destination
1354 source - text source 1354 source - text source
1355 1355
1356 *******************************************************************************/ 1356 *******************************************************************************/
1357 static void sat_UCODE_to_TEXT (T_SAT_TXT * txt, UBYTE * destination, cp_wstring_t source) 1357 static void sat_UCODE_to_TEXT (T_SAT_TXT * txt, UBYTE * destination, cp_wstring_t source)
1358 { 1358 {
1362 1362
1363 switch (txt->code) 1363 switch (txt->code)
1364 { 1364 {
1365 case MFW_DCS_7bits: 1365 case MFW_DCS_7bits:
1366 size = (source->length/sizeof(wchar_t))+1; 1366 size = (source->length/sizeof(wchar_t))+1;
1367 temp_buffer = (UBYTE *)ALLOC_MEMORY(size); 1367 temp_buffer = (UBYTE *)ALLOC_MEMORY(size);
1368 string_UCS2_to_GSM( 1368 string_UCS2_to_GSM(
1369 MFW_DCS_7bits, // gsm format 1369 MFW_DCS_7bits, // gsm format
1370 (wstring_t *)source,// source unicode string, includes own length 1370 (wstring_t *)source,// source unicode string, includes own length
1371 size, // maximum output size 1371 size, // maximum output size
1372 temp_buffer, // destination byte array 1372 temp_buffer, // destination byte array
1373 &outLen // actual length in bytes is stored here. 1373 &outLen // actual length in bytes is stored here.
1374 ); 1374 );
1375 txt->len = utl_cvt8To7 (temp_buffer, outLen, destination, 0); 1375 txt->len = utl_cvt8To7 (temp_buffer, outLen, destination, 0);
1376 FREE_MEMORY ((U8 *)temp_buffer, size); 1376 FREE_MEMORY ((U8 *)temp_buffer, size);
1377 break; 1377 break;
1378 case MFW_DCS_8bits: 1378 case MFW_DCS_8bits:
1379 string_UCS2_to_GSM( 1379 string_UCS2_to_GSM(
1380 MFW_DCS_7bits, // gsm format 1380 MFW_DCS_7bits, // gsm format
1381 (wstring_t *)source,// source unicode string, includes own length 1381 (wstring_t *)source,// source unicode string, includes own length
1382 size, // maximum output size 1382 size, // maximum output size
1383 destination, // destination byte array 1383 destination, // destination byte array
1384 &txt->len // actual length in bytes is stored here. 1384 &txt->len // actual length in bytes is stored here.
1385 ); 1385 );
1387 case MFW_DCS_UCS2: 1387 case MFW_DCS_UCS2:
1388 txt->len = source->length*sizeof(wchar_t); // txt count is in number of bytes 1388 txt->len = source->length*sizeof(wchar_t); // txt count is in number of bytes
1389 memcpy(destination, source, txt->len); 1389 memcpy(destination, source, txt->len);
1390 break; 1390 break;
1391 default: 1391 default:
1392 string_UCS2_to_GSM( 1392 string_UCS2_to_GSM(
1393 MFW_DCS_7bits, // gsm format 1393 MFW_DCS_7bits, // gsm format
1394 (wstring_t *)source,// source unicode string, includes own length 1394 (wstring_t *)source,// source unicode string, includes own length
1395 size, // maximum output size 1395 size, // maximum output size
1396 destination, // destination byte array 1396 destination, // destination byte array
1397 &txt->len // actual length in bytes is stored here. 1397 &txt->len // actual length in bytes is stored here.
1398 ); 1398 );
1404 1404
1405 /******************************************************************************* 1405 /*******************************************************************************
1406 1406
1407 $Function: sat_get_key_send_result 1407 $Function: sat_get_key_send_result
1408 1408
1409 $Description: 1409 $Description:
1410 1410
1411 1411
1412 $Returns: none 1412 $Returns: none
1413 1413
1414 $Arguments: data - key info 1414 $Arguments: data - key info
1418 static void sat_get_key_send_result (T_sat_get_key * data) 1418 static void sat_get_key_send_result (T_sat_get_key * data)
1419 { 1419 {
1420 T_SAT_RES sat_res; 1420 T_SAT_RES sat_res;
1421 struct { 1421 struct {
1422 T_SAT_TXT txt; 1422 T_SAT_TXT txt;
1423 UBYTE buffer[SAT_GET_KEY_BUFFER_SIZE]; /* buffer for result */ 1423 UBYTE buffer[SAT_GET_KEY_BUFFER_SIZE]; /* buffer for result */
1424 } buf; /* NOTE: txt and buffer shall be packed */ 1424 } buf; /* NOTE: txt and buffer shall be packed */
1425 1425
1426 /* update the output parameter */ 1426 /* update the output parameter */
1427 1427
1428 /* a0876501 (Shashi Shekar B.S.) 03-Oct-2005 MMI-SPR-34554. 1428 /* a0876501 (Shashi Shekar B.S.) 03-Oct-2005 MMI-SPR-34554.
1429 Populate Yes/No terminal response. 1429 Populate Yes/No terminal response.
1430 Ignore the DCS type to be sent if 'SAT_M_INKEY_YES_NO' is ON. 1430 Ignore the DCS type to be sent if 'SAT_M_INKEY_YES_NO' is ON.
1431 Refer GSM 11.14 Sec 12.6, Get Inkey. */ 1431 Refer GSM 11.14 Sec 12.6, Get Inkey. */
1432 if ((data->sat_command->qual & SAT_M_INKEY_YES_NO) NEQ 0) 1432 if ((data->sat_command->qual & SAT_M_INKEY_YES_NO) NEQ 0)
1433 { 1433 {
1434 /* Data coding scheme is not considered for Yes/No response */ 1434 /* Data coding scheme is not considered for Yes/No response */
1435 buf.txt.code = SAT_M_INKEY_YES_NO; 1435 buf.txt.code = SAT_M_INKEY_YES_NO;
1436 1436
1437 buf.txt.text = sizeof(T_SAT_TXT); 1437 buf.txt.text = sizeof(T_SAT_TXT);
1438 buf.txt.len = 1; 1438 buf.txt.len = 1;
1439 1439
1440 /* Simply copy the data populated in sat_editor_cb */ 1440 /* Simply copy the data populated in sat_editor_cb */
1441 buf.buffer[0] = (UBYTE)data->edt_buffer[0]; 1441 buf.buffer[0] = (UBYTE)data->edt_buffer[0];
1442 } 1442 }
1443 else 1443 else
1444 { 1444 {
1445 /* set the required DCS for the result to be returned */ 1445 /* set the required DCS for the result to be returned */
1446 if ((data->sat_command->qual & SAT_M_INKEY_UCS2) NEQ 0) 1446 if ((data->sat_command->qual & SAT_M_INKEY_UCS2) NEQ 0)
1449 } 1449 }
1450 else 1450 else
1451 { 1451 {
1452 buf.txt.code = MFW_DCS_8bits; /* use the SMS default alphabet */ 1452 buf.txt.code = MFW_DCS_8bits; /* use the SMS default alphabet */
1453 } 1453 }
1454 1454
1455 buf.txt.text = sizeof(T_SAT_TXT); 1455 buf.txt.text = sizeof(T_SAT_TXT);
1456 buf.txt.len = 1; 1456 buf.txt.len = 1;
1457 1457
1458 /* convert and send the result */ 1458 /* convert and send the result */
1459 sat_ASCII_to_TEXT(&buf.txt, buf.buffer, (UBYTE *)data->edt_buffer); 1459 sat_ASCII_to_TEXT(&buf.txt, buf.buffer, (UBYTE *)data->edt_buffer);
1485 1485
1486 /******************************************************************************* 1486 /*******************************************************************************
1487 1487
1488 $Function: sat_get_string_send_result 1488 $Function: sat_get_string_send_result
1489 1489
1490 $Description: 1490 $Description:
1491 1491
1492 1492
1493 $Returns: none 1493 $Returns: none
1494 1494
1495 $Arguments: data - string info 1495 $Arguments: data - string info
1517 else /* Ascii */ 1517 else /* Ascii */
1518 { 1518 {
1519 length = strlen(data->edt_buffer); 1519 length = strlen(data->edt_buffer);
1520 } 1520 }
1521 size = sizeof(T_sat_get_string_result) + length; 1521 size = sizeof(T_sat_get_string_result) + length;
1522 buf = (T_sat_get_string_result *) ALLOC_MEMORY(size); 1522 buf = (T_sat_get_string_result *) ALLOC_MEMORY(size);
1523 1523
1524 /* update the output parameter */ 1524 /* update the output parameter */
1525 1525
1526 /* set the required DCS for the result to be returned */ 1526 /* set the required DCS for the result to be returned */
1527 if ((data->sat_command->qual & SAT_M_INPUT_UCS2) NEQ 0) 1527 if ((data->sat_command->qual & SAT_M_INPUT_UCS2) NEQ 0)
1528 { 1528 {
1529 buf->txt.code = MFW_DCS_UCS2; 1529 buf->txt.code = MFW_DCS_UCS2;
1530 } 1530 }
1531 else if ((data->sat_command->qual & SAT_M_INPUT_PACKING) NEQ 0) 1531 else if ((data->sat_command->qual & SAT_M_INPUT_PACKING) NEQ 0)
1532 { 1532 {
1533 buf->txt.code = MFW_DCS_7bits; /* use the packed SMS alphabet */ 1533 buf->txt.code = MFW_DCS_7bits; /* use the packed SMS alphabet */
1534 } 1534 }
1535 else 1535 else
1536 { 1536 {
1537 buf->txt.code = MFW_DCS_8bits; /* use the SMS default alphabet */ 1537 buf->txt.code = MFW_DCS_8bits; /* use the SMS default alphabet */
1538 } 1538 }
1539 1539
1540 buf->txt.text = sizeof(T_SAT_TXT); 1540 buf->txt.text = sizeof(T_SAT_TXT);
1541 buf->txt.len = length; 1541 buf->txt.len = length;
1542 1542
1543 /* convert and send the result */ 1543 /* convert and send the result */
1544 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */ 1544 if (((data->sat_command->qual & SAT_M_INPUT_ALPHA) == 1) /* 0=digits, 1=alpha */
1550 } 1550 }
1551 else 1551 else
1552 { 1552 {
1553 sat_ASCII_to_TEXT(&buf->txt, buf->buffer, (UBYTE *)data->edt_buffer); 1553 sat_ASCII_to_TEXT(&buf->txt, buf->buffer, (UBYTE *)data->edt_buffer);
1554 } 1554 }
1555 1555
1556 /* SPR#2321 - DS - Check if an icon was supplied with SAT_STRING (Get Input) 1556 /* SPR#2321 - DS - Check if an icon was supplied with SAT_STRING (Get Input)
1557 * command. If supplied, set the result to 0x04 'Command performed successfully, 1557 * command. If supplied, set the result to 0x04 'Command performed successfully,
1558 * but requested icon could not be displayed'. 1558 * but requested icon could not be displayed'.
1559 */ 1559 */
1560 input = (T_SAT_INPUT*)&data->sat_command->c.inp; 1560 input = (T_SAT_INPUT*)&data->sat_command->c.inp;
1561 if (input->prompt.icon.qual == 0xFF && 1561 if (input->prompt.icon.qual == 0xFF &&
1562 input->prompt.icon.id == 0xFF) 1562 input->prompt.icon.id == 0xFF)
1590 $Returns: none 1590 $Returns: none
1591 1591
1592 $Arguments: win - window 1592 $Arguments: win - window
1593 Identifier - unique id 1593 Identifier - unique id
1594 event - event id 1594 event - event id
1595 1595
1596 *******************************************************************************/ 1596 *******************************************************************************/
1597 /* SPR#1428 - SH - New Editor: minor change so function matches callback type */ 1597 /* SPR#1428 - SH - New Editor: minor change so function matches callback type */
1598 #ifdef NEW_EDITOR 1598 #ifdef NEW_EDITOR
1599 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT event) 1599 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT event)
1600 #else 1600 #else
1601 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, USHORT event) 1601 static void sat_editor_cb (T_MFW_HND win, USHORT Identifier, USHORT event)
1602 #endif 1602 #endif
1603 { 1603 {
1604 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 1604 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1605 T_SAT_RES sat_res; 1605 T_SAT_RES sat_res;
1606 1606
1607 TRACE_EVENT ("sat_editor_cb()"); 1607 TRACE_EVENT ("sat_editor_cb()");
1608 1608
1609 TRACE_EVENT_P1("event number %d",event); 1609 TRACE_EVENT_P1("event number %d",event);
1610 1610
1611 if ((win EQ NULL) || (win_data EQ NULL)) 1611 if ((win EQ NULL) || (win_data EQ NULL))
1612 return; 1612 return;
1613 1613
1614 switch (Identifier) 1614 switch (Identifier)
1615 { 1615 {
1616 case SAT_GET_KEY: 1616 case SAT_GET_KEY:
1617 { 1617 {
1618 T_sat_get_key * data = (T_sat_get_key *)win_data->user; 1618 T_sat_get_key * data = (T_sat_get_key *)win_data->user;
1619 1619
1620 if (data EQ NULL) 1620 if (data EQ NULL)
1621 return; 1621 return;
1622 1622
1623 switch(event) 1623 switch(event)
1624 { 1624 {
1625 case INFO_KCD_LEFT: /* OK or single digit key or YES */ 1625 case INFO_KCD_LEFT: /* OK or single digit key or YES */
1626 /* update the output parameter */ 1626 /* update the output parameter */
1627 if ((data->sat_command->qual & SAT_M_INKEY_YES_NO) NEQ 0) 1627 if ((data->sat_command->qual & SAT_M_INKEY_YES_NO) NEQ 0)
1628 { 1628 {
1629 data->edt_buffer[0] = 0x01; /* means YES */ 1629 data->edt_buffer[0] = 0x01; /* means YES */
1630 data->edt_buffer[1] = 0x00; /* means YES */ 1630 data->edt_buffer[1] = 0x00; /* means YES */
1631 } 1631 }
1632 1632
1633 sat_get_key_send_result (data); 1633 sat_get_key_send_result (data);
1634 break; 1634 break;
1635 case INFO_KCD_ALTERNATELEFT: /* help */ 1635 case INFO_KCD_ALTERNATELEFT: /* help */
1636 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_HELP; 1636 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_HELP;
1637 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1637 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1650 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1650 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1651 sat_done (data->sat_command, sat_res); 1651 sat_done (data->sat_command, sat_res);
1652 } 1652 }
1653 break; 1653 break;
1654 case INFO_KCD_CLEAR: /* clear on empty buffer or long clear */ 1654 case INFO_KCD_CLEAR: /* clear on empty buffer or long clear */
1655 case INFO_KCD_HUP: 1655 case INFO_KCD_HUP:
1656 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT; 1656 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT;
1657 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1657 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1658 sat_done (data->sat_command, sat_res); 1658 sat_done (data->sat_command, sat_res);
1659 break; 1659 break;
1660 case INFO_TIMEOUT: /* timeout */ 1660 case INFO_TIMEOUT: /* timeout */
1675 } 1675 }
1676 break; 1676 break;
1677 case SAT_GET_STRING: 1677 case SAT_GET_STRING:
1678 { 1678 {
1679 T_sat_get_string * data = (T_sat_get_string *)win_data->user; 1679 T_sat_get_string * data = (T_sat_get_string *)win_data->user;
1680 1680
1681 if (data EQ NULL) 1681 if (data EQ NULL)
1682 return; 1682 return;
1683 1683
1684 switch(event) 1684 switch(event)
1685 { 1685 {
1686 case INFO_KCD_LEFT: /* OK */ 1686 case INFO_KCD_LEFT: /* OK */
1687 sat_get_string_send_result (data); 1687 sat_get_string_send_result (data);
1688 SEND_EVENT(data->win, SAT_DESTROY_WINDOW, 0, 0); /* SPR#1700 - DS - Destroy SAT string data */ 1688 SEND_EVENT(data->win, SAT_DESTROY_WINDOW, 0, 0); /* SPR#1700 - DS - Destroy SAT string data */
1689 break; 1689 break;
1690 case INFO_KCD_ALTERNATELEFT: /* help */ 1690 case INFO_KCD_ALTERNATELEFT: /* help */
1691 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_HELP; 1691 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_HELP;
1692 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1692 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1693 sat_done (data->sat_command, sat_res); 1693 sat_done (data->sat_command, sat_res);
1694 break; 1694 break;
1695 case INFO_KCD_RIGHT: /* back */ 1695 case INFO_KCD_RIGHT: /* back */
1696 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK; 1696 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK;
1697 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1697 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1698 sat_done (data->sat_command, sat_res); 1698 sat_done (data->sat_command, sat_res);
1699 break; 1699 break;
1700 case INFO_KCD_CLEAR: /* clear on empty buffer or long clear */ 1700 case INFO_KCD_CLEAR: /* clear on empty buffer or long clear */
1701 case INFO_KCD_HUP: /* SPR#2321 - DS - Handle hangup keypress */ 1701 case INFO_KCD_HUP: /* SPR#2321 - DS - Handle hangup keypress */
1702 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT; 1702 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT;
1703 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1703 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1704 sat_done (data->sat_command, sat_res); 1704 sat_done (data->sat_command, sat_res);
1705 break; 1705 break;
1728 break; 1728 break;
1729 1729
1730 case SAT_DISPLAY_TEXT: 1730 case SAT_DISPLAY_TEXT:
1731 { 1731 {
1732 T_sat_display_text * data = (T_sat_display_text *)win_data->user; 1732 T_sat_display_text * data = (T_sat_display_text *)win_data->user;
1733 1733
1734 switch (event) 1734 switch (event)
1735 { 1735 {
1736 case INFO_KCD_RIGHT: /* back */ 1736 case INFO_KCD_RIGHT: /* back */
1737 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK; 1737 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK;
1738 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1738 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1739 sat_done (data->sat_command, sat_res); 1739 sat_done (data->sat_command, sat_res);
1740 break; 1740 break;
1741 case INFO_TIMEOUT: /* timeout */ 1741 case INFO_TIMEOUT: /* timeout */
1742 case INFO_KCD_LEFT: /* OK */ 1742 case INFO_KCD_LEFT: /* OK */
1743 /* SPR#2340 - DS - Check if an icon was supplied with DISPLAY TEXT 1743 /* SPR#2340 - DS - Check if an icon was supplied with DISPLAY TEXT
1744 * command. If supplied, set the result to 0x04 'Command performed successfully, 1744 * command. If supplied, set the result to 0x04 'Command performed successfully,
1745 * but requested icon could not be displayed'. 1745 * but requested icon could not be displayed'.
1746 */ 1746 */
1747 if (data->sat_command->c.text.icon.qual == 0xFF && 1747 if (data->sat_command->c.text.icon.qual == 0xFF &&
1748 data->sat_command->c.text.icon.id == 0xFF) 1748 data->sat_command->c.text.icon.id == 0xFF)
1749 { 1749 {
1756 #ifdef FF_MMI_SAT_ICON 1756 #ifdef FF_MMI_SAT_ICON
1757 sat_res[SAT_ERR_INDEX] = SatResSuccess; 1757 sat_res[SAT_ERR_INDEX] = SatResSuccess;
1758 #else 1758 #else
1759 /* Icon present but ME cannot display icon */ 1759 /* Icon present but ME cannot display icon */
1760 sat_res[SAT_ERR_INDEX] = SatResNoIcon; 1760 sat_res[SAT_ERR_INDEX] = SatResNoIcon;
1761 #endif 1761 #endif
1762 } 1762 }
1763 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1763 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1764 sat_done (data->sat_command, sat_res); 1764 sat_done (data->sat_command, sat_res);
1765 break; 1765 break;
1766 case INFO_KCD_CLEAR: /* abort */ 1766 case INFO_KCD_CLEAR: /* abort */
1767 case INFO_KCD_HUP: 1767 case INFO_KCD_HUP:
1768 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT; 1768 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT;
1769 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1769 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1770 sat_done (data->sat_command, sat_res); 1770 sat_done (data->sat_command, sat_res);
1771 break; 1771 break;
1772 case INFO_KCD_CALL: /* SEND key */ 1772 case INFO_KCD_CALL: /* SEND key */
1782 //Nov 09, 2005 REF: OMAPS00043190 - x0018858 1782 //Nov 09, 2005 REF: OMAPS00043190 - x0018858
1783 // Re-initialize the global variable to NULL. 1783 // Re-initialize the global variable to NULL.
1784 satDisplayTextWin = NULL; 1784 satDisplayTextWin = NULL;
1785 } 1785 }
1786 break; 1786 break;
1787 1787
1788 case SAT_DISPLAY_TEXT_WAIT: 1788 case SAT_DISPLAY_TEXT_WAIT:
1789 { 1789 {
1790 T_sat_display_text * data = (T_sat_display_text *)win_data->user; 1790 T_sat_display_text * data = (T_sat_display_text *)win_data->user;
1791 1791
1792 switch (event) 1792 switch (event)
1793 { 1793 {
1794 case INFO_TIMEOUT: /* timeout */ 1794 case INFO_TIMEOUT: /* timeout */
1795 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; 1795 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP;
1796 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1796 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1797 sat_done (data->sat_command, sat_res); 1797 sat_done (data->sat_command, sat_res);
1798 break; 1798 break;
1799 case INFO_KCD_LEFT: /* OK */ 1799 case INFO_KCD_LEFT: /* OK */
1800 /* SPR#2340 - DS - Check if an icon was supplied with DISPLAY TEXT 1800 /* SPR#2340 - DS - Check if an icon was supplied with DISPLAY TEXT
1801 * command. If supplied, set the result to 0x04 'Command performed successfully, 1801 * command. If supplied, set the result to 0x04 'Command performed successfully,
1802 * but requested icon could not be displayed'. 1802 * but requested icon could not be displayed'.
1803 */ 1803 */
1804 if (data->sat_command->c.text.icon.qual == 0xFF && 1804 if (data->sat_command->c.text.icon.qual == 0xFF &&
1805 data->sat_command->c.text.icon.id == 0xFF) 1805 data->sat_command->c.text.icon.id == 0xFF)
1806 { 1806 {
1813 #ifdef FF_MMI_SAT_ICON 1813 #ifdef FF_MMI_SAT_ICON
1814 sat_res[SAT_ERR_INDEX] = SatResSuccess; 1814 sat_res[SAT_ERR_INDEX] = SatResSuccess;
1815 #else 1815 #else
1816 /* Icon present but ME cannot display icon */ 1816 /* Icon present but ME cannot display icon */
1817 sat_res[SAT_ERR_INDEX] = SatResNoIcon; 1817 sat_res[SAT_ERR_INDEX] = SatResNoIcon;
1818 #endif 1818 #endif
1819 } 1819 }
1820 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1820 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1821 sat_done (data->sat_command, sat_res); 1821 sat_done (data->sat_command, sat_res);
1822 break; 1822 break;
1823 case INFO_KCD_RIGHT: /* back */ 1823 case INFO_KCD_RIGHT: /* back */
1824 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK; 1824 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK;
1825 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1825 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1826 sat_done (data->sat_command, sat_res); 1826 sat_done (data->sat_command, sat_res);
1827 break; 1827 break;
1828 case INFO_KCD_CLEAR: /* abort */ 1828 case INFO_KCD_CLEAR: /* abort */
1829 case INFO_KCD_HUP: 1829 case INFO_KCD_HUP:
1830 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT; 1830 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_ABORT;
1831 sat_res[SAT_AI_INDEX] = SatResAiNoCause; 1831 sat_res[SAT_AI_INDEX] = SatResAiNoCause;
1832 sat_done (data->sat_command, sat_res); 1832 sat_done (data->sat_command, sat_res);
1833 break; 1833 break;
1834 /* SPR#2490 - DS - Explicitly ignore SEND key press */ 1834 /* SPR#2490 - DS - Explicitly ignore SEND key press */