comparison src/ui/bmi/mmiSettings.c @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children c0052fe355d3
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
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 (6349)
14 $Module: Settings
15 $File: MmiSettings.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25
26 ********************************************************************************
27 $History: MmiSettings.c
28
29 Mar 28, 2007 DR: OMAPS00122762 x0039928
30 Description: MM: Deleting a PCM Voice Memo message in one particular memory,
31 delete them in all memories
32 Solution: voice memo position and pcm voice memo position is provided for all the devices.
33
34 Oct 30 2006, OMAPS00098881 x0039928(sumanth)
35 Removal of power variant
36
37 xashmic 27 Sep 2006, OMAPS00096389
38 ENH - a) Providing static menu for re-selection of enum options for enumeration
39 b) Popup menu displayed on connect event, can be enabled or disabled via menu option
40
41 xashmic 9 Sep 2006, OMAPS00092732
42 USBMS ER
43
44 May 30, 2006 DR: OMAPS00070657 x0pleela
45 Description: CPHS feature on Locosto-Lite
46 Solution: For ALS feature,
47 a) Updating function "setUserSettings2Default ()" to memset Line1 and line2
48 fields of FFS_flashData
49
50 Apr 06, 2006 ERT: OMAPS00070660 x0039928(sumanth)
51 Description: Need to reduce flash foot-print for Locosto Lite
52 Solution: Voice Memo feature is put under the flag #ifndef FF_NO_VOICE_MEMO to compile
53 out voice memo feature if the above flag is enabled.
54
55 May 04, 2005 REF: CRR 30285 x0021334
56 Description: SMS Status Request in idle and dedicated mode (using Menu) setting does not work
57 Solution: status of sms status request is read and focus is set accrodingly.
58
59 March 2, 2005 REF: CRR 11536 x0018858
60 Description: Reply path not supported while sending a reply.
61 Solution: Added menu option for the reply path.
62
63 Aug 25, 2004 REF: CRR 24904 Deepa M.D
64 Bug:cleanup compile switches used for Go-lite
65 Fix:COLOURDISPLAY compiler switch has been added to the functions which are
66 used only for the normal color build.
67
68 xrashmic 7 Dec, 2004 MMI-SPR-23965
69 Description: Not able to extract the objects in EMS message
70 Solution: Extract and store the objects in the Object Manager
71
72 xrashmic 29 Nov, 2004 MMI-SPR-26161
73 Description: The downloaded object through wap was not visible to the MMI
74 Solution: The downloaded wap object is available in the object manager
75 and can be used by the MMS
76
77 Jul 28, 2004 REF: CRR 20899 xkundadu
78 Description: No identification for user whether 'Any-key-Answer' is On/Off
79 Solution: The menu focus will be on the 'On' menu if the 'Any key
80 answer' is enabled, otherwise focus will be on 'Off' menu item.
81 Changed "submenu" to "menuItem" to call a function, to set focus to
82 the selected option.Added function settingsFocusCurSelAnyKeyAns()
83 to set the focus to selected item.
84
85
86 Jul 29, 2004 REF: CRR 20898 xkundadu
87 Description: No identification for user whether 'Auto-Answer' is On/Off
88 Solution: The menu focus will be on the 'On' menu if the 'Auto
89 answer' is enabled, otherwise focus will be on 'Off' menu item.
90 Changed 'submenu' to 'menuItem' to call a function, which sets the
91 focus to the selected option. Added the function
92 settingsFocusCurSelAutoAns() to set the focus to selected item.
93
94
95 Jul 22,2004 CRR:20896 xrashmic - SASKEN
96 Description: The current time format is not highlighted
97 Fix: Instead of providing the submenu directly we call a function
98 where we set the menu and also higlight the previously selected menu item
99
100 // Issue Number : SPR#12822 on 31/03/04 by vvadiraj
101 May 10, 2004 REF: CRR 15753 Deepa M.D
102 Menuitem provided to set the validity period to maximum.
103 $End
104 *******************************************************************************/
105
106
107 /*******************************************************************************
108
109 Include Files
110
111 *******************************************************************************/
112
113 #define ENTITY_MFW
114
115 /* includes */
116 #include <string.h>
117 #include <stdio.h>
118 #include <stdlib.h>
119
120 #if defined (NEW_FRAME)
121
122 #include "typedefs.h"
123 #include "vsi.h"
124 #include "pei.h"
125 #include "custom.h"
126 #include "gsm.h"
127
128 #else
129
130 #include "STDDEFS.H"
131 #include "custom.h"
132 #include "gsm.h"
133 #include "vsi.h"
134
135 #endif
136 #include "mfw_sys.h"
137
138 #include "prim.h"
139
140 #include "mfw_mfw.h"
141 #include "mfw_win.h"
142 #include "mfw_kbd.h"
143 /* SPR#1428 - SH - New Editor changes */
144 #ifndef NEW_EDITOR
145 #include "mfw_edt.h"
146 #endif
147 #include "mfw_lng.h"
148 #include "mfw_tim.h"
149 #include "mfw_icn.h"
150 #include "mfw_mnu.h"
151 #include "mfw_phb.h"
152 #include "mfw_cm.h"
153 #include "mfw_sim.h"
154 #include "mfw_nm.h"
155 #include "mfw_sat.h"
156 #include "mfw_phb.h"
157 #include "ksd.h"
158 #include "psa.h"
159 #include "mfw_sms.h"
160 #include "mfw_cphs.h"
161 #include "mfw_sat.h"
162 #include "Mfw_td.h"
163
164 #include "mfw_mme.h"//xashmic 27 Sep 2006, OMAPS00096389
165
166 #include "dspl.h"
167
168 #include "MmiMmi.h"
169 #include "MmiDummy.h"
170 #include "MmiDialogs.h"
171 #include "MmiLists.h"
172 #include "MmiIdle.h"
173 #include "MmiSoftKeys.h"
174 #include "Mmiicons.h"
175 #include "MmiSounds.h"
176 #include "MmiMenu.h"
177 #include "MmiMain.h"
178 #include "MmiStart.h"
179 #include "MmiPins.h"
180 #include "MmiSettings.h"
181
182 #ifndef FF_NO_VOICE_MEMO
183 #include "MmiVoiceMemo.h"
184 #endif
185
186 #include "mfw_ffs.h"
187 #include "MmiTimers.h"
188 #include "MmiResources.h"
189
190 #include "cus_aci.h"
191
192
193 #include "mmiColours.h"
194
195 #define CLEAR_BOTTOM_ZONE dspl_Clear( KEY_AREA );
196 T_MFW_SMS_INFO SmsConfigData;
197
198 //ADDED BY RAVI - 28-11-2005
199 extern UBYTE SmsSend_get_config_data (T_MFW_SMS_INFO *config_data);
200 // END ADD BY RAVI
201
202 static int winEvent (MfwEvt e, MfwWin *w);
203
204 void confirm (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
205 void confirm_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
206 static void confirm_dialog(void);
207 static int confirm_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
208 void confirm_destroy (T_MFW_HND own_window);
209 T_MFW_HND confirm_create (T_MFW_HND parent_window);
210 void confirm_Exit (T_MFW_HND own_window);
211 T_MFW_HND confirm_Init (T_MFW_HND parent_window);
212 void setUserSettings2Default (void);
213
214
215 static void (*show) (void);
216
217 static MfwHnd win; /* our window */
218 /* static MmiState nextState; // next state when finished x0039928 - Lint warning fix */
219 /* static DisplayData DisplayInfo; x0039928 - Lint warning fix */
220
221
222
223 #define SHOW_CONFIRM 3
224 #define ACTIVATE_CONFIRM 4
225 #define DEACTIVATE_CONFIRM 5
226 #define FACTORY_RESET 6
227
228 UBYTE reply_path_bit =0;
229
230 typedef struct
231 {
232 T_MMI_CONTROL mmi_control;
233 T_MFW_HND confirm_win; /* MFW win handler */
234 UBYTE local_status;
235 } T_confirm;
236
237 T_confirm confirm_data;
238
239
240 /*
241 * Settings menu subs:
242 */
243
244
245
246
247 #define ON 0
248 #define OFF 1
249 #define CLEAR 2
250
251
252 typedef struct
253 {
254 UBYTE setting;
255 UBYTE status;
256 } T_settings;
257
258 //GW Added for settings not stored in FFS
259 static unsigned int BMIsettings=0; /* x0039928 - Lint warning fix */
260
261 typedef enum
262 {
263 ENGLISH = 0,
264 GERMAN,
265 AUTOREDIAL,
266 AUTOANSWER,
267 ANYKEYANSWER,
268 CALLTIMERS,
269 KEYPAD_CLICK,
270 KEYPAD_DTMF,
271 KEYPAD_SILENT,
272 #ifndef FF_NO_VOICE_MEMO
273 VOICE_MEMO,
274 #endif
275 #ifdef FF_POWER_MANAGEMENT
276 LCD_REFRESH, /*OMAPS00098881 (removing power variant) a0393213(Prabakar)*/
277 #endif
278 MAX
279 }T_FACTORY_RESET_LIST;
280
281
282
283 T_settings DEFAULT_SETTINGS[] =
284 {
285 {ENGLISH, ON}, //select the Language:English as a default
286 {GERMAN, OFF},
287 {AUTOREDIAL, OFF},
288 {AUTOANSWER, OFF},
289 {ANYKEYANSWER, OFF},
290 {CALLTIMERS, CLEAR},
291 {KEYPAD_CLICK, ON}, //only one of the Keypads are eligible
292 {KEYPAD_DTMF, OFF},
293 {KEYPAD_SILENT, OFF},
294 #ifndef FF_NO_VOICE_MEMO
295 {VOICE_MEMO, CLEAR},
296 #endif
297 #ifdef FF_POWER_MANAGEMENT
298 {LCD_REFRESH, ON}, /*OMAPS00098881 (removing power variant) a0393213(Prabakar)*/
299 #endif
300 {MAX, 0xFF}
301 };
302
303 /*******************************************************************************
304
305 $Function: SmsValidityPeriod
306
307 $Description: Store the validity period information, selected by the user.
308
309
310 $Returns: Execution status
311
312 $Arguments: m - menu handler
313 i - Menu item selected
314
315 *******************************************************************************/
316 int SmsValidityPeriod(MfwMnu* m, MfwMnuItem* i)
317 {
318 T_MFW_SMS_INFO sms_parameter;
319 UBYTE index = 0; // RAVI - Assigned 0.
320 T_DISPLAY_DATA DisplayInfo;
321 int txtId = 0; // RAVI - Assigned 0.
322
323 T_MFW_HND win = mfwParent(mfw_header());
324
325 TRACE_FUNCTION(">>>> SmsValidityPeriod()");
326
327 /*SPR#1952 - DS - Show the new period setting on pop-up dialog */
328 switch (m->lCursor[m->level])
329 {
330 case 0:
331 txtId = Txt1Hour;
332 index = VP_REL_1_HOUR;
333 break;
334 case 1:
335 txtId = Txt12Hours;
336 index = VP_REL_12_HOURS;
337 break;
338 case 2:
339 txtId = Txt24Hours;
340 index = VP_REL_24_HOURS;
341 break;
342 case 3:
343 txtId = Txt1Week;
344 index = VP_REL_1_WEEK;
345 break;
346 case 4:
347 txtId = TxtMaxTime;
348 index = VP_REL_MAXIMUM; // May 10, 2004 REF: CRR 15753 Deepa M.D
349 break;
350
351 }
352
353 /* API - 28/07/03 - CQ10203 - Read the Data and then set the REL VP identifier*/
354 SmsSend_get_config_data(&sms_parameter);
355
356 FFS_flashData.vp_rel = index;
357 flash_write();
358
359 sms_parameter.vp_rel = FFS_flashData.vp_rel;
360 TRACE_EVENT_P1("sms_parameter.vp_rel = %d", sms_parameter.vp_rel);
361 /*API - CQ10203 END*/
362
363 if (sms_set_val_period(&sms_parameter) == MFW_SMS_OK)
364 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtCancel,TxtSmsValidityPeriodSet, txtId /*SPR#1952*/, COLOUR_STATUS);
365 else
366 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtCancel,TxtFailed, TxtNull, COLOUR_STATUS);
367
368 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)NULL, THREE_SECS, KEY_RIGHT|KEY_CLEAR );
369
370 // Display confirmation screen.
371 info_dialog(win,&DisplayInfo);
372
373 return 1;
374 }
375
376
377 /* Marcus: Issue 1170: 30/09/2002: Start */
378 /*******************************************************************************
379
380 $Function: SmsStatusReportRequest
381
382 $Description: Activate/Deactivate SRR, selected by the user.
383
384 $Returns: Execution status
385
386 $Arguments: m - menu handler
387 i - Menu item selected
388
389 *******************************************************************************/
390 int SmsStatusReportRequest(MfwMnu* m, MfwMnuItem* i)
391 {
392 int index = m->lCursor[m->level];
393 T_DISPLAY_DATA DisplayInfo;
394 T_MFW_SMS_INFO sms_info;
395 T_MFW_HND win = mfwParent(mfw_header());
396 int TextId2;
397 TRACE_FUNCTION(">>>> SmsStatusReportRequest()");
398
399 if (sms_parameter(&sms_info, TRUE) == MFW_SMS_OK)
400 {
401 if (index == 0)
402 sms_info.srr = SMS_NOT_REQUESTED_SRR;
403 else
404 sms_info.srr = SMS_REQUESTED_SRR;
405
406 if (sms_parameter(&sms_info, FALSE) == MFW_SMS_OK)
407 {
408
409 if (index == 0)
410 TextId2 = TxtOff;
411 else
412 TextId2 = TxtOn;
413
414 dlg_initDisplayData_TextId( &DisplayInfo, TxtSoftOK, TxtNull,TxtSRR, TextId2, COLOUR_POPUP);
415 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)NULL, THREE_SECS, KEY_RIGHT | KEY_LEFT );
416
417 info_dialog(win,&DisplayInfo);
418 }
419 }
420 return 1;
421 }
422 /* Marcus: Issue 1170: 30/09/2002: End */
423
424 /*
425 March 2, 2005 REF: CRR 11536 x0018858
426 Added a function to set the Reply path
427 */
428 //begin -11536
429 /*******************************************************************************
430
431 $Function: SmsReplyPathRequest
432
433 $Description: Activate/Deactivate reply path, selected by the user.
434
435 $Returns: Execution status
436
437 $Arguments: m - menu handler
438 i - Menu item selected
439
440
441 *******************************************************************************/
442
443 int SmsReplyPathRequest(MfwMnu* m, MfwMnuItem* i)
444 {
445 int index = m->lCursor[m->level];
446 T_DISPLAY_DATA DisplayInfo;
447 T_MFW_SMS_INFO sms_info;
448 T_MFW_HND win = mfwParent(mfw_header());
449 int TextId2;
450 TRACE_FUNCTION(">>>> SmsReplyPathRequest()");
451
452 if (sms_parameter(&sms_info, TRUE) == MFW_SMS_OK)
453 {
454 if (index == 0)
455 reply_path_bit= SMS_UNSET_RP;
456 else
457 reply_path_bit= SMS_SET_RP;
458
459 TRACE_EVENT_P1("The reply paTH BIT IS = %d", reply_path_bit);
460
461 if (index == 0)
462 TextId2 = TxtOff;
463 else
464 TextId2 = TxtOn;
465
466 dlg_initDisplayData_TextId( &DisplayInfo, TxtSoftOK, TxtNull,TxtRP, TextId2, COLOUR_POPUP);
467 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)NULL, THREE_SECS, KEY_RIGHT | KEY_LEFT );
468
469 info_dialog(win,&DisplayInfo);
470
471 }
472 return 1;
473 }
474 // End --11536
475
476
477 /*******************************************************************************
478
479 $Function: settingsVoiceMail
480
481 $Description: menu entry function
482
483 $Returns:
484
485 $Arguments:
486
487 *******************************************************************************/
488 int settingsVoiceMail(MfwMnu* m, MfwMnuItem* i)
489
490 {
491
492 cphs_get_mailbox ();
493
494
495 return 0;
496 }
497
498 /*******************************************************************************
499
500 $Function: settingsVoiceMail
501
502 $Description: menu entry function
503
504 $Returns:
505
506 $Arguments:
507
508 *******************************************************************************/
509 int settingsScNumber(MfwMnu* m, MfwMnuItem* i)
510 {
511
512 return 0;
513 }
514 /*******************************************************************************
515
516 $Function: settingsInit
517
518 $Description: init settings handling
519
520 $Returns:
521
522 $Arguments:
523
524 *******************************************************************************/
525 void settingsInit (void)
526 {
527
528 TRACE_EVENT ("settingsInit()");
529
530 /* nextState = 0; x0039928 - Lint warning fix */
531
532 win = winCreate(0,0,MfwWinVisible,(MfwCb)winEvent);
533 winShow(win);
534 }
535
536 /*******************************************************************************
537
538 $Function: settingsExit
539
540 $Description: exit settings handling
541
542 $Returns:
543
544 $Arguments:
545
546 *******************************************************************************/
547 void settingsExit (void)
548 {
549 TRACE_FUNCTION ("settingsExit()");
550
551 /* nextState = 0; x0039928 - Lint warning fix */
552 winDelete(win); win = 0;
553 }
554
555
556 /*******************************************************************************
557
558 $Function: winEvent
559
560 $Description: window event handler
561
562 $Returns:
563
564 $Arguments:
565
566 *******************************************************************************/
567 static int winEvent (MfwEvt e, MfwWin *w)
568 {
569 TRACE_EVENT ("MmiSettings :: winEvent()");
570
571 switch (e)
572 {
573 case MfwWinVisible:
574 if (w->flags & MfwWinVisible)
575 show();
576 break;
577 default:
578 return 0;
579 }
580
581 return 1;
582 }
583 /*******************************************************************************
584
585 $Function: settingsGetStatus
586
587 $Description: Function to return the status of various BMI settings
588
589 $Returns: Non-zero number if setting is ON
590 Zero if the setting is OFF
591
592 $Arguments: flagBit - value indicating which setting is to be changed.
593
594 *******************************************************************************/
595 int settingsGetStatus(int flagBit)
596 {
597 if (flagBit & SettingsKeyPadLockOn)
598 {
599 return(BMIsettings & flagBit);
600 }
601 else
602 {
603 return(FFS_flashData.settings_status & flagBit);
604 }
605 }
606 /*******************************************************************************
607
608 $Function: settingsSetStatus
609
610 $Description: Function to set or clear the status of various BMI settings
611
612 $Returns: None.
613
614 $Arguments: flagBit - value indicating which setting is to be changed.
615 state - SET_SETTING - set the value
616 - CLEAR_SETTING - clear the value.
617 GW SPR#2470 Created
618 *******************************************************************************/
619 void settingsSetStatus(unsigned int flagBit, int value)
620 {
621 if (flagBit & SettingsKeyPadLockOn)
622 {
623 if (value == SET_SETTING)
624 BMIsettings = BMIsettings | flagBit;
625 else
626 BMIsettings = BMIsettings & (~flagBit);
627 }
628 else
629 {
630 if (value == SET_SETTING)
631 FFS_flashData.settings_status = FFS_flashData.settings_status | flagBit;
632 else
633 FFS_flashData.settings_status = FFS_flashData.settings_status & (~flagBit);
634 }
635 flash_write();
636 }
637 /*******************************************************************************
638
639 $Function: settingsAutoRedialOn
640
641 $Description: auto redial switch on
642
643 $Returns:
644
645 $Arguments:
646
647 *******************************************************************************/
648 int settingsAutoRedialOn(MfwMnu* m, MfwMnuItem* i)
649 {
650
651 T_MFW_HND win = mfw_parent(mfw_header());
652
653 confirm_Init(win);
654
655 cm_set_redial(CM_REDIAL_AUTO);
656
657
658 confirm_data.local_status = ACTIVATE_CONFIRM;
659
660 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
661
662 return 0;
663 }
664 /*******************************************************************************
665
666 $Function: settingsAutoRedialOff
667
668 $Description: auto redial switch off
669
670 $Returns:
671
672 $Arguments:
673
674 *******************************************************************************/
675 int settingsAutoRedialOff(MfwMnu* m, MfwMnuItem* i)
676 {
677 T_MFW_HND win = mfw_parent(mfw_header());
678 confirm_Init(win);
679
680 cm_set_redial(CM_REDIAL_OFF);
681
682 confirm_data.local_status = DEACTIVATE_CONFIRM;
683
684 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
685
686
687
688 return 0;
689 }
690 /*******************************************************************************
691
692 $Function: settingsSilentModeOn
693
694 $Description: Activate the silent Mode
695
696 $Returns:
697
698 $Arguments:
699
700 *******************************************************************************/
701 int settingsSilentModeOn(void)
702 {
703 TRACE_FUNCTION(">> settingsSilentModeOn()");
704 FFS_flashData.settings_status |= SettingsSilentMode;
705 flash_write();
706 setSilentModeVolume();
707 iconsSetState(iconIdSilRin);
708 return 0;
709 }
710 /*******************************************************************************
711
712 $Function: settingsSilentModeOff
713
714 $Description: Deactivate the silent Mode
715
716 $Returns:
717
718 $Arguments:
719
720 *******************************************************************************/
721 int settingsSilentModeOff(void)
722 {
723 TRACE_EVENT(">> settingsSilentModeOff()");
724 FFS_flashData.settings_status &= ~SettingsSilentMode;
725 flash_write();
726 restoreSilentModeVolume();
727 iconsDeleteState(iconIdSilRin);
728 return 0;
729 }
730
731 /*******************************************************************************
732
733 $Function: settingsKeyPadLockOn
734
735 $Description:
736
737 $Returns:
738
739 $Arguments:
740
741 *******************************************************************************/
742 int settingsKeyPadLockOn(void)
743 {
744 BMIsettings = BMIsettings | SettingsKeyPadLockOn;
745 iconsSetState(iconIdKeyplock);
746 idleEvent(IdleActiveKeyPadLocked);
747 return 0;
748 }
749 /*******************************************************************************
750
751 $Function: settingsKeyPadLockOff
752
753 $Description:
754
755 $Returns:
756
757 $Arguments:
758
759 *******************************************************************************/
760 int settingsKeyPadLockOff(void)
761 {
762 BMIsettings = BMIsettings & ~SettingsKeyPadLockOn;
763 iconsDeleteState(iconIdKeyplock);
764
765 return 0;
766 }
767 /*******************************************************************************
768
769 $Function: settingsAutoAnswerOn
770
771 $Description:
772
773 $Returns:
774
775 $Arguments:
776
777 *******************************************************************************/
778 int settingsAutoAnswerOn(MfwMnu* m, MfwMnuItem* i)
779 {
780 T_MFW_HND win = mfw_parent(mfw_header());
781
782 confirm_Init(win);
783
784 FFS_flashData.settings_status |= SettingsAutoAnswerOn;
785 flash_write();
786 confirm_data.local_status = ACTIVATE_CONFIRM;
787
788 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
789
790 return 0;
791 }
792 /*******************************************************************************
793
794 $Function: settingsAutoAnswerOff
795
796 $Description:
797
798 $Returns:
799
800 $Arguments:
801
802 *******************************************************************************/
803 int settingsAutoAnswerOff(MfwMnu* m, MfwMnuItem* i)
804 {
805 T_MFW_HND win = mfw_parent(mfw_header());
806
807 confirm_Init(win);
808
809 FFS_flashData.settings_status &= ~SettingsAutoAnswerOn;
810 flash_write();
811 confirm_data.local_status = DEACTIVATE_CONFIRM;
812
813 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
814
815
816
817 return 0;
818 }
819
820
821 /*******************************************************************************
822
823 $Function: settingsAnyKeyAnswerOn
824
825 $Description:
826
827 $Returns:
828
829 $Arguments:
830
831 *******************************************************************************/
832 int settingsAnyKeyAnswerOn(MfwMnu* m, MfwMnuItem* i)
833 {
834 T_MFW_HND win = mfw_parent(mfw_header());
835
836 confirm_Init(win);
837
838 FFS_flashData.settings_status |= SettingsAnyKeyAnswerOn;
839 flash_write();
840 confirm_data.local_status = ACTIVATE_CONFIRM;
841
842 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
843 return 0;
844 }
845 /*******************************************************************************
846
847 $Function: settingsAnyKeyAnswerOff
848
849 $Description:
850
851 $Returns:
852
853 $Arguments:
854
855 *******************************************************************************/
856 int settingsAnyKeyAnswerOff(MfwMnu* m, MfwMnuItem* i)
857 {
858
859 T_MFW_HND win = mfw_parent(mfw_header());
860
861 confirm_Init(win);
862
863 FFS_flashData.settings_status &= ~SettingsAnyKeyAnswerOn;
864 flash_write();
865 confirm_data.local_status = DEACTIVATE_CONFIRM;
866
867 SEND_EVENT (confirm_data.confirm_win, SHOW_CONFIRM, 0, 0);
868
869 return 0;
870 }
871
872 /*******************************************************************************
873
874 $Function: factoryReset
875
876 $Description: Reset all the user-settings,
877 At first it show up a confirmation screen
878 $Returns:
879
880 $Arguments:
881
882 *******************************************************************************/
883 int factoryReset(MfwMnu* m, MfwMnuItem* i)
884 {
885
886 T_MFW_HND win = mfw_parent(mfw_header());
887
888 confirm_Init(win);
889
890 confirm_data.local_status = FACTORY_RESET;
891
892 SEND_EVENT (confirm_data.confirm_win, FACTORY_RESET, 0, 0);
893 return 0;
894 }
895
896
897
898 /*******************************************************************************
899
900 $Function: setUserSettings2Default
901
902 $Description: The user confirm to delete the user-settings.
903
904 $Returns:
905
906 $Arguments:
907
908 *******************************************************************************/
909 void setUserSettings2Default (void)
910 {
911 //char buf[30]; // RAVI
912
913
914
915 if (DEFAULT_SETTINGS[ENGLISH].status EQ ON)
916 {
917 // set the language :ENGLISH
918 MmiRsrcSetLang(ENGLISH_LANGUAGE);/*MC, SPR 1242 - changed to new function*/
919 }
920
921
922 if (DEFAULT_SETTINGS[GERMAN].status EQ ON)
923 {
924 // set the language :GERMAN
925 MmiRsrcSetLang(GERMAN_LANGUAGE); /*MC, SPR 1242 - changed to new function*/
926 }
927
928
929 if (DEFAULT_SETTINGS[AUTOREDIAL].status EQ ON)
930 {
931 // set the Auto-redial
932 cm_set_redial(CM_REDIAL_AUTO);
933 }
934 else
935 {
936 cm_set_redial(CM_REDIAL_OFF);
937 }
938
939
940 if (DEFAULT_SETTINGS[AUTOANSWER].status EQ ON)
941 {
942 // set the Autoanswer
943 FFS_flashData.settings_status |= SettingsAutoAnswerOn;
944 }
945 else
946 {
947 //switch off the Autoanswer
948 FFS_flashData.settings_status &= ~SettingsAutoAnswerOn;
949 }
950
951
952 if (DEFAULT_SETTINGS[ANYKEYANSWER].status EQ ON)
953 {
954 // set the Anykeyanswer
955 FFS_flashData.settings_status |= SettingsAnyKeyAnswerOn;
956 }
957 else
958 {
959 //switch off the Anykeyanswer
960 FFS_flashData.settings_status &= ~SettingsAnyKeyAnswerOn;
961 }
962
963 if (DEFAULT_SETTINGS[CALLTIMERS].status EQ CLEAR)
964 {
965 //reset here the call timers
966 //incoming, outgoing & last calls
967 }
968
969
970 if (DEFAULT_SETTINGS[KEYPAD_CLICK].status EQ ON)
971 {
972 // set the Keypad click
973
974 if (FFS_flashData.settings_status & SettingsKeypadDTMF)
975 {
976 FFS_flashData.settings_status &= ~SettingsKeypadDTMF;
977 }
978
979 FFS_flashData.settings_status |= SettingsKeypadClick;
980 }
981
982
983 if (DEFAULT_SETTINGS[KEYPAD_DTMF].status EQ ON)
984 {
985 // set the Keypad DTMF
986
987 if (FFS_flashData.settings_status & SettingsKeypadClick)
988 {
989 FFS_flashData.settings_status &= ~SettingsKeypadClick;
990 }
991
992 FFS_flashData.settings_status |= SettingsKeypadDTMF;
993 }
994
995
996 if (DEFAULT_SETTINGS[KEYPAD_SILENT].status EQ ON)
997 {
998 // set the Keypad silence
999
1000 if (FFS_flashData.settings_status & SettingsKeypadClick)
1001 {
1002 FFS_flashData.settings_status &= ~SettingsKeypadClick;
1003 }
1004 else if (FFS_flashData.settings_status & SettingsKeypadDTMF)
1005 {
1006 FFS_flashData.settings_status &= ~SettingsKeypadDTMF;
1007 }
1008
1009 }
1010
1011 //GW-SPR#1018- Trace is too big for the buffer and is causing a crash.
1012 // sprintf (buf, " FFS_flashData.settings_status %d", FFS_flashData.settings_status);
1013 // TRACE_EVENT (buf);
1014
1015 //xrashmic 7 Dec, 2004 MMI-SPR-26161 and MMI-SPR-23965
1016 // Resetting the downloaded and extracted wap objects
1017 FFS_flashData.image_usr_obj=0;
1018 FFS_flashData.audio_usr_obj =0;
1019
1020 #ifndef FF_NO_VOICE_MEMO
1021 if (DEFAULT_SETTINGS[VOICE_MEMO].status EQ CLEAR)
1022 {
1023 /* Mar 28, 2007 DR: OMAPS00122762 x0039928 */
1024 #ifndef FF_MMI_FILEMANAGER
1025 // clear the voice memo
1026 FFS_flashData.voice_memo_position = 0;
1027 #endif
1028
1029 }
1030 #endif
1031
1032 /*OMAPS00098881(removing power variant) a0393213(Prabakar)*/
1033 #ifdef FF_POWER_MANAGEMENT
1034 if(DEFAULT_SETTINGS[LCD_REFRESH].status EQ ON)
1035 {
1036 FFS_flashData.refresh=1; /*lcd refresh needed*/
1037 }
1038 else
1039 {
1040 FFS_flashData.refresh=0; /*lcd refresh not needed*/
1041 }
1042 #endif
1043
1044 //x0pleela 25 May, 2006 DR: OMAPS00070657
1045 #ifdef FF_CPHS
1046 memset(FFS_flashData.line1,'\0', sizeof(FFS_flashData.line1));
1047 memset(FFS_flashData.line2,'\0', sizeof(FFS_flashData.line2));
1048 #endif
1049
1050 //reset the call timers
1051 setLastCallDuration(0, MFW_CM_INV_DIR);
1052 resetIncomingCallsDuration();
1053 resetOutgoingCallsDuration();
1054 //set clock format to twenty-four hour
1055 setClockFormat(MFW_TIME_FORMAT_24HOUR);/*SPR 1725, changed macro*/
1056
1057 // API/GW - On factory reset save the original colours to the flash.
1058 resetFactoryColour();
1059 //API - 1550 - Added code to reset the backgrounds to defaults
1060 resetFactoryBackground();
1061
1062 /*API - 28/07/03 - CQ10203 - Add a call to set the validity period to default on Factory Reset*/
1063 resetSMSValidityPeriod();
1064 /*API - CQ10203 - END*/
1065
1066 // PCM
1067 // here should also update the user-data-settings !!
1068 // in PCM
1069 //xashmic 27 Sep 2006, OMAPS00096389
1070 //xashmic 9 Sep 2006, OMAPS00092732
1071 //By default PS shutdown is disabled
1072 #ifdef FF_MMI_USBMS
1073 FFS_flashData.usb_ms_flags=MFW_USBMS_DEFAULT;
1074 #endif
1075
1076 /* FreeCalypso addition: set default earpiece volume */
1077 FFS_flashData.output_volume = OutVolumeLevel4;
1078
1079 flash_write();
1080 }
1081
1082 /*******************************************************************************
1083
1084 $Function: confirm_Init
1085
1086 $Description:
1087
1088 $Returns:
1089
1090 $Arguments:
1091
1092 *******************************************************************************/
1093 T_MFW_HND confirm_Init (T_MFW_HND parent_window)
1094 {
1095 return (confirm_create (parent_window));
1096 }
1097 /*******************************************************************************
1098
1099 $Function: confirm_Exit
1100
1101 $Description:
1102
1103 $Returns:
1104
1105 $Arguments:
1106
1107 *******************************************************************************/
1108 void confirm_Exit (T_MFW_HND own_window)
1109 {
1110
1111 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data;
1112 T_confirm * data = (T_confirm *)win_data->user;
1113
1114 confirm_destroy (data->confirm_win);
1115 }
1116
1117 /*******************************************************************************
1118
1119 $Function: confirm_create
1120
1121 $Description:
1122
1123 $Returns:
1124
1125 $Arguments:
1126
1127 *******************************************************************************/
1128 T_MFW_HND confirm_create (T_MFW_HND parent_window)
1129 {
1130 T_confirm * data = &confirm_data;
1131 T_MFW_WIN * win;
1132
1133 TRACE_FUNCTION ("confirm_create()");
1134
1135 data->confirm_win = win_create (parent_window, 0, 0, (T_MFW_CB)confirm_win_cb);
1136
1137 if (data->confirm_win EQ 0)
1138 return 0;
1139
1140 /*
1141 * Create window handler
1142 */
1143 data->mmi_control.dialog = (T_DIALOG_FUNC)confirm;
1144 data->mmi_control.data = data;
1145 win = ((T_MFW_HDR *)data->confirm_win)->data;
1146 win->user = (void *) data;
1147
1148
1149 winShow(data->confirm_win);
1150 /*
1151 * return window handle
1152 */
1153 return data->confirm_win;
1154 }
1155
1156 /*******************************************************************************
1157
1158 $Function: confirm_destroy
1159
1160 $Description:
1161
1162 $Returns:
1163
1164 $Arguments:
1165
1166 *******************************************************************************/
1167 void confirm_destroy (T_MFW_HND own_window)
1168 {
1169 T_MFW_WIN * win;
1170 T_confirm * data;
1171
1172 TRACE_FUNCTION ("confirm_destroy()");
1173
1174 if (own_window)
1175 {
1176 win = ((T_MFW_HDR *)own_window)->data;
1177 data = (T_confirm *)win->user;
1178
1179 if (data)
1180 {
1181
1182 /*
1183 * Delete WIN handler
1184 */
1185 win_delete (data->confirm_win);
1186 data->confirm_win = 0;
1187 }
1188 }
1189 }
1190 /*******************************************************************************
1191
1192 $Function: confirm_win_cb
1193
1194 $Description:
1195
1196 $Returns:
1197
1198 $Arguments:
1199
1200 *******************************************************************************/
1201 static int confirm_win_cb (T_MFW_EVENT event, T_MFW_WIN * win)
1202 {
1203 /*
1204 * Top Window has no output
1205 */
1206 return 1;
1207 }
1208
1209
1210 /*******************************************************************************
1211
1212 $Function: confirm_dialog
1213
1214 $Description:
1215
1216 $Returns:
1217
1218 $Arguments:
1219
1220 *******************************************************************************/
1221 static void confirm_dialog(void)
1222 {
1223 T_DISPLAY_DATA display_info;
1224
1225 TRACE_FUNCTION ("confirm_dialog()");
1226
1227
1228 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull,TxtNull, TxtNull , COLOUR_STATUS);
1229 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)confirm_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT );
1230
1231 if (confirm_data.local_status EQ ACTIVATE_CONFIRM)
1232 {
1233 display_info.TextId = TxtActivated;
1234 }
1235 else if (confirm_data.local_status EQ DEACTIVATE_CONFIRM)
1236 {
1237 display_info.TextId = TxtDeActivated;
1238 }
1239 else if (confirm_data.local_status EQ FACTORY_RESET)
1240 {
1241 display_info.TextId = TxtPressOk;
1242 display_info.TextId2 = TxtReset;
1243 display_info.Time = TEN_SECS;
1244 display_info.LeftSoftKey = TxtSoftOK;
1245 display_info.RightSoftKey = TxtSoftBack;
1246
1247 }
1248
1249 /*
1250 * Call Info Screen
1251 */
1252 info_dialog (confirm_data.confirm_win, &display_info);
1253
1254 }
1255 /*******************************************************************************
1256
1257 $Function: confirm_dialog_cb
1258
1259 $Description:
1260
1261 $Returns:
1262
1263 $Arguments:
1264
1265 *******************************************************************************/
1266 void confirm_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
1267 {
1268 TRACE_FUNCTION ("confirm_dialog_cb()");
1269
1270 switch (reason)
1271 {
1272 case INFO_KCD_LEFT:
1273 // user confirm to reset all the user settings !
1274 setUserSettings2Default ();
1275 confirm_Exit(win);
1276 break;
1277
1278 case INFO_TIMEOUT:
1279 /* no break; */
1280 case INFO_KCD_HUP:
1281 /* no break; */
1282 case INFO_KCD_RIGHT:
1283 /* no break; */
1284 case INFO_KCD_CLEAR:
1285 confirm_Exit(win);
1286 break;
1287 }
1288 }
1289
1290 /*******************************************************************************
1291
1292 $Function: confirm
1293
1294 $Description:
1295
1296 $Returns:
1297
1298 $Arguments:
1299
1300 *******************************************************************************/
1301 void confirm (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1302 {
1303 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
1304 // T_confirm * data = (T_confirm *)win_data->user; // RAVI
1305
1306 TRACE_FUNCTION("confirm()");
1307
1308 switch (event)
1309 {
1310 case SHOW_CONFIRM:
1311 confirm_dialog();
1312 break;
1313 case FACTORY_RESET:
1314 confirm_dialog();
1315 break;
1316
1317 }
1318
1319 }
1320 static void showSet (void)
1321 {
1322
1323 T_DISPLAY_DATA display_info;
1324
1325 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtActivated, TxtNull, COLOUR_STATUS);
1326 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_HUP| KEY_LEFT );
1327
1328 info_dialog ( NULL, &display_info);
1329 }
1330
1331 static void showClear (void)
1332 {
1333
1334 T_DISPLAY_DATA display_info;
1335
1336 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtDeActivated, TxtNull, COLOUR_STATUS);
1337 dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_HUP| KEY_LEFT );
1338
1339 info_dialog ( NULL, &display_info);
1340 }
1341
1342 // MENU_ITEM ( TxtCheckStatus, servicesDivertCheck, item_flag_none ),
1343 void settingsShowStateAnykeyAnswer (void)
1344 {
1345 if (settingsGetStatus(SettingsAnyKeyAnswerOn))
1346 showSet();
1347 else
1348 showClear();
1349 }
1350 void settingsShowStateAutoAnswer (void)
1351 {
1352 if (settingsGetStatus(SettingsAutoAnswerOn))
1353 showSet();
1354 else
1355 showClear();
1356 }
1357 void settingsShowStateAutoRedial(void)
1358 {
1359 if (FFS_flashData.redial_mode == CM_REDIAL_AUTO)
1360 showSet();
1361 else
1362 showClear();
1363 }
1364 /*GW SPR#2470 Created*/
1365 void settingsShowStateCBDisable(void)
1366 {
1367 if (settingsGetStatus(SettingsCBDisable))
1368 showClear();
1369 else
1370 showSet();
1371 }
1372
1373 // change by Sasken (VVADIRAJ) on March 31th 2004
1374 // Issue Number : MMI-SPR-12822
1375 // Subject: Highlighting the previously selected menu item.
1376 // Bug : Not highlighting the previously selected menu item.Selecting first item always.
1377 // Solution: Instead of providing the submenu directly we call this function
1378 // where we set the menu and also higlight the previously selected menu item.
1379
1380 /***************************Go-lite Optimization changes Start***********************/
1381 //Aug 25, 2004 REF: CRR 24904 Deepa M.D
1382 //This function is used only for the Color build.Hence it is put under the
1383 //COLOURDISPLAY compiler switch
1384 #ifdef COLOURDISPLAY
1385 void settingsFocusNwIconCurSel(void)
1386 {
1387 UBYTE SaveNwIcon;
1388 T_MFW_HND setting_win;
1389 T_MFW_HND win = mfw_parent(mfw_header());
1390
1391 setting_win= bookMenuStart(win, NWIconAttributes(), 0);
1392 SaveNwIcon=(FFS_flashData.ProviderNetworkShow == TRUE)?0:1;
1393 SEND_EVENT(setting_win, DEFAULT_OPTION, NULL, &SaveNwIcon);
1394 }
1395 #endif
1396 /***************************Go-lite Optimization changes Start***********************/
1397 //SPR 12822:VVADIRAJ
1398
1399 // Jul 29, 2004 REF = CRR 20898 xkundadu
1400 /*******************************************************************************
1401 $Function: settingsFocusCurSelAutoAns
1402
1403 $Description: This function sets the focus to the On or Off menu item of the
1404 'Auto Answer' menu in the Phone Settings main menu.
1405 Check whether the 'Auto Answer' is enabled by reading the data
1406 stored in the FFS. Depending on that, set the focus to the menu
1407 item.
1408
1409 $Returns: void
1410
1411 $Arguments: void
1412 *******************************************************************************/
1413
1414
1415 void settingsFocusCurSelAutoAns(void)
1416 {
1417 // Points to the index of the menuitem to be selected
1418 // If it is 1, 'Off' menuItem will be selected, else 'On' menuitem
1419 // will be selected.
1420 UBYTE menuItemIndex = 1;
1421
1422 T_MFW_HND setting_win;
1423 T_MFW_HND win = mfw_parent(mfw_header());
1424
1425 TRACE_FUNCTION ("settingsFocusCurSelAutoAns() ");
1426
1427 // Starting the menu corresponding to AutoAnswer.
1428 setting_win = bookMenuStart(win, GetAutoAnswerMenu(), 0);
1429
1430 //Checking whether the 'Auto Answer' is enabled or not
1431 //Reading the value from FFS.
1432 if( (FFS_flashData.settings_status & SettingsAutoAnswerOn)
1433 EQ SettingsAutoAnswerOn)
1434 {
1435 menuItemIndex = 0;
1436 }
1437
1438 // Send the event to display the menu item and appropriate menuitem
1439 // selected.
1440 SEND_EVENT(setting_win, DEFAULT_OPTION, NULL, &menuItemIndex);
1441
1442 }
1443
1444 // Jul 22,2004 CRR:20896 xrashmic - SASKEN
1445 // Description: The time current time format is not highlighted
1446 // Fix: Instead of showing the submenu directly we call this function
1447 // where we set the menu and also higlight the previously selected menu item
1448 void settingsFocusTimeFormatCurSel(void)
1449 {
1450 UBYTE CurSel;
1451 T_MFW_HND setting_win;
1452 T_MFW_HND win = mfw_parent(mfw_header());
1453
1454 setting_win= bookMenuStart(win, TimeFormatAttributes(), 0);
1455 CurSel = FFS_flashData.time_format;
1456 SEND_EVENT(setting_win, DEFAULT_OPTION, NULL, &CurSel);
1457 }
1458
1459 /*******************************************************************************
1460 $Function: settingsFocusCurSelAnyKeyAns
1461 $Description: This function sets the focus to the On or Off menu item of the
1462 'AnyKey Answer' menu in the Phone Settings main menu.
1463 Check whether the 'Any Key Answer' is enabled by reading the data
1464 stored in the FFS. Depending on that, set the focus to the menu
1465 item
1466 $Returns: void
1467 $Arguments: void
1468 *******************************************************************************/
1469 // Jul 28, 2004 REF: CRR 20899 xkundadu
1470 void settingsFocusCurSelAnyKeyAns(void)
1471 {
1472 // Points to the index of the menuitem to be selected
1473 // If it is 1, 'Off' menuItem will be selected, else 'On' menuitem
1474 // will be selected.
1475 UBYTE menuItemIndex = 1;
1476
1477 T_MFW_HND setting_win;
1478 T_MFW_HND win = mfw_parent(mfw_header());
1479
1480 TRACE_FUNCTION ("settingsFocusCurSelAnyKeyAns() ");
1481
1482 // Starting the menu corresponding to AnyKeyanswer.
1483 setting_win = bookMenuStart(win, GetAnyKeyAnswerMenu(), 0);
1484
1485 //Checking whether the 'Any key answer is enabled or not
1486 //Reading the value from FFS.
1487 if( (FFS_flashData.settings_status & SettingsAnyKeyAnswerOn)
1488 EQ SettingsAnyKeyAnswerOn)
1489 {
1490 //Set the focus to the 'On' menu item.
1491 menuItemIndex = 0;
1492 }
1493
1494 // Send the event to display the menu items and set focus to appropriate
1495 // menuitem.
1496 SEND_EVENT(setting_win, DEFAULT_OPTION, NULL, &menuItemIndex);
1497
1498 }
1499
1500 // May 04, 2005 REF: CRR 30285 x0021334
1501 /*******************************************************************************
1502 $Function: settingsSmsStatusReportCurSel
1503 $Description: This function sets the focus to the On or Off menu item of the
1504 'Status Report' submenu menu in the Messages Settings menu.
1505 $Returns: void
1506 $Arguments: void
1507 *******************************************************************************/
1508 void settingsSmsStatusReportCurSel(void)
1509 {
1510 T_MFW_HND setting_win;
1511 T_MFW_SMS_INFO sms_info;
1512 T_MFW_HND win = mfw_parent(mfw_header());
1513
1514 setting_win = bookMenuStart(win, SmsStatusReportAttributes(), 0);
1515 if (sms_parameter(&sms_info, TRUE) == MFW_SMS_OK)
1516 {
1517 // Send the event to set focus to appropriate option.
1518 SEND_EVENT(setting_win, DEFAULT_OPTION, NULL, &sms_info.srr);
1519 }
1520 else
1521 {
1522 TRACE_FUNCTION("sms info could not be retrieved ");
1523 }
1524
1525
1526 }
1527