comparison src/ui/bmi/mmiSmsMenu.c @ 172:44d6af34c75a

mmiSmsMenu.c: formatting fixes and dead code elimination
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 18 Jan 2021 02:33:57 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
171:4ef7466a72c9 172:44d6af34c75a
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: MmiSmsMenu.c 15 $File: MmiSmsMenu.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
202 MFW_MB_FAX = 3, 202 MFW_MB_FAX = 3,
203 MFW_MB_DATA = 4 203 MFW_MB_DATA = 4
204 } T_MFW_MAILBOX_ID; 204 } T_MFW_MAILBOX_ID;
205 205
206 206
207
208 typedef enum 207 typedef enum
209 { 208 {
210 SMS_DELETING, 209 SMS_DELETING,
211 SMS_DISPLAY, 210 SMS_DISPLAY,
212 SMS_READY 211 SMS_READY
227 T_MFW_HND kbd_long; 226 T_MFW_HND kbd_long;
228 T_MFW_HND menu; 227 T_MFW_HND menu;
229 228
230 /* internal data */ 229 /* internal data */
231 230
232 T_SmsUserData * user_data; // text and phone number of the message 231 T_SmsUserData * user_data; // text and phone number of the message
233 } T_M_SND_SAV; 232 } T_M_SND_SAV;
234 233
235 typedef struct 234 typedef struct
236 { 235 {
237 /* administrative data */ 236 /* administrative data */
238 237
239 T_MMI_CONTROL mmi_control; 238 T_MMI_CONTROL mmi_control;
240 T_MFW_HND win; 239 T_MFW_HND win;
241 SHORT id; 240 SHORT id;
242 T_MFW_HND parent; 241 T_MFW_HND parent;
243 T_MFW_HND waiting_win; 242 T_MFW_HND waiting_win;
244 243
245 /* associated handlers */ 244 /* associated handlers */
246 T_MFW_HND sms_hnd; /* MFW sms handler */ 245 T_MFW_HND sms_hnd; /* MFW sms handler */
247 246
248 /* internal data */ 247 /* internal data */
249 248
250 MySmsType type; // The type of the SMS to delete (SMS or SMS-CB) 249 MySmsType type; // The type of the SMS to delete (SMS or SMS-CB)
251 //May 27, 2005 MMI-FIX-29869 x0018858 250 //May 27, 2005 MMI-FIX-29869 x0018858
252 #ifdef FF_MMI_SMS_DYNAMIC 251 #ifdef FF_MMI_SMS_DYNAMIC
253 T_MFW_SMS_MSG *g_SmsMenu_messages; 252 T_MFW_SMS_MSG *g_SmsMenu_messages;
254 #else 253 #else
255 T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES]; 254 T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES];
256 #endif 255 #endif
257 T_MFW_HND child_dialog; 256 T_MFW_HND child_dialog;
258 } T_M_DEL_ALL; 257 } T_M_DEL_ALL;
259 258
260 typedef struct 259 typedef struct
261 { 260 {
262 /* administrative data */ 261 /* administrative data */
269 /* associated handlers */ 268 /* associated handlers */
270 269
271 T_MFW_HND kbd; 270 T_MFW_HND kbd;
272 T_MFW_HND kbd_long; 271 T_MFW_HND kbd_long;
273 T_MFW_HND menu; 272 T_MFW_HND menu;
274
275
276 } T_V; 273 } T_V;
277
278 274
279 275
280 typedef struct 276 typedef struct
281 { 277 {
282 /* administrative data */ 278 /* administrative data */
286 SHORT id; 282 SHORT id;
287 T_MFW_HND parent; 283 T_MFW_HND parent;
288 284
289 /* associated handlers */ 285 /* associated handlers */
290 286
291
292 /* internal data */ 287 /* internal data */
293 UBYTE voice_number_buffer[NUMBER_LENGTH]; 288 UBYTE voice_number_buffer[NUMBER_LENGTH];
294
295 } T_V_NUM; 289 } T_V_NUM;
296 290
297 static T_MFW_HND M_SND_SAV_create (T_MFW_HND parent); 291 static T_MFW_HND M_SND_SAV_create (T_MFW_HND parent);
298 static void M_SND_SAV_destroy (T_MFW_HND window); 292 static void M_SND_SAV_destroy (T_MFW_HND window);
299 static void M_SND_SAV_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); 293 static void M_SND_SAV_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
348 T_MFW_HND win = eZiTextWin;// SUMIT: mfwParent(mfw_header()); 342 T_MFW_HND win = eZiTextWin;// SUMIT: mfwParent(mfw_header());
349 T_SmsUserData SmsData; 343 T_SmsUserData SmsData;
350 344
351 /* Copy the number and name information to the SMS buffer 345 /* Copy the number and name information to the SMS buffer
352 */ 346 */
353 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/ 347 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
354 348
355 /*SPR 2587, check that SMS has been initialised*/ 349 /*SPR 2587, check that SMS has been initialised*/
356 if (!smsidle_get_ready_state() || phb_get_mode() == PHB_LOADING) 350 if (!smsidle_get_ready_state() || phb_get_mode() == PHB_LOADING)
357 { 351 {
358 352 mmi_dialog_information_screen(0, TxtPleaseWait, NULL, NULL, NULL);
359 mmi_dialog_information_screen(0, TxtPleaseWait, NULL, NULL, NULL); 353 return 0;
360 return 0; 354 }
361 } 355 // Jul 13, 2004 REF: CRR 21615 Deepa M.D
362 // Jul 13, 2004 REF: CRR 21615 Deepa M.D 356 // Copy the content from the temporary buffer into the editor,so that the
363 // Copy the content from the temporary buffer into the editor,so that the 357 // previously typed content is retained.
364 // previously typed content is retained.
365 #ifdef TI_PS_FF_CONC_SMS 358 #ifdef TI_PS_FF_CONC_SMS
366 if(FFS_flashData.ConcatenateStatus == TRUE) 359 if(FFS_flashData.ConcatenateStatus == TRUE)
367 { 360 {
368 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN); 361 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN);
369 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN); 362 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN);
370 } 363 }
371
372 else 364 else
373 #endif /*TI_PS_FF_CONC_SMS*/ 365 #endif /*TI_PS_FF_CONC_SMS*/
374 { 366 {
375 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL); 367 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL);
376 //Copy only 160 characters ofthe message. 368 //Copy only 160 characters ofthe message.
377 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN_SGL-1); 369 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN_SGL-1);
378 } 370 }
379 371
380 SmsData.NumberBuffer[0]='\0'; //set the number to null. 372 SmsData.NumberBuffer[0]='\0'; //set the number to null.
381 SmsData.called_from_reply_item = FALSE; 373 SmsData.called_from_reply_item = FALSE;
382 374
383 SmsSend_SEND_start(win, (void *) &SmsData); 375 SmsSend_SEND_start(win, (void *) &SmsData);
384 return 1; 376 return 1;
385 } 377 }
386 378
387 /******************************************************************************* 379 /*******************************************************************************
388 380
389 $Function: M_exeRead 381 $Function: M_exeRead
399 *******************************************************************************/ 391 *******************************************************************************/
400 392
401 int M_exeRead(MfwMnu* m, MfwMnuItem* i) 393 int M_exeRead(MfwMnu* m, MfwMnuItem* i)
402 { 394 {
403 T_MFW_HND win = mfwParent(mfw_header()); 395 T_MFW_HND win = mfwParent(mfw_header());
404 T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL; 396 T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL;
405 397
406 /* Call the function that manages SMS reading */ 398 /* Call the function that manages SMS reading */
407 SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type); 399 SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type);
408 400
409 return 1; 401 return 1;
410 } 402 }
411 403
412 /******************************************************************************* 404 /*******************************************************************************
413 405
414 $Function: M_exeDelAll 406 $Function: M_exeDelAll
424 *******************************************************************************/ 416 *******************************************************************************/
425 417
426 int M_exeDelAll(MfwMnu* m, MfwMnuItem* i) 418 int M_exeDelAll(MfwMnu* m, MfwMnuItem* i)
427 { 419 {
428 T_MFW_HND win = mfwParent(mfw_header()); 420 T_MFW_HND win = mfwParent(mfw_header());
429 MySmsType sms_type; 421 MySmsType sms_type;
430 422
431 sms_type = SMS_TYPE; 423 sms_type = SMS_TYPE;
432 // Here we have to pass the type of sms to delete (SMS or SMS-CB) 424 // Here we have to pass the type of sms to delete (SMS or SMS-CB)
433 M_DEL_ALL_start(win, (void *)&sms_type); 425 M_DEL_ALL_start(win, (void *)&sms_type);
434 426
435 return 1; 427 return 1;
436 } 428 }
437 429
438 /******************************************************************************* 430 /*******************************************************************************
439 431
440 $Function: M_exeSendSaved 432 $Function: M_exeSendSaved
451 443
452 int M_exeSendSaved(MfwMnu* m, MfwMnuItem* i) 444 int M_exeSendSaved(MfwMnu* m, MfwMnuItem* i)
453 { 445 {
454 T_MFW_HND win = mfwParent(mfw_header()); 446 T_MFW_HND win = mfwParent(mfw_header());
455 447
456 M_SND_SAV_start(win, 0); 448 M_SND_SAV_start(win, 0);
457 449
458 return 1; 450 return 1;
459 } 451 }
460
461 452
462 453
463 /******************************************************************************* 454 /*******************************************************************************
464 455
465 $Function: voice_mail_init 456 $Function: voice_mail_init
466 457
467 $Description: initialization the voice mail buffer 458 $Description: initialization the voice mail buffer
468 459
469
470 $Returns: 460 $Returns:
471 461
472 $Arguments: 462 $Arguments:
473 463
474
475 *******************************************************************************/ 464 *******************************************************************************/
476 465
477 int voice_mail_init (void) 466 int voice_mail_init (void)
478 { 467 {
479
480 //nm, later have to read the voice mail number from FFS after switching-on the mobile 468 //nm, later have to read the voice mail number from FFS after switching-on the mobile
481 469
482 //to clear the buffer is only temporary until we are able to save on Flash 470 //to clear the buffer is only temporary until we are able to save on Flash
483 //memset(voice_mail, '\0', sizeof(voice_mail)); 471 //memset(voice_mail, '\0', sizeof(voice_mail));
484 472
485
486
487 return 1; 473 return 1;
488 } 474 }
489
490
491 475
492 476
493 /******************************************************************************* 477 /*******************************************************************************
494 478
495 $Function: M_exeVoice 479 $Function: M_exeVoice
513 TRACE_FUNCTION ("M_exeVoice()"); 497 TRACE_FUNCTION ("M_exeVoice()");
514 498
515 win = V_create (parent_window); 499 win = V_create (parent_window);
516 500
517 if (win NEQ NULL) 501 if (win NEQ NULL)
518 { 502 {
519 SEND_EVENT (win, E_INIT, V_ID_SET, 0); 503 SEND_EVENT (win, E_INIT, V_ID_SET, 0);
520 } 504 }
521 return 1; 505 return 1;
522 } 506 }
523 507
524 508
525 /******************************************************************************* 509 /*******************************************************************************
526 510
539 int M_callVoice(MfwMnu* m, MfwMnuItem* i) 523 int M_callVoice(MfwMnu* m, MfwMnuItem* i)
540 { 524 {
541 T_MFW_HND win; 525 T_MFW_HND win;
542 T_MFW_HND parent_win = mfwParent(mfw_header()); 526 T_MFW_HND parent_win = mfwParent(mfw_header());
543 527
544
545 TRACE_FUNCTION ("M_callVoice()"); 528 TRACE_FUNCTION ("M_callVoice()");
546 529
547 win = V_create (parent_win); 530 win = V_create (parent_win);
548 531
549 if (win NEQ NULL) 532 if (win NEQ NULL)
550 { 533 {
551 SEND_EVENT (win, E_INIT, V_ID_CALL, 0); 534 SEND_EVENT (win, E_INIT, V_ID_CALL, 0);
552 } 535 }
553
554 return 1;
555 }
556
557
558 /*SPR 1920 removed obsolete function*/
559
560 #if(0) /* x0039928 - Lint warning removal */
561 /*******************************************************************************
562
563 $Function: ExeSms_sendM_SND_SAV
564
565 $Description: Called when the user press Saved SMS from the Send SMS menu
566
567 $Returns: Execution status
568
569 $Arguments: m - menu handler
570 i - Menu item selected
571
572 *******************************************************************************/
573
574 static int ExeSms_sendM_SND_SAV(MfwMnu* m, MfwMnuItem* i)
575 {
576 T_MFW_HND win = mfwParent(mfw_header());
577 536
578 return 1; 537 return 1;
579 } 538 }
580 #endif 539
581 540
582 /******************************************************************************* 541 /*******************************************************************************
583 542
584 $Function: M_SND_SAV_start 543 $Function: M_SND_SAV_start
585 544
599 TRACE_FUNCTION ("M_SND_SAV_start()"); 558 TRACE_FUNCTION ("M_SND_SAV_start()");
600 559
601 win = M_SND_SAV_create (parent_window); 560 win = M_SND_SAV_create (parent_window);
602 561
603 if (win NEQ NULL) 562 if (win NEQ NULL)
604 { 563 {
605 SEND_EVENT (win, E_INIT, M_SND_SAV_ID, (void *)menuAttr); 564 SEND_EVENT (win, E_INIT, M_SND_SAV_ID, (void *)menuAttr);
606 } 565 }
607 return win; 566 return win;
608 } 567 }
609 568
610 /******************************************************************************* 569 /*******************************************************************************
611 570
623 { 582 {
624 T_M_SND_SAV * data = (T_M_SND_SAV *)ALLOC_MEMORY (sizeof (T_M_SND_SAV)); 583 T_M_SND_SAV * data = (T_M_SND_SAV *)ALLOC_MEMORY (sizeof (T_M_SND_SAV));
625 T_MFW_WIN * win; 584 T_MFW_WIN * win;
626 585
627 TRACE_FUNCTION ("M_SND_SAV_create()"); 586 TRACE_FUNCTION ("M_SND_SAV_create()");
628
629 587
630 /* 588 /*
631 * Create window handler 589 * Create window handler
632 */ 590 */
633 591
634 data->win = 592 data->win =
635 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_SND_SAV_win_cb); 593 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_SND_SAV_win_cb);
636 594
637 if (data->win EQ NULL) 595 if (data->win EQ NULL)
638 { 596 {
639 return NULL; 597 return NULL;
640 } 598 }
599
641 /* 600 /*
642 * connect the dialog data to the MFW-window 601 * connect the dialog data to the MFW-window
643 */ 602 */
644
645 data->mmi_control.dialog = (T_DIALOG_FUNC)M_SND_SAV_exec_cb; 603 data->mmi_control.dialog = (T_DIALOG_FUNC)M_SND_SAV_exec_cb;
646 data->mmi_control.data = data; 604 data->mmi_control.data = data;
647 win = ((T_MFW_HDR *)data->win)->data; 605 win = ((T_MFW_HDR *)data->win)->data;
648 win->user = (void *)data; 606 win->user = (void *)data;
649 data->parent = parent_window; 607 data->parent = parent_window;
673 T_M_SND_SAV * data; 631 T_M_SND_SAV * data;
674 632
675 TRACE_FUNCTION ("M_SND_SAV_destroy()"); 633 TRACE_FUNCTION ("M_SND_SAV_destroy()");
676 634
677 if (own_window) 635 if (own_window)
678 { 636 {
679 win_data = ((T_MFW_HDR *)own_window)->data; 637 win_data = ((T_MFW_HDR *)own_window)->data;
680 data = (T_M_SND_SAV *)win_data->user; 638 data = (T_M_SND_SAV *)win_data->user;
681 639
682 if (data) 640 if (data)
683 { 641 {
684 /* 642 /*
685 * Delete WIN handler 643 * Delete WIN handler
686 */ 644 */
687 win_delete (data->win); 645 win_delete (data->win);
688 646
689 /* 647 /*
690 * Free Memory 648 * Free Memory
691 */ 649 */
692 FREE_MEMORY ((void *)data->user_data, sizeof (T_SmsUserData)); 650 FREE_MEMORY ((void *)data->user_data, sizeof (T_SmsUserData));
693 FREE_MEMORY ((void *)data, sizeof (T_M_SND_SAV)); 651 FREE_MEMORY ((void *)data, sizeof (T_M_SND_SAV));
694 } 652 }
695 else 653 else
696 { 654 {
697 TRACE_EVENT ("M_SND_SAV_destroy() called twice"); 655 TRACE_EVENT ("M_SND_SAV_destroy() called twice");
698 } 656 }
699 } 657 }
700 } 658 }
701 659
702 /******************************************************************************* 660 /*******************************************************************************
703 661
704 $Function: M_SND_SAV_exec_cb 662 $Function: M_SND_SAV_exec_cb
723 SHORT l_id; 681 SHORT l_id;
724 682
725 TRACE_FUNCTION ("M_SND_SAV_exec_cb()"); 683 TRACE_FUNCTION ("M_SND_SAV_exec_cb()");
726 684
727 switch (event) 685 switch (event)
728 { 686 {
729 case E_INIT: 687 case E_INIT:
730 /* initialization of administrative data */ 688 /* initialization of administrative data */
731 data->id = value; 689 data->id = value;
732 data->user_data = (T_SmsUserData *)ALLOC_MEMORY (sizeof (T_SmsUserData)); 690 data->user_data = (T_SmsUserData *)ALLOC_MEMORY (sizeof (T_SmsUserData));
733 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/ 691 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
734 #ifdef TI_PS_FF_CONC_SMS 692 #ifdef TI_PS_FF_CONC_SMS
735 if(FFS_flashData.ConcatenateStatus == TRUE) 693 if(FFS_flashData.ConcatenateStatus == TRUE)
736 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN_SGL); 694 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN_SGL);
737 else 695 else
738 #endif /*TI_PS_FF_CONC_SMS*/ 696 #endif /*TI_PS_FF_CONC_SMS*/
739 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN); 697 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN);
740 data->user_data->NumberBuffer[0] = '\0'; 698 data->user_data->NumberBuffer[0] = '\0';
741 699
742 /* initialization of the dialog data */ 700 /* initialization of the dialog data */
743 701
744 /* create the dialog handler */ 702 /* create the dialog handler */
745 data->kbd = kbdCreate(data->win,KEY_ALL, (MfwCb)M_SND_SAV_kbd_cb); 703 data->kbd = kbdCreate(data->win,KEY_ALL, (MfwCb)M_SND_SAV_kbd_cb);
746 data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)M_SND_SAV_kbd_cb); 704 data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)M_SND_SAV_kbd_cb);
747 705
748 /* put the (new) dialog window on top of the window stack */ 706 /* put the (new) dialog window on top of the window stack */
749 mnuUnhide(data->menu); 707 mnuUnhide(data->menu);
750 winShow(win); 708 winShow(win);
751 break; 709 break;
752 case E_ABORT: 710
753 case E_EXIT: 711 case E_ABORT:
754 l_parent = data->parent; 712 case E_EXIT:
755 l_id = data->id; 713 l_parent = data->parent;
756 M_SND_SAV_destroy(data->win); 714 l_id = data->id;
757 SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */ 715 M_SND_SAV_destroy(data->win);
758 break; 716 SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */
759 717 break;
760 case E_RETURN: 718
761 default: 719 case E_RETURN:
762 return; 720 default:
763 } 721 return;
764 } 722 }
765 723 }
766 #if(0) /* x0039928 - Lint warning fix */ 724
767 /******************************************************************************* 725 /*******************************************************************************
768 726
769 $Function: M_SND_SAV_mnu_cb 727 $Function: M_SND_SAV_win_cb
770 728
771 $Description: Menu callback for the saved SMS menu window 729 $Description: Window callback for the saved SMS menu window
772 730
773 $Returns: Execution status 731 $Returns: Execution status
774 732
775 $Arguments: e - event id 733 $Arguments: e - event id
776 m - menu handle 734 m - window handle
777 735
778 *******************************************************************************/ 736 *******************************************************************************/
779 737
780 static int M_SND_SAV_mnu_cb (MfwEvt e, MfwMnu *m) 738 static int M_SND_SAV_win_cb (MfwEvt e, MfwWin *w)
781 /* M_SND_SAV menu event handler */ 739 /* M_SND_SAV window event handler */
740 {
741 TRACE_FUNCTION ("M_SND_SAV_win_cb()");
742
743 switch (e)
744 {
745 case MfwWinVisible: /* window is visible */
746 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
747 break;
748 case MfwWinFocussed: /* input focus / selected */
749 case MfwWinDelete: /* window will be deleted */
750 default:
751 return MFW_EVENT_REJECTED;
752 }
753 return MFW_EVENT_CONSUMED;
754 }
755
756 /*******************************************************************************
757
758 $Function: M_SND_SAV_kbd_cb
759
760 $Description: Keyboard callback for the saved SMS menu window
761
762 $Returns: Execution status
763
764 $Arguments: e - event id
765 k - keyboard info
766
767 *******************************************************************************/
768
769 static int M_SND_SAV_kbd_cb (MfwEvt e, MfwKbd *k)
770 /* M_SND_SAV keyboard event handler */
782 { 771 {
783 T_MFW_HND win = mfwParent(mfw_header()); 772 T_MFW_HND win = mfwParent(mfw_header());
784 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 773 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
785 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user; 774 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user;
786 775
787 TRACE_FUNCTION ("M_SND_SAV_mnu_cb()");
788
789 switch (e)
790 {
791 case E_MNU_ESCAPE: /* back to previous menu */
792 M_SND_SAV_destroy(data->win);
793 SEND_EVENT (data->parent, E_RETURN, data->id, NULL);
794 break;
795 default: /* in mnuCreate() only E_MNU_ESCAPE has been enabled! */
796 return MFW_EVENT_REJECTED;
797 }
798 return MFW_EVENT_CONSUMED;
799 }
800 #endif
801
802 /*******************************************************************************
803
804 $Function: M_SND_SAV_win_cb
805
806 $Description: Window callback for the saved SMS menu window
807
808 $Returns: Execution status
809
810 $Arguments: e - event id
811 m - window handle
812
813 *******************************************************************************/
814
815 static int M_SND_SAV_win_cb (MfwEvt e, MfwWin *w)
816 /* M_SND_SAV window event handler */
817 {
818 TRACE_FUNCTION ("M_SND_SAV_win_cb()");
819
820 switch (e)
821 {
822 case MfwWinVisible: /* window is visible */
823 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
824 break;
825 case MfwWinFocussed: /* input focus / selected */
826 case MfwWinDelete: /* window will be deleted */
827 default:
828 return MFW_EVENT_REJECTED;
829 }
830 return MFW_EVENT_CONSUMED;
831 }
832
833 /*******************************************************************************
834
835 $Function: M_SND_SAV_kbd_cb
836
837 $Description: Keyboard callback for the saved SMS menu window
838
839 $Returns: Execution status
840
841 $Arguments: e - event id
842 k - keyboard info
843
844 *******************************************************************************/
845
846 static int M_SND_SAV_kbd_cb (MfwEvt e, MfwKbd *k)
847 /* M_SND_SAV keyboard event handler */
848 {
849 T_MFW_HND win = mfwParent(mfw_header());
850 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
851 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user;
852
853 TRACE_FUNCTION ("M_SND_SAV_kbd_cb()"); 776 TRACE_FUNCTION ("M_SND_SAV_kbd_cb()");
854 777
855 if (e & KEY_LONG) 778 if (e & KEY_LONG)
856 { 779 {
857 switch (k->code) 780 switch (k->code)
858 { 781 {
859 case KCD_HUP: /* back to previous menu */ 782 case KCD_HUP: /* back to previous menu */
860 mnuEscape(data->menu); 783 mnuEscape(data->menu);
861 break; 784 break;
862 case KCD_RIGHT: /* Power Down */ 785 case KCD_RIGHT: /* Power Down */
863 return MFW_EVENT_REJECTED; /* handled by idle */ 786 return MFW_EVENT_REJECTED; /* handled by idle */
864 default: /* no response to all other keys */ 787 default: /* no response to all other keys */
865 return MFW_EVENT_CONSUMED; 788 return MFW_EVENT_CONSUMED;
866 } 789 }
867 } 790 }
868 else 791 else
869 { 792 {
870 switch (k->code) 793 switch (k->code)
871 { 794 {
872 case KCD_MNUUP: /* highlight previous entry */ 795 case KCD_MNUUP: /* highlight previous entry */
873 mnuUp(data->menu); 796 mnuUp(data->menu);
874 winShow(win); 797 winShow(win);
875 break; 798 break;
876 case KCD_MNUDOWN: /* highlight next entry */ 799 case KCD_MNUDOWN: /* highlight next entry */
877 mnuDown(data->menu); 800 mnuDown(data->menu);
878 winShow(win); 801 winShow(win);
879 break; 802 break;
880 case KCD_LEFT: /* activate this entry */ 803 case KCD_LEFT: /* activate this entry */
881 mnuSelect(data->menu); 804 mnuSelect(data->menu);
882 break; 805 break;
883 case KCD_HUP: /* back to previous menu */ 806 case KCD_HUP: /* back to previous menu */
884 case KCD_RIGHT: /* back to previous menu */ 807 case KCD_RIGHT: /* back to previous menu */
885 mnuEscape(data->menu); 808 mnuEscape(data->menu);
886 break; 809 break;
887 default: /* no response to all other keys */ 810 default: /* no response to all other keys */
888 return MFW_EVENT_CONSUMED; 811 return MFW_EVENT_CONSUMED;
889 } 812 }
890 } 813 }
891 return MFW_EVENT_CONSUMED; 814 return MFW_EVENT_CONSUMED;
892 } 815 }
893 816
894 817
895 /******************************************************************************* 818 /*******************************************************************************
912 TRACE_FUNCTION ("M_DEL_ALL_start()"); 835 TRACE_FUNCTION ("M_DEL_ALL_start()");
913 836
914 win = M_DEL_ALL_create (parent_window); 837 win = M_DEL_ALL_create (parent_window);
915 838
916 if (win NEQ NULL) 839 if (win NEQ NULL)
917 { 840 {
918 SEND_EVENT (win, E_INIT, M_DEL_ALL_ID, (void *)menuAttr); 841 SEND_EVENT (win, E_INIT, M_DEL_ALL_ID, (void *)menuAttr);
919 } 842 }
920 return win; 843 return win;
921 } 844 }
922 845
923 /******************************************************************************* 846 /*******************************************************************************
924 847
942 /* 865 /*
943 * Create window handler 866 * Create window handler
944 */ 867 */
945 868
946 data->win = 869 data->win =
947 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_DEL_ALL_win_cb); 870 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_DEL_ALL_win_cb);
948 871
949 if (data->win EQ NULL) 872 if (data->win EQ NULL)
950 { 873 {
951 return NULL; 874 return NULL;
952 } 875 }
876
953 /* 877 /*
954 * connect the dialog data to the MFW-window 878 * connect the dialog data to the MFW-window
955 */ 879 */
956
957 data->mmi_control.dialog = (T_DIALOG_FUNC)M_DEL_ALL_exec_cb; 880 data->mmi_control.dialog = (T_DIALOG_FUNC)M_DEL_ALL_exec_cb;
958 data->mmi_control.data = data; 881 data->mmi_control.data = data;
959 win = ((T_MFW_HDR *)data->win)->data; 882 win = ((T_MFW_HDR *)data->win)->data;
960 win->user = (void *)data; 883 win->user = (void *)data;
961 data->parent = parent_window; 884 data->parent = parent_window;
985 T_M_DEL_ALL * data; 908 T_M_DEL_ALL * data;
986 909
987 TRACE_FUNCTION ("M_DEL_ALL_destroy()"); 910 TRACE_FUNCTION ("M_DEL_ALL_destroy()");
988 911
989 if (own_window) 912 if (own_window)
990 { 913 {
991 win_data = ((T_MFW_HDR *)own_window)->data; 914 win_data = ((T_MFW_HDR *)own_window)->data;
992 data = (T_M_DEL_ALL *)win_data->user; 915 data = (T_M_DEL_ALL *)win_data->user;
993 916
994 if (data) 917 if (data)
995 { 918 {
996 /* 919 /*
997 * Delete WIN handler 920 * Delete WIN handler
998 */ 921 */
999 922
1000 if (data->waiting_win) 923 if (data->waiting_win)
1001 { 924 {
1002 SEND_EVENT(data->waiting_win,DIALOG_DESTROY,0,0 ); 925 SEND_EVENT(data->waiting_win,DIALOG_DESTROY,0,0 );
1003 data->waiting_win = 0; 926 data->waiting_win = 0;
1004 } 927 }
1005 928
1006 win_delete (data->win); 929 win_delete (data->win);
1007 930
1008 /* 931 /*
1009 * Free Memory 932 * Free Memory
1010 */ 933 */
1011 FREE_MEMORY ((void *)data, sizeof (T_M_DEL_ALL)); 934 FREE_MEMORY ((void *)data, sizeof (T_M_DEL_ALL));
1012 } 935 }
1013 else 936 else
1014 { 937 {
1015 TRACE_EVENT ("M_DEL_ALL_destroy() called twice"); 938 TRACE_EVENT ("M_DEL_ALL_destroy() called twice");
1016 } 939 }
1017 } 940 }
1018 } 941 }
1019 942
1020 /******************************************************************************* 943 /*******************************************************************************
1021 944
1022 $Function: M_DEL_ALL_exec_cb 945 $Function: M_DEL_ALL_exec_cb
1035 void M_DEL_ALL_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) 958 void M_DEL_ALL_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1036 /* callback handler for events sent to to trigger execution */ 959 /* callback handler for events sent to to trigger execution */
1037 { 960 {
1038 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 961 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1039 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user; 962 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1040 T_MFW_EVENT MfwEvents; 963 T_MFW_EVENT MfwEvents;
1041 964
1042 T_DISPLAY_DATA DisplayInfo; 965 T_DISPLAY_DATA DisplayInfo;
1043 966
1044 TRACE_FUNCTION ("M_DEL_ALL_exec_cb()"); 967 TRACE_FUNCTION ("M_DEL_ALL_exec_cb()");
1045 968
1046 switch (event) 969 switch (event)
1047 { 970 {
1048 case E_INIT: 971 case E_INIT:
1049 /* initialization of administrative data */ 972 /* initialization of administrative data */
1050 data->id = value; 973 data->id = value;
1051 974
1052 /* initialization of the dialog data */ 975 /* initialization of the dialog data */
1053 data->type = (MySmsType)(int)parameter; /* x0039928 - Lint warning fix */ 976 data->type = (MySmsType)(int)parameter; /* x0039928 - Lint warning fix */
1054 977
1055 /*SPR2139, initialise sms handle to NULL*/ 978 /*SPR2139, initialise sms handle to NULL*/
1056 data->sms_hnd = NULL; 979 data->sms_hnd = NULL;
1057 980
1058 /* create the dialog handler */ 981 /* create the dialog handler */
1059 // Display the dialog window to delete all the SMS 982 // Display the dialog window to delete all the SMS
1060 SmsMenu_loadDialogDefault(&DisplayInfo); 983 SmsMenu_loadDialogDefault(&DisplayInfo);
1061 984
1062 //NM 29.8 Check before deleting, is SIM ready ?! */ 985 //NM 29.8 Check before deleting, is SIM ready ?! */
1063 if (!smsidle_get_ready_state()) 986 if (!smsidle_get_ready_state())
1064 { 987 {
1065 DisplayInfo.TextId = TxtWaiting; 988 DisplayInfo.TextId = TxtWaiting;
1066 DisplayInfo.Identifier = SMSMENU_ID_NOTREADY; 989 DisplayInfo.Identifier = SMSMENU_ID_NOTREADY;
1067 } 990 }
1068 else 991 else
1069 { /*SPR 2139, if there are no SMSs on the SIM*/ 992 {
1070 if ( sms_message_count(MFW_SMS_ALL) == 0) 993 /*SPR 2139, if there are no SMSs on the SIM*/
1071 { /*tell user*/ 994 if ( sms_message_count(MFW_SMS_ALL) == 0)
1072 DisplayInfo.TextId = TxtEmptyList; 995 { /*tell user*/
996 DisplayInfo.TextId = TxtEmptyList;
1073 DisplayInfo.Identifier = SMSMENU_ID_NOMESSAGES; 997 DisplayInfo.Identifier = SMSMENU_ID_NOMESSAGES;
1074 } 998 }
1075 else 999 else
1076 { /*SPR 2139, only create an SMS event handler if sms initialised and sms list is not empty*/ 1000 { /*SPR 2139, only create an SMS event handler if sms initialised and sms list is not empty*/
1077 MfwEvents = E_SMS_MO_AVAIL | E_SMS_ERR | E_SMS_OK; 1001 MfwEvents = E_SMS_MO_AVAIL | E_SMS_ERR | E_SMS_OK;
1078 data->sms_hnd = sms_create(data->win,MfwEvents,(MfwCb)M_DEL_ALL_mfw_cb); 1002 data->sms_hnd = sms_create(data->win,MfwEvents,(MfwCb)M_DEL_ALL_mfw_cb);
1079 1003
1080 DisplayInfo.TextId = TxtOkToDelete; 1004 DisplayInfo.TextId = TxtOkToDelete;
1081 DisplayInfo.Time = FIVE_SECS; 1005 DisplayInfo.Time = FIVE_SECS;
1082 DisplayInfo.KeyEvents = KEY_RIGHT|KEY_LEFT|KEY_CLEAR; 1006 DisplayInfo.KeyEvents = KEY_RIGHT|KEY_LEFT|KEY_CLEAR;
1083 DisplayInfo.Identifier = SMSMENU_ID_DELETEALL; 1007 DisplayInfo.Identifier = SMSMENU_ID_DELETEALL;
1084 DisplayInfo.LeftSoftKey = TxtSoftOK; 1008 DisplayInfo.LeftSoftKey = TxtSoftOK;
1085 DisplayInfo.RightSoftKey = TxtSoftBack; 1009 DisplayInfo.RightSoftKey = TxtSoftBack;
1086 } 1010 }
1087 } 1011 }
1088 // Generic function for info messages 1012 // Generic function for info messages
1089 1013
1090 (void) info_dialog(win, &DisplayInfo); 1014 (void) info_dialog(win, &DisplayInfo);
1091 1015
1092 winShow(win); 1016 winShow(win);
1093 1017
1094 break; 1018 break;
1095 1019
1096 case E_ABORT: 1020 case E_ABORT:
1097 case E_EXIT: 1021 case E_EXIT:
1098 M_DEL_ALL_destroy (data->win); 1022 M_DEL_ALL_destroy (data->win);
1099 break; 1023 break;
1100 1024
1101 case E_RETURN: 1025 case E_RETURN:
1102 default: 1026 default:
1103 return; 1027 return;
1104 } 1028 }
1105 } 1029 }
1106 1030
1107 /******************************************************************************* 1031 /*******************************************************************************
1108 1032
1109 $Function: M_DEL_ALL_win_cb 1033 $Function: M_DEL_ALL_win_cb
1121 /* V window event handler */ 1045 /* V window event handler */
1122 { 1046 {
1123 TRACE_FUNCTION ("M_DEL_ALL_win_cb()"); 1047 TRACE_FUNCTION ("M_DEL_ALL_win_cb()");
1124 1048
1125 switch (e) 1049 switch (e)
1126 { 1050 {
1127 case MfwWinVisible: /* window is visible */ 1051 case MfwWinVisible: /* window is visible */
1128 displaySoftKeys(TxtSoftSelect,TxtSoftBack); 1052 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
1129 break; 1053 break;
1130 case MfwWinFocussed: /* input focus / selected */ 1054 case MfwWinFocussed: /* input focus / selected */
1131 case MfwWinDelete: /* window will be deleted */ 1055 case MfwWinDelete: /* window will be deleted */
1132 default: 1056 default:
1133 return MFW_EVENT_REJECTED; 1057 return MFW_EVENT_REJECTED;
1134 } 1058 }
1135 return MFW_EVENT_CONSUMED; 1059 return MFW_EVENT_CONSUMED;
1136 } 1060 }
1137 1061
1138 /******************************************************************************* 1062 /*******************************************************************************
1139 1063
1140 $Function: M_DEL_ALL_mfw_cb 1064 $Function: M_DEL_ALL_mfw_cb
1141 1065
1142 $Description: Exec callback function for the DEL_ALL window 1066 $Description: Exec callback function for the DEL_ALL window
1143
1144 1067
1145 $Returns: none 1068 $Returns: none
1146 1069
1147 $Arguments: event - event id 1070 $Arguments: event - event id
1148 parameter - optional data. 1071 parameter - optional data.
1155 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 1078 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1156 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user; 1079 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1157 1080
1158 // T_MFW_EVENT MfwEvents; // RAVI 1081 // T_MFW_EVENT MfwEvents; // RAVI
1159 1082
1160 1083 T_DISPLAY_DATA DisplayInfo;
1161 T_DISPLAY_DATA DisplayInfo;
1162 1084
1163 TRACE_FUNCTION ("M_DEL_ALL_ACK_mfw_cb()"); 1085 TRACE_FUNCTION ("M_DEL_ALL_ACK_mfw_cb()");
1164 1086
1165 switch (event) 1087 switch (event)
1166 { 1088 {
1167 1089
1168 case E_SMS_ERR: 1090 case E_SMS_ERR:
1169 1091
1170 g_SmsMenu_state = SMS_READY; 1092 g_SmsMenu_state = SMS_READY;
1171 1093
1172 SmsMenu_loadDialogDefault(&DisplayInfo); 1094 SmsMenu_loadDialogDefault(&DisplayInfo);
1173 DisplayInfo.Identifier = SMSMENU_ID_DELERR; 1095 DisplayInfo.Identifier = SMSMENU_ID_DELERR;
1174 DisplayInfo.TextId = TxtFailed; 1096 DisplayInfo.TextId = TxtFailed;
1175 info_dialog(win,&DisplayInfo); 1097 info_dialog(win,&DisplayInfo);
1176 break; 1098 break;
1177 1099
1178 case E_SMS_OK: 1100 case E_SMS_OK:
1179 1101
1180 TRACE_EVENT("Event: E_SMS_OK"); 1102 TRACE_EVENT("Event: E_SMS_OK");
1181 1103
1182 // March 31, 2005 REF: CRR MMI-SPR-24511 x0012852 1104 // March 31, 2005 REF: CRR MMI-SPR-24511 x0012852
1183 // Check added for part message before deleting all messages. 1105 // Check added for part message before deleting all messages.
1184 if((g_ListLength2 > 0) && (!((data->g_SmsMenu_messages[g_ListLength2-1].concat_status == MFW_SMS_CONC_PART) 1106 if((g_ListLength2 > 0) && (!((data->g_SmsMenu_messages[g_ListLength2-1].concat_status == MFW_SMS_CONC_PART)
1185 && (data->g_SmsMenu_messages[g_ListLength2-1].index == data->g_SmsMenu_messages[g_ListLength2-1].first_index) 1107 && (data->g_SmsMenu_messages[g_ListLength2-1].index == data->g_SmsMenu_messages[g_ListLength2-1].first_index)
1228 1150
1229 $Function: V_start 1151 $Function: V_start
1230 1152
1231 $Description: Start the voice mailbox dialog window. 1153 $Description: Start the voice mailbox dialog window.
1232 1154
1233
1234 $Returns: window handle 1155 $Returns: window handle
1235 1156
1236 $Arguments: parent_window - parent window handle 1157 $Arguments: parent_window - parent window handle
1237 menuAttr - Menu attributes 1158 menuAttr - Menu attributes
1238 1159
1245 TRACE_FUNCTION ("V_start()"); 1166 TRACE_FUNCTION ("V_start()");
1246 1167
1247 win = V_create (parent_window); 1168 win = V_create (parent_window);
1248 1169
1249 if (win NEQ NULL) 1170 if (win NEQ NULL)
1250 { 1171 {
1251 SEND_EVENT (win, E_INIT, V_ID_SET, (void *)menuAttr); 1172 SEND_EVENT (win, E_INIT, V_ID_SET, (void *)menuAttr);
1252 } 1173 }
1253 return win; 1174 return win;
1254 } 1175 }
1255 1176
1256 /******************************************************************************* 1177 /*******************************************************************************
1257 1178
1275 /* 1196 /*
1276 * Create window handler 1197 * Create window handler
1277 */ 1198 */
1278 1199
1279 data->win = 1200 data->win =
1280 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)V_win_cb); 1201 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)V_win_cb);
1281 if (data->win EQ NULL) 1202 if (data->win EQ NULL)
1282 { 1203 {
1283 return NULL; 1204 return NULL;
1284 } 1205 }
1206
1285 /* 1207 /*
1286 * connect the dialog data to the MFW-window 1208 * connect the dialog data to the MFW-window
1287 */ 1209 */
1288
1289 data->mmi_control.dialog = (T_DIALOG_FUNC)V_exec_cb; 1210 data->mmi_control.dialog = (T_DIALOG_FUNC)V_exec_cb;
1290 data->mmi_control.data = data; 1211 data->mmi_control.data = data;
1291 win = ((T_MFW_HDR *)data->win)->data; 1212 win = ((T_MFW_HDR *)data->win)->data;
1292 win->user = (void *)data; 1213 win->user = (void *)data;
1293 data->parent = parent_window; 1214 data->parent = parent_window;
1317 T_V * data; 1238 T_V * data;
1318 1239
1319 TRACE_FUNCTION ("V_destroy()"); 1240 TRACE_FUNCTION ("V_destroy()");
1320 1241
1321 if (own_window) 1242 if (own_window)
1322 { 1243 {
1323 win_data = ((T_MFW_HDR *)own_window)->data; 1244 win_data = ((T_MFW_HDR *)own_window)->data;
1324 data = (T_V *)win_data->user; 1245 data = (T_V *)win_data->user;
1325 1246
1326 if (data) 1247 if (data)
1327 { 1248 {
1328 /* 1249 /*
1329 * Delete WIN handler 1250 * Delete WIN handler
1330 */ 1251 */
1331 win_delete (data->win); 1252 win_delete (data->win);
1332 1253
1333 /* 1254 /*
1334 * Free Memory 1255 * Free Memory
1335 */ 1256 */
1336 FREE_MEMORY ((void *)data, sizeof (T_V)); 1257 FREE_MEMORY ((void *)data, sizeof (T_V));
1337 } 1258 }
1338 else 1259 else
1339 { 1260 {
1340 TRACE_FUNCTION ("V_destroy() called twice"); 1261 TRACE_FUNCTION ("V_destroy() called twice");
1341 } 1262 }
1342 } 1263 }
1343 } 1264 }
1344 1265
1345 /******************************************************************************* 1266 /*******************************************************************************
1346 1267
1347 $Function: V_exec_cb 1268 $Function: V_exec_cb
1364 T_V * data = (T_V *)win_data->user; 1285 T_V * data = (T_V *)win_data->user;
1365 1286
1366 // char mail_alpha[10+1] = ""; // size hard coded in pcm.h // RAVI 1287 // char mail_alpha[10+1] = ""; // size hard coded in pcm.h // RAVI
1367 1288
1368 #ifdef NEW_EDITOR 1289 #ifdef NEW_EDITOR
1369 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 1290 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
1370 #else 1291 #else
1371 T_EDITOR_DATA editor_data; 1292 T_EDITOR_DATA editor_data;
1372 #endif 1293 #endif
1373 1294
1374 TRACE_FUNCTION ("V_exec_cb()"); 1295 TRACE_FUNCTION ("V_exec_cb()");
1432 callNumber(FFS_flashData.voice_mail); 1353 callNumber(FFS_flashData.voice_mail);
1433 V_destroy(win); 1354 V_destroy(win);
1434 } 1355 }
1435 } 1356 }
1436 1357
1437
1438 break; 1358 break;
1439 1359
1440 case E_ABORT: 1360 case E_ABORT:
1441 V_destroy(win); 1361 V_destroy(win);
1442
1443 break; 1362 break;
1444 1363
1445 case E_RETURN: 1364 case E_RETURN:
1446 case E_EXIT: 1365 case E_EXIT:
1447 1366
1467 /* V window event handler */ 1386 /* V window event handler */
1468 { 1387 {
1469 TRACE_FUNCTION ("V_win_cb()"); 1388 TRACE_FUNCTION ("V_win_cb()");
1470 1389
1471 switch (e) 1390 switch (e)
1472 { 1391 {
1473 case MfwWinVisible: /* window is visible */ 1392 case MfwWinVisible: /* window is visible */
1474 displaySoftKeys(TxtSoftSelect,TxtSoftBack); 1393 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
1475 break; 1394 break;
1476 case MfwWinFocussed: /* input focus / selected */ 1395 case MfwWinFocussed: /* input focus / selected */
1477 case MfwWinDelete: /* window will be deleted */ 1396 case MfwWinDelete: /* window will be deleted */
1478 default: 1397 default:
1479 return MFW_EVENT_REJECTED; 1398 return MFW_EVENT_REJECTED;
1480 } 1399 }
1481 return MFW_EVENT_CONSUMED; 1400 return MFW_EVENT_CONSUMED;
1482 } 1401 }
1483
1484 1402
1485 1403
1486 /******************************************************************************* 1404 /*******************************************************************************
1487 1405
1488 $Function: SmsMenu_standard_dialog_cb 1406 $Function: SmsMenu_standard_dialog_cb
1497 1415
1498 *******************************************************************************/ 1416 *******************************************************************************/
1499 1417
1500 int SmsMenu_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) 1418 int SmsMenu_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
1501 { 1419 {
1502 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1420 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1503 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user; 1421 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1504 1422
1505 TRACE_FUNCTION ("SmsMenu_standard_dialog_cb()"); 1423 TRACE_FUNCTION ("SmsMenu_standard_dialog_cb()");
1506
1507 1424
1508 switch (Identifier) 1425 switch (Identifier)
1509 { 1426 {
1510 case SMSMENU_ID_DELETEALL: 1427 case SMSMENU_ID_DELETEALL:
1511 1428
1626 *******************************************************************************/ 1543 *******************************************************************************/
1627 1544
1628 int SmsMenu_sms_delete_all(T_MFW_HND win) 1545 int SmsMenu_sms_delete_all(T_MFW_HND win)
1629 { 1546 {
1630 //T_MFW_HND win = mfw_parent (mfw_header()); 1547 //T_MFW_HND win = mfw_parent (mfw_header());
1631 // T_DISPLAY_DATA DisplayInfo; 1548 // T_DISPLAY_DATA DisplayInfo;
1632 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1549 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1633 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user; 1550 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1634 1551
1635 TRACE_FUNCTION("SmsMenu_sms_delete_all()"); 1552 TRACE_FUNCTION("SmsMenu_sms_delete_all()");
1636 //May 27, 2005 MMI-FIX-29869 x0018858 1553 //May 27, 2005 MMI-FIX-29869 x0018858
1637 #ifdef FF_MMI_SMS_DYNAMIC 1554 #ifdef FF_MMI_SMS_DYNAMIC
1638 data->g_SmsMenu_messages = (T_MFW_SMS_MSG*)ALLOC_MEMORY (g_max_messages * sizeof(T_MFW_SMS_MSG) ); 1555 data->g_SmsMenu_messages = (T_MFW_SMS_MSG*)ALLOC_MEMORY (g_max_messages * sizeof(T_MFW_SMS_MSG) );
1639 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, g_max_messages); 1556 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, g_max_messages);
1640 #else 1557 #else
1641 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, MAX_MESSAGES); 1558 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, MAX_MESSAGES);
1642 #endif 1559 #endif
1643 //NM 22.8 msgsLoadInfoDefaults2(&DisplayInfo); 1560 //NM 22.8 msgsLoadInfoDefaults2(&DisplayInfo);
1644 1561
1645
1646 if (g_ListLength2 > 0) 1562 if (g_ListLength2 > 0)
1647 { 1563 {
1648 /* Display "Please wait" on the screen*/ 1564 /* Display "Please wait" on the screen*/
1649 /* it is start now to delete sms*/ 1565 /* it is start now to delete sms*/
1650 /* SPR 2139, Removed call to dialog handler, as not needed*/ 1566 /* SPR 2139, Removed call to dialog handler, as not needed*/
1651 1567
1652 // Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar 1568 // Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar
1653 // As the user has already confirmed that all SMS messages are to be deleted, ''End All' key 1569 // As the user has already confirmed that all SMS messages are to be deleted, ''End All' key
1654 // press is to be ignored. Call function mmi_dialog_information_screen_delete_all() instead of 1570 // press is to be ignored. Call function mmi_dialog_information_screen_delete_all() instead of
1655 // mmi_dialog_information_screen_forever(). 1571 // mmi_dialog_information_screen_forever().
1656 1572
1657 // data->waiting_win = mmi_dialog_information_screen_forever(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT); 1573 // data->waiting_win = mmi_dialog_information_screen_forever(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);
1658 1574
1659 data->waiting_win = mmi_dialog_information_screen_delete_all(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT); 1575 data->waiting_win = mmi_dialog_information_screen_delete_all(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);
1660 1576
1661 /* delete now the first sms and than wait */ 1577 /* delete now the first sms and than wait */
1662 /* for the MFW EVENT "E_SMS_OK" */ 1578 /* for the MFW EVENT "E_SMS_OK" */
1663 1579
1664 g_ListLength2 --; 1580 g_ListLength2 --;
1665 /*a0393213 OMAPS00109953 - memory passed as parameter*/ 1581 /*a0393213 OMAPS00109953 - memory passed as parameter*/
1666 sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index,data->g_SmsMenu_messages[g_ListLength2].mem); 1582 sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index,data->g_SmsMenu_messages[g_ListLength2].mem);
1667 } 1583 }
1668 //May 27, 2005 MMI-FIX-29869 x0018858 1584
1585 //May 27, 2005 MMI-FIX-29869 x0018858
1669 #ifdef FF_MMI_SMS_DYNAMIC 1586 #ifdef FF_MMI_SMS_DYNAMIC
1670 if (g_ListLength2 == 0) 1587 if (g_ListLength2 == 0)
1671 FREE_MEMORY((U8*)data->g_SmsMenu_messages, g_max_messages * sizeof(T_MFW_SMS_MSG)); 1588 FREE_MEMORY((U8*)data->g_SmsMenu_messages, g_max_messages * sizeof(T_MFW_SMS_MSG));
1672 #endif 1589 #endif
1673 /*SPR 2139, don't need "else" as empty list case handled earlier*/ 1590 /*SPR 2139, don't need "else" as empty list case handled earlier*/
1674 return 1; 1591 return 1;
1675
1676 } 1592 }
1677 1593
1678 /******************************************************************************* 1594 /*******************************************************************************
1679 1595
1680 $Function: SmsRead_convertMailbox 1596 $Function: SmsRead_convertMailbox
1687 1603
1688 *******************************************************************************/ 1604 *******************************************************************************/
1689 UBYTE SmsRead_convertMailbox(T_MFW_MAILBOX_ID i, char *mail_number, char *mail_alpha) 1605 UBYTE SmsRead_convertMailbox(T_MFW_MAILBOX_ID i, char *mail_number, char *mail_alpha)
1690 { 1606 {
1691 // USHORT max_rcd; // RAVI 1607 // USHORT max_rcd; // RAVI
1692 USHORT nlen; 1608 USHORT nlen;
1693 1609
1694 char *international = mail_number; // Used to add '+' to the number if international 1610 char *international = mail_number; // Used to add '+' to the number if international
1695 1611
1696 TRACE_FUNCTION ("SmsRead_convertMailbox()"); 1612 TRACE_FUNCTION ("SmsRead_convertMailbox()");
1697
1698 1613
1699 // If international number, add the '+' symbol 1614 // If international number, add the '+' symbol
1700 if (FFS_flashData.mbn_numTp & 0x10) 1615 if (FFS_flashData.mbn_numTp & 0x10)
1701 { 1616 {
1702 international[0] = '+'; 1617 international[0] = '+';
1710 cmhPHB_getMfwTagNt((UBYTE*)FFS_flashData.mbn_AlphId, 10, (UBYTE*)mail_alpha, &nlen); 1625 cmhPHB_getMfwTagNt((UBYTE*)FFS_flashData.mbn_AlphId, 10, (UBYTE*)mail_alpha, &nlen);
1711 1626
1712 mail_alpha[nlen] = '\0'; 1627 mail_alpha[nlen] = '\0';
1713 1628
1714 return TRUE; 1629 return TRUE;
1715
1716 } 1630 }
1717 1631
1718 static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) 1632 static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
1719 { 1633 {
1720 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI 1634 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
1723 TRACE_FUNCTION ("SmsMenu_StandardEditor_cb()"); //Marcus: Issue 1490: 13/12/2002 1637 TRACE_FUNCTION ("SmsMenu_StandardEditor_cb()"); //Marcus: Issue 1490: 13/12/2002
1724 1638
1725 switch (reason) 1639 switch (reason)
1726 { 1640 {
1727 case INFO_KCD_LEFT: 1641 case INFO_KCD_LEFT:
1728
1729 1642
1730 if (Identifier EQ V_ID_CALL ) 1643 if (Identifier EQ V_ID_CALL )
1731 { 1644 {
1732 callNumber(FFS_flashData.voice_mail); 1645 callNumber(FFS_flashData.voice_mail);
1733 flash_write(); /*SPR#1929 - DS - Store voicemail number in flash. Port of 1888 */ 1646 flash_write(); /*SPR#1929 - DS - Store voicemail number in flash. Port of 1888 */
1741 */ 1654 */
1742 flash_write(); 1655 flash_write();
1743 } 1656 }
1744 /* Marcus: Issue 1490: 13/12/2002: End */ 1657 /* Marcus: Issue 1490: 13/12/2002: End */
1745 V_destroy(win); 1658 V_destroy(win);
1746
1747
1748 break; 1659 break;
1749 1660
1750 case INFO_KCD_RIGHT: 1661 case INFO_KCD_RIGHT:
1751 case INFO_KCD_CLEAR: 1662 case INFO_KCD_CLEAR:
1752 case INFO_KCD_HUP: 1663 case INFO_KCD_HUP:
1754 default: 1665 default:
1755 break; 1666 break;
1756 } 1667 }
1757 } 1668 }
1758 1669
1759 /* SPR#1428 - SH - New Editor: not required */
1760 #ifndef NEW_EDITOR
1761 /*******************************************************************************
1762
1763 $Function: SmsMenu_loadEditDefault
1764
1765 $Description:
1766
1767 $Returns:
1768
1769 $Arguments:
1770
1771 *******************************************************************************/
1772
1773 void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data)
1774 {
1775 TRACE_FUNCTION ("SmsMenu_loadEditDefault()");
1776
1777 editor_data->editor_attr.win.px = 6;
1778 editor_data->editor_attr.win.py = 12;
1779 editor_data->editor_attr.win.sx = 80;
1780 editor_data->editor_attr.win.sy = 20;
1781 editor_data->editor_attr.edtCol = COLOUR_EDITOR_XX;
1782 editor_data->editor_attr.font = 0;
1783 editor_data->editor_attr.mode = edtCurBar1;
1784 editor_data->editor_attr.controls = 0;
1785 editor_data->editor_attr.text = '\0';
1786 editor_data->editor_attr.size = 0;
1787 editor_data->hide = FALSE;
1788 editor_data->Identifier = 0; /* optional */
1789 editor_data->mode = DIGITS_MODE;
1790 editor_data->destroyEditor = TRUE;
1791 editor_data->LeftSoftKey = TxtSoftSelect;
1792 editor_data->AlternateLeftSoftKey = TxtNull;
1793 editor_data->RightSoftKey = TxtSoftBack;
1794 editor_data->Identifier = 0;
1795 editor_data->TextId = '\0';
1796 editor_data->TextString = NULL;
1797 editor_data->min_enter = 1; // Avoid to return empty strings
1798 editor_data->timeout = FOREVER;
1799 editor_data->Callback = (T_EDIT_CB)SmsMenu_StandardEditor_cb;
1800
1801 }
1802
1803 #endif /* NEW_EDITOR */
1804
1805 /* SPR#1428 - SH - New Editor: These functions moved here from MmiEditor.c */
1806 #ifdef EASY_TEXT_ENABLED
1807
1808 /*******************************************************************************
1809
1810 $Function: eZitextIcon
1811
1812 $Description: Icon to be displayed if eZiText has been selected.
1813
1814 $Returns: None.
1815
1816 $Arguments: None.
1817
1818 *******************************************************************************/
1819
1820 int showeZiTextIcon(MfwMnu* m, MfwMnuItem* i)
1821 {
1822 T_MFW_HND win = mfwParent(mfw_header());
1823
1824 /* BEGIN ADD: Sumit: Locosto*/
1825 eZiTextWin = win;
1826 /* END ADD: Sumit: Locosto*/
1827 TRACE_FUNCTION ("showeZiTextIcon()");
1828
1829 if(Easy_Text_Available == TRUE)
1830 {
1831 if(FFS_flashData.PredTextSelected == TRUE)
1832 {
1833 T_DISPLAY_DATA display_info;
1834 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull, TxtNull, COLOUR_STATUS_EZITEXT);
1835 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)M_exeSendNew, FOUR_SECS, 0 );
1836
1837 mmi_dialogs_insert_animation(info_dialog(win, &display_info), 400, (MfwIcnAttr*)&IconTexteZiText,1);
1838 }
1839 else if(FFS_flashData.PredTextSelected == FALSE)
1840 {
1841 M_exeSendNew(m,i);
1842 }
1843 }
1844 else
1845 M_exeSendNew(m,i);
1846 return 1; /*a0393213 warnings removal-return statement added*/
1847 }
1848
1849
1850 /*******************************************************************************
1851
1852 $Function: EasyActivate
1853
1854 $Description: Icon to be displayed if eZiText has been selected.
1855
1856 $Returns: MFW_EVENT_CONSUMED.
1857
1858 $Arguments: None.
1859
1860 *******************************************************************************/
1861
1862 int Easy_Activate(MfwMnu* m, MfwMnuItem* i)
1863 {
1864 T_MFW_HND win = mfwParent(mfw_header());
1865 T_DISPLAY_DATA display_info;
1866
1867 if(FFS_flashData.PredTextSelected == FALSE)
1868 {
1869 FFS_flashData.PredTextSelected = TRUE;
1870 flash_write();
1871
1872 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText, TxtActivated, COLOUR_STATUS_EZITEXT);
1873 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
1874
1875 info_dialog(win, &display_info);
1876
1877 return MFW_EVENT_CONSUMED;
1878 }
1879 return MFW_EVENT_CONSUMED;/*a0393213 warnings removal - added return statement*/
1880 }
1881
1882 /*******************************************************************************
1883
1884 $Function: EasyActivate
1885
1886 $Description: Icon to be displayed if eZiText has been selected.
1887
1888 $Returns: MFW_EVENT_CONSUMED.
1889
1890 $Arguments: None.
1891
1892 *******************************************************************************/
1893
1894 int Easy_DeActivate(MfwMnu* m, MfwMnuItem* i)
1895 {
1896 T_MFW_HND win = mfwParent(mfw_header());
1897 T_DISPLAY_DATA display_info;
1898
1899 if(FFS_flashData.PredTextSelected == TRUE)
1900 {
1901 FFS_flashData.PredTextSelected = FALSE;
1902 flash_write();
1903
1904 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText, TxtDeActivated, COLOUR_STATUS_EZITEXT);
1905 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
1906 info_dialog(win, &display_info);
1907
1908 return MFW_EVENT_CONSUMED;
1909
1910 }
1911 return MFW_EVENT_CONSUMED;/*a0393213 warnings removal*/
1912 }
1913 #endif /* EASY_TEXT_ENABLED */
1914
1915 #ifdef TI_PS_FF_CONC_SMS 1670 #ifdef TI_PS_FF_CONC_SMS
1916 /******************************************************************************* 1671 /*******************************************************************************
1917 1672
1918 $Function: Concatenate_Status 1673 $Function: Concatenate_Status
1919 1674