FreeCalypso > hg > fc-tourmaline
diff src/ui/bmi/mmiBookUtils.c @ 142:ec9f955fc487
mmiBook*.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Nov 2020 08:43:59 +0000 |
parents | c0052fe355d3 |
children |
line wrap: on
line diff
--- a/src/ui/bmi/mmiBookUtils.c Sat Nov 14 04:29:03 2020 +0000 +++ b/src/ui/bmi/mmiBookUtils.c Sat Nov 14 08:43:59 2020 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -9,14 +9,14 @@ ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI (6349) - $Module: PhoneBook - $File: MmiBookUtils.c - $Revision: 1.0 + $Project name: Basic MMI + $Project code: BMI (6349) + $Module: PhoneBook + $File: MmiBookUtils.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 25/10/00 + $Author: Condat(UK) + $Date: 25/10/00 ******************************************************************************** @@ -29,83 +29,83 @@ $History: MmiBookUtils.c $History: MmiBookUtils.c - Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) - Description: PhoneBook: Unexpected confirmation message when making changes to entries in SIM storage. - Solution: Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. + Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) + Description: PhoneBook: Unexpected confirmation message when making changes to entries in SIM storage. + Solution: Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. - 17 Aug, 2007 DR: OMAPS00141963 x0066814(Geetha) - Description: PhoneBook: The "Options" menu is not returned after a current entry is copied. - Solution: After copying, the menu control was not being returned back to the right window. - Added a callback, that will be called after copying an entry, where the control wil be returned to - correct window. + 17 Aug, 2007 DR: OMAPS00141963 x0066814(Geetha) + Description: PhoneBook: The "Options" menu is not returned after a current entry is copied. + Solution: After copying, the menu control was not being returned back to the right window. + Added a callback, that will be called after copying an entry, where the control wil be returned to + correct window. July 11, 2007 DR:OMAPS00137908 x00666692(Asha) Description:PHONEBOOK: changing name or number under SIM storage, Please Wait message appears instead of Saved Solution :Changes made to handle the condition MFW_PHB_EXCT in the function changeInFile() - which modifies the phone book entry. + which modifies the phone book entry. 27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) Description:PHONEBOOK-Unexpected behavior when copying all entries from Phone to SIM Solution :Updated the execution state(MFW_PHB_EXCT) in the phonebook. June 27, 2007 DR:OMAPS00136627 x0062172(Syed) - Description:PHONEBOOK: Unexpected behavior when moving all entries from Phone to SIM + Description:PHONEBOOK: Unexpected behavior when moving all entries from Phone to SIM Solution : Return Proper Value after phb_store_entry() in bookCopy to move all the entries - properly. + properly. June 05, 2007 DR:OMAPS00133241 x0061560(sateeshg) Description:ASTEC29607,SIM:The sim card should not return 9240 still. Solution :MMI should not display "Saved" after db is updated but has to wait until SIM is - updated with the entry and RAT_OK is received from ACI. + updated with the entry and RAT_OK is received from ACI. - June 06, 2007 DR:OMAPS00132045 x0073106 Sundeep - Description : Phonebook- behaviour inconsistency in the MMI when move contact - Solution : changed a if condition in function bookCopyMultiple(), in the if(move). + June 06, 2007 DR:OMAPS00132045 x0073106 Sundeep + Description : Phonebook- behaviour inconsistency in the MMI when move contact + Solution : changed a if condition in function bookCopyMultiple(), in the if(move). JUNE 4,07 (sateeshg) OMAPS00131777, x0061560 Phonebook - Delete all command for phonebook contacts answer "list empty" even if there are contacts in the list - Solution:Updated the current status of the phonebook + Solution:Updated the current status of the phonebook - Apr 30,2007, OMAPS00129173, x0066814(Geetha) - Description : Phone crashes if 'Delete All' is done on SIM contacts when SIM memory is empty - Solution: Added a condition in bookDeleteBook to check the number of used entries in the seleted phonebook. - If the condition is satified then the delete operation will proceed else an 'Empty List' dialog is displayed. + Apr 30,2007, OMAPS00129173, x0066814(Geetha) + Description : Phone crashes if 'Delete All' is done on SIM contacts when SIM memory is empty + Solution: Added a condition in bookDeleteBook to check the number of used entries in the seleted phonebook. + If the condition is satified then the delete operation will proceed else an 'Empty List' dialog is displayed. Nov 17, 2006 DR:OMAPS00104376 a0393213(R.Prabakar) Description : When tried to delete the last entry either incase of SIM or Phone book (i.e. last deletion), the board resets. Solution : The crash happens because of race condition between actual deletion by ACI and status check in BMI. Now the status before deletion is stored and status check is done on this previous status. - Aug 18, 2006 ER: OMAPS00089840 x0039928 - Description: Changes to be made in MMI for the functionality "Delete all" ADN entries - Solution: A new menu item "Delete All" is added in the phone book menu and bookDeleteBook - is called to delete all the phone book entries. + Aug 18, 2006 ER: OMAPS00089840 x0039928 + Description: Changes to be made in MMI for the functionality "Delete all" ADN entries + Solution: A new menu item "Delete All" is added in the phone book menu and bookDeleteBook + is called to delete all the phone book entries. - July 17, 2006 DR: OMAPS00082792 x0039928 - Description:Changes to be done in MMI for Move all entries from SIM to FFS (Defect 76492) - Solution: Condition to delete search window in deleteFromFile is modified. + July 17, 2006 DR: OMAPS00082792 x0039928 + Description:Changes to be done in MMI for Move all entries from SIM to FFS (Defect 76492) + Solution: Condition to delete search window in deleteFromFile is modified. - June 01, 2006 DR: OMAPS00079716 - Description:Phonebook: List of entries is not refreshed after a phonebook entry move - Solution: Added a new callback function to handle the populating of phonebook entries + June 01, 2006 DR: OMAPS00079716 + Description:Phonebook: List of entries is not refreshed after a phonebook entry move + Solution: Added a new callback function to handle the populating of phonebook entries - Feb 20, 2006 REF: OMAPS00061948 x0039928 - Bug:PhoneBook-My number menu -failed. - Fix: phb_read_entries is called with used entries as the no of entries if used entries are less than - MAX_SEARCH_NAME. + Feb 20, 2006 REF: OMAPS00061948 x0039928 + Bug:PhoneBook-My number menu -failed. + Fix: phb_read_entries is called with used entries as the no of entries if used entries are less than + MAX_SEARCH_NAME. - Jan 27, 2006 REF: OMAPS00061925 x0039928 - Bug:Phonebook-Changing an entry and Immidiately deleting the entry failed. - Fix: Phonebook is populated with phone numbers after some time and not immediately after deleting an entry. + Jan 27, 2006 REF: OMAPS00061925 x0039928 + Bug:Phonebook-Changing an entry and Immidiately deleting the entry failed. + Fix: Phonebook is populated with phone numbers after some time and not immediately after deleting an entry. - Jan 22, 2006 REF: OMAPS00061930 x0039928 - Bug:PhoneBook -Change entry and view entry through Change option-failed - Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries. + Jan 22, 2006 REF: OMAPS00061930 x0039928 + Bug:PhoneBook -Change entry and view entry through Change option-failed + Fix: Phonebook is populated with phone numbers after some time and not immediately while saving the changed entries. - 25/10/00 Original Condat(UK) BMI version. + 25/10/00 Original Condat(UK) BMI version. $End @@ -178,7 +178,6 @@ #include "MmiLists.h" - #include "MmiMenu.h" #include "mmiCall.h" #include "Mmiicons.h" @@ -205,8 +204,8 @@ // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P // Issue description: Followup from 15623, this is the BMI part of this Issue. -// At last, in the record "SSC09" the number is displayed with the "+" -// character at the beginning of the number instead of "**21*+014543877989#". +// At last, in the record "SSC09" the number is displayed with the "+" +// character at the beginning of the number instead of "**21*+014543877989#". extern int menuFDN; @@ -219,7 +218,7 @@ // Fix : Initialize Delete All flag and a window handler of please wait dialog. BOOL DeleteAll_flag = FALSE; T_MFW_HND waitWindel = NULL; - //x0061560 Date May17,07 (sateeshg) OMAPS00133241 + //x0061560 Date May17,07 (sateeshg) OMAPS00133241 BOOL addname_flag = FALSE; /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) Added a new flag changename_flag to handle the Phonebook-SIM Memory entry changed event. */ @@ -259,13 +258,13 @@ /******************************************************************************* - $Function: changeName + $Function: changeName - $Description: Change a phone book entry if we have a valid book selected + $Description: Change a phone book entry if we have a valid book selected - $Returns: status of change, or MWB_PHB_FAIL if an error occurs + $Returns: status of change, or MWB_PHB_FAIL if an error occurs - $Arguments: book, to be updated + $Arguments: book, to be updated entry, to update currentStatus, pointer to status word @@ -273,33 +272,27 @@ static UBYTE changeName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ) { - - TRACE_FUNCTION( "changeName()" ); + TRACE_FUNCTION( "changeName()" ); - /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ - changename_flag = TRUE; + /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ + changename_flag = TRUE; - if ( book == PHB_SDN ) - return MFW_PHB_FAIL; + if ( book == PHB_SDN ) + return MFW_PHB_FAIL; - return phb_store_entry( book, entry, currentStatus ); + return phb_store_entry( book, entry, currentStatus ); } - - - - - /******************************************************************************* - $Function: deleteName + $Function: deleteName - $Description: Delete a phone book entry + $Description: Delete a phone book entry - $Returns: status of delete, or MWB_PHB_FAIL if an error occurs + $Returns: status of delete, or MWB_PHB_FAIL if an error occurs - $Arguments: book, to be updated + $Arguments: book, to be updated index, index of entry to delete currentStatus, pointer to status word @@ -307,32 +300,24 @@ static UBYTE deleteName( UBYTE book, UBYTE index, T_MFW_PHB_STATUS *currentStatus ) { - TRACE_FUNCTION( "deleteName()" ); - - if ( book == PHB_SDN ) - return MFW_PHB_FAIL; - - return phb_delete_entry( book, index, currentStatus ); -} + TRACE_FUNCTION( "deleteName()" ); - - - + if ( book == PHB_SDN ) + return MFW_PHB_FAIL; - - - + return phb_delete_entry( book, index, currentStatus ); +} /******************************************************************************* - $Function: addName + $Function: addName - $Description: Add a new name to the phone book + $Description: Add a new name to the phone book - $Returns: status of change, or MWB_PHB_FAIL if an error occurs + $Returns: status of change, or MWB_PHB_FAIL if an error occurs - $Arguments: book, to be updated + $Arguments: book, to be updated entry, to update currentStatus, pointer to status word @@ -340,7 +325,7 @@ static UBYTE addName( UBYTE book, T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *currentStatus ) { - TRACE_FUNCTION( "addName()" ); + TRACE_FUNCTION( "addName()" ); //MC-- Commented out UPN-specific code as it causes the name string in a UPN //entry to be stored incorrectly and doesn't seem to be neccessary. @@ -348,57 +333,51 @@ { /* normal store operation */ - { - char temp[120]; - memset(temp,'\0',100); - //x0061560 Date May17,07 (sateeshg) OMAPS00133241 - addname_flag = TRUE; + { + char temp[120]; + memset(temp,'\0',100); + //x0061560 Date May17,07 (sateeshg) OMAPS00133241 + addname_flag = TRUE; #ifdef NO_ASCIIZ { - T_MFW_PHB_TEXT buf; + T_MFW_PHB_TEXT buf; - /*SPR 1752 check for unicode*/ - if (entry->name.data[0] ==0x80) - { - /*MC, don't do any conversions!!*/ - TRACE_EVENT("Converting Unicode 2 SIM"); + /*SPR 1752 check for unicode*/ + if (entry->name.data[0] ==0x80) + { + /*MC, don't do any conversions!!*/ + TRACE_EVENT("Converting Unicode 2 SIM"); - sprintf(temp,"Book: %d Name %s Number %s", - book, - (char*)buf.data,(char*)entry->number); + sprintf(temp,"Book: %d Name %s Number %s", + book, + (char*)buf.data,(char*)entry->number); - } - else + } + else - { - // convert from GSM to Alpha characters - bookGsm2Alpha( (UBYTE *) entry->name.data ); + { + // convert from GSM to Alpha characters + bookGsm2Alpha( (UBYTE *) entry->name.data ); - sprintf(temp,"Book: %d Name %s Number %s", - book, - (char*)entry->name.data,(char*)entry->number); - } + sprintf(temp,"Book: %d Name %s Number %s", + book, + (char*)entry->name.data,(char*)entry->number); + } } #else - sprintf(temp,"Book: %d Name %s Number %s", - book, - (char*)entry->name,(char*)entry->number); + sprintf(temp,"Book: %d Name %s Number %s", + book, + (char*)entry->name,(char*)entry->number); #endif - TRACE_EVENT(temp); - } - entry->index = 0; + TRACE_EVENT(temp); + } + entry->index = 0; return phb_store_entry( book, entry, currentStatus ); } } - - - - - - /******************************************************************************* File Handling Utilities @@ -407,22 +386,22 @@ /******************************************************************************* - $Function: storeInFile + $Function: storeInFile - $Description: Converts the name to a storeable format and stores it + $Description: Converts the name to a storeable format and stores it in the phone book - $Returns: None + $Returns: None - $Arguments: phbk, pointer to phonebook structure + $Arguments: phbk, pointer to phonebook structure *******************************************************************************/ void storeInFile( T_phbk *phbk ) -{ int i; - UBYTE actual_length = 0; - char debug[20]; - TRACE_FUNCTION( "storeInFile()" ); +{ int i; + UBYTE actual_length = 0; + char debug[20]; + TRACE_FUNCTION( "storeInFile()" ); /* Convert the name */ @@ -434,31 +413,31 @@ if (phbk->edt_buf_name[0] == 0x80)//if unicode { - /*a0393213 lint warning:Possible creation of out-of-bounds pointer soln:PHB_MAX_LEN changed to MAX_ALPHA_LEN-1*/ - for (i =0; i < (MAX_ALPHA_LEN-1); i+=2) //work out string length - { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0) - { if (i== 0) - actual_length =0; - else - actual_length = i -2; - break; - } - } - phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string - phbk->edt_buf_name[1] = 0x00; + /*a0393213 lint warning:Possible creation of out-of-bounds pointer soln:PHB_MAX_LEN changed to MAX_ALPHA_LEN-1*/ + for (i =0; i < (MAX_ALPHA_LEN-1); i+=2) //work out string length + { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0) + { if (i== 0) + actual_length =0; + else + actual_length = i -2; + break; + } + } + phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string + phbk->edt_buf_name[1] = 0x00; /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN*/ memset(phbk->newEntry.name.data, 0,MAX_ALPHA_LEN); //convert to SIM string - mfw_Ucs2SIMStr( MFW_DCS_UCS2 , (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, + mfw_Ucs2SIMStr( MFW_DCS_UCS2 , (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, phbk->newEntry.name.data, &phbk->newEntry.name.len ); - TRACE_EVENT( (char*)phbk->newEntry.name.data); - sprintf(debug, "length:%d", phbk->newEntry.name.len); - TRACE_EVENT(debug); + TRACE_EVENT( (char*)phbk->newEntry.name.data); + sprintf(debug, "length:%d", phbk->newEntry.name.len); + TRACE_EVENT(debug); } else { - mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN, + mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN, phbk->newEntry.name.data, &phbk->newEntry.name.len ); } @@ -471,13 +450,13 @@ /* update the number */ strncpy( (char *) phbk->newEntry.number, (char *) phbk->edt_buf_number, PHB_MAX_LEN ); - /*SPR 1327, copy current phonebook type to new entry*/ - phbk->newEntry.book = phbk->current.status.book; - /*If current phonebook UPN, don't overwrite phonebook type*/ - // Feb 20, 2006 REF: OMAPS00061948 x0039928 - // Fix : A check is made with enum PHB_UPN of MFW instead of UPN of ACI - if( phbk->newEntry.book != PHB_UPN) - phbk->newEntry.book = bookActiveBook(WRITE); + /*SPR 1327, copy current phonebook type to new entry*/ + phbk->newEntry.book = phbk->current.status.book; + /*If current phonebook UPN, don't overwrite phonebook type*/ + // Feb 20, 2006 REF: OMAPS00061948 x0039928 + // Fix : A check is made with enum PHB_UPN of MFW instead of UPN of ACI + if( phbk->newEntry.book != PHB_UPN) + phbk->newEntry.book = bookActiveBook(WRITE); phbk->newEntry.index = 0; /* Add the name/number combination to the phone book and setup @@ -492,16 +471,16 @@ MmiBookSetCurrentText( TxtSaved ); } break; - //x0061560 Date May16,07 (sateeshg) OMAPS00133241 - case MFW_PHB_EXCT : + //x0061560 Date May16,07 (sateeshg) OMAPS00133241 + case MFW_PHB_EXCT : { /* Entry saved okay */ MmiBookSetCurrentText( TxtPleaseWait ); - // MmiBookSetCurrentText( TxtSaved ); + // MmiBookSetCurrentText( TxtSaved ); } - //end + //end break; case MFW_PHB_FULL : @@ -520,7 +499,7 @@ } break; - default: + default: { /* No other returns possible */ @@ -530,67 +509,62 @@ } - - - - - /******************************************************************************* - $Function: changeInFile + $Function: changeInFile - $Description: change the phone book entry + $Description: change the phone book entry - $Returns: none + $Returns: none - $Arguments: phbk, pointer to phonebook structure + $Arguments: phbk, pointer to phonebook structure *******************************************************************************/ void changeInFile( T_phbk *phbk ) -{ int i; - int actual_length=0; - TRACE_FUNCTION( "changeInFile()" ); +{ int i; + int actual_length=0; + TRACE_FUNCTION( "changeInFile()" ); - if(phbk->current.status.book == PHB_ADN_FDN) - phbk->current.status.book = PHB_ADN; //JVJE We can only store in ADN/FDN - else - phbk->current.status.book = phbk->current.status.book; + if(phbk->current.status.book == PHB_ADN_FDN) + phbk->current.status.book = PHB_ADN; //JVJE We can only store in ADN/FDN + else + phbk->current.status.book = phbk->current.status.book; - TRACE_EVENT_P1("Current Book = %d", phbk->current.status.book); - TRACE_EVENT_P1("Current Name = %d", phbk->current.selectedName); - TRACE_EVENT_P1("Current Buf Name = %s", phbk->edt_buf_name); + TRACE_EVENT_P1("Current Book = %d", phbk->current.status.book); + TRACE_EVENT_P1("Current Name = %d", phbk->current.selectedName); + TRACE_EVENT_P1("Current Buf Name = %s", phbk->edt_buf_name); /* Convert the name */ #ifdef NO_ASCIIZ - /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ + /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ if (phbk->edt_buf_name[0] == 0x80)//if unicode { /*a0393213 lint warning:Possible access of out-of-bounds pointer soln:MAX_ALPHA_LEN-1*/ - for (i =0; i < MAX_ALPHA_LEN-1; i+=2) //work out string length - { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0) - { if (i== 0) - actual_length =0; - else - actual_length = i -2; - break; - } - } - phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string - phbk->edt_buf_name[1] = 0x00; + for (i =0; i < MAX_ALPHA_LEN-1; i+=2) //work out string length + { if (phbk->edt_buf_name[i] == 0 && phbk->edt_buf_name[i+1] == 0) + { if (i== 0) + actual_length =0; + else + actual_length = i -2; + break; + } + } + phbk->edt_buf_name[0] = (UBYTE)(actual_length/2);//add string length to beginning of string + phbk->edt_buf_name[1] = 0x00; memset(phbk->current.entry[phbk->current.selectedName].name.data, 0, MAX_ALPHA_LEN); //convert to SIM string - mfw_Ucs2SIMStr( MFW_DCS_UCS2, (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, + mfw_Ucs2SIMStr( MFW_DCS_UCS2, (U16*)phbk->edt_buf_name, MAX_ALPHA_LEN, phbk->current.entry[phbk->current.selectedName].name.data, &phbk->current.entry[phbk->current.selectedName].name.len ); } else - { mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN, + { mfw_Gsm2SIMStr( MFW_DCS_7bits, (U8*)phbk->edt_buf_name, MAX_ALPHA_LEN, phbk->current.entry[phbk->current.selectedName].name.data, &phbk->current.entry[phbk->current.selectedName].name.len ); - } + } #else strncpy( (char *) phbk->current.entry[ phbk->current.selectedName ].name, @@ -625,25 +599,25 @@ MmiBookSetCurrentText( TxtWriteError ); } break; - /* x0056422 on Aug 02,2007 for - OMAPS00140447 - PhoneBook: Unexpected confirmation message - when making changes to entries in SIM storage. */ + /* x0056422 on Aug 02,2007 for + OMAPS00140447 - PhoneBook: Unexpected confirmation message + when making changes to entries in SIM storage. */ // July 11, 2007 DR:OMAPS00137908 x00666692(Asha) //PHONEBOOK: changing name or number under SIM storage, Please Wait //message appears instead of Saved - case MFW_PHB_EXCT : + case MFW_PHB_EXCT : { /* Operation in progress */ MmiBookSetCurrentText( TxtPleaseWait ); - // MmiBookSetCurrentText( TxtSaved ); + // MmiBookSetCurrentText( TxtSaved ); } - //end + //end break; - default: + default: { /* No other returns possible */ @@ -653,37 +627,30 @@ } - - - - - - - /******************************************************************************* - $Function: deleteFromFile + $Function: deleteFromFile - $Description: delete an entry from a phone book + $Description: delete an entry from a phone book - $Returns: None + $Returns: None - $Arguments: phbk, phone book handle, + $Arguments: phbk, phone book handle, book, book to update, *******************************************************************************/ void deleteFromFile( T_phbk *phbk, UBYTE book ) { - int index; - T_MFW_PHB_STATUS phb_status_before_delete; /*OMAPS00104376 a0393213(R.Prabakar)*/ + int index; + T_MFW_PHB_STATUS phb_status_before_delete; /*OMAPS00104376 a0393213(R.Prabakar)*/ - TRACE_FUNCTION( "deleteFromFile()" ); + TRACE_FUNCTION( "deleteFromFile()" ); - index = phbk->current.selectedName - phbk->current.missedCallsOffset; - /*OMAPS00104376 a0393213(R.Prabakar)- getting the status of the phonebook before deletion*/ - phb_status_before_delete.book=book; - bookGetCurrentStatus( &phb_status_before_delete ); + index = phbk->current.selectedName - phbk->current.missedCallsOffset; + /*OMAPS00104376 a0393213(R.Prabakar)- getting the status of the phonebook before deletion*/ + phb_status_before_delete.book=book; + bookGetCurrentStatus( &phb_status_before_delete ); switch ( deleteName( book, phbk->current.entry[index].index, &phbk->current.status ) ) { @@ -694,52 +661,52 @@ MmiBookSetCurrentText( TxtEntryDeleted ); #ifdef NO_ASCIIZ - phbk->current.entry[index].name.len = 0; - memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); + phbk->current.entry[index].name.len = 0; + memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); #else /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ - memset((char*)phbk->current.entry[index].name, '\0', MAX_ALPHA_LEN); - memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); + memset((char*)phbk->current.entry[index].name, '\0', MAX_ALPHA_LEN); + memset((char*)phbk->current.entry[index].number, '\0', PHB_MAX_LEN); #endif /* Move the current index to the next valid entry */ - if(phbk->current.selectedName > 0) - phbk->current.selectedName --; - else - phbk->current.selectedName = 0; + if(phbk->current.selectedName > 0) + phbk->current.selectedName --; + else + phbk->current.selectedName = 0; - if(phbk->current.index > 1) - phbk->current.index--; - else - phbk->current.index = 1; + if(phbk->current.index > 1) + phbk->current.index--; + else + phbk->current.index = 1; /* And if we have a search window, perform the search to update the current valid entry */ - if ( phbk->search_win ) + if ( phbk->search_win ) { - // July 17, 2006 DR: OMAPS00082792 x0039928 - // Check used entry is 1 as delete is not complete yet as it is asynchronous. - /*Nov 17,2006 OMAPS00104376 a0393213(R.Prabakar) - Now the check is done with the status got before deletion instead of the status got after deletion*/ - if (phb_status_before_delete.used_entries == 1) + // July 17, 2006 DR: OMAPS00082792 x0039928 + // Check used entry is 1 as delete is not complete yet as it is asynchronous. + /*Nov 17,2006 OMAPS00104376 a0393213(R.Prabakar) + Now the check is done with the status got before deletion instead of the status got after deletion*/ + if (phb_status_before_delete.used_entries == 1) { /* empty phone book */ - bookSearchDestroy( phbk->search_win ); - phbk->search_win = 0; - } - else + bookSearchDestroy( phbk->search_win ); + phbk->search_win = 0; + } + else { /* perform the search */ - //Jan 27, 2006 REF: OMAPS00061925 x0039928 - // Fix : Start the phonebook timer for populating the list - timStart(PhbSearchTim); + //Jan 27, 2006 REF: OMAPS00061925 x0039928 + // Fix : Start the phonebook timer for populating the list + timStart(PhbSearchTim); } - } + } } break; @@ -751,7 +718,7 @@ } break; - default: + default: { /* No other action required */ @@ -766,107 +733,107 @@ /******************************************************************************* - $Function: bookChangePB + $Function: bookChangePB - $Description: Change the phonebook + $Description: Change the phonebook - $Returns: None + $Returns: None - $Arguments: None. + $Arguments: None. *******************************************************************************/ void bookChangePB(T_MFW_HND win, UBYTE identifier, UBYTE reason) { - T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; - T_phbk *Phbk = (T_phbk *) win_data->user; + T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; + T_phbk *Phbk = (T_phbk *) win_data->user; - GI_pb_SetPhonebook(identifier); - bookShowInfoScreen( Phbk->win, TxtPhonebook, TxtChanged, NULL, NULL, 3000); - return; + GI_pb_SetPhonebook(identifier); + bookShowInfoScreen( Phbk->win, TxtPhonebook, TxtChanged, NULL, NULL, 3000); + return; } /******************************************************************************* - $Function: bookCopy + $Function: bookCopy - $Description: Copy or move a phonebook entry from one book to another + $Description: Copy or move a phonebook entry from one book to another - $Returns: status of change, or MWB_PHB_FAIL if an error occurs + $Returns: status of change, or MWB_PHB_FAIL if an error occurs - $Arguments: entry - the entry to be moved or copied - srcStatus - Status information about the source phonebook - destStatus - Status information about the destination phonebook - move - TRUE if the original record is to be deleted + $Arguments: entry - the entry to be moved or copied + srcStatus - Status information about the source phonebook + destStatus - Status information about the destination phonebook + move - TRUE if the original record is to be deleted *******************************************************************************/ -UBYTE bookCopy( T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *destStatus, T_MFW_PHB_STATUS *srcStatus, UBYTE move ) +UBYTE bookCopy( T_MFW_PHB_ENTRY *entry, T_MFW_PHB_STATUS *destStatus, T_MFW_PHB_STATUS *srcStatus, UBYTE move ) { - T_MFW ret; - UBYTE srcIndex; - UBYTE srcBook; + T_MFW ret; + UBYTE srcIndex; + UBYTE srcBook; - TRACE_FUNCTION("bookCopy"); + TRACE_FUNCTION("bookCopy"); - if (!destStatus->avail_entries) - { - /* There's no room in the destination phonebook to add the entry */ - TRACE_EVENT("bookCopy: dest phonebook full"); - return MFW_PHB_FULL; - } + if (!destStatus->avail_entries) + { + /* There's no room in the destination phonebook to add the entry */ + TRACE_EVENT("bookCopy: dest phonebook full"); + return MFW_PHB_FULL; + } - srcIndex = entry->index; - entry->index = 0; + srcIndex = entry->index; + entry->index = 0; - if (entry->name.len>destStatus->tag_len) - { - TRACE_EVENT("bookCopy: Alpha tag cropped"); - entry->name.len = destStatus->tag_len; - entry->name.data[entry->name.len] = NULL; - } + if (entry->name.len>destStatus->tag_len) + { + TRACE_EVENT("bookCopy: Alpha tag cropped"); + entry->name.len = destStatus->tag_len; + entry->name.data[entry->name.len] = NULL; + } ret = phb_store_entry( destStatus->book, entry, destStatus ); TRACE_EVENT_P2("bookCopy: phb_store_entry book %d result %d", destStatus->book, ret); // 27 June, 2007 DR:OMAPS00136627 x0062172 Syed if ( (ret!=MFW_PHB_OK) && (ret!=MFW_PHB_EXCT) ) - return ret; + return ret; - /* Only try to delete the entry if we are moving an entry from one book - * to another. Don't try if it is an FDN entry */ + /* Only try to delete the entry if we are moving an entry from one book + * to another. Don't try if it is an FDN entry */ - TRACE_EVENT_P2("move %d, entry->book %d", move, entry->book); + TRACE_EVENT_P2("move %d, entry->book %d", move, entry->book); - if (move && entry->book!=PHB_FDN) - { - if (( srcStatus->book == PHB_UPN) || (srcStatus->book == PHB_FDN )) + if (move && entry->book!=PHB_FDN) + { + if (( srcStatus->book == PHB_UPN) || (srcStatus->book == PHB_FDN )) srcBook = srcStatus->book; - else - srcBook = bookActiveBook(WRITE); + else + srcBook = bookActiveBook(WRITE); - ret = phb_delete_entry(srcBook, srcIndex, srcStatus); - TRACE_EVENT_P3("bookCopy: phb_delete_entry book %d index %d result %d", srcStatus->book, srcIndex, ret); - } + ret = phb_delete_entry(srcBook, srcIndex, srcStatus); + TRACE_EVENT_P3("bookCopy: phb_delete_entry book %d index %d result %d", srcStatus->book, srcIndex, ret); + } /* 30 Aug ,2007 DR:OMAPS00143539 ,x0081909 ( Deepak ) */ /* 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 */ - entry->index = srcIndex; + entry->index = srcIndex; - TRACE_EVENT("bookCopy: leaving function"); + TRACE_EVENT("bookCopy: leaving function"); - return ret; + return ret; } /******************************************************************************* - $Function: bookDelMoveCB + $Function: bookDelMoveCB - $Description: callback after moving a phonebook entry + $Description: callback after moving a phonebook entry $Returns: @@ -877,31 +844,31 @@ static void bookDelMoveCB( T_MFW_HND win, USHORT Identifier,UBYTE reason) { - T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; - T_phbk *Phbk = (T_phbk *) win_data->user; + T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; + T_phbk *Phbk = (T_phbk *) win_data->user; - bookGetCurrentStatus(&Phbk->current.status); - bookMenuDestroy(Phbk->menu_options_win); - if( Phbk->current.status.used_entries > 0 ) - { - SEND_EVENT( Phbk->search_win, SEARCH_STRING, 1, 0); - winShow(Phbk->search_win ); - } - else - { - if( Phbk->search_win) - { - //destroy current window - bookSearchDestroy(Phbk->search_win ); - } - } + bookGetCurrentStatus(&Phbk->current.status); + bookMenuDestroy(Phbk->menu_options_win); + if( Phbk->current.status.used_entries > 0 ) + { + SEND_EVENT( Phbk->search_win, SEARCH_STRING, 1, 0); + winShow(Phbk->search_win ); + } + else + { + if( Phbk->search_win) + { + //destroy current window + bookSearchDestroy(Phbk->search_win ); + } + } } /******************************************************************************* - $Function: bookCopyCB + $Function: bookCopyCB - $Description: callback after Copying a phonebook entry + $Description: callback after Copying a phonebook entry $Returns: @@ -912,89 +879,89 @@ static void bookCopyCB( T_MFW_HND win, USHORT Identifier,UBYTE reason) { - T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; - T_phbk *Phbk = (T_phbk *) win_data->user; + T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; + T_phbk *Phbk = (T_phbk *) win_data->user; bookMenuDestroy(Phbk->menu_options_win); } /******************************************************************************* - $Function: bookCopySingle + $Function: bookCopySingle - $Description: Copy or move a single phonebook entry + $Description: Copy or move a single phonebook entry - $Returns: None + $Returns: None - $Arguments: None. + $Arguments: None. *******************************************************************************/ void bookCopySingle(T_MFW_HND win, UBYTE identifier, UBYTE reason) { - T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; - T_phbk *Phbk = (T_phbk *) win_data->user; - BOOL oldBook; - int txtId; - T_MFW_PHB_STATUS destStatus; - tMmiPhbData *current = &Phbk->phbk->current; + T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; + T_phbk *Phbk = (T_phbk *) win_data->user; + BOOL oldBook; + int txtId; + T_MFW_PHB_STATUS destStatus; + tMmiPhbData *current = &Phbk->phbk->current; - TRACE_FUNCTION("bookCopySingle"); + TRACE_FUNCTION("bookCopySingle"); - oldBook = bookGetBookSelected(); + oldBook = bookGetBookSelected(); // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) -// While doing a copy from the FDN menu the destination should always be internal phonebook - if(menuFDN && (call_data.calls.numCalls==0)) - { - destStatus.book = PHB_IPB; - } - else - { - bookSetBookSelected(!oldBook); - destStatus.book = bookActiveBook(WRITE); - } +// While doing a copy from the FDN menu the destination should always be internal phonebook + if(menuFDN && (call_data.calls.numCalls==0)) + { + destStatus.book = PHB_IPB; + } + else + { + bookSetBookSelected(!oldBook); + destStatus.book = bookActiveBook(WRITE); + } - bookGetCurrentStatus( &destStatus ); + bookGetCurrentStatus( &destStatus ); - bookSetBookSelected(oldBook); - txtId = TxtStored; + bookSetBookSelected(oldBook); + txtId = TxtStored; - if (destStatus.avail_entries) - { - switch (bookCopy(¤t->entry[current->selectedName], &destStatus, ¤t->status, identifier)) - { - case MFW_PHB_OK: - //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) - case MFW_PHB_EXCT: - txtId = TxtStored; - break; - case MFW_PHB_FULL: - txtId = TxtPhbkFull; - break; - default: - txtId = TxtFailed; - break; - } - } - else - { - txtId = TxtPhbkFull; - } + if (destStatus.avail_entries) + { + switch (bookCopy(¤t->entry[current->selectedName], &destStatus, ¤t->status, identifier)) + { + case MFW_PHB_OK: + //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) + case MFW_PHB_EXCT: + txtId = TxtStored; + break; + case MFW_PHB_FULL: + txtId = TxtPhbkFull; + break; + default: + txtId = TxtFailed; + break; + } + } + else + { + txtId = TxtPhbkFull; + } - //x0pleela 01 June, 2006 DR: OMAPS00079716 - //Calling a callback for move operation - if(identifier) - bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookDelMoveCB ); - else - //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963 - bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookCopyCB ); - /*if (identifier) - { - // Destroy options menu and regenerate address list + //x0pleela 01 June, 2006 DR: OMAPS00079716 + //Calling a callback for move operation + if(identifier) + bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookDelMoveCB ); + else + //x0066814(Geetha) 17 Aug, 2007 DR: OMAPS00141963 + bookShowInformation( win, txtId, NULL, (T_VOID_FUNC)bookCopyCB ); + /*if (identifier) + { + // Destroy options menu and regenerate address list - if(Phbk->current.status.used_entries > 0) - SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 ); - SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book ); - }*/ + if(Phbk->current.status.used_entries > 0) + SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 ); + SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book ); + }*/ return; } @@ -1002,161 +969,160 @@ /******************************************************************************* - $Function: bookCopyMultiple + $Function: bookCopyMultiple - $Description: Copy or move multiple phonebook entries + $Description: Copy or move multiple phonebook entries - $Returns: None + $Returns: None - $Arguments: None. + $Arguments: None. *******************************************************************************/ void bookCopyMultiple(T_MFW_HND win, UBYTE move, UBYTE reason) { - T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; - T_phbk *Phbk = (T_phbk *) win_data->user; - UBYTE oldBook; - T_MFW_PHB_STATUS destStatus; - T_MFW_PHB_STATUS srcStatus; - T_MFW_PHB_LIST entries; - T_MFW_PHB_ENTRY entry; - UBYTE readIndex; - int txtId; -// T_MFW_HND info_win; // RAVI - static T_MFW_HND waitWin = NULL; + T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; + T_phbk *Phbk = (T_phbk *) win_data->user; + UBYTE oldBook; + T_MFW_PHB_STATUS destStatus; + T_MFW_PHB_STATUS srcStatus; + T_MFW_PHB_LIST entries; + T_MFW_PHB_ENTRY entry; + UBYTE readIndex; + int txtId; +// T_MFW_HND info_win; // RAVI + static T_MFW_HND waitWin = NULL; /* Set up some data */ TRACE_FUNCTION("bookCopyMultiple"); - entries.entry = &entry; + entries.entry = &entry; - srcStatus.book = bookActiveBook(WRITE); - bookGetCurrentStatus( &srcStatus ); + srcStatus.book = bookActiveBook(WRITE); + bookGetCurrentStatus( &srcStatus ); - oldBook = bookGetBookSelected(); - bookSetBookSelected(!oldBook); + oldBook = bookGetBookSelected(); + bookSetBookSelected(!oldBook); - destStatus.book = bookActiveBook(WRITE); - bookGetCurrentStatus( &destStatus ); + destStatus.book = bookActiveBook(WRITE); + bookGetCurrentStatus( &destStatus ); - bookSetBookSelected(oldBook); + bookSetBookSelected(oldBook); - /* First time entering function, set up values. - * Store information so this function can be called again - * when the phonebook is ready */ + /* First time entering function, set up values. + * Store information so this function can be called again + * when the phonebook is ready */ - if (ipbCopyIndex==0) - { - ipbCopyIndex = srcStatus.used_entries; - ipbWin = win; - ipbMove = move; + if (ipbCopyIndex==0) + { + ipbCopyIndex = srcStatus.used_entries; + ipbWin = win; + ipbMove = move; - if (!bookGetBookSelected() && !move) - { - /* We need to drop out of this function briefly in order to get the dialog to display - * for this particular case! Show info screen very briefly, which calls this function as - * a callback. The info screen remains until we drop out of this function a second - * time */ - waitWin = NULL; - bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopyMultiple, NULL, 100); - return; - } - waitWin = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); - } + if (!bookGetBookSelected() && !move) + { + /* We need to drop out of this function briefly in order to get the dialog to display + * for this particular case! Show info screen very briefly, which calls this function as + * a callback. The info screen remains until we drop out of this function a second + * time */ + waitWin = NULL; + bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopyMultiple, NULL, 100); + return; + } + waitWin = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); + } - TRACE_EVENT_P1("Entries in list: %d", srcStatus.used_entries); + TRACE_EVENT_P1("Entries in list: %d", srcStatus.used_entries); - /* For special case where SIM will give no E_PHB_READY response, the - * do...while operates as a loop below. Otherwise, it will only go through - * once, and this function will be called repeatedly every E_PHB_READY */ + /* For special case where SIM will give no E_PHB_READY response, the + * do...while operates as a loop below. Otherwise, it will only go through + * once, and this function will be called repeatedly every E_PHB_READY */ - do - { - txtId = TxtStored; + do + { + txtId = TxtStored; - if (!destStatus.avail_entries) - { - txtId = TxtPhbkFull; - } - else if (ipbCopyIndex==0) - { - txtId = TxtEmpty; - } - else - { - /* For moving, always delete first entry alphabetically, list moves down. - * For copying, move through the list */ + if (!destStatus.avail_entries) + { + txtId = TxtPhbkFull; + } + else if (ipbCopyIndex==0) + { + txtId = TxtEmpty; + } + else + { + /* For moving, always delete first entry alphabetically, list moves down. + * For copying, move through the list */ - if (move) - readIndex = 1; - else - readIndex = ipbCopyIndex; + if (move) + readIndex = 1; + else + readIndex = ipbCopyIndex; - TRACE_EVENT_P1("Moving entry %d", readIndex); + TRACE_EVENT_P1("Moving entry %d", readIndex); - /* Read in entry and copy/move it */ + /* Read in entry and copy/move it */ - phb_read_entries(srcStatus.book, readIndex, MFW_PHB_ALPHA, 1, &entries); + phb_read_entries(srcStatus.book, readIndex, MFW_PHB_ALPHA, 1, &entries); - switch (bookCopy(entries.entry, &destStatus, &srcStatus, move)) - { - case MFW_PHB_OK: - //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) - case MFW_PHB_EXCT: - txtId = TxtStored; - break; - case MFW_PHB_FULL: - txtId = TxtPhbkFull; - break; - default: - txtId = TxtFailed; - break; - } + switch (bookCopy(entries.entry, &destStatus, &srcStatus, move)) + { + case MFW_PHB_OK: + //27 June, 2007 DR: OMAPS00136608 x0073106(sundeep) + case MFW_PHB_EXCT: + txtId = TxtStored; + break; + case MFW_PHB_FULL: + txtId = TxtPhbkFull; + break; + default: + txtId = TxtFailed; + break; + } - ipbCopyIndex--; - } - }/* Is a loop in special case - see above */ - while (!bookGetBookSelected() && !move && txtId==TxtStored && ipbCopyIndex>0); + ipbCopyIndex--; + } + }/* Is a loop in special case - see above */ + while (!bookGetBookSelected() && !move && txtId==TxtStored && ipbCopyIndex>0); - /* If we've finished, or an error has occurred, show info dialog */ + /* If we've finished, or an error has occurred, show info dialog */ - if (ipbCopyIndex==0 || txtId!=TxtStored) - { - ipbCopyIndex = 0; + if (ipbCopyIndex==0 || txtId!=TxtStored) + { + ipbCopyIndex = 0; - /* Destroy the Please Wait window and show the result message */ + /* Destroy the Please Wait window and show the result message */ - bookShowInformation( win, txtId, NULL, NULL ); - if (waitWin) - { - SEND_EVENT(waitWin, DIALOG_DESTROY,0,0); - } + bookShowInformation( win, txtId, NULL, NULL ); + if (waitWin) + { + SEND_EVENT(waitWin, DIALOG_DESTROY,0,0); + } - if (move) - { - /* Destroy options menu and regenerate address list */ + if (move) + { + /* Destroy options menu and regenerate address list */ - bookMenuDestroy(Phbk->menu_options_win); - bookGetCurrentStatus( &Phbk->current.status ); - //06 June, 2007 DR: OMAPS00132045 - //changed the condition from used_entries to ipbCopyIndex - if((ipbCopyIndex > 0)) - { - SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 ); - SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book ); - } - else - bookSearchDestroy(Phbk->search_win); - } - } + bookMenuDestroy(Phbk->menu_options_win); + bookGetCurrentStatus( &Phbk->current.status ); + //06 June, 2007 DR: OMAPS00132045 + //changed the condition from used_entries to ipbCopyIndex + if((ipbCopyIndex > 0)) + { + SEND_EVENT(Phbk->search_win, SEARCH_SCROLL_UP, 0, 0 ); + SEND_EVENT(Phbk->search_win, SEARCH_UPDATE, 0, (void*)Phbk->current.status.book ); + } + else + bookSearchDestroy(Phbk->search_win); + } + } - return; + return; } #endif - /******************************************************************************* Public Methods @@ -1165,36 +1131,30 @@ - /******************************************************************************* - $Function: bookCurrentWindow + $Function: bookCurrentWindow $Description: This returns the window handle associated with the current MFW element - $Returns: window handle of current MFW item + $Returns: window handle of current MFW item - $Arguments: none. + $Arguments: none. *******************************************************************************/ tBookMfwHnd bookCurrentWindow( void ) { - return mfwParent( mfwHeader() ); + return mfwParent( mfwHeader() ); } - - - - - /******************************************************************************* - $Function: bookDefaultCallBack + $Function: bookDefaultCallBack $Description: @@ -1204,32 +1164,26 @@ this will still be callable from the info dialogs as it will use the reference we set up. - $Returns: zero, always + $Returns: zero, always - $Arguments: win, parent window + $Arguments: win, parent window identifier, of the window - reason, for the window + reason, for the window *******************************************************************************/ static tBookStatus bookDefaultCallBack( tBookMfwHnd win, UBYTE identifier, UBYTE reason ) { - if ( win ) - winShow( win ); - - return 0; -} + if ( win ) + winShow( win ); - - - - - + return 0; +} /******************************************************************************* - $Function: bookWindowData + $Function: bookWindowData $Description: @@ -1237,102 +1191,79 @@ handler or call back function and will return a pointer to the window data associated with the current MFW element. - $Returns: pointer to the data area + $Returns: pointer to the data area - $Arguments: none. + $Arguments: none. *******************************************************************************/ void *bookWindowData( void ) { - tBookMfwHnd WinPtr; + tBookMfwHnd WinPtr; - if ( ( WinPtr = bookCurrentWindow() ) == NULL ) - return (void *) NULL; + if ( ( WinPtr = bookCurrentWindow() ) == NULL ) + return (void *) NULL; - return (void *)((tBookMfwHdr *) WinPtr)->data; + return (void *)((tBookMfwHdr *) WinPtr)->data; } - - - - - - - /******************************************************************************* - $Function: bookMenuSelectedNumber + $Function: bookMenuSelectedNumber $Description: This will return the currently selected entry in the phone book, when the routine is being called from a menu handler - $Returns: pointer to the selected number buffer + $Returns: pointer to the selected number buffer - $Arguments: none. + $Arguments: none. *******************************************************************************/ char *bookMenuSelectedNumber( void ) { - - - /* Have we got a valid window ? - */ - if ( ( (tBookMfwHnd) bookWindowData() ) == NULL ) - return NULL; + /* Have we got a valid window ? + */ + if ( ( (tBookMfwHnd) bookWindowData() ) == NULL ) + return NULL; - return NULL; + return NULL; } - - - - - - - /******************************************************************************* - $Function: bookPhoneBookLoading + $Function: bookPhoneBookLoading - $Description: access routine for the local static menu area + $Description: access routine for the local static menu area Utility functions to determine if the phone book is still in the loading state - $Returns: BOOK_FAILURE if loading, otherwise BOOK_SUCCESS + $Returns: BOOK_FAILURE if loading, otherwise BOOK_SUCCESS - $Arguments: none. + $Arguments: none. *******************************************************************************/ tBookStatus bookPhoneBookLoading( void ) { - int temp; - char tempst[20]; - TRACE_FUNCTION("bookPhoneBookLoading"); - temp = phb_get_mode(); - sprintf(tempst,"phb_get_mode %d",temp); - TRACE_EVENT(tempst); - return ( (phb_get_mode() == PHB_LOADING)||(phb_get_mode() == MFW_PHB_FAIL) ) ? BOOK_FAILURE : BOOK_SUCCESS; + int temp; + char tempst[20]; + TRACE_FUNCTION("bookPhoneBookLoading"); + temp = phb_get_mode(); + sprintf(tempst,"phb_get_mode %d",temp); + TRACE_EVENT(tempst); + return ( (phb_get_mode() == PHB_LOADING)||(phb_get_mode() == MFW_PHB_FAIL) ) ? BOOK_FAILURE : BOOK_SUCCESS; } - - - - - - - /******************************************************************************* - $Function: bookInfoDialog + $Function: bookInfoDialog $Description: @@ -1341,40 +1272,33 @@ for a user input before removing the message, the non-modal will clear after three seconds - $Returns: One. + $Returns: One. - $Arguments: String1, String2, character strings to be displayed. + $Arguments: String1, String2, character strings to be displayed. *******************************************************************************/ tBookStatus bookInfoDialog( char *String1, char *String2 ) { - tBookMfwHnd Win = bookCurrentWindow(); - tBookDialogData Dialog; - - /* Initialise the dialog control block with default information - */ - dlg_initDisplayData_TextStr( &Dialog, TxtNull, TxtNull, String1, String2, COLOUR_STATUS); - dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDefaultCallBack, THREE_SECS, KEY_CLEAR); + tBookMfwHnd Win = bookCurrentWindow(); + tBookDialogData Dialog; - /* Show the dialog - */ - info_dialog( Win, &Dialog ); - - return 1; -} + /* Initialise the dialog control block with default information + */ + dlg_initDisplayData_TextStr( &Dialog, TxtNull, TxtNull, String1, String2, COLOUR_STATUS); + dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDefaultCallBack, THREE_SECS, KEY_CLEAR); - - + /* Show the dialog + */ + info_dialog( Win, &Dialog ); - - - + return 1; +} /******************************************************************************* - $Function: bookNotImplemented + $Function: bookNotImplemented $Description: @@ -1383,27 +1307,27 @@ current MFW element to detect the handle of the parent window if the incoming window handle is NULL. - $Returns: One + $Returns: One - $Arguments: Parent, window, can be NULL + $Arguments: Parent, window, can be NULL *******************************************************************************/ tBookStatus bookNotImplemented( tBookMfwHnd Parent ) { - tBookMfwHnd Win = ( Parent ) ? Parent : bookCurrentWindow(); - tBookDialogData Dialog; + tBookMfwHnd Win = ( Parent ) ? Parent : bookCurrentWindow(); + tBookDialogData Dialog; - /* Initialise the dialog control block with default information - */ - dlg_initDisplayData_TextStr( &Dialog, TxtNull, TxtNull, MmiRsrcGetText( TxtNotImplemented ), NULL, COLOUR_STATUS); - dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDefaultCallBack, THREE_SECS, KEY_CLEAR); + /* Initialise the dialog control block with default information + */ + dlg_initDisplayData_TextStr( &Dialog, TxtNull, TxtNull, MmiRsrcGetText( TxtNotImplemented ), NULL, COLOUR_STATUS); + dlg_initDisplayData_events( &Dialog, (T_VOID_FUNC)bookDefaultCallBack, THREE_SECS, KEY_CLEAR); - /* Show the dialog - */ - info_dialog( Win, &Dialog ); + /* Show the dialog + */ + info_dialog( Win, &Dialog ); - return 1; + return 1; } @@ -1415,29 +1339,25 @@ } - - - - /* SPR#1428 - SH - New Editor changes: No longer required */ #ifndef NEW_EDITOR /******************************************************************************* - $Function: set_edt_attr + $Function: set_edt_attr $Description: Sets up the edit attribute structure with the provided parameters - $Returns: None + $Returns: None - $Arguments: winPx, winPy, winSx, winSy, positioning information + $Arguments: winPx, winPy, winSx, winSy, positioning information fgColor, colour for foreground - font, mode, controls, pretty much what they say - *text, initial text to be edited - size, of the text (in bytes) - attr, the block to be set up with the other parameters + font, mode, controls, pretty much what they say + *text, initial text to be edited + size, of the text (in bytes) + attr, the block to be set up with the other parameters GW - Changed colour from 8 bits (foreground) to 2x32bits fgd and bgd For the colour display we pass a 32 bit word that defines the size and position of the editor. @@ -1445,32 +1365,24 @@ *******************************************************************************/ void bookSetEditAttributes( int zone_id, - U32 colIndex, - U8 font, U8 mode, U8 *controls, - char *text, U16 size, - MfwEdtAttr* attr) + U32 colIndex, + U8 font, U8 mode, U8 *controls, + char *text, U16 size, + MfwEdtAttr* attr) { - /* Populate the structure with the parameters - */ - calculateWindow(attr, zone_id ); - attr->edtCol = colIndex; - attr->font = font; - attr->mode = mode; - attr->controls = controls; - attr->text = text; - attr->size = size; + /* Populate the structure with the parameters + */ + calculateWindow(attr, zone_id ); + attr->edtCol = colIndex; + attr->font = font; + attr->mode = mode; + attr->controls = controls; + attr->text = text; + attr->size = size; } #endif /* NEW_EDITOR */ - - - - - - - - /******************************************************************************* Name Handling Functions @@ -1479,51 +1391,44 @@ /******************************************************************************* - $Function: bookGetCurrentStatus + $Function: bookGetCurrentStatus - $Description: Determines the current status of the phone book + $Description: Determines the current status of the phone book - $Returns: status byte + $Returns: status byte - $Arguments: currentStatus, pointer to structure to be populated with + $Arguments: currentStatus, pointer to structure to be populated with status information *******************************************************************************/ UBYTE bookGetCurrentStatus( T_MFW_PHB_STATUS *currentStatus ) { - UBYTE temp; - TRACE_FUNCTION( "bookGetCurrentStatus()" ); - + UBYTE temp; + TRACE_FUNCTION( "bookGetCurrentStatus()" ); temp = phb_get_status( currentStatus ); { - char temp[255]; - sprintf(temp,"book %d max_entries %d used_entries %d aval_entries %d", - currentStatus->book,currentStatus->max_entries, - currentStatus->used_entries, - currentStatus->avail_entries); - TRACE_EVENT(temp); + char temp[255]; + sprintf(temp,"book %d max_entries %d used_entries %d aval_entries %d", + currentStatus->book,currentStatus->max_entries, + currentStatus->used_entries, + currentStatus->avail_entries); + TRACE_EVENT(temp); } return temp; } - - - - - - /******************************************************************************* - $Function: bookFindNames + $Function: bookFindNames - $Description: Fine name in phone book + $Description: Fine name in phone book - $Returns: status of search + $Returns: status of search - $Arguments: number, number of entries to search, current, + $Arguments: number, number of entries to search, current, pointer to structure containing search context *******************************************************************************/ @@ -1531,47 +1436,43 @@ UBYTE bookFindName( UBYTE number, tMmiPhbData *current ) { UBYTE ret; - int index; // , Count = 0; // RAVI + int index; // , Count = 0; // RAVI UBYTE book_type, index_type; - - // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P // Added these variables to Fix the Issue MMI-SPR-15813 // nondigitindex => index after which '+' sign to be added // numlength = lenght of the number array. // nondigitFound = Checks whether nondigit is present in the number array or not. - int nondigitindex = -1,j,numlength = 0, nondigitFound = -1; + int nondigitindex = -1,j,numlength = 0, nondigitFound = -1; - - TRACE_FUNCTION( "bookFindName()" ); + TRACE_FUNCTION( "bookFindName()" ); /* Firstly, check for an empty book */ - bookGetCurrentStatus( ¤t->status ); + bookGetCurrentStatus( ¤t->status ); if ( current->status.used_entries < 1 ) { current->index = 0; return MFW_PHB_OK; } - //x0066692 Date:23 April 2007 DR:OMAPS00121834 - // this condition ensures that stop index doesn't exceed max no. of entries can be added to a phonebook - number = current->status.used_entries - current->index +1; + //x0066692 Date:23 April 2007 DR:OMAPS00121834 + // this condition ensures that stop index doesn't exceed max no. of entries can be added to a phonebook + number = current->status.used_entries - current->index +1; - if ( number > MAX_SEARCH_NAME ) - number = MAX_SEARCH_NAME; - // Feb 20, 2006 REF: OMAPS00061948 x0039928 - // Fix : If used entries are less than MAX_SARCH_NAME then no. of entries - // passed to the phb_read_entries is used entries. + if ( number > MAX_SEARCH_NAME ) + number = MAX_SEARCH_NAME; + // Feb 20, 2006 REF: OMAPS00061948 x0039928 + // Fix : If used entries are less than MAX_SARCH_NAME then no. of entries + // passed to the phb_read_entries is used entries. /* Okay, we have some entries to search, so initialise the current entry buffer to empty */ - memset( current->entry, 0, MAX_SEARCH_CALL_LIST * sizeof( T_MFW_PHB_ENTRY ) ); - + memset( current->entry, 0, MAX_SEARCH_CALL_LIST * sizeof( T_MFW_PHB_ENTRY ) ); current->list.entry = current->entry; @@ -1586,40 +1487,40 @@ /* Sort out the type of search we are performing */ - if ((book_type == PHB_LDN) || (book_type == PHB_LRN)|| (book_type == PHB_LMN)) + if ((book_type == PHB_LDN) || (book_type == PHB_LRN)|| (book_type == PHB_LMN)) index_type = MFW_PHB_INDEX; else { - if ( current->KindOfSearch == SEARCH_BY_NAME ) - index_type = MFW_PHB_ALPHA; - else if ( current->KindOfSearch == SEARCH_BY_NUMBER ) - index_type = MFW_PHB_NUMBER; - else if ( current->KindOfSearch == SEARCH_BY_LOCATION ) - index_type = MFW_PHB_INDEX; + if ( current->KindOfSearch == SEARCH_BY_NAME ) + index_type = MFW_PHB_ALPHA; + else if ( current->KindOfSearch == SEARCH_BY_NUMBER ) + index_type = MFW_PHB_NUMBER; + else if ( current->KindOfSearch == SEARCH_BY_LOCATION ) + index_type = MFW_PHB_INDEX; } /* read the appropriate entries from the phone book */ - { - char temp[255]; - sprintf(temp,"book %d index %d indextype %d number %d", - book_type,current->index,index_type,number); - TRACE_EVENT(temp); - } + { + char temp[255]; + sprintf(temp,"book %d index %d indextype %d number %d", + book_type,current->index,index_type,number); + TRACE_EVENT(temp); + } // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) //When book is ADN, we need to read only ADN entries. no need to display ADN and FDN together - if (book_type == PHB_ADN) /*Quick test */ - { - TRACE_EVENT("book_type == PHB_ADN"); - ret = phb_read_entries( PHB_ADN, current->index, index_type, number, ¤t->list ); - } - else - { - TRACE_EVENT("book_type == OTHER"); - ret = phb_read_entries( book_type, current->index, index_type, number, ¤t->list ); - } + if (book_type == PHB_ADN) /*Quick test */ + { + TRACE_EVENT("book_type == PHB_ADN"); + ret = phb_read_entries( PHB_ADN, current->index, index_type, number, ¤t->list ); + } + else + { + TRACE_EVENT("book_type == OTHER"); + ret = phb_read_entries( book_type, current->index, index_type, number, ¤t->list ); + } /* Populate the output structures */ @@ -1636,208 +1537,201 @@ /* GSM character sets */ UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ - char debug[22]; - int i; + char debug[22]; + int i; TRACE_EVENT( (char*)current->entry[index].name.data); TRACE_EVENT("Convert from SIM to UCS2"); - TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); - /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ - if (current->entry[index].name.data[0] == 0x80 ) - { for (i=1; i<MAX_ALPHA_LEN; i+=1) - { - l_name[i+1] = current->entry[index].name.data[i]; - } - l_name[0] = current->entry[index].name.data[0]; - l_name[1] = MAX_ALPHA_LEN; + TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); + /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ + if (current->entry[index].name.data[0] == 0x80 ) + { for (i=1; i<MAX_ALPHA_LEN; i+=1) + { + l_name[i+1] = current->entry[index].name.data[i]; + } + l_name[0] = current->entry[index].name.data[0]; + l_name[1] = MAX_ALPHA_LEN; - memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); - /*MC, we'll just use the length provided by the MFW*/ - if (current->entry[index].name.len%2 == 1)/*if length of string odd*/ - current->entry[index].name.len++;/* INCREASE LENGTH BY 1*/ + memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); + /*MC, we'll just use the length provided by the MFW*/ + if (current->entry[index].name.len%2 == 1)/*if length of string odd*/ + current->entry[index].name.len++;/* INCREASE LENGTH BY 1*/ - /*make sure all chars after length are 0*/ - for (i=current->entry[index].name.len; i<MAX_ALPHA_LEN; i++) - { current->entry[index].name.data[i] = 0; } + /*make sure all chars after length are 0*/ + for (i=current->entry[index].name.len; i<MAX_ALPHA_LEN; i++) + { current->entry[index].name.data[i] = 0; } - for (i=0; i < MAX_ALPHA_LEN;i++) - { - if ( current->entry[index].name.data[i]== 0 && current->entry[index].name.data[i+1] != 0) - debug[i] = '0'; - else - debug[i] = (char)current->entry[index].name.data[i]; - } + for (i=0; i < MAX_ALPHA_LEN;i++) + { + if ( current->entry[index].name.data[i]== 0 && current->entry[index].name.data[i+1] != 0) + debug[i] = '0'; + else + debug[i] = (char)current->entry[index].name.data[i]; + } - TRACE_EVENT("Decoded entry"); - TRACE_EVENT(debug); + TRACE_EVENT("Decoded entry"); + TRACE_EVENT(debug); - } + } - else + else - { /*SPR2175, use new function to convert from GSM to ASCII*/ - { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.len, - (char*)l_name, MFW_ASCII, PHB_MAX_LEN, FALSE); - current->entry[index].name.dcs = MFW_ASCII; - memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); - } + { /*SPR2175, use new function to convert from GSM to ASCII*/ + { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.len, + (char*)l_name, MFW_ASCII, PHB_MAX_LEN, FALSE); + current->entry[index].name.dcs = MFW_ASCII; + memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); + } - } - } + } + } #endif /*MC end*/ #else for ( index = 0; index < number; index++ ) - { - UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ - TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); - /*SPR2175, use new function to convert from GSM to ASCII*/ - { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.data.len, - l_name, MFW_ASCII, PHB_MAX_LEN); - current->entry[index].name.dcs = MFW_ASCII; - memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); - } - } + { + UBYTE l_name[MAX_ALPHA_LEN];/*MC SPR 1257, name strings should use MAX_ALPHA_LEN*/ + TRACE_EVENT_P1("length of name string: %d", current->entry[index].name.len); + /*SPR2175, use new function to convert from GSM to ASCII*/ + { ATB_convert_String((char*)current->entry[index].name.data, MFW_DCS_8bits, current->entry[index].name.data.len, + l_name, MFW_ASCII, PHB_MAX_LEN); + current->entry[index].name.dcs = MFW_ASCII; + memcpy( current->entry[index].name.data, (char*)l_name, MAX_ALPHA_LEN ); + } + } #endif /* Needed to make international calls from the phonebook */ - for ( index = 0; index < number; index++ ) - { - if ( current->entry[index].ton ) - { + for ( index = 0; index < number; index++ ) + { + if ( current->entry[index].ton ) + { // May 24, 2004 REF: CRR MMI-SPR-15813 Ajith K P // Issue description: Followup from 15623, this is the BMI part of this Issue. -// At last, in the record "SSC09" the number is displayed with the "+" -// character at the beginning of the number instead of "**21*+014543877989#" +// At last, in the record "SSC09" the number is displayed with the "+" +// character at the beginning of the number instead of "**21*+014543877989#" // Solution: Find the location of nondigit(e.g:*, #) in the number array -// and put '+' to next position if the index is less than numlength-8. This is done -// as there can be ss strings(like *11*20#) attached to the number in the end. -// For eg: **61#+9844093515*11*20# +// and put '+' to next position if the index is less than numlength-8. This is done +// as there can be ss strings(like *11*20#) attached to the number in the end. +// For eg: **61#+9844093515*11*20# // If the total length is less than 8 assign this index to nondigitindex. // This solution is based on special sequences we have encountered till now. - // Finds the length of the number array. - numlength = strlen((char*)current->entry[ index ].number); - //checks whether the length is within the limit. - if(numlength <=PHB_MAX_LEN) + // Finds the length of the number array. + numlength = strlen((char*)current->entry[ index ].number); + //checks whether the length is within the limit. + if(numlength <=PHB_MAX_LEN) //TISH, patch for OMAPS00144985, modified by Jinshu Wang, 2007-09-07 //start if (current->entry[ index ].number[0]=='*' || current->entry[ index ].number[0]=='#') { - for( j=0; j< numlength ; j++) - { - if( !isdigit((char*)current->entry[ index ].number[j]) ) + for( j=0; j< numlength ; j++) + { + if( !isdigit((char*)current->entry[ index ].number[j]) ) { - // Found a nondigit can be */# - nondigitFound = j; - // Checking , whether the nondigit index is not at the end - // part of the number array. - if(j < (numlength-8)) - { - // Current index is less than numlength-8 - nondigitindex = j; - } - else - { - if(numlength <8) - { - // If lenght of the number array is less than 8 - // assign the index to nondigitindex - // This condition might occur when the user - // presses invalid short sequence - nondigitindex = j; - } - } - } - } + // Found a nondigit can be */# + nondigitFound = j; + // Checking , whether the nondigit index is not at the end + // part of the number array. + if(j < (numlength-8)) + { + // Current index is less than numlength-8 + nondigitindex = j; + } + else + { + if(numlength <8) + { + // If lenght of the number array is less than 8 + // assign the index to nondigitindex + // This condition might occur when the user + // presses invalid short sequence + nondigitindex = j; + } + } + } + } } //end - if((nondigitindex == -1) && (nondigitFound> -1) && (nondigitFound < 4)) - { - // Nondigit is existing and it's position is less than 4 and not met - // any of the above conditions. - nondigitindex = nondigitFound; - } + if((nondigitindex == -1) && (nondigitFound> -1) && (nondigitFound < 4)) + { + // Nondigit is existing and it's position is less than 4 and not met + // any of the above conditions. + nondigitindex = nondigitFound; + } - // Move the contents accordingly. - memmove((char *) &(current->entry[ index ].number[ nondigitindex+2]), - (char *) &(current->entry[ index ].number[nondigitindex+1]), numlength - nondigitindex+1); + // Move the contents accordingly. + memmove((char *) &(current->entry[ index ].number[ nondigitindex+2]), + (char *) &(current->entry[ index ].number[nondigitindex+1]), numlength - nondigitindex+1); - // Add the '+' sign after the appropriate nondigit character, if any. - current->entry[index].number[nondigitindex+1] = '+'; - } + // Add the '+' sign after the appropriate nondigit character, if any. + current->entry[index].number[nondigitindex+1] = '+'; + } - } - //} + } + //} return current->result = ret; } - - - - - - /******************************************************************************* - $Function: bookEvent + $Function: bookEvent - $Description: Event handler for a phone book event + $Description: Event handler for a phone book event - $Returns: MFW_EVENT_CONSUMED if recognised message, otherwise + $Returns: MFW_EVENT_CONSUMED if recognised message, otherwise MFW_EVENT_PASSED - $Arguments: e, event, para, general parameter giving context of call + $Arguments: e, event, para, general parameter giving context of call *******************************************************************************/ int bookEvent( MfwEvt e, void *para ) { - T_MFW_PHB_STATUS *status; + T_MFW_PHB_STATUS *status; TRACE_FUNCTION( "bookEvent" ); /* deal with the incoming event */ - switch( e ) + switch( e ) { case E_PHB_UPN_LIST : { - /* x0039928 - Lint warnings fix - upnList = (T_MFW_UPN_LIST *)para; */ + /* x0039928 - Lint warnings fix + upnList = (T_MFW_UPN_LIST *)para; */ /* tbd */ } break; - case E_PHB_STATUS: + case E_PHB_STATUS: { - status = (T_MFW_PHB_STATUS *)para; - if ( ( status->book == PHB_FDN ) || ( status->book == PHB_ADN ) ) - { - if ( pinsSetIsFocussed() == FOCUSSED_PINS ) - backpinFDNactdeact(); - } + status = (T_MFW_PHB_STATUS *)para; + if ( ( status->book == PHB_FDN ) || ( status->book == PHB_ADN ) ) + { + if ( pinsSetIsFocussed() == FOCUSSED_PINS ) + backpinFDNactdeact(); + } } break; - case E_PHB_ERROR: + case E_PHB_ERROR: { - //x0061560 Date May16,07 (sateeshg) OMAPS00133241 - T_MFW_HND win = mfwParent( mfw_header() ); + //x0061560 Date May16,07 (sateeshg) OMAPS00133241 + T_MFW_HND win = mfwParent( mfw_header() ); - TRACE_ERROR("E_PHB_ERROR store entry"); - bookShowInformation(win, TxtError, NULL, NULL ); - } - + TRACE_ERROR("E_PHB_ERROR store entry"); + bookShowInformation(win, TxtError, NULL, NULL ); + } break; @@ -1847,60 +1741,60 @@ { // Aug 18, 2006 ER: OMAPS00089840 x0039928 // Fix : If the E_PHB_READY is for delete all then destroy the please wait window and display the string "Deleted" - if( DeleteAll_flag == TRUE) - { - T_MFW_HND win = mfwParent( mfw_header() ); - int txtid; + if( DeleteAll_flag == TRUE) + { + T_MFW_HND win = mfwParent( mfw_header() ); + int txtid; - TRACE_EVENT("E_PHB_READY Delete all"); - if (waitWindel) - { - SEND_EVENT(waitWindel, DIALOG_DESTROY,0,0); - waitWindel = NULL; - txtid = TxtDeleted; - bookShowInformation(win, txtid, NULL, NULL ); - } - DeleteAll_flag = FALSE; - break; - } - //x0061560 Date May17,07 (sateeshg) OMAPS00133241 - if(addname_flag == TRUE) + TRACE_EVENT("E_PHB_READY Delete all"); + if (waitWindel) + { + SEND_EVENT(waitWindel, DIALOG_DESTROY,0,0); + waitWindel = NULL; + txtid = TxtDeleted; + bookShowInformation(win, txtid, NULL, NULL ); + } + DeleteAll_flag = FALSE; + break; + } + //x0061560 Date May17,07 (sateeshg) OMAPS00133241 + if(addname_flag == TRUE) { - T_MFW_HND win = mfwParent( mfw_header() ); - int txtid; + T_MFW_HND win = mfwParent( mfw_header() ); + int txtid; - TRACE_EVENT("E_PHB_READY Saved"); + TRACE_EVENT("E_PHB_READY Saved"); - txtid = TxtSaved; - bookShowInformation(win, txtid, NULL, NULL ); - addname_flag = FALSE; - break; - } - /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ - if(TRUE == changename_flag) - { - T_MFW_HND win = mfwParent( mfw_header() ); - int txtid; + txtid = TxtSaved; + bookShowInformation(win, txtid, NULL, NULL ); + addname_flag = FALSE; + break; + } + /* Aug 09, 2007 DR:OMAPS00140447 x0056422(Srilekha) */ + if(TRUE == changename_flag) + { + T_MFW_HND win = mfwParent( mfw_header() ); + int txtid; - TRACE_EVENT("Saved prompt for change entry"); - TRACE_EVENT("E_PHB_READY Saved"); + TRACE_EVENT("Saved prompt for change entry"); + TRACE_EVENT("E_PHB_READY Saved"); - txtid = TxtSaved; - bookShowInformation(win, txtid, NULL, NULL ); - changename_flag = FALSE; - break; - } + txtid = TxtSaved; + bookShowInformation(win, txtid, NULL, NULL ); + changename_flag = FALSE; + break; + } TRACE_EVENT("E_PHB_READY"); #ifdef INT_PHONEBOOK - /* SPR#1112 - SH - If we're copying or moving a list, - * the current operation has been successful - keep copying. */ + /* SPR#1112 - SH - If we're copying or moving a list, + * the current operation has been successful - keep copying. */ if (ipbCopyIndex) { - TRACE_EVENT("Copying/moving in progress."); - bookCopyMultiple(ipbWin, ipbMove, 0); + TRACE_EVENT("Copying/moving in progress."); + bookCopyMultiple(ipbWin, ipbMove, 0); } #endif } @@ -1918,7 +1812,7 @@ { /* indicate we haven't dealt with event */ - return MFW_EVENT_PASSED; + return MFW_EVENT_PASSED; } // break; // RAVI } @@ -1929,7 +1823,6 @@ } - // Aug 18, 2006 ER: OMAPS00089840 x0039928 // Fix : Added a new function to delete all the phone book entries. /******************************************************************************* @@ -1940,40 +1833,40 @@ $Returns: None - $Arguments: win - Window Handler + $Arguments: win - Window Handler *******************************************************************************/ void bookDeleteBook(T_MFW_HND win) { - T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; - T_phbk *Phbk = (T_phbk *) win_data->user; + T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; + T_phbk *Phbk = (T_phbk *) win_data->user; Phbk ->current.status.book = bookActiveBook(READ); - //x0061560 Date JUNE 4,07 (sateeshg) OMAPS00131777 - //Updating the current status of the phonebook + //x0061560 Date JUNE 4,07 (sateeshg) OMAPS00131777 + //Updating the current status of the phonebook bookGetCurrentStatus(&Phbk ->current.status); if(Phbk ->current.status.used_entries !=0)//Apr 30,2007, OMAPS00129173, x0066814(Geetha) { if (bookGetBookSelected() ) - bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, 100); + bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, 100); else - DeleteAll_flag = TRUE; + DeleteAll_flag = TRUE; if (phb_delete_book(Phbk->current.status.book) == MFW_PHB_OK) { if (!bookGetBookSelected() ) - waitWindel = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); - else - { - MmiBookSetCurrentText(TxtDeleted); - bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); - } + waitWindel = bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, NULL, NULL, FOREVER); + else + { + MmiBookSetCurrentText(TxtDeleted); + bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); + } } else { DeleteAll_flag = FALSE; - MmiBookSetCurrentText(TxtFailed); + MmiBookSetCurrentText(TxtFailed); bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); } Phbk ->current.status.used_entries=0;//Apr 30,2007, OMAPS00129173, x0066814(Geetha) @@ -1995,57 +1888,55 @@ $Returns: None - $Arguments: destEntry - destination phonebook entry structure - srcEntry - source phonebook entry structure - maxLen - max number oc chars to be copied + $Arguments: destEntry - destination phonebook entry structure + srcEntry - source phonebook entry structure + maxLen - max number oc chars to be copied *******************************************************************************/ //GW Created function to copy name (and length when required). void bookCopyPhbName( T_MFW_PHB_ENTRY* destEntry, T_MFW_PHB_ENTRY* srcEntry, int maxLen ) { - int len; //length of string to be copied - if ((destEntry==NULL) || (srcEntry==NULL)) - return; + int len; //length of string to be copied + if ((destEntry==NULL) || (srcEntry==NULL)) + return; #ifdef NO_ASCIIZ - //Ensure we do not copy more than the PHB array can hold. - if ((maxLen < PHB_MAX_LEN) && (maxLen >0)) - len = maxLen; - else - len = PHB_MAX_LEN; + //Ensure we do not copy more than the PHB array can hold. + if ((maxLen < PHB_MAX_LEN) && (maxLen >0)) + len = maxLen; + else + len = PHB_MAX_LEN; #else /*MC SPR1319, name string is only up to MAX_ALPHA_LEN in length*/ - //Ensure we do not copy more than the PHB array can hold. - if ((maxLen < MAX_ALPHA_LEN) && (maxLen >0)) - len = maxLen; - else - len = MAX_ALPHA_LEN; + //Ensure we do not copy more than the PHB array can hold. + if ((maxLen < MAX_ALPHA_LEN) && (maxLen >0)) + len = maxLen; + else + len = MAX_ALPHA_LEN; #endif #ifdef NO_ASCIIZ - memset (destEntry->name.data, 0, PHB_MAX_LEN); - memcpy( destEntry->name.data, srcEntry->name.data, len); - if (srcEntry->name.len < len) - destEntry->name.len = srcEntry->name.len; - else - { //we have truncated the name - add termination (if possible) - destEntry->name.len = len; - if (len < PHB_MAX_LEN) - { // there is space in array for termination - add it. - destEntry->name.data[len] = 0x00; + memset (destEntry->name.data, 0, PHB_MAX_LEN); + memcpy( destEntry->name.data, srcEntry->name.data, len); + if (srcEntry->name.len < len) + destEntry->name.len = srcEntry->name.len; + else + { //we have truncated the name - add termination (if possible) + destEntry->name.len = len; + if (len < PHB_MAX_LEN) + { // there is space in array for termination - add it. + destEntry->name.data[len] = 0x00; - } - } + } + } #else - memcpy( destEntry->name, srcEntry->name, maxLen); + memcpy( destEntry->name, srcEntry->name, maxLen); #endif } - /******************************************************************************* End of File *******************************************************************************/ -