comparison g23m/condat/ms/src/bmi/mmiSmsMenu.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
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.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI
14 $Module: SMS
15 $File: MmiSmsMenu.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25 Implementation SMS dynamic menu handling
26
27 ********************************************************************************
28
29 $History: MmiSmsMenu.c
30
31 May 27, 2005 MMI-FIX-29869 x0018858
32 Description: There is a limitation on the number of messages that can be downloaded from
33 server even though there is space on the sim.
34 Solution: The limitation has been removed and the number of messages that can be dowloaded
35 has been modified to the masimum number that can be stored.
36
37 March 31, 2005 REF: CRR MMI-SPR-24511 x0012852
38 Bug:The phone crashes when the user selects the 'Delete All' option
39 almost the same time as there's an incoming message.
40 Fix:Check added for part message before deleting all messages.
41
42 Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar
43 Description: The phone resets when user presses the ''End All' key while the SMSs are being deleted.
44 Solution: As the user has already confirmed that all SMS messages are to be deleted, ''End All' key
45 press is ignored till the delete operation is over.
46
47 Jul 13, 2004 REF: CRR 21615 Deepa M.D
48 Bug:Message once entered into message editor not storing in memory.
49 Fix:When a SMS is typed in the Editor, it is stored in a temporary buffer.
50 When the user accesses the editor,the temporary buffer is copied back into
51 the Editor .
52
53 Mar 29, 2004 REF: CRR 12722 Deepa M.D
54 Mar 24, 2004 REF: CRR 15746 Deepa M.D
55 25/10/00 Original Condat(UK) BMI version.
56
57 $End
58
59
60 *******************************************************************************/
61
62 #define MMI_SMSMENU_C
63
64 #define ENTITY_MFW
65
66 /* includes */
67 #include <string.h>
68 #include <stdio.h>
69 #include <stdlib.h>
70
71 #if defined (NEW_FRAME)
72
73 #include "typedefs.h"
74 #include "vsi.h"
75 #include "pei.h"
76 #include "custom.h"
77 #include "gsm.h"
78
79 #else
80
81 #include "STDDEFS.H"
82 #include "custom.h"
83 #include "gsm.h"
84 #include "vsi.h"
85
86 #endif
87 #include "prim.h"
88
89 #include "mfw_mfw.h"
90 #include "mfw_win.h"
91 /* SPR#1428 - SH - New Editor changes */
92 #ifndef NEW_EDITOR
93 #include "mfw_edt.h"
94 #endif
95 #include "mfw_tim.h"
96 #include "mfw_phb.h"
97 #include "ksd.h"
98 #include "psa.h"
99 #include "mfw_sms.h"
100 #include "mfw_smsi.h"
101 #include "mfw_icn.h"
102 #include "mfw_mnu.h"
103 #include "mfw_lng.h"
104 #include "mfw_sat.h"
105 #include "mfw_kbd.h"
106 #include "mfw_nm.h"
107
108
109 #include "dspl.h"
110
111 #include "MmiMain.h"
112 #include "MmiDummy.h"
113 #include "MmiMmi.h"
114
115 #include "MmiDialogs.h"
116 #include "MmiLists.h"
117 #include "MmiMenu.h"
118 #include "MmiSoftKeys.h"
119 /* SPR#1428 - SH - New Editor changes */
120 #ifdef NEW_EDITOR
121 #include "ATBCommon.h"
122 #include "ATBDisplay.h"
123 #include "ATBEditor.h"
124 #include "AUIEditor.h"
125 #else
126 #include "MmiEditor.h"
127 #endif
128 #include "MmiBookShared.h"
129 #include "mmiSmsMenu.h"
130 #include "mmiSmsRead.h"
131 #include "mmismssend.h"
132 #include "mmiSmsIdle.h"
133 #include "mmiSmsBroadcast.h" /* reqd for info_screen function prototype */
134
135 #include "cus_aci.h"
136
137 #include "mfw_ffs.h"
138 //#include "pcm.h"
139
140 #include "mmiColours.h"
141
142 //May 27, 2005 MMI-FIX-29869 x0018858
143 #ifdef FF_MMI_SMS_DYNAMIC
144 int g_max_messages = 0;
145 #endif
146
147
148 /* =================================================== */
149 /* BEGIN ADD: Sumit: Locosto: eZiText */
150 T_MFW_HND eZiTextWin;
151 /* END ADD: Sumit: Locosto: eZiText */
152 /* =================================================== */
153
154 extern T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
155
156 // Start functions of the windows
157 T_MFW_HND M_SND_SAV_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
158 T_MFW_HND M_DEL_ALL_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
159 T_MFW_HND M_DEL_ALL_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
160 T_MFW_HND V_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
161
162 // Standard callback function for temporary dialog window
163 int SmsMenu_StandardDialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
164 static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);
165
166
167 /* This structure is used by 'Delete All' function that is common for SMS and SMS-CB */
168 typedef enum SmsType
169 {
170 SMS_TYPE, /* interfered with macro -> renamed SMS to SMS_TYPE */
171 SMSCB_TYPE
172 } MySmsType;
173
174 /* ID of the different windows (used in SEND_EVENT function to provide the callee the ID of the caller) */
175 typedef enum
176 {
177 /* Logical frames */
178 M_DEL_ALL_ID,
179 M_SND_SAV_ID,
180 V_ID_SET,
181 V_ID_CALL,
182 V_NUM_ID,
183 /* Dialog windows */
184 SMSMENU_ID_NOTREADY,
185 SMSMENU_ID_DELETEALL,
186 SMSMENU_ID_DELOK,
187 SMSMENU_ID_DELERR,
188 SMSMENU_ID_NOMESSAGES,
189 SMSMENU_ID_WAIT
190 } sms_menu_id;
191
192 typedef enum /* numbering plan identifier */
193 {
194 MFW_MB_LINE1 = 1,
195 MFW_MB_LINE2 = 2,
196 MFW_MB_FAX = 3,
197 MFW_MB_DATA = 4
198 } T_MFW_MAILBOX_ID;
199
200
201
202 typedef enum
203 {
204 SMS_DELETING,
205 SMS_DISPLAY,
206 SMS_READY
207 } T_SmsMenu_state;
208
209 typedef struct
210 {
211 /* administrative data */
212
213 T_MMI_CONTROL mmi_control;
214 T_MFW_HND win;
215 SHORT id;
216 T_MFW_HND parent;
217
218 /* associated handlers */
219
220 T_MFW_HND kbd;
221 T_MFW_HND kbd_long;
222 T_MFW_HND menu;
223
224 /* internal data */
225
226 T_SmsUserData * user_data; // text and phone number of the message
227 } T_M_SND_SAV;
228
229 typedef struct
230 {
231 /* administrative data */
232
233 T_MMI_CONTROL mmi_control;
234 T_MFW_HND win;
235 SHORT id;
236 T_MFW_HND parent;
237 T_MFW_HND waiting_win;
238
239 /* associated handlers */
240 T_MFW_HND sms_hnd; /* MFW sms handler */
241
242 /* internal data */
243
244 enum SmsType type; // The type of the SMS to delete (SMS or SMS-CB)
245 //May 27, 2005 MMI-FIX-29869 x0018858
246 #ifdef FF_MMI_SMS_DYNAMIC
247 T_MFW_SMS_MSG *g_SmsMenu_messages;
248 #else
249 T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES];
250 #endif
251 T_MFW_HND child_dialog;
252 } T_M_DEL_ALL;
253
254 typedef struct
255 {
256 /* administrative data */
257
258 T_MMI_CONTROL mmi_control;
259 T_MFW_HND win;
260 SHORT id;
261 T_MFW_HND parent;
262
263 /* associated handlers */
264
265 T_MFW_HND kbd;
266 T_MFW_HND kbd_long;
267 T_MFW_HND menu;
268
269
270 } T_V;
271
272
273
274 typedef struct
275 {
276 /* administrative data */
277
278 T_MMI_CONTROL mmi_control;
279 T_MFW_HND win;
280 SHORT id;
281 T_MFW_HND parent;
282
283 /* associated handlers */
284
285
286 /* internal data */
287 UBYTE voice_number_buffer[NUMBER_LENGTH];
288
289 } T_V_NUM;
290
291 static T_MFW_HND M_SND_SAV_create (T_MFW_HND parent);
292 static void M_SND_SAV_destroy (T_MFW_HND window);
293 static void M_SND_SAV_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
294 static int M_SND_SAV_win_cb (MfwEvt e, MfwWin *w);
295 static int M_SND_SAV_kbd_cb (MfwEvt e, MfwKbd *k);
296 static int M_SND_SAV_mnu_cb (MfwEvt e, MfwMnu *m);
297
298 static int ExeSms_sendM_SND_SAV(MfwMnu *, MfwMnuItem *);
299
300 static T_MFW_HND M_DEL_ALL_create (T_MFW_HND parent);
301 static void M_DEL_ALL_destroy (T_MFW_HND window);
302 static void M_DEL_ALL_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
303 static int M_DEL_ALL_mfw_cb (MfwEvt event, void *parameter);
304 static int M_DEL_ALL_win_cb (MfwEvt e, MfwWin *w);
305
306 static T_MFW_HND V_create (T_MFW_HND parent);
307 static void V_destroy (T_MFW_HND window);
308 static void V_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
309 static int V_win_cb (MfwEvt e, MfwWin *w);
310 static int V_kbd_cb (MfwEvt e, MfwKbd *k);
311 static int V_mnu_cb (MfwEvt e, MfwMnu *m);
312
313
314 /* SPR#1428 - SH - New Editor: not required */
315 #ifndef NEW_EDITOR
316 void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data);
317 #endif
318
319 // State of the SMS menu management
320 T_SmsMenu_state g_SmsMenu_state = SMS_DISPLAY;
321 MfwHnd g_ChildWindow2;
322 UBYTE g_CenterNumber[NUMBER_LENGTH];
323 //Jul 13, 2004 REF: CRR 21615 Deepa M.D
324 UBYTE TempTextBuffer[MAX_MSG_LEN_ARRAY]; //Temporary buffer to store the SMS content
325
326 /*******************************************************************************
327
328 $Function: M_exeSendNew
329
330 $Description: This function is called when the user press Send in the
331 main SMS menu.
332
333 $Returns: Execution status
334
335 $Arguments: m - menu handler
336 i - Menu item selected
337
338 *******************************************************************************/
339
340 int M_exeSendNew(MfwMnu* m, MfwMnuItem* i)
341 {
342 T_MFW_HND win = eZiTextWin;// SUMIT: mfwParent(mfw_header());
343 T_SmsUserData SmsData;
344
345 /* Copy the number and name information to the SMS buffer
346 */
347 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
348
349 /*SPR 2587, check that SMS has been initialised*/
350 if (!smsidle_get_ready_state() || phb_get_mode() == PHB_LOADING)
351 {
352
353 mmi_dialog_information_screen(0, TxtPleaseWait, NULL, NULL, NULL);
354 return 0;
355 }
356 // Jul 13, 2004 REF: CRR 21615 Deepa M.D
357 // Copy the content from the temporary buffer into the editor,so that the
358 // previously typed content is retained.
359
360 if(FFS_flashData.ConcatenateStatus == TRUE)
361 {
362 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN);
363 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN);
364 }
365
366 else
367 {
368 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL);
369 //Copy only 160 characters ofthe message.
370 memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN_SGL-1);
371 }
372
373 SmsData.NumberBuffer[0]='\0'; //set the number to null.
374 SmsData.called_from_reply_item = FALSE;
375
376 SmsSend_SEND_start(win, (void *) &SmsData);
377 return 1;
378 }
379
380 /*******************************************************************************
381
382 $Function: M_exeRead
383
384 $Description: This function is called when the user press Read in the
385 main SMS menu
386
387 $Returns: Execution status
388
389 $Arguments: m - menu handler
390 i - Menu item selected
391
392 *******************************************************************************/
393
394 int M_exeRead(MfwMnu* m, MfwMnuItem* i)
395 {
396 T_MFW_HND win = mfwParent(mfw_header());
397 T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL;
398
399 /* Call the function that manages SMS reading */
400 SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type);
401
402 return 1;
403 }
404
405 /*******************************************************************************
406
407 $Function: M_exeDelAll
408
409 $Description: This function is called when the user press Delete all in the
410 main SMS menu
411
412 $Returns: Execution status
413
414 $Arguments: m - menu handler
415 i - Menu item selected
416
417 *******************************************************************************/
418
419 int M_exeDelAll(MfwMnu* m, MfwMnuItem* i)
420 {
421 T_MFW_HND win = mfwParent(mfw_header());
422 MySmsType sms_type;
423
424 sms_type = SMS_TYPE;
425 // Here we have to pass the type of sms to delete (SMS or SMS-CB)
426 M_DEL_ALL_start(win, (void *)&sms_type);
427
428 return 1;
429 }
430
431 /*******************************************************************************
432
433 $Function: M_exeSendSaved
434
435 $Description: This function is called when the user press Saved messages
436 in the main SMS menu
437
438 $Returns: Execution status
439
440 $Arguments: m - menu handler
441 i - Menu item selected
442
443 *******************************************************************************/
444
445 int M_exeSendSaved(MfwMnu* m, MfwMnuItem* i)
446 {
447 T_MFW_HND win = mfwParent(mfw_header());
448
449 M_SND_SAV_start(win, 0);
450
451 return 1;
452 }
453
454
455
456 /*******************************************************************************
457
458 $Function: voice_mail_init
459
460 $Description: initialization the voice mail buffer
461
462
463 $Returns:
464
465 $Arguments:
466
467
468 *******************************************************************************/
469
470 int voice_mail_init (void)
471 {
472
473 //nm, later have to read the voice mail number from FFS after switching-on the mobile
474
475 //to clear the buffer is only temporary until we are able to save on Flash
476 //memset(voice_mail, '\0', sizeof(voice_mail));
477
478
479
480 return 1;
481 }
482
483
484
485
486 /*******************************************************************************
487
488 $Function: M_exeVoice
489
490 $Description: This function is called when the user press Voice Mail
491 in the main SMS menu
492
493 $Returns: Execution status
494
495 $Arguments: m - menu handler
496 i - Menu item selected
497
498 *******************************************************************************/
499
500 int M_exeVoice(MfwMnu* m, MfwMnuItem* i)
501 {
502 T_MFW_HND win;
503
504 T_MFW_HND parent_window = mfwParent(mfw_header());
505
506 TRACE_FUNCTION ("M_exeVoice()");
507
508 win = V_create (parent_window);
509
510 if (win NEQ NULL)
511 {
512 SEND_EVENT (win, E_INIT, V_ID_SET, 0);
513 }
514 return 1;
515 }
516
517
518 /*******************************************************************************
519
520 $Function: M_callVoice
521
522 $Description: This function is called when the user press set Voice Mail
523 in the main SMS menu
524
525 $Returns: Execution status
526
527 $Arguments: m - menu handler
528 i - Menu item selected
529
530 *******************************************************************************/
531
532 int M_callVoice(MfwMnu* m, MfwMnuItem* i)
533 {
534 T_MFW_HND win;
535 T_MFW_HND parent_win = mfwParent(mfw_header());
536
537
538 TRACE_FUNCTION ("M_callVoice()");
539
540 win = V_create (parent_win);
541
542 if (win NEQ NULL)
543 {
544 SEND_EVENT (win, E_INIT, V_ID_CALL, 0);
545 }
546
547 return 1;
548 }
549
550
551 /*SPR 1920 removed obsolete function*/
552
553
554 /*******************************************************************************
555
556 $Function: ExeSms_sendM_SND_SAV
557
558 $Description: Called when the user press Saved SMS from the Send SMS menu
559
560 $Returns: Execution status
561
562 $Arguments: m - menu handler
563 i - Menu item selected
564
565 *******************************************************************************/
566
567 static int ExeSms_sendM_SND_SAV(MfwMnu* m, MfwMnuItem* i)
568 {
569 T_MFW_HND win = mfwParent(mfw_header());
570
571 return 1;
572 }
573
574 /*******************************************************************************
575
576 $Function: M_SND_SAV_start
577
578 $Description: Start the creation of the saved SMS menu window
579
580 $Returns: Execution status
581
582 $Arguments: parent_window - parent window
583 menuAttr - Menu attributes.
584
585 *******************************************************************************/
586
587 T_MFW_HND M_SND_SAV_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
588 {
589 T_MFW_HND win;
590
591 TRACE_FUNCTION ("M_SND_SAV_start()");
592
593 win = M_SND_SAV_create (parent_window);
594
595 if (win NEQ NULL)
596 {
597 SEND_EVENT (win, E_INIT, M_SND_SAV_ID, (void *)menuAttr);
598 }
599 return win;
600 }
601
602 /*******************************************************************************
603
604 $Function: M_SND_SAV_create
605
606 $Description: Create the saved SMS menu window
607
608 $Returns: Execution status
609
610 $Arguments: parent_window - parent window
611
612 *******************************************************************************/
613
614 static T_MFW_HND M_SND_SAV_create(MfwHnd parent_window)
615 {
616 T_M_SND_SAV * data = (T_M_SND_SAV *)ALLOC_MEMORY (sizeof (T_M_SND_SAV));
617 T_MFW_WIN * win;
618
619 TRACE_FUNCTION ("M_SND_SAV_create()");
620
621
622 /*
623 * Create window handler
624 */
625
626 data->win =
627 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_SND_SAV_win_cb);
628
629 if (data->win EQ NULL)
630 {
631 return NULL;
632 }
633 /*
634 * connect the dialog data to the MFW-window
635 */
636
637 data->mmi_control.dialog = (T_DIALOG_FUNC)M_SND_SAV_exec_cb;
638 data->mmi_control.data = data;
639 win = ((T_MFW_HDR *)data->win)->data;
640 win->user = (void *)data;
641 data->parent = parent_window;
642
643 /*
644 * return window handle
645 */
646
647 return data->win;
648 }
649
650 /*******************************************************************************
651
652 $Function: M_SND_SAV_destroy
653
654 $Description: Destroy the saved SMS menu window
655
656 $Returns: none
657
658 $Arguments: own_window - current window
659
660 *******************************************************************************/
661
662 static void M_SND_SAV_destroy(MfwHnd own_window)
663 {
664 T_MFW_WIN * win_data;
665 T_M_SND_SAV * data;
666
667 TRACE_FUNCTION ("M_SND_SAV_destroy()");
668
669 if (own_window)
670 {
671 win_data = ((T_MFW_HDR *)own_window)->data;
672 data = (T_M_SND_SAV *)win_data->user;
673
674 if (data)
675 {
676 /*
677 * Delete WIN handler
678 */
679 win_delete (data->win);
680
681 /*
682 * Free Memory
683 */
684 FREE_MEMORY ((void *)data->user_data, sizeof (T_SmsUserData));
685 FREE_MEMORY ((void *)data, sizeof (T_M_SND_SAV));
686 }
687 else
688 {
689 TRACE_EVENT ("M_SND_SAV_destroy() called twice");
690 }
691 }
692 }
693
694 /*******************************************************************************
695
696 $Function: M_SND_SAV_exec_cb
697
698 $Description: Exec callback for the saved SMS menu window
699
700 $Returns: none
701
702 $Arguments: win - current window
703 event - window event id
704 value - Unique Id
705 parameter - optional data.
706
707 *******************************************************************************/
708
709 void M_SND_SAV_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
710 /* callback handler for events sent to to trigger execution */
711 {
712 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
713 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user;
714 T_MFW_HND * l_parent;
715 SHORT l_id;
716
717 TRACE_FUNCTION ("M_SND_SAV_exec_cb()");
718
719 switch (event)
720 {
721 case E_INIT:
722 /* initialization of administrative data */
723 data->id = value;
724 data->user_data = (T_SmsUserData *)ALLOC_MEMORY (sizeof (T_SmsUserData));
725 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
726 if(FFS_flashData.ConcatenateStatus == TRUE)
727 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN_SGL);
728 else
729 memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN);
730 data->user_data->NumberBuffer[0] = '\0';
731
732 /* initialization of the dialog data */
733
734 /* create the dialog handler */
735 data->kbd = kbdCreate(data->win,KEY_ALL, (MfwCb)M_SND_SAV_kbd_cb);
736 data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)M_SND_SAV_kbd_cb);
737
738 /* put the (new) dialog window on top of the window stack */
739 mnuUnhide(data->menu);
740 winShow(win);
741 break;
742 case E_ABORT:
743 case E_EXIT:
744 l_parent = data->parent;
745 l_id = data->id;
746 M_SND_SAV_destroy(data->win);
747 SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */
748 break;
749
750 case E_RETURN:
751 default:
752 return;
753 }
754 }
755
756 /*******************************************************************************
757
758 $Function: M_SND_SAV_mnu_cb
759
760 $Description: Menu callback for the saved SMS menu window
761
762 $Returns: Execution status
763
764 $Arguments: e - event id
765 m - menu handle
766
767 *******************************************************************************/
768
769 static int M_SND_SAV_mnu_cb (MfwEvt e, MfwMnu *m)
770 /* M_SND_SAV menu event handler */
771 {
772 T_MFW_HND win = mfwParent(mfw_header());
773 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
774 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user;
775 T_MFW_HND * l_parent;
776 SHORT l_id;
777
778 TRACE_FUNCTION ("M_SND_SAV_mnu_cb()");
779
780 switch (e)
781 {
782 case E_MNU_ESCAPE: /* back to previous menu */
783 l_parent = data->parent;
784 l_id = data->id;
785 M_SND_SAV_destroy(data->win);
786 SEND_EVENT (data->parent, E_RETURN, data->id, NULL);
787 break;
788 default: /* in mnuCreate() only E_MNU_ESCAPE has been enabled! */
789 return MFW_EVENT_REJECTED;
790 }
791 return MFW_EVENT_CONSUMED;
792 }
793
794 /*******************************************************************************
795
796 $Function: M_SND_SAV_win_cb
797
798 $Description: Window callback for the saved SMS menu window
799
800 $Returns: Execution status
801
802 $Arguments: e - event id
803 m - window handle
804
805 *******************************************************************************/
806
807 static int M_SND_SAV_win_cb (MfwEvt e, MfwWin *w)
808 /* M_SND_SAV window event handler */
809 {
810 TRACE_FUNCTION ("M_SND_SAV_win_cb()");
811
812 switch (e)
813 {
814 case MfwWinVisible: /* window is visible */
815 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
816 break;
817 case MfwWinFocussed: /* input focus / selected */
818 case MfwWinDelete: /* window will be deleted */
819 default:
820 return MFW_EVENT_REJECTED;
821 }
822 return MFW_EVENT_CONSUMED;
823 }
824
825 /*******************************************************************************
826
827 $Function: M_SND_SAV_kbd_cb
828
829 $Description: Keyboard callback for the saved SMS menu window
830
831 $Returns: Execution status
832
833 $Arguments: e - event id
834 k - keyboard info
835
836 *******************************************************************************/
837
838 static int M_SND_SAV_kbd_cb (MfwEvt e, MfwKbd *k)
839 /* M_SND_SAV keyboard event handler */
840 {
841 T_MFW_HND win = mfwParent(mfw_header());
842 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
843 T_M_SND_SAV * data = (T_M_SND_SAV *)win_data->user;
844
845 TRACE_FUNCTION ("M_SND_SAV_kbd_cb()");
846
847 if (e & KEY_LONG)
848 {
849 switch (k->code)
850 {
851 case KCD_HUP: /* back to previous menu */
852 mnuEscape(data->menu);
853 break;
854 case KCD_RIGHT: /* Power Down */
855 return MFW_EVENT_REJECTED; /* handled by idle */
856 default: /* no response to all other keys */
857 return MFW_EVENT_CONSUMED;
858 }
859 }
860 else
861 {
862 switch (k->code)
863 {
864 case KCD_MNUUP: /* highlight previous entry */
865 mnuUp(data->menu);
866 winShow(win);
867 break;
868 case KCD_MNUDOWN: /* highlight next entry */
869 mnuDown(data->menu);
870 winShow(win);
871 break;
872 case KCD_LEFT: /* activate this entry */
873 mnuSelect(data->menu);
874 break;
875 case KCD_HUP: /* back to previous menu */
876 case KCD_RIGHT: /* back to previous menu */
877 mnuEscape(data->menu);
878 break;
879 default: /* no response to all other keys */
880 return MFW_EVENT_CONSUMED;
881 }
882 }
883 return MFW_EVENT_CONSUMED;
884 }
885
886
887 /*******************************************************************************
888
889 $Function: M_DEL_ALL_start
890
891 $Description: Start the delete all window dialog.
892
893 $Returns: window handler
894
895 $Arguments: parent_window - parent window
896 menuAttr - Menu attributes.
897
898 *******************************************************************************/
899
900 T_MFW_HND M_DEL_ALL_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
901 {
902 T_MFW_HND win;
903
904 TRACE_FUNCTION ("M_DEL_ALL_start()");
905
906 win = M_DEL_ALL_create (parent_window);
907
908 if (win NEQ NULL)
909 {
910 SEND_EVENT (win, E_INIT, M_DEL_ALL_ID, (void *)menuAttr);
911 }
912 return win;
913 }
914
915 /*******************************************************************************
916
917 $Function: M_DEL_ALL_create
918
919 $Description: Create the delete all window
920
921 $Returns: window handler
922
923 $Arguments: parent_window - parent window
924
925 *******************************************************************************/
926
927 static T_MFW_HND M_DEL_ALL_create(MfwHnd parent_window)
928 {
929 T_M_DEL_ALL * data = (T_M_DEL_ALL *)ALLOC_MEMORY (sizeof (T_M_DEL_ALL));
930 T_MFW_WIN * win;
931
932 TRACE_FUNCTION ("M_DEL_ALL_create()");
933
934 /*
935 * Create window handler
936 */
937
938 data->win =
939 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_DEL_ALL_win_cb);
940
941 if (data->win EQ NULL)
942 {
943 return NULL;
944 }
945 /*
946 * connect the dialog data to the MFW-window
947 */
948
949 data->mmi_control.dialog = (T_DIALOG_FUNC)M_DEL_ALL_exec_cb;
950 data->mmi_control.data = data;
951 win = ((T_MFW_HDR *)data->win)->data;
952 win->user = (void *)data;
953 data->parent = parent_window;
954
955 /*
956 * return window handle
957 */
958
959 return data->win;
960 }
961
962 /*******************************************************************************
963
964 $Function: M_DEL_ALL_destroy
965
966 $Description: Destroy the delete all window
967
968 $Returns: none
969
970 $Arguments: own_window - current window
971
972 *******************************************************************************/
973
974 static void M_DEL_ALL_destroy(MfwHnd own_window)
975 {
976 T_MFW_WIN * win_data;
977 T_M_DEL_ALL * data;
978
979 TRACE_FUNCTION ("M_DEL_ALL_destroy()");
980
981 if (own_window)
982 {
983 win_data = ((T_MFW_HDR *)own_window)->data;
984 data = (T_M_DEL_ALL *)win_data->user;
985
986 if (data)
987 {
988 /*
989 * Delete WIN handler
990 */
991
992 if (data->waiting_win)
993 {
994 SEND_EVENT(data->waiting_win,DIALOG_DESTROY,0,0 );
995 data->waiting_win = 0;
996 }
997
998 win_delete (data->win);
999
1000 /*
1001 * Free Memory
1002 */
1003 FREE_MEMORY ((void *)data, sizeof (T_M_DEL_ALL));
1004 }
1005 else
1006 {
1007 TRACE_EVENT ("M_DEL_ALL_destroy() called twice");
1008 }
1009 }
1010 }
1011
1012 /*******************************************************************************
1013
1014 $Function: M_DEL_ALL_exec_cb
1015
1016 $Description: Exec callback function for the Delete All window
1017
1018 $Returns: none
1019
1020 $Arguments: win - current window
1021 event - event id
1022 value - Unique id
1023 parameter - optional data.
1024
1025 *******************************************************************************/
1026
1027 void M_DEL_ALL_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1028 /* callback handler for events sent to to trigger execution */
1029 {
1030 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1031 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1032 T_MFW_HND * l_parent;
1033 SHORT l_id;
1034 T_MFW_EVENT MfwEvents;
1035
1036 T_DISPLAY_DATA DisplayInfo;
1037
1038 TRACE_FUNCTION ("M_DEL_ALL_exec_cb()");
1039
1040 switch (event)
1041 {
1042 case E_INIT:
1043 /* initialization of administrative data */
1044 data->id = value;
1045
1046 /* initialization of the dialog data */
1047 data->type = (enum SmsType)parameter;
1048
1049 /*SPR2139, initialise sms handle to NULL*/
1050 data->sms_hnd = NULL;
1051
1052 /* create the dialog handler */
1053 // Display the dialog window to delete all the SMS
1054 SmsMenu_loadDialogDefault(&DisplayInfo);
1055
1056 //NM 29.8 Check before deleting, is SIM ready ?! */
1057 if (!smsidle_get_ready_state())
1058 {
1059 DisplayInfo.TextId = TxtWaiting;
1060 DisplayInfo.Identifier = SMSMENU_ID_NOTREADY;
1061 }
1062 else
1063 { /*SPR 2139, if there are no SMSs on the SIM*/
1064 if ( sms_message_count(MFW_SMS_ALL) == 0)
1065 { /*tell user*/
1066 DisplayInfo.TextId = TxtEmptyList;
1067 DisplayInfo.Identifier = SMSMENU_ID_NOMESSAGES;
1068 }
1069 else
1070 { /*SPR 2139, only create an SMS event handler if sms initialised and sms list is not empty*/
1071 MfwEvents = E_SMS_MO_AVAIL | E_SMS_ERR | E_SMS_OK;
1072 data->sms_hnd = sms_create(data->win,MfwEvents,(MfwCb)M_DEL_ALL_mfw_cb);
1073
1074 DisplayInfo.TextId = TxtOkToDelete;
1075 DisplayInfo.Time = FIVE_SECS;
1076 DisplayInfo.KeyEvents = KEY_RIGHT|KEY_LEFT|KEY_CLEAR;
1077 DisplayInfo.Identifier = SMSMENU_ID_DELETEALL;
1078 DisplayInfo.LeftSoftKey = TxtSoftOK;
1079 DisplayInfo.RightSoftKey = TxtSoftBack;
1080 }
1081 }
1082 // Generic function for info messages
1083
1084 (void) info_dialog(win, &DisplayInfo);
1085
1086 winShow(win);
1087
1088 break;
1089
1090 case E_ABORT:
1091 case E_EXIT:
1092 l_parent = data->parent;
1093 l_id = data->id;
1094 M_DEL_ALL_destroy (data->win);
1095 break;
1096
1097 case E_RETURN:
1098 default:
1099 return;
1100 }
1101 }
1102
1103 /*******************************************************************************
1104
1105 $Function: M_DEL_ALL_win_cb
1106
1107 $Description: Window callback function for the delete all window
1108
1109 $Returns: none
1110
1111 $Arguments: e - current window
1112 w - event id
1113
1114 *******************************************************************************/
1115
1116 static int M_DEL_ALL_win_cb (MfwEvt e, MfwWin *w)
1117 /* V window event handler */
1118 {
1119 TRACE_FUNCTION ("M_DEL_ALL_win_cb()");
1120
1121 switch (e)
1122 {
1123 case MfwWinVisible: /* window is visible */
1124 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
1125 break;
1126 case MfwWinFocussed: /* input focus / selected */
1127 case MfwWinDelete: /* window will be deleted */
1128 default:
1129 return MFW_EVENT_REJECTED;
1130 }
1131 return MFW_EVENT_CONSUMED;
1132 }
1133
1134 /*******************************************************************************
1135
1136 $Function: M_DEL_ALL_mfw_cb
1137
1138 $Description: Exec callback function for the DEL_ALL window
1139
1140
1141 $Returns: none
1142
1143 $Arguments: event - event id
1144 parameter - optional data.
1145
1146 *******************************************************************************/
1147
1148 int M_DEL_ALL_mfw_cb (MfwEvt event, void *parameter)
1149 {
1150 T_MFW_HND win = mfwParent((MfwHdr *)mfw_header());
1151 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1152 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1153
1154 // T_MFW_EVENT MfwEvents; // RAVI
1155
1156
1157 T_DISPLAY_DATA DisplayInfo;
1158
1159 TRACE_FUNCTION ("M_DEL_ALL_ACK_mfw_cb()");
1160
1161 switch (event)
1162 {
1163
1164 case E_SMS_ERR:
1165
1166 g_SmsMenu_state = SMS_READY;
1167
1168 SmsMenu_loadDialogDefault(&DisplayInfo);
1169 DisplayInfo.Identifier = SMSMENU_ID_DELERR;
1170 DisplayInfo.TextId = TxtFailed;
1171 info_dialog(win,&DisplayInfo);
1172 break;
1173
1174 case E_SMS_OK:
1175
1176 TRACE_EVENT("Event: E_SMS_OK");
1177
1178 // March 31, 2005 REF: CRR MMI-SPR-24511 x0012852
1179 // Check added for part message before deleting all messages.
1180 if((g_ListLength2 > 0) && (!((data->g_SmsMenu_messages[g_ListLength2-1].concat_status == MFW_SMS_CONC_PART)
1181 && (data->g_SmsMenu_messages[g_ListLength2-1].index == data->g_SmsMenu_messages[g_ListLength2-1].first_index))))
1182 {
1183 g_ListLength2--;
1184
1185 sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index);
1186 }
1187 else
1188 {
1189
1190 /* there is now anymore sms to delete !! */
1191 g_SmsMenu_state = SMS_READY;
1192
1193 /* cq16875 Destroy the previous info dialog if there is one before displaying the new dialog.
1194 When a concatenated message is deleted using the "Delete All" menu option the E_SMS_OK
1195 event is received for each Concat message part that is deleted.
1196 12-02-04 MZ. */
1197 if(data->child_dialog != NULL)
1198 {
1199 SEND_EVENT (data->child_dialog, DIALOG_DESTROY, 0,NULL);
1200 data->child_dialog = NULL;
1201 }
1202
1203 SmsMenu_loadDialogDefault(&DisplayInfo);
1204 DisplayInfo.Identifier = SMSMENU_ID_DELOK;
1205 DisplayInfo.TextId = TxtDeleted;
1206 /*SPR2139, removed sms_delete() from here, this is now donw in dialog callback*/
1207 /*cq16875 Store the info dialog handler 12-02-04 MZ. */
1208 data->child_dialog = info_dialog(win,&DisplayInfo);
1209 }
1210
1211 break;
1212
1213 default:
1214 return MFW_EVENT_REJECTED;
1215
1216 }
1217 return MFW_EVENT_CONSUMED;
1218
1219 }
1220
1221 /*******************************************************************************
1222
1223 $Function: V_start
1224
1225 $Description: Start the voice mailbox dialog window.
1226
1227
1228 $Returns: window handle
1229
1230 $Arguments: parent_window - parent window handle
1231 menuAttr - Menu attributes
1232
1233 *******************************************************************************/
1234
1235 T_MFW_HND V_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
1236 {
1237 T_MFW_HND win;
1238
1239 TRACE_FUNCTION ("V_start()");
1240
1241 win = V_create (parent_window);
1242
1243 if (win NEQ NULL)
1244 {
1245 SEND_EVENT (win, E_INIT, V_ID_SET, (void *)menuAttr);
1246 }
1247 return win;
1248 }
1249
1250 /*******************************************************************************
1251
1252 $Function: V_create
1253
1254 $Description: create the voice mailbox window
1255
1256 $Returns: window handle
1257
1258 $Arguments: parent_window - parent window handle
1259
1260 *******************************************************************************/
1261
1262 static T_MFW_HND V_create(MfwHnd parent_window)
1263 {
1264 T_V * data = (T_V *)ALLOC_MEMORY (sizeof (T_V));
1265 T_MFW_WIN * win;
1266
1267 TRACE_FUNCTION ("V_create()");
1268
1269 /*
1270 * Create window handler
1271 */
1272
1273 data->win =
1274 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)V_win_cb);
1275 if (data->win EQ NULL)
1276 {
1277 return NULL;
1278 }
1279 /*
1280 * connect the dialog data to the MFW-window
1281 */
1282
1283 data->mmi_control.dialog = (T_DIALOG_FUNC)V_exec_cb;
1284 data->mmi_control.data = data;
1285 win = ((T_MFW_HDR *)data->win)->data;
1286 win->user = (void *)data;
1287 data->parent = parent_window;
1288
1289 /*
1290 * return window handle
1291 */
1292
1293 return data->win;
1294 }
1295
1296 /*******************************************************************************
1297
1298 $Function: V_destroy
1299
1300 $Description: Destroy the voice mailbox window
1301
1302 $Returns: none
1303
1304 $Arguments: own_window - current window
1305
1306 *******************************************************************************/
1307
1308 static void V_destroy(MfwHnd own_window)
1309 {
1310 T_MFW_WIN * win_data;
1311 T_V * data;
1312
1313 TRACE_FUNCTION ("V_destroy()");
1314
1315 if (own_window)
1316 {
1317 win_data = ((T_MFW_HDR *)own_window)->data;
1318 data = (T_V *)win_data->user;
1319
1320 if (data)
1321 {
1322 /*
1323 * Delete WIN handler
1324 */
1325 win_delete (data->win);
1326
1327 /*
1328 * Free Memory
1329 */
1330 FREE_MEMORY ((void *)data, sizeof (T_V));
1331 }
1332 else
1333 {
1334 TRACE_FUNCTION ("V_destroy() called twice");
1335 }
1336 }
1337 }
1338
1339 /*******************************************************************************
1340
1341 $Function: V_exec_cb
1342
1343 $Description: Exec callback function for the voice mailbox window
1344
1345 $Returns: none
1346
1347 $Arguments: win - current window
1348 event - event id
1349 value - Unique id
1350 parameter - optional data.
1351
1352 *******************************************************************************/
1353
1354 void V_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1355 /* callback handler for events sent to to trigger execution */
1356 {
1357 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1358 T_V * data = (T_V *)win_data->user;
1359
1360 // char mail_alpha[10+1] = ""; // size hard coded in pcm.h // RAVI
1361
1362 #ifdef NEW_EDITOR
1363 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
1364 #else
1365 T_EDITOR_DATA editor_data;
1366 #endif
1367
1368 TRACE_FUNCTION ("V_exec_cb()");
1369
1370 switch (event)
1371 {
1372 // On exit from the editor, we try again to call the number
1373 case E_INIT:
1374
1375 if ( (FFS_flashData.voice_mail[0] EQ '\0') || (value EQ V_ID_SET) )
1376 {
1377 /* initialization of administrative data */
1378 data->id = value;
1379
1380 /* SPR#1428 - SH - New Editor changes */
1381
1382 #ifdef NEW_EDITOR
1383 AUI_edit_SetDefault(&editor_data);
1384 AUI_edit_SetDisplay(&editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR_XX, EDITOR_FONT);
1385 AUI_edit_SetEvents(&editor_data, value, TRUE, FOREVER, (T_AUI_EDIT_CB)SmsMenu_StandardEditor_cb);
1386 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtVoiceMail, NULL); /* SPR#2141 - DS - Changed RSK to "Delete". */
1387 // Change by Sasken ( Deepa M.d) on March 29th 2004
1388 // Issue Number : MMI-SPR-12722
1389 // Subject: Right softkey should be "Back" when the editor is empty
1390 // Bug : Right softkey should be "Back" when the editor is empty
1391 // Solution : Added alternative string for the right softkey tobe displayed when the editor is empty
1392
1393 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack);
1394 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
1395 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)FFS_flashData.voice_mail, PHB_MAX_LEN);
1396
1397 /* SPR#2141 - DS - Set RSK to "Back" when the editor is empty. */
1398 AUI_edit_SetAltTextStr(&editor_data, 1, NULL, TRUE, TxtSoftBack);
1399
1400 AUI_edit_Start(win, &editor_data);
1401 #else /* NEW_EDITOR */
1402 SmsMenu_loadEditDefault(&editor_data);
1403
1404 editor_data.editor_attr.text = (char *)FFS_flashData.voice_mail;
1405 editor_data.editor_attr.size = PHB_MAX_LEN;
1406 editor_data.TextId = TxtVoiceMail;
1407 editor_data.LeftSoftKey = TxtSoftOK;
1408 // Change by Sasken ( Deepa M.d) on March 29th 2004
1409 // Issue Number : MMI-SPR-12722
1410 // Subject: Right softkey should be "Back" when the editor is empty
1411 // Bug : Right softkey should be "Back" when the editor is empty
1412 // Solution : Added alternative string for the right softkey tobe displayed when the editor is empty
1413
1414 editor_data.RightSoftKey = TxtSoftBack;
1415 editor_data.Identifier = value;
1416
1417 editor_start(win,&editor_data); /* start the editor */
1418 #endif /* NEW_EDITOR */
1419
1420 winShow(win);
1421 }
1422 else
1423 {
1424 if (value EQ V_ID_CALL)
1425 {
1426 callNumber(FFS_flashData.voice_mail);
1427 V_destroy(win);
1428 }
1429 }
1430
1431
1432 break;
1433
1434 case E_ABORT:
1435 V_destroy(win);
1436
1437 break;
1438
1439 case E_RETURN:
1440 case E_EXIT:
1441
1442 default:
1443 return;
1444 }
1445 }
1446
1447 /*******************************************************************************
1448
1449 $Function: V_win_cb
1450
1451 $Description: Window callback function for the voice mailbox window
1452
1453 $Returns: Execution status
1454
1455 $Arguments: e - event id
1456 w - mfw window handle
1457
1458 *******************************************************************************/
1459
1460 static int V_win_cb (MfwEvt e, MfwWin *w)
1461 /* V window event handler */
1462 {
1463 TRACE_FUNCTION ("V_win_cb()");
1464
1465 switch (e)
1466 {
1467 case MfwWinVisible: /* window is visible */
1468 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
1469 break;
1470 case MfwWinFocussed: /* input focus / selected */
1471 case MfwWinDelete: /* window will be deleted */
1472 default:
1473 return MFW_EVENT_REJECTED;
1474 }
1475 return MFW_EVENT_CONSUMED;
1476 }
1477
1478
1479
1480 /*******************************************************************************
1481
1482 $Function: SmsMenu_standard_dialog_cb
1483
1484 $Description: Handler function for standard dialogs in smsmenu module
1485
1486 $Returns: Execution status
1487
1488 $Arguments: win - current window
1489 Identifier - unique id
1490 Reason- event id
1491
1492 *******************************************************************************/
1493
1494 int SmsMenu_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
1495 {
1496 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1497 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1498 T_MFW_HND * l_parent;
1499 SHORT l_id;
1500
1501 TRACE_FUNCTION ("SmsMenu_standard_dialog_cb()");
1502
1503 l_parent = data->parent;
1504 l_id = data->id;
1505
1506 switch (Identifier)
1507 {
1508 case SMSMENU_ID_DELETEALL:
1509
1510 switch (Reason)
1511 {
1512 // User want to delete the SMS
1513 case INFO_KCD_LEFT:
1514 // Trigger the deletion
1515 SmsMenu_sms_delete_all(win);
1516 break;
1517
1518 case INFO_KCD_RIGHT:
1519 case INFO_KCD_HUP:
1520 case INFO_TIMEOUT:
1521 // API - 17-01-03 - 1571 - Add this call to sms_delete() to free memory
1522 sms_delete(data->sms_hnd);
1523 data->sms_hnd = NULL;
1524 /* Destroy the owner of the dialog box */
1525 M_DEL_ALL_destroy(win);
1526 /* Send E_RETURN event to parent of M_DEL_ALL */
1527 /*SPR2139 removed the sending of a destroy event to parent window*/
1528 break;
1529
1530 default:
1531 return MFW_EVENT_REJECTED;
1532 }
1533 break;
1534 /*SPR 2139, if no messages or sms not initialised, just destroy the delete all window*/
1535 case SMSMENU_ID_NOMESSAGES:
1536 case SMSMENU_ID_NOTREADY:
1537 M_DEL_ALL_destroy(win);
1538 break;
1539
1540 case SMSMENU_ID_DELOK:
1541 case SMSMENU_ID_DELERR:
1542 /*SPR2139 Add this call to sms_delete() to free memory*/
1543 sms_delete(data->sms_hnd);
1544 data->sms_hnd = NULL;
1545 /* Destroy the owner of the dialog box */
1546 M_DEL_ALL_destroy(win);
1547 break;
1548
1549 case SMSMENU_ID_WAIT:
1550 // No reaction to any event (wait to be destroyed when MFW event received)
1551 break;
1552
1553 default:
1554 return MFW_EVENT_REJECTED;
1555 }
1556 return MFW_EVENT_CONSUMED;
1557 }
1558
1559
1560 /*******************************************************************************
1561
1562 $Function: SmsMenu_loadDialogDefault
1563
1564 $Description: Loads standard default data for SMS information dialogs.
1565
1566 $Returns: Execution status
1567
1568 $Arguments: DisplayInfo - display settings
1569
1570 *******************************************************************************/
1571
1572 void SmsMenu_loadDialogDefault(T_DISPLAY_DATA * DisplayInfo)
1573 {
1574 dlg_initDisplayData_TextId( DisplayInfo, TxtNull, TxtNull, TxtNull, TxtNull, COLOUR_STATUS);
1575 dlg_initDisplayData_events( DisplayInfo, (T_VOID_FUNC)SmsMenu_standard_dialog_cb, THREE_SECS, KEY_CLEAR);
1576 DisplayInfo->Identifier = DIALOGS_REASON_NULL;
1577 }
1578
1579
1580 /*******************************************************************************
1581
1582 $Function: SmsMenu_call_voice
1583
1584 $Description: dummy function.
1585
1586 $Returns: none
1587
1588 $Arguments: none
1589
1590 *******************************************************************************/
1591
1592 void SmsMenu_call_voice(void)
1593 {
1594 TRACE_FUNCTION ("call_voice");
1595 }
1596
1597 /*******************************************************************************
1598
1599 $Function: SmsMenu_startcall
1600
1601 $Description: dummy function.
1602
1603 $Returns: Execution status
1604
1605 $Arguments: DisplayInfo - display settings
1606
1607 *******************************************************************************/
1608
1609 void SmsMenu_startcall(UBYTE * VoiceNumber)
1610 {
1611 TRACE_FUNCTION ("startcall");
1612 }
1613
1614 /*******************************************************************************
1615
1616 $Function: SmsMenu_sms_delete_all
1617
1618 $Description: Delete all SMS messages.
1619
1620 $Returns: Execution status
1621
1622 $Arguments: win - current window.
1623
1624 *******************************************************************************/
1625
1626 int SmsMenu_sms_delete_all(T_MFW_HND win)
1627 {
1628 //T_MFW_HND win = mfw_parent (mfw_header());
1629 // T_DISPLAY_DATA DisplayInfo;
1630 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1631 T_M_DEL_ALL * data = (T_M_DEL_ALL *)win_data->user;
1632
1633 TRACE_FUNCTION("SmsMenu_sms_delete_all()");
1634 //May 27, 2005 MMI-FIX-29869 x0018858
1635 #ifdef FF_MMI_SMS_DYNAMIC
1636 data->g_SmsMenu_messages = (T_MFW_SMS_MSG*)ALLOC_MEMORY (g_max_messages * sizeof(T_MFW_SMS_MSG) );
1637 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, g_max_messages);
1638 #else
1639 g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, MAX_MESSAGES);
1640 #endif
1641 //NM 22.8 msgsLoadInfoDefaults2(&DisplayInfo);
1642
1643
1644 if (g_ListLength2 > 0)
1645 {
1646 /* Display "Please wait" on the screen*/
1647 /* it is start now to delete sms*/
1648 /* SPR 2139, Removed call to dialog handler, as not needed*/
1649
1650 // Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar
1651 // As the user has already confirmed that all SMS messages are to be deleted, ''End All' key
1652 // press is to be ignored. Call function mmi_dialog_information_screen_delete_all() instead of
1653 // mmi_dialog_information_screen_forever().
1654
1655 // data->waiting_win = mmi_dialog_information_screen_forever(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);
1656
1657 data->waiting_win = mmi_dialog_information_screen_delete_all(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);
1658
1659 /* delete now the first sms and than wait */
1660 /* for the MFW EVENT "E_SMS_OK" */
1661
1662 g_ListLength2 --;
1663
1664 sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index);
1665
1666 }
1667 //May 27, 2005 MMI-FIX-29869 x0018858
1668 #ifdef FF_MMI_SMS_DYNAMIC
1669 if (g_ListLength2 == 0)
1670 FREE_MEMORY((U8*)data->g_SmsMenu_messages, g_max_messages * sizeof(T_MFW_SMS_MSG));
1671 #endif
1672 /*SPR 2139, don't need "else" as empty list case handled earlier*/
1673 return 1;
1674
1675 }
1676
1677 /*******************************************************************************
1678
1679 $Function: SmsRead_convertMailbox
1680
1681 $Description:
1682
1683 $Returns:
1684
1685 $Arguments:
1686
1687 *******************************************************************************/
1688 UBYTE SmsRead_convertMailbox(T_MFW_MAILBOX_ID i, char *mail_number, char *mail_alpha)
1689 {
1690 // USHORT max_rcd; // RAVI
1691 USHORT nlen;
1692
1693 char *international = mail_number; // Used to add '+' to the number if international
1694
1695 TRACE_FUNCTION ("SmsRead_convertMailbox()");
1696
1697
1698 // If international number, add the '+' symbol
1699 if (FFS_flashData.mbn_numTp & 0x10)
1700 {
1701 international[0] = '+';
1702 international[1] = '\0';
1703 international ++;
1704 }
1705 // Convert BCD number into string
1706 cmhPHB_getAdrStr(international, PHB_MAX_LEN - 1, FFS_flashData.mbn_Num, FFS_flashData.mbn_len);
1707
1708 // If the same number then we get the alpha identifier
1709 cmhPHB_getMfwTagNt((UBYTE*)FFS_flashData.mbn_AlphId, 10, (UBYTE*)mail_alpha, &nlen );
1710 mail_alpha[nlen] = '\0';
1711
1712 return TRUE;
1713
1714 }
1715
1716 static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
1717 {
1718 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
1719 // T_V * voice_data = (T_V *)win_data->user; // RAVI
1720
1721 TRACE_FUNCTION ("SmsMenu_StandardEditor_cb()"); //Marcus: Issue 1490: 13/12/2002
1722
1723 switch (reason)
1724 {
1725 case INFO_KCD_LEFT:
1726
1727
1728 if (Identifier EQ V_ID_CALL )
1729 {
1730 callNumber(FFS_flashData.voice_mail);
1731 flash_write(); /*SPR#1929 - DS - Store voicemail number in flash. Port of 1888 */
1732 }
1733 /* Marcus: Issue 1490: 13/12/2002: Start */
1734 else if (Identifier EQ V_ID_SET)
1735 {
1736 /*
1737 ** There is no need to copy the value entered into FFS_flashData.voicemail as the editor
1738 ** has already put the value there.
1739 */
1740 flash_write();
1741 }
1742 /* Marcus: Issue 1490: 13/12/2002: End */
1743 V_destroy(win);
1744
1745
1746 break;
1747
1748 case INFO_KCD_RIGHT:
1749 case INFO_KCD_CLEAR:
1750 case INFO_KCD_HUP:
1751 V_destroy(win);
1752 default:
1753 break;
1754 }
1755 }
1756
1757 /* SPR#1428 - SH - New Editor: not required */
1758 #ifndef NEW_EDITOR
1759 /*******************************************************************************
1760
1761 $Function: SmsMenu_loadEditDefault
1762
1763 $Description:
1764
1765 $Returns:
1766
1767 $Arguments:
1768
1769 *******************************************************************************/
1770
1771 void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data)
1772 {
1773 TRACE_FUNCTION ("SmsMenu_loadEditDefault()");
1774
1775 editor_data->editor_attr.win.px = 6;
1776 editor_data->editor_attr.win.py = 12;
1777 editor_data->editor_attr.win.sx = 80;
1778 editor_data->editor_attr.win.sy = 20;
1779 editor_data->editor_attr.edtCol = COLOUR_EDITOR_XX;
1780 editor_data->editor_attr.font = 0;
1781 editor_data->editor_attr.mode = edtCurBar1;
1782 editor_data->editor_attr.controls = 0;
1783 editor_data->editor_attr.text = '\0';
1784 editor_data->editor_attr.size = 0;
1785 editor_data->hide = FALSE;
1786 editor_data->Identifier = 0; /* optional */
1787 editor_data->mode = DIGITS_MODE;
1788 editor_data->destroyEditor = TRUE;
1789 editor_data->LeftSoftKey = TxtSoftSelect;
1790 editor_data->AlternateLeftSoftKey = TxtNull;
1791 editor_data->RightSoftKey = TxtSoftBack;
1792 editor_data->Identifier = 0;
1793 editor_data->TextId = '\0';
1794 editor_data->TextString = NULL;
1795 editor_data->min_enter = 1; // Avoid to return empty strings
1796 editor_data->timeout = FOREVER;
1797 editor_data->Callback = (T_EDIT_CB)SmsMenu_StandardEditor_cb;
1798
1799 }
1800
1801 #endif /* NEW_EDITOR */
1802
1803 /* SPR#1428 - SH - New Editor: These functions moved here from MmiEditor.c */
1804 #ifdef EASY_TEXT_ENABLED
1805
1806 /*******************************************************************************
1807
1808 $Function: eZitextIcon
1809
1810 $Description: Icon to be displayed if eZiText has been selected.
1811
1812 $Returns: None.
1813
1814 $Arguments: None.
1815
1816 *******************************************************************************/
1817
1818 int showeZiTextIcon(MfwMnu* m, MfwMnuItem* i)
1819 {
1820 T_MFW_HND win = mfwParent(mfw_header());
1821
1822 /* BEGIN ADD: Sumit: Locosto*/
1823 eZiTextWin = win;
1824 /* END ADD: Sumit: Locosto*/
1825 TRACE_FUNCTION ("showeZiTextIcon()");
1826
1827 if(Easy_Text_Available == TRUE)
1828 {
1829 if(FFS_flashData.PredTextSelected == TRUE)
1830 {
1831 T_DISPLAY_DATA display_info;
1832 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull, TxtNull, COLOUR_STATUS_EZITEXT);
1833 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)M_exeSendNew, FOUR_SECS, 0 );
1834
1835 mmi_dialogs_insert_animation(info_dialog(win, &display_info), 400, (MfwIcnAttr*)&IconTexteZiText,1);
1836 }
1837 else if(FFS_flashData.PredTextSelected == FALSE)
1838 {
1839 M_exeSendNew(m,i);
1840 }
1841 }
1842 else
1843 M_exeSendNew(m,i);
1844
1845 }
1846
1847
1848 /*******************************************************************************
1849
1850 $Function: EasyActivate
1851
1852 $Description: Icon to be displayed if eZiText has been selected.
1853
1854 $Returns: MFW_EVENT_CONSUMED.
1855
1856 $Arguments: None.
1857
1858 *******************************************************************************/
1859
1860 int Easy_Activate(MfwMnu* m, MfwMnuItem* i)
1861 {
1862 T_MFW_HND win = mfwParent(mfw_header());
1863 T_DISPLAY_DATA display_info;
1864
1865 if(FFS_flashData.PredTextSelected == FALSE)
1866 {
1867 FFS_flashData.PredTextSelected = TRUE;
1868 flash_write();
1869
1870 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText, TxtActivated, COLOUR_STATUS_EZITEXT);
1871 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
1872
1873 info_dialog(win, &display_info);
1874
1875 return MFW_EVENT_CONSUMED;
1876 }
1877 }
1878
1879
1880 /*******************************************************************************
1881
1882 $Function: EasyActivate
1883
1884 $Description: Icon to be displayed if eZiText has been selected.
1885
1886 $Returns: MFW_EVENT_CONSUMED.
1887
1888 $Arguments: None.
1889
1890 *******************************************************************************/
1891
1892 int Easy_DeActivate(MfwMnu* m, MfwMnuItem* i)
1893 {
1894 T_MFW_HND win = mfwParent(mfw_header());
1895 T_DISPLAY_DATA display_info;
1896
1897 if(FFS_flashData.PredTextSelected == TRUE)
1898 {
1899 FFS_flashData.PredTextSelected = FALSE;
1900 flash_write();
1901
1902 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText, TxtDeActivated, COLOUR_STATUS_EZITEXT);
1903 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
1904 info_dialog(win, &display_info);
1905
1906 return MFW_EVENT_CONSUMED;
1907
1908 }
1909 }
1910 #endif /* EASY_TEXT_ENABLED */
1911
1912 /*******************************************************************************
1913
1914 $Function: Concatenate_Status
1915
1916 $Description: Displays the Concatenation Satus
1917
1918 $Returns: MFW_EVENT_CONSUMED.
1919
1920 $Arguments: None.
1921
1922 *******************************************************************************/
1923
1924 int Concatenate_Status(MfwMnu* m, MfwMnuItem* i)
1925 {
1926 T_MFW_HND win = mfwParent(mfw_header());
1927
1928 USHORT TextId2;
1929
1930 // change by Sasken on March 24th 2004
1931 // Issue Number : SPR#15746
1932 // TextId2 string changed to TxtActivated from TxtActivate
1933
1934 if (FFS_flashData.ConcatenateStatus == TRUE )
1935 TextId2 = TxtActivated;
1936 else
1937 TextId2 = TxtDeActivated;
1938
1939 /*
1940 ** Display a standard dialog, with no keys processed, for 3 secs
1941 */
1942 info_screen(win, TxtConcat, TextId2, (T_VOID_FUNC) NULL);
1943
1944 return MFW_EVENT_CONSUMED;
1945 }
1946
1947
1948 /*******************************************************************************
1949
1950 $Function: ConcatenateDeActivate
1951
1952 $Description: Deactivates the Concatenation Switch
1953
1954 $Returns: MFW_EVENT_CONSUMED.
1955
1956 $Arguments: None.
1957
1958 *******************************************************************************/
1959
1960 int Concatenate_DeActivate(MfwMnu* m, MfwMnuItem* i)
1961 {
1962 T_MFW_HND win = mfwParent(mfw_header());
1963 // T_DISPLAY_DATA display_info; // RAVI
1964
1965 FFS_flashData.ConcatenateStatus = FALSE;
1966 flash_write();
1967
1968 /*
1969 ** Display a standard dialog, with no keys processed, for 3 secs
1970 */
1971 info_screen(win, TxtConcat, TxtDeActivated, (T_VOID_FUNC) NULL);
1972
1973 return MFW_EVENT_CONSUMED;
1974 }
1975
1976
1977 /*******************************************************************************
1978
1979 $Function: ConcatenateActivate
1980
1981 $Description: Deactivates the Concatenation Switch
1982
1983 $Returns: MFW_EVENT_CONSUMED.
1984
1985 $Arguments: None.
1986
1987 *******************************************************************************/
1988
1989 int Concatenate_Activate(MfwMnu* m, MfwMnuItem* i)
1990 {
1991 T_MFW_HND win = mfwParent(mfw_header());
1992 // T_DISPLAY_DATA display_info; // RAVI
1993
1994 FFS_flashData.ConcatenateStatus = TRUE;
1995 flash_write();
1996
1997 /*
1998 ** Display a standard dialog, with no keys processed, for 3 secs
1999 */
2000 info_screen(win, TxtConcat, TxtActivated, (T_VOID_FUNC) NULL);
2001
2002 return MFW_EVENT_CONSUMED;
2003 }
2004
2005 #undef MMI_SMSMENU_C