comparison src/aci2/bmi/mmiSettings.c @ 120:3c2acfa1a72f

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