comparison src/ui/bmi/mmiBookServices.c @ 142:ec9f955fc487

mmiBook*.c: bogotab fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Nov 2020 08:43:59 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
141:67b91d34f75e 142:ec9f955fc487
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: PhoneBook 14 $Module: PhoneBook
15 $File: MmiBookServices.c 15 $File: MmiBookServices.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
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
90 90
91 *******************************************************************************/ 91 *******************************************************************************/
92
93 92
94 93
95 94
96 /******************************************************************************* 95 /*******************************************************************************
97 96
141 #include "mfw_nm.h" 140 #include "mfw_nm.h"
142 #include "mfw_phb.h" 141 #include "mfw_phb.h"
143 #include "mfw_mme.h" 142 #include "mfw_mme.h"
144 #include "mfw_sat.h" 143 #include "mfw_sat.h"
145 #include "mfw_sms.h" 144 #include "mfw_sms.h"
146 #include "mfw_cnvt.h" //GW Added for 'mfw_SIM2GsmStr' 145 #include "mfw_cnvt.h" //GW Added for 'mfw_SIM2GsmStr'
147 146
148 #include "dspl.h" 147 #include "dspl.h"
149 148
150 #include "ksd.h" 149 #include "ksd.h"
151 #include "psa.h" 150 #include "psa.h"
152 #include "psa_sim.h" // June 07, 2005 REF: CRR MMI-FIX-31545 x0021334 151 #include "psa_sim.h" // June 07, 2005 REF: CRR MMI-FIX-31545 x0021334
153 152
154 #include "MmiMain.h" 153 #include "MmiMain.h"
155 #include "MmiBookController.h" 154 #include "MmiBookController.h"
156 #include "MmiDummy.h" 155 #include "MmiDummy.h"
157 #include "MmiDialogs.h" 156 #include "MmiDialogs.h"
158 #include "MmiLists.h" 157 #include "MmiLists.h"
159
160 158
161 159
162 #include "MmiMenu.h" 160 #include "MmiMenu.h"
163 #include "mmiCall.h" 161 #include "mmiCall.h"
164 #include "Mmiicons.h" 162 #include "Mmiicons.h"
216 # define PB_MAX_FIND_ENTRIES 1 214 # define PB_MAX_FIND_ENTRIES 1
217 #else 215 #else
218 # define PB_MAX_FIND_ENTRIES 4 216 # define PB_MAX_FIND_ENTRIES 4
219 #endif 217 #endif
220 218
221 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN 219 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN
222 220
223 #define FIRSTMENUITEM 0 221 #define FIRSTMENUITEM 0
224 #define SECONDMENUITEM 1 222 #define SECONDMENUITEM 1
225 #define OLD_NUM_LENGTH 21 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 223 #define OLD_NUM_LENGTH 21 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
226 224
262 { 260 {
263 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 261 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
264 tBookStandard *data = (tBookStandard *) win_data->user; 262 tBookStandard *data = (tBookStandard *) win_data->user;
265 T_phbk *Phbk = data->phbk; 263 T_phbk *Phbk = data->phbk;
266 264
267 TRACE_EVENT_P1("bookDeleteEntryCB index %d", Phbk->current.entry[Phbk->current.selectedName].index); 265 TRACE_EVENT_P1("bookDeleteEntryCB index %d", Phbk->current.entry[Phbk->current.selectedName].index);
268 266
269 /* This call back is invoked from the delete entry dialog confirmation 267 /* This call back is invoked from the delete entry dialog confirmation
270 screen, and will only respond to the left key (OK) being selected. 268 screen, and will only respond to the left key (OK) being selected.
271 */ 269 */
272 switch ( reason ) 270 switch ( reason )
273 { 271 {
274 case INFO_KCD_LEFT: 272 case INFO_KCD_LEFT:
275 { 273 {
276 if (( Phbk->current.status.book == PHB_UPN) || 274 if (( Phbk->current.status.book == PHB_UPN) ||
277 (Phbk->current.status.book == PHB_FDN )) 275 (Phbk->current.status.book == PHB_FDN ))
278 deleteFromFile( Phbk, Phbk->current.status.book ); 276 deleteFromFile( Phbk, Phbk->current.status.book );
279 else 277 else
280 deleteFromFile( Phbk, bookActiveBook(WRITE) ); 278 deleteFromFile( Phbk, bookActiveBook(WRITE) );
281 279
282 /* retrieve he status of the book, and create a string for output 280 /* retrieve he status of the book, and create a string for output
295 break; 293 break;
296 } 294 }
297 } 295 }
298 296
299 297
300
301
302
303
304
305
306 /******************************************************************************* 298 /*******************************************************************************
307 299
308 Public Methods 300 Public Methods
309 301
310 *******************************************************************************/ 302 *******************************************************************************/
311
312
313
314
315
316
317 303
318 304
319 /******************************************************************************* 305 /*******************************************************************************
320 306
321 $Function: bookInitialise 307 $Function: bookInitialise
333 { 319 {
334 TRACE_FUNCTION( "bookInitialise()" ); 320 TRACE_FUNCTION( "bookInitialise()" );
335 321
336 /* SPR#1112 - SH - Added E_PHB_READY and E_PHB_BUSY */ 322 /* 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 323 phb = phb_create( 0, (MfwEvt) (E_PHB_UPN_LIST | E_PHB_ERROR | E_PHB_STATUS
338 | E_PHB_READY | E_PHB_BUSY), (MfwCb) bookEvent ); 324 | E_PHB_READY | E_PHB_BUSY), (MfwCb) bookEvent );
339 325
340 } 326 }
341 327
342 /* SPR#1112 - Initialise internal phonebook */ 328 /* SPR#1112 - Initialise internal phonebook */
343 #ifdef INT_PHONEBOOK 329 #ifdef INT_PHONEBOOK
355 341
356 *******************************************************************************/ 342 *******************************************************************************/
357 343
358 void bookInitInternal( void ) 344 void bookInitInternal( void )
359 { 345 {
360 UBYTE intphonebook; 346 UBYTE intphonebook;
361 T_MFW ret; 347 T_MFW ret;
362 348
363 ret = GI_pb_GetPhonebook(&intphonebook); 349 ret = GI_pb_GetPhonebook(&intphonebook);
364 350
365 if (ret==MFW_PHB_OK) 351 if (ret==MFW_PHB_OK)
366 { 352 {
367 bookSetBookAvailable(TRUE); 353 bookSetBookAvailable(TRUE);
368 GI_pb_Initialise(); 354 GI_pb_Initialise();
369 if (intphonebook) 355 if (intphonebook)
370 { 356 {
371 bookSetBookSelected(TRUE); 357 bookSetBookSelected(TRUE);
372 } 358 }
373 else 359 else
374 bookSetBookSelected(FALSE); 360 bookSetBookSelected(FALSE);
375 } 361 }
376 else 362 else
377 bookSetBookAvailable(FALSE); 363 bookSetBookAvailable(FALSE);
378 364
379 return; 365 return;
380 } 366 }
381 367
382 368
383 /******************************************************************************* 369 /*******************************************************************************
384 370
385 $Function: bookGetBookSelected 371 $Function: bookGetBookSelected
386 372
387 $Description: Is the internal phonebook selected? 373 $Description: Is the internal phonebook selected?
388 374
389 $Returns: TRUE if internal phonebook is selected, FALSE otherwise 375 $Returns: TRUE if internal phonebook is selected, FALSE otherwise
390 376
391 $Arguments: none 377 $Arguments: none
392 378
393 *******************************************************************************/ 379 *******************************************************************************/
394 380
395 BOOL bookGetBookSelected() 381 BOOL bookGetBookSelected()
396 { 382 {
397 return ipbBookSelected; 383 return ipbBookSelected;
398 } 384 }
399 385
400 386
401 /******************************************************************************* 387 /*******************************************************************************
402 388
403 $Function: bookSetBookSelected 389 $Function: bookSetBookSelected
404 390
405 $Description: Select or deselect the internal phonebook 391 $Description: Select or deselect the internal phonebook
406 392
407 $Returns: None. 393 $Returns: None.
408 394
409 $Arguments: TRUE to select internal phonebook, FALSE to select SIM phonebook 395 $Arguments: TRUE to select internal phonebook, FALSE to select SIM phonebook
410 396
411 *******************************************************************************/ 397 *******************************************************************************/
412 398
413 void bookSetBookSelected(UBYTE bookSelected) 399 void bookSetBookSelected(UBYTE bookSelected)
414 { 400 {
415 ipbBookSelected = bookSelected; 401 ipbBookSelected = bookSelected;
416 402
417 return; 403 return;
418 } 404 }
419 405
420 406
421 /******************************************************************************* 407 /*******************************************************************************
422 408
423 $Function: bookGetBookAvailable 409 $Function: bookGetBookAvailable
424 410
425 $Description: Is the internal phonebook available for use? 411 $Description: Is the internal phonebook available for use?
426 412
427 $Returns: TRUE if internal phonebook is available, FALSE otherwise 413 $Returns: TRUE if internal phonebook is available, FALSE otherwise
428 414
429 $Arguments: none 415 $Arguments: none
430 416
431 *******************************************************************************/ 417 *******************************************************************************/
432 418
433 BOOL bookGetBookAvailable() 419 BOOL bookGetBookAvailable()
434 { 420 {
435 return ipbBookAvailable; 421 return ipbBookAvailable;
436 } 422 }
437 423
438 424
439 /******************************************************************************* 425 /*******************************************************************************
440 426
441 $Function: bookSetBookAvailable 427 $Function: bookSetBookAvailable
442 428
443 $Description: Indicate whether or not the internal phonebook is available for use 429 $Description: Indicate whether or not the internal phonebook is available for use
444 430
445 $Returns: None. 431 $Returns: None.
446 432
447 $Arguments: TRUE to if internal phonebook is available, FALSE otherwise 433 $Arguments: TRUE to if internal phonebook is available, FALSE otherwise
448 434
449 *******************************************************************************/ 435 *******************************************************************************/
450 436
451 void bookSetBookAvailable(UBYTE bookAvailable) 437 void bookSetBookAvailable(UBYTE bookAvailable)
452 { 438 {
453 ipbBookAvailable = bookAvailable; 439 ipbBookAvailable = bookAvailable;
454 440
455 return; 441 return;
456 } 442 }
457 443
458 #endif 444 #endif
459
460
461 445
462 446
463 /******************************************************************************* 447 /*******************************************************************************
464 448
465 $Function: bookExit 449 $Function: bookExit
474 *******************************************************************************/ 458 *******************************************************************************/
475 459
476 void bookExit( void ) 460 void bookExit( void )
477 { 461 {
478 TRACE_FUNCTION( "bookExit()" ); 462 TRACE_FUNCTION( "bookExit()" );
479 phb_delete( phb ); 463 phb_delete( phb );
480 /* SPR#1112 - SH - Now redundant */ 464 /* SPR#1112 - SH - Now redundant */
481 // bookDeletePhoneBook(); 465 // bookDeletePhoneBook();
482 466
483 /* SPR#1112 - SH - Exit internal phonebook if activated */ 467 /* SPR#1112 - SH - Exit internal phonebook if activated */
484 #ifdef INT_PHONEBOOK 468 #ifdef INT_PHONEBOOK
485 if (bookGetBookAvailable()) 469 if (bookGetBookAvailable())
486 GI_pb_Exit(); 470 GI_pb_Exit();
487 #endif 471 #endif
488 472
489 return; 473 return;
490 } 474 }
491
492
493
494
495
496
497 475
498 476
499 /******************************************************************************* 477 /*******************************************************************************
500 478
501 $Function: bookAddName 479 $Function: bookAddName
517 /* Populate the name and number records with the provided number 495 /* Populate the name and number records with the provided number
518 */ 496 */
519 497
520 498
521 /*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ 499 /*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/
522 memset( Phbk->edt_buf_name, 0, MAX_ALPHA_LEN ); 500 memset( Phbk->edt_buf_name, 0, MAX_ALPHA_LEN );
523 memcpy( Phbk->edt_buf_number, (char*)number, PHB_MAX_LEN ); 501 memcpy( Phbk->edt_buf_number, (char*)number, PHB_MAX_LEN );
524 502
525 /* Populate the input specifier structure and use it to 503 /* Populate the input specifier structure and use it to
526 perform the next action, note when we return we start 504 perform the next action, note when we return we start
527 adding a new name. 505 adding a new name.
530 data->phbk->input_name_win = bookInputStartNameEditor( 508 data->phbk->input_name_win = bookInputStartNameEditor(
531 data->win, (char*)Phbk->edt_buf_name ); 509 data->win, (char*)Phbk->edt_buf_name );
532 } 510 }
533 511
534 512
535
536
537
538
539
540
541 /******************************************************************************* 513 /*******************************************************************************
542 514
543 $Function: bookShowInformation 515 $Function: bookShowInformation
544 516
545 $Description: general information dialog routine 517 $Description: general information dialog routine
556 { 528 {
557 T_DISPLAY_DATA display_info; 529 T_DISPLAY_DATA display_info;
558 530
559 TRACE_FUNCTION( "bookShowInformation()" ); 531 TRACE_FUNCTION( "bookShowInformation()" );
560 532
561 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId, TxtNull, COLOUR_BOOK_POPUP); 533 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId, TxtNull, COLOUR_BOOK_POPUP);
562 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC) cb_function, THREE_SECS, KEY_CLEAR ); 534 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC) cb_function, THREE_SECS, KEY_CLEAR );
563 display_info.TextString = text; 535 display_info.TextString = text;
564 536
565 /* Call Info Screen 537 /* Call Info Screen
566 */ 538 */
582 time - timeout for dialog 554 time - timeout for dialog
583 555
584 *******************************************************************************/ 556 *******************************************************************************/
585 557
586 T_MFW_HND bookShowInfoScreen( MfwHnd parent, int txtId1, int txtId2, T_VOID_FUNC cb_function, 558 T_MFW_HND bookShowInfoScreen( MfwHnd parent, int txtId1, int txtId2, T_VOID_FUNC cb_function,
587 USHORT Identifier, ULONG Time) 559 USHORT Identifier, ULONG Time)
588 { 560 {
589 T_DISPLAY_DATA display_info; 561 T_DISPLAY_DATA display_info;
590 562
591 TRACE_FUNCTION( "bookShowInformation()" ); 563 TRACE_FUNCTION( "bookShowInformation()" );
592 564
593 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_BOOK_POPUP); 565 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); 566 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)cb_function, Time, KEY_CLEAR);
595 567
596 display_info.Identifier = Identifier; 568 display_info.Identifier = Identifier;
597 569
598 /* Call Info Screen 570 /* Call Info Screen
599 */ 571 */
600 return info_dialog( parent, &display_info ); 572 return info_dialog( parent, &display_info );
601 } 573 }
625 int maxMatchChars = 0; 597 int maxMatchChars = 0;
626 int count; /* Number of matching characters */ 598 int count; /* Number of matching characters */
627 int lenNum; 599 int lenNum;
628 int lenNumPB; 600 int lenNumPB;
629 int firstNotMatch=0; 601 int firstNotMatch=0;
630
631
632 602
633 603
634 TRACE_FUNCTION("bookFindIndexMatchPB()"); 604 TRACE_FUNCTION("bookFindIndexMatchPB()");
635 605
636 #ifdef TRACE_PB_DEBUG 606 #ifdef TRACE_PB_DEBUG
710 /* Return index of best match */ 680 /* Return index of best match */
711 return indexMatch; 681 return indexMatch;
712 } 682 }
713 683
714 684
715
716
717
718 /******************************************************************************* 685 /*******************************************************************************
719 686
720 $Function: bookFindNameInPhonebook 687 $Function: bookFindNameInPhonebook
721 688
722 $Description: SPR#1112 - Modified function to search in alternate phonebook. 689 $Description: SPR#1112 - Modified function to search in alternate phonebook.
723 Locates the name in the current phonebook. If the current phonebook is 690 Locates the name in the current phonebook. If the current phonebook is
724 the internal phonebook and no result is found, the SIM phonebook is also 691 the internal phonebook and no result is found, the SIM phonebook is also
725 searched. 692 searched.
726 693
727 $Returns: 0 if error, 1 if successful 694 $Returns: 0 if error, 1 if successful
728 695
729 $Arguments: p_pszNumber, pointer to pattern to match, p_pEntry, pointer 696 $Arguments: p_pszNumber, pointer to pattern to match, p_pEntry, pointer
730 to buffer into which to store result. 697 to buffer into which to store result.
749 #ifdef INT_PHONEBOOK 716 #ifdef INT_PHONEBOOK
750 /* If not found in internal phonebook, try SIM */ 717 /* If not found in internal phonebook, try SIM */
751 718
752 if (!result && bookGetBookAvailable() && bookGetBookSelected()) 719 if (!result && bookGetBookAvailable() && bookGetBookSelected())
753 { 720 {
754 bookSetBookSelected(FALSE); 721 bookSetBookSelected(FALSE);
755 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry); 722 result = bookFindNameInSpecificPhonebook(p_pszNumber, p_pEntry);
756 bookSetBookSelected(TRUE); 723 bookSetBookSelected(TRUE);
757 } 724 }
758 #endif 725 #endif
759 726
760 return result; 727 return result;
761 } 728 }
764 /******************************************************************************* 731 /*******************************************************************************
765 732
766 $Function: bookFindNameInSpecificPhonebook 733 $Function: bookFindNameInSpecificPhonebook
767 734
768 $Description: Locates the name in a specified phone book 735 $Description: Locates the name in a specified phone book
769 SPR#1112 - SH - Separate this part of function, so we can call it twice 736 SPR#1112 - SH - Separate this part of function, so we can call it twice
770 $Returns: 0 if error, 1 if successful 737 $Returns: 0 if error, 1 if successful
771 738
772 $Arguments: p_pszNumber, pointer to pattern to match, p_pEntry, pointer 739 $Arguments: p_pszNumber, pointer to pattern to match, p_pEntry, pointer
773 to buffer into which to store result. 740 to buffer into which to store result.
774 741
777 *******************************************************************************/ 744 *******************************************************************************/
778 745
779 int bookFindNameInSpecificPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry ) 746 int bookFindNameInSpecificPhonebook( const char *p_pszNumber, T_MFW_PHB_ENTRY *p_pEntry )
780 { 747 {
781 #ifdef NO_ASCIIZ 748 #ifdef NO_ASCIIZ
782 T_MFW_PHB_TEXT p_pszNumberText; 749 T_MFW_PHB_TEXT p_pszNumberText;
783 #endif 750 #endif
784 751
785 T_MFW_PHB_LIST phb_list; //, new_list; // RAVI 752 T_MFW_PHB_LIST phb_list; //, new_list; // RAVI
786 753
787 SHORT phb_index = 0; 754 SHORT phb_index = 0;
805 772
806 if(p_pszNumber == 0 || p_pEntry == 0) 773 if(p_pszNumber == 0 || p_pEntry == 0)
807 return (0); 774 return (0);
808 775
809 if (strlen(p_pszNumber) < 1) 776 if (strlen(p_pszNumber) < 1)
810 return (0); 777 return (0);
811 778
812 memset( p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY) ); 779 memset( p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY) );
813 memset( &phb_list, 0, sizeof(phb_list) ); 780 memset( &phb_list, 0, sizeof(phb_list) );
814 #ifdef FF_MMI_PB_OPTIM 781 #ifdef FF_MMI_PB_OPTIM
815 phb_list.entry = p_pEntry; 782 phb_list.entry = p_pEntry;
832 //First memset the structure and then memcpy. 799 //First memset the structure and then memcpy.
833 memset(p_pszNumberText.data, 0, sizeof(p_pszNumberText.data)); 800 memset(p_pszNumberText.data, 0, sizeof(p_pszNumberText.data));
834 memcpy( (char*)p_pszNumberText.data, p_pszNumber , p_pszNumberText.len ); 801 memcpy( (char*)p_pszNumberText.data, p_pszNumber , p_pszNumberText.len );
835 802
836 ret = phb_find_entries( 803 ret = phb_find_entries(
837 bookActiveBook(READ), /* phonebook */ 804 bookActiveBook(READ), /* phonebook */
838 &phb_index, /* returns index in phb */ 805 &phb_index, /* returns index in phb */
839 MFW_PHB_NUMBER, /* searching for number */ 806 MFW_PHB_NUMBER, /* searching for number */
840 PB_MAX_FIND_ENTRIES, /* return max. four entry */ 807 PB_MAX_FIND_ENTRIES, /* return max. four entry */
841 &p_pszNumberText, /* search this pattern */ 808 &p_pszNumberText, /* search this pattern */
842 &phb_list /* return structure */ 809 &phb_list /* return structure */
843 ); 810 );
844 811
845 #else 812 #else
846 ret = phb_find_entries( 813 ret = phb_find_entries(
847 bookActiveBook(READ), /* phonebook */ 814 bookActiveBook(READ), /* phonebook */
848 &phb_index, /* returns index in phb */ 815 &phb_index, /* returns index in phb */
849 MFW_PHB_NUMBER, /* searching for number */ 816 MFW_PHB_NUMBER, /* searching for number */
850 PB_MAX_FIND_ENTRIES, /* return max. four entry */ 817 PB_MAX_FIND_ENTRIES, /* return max. four entry */
851 (char *)p_pszNumber, /* search this pattern */ 818 (char *)p_pszNumber, /* search this pattern */
852 &phb_list /* return structure */ 819 &phb_list /* return structure */
853 ); 820 );
854 #endif //NO_ASCIIZ 821 #endif //NO_ASCIIZ
855 822
856 //Check return from phb_find_entries 823 //Check return from phb_find_entries
857 if (ret == MFW_PHB_FAIL) 824 if (ret == MFW_PHB_FAIL)
858 { 825 {
859 return (0); 826 return (0);
860 } 827 }
861 828
862 829
863 /* SPR#1727 - DS - Examine returned PB entries and find best match */ 830 /* SPR#1727 - DS - Examine returned PB entries and find best match */
864 indexMatch = bookFindIndexMatchPB(&phb_list, phb_list.num_entries, p_pszNumber); 831 indexMatch = bookFindIndexMatchPB(&phb_list, phb_list.num_entries, p_pszNumber);
884 return (0); 851 return (0);
885 } 852 }
886 853
887 /* Convert name into appropriate format */ 854 /* Convert name into appropriate format */
888 #ifdef NO_ASCIIZ 855 #ifdef NO_ASCIIZ
889 /*MC SPR 1319*/ 856 /*MC SPR 1319*/
890 #ifdef EASY_TEXT_ENABLED 857 #ifdef EASY_TEXT_ENABLED
891 #ifndef FF_MMI_PB_OPTIM 858 #ifndef FF_MMI_PB_OPTIM
892 for (k=0;k<p_pEntry->name.len; k++) 859 for (k=0;k<p_pEntry->name.len; k++)
893 { 860 {
894 if (p_pEntry->name.data[k]==0 ) 861 if (p_pEntry->name.data[k]==0 )
895 { 862 {
896 debug[k] = '0'; 863 debug[k] = '0';
897 } 864 }
898 else 865 else
899 { 866 {
900 debug[k] = p_pEntry->name.data[k]; 867 debug[k] = p_pEntry->name.data[k];
901 } 868 }
902 } 869 }
903 TRACE_EVENT_P1("BFNIP: %s ", debug); 870 TRACE_EVENT_P1("BFNIP: %s ", debug);
904 #endif 871 #endif
905 872
906 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 873 /*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 */ 874 if (p_pEntry->name.data[0] == 0x80) /* Unicode 0x80 style */
908 { 875 {
909 /*MC, removed var "actual_length*/ 876 /*MC, removed var "actual_length*/
910 int i; 877 int i;
911 for (i=1; i<MAX_ALPHA_LEN; i+=1) 878 for (i=1; i<MAX_ALPHA_LEN; i+=1)
912 { 879 {
913 l_name[i+1] = p_pEntry->name.data[i]; 880 l_name[i+1] = p_pEntry->name.data[i];
914 881
915 } 882 }
916 l_name[0] = p_pEntry->name.data[0]; 883 l_name[0] = p_pEntry->name.data[0];
917 l_name[1] = MAX_ALPHA_LEN; 884 l_name[1] = MAX_ALPHA_LEN;
918 885
919 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN ); 886 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN );
920 887
921 if (p_pEntry->name.len%2 == 1)/*if length of string odd*/ 888 if (p_pEntry->name.len%2 == 1)/*if length of string odd*/
922 { 889 {
923 p_pEntry->name.len++; /*MC we have to increase the length by one as we've shifted the string up*/ 890 p_pEntry->name.len++; /*MC we have to increase the length by one as we've shifted the string up*/
924 } 891 }
925 892
926 /*MC, ensure all the chars in the string after string length are 0*/ 893 /*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++) 894 for (i=p_pEntry->name.len; i<MAX_ALPHA_LEN; i++)
928 { 895 {
929 p_pEntry->name.data[i]= 0; 896 p_pEntry->name.data[i]= 0;
930 } 897 }
931 898
932 #ifndef FF_MMI_PB_OPTIM 899 #ifndef FF_MMI_PB_OPTIM
933 for (k=0;k<p_pEntry->name.len; k++) 900 for (k=0;k<p_pEntry->name.len; k++)
934 { 901 {
935 if (p_pEntry->name.data[k]==0 ) 902 if (p_pEntry->name.data[k]==0 )
936 { 903 {
937 debug[k] = '0'; 904 debug[k] = '0';
938 } 905 }
939 else 906 else
940 { 907 {
941 debug[k] = p_pEntry->name.data[k]; 908 debug[k] = p_pEntry->name.data[k];
942 } 909 }
943 } 910 }
944 911
945 TRACE_EVENT_P1("BNFIP conv: %s", debug); 912 TRACE_EVENT_P1("BNFIP conv: %s", debug);
946 913
947 sprintf(debug, "Length of phonebook entry:%d", p_pEntry->name.len); 914 sprintf(debug, "Length of phonebook entry:%d", p_pEntry->name.len);
948 #endif 915 #endif
949 916
950 } 917 }
951 else 918 else
952 #endif /* EASY_TEXT_ENABLED */ 919 #endif /* EASY_TEXT_ENABLED */
953 /* Marcus: Issue 963: 11/09/2002: Start */ 920 /* Marcus: Issue 963: 11/09/2002: Start */
954 { 921 {
955 /* 922 /*
956 * bookGsm2Alpha requires ASCIIZ string - make sure it is. 923 * bookGsm2Alpha requires ASCIIZ string - make sure it is.
957 * This also will help calling functions that may assume ASCIIZ. 924 * This also will help calling functions that may assume ASCIIZ.
958 */ 925 */
959 if (sizeof(p_pEntry->name.data) > p_pEntry->name.len) 926 if (sizeof(p_pEntry->name.data) > p_pEntry->name.len)
960 { 927 {
961 p_pEntry->name.data[p_pEntry->name.len] = '\0'; 928 p_pEntry->name.data[p_pEntry->name.len] = '\0';
962 } 929 }
963 /*SPR2175, use new function to convert from GSM to ASCII*/ 930 /*SPR2175, use new function to convert from GSM to ASCII*/
964 { 931 {
965 932
966 TRACE_EVENT_P1("Converting name from 8-bit to ASCII, dcs: %d", p_pEntry->name.dcs); 933 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); 934 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; 935 p_pEntry->name.dcs = MFW_ASCII;
969 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN); 936 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN);
970 } 937 }
971 938
972 } 939 }
973 /* Marcus: Issue 963: 11/09/2002: End */ 940 /* Marcus: Issue 963: 11/09/2002: End */
974 /*MC end*/ 941 /*MC end*/
975 #else 942 #else
976 bookGsm2Alpha( (UBYTE *) p_pEntry->name ); 943 bookGsm2Alpha( (UBYTE *) p_pEntry->name );
977 #endif /* NO_ASCIIZ */ 944 #endif /* NO_ASCIIZ */
978 945
979 return (1); 946 return (1);
980 } 947 }
981 948
982 949
983 950 /*******************************************************************************
984 951
985 /******************************************************************************* 952 $Function: bookFindNumberByPosition
986 953
987 $Function: bookFindNumberByPosition 954 $Description: locate a number given the index
988 955
989 $Description: locate a number given the index 956 $Returns: 0 if failure, 1 otherwise
990 957
991 $Returns: 0 if failure, 1 otherwise 958 $Arguments: index of the number to find, p_pentry, return structure
992
993 $Arguments: index of the number to find, p_pentry, return structure
994 959
995 *******************************************************************************/ 960 *******************************************************************************/
996 961
997 UBYTE bookFindNumberByPosition (UBYTE index,T_MFW_PHB_ENTRY* p_pEntry) 962 UBYTE bookFindNumberByPosition (UBYTE index,T_MFW_PHB_ENTRY* p_pEntry)
998 { 963 {
1025 990
1026 /* otherwise copy the located information to the output structure 991 /* otherwise copy the located information to the output structure
1027 */ 992 */
1028 #ifdef NO_ASCIIZ 993 #ifdef NO_ASCIIZ
1029 994
1030 { 995 {
1031 #ifdef EASY_TEXT_ENABLED 996 #ifdef EASY_TEXT_ENABLED
1032 /*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ 997 /*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/
1033 int i; 998 int i;
1034 if (p_pEntry->name.data[0] == 0x80 ||p_pEntry->name.data[0]== 0x00) 999 if (p_pEntry->name.data[0] == 0x80 ||p_pEntry->name.data[0]== 0x00)
1035 { for (i=1; i<MAX_ALPHA_LEN; i+=1) 1000 { for (i=1; i<MAX_ALPHA_LEN; i+=1)
1036 { 1001 {
1037 l_name[i+1] = p_pEntry->name.data[i]; 1002 l_name[i+1] = p_pEntry->name.data[i];
1038 1003
1039 } 1004 }
1040 l_name[0] = p_pEntry->name.data[0]; 1005 l_name[0] = p_pEntry->name.data[0];
1041 l_name[1] = MAX_ALPHA_LEN; 1006 l_name[1] = MAX_ALPHA_LEN;
1042 1007
1043 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN ); 1008 memcpy( p_pEntry->name.data, (char*)l_name, MAX_ALPHA_LEN );
1044 1009
1045 p_pEntry->name.len++;/* = actual_length;*/ 1010 p_pEntry->name.len++;/* = actual_length;*/
1046 1011
1047 } 1012 }
1048 else 1013 else
1049 #endif 1014 #endif
1050 1015
1051 /*SPR2175, use new function to convert from GSM to ASCII*/ 1016 /*SPR2175, use new function to convert from GSM to ASCII*/
1052 if (p_pEntry->name.dcs == MFW_DCS_8bits && p_pEntry->name.data[0] != 0x80) 1017 if (p_pEntry->name.dcs == MFW_DCS_8bits && p_pEntry->name.data[0] != 0x80)
1053 { 1018 {
1054 ATB_convert_String((char*)p_pEntry->name.data, MFW_DCS_8bits, p_pEntry->name.len, (char*)l_name, MFW_ASCII, MAX_ALPHA_LEN, FALSE); 1019 ATB_convert_String((char*)p_pEntry->name.data, MFW_DCS_8bits, p_pEntry->name.len, (char*)l_name, MFW_ASCII, MAX_ALPHA_LEN, FALSE);
1055 p_pEntry->name.dcs = MFW_ASCII; 1020 p_pEntry->name.dcs = MFW_ASCII;
1056 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN); 1021 memcpy(p_pEntry->name.data, l_name, MAX_ALPHA_LEN);
1057 } 1022 }
1058 } 1023 }
1059 #else 1024 #else
1060 1025
1061 bookGsm2Alpha( (UBYTE *) p_pEntry->name ); 1026 bookGsm2Alpha( (UBYTE *) p_pEntry->name );
1062 1027
1065 /* successful return status 1030 /* successful return status
1066 */ 1031 */
1067 return 1; 1032 return 1;
1068 1033
1069 } 1034 }
1070
1071
1072
1073
1074
1075
1076 1035
1077 1036
1078 /******************************************************************************* 1037 /*******************************************************************************
1079 1038
1080 $Function: bookCallIndex 1039 $Function: bookCallIndex
1102 phb_list.num_entries = 1; 1061 phb_list.num_entries = 1;
1103 if ( ( status = phb_read_entries( bookActiveBook(READ), index, MFW_PHB_PHYSICAL, 1, &phb_list ) ) == MFW_PHB_OK ) 1062 if ( ( status = phb_read_entries( bookActiveBook(READ), index, MFW_PHB_PHYSICAL, 1, &phb_list ) ) == MFW_PHB_OK )
1104 callNumber( entry.number ); 1063 callNumber( entry.number );
1105 return status; 1064 return status;
1106 } 1065 }
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116 1066
1117 1067
1118 /******************************************************************************* 1068 /*******************************************************************************
1119 1069
1120 $Function: bookGsm2Alpha 1070 $Function: bookGsm2Alpha
1146 for ( index = 0; index < length; index++ ) 1096 for ( index = 0; index < length; index++ )
1147 alpha[index] = alpha[index] & 0x7F; 1097 alpha[index] = alpha[index] & 0x7F;
1148 } 1098 }
1149 1099
1150 1100
1151
1152
1153 /******************************************************************************* 1101 /*******************************************************************************
1154 1102
1155 $Function: bookActiveBook 1103 $Function: bookActiveBook
1156 1104
1157 $Description: Determine if the current active book is restricted or not 1105 $Description: Determine if the current active book is restricted or not
1166 { 1114 {
1167 TRACE_FUNCTION( "bookActiveBook()" ); 1115 TRACE_FUNCTION( "bookActiveBook()" );
1168 1116
1169 /* SPR#1112 - SH - Return internal phonebook ID when appropriate */ 1117 /* SPR#1112 - SH - Return internal phonebook ID when appropriate */
1170 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1118 // 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 1119 // To get FDN book, when FDN is disabled, but only when accessing from FDM menu and not while we are in active call
1172 1120
1173 if(menuFDN && (call_data.calls.numCalls==0)) 1121 if(menuFDN && (call_data.calls.numCalls==0))
1174 { 1122 {
1175 return PHB_FDN; 1123 return PHB_FDN;
1176 } 1124 }
1177 1125
1178 #ifdef INT_PHONEBOOK 1126 #ifdef INT_PHONEBOOK
1179 if (bookGetBookAvailable() && bookGetBookSelected()) 1127 if (bookGetBookAvailable() && bookGetBookSelected())
1180 return PHB_IPB; 1128 return PHB_IPB;
1181 #endif 1129 #endif
1182 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1130 // 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. 1131 // 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. 1132 // We now return PHB_ADN instead of PHB_ADN_FDN.
1185 1133
1186 if(process == READ) 1134 if(process == READ)
1187 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN; 1135 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN;
1188 else if(process == WRITE) 1136 else if(process == WRITE)
1189 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN; 1137 return ( phb_get_mode() == PHB_RESTRICTED ) ? PHB_FDN : PHB_ADN;
1190 return PHB_NONE; /*a0393213 warnings removal-added return statement*/ 1138 return PHB_NONE; /*a0393213 warnings removal-added return statement*/
1191 } 1139 }
1192
1193 1140
1194 1141
1195 /******************************************************************************* 1142 /*******************************************************************************
1196 1143
1197 $Function: bookMemoryView 1144 $Function: bookMemoryView
1207 void bookMemoryView( void ) 1154 void bookMemoryView( void )
1208 { 1155 {
1209 T_MFW_HND win = mfwParent( mfw_header() ); 1156 T_MFW_HND win = mfwParent( mfw_header() );
1210 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1157 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1211 tBookStandard *data = (tBookStandard *) win_data->user; 1158 tBookStandard *data = (tBookStandard *) win_data->user;
1212 char Buffer[16]; 1159 char Buffer[16];
1213 int TxtToShow; 1160 int TxtToShow;
1214 1161
1215 1162
1216 /* Determine which book we are currently using 1163 /* Determine which book we are currently using
1217 */ 1164 */
1218 data->phbk->current.status.book = bookActiveBook(READ); 1165 data->phbk->current.status.book = bookActiveBook(READ);
1219 1166
1220 /* retrieve he status of the book, and create a string for output 1167 /* retrieve he status of the book, and create a string for output
1221 based on the status 1168 based on the status
1222 */ 1169 */
1223 #if(BOARD!=61) 1170 #if(BOARD!=61)
1224 Buffer[0] = '\0'; // OMAPS00042166 - RAVI /*a0393213 warnings removal-== changed to =*/ 1171 Buffer[0] = '\0'; // OMAPS00042166 - RAVI /*a0393213 warnings removal-== changed to =*/
1225 #endif 1172 #endif
1226 if ( bookGetCurrentStatus( &data->phbk->current.status ) == MFW_PHB_OK ) 1173 if ( bookGetCurrentStatus( &data->phbk->current.status ) == MFW_PHB_OK )
1227 { 1174 {
1228 /* SPR#1112 - Internal phonebook - show the current selected phonebook*/ 1175 /* SPR#1112 - Internal phonebook - show the current selected phonebook*/
1229 #ifdef INT_PHONEBOOK 1176 #ifdef INT_PHONEBOOK
1230 if (bookGetBookAvailable() && bookGetBookSelected()) 1177 if (bookGetBookAvailable() && bookGetBookSelected())
1231 TxtToShow = TxtPhone; 1178 TxtToShow = TxtPhone;
1232 else 1179 else
1233 TxtToShow = TxtSIM; 1180 TxtToShow = TxtSIM;
1234 #else 1181 #else
1235 TxtToShow = TxtUsed; 1182 TxtToShow = TxtUsed;
1236 #endif 1183 #endif
1237 sprintf( Buffer, "%d/%d", 1184 sprintf( Buffer, "%d/%d",
1238 data->phbk->current.status.used_entries, 1185 data->phbk->current.status.used_entries,
1240 } 1187 }
1241 else 1188 else
1242 TxtToShow = TxtReadError; 1189 TxtToShow = TxtReadError;
1243 1190
1244 1191
1245 { 1192 {
1246 T_DISPLAY_DATA display_info; 1193 T_DISPLAY_DATA display_info;
1247 1194
1248 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtToShow, TxtNull , COLOUR_STATUS); 1195 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtToShow, TxtNull , COLOUR_STATUS);
1249 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_CLEAR ); 1196 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_CLEAR );
1250 display_info.TextString2 = Buffer; 1197 display_info.TextString2 = Buffer;
1251 1198
1252 /* Call Info Screen 1199 /* Call Info Screen
1253 */ 1200 */
1254 info_dialog( win, &display_info ); 1201 info_dialog( win, &display_info );
1255 } 1202 }
1256 1203
1257 } 1204 }
1258
1259
1260
1261
1262
1263
1264 1205
1265 1206
1266 /******************************************************************************* 1207 /*******************************************************************************
1267 1208
1268 $Function: bookDeleteEntry 1209 $Function: bookDeleteEntry
1282 { 1223 {
1283 tBookDialogData Dialog; 1224 tBookDialogData Dialog;
1284 1225
1285 /* Initialise the dialog control block with default information 1226 /* Initialise the dialog control block with default information
1286 */ 1227 */
1287 dlg_initDisplayData_TextId( &Dialog, TxtSoftOK, TxtCancel, TxtPressOk, TxtDelete, COLOUR_STATUS); 1228 dlg_initDisplayData_TextId( &Dialog, TxtSoftOK, TxtCancel, TxtPressOk, TxtDelete, COLOUR_STATUS);
1288 1229
1289 // Jun 23, 2004 REF: CRR MMI-SPR-21636 Rashmi C N(Sasken) 1230 // 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 1231 // Description: The confirmation for deleting entry from address book was a timed confirmation
1291 // screen. 1232 // screen.
1292 // Solution: Now the time is set to 'FOREVER' from 'TEN_SECS' 1233 // 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 ); 1234 dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDeleteEntryCB, FOREVER, KEY_CLEAR | KEY_LEFT | KEY_RIGHT );
1294 1235
1295 /* Show the dialog 1236 /* Show the dialog
1296 */ 1237 */
1297 info_dialog( Window, &Dialog ); 1238 info_dialog( Window, &Dialog );
1298 } 1239 }
1299 1240
1300 /******************************************************************************* 1241 /*******************************************************************************
1301 1242
1302 $Function: bookActivateFDN 1243 $Function: bookActivateFDN
1303 1244
1304 $Description: information screen to tell user to activate FDN 1245 $Description: information screen to tell user to activate FDN
1305 1246
1306 $Returns: None 1247 $Returns: None
1307 1248
1308 $Arguments: None 1249 $Arguments: None
1309 1250
1310 *******************************************************************************/ 1251 *******************************************************************************/
1311 1252
1312 void bookActivateFDN( T_MFW_HND window ) 1253 void bookActivateFDN( T_MFW_HND window )
1313 { 1254 {
1314 tBookDialogData Dialog; 1255 tBookDialogData Dialog;
1315 1256
1316 /* Initialise the dialog control block with default information 1257 /* Initialise the dialog control block with default information
1317 */ 1258 */
1318 dlg_initDisplayData_TextId( &Dialog, TxtNull, TxtNull, TxtPlease, TxtActivateFDN, COLOUR_STATUS); 1259 dlg_initDisplayData_TextId( &Dialog, TxtNull, TxtNull, TxtPlease, TxtActivateFDN, COLOUR_STATUS);
1319 dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)NULL, FOUR_SECS, KEY_CLEAR | KEY_LEFT | KEY_RIGHT ); 1260 dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)NULL, FOUR_SECS, KEY_CLEAR | KEY_LEFT | KEY_RIGHT );
1320 1261
1321 /* Show the dialog 1262 /* Show the dialog
1322 */ 1263 */
1323 info_dialog( window, &Dialog ); 1264 info_dialog( window, &Dialog );
1324 } 1265 }
1325 1266
1326 /* SPR#1428 - SH - New Editor: moved the following two functions 1267 /* SPR#1428 - SH - New Editor: moved the following two functions
1327 * from MmiBookInputWindow.c, which is now a redundant file */ 1268 * from MmiBookInputWindow.c, which is now a redundant file */
1328 #ifdef NEW_EDITOR 1269 #ifdef NEW_EDITOR
1329 1270
1330 /******************************************************************************* 1271 /*******************************************************************************
1331 1272
1332 $Function: bookInputStartNumberEditor 1273 $Function: bookInputStartNumberEditor
1333 1274
1334 $Description: Start the input handler using default properties 1275 $Description: Start the input handler using default properties
1335 1276
1336 $Returns: Handle of newly created window, or NULL if failure 1277 $Returns: Handle of newly created window, or NULL if failure
1337 1278
1338 $Arguments: parent, parent window handle, buffer, input buffer 1279 $Arguments: parent, parent window handle, buffer, input buffer
1339 1280
1340 *******************************************************************************/ 1281 *******************************************************************************/
1341 1282
1342 MfwHnd bookInputStartNumberEditor( MfwHnd parent, void *buffer ) 1283 MfwHnd bookInputStartNumberEditor( MfwHnd parent, void *buffer )
1343 { 1284 {
1344 T_AUI_EDITOR_DATA editor_data; 1285 T_AUI_EDITOR_DATA editor_data;
1345 U16 editor_num_length = NUMBER_LENGTH;; 1286 U16 editor_num_length = NUMBER_LENGTH;;
1346 TRACE_FUNCTION ("bookInputStartNumberEditor()"); 1287 TRACE_FUNCTION ("bookInputStartNumberEditor()");
1347 1288
1348 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 1289 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
1349 // Number length can be upto 41 when EXT1 is allocated and activated in SIM service table 1290 // Number length can be upto 41 when EXT1 is allocated and activated in SIM service table
1350 // 40 characters + 1 Null character 1291 // 40 characters + 1 Null character
1351 switch(bookActiveBook(WRITE)) 1292 switch(bookActiveBook(WRITE))
1393 editor_num_length = NUMBER_LENGTH; 1334 editor_num_length = NUMBER_LENGTH;
1394 break; 1335 break;
1395 } 1336 }
1396 1337
1397 TRACE_EVENT_P1 ("Number length = %d ",editor_num_length); 1338 TRACE_EVENT_P1 ("Number length = %d ",editor_num_length);
1398 AUI_edit_SetDefault(&editor_data); 1339 AUI_edit_SetDefault(&editor_data);
1399 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); 1340 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); 1341 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNumberCB);
1401 // Change by Sasken ( Deepa M.d) on March 29th 2004 1342 // Change by Sasken ( Deepa M.d) on March 29th 2004
1402 // Issue Number : MMI-SPR-12722 1343 // Issue Number : MMI-SPR-12722
1403 // Subject: Right softkey should be "Back" when the editor is empty 1344 // Subject: Right softkey should be "Back" when the editor is empty
1404 // Bug : Right softkey should be "Back" when the editor is empty 1345 // Bug : Right softkey should be "Back" when the editor is empty
1405 // Solution : Added alternative string for the right softkey tobe displayed when the editor is empty 1346 // Solution : Added alternative string for the right softkey tobe displayed when the editor is empty
1406 1347
1407 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterNumber, NULL); 1348 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterNumber, NULL);
1408 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack); 1349 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack);
1409 // June 22, 2006 REF: DRT OMAPS00081761 x0012849 1350 // June 22, 2006 REF: DRT OMAPS00081761 x0012849
1410 // Changed the limit frommm NUMBER_LENGTH to editor_num_length. 1351 // Changed the limit frommm NUMBER_LENGTH to editor_num_length.
1411 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_num_length); 1352 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_num_length);
1412 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE); 1353 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
1413 1354
1414 return AUI_edit_Start(parent, &editor_data); 1355 return AUI_edit_Start(parent, &editor_data);
1415 } 1356 }
1416 1357
1417 1358
1418 1359 /*******************************************************************************
1419 /******************************************************************************* 1360
1420 1361 $Function: bookInputStartNameEditor
1421 $Function: bookInputStartNameEditor 1362
1422 1363 $Description: Start the input handler using default properties
1423 $Description: Start the input handler using default properties 1364
1424 1365 $Returns: Handle of newly created window, or NULL if failure
1425 $Returns: Handle of newly created window, or NULL if failure 1366
1426 1367 $Arguments: parent, parent window handle, buffer, input buffer
1427 $Arguments: parent, parent window handle, buffer, input buffer
1428 1368
1429 *******************************************************************************/ 1369 *******************************************************************************/
1430 1370
1431 MfwHnd bookInputStartNameEditor( MfwHnd parent, void *buffer ) 1371 MfwHnd bookInputStartNameEditor( MfwHnd parent, void *buffer )
1432 { 1372 {
1433 T_MFW_WIN *win_data = ( (T_MFW_HDR *) parent )->data; 1373 T_MFW_WIN *win_data = ( (T_MFW_HDR *) parent )->data;
1434 tBookStandard *data = (tBookStandard *) win_data->user; 1374 tBookStandard *data = (tBookStandard *) win_data->user;
1435 T_phbk *Phbk = data->phbk; 1375 T_phbk *Phbk = data->phbk;
1436 T_AUI_EDITOR_DATA editor_data; 1376 T_AUI_EDITOR_DATA editor_data;
1437 U16 editor_length; 1377 U16 editor_length;
1438 1378
1439 TRACE_FUNCTION ("bookInputStartNameEditor()"); 1379 TRACE_FUNCTION ("bookInputStartNameEditor()");
1440 1380
1441 /* xreddymn OMAPS00079431 May-29-2006 1381 /* xreddymn OMAPS00079431 May-29-2006
1442 * Restrict the number of characters that the user can input for name 1382 * Restrict the number of characters that the user can input for name
1443 * based on which phonebook is selected. 1383 * based on which phonebook is selected.
1444 */ 1384 */
1445 if(bookGetBookSelected() == TRUE) 1385 if(bookGetBookSelected() == TRUE)
1446 { 1386 {
1447 /* For ME phonebook use MAX_ALPHA_LEN */ 1387 /* For ME phonebook use MAX_ALPHA_LEN */
1448 editor_length = MAX_ALPHA_LEN; 1388 editor_length = MAX_ALPHA_LEN;
1449 } 1389 }
1450 else 1390 else
1451 { 1391 {
1452 /* For SIM phonebook, restrict length to 14 */ 1392 /* For SIM phonebook, restrict length to 14 */
1453 editor_length = 15; 1393 editor_length = 15;
1454 } 1394 }
1455 1395
1456 /* Set up the default parameters for the input window */ 1396 /* Set up the default parameters for the input window */
1457 1397
1458 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED) 1398 #if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED)
1459 /*MC, the chinese editor MUST have a unicode string as input*/ 1399 /*MC, the chinese editor MUST have a unicode string as input*/
1460 /*MC , SPR 1242 merged in from b-sample build*/ 1400 /*MC , SPR 1242 merged in from b-sample build*/
1461 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) 1401 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
1462 { 1402 {
1463 T_CHINESE_DATA chinese_data; 1403 T_CHINESE_DATA chinese_data;
1464 chinese_data.TextString = (char*) Phbk->edt_buf_name; 1404 chinese_data.TextString = (char*) Phbk->edt_buf_name;
1465 if (chinese_data.TextString[0]== 0)//if, empty string 1405 if (chinese_data.TextString[0]== 0)//if, empty string
1466 { 1406 {
1467 chinese_data.TextString[0] = (char)0x80;//give string Unicode tag /*a0393213 lint warnings removal-typecast done*/ 1407 chinese_data.TextString[0] = (char)0x80;//give string Unicode tag /*a0393213 lint warnings removal-typecast done*/
1468 chinese_data.TextString[1] = 0x7F; 1408 chinese_data.TextString[1] = 0x7F;
1469 } 1409 }
1470 else 1410 else
1471 { 1411 {
1472 if (chinese_data.TextString[0]!= (char)0x80)/*If ASCII string*//*a0393213 lint warnings removal-typecast done*/ 1412 if (chinese_data.TextString[0]!= (char)0x80)/*If ASCII string*//*a0393213 lint warnings removal-typecast done*/
1473 { 1413 {
1474 1414
1475 /*SPR 1752, if ASCII string, use a latin editor*/ 1415 /*SPR 1752, if ASCII string, use a latin editor*/
1476 AUI_edit_SetDefault(&editor_data); 1416 AUI_edit_SetDefault(&editor_data);
1477 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); 1417 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); 1418 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNameCB);
1479 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL); 1419 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL);
1480 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */ 1420 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */
1481 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_length); 1421 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_length);
1482 AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); 1422 AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR);
1483 1423
1484 return AUI_edit_Start(parent, &editor_data); 1424 return AUI_edit_Start(parent, &editor_data);
1485 } 1425 }
1486 } 1426 }
1487 /*MC end*/ 1427 /*MC end*/
1488 chinese_data.Callback = (T_AUI_EDIT_CB)bookAddNameCB; 1428 chinese_data.Callback = (T_AUI_EDIT_CB)bookAddNameCB;
1489 chinese_data.Identifier = INPUT_LEFT ; 1429 chinese_data.Identifier = INPUT_LEFT ;
1490 chinese_data.LeftSoftKey = TxtSave; 1430 chinese_data.LeftSoftKey = TxtSave;
1491 chinese_data.DestroyEditor = TRUE; 1431 chinese_data.DestroyEditor = TRUE;
1492 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */ 1432 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */
1493 chinese_data.EditorSize = (USHORT)((editor_length-4)/2);//i.e.8 1433 chinese_data.EditorSize = (USHORT)((editor_length-4)/2);//i.e.8
1494 return chinese_input(parent, &chinese_data); 1434 return chinese_input(parent, &chinese_data);
1495 } 1435 }
1496 else 1436 else
1497 #endif /* CHINESE_MMI && EASY_TEXT_ENABLED */ 1437 #endif /* CHINESE_MMI && EASY_TEXT_ENABLED */
1498 { 1438 {
1499 AUI_edit_SetDefault(&editor_data); 1439 AUI_edit_SetDefault(&editor_data);
1500 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); 1440 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
1501 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNameCB); 1441 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)bookAddNameCB);
1502 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL); 1442 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterName, NULL);
1503 /*SPR 1752*/ 1443 /*SPR 1752*/
1504 #ifdef NO_ASCIIZ 1444 #ifdef NO_ASCIIZ
1505 if (Phbk->edt_buf_name[0] ==0x80) 1445 if (Phbk->edt_buf_name[0] ==0x80)
1506 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */ 1446 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */
1507 AUI_edit_SetBuffer(&editor_data, ATB_DCS_UNICODE, &Phbk->edt_buf_name[2], editor_length/2 -2); 1447 AUI_edit_SetBuffer(&editor_data, ATB_DCS_UNICODE, &Phbk->edt_buf_name[2], editor_length/2 -2);
1508 else 1448 else
1509 #endif 1449 #endif
1510 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */ 1450 /* xreddymn OMAPS00079431 May-29-2006: Length changes based on selected phonebook */
1511 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_length); 1451 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, editor_length);
1512 AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); 1452 AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR);
1513 1453
1514 return AUI_edit_Start(parent, &editor_data); 1454 return AUI_edit_Start(parent, &editor_data);
1515 } 1455 }
1516 } 1456 }
1517 1457
1518 1458
1519 1459 /*******************************************************************************
1520 /******************************************************************************* 1460
1521 1461 $Function: bookInputDestroy
1522 $Function: bookInputDestroy 1462
1523 1463 $Description: Destroy Input Window
1524 $Description: Destroy Input Window 1464
1525 1465 $Returns: None
1526 $Returns: None 1466
1527 1467 $Arguments: Handle of window to be destroyed
1528 $Arguments: Handle of window to be destroyed
1529 1468
1530 *******************************************************************************/ 1469 *******************************************************************************/
1531 1470
1532 void bookInputDestroy( MfwHnd window ) 1471 void bookInputDestroy( MfwHnd window )
1533 { 1472 {
1534 TRACE_FUNCTION ("bookInputDestroy()"); 1473 TRACE_FUNCTION ("bookInputDestroy()");
1535 /*MC SPR 1752, send destroy event to window*/ 1474 /*MC SPR 1752, send destroy event to window*/
1536 SEND_EVENT( window, E_ED_DESTROY, 0, 0 ); 1475 SEND_EVENT( window, E_ED_DESTROY, 0, 0 );
1537 1476
1538 } 1477 }
1539 1478
1540 extern T_MFW_HND PhbSearchTim; 1479 extern T_MFW_HND PhbSearchTim;
1541 /******************************************************************************* 1480 /*******************************************************************************
1550 1489
1551 *******************************************************************************/ 1490 *******************************************************************************/
1552 1491
1553 void bookAddNameCB( T_MFW_HND win, USHORT Identifier, SHORT reason ) 1492 void bookAddNameCB( T_MFW_HND win, USHORT Identifier, SHORT reason )
1554 { 1493 {
1555
1556
1557 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1494 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1558 tBookStandard *data = (tBookStandard *) win_data->user; 1495 tBookStandard *data = (tBookStandard *) win_data->user;
1559 T_phbk *Phbk = data->phbk; 1496 T_phbk *Phbk = data->phbk;
1560 1497
1561 TRACE_FUNCTION("bookAddNameCB"); 1498 TRACE_FUNCTION("bookAddNameCB");
1562 1499
1563 switch (reason) 1500 switch (reason)
1564 { 1501 {
1565 case INFO_KCD_LEFT: 1502 case INFO_KCD_LEFT:
1566 { 1503 {
1567 /* Construct a new entry to be written to the phone book 1504 /* Construct a new entry to be written to the phone book
1568 */ 1505 */
1569 1506
1570 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 1507 /*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 1508 if (Phbk->edt_buf_name[0] == 0x80 )//MC, if unicode
1572 { //MC, if empty string, remove 0x80 at beginning 1509 { //MC, if empty string, remove 0x80 at beginning
1573 if (Phbk->edt_buf_name[2]==0x00 && Phbk->edt_buf_name[3] == 0x00) 1510 if (Phbk->edt_buf_name[2]==0x00 && Phbk->edt_buf_name[3] == 0x00)
1574 memset(Phbk->edt_buf_name, 0, MAX_ALPHA_LEN); 1511 memset(Phbk->edt_buf_name, 0, MAX_ALPHA_LEN);
1575 } 1512 }
1576 1513
1577 // xvilliva SPR21547 We check for presence of either phone number or name. 1514 // xvilliva SPR21547 We check for presence of either phone number or name.
1578 // We add or modify the entry and flash an alert correspondingly. 1515 // We add or modify the entry and flash an alert correspondingly.
1579 if(strlen((char *) Phbk->edt_buf_number)>0 || strlen((char *)Phbk->edt_buf_name)>0) 1516 if(strlen((char *) Phbk->edt_buf_number)>0 || strlen((char *)Phbk->edt_buf_name)>0)
1580 { 1517 {
1581 /* Store in the current phone book 1518 /* Store in the current phone book
1582 */ 1519 */
1583 if ( Phbk->UpdateAction == CREATE_ENTRY ) 1520 if ( Phbk->UpdateAction == CREATE_ENTRY )
1584 storeInFile( Phbk ); 1521 storeInFile( Phbk );
1585 else if ( Phbk->UpdateAction == MODIFY_EXISTING ) 1522 else if ( Phbk->UpdateAction == MODIFY_EXISTING )
1586 changeInFile( Phbk ); 1523 changeInFile( Phbk );
1587 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL ); 1524 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL );
1588 1525
1589 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */ 1526 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1590 mmi_int_phb_store_change_completion(); 1527 mmi_int_phb_store_change_completion();
1591 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1528 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1592 1529
1593 } 1530 }
1594 else 1531 else
1595 bookShowInformation( win, TxtInvalidInput, NULL,NULL ); 1532 bookShowInformation( win, TxtInvalidInput, NULL,NULL );
1596 1533
1597 /* And shut down, clearing the number and name windows as we go 1534 /* And shut down, clearing the number and name windows as we go
1598 */ 1535 */
1599 if ( Phbk->input_number_win ) 1536 if ( Phbk->input_number_win )
1600 { 1537 {
1601 AUI_edit_Destroy(Phbk->input_number_win); 1538 AUI_edit_Destroy(Phbk->input_number_win);
1602 Phbk->input_number_win = 0; 1539 Phbk->input_number_win = 0;
1603 } 1540 }
1604 /*SPR 1752, send destroy event rather than calling destroy function*/ 1541 /*SPR 1752, send destroy event rather than calling destroy function*/
1605 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 ); 1542 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 );
1606 Phbk->input_name_win = 0; 1543 Phbk->input_name_win = 0;
1607 1544
1608 // Jan 22, 2006 REF: OMAPS00061930 x0039928 1545 // Jan 22, 2006 REF: OMAPS00061930 x0039928
1609 // Fix : Start the phonebook timer in case of trying to modify the existing entry 1546 // Fix : Start the phonebook timer in case of trying to modify the existing entry
1610 if ( Phbk->UpdateAction == MODIFY_EXISTING ) 1547 if ( Phbk->UpdateAction == MODIFY_EXISTING )
1611 timStart(PhbSearchTim); 1548 timStart(PhbSearchTim);
1612 1549
1613 /*MC-- get rid of search window(and options menu), if just changed a chinese entry 1550 /*MC-- get rid of search window(and options menu), if just changed a chinese entry
1614 (prevent showing scrambled entry)*/ 1551 (prevent showing scrambled entry)*/
1615 if ( Phbk->UpdateAction == MODIFY_EXISTING && Mmi_getCurrentLanguage()==CHINESE_LANGUAGE) 1552 if ( Phbk->UpdateAction == MODIFY_EXISTING && Mmi_getCurrentLanguage()==CHINESE_LANGUAGE)
1616 { 1553 {
1617 bookMenuDestroy(Phbk->menu_options_win); 1554 bookMenuDestroy(Phbk->menu_options_win);
1618 Phbk->menu_options_win=0; 1555 Phbk->menu_options_win=0;
1619 bookSearchDestroy( Phbk->search_win); 1556 bookSearchDestroy( Phbk->search_win);
1620 Phbk->search_win=0; 1557 Phbk->search_win=0;
1621 } 1558 }
1622 } 1559 }
1623 break; 1560 break;
1624 1561
1625 case INFO_KCD_RIGHT: 1562 case INFO_KCD_RIGHT:
1626 case INFO_KCD_HUP: 1563 case INFO_KCD_HUP:
1627 /* Both right and HUP can do the same task here 1564 /* Both right and HUP can do the same task here
1628 */ 1565 */
1629 /*SPR 1752, send destroy event rather than calling destroy function*/ 1566 /*SPR 1752, send destroy event rather than calling destroy function*/
1630 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 ); 1567 SEND_EVENT( Phbk->input_name_win, E_ED_DESTROY, 0, 0 );
1631 Phbk->input_name_win = 0; 1568 Phbk->input_name_win = 0;
1632 break; 1569 break;
1633 1570
1634 default: 1571 default:
1635 { 1572 {
1636 /* otherwise no action to be performed 1573 /* otherwise no action to be performed
1637 */ 1574 */
1655 1592
1656 *******************************************************************************/ 1593 *******************************************************************************/
1657 1594
1658 void bookAddNumberCB( T_MFW_HND win, USHORT Identifier, SHORT reason ) 1595 void bookAddNumberCB( T_MFW_HND win, USHORT Identifier, SHORT reason )
1659 { 1596 {
1660 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1597 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1661 tBookStandard *data = (tBookStandard *) win_data->user; 1598 tBookStandard *data = (tBookStandard *) win_data->user;
1662 1599
1663 switch ( reason ) 1600 switch ( reason )
1664 { 1601 {
1665 case INFO_KCD_LEFT: 1602 case INFO_KCD_LEFT:
1666 data->phbk->input_name_win = bookInputStartNameEditor( data->win, data->phbk->edt_buf_name ); 1603 data->phbk->input_name_win = bookInputStartNameEditor( data->win, data->phbk->edt_buf_name );
1667 break; 1604 break;
1668 1605
1669 case INFO_KCD_RIGHT: 1606 case INFO_KCD_RIGHT:
1670 case INFO_KCD_HUP: 1607 case INFO_KCD_HUP:
1671 /* Both right and HUP can do the same task here 1608 /* Both right and HUP can do the same task here
1672 */ 1609 */
1673 AUI_edit_Destroy( data->phbk->input_number_win ); 1610 AUI_edit_Destroy( data->phbk->input_number_win );
1674 data->phbk->input_number_win = 0; 1611 data->phbk->input_number_win = 0;
1675 break; 1612 break;
1676 1613
1677 default: 1614 default:
1678 /* otherwise no action to be performed 1615 /* otherwise no action to be performed
1679 */ 1616 */
1680 break; 1617 break;
1681 } 1618 }
1682 } 1619 }
1683 1620
1684 1621
1685 #else /* NEW EDITOR */ 1622 #else /* NEW EDITOR */
1686 1623
1703 tBookStandard *data = (tBookStandard *) win_data->user; 1640 tBookStandard *data = (tBookStandard *) win_data->user;
1704 T_phbk *Phbk = data->phbk; 1641 T_phbk *Phbk = data->phbk;
1705 TRACE_FUNCTION("bookAddNameCB"); 1642 TRACE_FUNCTION("bookAddNameCB");
1706 switch (reason) 1643 switch (reason)
1707 { 1644 {
1708 case INPUT_LEFT: 1645 case INPUT_LEFT:
1709 { 1646 {
1710 1647
1711 /* Construct a new entry to be written to the phone book 1648 /* Construct a new entry to be written to the phone book
1712 */ 1649 */
1713 #ifdef NO_ASCIIZ 1650 #ifdef NO_ASCIIZ
1714 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 1651 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
1715 if (Phbk->edt_buf_name[0] == 0x80 )//MC, if unicode 1652 if (Phbk->edt_buf_name[0] == 0x80 )//MC, if unicode
1716 { //MC, if empty string, remove 0x80 at beginning 1653 { //MC, if empty string, remove 0x80 at beginning
1717 if (Phbk->edt_buf_name[2]==0x00 && Phbk->edt_buf_name[3] == 0x00) 1654 if (Phbk->edt_buf_name[2]==0x00 && Phbk->edt_buf_name[3] == 0x00)
1718 memset(Phbk->edt_buf_name, 0, MAX_ALPHA_LEN); 1655 memset(Phbk->edt_buf_name, 0, MAX_ALPHA_LEN);
1719 } 1656 }
1720 #endif 1657 #endif
1721 1658
1722 /* Store in the current phone book 1659 /* Store in the current phone book
1723 */ 1660 */
1724 if ( Phbk->UpdateAction == CREATE_ENTRY ) 1661 if ( Phbk->UpdateAction == CREATE_ENTRY )
1727 changeInFile( Phbk ); 1664 changeInFile( Phbk );
1728 1665
1729 1666
1730 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL ); 1667 bookShowInformation( win, MmiBookCurrentText(), NULL,NULL );
1731 1668
1732 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */ 1669 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1733 mmi_int_phb_store_change_completion(); 1670 mmi_int_phb_store_change_completion();
1734 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1671 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1735 1672
1736 1673
1737 /* And shut down, clearing the number and name windows as we go 1674 /* And shut down, clearing the number and name windows as we go
1738 */ 1675 */
1739 if ( Phbk->input_number_win ) 1676 if ( Phbk->input_number_win )
1740 { 1677 {
1741 SEND_EVENT( Phbk->input_number_win, INPUT_DESTROY, 0, 0 ); 1678 SEND_EVENT( Phbk->input_number_win, INPUT_DESTROY, 0, 0 );
1742 Phbk->input_number_win = 0; 1679 Phbk->input_number_win = 0;
1743 } 1680 }
1744 1681
1745 1682
1746 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 ); 1683 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 );
1747 Phbk->input_name_win = 0; 1684 Phbk->input_name_win = 0;
1748 1685
1749 #ifdef NO_ASCIIZ 1686 #ifdef NO_ASCIIZ
1750 /*MC-- get rid of search window(and options menu), if just changed a chinese entry 1687 /*MC-- get rid of search window(and options menu), if just changed a chinese entry
1751 (prevent showing scrambled entry)*/ 1688 (prevent showing scrambled entry)*/
1752 if ( Phbk->UpdateAction == MODIFY_EXISTING &&Mmi_getCurrentLanguage()==CHINESE_LANGUAGE) 1689 if ( Phbk->UpdateAction == MODIFY_EXISTING &&Mmi_getCurrentLanguage()==CHINESE_LANGUAGE)
1753 { bookMenuDestroy(Phbk->menu_options_win); 1690 { bookMenuDestroy(Phbk->menu_options_win);
1754 Phbk->menu_options_win=0; 1691 Phbk->menu_options_win=0;
1755 bookSearchDestroy( Phbk->search_win); 1692 bookSearchDestroy( Phbk->search_win);
1756 Phbk->search_win=0; 1693 Phbk->search_win=0;
1757 1694
1758 } 1695 }
1759 #endif 1696 #endif
1760 1697
1761 1698
1762 } 1699 }
1763 break; 1700 break;
1764 1701
1765 case INPUT_RIGHT: 1702 case INPUT_RIGHT:
1766 case INPUT_CLEAR: 1703 case INPUT_CLEAR:
1767 { 1704 {
1768 /* Both right and clear can do the same task here 1705 /* Both right and clear can do the same task here
1769 */ 1706 */
1770 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 ); 1707 SEND_EVENT( Phbk->input_name_win, INPUT_DESTROY, 0, 0 );
1771 Phbk->input_name_win = 0; 1708 Phbk->input_name_win = 0;
1772 } 1709 }
1773 break; 1710 break;
1774 1711
1775 default: 1712 default:
1833 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1770 // 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 1771 // This is called when we exit the FDN Numbers menu. So unsetting the menuFDN flag here
1835 1772
1836 void fdn_menu_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason) 1773 void fdn_menu_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason)
1837 { 1774 {
1838 TRACE_EVENT("fdn_menu_cb"); 1775 TRACE_EVENT("fdn_menu_cb");
1839 menuFDN=0; 1776 menuFDN=0;
1840 } 1777 }
1841 1778
1842 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1779 // 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 1780 // This is called to display the FDN Numbers menu. The menuFDN flag is set here
1844 1781
1845 int bookFDNMenu(MfwMnu* menu, MfwMnuItem* item) 1782 int bookFDNMenu(MfwMnu* menu, MfwMnuItem* item)
1846 { 1783 {
1847 T_MFW_HND win = mfw_parent(mfw_header()); 1784 T_MFW_HND win = mfw_parent(mfw_header());
1848 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 1785 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
1849 tBookStandard *data = (tBookStandard *) win_data->user; 1786 tBookStandard *data = (tBookStandard *) win_data->user;
1850 1787
1851 1788 menuFDN=1;
1852 1789 // Sep 29, 2004 REF: CRR 25041 xvilliva
1853 menuFDN=1; 1790 // The bookMenuStart() is called with the window data->phbk->win,
1854 // Sep 29, 2004 REF: CRR 25041 xvilliva 1791 // similar to the function bookFDNMenu() to avoid crash. The menu window
1855 // The bookMenuStart() is called with the window data->phbk->win, 1792 // thus created is stored, which will be deleted while phonebook menu is
1856 // similar to the function bookFDNMenu() to avoid crash. The menu window 1793 // destroyed.
1857 // thus created is stored, which will be deleted while phonebook menu is 1794 data->phbk->menu_call_options_win_2 = bookMenuStart( data->phbk->win, bookNameMenuFDNAttributes(),0);
1858 // destroyed. 1795 SEND_EVENT(data->phbk->menu_call_options_win_2, ADD_CALLBACK, NULL, (void *)fdn_menu_cb);
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);
1861 1796
1862 return 0; /* to remove warning Aug - 11 */ 1797 return 0; /* to remove warning Aug - 11 */
1863 } 1798 }
1864 1799
1865 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN 1800 // Jul 28, 2004 REF: CRR:20887 xrashmic - SASKEN
1866 // Description: Current state of FDN not highlighted 1801 // Description: Current state of FDN not highlighted
1867 // Fix: Instead of showing the submenu directly we call this function 1802 // 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 1803 // where we set the menu and also higlight the previously selected menu item
1869 1804
1870 extern MfwMnuAttr *FDNMenu(void); 1805 extern MfwMnuAttr *FDNMenu(void);
1871 void settingsFocusFDNCurSel(void) 1806 void settingsFocusFDNCurSel(void)
1872 { 1807 {
1873 UBYTE CurSel; //, state; // RAVI 1808 UBYTE CurSel; //, state; // RAVI
1874 1809
1875 1810 T_MFW_HND win = mfw_parent(mfw_header());
1876 1811 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
1877 T_MFW_HND win = mfw_parent(mfw_header()); 1812 tBookStandard *data = (tBookStandard *) win_data->user;
1878 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 1813
1879 tBookStandard *data = (tBookStandard *) win_data->user; 1814 // Sep 29, 2004 REF: CRR 25041 xvilliva
1880 1815 // The bookMenuStart() is called with the window data->phbk->win,
1881 // Sep 29, 2004 REF: CRR 25041 xvilliva 1816 // similar to the function bookFDNMenu() to avoid crash. The menu window
1882 // The bookMenuStart() is called with the window data->phbk->win, 1817 // thus created is stored, which will be deleted while phonebook menu is
1883 // similar to the function bookFDNMenu() to avoid crash. The menu window 1818 // destroyed.
1884 // thus created is stored, which will be deleted while phonebook menu is 1819 data->phbk->menu_options_win_2= bookMenuStart(data->phbk->win, FDNMenu(), 0);
1885 // destroyed. 1820 CurSel = (phb_get_mode() == PHB_RESTRICTED)?FIRSTMENUITEM:SECONDMENUITEM;
1886 data->phbk->menu_options_win_2= bookMenuStart(data->phbk->win, FDNMenu(), 0); 1821 SEND_EVENT(data->phbk->menu_options_win_2, DEFAULT_OPTION, NULL, &CurSel);
1887 CurSel = (phb_get_mode() == PHB_RESTRICTED)?FIRSTMENUITEM:SECONDMENUITEM;
1888 SEND_EVENT(data->phbk->menu_options_win_2, DEFAULT_OPTION, NULL, &CurSel);
1889 } 1822 }
1890 1823
1891 // June 07, 2005 REF: CRR MMI-FIX-31545 x0021334 1824 // June 07, 2005 REF: CRR MMI-FIX-31545 x0021334
1892 // Issue description: SIM: wrong behavior when FDN is not allocated in SST 1825 // Issue description: SIM: wrong behavior when FDN is not allocated in SST
1893 // Added this function to check if FDN is allocated 1826 // Added this function to check if FDN is allocated
1894 void checkFDNSupport(void) 1827 void checkFDNSupport(void)
1895 { 1828 {
1896 T_MFW_HND win = mfw_parent(mfw_header()); 1829 T_MFW_HND win = mfw_parent(mfw_header());
1897 1830
1898 1831 UBYTE serv_stat;
1899 1832 T_DISPLAY_DATA display_info;
1900 UBYTE serv_stat; 1833
1901 T_DISPLAY_DATA display_info; 1834 // Check in SIM service table if FDN is allocated. If not allocated, display this info dialog
1902 1835 /* x0045876, 14-Aug-2006 (WR - "serv_stat" was set but never used) */
1903 // Check in SIM service table if FDN is allocated. If not allocated, display this info dialog 1836 serv_stat = sim_serv_table_check(SRV_FDN);
1904 /* x0045876, 14-Aug-2006 (WR - "serv_stat" was set but never used) */ 1837 /*if ((serv_stat = sim_serv_table_check(SRV_FDN)) EQ NO_ALLOCATED)*/
1905 serv_stat = sim_serv_table_check(SRV_FDN); 1838 if (serv_stat EQ NO_ALLOCATED)
1906 /*if ((serv_stat = sim_serv_table_check(SRV_FDN)) EQ NO_ALLOCATED)*/ 1839 {
1907 if (serv_stat EQ NO_ALLOCATED) 1840 dlg_initDisplayData_TextId(&display_info, TxtSoftOK, NULL, TxtNotSupported, TxtNull, COLOUR_STATUS);
1908 { 1841 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT);
1909 dlg_initDisplayData_TextId(&display_info, TxtSoftOK, NULL, TxtNotSupported, TxtNull, COLOUR_STATUS); 1842 info_dialog (win, &display_info);
1910 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT); 1843 }
1911 info_dialog (win, &display_info); 1844 else // Else show the FDN menu and set focus on current selection
1912 } 1845 settingsFocusFDNCurSel();
1913 else // Else show the FDN menu and set focus on current selection 1846 }
1914 settingsFocusFDNCurSel(); 1847
1915 } 1848 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1916
1917 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- Start */
1918 1849
1919 /******************************************************************************* 1850 /*******************************************************************************
1920 1851
1921 $Function: mmi_int_phb_store_change_completion 1852 $Function: mmi_int_phb_store_change_completion
1922 1853
1923 $Description: Reset all flags on adding / editing an Internal PHB Entry 1854 $Description: Reset all flags on adding / editing an Internal PHB Entry
1924 1855
1925 $Returns: None 1856 $Returns: None
1926 1857
1927 $Arguments: None 1858 $Arguments: None
1928 1859
1929 *******************************************************************************/ 1860 *******************************************************************************/
1930 static void mmi_int_phb_store_change_completion() 1861 static void mmi_int_phb_store_change_completion()
1931 { 1862 {
1932 /* Reset the "add" and "change" flags only incase of Internal PHB */ 1863 /* Reset the "add" and "change" flags only incase of Internal PHB */
1933 if ( bookGetBookSelected() == TRUE ) 1864 if ( bookGetBookSelected() == TRUE )
1934 { 1865 {
1935 addname_flag = FALSE; 1866 addname_flag = FALSE;
1936 1867
1937 changename_flag = FALSE; 1868 changename_flag = FALSE;
1938 } 1869 }
1939 1870
1940 return; 1871 return;
1941 } 1872 }
1942 1873
1943 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */ 1874 /* Sep 20, 2006 REF: OMAPS00145786 x0080701 (Bharat) -- End */
1944 1875
1945 /******************************************************************************* 1876 /*******************************************************************************
1946 1877
1947 End of File 1878 End of File
1948 1879
1949 *******************************************************************************/ 1880 *******************************************************************************/
1950