FreeCalypso > hg > fc-tourmaline
diff src/ui/bmi/mmiBookSearchWindow.c @ 92:c0052fe355d3
src/ui/bmi/*.[ch]: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 08 Nov 2020 06:39:16 +0000 |
parents | 67bfe9f274f6 |
children | ec9f955fc487 |
line wrap: on
line diff
--- a/src/ui/bmi/mmiBookSearchWindow.c Sun Nov 08 05:12:05 2020 +0000 +++ b/src/ui/bmi/mmiBookSearchWindow.c Sun Nov 08 06:39:16 2020 +0000 @@ -2,40 +2,40 @@ CONDAT (UK) -******************************************************************************** +******************************************************************************** This software product is the property of Condat (UK) Ltd and may not be - disclosed to any third party without the express permission of the owner. - + disclosed to any third party without the express permission of the owner. + ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI (6349) + $Project name: Basic MMI + $Project code: BMI (6349) $Module: PhoneBook $File: MmiSearchWindow.c - $Revision: 1.0 - - $Author: Condat(UK) - $Date: 25/10/00 - + $Revision: 1.0 + + $Author: Condat(UK) + $Date: 25/10/00 + ******************************************************************************** - + Description: - + This module provides the phone book search window functionality for the phone book module of the basic MMI - + ******************************************************************************** $History: MmiSearchWindow.c - 23 April 2007 DR:OMAPS00121834, x0066692 Asha - Description: Phonebook -> Phonebooksearch is pointing to the first entry when no of + 23 April 2007 DR:OMAPS00121834, x0066692 Asha + Description: Phonebook -> Phonebooksearch is pointing to the first entry when no of entries in the phonebook is >240 Fix: added the check to restrict the max_stop_index to max no availabe entries and made cursor point to the correct entry in the phonebook. - + - Jan 22, 2006 REF: OMAPS00061930 x0039928 + 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. @@ -44,13 +44,13 @@ sending MMS/EMS. Solution: The new feature to select the number from phonebook while sending MMS/EMS is added - + Oct 26, 2004 REF: CRR 25354 xkundadu - Description: Phonebook: After entering precise name to search and then + Description: Phonebook: After entering precise name to search and then trying to delete using RSK, first character is not deleted Fix: If only one character is present in the editor and delete key is pressed, delete the editor buffer and update the editor view. - + Aug 16, 2004 REF: CRR 24323 Deepa M.D Bug:Clenup of sprintf used for tracing Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX @@ -58,16 +58,16 @@ 25/10/00 Original Condat(UK) BMI version. 20/02/02 Reinstated editor when in Chinese language by removing "if not Chinese" conditions SPR 1742 - + $End *******************************************************************************/ /******************************************************************************* - + Include Files - + *******************************************************************************/ #define ENTITY_MFW @@ -178,12 +178,12 @@ /******************************************************************************* - + Private Methods - + *******************************************************************************/ //#define TIME_TRACE_EVENT TRACE_EVENT -#ifndef TIME_TRACE_EVENT +#ifndef TIME_TRACE_EVENT #define TIME_TRACE_EVENT #endif @@ -192,14 +192,14 @@ $Function: bookSearchDialog $Description: dialog handler for the search window functionality - + $Returns: None $Arguments: win, window handle event, event to be handled value, not used parameter, not used - + *******************************************************************************/ void bookSearchDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter ) @@ -214,7 +214,7 @@ //x0066692 Date:23 April 2007 DR:OMAPS00121834, Asha //Fix for phone book search issue - when phonebook has more than 240 entries. UBYTE max_search_name; - + TRACE_FUNCTION( "bookSearchDialog()" ); switch( event ) @@ -231,7 +231,7 @@ update the portion of the list displayed*/ BOOL get_new_screen = FALSE; - + /* Scroll up */ if ( ( Current->index == 1 ) && ( Current->selectedName == 0 ) ) @@ -271,7 +271,7 @@ { /*MC SPR 1541, flag to show whether we've scrolled off-screen and need to update the portion of the list displayed*/ BOOL get_new_screen = FALSE; - + /* Scroll Down */ if ( ( Current->index + Current->selectedName ) == Current->status.used_entries ) @@ -310,7 +310,7 @@ strcpy(search_string,(char*)data->phbk->edt_buf_name); else strcpy(search_string,(char*)data->edtBuf); - + /* Find name */ Current->index = Current->index + Current->selectedName; @@ -320,8 +320,8 @@ //Fix is added to make cursor point to the correct entry in the phonebook. max_search_name = Current->status.used_entries - Current->index +1; if ( max_search_name > MAX_SEARCH_NAME ) - max_search_name = MAX_SEARCH_NAME; - + max_search_name = MAX_SEARCH_NAME; + if ( Current->index > ( Current->status.used_entries + 1 - max_search_name ) ) { if ( Current->status.used_entries > MAX_SEARCH_NAME ) @@ -337,13 +337,13 @@ /* go find the name */ - + bookFindName(MAX_SEARCH_NAME,&data->phbk->current); } else - { + { Current->selectedName =0; - + } /* update the menu */ @@ -354,7 +354,7 @@ Current->index = 1; Current->selectedName = 0; } - + /* update the menu */ /* SPR881 - SH - is necessary even when BookSearchName, above, fails */ @@ -370,7 +370,7 @@ break; case SEARCH_UPDATE: - { + { /* Update, actually an initialisation/reset phase */ Current->index = 1; @@ -391,7 +391,7 @@ /* SPR#1428 - SH - New Editor: Add this to allow redraw of * window on request. */ - + #ifdef NEW_EDITOR case SEARCH_REDRAW: /*SPR 2104, TRACE seems to fix timing probs :/ */ @@ -420,11 +420,11 @@ $Function: bookSearchWindowCB $Description: Window call back function - + $Returns: MFW_EVENT_CONSUMED, or MFW_EVENT_PASSED $Arguments: e, event, w, window handle - + *******************************************************************************/ static int bookSearchWindowCB( MfwEvt e, MfwWin *w ) @@ -436,7 +436,7 @@ char pchr2[PHB_MAX_LEN*2 +4];/*mc, SPR 1442*/ TRACE_FUNCTION( "bookSearchWindowCB()" ); - // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) + // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) // When FDN is disabled we need to display only ADN entries in the phonebook menu. // We just use the preset PHB_ADN as the current book. //if(data->phbk->current.status.book == PHB_ADN) @@ -471,13 +471,13 @@ for ( index = 0; index < MAX_SEARCH_NAME; index++ ) { TRACE_EVENT( "bookSearchWindowCB()-loopstart" ); - - pchr = (char *) MmiBookCallList( index ); - + + pchr = (char *) MmiBookCallList( index ); + memset( pchr, '\0', NAME_SCREEN_MAX ); /* SPR#1428 - SH - remove extraneous call to edtShow*/ - /*SPR 2123, using new macro PHONEBOOK_ITEM_LENGTH*/ + /*SPR 2123, using new macro PHONEBOOK_ITEM_LENGTH*/ #ifdef NO_ASCIIZ /*if current language chinese*/ if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) @@ -490,22 +490,22 @@ pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal - typecast done*/ pchr2[1]= 0x7f; /*SPR2175, use new function*/ - ATB_convert_String((char*)Current->entry[ index ].name.data, MFW_ASCII, + ATB_convert_String((char*)Current->entry[ index ].name.data, MFW_ASCII, (UBYTE)strlen((char*)Current->entry[ index ].name.data), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE); /*SPR 1442 and now truncate the string*/ resources_truncate_to_screen_width((char *) pchr2, Current->entry[ index ].name.len*2+2, pchr,PHONEBOOK_ITEM_LENGTH , SCREEN_SIZE_X, TRUE); } else /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ - { + { /*SPR 1442 truncate the string*/ resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, MAX_ALPHA_LEN, SCREEN_SIZE_X, TRUE); } } else /*we convert number string into unicode*/ { pchr2[0]= (char)0x80;/*SPR 1442, add unicode tag*//*a0393213 lint warnings removal-typecast done*/ - pchr2[1]= 0x7f; + pchr2[1]= 0x7f; /*SPR 2175, use new function*/ - ATB_convert_String((char*)Current->entry[ index ].number, MFW_ASCII, + ATB_convert_String((char*)Current->entry[ index ].number, MFW_ASCII, (UBYTE)strlen((char*)Current->entry[ index ].number), &pchr2[2], MFW_DCS_UCS2, PHONEBOOK_ITEM_LENGTH-2, FALSE); /*SPR 1442 and now truncate the string*/ resources_truncate_to_screen_width((char *) pchr2, strlen((char*)Current->entry[ index ].number)*2+2, pchr,PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, TRUE); @@ -513,33 +513,33 @@ } } - + else { /*if current language a latin language*/ /*SPR 2653, removed consitional compilation, this check applies whether we're in simulation mode or target hardware*/ // EF check for null pointer first if (!Current->list.entry == NULL) /*SPR 2104, don't need this test*/ - + if ( Current->entry[ index ].name.len NEQ 0&&Current->entry[ index ].name.data[0] != 0x80/*mc*/) //Should check to see if null name - { /*mc, SPR 1442, replaced old truncation function with new one*/ + { /*mc, SPR 1442, replaced old truncation function with new one*/ resources_truncate_to_screen_width((char *) Current->entry[index].name.data, Current->entry[index].name.len, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE); } else - {/*mc, SPR 1442, replaced old truncation function with new one*/ + {/*mc, SPR 1442, replaced old truncation function with new one*/ resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE); } #else if ( Current->entry[ index ].name[ 0 ] != NULL) //Should check to see if null name - { /*mc, SPR 1442, replaced old truncation function with new one*/ + { /*mc, SPR 1442, replaced old truncation function with new one*/ resources_truncate_to_screen_width((char *) Current->entry[index].name, 0, pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X, FALSE); } else - { /*mc, SPR 1442, replaced old truncation function with new one*/ + { /*mc, SPR 1442, replaced old truncation function with new one*/ resources_truncate_to_screen_width((char *) Current->entry[index].number, strlen((char*)Current->entry[index].number), pchr, PHONEBOOK_ITEM_LENGTH, SCREEN_SIZE_X,FALSE); } - /*SPR 2123 end*/ + /*SPR 2123 end*/ #endif #ifdef NO_ASCIIZ/*MC SPR 975, opening bracket only exists when NO_ASCIIZ defined*/ } @@ -547,8 +547,8 @@ } TRACE_EVENT( "bookSearchWindowCB()-end of loop" ); - mnuShow(data->menu); - /* SPR#1428 - SH - End of condition to check if we're in multi-tap */ + mnuShow(data->menu); + /* SPR#1428 - SH - End of condition to check if we're in multi-tap */ #ifdef NEW_EDITOR } #endif @@ -558,15 +558,15 @@ if ( ( data->phbk->fromSMS )|| ( data->phbk->fromSMSSC ) || /* SPR#1428 - SH - New event for service centre editor */ ( data->phbk->fromDivert ) || - ( data->phbk->fromDeflect )|| + ( data->phbk->fromDeflect )|| //CRR: 25302 - xpradipg 10 Nov 2004 //check if it was invoked from MMS/EMS ( data->phbk->fromMmsEms)|| ( Current->status.book == PHB_SDN ) ) { //displaySoftKeys( TxtSoftSelect, TxtSoftBack ); -// Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) -// when the editor is empty, we need to display BACK softkey +// Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) +// when the editor is empty, we need to display BACK softkey // Delete softkey is displayed when it contains some characters if (data->editor_attr.text.len==0) { @@ -580,8 +580,8 @@ else { //displaySoftKeys( TxtSoftOptions, TxtSoftBack ); -// Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) -// when the editor is empty, we need to display BACK softkey +// Jun 07, 2004 REF: CRR MMI-SPR-12818 Rashmi C N(Sasken) +// when the editor is empty, we need to display BACK softkey // Delete softkey is displayed when it contains some characters if (data->editor_attr.text.len==0) { @@ -624,11 +624,11 @@ $Function: bookSearchKbdCB $Description: Keyboard handler - + $Returns: MFW_EVENT_CONSUMED always $Arguments: e, event, k, key handle - + *******************************************************************************/ static int bookSearchKbdCB( MfwEvt e, MfwKbd *k ) @@ -651,7 +651,7 @@ /* Deal with the key and event combinatino */ - + switch( k->code ) { case KCD_MNUUP: @@ -672,7 +672,7 @@ } break; - + case KCD_CALL: if ( data->phbk->fromSMS ) @@ -723,11 +723,11 @@ { /* Send empty string so that ptr can be set 0*/ SEND_EVENT( data->phbk->parent_win, MMS_EMS_PHBK_NUMBER, PHBK_ID,"" ); bookPhonebookDestroy(data->phbk->win); - } + } /* Marcus (mk): Issue 1010: 2002-08-22: End */ else bookSearchDestroy(data->win); - + } break; @@ -748,13 +748,13 @@ bookPhonebookDestroy(data->phbk->win); } else if(data->phbk->fromDivert ) //MZ 26/02/01 check for divert If in Divert send event. - { + { SEND_EVENT( data->phbk->parent_win, DIVERT_PHBK_NUMBER, PHBK_ID /*MZ 28/2/01 */, (UBYTE *) Current->entry[ Current->selectedName ].number ); bookPhonebookDestroy(data->phbk->win); } else if(data->phbk->fromDeflect ) /*SPR 1392*/ - { + { TRACE_EVENT_P1("<< API deflection no. = %s", (char*) Current->entry[ Current->selectedName ].number); SEND_EVENT( data->phbk->parent_win, DEFLECT_PHBK_NUMBER, PHBK_ID, (UBYTE *) Current->entry[ Current->selectedName ].number ); @@ -778,8 +778,8 @@ data->phbk->menu_options_win = bookMenuStart( data->phbk->win, bookUPNMenuAttributes(),0); } break; - - /* JVJ #1743 Right key deletes search character*/ + + /* JVJ #1743 Right key deletes search character*/ #ifdef NEW_EDITOR case KCD_RIGHT: #else /* NEW_EDITOR */ @@ -788,7 +788,7 @@ { - + /* If we have any characters in the buffer, step back, otherwise destroy the window */ @@ -797,27 +797,27 @@ { // Oct 26, 2004 REF: CRR 25354 xkundadu -// Description: Phonebook: After entering precise name to search and then +// Description: Phonebook: After entering precise name to search and then // trying to delete using RSK, first character is not deleted. -// Fix: If only one character is present in the editor and delete key is +// Fix: If only one character is present in the editor and delete key is // pressed, delete the editor buffer and update the editor view. // Find out the length of the buffer. if(strlen((char*)data->edtBuf) == 1) { - //If only one character is present, delete and set the buffer + //If only one character is present, delete and set the buffer //to NULL. data->edtBuf[0] = '\0'; data->editor_attr.text.len = 0; //Move the cursor accordingly. ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); - data->editor->update = ED_UPDATE_TRIVIAL; + data->editor->update = ED_UPDATE_TRIVIAL; SEND_EVENT( data->win, SEARCH_STRING, 0, 0); //Update the window. winShow( data->win ); break; } - + /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR /* SPR#2174 - SH - If multitap is in progress, delete current character @@ -841,7 +841,7 @@ } else { - /*API - 12/08/03 - CQ11268 - Add this so the phonebbok is destoryed on right key press*/ + /*API - 12/08/03 - CQ11268 - Add this so the phonebbok is destoryed on right key press*/ if ( data->phbk->fromSMS ) { /* Send empty string so that ptr can be set 0*/ bookPhonebookDestroy(data->phbk->win); @@ -872,9 +872,9 @@ } } break; - + case KCD_HASH: - { + { { /* SPR#1428 - SH - New Editor changes */ @@ -884,7 +884,7 @@ edtChar( data->edt,ecBack ); #endif /* NEW_EDITOR */ } - + /*NM, p016 even updating when deleting characters */ @@ -895,7 +895,7 @@ default: { - + { /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR @@ -937,11 +937,11 @@ $Function: bookSearchKbdLongCB $Description: long keypress event handler, handles long clear event only - + $Returns: MFW_EVENT_CONSUMED always $Arguments: e, event, k, key handle - + *******************************************************************************/ static int bookSearchKbdLongCB( MfwEvt e, MfwKbd *k ) @@ -951,7 +951,7 @@ tBookStandard *data = (tBookStandard *) win_data->user; TRACE_FUNCTION ("bookSearchKbdLongCB()"); - + /* deal with the clear event */ if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) ) @@ -974,7 +974,7 @@ $Function: bookSearchTimCB $Description: Callback function for the Phonebook timer. - + $Returns: None $Arguments: window handle event, timer control block @@ -990,7 +990,7 @@ /* x0045876, 14-Aug-2006 (WR - "Current" was declared but never referenced) */ /* tMmiPhbData *Current = &data->phbk->current; */ TRACE_FUNCTION ("bookSearchTimCB()"); - + SEND_EVENT( data->win, SEARCH_STRING, 1, 0); winShow( data->win ); return MFW_EVENT_CONSUMED; @@ -1002,11 +1002,11 @@ $Function: bookSearchCreate $Description: Create the search window - + $Returns: handle of window or NULL if error $Arguments: parent, handle of parent window - + *******************************************************************************/ static T_MFW_HND bookSearchCreate( MfwHnd parent ) @@ -1060,7 +1060,7 @@ /* 1945 MZ Initialise the edtBuf */ memset(data->edtBuf,'\0', STANDARD_EDITOR_SIZE ); - + { /* SPR#1428 - SH - New Editor changes */ @@ -1072,9 +1072,9 @@ data->editor = ATB_edit_Create( &data->editor_attr, 0 ); data->entry_data = AUI_entry_Create(data->win, data->editor, SEARCH_REDRAW); /*SPR2233 end*/ - ATB_edit_Init(data->editor); + ATB_edit_Init(data->editor); #else /* NEW_EDITOR */ - bookSetEditAttributes(BOOKSEARCH_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, + bookSetEditAttributes(BOOKSEARCH_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, (char *) data->edtBuf, MAX_SEARCH_CHAR, &data->attr ); data->edt = edtCreate( data->win, &data->attr, 0, 0 ); #endif /* NEW_EDITOR */ @@ -1091,12 +1091,12 @@ return data->win; } - + /******************************************************************************* - + Public Methods - + *******************************************************************************/ @@ -1107,11 +1107,11 @@ $Function: bookSearchStart $Description: Starts the search window - + $Returns: handle of newly created window, or NULL if error $Arguments: parent, handle of parent window - + *******************************************************************************/ T_MFW_HND bookSearchStart( MfwHnd parent ) @@ -1190,11 +1190,11 @@ $Function: bookSearchDestroy $Description: Destroy the search window - + $Returns: None $Arguments: Window, handle of the window to be destroyed - + *******************************************************************************/ void bookSearchDestroy( MfwHnd window ) @@ -1253,13 +1253,13 @@ $Function: bookSearchName $Description: locate a requested name in the phone book - + $Returns: status of the findName routine $Arguments: pattern, to be searched for number, of elements to limit the search to current, pointer to a buffer to store the results - + *******************************************************************************/ UBYTE bookSearchName (char *pattern,UBYTE number,tMmiPhbData *current) @@ -1272,7 +1272,7 @@ // UBYTE len; // RAVI int i; UBYTE ret = (UBYTE)PHB_FAIL; - + TRACE_FUNCTION( "bookSearchName()" ); /* if using UPN phone book, return status of findname @@ -1291,7 +1291,7 @@ /* convert from GSM characters */ #ifdef NO_ASCIIZ - + memset( l_name.data, 0, PHB_MAX_LEN ); mfw_Gsm2SIMStr( MFW_DCS_7bits, (UBYTE *) pattern, PHB_MAX_LEN, l_name.data, &l_name.len ); #else @@ -1329,7 +1329,7 @@ current->selectedName = 0; bookFindName( MAX_SEARCH_NAME, current ); } - + /* check for match */ if ( ( current->list.num_entries < MAX_SEARCH_NAME ) @@ -1340,10 +1340,10 @@ ret = bookFindName( MAX_SEARCH_NAME, current ); } else - { + { for ( i = 0; i < number; i++ ) #ifdef NO_ASCIIZ -{ +{ /* convert from Sim to GSM and then copy to output buffer */ /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ @@ -1371,8 +1371,8 @@ /******************************************************************************* - + End of File - + *******************************************************************************/