FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiSmsRead.c @ 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 | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
172:44d6af34c75a | 173:0a0d54877239 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 | 2 |
3 CONDAT (UK) | 3 CONDAT (UK) |
4 | 4 |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 | 6 |
7 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
8 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI | 13 $Project code: BMI |
14 $Module: SMS | 14 $Module: SMS |
15 $File: MmiSmsRead.c | 15 $File: MmiSmsRead.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 25/10/00 | 19 $Date: 25/10/00 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 | 24 |
47 Solution: Display Info structure is initialized properly to display dialog "Message Deleted". | 47 Solution: Display Info structure is initialized properly to display dialog "Message Deleted". |
48 | 48 |
49 Feb 07, 2006 DR: OMAPS00059261 x0pleela | 49 Feb 07, 2006 DR: OMAPS00059261 x0pleela |
50 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI | 50 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI |
51 Solution: smsread_r_exec_cb(): avoiding display of sender's address in header for status reports during listing | 51 Solution: smsread_r_exec_cb(): avoiding display of sender's address in header for status reports during listing |
52 smsread_getstatustext():renamed txtreport to txtreport | 52 smsread_getstatustext():renamed txtreport to txtreport |
53 Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed | 53 Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed |
54 | 54 |
55 Feb 01, 2006 DR: OMAPS00059261 x0pleela | 55 Feb 01, 2006 DR: OMAPS00059261 x0pleela |
56 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI | 56 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI |
57 Solution: Added a check for Status report to display a text "Report:Pending" during listing of this message | 57 Solution: Added a check for Status report to display a text "Report:Pending" during listing of this message |
58 Made changes as per review comments | 58 Made changes as per review comments |
59 | 59 |
60 Jan 30, 2006 DR: OMAPS00059261 x0pleela | 60 Jan 30, 2006 DR: OMAPS00059261 x0pleela |
61 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI | 61 Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI |
62 Solution: Added code to read and display MT Status report | 62 Solution: Added code to read and display MT Status report |
63 | 63 |
78 Solution: Added menu option for the reply path. | 78 Solution: Added menu option for the reply path. |
79 | 79 |
80 Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar | 80 Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar |
81 Issue description: BMI: using the tool nowSMS the voicemail indication via sms does not work | 81 Issue description: BMI: using the tool nowSMS the voicemail indication via sms does not work |
82 Solution: Instead of identifying voice using addr[0] and pid, we use dcs. Also, messages belonging | 82 Solution: Instead of identifying voice using addr[0] and pid, we use dcs. Also, messages belonging |
83 to group "1100" are deleted when voicemail icon is displayed. | 83 to group "1100" are deleted when voicemail icon is displayed. |
84 | 84 |
85 Feb 16, 2005 REF: CRR 28966 x0012851 | 85 Feb 16, 2005 REF: CRR 28966 x0012851 |
86 Description: Editing or forwarding of large MT messages (>160 characters) | 86 Description: Editing or forwarding of large MT messages (>160 characters) |
87 shouldn't be allowed when Concatenation is set to 'OFF' | 87 shouldn't be allowed when Concatenation is set to 'OFF' |
88 Solution: If the 'ConcatenateStatus' flag is FALSE, the 'if' check condition | 88 Solution: If the 'ConcatenateStatus' flag is FALSE, the 'if' check condition |
89 which allows the message to be edited or forwarded has been | 89 which allows the message to be edited or forwarded has been |
90 modified for the same. | 90 modified for the same. |
91 | 91 |
92 Dec 15,2004 REF: CRR 24396 xkundadu | 92 Dec 15,2004 REF: CRR 24396 xkundadu |
93 Description: Phone crashes when a message is received while the | 93 Description: Phone crashes when a message is received while the |
94 'List Empty' dialog is displayed. | 94 'List Empty' dialog is displayed. |
95 Solution: NULL check is added for the list_win handle before calling | 95 Solution: NULL check is added for the list_win handle before calling |
96 listsDestroy() when an MT sms is receieved. | 96 listsDestroy() when an MT sms is receieved. |
97 | 97 |
98 Dec 01, 2004 REF: CRR 24225 xnkulkar | 98 Dec 01, 2004 REF: CRR 24225 xnkulkar |
99 Description: Reset when forwarding SMS | 99 Description: Reset when forwarding SMS |
100 Solution: The message content is sent excluding the date/time info from the | 100 Solution: The message content is sent excluding the date/time info from the |
101 original message, which was causing the reset as the max limit (161) was crossed. | 101 original message, which was causing the reset as the max limit (161) was crossed. |
102 | 102 |
103 Sep 08, 2004 REF: CRR 24393 Deepa M. D | 103 Sep 08, 2004 REF: CRR 24393 Deepa M. D |
104 Bug:Phone crashes when user tries to reply to a saved message in the Inbox | 104 Bug:Phone crashes when user tries to reply to a saved message in the Inbox |
105 Fix:The reply and Callnumber Option has been removed for the saved message. | 105 Fix:The reply and Callnumber Option has been removed for the saved message. |
106 25/10/00 Original Condat(UK) BMI version. | 106 25/10/00 Original Condat(UK) BMI version. |
107 14/10/00 SPR 1257 - merged in issue 888 from b-sample line (extract | 107 14/10/00 SPR 1257 - merged in issue 888 from b-sample line (extract |
108 number from SMS improvements) and made changes to accommodate | 108 number from SMS improvements) and made changes to accommodate |
109 Unicode SMSs containing numbers. | 109 Unicode SMSs containing numbers. |
110 May 03, 2004 REF: CRR 13845 Deepa M | 110 May 03, 2004 REF: CRR 13845 Deepa M |
111 The Forward menuitem added. | 111 The Forward menuitem added. |
112 $End | 112 $End |
113 | 113 |
114 *******************************************************************************/ | 114 *******************************************************************************/ |
236 extern BOOL invalidVm; | 236 extern BOOL invalidVm; |
237 | 237 |
238 extern UBYTE reply_path_bit; | 238 extern UBYTE reply_path_bit; |
239 /********************************************************************* | 239 /********************************************************************* |
240 | 240 |
241 DYNAMIC MENU WINDOW. DECLARATION | 241 DYNAMIC MENU WINDOW. DECLARATION |
242 | 242 |
243 **********************************************************************/ | 243 **********************************************************************/ |
244 | 244 |
245 typedef enum | 245 typedef enum |
246 { | 246 { |
298 /* associated handlers */ | 298 /* associated handlers */ |
299 | 299 |
300 T_MFW_HND sms_handle; /* MFW sms handler */ | 300 T_MFW_HND sms_handle; /* MFW sms handler */ |
301 | 301 |
302 /* internal data */ | 302 /* internal data */ |
303 T_SMS_LIST_DATA sms_list_data; | 303 T_SMS_LIST_DATA sms_list_data; |
304 T_SMS_EDITOR_DATA sms_editor_data; | 304 T_SMS_EDITOR_DATA sms_editor_data; |
305 ListMenuData *menu_list_data; | 305 ListMenuData *menu_list_data; |
306 /*SPR 2686, removed unused data field*/ | 306 /*SPR 2686, removed unused data field*/ |
307 | |
308 } T_SMSREAD_R; | 307 } T_SMSREAD_R; |
308 | |
309 T_SMSREAD_R* getUserData_T_SMSREAD_R( T_MFW_WIN *win) | 309 T_SMSREAD_R* getUserData_T_SMSREAD_R( T_MFW_WIN *win) |
310 { | 310 { |
311 if (win == NULL) | 311 if (win == NULL) |
312 return (NULL); | 312 return (NULL); |
313 return((T_SMSREAD_R *)win->user); | 313 return((T_SMSREAD_R *)win->user); |
324 T_MFW_HND parent; | 324 T_MFW_HND parent; |
325 T_MFW_HND editor_win; | 325 T_MFW_HND editor_win; |
326 | 326 |
327 /* associated handlers */ | 327 /* associated handlers */ |
328 | 328 |
329 | |
330 /* internal data */ | 329 /* internal data */ |
331 T_SMS_EDITOR_DATA *sms_editor_data; | 330 T_SMS_EDITOR_DATA *sms_editor_data; |
332 /*SPR 2686, removed unused data field*/ | 331 /*SPR 2686, removed unused data field*/ |
333 } T_SMSREAD_R_TEXTEDT2; | 332 } T_SMSREAD_R_TEXTEDT2; |
334 | 333 |
335 T_SMSREAD_R_TEXTEDT2* getUserData_T_SMSREAD_R_TEXTEDT2( T_MFW_WIN *win) | 334 T_SMSREAD_R_TEXTEDT2* getUserData_T_SMSREAD_R_TEXTEDT2( T_MFW_WIN *win) |
336 { | 335 { |
337 if (win == NULL) | 336 if (win == NULL) |
338 return (NULL); | 337 return (NULL); |
339 return((T_SMSREAD_R_TEXTEDT2 *)win->user); | 338 return((T_SMSREAD_R_TEXTEDT2 *)win->user); |
340 } | 339 } |
341 | |
342 | 340 |
343 | 341 |
344 typedef struct | 342 typedef struct |
345 { | 343 { |
346 /* administrative data */ | 344 /* administrative data */ |
360 | 358 |
361 /* internal data */ | 359 /* internal data */ |
362 | 360 |
363 /* !!! **************************************** modify here **************************************** !!!*/ | 361 /* !!! **************************************** modify here **************************************** !!!*/ |
364 /*SPR 2686, removed unused data field*/ | 362 /*SPR 2686, removed unused data field*/ |
365 T_MFW_HND sms; | 363 T_MFW_HND sms; |
366 T_MFW_HND dialog_win; | 364 T_MFW_HND dialog_win; |
367 | 365 |
368 /* !!! **************************************** end modify here **************************************** !!! */ | 366 /* !!! **************************************** end modify here **************************************** !!! */ |
369 T_SMS_EDITOR_DATA *sms_editor_data; //NM 25.8 | 367 T_SMS_EDITOR_DATA *sms_editor_data; //NM 25.8 |
370 } T_SMSREAD_R_OPT; | 368 } T_SMSREAD_R_OPT; |
369 | |
371 T_SMSREAD_R_OPT* getUserData_T_SMSREAD_R_OPT( T_MFW_WIN *win) | 370 T_SMSREAD_R_OPT* getUserData_T_SMSREAD_R_OPT( T_MFW_WIN *win) |
372 { | 371 { |
373 if (win == NULL) | 372 if (win == NULL) |
374 return (NULL); | 373 return (NULL); |
375 return((T_SMSREAD_R_OPT *)win->user); | 374 return((T_SMSREAD_R_OPT *)win->user); |
376 } | 375 } |
377 | |
378 | |
379 | |
380 | 376 |
381 | 377 |
382 static enum | 378 static enum |
383 { | 379 { |
384 READ_SMS_LIST, | 380 READ_SMS_LIST, |
400 &readSMS_menuArea, | 396 &readSMS_menuArea, |
401 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ | 397 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ |
402 (U8)-1, /* use default font */ | 398 (U8)-1, /* use default font */ |
403 NULL, /* with these items */ | 399 NULL, /* with these items */ |
404 0, /* number of items */ | 400 0, /* number of items */ |
405 COLOUR_LIST_SMS, | 401 COLOUR_LIST_SMS, |
406 TxtMessages, | 402 TxtMessages, |
407 NULL, | 403 NULL, |
408 MNUATTRSPARE | 404 MNUATTRSPARE |
409 | |
410 }; | 405 }; |
411 | 406 |
412 //Mar 28, 2006 DR:OMAPS00047813 x0035544 | 407 //Mar 28, 2006 DR:OMAPS00047813 x0035544 |
413 /*default static menu*/ | 408 /*default static menu*/ |
414 static const MfwMnuAttr menuSearchNumListAttr = | 409 static const MfwMnuAttr menuSearchNumListAttr = |
415 { | 410 { |
416 &menuArea, | 411 &menuArea, |
417 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ | 412 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ |
418 (U8)-1, /* use default font */ | 413 (U8)-1, /* use default font */ |
419 NULL, /* with these items (filled in later) */ | 414 NULL, /* with these items (filled in later) */ |
420 0, /* number of items (filled in leter) | 415 0, /* number of items (filled in later) */ |
421 | 416 COLOUR_LIST_XX, /* Colour */ |
422 */ | 417 TxtExtractNumber, /* Hdr Id */ |
423 COLOUR_LIST_XX, /* Colour */ | 418 NULL, /* Background */ |
424 TxtExtractNumber, /* Hdr Id */ | 419 MNUATTRSPARE /* unused */ |
425 NULL, /* Background */ | |
426 MNUATTRSPARE /* unused */ | |
427 }; | 420 }; |
428 | 421 |
429 | 422 |
430 /* x0039928 - Lint warning fix | 423 /* x0039928 - Lint warning fix |
431 static SHORT g_sms_list_counter; | 424 static SHORT g_sms_list_counter; |
432 static SHORT g_nb_line_sms; */ | 425 static SHORT g_nb_line_sms; */ |
433 | 426 |
434 static int search_index; /* SPR888 - SH - keeps track of position within SMS for extract number */ | 427 static int search_index; /* SPR888 - SH - keeps track of position within SMS for extract number */ |
435 | 428 |
436 static T_MFW_HND info_win=0; | 429 static T_MFW_HND info_win=0; |
437 static T_MFW_HND deleting_win = 0; | 430 static T_MFW_HND deleting_win = 0; |
438 static T_MFW_HND list_win=0; | 431 static T_MFW_HND list_win=0; |
439 static T_MFW_HND sms_read_win = 0;/*MC 1991 main SMS read window*/ | 432 static T_MFW_HND sms_read_win = 0;/*MC 1991 main SMS read window*/ |
440 static T_MFW_HND message_win = 0; /*MC 2132, individual message display win*/ | 433 static T_MFW_HND message_win = 0; /*MC 2132, individual message display win*/ |
441 static T_MFW_HND option_mnu_win = 0;/*MC 2132, options menu window*/ | 434 static T_MFW_HND option_mnu_win = 0;/*MC 2132, options menu window*/ |
442 | 435 |
443 static char sms_text_ascii[MAX_EDITOR_LEN]; | 436 static char sms_text_ascii[MAX_EDITOR_LEN]; |
444 | 437 |
445 /* we need this variable "read_status" to know which sms message we are going | 438 /* we need this variable "read_status" to know which sms message we are going |
448 (current length saved in "current_sms_len") !! | 441 (current length saved in "current_sms_len") !! |
449 SMS_MT includes additional TIME, DATE and NUMBER and we dont want | 442 SMS_MT includes additional TIME, DATE and NUMBER and we dont want |
450 to show it when we are editing. | 443 to show it when we are editing. |
451 */ | 444 */ |
452 static UBYTE read_status; | 445 static UBYTE read_status; |
453 static USHORT current_sms_len= 0; | 446 static USHORT current_sms_len = 0; |
454 | 447 |
455 // Dec 15,2004 REF: CRR 24396 xkundadu | 448 // Dec 15,2004 REF: CRR 24396 xkundadu |
456 // Description: Phone crashes when a message is received while the | 449 // Description: Phone crashes when a message is received while the |
457 // 'List Empty' dialog is displayed. | 450 // 'List Empty' dialog is displayed. |
458 // Solution: NULL check is added for the list_win handle before calling | 451 // Solution: NULL check is added for the list_win handle before calling |
523 static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w); | 516 static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w); |
524 static void SmsRead_R_TEXTEDT2_editor_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason); | 517 static void SmsRead_R_TEXTEDT2_editor_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason); |
525 static void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData); | 518 static void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData); |
526 | 519 |
527 | 520 |
528 | |
529 static BOOL Search_forNextNumber(T_SmsUserData *UserData); | 521 static BOOL Search_forNextNumber(T_SmsUserData *UserData); |
530 //Mar 27, 2006 DR:OMAPS00047813 x0035544 | 522 //Mar 27, 2006 DR:OMAPS00047813 x0035544 |
531 static void SmsRead_numlist_destroy(MfwHnd own_window); | 523 static void SmsRead_numlist_destroy(MfwHnd own_window); |
532 static void SmsRead_numlist_cb(T_MFW_HND Parent, ListMenuData * ListData); | 524 static void SmsRead_numlist_cb(T_MFW_HND Parent, ListMenuData * ListData); |
533 void smsread_numlist_exec_cb (T_MFW_HND win, USHORT event); | 525 void smsread_numlist_exec_cb (T_MFW_HND win, USHORT event); |
553 static const MfwMnuAttr SmsRead_R_OPTAttrib = | 545 static const MfwMnuAttr SmsRead_R_OPTAttrib = |
554 { | 546 { |
555 &SmsRead_R_OPTArea, | 547 &SmsRead_R_OPTArea, |
556 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ | 548 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ |
557 (U8)-1, /* use default font */ | 549 (U8)-1, /* use default font */ |
558 (MfwMnuItem*) SmsRead_R_OPTItems, /* with these items */ | 550 (MfwMnuItem*) SmsRead_R_OPTItems, /* with these items */ |
559 sizeof(SmsRead_R_OPTItems)/sizeof(MfwMnuItem) /* number of items */ | 551 sizeof(SmsRead_R_OPTItems)/sizeof(MfwMnuItem) /* number of items */ |
560 }; | 552 }; |
561 | 553 |
562 //Sep 08, 2004 REF: CRR 24393 Deepa M. D | 554 //Sep 08, 2004 REF: CRR 24393 Deepa M. D |
563 //New menu item for the saved/unsent messages. | 555 //New menu item for the saved/unsent messages. |
564 static const MfwMnuItem SmsRead_R_Unsent_OPTItems [] = | 556 static const MfwMnuItem SmsRead_R_Unsent_OPTItems [] = |
565 { | 557 { |
566 {0,0,0,(char *)TxtDelete,0,(MenuFunc)SmsRead_R_OPTExeDelete,item_flag_none}, | 558 {0,0,0,(char *)TxtDelete,0,(MenuFunc)SmsRead_R_OPTExeDelete,item_flag_none}, |
567 {0,0,0,(char *)TxtEdit,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, | 559 {0,0,0,(char *)TxtEdit,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, |
568 {0,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, | 560 {0,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none}, |
569 {0,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none}, | 561 {0,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none}, |
570 | |
571 }; | 562 }; |
572 | 563 |
573 //Sep 08, 2004 REF: CRR 24393 Deepa M. D | 564 //Sep 08, 2004 REF: CRR 24393 Deepa M. D |
574 //Menu attributes for the saved/unsent messages. | 565 //Menu attributes for the saved/unsent messages. |
575 static const MfwMnuAttr SmsRead_R_Unsent_OPTAttrib = | 566 static const MfwMnuAttr SmsRead_R_Unsent_OPTAttrib = |
576 { | 567 { |
577 &SmsRead_R_OPTArea, | 568 &SmsRead_R_OPTArea, |
578 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ | 569 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ |
579 (U8)-1, /* use default font */ | 570 (U8)-1, /* use default font */ |
580 (MfwMnuItem*) SmsRead_R_Unsent_OPTItems, /* with these items */ | 571 (MfwMnuItem*) SmsRead_R_Unsent_OPTItems, /* with these items */ |
581 sizeof(SmsRead_R_Unsent_OPTItems)/sizeof(MfwMnuItem) /* number of items */ | 572 sizeof(SmsRead_R_Unsent_OPTItems)/sizeof(MfwMnuItem) /* number of items */ |
582 }; | 573 }; |
583 | 574 |
584 | 575 |
585 | |
586 /******************************************************************************* | 576 /******************************************************************************* |
587 | 577 |
588 $Function: charPtrToUBYTEPtr | 578 $Function: charPtrToUBYTEPtr |
589 | 579 |
590 $Description: Converts a char ptr to a UBYTE ptr. The procedures can be replaced by macro | 580 $Description: Converts a char ptr to a UBYTE ptr. The procedures can be replaced by macro |
591 once all conversions are confirmed as valid. | 581 once all conversions are confirmed as valid. |
592 | 582 |
593 $Returns: data set to new type | 583 $Returns: data set to new type |
594 | 584 |
595 $Arguments: data -data item of input type. | 585 $Arguments: data -data item of input type. |
596 | 586 |
597 *******************************************************************************/ | 587 *******************************************************************************/ |
598 #ifndef MMI_USE_MACROS | 588 #ifndef MMI_USE_MACROS |
607 USHORT charToUSHORT ( char chr ) { return((USHORT)(int)chr); } | 597 USHORT charToUSHORT ( char chr ) { return((USHORT)(int)chr); } |
608 USHORT UBYTEToUSHORT ( UBYTE data) { return((USHORT)data); } | 598 USHORT UBYTEToUSHORT ( UBYTE data) { return((USHORT)data); } |
609 USHORT* charPtrToUSHORTPtr (char* data) { return((USHORT*)data); } | 599 USHORT* charPtrToUSHORTPtr (char* data) { return((USHORT*)data); } |
610 | 600 |
611 #else | 601 #else |
612 #define charToUBYTE (UBYTE) | 602 #define charToUBYTE (UBYTE) |
613 #define charPtrToUBYTEPtr (UBYTE*) | 603 #define charPtrToUBYTEPtr (UBYTE*) |
614 #define SHORTToUBYTE (UBYTE) | 604 #define SHORTToUBYTE (UBYTE) |
615 | 605 |
616 #define UBYTEPtrToCharPtr (char*) | 606 #define UBYTEPtrToCharPtr (char*) |
617 #define UBYTEToChar (char) | 607 #define UBYTEToChar (char) |
618 #define USHORTPtrToCharPtr (char*) | 608 #define USHORTPtrToCharPtr (char*) |
619 | 609 |
620 #define charToUSHORT (USHORT) | 610 #define charToUSHORT (USHORT) |
621 #define UBYTEToUSHORT (USHORT) | 611 #define UBYTEToUSHORT (USHORT) |
622 #define charPtrToUSHORTPtr (USHORT*) | 612 #define charPtrToUSHORTPtr (USHORT*) |
629 | 619 |
630 $Function: SmsRead_R_start | 620 $Function: SmsRead_R_start |
631 | 621 |
632 $Description: Start the creation of the main window for SMS reading | 622 $Description: Start the creation of the main window for SMS reading |
633 | 623 |
634 $Returns: mfw window handler | 624 $Returns: mfw window handler |
635 | 625 |
636 $Arguments: parent_window - Parent window handler | 626 $Arguments: parent_window - Parent window handler |
637 menuAttr - Menu attributes. | 627 menuAttr - Menu attributes. |
638 | 628 |
639 *******************************************************************************/ | 629 *******************************************************************************/ |
640 T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) | 630 T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) |
641 { | 631 { |
642 TRACE_EVENT_P1("sms_read_win:%d", sms_read_win); | 632 TRACE_EVENT_P1("sms_read_win:%d", sms_read_win); |
643 /*SPR2132, if the list window already exists, destroy it before creating a new one*/ | 633 /*SPR2132, if the list window already exists, destroy it before creating a new one*/ |
644 if (sms_read_win != NULL) | 634 if (sms_read_win != NULL) |
645 SmsRead_R_destroy(sms_read_win); | 635 SmsRead_R_destroy(sms_read_win); |
646 | 636 |
647 TRACE_FUNCTION ("SmsRead_R_start()"); | 637 TRACE_FUNCTION ("SmsRead_R_start()"); |
648 /*SPR 1991 use ssms_read_win rather than a local var*/ | 638 /*SPR 1991 use ssms_read_win rather than a local var*/ |
649 sms_read_win = SmsRead_R_create (parent_window); | 639 sms_read_win = SmsRead_R_create (parent_window); |
650 | 640 |
651 if (sms_read_win NEQ NULL) | 641 if (sms_read_win NEQ NULL) |
652 { | 642 { |
653 /* We transmit to the SMS editor the address of the data buffer */ | 643 /* We transmit to the SMS editor the address of the data buffer */ |
654 SEND_EVENT (sms_read_win, E_INIT, SmsRead_R_ID, (void *)menuAttr); | 644 SEND_EVENT (sms_read_win, E_INIT, SmsRead_R_ID, (void *)menuAttr); |
655 } | 645 } |
656 return sms_read_win; | 646 return sms_read_win; |
657 } | 647 } |
658 | 648 |
659 /******************************************************************************* | 649 /******************************************************************************* |
660 | 650 |
661 $Function: SmsRead_R_create | 651 $Function: SmsRead_R_create |
662 | 652 |
663 $Description: create the SMS read window (dynamic list of all the SMS) | 653 $Description: create the SMS read window (dynamic list of all the SMS) |
664 | 654 |
665 $Returns: mfw window handler | 655 $Returns: mfw window handler |
666 | 656 |
667 $Arguments: parent_window - Parent window handler | 657 $Arguments: parent_window - Parent window handler |
668 | 658 |
669 *******************************************************************************/ | 659 *******************************************************************************/ |
670 static T_MFW_HND SmsRead_R_create(MfwHnd parent_window) | 660 static T_MFW_HND SmsRead_R_create(MfwHnd parent_window) |
677 /* | 667 /* |
678 * Create window handler | 668 * Create window handler |
679 */ | 669 */ |
680 | 670 |
681 data->win = | 671 data->win = |
682 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_win_cb); | 672 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_win_cb); |
673 | |
683 if (data->win EQ NULL) | 674 if (data->win EQ NULL) |
684 { | 675 { |
685 return NULL; | 676 return NULL; |
686 } | 677 } |
678 | |
687 /* | 679 /* |
688 * connect the dialog data to the MFW-window | 680 * connect the dialog data to the MFW-window |
689 */ | 681 */ |
690 | |
691 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_exec_cb; | 682 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_exec_cb; |
692 data->mmi_control.data = data; | 683 data->mmi_control.data = data; |
693 win = getWinData(data->win); | 684 win = getWinData(data->win); |
694 win->user = (void *)data; | 685 win->user = (void *)data; |
695 data->parent = parent_window; | 686 data->parent = parent_window; |
696 winShow(data->win); | 687 winShow(data->win); |
697 | 688 |
698 /* | 689 /* |
699 * return window handle | 690 * return window handle |
700 */ | 691 */ |
701 | 692 |
706 | 697 |
707 $Function: SmsRead_R_destroy | 698 $Function: SmsRead_R_destroy |
708 | 699 |
709 $Description: Destroy the SMS read window (dynamic list of all the SMS) | 700 $Description: Destroy the SMS read window (dynamic list of all the SMS) |
710 | 701 |
711 $Returns: none | 702 $Returns: none |
712 | 703 |
713 $Arguments: own_window - window handler | 704 $Arguments: own_window - window handler |
714 | 705 |
715 *******************************************************************************/ | 706 *******************************************************************************/ |
716 | 707 |
717 static void SmsRead_R_destroy(MfwHnd own_window) | 708 static void SmsRead_R_destroy(MfwHnd own_window) |
718 { | 709 { |
719 T_MFW_WIN * win_data; | 710 T_MFW_WIN * win_data; |
720 T_SMSREAD_R * data; | 711 T_SMSREAD_R * data; |
721 USHORT i; | 712 USHORT i; |
722 | |
723 | 713 |
724 TRACE_FUNCTION ("SmsRead_R_destroy()"); | 714 TRACE_FUNCTION ("SmsRead_R_destroy()"); |
725 | 715 |
726 if (own_window) | 716 if (own_window) |
727 { | 717 { |
728 win_data = getWinData(own_window); //((T_MFW_HDR *))->data; | 718 win_data = getWinData(own_window); //((T_MFW_HDR *))->data; |
729 data = getUserData_T_SMSREAD_R(win_data); | 719 data = getUserData_T_SMSREAD_R(win_data); |
730 if (data) | 720 if (data) |
721 { | |
722 /* | |
723 * Delete WIN handler | |
724 */ | |
725 sms_delete(data->sms_handle); | |
726 | |
727 /*SPR 2132, if the message options menu or the messaeg display screen exist, | |
728 destroy them */ | |
729 if (option_mnu_win) | |
730 { | |
731 SmsRead_R_OPT_destroy(option_mnu_win); | |
732 } | |
733 if (message_win) | |
734 { | |
735 SmsRead_R_TEXTEDT2_destroy(message_win); | |
736 message_win = 0; | |
737 } | |
738 /*SPR 2132 end*/ | |
739 | |
740 if (info_win) | |
741 { | |
742 SEND_EVENT(info_win,DIALOG_DESTROY,0,0 ); | |
743 info_win = 0; | |
744 } | |
745 if (list_win) | |
746 { | |
747 SEND_EVENT(list_win/*SPR1991*/,E_LIST_DESTROY/*SPR 2132*/,0,0 ); | |
748 list_win = 0; | |
749 } | |
750 win_delete (data->win); | |
751 | |
752 /* | |
753 * Free Memory | |
754 */ | |
755 | |
756 /* Free the data allocated for the name associated to the phone number */ | |
757 if (data->sms_editor_data.assoc_name != NULL) | |
758 FREE_MEMORY( (void *)data->sms_editor_data.assoc_name, strlen(data->sms_editor_data.assoc_name) + 1); | |
759 | |
760 /* Free the data allocated for the dynamic list */ | |
761 if (data->menu_list_data != NULL) | |
762 { | |
763 for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) | |
731 { | 764 { |
732 /* | 765 FREE_MEMORY( (void *)data->sms_list_data.sms_header[i], UCS2_MENU_TEXT_LEN+ 1/*SPR1242*/); |
733 * Delete WIN handler | 766 } |
734 */ | 767 /*SPR 2686, only de-allocate memory for the number of messages displayed*/ |
735 sms_delete(data->sms_handle); | 768 FREE_MEMORY ((void *)data->menu_list_data->List,((data->sms_list_data).nb_sms_stored) * sizeof(T_MFW_MNU_ITEM)); |
736 | 769 FREE_MEMORY ((UBYTE *)data->menu_list_data, sizeof(ListMenuData)); |
737 | 770 } |
738 /*SPR 2132, if the message options menu or the messaeg display screen exist, | |
739 destroy them */ | |
740 if (option_mnu_win) | |
741 { | |
742 SmsRead_R_OPT_destroy(option_mnu_win); | |
743 | |
744 } | |
745 if (message_win) | |
746 { | |
747 SmsRead_R_TEXTEDT2_destroy(message_win); | |
748 message_win = 0; | |
749 } | |
750 /*SPR 2132 end*/ | |
751 | |
752 if (info_win) | |
753 { | |
754 SEND_EVENT(info_win,DIALOG_DESTROY,0,0 ); | |
755 info_win = 0; | |
756 } | |
757 if (list_win){ | |
758 | |
759 SEND_EVENT(list_win/*SPR1991*/,E_LIST_DESTROY/*SPR 2132*/,0,0 ); | |
760 list_win = 0; | |
761 } | |
762 win_delete (data->win); | |
763 { | |
764 | |
765 } | |
766 | |
767 /* | |
768 * Free Memory | |
769 */ | |
770 | |
771 /* Free the data allocated for the name associated to the phone number */ | |
772 if (data->sms_editor_data.assoc_name != NULL) | |
773 FREE_MEMORY( (void *)data->sms_editor_data.assoc_name, strlen(data->sms_editor_data.assoc_name) + 1); | |
774 | |
775 /* Free the data allocated for the dynamic list */ | |
776 if (data->menu_list_data != NULL) | |
777 { | |
778 for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) | |
779 { | |
780 FREE_MEMORY( (void *)data->sms_list_data.sms_header[i], UCS2_MENU_TEXT_LEN+ 1/*SPR1242*/); | |
781 } | |
782 /*SPR 2686, only de-allocate memory for the number of messages displayed*/ | |
783 FREE_MEMORY ((void *)data->menu_list_data->List,((data->sms_list_data).nb_sms_stored) * sizeof(T_MFW_MNU_ITEM)); | |
784 FREE_MEMORY ((UBYTE *)data->menu_list_data, sizeof(ListMenuData)); | |
785 } | |
786 #ifdef FF_MMI_SMS_DYNAMIC | 771 #ifdef FF_MMI_SMS_DYNAMIC |
787 FREE_MEMORY((void*)data->sms_list_data.sms_messages,g_max_messages * sizeof(T_MFW_SMS_MSG) ); | 772 FREE_MEMORY((void*)data->sms_list_data.sms_messages,g_max_messages * sizeof(T_MFW_SMS_MSG) ); |
788 FREE_MEMORY((void*)data->sms_list_data.sms_header, g_max_messages * sizeof(wstring_t)); | 773 FREE_MEMORY((void*)data->sms_list_data.sms_header, g_max_messages * sizeof(wstring_t)); |
789 #endif | 774 #endif |
790 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R)); | 775 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R)); |
791 sms_read_win = 0; | 776 sms_read_win = 0; |
792 } | 777 } |
793 else | 778 else |
794 { | 779 { |
795 TRACE_EVENT ("SmsRead_R_destroy() called twice"); | 780 TRACE_EVENT ("SmsRead_R_destroy() called twice"); |
796 } | 781 } |
797 } | 782 } |
798 } | 783 } |
799 | 784 |
800 /******************************************************************************* | 785 /******************************************************************************* |
801 | 786 |
802 $Function: SmsRead_R_exec_cb | 787 $Function: SmsRead_R_exec_cb |
803 | 788 |
804 $Description: Exec callback function of the SMS read window (dynamic list of | 789 $Description: Exec callback function of the SMS read window (dynamic list of |
805 all the SMS) | 790 all the SMS) |
806 | 791 |
807 $Returns: none | 792 $Returns: none |
808 | 793 |
809 $Arguments: win - window handler | 794 $Arguments: win - window handler |
810 event - mfw event | 795 event - mfw event |
811 parameter - optional data. | 796 parameter - optional data. |
812 | 797 |
813 *******************************************************************************/ | 798 *******************************************************************************/ |
814 void SmsRead_R_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 799 void SmsRead_R_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
815 /* callback handler for events sent to to trigger execution */ | 800 /* callback handler for events sent to to trigger execution */ |
816 { | 801 { |
817 T_MFW_WIN * win_data; | 802 T_MFW_WIN * win_data; |
818 T_SMSREAD_R * data; | 803 T_SMSREAD_R * data; |
819 T_SMS_LIST_DATA * list_data; | 804 T_SMS_LIST_DATA * list_data; |
820 T_MFW_EVENT MfwEvents; | 805 T_MFW_EVENT MfwEvents; |
821 | 806 |
822 T_MFW_SMS_STAT sms_list_type = *(T_MFW_SMS_STAT *)parameter; | 807 T_MFW_SMS_STAT sms_list_type = *(T_MFW_SMS_STAT *)parameter; |
823 | 808 |
824 T_MFW_HND l_parent; | 809 T_MFW_HND l_parent; |
825 T_DISPLAY_DATA DisplayInfo; | 810 T_DISPLAY_DATA DisplayInfo; |
826 // Status of SMS reading | 811 // Status of SMS reading |
827 | 812 |
828 /* x0045876, 14-Aug-2006 (WR - "status" & "i" was declared but never referenced)*/ | 813 /* x0045876, 14-Aug-2006 (WR - "status" & "i" was declared but never referenced)*/ |
829 /* T_MFW status; */ | 814 /* T_MFW status; */ |
830 /* int i;*/ | 815 /* int i;*/ |
831 | 816 |
832 win_data = getWinData(win); //((T_MFW_HDR *))->data; | 817 win_data = getWinData(win); //((T_MFW_HDR *))->data; |
833 data = getUserData_T_SMSREAD_R(win_data); | 818 data = getUserData_T_SMSREAD_R(win_data); |
834 list_data = &data->sms_list_data; | 819 list_data = &data->sms_list_data; |
835 | 820 |
836 TRACE_FUNCTION ("SmsRead_R_exec_cb()"); | 821 TRACE_FUNCTION ("SmsRead_R_exec_cb()"); |
837 | 822 |
838 switch (event) | 823 switch (event) |
1038 /******************************************************************************* | 1023 /******************************************************************************* |
1039 | 1024 |
1040 $Function: SmsRead_R_win_cb | 1025 $Function: SmsRead_R_win_cb |
1041 | 1026 |
1042 $Description: Window callback function of the SMS read window (dynamic list of | 1027 $Description: Window callback function of the SMS read window (dynamic list of |
1043 all the SMS) | 1028 all the SMS) |
1044 | 1029 |
1045 $Returns: none | 1030 $Returns: none |
1046 | 1031 |
1047 $Arguments: w - mfw window handler | 1032 $Arguments: w - mfw window handler |
1048 e - mfw event | 1033 e - mfw event |
1049 | 1034 |
1050 *******************************************************************************/ | 1035 *******************************************************************************/ |
1051 | 1036 |
1052 static int SmsRead_R_win_cb (MfwEvt e, MfwWin *w) /* yyy window event handler */ | 1037 static int SmsRead_R_win_cb (MfwEvt e, MfwWin *w) /* yyy window event handler */ |
1053 { | 1038 { |
1068 | 1053 |
1069 $Function: SmsRead_GetStatusText | 1054 $Function: SmsRead_GetStatusText |
1070 | 1055 |
1071 $Description: Function to copy status string into array provided. | 1056 $Description: Function to copy status string into array provided. |
1072 | 1057 |
1073 $Returns: number of characters used in the output array. | 1058 $Returns: number of characters used in the output array. |
1074 | 1059 |
1075 $Arguments: op_text_str - pointer to array to store the string | 1060 $Arguments: op_text_str - pointer to array to store the string |
1076 status - read status of text message. | 1061 status - read status of text message. |
1077 | 1062 |
1078 $History | 1063 $History |
1079 SPR#780-GW-Created to allow consistent display of status in text message list | 1064 SPR#780-GW-Created to allow consistent display of status in text message list |
1080 *******************************************************************************/ | 1065 *******************************************************************************/ |
1081 int SmsRead_GetStatusText( char* op_text_str, int status, T_MFW_SMS_MEM mem) | 1066 int SmsRead_GetStatusText( char* op_text_str, int status, T_MFW_SMS_MEM mem) |
1152 /******************************************************************************* | 1137 /******************************************************************************* |
1153 | 1138 |
1154 $Function: SmsRead_R_mfw_cb | 1139 $Function: SmsRead_R_mfw_cb |
1155 | 1140 |
1156 $Description: MFW callback function of the SMS read window (dynamic list of all the SMS). | 1141 $Description: MFW callback function of the SMS read window (dynamic list of all the SMS). |
1157 Only interesting events for reading are handled here | 1142 Only interesting events for reading are handled here |
1158 | 1143 |
1159 $Returns: event status | 1144 $Returns: event status |
1160 | 1145 |
1161 $Arguments: parameter - optional data | 1146 $Arguments: parameter - optional data |
1162 event - mfw event | 1147 event - mfw event |
1163 | 1148 |
1164 *******************************************************************************/ | 1149 *******************************************************************************/ |
1165 int SmsRead_R_mfw_cb(MfwEvt event, void *parameter) | 1150 int SmsRead_R_mfw_cb(MfwEvt event, void *parameter) |
1166 { | 1151 { |
1167 T_MFW_HND win = mfwParent((MfwHdr *)mfw_header()); | 1152 T_MFW_HND win = mfwParent((MfwHdr *)mfw_header()); |
1180 T_MFW_SMS_MO * MoMessage; | 1165 T_MFW_SMS_MO * MoMessage; |
1181 T_MFW_SMS_MT * MtMessage; | 1166 T_MFW_SMS_MT * MtMessage; |
1182 | 1167 |
1183 T_MFW_SMS_IDX msg_info; | 1168 T_MFW_SMS_IDX msg_info; |
1184 | 1169 |
1185 | |
1186 | |
1187 T_DISPLAY_DATA DisplayInfo; | 1170 T_DISPLAY_DATA DisplayInfo; |
1188 | 1171 |
1189 /* x0045876, 14-Aug-2006 (WR - "sms_len" & "sms_text" was declared but never referenced)*/ | 1172 /* x0045876, 14-Aug-2006 (WR - "sms_len" & "sms_text" was declared but never referenced)*/ |
1190 /* USHORT sms_len; */ | 1173 /* USHORT sms_len; */ |
1191 /* char *sms_text; */ | 1174 /* char *sms_text; */ |
1192 // int i; // RAVI | 1175 // int i; // RAVI |
1193 | |
1194 | 1176 |
1195 win_data = getWinData(win); | 1177 win_data = getWinData(win); |
1196 data = getUserData_T_SMSREAD_R(win_data); | 1178 data = getUserData_T_SMSREAD_R(win_data); |
1197 | 1179 |
1198 /* x0045876, 14-Aug-2006 (WR - "list_data" was set but never used)*/ | 1180 /* x0045876, 14-Aug-2006 (WR - "list_data" was set but never used)*/ |
1284 /*SPR2175, use new function for conversion*/ | 1266 /*SPR2175, use new function for conversion*/ |
1285 ATB_convert_String( MoMessage->sms_msg, input_type /*MC SPR1242*/, input_length/*SPR 1453*/, | 1267 ATB_convert_String( MoMessage->sms_msg, input_type /*MC SPR1242*/, input_length/*SPR 1453*/, |
1286 &sms_text_ascii[txt_len] , MFW_ASCII, MENU_TEXT_LENGTH-(txt_len+1), TRUE); | 1268 &sms_text_ascii[txt_len] , MFW_ASCII, MENU_TEXT_LENGTH-(txt_len+1), TRUE); |
1287 | 1269 |
1288 } | 1270 } |
1289 | |
1290 | 1271 |
1291 /* just in case */ | 1272 /* just in case */ |
1292 if (g_sms_list_counter >= 0) | 1273 if (g_sms_list_counter >= 0) |
1293 { | 1274 { |
1294 list_data->sms_header[g_sms_list_counter] = (wstring_t *) ALLOC_MEMORY (UCS2_MENU_TEXT_LEN + 1/*MC SPR1242*/); | 1275 list_data->sms_header[g_sms_list_counter] = (wstring_t *) ALLOC_MEMORY (UCS2_MENU_TEXT_LEN + 1/*MC SPR1242*/); |
1538 | 1519 |
1539 $Function: retry_sms_read. Added for SPR2260 | 1520 $Function: retry_sms_read. Added for SPR2260 |
1540 | 1521 |
1541 $Description: set up a timer to re-read sms at passed index in 100ms | 1522 $Description: set up a timer to re-read sms at passed index in 100ms |
1542 | 1523 |
1543 $Returns: none | 1524 $Returns: none |
1544 | 1525 |
1545 $Arguments: index of sms to be re-read | 1526 $Arguments: index of sms to be re-read |
1546 | 1527 |
1547 *******************************************************************************/ | 1528 *******************************************************************************/ |
1548 /*a0393213 OMAPS00109953 - sms_memory parameter added - It indicates where (SIM/ME) the | 1529 /*a0393213 OMAPS00109953 - sms_memory parameter added - It indicates where (SIM/ME) the |
1558 | 1539 |
1559 $Function: retry_sms_read_tim_cb. Added for SPR2260 | 1540 $Function: retry_sms_read_tim_cb. Added for SPR2260 |
1560 | 1541 |
1561 $Description: Callback function for retry SMS read timer | 1542 $Description: Callback function for retry SMS read timer |
1562 | 1543 |
1563 $Returns: status int | 1544 $Returns: status int |
1564 | 1545 |
1565 $Arguments: event, timer data structure | 1546 $Arguments: event, timer data structure |
1566 | 1547 |
1567 *******************************************************************************/ | 1548 *******************************************************************************/ |
1568 int retry_sms_read_tim_cb(MfwEvt event, MfwTim *timer_info) | 1549 int retry_sms_read_tim_cb(MfwEvt event, MfwTim *timer_info) |
1581 | 1562 |
1582 $Function: SmsRead_R_smslist_cb | 1563 $Function: SmsRead_R_smslist_cb |
1583 | 1564 |
1584 $Description: Callback function for the dynamic list of the SMS read window. | 1565 $Description: Callback function for the dynamic list of the SMS read window. |
1585 | 1566 |
1586 $Returns: none | 1567 $Returns: none |
1587 | 1568 |
1588 $Arguments: Parent - window handler | 1569 $Arguments: Parent - window handler |
1589 ListData - Menu list data. | 1570 ListData - Menu list data. |
1590 | 1571 |
1591 *******************************************************************************/ | 1572 *******************************************************************************/ |
1592 | 1573 |
1593 void SmsRead_R_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData) | 1574 void SmsRead_R_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData) |
1594 { | 1575 { |
1595 | |
1596 | |
1597 | |
1598 T_MFW_WIN * win_data; | 1576 T_MFW_WIN * win_data; |
1599 T_SMSREAD_R * data; | 1577 T_SMSREAD_R * data; |
1600 | 1578 |
1601 // T_MFW_HND * l_parent; // RAVI | 1579 // T_MFW_HND * l_parent; // RAVI |
1602 // SHORT l_id; // RAVI | 1580 // SHORT l_id; // RAVI |
1603 | |
1604 | 1581 |
1605 TRACE_FUNCTION("SmsRead_R_smslist_cb "); | 1582 TRACE_FUNCTION("SmsRead_R_smslist_cb "); |
1606 | 1583 |
1607 win_data = getWinData(Parent); | 1584 win_data = getWinData(Parent); |
1608 data = getUserData_T_SMSREAD_R(win_data); | 1585 data = getUserData_T_SMSREAD_R(win_data); |
1709 /******************************************************************************* | 1686 /******************************************************************************* |
1710 | 1687 |
1711 $Function: SmsRead_R_dialog_cb | 1688 $Function: SmsRead_R_dialog_cb |
1712 | 1689 |
1713 $Description: Dialog callback function of the SMS read window (dynamic list of all the SMS) | 1690 $Description: Dialog callback function of the SMS read window (dynamic list of all the SMS) |
1714 Case where SMS has not been initialized yet | 1691 Case where SMS has not been initialized yet |
1715 | 1692 |
1716 $Returns: status | 1693 $Returns: status |
1717 | 1694 |
1718 $Arguments: win - current window handler | 1695 $Arguments: win - current window handler |
1719 Identifier - window id | 1696 Identifier - window id |
1720 Reason - Event cause. | 1697 Reason - Event cause. |
1721 | 1698 |
1722 *******************************************************************************/ | 1699 *******************************************************************************/ |
1723 | 1700 |
1724 int SmsRead_R_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) | 1701 int SmsRead_R_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) |
1725 { | 1702 { |
1726 T_MFW_WIN * win_data; | 1703 T_MFW_WIN * win_data; |
1727 T_SMSREAD_R * data; | 1704 T_SMSREAD_R * data; |
1728 T_MFW_HND *lparent; | 1705 T_MFW_HND *lparent; |
1729 | 1706 |
1730 win_data = getWinData(win); | 1707 win_data = getWinData(win); |
1731 data = getUserData_T_SMSREAD_R(win_data); | 1708 data = getUserData_T_SMSREAD_R(win_data); |
1732 lparent = data->parent; | 1709 lparent = data->parent; |
1733 | 1710 |
1734 TRACE_FUNCTION ("SmsRead_dialog_cb()"); | 1711 TRACE_FUNCTION ("SmsRead_dialog_cb()"); |
1735 | 1712 |
1736 switch (Reason) | 1713 switch (Reason) |
1737 { | 1714 { |
1759 | 1736 |
1760 $Function: SmsRead_R_BuildList | 1737 $Function: SmsRead_R_BuildList |
1761 | 1738 |
1762 $Description: Build the list of SMS for the dynamic list. | 1739 $Description: Build the list of SMS for the dynamic list. |
1763 | 1740 |
1764 $Returns: status | 1741 $Returns: status |
1765 | 1742 |
1766 $Arguments: win - current window handler | 1743 $Arguments: win - current window handler |
1767 | 1744 |
1768 *******************************************************************************/ | 1745 *******************************************************************************/ |
1769 | 1746 |
1770 void SmsRead_R_BuildList(T_MFW_HND win, int inUnicode) | 1747 void SmsRead_R_BuildList(T_MFW_HND win, int inUnicode) |
1771 { | 1748 { |
1772 | |
1773 T_MFW_WIN * win_data; | 1749 T_MFW_WIN * win_data; |
1774 T_SMSREAD_R * data; | 1750 T_SMSREAD_R * data; |
1775 | 1751 |
1776 /* List is complete so present menu. */ | 1752 /* List is complete so present menu. */ |
1777 USHORT i; | 1753 USHORT i; |
1794 if(data->menu_list_data->List == 0) | 1770 if(data->menu_list_data->List == 0) |
1795 { | 1771 { |
1796 TRACE_EVENT("Failed memory alloc 2"); | 1772 TRACE_EVENT("Failed memory alloc 2"); |
1797 return; | 1773 return; |
1798 } | 1774 } |
1799 | |
1800 | 1775 |
1801 for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) | 1776 for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++) |
1802 { | 1777 { |
1803 mnuInitDataItem(&data->menu_list_data->List[i]); | 1778 mnuInitDataItem(&data->menu_list_data->List[i]); |
1804 data->menu_list_data->List[i].str = (char *)(data->sms_list_data).sms_header[i]; | 1779 data->menu_list_data->List[i].str = (char *)(data->sms_list_data).sms_header[i]; |
1831 info_win = 0; | 1806 info_win = 0; |
1832 } | 1807 } |
1833 } | 1808 } |
1834 | 1809 |
1835 | 1810 |
1836 | |
1837 /******************************************************************************* | 1811 /******************************************************************************* |
1838 | 1812 |
1839 $Function: SmsRead_R_OPTExeDelete | 1813 $Function: SmsRead_R_OPTExeDelete |
1840 | 1814 |
1841 $Description: Called when the user press Delete in the Option menu | 1815 $Description: Called when the user press Delete in the Option menu |
1842 | 1816 |
1843 $Returns: event status. | 1817 $Returns: event status. |
1844 | 1818 |
1845 $Arguments: m - pointer to menu. | 1819 $Arguments: m - pointer to menu. |
1846 i - index if selected menu item. | 1820 i - index if selected menu item. |
1847 *******************************************************************************/ | 1821 *******************************************************************************/ |
1848 | 1822 |
1849 static int SmsRead_R_OPTExeDelete(MfwMnu* m, MfwMnuItem* item) | 1823 static int SmsRead_R_OPTExeDelete(MfwMnu* m, MfwMnuItem* item) |
1850 { | 1824 { |
1851 T_MFW_HND win = mfwParent(mfw_header()); | 1825 T_MFW_HND win = mfwParent(mfw_header()); |
1852 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1826 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1853 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 1827 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
1854 | 1828 |
1855 /* access to data from parent */ | 1829 /* access to data from parent */ |
1856 T_MFW_HDR * parent = data->parent; | 1830 T_MFW_HDR * parent = data->parent; |
1935 | 1909 |
1936 $Function: SmsRead_R_OPTExeReply | 1910 $Function: SmsRead_R_OPTExeReply |
1937 | 1911 |
1938 $Description: Called when the user press Reply in the Option menu | 1912 $Description: Called when the user press Reply in the Option menu |
1939 | 1913 |
1940 $Returns: event status. | 1914 $Returns: event status. |
1941 | 1915 |
1942 $Arguments: m - pointer to menu. | 1916 $Arguments: m - pointer to menu. |
1943 i - index if selected menu item. | 1917 i - index if selected menu item. |
1944 *******************************************************************************/ | 1918 *******************************************************************************/ |
1945 | 1919 |
1946 static int SmsRead_R_OPTExeReply(MfwMnu* m, MfwMnuItem* i) | 1920 static int SmsRead_R_OPTExeReply(MfwMnu* m, MfwMnuItem* i) |
1947 { | 1921 { |
1948 | |
1949 T_MFW_HND win = mfwParent(mfw_header()); | 1922 T_MFW_HND win = mfwParent(mfw_header()); |
1950 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1923 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1951 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 1924 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
1952 | 1925 |
1953 T_MFW_HDR * parent = data->parent; | 1926 T_MFW_HDR * parent = data->parent; |
1954 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; | 1927 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; |
1955 | 1928 |
1956 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; | 1929 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; |
1957 // March 2, 2005 REF: CRR 11536 x0018858 | 1930 // March 2, 2005 REF: CRR 11536 x0018858 |
1958 // T_MFW_SMS_INFO sms_parameter;//Added for retreiving the Reply path. // RAVI | 1931 // T_MFW_SMS_INFO sms_parameter;//Added for retreiving the Reply path. // RAVI |
1959 | |
1960 | 1932 |
1961 TRACE_FUNCTION("SmsRead_R_OPTExeReply"); | 1933 TRACE_FUNCTION("SmsRead_R_OPTExeReply"); |
1962 | 1934 |
1963 /* Copy the number and name information to the SMS buffer | 1935 /* Copy the number and name information to the SMS buffer |
1964 */ | 1936 */ |
2021 | 1993 |
2022 /* p304 SH - call this after destroying editor & windows. parent_data is lost, | 1994 /* p304 SH - call this after destroying editor & windows. parent_data is lost, |
2023 so use pointer saved from above */ | 1995 so use pointer saved from above */ |
2024 SmsSend_SEND_start(win, (void *) &SmsData); | 1996 SmsSend_SEND_start(win, (void *) &SmsData); |
2025 | 1997 |
2026 | |
2027 | |
2028 | |
2029 return 1; | 1998 return 1; |
2030 } | 1999 } |
2031 | 2000 |
2032 /******************************************************************************* | 2001 /******************************************************************************* |
2033 | 2002 |
2034 $Function: SmsRead_R_OPTExeStoreNumber | 2003 $Function: SmsRead_R_OPTExeStoreNumber |
2035 | 2004 |
2036 $Description: Called when the user press Store Number in the Option menu | 2005 $Description: Called when the user press Store Number in the Option menu |
2037 | 2006 |
2038 $Returns: event status. | 2007 $Returns: event status. |
2039 | 2008 |
2040 $Arguments: m - pointer to menu. | 2009 $Arguments: m - pointer to menu. |
2041 i - index if selected menu item. | 2010 i - index if selected menu item. |
2042 *******************************************************************************/ | 2011 *******************************************************************************/ |
2043 static int SmsRead_R_OPTExeStoreNumber(MfwMnu* m, MfwMnuItem* i) | 2012 static int SmsRead_R_OPTExeStoreNumber(MfwMnu* m, MfwMnuItem* i) |
2044 { | 2013 { |
2045 T_MFW_HND win = mfwParent(mfw_header()); | 2014 T_MFW_HND win = mfwParent(mfw_header()); |
2046 T_MFW_HND win2; //Mar 27, 2006 DR:OMAPS00047813 x0035544 | 2015 T_MFW_HND win2; //Mar 27, 2006 DR:OMAPS00047813 x0035544 |
2047 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 2016 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
2048 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 2017 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
2049 T_MFW_HDR * parent = data->parent; | 2018 T_MFW_HDR * parent = data->parent; |
2050 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; | 2019 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; |
2051 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; | 2020 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; |
2052 // UBYTE found_name; /*SPR888 -SH*/ // RAVI | 2021 // UBYTE found_name; /*SPR888 -SH*/ // RAVI |
2053 //Mar 27, 2006 DR:OMAPS00047813 x0035544 | 2022 //Mar 27, 2006 DR:OMAPS00047813 x0035544 |
2054 CHAR number[MFW_NUM_LEN]; | 2023 CHAR number[MFW_NUM_LEN]; |
2055 T_MFW_PHB_TON ton; | 2024 T_MFW_PHB_TON ton; |
2056 | 2025 |
2057 TRACE_FUNCTION("SmsRead_R_OPTExeStoreNumber"); | 2026 TRACE_FUNCTION("SmsRead_R_OPTExeStoreNumber"); |
2058 | 2027 |
2059 /* Copy the number and name information to the SMS buffer | 2028 /* Copy the number and name information to the SMS buffer |
2060 */ | 2029 */ |
2135 if (win2 NEQ NULL) | 2104 if (win2 NEQ NULL) |
2136 { | 2105 { |
2137 SEND_EVENT (win2, E_INIT, 0, 0); | 2106 SEND_EVENT (win2, E_INIT, 0, 0); |
2138 } | 2107 } |
2139 | 2108 |
2140 | |
2141 return 1; | 2109 return 1; |
2142 } | 2110 } |
2143 | 2111 |
2144 /******************************************************************************* | 2112 /******************************************************************************* |
2145 | 2113 |
2146 $Function: SmsRead_R_OPTExeEdit | 2114 $Function: SmsRead_R_OPTExeEdit |
2147 | 2115 |
2148 $Description: Called when the user press Forward in the Option menu | 2116 $Description: Called when the user press Forward in the Option menu |
2149 | 2117 |
2150 $Returns: event status. | 2118 $Returns: event status. |
2151 | 2119 |
2152 $Arguments: m - pointer to menu. | 2120 $Arguments: m - pointer to menu. |
2153 i - index if selected menu item. | 2121 i - index if selected menu item. |
2154 *******************************************************************************/ | 2122 *******************************************************************************/ |
2155 | 2123 |
2156 static int SmsRead_R_OPTExeEdit(MfwMnu* m, MfwMnuItem* i) | 2124 static int SmsRead_R_OPTExeEdit(MfwMnu* m, MfwMnuItem* i) |
2157 { | 2125 { |
2158 T_MFW_HND win = mfwParent(mfw_header()); | 2126 T_MFW_HND win = mfwParent(mfw_header()); |
2288 /******************************************************************************* | 2256 /******************************************************************************* |
2289 | 2257 |
2290 $Function: SmsRead_R_READSMS_OPT_start | 2258 $Function: SmsRead_R_READSMS_OPT_start |
2291 | 2259 |
2292 $Description: Start the creation of the Option Window from the Read SMS | 2260 $Description: Start the creation of the Option Window from the Read SMS |
2293 Text window. | 2261 Text window. |
2294 | 2262 |
2295 $Returns: mfw window handler | 2263 $Returns: mfw window handler |
2296 | 2264 |
2297 $Arguments: parent_window- pointer to menu. | 2265 $Arguments: parent_window- pointer to menu. |
2298 menuAttr - menu attributes. | 2266 menuAttr - menu attributes. |
2299 *******************************************************************************/ | 2267 *******************************************************************************/ |
2300 | 2268 |
2301 T_MFW_HND SmsRead_R_READSMS_OPT_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) | 2269 T_MFW_HND SmsRead_R_READSMS_OPT_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) |
2302 { | 2270 { |
2303 /*SPR 2132, setting global var to keep track of options window*/ | 2271 /*SPR 2132, setting global var to keep track of options window*/ |
2304 | 2272 |
2305 TRACE_FUNCTION ("SmsRead_R_OPT_start()"); | 2273 TRACE_FUNCTION ("SmsRead_R_OPT_start()"); |
2306 | 2274 |
2307 option_mnu_win = SmsRead_R_OPT_create (parent_window); | 2275 option_mnu_win = SmsRead_R_OPT_create (parent_window); |
2308 | 2276 |
2309 if (option_mnu_win NEQ NULL) | 2277 if (option_mnu_win NEQ NULL) |
2310 { | 2278 { |
2311 SEND_EVENT (option_mnu_win , E_INIT, SmsRead_R_READSMS_OPT_ID, (void *)menuAttr); | 2279 SEND_EVENT (option_mnu_win , E_INIT, SmsRead_R_READSMS_OPT_ID, (void *)menuAttr); |
2312 } | 2280 } |
2313 return option_mnu_win; | 2281 return option_mnu_win; |
2314 } | 2282 } |
2315 | 2283 |
2316 /*SPR 2132, removed obsolete function*/ | 2284 /*SPR 2132, removed obsolete function*/ |
2317 /******************************************************************************* | 2285 /******************************************************************************* |
2318 | 2286 |
2319 $Function: SmsRead_R_OPT_create | 2287 $Function: SmsRead_R_OPT_create |
2320 | 2288 |
2321 $Description: Create the Options window | 2289 $Description: Create the Options window |
2322 | 2290 |
2323 $Returns: window handler | 2291 $Returns: window handler |
2324 | 2292 |
2325 $Arguments: parent_window- pointer to parent window | 2293 $Arguments: parent_window- pointer to parent window |
2326 *******************************************************************************/ | 2294 *******************************************************************************/ |
2327 | 2295 |
2328 static T_MFW_HND SmsRead_R_OPT_create(MfwHnd parent_window) | 2296 static T_MFW_HND SmsRead_R_OPT_create(MfwHnd parent_window) |
2337 */ | 2305 */ |
2338 | 2306 |
2339 data->win = | 2307 data->win = |
2340 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_OPT_win_cb); | 2308 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_OPT_win_cb); |
2341 if (data->win EQ NULL) | 2309 if (data->win EQ NULL) |
2342 { | 2310 { |
2343 return NULL; | 2311 return NULL; |
2344 } | 2312 } |
2313 | |
2345 /* | 2314 /* |
2346 * connect the dialog data to the MFW-window | 2315 * connect the dialog data to the MFW-window |
2347 */ | 2316 */ |
2348 | |
2349 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_OPT_exec_cb; | 2317 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_OPT_exec_cb; |
2350 data->mmi_control.data = data; | 2318 data->mmi_control.data = data; |
2351 win = ((T_MFW_HDR *)data->win)->data; | 2319 win = ((T_MFW_HDR *)data->win)->data; |
2352 win->user = (void *)data; | 2320 win->user = (void *)data; |
2353 data->parent = parent_window; | 2321 data->parent = parent_window; |
2363 | 2331 |
2364 $Function: SmsRead_R_OPT_destroy | 2332 $Function: SmsRead_R_OPT_destroy |
2365 | 2333 |
2366 $Description: Destroy the Option window | 2334 $Description: Destroy the Option window |
2367 | 2335 |
2368 $Returns: none | 2336 $Returns: none |
2369 | 2337 |
2370 $Arguments: own_window- current window | 2338 $Arguments: own_window- current window |
2371 *******************************************************************************/ | 2339 *******************************************************************************/ |
2372 | 2340 |
2373 static void SmsRead_R_OPT_destroy(MfwHnd own_window) | 2341 static void SmsRead_R_OPT_destroy(MfwHnd own_window) |
2376 T_SMSREAD_R_OPT * data; | 2344 T_SMSREAD_R_OPT * data; |
2377 | 2345 |
2378 TRACE_FUNCTION ("SmsRead_R_OPT_destroy()"); | 2346 TRACE_FUNCTION ("SmsRead_R_OPT_destroy()"); |
2379 | 2347 |
2380 if (own_window) | 2348 if (own_window) |
2381 { | 2349 { |
2382 win_data = ((T_MFW_HDR *)own_window)->data; | 2350 win_data = ((T_MFW_HDR *)own_window)->data; |
2383 data = (T_SMSREAD_R_OPT *)win_data->user; | 2351 data = (T_SMSREAD_R_OPT *)win_data->user; |
2384 | 2352 |
2385 if (data) | 2353 if (data) |
2386 { | 2354 { |
2387 /* | 2355 /* |
2388 * Delete WIN handler | 2356 * Delete WIN handler |
2389 */ | 2357 */ |
2390 win_delete (data->win); | 2358 win_delete (data->win); |
2391 | 2359 |
2392 /* | 2360 /* |
2393 * Free Memory | 2361 * Free Memory |
2394 */ | 2362 */ |
2395 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_OPT)); | 2363 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_OPT)); |
2396 option_mnu_win =0;/*SPR2132, make sure window pointer is reset*/ | 2364 option_mnu_win =0;/*SPR2132, make sure window pointer is reset*/ |
2397 } | 2365 } |
2398 else | 2366 else |
2399 { | 2367 { |
2400 TRACE_EVENT ("SmsRead_R_OPT_destroy() called twice"); | 2368 TRACE_EVENT ("SmsRead_R_OPT_destroy() called twice"); |
2401 } | 2369 } |
2402 } | 2370 } |
2403 } | 2371 } |
2404 | 2372 |
2405 /******************************************************************************* | 2373 /******************************************************************************* |
2406 | 2374 |
2407 $Function: SmsRead_R_OPT_exec_cb | 2375 $Function: SmsRead_R_OPT_exec_cb |
2408 | 2376 |
2409 $Description: Exec callback function for the Option window | 2377 $Description: Exec callback function for the Option window |
2410 | 2378 |
2411 $Returns: none | 2379 $Returns: none |
2412 | 2380 |
2413 $Arguments: win- current window | 2381 $Arguments: win- current window |
2414 event - window event Id | 2382 event - window event Id |
2415 value - unique Id | 2383 value - unique Id |
2416 parameter- optional data. | 2384 parameter- optional data. |
2417 *******************************************************************************/ | 2385 *******************************************************************************/ |
2418 | 2386 |
2419 void SmsRead_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 2387 void SmsRead_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
2420 /* callback handler for events sent to to trigger execution */ | 2388 /* callback handler for events sent to to trigger execution */ |
2421 { | 2389 { |
2422 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 2390 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
2423 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 2391 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
2424 T_MFW_HND * l_parent = NULL; // RAVI | 2392 T_MFW_HND * l_parent = NULL; // RAVI |
2425 SHORT l_id = 0; // RAVI | 2393 SHORT l_id = 0; // RAVI |
2426 | 2394 |
2427 T_MFW_EVENT MfwEvents; | 2395 T_MFW_EVENT MfwEvents; |
2428 | 2396 |
2429 TRACE_FUNCTION ("SmsRead_R_OPT_exec_cb()"); | 2397 TRACE_FUNCTION ("SmsRead_R_OPT_exec_cb()"); |
2430 | |
2431 | 2398 |
2432 switch (event) | 2399 switch (event) |
2433 { | 2400 { |
2434 case E_INIT: | 2401 case E_INIT: |
2435 TRACE_EVENT(">> SmsRead_R_OPT_exec_cb(), E_INIT "); | 2402 TRACE_EVENT(">> SmsRead_R_OPT_exec_cb(), E_INIT "); |
2506 | 2473 |
2507 $Function: SmsRead_R_OPT_mfw_cb | 2474 $Function: SmsRead_R_OPT_mfw_cb |
2508 | 2475 |
2509 $Description: Exec callback function for the DEL_ALL_ACK window | 2476 $Description: Exec callback function for the DEL_ALL_ACK window |
2510 | 2477 |
2511 $Returns: status | 2478 $Returns: status |
2512 | 2479 |
2513 $Arguments: event - window event Id | 2480 $Arguments: event - window event Id |
2514 parameter- optional data. | 2481 parameter- optional data. |
2515 *******************************************************************************/ | 2482 *******************************************************************************/ |
2516 | 2483 |
2517 int SmsRead_R_OPT_mfw_cb (MfwEvt event, void *parameter) | 2484 int SmsRead_R_OPT_mfw_cb (MfwEvt event, void *parameter) |
2518 { | 2485 { |
2519 T_MFW_HND win = mfwParent((MfwHdr *)mfw_header()); | 2486 T_MFW_HND win = mfwParent((MfwHdr *)mfw_header()); |
2520 T_MFW_WIN * win_data = (T_MFW_WIN *)((T_MFW_HDR *)win)->data; | 2487 T_MFW_WIN * win_data = (T_MFW_WIN *)((T_MFW_HDR *)win)->data; |
2521 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 2488 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
2522 // T_MFW_EVENT MfwEvents; // RAVI | 2489 // T_MFW_EVENT MfwEvents; // RAVI |
2523 | 2490 |
2524 | |
2525 TRACE_FUNCTION ("SmsRead_R_OPT_mfw_cb()"); | 2491 TRACE_FUNCTION ("SmsRead_R_OPT_mfw_cb()"); |
2526 | 2492 |
2527 switch (event) | 2493 switch (event) |
2528 { | 2494 { |
2529 | 2495 |
2554 | 2520 |
2555 $Function: SmsRead_R_OPT_mnu_cb | 2521 $Function: SmsRead_R_OPT_mnu_cb |
2556 | 2522 |
2557 $Description: Menu callback function for the Option window | 2523 $Description: Menu callback function for the Option window |
2558 | 2524 |
2559 $Returns: status | 2525 $Returns: status |
2560 | 2526 |
2561 $Arguments: e - mfw event Id | 2527 $Arguments: e - mfw event Id |
2562 m - menu handle | 2528 m - menu handle |
2563 *******************************************************************************/ | 2529 *******************************************************************************/ |
2564 | 2530 |
2565 static int SmsRead_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m) | 2531 static int SmsRead_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m) |
2566 /* SmsRead_R_OPT menu event handler */ | 2532 /* SmsRead_R_OPT menu event handler */ |
2567 { | 2533 { |
2595 | 2561 |
2596 $Function: SmsRead_R_OPT_win_cb | 2562 $Function: SmsRead_R_OPT_win_cb |
2597 | 2563 |
2598 $Description: Window callback function for the Option window | 2564 $Description: Window callback function for the Option window |
2599 | 2565 |
2600 $Returns: status | 2566 $Returns: status |
2601 | 2567 |
2602 $Arguments: e - mfw event Id | 2568 $Arguments: e - mfw event Id |
2603 w - window handler | 2569 w - window handler |
2604 *******************************************************************************/ | 2570 *******************************************************************************/ |
2605 | 2571 |
2606 static int SmsRead_R_OPT_win_cb (MfwEvt e, MfwWin *w) | 2572 static int SmsRead_R_OPT_win_cb (MfwEvt e, MfwWin *w) |
2607 /* SmsRead_R_OPT window event handler */ | 2573 /* SmsRead_R_OPT window event handler */ |
2608 { | 2574 { |
2625 | 2591 |
2626 $Function: SmsRead_R_OPT_kbd_cb | 2592 $Function: SmsRead_R_OPT_kbd_cb |
2627 | 2593 |
2628 $Description: Exec callback function for the Option window | 2594 $Description: Exec callback function for the Option window |
2629 | 2595 |
2630 $Returns: status | 2596 $Returns: status |
2631 | 2597 |
2632 $Arguments: e - keyboard event Id | 2598 $Arguments: e - keyboard event Id |
2633 k - keyboard data | 2599 k - keyboard data |
2634 *******************************************************************************/ | 2600 *******************************************************************************/ |
2635 | 2601 |
2636 static int SmsRead_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k) | 2602 static int SmsRead_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k) |
2637 /* SmsRead_R_OPT keyboard event handler */ | 2603 /* SmsRead_R_OPT keyboard event handler */ |
2638 { | 2604 { |
2683 /******************************************************************************* | 2649 /******************************************************************************* |
2684 | 2650 |
2685 $Function: SmsRead_R_OPT_dialog_cb | 2651 $Function: SmsRead_R_OPT_dialog_cb |
2686 | 2652 |
2687 $Description: Dialog callback function of the SMS read window (dynamic list | 2653 $Description: Dialog callback function of the SMS read window (dynamic list |
2688 of all the SMS). Case where SMS has not been initialized yet. | 2654 of all the SMS). Case where SMS has not been initialized yet. |
2689 | 2655 |
2690 $Returns: status | 2656 $Returns: status |
2691 | 2657 |
2692 $Arguments: win - window handler. | 2658 $Arguments: win - window handler. |
2693 Identifier - unique identifier. | 2659 Identifier - unique identifier. |
2694 Reason - cause of event. | 2660 Reason - cause of event. |
2695 *******************************************************************************/ | 2661 *******************************************************************************/ |
2696 | 2662 |
2697 int SmsRead_R_OPT_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) | 2663 int SmsRead_R_OPT_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) |
2698 { | 2664 { |
2699 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 2665 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
2700 T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; | 2666 T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; |
2701 T_MFW_HND *lparent = data->parent; | 2667 T_MFW_HND *lparent = data->parent; |
2702 | 2668 |
2703 TRACE_FUNCTION ("SmsRead_dialog_cb()"); | 2669 TRACE_FUNCTION ("SmsRead_dialog_cb()"); |
2704 | 2670 |
2705 switch (Reason) | 2671 switch (Reason) |
2706 { | 2672 { |
2707 case INFO_TIMEOUT: | 2673 case INFO_TIMEOUT: |
2708 case INFO_KCD_HUP: | 2674 case INFO_KCD_HUP: |
2709 // Commit suicide | 2675 // Commit suicide |
2710 SmsRead_R_OPT_destroy(win); | 2676 SmsRead_R_OPT_destroy(win); |
2711 // Send E_RETURN event to parent window | 2677 // Send E_RETURN event to parent window |
2712 SEND_EVENT(lparent, E_RETURN, data->id, NULL); | 2678 SEND_EVENT(lparent, E_RETURN, data->id, NULL); |
2713 return MFW_EVENT_CONSUMED; | 2679 return MFW_EVENT_CONSUMED; |
2714 | 2680 |
2715 default: | 2681 default: |
2716 return MFW_EVENT_REJECTED; | 2682 return MFW_EVENT_REJECTED; |
2717 } | 2683 } |
2718 } | 2684 } |
2719 | 2685 |
2720 /******************************************************************************* | 2686 /******************************************************************************* |
2721 | 2687 |
2722 $Function: SmsRead_DisplayStandardDialog | 2688 $Function: SmsRead_DisplayStandardDialog |
2723 | 2689 |
2724 $Description: Display a standard dialog with no soft key and 3 seconds of display | 2690 $Description: Display a standard dialog with no soft key and 3 seconds of display |
2725 | 2691 |
2726 $Returns: none | 2692 $Returns: none |
2727 | 2693 |
2728 $Arguments: win - window handler. | 2694 $Arguments: win - window handler. |
2729 text - text string. | 2695 text - text string. |
2730 duration - seconds | 2696 duration - seconds |
2731 *******************************************************************************/ | 2697 *******************************************************************************/ |
2732 | 2698 |
2733 void SmsRead_DisplayStandardDialog(T_MFW_HND win, int TextId, ULONG duration) | 2699 void SmsRead_DisplayStandardDialog(T_MFW_HND win, int TextId, ULONG duration) |
2734 { | 2700 { |
2735 T_DISPLAY_DATA DisplayInfo; | 2701 T_DISPLAY_DATA DisplayInfo; |
2736 | 2702 |
2737 SmsMenu_loadDialogDefault(&DisplayInfo); | 2703 SmsMenu_loadDialogDefault(&DisplayInfo); |
2738 | 2704 |
2739 DisplayInfo.TextId = TextId; | 2705 DisplayInfo.TextId = TextId; |
2740 DisplayInfo.Time = duration; | 2706 DisplayInfo.Time = duration; |
2741 DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb; | 2707 DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb; |
2742 | 2708 |
2743 // Dec 15,2004 REF: CRR 24396 xkundadu | 2709 // Dec 15,2004 REF: CRR 24396 xkundadu |
2744 // Description: Phone crashes when a message is received while the | 2710 // Description: Phone crashes when a message is received while the |
2745 // 'List Empty' dialog is displayed. | 2711 // 'List Empty' dialog is displayed. |
2746 | 2712 |
2747 // set the variable to TRUE since 'List empty' dialog is going to display. | 2713 // set the variable to TRUE since 'List empty' dialog is going to display. |
2748 SmsListEmptyDlgPresent = TRUE; | 2714 SmsListEmptyDlgPresent = TRUE; |
2749 info_dialog(win, &DisplayInfo); | 2715 info_dialog(win, &DisplayInfo); |
2750 } | 2716 } |
2751 | 2717 |
2752 /******************************************************************************* | 2718 /******************************************************************************* |
2753 | 2719 |
2754 $Function: SmsRead_R_OPT_StandardDialog | 2720 $Function: SmsRead_R_OPT_StandardDialog |
2755 | 2721 |
2756 $Description: Display a standard dialog with no soft key and 3 seconds of display | 2722 $Description: Display a standard dialog with no soft key and 3 seconds of display |
2757 | 2723 |
2758 $Returns: none | 2724 $Returns: none |
2759 | 2725 |
2760 $Arguments: win - window handler. | 2726 $Arguments: win - window handler. |
2761 text - text string. | 2727 text - text string. |
2762 duration - seconds | 2728 duration - seconds |
2763 *******************************************************************************/ | 2729 *******************************************************************************/ |
2764 | 2730 |
2765 void SmsRead_R_OPT_StandardDialog(T_MFW_HND win, char *text, ULONG duration) | 2731 void SmsRead_R_OPT_StandardDialog(T_MFW_HND win, char *text, ULONG duration) |
2766 { | 2732 { |
2767 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 2733 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
2768 T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; | 2734 T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user; |
2769 | 2735 |
2770 T_DISPLAY_DATA DisplayInfo; | 2736 T_DISPLAY_DATA DisplayInfo; |
2771 | 2737 |
2772 SmsMenu_loadDialogDefault(&DisplayInfo); | 2738 SmsMenu_loadDialogDefault(&DisplayInfo); |
2773 | 2739 |
2774 DisplayInfo.TextId = 0; | 2740 DisplayInfo.TextId = 0; |
2775 DisplayInfo.Time = duration; | 2741 DisplayInfo.Time = duration; |
2776 DisplayInfo.TextString = text; | 2742 DisplayInfo.TextString = text; |
2777 DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_OPT_dialog_cb; //TBD | 2743 DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_OPT_dialog_cb; //TBD |
2778 | 2744 |
2779 data->dialog_win = info_dialog(win, &DisplayInfo); | 2745 data->dialog_win = info_dialog(win, &DisplayInfo); |
2780 } | 2746 } |
2781 | 2747 |
2782 | 2748 |
2787 | 2753 |
2788 $Function: string_CopyW2W | 2754 $Function: string_CopyW2W |
2789 | 2755 |
2790 $Description: | 2756 $Description: |
2791 | 2757 |
2792 $Returns: none | 2758 $Returns: none |
2793 | 2759 |
2794 $Arguments: strDestination - destination string | 2760 $Arguments: strDestination - destination string |
2795 strSource - source string | 2761 strSource - source string |
2796 count -number of character. | 2762 count -number of character. |
2797 *******************************************************************************/ | 2763 *******************************************************************************/ |
2798 | 2764 |
2799 void string_CopyW2W(wstring_t *strDestination, charw_t *strSource, USHORT count ) | 2765 void string_CopyW2W(wstring_t *strDestination, charw_t *strSource, USHORT count ) |
2800 // Copy characters of an ascii string to a wide counted string | 2766 // Copy characters of an ascii string to a wide counted string |
2801 { | 2767 { |
2810 /******************************************************************************* | 2776 /******************************************************************************* |
2811 | 2777 |
2812 $Function: SmsRead_R_TEXTEDT2_start | 2778 $Function: SmsRead_R_TEXTEDT2_start |
2813 | 2779 |
2814 $Description: Start the creation of the SMS editor window (display of the text | 2780 $Description: Start the creation of the SMS editor window (display of the text |
2815 of one SMS) | 2781 of one SMS) |
2816 | 2782 |
2817 $Returns: win - window handler. | 2783 $Returns: win - window handler. |
2818 | 2784 |
2819 $Arguments: parent_window - current window handler | 2785 $Arguments: parent_window - current window handler |
2820 data - Menu attributes. | 2786 data - Menu attributes. |
2821 | 2787 |
2822 *******************************************************************************/ | 2788 *******************************************************************************/ |
2823 | 2789 |
2824 T_MFW_HND SmsRead_R_TEXTEDT2_start(T_MFW_HND parent_window, MfwMnuAttr *data) | 2790 T_MFW_HND SmsRead_R_TEXTEDT2_start(T_MFW_HND parent_window, MfwMnuAttr *data) |
2825 { | 2791 { |
2826 /*SPR 2132, use global var*/ | 2792 /*SPR 2132, use global var*/ |
2827 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_start()"); | 2793 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_start()"); |
2828 | 2794 |
2829 message_win = SmsRead_R_TEXTEDT2_create (parent_window); | 2795 message_win = SmsRead_R_TEXTEDT2_create (parent_window); |
2830 | 2796 |
2831 if (message_win NEQ NULL) | 2797 if (message_win NEQ NULL) |
2832 { | 2798 { |
2833 SEND_EVENT (message_win, E_INIT, SmsRead_R_TEXTEDT2_ID, (void *)data); | 2799 SEND_EVENT (message_win, E_INIT, SmsRead_R_TEXTEDT2_ID, (void *)data); |
2834 } | 2800 } |
2835 return message_win; | 2801 return message_win; |
2836 } | 2802 } |
2837 | 2803 |
2838 /******************************************************************************* | 2804 /******************************************************************************* |
2839 | 2805 |
2840 $Function: SmsRead_R_TEXTEDT2_create | 2806 $Function: SmsRead_R_TEXTEDT2_create |
2841 | 2807 |
2842 $Description: Create the SMS editor window (display of the text of one SMS) | 2808 $Description: Create the SMS editor window (display of the text of one SMS) |
2843 | 2809 |
2844 $Returns: window handler. | 2810 $Returns: window handler. |
2845 | 2811 |
2846 $Arguments: parent_window - current window handler | 2812 $Arguments: parent_window - current window handler |
2847 | 2813 |
2848 *******************************************************************************/ | 2814 *******************************************************************************/ |
2849 | 2815 |
2859 */ | 2825 */ |
2860 | 2826 |
2861 data->win = | 2827 data->win = |
2862 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_TEXTEDT2_win_cb); | 2828 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_TEXTEDT2_win_cb); |
2863 if (data->win EQ NULL) | 2829 if (data->win EQ NULL) |
2864 { | 2830 { |
2865 return NULL; | 2831 return NULL; |
2866 } | 2832 } |
2833 | |
2867 /* | 2834 /* |
2868 * connect the dialog data to the MFW-window | 2835 * connect the dialog data to the MFW-window |
2869 */ | 2836 */ |
2870 | |
2871 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_TEXTEDT2_exec_cb; | 2837 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsRead_R_TEXTEDT2_exec_cb; |
2872 data->mmi_control.data = data; | 2838 data->mmi_control.data = data; |
2873 win = ((T_MFW_HDR *)data->win)->data; | 2839 win = ((T_MFW_HDR *)data->win)->data; |
2874 win->user = (void *)data; | 2840 win->user = (void *)data; |
2875 data->parent = parent_window; | 2841 data->parent = parent_window; |
2876 | 2842 |
2877 /* | 2843 /* |
2878 * return window handle | 2844 * return window handle |
2879 */ | 2845 */ |
2880 winShow(data->win); | 2846 winShow(data->win); |
2881 return data->win; | 2847 return data->win; |
2882 } | 2848 } |
2883 | 2849 |
2884 /******************************************************************************* | 2850 /******************************************************************************* |
2885 | 2851 |
2886 $Function: SmsRead_R_TEXTEDT2_destroy | 2852 $Function: SmsRead_R_TEXTEDT2_destroy |
2887 | 2853 |
2888 $Description: Destroy the SMS editor window (display of the text of one SMS) | 2854 $Description: Destroy the SMS editor window (display of the text of one SMS) |
2889 | 2855 |
2890 $Returns: none | 2856 $Returns: none |
2891 | 2857 |
2892 $Arguments: own_window - current window handler | 2858 $Arguments: own_window - current window handler |
2893 | 2859 |
2894 *******************************************************************************/ | 2860 *******************************************************************************/ |
2895 | 2861 |
2901 // USHORT i; // RAVI | 2867 // USHORT i; // RAVI |
2902 | 2868 |
2903 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); | 2869 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); |
2904 | 2870 |
2905 if (own_window) | 2871 if (own_window) |
2906 { | 2872 { |
2907 win_data = ((T_MFW_HDR *)own_window)->data; | 2873 win_data = ((T_MFW_HDR *)own_window)->data; |
2908 data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; | 2874 data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; |
2909 | 2875 |
2910 if (data) | 2876 if (data) |
2911 { | 2877 { |
2912 /* | 2878 /* |
2913 * Delete WIN handler | 2879 * Delete WIN handler |
2914 */ | 2880 */ |
2915 | 2881 |
2916 /* SPR#1428 - SH - New Editor changes */ | 2882 /* SPR#1428 - SH - New Editor changes */ |
2917 #ifdef NEW_EDITOR | 2883 #ifdef NEW_EDITOR |
2918 AUI_edit_Destroy(data->editor_win); | 2884 AUI_edit_Destroy(data->editor_win); |
2919 #else /* NEW_EDITOR */ | 2885 #else /* NEW_EDITOR */ |
2920 editor_destroy(data->editor_win); | 2886 editor_destroy(data->editor_win); |
2921 #endif /* NEW_EDITOR */ | 2887 #endif /* NEW_EDITOR */ |
2922 | 2888 |
2923 win_delete (data->win); | 2889 win_delete (data->win); |
2924 | 2890 |
2925 | 2891 FREE_MEMORY ((void *)data->sms_editor_data->sms_info, sizeof (T_MFW_SMS_PARA)); |
2926 | 2892 |
2927 FREE_MEMORY ((void *)data->sms_editor_data->sms_info, sizeof (T_MFW_SMS_PARA)); | 2893 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_TEXTEDT2)); |
2928 | 2894 |
2929 FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_TEXTEDT2)); | 2895 message_win = 0; /*SPR2132, make sure window pointer is reset*/ |
2930 | 2896 } |
2931 message_win = 0; /*SPR2132, make sure window pointer is reset*/ | 2897 else |
2932 } | 2898 { |
2933 else | 2899 TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); |
2934 { | 2900 } |
2935 TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); | 2901 } |
2936 } | |
2937 } | |
2938 } | 2902 } |
2939 | 2903 |
2940 /******************************************************************************* | 2904 /******************************************************************************* |
2941 | 2905 |
2942 $Function: SmsRead_R_TEXT_editor_cb | 2906 $Function: SmsRead_R_TEXT_editor_cb |
2943 | 2907 |
2944 $Description: Callback function for the text editor | 2908 $Description: Callback function for the text editor |
2945 | 2909 |
2946 $Returns: none | 2910 $Returns: none |
2947 | 2911 |
2948 $Arguments: win - current window handler | 2912 $Arguments: win - current window handler |
2949 Identifier -Unique identifier. | 2913 Identifier -Unique identifier. |
2950 reason - event | 2914 reason - event |
2951 *******************************************************************************/ | 2915 *******************************************************************************/ |
2952 | 2916 |
2953 static void SmsRead_R_TEXT_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) | 2917 static void SmsRead_R_TEXT_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) |
2954 { | 2918 { |
2955 T_MFW_PHB_ENTRY pb_data; | 2919 T_MFW_PHB_ENTRY pb_data; |
2964 /* T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; */ | 2928 /* T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; */ |
2965 | 2929 |
2966 // T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; // RAVI | 2930 // T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; // RAVI |
2967 | 2931 |
2968 // T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL; // RAVI | 2932 // T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL; // RAVI |
2969 | |
2970 | 2933 |
2971 TRACE_FUNCTION ("SmsRead_R_TEXT_editor_cb()"); | 2934 TRACE_FUNCTION ("SmsRead_R_TEXT_editor_cb()"); |
2972 | 2935 |
2973 switch (reason) | 2936 switch (reason) |
2974 { | 2937 { |
3036 /* Marcus: Issue 1041: 05/09/2002: End */ | 2999 /* Marcus: Issue 1041: 05/09/2002: End */ |
3037 TRACE_EVENT_P1("Number is = %d",(int)pb_data.number); | 3000 TRACE_EVENT_P1("Number is = %d",(int)pb_data.number); |
3038 callNumber(pb_data.number); | 3001 callNumber(pb_data.number); |
3039 break; | 3002 break; |
3040 | 3003 |
3041 | |
3042 default: | 3004 default: |
3043 TRACE_EVENT("Err: Default No match found"); | 3005 TRACE_EVENT("Err: Default No match found"); |
3044 break; | 3006 break; |
3045 } | 3007 } |
3046 } | 3008 } |
3048 /******************************************************************************* | 3010 /******************************************************************************* |
3049 | 3011 |
3050 $Function: SmsRead_R_TEXTEDT2_exec_cb | 3012 $Function: SmsRead_R_TEXTEDT2_exec_cb |
3051 | 3013 |
3052 $Description: Exec callback function of the SMS editor window (display of the | 3014 $Description: Exec callback function of the SMS editor window (display of the |
3053 text of one SMS) | 3015 text of one SMS) |
3054 | 3016 |
3055 $Returns: none | 3017 $Returns: none |
3056 | 3018 |
3057 $Arguments: win - current window handler | 3019 $Arguments: win - current window handler |
3058 event - event id | 3020 event - event id |
3059 value - unique id | 3021 value - unique id |
3060 parameter - optional data. | 3022 parameter - optional data. |
3061 *******************************************************************************/ | 3023 *******************************************************************************/ |
3062 | 3024 |
3063 void SmsRead_R_TEXTEDT2_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 3025 void SmsRead_R_TEXTEDT2_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
3064 /* callback handler for events sent to to trigger execution */ | 3026 /* callback handler for events sent to to trigger execution */ |
3065 { | 3027 { |
3597 /******************************************************************************* | 3559 /******************************************************************************* |
3598 | 3560 |
3599 $Function: SmsRead_R_TEXTEDT2_win_cb | 3561 $Function: SmsRead_R_TEXTEDT2_win_cb |
3600 | 3562 |
3601 $Description: Window callback function of the SMS editor window (display of | 3563 $Description: Window callback function of the SMS editor window (display of |
3602 the text of one SMS). | 3564 the text of one SMS). |
3603 | 3565 |
3604 $Returns: execution status | 3566 $Returns: execution status |
3605 | 3567 |
3606 $Arguments: w - mfw window handle | 3568 $Arguments: w - mfw window handle |
3607 e - event id | 3569 e - event id |
3608 value - unique id | 3570 value - unique id |
3609 parameter - optional data. | 3571 parameter - optional data. |
3610 *******************************************************************************/ | 3572 *******************************************************************************/ |
3611 | 3573 |
3612 static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w) | 3574 static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w) |
3613 /* window event handler */ | 3575 /* window event handler */ |
3614 { | 3576 { |
3624 default: | 3586 default: |
3625 return MFW_EVENT_REJECTED; | 3587 return MFW_EVENT_REJECTED; |
3626 } | 3588 } |
3627 return MFW_EVENT_CONSUMED; | 3589 return MFW_EVENT_CONSUMED; |
3628 } | 3590 } |
3629 #if(0) /* x0039928 - Lint warning fix */ | 3591 |
3630 /******************************************************************************* | |
3631 | |
3632 $Function: SmsRead_R_TEXTEDT2_smslist_cb | |
3633 | |
3634 $Description: Callback function of the SMS editor window (editor itself). | |
3635 | |
3636 $Returns: none | |
3637 | |
3638 $Arguments: Parent - parent window. | |
3639 ListData - Menu item list | |
3640 *******************************************************************************/ | |
3641 | |
3642 void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData) | |
3643 { | |
3644 T_MFW_WIN * win_data = ((T_MFW_HDR *)Parent)->data; | |
3645 T_SMSREAD_R * data = (T_SMSREAD_R *)win_data->user; | |
3646 | |
3647 T_MFW_HND * l_parent; | |
3648 SHORT l_id; | |
3649 | |
3650 if ((ListData->Reason EQ LISTS_REASON_BACK) || (ListData->Reason EQ LISTS_REASON_CLEAR) | |
3651 || (ListData->Reason EQ LISTS_REASON_HANGUP)) | |
3652 { | |
3653 l_parent = data->parent; | |
3654 l_id = data->id; | |
3655 SmsRead_R_destroy(data->win); | |
3656 //The editor has sent an back event, we return to the previous window (E_RETURN) | |
3657 SEND_EVENT (l_parent, E_RETURN, l_id, NULL); | |
3658 } | |
3659 } | |
3660 #endif | |
3661 /******************************************************************************* | 3592 /******************************************************************************* |
3662 | 3593 |
3663 $Function: check_assoc_name | 3594 $Function: check_assoc_name |
3664 | 3595 |
3665 $Description: This function search if a phone number corresponds to any name in phonebook | 3596 $Description: This function search if a phone number corresponds to any name in phonebook |
3666 or to the voice mailbox or to the SMS center | 3597 or to the voice mailbox or to the SMS center |
3667 BE CAREFUL it allocates memory for the name, that has to be freed by the caller | 3598 BE CAREFUL it allocates memory for the name, that has to be freed by the caller |
3668 It returns the length of the associated name if found, else length is 0 and name is NULL | 3599 It returns the length of the associated name if found, else length is 0 and name is NULL |
3669 | 3600 |
3670 $Returns: string length | 3601 $Returns: string length |
3671 | 3602 |
3672 $Arguments: name - string | 3603 $Arguments: name - string |
3673 sms_addr - phonenumber string. | 3604 sms_addr - phonenumber string. |
3674 *******************************************************************************/ | 3605 *******************************************************************************/ |
3675 | 3606 |
3676 UBYTE check_assoc_name(char *name, T_MFW_SMS_ADDR sms_addr) | 3607 UBYTE check_assoc_name(char *name, T_MFW_SMS_ADDR sms_addr) |
3677 { | 3608 { |
3678 // MZ T_MFW_SMS_STAT pb_entry; | 3609 // MZ T_MFW_SMS_STAT pb_entry; |
3679 T_MFW_SMS_ADDR pb_entry; | 3610 T_MFW_SMS_ADDR pb_entry; |
3680 USHORT i; | 3611 USHORT i; |
3681 | |
3682 | |
3683 | 3612 |
3684 // TBD: add international numbers management | 3613 // TBD: add international numbers management |
3685 | 3614 |
3686 // Voice, fax... mailboxes data | 3615 // Voice, fax... mailboxes data |
3687 | 3616 |
3738 } | 3667 } |
3739 } | 3668 } |
3740 return 1; // RAVI | 3669 return 1; // RAVI |
3741 } | 3670 } |
3742 | 3671 |
3743 #if(0) /* x0039928 - Lint warning fix */ | |
3744 /******************************************************************************* | |
3745 | |
3746 $Function: SmsRead_R_TEXTEDT2_editor_cb | |
3747 | |
3748 $Description: Callback function for the text editor. | |
3749 | |
3750 $Returns: void | |
3751 | |
3752 $Arguments: win - current window. | |
3753 Identifier - unique id | |
3754 Reason - event id | |
3755 *******************************************************************************/ | |
3756 | |
3757 void SmsRead_R_TEXTEDT2_editor_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) | |
3758 { | |
3759 | |
3760 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
3761 T_SMSREAD_R_TEXTEDT2 * data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user; | |
3762 | |
3763 TRACE_FUNCTION("SmsRead_R_TEXTEDT2_editor_cb"); | |
3764 switch (Reason) | |
3765 { | |
3766 case INFO_KCD_LEFT: | |
3767 case INFO_KCD_RIGHT: | |
3768 case INFO_KCD_HUP: | |
3769 SEND_EVENT (data->parent, E_RETURN, Identifier, NULL); /* forward event to parent */ | |
3770 break; | |
3771 default: | |
3772 break; | |
3773 } | |
3774 } | |
3775 #endif | |
3776 | 3672 |
3777 /******************************************************************************* | 3673 /******************************************************************************* |
3778 | 3674 |
3779 $Function: SmsRead_FindNextNumber_cb | 3675 $Function: SmsRead_FindNextNumber_cb |
3780 | 3676 |
3781 $Description: Exec callback function for searching the SMS text message. | 3677 $Description: Exec callback function for searching the SMS text message. |
3782 | 3678 |
3783 $Returns: none | 3679 $Returns: none |
3784 | 3680 |
3785 $Arguments: win - window handler | 3681 $Arguments: win - window handler |
3786 event - mfw event | 3682 event - mfw event |
3787 value -optional id | 3683 value -optional id |
3788 parameter - optional data. | 3684 parameter - optional data. |
3789 | 3685 |
3790 *******************************************************************************/ | 3686 *******************************************************************************/ |
3791 void SmsRead_FindNextNumber_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) | 3687 void SmsRead_FindNextNumber_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) |
3792 { | 3688 { |
3793 | |
3794 T_MFW_PHB_ENTRY pb_data; | 3689 T_MFW_PHB_ENTRY pb_data; |
3795 | 3690 |
3796 switch (Reason) | 3691 switch (Reason) |
3797 { | 3692 { |
3798 case INFO_KCD_RIGHT: | 3693 case INFO_KCD_RIGHT: |
3827 case INFO_KCD_OFFHOOK: | 3722 case INFO_KCD_OFFHOOK: |
3828 callNumber(SmsData.NumberBuffer); | 3723 callNumber(SmsData.NumberBuffer); |
3829 break; | 3724 break; |
3830 | 3725 |
3831 default: | 3726 default: |
3832 TRACE_EVENT(" >>> INFO Default "); | 3727 TRACE_EVENT(" >>> INFO Default "); |
3833 //return MFW_EVENT_REJECTED; | 3728 //return MFW_EVENT_REJECTED; |
3834 break; | 3729 break; |
3835 } | 3730 } |
3836 | |
3837 } | 3731 } |
3838 | 3732 |
3839 /******************************************************************************* | 3733 /******************************************************************************* |
3840 | 3734 |
3841 $Function: smsRead_NumberName_info_screen | 3735 $Function: smsRead_NumberName_info_screen |
3842 | 3736 |
3843 $Description: Display the number and name of numbers found in the received SMS text. | 3737 $Description: Display the number and name of numbers found in the received SMS text. |
3844 | 3738 |
3845 $Returns: window handle | 3739 $Returns: window handle |
3846 | 3740 |
3847 $Arguments: win - current window. | 3741 $Arguments: win - current window. |
3848 UserData - Sms data info | 3742 UserData - Sms data info |
3849 *******************************************************************************/ | 3743 *******************************************************************************/ |
3850 | 3744 |
3851 static MfwHnd smsRead_NumberName_info_screen(MfwHnd win,T_SmsUserData *UserData, char* nameTag) | 3745 static MfwHnd smsRead_NumberName_info_screen(MfwHnd win,T_SmsUserData *UserData, char* nameTag) |
3852 { | 3746 { |
3853 | 3747 T_DISPLAY_DATA DisplayInfo; |
3854 T_DISPLAY_DATA DisplayInfo; | 3748 TRACE_FUNCTION("smsRead_NumberName_info_screen() "); |
3855 TRACE_FUNCTION("smsRead_NumberName_info_screen() "); | 3749 |
3856 | 3750 dlg_initDisplayData_TextStr( &DisplayInfo, TxtSoftNext, TxtSoftBack, nameTag, (char*)UserData->NumberBuffer, COLOUR_STATUS); |
3857 dlg_initDisplayData_TextStr( &DisplayInfo, TxtSoftNext, TxtSoftBack, nameTag, (char*)UserData->NumberBuffer, COLOUR_STATUS); | 3751 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)SmsRead_FindNextNumber_cb, FOREVER, KEY_ALL ); |
3858 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)SmsRead_FindNextNumber_cb, FOREVER, KEY_ALL ); | 3752 |
3859 | 3753 TRACE_EVENT(">>>>> Display Information Screen "); |
3860 TRACE_EVENT(">>>>> Display Information Screen "); | 3754 return info_dialog(win, &DisplayInfo); |
3861 return info_dialog(win, &DisplayInfo); | |
3862 | |
3863 } | 3755 } |
3864 | 3756 |
3865 /******************************************************************************* | 3757 /******************************************************************************* |
3866 | 3758 |
3867 $Function: Search_forNextNumber | 3759 $Function: Search_forNextNumber |
3868 | 3760 |
3869 $Description: Search through the SMS text and find a telephone number, the number | 3761 $Description: Search through the SMS text and find a telephone number, the number |
3870 may start with the '+' prefix. | 3762 may start with the '+' prefix. |
3871 | 3763 |
3872 $Returns: Boolean | 3764 $Returns: Boolean |
3873 | 3765 |
3874 $Arguments: UserData - SMS data info | 3766 $Arguments: UserData - SMS data info |
3875 *******************************************************************************/ | 3767 *******************************************************************************/ |
3876 static BOOL Search_forNextNumber(T_SmsUserData *UserData) | 3768 static BOOL Search_forNextNumber(T_SmsUserData *UserData) |
3877 { | 3769 { |
3878 /* SPR888 - SH - Rewritten, old function below */ | 3770 /* SPR888 - SH - Rewritten, old function below */ |
3879 /* Use search_index so we can start looking where we left off last time. | 3771 /* Use search_index so we can start looking where we left off last time. |
3880 Set to 0 in SMSRead_R_OPTExeStoreNumber */ | 3772 Set to 0 in SMSRead_R_OPTExeStoreNumber */ |
3881 | 3773 |
3882 int sms_length; | 3774 int sms_length; |
3883 int number_index; | 3775 int number_index; |
3907 | 3799 |
3908 number_index = 0; | 3800 number_index = 0; |
3909 found_status = 0; | 3801 found_status = 0; |
3910 | 3802 |
3911 memset (number_buffer, '\0', NUMBER_LENGTH*2+4); | 3803 memset (number_buffer, '\0', NUMBER_LENGTH*2+4); |
3912 | |
3913 | 3804 |
3914 while (search_index<sms_length && found_status<2 && number_index<NUMBER_LENGTH*2+4) | 3805 while (search_index<sms_length && found_status<2 && number_index<NUMBER_LENGTH*2+4) |
3915 { | 3806 { |
3916 character = sms_buffer[search_index]; | 3807 character = sms_buffer[search_index]; |
3917 | 3808 |
3945 } | 3836 } |
3946 | 3837 |
3947 return FALSE; | 3838 return FALSE; |
3948 } | 3839 } |
3949 | 3840 |
3950 | |
3951 /* api Store number for calling when reading SMS - 04/03/2002 | 3841 /* api Store number for calling when reading SMS - 04/03/2002 |
3952 */ | 3842 */ |
3953 | 3843 |
3954 /******************************************************************************* | 3844 /******************************************************************************* |
3955 | 3845 |
3956 $Function: Search_forNextNumber | 3846 $Function: Search_forNextNumber |
3957 | 3847 |
3958 $Description: Search through the SMS text and find a telephone number, the number | 3848 $Description: Search through the SMS text and find a telephone number, the number |
3959 may start with the '+' prefix. | 3849 may start with the '+' prefix. |
3960 | 3850 |
3961 $Returns: Boolean | 3851 $Returns: Boolean |
3962 | 3852 |
3963 $Arguments: UserData - SMS data info | 3853 $Arguments: UserData - SMS data info |
3964 *******************************************************************************/ | 3854 *******************************************************************************/ |
3965 void SmsRead_StoreNumber(void) | 3855 void SmsRead_StoreNumber(void) |
3966 { | 3856 { |
3967 T_MFW_HND win = mfwParent(mfw_header()); | 3857 T_MFW_HND win = mfwParent(mfw_header()); |
3968 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 3858 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
3969 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; | 3859 T_SMSREAD_R_OPT * data = (T_SMSREAD_R_OPT *)win_data->user; |
3970 | 3860 |
3971 T_MFW_HDR * parent = data->parent; | 3861 T_MFW_HDR * parent = data->parent; |
3972 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; | 3862 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; |
3973 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; | 3863 T_SMSREAD_R_TEXTEDT2 * parent_data = (T_SMSREAD_R_TEXTEDT2 *)win_data2->user; |
3974 T_MFW_PHB_ENTRY pb_data; | 3864 T_MFW_PHB_ENTRY pb_data; |
3975 | 3865 |
3976 TRACE_FUNCTION("SmsRead_StoreNumber"); | 3866 TRACE_FUNCTION("SmsRead_StoreNumber"); |
3977 | 3867 |
3978 TRACE_EVENT_P1("TON = %d",parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.ton); | 3868 TRACE_EVENT_P1("TON = %d",parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.ton); |
3979 /* Marcus: Issue 1489: 13/12/2002: Start */ | 3869 /* Marcus: Issue 1489: 13/12/2002: Start */ |
4023 //x0035544 Mar 23, 2006 DR:OMAPS00047813 | 3913 //x0035544 Mar 23, 2006 DR:OMAPS00047813 |
4024 /******************************************************************************* | 3914 /******************************************************************************* |
4025 | 3915 |
4026 $Function: Search_forNumberInSMS | 3916 $Function: Search_forNumberInSMS |
4027 | 3917 |
4028 $Description: Search through the SMS text and find the numbers | 3918 $Description: Search through the SMS text and find the numbers |
4029 | 3919 |
4030 $Returns: void | 3920 $Returns: void |
4031 | 3921 |
4032 $Arguments: UserData - SMS data info | 3922 $Arguments: UserData - SMS data info |
4033 *******************************************************************************/ | 3923 *******************************************************************************/ |
4034 void Search_forNumberInSMS(T_SmsUserData *UserData) | 3924 void Search_forNumberInSMS(T_SmsUserData *UserData) |
4035 { | 3925 { |
4142 //Mar 23, 2006 DR:OMAPS00047813 x0035544 | 4032 //Mar 23, 2006 DR:OMAPS00047813 x0035544 |
4143 /******************************************************************************* | 4033 /******************************************************************************* |
4144 | 4034 |
4145 $Function: smsread_numlist_win_cb | 4035 $Function: smsread_numlist_win_cb |
4146 | 4036 |
4147 $Description: Window event handler | 4037 $Description: Window event handler |
4148 | 4038 |
4149 $Returns: MFW_EVENT_REJECTED: | 4039 $Returns: MFW_EVENT_REJECTED: |
4150 MFW_EVENT_CONSUMED: | 4040 MFW_EVENT_CONSUMED: |
4151 | 4041 |
4152 $Arguments: | 4042 $Arguments: |
4153 | 4043 |
4154 *******************************************************************************/ | 4044 *******************************************************************************/ |
4155 static int smsread_numlist_win_cb (MfwEvt e, MfwWin *w) | 4045 static int smsread_numlist_win_cb (MfwEvt e, MfwWin *w) |
4156 { | 4046 { |
4157 TRACE_FUNCTION ("smsread_numlist_win_cb()"); | 4047 TRACE_FUNCTION ("smsread_numlist_win_cb()"); |
4158 switch (e) | 4048 switch (e) |
4159 { | 4049 { |
4160 case MfwWinVisible: /* window is visible */ | 4050 case MfwWinVisible: /* window is visible */ |
4161 break; | 4051 break; |
4162 case MfwWinFocussed: /* input focus / selected */ | 4052 case MfwWinFocussed: /* input focus / selected */ |
4163 case MfwWinDelete: /* window will be deleted */ | 4053 case MfwWinDelete: /* window will be deleted */ |
4164 | 4054 default: |
4165 default: | 4055 return MFW_EVENT_REJECTED; |
4166 return MFW_EVENT_REJECTED; | 4056 } |
4167 } | 4057 return MFW_EVENT_CONSUMED; |
4168 return MFW_EVENT_CONSUMED; | |
4169 } | 4058 } |
4170 | 4059 |
4171 //Mar 23, 2006 DR:OMAPS00047813 x0035544 | 4060 //Mar 23, 2006 DR:OMAPS00047813 x0035544 |
4172 /******************************************************************************* | 4061 /******************************************************************************* |
4173 | 4062 |
4186 T_MFW_WIN * win; | 4075 T_MFW_WIN * win; |
4187 | 4076 |
4188 TRACE_FUNCTION ("SmsRead_BuildNumList_Menu"); | 4077 TRACE_FUNCTION ("SmsRead_BuildNumList_Menu"); |
4189 | 4078 |
4190 /* | 4079 /* |
4191 * Create window handler | 4080 * Create window handler |
4192 */ | 4081 */ |
4193 | 4082 |
4194 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)smsread_numlist_win_cb); | 4083 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)smsread_numlist_win_cb); |
4195 if (data->win EQ NULL) | 4084 if (data->win EQ NULL) |
4196 { | 4085 { |
4197 FREE_MEMORY( (void *)data, sizeof( T_SMSREAD_R ) ); | 4086 FREE_MEMORY( (void *)data, sizeof( T_SMSREAD_R ) ); |
4198 return NULL; | 4087 return NULL; |
4199 } | 4088 } |
4200 | 4089 |
4201 TRACE_EVENT("list holder window created: " ); | 4090 TRACE_EVENT("list holder window created: " ); |
4091 | |
4202 /* | 4092 /* |
4203 * connect the dialog data to the MFW-window | 4093 * connect the dialog data to the MFW-window |
4204 */ | 4094 */ |
4205 | |
4206 data->mmi_control.dialog = (T_DIALOG_FUNC)smsread_numlist_exec_cb; | 4095 data->mmi_control.dialog = (T_DIALOG_FUNC)smsread_numlist_exec_cb; |
4207 data->mmi_control.data = data; | 4096 data->mmi_control.data = data; |
4208 win = ((T_MFW_HDR *)data->win)->data; | 4097 win = ((T_MFW_HDR *)data->win)->data; |
4209 win->user = (void *)data; | 4098 win->user = (void *)data; |
4210 data->parent = parent_window; | 4099 data->parent = parent_window; |
4211 winShow(data->win); | 4100 winShow(data->win); |
4101 | |
4212 /* | 4102 /* |
4213 * return window handle | 4103 * return window handle |
4214 */ | 4104 */ |
4215 | 4105 return data->win; |
4216 return data->win; | |
4217 } | 4106 } |
4218 | 4107 |
4219 //Mar 23, 2006 DR:OMAPS00047813 x0035544 | 4108 //Mar 23, 2006 DR:OMAPS00047813 x0035544 |
4220 /******************************************************************************* | 4109 /******************************************************************************* |
4221 | 4110 |
4236 /* List is complete so present menu. */ | 4125 /* List is complete so present menu. */ |
4237 USHORT i; | 4126 USHORT i; |
4238 | 4127 |
4239 TRACE_FUNCTION("smsread_numlist_exec_cb"); | 4128 TRACE_FUNCTION("smsread_numlist_exec_cb"); |
4240 | 4129 |
4241 | |
4242 win_data = ((T_MFW_HDR *) win)->data; | 4130 win_data = ((T_MFW_HDR *) win)->data; |
4243 data = (T_SMSREAD_R *)win_data->user; | 4131 data = (T_SMSREAD_R *)win_data->user; |
4244 | 4132 |
4245 switch (event) | 4133 switch (event) |
4246 { | |
4247 case E_INIT: | |
4248 data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); | |
4249 | |
4250 if(data->menu_list_data == 0) | |
4251 { | 4134 { |
4252 TRACE_EVENT("Failed memory alloc 1 "); | 4135 case E_INIT: |
4253 return; | 4136 data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); |
4137 | |
4138 if(data->menu_list_data == 0) | |
4139 { | |
4140 TRACE_EVENT("Failed memory alloc 1 "); | |
4141 return; | |
4142 } | |
4143 /*SPR 2686, only allocate memory for the number of messages displayed*/ | |
4144 data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( smsread_num_ctr * sizeof(T_MFW_MNU_ITEM) );//JVJE | |
4145 | |
4146 if(data->menu_list_data->List == 0) | |
4147 { | |
4148 TRACE_EVENT("Failed memory alloc 2"); | |
4149 return; | |
4150 } | |
4151 | |
4152 for (i = 0; i < smsread_num_ctr; i++) | |
4153 { | |
4154 mnuInitDataItem(&data->menu_list_data->List[i]); | |
4155 data->menu_list_data->List[i].str = (char *)num_buffer[i]; | |
4156 TRACE_EVENT_P1("Menu Tags:%s", data->menu_list_data->List[i].str); | |
4157 data->menu_list_data->List[i].flagFunc = item_flag_none; | |
4158 } | |
4159 | |
4160 data->menu_list_data->ListLength =smsread_num_ctr; | |
4161 data->menu_list_data->ListPosition = 1; | |
4162 data->menu_list_data->CursorPosition = 1; | |
4163 data->menu_list_data->SnapshotSize =smsread_num_ctr; | |
4164 data->menu_list_data->Font = 0; | |
4165 data->menu_list_data->LeftSoftKey = TxtSoftSelect; | |
4166 /*NM p032*/ | |
4167 if(test_sim EQ TRUE) | |
4168 data->menu_list_data->RightSoftKey = TxtNull; | |
4169 else | |
4170 data->menu_list_data->RightSoftKey = TxtSoftBack; | |
4171 | |
4172 data->menu_list_data->KeyEvents = KEY_ALL; | |
4173 data->menu_list_data->Reason = 0; | |
4174 data->menu_list_data->Strings = TRUE; | |
4175 data->menu_list_data->Attr = (MfwMnuAttr*)&menuSearchNumListAttr; | |
4176 data->menu_list_data->autoDestroy = FALSE; | |
4177 | |
4178 /* Create the dynamic menu window */ | |
4179 listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_numlist_cb ,0); | |
4180 break; | |
4181 default: | |
4182 break; | |
4254 } | 4183 } |
4255 /*SPR 2686, only allocate memory for the number of messages displayed*/ | 4184 } |
4256 data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( smsread_num_ctr * sizeof(T_MFW_MNU_ITEM) );//JVJE | |
4257 | |
4258 if(data->menu_list_data->List == 0) | |
4259 { | |
4260 TRACE_EVENT("Failed memory alloc 2"); | |
4261 return; | |
4262 } | |
4263 | |
4264 for (i = 0; i < smsread_num_ctr; i++) | |
4265 { | |
4266 mnuInitDataItem(&data->menu_list_data->List[i]); | |
4267 data->menu_list_data->List[i].str = (char *)num_buffer[i]; | |
4268 TRACE_EVENT_P1("Menu Tags:%s", data->menu_list_data->List[i].str); | |
4269 data->menu_list_data->List[i].flagFunc = item_flag_none; | |
4270 } | |
4271 | |
4272 data->menu_list_data->ListLength =smsread_num_ctr; | |
4273 data->menu_list_data->ListPosition = 1; | |
4274 data->menu_list_data->CursorPosition = 1; | |
4275 data->menu_list_data->SnapshotSize =smsread_num_ctr; | |
4276 data->menu_list_data->Font = 0; | |
4277 data->menu_list_data->LeftSoftKey = TxtSoftSelect; | |
4278 /*NM p032*/ | |
4279 if(test_sim EQ TRUE) | |
4280 data->menu_list_data->RightSoftKey = TxtNull; | |
4281 else | |
4282 data->menu_list_data->RightSoftKey = TxtSoftBack; | |
4283 | |
4284 data->menu_list_data->KeyEvents = KEY_ALL; | |
4285 data->menu_list_data->Reason = 0; | |
4286 data->menu_list_data->Strings = TRUE; | |
4287 data->menu_list_data->Attr = (MfwMnuAttr*)&menuSearchNumListAttr; | |
4288 data->menu_list_data->autoDestroy = FALSE; | |
4289 | |
4290 /* Create the dynamic menu window */ | |
4291 listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_numlist_cb ,0); | |
4292 break; | |
4293 default: | |
4294 break; | |
4295 } | |
4296 | |
4297 } | |
4298 | 4185 |
4299 //Mar 23, 2006 DR:OMAPS00047813 x0035544 | 4186 //Mar 23, 2006 DR:OMAPS00047813 x0035544 |
4300 /******************************************************************************* | 4187 /******************************************************************************* |
4301 | 4188 |
4302 $Function: SmsRead_numlist_cb | 4189 $Function: SmsRead_numlist_cb |
4315 char *pb_number; | 4202 char *pb_number; |
4316 int i; | 4203 int i; |
4317 | 4204 |
4318 TRACE_FUNCTION ("SmsRead_numlist_cb()"); | 4205 TRACE_FUNCTION ("SmsRead_numlist_cb()"); |
4319 | 4206 |
4320 | |
4321 if ((ListData->Reason EQ LISTS_REASON_BACK) || | 4207 if ((ListData->Reason EQ LISTS_REASON_BACK) || |
4322 (ListData->Reason EQ LISTS_REASON_CLEAR) || | 4208 (ListData->Reason EQ LISTS_REASON_CLEAR) || |
4323 (ListData->Reason EQ LISTS_REASON_HANGUP)) | 4209 (ListData->Reason EQ LISTS_REASON_HANGUP)) |
4324 { | 4210 { |
4325 /* | 4211 /* |
4329 | 4215 |
4330 /* | 4216 /* |
4331 ** Free the memory set aside for ALL the devices to be listed. | 4217 ** Free the memory set aside for ALL the devices to be listed. |
4332 */ | 4218 */ |
4333 for(i=0; i<MAX_NUMBER_SIZE;i++) | 4219 for(i=0; i<MAX_NUMBER_SIZE;i++) |
4334 { | 4220 { |
4335 FREE_MEMORY((U8*)num_buffer[i], sizeof(char)*NUMBER_LENGTH); | 4221 FREE_MEMORY((U8*)num_buffer[i], sizeof(char)*NUMBER_LENGTH); |
4336 num_buffer[i] = NULL; | 4222 num_buffer[i] = NULL; |
4337 } | 4223 } |
4338 | 4224 |
4339 /*deallocate memory for the array of pointer to numbers*/ | 4225 /*deallocate memory for the array of pointer to numbers*/ |
4340 FREE_MEMORY((U8*)num_buffer, sizeof(char*)*MAX_NUMBER_SIZE); | 4226 FREE_MEMORY((U8*)num_buffer, sizeof(char*)*MAX_NUMBER_SIZE); |
4341 | 4227 |
4342 if (data->menu_list_data->List != NULL) | 4228 if (data->menu_list_data->List != NULL) |
4348 { | 4234 { |
4349 FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData)); | 4235 FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData)); |
4350 } | 4236 } |
4351 | 4237 |
4352 SmsRead_numlist_destroy(data->win); | 4238 SmsRead_numlist_destroy(data->win); |
4353 | |
4354 | |
4355 | |
4356 } | 4239 } |
4357 | 4240 |
4358 else if(ListData->Reason EQ LISTS_REASON_SELECT) | 4241 else if(ListData->Reason EQ LISTS_REASON_SELECT) |
4359 { | 4242 { |
4360 pb_number = ListData->List[ListData->ListPosition].str; | 4243 pb_number = ListData->List[ListData->ListPosition].str; |
4361 callNumber((UBYTE*)pb_number); | 4244 callNumber((UBYTE*)pb_number); |
4362 | 4245 } |
4363 } | |
4364 | 4246 |
4365 return; | 4247 return; |
4366 } | 4248 } |
4367 | 4249 |
4368 //Mar 23, 2006 DR:OMAPS00047813 x0035544 | 4250 //Mar 23, 2006 DR:OMAPS00047813 x0035544 |
4370 | 4252 |
4371 $Function: SmsRead_numlist_destroy | 4253 $Function: SmsRead_numlist_destroy |
4372 | 4254 |
4373 $Description: Destroy the Extr Number window. | 4255 $Description: Destroy the Extr Number window. |
4374 | 4256 |
4375 $Returns: none | 4257 $Returns: none |
4376 | 4258 |
4377 $Arguments: own_window - window handler | 4259 $Arguments: own_window - window handler |
4378 | 4260 |
4379 *******************************************************************************/ | 4261 *******************************************************************************/ |
4380 | 4262 |