comparison src/ui/bmi/mmiBookServices.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 ec9f955fc487
comparison
equal deleted inserted replaced
91:c3d28a37caad 92:c0052fe355d3
26 phone book module 26 phone book module
27 27
28 ******************************************************************************** 28 ********************************************************************************
29 $History: MmiBookServices.c 29 $History: MmiBookServices.c
30 30
31 Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) 31 Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat)
32 Bug:PhoneBook: Wrong confirmation message in Phonebook storage when copying/moving a contact 32 Bug:PhoneBook: Wrong confirmation message in Phonebook storage when copying/moving a contact
33 after adding one or making a change 33 after adding one or making a change
34 Fix: ACI shall not send rAT_OK for entry addition / entry change operations in Internal PHB 34 Fix: ACI shall not send rAT_OK for entry addition / entry change operations in Internal PHB
35 Hence, the "addname_flag" and "changename_flag" are immdtly reset incase of Internal PHB 35 Hence, the "addname_flag" and "changename_flag" are immdtly reset incase of Internal PHB
36 36
37 June 22, 2006 REF: DRT OMAPS00081761 x0012849 : Jagannatha 37 June 22, 2006 REF: DRT OMAPS00081761 x0012849 : Jagannatha
38 Description:Handset crash when adding new entry with more then 20 digits to phonebook SIM card 38 Description:Handset crash when adding new entry with more then 20 digits to phonebook SIM card
39 Solution: Number editor will be restricted to 20 characters when EXT1 is not supported. 39 Solution: Number editor will be restricted to 20 characters when EXT1 is not supported.
40 40
41 June 14, 2006 REF: OMAPS00079308 x0039928 41 June 14, 2006 REF: OMAPS00079308 x0039928
42 Bug:Validation and Optimization of Memory consumption 42 Bug:Validation and Optimization of Memory consumption
43 Fix: Memory optimization is done in bookFindNameInSpecificPhonebook to save around 450 bytes of memory. 43 Fix: Memory optimization is done in bookFindNameInSpecificPhonebook to save around 450 bytes of memory.
44 44
45 May 29, 2006 DR: OMAPS00079431 - xreddymn 45 May 29, 2006 DR: OMAPS00079431 - xreddymn
46 Description: Name field is not limited to 14 bytes in case of SIM phonebook. 46 Description: Name field is not limited to 14 bytes in case of SIM phonebook.
47 Solution: In bookInputStartNameEditor, limit the number of characters after 47 Solution: In bookInputStartNameEditor, limit the number of characters after
48 checking if SIM or ME phonebook is being used. 48 checking if SIM or ME phonebook is being used.
49 49
50 Jan 22, 2006 REF: OMAPS00061930 x0039928 50 Jan 22, 2006 REF: OMAPS00061930 x0039928
51 Bug:PhoneBook -Change entry and view entry through Change option-failed 51 Bug:PhoneBook -Change entry and view entry through Change option-failed
52 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries. 52 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries.
53 53
54 June 07, 2005 REF: CRR MMI-FIX-31545 x0021334 54 June 07, 2005 REF: CRR MMI-FIX-31545 x0021334
55 Issue description: SIM: wrong behavior when FDN is not allocated in SST 55 Issue description: SIM: wrong behavior when FDN is not allocated in SST
56 Solution: Before displaying the FDN options, a check is made if FDN is allocated. Only if 56 Solution: Before displaying the FDN options, a check is made if FDN is allocated. Only if
57 FDN is allocated, the options are displayed. 57 FDN is allocated, the options are displayed.
58 58
59 Sep 29, 2004 REF: CRR 25041 xvilliva 59 Sep 29, 2004 REF: CRR 25041 xvilliva
60 Bug: add new entry in the FDN , phone gets rebooted. 60 Bug: add new entry in the FDN , phone gets rebooted.
61 Fix: The bookMenuStart() is called with the window data->phbk->win, 61 Fix: The bookMenuStart() is called with the window data->phbk->win,
62 similar to the function bookFDNMenu() to avoid crash. The menu 62 similar to the function bookFDNMenu() to avoid crash. The menu
63 window thus created is stored, which will be deleted while 63 window thus created is stored, which will be deleted while
64 phonebook menu is destroyed. 64 phonebook menu is destroyed.
65 65
66 Jul 29, 2004 REF: CRR 20888 Deepa M.D 66 Jul 29, 2004 REF: CRR 20888 Deepa M.D
67 Bug:Message received not showing with name, name stored in phonebook 67 Bug:Message received not showing with name, name stored in phonebook
68 Fix:Memset the structure(p_pszNumberText.data) to 0 and then memcpy. 68 Fix:Memset the structure(p_pszNumberText.data) to 0 and then memcpy.
69 69
70 Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN 70 Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN
71 Description: Current state of FDN not highlighted 71 Description: Current state of FDN not highlighted
72 Fix: Instead of showing the submenu directly we call this function 72 Fix: Instead of showing the submenu directly we call this function
73 where we set the menu and also higlight the previously selected menu item 73 where we set the menu and also higlight the previously selected menu item
74 74
75 June 25, 2004 REF: CRR 21547 xvilliva 75 June 25, 2004 REF: CRR 21547 xvilliva
76 Bug: Taking blank entries in phonebook if select book is either SIM or Phone. 76 Bug: Taking blank entries in phonebook if select book is either SIM or Phone.
77 Fix: We check for presence of either phone number or name before add/modify. 77 Fix: We check for presence of either phone number or name before add/modify.
78 78
79 Jun 23, 2004 REF: CRR MMI-SPR-21636 Rashmi C N(Sasken) 79 Jun 23, 2004 REF: CRR MMI-SPR-21636 Rashmi C N(Sasken)
80 Description: The confirmation for deleting entry from address book was a timed confirmation 80 Description: The confirmation for deleting entry from address book was a timed confirmation
81 screen. 81 screen.
82 Solution: Now the time is set to 'FOREVER' from 'TEN_SECS' 82 Solution: Now the time is set to 'FOREVER' from 'TEN_SECS'
83 83
84 Issue Number : SPR#12722 on 29/03/04 by Deepa M.D 84 Issue Number : SPR#12722 on 29/03/04 by Deepa M.D
85 85
86 86
87 25/10/00 Original Condat(UK) BMI version. 87 25/10/00 Original Condat(UK) BMI version.
88 88
89 $End 89 $End
190 #include "MmiChineseInput.h" 190 #include "MmiChineseInput.h"
191 #endif 191 #endif
192 #endif 192 #endif
193 #include "psa_sim.h" // June 22, 2006 REF: DRT OMAPS00081761 x0012849 193 #include "psa_sim.h" // June 22, 2006 REF: DRT OMAPS00081761 x0012849
194 194
195 #define TRACE_PB_DEBUG 195 #define TRACE_PB_DEBUG
196 196
197 extern int menuFDN; 197 extern int menuFDN;
198 extern T_call call_data; 198 extern T_call call_data;
199 199
200 /******************************************************************************* 200 /*******************************************************************************
208 #ifdef INT_PHONEBOOK 208 #ifdef INT_PHONEBOOK
209 BOOL ipbBookSelected = FALSE; 209 BOOL ipbBookSelected = FALSE;
210 BOOL ipbBookAvailable = FALSE; 210 BOOL ipbBookAvailable = FALSE;
211 #endif 211 #endif
212 212
213 // June 14, 2006 REF: OMAPS00079308 x0039928 213 // June 14, 2006 REF: OMAPS00079308 x0039928
214 // Fix: All optimized code is put under flag FF_MMI_PB_OPTIM 214 // Fix: All optimized code is put under flag FF_MMI_PB_OPTIM
215 #ifdef FF_MMI_PB_OPTIM 215 #ifdef FF_MMI_PB_OPTIM
216 # define PB_MAX_FIND_ENTRIES 1 216 # define PB_MAX_FIND_ENTRIES 1
217 #else 217 #else
218 # define PB_MAX_FIND_ENTRIES 4 218 # define PB_MAX_FIND_ENTRIES 4
230 230
231 *******************************************************************************/ 231 *******************************************************************************/
232 232
233 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */ 233 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
234 234
235 extern BOOL addname_flag; 235 extern BOOL addname_flag;
236 236
237 extern BOOL changename_flag; 237 extern BOOL changename_flag;
238 238
239 static void mmi_int_phb_store_change_completion(); 239 static void mmi_int_phb_store_change_completion();
240 240
241 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 241 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
263 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 263 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
264 tBookStandard *data = (tBookStandard *) win_data->user; 264 tBookStandard *data = (tBookStandard *) win_data->user;
265 T_phbk *Phbk = data->phbk; 265 T_phbk *Phbk = data->phbk;
266 266
267 TRACE_EVENT_P1("bookDeleteEntryCB index %d", Phbk->current.entry[Phbk->current.selectedName].index); 267 TRACE_EVENT_P1("bookDeleteEntryCB index %d", Phbk->current.entry[Phbk->current.selectedName].index);
268 268
269 /* This call back is invoked from the delete entry dialog confirmation 269 /* This call back is invoked from the delete entry dialog confirmation
270 screen, and will only respond to the left key (OK) being selected. 270 screen, and will only respond to the left key (OK) being selected.
271 */ 271 */
272 switch ( reason ) 272 switch ( reason )
273 { 273 {
330 *******************************************************************************/ 330 *******************************************************************************/
331 331
332 void bookInitialise( MfwHnd parent ) 332 void bookInitialise( MfwHnd parent )
333 { 333 {
334 TRACE_FUNCTION( "bookInitialise()" ); 334 TRACE_FUNCTION( "bookInitialise()" );
335 335
336 /* SPR#1112 - SH - Added E_PHB_READY and E_PHB_BUSY */ 336 /* SPR#1112 - SH - Added E_PHB_READY and E_PHB_BUSY */
337 phb = phb_create( 0, (MfwEvt) (E_PHB_UPN_LIST | E_PHB_ERROR | E_PHB_STATUS 337 phb = phb_create( 0, (MfwEvt) (E_PHB_UPN_LIST | E_PHB_ERROR | E_PHB_STATUS
338 | E_PHB_READY | E_PHB_BUSY), (MfwCb) bookEvent ); 338 | E_PHB_READY | E_PHB_BUSY), (MfwCb) bookEvent );
339 339
340 } 340 }
357 357
358 void bookInitInternal( void ) 358 void bookInitInternal( void )
359 { 359 {
360 UBYTE intphonebook; 360 UBYTE intphonebook;
361 T_MFW ret; 361 T_MFW ret;
362 362
363 ret = GI_pb_GetPhonebook(&intphonebook); 363 ret = GI_pb_GetPhonebook(&intphonebook);
364 364
365 if (ret==MFW_PHB_OK) 365 if (ret==MFW_PHB_OK)
366 { 366 {
367 bookSetBookAvailable(TRUE); 367 bookSetBookAvailable(TRUE);
373 else 373 else
374 bookSetBookSelected(FALSE); 374 bookSetBookSelected(FALSE);
375 } 375 }
376 else 376 else
377 bookSetBookAvailable(FALSE); 377 bookSetBookAvailable(FALSE);
378 378
379 return; 379 return;
380 } 380 }
381 381
382 382
383 /******************************************************************************* 383 /*******************************************************************************
571 /******************************************************************************* 571 /*******************************************************************************
572 572
573 $Function: bookShowInfoScreen 573 $Function: bookShowInfoScreen
574 574
575 $Description: SPR1112 - SH - Show an info screen 575 $Description: SPR1112 - SH - Show an info screen
576 576
577 $Returns: none 577 $Returns: none
578 578
579 $Arguments: parent, window, 579 $Arguments: parent, window,
580 txtId1 - first line ID 580 txtId1 - first line ID
581 txtId2 - second line ID 581 txtId2 - second line ID
590 590
591 TRACE_FUNCTION( "bookShowInformation()" ); 591 TRACE_FUNCTION( "bookShowInformation()" );
592 592
593 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_BOOK_POPUP); 593 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_BOOK_POPUP);
594 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)cb_function, Time, KEY_CLEAR); 594 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)cb_function, Time, KEY_CLEAR);
595 595
596 display_info.Identifier = Identifier; 596 display_info.Identifier = Identifier;
597 597
598 /* Call Info Screen 598 /* Call Info Screen
599 */ 599 */
600 return info_dialog( parent, &display_info ); 600 return info_dialog( parent, &display_info );
625 int maxMatchChars = 0; 625 int maxMatchChars = 0;
626 int count; /* Number of matching characters */ 626 int count; /* Number of matching characters */
627 int lenNum; 627 int lenNum;
628 int lenNumPB; 628 int lenNumPB;
629 int firstNotMatch=0; 629 int firstNotMatch=0;
630 630
631 631
632 632
633 633
634 TRACE_FUNCTION("bookFindIndexMatchPB()"); 634 TRACE_FUNCTION("bookFindIndexMatchPB()");
635 635
636 #ifdef TRACE_PB_DEBUG 636 #ifdef TRACE_PB_DEBUG
637 TRACE_EVENT_P1("numEntries to examine: %d", numEntries); 637 TRACE_EVENT_P1("numEntries to examine: %d", numEntries);
653 lenNum = strlen(srcNumber); 653 lenNum = strlen(srcNumber);
654 654
655 #ifdef TRACE_PB_DEBUG 655 #ifdef TRACE_PB_DEBUG
656 TRACE_EVENT_P1("Len of number: %d", lenNum); 656 TRACE_EVENT_P1("Len of number: %d", lenNum);
657 #endif /* TRACE_PB_DEBUG */ 657 #endif /* TRACE_PB_DEBUG */
658 658
659 /* Loop round number of entries */ 659 /* Loop round number of entries */
660 for (i=0; i<numEntries; i++) 660 for (i=0; i<numEntries; i++)
661 { 661 {
662 char* entryPB = (char*)listPB->entry[i].number; 662 char* entryPB = (char*)listPB->entry[i].number;
663 663
664 /* Calculate length of number in PB entry */ 664 /* Calculate length of number in PB entry */
665 lenNumPB = strlen(entryPB); 665 lenNumPB = strlen(entryPB);
666 666
667 #ifdef TRACE_PB_DEBUG 667 #ifdef TRACE_PB_DEBUG
668 TRACE_EVENT_P2("Len of PB number for entry %d: %d", i, lenNumPB); 668 TRACE_EVENT_P2("Len of PB number for entry %d: %d", i, lenNumPB);
688 else 688 else
689 { 689 {
690 /* Digits don't match */ 690 /* Digits don't match */
691 firstNotMatch=1; 691 firstNotMatch=1;
692 } 692 }
693 693
694 /* Increment index to point at next set of digits */ 694 /* Increment index to point at next set of digits */
695 j = j + 1; 695 j = j + 1;
696 } 696 }
697 697
698 /* If better match store count and index */ 698 /* If better match store count and index */
733 //GW-SPR#810-Simplified phonebook entry search based on 1.3.3 code. 733 //GW-SPR#810-Simplified phonebook entry search based on 1.3.3 code.
734 734
735 int bookFindNameInPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry ) 735 int bookFindNameInPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry )
736 { 736 {
737 int result; 737 int result;
738 738
739 TRACE_FUNCTION( "bookFindNameInPhonebook()" ); 739 TRACE_FUNCTION( "bookFindNameInPhonebook()" );
740 740
741 if(p_pszNumber == 0 || p_pEntry == 0) 741 if(p_pszNumber == 0 || p_pEntry == 0)
742 return (0); 742 return (0);
743 743
744 if (strlen(p_pszNumber) < 1) 744 if (strlen(p_pszNumber) < 1)
745 return (0); 745 return (0);
746 746
747 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry); 747 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry);
748 748
749 #ifdef INT_PHONEBOOK 749 #ifdef INT_PHONEBOOK
750 /* If not found in internal phonebook, try SIM */ 750 /* If not found in internal phonebook, try SIM */
751 751
752 if (!result && bookGetBookAvailable() && bookGetBookSelected()) 752 if (!result && bookGetBookAvailable() && bookGetBookSelected())
753 { 753 {
754 bookSetBookSelected(FALSE); 754 bookSetBookSelected(FALSE);
755 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry); 755 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry);
756 bookSetBookSelected(TRUE); 756 bookSetBookSelected(TRUE);
757 } 757 }
758 #endif 758 #endif
759 759
760 return result; 760 return result;
761 } 761 }
762 762
763 763
764 /******************************************************************************* 764 /*******************************************************************************
779 int bookFindNameInSpecificPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry ) 779 int bookFindNameInSpecificPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry )
780 { 780 {
781 #ifdef NO_ASCIIZ 781 #ifdef NO_ASCIIZ
782 T_MFW_PHB_TEXT p_pszNumberText; 782 T_MFW_PHB_TEXT p_pszNumberText;
783 #endif 783 #endif
784 784
785 T_MFW_PHB_LIST phb_list; //, new_list; // RAVI 785 T_MFW_PHB_LIST phb_list; //, new_list; // RAVI
786 786
787 SHORT phb_index = 0; 787 SHORT phb_index = 0;
788 UBYTE l_name[MAX_ALPHA_LEN]; 788 UBYTE l_name[MAX_ALPHA_LEN];
789 // June 14, 2006 REF: OMAPS00079308 x0039928 789 // June 14, 2006 REF: OMAPS00079308 x0039928
790 // Fix: All optimized code is put under flag FF_MMI_PB_OPTIM 790 // Fix: All optimized code is put under flag FF_MMI_PB_OPTIM
791 #ifndef FF_MMI_PB_OPTIM 791 #ifndef FF_MMI_PB_OPTIM
792 T_MFW_PHB_ENTRY temp_pEntry[PB_MAX_FIND_ENTRIES]; 792 T_MFW_PHB_ENTRY temp_pEntry[PB_MAX_FIND_ENTRIES];
793 #endif 793 #endif
794 794
795 /*MC SPR 1319*/ 795 /*MC SPR 1319*/
796 #ifdef EASY_TEXT_ENABLED 796 #ifdef EASY_TEXT_ENABLED
797 #ifndef FF_MMI_PB_OPTIM 797 #ifndef FF_MMI_PB_OPTIM
798 char debug[MAX_ALPHA_LEN]; 798 char debug[MAX_ALPHA_LEN];
799 int k; 799 int k;
800 #endif 800 #endif
801 #endif 801 #endif
802 int indexMatch; 802 int indexMatch;
803 int ret; 803 int ret;
804 804
805 805
806 if(p_pszNumber == 0 || p_pEntry == 0) 806 if(p_pszNumber == 0 || p_pEntry == 0)
807 return (0); 807 return (0);
808 808
809 if (strlen(p_pszNumber) < 1) 809 if (strlen(p_pszNumber) < 1)
810 return (0); 810 return (0);
811 811
812 memset( p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY) ); 812 memset( p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY) );
813 memset( &phb_list, 0, sizeof(phb_list) ); 813 memset( &phb_list, 0, sizeof(phb_list) );
815 phb_list.entry = p_pEntry; 815 phb_list.entry = p_pEntry;
816 #else 816 #else
817 phb_list.entry = temp_pEntry; 817 phb_list.entry = temp_pEntry;
818 #endif 818 #endif
819 phb_list.num_entries = PB_MAX_FIND_ENTRIES; 819 phb_list.num_entries = PB_MAX_FIND_ENTRIES;
820 820
821 /* Search phonebook for up to 4 entries with the last 6 digits matching number */ 821 /* Search phonebook for up to 4 entries with the last 6 digits matching number */
822 822
823 #ifdef NO_ASCIIZ 823 #ifdef NO_ASCIIZ
824 /* GW Set up data structure for NO_ASCIIZ */ 824 /* GW Set up data structure for NO_ASCIIZ */
825 825
826 p_pszNumberText.dcs = MFW_DCS_8bits; 826 p_pszNumberText.dcs = MFW_DCS_8bits;
827 p_pszNumberText.len = strlen(p_pszNumber); 827 p_pszNumberText.len = strlen(p_pszNumber);
828 828
829 // strcpy((char*)p_pszNumberText.data, p_pszNumber); 829 // strcpy((char*)p_pszNumberText.data, p_pszNumber);
830 /* cq15688 copy number into the text info structure using memcpy() instead of strcpy()3/03/04 MZ */ 830 /* cq15688 copy number into the text info structure using memcpy() instead of strcpy()3/03/04 MZ */
831 //Jul 29, 2004 REF: CRR 20888 Deepa M.D 831 //Jul 29, 2004 REF: CRR 20888 Deepa M.D
832 //First memset the structure and then memcpy. 832 //First memset the structure and then memcpy.
833 memset(p_pszNumberText.data, 0, sizeof(p_pszNumberText.data)); 833 memset(p_pszNumberText.data, 0, sizeof(p_pszNumberText.data));
834 memcpy( (char*)p_pszNumberText.data, p_pszNumber , p_pszNumberText.len ); 834 memcpy( (char*)p_pszNumberText.data, p_pszNumber , p_pszNumberText.len );
835 835
836 ret = phb_find_entries( 836 ret = phb_find_entries(
837 bookActiveBook(READ), /* phonebook */ 837 bookActiveBook(READ), /* phonebook */
838 &phb_index, /* returns index in phb */ 838 &phb_index, /* returns index in phb */
839 MFW_PHB_NUMBER, /* searching for number */ 839 MFW_PHB_NUMBER, /* searching for number */
840 PB_MAX_FIND_ENTRIES, /* return max. four entry */ 840 PB_MAX_FIND_ENTRIES, /* return max. four entry */
841 &p_pszNumberText, /* search this pattern */ 841 &p_pszNumberText, /* search this pattern */
842 &phb_list /* return structure */ 842 &phb_list /* return structure */
843 ); 843 );
844 844
845 #else 845 #else
846 ret = phb_find_entries( 846 ret = phb_find_entries(
847 bookActiveBook(READ), /* phonebook */ 847 bookActiveBook(READ), /* phonebook */
848 &phb_index, /* returns index in phb */ 848 &phb_index, /* returns index in phb */
849 MFW_PHB_NUMBER, /* searching for number */ 849 MFW_PHB_NUMBER, /* searching for number */
856 //Check return from phb_find_entries 856 //Check return from phb_find_entries
857 if (ret == MFW_PHB_FAIL) 857 if (ret == MFW_PHB_FAIL)
858 { 858 {
859 return (0); 859 return (0);
860 } 860 }
861 861
862 862
863 /* SPR#1727 - DS - Examine returned PB entries and find best match */ 863 /* SPR#1727 - DS - Examine returned PB entries and find best match */
864 indexMatch = bookFindIndexMatchPB(&phb_list, phb_list.num_entries, p_pszNumber); 864 indexMatch = bookFindIndexMatchPB(&phb_list, phb_list.num_entries, p_pszNumber);
865 865
866 if (indexMatch == -1) /* No match found */ 866 if (indexMatch == -1) /* No match found */
888 #ifdef NO_ASCIIZ 888 #ifdef NO_ASCIIZ
889 /*MC SPR 1319*/ 889 /*MC SPR 1319*/
890 #ifdef EASY_TEXT_ENABLED 890 #ifdef EASY_TEXT_ENABLED
891 #ifndef FF_MMI_PB_OPTIM 891 #ifndef FF_MMI_PB_OPTIM
892 for (k=0;k<p_pEntry->name.len; k++) 892 for (k=0;k<p_pEntry->name.len; k++)
893 { 893 {
894 if (p_pEntry->name.data[k]==0 ) 894 if (p_pEntry->name.data[k]==0 )
895 { 895 {
896 debug[k] = '0'; 896 debug[k] = '0';
897 } 897 }
898 else 898 else
899 { 899 {
900 debug[k] = p_pEntry->name.data[k]; 900 debug[k] = p_pEntry->name.data[k];
901 } 901 }
902 } 902 }
903 TRACE_EVENT_P1("BFNIP: %s ", debug); 903 TRACE_EVENT_P1("BFNIP: %s ", debug);
904 #endif 904 #endif
905 905
906 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 906 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
907 if (p_pEntry->name.data[0] == 0x80) /* Unicode 0x80 style */ 907 if (p_pEntry->name.data[0] == 0x80) /* Unicode 0x80 style */
908 { 908 {
909 /*MC, removed var "actual_length*/ 909 /*MC, removed var "actual_length*/
910 int i; 910 int i;
911 for (i=1; i<MAX_ALPHA_LEN; i+=1) 911 for (i=1; i<MAX_ALPHA_LEN; i+=1)
912 { 912 {
913 l_name[i+1] = p_pEntry->name.data[i]; 913 l_name[i+1] = p_pEntry->name.data[i];
914 914
915 } 915 }
916 l_name[0] = p_pEntry->name.data[0]; 916 l_name[0] = p_pEntry->name.data[0];
917 l_name[1] = MAX_ALPHA_LEN; 917 l_name[1] = MAX_ALPHA_LEN;
918 918
919 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN ); 919 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN );
920 920
921 if (p_pEntry->name.len%2 == 1)/*if length of string odd*/ 921 if (p_pEntry->name.len%2 == 1)/*if length of string odd*/
922 { 922 {
923 p_pEntry->name.len++; /*MC we have to increase the length by one as we've shifted the string up*/ 923 p_pEntry->name.len++; /*MC we have to increase the length by one as we've shifted the string up*/
924 } 924 }
925 925
926 /*MC, ensure all the chars in the string after string length are 0*/ 926 /*MC, ensure all the chars in the string after string length are 0*/
927 for (i=p_pEntry->name.len; i<MAX_ALPHA_LEN; i++) 927 for (i=p_pEntry->name.len; i<MAX_ALPHA_LEN; i++)
928 { 928 {
929 p_pEntry->name.data[i]= 0; 929 p_pEntry->name.data[i]= 0;
930 } 930 }
931 931
932 #ifndef FF_MMI_PB_OPTIM 932 #ifndef FF_MMI_PB_OPTIM
933 for (k=0;k<p_pEntry->name.len; k++) 933 for (k=0;k<p_pEntry->name.len; k++)
934 { 934 {
935 if (p_pEntry->name.data[k]==0 ) 935 if (p_pEntry->name.data[k]==0 )
936 { 936 {
937 debug[k] = '0'; 937 debug[k] = '0';
944 944
945 TRACE_EVENT_P1("BNFIP conv: %s", debug); 945 TRACE_EVENT_P1("BNFIP conv: %s", debug);
946 946
947 sprintf(debug, "Length of phonebook entry:%d", p_pEntry->name.len); 947 sprintf(debug, "Length of phonebook entry:%d", p_pEntry->name.len);
948 #endif 948 #endif
949 949
950 } 950 }
951 else 951 else
952 #endif /* EASY_TEXT_ENABLED */ 952 #endif /* EASY_TEXT_ENABLED */
953 /* Marcus: Issue 963: 11/09/2002: Start */ 953 /* Marcus: Issue 963: 11/09/2002: Start */
954 { 954 {
966 TRACE_EVENT_P1("Converting name from 8-bit to ASCII, dcs: %d", p_pEntry->name.dcs); 966 TRACE_EVENT_P1("Converting name from 8-bit to ASCII, dcs: %d", p_pEntry->name.dcs);
967 ATB_convert_String((char*)p_pEntry->name.data, MFW_DCS_8bits, p_pEntry->name.len, (char*)l_name, MFW_ASCII, MAX_ALPHA_LEN, FALSE); 967 ATB_convert_String((char*)p_pEntry->name.data, MFW_DCS_8bits, p_pEntry->name.len, (char*)l_name, MFW_ASCII, MAX_ALPHA_LEN, FALSE);
968 p_pEntry->name.dcs = MFW_ASCII; 968 p_pEntry->name.dcs = MFW_ASCII;
969 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN); 969 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN);
970 } 970 }
971 971
972 } 972 }
973 /* Marcus: Issue 963: 11/09/2002: End */ 973 /* Marcus: Issue 963: 11/09/2002: End */
974 /*MC end*/ 974 /*MC end*/
975 #else 975 #else
976 bookGsm2Alpha( (UBYTE *) p_pEntry->name ); 976 bookGsm2Alpha( (UBYTE *) p_pEntry->name );
977 #endif /* NO_ASCIIZ */ 977 #endif /* NO_ASCIIZ */
978 978
979 return (1); 979 return (1);
980 } 980 }
981 981
982 982
983 983
985 /******************************************************************************* 985 /*******************************************************************************
986 986
987 $Function: bookFindNumberByPosition 987 $Function: bookFindNumberByPosition
988 988
989 $Description: locate a number given the index 989 $Description: locate a number given the index
990 990
991 $Returns: 0 if failure, 1 otherwise 991 $Returns: 0 if failure, 1 otherwise
992 992
993 $Arguments: index of the number to find, p_pentry, return structure 993 $Arguments: index of the number to find, p_pentry, return structure
994 994
995 *******************************************************************************/ 995 *******************************************************************************/
996 996
997 UBYTE bookFindNumberByPosition (UBYTE index,T_MFW_PHB_ENTRY* p_pEntry) 997 UBYTE bookFindNumberByPosition (UBYTE index,T_MFW_PHB_ENTRY* p_pEntry)
998 { 998 {
999 T_MFW_PHB_LIST phb_list; 999 T_MFW_PHB_LIST phb_list;
1033 int i; 1033 int i;
1034 if (p_pEntry->name.data[0] == 0x80 ||p_pEntry->name.data[0]== 0x00) 1034 if (p_pEntry->name.data[0] == 0x80 ||p_pEntry->name.data[0]== 0x00)
1035 { for (i=1; i<MAX_ALPHA_LEN; i+=1) 1035 { for (i=1; i<MAX_ALPHA_LEN; i+=1)
1036 { 1036 {
1037 l_name[i+1] = p_pEntry->name.data[i]; 1037 l_name[i+1] = p_pEntry->name.data[i];
1038 1038
1039 } 1039 }
1040 l_name[0] = p_pEntry->name.data[0]; 1040 l_name[0] = p_pEntry->name.data[0];
1041 l_name[1] = MAX_ALPHA_LEN; 1041 l_name[1] = MAX_ALPHA_LEN;
1042 1042
1043 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN ); 1043 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN );
1044 1044
1045 p_pEntry->name.len++;/* = actual_length;*/ 1045 p_pEntry->name.len++;/* = actual_length;*/
1046 1046
1047 } 1047 }
1048 else 1048 else
1049 #endif 1049 #endif
1050 1050
1051 /*SPR2175, use new function to convert from GSM to ASCII*/ 1051 /*SPR2175, use new function to convert from GSM to ASCII*/
1140 } 1140 }
1141 else 1141 else
1142 { 1142 {
1143 return; 1143 return;
1144 } 1144 }
1145 1145
1146 for ( index = 0; index < length; index++ ) 1146 for ( index = 0; index < length; index++ )
1147 alpha[index] = alpha[index] & 0x7F; 1147 alpha[index] = alpha[index] & 0x7F;
1148 } 1148 }
1149 1149
1150 1150
1165 UBYTE bookActiveBook( int process ) 1165 UBYTE bookActiveBook( int process )
1166 { 1166 {
1167 TRACE_FUNCTION( "bookActiveBook()" ); 1167 TRACE_FUNCTION( "bookActiveBook()" );
1168 1168
1169 /* SPR#1112 - SH - Return internal phonebook ID when appropriate */ 1169 /* SPR#1112 - SH - Return internal phonebook ID when appropriate */
1170 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1170 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
1171 // To get FDN book, when FDN is disabled, but only when accessing from FDM menu and not while we are in active call 1171 // To get FDN book, when FDN is disabled, but only when accessing from FDM menu and not while we are in active call
1172 1172
1173 if(menuFDN && (call_data.calls.numCalls==0)) 1173 if(menuFDN && (call_data.calls.numCalls==0))
1174 { 1174 {
1175 return PHB_FDN; 1175 return PHB_FDN;
1176 } 1176 }
1177 1177
1178 #ifdef INT_PHONEBOOK 1178 #ifdef INT_PHONEBOOK
1179 if (bookGetBookAvailable() && bookGetBookSelected()) 1179 if (bookGetBookAvailable() && bookGetBookSelected())
1180 return PHB_IPB; 1180 return PHB_IPB;
1181 #endif 1181 #endif
1182 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1182 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
1183 // When FDN is disabled we need to display only ADN entries in the phonebook menu. 1183 // When FDN is disabled we need to display only ADN entries in the phonebook menu.
1184 // We now return PHB_ADN instead of PHB_ADN_FDN. 1184 // We now return PHB_ADN instead of PHB_ADN_FDN.
1185 1185
1186 if(process == READ) 1186 if(process == READ)
1187 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN; 1187 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN;
1210 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1210 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1211 tBookStandard *data = (tBookStandard *) win_data->user; 1211 tBookStandard *data = (tBookStandard *) win_data->user;
1212 char Buffer[16]; 1212 char Buffer[16];
1213 int TxtToShow; 1213 int TxtToShow;
1214 1214
1215 1215
1216 /* Determine which book we are currently using 1216 /* Determine which book we are currently using
1217 */ 1217 */
1218 data->phbk->current.status.book = bookActiveBook(READ); 1218 data->phbk->current.status.book = bookActiveBook(READ);
1219 1219
1220 /* retrieve he status of the book, and create a string for output 1220 /* retrieve he status of the book, and create a string for output
1221 based on the status 1221 based on the status
1222 */ 1222 */
1223 #if(BOARD!=61) 1223 #if(BOARD!=61)
1224 Buffer[0] = '\0'; // OMAPS00042166 - RAVI /*a0393213 warnings removal-== changed to =*/ 1224 Buffer[0] = '\0'; // OMAPS00042166 - RAVI /*a0393213 warnings removal-== changed to =*/
1225 #endif 1225 #endif
1226 if ( bookGetCurrentStatus( &data->phbk->current.status ) == MFW_PHB_OK ) 1226 if ( bookGetCurrentStatus( &data->phbk->current.status ) == MFW_PHB_OK )
1227 { 1227 {
1228 /* SPR#1112 - Internal phonebook - show the current selected phonebook*/ 1228 /* SPR#1112 - Internal phonebook - show the current selected phonebook*/
1229 #ifdef INT_PHONEBOOK 1229 #ifdef INT_PHONEBOOK
1230 if (bookGetBookAvailable() && bookGetBookSelected()) 1230 if (bookGetBookAvailable() && bookGetBookSelected())
1284 1284
1285 /* Initialise the dialog control block with default information 1285 /* Initialise the dialog control block with default information
1286 */ 1286 */
1287 dlg_initDisplayData_TextId( &Dialog, TxtSoftOK, TxtCancel, TxtPressOk, TxtDelete, COLOUR_STATUS); 1287 dlg_initDisplayData_TextId( &Dialog, TxtSoftOK, TxtCancel, TxtPressOk, TxtDelete, COLOUR_STATUS);
1288 1288
1289 // Jun 23, 2004 REF: CRR MMI-SPR-21636 Rashmi C N(Sasken) 1289 // Jun 23, 2004 REF: CRR MMI-SPR-21636 Rashmi C N(Sasken)
1290 // Description: The confirmation for deleting entry from address book was a timed confirmation 1290 // Description: The confirmation for deleting entry from address book was a timed confirmation
1291 // screen. 1291 // screen.
1292 // Solution: Now the time is set to 'FOREVER' from 'TEN_SECS' 1292 // Solution: Now the time is set to 'FOREVER' from 'TEN_SECS'
1293 dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDeleteEntryCB, FOREVER, KEY_CLEAR | KEY_LEFT | KEY_RIGHT ); 1293 dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDeleteEntryCB, FOREVER, KEY_CLEAR | KEY_LEFT | KEY_RIGHT );
1294 1294
1300 /******************************************************************************* 1300 /*******************************************************************************
1301 1301
1302 $Function: bookActivateFDN 1302 $Function: bookActivateFDN
1303 1303
1304 $Description: information screen to tell user to activate FDN 1304 $Description: information screen to tell user to activate FDN
1305 1305
1306 $Returns: None 1306 $Returns: None
1307 1307
1308 $Arguments: None 1308 $Arguments: None
1309 1309
1310 *******************************************************************************/ 1310 *******************************************************************************/
1311 1311
1312 void bookActivateFDN( T_MFW_HND window ) 1312 void bookActivateFDN( T_MFW_HND window )
1313 { 1313 {
1314 tBookDialogData Dialog; 1314 tBookDialogData Dialog;
1330 /******************************************************************************* 1330 /*******************************************************************************
1331 1331
1332 $Function: bookInputStartNumberEditor 1332 $Function: bookInputStartNumberEditor
1333 1333
1334 $Description: Start the input handler using default properties 1334 $Description: Start the input handler using default properties
1335 1335
1336 $Returns: Handle of newly created window, or NULL if failure 1336 $Returns: Handle of newly created window, or NULL if failure
1337 1337
1338 $Arguments: parent, parent window handle, buffer, input buffer 1338 $Arguments: parent, parent window handle, buffer, input buffer
1339 1339
1340 *******************************************************************************/ 1340 *******************************************************************************/
1341 1341
1342 MfwHnd bookInputStartNumberEditor( MfwHnd parent, void *buffer ) 1342 MfwHnd bookInputStartNumberEditor( MfwHnd parent, void *buffer )
1343 { 1343 {
1344 T_AUI_EDITOR_DATA editor_data; 1344 T_AUI_EDITOR_DATA editor_data;
1360 else 1360 else
1361 { 1361 {
1362 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 1362 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
1363 // When EXT1 is not supported Number can be upto 20 characters. 1363 // When EXT1 is not supported Number can be upto 20 characters.
1364 editor_num_length = OLD_NUM_LENGTH; 1364 editor_num_length = OLD_NUM_LENGTH;
1365 TRACE_EVENT("EXT1 is not supported for this SIM"); 1365 TRACE_EVENT("EXT1 is not supported for this SIM");
1366 } 1366 }
1367 break; 1367 break;
1368 1368
1369 case PHB_FDN: 1369 case PHB_FDN:
1370 TRACE_EVENT("FDN book is selcted"); 1370 TRACE_EVENT("FDN book is selcted");
1371 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 1371 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
1372 //If EXT2 is present in service table then the FDN phone number can go upto 40 digits. 1372 //If EXT2 is present in service table then the FDN phone number can go upto 40 digits.
1373 if (sim_serv_table_check(SRV_EXT2) == ALLOCATED_AND_ACTIVATED) 1373 if (sim_serv_table_check(SRV_EXT2) == ALLOCATED_AND_ACTIVATED)
1374 { 1374 {
1375 editor_num_length = NUMBER_LENGTH; 1375 editor_num_length = NUMBER_LENGTH;
1378 else 1378 else
1379 { 1379 {
1380 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 1380 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
1381 // When EXT1 is not supported Number can be upto 20 characters. 1381 // When EXT1 is not supported Number can be upto 20 characters.
1382 editor_num_length = OLD_NUM_LENGTH; 1382 editor_num_length = OLD_NUM_LENGTH;
1383 TRACE_EVENT("EXT2 is not supported for this SIM"); 1383 TRACE_EVENT("EXT2 is not supported for this SIM");
1384 } 1384 }
1385 break; 1385 break;
1386 1386
1387 case PHB_IPB: // Internal phone book 1387 case PHB_IPB: // Internal phone book
1388 TRACE_EVENT("IPB - Internal phone book selected"); 1388 TRACE_EVENT("IPB - Internal phone book selected");
1389 editor_num_length = NUMBER_LENGTH; 1389 editor_num_length = NUMBER_LENGTH;
1390 break; 1390 break;
1391 default: 1391 default:
1392 TRACE_EVENT("Selected phone book is other than ADN,FDN,IPB"); 1392 TRACE_EVENT("Selected phone book is other than ADN,FDN,IPB");
1393 editor_num_length = NUMBER_LENGTH; 1393 editor_num_length = NUMBER_LENGTH;
1394 break; 1394 break;
1395 } 1395 }
1396 1396
1397 TRACE_EVENT_P1 ("Number length = %d ",editor_num_length); 1397 TRACE_EVENT_P1 ("Number length = %d ",editor_num_length);
1398 AUI_edit_SetDefault(&editor_data); 1398 AUI_edit_SetDefault(&editor_data);
1399 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); 1399 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
1400 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNumberCB); 1400 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNumberCB);
1401 // Change by Sasken ( Deepa M.d) on March 29th 2004 1401 // Change by Sasken ( Deepa M.d) on March 29th 2004
1419 /******************************************************************************* 1419 /*******************************************************************************
1420 1420
1421 $Function: bookInputStartNameEditor 1421 $Function: bookInputStartNameEditor
1422 1422
1423 $Description: Start the input handler using default properties 1423 $Description: Start the input handler using default properties
1424 1424
1425 $Returns: Handle of newly created window, or NULL if failure 1425 $Returns: Handle of newly created window, or NULL if failure
1426 1426
1427 $Arguments: parent, parent window handle, buffer, input buffer 1427 $Arguments: parent, parent window handle, buffer, input buffer
1428 1428
1429 *******************************************************************************/ 1429 *******************************************************************************/
1430 1430
1431 MfwHnd bookInputStartNameEditor( MfwHnd parent, void *buffer ) 1431 MfwHnd bookInputStartNameEditor( MfwHnd parent, void *buffer )
1432 { 1432 {
1433 T_MFW_WIN *win_data = ( (T_MFW_HDR *) parent )->data; 1433 T_MFW_WIN *win_data = ( (T_MFW_HDR *) parent )->data;
1466 { 1466 {
1467 chinese_data.TextString[0] = (char)0x80;//give string Unicode tag /*a0393213 lint warnings removal-typecast done*/ 1467 chinese_data.TextString[0] = (char)0x80;//give string Unicode tag /*a0393213 lint warnings removal-typecast done*/
1468 chinese_data.TextString[1] = 0x7F; 1468 chinese_data.TextString[1] = 0x7F;
1469 } 1469 }
1470 else 1470 else
1471 { 1471 {
1472 if (chinese_data.TextString[0]!= (char)0x80)/*If ASCII string*//*a0393213 lint warnings removal-typecast done*/ 1472 if (chinese_data.TextString[0]!= (char)0x80)/*If ASCII string*//*a0393213 lint warnings removal-typecast done*/
1473 { 1473 {
1474 1474
1475 /*SPR 1752, if ASCII string, use a latin editor*/ 1475 /*SPR 1752, if ASCII string, use a latin editor*/
1476 AUI_edit_SetDefault(&editor_data); 1476 AUI_edit_SetDefault(&editor_data);
1477 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); 1477 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
1478 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNameCB); 1478 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNameCB);
1479 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL); 1479 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL);
1520 /******************************************************************************* 1520 /*******************************************************************************
1521 1521
1522 $Function: bookInputDestroy 1522 $Function: bookInputDestroy
1523 1523
1524 $Description: Destroy Input Window 1524 $Description: Destroy Input Window
1525 1525
1526 $Returns: None 1526 $Returns: None
1527 1527
1528 $Arguments: Handle of window to be destroyed 1528 $Arguments: Handle of window to be destroyed
1529 1529
1530 *******************************************************************************/ 1530 *******************************************************************************/
1531 1531
1532 void bookInputDestroy( MfwHnd window ) 1532 void bookInputDestroy( MfwHnd window )
1533 { 1533 {
1534 TRACE_FUNCTION ("bookInputDestroy()"); 1534 TRACE_FUNCTION ("bookInputDestroy()");
1561 TRACE_FUNCTION("bookAddNameCB"); 1561 TRACE_FUNCTION("bookAddNameCB");
1562 1562
1563 switch (reason) 1563 switch (reason)
1564 { 1564 {
1565 case INFO_KCD_LEFT: 1565 case INFO_KCD_LEFT:
1566 { 1566 {
1567 /* Construct a new entry to be written to the phone book 1567 /* Construct a new entry to be written to the phone book
1568 */ 1568 */
1569 1569
1570 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 1570 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
1571 if (Phbk->edt_buf_name[0] == 0x80 )//MC, if unicode 1571 if (Phbk->edt_buf_name[0] == 0x80 )//MC, if unicode
1581 /* Store in the current phone book 1581 /* Store in the current phone book
1582 */ 1582 */
1583 if ( Phbk->UpdateAction == CREATE_ENTRY ) 1583 if ( Phbk->UpdateAction == CREATE_ENTRY )
1584 storeInFile( Phbk ); 1584 storeInFile( Phbk );
1585 else if ( Phbk->UpdateAction == MODIFY_EXISTING ) 1585 else if ( Phbk->UpdateAction == MODIFY_EXISTING )
1586 changeInFile( Phbk ); 1586 changeInFile( Phbk );
1587 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL ); 1587 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL );
1588 1588
1589 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */ 1589 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1590 mmi_int_phb_store_change_completion(); 1590 mmi_int_phb_store_change_completion();
1591 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1591 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1592 1592
1593 } 1593 }
1594 else 1594 else
1595 bookShowInformation( win, TxtInvalidInput, NULL,NULL ); 1595 bookShowInformation( win, TxtInvalidInput, NULL,NULL );
1596 1596
1597 /* And shut down, clearing the number and name windows as we go 1597 /* And shut down, clearing the number and name windows as we go
1598 */ 1598 */
1599 if ( Phbk->input_number_win ) 1599 if ( Phbk->input_number_win )
1600 { 1600 {
1601 AUI_edit_Destroy(Phbk->input_number_win); 1601 AUI_edit_Destroy(Phbk->input_number_win);
1602 Phbk->input_number_win = 0; 1602 Phbk->input_number_win = 0;
1603 } 1603 }
1604 /*SPR 1752, send destroy event rather than calling destroy function*/ 1604 /*SPR 1752, send destroy event rather than calling destroy function*/
1605 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 ); 1605 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 );
1608 // Jan 22, 2006 REF: OMAPS00061930 x0039928 1608 // Jan 22, 2006 REF: OMAPS00061930 x0039928
1609 // Fix : Start the phonebook timer in case of trying to modify the existing entry 1609 // Fix : Start the phonebook timer in case of trying to modify the existing entry
1610 if ( Phbk->UpdateAction == MODIFY_EXISTING ) 1610 if ( Phbk->UpdateAction == MODIFY_EXISTING )
1611 timStart(PhbSearchTim); 1611 timStart(PhbSearchTim);
1612 1612
1613 /*MC-- get rid of search window(and options menu), if just changed a chinese entry 1613 /*MC-- get rid of search window(and options menu), if just changed a chinese entry
1614 (prevent showing scrambled entry)*/ 1614 (prevent showing scrambled entry)*/
1615 if ( Phbk->UpdateAction == MODIFY_EXISTING && Mmi_getCurrentLanguage()==CHINESE_LANGUAGE) 1615 if ( Phbk->UpdateAction == MODIFY_EXISTING && Mmi_getCurrentLanguage()==CHINESE_LANGUAGE)
1616 { 1616 {
1617 bookMenuDestroy(Phbk->menu_options_win); 1617 bookMenuDestroy(Phbk->menu_options_win);
1618 Phbk->menu_options_win=0; 1618 Phbk->menu_options_win=0;
1704 T_phbk *Phbk = data->phbk; 1704 T_phbk *Phbk = data->phbk;
1705 TRACE_FUNCTION("bookAddNameCB"); 1705 TRACE_FUNCTION("bookAddNameCB");
1706 switch (reason) 1706 switch (reason)
1707 { 1707 {
1708 case INPUT_LEFT: 1708 case INPUT_LEFT:
1709 { 1709 {
1710 1710
1711 /* Construct a new entry to be written to the phone book 1711 /* Construct a new entry to be written to the phone book
1712 */ 1712 */
1713 #ifdef NO_ASCIIZ 1713 #ifdef NO_ASCIIZ
1714 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 1714 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
1724 if ( Phbk->UpdateAction == CREATE_ENTRY ) 1724 if ( Phbk->UpdateAction == CREATE_ENTRY )
1725 storeInFile( Phbk ); 1725 storeInFile( Phbk );
1726 else if ( Phbk->UpdateAction == MODIFY_EXISTING ) 1726 else if ( Phbk->UpdateAction == MODIFY_EXISTING )
1727 changeInFile( Phbk ); 1727 changeInFile( Phbk );
1728 1728
1729 1729
1730 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL ); 1730 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL );
1731 1731
1732 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */ 1732 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1733 mmi_int_phb_store_change_completion(); 1733 mmi_int_phb_store_change_completion();
1734 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1734 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1735 1735
1736 1736
1737 /* And shut down, clearing the number and name windows as we go 1737 /* And shut down, clearing the number and name windows as we go
1738 */ 1738 */
1739 if ( Phbk->input_number_win ) 1739 if ( Phbk->input_number_win )
1740 { 1740 {
1745 1745
1746 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 ); 1746 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 );
1747 Phbk->input_name_win = 0; 1747 Phbk->input_name_win = 0;
1748 1748
1749 #ifdef NO_ASCIIZ 1749 #ifdef NO_ASCIIZ
1750 /*MC-- get rid of search window(and options menu), if just changed a chinese entry 1750 /*MC-- get rid of search window(and options menu), if just changed a chinese entry
1751 (prevent showing scrambled entry)*/ 1751 (prevent showing scrambled entry)*/
1752 if ( Phbk->UpdateAction == MODIFY_EXISTING &&Mmi_getCurrentLanguage()==CHINESE_LANGUAGE) 1752 if ( Phbk->UpdateAction == MODIFY_EXISTING &&Mmi_getCurrentLanguage()==CHINESE_LANGUAGE)
1753 { bookMenuDestroy(Phbk->menu_options_win); 1753 { bookMenuDestroy(Phbk->menu_options_win);
1754 Phbk->menu_options_win=0; 1754 Phbk->menu_options_win=0;
1755 bookSearchDestroy( Phbk->search_win); 1755 bookSearchDestroy( Phbk->search_win);
1756 Phbk->search_win=0; 1756 Phbk->search_win=0;
1757 1757
1758 } 1758 }
1759 #endif 1759 #endif
1760 1760
1761 1761
1762 } 1762 }
1763 break; 1763 break;
1764 1764
1765 case INPUT_RIGHT: 1765 case INPUT_RIGHT:
1828 } 1828 }
1829 } 1829 }
1830 } 1830 }
1831 1831
1832 #endif /* NEW_EDITOR */ 1832 #endif /* NEW_EDITOR */
1833 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1833 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
1834 // This is called when we exit the FDN Numbers menu. So unsetting the menuFDN flag here 1834 // This is called when we exit the FDN Numbers menu. So unsetting the menuFDN flag here
1835 1835
1836 void fdn_menu_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason) 1836 void fdn_menu_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason)
1837 { 1837 {
1838 TRACE_EVENT("fdn_menu_cb"); 1838 TRACE_EVENT("fdn_menu_cb");
1839 menuFDN=0; 1839 menuFDN=0;
1840 } 1840 }
1841 1841
1842 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1842 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
1843 // This is called to display the FDN Numbers menu. The menuFDN flag is set here 1843 // This is called to display the FDN Numbers menu. The menuFDN flag is set here
1844 1844
1845 int bookFDNMenu(MfwMnu* menu, MfwMnuItem* item) 1845 int bookFDNMenu(MfwMnu* menu, MfwMnuItem* item)
1846 { 1846 {
1847 T_MFW_HND win = mfw_parent(mfw_header()); 1847 T_MFW_HND win = mfw_parent(mfw_header());
1848 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 1848 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
1849 tBookStandard *data = (tBookStandard *) win_data->user; 1849 tBookStandard *data = (tBookStandard *) win_data->user;
1850 1850
1851 1851
1852 1852
1853 menuFDN=1; 1853 menuFDN=1;
1854 // Sep 29, 2004 REF: CRR 25041 xvilliva 1854 // Sep 29, 2004 REF: CRR 25041 xvilliva
1855 // The bookMenuStart() is called with the window data->phbk->win, 1855 // The bookMenuStart() is called with the window data->phbk->win,
1856 // similar to the function bookFDNMenu() to avoid crash. The menu window 1856 // similar to the function bookFDNMenu() to avoid crash. The menu window
1857 // thus created is stored, which will be deleted while phonebook menu is 1857 // thus created is stored, which will be deleted while phonebook menu is
1858 // destroyed. 1858 // destroyed.
1859 data->phbk->menu_call_options_win_2 = bookMenuStart( data->phbk->win, bookNameMenuFDNAttributes(),0); 1859 data->phbk->menu_call_options_win_2 = bookMenuStart( data->phbk->win, bookNameMenuFDNAttributes(),0);
1860 SEND_EVENT(data->phbk->menu_call_options_win_2, ADD_CALLBACK, NULL, (void *)fdn_menu_cb); 1860 SEND_EVENT(data->phbk->menu_call_options_win_2, ADD_CALLBACK, NULL, (void *)fdn_menu_cb);
1861 1861
1862 return 0; /* to remove warning Aug - 11 */ 1862 return 0; /* to remove warning Aug - 11 */
1863 } 1863 }
1864 1864
1865 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN 1865 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN
1866 // Description: Current state of FDN not highlighted 1866 // Description: Current state of FDN not highlighted
1867 // Fix: Instead of showing the submenu directly we call this function 1867 // Fix: Instead of showing the submenu directly we call this function
1868 // where we set the menu and also higlight the previously selected menu item 1868 // where we set the menu and also higlight the previously selected menu item
1869 1869
1870 extern MfwMnuAttr *FDNMenu(void); 1870 extern MfwMnuAttr *FDNMenu(void);
1871 void settingsFocusFDNCurSel(void) 1871 void settingsFocusFDNCurSel(void)
1872 { 1872 {
1876 1876
1877 T_MFW_HND win = mfw_parent(mfw_header()); 1877 T_MFW_HND win = mfw_parent(mfw_header());
1878 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 1878 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
1879 tBookStandard *data = (tBookStandard *) win_data->user; 1879 tBookStandard *data = (tBookStandard *) win_data->user;
1880 1880
1881 // Sep 29, 2004 REF: CRR 25041 xvilliva 1881 // Sep 29, 2004 REF: CRR 25041 xvilliva
1882 // The bookMenuStart() is called with the window data->phbk->win, 1882 // The bookMenuStart() is called with the window data->phbk->win,
1883 // similar to the function bookFDNMenu() to avoid crash. The menu window 1883 // similar to the function bookFDNMenu() to avoid crash. The menu window
1884 // thus created is stored, which will be deleted while phonebook menu is 1884 // thus created is stored, which will be deleted while phonebook menu is
1885 // destroyed. 1885 // destroyed.
1886 data->phbk->menu_options_win_2= bookMenuStart(data->phbk->win, FDNMenu(), 0); 1886 data->phbk->menu_options_win_2= bookMenuStart(data->phbk->win, FDNMenu(), 0);
1887 CurSel = (phb_get_mode() == PHB_RESTRICTED)?FIRSTMENUITEM:SECONDMENUITEM; 1887 CurSel = (phb_get_mode() == PHB_RESTRICTED)?FIRSTMENUITEM:SECONDMENUITEM;
1888 SEND_EVENT(data->phbk->menu_options_win_2, DEFAULT_OPTION, NULL, &CurSel); 1888 SEND_EVENT(data->phbk->menu_options_win_2, DEFAULT_OPTION, NULL, &CurSel);
1889 } 1889 }
1890 1890
1928 1928
1929 *******************************************************************************/ 1929 *******************************************************************************/
1930 static void mmi_int_phb_store_change_completion() 1930 static void mmi_int_phb_store_change_completion()
1931 { 1931 {
1932 /* Reset the "add" and "change" flags only incase of Internal PHB */ 1932 /* Reset the "add" and "change" flags only incase of Internal PHB */
1933 if ( bookGetBookSelected() == TRUE ) 1933 if ( bookGetBookSelected() == TRUE )
1934 { 1934 {
1935 addname_flag = FALSE; 1935 addname_flag = FALSE;
1936 1936
1937 changename_flag = FALSE; 1937 changename_flag = FALSE;
1938 } 1938 }
1939 1939
1940 return; 1940 return;
1941 } 1941 }
1942 1942
1943 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1943 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1944 1944