FreeCalypso > hg > fc-tourmaline
changeset 173:0a0d54877239
mmiSmsRead.c: formatting fixes and dead code elimination
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 18 Jan 2021 03:46:02 +0000 |
parents | 44d6af34c75a |
children | 6838be2e9067 |
files | src/ui/bmi/mmiSmsRead.c |
diffstat | 1 files changed, 444 insertions(+), 562 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ui/bmi/mmiSmsRead.c Mon Jan 18 02:33:57 2021 +0000 +++ b/src/ui/bmi/mmiSmsRead.c Mon Jan 18 03:46:02 2021 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -11,12 +11,12 @@ $Project name: Basic MMI $Project code: BMI - $Module: SMS - $File: MmiSmsRead.c - $Revision: 1.0 - - $Author: Condat(UK) - $Date: 25/10/00 + $Module: SMS + $File: MmiSmsRead.c + $Revision: 1.0 + + $Author: Condat(UK) + $Date: 25/10/00 ******************************************************************************** @@ -49,13 +49,13 @@ Feb 07, 2006 DR: OMAPS00059261 x0pleela Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI Solution: smsread_r_exec_cb(): avoiding display of sender's address in header for status reports during listing - smsread_getstatustext():renamed txtreport to txtreport - Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed + smsread_getstatustext():renamed txtreport to txtreport + Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed Feb 01, 2006 DR: OMAPS00059261 x0pleela Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI Solution: Added a check for Status report to display a text "Report:Pending" during listing of this message - Made changes as per review comments + Made changes as per review comments Jan 30, 2006 DR: OMAPS00059261 x0pleela Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI @@ -80,33 +80,33 @@ Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar Issue description: BMI: using the tool nowSMS the voicemail indication via sms does not work Solution: Instead of identifying voice using addr[0] and pid, we use dcs. Also, messages belonging - to group "1100" are deleted when voicemail icon is displayed. + to group "1100" are deleted when voicemail icon is displayed. Feb 16, 2005 REF: CRR 28966 x0012851 Description: Editing or forwarding of large MT messages (>160 characters) - shouldn't be allowed when Concatenation is set to 'OFF' + shouldn't be allowed when Concatenation is set to 'OFF' Solution: If the 'ConcatenateStatus' flag is FALSE, the 'if' check condition - which allows the message to be edited or forwarded has been - modified for the same. + which allows the message to be edited or forwarded has been + modified for the same. Dec 15,2004 REF: CRR 24396 xkundadu Description: Phone crashes when a message is received while the - 'List Empty' dialog is displayed. + 'List Empty' dialog is displayed. Solution: NULL check is added for the list_win handle before calling - listsDestroy() when an MT sms is receieved. + listsDestroy() when an MT sms is receieved. Dec 01, 2004 REF: CRR 24225 xnkulkar Description: Reset when forwarding SMS Solution: The message content is sent excluding the date/time info from the - original message, which was causing the reset as the max limit (161) was crossed. + original message, which was causing the reset as the max limit (161) was crossed. Sep 08, 2004 REF: CRR 24393 Deepa M. D Bug:Phone crashes when user tries to reply to a saved message in the Inbox Fix:The reply and Callnumber Option has been removed for the saved message. - 25/10/00 Original Condat(UK) BMI version. - 14/10/00 SPR 1257 - merged in issue 888 from b-sample line (extract - number from SMS improvements) and made changes to accommodate - Unicode SMSs containing numbers. + 25/10/00 Original Condat(UK) BMI version. + 14/10/00 SPR 1257 - merged in issue 888 from b-sample line (extract + number from SMS improvements) and made changes to accommodate + Unicode SMSs containing numbers. May 03, 2004 REF: CRR 13845 Deepa M The Forward menuitem added. $End @@ -238,7 +238,7 @@ extern UBYTE reply_path_bit; /********************************************************************* - DYNAMIC MENU WINDOW. DECLARATION + DYNAMIC MENU WINDOW. DECLARATION **********************************************************************/ @@ -300,12 +300,12 @@ T_MFW_HND sms_handle; /* MFW sms handler */ /* internal data */ - T_SMS_LIST_DATA sms_list_data; - T_SMS_EDITOR_DATA sms_editor_data; - ListMenuData *menu_list_data; - /*SPR 2686, removed unused data field*/ - + T_SMS_LIST_DATA sms_list_data; + T_SMS_EDITOR_DATA sms_editor_data; + ListMenuData *menu_list_data; + /*SPR 2686, removed unused data field*/ } T_SMSREAD_R; + T_SMSREAD_R* getUserData_T_SMSREAD_R( T_MFW_WIN *win) { if (win == NULL) @@ -326,9 +326,8 @@ /* associated handlers */ - /* internal data */ - T_SMS_EDITOR_DATA *sms_editor_data; + T_SMS_EDITOR_DATA *sms_editor_data; /*SPR 2686, removed unused data field*/ } T_SMSREAD_R_TEXTEDT2; @@ -340,7 +339,6 @@ } - typedef struct { /* administrative data */ @@ -362,12 +360,13 @@ /* !!! **************************************** modify here **************************************** !!!*/ /*SPR 2686, removed unused data field*/ - T_MFW_HND sms; + T_MFW_HND sms; T_MFW_HND dialog_win; /* !!! **************************************** end modify here **************************************** !!! */ - T_SMS_EDITOR_DATA *sms_editor_data; //NM 25.8 + T_SMS_EDITOR_DATA *sms_editor_data; //NM 25.8 } T_SMSREAD_R_OPT; + T_SMSREAD_R_OPT* getUserData_T_SMSREAD_R_OPT( T_MFW_WIN *win) { if (win == NULL) @@ -376,9 +375,6 @@ } - - - static enum { READ_SMS_LIST, @@ -402,11 +398,10 @@ (U8)-1, /* use default font */ NULL, /* with these items */ 0, /* number of items */ - COLOUR_LIST_SMS, - TxtMessages, - NULL, - MNUATTRSPARE - + COLOUR_LIST_SMS, + TxtMessages, + NULL, + MNUATTRSPARE }; //Mar 28, 2006 DR:OMAPS00047813 x0035544 @@ -415,15 +410,13 @@ { &menuArea, MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ - (U8)-1, /* use default font */ - NULL, /* with these items (filled in later) */ - 0, /* number of items (filled in leter) - -*/ - COLOUR_LIST_XX, /* Colour */ - TxtExtractNumber, /* Hdr Id */ - NULL, /* Background */ - MNUATTRSPARE /* unused */ + (U8)-1, /* use default font */ + NULL, /* with these items (filled in later) */ + 0, /* number of items (filled in later) */ + COLOUR_LIST_XX, /* Colour */ + TxtExtractNumber, /* Hdr Id */ + NULL, /* Background */ + MNUATTRSPARE /* unused */ }; @@ -433,11 +426,11 @@ static int search_index; /* SPR888 - SH - keeps track of position within SMS for extract number */ -static T_MFW_HND info_win=0; -static T_MFW_HND deleting_win = 0; -static T_MFW_HND list_win=0; -static T_MFW_HND sms_read_win = 0;/*MC 1991 main SMS read window*/ -static T_MFW_HND message_win = 0; /*MC 2132, individual message display win*/ +static T_MFW_HND info_win=0; +static T_MFW_HND deleting_win = 0; +static T_MFW_HND list_win=0; +static T_MFW_HND sms_read_win = 0;/*MC 1991 main SMS read window*/ +static T_MFW_HND message_win = 0; /*MC 2132, individual message display win*/ static T_MFW_HND option_mnu_win = 0;/*MC 2132, options menu window*/ static char sms_text_ascii[MAX_EDITOR_LEN]; @@ -450,7 +443,7 @@ to show it when we are editing. */ static UBYTE read_status; -static USHORT current_sms_len= 0; +static USHORT current_sms_len = 0; // Dec 15,2004 REF: CRR 24396 xkundadu // Description: Phone crashes when a message is received while the @@ -525,7 +518,6 @@ static void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData); - static BOOL Search_forNextNumber(T_SmsUserData *UserData); //Mar 27, 2006 DR:OMAPS00047813 x0035544 static void SmsRead_numlist_destroy(MfwHnd own_window); @@ -555,7 +547,7 @@ &SmsRead_R_OPTArea, MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ (U8)-1, /* use default font */ - (MfwMnuItem*) SmsRead_R_OPTItems, /* with these items */ + (MfwMnuItem*) SmsRead_R_OPTItems, /* with these items */ sizeof(SmsRead_R_OPTItems)/sizeof(MfwMnuItem) /* number of items */ }; @@ -565,9 +557,8 @@ { {0,0,0,(char *)TxtDelete,0,(MenuFunc)SmsRead_R_OPTExeDelete,item_flag_none}, {0,0,0,(char *)TxtEdit,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, - {0,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, + {0,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, {0,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none}, - }; //Sep 08, 2004 REF: CRR 24393 Deepa M. D @@ -577,20 +568,19 @@ &SmsRead_R_OPTArea, MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ (U8)-1, /* use default font */ - (MfwMnuItem*) SmsRead_R_Unsent_OPTItems, /* with these items */ - sizeof(SmsRead_R_Unsent_OPTItems)/sizeof(MfwMnuItem) /* number of items */ + (MfwMnuItem*) SmsRead_R_Unsent_OPTItems, /* with these items */ + sizeof(SmsRead_R_Unsent_OPTItems)/sizeof(MfwMnuItem) /* number of items */ }; - /******************************************************************************* $Function: charPtrToUBYTEPtr $Description: Converts a char ptr to a UBYTE ptr. The procedures can be replaced by macro - once all conversions are confirmed as valid. - - $Returns: data set to new type + once all conversions are confirmed as valid. + + $Returns: data set to new type $Arguments: data -data item of input type. @@ -609,12 +599,12 @@ USHORT* charPtrToUSHORTPtr (char* data) { return((USHORT*)data); } #else -#define charToUBYTE (UBYTE) +#define charToUBYTE (UBYTE) #define charPtrToUBYTEPtr (UBYTE*) #define SHORTToUBYTE (UBYTE) #define UBYTEPtrToCharPtr (char*) -#define UBYTEToChar (char) +#define UBYTEToChar (char) #define USHORTPtrToCharPtr (char*) #define charToUSHORT (USHORT) @@ -631,28 +621,28 @@ $Description: Start the creation of the main window for SMS reading - $Returns: mfw window handler + $Returns: mfw window handler $Arguments: parent_window - Parent window handler - menuAttr - Menu attributes. + menuAttr - Menu attributes. *******************************************************************************/ T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) { - TRACE_EVENT_P1("sms_read_win:%d", sms_read_win); + TRACE_EVENT_P1("sms_read_win:%d", sms_read_win); /*SPR2132, if the list window already exists, destroy it before creating a new one*/ - if (sms_read_win != NULL) - SmsRead_R_destroy(sms_read_win); + if (sms_read_win != NULL) + SmsRead_R_destroy(sms_read_win); TRACE_FUNCTION ("SmsRead_R_start()"); - /*SPR 1991 use ssms_read_win rather than a local var*/ + /*SPR 1991 use ssms_read_win rather than a local var*/ sms_read_win = SmsRead_R_create (parent_window); if (sms_read_win NEQ NULL) - { - /* We transmit to the SMS editor the address of the data buffer */ - SEND_EVENT (sms_read_win, E_INIT, SmsRead_R_ID, (void *)menuAttr); - } + { + /* We transmit to the SMS editor the address of the data buffer */ + SEND_EVENT (sms_read_win, E_INIT, SmsRead_R_ID, (void *)menuAttr); + } return sms_read_win; } @@ -662,7 +652,7 @@ $Description: create the SMS read window (dynamic list of all the SMS) - $Returns: mfw window handler + $Returns: mfw window handler $Arguments: parent_window - Parent window handler @@ -679,21 +669,22 @@ */ data->win = - win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_win_cb); + win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_win_cb); + if (data->win EQ NULL) - { - return NULL; - } + { + return NULL; + } + /* * connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_exec_cb; data->mmi_control.data = data; win = getWinData(data->win); win->user = (void *)data; data->parent = parent_window; - winShow(data->win); + winShow(data->win); /* * return window handle @@ -708,7 +699,7 @@ $Description: Destroy the SMS read window (dynamic list of all the SMS) - $Returns: none + $Returns: none $Arguments: own_window - window handler @@ -718,83 +709,77 @@ { T_MFW_WIN * win_data; T_SMSREAD_R * data; - USHORT i; - + USHORT i; TRACE_FUNCTION ("SmsRead_R_destroy()"); if (own_window) + { + win_data = getWinData(own_window); //((T_MFW_HDR *))->data; + data = getUserData_T_SMSREAD_R(win_data); + if (data) { - win_data = getWinData(own_window); //((T_MFW_HDR *))->data; - data = getUserData_T_SMSREAD_R(win_data); - if (data) + /* + * Delete WIN handler + */ + sms_delete(data->sms_handle); + + /*SPR 2132, if the message options menu or the messaeg display screen exist, + destroy them */ + if (option_mnu_win) + { + SmsRead_R_OPT_destroy(option_mnu_win); + } + if (message_win) + { + SmsRead_R_TEXTEDT2_destroy(message_win); + message_win = 0; + } + /*SPR 2132 end*/ + + if (info_win) + { + SEND_EVENT(info_win,DIALOG_DESTROY,0,0 ); + info_win = 0; + } + if (list_win) + { + SEND_EVENT(list_win/*SPR1991*/,E_LIST_DESTROY/*SPR 2132*/,0,0 ); + list_win = 0; + } + win_delete (data->win); + + /* + * Free Memory + */ + + /* Free the data allocated for the name associated to the phone number */ + if (data->sms_editor_data.assoc_name != NULL) + FREE_MEMORY( (void *)data->sms_editor_data.assoc_name, strlen(data->sms_editor_data.assoc_name) + 1); + + /* Free the data allocated for the dynamic list */ + if (data->menu_list_data != NULL) + { + for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) { - /* - * Delete WIN handler - */ - sms_delete(data->sms_handle); - - - /*SPR 2132, if the message options menu or the messaeg display screen exist, - destroy them */ - if (option_mnu_win) - { - SmsRead_R_OPT_destroy(option_mnu_win); - - } - if (message_win) - { - SmsRead_R_TEXTEDT2_destroy(message_win); - message_win = 0; - } - /*SPR 2132 end*/ - - if (info_win) - { - SEND_EVENT(info_win,DIALOG_DESTROY,0,0 ); - info_win = 0; - } - if (list_win){ - - SEND_EVENT(list_win/*SPR1991*/,E_LIST_DESTROY/*SPR 2132*/,0,0 ); - list_win = 0; - } - win_delete (data->win); - { - - } - - /* - * Free Memory - */ - - /* Free the data allocated for the name associated to the phone number */ - if (data->sms_editor_data.assoc_name != NULL) - FREE_MEMORY( (void *)data->sms_editor_data.assoc_name, strlen(data->sms_editor_data.assoc_name) + 1); - - /* Free the data allocated for the dynamic list */ - if (data->menu_list_data != NULL) - { - for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) - { - FREE_MEMORY( (void *)data->sms_list_data.sms_header[i], UCS2_MENU_TEXT_LEN+ 1/*SPR1242*/); - } - /*SPR 2686, only de-allocate memory for the number of messages displayed*/ - FREE_MEMORY ((void *)data->menu_list_data->List,((data->sms_list_data).nb_sms_stored) * sizeof(T_MFW_MNU_ITEM)); - FREE_MEMORY ((UBYTE *)data->menu_list_data, sizeof(ListMenuData)); - } + FREE_MEMORY( (void *)data->sms_list_data.sms_header[i], UCS2_MENU_TEXT_LEN+ 1/*SPR1242*/); + } + /*SPR 2686, only de-allocate memory for the number of messages displayed*/ + FREE_MEMORY ((void *)data->menu_list_data->List,((data->sms_list_data).nb_sms_stored) * sizeof(T_MFW_MNU_ITEM)); + FREE_MEMORY ((UBYTE *)data->menu_list_data, sizeof(ListMenuData)); + } #ifdef FF_MMI_SMS_DYNAMIC - FREE_MEMORY((void*)data->sms_list_data.sms_messages,g_max_messages * sizeof(T_MFW_SMS_MSG) ); - FREE_MEMORY((void*)data->sms_list_data.sms_header, g_max_messages * sizeof(wstring_t)); + FREE_MEMORY((void*)data->sms_list_data.sms_messages,g_max_messages * sizeof(T_MFW_SMS_MSG) ); + FREE_MEMORY((void*)data->sms_list_data.sms_header, g_max_messages * sizeof(wstring_t)); #endif - FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R)); - sms_read_win = 0; - } - else - { - TRACE_EVENT ("SmsRead_R_destroy() called twice"); - } + FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R)); + sms_read_win = 0; } + else + { + TRACE_EVENT ("SmsRead_R_destroy() called twice"); + } + } } /******************************************************************************* @@ -802,13 +787,13 @@ $Function: SmsRead_R_exec_cb $Description: Exec callback function of the SMS read window (dynamic list of - all the SMS) - - $Returns: none + all the SMS) + + $Returns: none $Arguments: win - window handler - event - mfw event - parameter - optional data. + event - mfw event + parameter - optional data. *******************************************************************************/ void SmsRead_R_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) @@ -817,20 +802,20 @@ T_MFW_WIN * win_data; T_SMSREAD_R * data; T_SMS_LIST_DATA * list_data; - T_MFW_EVENT MfwEvents; - - T_MFW_SMS_STAT sms_list_type = *(T_MFW_SMS_STAT *)parameter; - - T_MFW_HND l_parent; - T_DISPLAY_DATA DisplayInfo; - // Status of SMS reading - - /* x0045876, 14-Aug-2006 (WR - "status" & "i" was declared but never referenced)*/ - /* T_MFW status; */ - /* int i;*/ - - win_data = getWinData(win); //((T_MFW_HDR *))->data; - data = getUserData_T_SMSREAD_R(win_data); + T_MFW_EVENT MfwEvents; + + T_MFW_SMS_STAT sms_list_type = *(T_MFW_SMS_STAT *)parameter; + + T_MFW_HND l_parent; + T_DISPLAY_DATA DisplayInfo; + // Status of SMS reading + + /* x0045876, 14-Aug-2006 (WR - "status" & "i" was declared but never referenced)*/ + /* T_MFW status; */ + /* int i;*/ + + win_data = getWinData(win); //((T_MFW_HDR *))->data; + data = getUserData_T_SMSREAD_R(win_data); list_data = &data->sms_list_data; TRACE_FUNCTION ("SmsRead_R_exec_cb()"); @@ -1040,12 +1025,12 @@ $Function: SmsRead_R_win_cb $Description: Window callback function of the SMS read window (dynamic list of - all the SMS) - - $Returns: none + all the SMS) + + $Returns: none $Arguments: w - mfw window handler - e - mfw event + e - mfw event *******************************************************************************/ @@ -1070,10 +1055,10 @@ $Description: Function to copy status string into array provided. - $Returns: number of characters used in the output array. + $Returns: number of characters used in the output array. $Arguments: op_text_str - pointer to array to store the string - status - read status of text message. + status - read status of text message. $History SPR#780-GW-Created to allow consistent display of status in text message list @@ -1154,12 +1139,12 @@ $Function: SmsRead_R_mfw_cb $Description: MFW callback function of the SMS read window (dynamic list of all the SMS). - Only interesting events for reading are handled here - - $Returns: event status + Only interesting events for reading are handled here + + $Returns: event status $Arguments: parameter - optional data - event - mfw event + event - mfw event *******************************************************************************/ int SmsRead_R_mfw_cb(MfwEvt event, void *parameter) @@ -1182,8 +1167,6 @@ T_MFW_SMS_IDX msg_info; - - T_DISPLAY_DATA DisplayInfo; /* x0045876, 14-Aug-2006 (WR - "sms_len" & "sms_text" was declared but never referenced)*/ @@ -1191,7 +1174,6 @@ /* char *sms_text; */ // int i; // RAVI - win_data = getWinData(win); data = getUserData_T_SMSREAD_R(win_data); @@ -1287,7 +1269,6 @@ } - /* just in case */ if (g_sms_list_counter >= 0) { @@ -1540,7 +1521,7 @@ $Description: set up a timer to re-read sms at passed index in 100ms - $Returns: none + $Returns: none $Arguments: index of sms to be re-read @@ -1560,7 +1541,7 @@ $Description: Callback function for retry SMS read timer - $Returns: status int + $Returns: status int $Arguments: event, timer data structure @@ -1583,25 +1564,21 @@ $Description: Callback function for the dynamic list of the SMS read window. - $Returns: none + $Returns: none $Arguments: Parent - window handler - ListData - Menu list data. + ListData - Menu list data. *******************************************************************************/ void SmsRead_R_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData) { - - - T_MFW_WIN * win_data; T_SMSREAD_R * data; // T_MFW_HND * l_parent; // RAVI // SHORT l_id; // RAVI - TRACE_FUNCTION("SmsRead_R_smslist_cb "); win_data = getWinData(Parent); @@ -1711,13 +1688,13 @@ $Function: SmsRead_R_dialog_cb $Description: Dialog callback function of the SMS read window (dynamic list of all the SMS) - Case where SMS has not been initialized yet - - $Returns: status + Case where SMS has not been initialized yet + + $Returns: status $Arguments: win - current window handler - Identifier - window id - Reason - Event cause. + Identifier - window id + Reason - Event cause. *******************************************************************************/ @@ -1725,11 +1702,11 @@ { T_MFW_WIN * win_data; T_SMSREAD_R * data; - T_MFW_HND *lparent; - - win_data = getWinData(win); - data = getUserData_T_SMSREAD_R(win_data); - lparent = data->parent; + T_MFW_HND *lparent; + + win_data = getWinData(win); + data = getUserData_T_SMSREAD_R(win_data); + lparent = data->parent; TRACE_FUNCTION ("SmsRead_dialog_cb()"); @@ -1761,7 +1738,7 @@ $Description: Build the list of SMS for the dynamic list. - $Returns: status + $Returns: status $Arguments: win - current window handler @@ -1769,7 +1746,6 @@ void SmsRead_R_BuildList(T_MFW_HND win, int inUnicode) { - T_MFW_WIN * win_data; T_SMSREAD_R * data; @@ -1797,7 +1773,6 @@ return; } - for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) { mnuInitDataItem(&data->menu_list_data->List[i]); @@ -1833,14 +1808,13 @@ } - /******************************************************************************* $Function: SmsRead_R_OPTExeDelete $Description: Called when the user press Delete in the Option menu - $Returns: event status. + $Returns: event status. $Arguments: m - pointer to menu. i - index if selected menu item. @@ -1848,7 +1822,7 @@ static int SmsRead_R_OPTExeDelete(MfwMnu* m, MfwMnuItem* item) { - T_MFW_HND win = mfwParent(mfw_header()); + T_MFW_HND win = mfwParent(mfw_header()); T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; @@ -1937,27 +1911,25 @@ $Description: Called when the user press Reply in the Option menu - $Returns: event status. + $Returns: event status. $Arguments: m - pointer to menu. - i - index if selected menu item. + i - index if selected menu item. *******************************************************************************/ static int SmsRead_R_OPTExeReply(MfwMnu* m, MfwMnuItem* i) { - T_MFW_HND win = mfwParent(mfw_header()); T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; - T_MFW_HDR * parent = data->parent; + T_MFW_HDR * parent = data->parent; T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; // March 2, 2005 REF: CRR 11536 x0018858 // T_MFW_SMS_INFO sms_parameter;//Added for retreiving the Reply path. // RAVI - TRACE_FUNCTION("SmsRead_R_OPTExeReply"); /* Copy the number and name information to the SMS buffer @@ -2023,9 +1995,6 @@ so use pointer saved from above */ SmsSend_SEND_start(win, (void *) &SmsData); - - - return 1; } @@ -2035,10 +2004,10 @@ $Description: Called when the user press Store Number in the Option menu - $Returns: event status. + $Returns: event status. $Arguments: m - pointer to menu. - i - index if selected menu item. + i - index if selected menu item. *******************************************************************************/ static int SmsRead_R_OPTExeStoreNumber(MfwMnu* m, MfwMnuItem* i) { @@ -2046,13 +2015,13 @@ T_MFW_HND win2; //Mar 27, 2006 DR:OMAPS00047813 x0035544 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; - T_MFW_HDR * parent = data->parent; + T_MFW_HDR * parent = data->parent; T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; - // UBYTE found_name; /*SPR888 -SH*/ // RAVI - //Mar 27, 2006 DR:OMAPS00047813 x0035544 - CHAR number[MFW_NUM_LEN]; - T_MFW_PHB_TON ton; + // UBYTE found_name; /*SPR888 -SH*/ // RAVI + //Mar 27, 2006 DR:OMAPS00047813 x0035544 + CHAR number[MFW_NUM_LEN]; + T_MFW_PHB_TON ton; TRACE_FUNCTION("SmsRead_R_OPTExeStoreNumber"); @@ -2137,7 +2106,6 @@ SEND_EVENT (win2, E_INIT, 0, 0); } - return 1; } @@ -2147,10 +2115,10 @@ $Description: Called when the user press Forward in the Option menu - $Returns: event status. + $Returns: event status. $Arguments: m - pointer to menu. - i - index if selected menu item. + i - index if selected menu item. *******************************************************************************/ static int SmsRead_R_OPTExeEdit(MfwMnu* m, MfwMnuItem* i) @@ -2290,26 +2258,26 @@ $Function: SmsRead_R_READSMS_OPT_start $Description: Start the creation of the Option Window from the Read SMS - Text window. - - $Returns: mfw window handler + Text window. + + $Returns: mfw window handler $Arguments: parent_window- pointer to menu. - menuAttr - menu attributes. + menuAttr - menu attributes. *******************************************************************************/ T_MFW_HND SmsRead_R_READSMS_OPT_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) { - /*SPR 2132, setting global var to keep track of options window*/ + /*SPR 2132, setting global var to keep track of options window*/ TRACE_FUNCTION ("SmsRead_R_OPT_start()"); option_mnu_win = SmsRead_R_OPT_create (parent_window); if (option_mnu_win NEQ NULL) - { - SEND_EVENT (option_mnu_win , E_INIT, SmsRead_R_READSMS_OPT_ID, (void *)menuAttr); - } + { + SEND_EVENT (option_mnu_win , E_INIT, SmsRead_R_READSMS_OPT_ID, (void *)menuAttr); + } return option_mnu_win; } @@ -2320,7 +2288,7 @@ $Description: Create the Options window - $Returns: window handler + $Returns: window handler $Arguments: parent_window- pointer to parent window *******************************************************************************/ @@ -2339,13 +2307,13 @@ data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_OPT_win_cb); if (data->win EQ NULL) - { - return NULL; - } + { + return NULL; + } + /* * connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_OPT_exec_cb; data->mmi_control.data = data; win = ((T_MFW_HDR *)data->win)->data; @@ -2365,7 +2333,7 @@ $Description: Destroy the Option window - $Returns: none + $Returns: none $Arguments: own_window- current window *******************************************************************************/ @@ -2378,28 +2346,28 @@ TRACE_FUNCTION ("SmsRead_R_OPT_destroy()"); if (own_window) + { + win_data = ((T_MFW_HDR *)own_window)->data; + data = (T_SMSREAD_R_OPT *)win_data->user; + + if (data) { - win_data = ((T_MFW_HDR *)own_window)->data; - data = (T_SMSREAD_R_OPT *)win_data->user; - - if (data) - { - /* - * Delete WIN handler - */ - win_delete (data->win); - - /* - * Free Memory - */ - FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_OPT)); - option_mnu_win =0;/*SPR2132, make sure window pointer is reset*/ - } - else - { - TRACE_EVENT ("SmsRead_R_OPT_destroy() called twice"); - } + /* + * Delete WIN handler + */ + win_delete (data->win); + + /* + * Free Memory + */ + FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_OPT)); + option_mnu_win =0;/*SPR2132, make sure window pointer is reset*/ } + else + { + TRACE_EVENT ("SmsRead_R_OPT_destroy() called twice"); + } + } } /******************************************************************************* @@ -2408,12 +2376,12 @@ $Description: Exec callback function for the Option window - $Returns: none + $Returns: none $Arguments: win- current window - event - window event Id - value - unique Id - parameter- optional data. + event - window event Id + value - unique Id + parameter- optional data. *******************************************************************************/ void SmsRead_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) @@ -2424,11 +2392,10 @@ T_MFW_HND * l_parent = NULL; // RAVI SHORT l_id = 0; // RAVI - T_MFW_EVENT MfwEvents; + T_MFW_EVENT MfwEvents; TRACE_FUNCTION ("SmsRead_R_OPT_exec_cb()"); - switch (event) { case E_INIT: @@ -2508,10 +2475,10 @@ $Description: Exec callback function for the DEL_ALL_ACK window - $Returns: status + $Returns: status $Arguments: event - window event Id - parameter- optional data. + parameter- optional data. *******************************************************************************/ int SmsRead_R_OPT_mfw_cb (MfwEvt event, void *parameter) @@ -2521,7 +2488,6 @@ T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; // T_MFW_EVENT MfwEvents; // RAVI - TRACE_FUNCTION ("SmsRead_R_OPT_mfw_cb()"); switch (event) @@ -2556,10 +2522,10 @@ $Description: Menu callback function for the Option window - $Returns: status + $Returns: status $Arguments: e - mfw event Id - m - menu handle + m - menu handle *******************************************************************************/ static int SmsRead_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m) @@ -2597,10 +2563,10 @@ $Description: Window callback function for the Option window - $Returns: status + $Returns: status $Arguments: e - mfw event Id - w - window handler + w - window handler *******************************************************************************/ static int SmsRead_R_OPT_win_cb (MfwEvt e, MfwWin *w) @@ -2627,10 +2593,10 @@ $Description: Exec callback function for the Option window - $Returns: status + $Returns: status $Arguments: e - keyboard event Id - k - keyboard data + k - keyboard data *******************************************************************************/ static int SmsRead_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k) @@ -2685,25 +2651,25 @@ $Function: SmsRead_R_OPT_dialog_cb $Description: Dialog callback function of the SMS read window (dynamic list - of all the SMS). Case where SMS has not been initialized yet. - - $Returns: status + of all the SMS). Case where SMS has not been initialized yet. + + $Returns: status $Arguments: win - window handler. - Identifier - unique identifier. - Reason - cause of event. + Identifier - unique identifier. + Reason - cause of event. *******************************************************************************/ int SmsRead_R_OPT_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; - T_MFW_HND *lparent = data->parent; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; + T_MFW_HND *lparent = data->parent; TRACE_FUNCTION ("SmsRead_dialog_cb()"); - switch (Reason) - { + switch (Reason) + { case INFO_TIMEOUT: case INFO_KCD_HUP: // Commit suicide @@ -2714,7 +2680,7 @@ default: return MFW_EVENT_REJECTED; - } + } } /******************************************************************************* @@ -2723,11 +2689,11 @@ $Description: Display a standard dialog with no soft key and 3 seconds of display - $Returns: none + $Returns: none $Arguments: win - window handler. - text - text string. - duration - seconds + text - text string. + duration - seconds *******************************************************************************/ void SmsRead_DisplayStandardDialog(T_MFW_HND win, int TextId, ULONG duration) @@ -2736,7 +2702,7 @@ SmsMenu_loadDialogDefault(&DisplayInfo); - DisplayInfo.TextId = TextId; + DisplayInfo.TextId = TextId; DisplayInfo.Time = duration; DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb; @@ -2746,7 +2712,7 @@ // set the variable to TRUE since 'List empty' dialog is going to display. SmsListEmptyDlgPresent = TRUE; - info_dialog(win, &DisplayInfo); + info_dialog(win, &DisplayInfo); } /******************************************************************************* @@ -2755,26 +2721,26 @@ $Description: Display a standard dialog with no soft key and 3 seconds of display - $Returns: none + $Returns: none $Arguments: win - window handler. - text - text string. - duration - seconds + text - text string. + duration - seconds *******************************************************************************/ void SmsRead_R_OPT_StandardDialog(T_MFW_HND win, char *text, ULONG duration) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; - - T_DISPLAY_DATA DisplayInfo; - - SmsMenu_loadDialogDefault(&DisplayInfo); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; + + T_DISPLAY_DATA DisplayInfo; + + SmsMenu_loadDialogDefault(&DisplayInfo); DisplayInfo.TextId = 0; - DisplayInfo.Time = duration; + DisplayInfo.Time = duration; DisplayInfo.TextString = text; - DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_OPT_dialog_cb; //TBD + DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_OPT_dialog_cb; //TBD data->dialog_win = info_dialog(win, &DisplayInfo); } @@ -2789,11 +2755,11 @@ $Description: - $Returns: none + $Returns: none $Arguments: strDestination - destination string - strSource - source string - count -number of character. + strSource - source string + count -number of character. *******************************************************************************/ void string_CopyW2W(wstring_t *strDestination, charw_t *strSource, USHORT count ) @@ -2812,26 +2778,26 @@ $Function: SmsRead_R_TEXTEDT2_start $Description: Start the creation of the SMS editor window (display of the text - of one SMS) - - $Returns: win - window handler. + of one SMS) + + $Returns: win - window handler. $Arguments: parent_window - current window handler - data - Menu attributes. + data - Menu attributes. *******************************************************************************/ T_MFW_HND SmsRead_R_TEXTEDT2_start(T_MFW_HND parent_window, MfwMnuAttr *data) { - /*SPR 2132, use global var*/ + /*SPR 2132, use global var*/ TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_start()"); message_win = SmsRead_R_TEXTEDT2_create (parent_window); if (message_win NEQ NULL) - { - SEND_EVENT (message_win, E_INIT, SmsRead_R_TEXTEDT2_ID, (void *)data); - } + { + SEND_EVENT (message_win, E_INIT, SmsRead_R_TEXTEDT2_ID, (void *)data); + } return message_win; } @@ -2841,7 +2807,7 @@ $Description: Create the SMS editor window (display of the text of one SMS) - $Returns: window handler. + $Returns: window handler. $Arguments: parent_window - current window handler @@ -2861,13 +2827,13 @@ data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_TEXTEDT2_win_cb); if (data->win EQ NULL) - { - return NULL; - } + { + return NULL; + } + /* * connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_TEXTEDT2_exec_cb; data->mmi_control.data = data; win = ((T_MFW_HDR *)data->win)->data; @@ -2877,7 +2843,7 @@ /* * return window handle */ - winShow(data->win); + winShow(data->win); return data->win; } @@ -2887,7 +2853,7 @@ $Description: Destroy the SMS editor window (display of the text of one SMS) - $Returns: none + $Returns: none $Arguments: own_window - current window handler @@ -2903,38 +2869,36 @@ TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); if (own_window) + { + win_data = ((T_MFW_HDR *)own_window)->data; + data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; + + if (data) { - win_data = ((T_MFW_HDR *)own_window)->data; - data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; - - if (data) - { - /* - * Delete WIN handler - */ - - /* SPR#1428 - SH - New Editor changes */ + /* + * Delete WIN handler + */ + + /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR - AUI_edit_Destroy(data->editor_win); + AUI_edit_Destroy(data->editor_win); #else /* NEW_EDITOR */ - editor_destroy(data->editor_win); + editor_destroy(data->editor_win); #endif /* NEW_EDITOR */ - win_delete (data->win); - - - - FREE_MEMORY ((void *)data->sms_editor_data->sms_info, sizeof (T_MFW_SMS_PARA)); - - FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_TEXTEDT2)); - - message_win = 0; /*SPR2132, make sure window pointer is reset*/ - } - else - { - TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); - } + win_delete (data->win); + + FREE_MEMORY ((void *)data->sms_editor_data->sms_info, sizeof (T_MFW_SMS_PARA)); + + FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_TEXTEDT2)); + + message_win = 0; /*SPR2132, make sure window pointer is reset*/ } + else + { + TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); + } + } } /******************************************************************************* @@ -2943,11 +2907,11 @@ $Description: Callback function for the text editor - $Returns: none + $Returns: none $Arguments: win - current window handler - Identifier -Unique identifier. - reason - event + Identifier -Unique identifier. + reason - event *******************************************************************************/ static void SmsRead_R_TEXT_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) @@ -2967,7 +2931,6 @@ // T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL; // RAVI - TRACE_FUNCTION ("SmsRead_R_TEXT_editor_cb()"); switch (reason) @@ -3038,7 +3001,6 @@ callNumber(pb_data.number); break; - default: TRACE_EVENT("Err: Default No match found"); break; @@ -3050,14 +3012,14 @@ $Function: SmsRead_R_TEXTEDT2_exec_cb $Description: Exec callback function of the SMS editor window (display of the - text of one SMS) - - $Returns: none + text of one SMS) + + $Returns: none $Arguments: win - current window handler - event - event id - value - unique id - parameter - optional data. + event - event id + value - unique id + parameter - optional data. *******************************************************************************/ void SmsRead_R_TEXTEDT2_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) @@ -3599,14 +3561,14 @@ $Function: SmsRead_R_TEXTEDT2_win_cb $Description: Window callback function of the SMS editor window (display of - the text of one SMS). - - $Returns: execution status + the text of one SMS). + + $Returns: execution status $Arguments: w - mfw window handle - e - event id - value - unique id - parameter - optional data. + e - event id + value - unique id + parameter - optional data. *******************************************************************************/ static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w) @@ -3626,51 +3588,20 @@ } return MFW_EVENT_CONSUMED; } -#if(0) /* x0039928 - Lint warning fix */ -/******************************************************************************* - - $Function: SmsRead_R_TEXTEDT2_smslist_cb - - $Description: Callback function of the SMS editor window (editor itself). - - $Returns: none - - $Arguments: Parent - parent window. - ListData - Menu item list -*******************************************************************************/ - -void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *)Parent)->data; - T_SMSREAD_R * data = (T_SMSREAD_R *)win_data->user; - - T_MFW_HND * l_parent; - SHORT l_id; - - if ((ListData->Reason EQ LISTS_REASON_BACK) || (ListData->Reason EQ LISTS_REASON_CLEAR) - || (ListData->Reason EQ LISTS_REASON_HANGUP)) - { - l_parent = data->parent; - l_id = data->id; - SmsRead_R_destroy(data->win); - //The editor has sent an back event, we return to the previous window (E_RETURN) - SEND_EVENT (l_parent, E_RETURN, l_id, NULL); - } -} -#endif + /******************************************************************************* $Function: check_assoc_name $Description: This function search if a phone number corresponds to any name in phonebook - or to the voice mailbox or to the SMS center - BE CAREFUL it allocates memory for the name, that has to be freed by the caller - It returns the length of the associated name if found, else length is 0 and name is NULL - - $Returns: string length + or to the voice mailbox or to the SMS center + BE CAREFUL it allocates memory for the name, that has to be freed by the caller + It returns the length of the associated name if found, else length is 0 and name is NULL + + $Returns: string length $Arguments: name - string - sms_addr - phonenumber string. + sms_addr - phonenumber string. *******************************************************************************/ UBYTE check_assoc_name(char *name, T_MFW_SMS_ADDR sms_addr) @@ -3679,8 +3610,6 @@ T_MFW_SMS_ADDR pb_entry; USHORT i; - - // TBD: add international numbers management // Voice, fax... mailboxes data @@ -3740,39 +3669,6 @@ return 1; // RAVI } -#if(0) /* x0039928 - Lint warning fix */ -/******************************************************************************* - - $Function: SmsRead_R_TEXTEDT2_editor_cb - - $Description: Callback function for the text editor. - - $Returns: void - - $Arguments: win - current window. - Identifier - unique id - Reason - event id -*******************************************************************************/ - -void SmsRead_R_TEXTEDT2_editor_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) -{ - - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_SMSREAD_R_TEXTEDT2 * data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; - - TRACE_FUNCTION("SmsRead_R_TEXTEDT2_editor_cb"); - switch (Reason) - { - case INFO_KCD_LEFT: - case INFO_KCD_RIGHT: - case INFO_KCD_HUP: - SEND_EVENT (data->parent, E_RETURN, Identifier, NULL); /* forward event to parent */ - break; - default: - break; - } -} -#endif /******************************************************************************* @@ -3780,17 +3676,16 @@ $Description: Exec callback function for searching the SMS text message. - $Returns: none + $Returns: none $Arguments: win - window handler - event - mfw event - value -optional id - parameter - optional data. + event - mfw event + value -optional id + parameter - optional data. *******************************************************************************/ void SmsRead_FindNextNumber_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) { - T_MFW_PHB_ENTRY pb_data; switch (Reason) @@ -3829,53 +3724,50 @@ break; default: - TRACE_EVENT(" >>> INFO Default "); + TRACE_EVENT(" >>> INFO Default "); //return MFW_EVENT_REJECTED; break; } - } /******************************************************************************* $Function: smsRead_NumberName_info_screen - $Description: Display the number and name of numbers found in the received SMS text. - - $Returns: window handle + $Description: Display the number and name of numbers found in the received SMS text. + + $Returns: window handle $Arguments: win - current window. - UserData - Sms data info + UserData - Sms data info *******************************************************************************/ static MfwHnd smsRead_NumberName_info_screen(MfwHnd win,T_SmsUserData *UserData, char* nameTag) { - - T_DISPLAY_DATA DisplayInfo; - TRACE_FUNCTION("smsRead_NumberName_info_screen() "); - - dlg_initDisplayData_TextStr( &DisplayInfo, TxtSoftNext, TxtSoftBack, nameTag, (char*)UserData->NumberBuffer, COLOUR_STATUS); - dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)SmsRead_FindNextNumber_cb, FOREVER, KEY_ALL ); - - TRACE_EVENT(">>>>> Display Information Screen "); - return info_dialog(win, &DisplayInfo); - + T_DISPLAY_DATA DisplayInfo; + TRACE_FUNCTION("smsRead_NumberName_info_screen() "); + + dlg_initDisplayData_TextStr( &DisplayInfo, TxtSoftNext, TxtSoftBack, nameTag, (char*)UserData->NumberBuffer, COLOUR_STATUS); + dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)SmsRead_FindNextNumber_cb, FOREVER, KEY_ALL ); + + TRACE_EVENT(">>>>> Display Information Screen "); + return info_dialog(win, &DisplayInfo); } /******************************************************************************* $Function: Search_forNextNumber - $Description: Search through the SMS text and find a telephone number, the number - may start with the '+' prefix. - - $Returns: Boolean + $Description: Search through the SMS text and find a telephone number, the number + may start with the '+' prefix. + + $Returns: Boolean $Arguments: UserData - SMS data info *******************************************************************************/ static BOOL Search_forNextNumber(T_SmsUserData *UserData) { - /* SPR888 - SH - Rewritten, old function below */ + /* SPR888 - SH - Rewritten, old function below */ /* Use search_index so we can start looking where we left off last time. Set to 0 in SMSRead_R_OPTExeStoreNumber */ @@ -3910,7 +3802,6 @@ memset (number_buffer, '\0', NUMBER_LENGTH*2+4); - while (search_index<sms_length && found_status<2 && number_index<NUMBER_LENGTH*2+4) { character = sms_buffer[search_index]; @@ -3947,7 +3838,6 @@ return FALSE; } - /* api Store number for calling when reading SMS - 04/03/2002 */ @@ -3955,10 +3845,10 @@ $Function: Search_forNextNumber - $Description: Search through the SMS text and find a telephone number, the number - may start with the '+' prefix. - - $Returns: Boolean + $Description: Search through the SMS text and find a telephone number, the number + may start with the '+' prefix. + + $Returns: Boolean $Arguments: UserData - SMS data info *******************************************************************************/ @@ -3968,10 +3858,10 @@ T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; - T_MFW_HDR * parent = data->parent; + T_MFW_HDR * parent = data->parent; T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; - T_MFW_PHB_ENTRY pb_data; + T_MFW_PHB_ENTRY pb_data; TRACE_FUNCTION("SmsRead_StoreNumber"); @@ -4025,9 +3915,9 @@ $Function: Search_forNumberInSMS - $Description: Search through the SMS text and find the numbers - - $Returns: void + $Description: Search through the SMS text and find the numbers + + $Returns: void $Arguments: UserData - SMS data info *******************************************************************************/ @@ -4144,28 +4034,27 @@ $Function: smsread_numlist_win_cb - $Description: Window event handler + $Description: Window event handler $Returns: MFW_EVENT_REJECTED: - MFW_EVENT_CONSUMED: + MFW_EVENT_CONSUMED: $Arguments: *******************************************************************************/ static int smsread_numlist_win_cb (MfwEvt e, MfwWin *w) { - TRACE_FUNCTION ("smsread_numlist_win_cb()"); - switch (e) - { - case MfwWinVisible: /* window is visible */ - break; - case MfwWinFocussed: /* input focus / selected */ - case MfwWinDelete: /* window will be deleted */ - - default: - return MFW_EVENT_REJECTED; - } - return MFW_EVENT_CONSUMED; + TRACE_FUNCTION ("smsread_numlist_win_cb()"); + switch (e) + { + case MfwWinVisible: /* window is visible */ + break; + case MfwWinFocussed: /* input focus / selected */ + case MfwWinDelete: /* window will be deleted */ + default: + return MFW_EVENT_REJECTED; + } + return MFW_EVENT_CONSUMED; } //Mar 23, 2006 DR:OMAPS00047813 x0035544 @@ -4188,32 +4077,32 @@ TRACE_FUNCTION ("SmsRead_BuildNumList_Menu"); /* - * Create window handler - */ + * Create window handler + */ data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)smsread_numlist_win_cb); if (data->win EQ NULL) { - FREE_MEMORY( (void *)data, sizeof( T_SMSREAD_R ) ); - return NULL; + FREE_MEMORY( (void *)data, sizeof( T_SMSREAD_R ) ); + return NULL; } TRACE_EVENT("list holder window created: " ); + /* - * connect the dialog data to the MFW-window - */ - + * connect the dialog data to the MFW-window + */ data->mmi_control.dialog = (T_DIALOG_FUNC)smsread_numlist_exec_cb; data->mmi_control.data = data; win = ((T_MFW_HDR *)data->win)->data; win->user = (void *)data; data->parent = parent_window; winShow(data->win); + /* - * return window handle - */ - - return data->win; + * return window handle + */ + return data->win; } //Mar 23, 2006 DR:OMAPS00047813 x0035544 @@ -4238,63 +4127,61 @@ TRACE_FUNCTION("smsread_numlist_exec_cb"); - win_data = ((T_MFW_HDR *) win)->data; data = (T_SMSREAD_R *)win_data->user; - switch (event) - { - case E_INIT: - data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); - - if(data->menu_list_data == 0) + switch (event) { - TRACE_EVENT("Failed memory alloc 1 "); - return; - } - /*SPR 2686, only allocate memory for the number of messages displayed*/ - data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( smsread_num_ctr * sizeof(T_MFW_MNU_ITEM) );//JVJE - - if(data->menu_list_data->List == 0) - { - TRACE_EVENT("Failed memory alloc 2"); - return; - } - - for (i = 0; i < smsread_num_ctr; i++) - { - mnuInitDataItem(&data->menu_list_data->List[i]); - data->menu_list_data->List[i].str = (char *)num_buffer[i]; - TRACE_EVENT_P1("Menu Tags:%s", data->menu_list_data->List[i].str); - data->menu_list_data->List[i].flagFunc = item_flag_none; + case E_INIT: + data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); + + if(data->menu_list_data == 0) + { + TRACE_EVENT("Failed memory alloc 1 "); + return; + } + /*SPR 2686, only allocate memory for the number of messages displayed*/ + data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( smsread_num_ctr * sizeof(T_MFW_MNU_ITEM) );//JVJE + + if(data->menu_list_data->List == 0) + { + TRACE_EVENT("Failed memory alloc 2"); + return; + } + + for (i = 0; i < smsread_num_ctr; i++) + { + mnuInitDataItem(&data->menu_list_data->List[i]); + data->menu_list_data->List[i].str = (char *)num_buffer[i]; + TRACE_EVENT_P1("Menu Tags:%s", data->menu_list_data->List[i].str); + data->menu_list_data->List[i].flagFunc = item_flag_none; + } + + data->menu_list_data->ListLength =smsread_num_ctr; + data->menu_list_data->ListPosition = 1; + data->menu_list_data->CursorPosition = 1; + data->menu_list_data->SnapshotSize =smsread_num_ctr; + data->menu_list_data->Font = 0; + data->menu_list_data->LeftSoftKey = TxtSoftSelect; + /*NM p032*/ + if(test_sim EQ TRUE) + data->menu_list_data->RightSoftKey = TxtNull; + else + data->menu_list_data->RightSoftKey = TxtSoftBack; + + data->menu_list_data->KeyEvents = KEY_ALL; + data->menu_list_data->Reason = 0; + data->menu_list_data->Strings = TRUE; + data->menu_list_data->Attr = (MfwMnuAttr*)&menuSearchNumListAttr; + data->menu_list_data->autoDestroy = FALSE; + + /* Create the dynamic menu window */ + listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_numlist_cb ,0); + break; + default: + break; } - - data->menu_list_data->ListLength =smsread_num_ctr; - data->menu_list_data->ListPosition = 1; - data->menu_list_data->CursorPosition = 1; - data->menu_list_data->SnapshotSize =smsread_num_ctr; - data->menu_list_data->Font = 0; - data->menu_list_data->LeftSoftKey = TxtSoftSelect; - /*NM p032*/ - if(test_sim EQ TRUE) - data->menu_list_data->RightSoftKey = TxtNull; - else - data->menu_list_data->RightSoftKey = TxtSoftBack; - - data->menu_list_data->KeyEvents = KEY_ALL; - data->menu_list_data->Reason = 0; - data->menu_list_data->Strings = TRUE; - data->menu_list_data->Attr = (MfwMnuAttr*)&menuSearchNumListAttr; - data->menu_list_data->autoDestroy = FALSE; - - /* Create the dynamic menu window */ - listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_numlist_cb ,0); - break; - default: - break; - } - - } +} //Mar 23, 2006 DR:OMAPS00047813 x0035544 /******************************************************************************* @@ -4317,7 +4204,6 @@ TRACE_FUNCTION ("SmsRead_numlist_cb()"); - if ((ListData->Reason EQ LISTS_REASON_BACK) || (ListData->Reason EQ LISTS_REASON_CLEAR) || (ListData->Reason EQ LISTS_REASON_HANGUP)) @@ -4331,10 +4217,10 @@ ** Free the memory set aside for ALL the devices to be listed. */ for(i=0; i<MAX_NUMBER_SIZE;i++) - { + { FREE_MEMORY((U8*)num_buffer[i], sizeof(char)*NUMBER_LENGTH); num_buffer[i] = NULL; - } + } /*deallocate memory for the array of pointer to numbers*/ FREE_MEMORY((U8*)num_buffer, sizeof(char*)*MAX_NUMBER_SIZE); @@ -4350,17 +4236,13 @@ } SmsRead_numlist_destroy(data->win); - - - } else if(ListData->Reason EQ LISTS_REASON_SELECT) - { + { pb_number = ListData->List[ListData->ListPosition].str; callNumber((UBYTE*)pb_number); - - } + } return; } @@ -4372,7 +4254,7 @@ $Description: Destroy the Extr Number window. - $Returns: none + $Returns: none $Arguments: own_window - window handler