comparison src/ui/bmi/mmiBookUtils.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: MmiBookUtils.c 15 $File: MmiBookUtils.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 utility function for use in the 25 This module provides utility function for use in the
26 phone book application 26 phone book application
27 27
28 ******************************************************************************** 28 ********************************************************************************
29 $History: MmiBookUtils.c 29 $History: MmiBookUtils.c
30 $History: MmiBookUtils.c 30 $History: MmiBookUtils.c
31 31
32 Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) 32 Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha)
33 Description: PhoneBook: Unexpected confirmation message when making changes to entries in SIM storage. 33 Description: PhoneBook: Unexpected confirmation message when making changes to entries in SIM storage.
34 Solution: Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. 34 Solution: Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event.
35 35
36 17 Aug, 2007 DR: OMAPS00141963 x0066814(Geetha) 36 17 Aug, 2007 DR: OMAPS00141963 x0066814(Geetha)
37 Description: PhoneBook: The "Options" menu is not returned after a current entry is copied. 37 Description: PhoneBook: The "Options" menu is not returned after a current entry is copied.
38 Solution: After copying, the menu control was not being returned back to the right window. 38 Solution: After copying, the menu control was not being returned back to the right window.
39 Added a callback, that will be called after copying an entry, where the control wil be returned to 39 Added a callback, that will be called after copying an entry, where the control wil be returned to
40 correct window. 40 correct window.
41 41
42 July 11, 2007 DR:OMAPS00137908 x00666692(Asha) 42 July 11, 2007 DR:OMAPS00137908 x00666692(Asha)
43 Description:PHONEBOOK: changing name or number under SIM storage, Please Wait message 43 Description:PHONEBOOK: changing name or number under SIM storage, Please Wait message
44 appears instead of Saved 44 appears instead of Saved
45 Solution :Changes made to handle the condition MFW_PHB_EXCT in the function changeInFile() 45 Solution :Changes made to handle the condition MFW_PHB_EXCT in the function changeInFile()
46 which modifies the phone book entry. 46 which modifies the phone book entry.
47 47
48 27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) 48 27 June, 2007 DR: OMAPS00136608 x0073106(sundeep)
49 Description:PHONEBOOK-Unexpected behavior when copying all entries from Phone to SIM 49 Description:PHONEBOOK-Unexpected behavior when copying all entries from Phone to SIM
50 Solution :Updated the execution state(MFW_PHB_EXCT) in the phonebook. 50 Solution :Updated the execution state(MFW_PHB_EXCT) in the phonebook.
51 51
52 June 27, 2007 DR:OMAPS00136627 x0062172(Syed) 52 June 27, 2007 DR:OMAPS00136627 x0062172(Syed)
53 Description:PHONEBOOK: Unexpected behavior when moving all entries from Phone to SIM 53 Description:PHONEBOOK: Unexpected behavior when moving all entries from Phone to SIM
54 Solution : Return Proper Value after phb_store_entry() in bookCopy to move all the entries 54 Solution : Return Proper Value after phb_store_entry() in bookCopy to move all the entries
55 properly. 55 properly.
56 56
57 June 05, 2007 DR:OMAPS00133241 x0061560(sateeshg) 57 June 05, 2007 DR:OMAPS00133241 x0061560(sateeshg)
58 Description:ASTEC29607,SIM:The sim card should not return 9240 still. 58 Description:ASTEC29607,SIM:The sim card should not return 9240 still.
59 Solution :MMI should not display "Saved" after db is updated but has to wait until SIM is 59 Solution :MMI should not display "Saved" after db is updated but has to wait until SIM is
60 updated with the entry and RAT_OK is received from ACI. 60 updated with the entry and RAT_OK is received from ACI.
61 61
62 62
63 June 06, 2007 DR:OMAPS00132045 x0073106 Sundeep 63 June 06, 2007 DR:OMAPS00132045 x0073106 Sundeep
64 Description : Phonebook- behaviour inconsistency in the MMI when move contact 64 Description : Phonebook- behaviour inconsistency in the MMI when move contact
65 Solution : changed a if condition in function bookCopyMultiple(), in the if(move). 65 Solution : changed a if condition in function bookCopyMultiple(), in the if(move).
66 66
67 67
68 JUNE 4,07 (sateeshg) OMAPS00131777, x0061560 68 JUNE 4,07 (sateeshg) OMAPS00131777, x0061560
69 Phonebook - Delete all command for phonebook contacts answer "list empty" even if there are contacts in the list 69 Phonebook - Delete all command for phonebook contacts answer "list empty" even if there are contacts in the list
70 Solution:Updated the current status of the phonebook 70 Solution:Updated the current status of the phonebook
71 71
72 Apr 30,2007, OMAPS00129173, x0066814(Geetha) 72 Apr 30,2007, OMAPS00129173, x0066814(Geetha)
73 Description : Phone crashes if 'Delete All' is done on SIM contacts when SIM memory is empty 73 Description : Phone crashes if 'Delete All' is done on SIM contacts when SIM memory is empty
74 Solution: Added a condition in bookDeleteBook to check the number of used entries in the seleted phonebook. 74 Solution: Added a condition in bookDeleteBook to check the number of used entries in the seleted phonebook.
75 If the condition is satified then the delete operation will proceed else an 'Empty List' dialog is displayed. 75 If the condition is satified then the delete operation will proceed else an 'Empty List' dialog is displayed.
76 76
77 Nov 17, 2006 DR:OMAPS00104376 a0393213(R.Prabakar) 77 Nov 17, 2006 DR:OMAPS00104376 a0393213(R.Prabakar)
78 Description : When tried to delete the last entry either incase of SIM or Phone book (i.e. last deletion), the board resets. 78 Description : When tried to delete the last entry either incase of SIM or Phone book (i.e. last deletion), the board resets.
79 Solution : The crash happens because of race condition between actual deletion by ACI and status check in BMI. 79 Solution : The crash happens because of race condition between actual deletion by ACI and status check in BMI.
80 Now the status before deletion is stored and status check is done on this previous status. 80 Now the status before deletion is stored and status check is done on this previous status.
81 81
82 Aug 18, 2006 ER: OMAPS00089840 x0039928 82 Aug 18, 2006 ER: OMAPS00089840 x0039928
83 Description: Changes to be made in MMI for the functionality "Delete all" ADN entries 83 Description: Changes to be made in MMI for the functionality "Delete all" ADN entries
84 Solution: A new menu item "Delete All" is added in the phone book menu and bookDeleteBook 84 Solution: A new menu item "Delete All" is added in the phone book menu and bookDeleteBook
89 Solution: Condition to delete search window in deleteFromFile is modified. 89 Solution: Condition to delete search window in deleteFromFile is modified.
90 90
91 June 01, 2006 DR: OMAPS00079716 91 June 01, 2006 DR: OMAPS00079716
92 Description:Phonebook: List of entries is not refreshed after a phonebook entry move 92 Description:Phonebook: List of entries is not refreshed after a phonebook entry move
93 Solution: Added a new callback function to handle the populating of phonebook entries 93 Solution: Added a new callback function to handle the populating of phonebook entries
94 94
95 Feb 20, 2006 REF: OMAPS00061948 x0039928 95 Feb 20, 2006 REF: OMAPS00061948 x0039928
96 Bug:PhoneBook-My number menu -failed. 96 Bug:PhoneBook-My number menu -failed.
97 Fix: phb_read_entries is called with used entries as the no of entries if used entries are less than 97 Fix: phb_read_entries is called with used entries as the no of entries if used entries are less than
98 MAX_SEARCH_NAME. 98 MAX_SEARCH_NAME.
99 99
100 Jan 27, 2006 REF: OMAPS00061925 x0039928 100 Jan 27, 2006 REF: OMAPS00061925 x0039928
101 Bug:Phonebook-Changing an entry and Immidiately deleting the entry failed. 101 Bug:Phonebook-Changing an entry and Immidiately deleting the entry failed.
102 Fix: Phonebook is populated with phone numbers after some time and not immediately after deleting an entry. 102 Fix: Phonebook is populated with phone numbers after some time and not immediately after deleting an entry.
103 103
104 Jan 22, 2006 REF: OMAPS00061930 x0039928 104 Jan 22, 2006 REF: OMAPS00061930 x0039928
105 Bug:PhoneBook -Change entry and view entry through Change option-failed 105 Bug:PhoneBook -Change entry and view entry through Change option-failed
106 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries. 106 Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries.
107 107
108 25/10/00 Original Condat(UK) BMI version. 108 25/10/00 Original Condat(UK) BMI version.
109 109
110 $End 110 $End
111 111
112 // Issue Number : SPR#15671 on 24/03/04 by Ajith K.P 112 // Issue Number : SPR#15671 on 24/03/04 by Ajith K.P
113 113
114 *******************************************************************************/ 114 *******************************************************************************/
115 115
116 116
117 117
118 /******************************************************************************* 118 /*******************************************************************************
119 119
120 Include Files 120 Include Files
121 121
122 *******************************************************************************/ 122 *******************************************************************************/
123 #define ENTITY_MFW 123 #define ENTITY_MFW
124 124
125 /* includes */ 125 /* includes */
126 #include <string.h> 126 #include <string.h>
203 #include "mmiColours.h" 203 #include "mmiColours.h"
204 #include "mmiSmsRead.h"/*MC , SPR 1242 */ 204 #include "mmiSmsRead.h"/*MC , SPR 1242 */
205 205
206 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P 206 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P
207 // Issue description: Followup from 15623, this is the BMI part of this Issue. 207 // Issue description: Followup from 15623, this is the BMI part of this Issue.
208 // At last, in the record "SSC09" the number is displayed with the "+" 208 // At last, in the record "SSC09" the number is displayed with the "+"
209 // character at the beginning of the number instead of "**21*+014543877989#". 209 // character at the beginning of the number instead of "**21*+014543877989#".
210 210
211 211
212 extern int menuFDN; 212 extern int menuFDN;
213 extern T_call call_data; 213 extern T_call call_data;
214 // Jan 27, 2006 REF: OMAPS00061925 x0039928 214 // Jan 27, 2006 REF: OMAPS00061925 x0039928
215 // Fix : Declare a extern phonebook timer handler 215 // Fix : Declare a extern phonebook timer handler
219 // Fix : Initialize Delete All flag and a window handler of please wait dialog. 219 // Fix : Initialize Delete All flag and a window handler of please wait dialog.
220 BOOL DeleteAll_flag = FALSE; 220 BOOL DeleteAll_flag = FALSE;
221 T_MFW_HND waitWindel = NULL; 221 T_MFW_HND waitWindel = NULL;
222 //x0061560 Date May17,07 (sateeshg) OMAPS00133241 222 //x0061560 Date May17,07 (sateeshg) OMAPS00133241
223 BOOL addname_flag = FALSE; 223 BOOL addname_flag = FALSE;
224 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) 224 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha)
225 Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. */ 225 Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. */
226 226
227 BOOL changename_flag = FALSE; 227 BOOL changename_flag = FALSE;
228 /******************************************************************************* 228 /*******************************************************************************
229 229
230 Private data elements 230 Private data elements
231 231
232 *******************************************************************************/ 232 *******************************************************************************/
233 233
234 /* x0039928 - Lint warnings fix 234 /* x0039928 - Lint warnings fix
235 static T_MFW_UPN_LIST *upnList = NULL; */ 235 static T_MFW_UPN_LIST *upnList = NULL; */
236 236
243 static UBYTE ipbMove = FALSE; 243 static UBYTE ipbMove = FALSE;
244 static T_MFW_HND ipbWin = NULL; 244 static T_MFW_HND ipbWin = NULL;
245 #endif 245 #endif
246 246
247 // ADDED BY RAVI - 28-11-2005 247 // ADDED BY RAVI - 28-11-2005
248 EXTERN T_MFW mfw_Ucs2SIMStr(T_MFW_DCS outMode, U16 *inUcsStr, UBYTE maxOutSize, 248 EXTERN T_MFW mfw_Ucs2SIMStr(T_MFW_DCS outMode, U16 *inUcsStr, UBYTE maxOutSize,
249 UBYTE *outMfwStr, UBYTE *outLen); 249 UBYTE *outMfwStr, UBYTE *outLen);
250 250
251 EXTERN T_MFW mfw_Gsm2SIMStr(T_MFW_DCS outMode, UBYTE *inGsmStr, UBYTE maxOutSize, 251 EXTERN T_MFW mfw_Gsm2SIMStr(T_MFW_DCS outMode, UBYTE *inGsmStr, UBYTE maxOutSize,
252 UBYTE *outMfwStr,UBYTE *outLen); 252 UBYTE *outMfwStr,UBYTE *outLen);
253 // END RAVI - 28-11-2005 253 // END RAVI - 28-11-2005
254 /******************************************************************************* 254 /*******************************************************************************
255 255
256 Private Methods 256 Private Methods
257 257
258 *******************************************************************************/ 258 *******************************************************************************/
259 259
260 /******************************************************************************* 260 /*******************************************************************************
261 261
262 $Function: changeName 262 $Function: changeName
263 263
264 $Description: Change a phone book entry if we have a valid book selected 264 $Description: Change a phone book entry if we have a valid book selected
265 265
266 $Returns: status of change, or MWB_PHB_FAIL if an error occurs 266 $Returns: status of change, or MWB_PHB_FAIL if an error occurs
267 267
268 $Arguments: book, to be updated 268 $Arguments: book, to be updated
269 entry, to update 269 entry, to update
270 currentStatus, pointer to status word 270 currentStatus, pointer to status word
271 271
272 *******************************************************************************/ 272 *******************************************************************************/
273 273
274 static UBYTE changeName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ) 274 static UBYTE changeName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus )
275 { 275 {
276 276
277 TRACE_FUNCTION( "changeName()" ); 277 TRACE_FUNCTION( "changeName()" );
278 278
279 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ 279 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */
280 changename_flag = TRUE; 280 changename_flag = TRUE;
281 281
282 if ( book == PHB_SDN ) 282 if ( book == PHB_SDN )
283 return MFW_PHB_FAIL; 283 return MFW_PHB_FAIL;
284 284
285 return phb_store_entry( book, entry, currentStatus ); 285 return phb_store_entry( book, entry, currentStatus );
286 } 286 }
287 287
288 288
289 289
290 290
294 /******************************************************************************* 294 /*******************************************************************************
295 295
296 $Function: deleteName 296 $Function: deleteName
297 297
298 $Description: Delete a phone book entry 298 $Description: Delete a phone book entry
299 299
300 $Returns: status of delete, or MWB_PHB_FAIL if an error occurs 300 $Returns: status of delete, or MWB_PHB_FAIL if an error occurs
301 301
302 $Arguments: book, to be updated 302 $Arguments: book, to be updated
303 index, index of entry to delete 303 index, index of entry to delete
304 currentStatus, pointer to status word 304 currentStatus, pointer to status word
305 305
306 *******************************************************************************/ 306 *******************************************************************************/
307 307
308 static UBYTE deleteName( UBYTE book, UBYTE index, T_MFW_PHB_STATUS *currentStatus ) 308 static UBYTE deleteName( UBYTE book, UBYTE index, T_MFW_PHB_STATUS *currentStatus )
309 { 309 {
310 TRACE_FUNCTION( "deleteName()" ); 310 TRACE_FUNCTION( "deleteName()" );
327 /******************************************************************************* 327 /*******************************************************************************
328 328
329 $Function: addName 329 $Function: addName
330 330
331 $Description: Add a new name to the phone book 331 $Description: Add a new name to the phone book
332 332
333 $Returns: status of change, or MWB_PHB_FAIL if an error occurs 333 $Returns: status of change, or MWB_PHB_FAIL if an error occurs
334 334
335 $Arguments: book, to be updated 335 $Arguments: book, to be updated
336 entry, to update 336 entry, to update
337 currentStatus, pointer to status word 337 currentStatus, pointer to status word
338 338
339 *******************************************************************************/ 339 *******************************************************************************/
340 340
341 static UBYTE addName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ) 341 static UBYTE addName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus )
342 { 342 {
343 TRACE_FUNCTION( "addName()" ); 343 TRACE_FUNCTION( "addName()" );
367 book, 367 book,
368 (char*)buf.data,(char*)entry->number); 368 (char*)buf.data,(char*)entry->number);
369 369
370 } 370 }
371 else 371 else
372 372
373 { 373 {
374 // convert from GSM to Alpha characters 374 // convert from GSM to Alpha characters
375 bookGsm2Alpha( (UBYTE *) entry->name.data ); 375 bookGsm2Alpha( (UBYTE *) entry->name.data );
376 376
377 sprintf(temp,"Book: %d Name %s Number %s", 377 sprintf(temp,"Book: %d Name %s Number %s",
385 (char*)entry->name,(char*)entry->number); 385 (char*)entry->name,(char*)entry->number);
386 #endif 386 #endif
387 TRACE_EVENT(temp); 387 TRACE_EVENT(temp);
388 } 388 }
389 entry->index = 0; 389 entry->index = 0;
390 390
391 return phb_store_entry( book, entry, currentStatus ); 391 return phb_store_entry( book, entry, currentStatus );
392 } 392 }
393 } 393 }
394 394
395 395
398 398
399 399
400 400
401 401
402 /******************************************************************************* 402 /*******************************************************************************
403 403
404 File Handling Utilities 404 File Handling Utilities
405 405
406 *******************************************************************************/ 406 *******************************************************************************/
407 407
408 /******************************************************************************* 408 /*******************************************************************************
409 409
410 $Function: storeInFile 410 $Function: storeInFile
411 411
412 $Description: Converts the name to a storeable format and stores it 412 $Description: Converts the name to a storeable format and stores it
413 in the phone book 413 in the phone book
414 414
415 $Returns: None 415 $Returns: None
416 416
417 $Arguments: phbk, pointer to phonebook structure 417 $Arguments: phbk, pointer to phonebook structure
418 418
419 *******************************************************************************/ 419 *******************************************************************************/
420 420
421 void storeInFile( T_phbk *phbk ) 421 void storeInFile( T_phbk *phbk )
422 { int i; 422 { int i;
423 UBYTE actual_length = 0; 423 UBYTE actual_length = 0;
433 433
434 434
435 if (phbk->edt_buf_name[0] == 0x80)//if unicode 435 if (phbk->edt_buf_name[0] == 0x80)//if unicode
436 { 436 {
437 /*a0393213 lint warning:Possible creation of out-of-bounds pointer soln:PHB_MAX_LEN changed to MAX_ALPHA_LEN-1*/ 437 /*a0393213 lint warning:Possible creation of out-of-bounds pointer soln:PHB_MAX_LEN changed to MAX_ALPHA_LEN-1*/
438 for (i =0; i < (MAX_ALPHA_LEN-1); i+=2) //work out string length 438 for (i =0; i < (MAX_ALPHA_LEN-1); i+=2) //work out string length
439 { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0) 439 { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0)
440 { if (i== 0) 440 { if (i== 0)
441 actual_length =0; 441 actual_length =0;
442 else 442 else
443 actual_length = i -2; 443 actual_length = i -2;
448 phbk->edt_buf_name[1] = 0x00; 448 phbk->edt_buf_name[1] = 0x00;
449 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN*/ 449 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN*/
450 memset(phbk->newEntry.name.data, 0,MAX_ALPHA_LEN); 450 memset(phbk->newEntry.name.data, 0,MAX_ALPHA_LEN);
451 //convert to SIM string 451 //convert to SIM string
452 mfw_Ucs2SIMStr( MFW_DCS_UCS2 , (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, 452 mfw_Ucs2SIMStr( MFW_DCS_UCS2 , (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN,
453 453
454 phbk->newEntry.name.data, &phbk->newEntry.name.len ); 454 phbk->newEntry.name.data, &phbk->newEntry.name.len );
455 TRACE_EVENT( (char*)phbk->newEntry.name.data); 455 TRACE_EVENT( (char*)phbk->newEntry.name.data);
456 sprintf(debug, "length:%d", phbk->newEntry.name.len); 456 sprintf(debug, "length:%d", phbk->newEntry.name.len);
457 TRACE_EVENT(debug); 457 TRACE_EVENT(debug);
458 } 458 }
459 else 459 else
460 { 460 {
461 mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN, 461 mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN,
462 phbk->newEntry.name.data, &phbk->newEntry.name.len ); 462 phbk->newEntry.name.data, &phbk->newEntry.name.len );
463 } 463 }
464 464
465 #else 465 #else
466 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN*/ 466 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN*/
467 strncpy( (char *)phbk->newEntry.name, (char *)phbk->edt_buf_name, MAX_ALPHA_LEN ); 467 strncpy( (char *)phbk->newEntry.name, (char *)phbk->edt_buf_name, MAX_ALPHA_LEN );
468 468
469 #endif 469 #endif
470 470
471 /* update the number 471 /* update the number
472 */ 472 */
473 strncpy( (char *) phbk->newEntry.number, (char *) phbk->edt_buf_number, PHB_MAX_LEN ); 473 strncpy( (char *) phbk->newEntry.number, (char *) phbk->edt_buf_number, PHB_MAX_LEN );
474 /*SPR 1327, copy current phonebook type to new entry*/ 474 /*SPR 1327, copy current phonebook type to new entry*/
475 phbk->newEntry.book = phbk->current.status.book; 475 phbk->newEntry.book = phbk->current.status.book;
476 /*If current phonebook UPN, don't overwrite phonebook type*/ 476 /*If current phonebook UPN, don't overwrite phonebook type*/
477 // Feb 20, 2006 REF: OMAPS00061948 x0039928 477 // Feb 20, 2006 REF: OMAPS00061948 x0039928
478 // Fix : A check is made with enum PHB_UPN of MFW instead of UPN of ACI 478 // Fix : A check is made with enum PHB_UPN of MFW instead of UPN of ACI
479 if( phbk->newEntry.book != PHB_UPN) 479 if( phbk->newEntry.book != PHB_UPN)
480 phbk->newEntry.book = bookActiveBook(WRITE); 480 phbk->newEntry.book = bookActiveBook(WRITE);
481 phbk->newEntry.index = 0; 481 phbk->newEntry.index = 0;
482 482
490 /* Entry saved okay 490 /* Entry saved okay
491 */ 491 */
492 MmiBookSetCurrentText( TxtSaved ); 492 MmiBookSetCurrentText( TxtSaved );
493 } 493 }
494 break; 494 break;
495 //x0061560 Date May16,07 (sateeshg) OMAPS00133241 495 //x0061560 Date May16,07 (sateeshg) OMAPS00133241
496 case MFW_PHB_EXCT : 496 case MFW_PHB_EXCT :
497 { 497 {
498 /* Entry saved okay 498 /* Entry saved okay
499 */ 499 */
500 MmiBookSetCurrentText( TxtPleaseWait ); 500 MmiBookSetCurrentText( TxtPleaseWait );
501 // MmiBookSetCurrentText( TxtSaved ); 501 // MmiBookSetCurrentText( TxtSaved );
502 502
503 } 503 }
504 //end 504 //end
505 break; 505 break;
506 506
507 case MFW_PHB_FULL : 507 case MFW_PHB_FULL :
538 /******************************************************************************* 538 /*******************************************************************************
539 539
540 $Function: changeInFile 540 $Function: changeInFile
541 541
542 $Description: change the phone book entry 542 $Description: change the phone book entry
543 543
544 $Returns: none 544 $Returns: none
545 545
546 $Arguments: phbk, pointer to phonebook structure 546 $Arguments: phbk, pointer to phonebook structure
547 547
548 *******************************************************************************/ 548 *******************************************************************************/
549 549
550 void changeInFile( T_phbk *phbk ) 550 void changeInFile( T_phbk *phbk )
551 { int i; 551 { int i;
552 int actual_length=0; 552 int actual_length=0;
553 TRACE_FUNCTION( "changeInFile()" ); 553 TRACE_FUNCTION( "changeInFile()" );
554 554
555 if(phbk->current.status.book == PHB_ADN_FDN) 555 if(phbk->current.status.book == PHB_ADN_FDN)
556 phbk->current.status.book = PHB_ADN; //JVJE We can only store in ADN/FDN 556 phbk->current.status.book = PHB_ADN; //JVJE We can only store in ADN/FDN
557 else 557 else
558 phbk->current.status.book = phbk->current.status.book; 558 phbk->current.status.book = phbk->current.status.book;
559 559
560 TRACE_EVENT_P1("Current Book = %d", phbk->current.status.book); 560 TRACE_EVENT_P1("Current Book = %d", phbk->current.status.book);
561 TRACE_EVENT_P1("Current Name = %d", phbk->current.selectedName); 561 TRACE_EVENT_P1("Current Name = %d", phbk->current.selectedName);
562 TRACE_EVENT_P1("Current Buf Name = %s", phbk->edt_buf_name); 562 TRACE_EVENT_P1("Current Buf Name = %s", phbk->edt_buf_name);
563 563
564 564
578 break; 578 break;
579 } 579 }
580 } 580 }
581 phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string 581 phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string
582 phbk->edt_buf_name[1] = 0x00; 582 phbk->edt_buf_name[1] = 0x00;
583 583
584 memset(phbk->current.entry[phbk->current.selectedName].name.data, 0, MAX_ALPHA_LEN); 584 memset(phbk->current.entry[phbk->current.selectedName].name.data, 0, MAX_ALPHA_LEN);
585 //convert to SIM string 585 //convert to SIM string
586 mfw_Ucs2SIMStr( MFW_DCS_UCS2, (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, 586 mfw_Ucs2SIMStr( MFW_DCS_UCS2, (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN,
587 phbk->current.entry[phbk->current.selectedName].name.data, 587 phbk->current.entry[phbk->current.selectedName].name.data,
588 &phbk->current.entry[phbk->current.selectedName].name.len ); 588 &phbk->current.entry[phbk->current.selectedName].name.len );
623 /* Write failure 623 /* Write failure
624 */ 624 */
625 MmiBookSetCurrentText( TxtWriteError ); 625 MmiBookSetCurrentText( TxtWriteError );
626 } 626 }
627 break; 627 break;
628 /* x0056422 on Aug 02,2007 for 628 /* x0056422 on Aug 02,2007 for
629 OMAPS00140447 - PhoneBook: Unexpected confirmation message 629 OMAPS00140447 - PhoneBook: Unexpected confirmation message
630 when making changes to entries in SIM storage. */ 630 when making changes to entries in SIM storage. */
631 631
632 // July 11, 2007 DR:OMAPS00137908 x00666692(Asha) 632 // July 11, 2007 DR:OMAPS00137908 x00666692(Asha)
633 //PHONEBOOK: changing name or number under SIM storage, Please Wait 633 //PHONEBOOK: changing name or number under SIM storage, Please Wait
634 //message appears instead of Saved 634 //message appears instead of Saved
635 case MFW_PHB_EXCT : 635 case MFW_PHB_EXCT :
636 { 636 {
637 /* Operation in progress 637 /* Operation in progress
638 */ 638 */
639 MmiBookSetCurrentText( TxtPleaseWait ); 639 MmiBookSetCurrentText( TxtPleaseWait );
640 // MmiBookSetCurrentText( TxtSaved ); 640 // MmiBookSetCurrentText( TxtSaved );
641 641
642 } 642 }
643 //end 643 //end
644 break; 644 break;
645 645
646 default: 646 default:
663 /******************************************************************************* 663 /*******************************************************************************
664 664
665 $Function: deleteFromFile 665 $Function: deleteFromFile
666 666
667 $Description: delete an entry from a phone book 667 $Description: delete an entry from a phone book
668 668
669 $Returns: None 669 $Returns: None
670 670
671 $Arguments: phbk, phone book handle, 671 $Arguments: phbk, phone book handle,
672 book, book to update, 672 book, book to update,
673 673
674 *******************************************************************************/ 674 *******************************************************************************/
675 675
676 void deleteFromFile( T_phbk *phbk, UBYTE book ) 676 void deleteFromFile( T_phbk *phbk, UBYTE book )
677 { 677 {
678 int index; 678 int index;
679 T_MFW_PHB_STATUS phb_status_before_delete; /*OMAPS00104376 a0393213(R.Prabakar)*/ 679 T_MFW_PHB_STATUS phb_status_before_delete; /*OMAPS00104376 a0393213(R.Prabakar)*/
680 680
681 TRACE_FUNCTION( "deleteFromFile()" ); 681 TRACE_FUNCTION( "deleteFromFile()" );
682 682
683 index = phbk->current.selectedName - phbk->current.missedCallsOffset; 683 index = phbk->current.selectedName - phbk->current.missedCallsOffset;
684 /*OMAPS00104376 a0393213(R.Prabakar)- getting the status of the phonebook before deletion*/ 684 /*OMAPS00104376 a0393213(R.Prabakar)- getting the status of the phonebook before deletion*/
685 phb_status_before_delete.book=book; 685 phb_status_before_delete.book=book;
693 */ 693 */
694 MmiBookSetCurrentText( TxtEntryDeleted ); 694 MmiBookSetCurrentText( TxtEntryDeleted );
695 695
696 #ifdef NO_ASCIIZ 696 #ifdef NO_ASCIIZ
697 phbk->current.entry[index].name.len = 0; 697 phbk->current.entry[index].name.len = 0;
698 memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); 698 memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN);
699 699
700 #else 700 #else
701 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 701 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
702 memset((char*)phbk->current.entry[index].name, '\0', MAX_ALPHA_LEN); 702 memset((char*)phbk->current.entry[index].name, '\0', MAX_ALPHA_LEN);
703 memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); 703 memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN);
704 #endif 704 #endif
705 /* Move the current index to the next valid entry 705 /* Move the current index to the next valid entry
706 */ 706 */
707 if(phbk->current.selectedName > 0) 707 if(phbk->current.selectedName > 0)
708 phbk->current.selectedName --; 708 phbk->current.selectedName --;
709 else 709 else
710 phbk->current.selectedName = 0; 710 phbk->current.selectedName = 0;
711 711
712 if(phbk->current.index > 1) 712 if(phbk->current.index > 1)
713 phbk->current.index--; 713 phbk->current.index--;
714 else 714 else
715 phbk->current.index = 1; 715 phbk->current.index = 1;
716 716
767 /******************************************************************************* 767 /*******************************************************************************
768 768
769 $Function: bookChangePB 769 $Function: bookChangePB
770 770
771 $Description: Change the phonebook 771 $Description: Change the phonebook
772 772
773 $Returns: None 773 $Returns: None
774 774
775 $Arguments: None. 775 $Arguments: None.
776 776
777 *******************************************************************************/ 777 *******************************************************************************/
778 778
779 void bookChangePB(T_MFW_HND win, UBYTE identifier, UBYTE reason) 779 void bookChangePB(T_MFW_HND win, UBYTE identifier, UBYTE reason)
780 { 780 {
781 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 781 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
782 T_phbk *Phbk = (T_phbk *) win_data->user; 782 T_phbk *Phbk = (T_phbk *) win_data->user;
783 783
784 GI_pb_SetPhonebook(identifier); 784 GI_pb_SetPhonebook(identifier);
785 bookShowInfoScreen( Phbk->win, TxtPhonebook, TxtChanged, NULL, NULL, 3000); 785 bookShowInfoScreen( Phbk->win, TxtPhonebook, TxtChanged, NULL, NULL, 3000);
786 return; 786 return;
787 } 787 }
788 788
790 /******************************************************************************* 790 /*******************************************************************************
791 791
792 $Function: bookCopy 792 $Function: bookCopy
793 793
794 $Description: Copy or move a phonebook entry from one book to another 794 $Description: Copy or move a phonebook entry from one book to another
795 795
796 $Returns: status of change, or MWB_PHB_FAIL if an error occurs 796 $Returns: status of change, or MWB_PHB_FAIL if an error occurs
797 797
798 $Arguments: entry - the entry to be moved or copied 798 $Arguments: entry - the entry to be moved or copied
799 srcStatus - Status information about the source phonebook 799 srcStatus - Status information about the source phonebook
800 destStatus - Status information about the destination phonebook 800 destStatus - Status information about the destination phonebook
801 move - TRUE if the original record is to be deleted 801 move - TRUE if the original record is to be deleted
802 802
803 *******************************************************************************/ 803 *******************************************************************************/
804 804
805 UBYTE bookCopy( T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *destStatus, T_MFW_PHB_STATUS *srcStatus, UBYTE move ) 805 UBYTE bookCopy( T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *destStatus, T_MFW_PHB_STATUS *srcStatus, UBYTE move )
806 { 806 {
807 T_MFW ret; 807 T_MFW ret;
808 UBYTE srcIndex; 808 UBYTE srcIndex;
809 UBYTE srcBook; 809 UBYTE srcBook;
810 810
811 TRACE_FUNCTION("bookCopy"); 811 TRACE_FUNCTION("bookCopy");
812 812
813 if (!destStatus->avail_entries) 813 if (!destStatus->avail_entries)
814 { 814 {
815 /* There's no room in the destination phonebook to add the entry */ 815 /* There's no room in the destination phonebook to add the entry */
816 TRACE_EVENT("bookCopy: dest phonebook full"); 816 TRACE_EVENT("bookCopy: dest phonebook full");
817 return MFW_PHB_FULL; 817 return MFW_PHB_FULL;
824 { 824 {
825 TRACE_EVENT("bookCopy: Alpha tag cropped"); 825 TRACE_EVENT("bookCopy: Alpha tag cropped");
826 entry->name.len = destStatus->tag_len; 826 entry->name.len = destStatus->tag_len;
827 entry->name.data[entry->name.len] = NULL; 827 entry->name.data[entry->name.len] = NULL;
828 } 828 }
829 829
830 ret = phb_store_entry( destStatus->book, entry, destStatus ); 830 ret = phb_store_entry( destStatus->book, entry, destStatus );
831 TRACE_EVENT_P2("bookCopy: phb_store_entry book %d result %d", destStatus->book, ret); 831 TRACE_EVENT_P2("bookCopy: phb_store_entry book %d result %d", destStatus->book, ret);
832 832
833 // 27 June, 2007 DR:OMAPS00136627 x0062172 Syed 833 // 27 June, 2007 DR:OMAPS00136627 x0062172 Syed
834 if ( (ret!=MFW_PHB_OK) && (ret!=MFW_PHB_EXCT) ) 834 if ( (ret!=MFW_PHB_OK) && (ret!=MFW_PHB_EXCT) )
835 return ret; 835 return ret;
836 836
837 /* Only try to delete the entry if we are moving an entry from one book 837 /* Only try to delete the entry if we are moving an entry from one book
838 * to another. Don't try if it is an FDN entry */ 838 * to another. Don't try if it is an FDN entry */
839 839
840 TRACE_EVENT_P2("move %d, entry->book %d", move, entry->book); 840 TRACE_EVENT_P2("move %d, entry->book %d", move, entry->book);
841 841
842 if (move && entry->book!=PHB_FDN) 842 if (move && entry->book!=PHB_FDN)
843 { 843 {
844 if (( srcStatus->book == PHB_UPN) || (srcStatus->book == PHB_FDN )) 844 if (( srcStatus->book == PHB_UPN) || (srcStatus->book == PHB_FDN ))
845 srcBook = srcStatus->book; 845 srcBook = srcStatus->book;
846 else 846 else
851 } 851 }
852 852
853 /* 30 Aug ,2007 DR:OMAPS00143539 ,x0081909 ( Deepak ) */ 853 /* 30 Aug ,2007 DR:OMAPS00143539 ,x0081909 ( Deepak ) */
854 854
855 /* If we copy an entry and then try to delete it from either SIM or Phone storage,before delete opertaion Index of an entry is restored */ 855 /* If we copy an entry and then try to delete it from either SIM or Phone storage,before delete opertaion Index of an entry is restored */
856 856
857 entry->index = srcIndex; 857 entry->index = srcIndex;
858 858
859 TRACE_EVENT("bookCopy: leaving function"); 859 TRACE_EVENT("bookCopy: leaving function");
860 860
861 return ret; 861 return ret;
862 } 862 }
863 863
864 864
865 /******************************************************************************* 865 /*******************************************************************************
866 866
867 $Function: bookDelMoveCB 867 $Function: bookDelMoveCB
868 868
869 $Description: callback after moving a phonebook entry 869 $Description: callback after moving a phonebook entry
870 870
871 $Returns: 871 $Returns:
872 872
873 $Arguments: 873 $Arguments:
874 874
875 *******************************************************************************/ 875 *******************************************************************************/
876 //x0pleela 01 june, 2006 DR: OMAPS00079716 876 //x0pleela 01 june, 2006 DR: OMAPS00079716
877 877
878 static void bookDelMoveCB( T_MFW_HND win, USHORT Identifier,UBYTE reason) 878 static void bookDelMoveCB( T_MFW_HND win, USHORT Identifier,UBYTE reason)
879 { 879 {
884 bookMenuDestroy(Phbk->menu_options_win); 884 bookMenuDestroy(Phbk->menu_options_win);
885 if( Phbk->current.status.used_entries > 0 ) 885 if( Phbk->current.status.used_entries > 0 )
886 { 886 {
887 SEND_EVENT( Phbk->search_win, SEARCH_STRING, 1, 0); 887 SEND_EVENT( Phbk->search_win, SEARCH_STRING, 1, 0);
888 winShow(Phbk->search_win ); 888 winShow(Phbk->search_win );
889 } 889 }
890 else 890 else
891 { 891 {
892 if( Phbk->search_win) 892 if( Phbk->search_win)
893 { 893 {
894 //destroy current window 894 //destroy current window
895 bookSearchDestroy(Phbk->search_win ); 895 bookSearchDestroy(Phbk->search_win );
896 } 896 }
897 } 897 }
898 898
899 } 899 }
900 /******************************************************************************* 900 /*******************************************************************************
901 901
902 $Function: bookCopyCB 902 $Function: bookCopyCB
903 903
904 $Description: callback after Copying a phonebook entry 904 $Description: callback after Copying a phonebook entry
905 905
906 $Returns: 906 $Returns:
907 907
908 $Arguments: 908 $Arguments:
909 909
910 *******************************************************************************/ 910 *******************************************************************************/
911 //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963 911 //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963
912 912
913 static void bookCopyCB( T_MFW_HND win, USHORT Identifier,UBYTE reason) 913 static void bookCopyCB( T_MFW_HND win, USHORT Identifier,UBYTE reason)
914 { 914 {
915 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 915 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
916 T_phbk *Phbk = (T_phbk *) win_data->user; 916 T_phbk *Phbk = (T_phbk *) win_data->user;
917 917
918 bookMenuDestroy(Phbk->menu_options_win); 918 bookMenuDestroy(Phbk->menu_options_win);
919 919
920 } 920 }
921 /******************************************************************************* 921 /*******************************************************************************
922 $Function: bookCopySingle 922 $Function: bookCopySingle
923 923
924 $Description: Copy or move a single phonebook entry 924 $Description: Copy or move a single phonebook entry
925 925
926 $Returns: None 926 $Returns: None
927 927
928 $Arguments: None. 928 $Arguments: None.
929 929
930 *******************************************************************************/ 930 *******************************************************************************/
931 931
932 void bookCopySingle(T_MFW_HND win, UBYTE identifier, UBYTE reason) 932 void bookCopySingle(T_MFW_HND win, UBYTE identifier, UBYTE reason)
933 { 933 {
934 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 934 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
937 int txtId; 937 int txtId;
938 T_MFW_PHB_STATUS destStatus; 938 T_MFW_PHB_STATUS destStatus;
939 tMmiPhbData *current = &Phbk->phbk->current; 939 tMmiPhbData *current = &Phbk->phbk->current;
940 940
941 TRACE_FUNCTION("bookCopySingle"); 941 TRACE_FUNCTION("bookCopySingle");
942 942
943 oldBook = bookGetBookSelected(); 943 oldBook = bookGetBookSelected();
944 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 944 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
945 // While doing a copy from the FDN menu the destination should always be internal phonebook 945 // While doing a copy from the FDN menu the destination should always be internal phonebook
946 if(menuFDN && (call_data.calls.numCalls==0)) 946 if(menuFDN && (call_data.calls.numCalls==0))
947 { 947 {
948 destStatus.book = PHB_IPB; 948 destStatus.book = PHB_IPB;
949 } 949 }
961 if (destStatus.avail_entries) 961 if (destStatus.avail_entries)
962 { 962 {
963 switch (bookCopy(&current->entry[current->selectedName], &destStatus, &current->status, identifier)) 963 switch (bookCopy(&current->entry[current->selectedName], &destStatus, &current->status, identifier))
964 { 964 {
965 case MFW_PHB_OK: 965 case MFW_PHB_OK:
966 //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) 966 //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep)
967 case MFW_PHB_EXCT: 967 case MFW_PHB_EXCT:
968 txtId = TxtStored; 968 txtId = TxtStored;
969 break; 969 break;
970 case MFW_PHB_FULL: 970 case MFW_PHB_FULL:
971 txtId = TxtPhbkFull; 971 txtId = TxtPhbkFull;
987 else 987 else
988 //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963 988 //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963
989 bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookCopyCB ); 989 bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookCopyCB );
990 /*if (identifier) 990 /*if (identifier)
991 { 991 {
992 // Destroy options menu and regenerate address list 992 // Destroy options menu and regenerate address list
993 993
994 if(Phbk->current.status.used_entries > 0) 994 if(Phbk->current.status.used_entries > 0)
995 SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 ); 995 SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 );
996 SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book ); 996 SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book );
997 }*/ 997 }*/
998 998
999 return; 999 return;
1000 } 1000 }
1001 1001
1002 1002
1003 /******************************************************************************* 1003 /*******************************************************************************
1004 1004
1005 $Function: bookCopyMultiple 1005 $Function: bookCopyMultiple
1006 1006
1007 $Description: Copy or move multiple phonebook entries 1007 $Description: Copy or move multiple phonebook entries
1008 1008
1009 $Returns: None 1009 $Returns: None
1010 1010
1011 $Arguments: None. 1011 $Arguments: None.
1012 1012
1013 *******************************************************************************/ 1013 *******************************************************************************/
1014 1014
1015 void bookCopyMultiple(T_MFW_HND win, UBYTE move, UBYTE reason) 1015 void bookCopyMultiple(T_MFW_HND win, UBYTE move, UBYTE reason)
1016 { 1016 {
1017 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1017 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1026 // T_MFW_HND info_win; // RAVI 1026 // T_MFW_HND info_win; // RAVI
1027 static T_MFW_HND waitWin = NULL; 1027 static T_MFW_HND waitWin = NULL;
1028 /* Set up some data */ 1028 /* Set up some data */
1029 1029
1030 TRACE_FUNCTION("bookCopyMultiple"); 1030 TRACE_FUNCTION("bookCopyMultiple");
1031 1031
1032 entries.entry = &entry; 1032 entries.entry = &entry;
1033 1033
1034 srcStatus.book = bookActiveBook(WRITE); 1034 srcStatus.book = bookActiveBook(WRITE);
1035 bookGetCurrentStatus( &srcStatus ); 1035 bookGetCurrentStatus( &srcStatus );
1036 1036
1062 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopyMultiple, NULL, 100); 1062 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopyMultiple, NULL, 100);
1063 return; 1063 return;
1064 } 1064 }
1065 waitWin = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); 1065 waitWin = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER);
1066 } 1066 }
1067 1067
1068 TRACE_EVENT_P1("Entries in list: %d", srcStatus.used_entries); 1068 TRACE_EVENT_P1("Entries in list: %d", srcStatus.used_entries);
1069 1069
1070 /* For special case where SIM will give no E_PHB_READY response, the 1070 /* For special case where SIM will give no E_PHB_READY response, the
1071 * do...while operates as a loop below. Otherwise, it will only go through 1071 * do...while operates as a loop below. Otherwise, it will only go through
1072 * once, and this function will be called repeatedly every E_PHB_READY */ 1072 * once, and this function will be called repeatedly every E_PHB_READY */
1085 } 1085 }
1086 else 1086 else
1087 { 1087 {
1088 /* For moving, always delete first entry alphabetically, list moves down. 1088 /* For moving, always delete first entry alphabetically, list moves down.
1089 * For copying, move through the list */ 1089 * For copying, move through the list */
1090 1090
1091 if (move) 1091 if (move)
1092 readIndex = 1; 1092 readIndex = 1;
1093 else 1093 else
1094 readIndex = ipbCopyIndex; 1094 readIndex = ipbCopyIndex;
1095 1095
1096 TRACE_EVENT_P1("Moving entry %d", readIndex); 1096 TRACE_EVENT_P1("Moving entry %d", readIndex);
1097 1097
1098 /* Read in entry and copy/move it */ 1098 /* Read in entry and copy/move it */
1099 1099
1100 phb_read_entries(srcStatus.book, readIndex, MFW_PHB_ALPHA, 1, &entries); 1100 phb_read_entries(srcStatus.book, readIndex, MFW_PHB_ALPHA, 1, &entries);
1101 1101
1102 switch (bookCopy(entries.entry, &destStatus, &srcStatus, move)) 1102 switch (bookCopy(entries.entry, &destStatus, &srcStatus, move))
1103 { 1103 {
1104 case MFW_PHB_OK: 1104 case MFW_PHB_OK:
1105 //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) 1105 //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep)
1106 case MFW_PHB_EXCT: 1106 case MFW_PHB_EXCT:
1107 txtId = TxtStored; 1107 txtId = TxtStored;
1108 break; 1108 break;
1109 case MFW_PHB_FULL: 1109 case MFW_PHB_FULL:
1110 txtId = TxtPhbkFull; 1110 txtId = TxtPhbkFull;
1111 break; 1111 break;
1112 default: 1112 default:
1113 txtId = TxtFailed; 1113 txtId = TxtFailed;
1114 break; 1114 break;
1115 } 1115 }
1116 1116
1117 ipbCopyIndex--; 1117 ipbCopyIndex--;
1118 } 1118 }
1119 }/* Is a loop in special case - see above */ 1119 }/* Is a loop in special case - see above */
1120 while (!bookGetBookSelected() && !move && txtId==TxtStored && ipbCopyIndex>0); 1120 while (!bookGetBookSelected() && !move && txtId==TxtStored && ipbCopyIndex>0);
1121 1121
1122 /* If we've finished, or an error has occurred, show info dialog */ 1122 /* If we've finished, or an error has occurred, show info dialog */
1123 1123
1124 if (ipbCopyIndex==0 || txtId!=TxtStored) 1124 if (ipbCopyIndex==0 || txtId!=TxtStored)
1125 { 1125 {
1126 ipbCopyIndex = 0; 1126 ipbCopyIndex = 0;
1127 1127
1128 /* Destroy the Please Wait window and show the result message */ 1128 /* Destroy the Please Wait window and show the result message */
1129 1129
1130 bookShowInformation( win, txtId, NULL, NULL ); 1130 bookShowInformation( win, txtId, NULL, NULL );
1131 if (waitWin) 1131 if (waitWin)
1132 { 1132 {
1133 SEND_EVENT(waitWin, DIALOG_DESTROY,0,0); 1133 SEND_EVENT(waitWin, DIALOG_DESTROY,0,0);
1134 } 1134 }
1135 1135
1136 if (move) 1136 if (move)
1137 { 1137 {
1138 /* Destroy options menu and regenerate address list */ 1138 /* Destroy options menu and regenerate address list */
1139 1139
1140 bookMenuDestroy(Phbk->menu_options_win); 1140 bookMenuDestroy(Phbk->menu_options_win);
1141 bookGetCurrentStatus( &Phbk->current.status ); 1141 bookGetCurrentStatus( &Phbk->current.status );
1142 //06 June, 2007 DR: OMAPS00132045 1142 //06 June, 2007 DR: OMAPS00132045
1143 //changed the condition from used_entries to ipbCopyIndex 1143 //changed the condition from used_entries to ipbCopyIndex
1144 if((ipbCopyIndex > 0)) 1144 if((ipbCopyIndex > 0))
1148 } 1148 }
1149 else 1149 else
1150 bookSearchDestroy(Phbk->search_win); 1150 bookSearchDestroy(Phbk->search_win);
1151 } 1151 }
1152 } 1152 }
1153 1153
1154 return; 1154 return;
1155 } 1155 }
1156 #endif 1156 #endif
1157 1157
1158 1158
1159 1159
1160 /******************************************************************************* 1160 /*******************************************************************************
1161 1161
1162 Public Methods 1162 Public Methods
1163 1163
1164 *******************************************************************************/ 1164 *******************************************************************************/
1165 1165
1166 1166
1167 1167
1168 1168
1172 1172
1173 $Description: 1173 $Description:
1174 1174
1175 This returns the window handle associated with the current 1175 This returns the window handle associated with the current
1176 MFW element 1176 MFW element
1177 1177
1178 $Returns: window handle of current MFW item 1178 $Returns: window handle of current MFW item
1179 1179
1180 $Arguments: none. 1180 $Arguments: none.
1181 1181
1182 *******************************************************************************/ 1182 *******************************************************************************/
1183 1183
1184 tBookMfwHnd bookCurrentWindow( void ) 1184 tBookMfwHnd bookCurrentWindow( void )
1185 { 1185 {
1186 return mfwParent( mfwHeader() ); 1186 return mfwParent( mfwHeader() );
1194 1194
1195 /******************************************************************************* 1195 /*******************************************************************************
1196 1196
1197 $Function: bookDefaultCallBack 1197 $Function: bookDefaultCallBack
1198 1198
1199 $Description: 1199 $Description:
1200 1200
1201 This is a simple call back function which is invoked when 1201 This is a simple call back function which is invoked when
1202 a not implemented dialog is displayed. We don't want anyone 1202 a not implemented dialog is displayed. We don't want anyone
1203 outside of this module using it so define it as static, 1203 outside of this module using it so define it as static,
1204 this will still be callable from the info dialogs as it 1204 this will still be callable from the info dialogs as it
1205 will use the reference we set up. 1205 will use the reference we set up.
1206 1206
1207 $Returns: zero, always 1207 $Returns: zero, always
1208 1208
1209 $Arguments: win, parent window 1209 $Arguments: win, parent window
1210 identifier, of the window 1210 identifier, of the window
1211 reason, for the window 1211 reason, for the window
1212 1212
1213 *******************************************************************************/ 1213 *******************************************************************************/
1214 1214
1215 static tBookStatus bookDefaultCallBack( tBookMfwHnd win, UBYTE identifier, UBYTE reason ) 1215 static tBookStatus bookDefaultCallBack( tBookMfwHnd win, UBYTE identifier, UBYTE reason )
1216 { 1216 {
1217 if ( win ) 1217 if ( win )
1229 1229
1230 /******************************************************************************* 1230 /*******************************************************************************
1231 1231
1232 $Function: bookWindowData 1232 $Function: bookWindowData
1233 1233
1234 $Description: 1234 $Description:
1235 1235
1236 This routine is designed to be invoked from within a menu 1236 This routine is designed to be invoked from within a menu
1237 handler or call back function and will return a pointer to 1237 handler or call back function and will return a pointer to
1238 the window data associated with the current MFW element. 1238 the window data associated with the current MFW element.
1239 1239
1240 $Returns: pointer to the data area 1240 $Returns: pointer to the data area
1241 1241
1242 $Arguments: none. 1242 $Arguments: none.
1243 1243
1244 *******************************************************************************/ 1244 *******************************************************************************/
1245 1245
1246 void *bookWindowData( void ) 1246 void *bookWindowData( void )
1247 { 1247 {
1248 tBookMfwHnd WinPtr; 1248 tBookMfwHnd WinPtr;
1263 1263
1264 /******************************************************************************* 1264 /*******************************************************************************
1265 1265
1266 $Function: bookMenuSelectedNumber 1266 $Function: bookMenuSelectedNumber
1267 1267
1268 $Description: 1268 $Description:
1269 1269
1270 This will return the currently selected entry in the phone 1270 This will return the currently selected entry in the phone
1271 book, when the routine is being called from a menu handler 1271 book, when the routine is being called from a menu handler
1272 1272
1273 $Returns: pointer to the selected number buffer 1273 $Returns: pointer to the selected number buffer
1274 1274
1275 $Arguments: none. 1275 $Arguments: none.
1276 1276
1277 *******************************************************************************/ 1277 *******************************************************************************/
1278 1278
1279 char *bookMenuSelectedNumber( void ) 1279 char *bookMenuSelectedNumber( void )
1280 { 1280 {
1281 1281
1302 1302
1303 $Description: access routine for the local static menu area 1303 $Description: access routine for the local static menu area
1304 1304
1305 Utility functions to determine if the phone book is 1305 Utility functions to determine if the phone book is
1306 still in the loading state 1306 still in the loading state
1307 1307
1308 $Returns: BOOK_FAILURE if loading, otherwise BOOK_SUCCESS 1308 $Returns: BOOK_FAILURE if loading, otherwise BOOK_SUCCESS
1309 1309
1310 $Arguments: none. 1310 $Arguments: none.
1311 1311
1312 *******************************************************************************/ 1312 *******************************************************************************/
1313 1313
1314 tBookStatus bookPhoneBookLoading( void ) 1314 tBookStatus bookPhoneBookLoading( void )
1315 { 1315 {
1316 int temp; 1316 int temp;
1333 /******************************************************************************* 1333 /*******************************************************************************
1334 1334
1335 $Function: bookInfoDialog 1335 $Function: bookInfoDialog
1336 1336
1337 $Description: 1337 $Description:
1338 1338
1339 Utility functions just to throw a string onto the screen 1339 Utility functions just to throw a string onto the screen
1340 primarily for debug purposes, the modal version will wait 1340 primarily for debug purposes, the modal version will wait
1341 for a user input before removing the message, the non-modal 1341 for a user input before removing the message, the non-modal
1342 will clear after three seconds 1342 will clear after three seconds
1343 1343
1344 $Returns: One. 1344 $Returns: One.
1345 1345
1346 $Arguments: String1, String2, character strings to be displayed. 1346 $Arguments: String1, String2, character strings to be displayed.
1347 1347
1348 *******************************************************************************/ 1348 *******************************************************************************/
1349 1349
1350 tBookStatus bookInfoDialog( char *String1, char *String2 ) 1350 tBookStatus bookInfoDialog( char *String1, char *String2 )
1351 { 1351 {
1352 tBookMfwHnd Win = bookCurrentWindow(); 1352 tBookMfwHnd Win = bookCurrentWindow();
1374 1374
1375 /******************************************************************************* 1375 /*******************************************************************************
1376 1376
1377 $Function: bookNotImplemented 1377 $Function: bookNotImplemented
1378 1378
1379 $Description: 1379 $Description:
1380 1380
1381 This will present an information dialog indicating the current 1381 This will present an information dialog indicating the current
1382 feature is still under development. This routine will use the 1382 feature is still under development. This routine will use the
1383 current MFW element to detect the handle of the parent window 1383 current MFW element to detect the handle of the parent window
1384 if the incoming window handle is NULL. 1384 if the incoming window handle is NULL.
1385 1385
1386 $Returns: One 1386 $Returns: One
1387 1387
1388 $Arguments: Parent, window, can be NULL 1388 $Arguments: Parent, window, can be NULL
1389 1389
1390 *******************************************************************************/ 1390 *******************************************************************************/
1391 1391
1392 tBookStatus bookNotImplemented( tBookMfwHnd Parent ) 1392 tBookStatus bookNotImplemented( tBookMfwHnd Parent )
1393 { 1393 {
1394 tBookMfwHnd Win = ( Parent ) ? Parent : bookCurrentWindow(); 1394 tBookMfwHnd Win = ( Parent ) ? Parent : bookCurrentWindow();
1424 1424
1425 /******************************************************************************* 1425 /*******************************************************************************
1426 1426
1427 $Function: set_edt_attr 1427 $Function: set_edt_attr
1428 1428
1429 $Description: 1429 $Description:
1430 1430
1431 Sets up the edit attribute structure with the provided parameters 1431 Sets up the edit attribute structure with the provided parameters
1432 1432
1433 $Returns: None 1433 $Returns: None
1434 1434
1435 $Arguments: winPx, winPy, winSx, winSy, positioning information 1435 $Arguments: winPx, winPy, winSx, winSy, positioning information
1436 fgColor, colour for foreground 1436 fgColor, colour for foreground
1437 font, mode, controls, pretty much what they say 1437 font, mode, controls, pretty much what they say
1438 *text, initial text to be edited 1438 *text, initial text to be edited
1439 size, of the text (in bytes) 1439 size, of the text (in bytes)
1440 attr, the block to be set up with the other parameters 1440 attr, the block to be set up with the other parameters
1441 1441
1442 GW - Changed colour from 8 bits (foreground) to 2x32bits fgd and bgd 1442 GW - Changed colour from 8 bits (foreground) to 2x32bits fgd and bgd
1443 For the colour display we pass a 32 bit word that defines the size and position of the editor. 1443 For the colour display we pass a 32 bit word that defines the size and position of the editor.
1444 This can be either a specific size or a more generic ('middle of the screen'/full width of display) 1444 This can be either a specific size or a more generic ('middle of the screen'/full width of display)
1445 *******************************************************************************/ 1445 *******************************************************************************/
1446 void bookSetEditAttributes( 1446 void bookSetEditAttributes(
1470 1470
1471 1471
1472 1472
1473 1473
1474 /******************************************************************************* 1474 /*******************************************************************************
1475 1475
1476 Name Handling Functions 1476 Name Handling Functions
1477 1477
1478 *******************************************************************************/ 1478 *******************************************************************************/
1479 1479
1480 /******************************************************************************* 1480 /*******************************************************************************
1481 1481
1482 $Function: bookGetCurrentStatus 1482 $Function: bookGetCurrentStatus
1483 1483
1484 $Description: Determines the current status of the phone book 1484 $Description: Determines the current status of the phone book
1485 1485
1486 $Returns: status byte 1486 $Returns: status byte
1487 1487
1488 $Arguments: currentStatus, pointer to structure to be populated with 1488 $Arguments: currentStatus, pointer to structure to be populated with
1489 status information 1489 status information
1490 1490
1491 *******************************************************************************/ 1491 *******************************************************************************/
1492 1492
1493 UBYTE bookGetCurrentStatus( T_MFW_PHB_STATUS *currentStatus ) 1493 UBYTE bookGetCurrentStatus( T_MFW_PHB_STATUS *currentStatus )
1494 { 1494 {
1495 UBYTE temp; 1495 UBYTE temp;
1518 /******************************************************************************* 1518 /*******************************************************************************
1519 1519
1520 $Function: bookFindNames 1520 $Function: bookFindNames
1521 1521
1522 $Description: Fine name in phone book 1522 $Description: Fine name in phone book
1523 1523
1524 $Returns: status of search 1524 $Returns: status of search
1525 1525
1526 $Arguments: number, number of entries to search, current, 1526 $Arguments: number, number of entries to search, current,
1527 pointer to structure containing search context 1527 pointer to structure containing search context
1528 1528
1529 *******************************************************************************/ 1529 *******************************************************************************/
1530 1530
1531 UBYTE bookFindName( UBYTE number, tMmiPhbData *current ) 1531 UBYTE bookFindName( UBYTE number, tMmiPhbData *current )
1532 { 1532 {
1533 UBYTE ret; 1533 UBYTE ret;
1534 int index; // , Count = 0; // RAVI 1534 int index; // , Count = 0; // RAVI
1535 1535
1536 UBYTE book_type, index_type; 1536 UBYTE book_type, index_type;
1537 1537
1538 1538
1539 1539
1540 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P 1540 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P
1541 // Added these variables to Fix the Issue MMI-SPR-15813 1541 // Added these variables to Fix the Issue MMI-SPR-15813
1542 // nondigitindex => index after which '+' sign to be added 1542 // nondigitindex => index after which '+' sign to be added
1543 // numlength = lenght of the number array. 1543 // numlength = lenght of the number array.
1544 // nondigitFound = Checks whether nondigit is present in the number array or not. 1544 // nondigitFound = Checks whether nondigit is present in the number array or not.
1545 1545
1546 int nondigitindex = -1,j,numlength = 0, nondigitFound = -1; 1546 int nondigitindex = -1,j,numlength = 0, nondigitFound = -1;
1547 1547
1548 1548
1549 TRACE_FUNCTION( "bookFindName()" ); 1549 TRACE_FUNCTION( "bookFindName()" );
1550 1550
1551 /* Firstly, check for an empty book 1551 /* Firstly, check for an empty book
1552 */ 1552 */
1553 bookGetCurrentStatus( &current->status ); 1553 bookGetCurrentStatus( &current->status );
1556 current->index = 0; 1556 current->index = 0;
1557 return MFW_PHB_OK; 1557 return MFW_PHB_OK;
1558 } 1558 }
1559 1559
1560 //x0066692 Date:23 April 2007 DR:OMAPS00121834 1560 //x0066692 Date:23 April 2007 DR:OMAPS00121834
1561 // this condition ensures that stop index doesn't exceed max no. of entries can be added to a phonebook 1561 // this condition ensures that stop index doesn't exceed max no. of entries can be added to a phonebook
1562 number = current->status.used_entries - current->index +1; 1562 number = current->status.used_entries - current->index +1;
1563 1563
1564 if ( number > MAX_SEARCH_NAME ) 1564 if ( number > MAX_SEARCH_NAME )
1565 number = MAX_SEARCH_NAME; 1565 number = MAX_SEARCH_NAME;
1566 // Feb 20, 2006 REF: OMAPS00061948 x0039928 1566 // Feb 20, 2006 REF: OMAPS00061948 x0039928
1567 // Fix : If used entries are less than MAX_SARCH_NAME then no. of entries 1567 // Fix : If used entries are less than MAX_SARCH_NAME then no. of entries
1568 // passed to the phb_read_entries is used entries. 1568 // passed to the phb_read_entries is used entries.
1569 1569
1570 /* Okay, we have some entries to search, so initialise the current 1570 /* Okay, we have some entries to search, so initialise the current
1571 entry buffer to empty 1571 entry buffer to empty
1572 */ 1572 */
1573 memset( current->entry, 0, MAX_SEARCH_CALL_LIST * sizeof( T_MFW_PHB_ENTRY ) ); 1573 memset( current->entry, 0, MAX_SEARCH_CALL_LIST * sizeof( T_MFW_PHB_ENTRY ) );
1574 1574
1575 1575
1576 1576
1577 current->list.entry = current->entry; 1577 current->list.entry = current->entry;
1578 current->list.num_entries = number; 1578 current->list.num_entries = number;
1579 1579
1580 /* Sort out how we index the information 1580 /* Sort out how we index the information
1581 */ 1581 */
1596 index_type = MFW_PHB_NUMBER; 1596 index_type = MFW_PHB_NUMBER;
1597 else if ( current->KindOfSearch == SEARCH_BY_LOCATION ) 1597 else if ( current->KindOfSearch == SEARCH_BY_LOCATION )
1598 index_type = MFW_PHB_INDEX; 1598 index_type = MFW_PHB_INDEX;
1599 } 1599 }
1600 1600
1601 1601
1602 /* read the appropriate entries from the phone book 1602 /* read the appropriate entries from the phone book
1603 */ 1603 */
1604 { 1604 {
1605 char temp[255]; 1605 char temp[255];
1606 sprintf(temp,"book %d index %d indextype %d number %d", 1606 sprintf(temp,"book %d index %d indextype %d number %d",
1607 book_type,current->index,index_type,number); 1607 book_type,current->index,index_type,number);
1608 TRACE_EVENT(temp); 1608 TRACE_EVENT(temp);
1609 } 1609 }
1610 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) 1610 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken)
1611 //When book is ADN, we need to read only ADN entries. no need to display ADN and FDN together 1611 //When book is ADN, we need to read only ADN entries. no need to display ADN and FDN together
1612 1612
1613 if (book_type == PHB_ADN) /*Quick test */ 1613 if (book_type == PHB_ADN) /*Quick test */
1614 { 1614 {
1615 TRACE_EVENT("book_type == PHB_ADN"); 1615 TRACE_EVENT("book_type == PHB_ADN");
1616 ret = phb_read_entries( PHB_ADN, current->index, index_type, number, &current->list ); 1616 ret = phb_read_entries( PHB_ADN, current->index, index_type, number, &current->list );
1617 } 1617 }
1618 else 1618 else
1619 { 1619 {
1620 TRACE_EVENT("book_type == OTHER"); 1620 TRACE_EVENT("book_type == OTHER");
1621 ret = phb_read_entries( book_type, current->index, index_type, number, &current->list ); 1621 ret = phb_read_entries( book_type, current->index, index_type, number, &current->list );
1622 } 1622 }
1623 1623
1624 /* Populate the output structures 1624 /* Populate the output structures
1625 */ 1625 */
1626 if (current->list.result == MFW_NO_ENTRY) 1626 if (current->list.result == MFW_NO_ENTRY)
1627 current->index = 0; 1627 current->index = 0;
1628 1628
1629 1629
1630 #ifdef NO_ASCIIZ 1630 #ifdef NO_ASCIIZ
1631 1631
1632 #ifdef EASY_TEXT_ENABLED 1632 #ifdef EASY_TEXT_ENABLED
1633 for ( index = 0; index < number; index++ ) 1633 for ( index = 0; index < number; index++ )
1634 {/*MC , SPR 1242 merged in this section from b-sample build*/ 1634 {/*MC , SPR 1242 merged in this section from b-sample build*/
1635 1635
1636 /* GSM character sets 1636 /* GSM character sets
1637 */ 1637 */
1638 UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ 1638 UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/
1639 char debug[22]; 1639 char debug[22];
1640 int i; 1640 int i;
1641 TRACE_EVENT( (char*)current->entry[index].name.data); 1641 TRACE_EVENT( (char*)current->entry[index].name.data);
1642 TRACE_EVENT("Convert from SIM to UCS2"); 1642 TRACE_EVENT("Convert from SIM to UCS2");
1643 1643
1644 TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); 1644 TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len);
1646 if (current->entry[index].name.data[0] == 0x80 ) 1646 if (current->entry[index].name.data[0] == 0x80 )
1647 { for (i=1; i<MAX_ALPHA_LEN; i+=1) 1647 { for (i=1; i<MAX_ALPHA_LEN; i+=1)
1648 { 1648 {
1649 l_name[i+1] = current->entry[index].name.data[i]; 1649 l_name[i+1] = current->entry[index].name.data[i];
1650 } 1650 }
1651 l_name[0] = current->entry[index].name.data[0]; 1651 l_name[0] = current->entry[index].name.data[0];
1652 l_name[1] = MAX_ALPHA_LEN; 1652 l_name[1] = MAX_ALPHA_LEN;
1653 1653
1654 memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); 1654 memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN );
1655 /*MC, we'll just use the length provided by the MFW*/ 1655 /*MC, we'll just use the length provided by the MFW*/
1656 if (current->entry[index].name.len%2 == 1)/*if length of string odd*/ 1656 if (current->entry[index].name.len%2 == 1)/*if length of string odd*/
1657 current->entry[index].name.len++;/* INCREASE LENGTH BY 1*/ 1657 current->entry[index].name.len++;/* INCREASE LENGTH BY 1*/
1658 1658
1659 /*make sure all chars after length are 0*/ 1659 /*make sure all chars after length are 0*/
1660 for (i=current->entry[index].name.len; i<MAX_ALPHA_LEN; i++) 1660 for (i=current->entry[index].name.len; i<MAX_ALPHA_LEN; i++)
1661 { current->entry[index].name.data[i] = 0; } 1661 { current->entry[index].name.data[i] = 0; }
1662 1662
1663 for (i=0; i < MAX_ALPHA_LEN;i++) 1663 for (i=0; i < MAX_ALPHA_LEN;i++)
1664 { 1664 {
1665 if ( current->entry[index].name.data[i]== 0 && current->entry[index].name.data[i+1] != 0) 1665 if ( current->entry[index].name.data[i]== 0 && current->entry[index].name.data[i+1] != 0)
1666 debug[i] = '0'; 1666 debug[i] = '0';
1667 else 1667 else
1668 debug[i] = (char)current->entry[index].name.data[i]; 1668 debug[i] = (char)current->entry[index].name.data[i];
1669 } 1669 }
1670 1670
1671 1671
1672 TRACE_EVENT("Decoded entry"); 1672 TRACE_EVENT("Decoded entry");
1673 TRACE_EVENT(debug); 1673 TRACE_EVENT(debug);
1674 1674
1675 } 1675 }
1676 1676
1677 else 1677 else
1678 1678
1679 { /*SPR2175, use new function to convert from GSM to ASCII*/ 1679 { /*SPR2175, use new function to convert from GSM to ASCII*/
1681 (char*)l_name, MFW_ASCII, PHB_MAX_LEN, FALSE); 1681 (char*)l_name, MFW_ASCII, PHB_MAX_LEN, FALSE);
1682 current->entry[index].name.dcs = MFW_ASCII; 1682 current->entry[index].name.dcs = MFW_ASCII;
1683 memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); 1683 memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN );
1684 } 1684 }
1685 1685
1686 1686
1687 } 1687 }
1688 } 1688 }
1689 1689
1690 #endif 1690 #endif
1691 /*MC end*/ 1691 /*MC end*/
1692 #else 1692 #else
1693 for ( index = 0; index < number; index++ ) 1693 for ( index = 0; index < number; index++ )
1694 { 1694 {
1695 UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ 1695 UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/
1696 TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); 1696 TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len);
1697 /*SPR2175, use new function to convert from GSM to ASCII*/ 1697 /*SPR2175, use new function to convert from GSM to ASCII*/
1698 { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.data.len, 1698 { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.data.len,
1699 l_name, MFW_ASCII, PHB_MAX_LEN); 1699 l_name, MFW_ASCII, PHB_MAX_LEN);
1704 #endif 1704 #endif
1705 1705
1706 /* Needed to make international calls from the phonebook 1706 /* Needed to make international calls from the phonebook
1707 */ 1707 */
1708 for ( index = 0; index < number; index++ ) 1708 for ( index = 0; index < number; index++ )
1709 { 1709 {
1710 if ( current->entry[index].ton ) 1710 if ( current->entry[index].ton )
1711 { 1711 {
1712 1712
1713 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P 1713 // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P
1714 1714
1715 // Issue description: Followup from 15623, this is the BMI part of this Issue. 1715 // Issue description: Followup from 15623, this is the BMI part of this Issue.
1716 // At last, in the record "SSC09" the number is displayed with the "+" 1716 // At last, in the record "SSC09" the number is displayed with the "+"
1717 // character at the beginning of the number instead of "**21*+014543877989#" 1717 // character at the beginning of the number instead of "**21*+014543877989#"
1718 1718
1719 // Solution: Find the location of nondigit(e.g:*, #) in the number array 1719 // Solution: Find the location of nondigit(e.g:*, #) in the number array
1720 // and put '+' to next position if the index is less than numlength-8. This is done 1720 // and put '+' to next position if the index is less than numlength-8. This is done
1721 // as there can be ss strings(like *11*20#) attached to the number in the end. 1721 // as there can be ss strings(like *11*20#) attached to the number in the end.
1722 // For eg: **61#+9844093515*11*20# 1722 // For eg: **61#+9844093515*11*20#
1723 // If the total length is less than 8 assign this index to nondigitindex. 1723 // If the total length is less than 8 assign this index to nondigitindex.
1724 // This solution is based on special sequences we have encountered till now. 1724 // This solution is based on special sequences we have encountered till now.
1725 1725
1726 // Finds the length of the number array. 1726 // Finds the length of the number array.
1727 numlength = strlen((char*)current->entry[ index ].number); 1727 numlength = strlen((char*)current->entry[ index ].number);
1728 //checks whether the length is within the limit. 1728 //checks whether the length is within the limit.
1729 if(numlength <=PHB_MAX_LEN) 1729 if(numlength <=PHB_MAX_LEN)
1730 //TISH, patch for OMAPS00144985, modified by Jinshu Wang, 2007-09-07 1730 //TISH, patch for OMAPS00144985, modified by Jinshu Wang, 2007-09-07
1735 { 1735 {
1736 if( !isdigit((char*)current->entry[ index ].number[j]) ) 1736 if( !isdigit((char*)current->entry[ index ].number[j]) )
1737 { 1737 {
1738 // Found a nondigit can be */# 1738 // Found a nondigit can be */#
1739 nondigitFound = j; 1739 nondigitFound = j;
1740 // Checking , whether the nondigit index is not at the end 1740 // Checking , whether the nondigit index is not at the end
1741 // part of the number array. 1741 // part of the number array.
1742 if(j < (numlength-8)) 1742 if(j < (numlength-8))
1743 { 1743 {
1744 // Current index is less than numlength-8 1744 // Current index is less than numlength-8
1745 nondigitindex = j; 1745 nondigitindex = j;
1746 } 1746 }
1747 else 1747 else
1748 { 1748 {
1749 if(numlength <8) 1749 if(numlength <8)
1750 { 1750 {
1751 // If lenght of the number array is less than 8 1751 // If lenght of the number array is less than 8
1752 // assign the index to nondigitindex 1752 // assign the index to nondigitindex
1753 // This condition might occur when the user 1753 // This condition might occur when the user
1754 // presses invalid short sequence 1754 // presses invalid short sequence
1756 } 1756 }
1757 } 1757 }
1758 } 1758 }
1759 } 1759 }
1760 } 1760 }
1761 //end 1761 //end
1762 if((nondigitindex == -1) && (nondigitFound> -1) && (nondigitFound < 4)) 1762 if((nondigitindex == -1) && (nondigitFound> -1) && (nondigitFound < 4))
1763 { 1763 {
1764 // Nondigit is existing and it's position is less than 4 and not met 1764 // Nondigit is existing and it's position is less than 4 and not met
1765 // any of the above conditions. 1765 // any of the above conditions.
1766 nondigitindex = nondigitFound; 1766 nondigitindex = nondigitFound;
1767 } 1767 }
1768 1768
1769 // Move the contents accordingly. 1769 // Move the contents accordingly.
1771 (char *) &(current->entry[ index ].number[nondigitindex+1]), numlength - nondigitindex+1); 1771 (char *) &(current->entry[ index ].number[nondigitindex+1]), numlength - nondigitindex+1);
1772 1772
1773 // Add the '+' sign after the appropriate nondigit character, if any. 1773 // Add the '+' sign after the appropriate nondigit character, if any.
1774 current->entry[index].number[nondigitindex+1] = '+'; 1774 current->entry[index].number[nondigitindex+1] = '+';
1775 } 1775 }
1776 1776
1777 } 1777 }
1778 //} 1778 //}
1779 1779
1780 return current->result = ret; 1780 return current->result = ret;
1781 } 1781 }
1782 1782
1783 1783
1784 1784
1790 /******************************************************************************* 1790 /*******************************************************************************
1791 1791
1792 $Function: bookEvent 1792 $Function: bookEvent
1793 1793
1794 $Description: Event handler for a phone book event 1794 $Description: Event handler for a phone book event
1795 1795
1796 $Returns: MFW_EVENT_CONSUMED if recognised message, otherwise 1796 $Returns: MFW_EVENT_CONSUMED if recognised message, otherwise
1797 MFW_EVENT_PASSED 1797 MFW_EVENT_PASSED
1798 1798
1799 $Arguments: e, event, para, general parameter giving context of call 1799 $Arguments: e, event, para, general parameter giving context of call
1800 1800
1801 *******************************************************************************/ 1801 *******************************************************************************/
1802 1802
1803 int bookEvent( MfwEvt e, void *para ) 1803 int bookEvent( MfwEvt e, void *para )
1804 { 1804 {
1805 T_MFW_PHB_STATUS *status; 1805 T_MFW_PHB_STATUS *status;
1829 } 1829 }
1830 break; 1830 break;
1831 1831
1832 case E_PHB_ERROR: 1832 case E_PHB_ERROR:
1833 { 1833 {
1834 //x0061560 Date May16,07 (sateeshg) OMAPS00133241 1834 //x0061560 Date May16,07 (sateeshg) OMAPS00133241
1835 T_MFW_HND win = mfwParent( mfw_header() ); 1835 T_MFW_HND win = mfwParent( mfw_header() );
1836 1836
1837 TRACE_ERROR("E_PHB_ERROR store entry"); 1837 TRACE_ERROR("E_PHB_ERROR store entry");
1838 bookShowInformation(win, TxtError, NULL, NULL ); 1838 bookShowInformation(win, TxtError, NULL, NULL );
1839 } 1839 }
1840 1840
1841 1841
1842 break; 1842 break;
1843 1843
1844 /* SPR#1112 - SH - New events to indicate status of phonebook */ 1844 /* SPR#1112 - SH - New events to indicate status of phonebook */
1845 1845
1846 case E_PHB_READY: 1846 case E_PHB_READY:
1847 { 1847 {
1848 // Aug 18, 2006 ER: OMAPS00089840 x0039928 1848 // Aug 18, 2006 ER: OMAPS00089840 x0039928
1849 // Fix : If the E_PHB_READY is for delete all then destroy the please wait window and display the string "Deleted" 1849 // Fix : If the E_PHB_READY is for delete all then destroy the please wait window and display the string "Deleted"
1850 if( DeleteAll_flag == TRUE) 1850 if( DeleteAll_flag == TRUE)
1851 { 1851 {
1852 T_MFW_HND win = mfwParent( mfw_header() ); 1852 T_MFW_HND win = mfwParent( mfw_header() );
1853 int txtid; 1853 int txtid;
1854 1854
1855 TRACE_EVENT("E_PHB_READY Delete all"); 1855 TRACE_EVENT("E_PHB_READY Delete all");
1856 if (waitWindel) 1856 if (waitWindel)
1857 { 1857 {
1858 SEND_EVENT(waitWindel, DIALOG_DESTROY,0,0); 1858 SEND_EVENT(waitWindel, DIALOG_DESTROY,0,0);
1859 waitWindel = NULL; 1859 waitWindel = NULL;
1864 break; 1864 break;
1865 } 1865 }
1866 //x0061560 Date May17,07 (sateeshg) OMAPS00133241 1866 //x0061560 Date May17,07 (sateeshg) OMAPS00133241
1867 if(addname_flag == TRUE) 1867 if(addname_flag == TRUE)
1868 { 1868 {
1869 1869
1870 T_MFW_HND win = mfwParent( mfw_header() ); 1870 T_MFW_HND win = mfwParent( mfw_header() );
1871 int txtid; 1871 int txtid;
1872 1872
1873 TRACE_EVENT("E_PHB_READY Saved"); 1873 TRACE_EVENT("E_PHB_READY Saved");
1874 1874
1875 txtid = TxtSaved; 1875 txtid = TxtSaved;
1876 bookShowInformation(win, txtid, NULL, NULL ); 1876 bookShowInformation(win, txtid, NULL, NULL );
1877 addname_flag = FALSE; 1877 addname_flag = FALSE;
1878 break; 1878 break;
1879 } 1879 }
1880 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ 1880 /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */
1881 if(TRUE == changename_flag) 1881 if(TRUE == changename_flag)
1882 { 1882 {
1883 T_MFW_HND win = mfwParent( mfw_header() ); 1883 T_MFW_HND win = mfwParent( mfw_header() );
1884 int txtid; 1884 int txtid;
1885 1885
1886 TRACE_EVENT("Saved prompt for change entry"); 1886 TRACE_EVENT("Saved prompt for change entry");
1887 TRACE_EVENT("E_PHB_READY Saved"); 1887 TRACE_EVENT("E_PHB_READY Saved");
1888 1888
1889 txtid = TxtSaved; 1889 txtid = TxtSaved;
1890 bookShowInformation(win, txtid, NULL, NULL ); 1890 bookShowInformation(win, txtid, NULL, NULL );
1891 changename_flag = FALSE; 1891 changename_flag = FALSE;
1892 break; 1892 break;
1893 } 1893 }
1894 1894
1895 1895
1896 TRACE_EVENT("E_PHB_READY"); 1896 TRACE_EVENT("E_PHB_READY");
1897 #ifdef INT_PHONEBOOK 1897 #ifdef INT_PHONEBOOK
1898 /* SPR#1112 - SH - If we're copying or moving a list, 1898 /* SPR#1112 - SH - If we're copying or moving a list,
1899 * the current operation has been successful - keep copying. */ 1899 * the current operation has been successful - keep copying. */
1900 if (ipbCopyIndex) 1900 if (ipbCopyIndex)
1901 { 1901 {
1902 TRACE_EVENT("Copying/moving in progress."); 1902 TRACE_EVENT("Copying/moving in progress.");
1903 bookCopyMultiple(ipbWin, ipbMove, 0); 1903 bookCopyMultiple(ipbWin, ipbMove, 0);
1904 } 1904 }
1909 case E_PHB_BUSY: 1909 case E_PHB_BUSY:
1910 { 1910 {
1911 TRACE_EVENT("E_PHB_BUSY"); 1911 TRACE_EVENT("E_PHB_BUSY");
1912 } 1912 }
1913 break; 1913 break;
1914 1914
1915 /* end SPR#1112 */ 1915 /* end SPR#1112 */
1916 1916
1917 default: 1917 default:
1918 { 1918 {
1919 /* indicate we haven't dealt with event 1919 /* indicate we haven't dealt with event
1920 */ 1920 */
1921 return MFW_EVENT_PASSED; 1921 return MFW_EVENT_PASSED;
1948 { 1948 {
1949 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; 1949 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
1950 T_phbk *Phbk = (T_phbk *) win_data->user; 1950 T_phbk *Phbk = (T_phbk *) win_data->user;
1951 1951
1952 Phbk ->current.status.book = bookActiveBook(READ); 1952 Phbk ->current.status.book = bookActiveBook(READ);
1953 //x0061560 Date JUNE 4,07 (sateeshg) OMAPS00131777 1953 //x0061560 Date JUNE 4,07 (sateeshg) OMAPS00131777
1954 //Updating the current status of the phonebook 1954 //Updating the current status of the phonebook
1955 bookGetCurrentStatus(&Phbk ->current.status); 1955 bookGetCurrentStatus(&Phbk ->current.status);
1956 if(Phbk ->current.status.used_entries !=0)//Apr 30,2007, OMAPS00129173, x0066814(Geetha) 1956 if(Phbk ->current.status.used_entries !=0)//Apr 30,2007, OMAPS00129173, x0066814(Geetha)
1957 { 1957 {
1958 if (bookGetBookSelected() ) 1958 if (bookGetBookSelected() )
1959 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, 100); 1959 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, 100);
1960 else 1960 else
1961 DeleteAll_flag = TRUE; 1961 DeleteAll_flag = TRUE;
1962 1962
1963 if (phb_delete_book(Phbk->current.status.book) == MFW_PHB_OK) 1963 if (phb_delete_book(Phbk->current.status.book) == MFW_PHB_OK)
1964 { 1964 {
1965 if (!bookGetBookSelected() ) 1965 if (!bookGetBookSelected() )
1966 waitWindel = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); 1966 waitWindel = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER);
1967 else 1967 else
1995 1995
1996 $Returns: None 1996 $Returns: None
1997 1997
1998 $Arguments: destEntry - destination phonebook entry structure 1998 $Arguments: destEntry - destination phonebook entry structure
1999 srcEntry - source phonebook entry structure 1999 srcEntry - source phonebook entry structure
2000 maxLen - max number oc chars to be copied 2000 maxLen - max number oc chars to be copied
2001 2001
2002 *******************************************************************************/ 2002 *******************************************************************************/
2003 //GW Created function to copy name (and length when required). 2003 //GW Created function to copy name (and length when required).
2004 void bookCopyPhbName( T_MFW_PHB_ENTRY* destEntry, T_MFW_PHB_ENTRY* srcEntry, int maxLen ) 2004 void bookCopyPhbName( T_MFW_PHB_ENTRY* destEntry, T_MFW_PHB_ENTRY* srcEntry, int maxLen )
2005 { 2005 {
2019 if ((maxLen < MAX_ALPHA_LEN) && (maxLen >0)) 2019 if ((maxLen < MAX_ALPHA_LEN) && (maxLen >0))
2020 len = maxLen; 2020 len = maxLen;
2021 else 2021 else
2022 len = MAX_ALPHA_LEN; 2022 len = MAX_ALPHA_LEN;
2023 #endif 2023 #endif
2024 #ifdef NO_ASCIIZ 2024 #ifdef NO_ASCIIZ
2025 memset (destEntry->name.data, 0, PHB_MAX_LEN); 2025 memset (destEntry->name.data, 0, PHB_MAX_LEN);
2026 memcpy( destEntry->name.data, srcEntry->name.data, len); 2026 memcpy( destEntry->name.data, srcEntry->name.data, len);
2027 if (srcEntry->name.len < len) 2027 if (srcEntry->name.len < len)
2028 destEntry->name.len = srcEntry->name.len; 2028 destEntry->name.len = srcEntry->name.len;
2029 else 2029 else
2030 { //we have truncated the name - add termination (if possible) 2030 { //we have truncated the name - add termination (if possible)
2031 destEntry->name.len = len; 2031 destEntry->name.len = len;
2032 if (len < PHB_MAX_LEN) 2032 if (len < PHB_MAX_LEN)
2033 { // there is space in array for termination - add it. 2033 { // there is space in array for termination - add it.
2034 destEntry->name.data[len] = 0x00; 2034 destEntry->name.data[len] = 0x00;
2035 2035
2036 } 2036 }
2037 } 2037 }
2038 #else 2038 #else
2039 2039
2040 memcpy( destEntry->name, srcEntry->name, maxLen); 2040 memcpy( destEntry->name, srcEntry->name, maxLen);
2041 #endif 2041 #endif
2042 } 2042 }
2043 2043
2044 2044
2045 2045
2046 /******************************************************************************* 2046 /*******************************************************************************
2047 2047
2048 End of File 2048 End of File
2049 2049
2050 *******************************************************************************/ 2050 *******************************************************************************/
2051 2051