comparison src/ui/bmi/mmiBookSearchWindow.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
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner. 8 disclosed to any third party without the express permission of the owner.
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: PhoneBook 14 $Module: PhoneBook
15 $File: MmiSearchWindow.c 15 $File: MmiSearchWindow.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 25/10/00 19 $Date: 25/10/00
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
25 This module provides the phone book search window functionality for the 25 This module provides the phone book search window functionality for the
26 phone book module of the basic MMI 26 phone book module of the basic MMI
27 27
28 ******************************************************************************** 28 ********************************************************************************
29 $History: MmiSearchWindow.c 29 $History: MmiSearchWindow.c
30 30
31 23 April 2007 DR:OMAPS00121834, x0066692 Asha 31 23 April 2007 DR:OMAPS00121834, x0066692 Asha
32 Description: Phonebook -> Phonebooksearch is pointing to the first entry when no of 32 Description: Phonebook -> Phonebooksearch is pointing to the first entry when no of
33 entries in the phonebook is >240 33 entries in the phonebook is >240
34 Fix: added the check to restrict the max_stop_index to max no availabe entries and 34 Fix: added the check to restrict the max_stop_index to max no availabe entries and
35 made cursor point to the correct entry in the phonebook. 35 made cursor point to the correct entry in the phonebook.
36 36
37 37
38 Jan 22, 2006 REF: OMAPS00061930 x0039928 38 Jan 22, 2006 REF: OMAPS00061930 x0039928
39 Bug:PhoneBook -Change entry and view entry through Change option-failed 39 Bug:PhoneBook -Change entry and view entry through Change option-failed
40 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries. 40 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries.
41 41
42 CRR: 25302 - xpradipg 10 Nov 2004 42 CRR: 25302 - xpradipg 10 Nov 2004
43 Description: Should be able to select the number fro the phonebook while 43 Description: Should be able to select the number fro the phonebook while
44 sending MMS/EMS. 44 sending MMS/EMS.
45 Solution: The new feature to select the number from phonebook while sending 45 Solution: The new feature to select the number from phonebook while sending
46 MMS/EMS is added 46 MMS/EMS is added
47 47
48 Oct 26, 2004 REF: CRR 25354 xkundadu 48 Oct 26, 2004 REF: CRR 25354 xkundadu
49 Description: Phonebook: After entering precise name to search and then 49 Description: Phonebook: After entering precise name to search and then
50 trying to delete using RSK, first character is not deleted 50 trying to delete using RSK, first character is not deleted
51 Fix: If only one character is present in the editor and delete key is pressed, 51 Fix: If only one character is present in the editor and delete key is pressed,
52 delete the editor buffer and update the editor view. 52 delete the editor buffer and update the editor view.
53 53
54 Aug 16, 2004 REF: CRR 24323 Deepa M.D 54 Aug 16, 2004 REF: CRR 24323 Deepa M.D
55 Bug:Clenup of sprintf used for tracing 55 Bug:Clenup of sprintf used for tracing
56 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX 56 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX
57 57
58 25/10/00 Original Condat(UK) BMI version. 58 25/10/00 Original Condat(UK) BMI version.
59 20/02/02 Reinstated editor when in Chinese language by removing 59 20/02/02 Reinstated editor when in Chinese language by removing
60 "if not Chinese" conditions SPR 1742 60 "if not Chinese" conditions SPR 1742
61 61
62 $End 62 $End
63 63
64 *******************************************************************************/ 64 *******************************************************************************/
65 65
66 66
67 /******************************************************************************* 67 /*******************************************************************************
68 68
69 Include Files 69 Include Files
70 70
71 *******************************************************************************/ 71 *******************************************************************************/
72 #define ENTITY_MFW 72 #define ENTITY_MFW
73 73
74 /* includes */ 74 /* includes */
75 #include <string.h> 75 #include <string.h>
176 //CRR: 25302 - xpradipg 10 Nov 2004 176 //CRR: 25302 - xpradipg 10 Nov 2004
177 //extern MmsSend_PHBK_exec_cb(T_MFW_HND win, USHORT event, void *parameter); 177 //extern MmsSend_PHBK_exec_cb(T_MFW_HND win, USHORT event, void *parameter);
178 178
179 179
180 /******************************************************************************* 180 /*******************************************************************************
181 181
182 Private Methods 182 Private Methods
183 183
184 *******************************************************************************/ 184 *******************************************************************************/
185 //#define TIME_TRACE_EVENT TRACE_EVENT 185 //#define TIME_TRACE_EVENT TRACE_EVENT
186 #ifndef TIME_TRACE_EVENT 186 #ifndef TIME_TRACE_EVENT
187 #define TIME_TRACE_EVENT 187 #define TIME_TRACE_EVENT
188 #endif 188 #endif
189 189
190 /******************************************************************************* 190 /*******************************************************************************
191 191
192 $Function: bookSearchDialog 192 $Function: bookSearchDialog
193 193
194 $Description: dialog handler for the search window functionality 194 $Description: dialog handler for the search window functionality
195 195
196 $Returns: None 196 $Returns: None
197 197
198 $Arguments: win, window handle 198 $Arguments: win, window handle
199 event, event to be handled 199 event, event to be handled
200 value, not used 200 value, not used
201 parameter, not used 201 parameter, not used
202 202
203 *******************************************************************************/ 203 *******************************************************************************/
204 204
205 void bookSearchDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter ) 205 void bookSearchDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter )
206 { 206 {
207 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 207 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
212 // Fix : Add a local variable search_string 212 // Fix : Add a local variable search_string
213 char search_string[MAX_ALPHA_LEN]; 213 char search_string[MAX_ALPHA_LEN];
214 //x0066692 Date:23 April 2007 DR:OMAPS00121834, Asha 214 //x0066692 Date:23 April 2007 DR:OMAPS00121834, Asha
215 //Fix for phone book search issue - when phonebook has more than 240 entries. 215 //Fix for phone book search issue - when phonebook has more than 240 entries.
216 UBYTE max_search_name; 216 UBYTE max_search_name;
217 217
218 TRACE_FUNCTION( "bookSearchDialog()" ); 218 TRACE_FUNCTION( "bookSearchDialog()" );
219 219
220 switch( event ) 220 switch( event )
221 { 221 {
222 case SEARCH_INIT: 222 case SEARCH_INIT:
229 case SEARCH_SCROLL_UP: 229 case SEARCH_SCROLL_UP:
230 { /*MC SPR 1541, flag to show whether we've scrolled off-screen and need to 230 { /*MC SPR 1541, flag to show whether we've scrolled off-screen and need to
231 update the portion of the list displayed*/ 231 update the portion of the list displayed*/
232 BOOL get_new_screen = FALSE; 232 BOOL get_new_screen = FALSE;
233 233
234 234
235 /* Scroll up 235 /* Scroll up
236 */ 236 */
237 if ( ( Current->index == 1 ) && ( Current->selectedName == 0 ) ) 237 if ( ( Current->index == 1 ) && ( Current->selectedName == 0 ) )
238 { 238 {
239 if ( Current->status.used_entries < MAX_SEARCH_NAME ) 239 if ( Current->status.used_entries < MAX_SEARCH_NAME )
269 269
270 case SEARCH_SCROLL_DOWN: 270 case SEARCH_SCROLL_DOWN:
271 { /*MC SPR 1541, flag to show whether we've scrolled off-screen and need to 271 { /*MC SPR 1541, flag to show whether we've scrolled off-screen and need to
272 update the portion of the list displayed*/ 272 update the portion of the list displayed*/
273 BOOL get_new_screen = FALSE; 273 BOOL get_new_screen = FALSE;
274 274
275 /* Scroll Down 275 /* Scroll Down
276 */ 276 */
277 if ( ( Current->index + Current->selectedName ) == Current->status.used_entries ) 277 if ( ( Current->index + Current->selectedName ) == Current->status.used_entries )
278 { 278 {
279 Current->index = 1; 279 Current->index = 1;
308 //Fix : Copy the number to be searched into the search_string variable and give a search for it 308 //Fix : Copy the number to be searched into the search_string variable and give a search for it
309 if ( value == TRUE) 309 if ( value == TRUE)
310 strcpy(search_string,(char*)data->phbk->edt_buf_name); 310 strcpy(search_string,(char*)data->phbk->edt_buf_name);
311 else 311 else
312 strcpy(search_string,(char*)data->edtBuf); 312 strcpy(search_string,(char*)data->edtBuf);
313 313
314 /* Find name 314 /* Find name
315 */ 315 */
316 Current->index = Current->index + Current->selectedName; 316 Current->index = Current->index + Current->selectedName;
317 if ( bookSearchName( search_string, MAX_SEARCH_NAME, Current ) == MFW_PHB_OK ) 317 if ( bookSearchName( search_string, MAX_SEARCH_NAME, Current ) == MFW_PHB_OK )
318 { 318 {
319 //x0066692 Date:23 April 2007 DR:OMAPS00121834, Asha 319 //x0066692 Date:23 April 2007 DR:OMAPS00121834, Asha
320 //Fix is added to make cursor point to the correct entry in the phonebook. 320 //Fix is added to make cursor point to the correct entry in the phonebook.
321 max_search_name = Current->status.used_entries - Current->index +1; 321 max_search_name = Current->status.used_entries - Current->index +1;
322 if ( max_search_name > MAX_SEARCH_NAME ) 322 if ( max_search_name > MAX_SEARCH_NAME )
323 max_search_name = MAX_SEARCH_NAME; 323 max_search_name = MAX_SEARCH_NAME;
324 324
325 if ( Current->index > ( Current->status.used_entries + 1 - max_search_name ) ) 325 if ( Current->index > ( Current->status.used_entries + 1 - max_search_name ) )
326 { 326 {
327 if ( Current->status.used_entries > MAX_SEARCH_NAME ) 327 if ( Current->status.used_entries > MAX_SEARCH_NAME )
328 { 328 {
329 Current->selectedName = Current->index - Current->status.used_entries + max_search_name - 1; 329 Current->selectedName = Current->index - Current->status.used_entries + max_search_name - 1;
335 Current->index=1; 335 Current->index=1;
336 } 336 }
337 337
338 /* go find the name 338 /* go find the name
339 */ 339 */
340 340
341 bookFindName(MAX_SEARCH_NAME,&data->phbk->current); 341 bookFindName(MAX_SEARCH_NAME,&data->phbk->current);
342 } 342 }
343 else 343 else
344 { 344 {
345 Current->selectedName =0; 345 Current->selectedName =0;
346 346
347 } 347 }
348 348
349 /* update the menu */ 349 /* update the menu */
350 /* SPR881 - SH - Move name find to below */ 350 /* SPR881 - SH - Move name find to below */
351 } 351 }
352 else 352 else
353 {/*SPR 2233, if no name found, go to beginning of list*/ 353 {/*SPR 2233, if no name found, go to beginning of list*/
354 Current->index = 1; 354 Current->index = 1;
355 Current->selectedName = 0; 355 Current->selectedName = 0;
356 } 356 }
357 357
358 /* update the menu 358 /* update the menu
359 */ 359 */
360 /* SPR881 - SH - is necessary even when BookSearchName, above, fails */ 360 /* SPR881 - SH - is necessary even when BookSearchName, above, fails */
361 361
362 mnu = (MfwMnu *) mfwControl( data->menu ); 362 mnu = (MfwMnu *) mfwControl( data->menu );
368 } 368 }
369 } 369 }
370 break; 370 break;
371 371
372 case SEARCH_UPDATE: 372 case SEARCH_UPDATE:
373 { 373 {
374 /* Update, actually an initialisation/reset phase 374 /* Update, actually an initialisation/reset phase
375 */ 375 */
376 Current->index = 1; 376 Current->index = 1;
377 Current->selectedName = 0; 377 Current->selectedName = 0;
378 378
389 } 389 }
390 break; 390 break;
391 391
392 /* SPR#1428 - SH - New Editor: Add this to allow redraw of 392 /* SPR#1428 - SH - New Editor: Add this to allow redraw of
393 * window on request. */ 393 * window on request. */
394 394
395 #ifdef NEW_EDITOR 395 #ifdef NEW_EDITOR
396 case SEARCH_REDRAW: 396 case SEARCH_REDRAW:
397 /*SPR 2104, TRACE seems to fix timing probs :/ */ 397 /*SPR 2104, TRACE seems to fix timing probs :/ */
398 TRACE_EVENT("UPDATE SEARCH REDRAW"); 398 TRACE_EVENT("UPDATE SEARCH REDRAW");
399 SEND_EVENT(data->win, SEARCH_STRING, 0, 0); 399 SEND_EVENT(data->win, SEARCH_STRING, 0, 0);
418 /******************************************************************************* 418 /*******************************************************************************
419 419
420 $Function: bookSearchWindowCB 420 $Function: bookSearchWindowCB
421 421
422 $Description: Window call back function 422 $Description: Window call back function
423 423
424 $Returns: MFW_EVENT_CONSUMED, or MFW_EVENT_PASSED 424 $Returns: MFW_EVENT_CONSUMED, or MFW_EVENT_PASSED
425 425
426 $Arguments: e, event, w, window handle 426 $Arguments: e, event, w, window handle
427 427
428 *******************************************************************************/ 428 *******************************************************************************/
429 429
430 static int bookSearchWindowCB( MfwEvt e, MfwWin *w ) 430 static int bookSearchWindowCB( MfwEvt e, MfwWin *w )
431 { 431 {
432 tBookStandard *data = (tBookStandard *) w->user; 432 tBookStandard *data = (tBookStandard *) w->user;
434 int index; 434 int index;
435 char *pchr; 435 char *pchr;
436 char pchr2[PHB_MAX_LEN*2 +4];/*mc, SPR 1442*/ 436 char pchr2[PHB_MAX_LEN*2 +4];/*mc, SPR 1442*/
437 TRACE_FUNCTION( "bookSearchWindowCB()" ); 437 TRACE_FUNCTION( "bookSearchWindowCB()" );
438 438
439 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 439 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
440 // When FDN is disabled we need to display only ADN entries in the phonebook menu. 440 // When FDN is disabled we need to display only ADN entries in the phonebook menu.
441 // We just use the preset PHB_ADN as the current book. 441 // We just use the preset PHB_ADN as the current book.
442 //if(data->phbk->current.status.book == PHB_ADN) 442 //if(data->phbk->current.status.book == PHB_ADN)
443 // data->phbk->current.status.book = PHB_ADN_FDN; 443 // data->phbk->current.status.book = PHB_ADN_FDN;
444 444
469 #endif /* NEW_EDITOR */ 469 #endif /* NEW_EDITOR */
470 470
471 for ( index = 0; index < MAX_SEARCH_NAME; index++ ) 471 for ( index = 0; index < MAX_SEARCH_NAME; index++ )
472 { 472 {
473 TRACE_EVENT( "bookSearchWindowCB()-loopstart" ); 473 TRACE_EVENT( "bookSearchWindowCB()-loopstart" );
474 474
475 pchr = (char *) MmiBookCallList( index ); 475 pchr = (char *) MmiBookCallList( index );
476 476
477 memset( pchr, '\0', NAME_SCREEN_MAX ); 477 memset( pchr, '\0', NAME_SCREEN_MAX );
478 478
479 /* SPR#1428 - SH - remove extraneous call to edtShow*/ 479 /* SPR#1428 - SH - remove extraneous call to edtShow*/
480 /*SPR 2123, using new macro PHONEBOOK_ITEM_LENGTH*/ 480 /*SPR 2123, using new macro PHONEBOOK_ITEM_LENGTH*/
481 #ifdef NO_ASCIIZ 481 #ifdef NO_ASCIIZ
482 /*if current language chinese*/ 482 /*if current language chinese*/
483 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) 483 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
484 { /*SPR 2653, this check should be here too*/ 484 { /*SPR 2653, this check should be here too*/
485 if (!Current->list.entry == NULL) 485 if (!Current->list.entry == NULL)
488 if (Current->entry[ index ].name.data[0] != 0x80)//if not unicode 488 if (Current->entry[ index ].name.data[0] != 0x80)//if not unicode
489 {/*we have to convert to unicode*/ 489 {/*we have to convert to unicode*/
490 pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal - typecast done*/ 490 pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal - typecast done*/
491 pchr2[1]= 0x7f; 491 pchr2[1]= 0x7f;
492 /*SPR2175, use new function*/ 492 /*SPR2175, use new function*/
493 ATB_convert_String((char*)Current->entry[ index ].name.data, MFW_ASCII, 493 ATB_convert_String((char*)Current->entry[ index ].name.data, MFW_ASCII,
494 (UBYTE)strlen((char*)Current->entry[ index ].name.data), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE); 494 (UBYTE)strlen((char*)Current->entry[ index ].name.data), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE);
495 /*SPR 1442 and now truncate the string*/ 495 /*SPR 1442 and now truncate the string*/
496 resources_truncate_to_screen_width((char *) pchr2, Current->entry[ index ].name.len*2+2, pchr,PHONEBOOK_ITEM_LENGTH , SCREEN_SIZE_X, TRUE); 496 resources_truncate_to_screen_width((char *) pchr2, Current->entry[ index ].name.len*2+2, pchr,PHONEBOOK_ITEM_LENGTH , SCREEN_SIZE_X, TRUE);
497 } 497 }
498 else /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 498 else /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
499 { 499 {
500 /*SPR 1442 truncate the string*/ 500 /*SPR 1442 truncate the string*/
501 resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, MAX_ALPHA_LEN, SCREEN_SIZE_X, TRUE); 501 resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, MAX_ALPHA_LEN, SCREEN_SIZE_X, TRUE);
502 } 502 }
503 } 503 }
504 else /*we convert number string into unicode*/ 504 else /*we convert number string into unicode*/
505 { pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal-typecast done*/ 505 { pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal-typecast done*/
506 pchr2[1]= 0x7f; 506 pchr2[1]= 0x7f;
507 /*SPR 2175, use new function*/ 507 /*SPR 2175, use new function*/
508 ATB_convert_String((char*)Current->entry[ index ].number, MFW_ASCII, 508 ATB_convert_String((char*)Current->entry[ index ].number, MFW_ASCII,
509 (UBYTE)strlen((char*)Current->entry[ index ].number), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE); 509 (UBYTE)strlen((char*)Current->entry[ index ].number), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE);
510 /*SPR 1442 and now truncate the string*/ 510 /*SPR 1442 and now truncate the string*/
511 resources_truncate_to_screen_width((char *) pchr2, strlen((char*)Current->entry[ index ].number)*2+2, pchr,PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, TRUE); 511 resources_truncate_to_screen_width((char *) pchr2, strlen((char*)Current->entry[ index ].number)*2+2, pchr,PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, TRUE);
512 } 512 }
513 } 513 }
514 514
515 } 515 }
516 516
517 else 517 else
518 { /*if current language a latin language*/ 518 { /*if current language a latin language*/
519 /*SPR 2653, removed consitional compilation, this check applies whether we're in simulation mode or target hardware*/ 519 /*SPR 2653, removed consitional compilation, this check applies whether we're in simulation mode or target hardware*/
520 // EF check for null pointer first 520 // EF check for null pointer first
521 if (!Current->list.entry == NULL) 521 if (!Current->list.entry == NULL)
522 /*SPR 2104, don't need this test*/ 522 /*SPR 2104, don't need this test*/
523 523
524 if ( Current->entry[ index ].name.len NEQ 0&&Current->entry[ index ].name.data[0] != 0x80/*mc*/) //Should check to see if null name 524 if ( Current->entry[ index ].name.len NEQ 0&&Current->entry[ index ].name.data[0] != 0x80/*mc*/) //Should check to see if null name
525 { /*mc, SPR 1442, replaced old truncation function with new one*/ 525 { /*mc, SPR 1442, replaced old truncation function with new one*/
526 resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE); 526 resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE);
527 } 527 }
528 else 528 else
529 {/*mc, SPR 1442, replaced old truncation function with new one*/ 529 {/*mc, SPR 1442, replaced old truncation function with new one*/
530 resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE); 530 resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE);
531 } 531 }
532 532
533 #else 533 #else
534 if ( Current->entry[ index ].name[ 0 ] != NULL) //Should check to see if null name 534 if ( Current->entry[ index ].name[ 0 ] != NULL) //Should check to see if null name
535 { /*mc, SPR 1442, replaced old truncation function with new one*/ 535 { /*mc, SPR 1442, replaced old truncation function with new one*/
536 resources_truncate_to_screen_width((char *) Current->entry[index].name, 0, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE); 536 resources_truncate_to_screen_width((char *) Current->entry[index].name, 0, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE);
537 } 537 }
538 else 538 else
539 { /*mc, SPR 1442, replaced old truncation function with new one*/ 539 { /*mc, SPR 1442, replaced old truncation function with new one*/
540 resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE); 540 resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE);
541 } 541 }
542 /*SPR 2123 end*/ 542 /*SPR 2123 end*/
543 #endif 543 #endif
544 #ifdef NO_ASCIIZ/*MC SPR 975, opening bracket only exists when NO_ASCIIZ defined*/ 544 #ifdef NO_ASCIIZ/*MC SPR 975, opening bracket only exists when NO_ASCIIZ defined*/
545 } 545 }
546 #endif 546 #endif
547 } 547 }
548 548
549 TRACE_EVENT( "bookSearchWindowCB()-end of loop" ); 549 TRACE_EVENT( "bookSearchWindowCB()-end of loop" );
550 mnuShow(data->menu); 550 mnuShow(data->menu);
551 /* SPR#1428 - SH - End of condition to check if we're in multi-tap */ 551 /* SPR#1428 - SH - End of condition to check if we're in multi-tap */
552 #ifdef NEW_EDITOR 552 #ifdef NEW_EDITOR
553 } 553 }
554 #endif 554 #endif
555 555
556 /* special case if invoked from SMS or using SDN book 556 /* special case if invoked from SMS or using SDN book
557 */ 557 */
558 if ( ( data->phbk->fromSMS )|| 558 if ( ( data->phbk->fromSMS )||
559 ( data->phbk->fromSMSSC ) || /* SPR#1428 - SH - New event for service centre editor */ 559 ( data->phbk->fromSMSSC ) || /* SPR#1428 - SH - New event for service centre editor */
560 ( data->phbk->fromDivert ) || 560 ( data->phbk->fromDivert ) ||
561 ( data->phbk->fromDeflect )|| 561 ( data->phbk->fromDeflect )||
562 //CRR: 25302 - xpradipg 10 Nov 2004 562 //CRR: 25302 - xpradipg 10 Nov 2004
563 //check if it was invoked from MMS/EMS 563 //check if it was invoked from MMS/EMS
564 ( data->phbk->fromMmsEms)|| 564 ( data->phbk->fromMmsEms)||
565 ( Current->status.book == PHB_SDN ) ) 565 ( Current->status.book == PHB_SDN ) )
566 { 566 {
567 //displaySoftKeys( TxtSoftSelect, TxtSoftBack ); 567 //displaySoftKeys( TxtSoftSelect, TxtSoftBack );
568 // Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) 568 // Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken)
569 // when the editor is empty, we need to display BACK softkey 569 // when the editor is empty, we need to display BACK softkey
570 // Delete softkey is displayed when it contains some characters 570 // Delete softkey is displayed when it contains some characters
571 if (data->editor_attr.text.len==0) 571 if (data->editor_attr.text.len==0)
572 { 572 {
573 displaySoftKeys( TxtSoftSelect, TxtSoftBack ); 573 displaySoftKeys( TxtSoftSelect, TxtSoftBack );
574 } 574 }
578 } 578 }
579 } 579 }
580 else 580 else
581 { 581 {
582 //displaySoftKeys( TxtSoftOptions, TxtSoftBack ); 582 //displaySoftKeys( TxtSoftOptions, TxtSoftBack );
583 // Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) 583 // Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken)
584 // when the editor is empty, we need to display BACK softkey 584 // when the editor is empty, we need to display BACK softkey
585 // Delete softkey is displayed when it contains some characters 585 // Delete softkey is displayed when it contains some characters
586 if (data->editor_attr.text.len==0) 586 if (data->editor_attr.text.len==0)
587 { 587 {
588 displaySoftKeys( TxtSoftOptions, TxtSoftBack ); 588 displaySoftKeys( TxtSoftOptions, TxtSoftBack );
589 } 589 }
622 /******************************************************************************* 622 /*******************************************************************************
623 623
624 $Function: bookSearchKbdCB 624 $Function: bookSearchKbdCB
625 625
626 $Description: Keyboard handler 626 $Description: Keyboard handler
627 627
628 $Returns: MFW_EVENT_CONSUMED always 628 $Returns: MFW_EVENT_CONSUMED always
629 629
630 $Arguments: e, event, k, key handle 630 $Arguments: e, event, k, key handle
631 631
632 *******************************************************************************/ 632 *******************************************************************************/
633 633
634 static int bookSearchKbdCB( MfwEvt e, MfwKbd *k ) 634 static int bookSearchKbdCB( MfwEvt e, MfwKbd *k )
635 { 635 {
636 T_MFW_HND win = mfwParent( mfw_header() ); 636 T_MFW_HND win = mfwParent( mfw_header() );
649 #endif 649 #endif
650 650
651 /* Deal with the key and event combinatino 651 /* Deal with the key and event combinatino
652 */ 652 */
653 653
654 654
655 switch( k->code ) 655 switch( k->code )
656 { 656 {
657 case KCD_MNUUP: 657 case KCD_MNUUP:
658 { 658 {
659 /* scroll up 659 /* scroll up
670 SEND_EVENT( data->win, SEARCH_SCROLL_DOWN, 0, 0 ); 670 SEND_EVENT( data->win, SEARCH_SCROLL_DOWN, 0, 0 );
671 winShow( data->win ); 671 winShow( data->win );
672 } 672 }
673 break; 673 break;
674 674
675 675
676 676
677 case KCD_CALL: 677 case KCD_CALL:
678 if ( data->phbk->fromSMS ) 678 if ( data->phbk->fromSMS )
679 SEND_EVENT( data->phbk->parent_win, SMS_PHBK_NUMBER, PHBK_ID, 679 SEND_EVENT( data->phbk->parent_win, SMS_PHBK_NUMBER, PHBK_ID,
680 (UBYTE *) Current->entry[ Current->selectedName ].number ); 680 (UBYTE *) Current->entry[ Current->selectedName ].number );
721 //also handle if invoked by MMS/EMS 721 //also handle if invoked by MMS/EMS
722 else if ( data->phbk->fromMmsEms ) 722 else if ( data->phbk->fromMmsEms )
723 { /* Send empty string so that ptr can be set 0*/ 723 { /* Send empty string so that ptr can be set 0*/
724 SEND_EVENT( data->phbk->parent_win, MMS_EMS_PHBK_NUMBER, PHBK_ID,"" ); 724 SEND_EVENT( data->phbk->parent_win, MMS_EMS_PHBK_NUMBER, PHBK_ID,"" );
725 bookPhonebookDestroy(data->phbk->win); 725 bookPhonebookDestroy(data->phbk->win);
726 } 726 }
727 /* Marcus (mk): Issue 1010: 2002-08-22: End */ 727 /* Marcus (mk): Issue 1010: 2002-08-22: End */
728 else 728 else
729 bookSearchDestroy(data->win); 729 bookSearchDestroy(data->win);
730 730
731 } 731 }
732 break; 732 break;
733 733
734 case KCD_MNUSELECT: 734 case KCD_MNUSELECT:
735 case KCD_LEFT: 735 case KCD_LEFT:
746 { SEND_EVENT( data->phbk->parent_win, SMSSC_PHBK_NUMBER, PHBK_ID /*MZ 6/2/01 */, 746 { SEND_EVENT( data->phbk->parent_win, SMSSC_PHBK_NUMBER, PHBK_ID /*MZ 6/2/01 */,
747 (UBYTE *) Current->entry[ Current->selectedName ].number ); 747 (UBYTE *) Current->entry[ Current->selectedName ].number );
748 bookPhonebookDestroy(data->phbk->win); 748 bookPhonebookDestroy(data->phbk->win);
749 } 749 }
750 else if(data->phbk->fromDivert ) //MZ 26/02/01 check for divert If in Divert send event. 750 else if(data->phbk->fromDivert ) //MZ 26/02/01 check for divert If in Divert send event.
751 { 751 {
752 SEND_EVENT( data->phbk->parent_win, DIVERT_PHBK_NUMBER, PHBK_ID /*MZ 28/2/01 */, 752 SEND_EVENT( data->phbk->parent_win, DIVERT_PHBK_NUMBER, PHBK_ID /*MZ 28/2/01 */,
753 (UBYTE *) Current->entry[ Current->selectedName ].number ); 753 (UBYTE *) Current->entry[ Current->selectedName ].number );
754 bookPhonebookDestroy(data->phbk->win); 754 bookPhonebookDestroy(data->phbk->win);
755 } 755 }
756 else if(data->phbk->fromDeflect ) /*SPR 1392*/ 756 else if(data->phbk->fromDeflect ) /*SPR 1392*/
757 { 757 {
758 TRACE_EVENT_P1("<< API deflection no. = %s", (char*) Current->entry[ Current->selectedName ].number); 758 TRACE_EVENT_P1("<< API deflection no. = %s", (char*) Current->entry[ Current->selectedName ].number);
759 SEND_EVENT( data->phbk->parent_win, DEFLECT_PHBK_NUMBER, PHBK_ID, 759 SEND_EVENT( data->phbk->parent_win, DEFLECT_PHBK_NUMBER, PHBK_ID,
760 (UBYTE *) Current->entry[ Current->selectedName ].number ); 760 (UBYTE *) Current->entry[ Current->selectedName ].number );
761 bookPhonebookDestroy(data->phbk->win); 761 bookPhonebookDestroy(data->phbk->win);
762 } 762 }
776 data->phbk->menu_options_win = bookMenuStart( data->phbk->win, bookNameMenuAttributes(),0); 776 data->phbk->menu_options_win = bookMenuStart( data->phbk->win, bookNameMenuAttributes(),0);
777 else 777 else
778 data->phbk->menu_options_win = bookMenuStart( data->phbk->win, bookUPNMenuAttributes(),0); 778 data->phbk->menu_options_win = bookMenuStart( data->phbk->win, bookUPNMenuAttributes(),0);
779 } 779 }
780 break; 780 break;
781 781
782 /* JVJ #1743 Right key deletes search character*/ 782 /* JVJ #1743 Right key deletes search character*/
783 #ifdef NEW_EDITOR 783 #ifdef NEW_EDITOR
784 case KCD_RIGHT: 784 case KCD_RIGHT:
785 #else /* NEW_EDITOR */ 785 #else /* NEW_EDITOR */
786 case KCD_HUP: 786 case KCD_HUP:
787 #endif /* NEW_EDITOR */ 787 #endif /* NEW_EDITOR */
788 { 788 {
789 789
790 790
791 791
792 /* If we have any characters in the buffer, step back, otherwise 792 /* If we have any characters in the buffer, step back, otherwise
793 destroy the window 793 destroy the window
794 */ 794 */
795 795
796 if ( data->edtBuf[0]) 796 if ( data->edtBuf[0])
797 { 797 {
798 798
799 // Oct 26, 2004 REF: CRR 25354 xkundadu 799 // Oct 26, 2004 REF: CRR 25354 xkundadu
800 // Description: Phonebook: After entering precise name to search and then 800 // Description: Phonebook: After entering precise name to search and then
801 // trying to delete using RSK, first character is not deleted. 801 // trying to delete using RSK, first character is not deleted.
802 // Fix: If only one character is present in the editor and delete key is 802 // Fix: If only one character is present in the editor and delete key is
803 // pressed, delete the editor buffer and update the editor view. 803 // pressed, delete the editor buffer and update the editor view.
804 804
805 // Find out the length of the buffer. 805 // Find out the length of the buffer.
806 if(strlen((char*)data->edtBuf) == 1) 806 if(strlen((char*)data->edtBuf) == 1)
807 { 807 {
808 //If only one character is present, delete and set the buffer 808 //If only one character is present, delete and set the buffer
809 //to NULL. 809 //to NULL.
810 data->edtBuf[0] = '\0'; 810 data->edtBuf[0] = '\0';
811 data->editor_attr.text.len = 0; 811 data->editor_attr.text.len = 0;
812 //Move the cursor accordingly. 812 //Move the cursor accordingly.
813 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); 813 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE);
814 data->editor->update = ED_UPDATE_TRIVIAL; 814 data->editor->update = ED_UPDATE_TRIVIAL;
815 SEND_EVENT( data->win, SEARCH_STRING, 0, 0); 815 SEND_EVENT( data->win, SEARCH_STRING, 0, 0);
816 //Update the window. 816 //Update the window.
817 winShow( data->win ); 817 winShow( data->win );
818 break; 818 break;
819 } 819 }
820 820
821 /* SPR#1428 - SH - New Editor changes */ 821 /* SPR#1428 - SH - New Editor changes */
822 #ifdef NEW_EDITOR 822 #ifdef NEW_EDITOR
823 /* SPR#2174 - SH - If multitap is in progress, delete current character 823 /* SPR#2174 - SH - If multitap is in progress, delete current character
824 * rather than previous character */ 824 * rather than previous character */
825 825
839 SEND_EVENT( data->win, SEARCH_STRING, 0, 0 ); 839 SEND_EVENT( data->win, SEARCH_STRING, 0, 0 );
840 winShow( data->win ); 840 winShow( data->win );
841 } 841 }
842 else 842 else
843 { 843 {
844 /*API - 12/08/03 - CQ11268 - Add this so the phonebbok is destoryed on right key press*/ 844 /*API - 12/08/03 - CQ11268 - Add this so the phonebbok is destoryed on right key press*/
845 if ( data->phbk->fromSMS ) 845 if ( data->phbk->fromSMS )
846 { /* Send empty string so that ptr can be set 0*/ 846 { /* Send empty string so that ptr can be set 0*/
847 bookPhonebookDestroy(data->phbk->win); 847 bookPhonebookDestroy(data->phbk->win);
848 } 848 }
849 else if ( data->phbk->fromSMSSC ) 849 else if ( data->phbk->fromSMSSC )
870 bookSearchDestroy(data->win); 870 bookSearchDestroy(data->win);
871 /*API - 12/08/03 - CQ11268 - END*/ 871 /*API - 12/08/03 - CQ11268 - END*/
872 } 872 }
873 } 873 }
874 break; 874 break;
875 875
876 case KCD_HASH: 876 case KCD_HASH:
877 { 877 {
878 878
879 { 879 {
880 /* SPR#1428 - SH - New Editor changes */ 880 /* SPR#1428 - SH - New Editor changes */
881 #ifdef NEW_EDITOR 881 #ifdef NEW_EDITOR
882 ATB_edit_DeleteLeft( data->editor, TRUE); /* SPR#2342 - SH */ 882 ATB_edit_DeleteLeft( data->editor, TRUE); /* SPR#2342 - SH */
883 #else /* NEW_EDITOR */ 883 #else /* NEW_EDITOR */
884 edtChar( data->edt,ecBack ); 884 edtChar( data->edt,ecBack );
885 #endif /* NEW_EDITOR */ 885 #endif /* NEW_EDITOR */
886 } 886 }
887 887
888 /*NM, p016 888 /*NM, p016
889 even updating when deleting characters 889 even updating when deleting characters
890 */ 890 */
891 SEND_EVENT( data->win, SEARCH_STRING, 0, 0 ); 891 SEND_EVENT( data->win, SEARCH_STRING, 0, 0 );
892 winShow( data->win ); 892 winShow( data->win );
893 } 893 }
894 break; 894 break;
895 895
896 default: 896 default:
897 { 897 {
898 898
899 { 899 {
900 /* SPR#1428 - SH - New Editor changes */ 900 /* SPR#1428 - SH - New Editor changes */
901 #ifdef NEW_EDITOR 901 #ifdef NEW_EDITOR
902 AUI_entry_EventKey( data->entry_data, e, k ); 902 AUI_entry_EventKey( data->entry_data, e, k );
903 903
935 /******************************************************************************* 935 /*******************************************************************************
936 936
937 $Function: bookSearchKbdLongCB 937 $Function: bookSearchKbdLongCB
938 938
939 $Description: long keypress event handler, handles long clear event only 939 $Description: long keypress event handler, handles long clear event only
940 940
941 $Returns: MFW_EVENT_CONSUMED always 941 $Returns: MFW_EVENT_CONSUMED always
942 942
943 $Arguments: e, event, k, key handle 943 $Arguments: e, event, k, key handle
944 944
945 *******************************************************************************/ 945 *******************************************************************************/
946 946
947 static int bookSearchKbdLongCB( MfwEvt e, MfwKbd *k ) 947 static int bookSearchKbdLongCB( MfwEvt e, MfwKbd *k )
948 { 948 {
949 T_MFW_HND win = mfwParent( mfw_header() ); 949 T_MFW_HND win = mfwParent( mfw_header() );
950 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 950 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
951 tBookStandard *data = (tBookStandard *) win_data->user; 951 tBookStandard *data = (tBookStandard *) win_data->user;
952 952
953 TRACE_FUNCTION ("bookSearchKbdLongCB()"); 953 TRACE_FUNCTION ("bookSearchKbdLongCB()");
954 954
955 /* deal with the clear event 955 /* deal with the clear event
956 */ 956 */
957 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) ) 957 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) )
958 { 958 {
959 bookSearchDestroy( win ); 959 bookSearchDestroy( win );
972 /******************************************************************************* 972 /*******************************************************************************
973 973
974 $Function: bookSearchTimCB 974 $Function: bookSearchTimCB
975 975
976 $Description: Callback function for the Phonebook timer. 976 $Description: Callback function for the Phonebook timer.
977 977
978 $Returns: None 978 $Returns: None
979 979
980 $Arguments: window handle event, timer control block 980 $Arguments: window handle event, timer control block
981 981
982 *******************************************************************************/ 982 *******************************************************************************/
988 tBookStandard *data = (tBookStandard *) win_data->user; 988 tBookStandard *data = (tBookStandard *) win_data->user;
989 989
990 /* x0045876, 14-Aug-2006 (WR - "Current" was declared but never referenced) */ 990 /* x0045876, 14-Aug-2006 (WR - "Current" was declared but never referenced) */
991 /* tMmiPhbData *Current = &data->phbk->current; */ 991 /* tMmiPhbData *Current = &data->phbk->current; */
992 TRACE_FUNCTION ("bookSearchTimCB()"); 992 TRACE_FUNCTION ("bookSearchTimCB()");
993 993
994 SEND_EVENT( data->win, SEARCH_STRING, 1, 0); 994 SEND_EVENT( data->win, SEARCH_STRING, 1, 0);
995 winShow( data->win ); 995 winShow( data->win );
996 return MFW_EVENT_CONSUMED; 996 return MFW_EVENT_CONSUMED;
997 } 997 }
998 998
1000 /******************************************************************************* 1000 /*******************************************************************************
1001 1001
1002 $Function: bookSearchCreate 1002 $Function: bookSearchCreate
1003 1003
1004 $Description: Create the search window 1004 $Description: Create the search window
1005 1005
1006 $Returns: handle of window or NULL if error 1006 $Returns: handle of window or NULL if error
1007 1007
1008 $Arguments: parent, handle of parent window 1008 $Arguments: parent, handle of parent window
1009 1009
1010 *******************************************************************************/ 1010 *******************************************************************************/
1011 1011
1012 static T_MFW_HND bookSearchCreate( MfwHnd parent ) 1012 static T_MFW_HND bookSearchCreate( MfwHnd parent )
1013 { 1013 {
1014 T_MFW_WIN *parent_win_data = ( (T_MFW_HDR *) parent )->data; 1014 T_MFW_WIN *parent_win_data = ( (T_MFW_HDR *) parent )->data;
1058 PhbSearchTim = data->tim; 1058 PhbSearchTim = data->tim;
1059 mnuLang (data->menu,0); 1059 mnuLang (data->menu,0);
1060 1060
1061 /* 1945 MZ Initialise the edtBuf */ 1061 /* 1945 MZ Initialise the edtBuf */
1062 memset(data->edtBuf,'\0', STANDARD_EDITOR_SIZE ); 1062 memset(data->edtBuf,'\0', STANDARD_EDITOR_SIZE );
1063 1063
1064 { 1064 {
1065 1065
1066 /* SPR#1428 - SH - New Editor changes */ 1066 /* SPR#1428 - SH - New Editor changes */
1067 #ifdef NEW_EDITOR 1067 #ifdef NEW_EDITOR
1068 /*SPR 2233, make sure editor only displays lower-case chars*/ 1068 /*SPR 2233, make sure editor only displays lower-case chars*/
1070 ED_MODE_ALPHA | ED_MODE_FORMATTED, ED_CURSOR_BAR, ATB_DCS_ASCII, (UBYTE*) data->edtBuf, MAX_SEARCH_CHAR); 1070 ED_MODE_ALPHA | ED_MODE_FORMATTED, ED_CURSOR_BAR, ATB_DCS_ASCII, (UBYTE*) data->edtBuf, MAX_SEARCH_CHAR);
1071 data->editor_attr.FormatString = "*a"; 1071 data->editor_attr.FormatString = "*a";
1072 data->editor = ATB_edit_Create( &data->editor_attr, 0 ); 1072 data->editor = ATB_edit_Create( &data->editor_attr, 0 );
1073 data->entry_data = AUI_entry_Create(data->win, data->editor, SEARCH_REDRAW); 1073 data->entry_data = AUI_entry_Create(data->win, data->editor, SEARCH_REDRAW);
1074 /*SPR2233 end*/ 1074 /*SPR2233 end*/
1075 ATB_edit_Init(data->editor); 1075 ATB_edit_Init(data->editor);
1076 #else /* NEW_EDITOR */ 1076 #else /* NEW_EDITOR */
1077 bookSetEditAttributes(BOOKSEARCH_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, 1077 bookSetEditAttributes(BOOKSEARCH_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0,
1078 (char *) data->edtBuf, MAX_SEARCH_CHAR, &data->attr ); 1078 (char *) data->edtBuf, MAX_SEARCH_CHAR, &data->attr );
1079 data->edt = edtCreate( data->win, &data->attr, 0, 0 ); 1079 data->edt = edtCreate( data->win, &data->attr, 0, 0 );
1080 #endif /* NEW_EDITOR */ 1080 #endif /* NEW_EDITOR */
1081 } 1081 }
1082 1082
1089 /* And return the handle of the newly created window 1089 /* And return the handle of the newly created window
1090 */ 1090 */
1091 return data->win; 1091 return data->win;
1092 } 1092 }
1093 1093
1094 1094
1095 1095
1096 /******************************************************************************* 1096 /*******************************************************************************
1097 1097
1098 Public Methods 1098 Public Methods
1099 1099
1100 *******************************************************************************/ 1100 *******************************************************************************/
1101 1101
1102 1102
1103 1103
1104 1104
1105 /******************************************************************************* 1105 /*******************************************************************************
1106 1106
1107 $Function: bookSearchStart 1107 $Function: bookSearchStart
1108 1108
1109 $Description: Starts the search window 1109 $Description: Starts the search window
1110 1110
1111 $Returns: handle of newly created window, or NULL if error 1111 $Returns: handle of newly created window, or NULL if error
1112 1112
1113 $Arguments: parent, handle of parent window 1113 $Arguments: parent, handle of parent window
1114 1114
1115 *******************************************************************************/ 1115 *******************************************************************************/
1116 1116
1117 T_MFW_HND bookSearchStart( MfwHnd parent ) 1117 T_MFW_HND bookSearchStart( MfwHnd parent )
1118 { 1118 {
1119 T_MFW_HND win; 1119 T_MFW_HND win;
1188 /******************************************************************************* 1188 /*******************************************************************************
1189 1189
1190 $Function: bookSearchDestroy 1190 $Function: bookSearchDestroy
1191 1191
1192 $Description: Destroy the search window 1192 $Description: Destroy the search window
1193 1193
1194 $Returns: None 1194 $Returns: None
1195 1195
1196 $Arguments: Window, handle of the window to be destroyed 1196 $Arguments: Window, handle of the window to be destroyed
1197 1197
1198 *******************************************************************************/ 1198 *******************************************************************************/
1199 1199
1200 void bookSearchDestroy( MfwHnd window ) 1200 void bookSearchDestroy( MfwHnd window )
1201 { 1201 {
1202 T_MFW_WIN *win = ((T_MFW_HDR *) window)->data; 1202 T_MFW_WIN *win = ((T_MFW_HDR *) window)->data;
1251 /******************************************************************************* 1251 /*******************************************************************************
1252 1252
1253 $Function: bookSearchName 1253 $Function: bookSearchName
1254 1254
1255 $Description: locate a requested name in the phone book 1255 $Description: locate a requested name in the phone book
1256 1256
1257 $Returns: status of the findName routine 1257 $Returns: status of the findName routine
1258 1258
1259 $Arguments: pattern, to be searched for 1259 $Arguments: pattern, to be searched for
1260 number, of elements to limit the search to 1260 number, of elements to limit the search to
1261 current, pointer to a buffer to store the results 1261 current, pointer to a buffer to store the results
1262 1262
1263 *******************************************************************************/ 1263 *******************************************************************************/
1264 1264
1265 UBYTE bookSearchName (char *pattern,UBYTE number,tMmiPhbData *current) 1265 UBYTE bookSearchName (char *pattern,UBYTE number,tMmiPhbData *current)
1266 { 1266 {
1267 #ifdef NO_ASCIIZ 1267 #ifdef NO_ASCIIZ
1270 UBYTE l_name[PHB_MAX_LEN]; 1270 UBYTE l_name[PHB_MAX_LEN];
1271 #endif 1271 #endif
1272 // UBYTE len; // RAVI 1272 // UBYTE len; // RAVI
1273 int i; 1273 int i;
1274 UBYTE ret = (UBYTE)PHB_FAIL; 1274 UBYTE ret = (UBYTE)PHB_FAIL;
1275 1275
1276 TRACE_FUNCTION( "bookSearchName()" ); 1276 TRACE_FUNCTION( "bookSearchName()" );
1277 1277
1278 /* if using UPN phone book, return status of findname 1278 /* if using UPN phone book, return status of findname
1279 */ 1279 */
1280 if ( current->status.book == PHB_UPN ) 1280 if ( current->status.book == PHB_UPN )
1289 current->list.num_entries = number; 1289 current->list.num_entries = number;
1290 1290
1291 /* convert from GSM characters 1291 /* convert from GSM characters
1292 */ 1292 */
1293 #ifdef NO_ASCIIZ 1293 #ifdef NO_ASCIIZ
1294 1294
1295 memset( l_name.data, 0, PHB_MAX_LEN ); 1295 memset( l_name.data, 0, PHB_MAX_LEN );
1296 mfw_Gsm2SIMStr( MFW_DCS_7bits, (UBYTE *) pattern, PHB_MAX_LEN, l_name.data, &l_name.len ); 1296 mfw_Gsm2SIMStr( MFW_DCS_7bits, (UBYTE *) pattern, PHB_MAX_LEN, l_name.data, &l_name.len );
1297 #else 1297 #else
1298 memset( l_name, 0, PHB_MAX_LEN ); 1298 memset( l_name, 0, PHB_MAX_LEN );
1299 mfw_Gsm2SIMStr( MFW_DCS_7bits, (UBYTE *) pattern, PHB_MAX_LEN, l_name, &len ); 1299 mfw_Gsm2SIMStr( MFW_DCS_7bits, (UBYTE *) pattern, PHB_MAX_LEN, l_name, &len );
1327 */ 1327 */
1328 current->index = 1; 1328 current->index = 1;
1329 current->selectedName = 0; 1329 current->selectedName = 0;
1330 bookFindName( MAX_SEARCH_NAME, current ); 1330 bookFindName( MAX_SEARCH_NAME, current );
1331 } 1331 }
1332 1332
1333 /* check for match 1333 /* check for match
1334 */ 1334 */
1335 if ( ( current->list.num_entries < MAX_SEARCH_NAME ) 1335 if ( ( current->list.num_entries < MAX_SEARCH_NAME )
1336 || ( current->list.result == MFW_NO_ENTRY ) || ( ret == (UBYTE)PHB_FAIL ) ) 1336 || ( current->list.result == MFW_NO_ENTRY ) || ( ret == (UBYTE)PHB_FAIL ) )
1337 { 1337 {
1338 /* no, then try to find again 1338 /* no, then try to find again
1339 */ 1339 */
1340 ret = bookFindName( MAX_SEARCH_NAME, current ); 1340 ret = bookFindName( MAX_SEARCH_NAME, current );
1341 } 1341 }
1342 else 1342 else
1343 { 1343 {
1344 for ( i = 0; i < number; i++ ) 1344 for ( i = 0; i < number; i++ )
1345 #ifdef NO_ASCIIZ 1345 #ifdef NO_ASCIIZ
1346 { 1346 {
1347 /* convert from Sim to GSM and then copy to output buffer 1347 /* convert from Sim to GSM and then copy to output buffer
1348 */ 1348 */
1349 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 1349 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
1350 /*MC SPR 2175, using new function to convert name string*/ 1350 /*MC SPR 2175, using new function to convert name string*/
1351 if (current->entry[i].name.dcs == MFW_DCS_8bits && current->entry[i].name.data[0] != 0x80) 1351 if (current->entry[i].name.dcs == MFW_DCS_8bits && current->entry[i].name.data[0] != 0x80)
1369 } 1369 }
1370 1370
1371 1371
1372 1372
1373 /******************************************************************************* 1373 /*******************************************************************************
1374 1374
1375 End of File 1375 End of File
1376 1376
1377 *******************************************************************************/ 1377 *******************************************************************************/
1378 1378