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