FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiSatMenu.c @ 166:d715ee726526
mmiSatMenu.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 19 Nov 2020 06:13:24 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
165:6b740edabc07 | 166:d715ee726526 |
---|---|
1 | |
2 /******************************************************************************* | 1 /******************************************************************************* |
3 | 2 |
4 CONDAT (UK) | 3 CONDAT (UK) |
5 | 4 |
6 ******************************************************************************** | 5 ******************************************************************************** |
7 | 6 |
8 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 |
9 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. |
10 | 9 |
11 ******************************************************************************** | 10 ******************************************************************************** |
12 | 11 |
13 $Project name: Basic MMI | 12 $Project name: Basic MMI |
14 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
15 $Module: MMI | 14 $Module: MMI |
16 $File: MmiSatMenu.c | 15 $File: MmiSatMenu.c |
17 $Revision: 1.0 | 16 $Revision: 1.0 |
18 | 17 |
19 $Author: Condat(UK) | 18 $Author: Condat(UK) |
20 $Date: 25/10/00 | 19 $Date: 25/10/00 |
21 | 20 |
22 ******************************************************************************** | 21 ******************************************************************************** |
23 | 22 |
24 Description: | 23 Description: |
25 | 24 |
26 Implementation of MMI SIM Application Toolkit (SAT) | 25 Implementation of MMI SIM Application Toolkit (SAT) |
27 | 26 |
28 ******************************************************************************** | 27 ******************************************************************************** |
29 | 28 |
30 $History: MmiSatMenu.c | 29 $History: MmiSatMenu.c |
31 | |
32 | |
33 | 30 |
34 | 31 |
35 Jun 06, 2006 DR: OMAPS00080543 - xreddymn | 32 Jun 06, 2006 DR: OMAPS00080543 - xreddymn |
36 Description: Default item is not being highlighted for SELECT ITEM command. | 33 Description: Default item is not being highlighted for SELECT ITEM command. |
37 Solution: Change list menu highlight index based on the default item provided | 34 Solution: Change list menu highlight index based on the default item provided |
60 | 57 |
61 Aug 16, 2004 REF: CRR 24323 Deepa M.D | 58 Aug 16, 2004 REF: CRR 24323 Deepa M.D |
62 Bug:Clenup of sprintf used for tracing | 59 Bug:Clenup of sprintf used for tracing |
63 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | 60 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX |
64 | 61 |
65 25/10/00 Original Condat(UK) BMI version. | 62 25/10/00 Original Condat(UK) BMI version. |
66 | 63 |
67 $End | 64 $End |
68 | 65 |
69 *******************************************************************************/ | 66 *******************************************************************************/ |
70 | |
71 | 67 |
72 | 68 |
73 /******************************************************************************* | 69 /******************************************************************************* |
74 | 70 |
75 Include Files | 71 Include Files |
98 #include "vsi.h" | 94 #include "vsi.h" |
99 | 95 |
100 #endif | 96 #endif |
101 #include "mfw_sys.h" | 97 #include "mfw_sys.h" |
102 #include "prim.h" | 98 #include "prim.h" |
103 | |
104 | 99 |
105 | 100 |
106 #include "mfw_mfw.h" | 101 #include "mfw_mfw.h" |
107 #include "mfw_win.h" | 102 #include "mfw_win.h" |
108 #include "mfw_kbd.h" | 103 #include "mfw_kbd.h" |
174 { | 169 { |
175 /* administrative data */ | 170 /* administrative data */ |
176 | 171 |
177 T_MMI_CONTROL mmi_control; | 172 T_MMI_CONTROL mmi_control; |
178 T_MFW_HND win; | 173 T_MFW_HND win; |
179 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ | 174 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ |
180 | 175 |
181 /* associated handlers */ | 176 /* associated handlers */ |
182 | 177 |
183 /* internal data */ | 178 /* internal data */ |
184 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */ | 179 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */ |
204 NULL, /* with these items */ | 199 NULL, /* with these items */ |
205 0 , /* number of items */ | 200 0 , /* number of items */ |
206 COLOUR_LIST_XX, TxtNull, NULL, MNUATTRSPARE, | 201 COLOUR_LIST_XX, TxtNull, NULL, MNUATTRSPARE, |
207 /* 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ | 202 /* 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ |
208 TRUE | 203 TRUE |
209 | |
210 }; | 204 }; |
211 | 205 |
212 static MfwMnuAttr sat_select_menuAttrib = | 206 static MfwMnuAttr sat_select_menuAttrib = |
213 { | 207 { |
214 &sat_select_menuArea, | 208 &sat_select_menuArea, |
237 T_MFW_HND sat_setup_menu_start(T_SAT_CMD * sat_command) | 231 T_MFW_HND sat_setup_menu_start(T_SAT_CMD * sat_command) |
238 { | 232 { |
239 T_MFW_HND win; | 233 T_MFW_HND win; |
240 | 234 |
241 TRACE_FUNCTION ("sat_setup_menu_start()"); | 235 TRACE_FUNCTION ("sat_setup_menu_start()"); |
242 /***************************Go-lite Optimization changes Start***********************/ | 236 /***************************Go-lite Optimization changes Start***********************/ |
243 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 237 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
244 TRACE_EVENT_P1("MFW Memory Left after starting SAT %d",mfwCheckMemoryLeft()); | 238 TRACE_EVENT_P1("MFW Memory Left after starting SAT %d",mfwCheckMemoryLeft()); |
245 /***************************Go-lite Optimization changes end***********************/ | 239 /***************************Go-lite Optimization changes end***********************/ |
246 | 240 |
247 win = sat_setup_menu_create (NULL); | 241 win = sat_setup_menu_create (NULL); |
248 | 242 |
249 if (win NEQ NULL) | 243 if (win NEQ NULL) |
250 { | 244 { |
251 SEND_EVENT (win, SAT_SETUP_MENU, 0, sat_command); | 245 SEND_EVENT (win, SAT_SETUP_MENU, 0, sat_command); |
252 } | 246 } |
279 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_setup_menu_exec; | 273 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_setup_menu_exec; |
280 data->mmi_control.data = data; | 274 data->mmi_control.data = data; |
281 win = ((T_MFW_HDR *)data->win)->data; | 275 win = ((T_MFW_HDR *)data->win)->data; |
282 win->user = (MfwUserDataPtr)data; | 276 win->user = (MfwUserDataPtr)data; |
283 | 277 |
284 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ | 278 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ |
285 | 279 |
286 /* | 280 /* |
287 * return window handle | 281 * return window handle |
288 */ | 282 */ |
289 | 283 |
290 | 284 g_SATsession_is_active = TRUE; |
291 g_SATsession_is_active = TRUE; | |
292 | 285 |
293 win_show(data->win); | 286 win_show(data->win); |
294 return data->win; | 287 return data->win; |
295 } | 288 } |
296 | 289 |
386 static T_MFW sat_setup_menu_recreate(T_sat_setup_menu *data) | 379 static T_MFW sat_setup_menu_recreate(T_sat_setup_menu *data) |
387 { | 380 { |
388 int i; | 381 int i; |
389 SatMenu * menu = &data->sat_command->c.menu; | 382 SatMenu * menu = &data->sat_command->c.menu; |
390 int Unicode_menu = FALSE; /*MC, SPR 940/2flag to lay-out as Unicode*/ | 383 int Unicode_menu = FALSE; /*MC, SPR 940/2flag to lay-out as Unicode*/ |
391 T_MFW retVal; | 384 T_MFW retVal; |
392 | 385 |
393 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 386 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
394 #ifdef FF_MMI_SAT_ICON | 387 #ifdef FF_MMI_SAT_ICON |
395 USHORT icon_length; | 388 USHORT icon_length; |
396 USHORT fontHeight = 0, menuHeight = 0, titleHeight; | 389 USHORT fontHeight = 0, menuHeight = 0, titleHeight; |
397 #endif | 390 #endif |
398 | 391 |
399 TRACE_EVENT ("sat_setup_menu_recreate()"); | 392 TRACE_EVENT ("sat_setup_menu_recreate()"); |
400 | 393 |
401 #ifdef __COMPLETE_LIST_SUPPORT__ /* ??? rsa for future extension */ | 394 #ifdef __COMPLETE_LIST_SUPPORT__ /* ??? rsa for future extension */ |
402 if ((&data->sat_command.qual & SAT_M_SETUP_HELP_AVAIL) NEQ 0) | 395 if ((&data->sat_command.qual & SAT_M_SETUP_HELP_AVAIL) NEQ 0) |
403 { | 396 { |
404 data->list_menu_data.AlternateLeftSoftKey = TxtHelp; /* help available */ | 397 data->list_menu_data.AlternateLeftSoftKey = TxtHelp; /* help available */ |
502 | 495 |
503 TRACE_EVENT_P1("menu->header.len %d", menu->header.len); | 496 TRACE_EVENT_P1("menu->header.len %d", menu->header.len); |
504 | 497 |
505 /* SPR#2492 - DS - Setup menu header */ | 498 /* SPR#2492 - DS - Setup menu header */ |
506 if (menu->header.len > 0 && menu->header.len != 0xFF) | 499 if (menu->header.len > 0 && menu->header.len != 0xFF) |
507 { | 500 { |
508 if (menuHdr) /* Free previously allocated header */ | 501 if (menuHdr) /* Free previously allocated header */ |
509 { | 502 { |
510 TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); | 503 TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); |
511 | 504 |
512 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 505 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
601 if(data->sat_command->qual & SAT_M_SELECT_HELP_AVAIL) | 594 if(data->sat_command->qual & SAT_M_SELECT_HELP_AVAIL) |
602 { | 595 { |
603 displayHelpSymbol(); | 596 displayHelpSymbol(); |
604 } | 597 } |
605 if (retVal != LISTS_FAIL) | 598 if (retVal != LISTS_FAIL) |
606 sat_set_setup_menu_listmnu_win(data->list_menu_data.win); | 599 sat_set_setup_menu_listmnu_win(data->list_menu_data.win); |
607 else | 600 else |
608 sat_set_setup_menu_listmnu_win(NULL); | 601 sat_set_setup_menu_listmnu_win(NULL); |
609 | 602 |
610 return retVal; | 603 return retVal; |
611 } | 604 } |
612 | 605 |
613 static void sat_setup_menu_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) | 606 static void sat_setup_menu_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) |
614 /* callback handler for events sent from parents or childs to to trigger some execution */ | 607 /* callback handler for events sent from parents or childs to to trigger some execution */ |
615 { | 608 { |
616 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 609 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
617 T_sat_setup_menu * data = (T_sat_setup_menu *)win_data->user; | 610 T_sat_setup_menu * data = (T_sat_setup_menu *)win_data->user; |
618 T_SAT_RES sat_res; | 611 T_SAT_RES sat_res; |
619 | |
620 | |
621 | 612 |
622 TRACE_FUNCTION ("sat_setup_menu_exec()"); | 613 TRACE_FUNCTION ("sat_setup_menu_exec()"); |
623 | 614 |
624 switch (event) | 615 switch (event) |
625 { | 616 { |
635 | 626 |
636 data->list_menu_data.ListPosition = 1;/* True cursor position in list menu. */ | 627 data->list_menu_data.ListPosition = 1;/* True cursor position in list menu. */ |
637 data->list_menu_data.Font = 0; | 628 data->list_menu_data.Font = 0; |
638 data->list_menu_data.LeftSoftKey = TxtSoftSelect; | 629 data->list_menu_data.LeftSoftKey = TxtSoftSelect; |
639 data->list_menu_data.RightSoftKey = TxtSoftBack; | 630 data->list_menu_data.RightSoftKey = TxtSoftBack; |
640 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 | 631 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 |
641 //Adding the support for MenuSelect in this list view | 632 //Adding the support for MenuSelect in this list view |
642 data->list_menu_data.KeyEvents = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_MNUSELECT| KEY_MNULEFT| KEY_MNUUP | KEY_MNUDOWN |KEY_HUP; | 633 data->list_menu_data.KeyEvents = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_MNUSELECT| KEY_MNULEFT| KEY_MNUUP | KEY_MNUDOWN |KEY_HUP; |
643 data->list_menu_data.Reason = 0; | 634 data->list_menu_data.Reason = 0; |
644 data->list_menu_data.Strings = TRUE; | 635 data->list_menu_data.Strings = TRUE; |
645 data->list_menu_data.Attr = &sat_setup_menuAttrib; | 636 data->list_menu_data.Attr = &sat_setup_menuAttrib; |
646 data->list_menu_data.List = NULL; /* c030 rsa mark as first time creation */ | 637 data->list_menu_data.List = NULL; /* c030 rsa mark as first time creation */ |
647 data->list_menu_data.autoDestroy = TRUE; | 638 data->list_menu_data.autoDestroy = TRUE; |
648 | 639 |
649 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 640 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
650 #ifdef FF_MMI_SAT_ICON | 641 #ifdef FF_MMI_SAT_ICON |
651 /*Initialize the data members of Icon attributes */ | 642 /*Initialize the data members of Icon attributes */ |
652 setupMenuItemIconData.width = 0; | 643 setupMenuItemIconData.width = 0; |
666 if (event == SAT_RETURN) | 657 if (event == SAT_RETURN) |
667 TRACE_EVENT("sat_setup_menu_exec() SAT_RETURN"); | 658 TRACE_EVENT("sat_setup_menu_exec() SAT_RETURN"); |
668 | 659 |
669 // end c030 rsa | 660 // end c030 rsa |
670 if (sat_get_setup_menu_listmnu_win() == NULL) | 661 if (sat_get_setup_menu_listmnu_win() == NULL) |
671 { | 662 { |
672 /* (re)create the dialog handler */ | 663 /* (re)create the dialog handler */ |
673 if (sat_setup_menu_recreate(data) == LISTS_FAIL) | 664 if (sat_setup_menu_recreate(data) == LISTS_FAIL) |
674 { | 665 { |
675 sat_res[SAT_ERR_INDEX] = SAT_RES_IMPOSSIBLE; | 666 sat_res[SAT_ERR_INDEX] = SAT_RES_IMPOSSIBLE; |
676 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 667 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
677 sat_done (sat_command, sat_res); | 668 sat_done (sat_command, sat_res); |
678 sat_setup_menu_destroy (data->win); | 669 sat_setup_menu_destroy (data->win); |
679 } | 670 } |
680 } | 671 } |
681 break; | 672 break; |
682 | 673 |
683 /* sbh - all window types are being provided with this event to destroy the window */ | 674 /* sbh - all window types are being provided with this event to destroy the window */ |
684 case SAT_DESTROY_WINDOW: | 675 case SAT_DESTROY_WINDOW: |
685 /* ...sbh */ | 676 /* ...sbh */ |
686 | 677 |
687 case SAT_EXIT: | 678 case SAT_EXIT: |
688 sat_setup_menu_destroy (data->win); | 679 sat_setup_menu_destroy (data->win); |
689 break; | 680 break; |
703 int index; | 694 int index; |
704 // T_SAT_RES sat_res; // RAVI | 695 // T_SAT_RES sat_res; // RAVI |
705 | 696 |
706 TRACE_FUNCTION ("sat_setup_menu_listmnu_cb()"); | 697 TRACE_FUNCTION ("sat_setup_menu_listmnu_cb()"); |
707 | 698 |
708 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) | 699 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) |
709 return; | 700 return; |
710 | 701 |
711 switch (ListData->Reason) | 702 switch (ListData->Reason) |
712 { | 703 { |
713 case E_MNU_SELECT: | 704 case E_MNU_SELECT: |
714 case LISTS_REASON_SELECT: | 705 case LISTS_REASON_SELECT: |
715 | 706 |
716 index = ListData->ListPosition; /* index of selected item */ | 707 index = ListData->ListPosition; /* index of selected item */ |
717 item = &data->sat_command->c.menu.items[index]; /* selected item */ | 708 item = &data->sat_command->c.menu.items[index]; /* selected item */ |
718 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 | 709 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 |
719 // Using the MenuSelect Key for requesting the help info in STK menu. | 710 // Using the MenuSelect Key for requesting the help info in STK menu. |
732 | 723 |
733 /* sat_setup_menu_destroy(data->win); c030 rsa do not destroy in order to keep the menu on top */ | 724 /* sat_setup_menu_destroy(data->win); c030 rsa do not destroy in order to keep the menu on top */ |
734 break; | 725 break; |
735 case LISTS_REASON_TIMEOUT: // c015 rsa | 726 case LISTS_REASON_TIMEOUT: // c015 rsa |
736 case LISTS_REASON_BACK: /* back to previous menu */ | 727 case LISTS_REASON_BACK: /* back to previous menu */ |
737 case LISTS_REASON_HANGUP: // sbh - added so hangup key exits | 728 case LISTS_REASON_HANGUP: // sbh - added so hangup key exits |
738 case LISTS_REASON_CLEAR: | 729 case LISTS_REASON_CLEAR: |
739 | 730 |
740 /* | 731 /* |
741 * we don't need to signal <SAT_RES_USER_BACK> here, since the session itself | 732 * we don't need to signal <SAT_RES_USER_BACK> here, since the session itself |
742 * has been finished immediately after sat_setup_menu_proc(). | 733 * has been finished immediately after sat_setup_menu_proc(). |
770 T_MMI_CONTROL mmi_control; | 761 T_MMI_CONTROL mmi_control; |
771 T_MFW_HND win; | 762 T_MFW_HND win; |
772 | 763 |
773 /* associated handlers */ | 764 /* associated handlers */ |
774 | 765 |
775 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ | 766 T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ |
776 | 767 |
777 /* internal data */ | 768 /* internal data */ |
778 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */ | 769 T_SAT_CMD *sat_command; /* pointer to sat_command in parent */ |
779 ListMenuData_t list_menu_data; | 770 ListMenuData_t list_menu_data; |
780 T_MFW_HND sat_timer; // May 24, 2005 REF: CRR 29358 x0021334 | 771 T_MFW_HND sat_timer; // May 24, 2005 REF: CRR 29358 x0021334 |
781 ULONG sat_timeout; // May 24, 2005 REF: CRR 29358 x0021334 | 772 ULONG sat_timeout; // May 24, 2005 REF: CRR 29358 x0021334 |
782 } T_sat_select_item; | 773 } T_sat_select_item; |
783 | 774 |
784 static void sat_select_item_destroy (T_MFW_HND window); | 775 static void sat_select_item_destroy (T_MFW_HND window); |
785 static void sat_select_item_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command); | 776 static void sat_select_item_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command); |
786 static void sat_select_item_listmnu_cb (T_MFW_HND win, ListMenuData_t * ListData); | 777 static void sat_select_item_listmnu_cb (T_MFW_HND win, ListMenuData_t * ListData); |
818 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_select_item_exec; | 809 data->mmi_control.dialog = (T_DIALOG_FUNC)sat_select_item_exec; |
819 data->mmi_control.data = data; | 810 data->mmi_control.data = data; |
820 win = ((T_MFW_HDR *)data->win)->data; | 811 win = ((T_MFW_HDR *)data->win)->data; |
821 win->user = (MfwUserDataPtr)data; | 812 win->user = (MfwUserDataPtr)data; |
822 | 813 |
823 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ | 814 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ |
824 | 815 |
825 /* | 816 /* |
826 * return window handle | 817 * return window handle |
827 */ | 818 */ |
828 | |
829 | 819 |
830 win_show(data->win); | 820 win_show(data->win); |
831 return data->win; | 821 return data->win; |
832 } | 822 } |
833 | 823 |
917 } | 907 } |
918 } | 908 } |
919 | 909 |
920 static T_MFW sat_select_item_recreate(T_sat_select_item *data) | 910 static T_MFW sat_select_item_recreate(T_sat_select_item *data) |
921 { | 911 { |
922 int i; | 912 int i; |
923 int Unicode_menu = FALSE; /*MC, SPR 940/2 flag to lay-out as Unicode*/ | 913 int Unicode_menu = FALSE; /*MC, SPR 940/2 flag to lay-out as Unicode*/ |
924 //May 24, 2005 REF: CRR 29358 x0021334 | 914 //May 24, 2005 REF: CRR 29358 x0021334 |
925 // Added this variable to store return value from listDisplayListMenu | 915 // Added this variable to store return value from listDisplayListMenu |
926 T_MFW sat_select_item_status; | 916 T_MFW sat_select_item_status; |
927 | 917 |
943 { | 933 { |
944 data->list_menu_data.AlternateLeftSoftKey = TxtNull; /* no help available */ | 934 data->list_menu_data.AlternateLeftSoftKey = TxtNull; /* no help available */ |
945 } | 935 } |
946 #endif | 936 #endif |
947 | 937 |
948 /* allocate sufficient memory to hold the list of menu items */ | 938 /* allocate sufficient memory to hold the list of menu items */ |
949 data->list_menu_data.ListLength = menu->nItems; /* actual number of entries in list menu. */ | 939 data->list_menu_data.ListLength = menu->nItems; /* actual number of entries in list menu. */ |
950 data->list_menu_data.List = (MfwMnuItem *)ALLOC_MEMORY (data->list_menu_data.ListLength * sizeof (MfwMnuItem)); | 940 data->list_menu_data.List = (MfwMnuItem *)ALLOC_MEMORY (data->list_menu_data.ListLength * sizeof (MfwMnuItem)); |
951 memset(data->list_menu_data.List, 0x00, data->list_menu_data.ListLength * sizeof (MfwMnuItem)); | 941 memset(data->list_menu_data.List, 0x00, data->list_menu_data.ListLength * sizeof (MfwMnuItem)); |
952 | 942 |
953 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 943 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
994 } | 984 } |
995 #endif | 985 #endif |
996 | 986 |
997 for (i=0; i < data->list_menu_data.ListLength; i++) /* Fill Menu List */ | 987 for (i=0; i < data->list_menu_data.ListLength; i++) /* Fill Menu List */ |
998 { | 988 { |
999 mnuInitDataItem(&data->list_menu_data.List[i]); | 989 mnuInitDataItem(&data->list_menu_data.List[i]); |
1000 | 990 |
1001 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 991 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
1002 #ifdef FF_MMI_SAT_ICON | 992 #ifdef FF_MMI_SAT_ICON |
1003 if(data->sat_command->c.menu.itemIconQual != 0xFF) | 993 if(data->sat_command->c.menu.itemIconQual != 0xFF) |
1004 { | 994 { |
1042 | 1032 |
1043 TRACE_EVENT_P1("menu->header.len %d", menu->header.len); | 1033 TRACE_EVENT_P1("menu->header.len %d", menu->header.len); |
1044 | 1034 |
1045 /* SPR#2492 - DS - Setup menu header */ | 1035 /* SPR#2492 - DS - Setup menu header */ |
1046 if (menu->header.len > 0 && menu->header.len != 0xFF) | 1036 if (menu->header.len > 0 && menu->header.len != 0xFF) |
1047 { | 1037 { |
1048 if (menuHdr) /* Free previously allocated header */ | 1038 if (menuHdr) /* Free previously allocated header */ |
1049 { | 1039 { |
1050 TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); | 1040 TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); |
1051 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 1041 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
1052 #ifdef FF_MMI_SAT_ICON | 1042 #ifdef FF_MMI_SAT_ICON |
1053 /* Free the memory allocated for Header icon data. */ | 1043 /* Free the memory allocated for Header icon data. */ |
1054 if(selectItemHeaderIconData.dst != NULL) | 1044 if(selectItemHeaderIconData.dst != NULL) |
1055 { | 1045 { |
1056 FREE_MEMORY((U8 *)selectItemHeaderIconData.dst, selectItemHeaderIconData.width * | 1046 FREE_MEMORY((U8 *)selectItemHeaderIconData.dst, selectItemHeaderIconData.width * |
1057 selectItemHeaderIconData.height); | 1047 selectItemHeaderIconData.height); |
1058 selectItemHeaderIconData.dst = NULL; | 1048 selectItemHeaderIconData.dst = NULL; |
1059 } | 1049 } |
1060 #endif | 1050 #endif |
1061 sat_destroy_TEXT_ASCIIZ(menuHdr); | 1051 sat_destroy_TEXT_ASCIIZ(menuHdr); |
1062 menuHdr = NULL; /* dsm 01/12/03 - Added to explicitly set menuHdr to NULL */ | 1052 menuHdr = NULL; /* dsm 01/12/03 - Added to explicitly set menuHdr to NULL */ |
1063 } | 1053 } |
1064 | 1054 |
1065 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 1055 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
1066 #ifdef FF_MMI_SAT_ICON | 1056 #ifdef FF_MMI_SAT_ICON |
1067 if(data->sat_command->c.menu.header.icon.qual != 0xFF) | 1057 if(data->sat_command->c.menu.header.icon.qual != 0xFF) |
1097 selectItemHeaderIconData.dst = NULL; | 1087 selectItemHeaderIconData.dst = NULL; |
1098 selectItemHeaderIconData.selfExplanatory = FALSE; | 1088 selectItemHeaderIconData.selfExplanatory = FALSE; |
1099 } | 1089 } |
1100 #endif | 1090 #endif |
1101 | 1091 |
1102 | |
1103 menuHdr = sat_create_TEXT_ASCIIZ(&menu->header); | 1092 menuHdr = sat_create_TEXT_ASCIIZ(&menu->header); |
1104 TRACE_EVENT_P1("SAT menu header: %s", menuHdr); | 1093 TRACE_EVENT_P1("SAT menu header: %s", menuHdr); |
1105 | 1094 |
1106 /* SPR#2492 - DS - Display menu header if one exists */ | 1095 /* SPR#2492 - DS - Display menu header if one exists */ |
1107 if (menuHdr) | 1096 if (menuHdr) |
1145 { | 1134 { |
1146 displayHelpSymbol(); | 1135 displayHelpSymbol(); |
1147 } | 1136 } |
1148 tim_start(data->sat_timer); | 1137 tim_start(data->sat_timer); |
1149 return sat_select_item_status; | 1138 return sat_select_item_status; |
1150 } | 1139 } |
1151 | 1140 |
1152 static void sat_select_item_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) | 1141 static void sat_select_item_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) |
1153 /* callback handler for events sent from parents or childs to to trigger some execution */ | 1142 /* callback handler for events sent from parents or childs to to trigger some execution */ |
1154 { | 1143 { |
1155 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 1144 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
1174 //Adding the support for MenuSelect in this list view | 1163 //Adding the support for MenuSelect in this list view |
1175 data->list_menu_data.KeyEvents = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_MNUSELECT| KEY_MNULEFT| KEY_MNUUP | KEY_MNUDOWN|KEY_HUP; | 1164 data->list_menu_data.KeyEvents = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_MNUSELECT| KEY_MNULEFT| KEY_MNUUP | KEY_MNUDOWN|KEY_HUP; |
1176 data->list_menu_data.Reason = 0; | 1165 data->list_menu_data.Reason = 0; |
1177 data->list_menu_data.Strings = TRUE; | 1166 data->list_menu_data.Strings = TRUE; |
1178 data->list_menu_data.Attr = &sat_select_menuAttrib; | 1167 data->list_menu_data.Attr = &sat_select_menuAttrib; |
1179 data->list_menu_data.autoDestroy = TRUE; | 1168 data->list_menu_data.autoDestroy = TRUE; |
1180 | 1169 |
1181 // May 24, 2005 REF: CRR 29358 x0021334 | 1170 // May 24, 2005 REF: CRR 29358 x0021334 |
1182 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response | 1171 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response |
1183 // Fix: Set Timeout period to 20 seconds and create the timer. | 1172 // Fix: Set Timeout period to 20 seconds and create the timer. |
1184 data->sat_timeout = TWENTY_SECS; | 1173 data->sat_timeout = TWENTY_SECS; |
1185 data->sat_timer = tim_create(data->win, data->sat_timeout, (T_MFW_CB)sat_select_TimerCb); | 1174 data->sat_timer = tim_create(data->win, data->sat_timeout, (T_MFW_CB)sat_select_TimerCb); |
1186 g_sat_scroll_status = TRUE; | 1175 g_sat_scroll_status = TRUE; |
1187 | 1176 |
1188 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 | 1177 // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 |
1189 #ifdef FF_MMI_SAT_ICON | 1178 #ifdef FF_MMI_SAT_ICON |
1190 /*Initialize the data members of Icon attributes */ | 1179 /*Initialize the data members of Icon attributes */ |
1191 selectItemIconData.width = 0; | 1180 selectItemIconData.width = 0; |
1210 g_sat_scroll_status = FALSE; | 1199 g_sat_scroll_status = FALSE; |
1211 sat_select_item_destroy (data->win); | 1200 sat_select_item_destroy (data->win); |
1212 } | 1201 } |
1213 break; | 1202 break; |
1214 | 1203 |
1215 /* sbh - all window types are being provided with this event to destroy the window */ | 1204 /* sbh - all window types are being provided with this event to destroy the window */ |
1216 case SAT_DESTROY_WINDOW: | 1205 case SAT_DESTROY_WINDOW: |
1217 // May 24, 2005 REF: CRR 29358 x0021334 | 1206 // May 24, 2005 REF: CRR 29358 x0021334 |
1218 // Delete the timer and set g_sat_scroll_status to FALSE. | 1207 // Delete the timer and set g_sat_scroll_status to FALSE. |
1219 tim_delete (data->sat_timer); | 1208 tim_delete (data->sat_timer); |
1220 g_sat_scroll_status = FALSE; | 1209 g_sat_scroll_status = FALSE; |
1221 sat_select_item_destroy (data->win); | 1210 sat_select_item_destroy (data->win); |
1222 break; | 1211 break; |
1223 /* ...sbh */ | 1212 /* ...sbh */ |
1224 | 1213 |
1225 // May 24, 2005 REF: CRR 29358 x0021334 | 1214 // May 24, 2005 REF: CRR 29358 x0021334 |
1226 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response | 1215 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response |
1227 // Fix: Timeout has occured. Used existing LISTS_REASON_TIMEOUT event for the same | 1216 // Fix: Timeout has occured. Used existing LISTS_REASON_TIMEOUT event for the same |
1228 case LISTS_REASON_TIMEOUT: | 1217 case LISTS_REASON_TIMEOUT: |
1229 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; // set no response from user | 1218 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; // set no response from user |
1230 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 1219 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
1231 sat_done (data->sat_command, sat_res); | 1220 sat_done (data->sat_command, sat_res); |
1232 tim_stop(data->sat_timer); // stop the timer | 1221 tim_stop(data->sat_timer); // stop the timer |
1233 tim_delete(data->sat_timer); // delete the timer | 1222 tim_delete(data->sat_timer); // delete the timer |
1234 g_sat_scroll_status = FALSE; // set scrolling status to FALSE | 1223 g_sat_scroll_status = FALSE; // set scrolling status to FALSE |
1235 sat_select_item_destroy(data->win); | 1224 sat_select_item_destroy(data->win); |
1236 break; | 1225 break; |
1237 | 1226 |
1238 // May 24, 2005 REF: CRR 29358 x0021334 | 1227 // May 24, 2005 REF: CRR 29358 x0021334 |
1239 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response | 1228 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response |
1240 // Fix: User has scrolled up/down. Used existing LISTS_REASON_SCROLL event for the same | 1229 // Fix: User has scrolled up/down. Used existing LISTS_REASON_SCROLL event for the same |
1241 case LISTS_REASON_SCROLL: | 1230 case LISTS_REASON_SCROLL: |
1242 tim_stop(data->sat_timer); // stop the timer | 1231 tim_stop(data->sat_timer); // stop the timer |
1243 tim_start(data->sat_timer); // start the timer again for 20 seconds | 1232 tim_start(data->sat_timer); // start the timer again for 20 seconds |
1244 break; | 1233 break; |
1245 default: | 1234 default: |
1246 TRACE_EVENT ("sim_select_item_exec() unexpected event"); | 1235 TRACE_EVENT ("sim_select_item_exec() unexpected event"); |
1247 break; | 1236 break; |
1248 } | 1237 } |
1249 } | 1238 } |
1250 | 1239 |
1251 static void sat_select_item_listmnu_cb (T_MFW_HND win, ListMenuData_t * ListData) | 1240 static void sat_select_item_listmnu_cb (T_MFW_HND win, ListMenuData_t * ListData) |
1252 /* sat_select_item menu event handler */ | 1241 /* sat_select_item menu event handler */ |
1255 T_sat_select_item * data = (T_sat_select_item *)win_data->user; | 1244 T_sat_select_item * data = (T_sat_select_item *)win_data->user; |
1256 SatItem * item; | 1245 SatItem * item; |
1257 int index; | 1246 int index; |
1258 T_SAT_RES sat_res; | 1247 T_SAT_RES sat_res; |
1259 | 1248 |
1260 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) | 1249 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) |
1261 return; | 1250 return; |
1262 | 1251 |
1263 TRACE_FUNCTION ("sat_select_item_listmnu_cb()"); | 1252 TRACE_FUNCTION ("sat_select_item_listmnu_cb()"); |
1264 | 1253 |
1265 switch (ListData->Reason) | 1254 switch (ListData->Reason) |
1266 { | 1255 { |
1267 case E_MNU_SELECT: | 1256 case E_MNU_SELECT: |
1268 case LISTS_REASON_SELECT: | 1257 case LISTS_REASON_SELECT: |
1269 index = ListData->ListPosition; /* index of selected item */ | 1258 index = ListData->ListPosition; /* index of selected item */ |
1270 item = &data->sat_command->c.menu.items[index]; /* selected item */ | 1259 item = &data->sat_command->c.menu.items[index]; /* selected item */ |
1271 /* CQ 16307 - Start */ | 1260 /* CQ 16307 - Start */ |
1272 if (data->sat_command->c.menu.itemIconQual == 0xFF) | 1261 if (data->sat_command->c.menu.itemIconQual == 0xFF) |
1273 sat_res[SAT_ERR_INDEX] = SatResSuccess; | 1262 sat_res[SAT_ERR_INDEX] = SatResSuccess; |
1274 else | 1263 else |
1275 { | 1264 { |
1276 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 1265 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
1277 #ifdef FF_MMI_SAT_ICON | 1266 #ifdef FF_MMI_SAT_ICON |
1278 sat_res[SAT_ERR_INDEX] = SatResSuccess; | 1267 sat_res[SAT_ERR_INDEX] = SatResSuccess; |
1279 #else | 1268 #else |
1280 sat_res[SAT_ERR_INDEX] = SatResNoIcon; | 1269 sat_res[SAT_ERR_INDEX] = SatResNoIcon; |
1281 /* CQ 16307 - End */ | 1270 /* CQ 16307 - End */ |
1282 #endif | 1271 #endif |
1283 } | 1272 } |
1284 | |
1285 | 1273 |
1286 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 | 1274 // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 |
1287 // Using the MenuSelect Key for requesting the help info in STK menu. | 1275 // Using the MenuSelect Key for requesting the help info in STK menu. |
1288 if(ListData->selectKey && ((data->sat_command->qual & SAT_M_SELECT_HELP_AVAIL) != 0)) | 1276 if(ListData->selectKey && ((data->sat_command->qual & SAT_M_SELECT_HELP_AVAIL) != 0)) |
1289 { | 1277 { |
1290 sat_res[SAT_ERR_INDEX] = SatResUserHelp; | 1278 sat_res[SAT_ERR_INDEX] = SatResUserHelp; |
1291 ListData->selectKey = FALSE; | 1279 ListData->selectKey = FALSE; |
1292 } | 1280 } |
1293 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 1281 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
1294 satItem (data->sat_command, item->id, sat_res, sizeof(T_SAT_RES)); /* issue the answering envelope */ | 1282 satItem (data->sat_command, item->id, sat_res, sizeof(T_SAT_RES)); /* issue the answering envelope */ |
1295 | 1283 |
1296 | 1284 // May 24, 2005 REF: CRR 29358 x0021334 |
1297 // May 24, 2005 REF: CRR 29358 x0021334 | 1285 // Stop and delete the timer. Also, set scrolling status to FALSE |
1298 // Stop and delete the timer. Also, set scrolling status to FALSE | 1286 tim_stop(data->sat_timer); |
1299 tim_stop(data->sat_timer); | 1287 tim_delete(data->sat_timer); |
1300 tim_delete(data->sat_timer); | 1288 g_sat_scroll_status = FALSE; |
1301 g_sat_scroll_status = FALSE; | 1289 sat_select_item_destroy(data->win); |
1302 sat_select_item_destroy(data->win); | |
1303 break; | 1290 break; |
1304 // c015 rsa | 1291 // c015 rsa |
1305 case LISTS_REASON_TIMEOUT: | 1292 case LISTS_REASON_TIMEOUT: |
1306 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; | 1293 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; |
1307 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 1294 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
1319 case LISTS_REASON_BACK: /* back to previous menu */ | 1306 case LISTS_REASON_BACK: /* back to previous menu */ |
1320 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK; | 1307 sat_res[SAT_ERR_INDEX] = SAT_RES_USER_BACK; |
1321 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 1308 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
1322 sat_done (data->sat_command, sat_res); | 1309 sat_done (data->sat_command, sat_res); |
1323 | 1310 |
1324 // May 24, 2005 REF: CRR 29358 x0021334 | 1311 // May 24, 2005 REF: CRR 29358 x0021334 |
1325 // Stop and delete the timer. Also, set scrolling status to FALSE | 1312 // Stop and delete the timer. Also, set scrolling status to FALSE |
1326 tim_stop(data->sat_timer); | 1313 tim_stop(data->sat_timer); |
1327 tim_delete(data->sat_timer); | 1314 tim_delete(data->sat_timer); |
1328 g_sat_scroll_status = FALSE; | 1315 g_sat_scroll_status = FALSE; |
1329 sat_select_item_destroy(data->win); | 1316 sat_select_item_destroy(data->win); |
1330 break; | 1317 break; |
1331 default: | 1318 default: |
1332 return; | 1319 return; |
1333 } | 1320 } |
1334 return; | 1321 return; |
1338 // May 24, 2005 REF: CRR 29358 x0021334 | 1325 // May 24, 2005 REF: CRR 29358 x0021334 |
1339 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response | 1326 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response |
1340 // Fix: This is the call back function for sat timer | 1327 // Fix: This is the call back function for sat timer |
1341 static int sat_select_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) | 1328 static int sat_select_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) |
1342 { | 1329 { |
1343 T_MFW_HND win = mfw_parent (mfw_header()); | 1330 T_MFW_HND win = mfw_parent (mfw_header()); |
1344 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1331 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1345 T_sat_select_item *data = (T_sat_select_item *)win_data->user; | 1332 T_sat_select_item *data = (T_sat_select_item *)win_data->user; |
1346 | 1333 |
1347 TRACE_FUNCTION("sat_select_TimerCb()"); | 1334 TRACE_FUNCTION("sat_select_TimerCb()"); |
1348 | 1335 |
1349 // Destroy the list before going back to the sat menu | 1336 // Destroy the list before going back to the sat menu |
1350 listsDestroy(data->list_menu_data.win); | 1337 listsDestroy(data->list_menu_data.win); |
1351 // Send timeout event. | 1338 // Send timeout event. |
1352 SEND_EVENT (data->win, LISTS_REASON_TIMEOUT, NULL, NULL); | 1339 SEND_EVENT (data->win, LISTS_REASON_TIMEOUT, NULL, NULL); |
1353 return MFW_EVENT_CONSUMED; | 1340 return MFW_EVENT_CONSUMED; |
1354 } | 1341 } |
1355 | 1342 |
1356 // May 24, 2005 REF: CRR 29358 x0021334 | 1343 // May 24, 2005 REF: CRR 29358 x0021334 |
1357 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response | 1344 // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response |
1358 // Fix: This function returns the status of scrolling, which is used for restarting the timer | 1345 // Fix: This function returns the status of scrolling, which is used for restarting the timer |
1359 BOOL getScrollStatus() | 1346 BOOL getScrollStatus() |
1360 { | 1347 { |
1361 return g_sat_scroll_status; | 1348 return g_sat_scroll_status; |
1362 } | 1349 } |