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

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI (6349)
14 $Module: Idle
15 $File: MmiIdle.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25 Handling for the idle screen
26
27 ********************************************************************************
28 $History: MmiIdle.c
29
30 Feb 15, 2006 ER: OMAPS00065203 x0pleela
31 Description: Cingular Operator Name Prioritization implementation required
32 Solution: Incorporated review comments
33 Removed the code added in earlier version from function idle_kbd_cb()
34 Registering for MfwWinResume event in idle_create()
35 Handling MfwWinResume event in idle_win_cb()
36
37 Feb 09, 2006 ER: OMAPS00065203 x0pleela
38 Description: Cingular Operator Name Prioritization implementation required
39 Solution: "idle_opername_timer_cb" callback for timer to display opername on idle screen
40 Display of the operator name on idle screen based on the following:
41 a. If SPN and plmn name are not NULL, SPN is displayed for 5 seconds and then plmn name
42 For the above scenario, display_condition of SPN is not checked as per Cingular's requirement
43 In spite of display_condition being FALSE, we go ahead and display SPN
44 b. If SPN is NULL and plmn name is not NULL, then plmn name is displayed
45
46 Feb 02, 2006 DR: OMAPS00061468 - x0035544.
47 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails
48 Solution : SAT SET UP IDLE MODE TEXT (Icon) support added.
49
50 Nov 24, 2005 DR: OMAPS00045909 - Shashi Shekar B.S.
51 Description: Improve IMEI control mechanism
52 Solution : When MMI calls sAT_PLUSCFUN, if an IMEI invalid error is returned,
53 we will block on that screen & will not allow the user to browse menus further,
54 since the PS will not be booted at all!!!
55
56 Nov 17, 2005 DR: OMAPS00050447 - nekkareb
57 Description: Even after removing the SIM , Hutch or Airtel network is seen
58 Solution : Sim removal event is now being handled and appropriate display shown.
59
60 Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
61 Description: Mp3 Ringer Implementation
62 Solution: The Midi Ringer application has been enhanced to support mp3 as ringer.
63 The interface function names have been modified.
64
65 xrashmic 22 Aug, 2004 MMI-SPR-32798
66 Adding the support for screen capture using a dynamically assigned key.
67
68 Sept 15, 2005 REF: CRR 32410 x0021334
69 Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
70 Fix: A new timer expiry event is added and handled.
71
72 Jul 08, 2005 REF: ENH 32642 x0018858
73 Description: The date time string should at all times be displayed on the idle scree.
74 Solution: Code to display the date time if already not displayed, has been added.
75
76 Jun 14, 2005 REF: MMI-FIX-30439 x0018858
77 Description: The homezone/cityzone tags were not being displayed properly.
78 Solution: Modified to save the tags properly in caches and also made the
79 appropriate modifications to update the same properly during mobility.
80
81
82 Jun 24, 2005 MMI-FIX-30973 x0018858
83 Issue Description :- The homezone/cityzone tag disappears when the HUP button is pressed or after
84 "new CB" arrives indication is received and processed.
85 Fix: Modified the code to display the homezone/cityzone tag after the HUP is processed.
86
87 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
88 Description: IMEI retreival by posting a call to ACI sAT_xx API
89 Solution: The direct call to cl_get_imeisv() is replaced with the
90 call to the mmi_imei_store() which inturn calls sAT_Dn() and
91 retrieves the IMEI info and stores it onto the global
92 variable "imei"
93
94 Apr 05, 2005 REF: ENH 29994 xdeepadh
95 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
96 Solution: Generic Midi Ringer and Midi Test Application were implemented.
97
98 x0018858 24 Mar, 2005 MMI-FIX-11321
99 Issue Description :- If the inbox is full and a new message is receivd, no indication is received.
100 Fix: Added support for handling indication when message box is full and
101 there is a pending message.
102
103 Nov 3, 2004 REF: CRR 25887 xkundadu
104 Description: Unable to make an emergency call.
105 Fix: Changed the code to make the emergency call when the screen is locked.
106 Also, a check is done to confirm whether the keypad buffer contains any ECC.
107
108 CRR 25268: 13 Oct 2004 - xpradipg
109 Description: Unable to see the Number / name and the status read/unread of
110 the received EMS/MMS
111 Solution: The status of each message is updated as soon as the Message is
112 read, and "old"/"new" is appended based on the status flag
113
114 CRR 25270: 13 Oct 2004 - xpradipg
115 Description: EMS: Titles such as "no name" is added to EMSs with no titles
116 Solution: The corresponding name is retrieved from the phone book for the
117 number from which EMS is received, if name is not present number is
118 displayed in Inbox
119
120 Sep 22, 2004 REF: CRR 23871 xkundadu
121 Description: Screen Locking: Unlocking screen is happening by other keys
122 Fix: handled the other key events except '*' not to unlock the keypad.
123
124 Sep 2, 2004 REF: CRR 21370 xkundadu
125 Description: Giving wrong expected result by long press on "#" key
126 Fix: When user presses long on '#' key it will display 'p'.
127 Changed the long press of '*' key to display 'w'
128
129 May 21, 2004 REF: CRR 16084 Deepa M.D
130 Fix: SMSFull message string is displayed,in the clean Idle Screen .
131
132 Apr 27, 2004 REF: ENH 12646 Deepa M.D
133 Fix: When the SMS memory is full,the SMS icon is made to blink.
134 Apr 14, 2004 REF: CRR 12653 xvilliva
135 Fix: The FPLMN selection shows "No Service" on idle screen.
136 The current mode of "limited service" is queried and the screen is updated
137 accordingly. The LSK and RSK also work in sync.
138 May 26, 2004 REF: CRR 19656 Sandip and Deepa M.D
139 Fix: when a SETUP IDLE TEXT command is sent with a long text ( 239 characters ), instead of discarding the message
140 the message will be displayed.The CR is handled properly by converting it to Space.
141
142 Jul 23,2004 CRR:20895 xrashmic - SASKEN
143 Description: The keypad should not be unlocked by SEND and *, it should be
144 unlocked only by Menu and *
145 Fix: SEND key is now handled the same way as rest of the number keys.
146 Keypad unlock can be done only through MENU and *.
147
148 Apr 14, 2004 REF: CRR 12653 xvilliva
149 The FPLMN selection shows "No Service" on idle screen.
150 The current mode of "limited service" is queried and the screen is updated
151 accordingly. The LSK and RSK also work in sync.
152 xrashmic 26 Aug, 2004 MMI-SPR-23931
153 To display the indication of new EMS in the idle screen
154
155 25/10/00 Original Condat(UK) BMI version.
156
157 Dec 23, 2005 REF:SR13873 x0020906
158 Description: SMS Play tones to be stopped during button press in idle
159 FIX : Called for audio_stopSoundById () in the key press event.
160 $End
161
162 *******************************************************************************/
163
164 /*******************************************************************************
165
166 Include Files
167
168 *******************************************************************************/
169
170
171
172 #define ENTITY_MFW
173
174 /* includes */
175 #include <string.h>
176 #include <stdio.h>
177 #include <stdlib.h>
178
179 #if defined (NEW_FRAME)
180
181 #include "typedefs.h"
182 #include "vsi.h"
183 #include "pei.h"
184 #include "custom.h"
185 #include "gsm.h"
186
187 #else
188
189 #include "STDDEFS.H"
190 #include "custom.h"
191 #include "gsm.h"
192 #include "vsi.h"
193
194 #endif
195
196
197 #include "prim.h"
198 #include "mfw_mfw.h"
199 #include "mfw_win.h"
200 #include "mfw_kbd.h"
201 #include "mfw_lng.h"
202 /* SPR#1428 - SH - New Editor changes */
203 #ifndef NEW_EDITOR
204 #include "mfw_edt.h"
205 #endif
206 #include "mfw_cm.h"
207 #include "mfw_phb.h"
208 #include "mfw_sms.h"
209 #include "mfw_icn.h"
210 #include "mfw_mnu.h"
211 #include "mfw_tim.h"
212 #include "mfw_sim.h"
213 #include "mfw_nm.h"
214 #include "mfw_simi.h" // NH : put after mfw_nm.h as it contains a definition required by mfw_simi.h
215 #include "mfw_sat.h"
216 //Apr 05, 2005 REF: ENH 29994 xdeepadh
217 #ifdef FF_MIDI_RINGER
218 #include "mfw_midi.h"
219 #endif
220
221
222 #include "dspl.h"
223 #include "MmiMmi.h"
224
225 #include "ksd.h"
226 #include "psa.h"
227
228
229 #include "MmiDummy.h"
230 #include "MmiDialogs.h"
231 #include "MmiLists.h"
232
233 #include "MmiMain.h"
234 #include "MmiStart.h"
235
236 #include "MmiMenu.h"
237
238 #include "MmiBookController.h"
239 #include "MmiBookUtils.h"
240
241 #include "mmiCall.h"
242 #include "MmiNetwork.h"
243 #include "Mmiicons.h"
244 /* SPR#1428 - SH - New Editor changes */
245 #ifdef NEW_EDITOR
246 #include "ATBCommon.h"
247 #include "ATBDisplay.h"
248 #include "ATBEditor.h"
249 #include "AUIEditor.h"
250 #else
251 #include "MmiEditor.h"
252 #endif
253
254 #include "mmimmsmenu.h" //xrashmic 26 Aug, 2004 MMI-SPR-23931
255 #include "MmiSounds.h"
256 #include "MmiUserData.h"
257 #include "MmiSoftKeys.h"
258 #include "MmiPins.h"
259
260 #include "MmiDialogs.h"
261 #include "MmiIdle.h"
262 #include "MmiNetwork.h"
263 #include "MmiSettings.h"
264 #include "mmiSmsIdle.h"
265 #include "mfw_ffs.h"
266 #include "mmiSmsBroadcast.h"
267 #include "MmiCPHS.h"
268
269 #include "mmiSmsRead.h"
270 #include "Mfw_td.h"/*SPR 1725*/
271 #ifdef MMI_HOMEZONE_ENABLED
272 #include "MmiHomezone.h" /* SPR759 - SH*/
273 #endif
274 #include "gdi.h"
275 #include "audio.h"
276
277 #include "cus_aci.h"
278
279 #include "MmiResources.h" //for LINE_HEIGHT
280 #include "mmiColours.h"
281
282 #undef JVJ_USSD_TEST
283 #include "MmiBookShared.h"
284 #include "MmiBookUtils.h"
285
286 #ifdef MMI_EM_ENABLED
287 #include "MmiEm.h"
288 #endif
289 /*********************************************************************
290 **********************************************************************
291
292 IDLE WINDOW. DECLARATION
293
294 *********************************************************************
295 **********************************************************************/
296
297 /*
298 * This is a static window (also called dialog), it remains always, so that we dont have to worry a memory allocation
299 */
300 /*
301 The typedef for T_idle has been moved into the MmiIdle.h file.
302 */
303
304 T_idle idle_data; // This is a static window, and the related data are also static.
305
306
307 /*
308 * These are common functions xxx_create and xxx_destroy
309 */
310 T_MFW_HND idle_create (T_MFW_HND parent_window);
311 void idle_destroy (T_MFW_HND own_window);
312
313 // ADDED BY RAVI - 28-11-2005
314 EXTERN void icon_setMainBgdBitmap (int bmpId);
315 extern T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
316 extern UBYTE getcurrentVoiceTone(void);
317 // END RAVI - 28-11-2005
318
319 /*
320 * This dialog function (the same name as the window)
321 * is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
322 * and the corresponding events to send from one mmi dialog to another.
323 */
324
325 void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
326
327
328 /*
329 * These are common optional functions handler
330 */
331
332
333 static int idle_win_cb(MfwEvt e, MfwWin *w);
334 static int idle_kbd_cb (MfwEvt e, MfwKbd *k);
335 static int idle_kbd_long_cb (MfwEvt e, MfwKbd *k);
336
337
338 static int idleLine( int lineNo );
339
340
341
342 static int idleExeSendMessage(MfwMnu* m, MfwMnuItem* i);
343 MfwHnd VOS_Idle_Win; /* our window */
344
345 extern UBYTE getCurrentRingerSettings(void );
346
347 void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph);
348
349 U16 AlarmStatus = 0;
350
351 extern UBYTE HUPKeyOrigin; // SH - set to 1 if POWER_KEY is pressed in idle screen
352 UBYTE test_sim; // SH
353 static UBYTE LimitedService;// Apr 14, 2004 REF: CRR 12653 xvilliva
354 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
355 extern MfwHnd sms_animate; //Timer for blinking SMS Icon
356 static int homezoneFlag = 0; //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
357 // Added a flag.
358
359 //Jun 24, 2005 MMI-FIX-30973 x0018858
360 //Global to copy the New CB msg tag.
361 char tag_zone[94];
362
363 //x0pleela 09 Feb, 2006 ER: OMAPS00065203
364 #define SPN 0 /* SPN to be displayed on Idle screen*/
365 #define PLMN 1 /* PLMN name to be displayed on Idle screen*/
366
367 EXTERN UBYTE gEons_alloc_active; /* EONS allocation and activation */
368 static MfwHnd plmn_display; /* timer handle */
369 static UBYTE timer_start_flag = FALSE; /* Timer start flag */
370 static UBYTE opername_disp_flag=SPN; /* Opertor name display flag : SPN or PLMN*/
371
372 /*********************************************************************
373 **********************************************************************
374
375 DIALLING WINDOW. DECLARATION
376
377 *********************************************************************
378 **********************************************************************/
379
380 /*
381 * This is a dinamic dialog, it must be created only when dialling in idle screen, and destroyed automatically after calling
382 * or clearing
383 */
384
385 // Nov 3, 2004 REF: CRR 25887 xkundadu
386 // Description: Unable to make an emergency call.
387 // Fix: Check whether the keypad buffer contains any ECC.
388
389 // This is the maximum length of ECC number.
390 #define ECC_LENGTH 3
391 #define WIN_DIALLING_ORG_X 0
392 #define WIN_CENTRALIZE_ORG_X 30
393
394 #define XOFFSET 1
395 #define YOFFSET 1
396
397
398 #ifndef LSCREEN
399 #define YLINE 9
400 #else
401 #define YLINE (12*2+2)
402 #endif
403
404
405 #define KEYPADLOCK_BUF_SIZE 4
406
407 /*
408 * The information related to every window must be encapsulated in such an structure
409 */
410
411 typedef struct
412 {
413 T_MMI_CONTROL mmi_control; // common control parameter
414 T_MFW_HND win;
415 T_MFW_HND kbd;
416 T_MFW_HND kbd_long;
417 #ifdef NEW_EDITOR
418 T_ED_DATA *editor; /* SPR#1428 - SH - New Editor changes */
419 #else /* NEW_EDITOR */
420 T_MFW_HND edt;
421 #endif /* NEW_EDITOR */
422 } T_idle_dialling;
423
424 typedef struct
425 {
426 /* administrative data */
427
428 T_MMI_CONTROL mmi_control;
429 T_MFW_HND win;
430 T_MFW_HND parent_win;
431 #ifdef NEW_EDITOR
432 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
433 #else
434 T_EDITOR_DATA editor_data;
435 #endif
436
437 /* internal data */
438 char buffer[80];
439 UBYTE status;
440
441 } tShowVerion;
442
443
444
445
446 /*
447 * These are common functions xxx_create and xxx_destroy
448 */
449
450 T_MFW_HND idle_dialling_create(MfwHnd parent);
451 void idle_dialling_exit (void);
452
453
454 /*
455 * This dialog function (the same name as the window)
456 * is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
457 * and the corresponding events to send from one mmi dialog to another.
458 */
459
460 void idle_dialling (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
461
462 /*
463 * These are common optional functions handler
464 */
465
466
467 static int idle_dialling_kbd_cb (MfwEvt e, MfwKbd *k);
468 static int idle_dialling_kbd_long_cb (MfwEvt e, MfwKbd *k);
469 static int idle_dialling_win_cb (MfwEvt e, MfwWin *w);
470
471 /*
472 * This an optional function, used often to call, create and init a new dialog, with different parameters depending
473 * on the context
474 */
475
476
477 T_MFW_HND idle_dialling_start (T_MFW_HND win_parent,char *character);
478
479
480
481 /*********************************************************************
482 **********************************************************************
483
484 OPTIONS DIALLING WINDOW. DECLARATION
485
486 *********************************************************************
487 **********************************************************************/
488
489
490
491 #define WIN_OPTIONS_DIALLING_ORG_X 0
492 #define WIN_OPTIONS_DIALLING_ORG_Y SECOND_LINE
493
494 #define WIN_OPTIONS_DIALLING_X_OFFSET 1
495 #define WIN_OPTIONS_DIALLING_Y_OFFSET 1
496
497
498
499 T_MFW_HND idle_dialling_options_create(MfwHnd parent);
500 void idle_dialling_options_destroy (T_MFW_HND own_window);
501
502 static int idle_dialling_options_kbd_cb (MfwEvt e, MfwKbd *k);
503 static int idle_dialling_options_kbd_long_cb (MfwEvt e, MfwKbd *k);
504 static int idle_dialling_options_win_cb (MfwEvt e, MfwWin *w);
505 static int idle_dialling_options_mnu_cb (MfwEvt e, MfwMnu *m);
506
507 typedef struct
508 {
509 T_MMI_CONTROL mmi_control;
510 T_MFW_HND win; // window handle
511 T_MFW_HND kbd;
512 T_MFW_HND kbd_long;
513 T_MFW_HND menu;
514 } T_idle_dialling_options;
515
516
517
518
519
520 /*********************************************************************
521 **********************************************************************
522
523 KEYPADLOCKED WINDOW. DECLARATION
524
525 *********************************************************************
526 **********************************************************************/
527
528
529 T_MFW_HND idle_key_pad_locked_create(MfwHnd parent);
530 void idle_key_pad_locked_destroy (T_MFW_HND own_window);
531
532 static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k);
533 static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k);
534 static int idle_key_pad_locked_win_cb (MfwEvt e, MfwWin *w);
535
536 typedef struct
537 {
538 T_MMI_CONTROL mmi_control;
539 T_MFW_HND win; // window handle
540 T_MFW_HND kbd;
541 T_MFW_HND kbd_long;
542 #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
543 T_ED_DATA *editor;
544 #else
545 T_MFW_HND edt;
546 #endif
547 T_MFW_HND win_info; // window handle
548 UBYTE menuPressed;
549 UBYTE keyPadLockBuf[KEYPADLOCK_BUF_SIZE];
550 UBYTE TempkeyPadLockBuf[KEYPADLOCK_BUF_SIZE];
551 } T_idle_key_pad_locked;
552
553 void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
554
555
556
557 static void (*showKeyPadLocked) (void);
558 static void showSOSCallKeyPadLocked(void);
559 void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
560
561
562 /*********************************************************************
563 **********************************************************************
564
565 Information WINDOW. DECLARATION
566
567 *********************************************************************
568 **********************************************************************/
569
570
571
572 static int lockTimerEvent(MfwEvt e, MfwTim *t);
573 static void showPressMenuStar(void);
574 static void showSMSNewMessage(void);
575 static void showNothing(void);
576
577
578
579 T_MFW_HND idle_information_create(MfwHnd parent);
580 void idle_information_destroy (T_MFW_HND own_window);
581
582 static int idle_information_kbd_cb (MfwEvt e, MfwKbd *k);
583 static int idle_information_kbd_long_cb (MfwEvt e, MfwKbd *k);
584 static int idle_information_win_cb (MfwEvt e, MfwWin *w);
585
586 typedef struct
587 {
588 T_MMI_CONTROL mmi_control;
589 T_MFW_HND win; // window handle
590 T_MFW_HND parent_win;
591 T_MFW_HND timer;
592 T_VOID_FUNC info_cb;
593 T_MFW_HND kbd;
594 } T_idle_information;
595
596
597
598 void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
599 T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb);
600
601
602
603
604
605 static void (*showInformation)(void);
606
607
608 static int idle_information_tim_cb(MfwEvt e, MfwTim *t);
609 static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
610
611
612 T_MFW_HND ShowVersion(T_MFW_HND parent_window);
613 static T_MFW_HND ShowVersion_create(MfwHnd parent_window);
614 static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier, void *parameter);
615 void ShowVersionSetEditor(T_MFW_HND win);
616 static void ShowVerionCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
617 void showVersion_destroy(MfwHnd own_window);
618 const char * date = "29.02.02";
619 const char * bmi = "01.06.01";
620 const char * gprs = "XX.XX.XX";
621 const char * ti = "05.03.02";
622
623 //API - 13-01-03 - 1310 - Create a variable for idle instead of using global pin_emergency_call
624 UBYTE pin_idle_emerg_call;
625 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
626 extern int smsFullEventTim( MfwEvt e, MfwTim *tc );
627
628 #ifdef MMI_EM_ENABLED
629 //xrashmic 22 Aug, 2004 MMI-SPR-32798
630 U8 screenCaptureKey=KCD_NONE;
631 T_MFW_HND screen_capture_win;
632 #endif
633
634 //x0pleela 09 Feb, 2006 ER: OMAPS00065203
635 //callback for timer to display opername on idle screen
636 int idle_opername_timer_cb( MfwEvt e, MfwTim *tc );
637
638 /*********************************************************************
639 **********************************************************************
640
641 IDLE WINDOW. IMPLEMENTATION
642
643 *********************************************************************/
644 /*******************************************************************************
645
646 $Function: idleInit
647
648 $Description: init MMI idle handling
649
650 $Returns:
651
652 $Arguments:
653
654 *******************************************************************************/
655
656
657
658
659 void idleInit (MfwHnd parent)
660 {
661 T_MFW_HND hnd;
662 winAutoFocus(TRUE);
663 idle_data.nm_status = 0;
664 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
665 //Timer created to blink the SMS icon , when SMS memory is full
666 sms_animate= timCreate(0,500,(MfwCb) smsFullEventTim);
667
668 //x0pleela 10 Feb, 2006 ER: OMAPS00065203
669 //Create timer to display SPN for 5 secs and then display PLMN name
670 plmn_display = timCreate(0, 5000, (MfwCb)idle_opername_timer_cb);
671
672 hnd = idle_create (parent);
673
674 TRACE_EVENT_P1("FFS_flashData.IdleScreenBgd = %d", FFS_flashData.IdleScreenBgd);
675
676 if( FFS_flashData.ProviderNetworkShow != TRUE )
677 FFS_flashData.ProviderNetworkShow = FFS_flashData.ProviderNetworkShow;
678 else
679 FFS_flashData.ProviderNetworkShow = TRUE;
680
681 if((FFS_flashData.IdleScreenBgd >= BGD_NONE) && (FFS_flashData.IdleScreenBgd < BGD_LAST))
682 idle_setBgdBitmap(FFS_flashData.IdleScreenBgd);
683 else
684 idle_setBgdBitmap(BGD_TI_LOGO);
685
686 if((FFS_flashData.MainMenuBgd >= BGD_NONE) && (FFS_flashData.MainMenuBgd < BGD_LAST))
687 icon_setMainBgdBitmap(FFS_flashData.MainMenuBgd);
688 else
689 icon_setMainBgdBitmap(BGD_SQUARE);
690
691 }
692
693
694 /*******************************************************************************
695
696 $Function: idleExit
697
698 $Description: exit MMI idle handling
699
700 $Returns:
701
702 $Arguments:
703
704 *******************************************************************************/
705
706
707 void idleExit (void)
708 {
709 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
710 //Delete the timer for blinking SMS Icon ,when memory is full.
711 if (sms_animate)
712 {
713 timStop(sms_animate);
714 timDelete(sms_animate);
715 }
716 sms_animate = 0;
717
718 //x0pleela 14 Feb, 2006 ER: OMAPS00065203
719 //Delete the timer of operator name display
720 if( plmn_display)
721 {
722 timDelete(plmn_display);
723 plmn_display = 0;
724 }
725
726 mfwSetSatIdle(0);
727
728 idle_destroy (idle_data.win);
729 }
730
731
732
733 /*******************************************************************************
734
735 $Function: idle_create
736
737 $Description: Creation of an instance for the Idle dialog.
738
739 $Returns:
740
741 $Arguments:
742
743 *******************************************************************************/
744
745
746 T_MFW_HND idle_create (T_MFW_HND parent_window)
747 {
748 T_idle * data = &idle_data;
749 T_MFW_WIN * win;
750 UBYTE result;
751
752 TRACE_FUNCTION ("idle_create");
753
754 memset(&idle_data,'\0',sizeof(idle_data));
755 idle_data.defTextOffset= SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-6*Mmi_layout_line_height();
756
757 /*
758 * Create window handler
759 */
760 //x0pleela 15 Feb, 2006 ER:OMAPs00065203
761 //Register MfwWinResume event also
762 data->win = win_create (parent_window, 0, E_WIN_VISIBLE|MfwWinResume, (T_MFW_CB)idle_win_cb);
763
764 if (data->win EQ 0)
765 {
766 mfwSetSatIdle(0);
767 return 0;
768 }
769
770 VOS_Idle_Win = data->win;
771
772
773 /*
774 * These assignments are necessary to attach the data to the window, and to handle the mmi event communication.
775 */
776
777
778 data->mmi_control.dialog = (T_DIALOG_FUNC)idle;
779 data->mmi_control.data = data;
780 win = ((T_MFW_HDR *)data->win)->data;
781 win->user = (void *) data;
782
783 /*
784 * Create any other handler
785 */
786
787 data->kbd = kbd_create (data->win,KEY_ALL|KEY_MAKE,(T_MFW_CB)idle_kbd_cb);
788 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_kbd_long_cb);
789 /* SPR#1428 - SH - New Editor changes */
790 #ifdef NEW_EDITOR
791 data->editor = 0;
792 data->editor_sat = 0;
793 AUI_edit_SetAttr(&data->editor_attr2, WIN_DIALLING_CB, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_cb_msg, MAX_CBMSG_LEN);
794 AUI_edit_SetAttr(&data->editor_attr3, WIN_DIALLING_SMS, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_sms_msg, MAX_MSG_LEN_SGL);
795 AUI_edit_SetAttr(&data->editor_attr_sat, WIN_DIALLING_SAT, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_sat_msg, MAX_CBMSG_LEN);
796 #else /* NEW_EDITOR */
797 data->edt = 0;
798 data->edt_sat = 0; /* SPR759 - SH*/
799 bookSetEditAttributes(WIN_DIALLING_CB, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_cb_msg, MAX_CBMSG_LEN,&data->edt_attr2);
800 bookSetEditAttributes(WIN_DIALLING_SMS, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_sms_msg, MAX_MSG_LEN_SGL,&data->edt_attr3);
801 bookSetEditAttributes(WIN_DIALLING_SAT, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_sat_msg, MAX_CBMSG_LEN,&data->edt_attr_sat);
802 #endif /* NEW_EDITOR */
803
804 /*
805 * In the new design the are created and automatically shown.
806 */
807
808 winShow(data->win);
809 data->search=FALSE;
810 data->missedCalls = 0;
811 //API - 23/09/02 - Emergency Call Define
812 pin_idle_emerg_call = FALSE;
813 data->flagIdle=FALSE;
814 data->right_key_pressed = FALSE;
815 addCBCH(NULL, IdleNewCBImmediateMessage);
816 data->new_cbch= FALSE;
817 data->clean_screen = FALSE; //for clean the DISPLAY ZONE 3
818 data->ciphering = DONT_SHOW_CPRS; //use as a default
819 data->starting_up = TRUE; /*SPR#1662 JVJ New flag for the start up procedure */
820
821
822
823 //init the Ciphering indication
824 result = sim_init_CPRS ((CallbackCPRI) idle_Ciphering, MFW_SIM_CPRI_SHOW );
825
826 if (result == FALSE)
827 TRACE_EVENT("Cant show Ciphering");
828
829 /*
830 ** CQ16435 : Set the Mfw Sat window to this value.
831 */
832 mfwSetSatIdle(data->win);
833
834 /*
835 * return window handle
836 */
837 return data->win;
838 }
839
840
841 /*******************************************************************************
842
843 $Function: idle_destroy
844
845 $Description: Destroy the idle dialog.
846
847 $Returns:
848
849 $Arguments:
850
851 *******************************************************************************/
852
853
854 void idle_destroy (T_MFW_HND own_window)
855 {
856 T_MFW_WIN * win;
857 T_idle * data;
858
859 /*
860 * The destruction of this dialog is trivial, because the information contained is not dynamic. A better example
861 * of dialog destruction can be found in dialling_destroy
862 */
863 TRACE_FUNCTION ("idle_destroy");
864
865
866 if (own_window)
867 {
868 win = ((T_MFW_HDR *)own_window)->data;
869 data = (T_idle *)win->user;
870
871 if (data)
872 {
873 /*
874 * Exit Keyboard Handler
875 */
876 /*
877 * Delete WIN Handler
878 */
879 win_delete (data->win);
880 data->win=0;
881 }
882 }
883 }
884
885
886 /*******************************************************************************
887
888 $Function: idle
889
890 $Description: Dialog function for idle top window.
891
892 $Returns:
893
894 $Arguments:
895
896 *******************************************************************************/
897
898
899 void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
900 {
901 U8 * key_code;
902 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
903 T_idle * data = (T_idle *)win_data->user;
904
905
906 /*
907 * This function is called by the SEND_EVENT macro, when the parameter win is the idle window. the different events
908 * come from another mmi modules.
909 */
910
911
912 TRACE_FUNCTION ("idle()");
913
914 switch (event)
915 {
916 case NETWORK_NO_SERVICE:
917 case NETWORK_NO_PLMN_XXX_AVAIL:
918 /*
919 * Network management indicates no or limited service
920 */
921 data->nm_status = event;
922 data->search=TRUE;
923
924 /*NM, p020*/
925 if(idleIsFocussed())
926 windowsUpdate();
927 break;
928 case NETWORK_SEARCH_NETWORK:
929 case NETWORK_FULL_SERVICE:
930 /*
931 * Network will be searched or is available
932 */
933
934 #ifdef MMI_HOMEZONE_ENABLED
935 //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
936 //Modified the conditional statement to read only once.Rest of the code will be performed everytime.
937 //begin 30439
938 if (event==NETWORK_FULL_SERVICE && !homezoneFlag)
939 {
940 homezoneFlag = 1; /* only read one time from SIM for FULL SERVICE */
941 homezoneReadSim(HZ_READ_ONCE_ONLY); // Read in homezone data. Will do nothing on repeated calls.
942 }
943 //end 30439
944 #endif
945 data->search=FALSE;
946 data->nm_status = event;
947
948 /*NM, p020*/
949 if(idleIsFocussed())
950 windowsUpdate();
951 break;
952
953 case IDLE_UPDATE:
954 /*NM, p020*/
955 if ((idleIsFocussed()) || (idle_data.klck_win != NULL))
956 {
957 if ((mmiStart_animationComplete()!=TRUE) && (mmiPinsEmergencyCall() == TRUE))
958 {
959 mmiPinsResetEmergencyCall();
960 mfwSimRestartPinEntry();
961 }
962 else
963 windowsUpdate();
964 }
965 break;
966
967 case IDLE_NEW_SMS:
968 // show the info about incoming sms on the idle screen
969 idle_data.clean_screen = FALSE;
970 /*NM, p020*/
971 if(idleIsFocussed())
972 windowsUpdate();
973 else if (idle_data.klck_win != NULL)
974 SEND_EVENT(idle_data.klck_win,IDLE_NEW_SMS,0,0);
975 break;
976 case IDLE_ACTIVE_KEY_PAD_LOCKED:
977 idle_data.klck_win = idle_key_pad_locked_create(win);
978 windowsUpdate();
979 break;
980
981 case IDLE_DETAILS_NUMBER:
982 idle_dialling_create(win);
983 windowsUpdate();
984 break;
985
986 case IDLE_START_DIALLING_NUMBER:
987 key_code = (U8*)parameter;
988 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
989 idle_data.edt_buf[0]=editControls[*key_code];
990 idle_dialling_start(idle_data.win,NULL);
991 break;
992
993 default:
994 return;
995 }
996
997 }
998
999 /*******************************************************************************
1000
1001 $Function: idleExec
1002
1003 $Description:
1004
1005 $Returns:
1006
1007 $Arguments:
1008
1009 *******************************************************************************/
1010
1011
1012 void idleExec (int reason, MmiState next)
1013 {
1014 MmiModuleSet (ModuleIdle); /* Set the global status of Idle */
1015 switch (reason)
1016 {
1017 case IdleNormal: /* enter normal idle mode */
1018 winShow(idle_data.win);
1019 break;
1020 default:
1021 break;
1022 }
1023 }
1024
1025
1026 /*******************************************************************************
1027
1028 $Function: idleEvent
1029
1030 $Description:
1031
1032 $Returns:
1033
1034 $Arguments:
1035
1036 *******************************************************************************/
1037
1038
1039 void idleEvent (int reason)
1040 {
1041 TRACE_EVENT_P1("IDLE event reason: %d",reason);
1042
1043 switch (reason)
1044 {
1045 case IdleSearchNetwork:
1046 if (idle_data.win)
1047 SEND_EVENT(idle_data.win,IDLE_NO_NETWORK,0,0);
1048 break;
1049 case IdleUpdate:
1050 if (idle_data.win)
1051 SEND_EVENT(idle_data.win,IDLE_UPDATE,0,0);
1052 break;
1053 case IdleNewSmsMessage:
1054 if (idle_data.win)
1055 SEND_EVENT(idle_data.win,IDLE_NEW_SMS,0,0);
1056 break;
1057 case IdleActiveKeyPadLocked:
1058 if (idle_data.win)
1059 SEND_EVENT(idle_data.win,IDLE_ACTIVE_KEY_PAD_LOCKED,0,0);
1060 break;
1061 case PhbkDetailListToIdle:
1062 if (idle_data.win)
1063 SEND_EVENT(idle_data.win,IDLE_DETAILS_NUMBER,0,0);
1064 break;
1065 default:
1066 break;
1067 }
1068 }
1069
1070
1071
1072 /*******************************************************************************
1073
1074 $Function: idle_setBgdBitmap
1075
1076 $Description: This procedure is called when the idle background bitmap is to be changed
1077
1078 $Returns: None
1079
1080 $Arguments: bmp - pointer to the bitmap structure.
1081
1082 *******************************************************************************/
1083 void idle_setBgdBitmap(int bmpId)
1084 {
1085 idle_data.idleBgd = icon_getBitmapFromId(bmpId, NULL);
1086
1087 }
1088
1089
1090 /*******************************************************************************
1091
1092 $Function: idle_initDisplayData
1093
1094 $Description: initialises the display data
1095
1096 $Returns:
1097
1098 $Arguments:
1099
1100 $History
1101 GW 09/10/02 - Created
1102
1103 *******************************************************************************/
1104 enum {
1105 IDLE_CHARGING_MODE,
1106 IDLE_NETWORK_NAME,
1107 IDLE_CALL_SMS_INFO,
1108 IDLE_CLOCK_STR,
1109 IDLE_DATE_STR,
1110 IDLE_LOCKED_ECC,
1111 IDLE_LOCKED,
1112 IDLE_MENU_PRESS,
1113 IDLE_END
1114 };
1115
1116 static int idlePosition[IDLE_END];
1117 /*******************************************************************************
1118
1119 $Function:
1120
1121 $Description:
1122
1123 $Returns:
1124
1125 $Arguments:
1126
1127 $History
1128 GW 09/10/02 - Created
1129
1130 *******************************************************************************/
1131 int idle_initDisplayData( void )
1132 {
1133 int i;
1134 for (i=0;i<IDLE_END;i++)
1135 idlePosition[i] = 0;
1136
1137 // ADDED BY RAVI - 28-11-2005
1138 return 0;
1139 // END RAVI - 28-11-2005
1140 }
1141
1142
1143 /*******************************************************************************
1144
1145 $Function: idle_displayData
1146
1147 $Description: Procedure to allow different layouts of the idle screen data depending on
1148 hardware configuration.
1149 Each bit of text that can be displayed is given a value in the enumerated type.
1150 For some h/w configurations, different enumerated type values are displayed in
1151 the same position. By checking the 'idlePosition' array we can tell if we can display
1152 a particular bit of text. This allows a C-sample to display either the SMS information
1153 or the clock and for the D-sample to always display the clock (and the date).
1154
1155 $Returns: None.
1156
1157 $Arguments: dataId - value form the enumerated type that indicates what the data is
1158 txtId - text identifier (can be set to TxtNull if not used)
1159 strId - pointer to a char array to be displayed. Array is assumed to be ascii.
1160 NB If both txtId and strId are used, the string is displayed first followed by
1161 1 or 2 spaces, then the text id allowing display of "1 New Message" etc.
1162 $History
1163 GW 09/10/02 - Created
1164
1165 *******************************************************************************/
1166 int idle_displayData( int dataId , int txtId, char* txtStr)
1167 {
1168 int xPos, yPos;
1169 int lenStr,lenId,lenSpace;
1170 int txtWidth = 0; // RAVI
1171 char *txtSpace = ""; //EF must initialise. 03/02/2003
1172 char *idStr;
1173 int txtFormat = 0; // RAVI
1174 int noRoom = 0;
1175
1176 if (txtStr != NULL)
1177 lenStr = dspl_GetTextExtent( txtStr, 0);
1178 else
1179 lenStr = 0;
1180 if (txtId!=TxtNull)
1181 {
1182 idStr = (char*)MmiRsrcGetText(txtId);
1183 lenId = dspl_GetTextExtent( idStr, 0);
1184 }
1185 else
1186 {
1187 lenId = 0;
1188 idStr = "";
1189 }
1190 if ((lenId > 0 ) && (lenStr >0))
1191 {
1192 #ifndef LSCREEN
1193
1194 txtSpace=" ";
1195
1196 #else
1197 txtSpace=" ";
1198
1199 #endif
1200 lenSpace = dspl_GetTextExtent( txtSpace, 0);
1201 }
1202 else
1203 {
1204 lenSpace = 0;
1205 }
1206 txtWidth = lenStr+lenId+lenSpace;
1207 if (idlePosition[dataId] == 0)
1208 idlePosition[dataId] = 1;
1209 else
1210 {
1211 //We have already output something here - do not overwrite it
1212 noRoom = 1;
1213 }
1214 #ifndef LSCREEN
1215 xPos = 0;
1216 yPos = 0;
1217 txtFormat = 0;
1218
1219 switch (dataId)
1220 {
1221 case IDLE_NETWORK_NAME:
1222 xPos = 16;
1223 yPos = Mmi_layout_line_icons(1);
1224 break;
1225
1226 case IDLE_CHARGING_MODE:
1227 xPos = 16;
1228 yPos = Mmi_layout_line_icons(2);
1229 break;
1230
1231 case IDLE_CALL_SMS_INFO:
1232 xPos = 0;
1233 yPos = Mmi_layout_line_icons(3);
1234 break;
1235
1236 case IDLE_CLOCK_STR:
1237 /* Marcus: Issue 1614: 23/01/2003: Start */
1238 #ifdef NEW_EDITOR
1239 if ((idlePosition[IDLE_CALL_SMS_INFO] == 0) &&
1240 (idle_data.editor == NULL))
1241 #else
1242 if ((idlePosition[IDLE_CALL_SMS_INFO] == 0) &&
1243 (idle_data.edt == NULL))
1244 #endif
1245 /* Marcus: Issue 1614: 23/01/2003: End */
1246 {
1247 xPos = 30;
1248 yPos = 24;
1249 }
1250 else
1251 { //no room to display the time
1252 noRoom = 1;
1253 }
1254 break;
1255 case IDLE_DATE_STR:
1256 noRoom = 1; //date not displayed in B-sample/C-sample
1257 break;
1258 case IDLE_LOCKED_ECC:
1259 case IDLE_LOCKED:
1260 xPos = 0;
1261 yPos = idleLine(2);
1262 break;
1263 case IDLE_MENU_PRESS:
1264 xPos = 0;
1265 yPos = idleLine(3);
1266 break;
1267
1268 default:
1269 break;
1270 }
1271 #else
1272 xPos = (SCREEN_SIZE_X - txtWidth)/2;
1273 yPos = idle_data.defTextOffset;
1274 txtFormat = 0;
1275 switch (dataId)
1276 {
1277 case IDLE_NETWORK_NAME:
1278 if (idle_data.idleNetLogo == NULL)
1279 yPos = Mmi_layout_line_height()*4;
1280 else
1281 yPos = yPos + Mmi_layout_line_height()*3;
1282 break;
1283
1284 case IDLE_CHARGING_MODE:
1285 yPos = yPos + Mmi_layout_line_height()*4;
1286 break;
1287
1288 case IDLE_CALL_SMS_INFO:
1289 yPos = yPos + Mmi_layout_line_height()*5;
1290 break;
1291
1292 case IDLE_CLOCK_STR:
1293 /* Marcus: Issue 1614: 23/01/2003: Start */
1294 #ifdef NEW_EDITOR
1295 if (idle_data.editor == NULL)
1296 #else
1297 if (idle_data.edt == NULL)
1298 #endif
1299 /* Marcus: Issue 1614: 23/01/2003: End */
1300 {
1301 xPos = 10;
1302 yPos = yPos + Mmi_layout_line_height();
1303 }
1304 else
1305 {
1306 noRoom = 1;
1307 }
1308 break;
1309 case IDLE_DATE_STR:
1310 /* Marcus: Issue 1614: 23/01/2003: Start */
1311 #ifdef NEW_EDITOR
1312 if (idle_data.editor == NULL)
1313 #else
1314 if (idle_data.edt == NULL)
1315 #endif
1316 {
1317 xPos = SCREEN_SIZE_X - txtWidth - 10;
1318 yPos = yPos + Mmi_layout_line_height();
1319 }
1320 else
1321 {
1322 noRoom = 1;
1323 }
1324 /* Marcus: Issue 1614: 23/01/2003: End */
1325 break;
1326 case IDLE_LOCKED_ECC:
1327 xPos = 0; /*SPR#2026 - DS - Changed from 10 */
1328 yPos = yPos + Mmi_layout_line_height()*4;
1329 dspl_Clear(xPos,yPos,mmiScrX,mmiScrY);
1330 dspl_Clear(xPos,yPos+ Mmi_layout_line_height()*5,mmiScrX,mmiScrY);
1331 break;
1332 case IDLE_LOCKED:
1333 xPos = 10;
1334 yPos = yPos + Mmi_layout_line_height()*4;
1335 break;
1336 case IDLE_MENU_PRESS:
1337 xPos = 10;
1338 yPos = yPos + Mmi_layout_line_height()*5;
1339 break;
1340
1341 default:
1342 break;
1343
1344 }
1345 #endif
1346
1347 if (!noRoom)
1348 {
1349 //GW 28/11/02 - Only display a non-null string
1350
1351 /*MC SPR 1526, using dspl_TextOut rather than dspl_ScrText*/
1352 if (txtStr != NULL)
1353 dspl_TextOut(xPos, yPos, 0, txtStr);
1354 if (lenSpace!= NULL)
1355 dspl_TextOut(xPos+lenStr, yPos, 0, txtSpace);
1356 dspl_TextOut(xPos+lenStr+lenSpace,yPos, 0, idStr);
1357 }
1358
1359 // ADDED BY RAVI - 28-11-2005
1360 return 0;
1361 //END RAVI - 28-11-2005
1362 }
1363
1364 /*******************************************************************************
1365
1366 $Function:
1367
1368 $Description: Returns a pixel position for a line number on the idle screen
1369
1370 $Returns: y pixel position for the line
1371
1372 $Arguments: lineNo - line number
1373
1374 $History
1375 GW 09/10/02 - Created
1376
1377 *******************************************************************************/
1378 static int idleLine( int lineNo )
1379 {
1380 // int yPos; // RAVI
1381 #ifndef LSCREEN
1382 return (Mmi_layout_line_icons(lineNo));
1383 #else
1384 return (Mmi_layout_line(lineNo)*3/2+Mmi_layout_IconHeight());
1385 #endif
1386 }
1387
1388 /*SPR 1725, removed getClockString() and getDateString() functions*/
1389
1390 /*******************************************************************************
1391
1392 $Function:
1393
1394 $Description:
1395
1396 $Returns:
1397
1398 $Arguments:
1399
1400 $History
1401 GW 09/10/02 - Created
1402
1403 *******************************************************************************/
1404 //Fix for 19656
1405 void idle_show_cb_editor_scrollbar(T_ED_DATA *e)
1406 {
1407 int editX, editY, editWidth, editHeight;
1408 int scrollBarSize, scrollBarPos;
1409
1410 if(e->viewHeight>=e->totalHeight)
1411 return;
1412
1413 editX=e->attr->win_size.px;
1414 editY=e->attr->win_size.py;
1415 editWidth=e->attr->win_size.sx-3;
1416 editHeight=e->attr->win_size.sy;
1417
1418 dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1);
1419 scrollBarSize = e->viewHeight * editHeight / e->totalHeight;
1420 if (scrollBarSize>editHeight)
1421 scrollBarSize = editHeight;
1422 scrollBarPos = e->viewStartPos * editHeight / e->totalHeight;
1423
1424 dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1,
1425 editY+scrollBarPos+scrollBarSize);
1426 dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2,
1427 editY+scrollBarPos+scrollBarSize);
1428 }
1429
1430 void idle_draw_main_idle( void )
1431 {
1432 T_CURRENT_NETWORK current_network;
1433 char text[20];
1434 int txtStrId; //Id of text string to be displayed
1435 int txtNo; //Numeric value to be displayed (0=no value)
1436 //int xOfs; //used to offset text id when a number is to be displayed // RAVI
1437 // int lenStr, txtFormat; // RAVI
1438 // static int nTimes=0; // RAVI
1439 int oldborderSize;
1440 int localborderSize;
1441 // Jul 08, 2005 REF: ENH 32642 x0018858
1442 char dt_str[20]; //date string
1443 char time_str[20]; //time string
1444 int xPos,yPos; //x and y position on screen
1445
1446 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1447 int sim_status;
1448
1449 // Apr 14, 2004 REF: CRR 12653 xvilliva
1450 CHAR oper[MAX_ALPHA_OPER_LEN]; /* operator name */
1451 T_ACI_COPS_MOD mode; /* COPS mode */
1452 T_ACI_COPS_FRMT frmt; /* COPS format */
1453 T_ACI_NRG_RGMD regMode;
1454 T_ACI_NRG_SVMD srvMode;
1455 T_ACI_NRG_FRMT oprFrmt;
1456 T_ACI_NRG_SVMD srvStat;
1457 LimitedService = 0;//end of crr12653
1458
1459
1460 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1461 sim_status = sim_status_check();
1462
1463
1464 TRACE_FUNCTION("idle_draw_main_idle()");
1465
1466 /* If we have not finished animation, do not draw any of the idle screen */
1467 if (mmiStart_animationComplete()!=TRUE)
1468 return;
1469
1470 TRACE_FUNCTION("idle_draw_main_idle");
1471
1472 resources_setColour( COLOUR_IDLE );
1473 dspl_ClearAll();
1474 idle_initDisplayData();
1475
1476 if (idle_data.starting_up) /*SPR#1662 - NH Show please wait since the phone is not ready yet*/
1477 {
1478 idle_displayData(IDLE_NETWORK_NAME,TxtPleaseWait,NULL);
1479 return;
1480 }
1481
1482 /* GW SPR#1721 - Add a border round all the text on the idle screen */
1483 #ifdef COLOURDISPLAY
1484 oldborderSize = dspl_setBorderWidth(1);
1485 #endif
1486 if (dspl_GetFgdColour()==dspl_GetBorderColour())
1487 {
1488 //Get a colour that contrasts with the foreground colour
1489 dspl_SetBorderColour(dspl_GetContrastColour(dspl_GetFgdColour()));
1490 //If this is the same as the background colour... too bad
1491 }
1492
1493 if(idle_data.idleBgd != NULL)
1494 dspl_BitBlt2(idle_data.idleBgd->area.px,idle_data.idleBgd->area.py,idle_data.idleBgd->area.sx,idle_data.idleBgd->area.sy,(void *)idle_data.idleBgd->icons,0,idle_data.idleBgd->icnType);
1495
1496 // Jul 08, 2005 REF: ENH 32642 x0018858
1497 // Set the back ground and foreground colour.
1498 dspl_SetFgdColour( COL_BLK );
1499 dspl_SetBgdColour( COL_TRANSPARENT );
1500
1501 if (idle_data.nm_status == NETWORK_FULL_SERVICE)
1502 {
1503 network_get_name (&current_network);
1504 #ifdef COLOURDISPLAY
1505 idle_data.idleNetLogo = icon_getNetworkIcon(current_network.network_name);
1506 #else
1507 idle_data.idleNetLogo = NULL;
1508 #endif
1509 }
1510 else
1511 idle_data.idleNetLogo = NULL;
1512
1513 //The animation complete will provide a better
1514
1515 if (idle_data.idleNetLogo)
1516 {
1517 int xOfs,yOfs;
1518 T_BITMAP* icn=idle_data.idleNetLogo;
1519
1520 if (icn->area.sy < SCREEN_SIZE_Y - Mmi_layout_IconHeight())
1521 {
1522 yOfs = Mmi_layout_IconHeight();
1523 if (icn->area.sy + yOfs < idle_data.defTextOffset)
1524 yOfs = yOfs + (idle_data.defTextOffset - icn->area.sy)/2;
1525 }
1526 else
1527 yOfs = 0;
1528
1529 if (icn->area.sx < SCREEN_SIZE_X)
1530 xOfs = (SCREEN_SIZE_X - icn->area.sx)/2;
1531 else
1532 xOfs = 0;
1533 #ifdef COLOURDISPLAY
1534 dspl_BitBlt2(xOfs,yOfs,icn->area.sx,icn->area.sy,icn->icons,0,icn->icnType);
1535 #endif
1536 }
1537
1538 if (smsidle_get_unread_sms_available())
1539 iconsSetState(iconIdSMS);/* Indicate SMS delivery to MS-User. */
1540 else
1541 iconsDeleteState(iconIdSMS);
1542
1543 /*
1544 DISPLAY ZONE 1
1545 */
1546 GlobalIconStatus = GlobalSignalIconFlag | GlobalBatteryIconFlag
1547 | GlobalSMSIconFlag| GlobalVoiceMailIconFlag
1548 | GlobalCallForwardingIconFlag| GlobalKeyplockIconFlag
1549 | GlobalRingerIconFlag | GlobalRingVibrIconFlag
1550 | GlobalVibratorIconFlag | GlobalAlarmIconFlag
1551 | GlobalSilentRingerIconFlag|GlobalCipheringActivIconFlag
1552 | GlobalCipheringDeactivIconFlag
1553 /* SH 18/01/02. Flag for GPRS On icon. */
1554 #ifdef MMI_GPRS_ENABLED
1555 | GlobalGPRSOnIconFlag
1556 #endif
1557 /* SPR759 - SH - Flag for Homezone icon */
1558 #ifdef MMI_HOMEZONE_ENABLED
1559 | GlobalHomezoneIconFlag
1560 #endif
1561 /* SPR#1352 - SH - Flag for TTY icon */
1562 #ifdef MMI_TTY_ENABLED
1563 | GlobalTTYIconFlag
1564 #endif
1565 /* SH end */
1566 ;
1567
1568 /* OMAPS00050447: a0393130, handle removal of sim card */
1569 /* In case of no network service icon display is handled in */
1570 /* switch case below */
1571 if(idle_data.nm_status == NETWORK_NO_SERVICE && sim_status == SIM_NOT_ACTIVE)
1572 /* OMAPS00050447: a0393130, handle removal of sim card */
1573 {
1574 TRACE_EVENT("ICON display handled below");
1575 }
1576 else
1577 {
1578 TRACE_EVENT("Normal ICON display handled");
1579 iconsShow();
1580 }
1581
1582 /*
1583 DISPLAY ZONE 2
1584 */
1585 switch (idle_data.nm_status)
1586 {
1587 case NETWORK_FULL_SERVICE :
1588 if (globalMobileMode == (GlobalMobileOn|GlobalCharging))
1589 {
1590 if(globalBatteryMode == GlobalBatteryFull)
1591 {
1592 idle_displayData(IDLE_CHARGING_MODE,TxtChargComplete,NULL);
1593
1594 }
1595 else
1596 {
1597 idle_displayData(IDLE_CHARGING_MODE,TxtCharging,NULL);
1598 }
1599 break;
1600 }
1601 else
1602 {
1603 if (DivertStatus == MFW_CFLAG_SET)
1604 {
1605 idle_displayData(IDLE_CHARGING_MODE,TxtCallDivert,NULL);
1606 }
1607 }
1608 /*NM p032
1609 set the flag when the TEST SIM is inserted*/
1610 if (!strcmp((char *)current_network.network_name,"00101"))
1611 {
1612 test_sim = TRUE;
1613 }
1614 else
1615 {
1616 test_sim = FALSE;
1617 }
1618 /*p032 end */
1619
1620 //x0pleela 9 Feb, 2006 ER:OMAPS00065203
1621
1622 //If SPN and plmn name are not NULL, display SPN for 5 seconds and the plmn name
1623 //For the above scenario, display_condition of SPN is not checked as per Cingular's requirement
1624 //In spite of display_condition being FALSE, we go ahead and display SPN
1625
1626 //If SPN is NULL and plmn name is not NULL, then display plmn name
1627
1628 /* Marcus: Issue 1618: 24/01/2003: Start *
1629 *
1630 * If we have a service provider name, show that,
1631 * else show the PLMN name
1632 */
1633
1634 if(!timer_start_flag)
1635 {
1636 timStart(plmn_display);
1637 timer_start_flag = TRUE;
1638 }
1639
1640 if( ( opername_disp_flag EQ SPN ) AND
1641 (strlen((char*)current_network.service_provider_name)) ) //SPN name
1642 {
1643 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.service_provider_name);
1644 }
1645 else
1646 {
1647 if(strlen((char*)current_network.plmn_name)) //PLMN name
1648 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.plmn_name);
1649 else //Numeric name
1650 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.network_name);
1651 }
1652
1653 /* Marcus: Issue 1618: 24/01/2003: End */
1654 break;
1655
1656 case NETWORK_SEARCH_NETWORK :
1657 idle_displayData(IDLE_NETWORK_NAME,TxtSearching,NULL);
1658 break;
1659 case NETWORK_NO_SERVICE :
1660 if (sim_status == SIM_NOT_ACTIVE)
1661 {
1662 /* OMAPS00050447: a0393130, handle removal of sim card */
1663 globalSignalPicNumber =0; /* updating signal strength */
1664 iconsShow();
1665 /* OMAPS00050447: a0393130, handle removal of sim card */
1666 idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
1667 }
1668 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1669 else if (sim_status == IMEI_NOT_VALID)
1670 idle_displayData(IDLE_NETWORK_NAME,TxtInvalidIMEI,NULL);
1671 else
1672 {// Apr 14, 2004 REF: CRR 12653 xvilliva
1673 srvStat = -2;
1674 qAT_PercentNRG( CMD_SRC_LCL,
1675 &regMode,
1676 &srvMode,
1677 &oprFrmt,
1678 &srvStat,
1679 oper);
1680
1681 if(srvStat == NRG_SVMD_Limited && globalSignalPicNumber > iconSigStat49)
1682 {//xvilliva checking signal and limited service status.
1683 idle_displayData(IDLE_NETWORK_NAME,TxtLimService,NULL);
1684 LimitedService = 1;
1685 }
1686 else
1687 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
1688 }
1689 break;
1690 case NETWORK_NO_PLMN_XXX_AVAIL:
1691 if (sim_status == SIM_NOT_ACTIVE)
1692 idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
1693 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1694 else if (sim_status == IMEI_NOT_VALID)
1695 idle_displayData(IDLE_NETWORK_NAME,TxtInvalidIMEI,NULL);
1696 else
1697 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
1698 default:
1699 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
1700 break;
1701 }
1702
1703 /*
1704 DISPLAY ZONE 3
1705 */
1706
1707 TRACE_EVENT("DISPLAY ZONE 3");
1708 txtStrId = TxtNull;
1709 txtNo= 0;
1710 // xOfs= 0; // RAVI
1711 if (!idle_data.clean_screen) //for clean the DISPLAY ZONE 3
1712 //dont show the following information when the user pressed
1713 // the HUP key once in the idle screen
1714 {
1715 TRACE_EVENT("Not clean screen");
1716 idle_data.new_sms = FALSE;
1717 /*
1718 ** NDH : 15/05/2003 : Change the priority for the idle display, such that
1719 ** CB, SAT Idle Display Text or Class 0 SMS are displayed with
1720 ** the highest priority
1721 */
1722 /* SPR#1428 - SH - New Editor changes */
1723 #ifdef NEW_EDITOR
1724 /* Normal incoming cell broadcast */
1725 if (idle_data.new_cbch)
1726 {
1727 if (idle_data.editor)
1728 {
1729 ATB_edit_Hide(idle_data.editor);
1730 }
1731
1732 /* SPR759 - SH. Hide SAT idle mode text if present */
1733 if (idle_data.editor_sat)
1734 {
1735 ATB_edit_Hide(idle_data.editor_sat);
1736 }
1737 txtStrId = TxtNewCbMessage;
1738 TRACE_EVENT("new_cbch");
1739 }
1740
1741 /* SPR759 - SH - Display SAT idle mode text */
1742 else if (idle_data.editor_sat)
1743 {
1744 ATB_edit_Unhide(idle_data.editor_sat);
1745 ATB_edit_Show(idle_data.editor_sat);
1746 idle_show_cb_editor_scrollbar(idle_data.editor_sat); //Fix for 19656
1747 TRACE_EVENT("editor_sat");
1748 }
1749
1750 /* Dialling editor, Immediate incoming cell broadcast */
1751 else if (idle_data.editor)
1752 {
1753 TRACE_EVENT("*** Displaying number editor *");
1754 /* MZ issue 1948, Modify the text boarder settings before displaying the message. */
1755 localborderSize = dspl_setBorderWidth(0);
1756 ATB_edit_Unhide(idle_data.editor);
1757 ATB_edit_Show(idle_data.editor);
1758 dspl_setBorderWidth(localborderSize);
1759 }
1760 #else /* NEW_EDITOR */
1761 /* Normal incoming cell broadcast */
1762 if (idle_data.new_cbch)
1763 {
1764 if (idle_data.edt)
1765 {
1766 edtHide(idle_data.edt);
1767 }
1768
1769 /* SPR759 - SH. Hide SAT idle mode text if present */
1770 if (idle_data.edt_sat)
1771 {
1772 edtHide(idle_data.edt_sat);
1773 }
1774 txtStrId = TxtNewCbMessage;
1775 }
1776
1777 /* SPR759 - SH - Display SAT idle mode text */
1778 else if (idle_data.edt_sat)
1779 {
1780 edtUnhide(idle_data.edt_sat);
1781 edtShow(idle_data.edt_sat);
1782 }
1783
1784 /* Immediate incoming cell broadcast */
1785 else if (idle_data.edt)
1786 {
1787 edtUnhide(idle_data.edt);
1788 edtShow(idle_data.edt);
1789 }
1790 #endif /* NEW_EDITOR */
1791 else if (idle_data.missedCalls)
1792 {
1793 txtNo = idle_data.missedCalls;
1794 if(txtNo <= 1)
1795 {
1796 txtStrId = TxtMissedCall;
1797 }
1798 else
1799 {
1800 txtStrId = TxtMissedCalls;
1801 }
1802 TRACE_EVENT("missed calls");
1803 }
1804 //xrashmic 26 Aug, 2004 MMI-SPR-23931
1805 // To display the indication of new EMS in the idle screen
1806 else if (idle_data.ems)
1807 {
1808 #if defined (FF_MMI_MMS) || defined (FF_MMI_EMS)//MMI-SPR 49811 - x0035544 07 nov 2005
1809 txtStrId = TxtEMSNew;
1810 #endif //MMI-SPR 49811 - x0035544 07 nov 2005
1811 }
1812 else if (sms_message_count(MFW_SMS_UNREAD) > 0 )
1813 {
1814 txtStrId = smsidle_display_sms_status(&txtNo );
1815 idle_data.new_sms = TRUE;
1816 }
1817 else if(FFS_flashData.settings_status & SettingsSilentMode)
1818 {
1819 txtStrId = TxtSilentMode;
1820 TRACE_EVENT("Silent mode");
1821 }
1822 /* Marcus: Issue 1604: 23/01/2003: Start */
1823 else if (smsidle_get_ready_state() && smsidle_get_memory_full())
1824 {
1825 /* x0018858 24 Mar, 2005 MMI-FIX-11321
1826 Added a condition to check for any pending message on the server.
1827 */
1828 //begin -x0018858 24 Mar, 2005 MMI-FIX-11321
1829 if(TRUE == sms_check_message_pending())
1830 {
1831 TRACE_EVENT("Pending SMS, but list is full");
1832 txtStrId = TxtSmsWaiting;
1833 }//end -x0018858 24 Mar, 2005 MMI-FIX-11321
1834 else
1835 {
1836 TRACE_EVENT("No unread SMS, but list is full");
1837 txtStrId = TxtSmsListFull;
1838 }
1839 }
1840 /* Marcus: Issue 1604: 23/01/2003: End */
1841 else
1842 {
1843 TRACE_EVENT("None of the above!");
1844 }
1845 }
1846 else //(!idle_data.clean_screen)
1847 {
1848 TRACE_EVENT("Clean screen");
1849 /* SPR#1428 - SH - New Editor changes */
1850 #ifdef NEW_EDITOR
1851 //this is for the immediate incoming cell broadcast
1852 if (idle_data.editor)
1853 { /* MZ Issue 1948, modify the text border settings before displaying the message.*/
1854 localborderSize = dspl_setBorderWidth(0);
1855 ATB_edit_Unhide(idle_data.editor);
1856 ATB_edit_Show(idle_data.editor);
1857 dspl_setBorderWidth(localborderSize);
1858 }
1859 #else /* NEW_EDITOR */
1860 //this is for the immediate incoming cell broadcast
1861 if (idle_data.edt)
1862 {
1863 edtUnhide(idle_data.edt);
1864 edtShow(idle_data.edt);
1865 }
1866 #endif /* NEW_EDITOR */
1867
1868 //20/4/01 MZ check for silent_mode status.
1869 else if(FFS_flashData.settings_status & SettingsSilentMode)
1870 {
1871 txtStrId = TxtSilentMode;
1872 }
1873 // May 21, 2004 REF: CRR 16084 Deepa M.D
1874 //Display the Message Full String, when the Idle screen is clean.
1875 else if (smsidle_get_ready_state() && smsidle_get_memory_full())
1876 {
1877 /* x0018858 24 Mar, 2005 MMI-FIX-11321
1878 Added a condition to check for any pending message on the server.
1879 */
1880 //begin -x0018858 24 Mar, 2005 MMI-FIX-11321
1881 if(TRUE == sms_check_message_pending())
1882 {
1883 TRACE_EVENT("Pending SMS, but list is full");
1884 txtStrId = TxtSmsWaiting;
1885 }//end -x0018858 24 Mar, 2005 MMI-FIX-11321
1886 else
1887 {
1888 TRACE_EVENT("No unread SMS, but list is full");
1889 txtStrId = TxtSmsListFull;
1890 }
1891 }
1892 else
1893 {
1894 TRACE_EVENT("None of the above 2");
1895 }
1896 }
1897 //If data has been set up, then show it
1898 if (txtStrId != TxtNull)
1899 {
1900 if (txtNo != 0)
1901 {
1902 sprintf((char*)text,"%d",txtNo);
1903 idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,text);
1904 }
1905 else
1906 idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,NULL);
1907 }
1908
1909 idle_displayData(IDLE_CLOCK_STR, TxtNull, mfw_td_get_clock_str());/*SPR 1725*/
1910 idle_displayData(IDLE_DATE_STR, TxtNull, mfw_td_get_date_str()); /*SPR 1725*///Only displayed on D-sample
1911
1912 /*
1913 DISPLAY ZONE 4
1914 */
1915
1916 TRACE_EVENT("DISPLAY ZONE 4");
1917 resources_setSKColour( COLOUR_IDLE );
1918
1919 /* GW SPR#1721 - Changed from a case statement so we restore colour/border info */
1920 if ((idle_data.search) && ((idle_data.nm_status==NETWORK_NO_SERVICE) ||
1921 (idle_data.nm_status==NETWORK_NO_PLMN_XXX_AVAIL)))
1922 {
1923 TRACE_EVENT("idle_win_cb()-no network yet");
1924 // Apr 14, 2004 REF: CRR 12653 xvilliva
1925 // Here we are setting the softkey names if there are missedCalls/SMS/CBCH
1926 // we set the left key as "Read" else it is "Names".
1927 if(srvStat == NRG_SVMD_Limited)
1928 {
1929 if(idle_data.new_sms || idle_data.missedCalls > 0 || idle_data.new_cbch)
1930 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
1931 else
1932 softKeys_displayId(TxtNames,TxtSoftMenu,0,COLOUR_IDLE);
1933 }
1934 else
1935 softKeys_displayId(TxtSearchName,TxtNull,0,COLOUR_IDLE);
1936 }
1937 //xrashmic 26 Aug, 2004 MMI-SPR-23931
1938 // To display the 'read' softkey for the indication of new EMS in the idle screen
1939 //CRR 25268 & 25270: 14 Oct 2004 - xpradipg
1940 //display the read softkey only if there are no new cb message or sat messsage on idle screen
1941 else if (idle_data.ems && !idle_data.new_cbch && !idle_data.missedCalls && !idle_data.editor && !idle_data.editor_sat && !idle_data.clean_screen)
1942 {
1943 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
1944 }
1945 else if ( smsidle_get_unread_sms_available()
1946 && (!idle_data.clean_screen)
1947 && idle_data.new_sms )
1948 {
1949 TRACE_EVENT("idle_win_cb()-unread SMS");
1950 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
1951 }
1952 else if ((!idle_data.clean_screen) && idle_data.new_cbch)
1953 {
1954 TRACE_EVENT("idle_win_cb()-new CBCH");
1955 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
1956 }
1957 else if (idle_data.missedCalls > 0)
1958 {
1959 TRACE_EVENT("idle_win_cb()-missed calls");
1960 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
1961 }
1962 else
1963 {
1964 TRACE_EVENT("idle_win_cb()-phonebook");
1965 softKeys_displayId(TxtNames,TxtSoftMenu,0,COLOUR_IDLE);
1966 }
1967
1968 // Jul 08, 2005 REF: ENH 32642 x0018858
1969 //Code to display the date/time even if the idle_data editor is being displayed.
1970 //Begin 32642
1971 #ifdef NEW_EDITOR
1972 if (idle_data.editor != NULL)
1973 #else
1974 if (idle_data.edt != NULL)
1975 #endif
1976 {
1977 dspl_SetFgdColour( COL_BLK );
1978 dspl_SetBgdColour( COL_TRANSPARENT );
1979
1980 strcpy((char *)dt_str, mfw_td_get_date_str());
1981 strcpy((char *)time_str, mfw_td_get_clock_str());
1982
1983 xPos = 10;
1984 yPos = Mmi_layout_line_height()*7;
1985
1986 dspl_Clear(10, Mmi_layout_line_height()*7,mmiScrX,mmiScrY);
1987 dspl_TextOut (10,Mmi_layout_line_height()*7, 0, time_str);
1988
1989 dspl_Clear(125, Mmi_layout_line_height()*7,mmiScrX,mmiScrY);
1990 dspl_TextOut(100,yPos,0, dt_str);
1991
1992 }
1993 //End 32642
1994
1995 resources_restoreMnuColour();//required only if other menu items are to be drawn afterwards
1996
1997 resources_restoreColour();
1998
1999 #ifdef COLOURDISPLAY
2000 dspl_setBorderWidth(oldborderSize);
2001 #endif
2002
2003 //Debug - output how much memory is left.
2004 mfwCheckMemoryLeft();
2005
2006 TRACE_FUNCTION("end of idle_draw_main_idle()");
2007 }
2008
2009 /*******************************************************************************
2010
2011 $Function: idle_win_cb
2012
2013 $Description:
2014
2015 $Returns:
2016
2017 $Arguments:
2018
2019 $History
2020 GW 09/10/02 - Removed display code to separate procedure.
2021
2022 *******************************************************************************/
2023 static int idle_win_cb (MfwEvt e, MfwWin *w)
2024 {
2025 TRACE_FUNCTION("idle_win_cb");
2026 switch (e)
2027 {
2028 case MfwWinVisible:
2029
2030 /* Mar 08, 2006 REF:ER OMAPS00065168 */
2031 /* Destroy the editor to make the messages like 'new message' visible */
2032 #ifdef NEPTUNE_BOARD
2033 statusCBCH(FALSE);
2034 #endif
2035
2036 idle_draw_main_idle();
2037 break;
2038 //x0pleela 15 Feb, 2006 ER:OMAPS00065203
2039 //Handling MfwWinResume event
2040 case MfwWinResume: /* window is resumed */
2041 opername_disp_flag = SPN;
2042 timer_start_flag = FALSE;
2043 break;
2044
2045 case MfwWinFocussed: /* input focus / selected*/
2046 case MfwWinDelete:/* window will be deleted*/
2047 default:
2048 return MFW_EVENT_REJECTED;
2049 }
2050
2051 return MFW_EVENT_CONSUMED;
2052
2053 }
2054
2055
2056 /*******************************************************************************
2057
2058 $Function: keyEvent
2059
2060 $Description: keyboard event handler
2061
2062 $Returns:
2063
2064 $Arguments:
2065
2066 *******************************************************************************/
2067
2068 static int idle_kbd_cb (MfwEvt e, MfwKbd *k)
2069 {
2070
2071 // static UBYTE right_key_pressed=FALSE; // RAVI
2072 UBYTE currentRinger = getCurrentRingerSettings();
2073
2074 T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL;
2075 // UBYTE Temp_edt_buf[KEYPADLOCK_BUF_SIZE]; // RAVI
2076
2077 // char debug[50]; // RAVI - Not Used.
2078
2079 TRACE_FUNCTION("idle_kbd_cb");
2080
2081 TRACE_EVENT_P1("Key: %d", k->code);
2082
2083 if (idle_data.starting_up) /*NH Do nothing when starting up */
2084 {
2085 return MFW_EVENT_CONSUMED;
2086 }
2087
2088 if (!(e & KEY_MAKE))
2089 {
2090 switch (k->code)
2091 {
2092 case KCD_RIGHT:
2093 pin_idle_emerg_call = FALSE;
2094 break;
2095
2096 // sbh - power key pressed in idle screen, we can shut down
2097 case KCD_POWER:
2098 pin_idle_emerg_call = FALSE;
2099 HUPKeyOrigin = 1;
2100 break;
2101
2102 case KCD_LEFT:
2103 break;
2104
2105 default:
2106 break;
2107 }
2108 idle_data.right_key_pressed = FALSE;
2109
2110 return MFW_EVENT_CONSUMED;
2111 }
2112
2113 idle_data.right_key_pressed = FALSE;
2114
2115 if(idle_data.missedCalls > 0)
2116 {
2117 switch (k->code)
2118 {
2119 case KCD_MNUSELECT:
2120 case KCD_LEFT:
2121 idle_data.missedCalls = 0;
2122 bookPhonebookStart(idle_data.win,PhbkMissedCallsListNormal);
2123
2124 return MFW_EVENT_CONSUMED;
2125 default:
2126 break;
2127 }
2128 }
2129
2130 #if defined (FF_MMI_EMS) && defined (FF_GPF_TCPIP)
2131 //xrashmic 26 Aug, 2004 MMI-SPR-23931
2132 // To launch the EMS inbox on pressing the "read" left softkey in idle
2133 // screen after receving the new EMS indication in the idle screen.
2134 if(idle_data.ems)
2135 {
2136 switch (k->code)
2137 {
2138 case KCD_MNUSELECT:
2139 case KCD_LEFT:
2140 MMSBox_start(idle_data.win, (MfwMnuAttr*)MMS_INBOX);
2141 return MFW_EVENT_CONSUMED;
2142 default:
2143 break;
2144 }
2145 }
2146 #endif
2147
2148
2149 if(LimitedService == 0 && idle_data.search)// Apr 14, 2004 REF: CRR 12653 xvilliva
2150 //if (idle_data.search)
2151 {
2152 switch (idle_data.nm_status)
2153 {
2154 case NETWORK_NO_SERVICE :
2155 case NETWORK_NO_PLMN_XXX_AVAIL:
2156
2157 switch (k->code)
2158 {
2159 case KCD_MNUSELECT:
2160 case KCD_LEFT:
2161 network_start_full_service();
2162 winShow(idle_data.win);
2163 case KCD_HUP:
2164 idle_data.search=FALSE;
2165 winShow(idle_data.win);
2166 break;
2167 /*CONQ 6436, MC allow entry of emergency number*/
2168 /*API - 13-09-02 -Add all KCD_0 and KCD_8 */
2169 /*CQ10659 - API - 20/06/03 - Added KCD_STAR, KCD_HASH, KCD_6*/
2170 case KCD_0:
2171 case KCD_1:
2172 case KCD_2:
2173 case KCD_6:
2174 case KCD_8:
2175 case KCD_9:
2176 case KCD_STAR:
2177 case KCD_HASH:
2178 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
2179 idle_data.edt_buf[0]=editControls[k->code];
2180 TRACE_EVENT_P2("Idle_data.edt_buf[0] = %d, [1] = %d", idle_data.edt_buf[0], idle_data.edt_buf[1]);
2181 idle_dialling_start(idle_data.win,NULL);
2182 break;
2183
2184 default:
2185 break;
2186 }
2187 return MFW_EVENT_CONSUMED;
2188
2189 default:
2190 break;
2191 }
2192 }
2193
2194 if (smsidle_get_unread_sms_available()
2195 && (!idle_data.clean_screen)
2196 && idle_data.new_sms )
2197
2198 {
2199
2200 switch (k->code)
2201 {
2202 case KCD_MNUSELECT:
2203 case KCD_LEFT:
2204 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2205 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
2206 // terminate the ringing
2207 #ifdef FF_MIDI_RINGER
2208 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2209 #else
2210 /* Stop playing ring tone on key press - RAVI -23-12-2005 */
2211 #ifdef NEPTUNE_BOARD
2212 currentRinger = getcurrentSMSTone();
2213 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2214 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2215 #else
2216 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2217 #endif
2218
2219 vsi_t_sleep(0,10); /* small delay */
2220 #else
2221 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2222 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2223 #else
2224 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2225 #endif
2226 #endif /*END RAVI */
2227 #endif
2228
2229 idle_data.new_sms = FALSE;
2230 /*SPR 2512, removed setting of clean_screen flag here*/
2231 SmsRead_R_start(idle_data.win, (MfwMnuAttr *)&sms_list_type);
2232
2233 return MFW_EVENT_CONSUMED;
2234 default:
2235 break;
2236 }
2237 }
2238
2239 //this is for cell broadcast
2240 if ((!idle_data.clean_screen) && idle_data.new_cbch )
2241 {
2242 switch (k->code)
2243 {
2244 case KCD_MNUSELECT:
2245 case KCD_LEFT:
2246 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2247 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
2248 // terminate the ringing
2249 #ifdef FF_MIDI_RINGER
2250 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2251 #else
2252 /* Stop Playing Ring tone on Key press - RAVI - 23-12-2005 */
2253 #ifdef NEPTUNE_BOARD
2254 currentRinger = getcurrentSMSTone();
2255 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2256 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2257 #else
2258 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2259 #endif
2260
2261 vsi_t_sleep(0,10); /* small delay */
2262 #else
2263 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2264 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2265 #else
2266 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2267 #endif
2268 #endif /* END RAVI */
2269 #endif
2270
2271 idle_data.new_cbch = FALSE;
2272 idle_data.clean_screen = TRUE;
2273 sms_cb_read_msg (ALL_MESSAGE);
2274 return MFW_EVENT_CONSUMED;
2275 default:
2276 break;
2277 }
2278 }
2279
2280
2281
2282 switch (k->code)
2283 {
2284 case KCD_MNUUP:
2285 /* SPR#1428 - SH - New Editor changes */
2286 #ifdef NEW_EDITOR
2287 if(idle_data.editor)
2288 {
2289 TRACE_EVENT("CB menu up");
2290 ATB_edit_MoveCursor(idle_data.editor,ctrlUp, TRUE);
2291 }
2292 #else /* NEW_EDITOR */
2293 if(idle_data.edt)
2294 {
2295 TRACE_EVENT("CB menu up");
2296 edtChar(idle_data.edt,ecUp);
2297 }
2298 #endif /*NEW_EDITOR */
2299 //Fix for 19656
2300 #ifdef NEW_EDITOR
2301 else if(idle_data.editor_sat)
2302 {
2303 TRACE_EVENT("sat menu up");
2304 ATB_edit_MoveCursor(idle_data.editor_sat,ctrlUp, TRUE);
2305 ATB_edit_Show(idle_data.editor_sat);
2306 idle_show_cb_editor_scrollbar(idle_data.editor_sat);
2307 }
2308 #else /* NEW_EDITOR */
2309 else if(idle_data.edt_sat)
2310 {
2311 TRACE_EVENT("CB menu up");
2312 edtChar(idle_data.edt,ecUp);
2313 }
2314 #endif /*NEW_EDITOR */
2315 else
2316 {
2317 /*
2318 Indicate that the volume settings menu has been invoked from the
2319 incoming call screen.
2320 //Apr 05, 2005 REF: ENH 29994 xdeepadh */
2321 #ifdef FF_MIDI_RINGER
2322 IdleScreenVolumeTimer();
2323 #endif
2324 setSoundsReason(SettingVolume);
2325 idle_data.info_win=bookMenuStart(idle_data.win, ringerVolumeSetting(), SettingVolume);
2326 }
2327 break;
2328
2329 case KCD_MNUDOWN:
2330 /* SPR#1428 - SH - New Editor changes */
2331 #ifdef NEW_EDITOR
2332 if(idle_data.editor)
2333 {
2334 TRACE_EVENT("CB menu down");
2335 ATB_edit_MoveCursor(idle_data.editor,ctrlDown, TRUE);
2336 }
2337 #else /* NEW_EDITOR */
2338 if(idle_data.edt)
2339 {
2340 TRACE_EVENT("CB menu down");
2341 edtChar(idle_data.edt,ecDown);
2342 }
2343 #endif /*NEW_EDITOR */
2344 //Fix for 19656
2345 #ifdef NEW_EDITOR
2346 else if(idle_data.editor_sat)
2347 {
2348 TRACE_EVENT("sat menu up");
2349 ATB_edit_MoveCursor(idle_data.editor_sat,ctrlDown, TRUE);
2350 ATB_edit_Show(idle_data.editor_sat);
2351 idle_show_cb_editor_scrollbar(idle_data.editor_sat);
2352 }
2353 #else /* NEW_EDITOR */
2354 else if(idle_data.edt_sat)
2355 {
2356 TRACE_EVENT("CB menu up");
2357 edtChar(idle_data.edt,ecUp);
2358 }
2359 #endif /*NEW_EDITOR */
2360 else
2361 {
2362 /*
2363 Indicate that the volume settings menu has been invoked from the
2364 incoming call screen.
2365 */
2366 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2367 #ifdef FF_MIDI_RINGER
2368 IdleScreenVolumeTimer();
2369 #endif
2370 setSoundsReason(SettingVolume);
2371 idle_data.info_win=bookMenuStart(idle_data.win, ringerVolumeSetting(), SettingVolume);
2372 }
2373 break;
2374 // break; // RAVI
2375 case KCD_MNUSELECT:
2376 case KCD_LEFT: /* main menu */
2377 /* Stop Playing Audio on Key press - RAVI - 23-12-2005 */
2378 #ifdef NEPTUNE_BOARD
2379 if (idle_data.new_sms == TRUE)
2380 {
2381 /*Apr 05, 2005 REF: ENH 29994 xdeepadh */
2382 /*Terminate ringing */
2383 #ifdef FF_MIDI_RINGER
2384 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2385 #else
2386 currentRinger = getcurrentSMSTone();
2387 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2388 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2389 #else
2390 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2391 #endif
2392
2393 vsi_t_sleep(0,10); /* Small Delay */
2394 #endif
2395 }
2396 #else
2397 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
2398 /* Terminate ringing */
2399 #ifdef FF_MIDI_RINGER
2400 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2401 #endif
2402 #endif
2403 /* END RAVI - 23-12-2005 */
2404
2405
2406 bookPhonebookStart(idle_data.win,PhbkNormal);
2407 break;
2408 case KCD_CALL:
2409 bookPhonebookStart(idle_data.win,PhbkRedialListNormal);
2410 break;
2411 case KCD_RIGHT: /* contacts (ADN) */
2412 /* SPR#1449 - SH - Remove, as terminates GPRS connection.
2413 * Seems to be unnecessary. */
2414 /*cm_force_disconnect();
2415 /* terminate the ringing */
2416 /* audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2417 */
2418 /* Stop playing audio on key press - RAVI - 23-12-2005 */
2419 #ifdef NEPTUNE_BOARD
2420 if (idle_data.new_sms == TRUE)
2421 {
2422 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
2423 /* Terminate ringing */
2424 #ifdef FF_MIDI_RINGER
2425 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2426 #else
2427 currentRinger = getcurrentSMSTone();
2428 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2429 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2430 #else
2431 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2432 #endif
2433
2434 vsi_t_sleep(0,10); /* Small delay */
2435 #endif
2436 }
2437 #else
2438 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
2439 /* Terminate ringing */
2440 #ifdef FF_MIDI_RINGER
2441 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2442 #endif
2443 #endif
2444 /* END RAVI - 23-12-2005 */
2445 bookPhonebookStart(idle_data.win,PhbkMainMenu);
2446 break;
2447 case KCD_HUP:
2448 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2449 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
2450 //Terminate ringing
2451 #ifdef FF_MIDI_RINGER
2452 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2453 #endif
2454
2455 /*
2456 ** NDH : 15/05/2003 : If the Idle editor is being displayed the only way to
2457 ** remove it is by pressing the Hangup Key, if it is active, do not set
2458 ** "Clean Screen" so that the previous "Missed Calls" etc will be displayed
2459 */
2460 if (!idle_data.editor)
2461 {
2462 //for clean the DISPLAY ZONE 3
2463 //information like "missed calls" and "receive messages"
2464 //disappear if the user press the HUP key
2465 idle_data.clean_screen = TRUE;
2466 }
2467
2468
2469 /* delete the message buffer plus the editor */
2470 statusCBCH(FALSE);
2471 windowsUpdate();
2472 break;
2473
2474 // sbh - power key pressed in idle screen, we can shut down
2475 case KCD_POWER:
2476 HUPKeyOrigin = 1;
2477 break;
2478
2479 case KCD_0:
2480 case KCD_1:
2481 case KCD_2:
2482 case KCD_3:
2483 case KCD_4:
2484 case KCD_5:
2485 case KCD_6:
2486 case KCD_7:
2487 case KCD_8:
2488 case KCD_9:
2489 case KCD_STAR:
2490 case KCD_HASH:
2491 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
2492 idle_data.edt_buf[0]=editControls[k->code];
2493 idle_dialling_start(idle_data.win,NULL);
2494 break;
2495
2496 default:
2497 break;
2498 }
2499 //Jun 24, 2005 MMI-FIX-30973 x0018858
2500 //Added code to handle the display of homezone/cityzone tag.
2501 //Begin 30973
2502 //Check to see if there are any new sms/ missed calls and confirm that the screen is clean.
2503 if ( ((smsidle_get_unread_sms_available() == 0)
2504 && ( idle_data.new_sms <= 0) && ( idle_data.missedCalls == 0)) || (idle_data.clean_screen))
2505 {
2506 if (tag_zone != NULL)
2507 {
2508
2509 addCBCH((char*)tag_zone, IdleNewCBImmediateMessage);
2510 winShow(idle_data.win);
2511
2512 }
2513 }
2514 //End 30973
2515
2516 return MFW_EVENT_CONSUMED;
2517 }
2518
2519
2520
2521
2522
2523 /*******************************************************************************
2524
2525 $Function: idle_kbd_long_cb
2526
2527 $Description: Creation of an instance for the Idle dialog.
2528
2529 $Returns:
2530
2531 $Arguments:
2532
2533 *******************************************************************************/
2534
2535
2536 static int idle_kbd_long_cb(MfwEvt e, MfwKbd *k)
2537 {
2538
2539 TRACE_FUNCTION ("idle_kbd_long_cb");
2540
2541 if ((e & KEY_RIGHT) && (e & KEY_LONG) && (idle_data.right_key_pressed == TRUE))
2542 {
2543 }
2544
2545 return MFW_EVENT_CONSUMED;
2546 }
2547
2548
2549 /*******************************************************************************
2550
2551 $Function: idle_get_window
2552
2553 $Description:
2554
2555 $Returns:
2556
2557 $Arguments:
2558
2559 *******************************************************************************/
2560
2561
2562
2563
2564 MfwHnd idle_get_window (void)
2565 {
2566 return idle_data.win;
2567 }
2568
2569 /*******************************************************************************
2570
2571 $Function: idle_set_starting_up
2572
2573 $Description: Sets a flag that indicates to Idle that the phone is starting up
2574
2575 $Returns:
2576
2577 $Arguments:
2578
2579 *******************************************************************************/
2580
2581
2582
2583
2584 void idle_set_starting_up (UBYTE set)
2585 {
2586 idle_data.starting_up = set;
2587 }
2588
2589
2590 /*******************************************************************************
2591
2592 $Function: idleIsFocussed
2593
2594 $Description:
2595
2596 $Returns:
2597
2598 $Arguments:
2599
2600 *******************************************************************************/
2601
2602
2603
2604
2605 int idleIsFocussed(void)
2606 {
2607
2608 if (winIsFocussed(idle_data.win))
2609 {
2610 TRACE_EVENT("idleIsFocussed");
2611 return 1;
2612 }
2613 else
2614 return 0;
2615
2616
2617 }
2618
2619 /*******************************************************************************
2620
2621 $Function: addMissedCall
2622
2623 $Description:
2624
2625 $Returns:
2626
2627 $Arguments:
2628
2629 *******************************************************************************/
2630
2631
2632
2633
2634 void addMissedCall(void)
2635 {
2636 idle_data.missedCalls++;
2637
2638 // show the info about missed calls on the idle screen
2639 idle_data.clean_screen = FALSE;
2640 }
2641 /*******************************************************************************
2642
2643 $Function: class0_editor_cb Added for issue 2512
2644
2645 $Description: CAllback for the class 0 editor. frees memory
2646
2647 $Returns: none
2648
2649 $Arguments: window(cast to string pointer), id, reason
2650
2651 *******************************************************************************/
2652 void class0_editor_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
2653 { U8* message_buffer;
2654 /*cast the window pointer to string buffer*/
2655 message_buffer = (U8*)win;
2656 /*free the memory*/
2657 FREE_MEMORY(message_buffer, MAX_EDITOR_LEN);
2658 message_buffer = NULL;
2659 /*redraw the windows*/
2660 windowsUpdate();
2661
2662
2663 }
2664 /*******************************************************************************
2665
2666 $Function: addCBCH
2667
2668 $Description: this indicates the incoming cell-info cellbroadcast
2669 or incoming sms class 0 message
2670 The Status tells about to show or not on the Idle screen
2671
2672 $Returns:
2673
2674 $Arguments:
2675
2676 *******************************************************************************/
2677 void addCBCH(char* cbch_string, UBYTE type)
2678 {
2679 /*SPR 2512*/
2680 #ifdef NEW_EDITOR
2681 T_AUI_EDITOR_DATA editor_data;
2682 #else /* NEW_EDITOR */
2683 T_EDITOR_DATA editor_data;
2684 #endif /* NEW_EDITOR */
2685 /*SPR 2512, end*/
2686 switch(type)
2687 {
2688 case IdleNewCBImmediateMessage:
2689 if(cbch_string NEQ NULL)
2690 {
2691 /* SPR#1428 - SH - New Editor changes */
2692 #ifdef NEW_EDITOR
2693 if (!idle_data.editor)
2694 {
2695 idle_data.editor = ATB_edit_Create (&idle_data.editor_attr2,0);
2696 }
2697 #else /* NEW_EDITOR */
2698 if (!idle_data.edt)
2699 {
2700 idle_data.edt = edtCreate (idle_data.win,&idle_data.edt_attr2,0,0);
2701 }
2702 #endif /* NEW_EDITOR */
2703 memset(idle_data.incoming_cb_msg, '\0',MAX_CBMSG_LEN);
2704 strcpy((char *)idle_data.incoming_cb_msg, (char *)cbch_string);
2705
2706 //Jun 24, 2005 MMI-FIX-30973 x0018858
2707 // Copy the tag string on to a global variable for display later.
2708 //Begin 30973
2709 memset(tag_zone, '\0',MAX_CBMSG_LEN);
2710 strcpy((char *)tag_zone, (char *)idle_data.incoming_cb_msg);
2711 tag_zone[MAX_CBMSG_LEN -1]= '\0';
2712 //End 30973
2713 //this is centralize the cb message if it's a short one
2714 //12 cos CB messages have some space character after the string
2715 //it is just a estimate
2716 /* SPR#1428 - SH - New Editor changes. Use centralise
2717 * editor feature. */
2718 #ifdef NEW_EDITOR
2719 if ((strlen(cbch_string)) < 12)
2720 idle_data.editor_attr2.startFormat.attr |= DS_ALIGN_CENTRE;
2721 ATB_edit_Init(idle_data.editor);
2722 #else /* NEW_EDITOR */
2723 if ((strlen(cbch_string)) < 12)
2724 idle_data.edt_attr2.win.px = WIN_CENTRALIZE_ORG_X;
2725 else
2726 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
2727 #endif /*NEW_EDITOR*/
2728 }
2729 else
2730 {
2731 /* SPR#1428 - SH - New Editor changes */
2732 #ifdef NEW_EDITOR
2733 if (idle_data.editor)
2734 {
2735 ATB_edit_Destroy(idle_data.editor);
2736 }
2737
2738 idle_data.editor_attr2.startFormat.attr = 0;
2739
2740 idle_data.editor = 0;
2741 #else /* NEW_EDITOR */
2742 if (idle_data.edt)
2743 {
2744 edtDelete(idle_data.edt);
2745 }
2746
2747 //set the centralize for the cb message to default
2748 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
2749
2750 idle_data.edt = 0;
2751 #endif /*NEW_EDITOR */
2752 memset(idle_data.incoming_cb_msg, '\0',MAX_CBMSG_LEN);
2753 }
2754 break;
2755
2756 case IdleNewCBNormalMessage:
2757
2758 //set back to default
2759 idle_data.clean_screen = FALSE;
2760
2761 idle_data.new_cbch = TRUE;
2762 break;
2763
2764 /*NM p019*/
2765 case IdleNewSmsMessage:
2766 /*SPR 2512, show class 0 message as a pop-up*/
2767 #ifdef NEW_EDITOR
2768 AUI_edit_SetDefault(&editor_data);
2769 AUI_edit_SetDisplay(&editor_data, ZONE_FULLSOFTKEYS, COLOUR_EDITOR_XX, EDITOR_FONT);
2770 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)cbch_string, strlen(cbch_string));
2771 AUI_edit_SetMode(&editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
2772 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtNull, TxtNull, NULL);
2773 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)class0_editor_cb);
2774 /*this casting of the message buffer allows it to be passed back via the editor callback function
2775 so we can free the memory when it's no longer needed. Yes, I know it's dodgy.*/
2776 AUI_edit_Start((T_MFW_HND)cbch_string, &editor_data);
2777
2778 #else
2779 editor_data.editor_attr.win.px = 0;
2780 editor_data.editor_attr.win.py = 0;
2781 editor_data.editor_attr.win.sx =
2782 SCREEN_SIZE_X-editor_data.editor_attr.win.px;
2783 editor_data.editor_attr.win.sy = SCREEN_SIZE_Y-2*Mmi_layout_first_line();
2784 editor_data.editor_attr.edtCol = COLOUR_EDITOR_XX,
2785 editor_data.editor_attr.font = 0;
2786 editor_data.editor_attr.mode = edtCurNone;
2787 editor_data.editor_attr.controls = 0;
2788 editor_data.hide = FALSE;
2789
2790 editor_data.editor_attr.text = (char*)cbch_string;
2791
2792 editor_data.editor_attr.size = strlen(cbch_string);
2793 editor_data.LeftSoftKey = TxtSoftOK;
2794 editor_data.RightSoftKey = TxtNull;
2795 editor_data.AlternateLeftSoftKey = TxtNull;
2796 editor_data.TextString = '\0';
2797 editor_data.TextId = TxtNull;
2798 editor_data.Identifier = NULL;
2799 editor_data.mode = READ_ONLY_MODE;
2800 editor_data.timeout = FOREVER;
2801 editor_data.min_enter = 1;
2802 editor_data.Callback = (T_EDIT_CB)NULL;
2803 editor_data.destroyEditor = TRUE;
2804 editor_start(idle_get_window(), &editor_data);
2805
2806 #endif
2807 break;
2808
2809 }
2810
2811
2812 }
2813
2814 /*******************************************************************************
2815
2816 $Function: statusCBCH
2817
2818 $Description: if True -> keep it on the idle screen
2819 if FALSE -> remove the message (CB or SMS)
2820 and destroy the editor
2821
2822 $Returns:
2823
2824 $Arguments:
2825
2826 *******************************************************************************/
2827
2828 void statusCBCH(UBYTE status)
2829 {
2830 if(status)
2831 {
2832
2833 windowsUpdate();
2834
2835 }
2836 else
2837 {
2838
2839 //Dont show the CB on the Idle screen
2840
2841 idle_data.new_cbch = FALSE;
2842 /* SPR#1428 - SH - New Editor changes */
2843 #ifdef NEW_EDITOR
2844 if (idle_data.editor)
2845 ATB_edit_Destroy(idle_data.editor);
2846 idle_data.editor = 0;
2847
2848 //set the centralize for the cb message to default
2849 idle_data.editor_attr2.startFormat.attr = 0;
2850
2851 #else /* NEW_EDITOR */
2852 if (idle_data.edt)
2853 edtDelete(idle_data.edt);
2854 idle_data.edt = 0;
2855
2856 //set the centralize for the cb message to default
2857 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
2858 #endif /*NEW_EDITOR */
2859 }
2860
2861
2862 }
2863
2864
2865 /*******************************************************************************
2866
2867 $Function: addSatMessage
2868
2869 $Description: Store a SAT message to display on the idle screen.
2870 SPR759 - SH.
2871
2872 $Returns:
2873
2874 $Arguments: satMessage - the text of the message
2875
2876 *******************************************************************************/
2877
2878 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
2879 #ifdef FF_MMI_SAT_ICON
2880 void addSatMessage(char *satMessage, UBYTE width, UBYTE height,
2881 char *dst, UBYTE selfExplanatory, T_DISPLAY_TYPE display_type)
2882 #else
2883 void addSatMessage(char *satMessage)
2884 #endif
2885 {
2886 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
2887 #ifdef FF_MMI_SAT_ICON
2888 USHORT icon_length;
2889 #endif
2890
2891 /* SPR#1428 - SH - New Editor changes */
2892 #ifdef NEW_EDITOR
2893 if(satMessage NEQ NULL)
2894 {
2895 if(!idle_data.editor_sat)
2896 {
2897 idle_data.editor_sat = ATB_edit_Create(&idle_data.editor_attr_sat,0); /* Create the editor to hold it */
2898 }
2899
2900 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
2901 #ifdef FF_MMI_SAT_ICON
2902 if(selfExplanatory == FALSE)
2903 {
2904 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
2905 strcpy((char *)idle_data.incoming_sat_msg, (char *)satMessage);
2906
2907 /* Centralize sat message if below 12 characters (so it doesn't look odd on the screen) */
2908
2909 if ((strlen(satMessage)) < 12)
2910 idle_data.editor_attr_sat.startFormat.attr |= DS_ALIGN_CENTRE;
2911 }
2912 else
2913 {
2914 /* Icon is self-explanatory. No need to display text for this case.
2915 Fill the idle text buffer with NULL*/
2916 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
2917 }
2918
2919 /* Copy the data to the Editor title field & ATB editor will
2920 take care of displaying the Icon */
2921 if(dst != NULL)
2922 {
2923 idle_data.editor_sat->attr->TitleIcon.width = width;
2924 idle_data.editor_sat->attr->TitleIcon.height = height;
2925
2926 icon_length = width * height;
2927
2928 idle_data.editor_sat->attr->TitleIcon.data = (char *)ALLOC_MEMORY (icon_length);
2929
2930 memcpy(idle_data.editor_sat->attr->TitleIcon.data, dst, icon_length);
2931 idle_data.editor_sat->attr->TitleIcon.display_type = display_type; //x0035544 02-Feb-2006 DR:61468
2932 idle_data.editor_sat->attr->TitleIcon.isTitle = FALSE;
2933
2934 }
2935 #else
2936 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
2937 strcpy((char *)idle_data.incoming_sat_msg, (char *)satMessage);
2938
2939 /* Centralize sat message if below 12 characters (so it doesn't look odd on the screen) */
2940
2941 if ((strlen(satMessage)) < 12)
2942 idle_data.editor_attr_sat.startFormat.attr |= DS_ALIGN_CENTRE;
2943
2944 #endif
2945
2946 ATB_edit_Init(idle_data.editor_sat);
2947
2948 }
2949 else /* If a null string is passed, get rid of the message */
2950 {
2951 if (idle_data.editor_sat)
2952 {
2953 // 02-Feb-2006, Sudha.V., x0035544
2954 #ifdef FF_MMI_SAT_ICON
2955 /* Check if a Idle mode text malloc was done for icon support, if Yes, free it*/
2956 if (idle_data.editor_sat->attr->TitleIcon.data != NULL)
2957 {
2958 FREE_MEMORY((U8 *)idle_data.editor_sat->attr->TitleIcon.data, idle_data.editor_sat->attr->TitleIcon.width *
2959 idle_data.editor_sat->attr->TitleIcon.height);
2960 idle_data.editor_sat->attr->TitleIcon.data = NULL;
2961 }
2962 #endif
2963 ATB_edit_Destroy(idle_data.editor_sat);
2964 }
2965
2966 //set the centralize for the cb message to default
2967 idle_data.editor_attr_sat.startFormat.attr = 0;
2968
2969 idle_data.editor_sat = NULL;
2970 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
2971 }
2972 #else /* NEW_EDITOR */
2973 if(satMessage NEQ NULL)
2974 {
2975 if(!idle_data.edt_sat)
2976 {
2977 idle_data.edt_sat = edtCreate(idle_data.win,&idle_data.edt_attr_sat,0,0); // Create the editor to hold it
2978 }
2979 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
2980 strcpy((char *)idle_data.incoming_sat_msg, (char *)satMessage);
2981
2982 //Centralize sat message if below 12 characters (so it doesn't look odd on the screen)
2983
2984 if ((strlen(satMessage)) < 12)
2985 idle_data.edt_attr_sat.win.px = (SCREEN_SIZE_X-strlen(idle_data.edt_attr_sat.text)*6)/2;
2986 else
2987 idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
2988 }
2989 else // If a null string is passed, get rid of the message
2990 {
2991 if (idle_data.edt_sat)
2992 {
2993 edtDelete(idle_data.edt_sat);
2994 }
2995
2996 //set the centralize for the cb message to default
2997 idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
2998
2999 idle_data.edt_sat = NULL;
3000 memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
3001 }
3002 #endif /* NEW_EDITOR */
3003 return;
3004 }
3005
3006 /*******************************************************************************
3007
3008 $Function: idleDialBuffer
3009
3010 $Description:
3011
3012 $Returns:
3013
3014 $Arguments:
3015
3016 *******************************************************************************/
3017
3018
3019 void idleDialBuffer(char* dialBuffer)
3020 {
3021 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
3022 strncpy((char*)idle_data.edt_buf,(char*)dialBuffer,sizeof(idle_data.edt_buf)-1);
3023 idle_dialling_start(idle_data.win,NULL);
3024 }
3025
3026
3027 /*******************************************************************************
3028
3029 $Function: windowsUpdate
3030
3031 $Description:
3032
3033 $Returns:
3034
3035 $Arguments:
3036
3037 *******************************************************************************/
3038
3039
3040 void windowsUpdate(void)
3041 {
3042 TRACE_FUNCTION("Idle_update()");
3043 winShow(idle_data.win);
3044
3045
3046 }
3047
3048
3049
3050 /*******************************************************************************
3051
3052 $Function: idle_dialling_create
3053
3054 $Description:
3055
3056 $Returns:
3057
3058 $Arguments:
3059
3060 *******************************************************************************/
3061
3062
3063 T_MFW_HND idle_dialling_create (T_MFW_HND parent_window)
3064 {
3065 T_MFW_WIN * win;
3066
3067 /*
3068 * This window is dynamic, for that reason the associated data are allocated in the mfw heap
3069 */
3070
3071 T_idle_dialling * data = (T_idle_dialling *)ALLOC_MEMORY (sizeof (T_idle_dialling));
3072
3073 TRACE_FUNCTION ("idle_dialling_create");
3074
3075 /*
3076 * Create window handler
3077 */
3078
3079 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_dialling_win_cb);
3080
3081 if (data->win EQ 0)
3082 return 0;
3083
3084 /*
3085 * These assignments are necessary to attach the data to the window, and to handle the mmi event communication.
3086 */
3087
3088 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_dialling;
3089 data->mmi_control.data = data;
3090 win = ((T_MFW_HDR *)data->win)->data;
3091 win->user = (void *) data;
3092
3093 /*
3094 * Create any other handler
3095 */
3096 /* SPR#1428 - SH - New Editor changes */
3097 #ifdef NEW_EDITOR
3098 data->editor = ATB_edit_Create(&idle_data.editor_attr, 0);
3099 #else /* NEW_EDITOR */
3100 data->edt = edtCreate (data->win,&idle_data.edt_attr,0,0);
3101 #endif /* NEW_EDITOR */
3102 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_dialling_kbd_cb);
3103 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_dialling_kbd_long_cb);
3104
3105
3106 //winShow(data->win);
3107 /*
3108 * return window handle
3109 */
3110 return data->win;
3111 }
3112
3113
3114
3115 /*******************************************************************************
3116
3117 $Function: idle_dialling_destroy
3118
3119 $Description:
3120
3121 $Returns:
3122
3123 $Arguments:
3124
3125 *******************************************************************************/
3126
3127
3128
3129 void idle_dialling_destroy (T_MFW_HND own_window)
3130 {
3131 T_MFW_WIN * win;
3132 T_idle_dialling * data;
3133
3134 TRACE_FUNCTION("idle_dialling_destroy");
3135
3136 /*SPR 2500*/
3137 win = ((T_MFW_HDR *)own_window)->data;
3138 data = (T_idle_dialling *)win->user;
3139
3140 #ifdef NEPTUNE_BOARD
3141 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf)); /* OMAPS00033660 */
3142 #endif
3143
3144 if ((own_window) &&
3145 (win) &&
3146 (data))
3147 {
3148
3149 /*
3150 * Exit Keyboard Handler
3151 */
3152 /*NM, 26.3.02*/
3153 /* SPR#1428 - SH - New Editor changes */
3154 #ifdef NEW_EDITOR
3155 ATB_edit_Destroy(data->editor);
3156 #else/* NEW_EDITOR */
3157 edt_delete(data->edt);
3158 #endif /* NEW_EDITOR */
3159 kbd_delete(data->kbd);
3160 kbd_delete(data->kbd_long);
3161 /*
3162 * Delete WIN Handler
3163 */
3164 win_delete (data->win);
3165
3166 /*
3167 * In this case the data attached to window must be also deleted.
3168 */
3169 FREE_MEMORY ((void *)data, sizeof (T_idle_dialling));
3170 }
3171 else
3172 {/*SPR2500*/
3173 TRACE_ERROR("idle_dialling_destory : Invalid pointer");
3174 }
3175
3176 }
3177
3178
3179 /*******************************************************************************
3180
3181 $Function: idle_dialling_start
3182
3183 $Description: This function just creates and inits the new dialog
3184
3185 $Returns:
3186
3187 $Arguments:
3188
3189 *******************************************************************************/
3190
3191
3192
3193
3194 T_MFW_HND idle_dialling_start (T_MFW_HND win_parent,char *character)
3195 {
3196
3197
3198 T_MFW_HND win = idle_dialling_create (win_parent);
3199
3200 TRACE_FUNCTION("idle_dialling_start");
3201
3202 if (win NEQ NULL)
3203 {
3204 SEND_EVENT(win,IDLE_DIALLING_INIT,0,(char*)character);
3205 }
3206 return win;
3207
3208 }
3209
3210
3211
3212 /*******************************************************************************
3213
3214 $Function: idle_dialling
3215
3216 $Description:
3217
3218 $Returns:
3219
3220 $Arguments:
3221
3222 *******************************************************************************/
3223
3224
3225
3226 void idle_dialling (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
3227 {
3228 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
3229 T_idle_dialling * data = (T_idle_dialling *)win_data->user;
3230
3231 TRACE_FUNCTION ("idle_dialling()");
3232 /*
3233 * In this case the communication is very simple (only one intern event)
3234 */
3235
3236 //GW Use macros for screen size
3237 switch (event)
3238 {
3239 case IDLE_DIALLING_INIT:
3240 /* SPR#1428 - SH - New Editor changes */
3241 #ifdef NEW_EDITOR
3242 AUI_edit_SetAttr(&idle_data.editor_attr, WIN_DIALLING, COLOUR_EDITOR_XX, EDITOR_FONT, 0, ED_CURSOR_UNDERLINE, ATB_DCS_ASCII, (UBYTE*)idle_data.edt_buf,EDITOR_SIZE);
3243
3244 ATB_edit_Init(data->editor);
3245
3246 ATB_edit_Unhide(data->editor);
3247 ATB_edit_Char(data->editor, ctrlBottom, TRUE);
3248 #else /* NEW_EDITOR */
3249 bookSetEditAttributes(WIN_DIALLING,COLOUR_EDITOR_XX,0,edtCurBar1,0,(char*)idle_data.edt_buf,EDITOR_SIZE,&idle_data.edt_attr);
3250
3251 /* NM 13.03 fast-edit */
3252 editActivate (data->edt,FALSE);
3253
3254 edtUnhide(data->edt);
3255 edtChar(data->edt,ecBottom);
3256 #endif /* NEW_EDITOR */
3257 winShow(data->win);
3258 break;
3259 default:
3260 return;
3261 }
3262
3263 }
3264
3265
3266
3267 /*******************************************************************************
3268
3269 $Function: idle_dialling_win_cb
3270
3271 $Description:
3272
3273 $Returns:
3274
3275 $Arguments:
3276
3277 *******************************************************************************/
3278
3279
3280 static int idle_dialling_win_cb (MfwEvt evt, MfwWin *win)
3281 {
3282 T_idle_dialling * data = (T_idle_dialling *)win->user;
3283
3284 TRACE_FUNCTION ("idle_dialling_win_cb()");
3285 switch (evt)
3286 {
3287 case MfwWinVisible:
3288 /* SPR#1428 - SH - New Editor changes */
3289 #ifdef NEW_EDITOR
3290 /* If update is trivial, don't update what's underneath */
3291 if (data->editor->update!=ED_UPDATE_TRIVIAL)
3292 {
3293 idle_draw_main_idle();
3294 displaySoftKeys(TxtNames,TxtDelete);
3295 }
3296 ATB_edit_Show(data->editor);
3297
3298 data->editor->update = ED_UPDATE_DEFAULT;
3299 #else /* NEW_EDITOR */
3300 idle_draw_main_idle();
3301 edtShow(data->edt);
3302 displaySoftKeys(TxtNames,TxtDelete);
3303 #endif /* NEW_EDITOR */
3304 break;
3305 default:
3306 return 0;
3307 }
3308
3309 return 1;
3310 }
3311
3312 #ifdef MMI_EM_ENABLED
3313 /*******************************************************************************
3314
3315 $Function: screen_capture_dialog_cb
3316
3317 $Description: Call back for the screen capture key assignment dialog
3318 xrashmic 22 Aug, 2004 MMI-SPR-32798
3319
3320 $Returns:
3321
3322 $Arguments:
3323
3324 *******************************************************************************/
3325 static void screen_capture_dialog_cb( T_MFW_HND win, USHORT Identifier,UBYTE reason)
3326 {
3327 switch(reason)
3328 {
3329 case INFO_KCD_LEFT:
3330 screenCaptureKey=KCD_LEFT;
3331 break;
3332 case INFO_KCD_RIGHT:
3333 screenCaptureKey=KCD_RIGHT;
3334 break;
3335 case INFO_KCD_HUP:
3336 screenCaptureKey=KCD_HUP;
3337 break;
3338 case INFO_KCD_UP:
3339 dialog_info_destroy (screen_capture_win);
3340 screenCaptureKey=KCD_MNUUP;
3341 break;
3342 case INFO_KCD_DOWN:
3343 dialog_info_destroy (screen_capture_win);
3344 screenCaptureKey=KCD_MNUDOWN;
3345 break;
3346 case INFO_KCD_OFFHOOK:
3347 screenCaptureKey=KCD_CALL;
3348 break;
3349 case INFO_KCD_ALL:
3350 screenCaptureKey=Identifier;
3351 break;
3352 default:
3353 screenCaptureKey=KCD_NONE;
3354 }
3355
3356 }
3357
3358 /*******************************************************************************
3359
3360 $Function: screen_capture_dialog
3361
3362 $Description: Dialog to set a key for screen capture
3363 xrashmic 22 Aug, 2004 MMI-SPR-32798
3364
3365
3366 $Returns:
3367
3368 $Arguments:
3369
3370 *******************************************************************************/
3371
3372 void screen_capture_dialog(void)
3373 {
3374 T_DISPLAY_DATA display_info;
3375 T_MFW_HND parent_win = mfwParent(mfw_header());
3376
3377 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull, TxtNull, COLOUR_WAP_POPUP);
3378 display_info.TextString="Press a key";
3379 display_info.TextString2="For screen capture";
3380 dlg_initDisplayData_events( &display_info,(T_VOID_FUNC)screen_capture_dialog_cb, FOREVER,KEY_ALL );
3381 display_info.Identifier = 0;
3382 screen_capture_win=info_dialog(parent_win, &display_info);
3383 dspl_Enable(0);
3384 win_show(screen_capture_win);
3385 dspl_Enable(1);
3386 }
3387 #endif
3388
3389 /*******************************************************************************
3390
3391 $Function: idle_dialling_kbd_cb
3392
3393 $Description:
3394
3395 $Returns:
3396
3397 $Arguments:
3398
3399 *******************************************************************************/
3400
3401
3402 static int idle_dialling_kbd_cb (MfwEvt e, MfwKbd *k)
3403 {
3404 /*
3405 * The following lines describe the common method to extract the data from the window. This mfw_parent(mfw_header())
3406 * construction captures the current mfw handled window.
3407 */
3408 T_MFW_HND win = mfw_parent (mfw_header());
3409 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
3410 T_idle_dialling *data = (T_idle_dialling *)win_data->user;
3411 T_MFW_SS_RETURN ssRes;
3412 // T_MFW_PHB_ENTRY p_pEntry; // RAVI
3413 tMmiPhbData *current = (tMmiPhbData *)ALLOC_MEMORY (sizeof (tMmiPhbData ));
3414 U8 finishedHere = FALSE; /* SH- used to skip out part of function */
3415 int position = 0;
3416 char edt_buf_prov[EDITOR_SIZE];
3417 /* try to establish if we have information in the phone book
3418 */
3419
3420 TRACE_FUNCTION ("idle_dialling_kbd_cb()");
3421
3422 /* SPR#1428 - SH - New Editor changes - By default, set this flag
3423 * so that only editor portion of idle screen is updated when a key is pressed. */
3424 #ifdef NEW_EDITOR
3425 data->editor->update = ED_UPDATE_TRIVIAL;
3426 #endif
3427
3428 switch (k->code)
3429 {
3430 case KCD_MNURIGHT:
3431 case KCD_MNUUP:
3432 /* SPR#1428 - SH - New Editor changes */
3433 #ifdef NEW_EDITOR
3434 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE);
3435 win_show(data->win);
3436 #else /* NEW_EDITOR */
3437 edtChar(data->edt,ecRight);
3438 #endif /* NEW_EDITOR */
3439 break;
3440
3441 case KCD_MNULEFT:
3442 case KCD_MNUDOWN:
3443 /* SPR#1428 - SH - New Editor changes */
3444 #ifdef NEW_EDITOR
3445 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE);
3446 win_show(data->win);
3447 #else /* NEW_EDITOR */
3448 edtChar(data->edt,ecLeft);
3449 #endif /* NEW_EDITOR */
3450 break;
3451
3452 case KCD_CALL:
3453 #ifdef JVJ_USSD_TEST
3454 {
3455 T_MFW_SS_USSD prov_ussd;
3456
3457 prov_ussd.len = strlen((char*)idle_data.edt_buf);
3458 memcpy(prov_ussd.ussd,(char*)idle_data.edt_buf,prov_ussd.len);
3459 prov_ussd.dcs = MFW_DCS_7bits;
3460 ss_send_ussd(&prov_ussd);
3461 }
3462 #else
3463 callNumber((UBYTE*)idle_data.edt_buf);
3464 #endif
3465 idle_dialling_destroy(data->win);
3466 break;
3467
3468 case KCD_LEFT: /* call establishment */
3469 /* Ensure next update is a full update */
3470 #ifdef NEW_EDITOR
3471 data->editor->update = ED_UPDATE_DEFAULT;
3472 #endif
3473 if (bookPhoneBookLoading()==BOOK_SUCCESS)
3474 {
3475 T_MFW_HND phbk_win;
3476 phbk_win = bookPhonebookStart(idle_data.win,PhbkNameEnterIdle);
3477 SEND_EVENT( phbk_win, PHBK_SEND_NUMBER, 0,(char*)idle_data.edt_buf );
3478 }
3479 break;
3480
3481 case KCD_RIGHT:
3482 /* SPR#1428 - SH - New Editor changes */
3483 #ifdef NEW_EDITOR
3484 ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */
3485 win_show(data->win);
3486 #else /* NEW_EDITOR */
3487 edtChar(data->edt,ecBack);
3488 #endif /* NEW_EDITOR */
3489
3490 if (strlen(idle_data.edt_buf) <= 0)
3491 idle_dialling_destroy(data->win);
3492 break;
3493
3494 /* SPR#2342 - SH - HUP detroys editor */
3495 case KCD_HUP:
3496 idle_dialling_destroy(data->win);
3497
3498 break;
3499
3500 case KCD_0:
3501 case KCD_1:
3502 case KCD_2:
3503 case KCD_3:
3504 case KCD_4:
3505 case KCD_5:
3506 case KCD_6:
3507 case KCD_7:
3508 case KCD_8:
3509 case KCD_9:
3510 case KCD_STAR:
3511 /* SPR#1428 - SH - New Editor changes */
3512 #ifdef NEW_EDITOR
3513 ATB_edit_AsciiChar(data->editor, editControls[k->code], TRUE);
3514 win_show(data->win);
3515 #else /* NEW_EDITOR */
3516 edtChar(data->edt, editControls[k->code]);
3517 #endif /* NEW_EDITOR */
3518 break;
3519
3520 case KCD_HASH:
3521 /* SPR#1428 - SH - New Editor changes */
3522 #ifdef NEW_EDITOR
3523 ATB_edit_AsciiChar(data->editor, editControls[k->code], TRUE);
3524 win_show(data->win);
3525 #else /* NEW_EDITOR */
3526 edtChar(data->edt, editControls[k->code]);
3527 #endif /* NEW_EDITOR */
3528 memset(edt_buf_prov,'\0',sizeof(edt_buf_prov));
3529 strcpy((char*)edt_buf_prov,(char*)idle_data.edt_buf);
3530
3531 if(strcmp((char*)idle_data.edt_buf, "###520#") == 0)
3532 {
3533 ShowVersion(idle_data.win);
3534 idle_dialling_destroy(data->win);
3535 finishedHere = TRUE; /*sbh*/
3536
3537 }
3538 #ifdef MMI_EM_ENABLED
3539 //xrashmic 22 Aug, 2004 MMI-SPR-32798
3540 //Using a dialog to take the input from the user for key to be used for screen capture.
3541 else if(strcmp((char*)idle_data.edt_buf, "###1234#") == 0)
3542 {
3543 screen_capture_dialog();
3544 idle_dialling_destroy(data->win);
3545 }
3546 else
3547 { /*MC, SPR1209 check for engineering mode code*/
3548 if (strcmp((char*)idle_data.edt_buf, "*36446337464#") == 0)
3549 {
3550 TRACE_EVENT("Engineering mode string");
3551 /*create menu*/
3552 mmi_em_start_eng_mode_menus(idle_data.win);
3553 idle_dialling_destroy(data->win);
3554 finishedHere = TRUE;
3555 }
3556 #endif
3557 else
3558 {
3559 ssRes = ss_check_ss_string((UBYTE*)edt_buf_prov);
3560 switch (ssRes)
3561 {
3562 case MFW_SS_USSD:
3563 case MFW_SS_SIM_LOCK:
3564 case MFW_SS_REG_PW:
3565 case MFW_SS_CF:
3566 case MFW_SS_CB:
3567 case MFW_SS_CLIR:
3568 case MFW_SS_CLIP:
3569 case MFW_SS_COLR:
3570 case MFW_SS_COLP:
3571 case MFW_SS_WAIT:
3572 case MFW_SS_HOLD:
3573 case MFW_SS_CCBS:
3574 finishedHere = TRUE; /* Handled on # */
3575 break;
3576 case MFW_SS_SIM_REG_PW:
3577 case MFW_SS_SIM_UNBLCK_PIN:
3578 gsm_idle(0,(char *)idle_data.edt_buf);
3579 idle_dialling_destroy(data->win);
3580 finishedHere = TRUE; /* Handled on # */
3581 break;
3582 case MFW_SS_MMI:
3583 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
3584 // guarding the code with the flag
3585 #ifndef FF_MMI_ATC_MIGRATION
3586 get_imei((char*)idle_data.imei);
3587 showIMEI(idle_data.win,(char*)idle_data.imei);
3588 #endif
3589 idle_dialling_destroy(data->win);
3590 finishedHere = TRUE; /* Handled on # */
3591 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
3592 // replaced the get_imei() with the mmi_imei_retrieve() - sAT_Dn()
3593 #ifdef FF_MMI_ATC_MIGRATION
3594 mmi_imei_retrieve();
3595 #endif
3596 break;
3597 /*MC, SPR 1111 handle language reset*/
3598 case MFW_SS_LANG_RESET:
3599 /*if language has been reset*/
3600 if (resources_reset_language((char*) idle_data.edt_buf) == TRUE)
3601 {
3602 bookShowInformation(idle_data.win,TxtDone,NULL,NULL);
3603 }
3604 else /*if current language English, don't show second Line in English*/
3605 {T_DISPLAY_DATA display_info;
3606
3607 /*SPR 1619, use new info dialog configuration functions*/
3608 if (Mmi_getCurrentLanguage() == ENGLISH_LANGUAGE)
3609 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, MmiRsrcGetText(TxtUnknownCode), NULL, COLOUR_POPUP);
3610 else
3611 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, MmiRsrcGetText(TxtUnknownCode), "Code Unknown", COLOUR_POPUP);
3612 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, SIX_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
3613 /* Call Info Screen
3614 */
3615 info_dialog( idle_data.win, &display_info );
3616 }
3617 /*MC end*/
3618 idle_dialling_destroy(data->win);
3619 finishedHere = TRUE;
3620 break;
3621
3622 case MFW_SS_DIAL:
3623 case MFW_SS_DIAL_IDX:
3624 case MFW_SS_DTMF:
3625 case MFW_SS_UNKNOWN:
3626 default:
3627 /* CQ16651 - NDH - Lines Deleted, Do not delete the entered character */
3628 break;
3629 }
3630 }
3631 #ifdef FF_EM_MODE
3632 }
3633 #endif
3634 /* SH - skip out this section if we recognised SS code */
3635
3636 if (!finishedHere)
3637 {
3638 //nm 450
3639 // this functions looks for shortcut
3640 sscanf(idle_data.edt_buf, "%d", &position);
3641 current->missedCallsOffset = 0;
3642 current->index = position;
3643 current->selectedName = 0;
3644 current->KindOfSearch = SEARCH_BY_LOCATION;
3645 current->status.book = bookActiveBook(READ);
3646 bookGetCurrentStatus( &(current->status) );
3647
3648 if((idle_data.edt_buf[0]!='*')&&(bookFindName( 1, current )== MFW_PHB_OK))
3649 { memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
3650
3651 strncpy((char*)idle_data.edt_buf,(char*)current->entry[0].number,sizeof(idle_data.edt_buf)-1);
3652 /* SPR#1428 - SH - New Editor changes */
3653 #ifdef NEW_EDITOR
3654 ATB_edit_Char(data->editor, ctrlBottom, TRUE);
3655 win_show(data->win);
3656 #else /* NEW_EDITOR */
3657 edtChar(data->edt,ecBottom);
3658 #endif /* NEW_EDITOR */
3659 }
3660 }
3661 break;
3662 default:
3663 break;
3664 }
3665 FREE_MEMORY ((void *)current, sizeof (tMmiPhbData));
3666 return MFW_EVENT_CONSUMED;
3667 }
3668
3669
3670
3671 /*******************************************************************************
3672
3673 $Function: idle_dialling_kbd_long_cb
3674
3675 $Description:
3676
3677 $Returns:
3678
3679 $Arguments:
3680
3681 *******************************************************************************/
3682
3683 static int idle_dialling_kbd_long_cb (MfwEvt e, MfwKbd *k)
3684 {
3685 T_MFW_HND win = mfw_parent (mfw_header());
3686 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
3687 T_idle_dialling * data = (T_idle_dialling *)win_data->user;
3688
3689 TRACE_FUNCTION ("idle_dialling_kbd_long_cb");
3690
3691 if (e & KEY_LONG)
3692 {
3693 /* SPR#1428 - SH - New Editor - Long right soft keypress clears buffer */
3694 #ifdef NEW_EDITOR
3695 if ((e & KEY_RIGHT) || (e & KEY_CLEAR))
3696 #else /* NEW_EDITOR */
3697 if (e & KEY_CLEAR)
3698 #endif /* NEW_EDITOR */
3699 {
3700 idle_dialling_destroy(data->win);
3701 return MFW_EVENT_CONSUMED;
3702 }
3703 if (e & KEY_0)
3704 {
3705 /* SPR#1428 - SH - New Editor changes */
3706 #ifdef NEW_EDITOR
3707 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */
3708 ATB_edit_AsciiChar(data->editor, '+', TRUE);
3709 win_show(data->win);
3710 #else /* NEW_EDITOR */
3711 edtChar(data->edt,ecBack);
3712 edtChar(data->edt,'+');
3713 #endif /* NEW_EDITOR */
3714
3715 return MFW_EVENT_CONSUMED;
3716 }
3717 if (e & KEY_1)
3718 {
3719 //long press on key 1 start to dial the voicemail
3720 M_callVoice(NULL, NULL);
3721 return MFW_EVENT_CONSUMED;
3722 }
3723 /* MZ cq11414 support for Pause seperator for DTMF strings. */
3724 if(e & KEY_STAR)
3725 {
3726 #ifdef NEW_EDITOR
3727 ATB_edit_DeleteLeft(data->editor, FALSE);
3728
3729 //Sep 2, 2004 REF: CRR 21370 xkundadu
3730 // Changed the long press of '*' to display 'w'.
3731
3732 ATB_edit_AsciiChar(data->editor, 'w', TRUE);
3733 win_show(data->win);
3734 #else /* NEW_EDITOR */
3735 /* MZ cq11414 add Pause Character */
3736 MfwEdt *edit = ((MfwHdr*) data->edt)->data;
3737 if((edit->cp) > 0) && (edit->attr->text[edit->cp-1] == '*'))
3738 {
3739 edtChar(data->edt,ecBack);
3740 }
3741
3742 //Sep 2, 2004 REF: CRR 21370 xkundadu
3743 //Changed the long press of '*' key to display 'w'.
3744 edtChar(data->edt,'w');
3745
3746 #endif /* NEW_EDITOR */
3747 return MFW_EVENT_CONSUMED;
3748 }
3749 if (e & KEY_HASH)
3750 {
3751 /* SPR#1428 - SH - New Editor changes */
3752 #ifdef NEW_EDITOR
3753 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */
3754
3755 //Sep 2, 2004 REF: CRR 21370 xkundadu
3756 // Changed the long press of '#' key to display 'p'.
3757 ATB_edit_AsciiChar(data->editor, 'p', TRUE);
3758 win_show(data->win);
3759 #else /* NEW_EDITOR */
3760 /* MZ cq11414 add Wait Character */
3761 MfwEdt *edit = ((MfwHdr*) data->edt)->data;
3762 if((edit->cp) > 0) && (edit->attr->text[edit->cp-1] == '#'))
3763 {
3764 edtChar(data->edt,ecBack);
3765 }
3766
3767 //Sep 2, 2004 REF: CRR 21370 xkundadu
3768 // Changed the long press of '#' to display 'p'.
3769
3770 edtChar(data->edt,'p');
3771
3772 #endif /* NEW_EDITOR */
3773 return MFW_EVENT_CONSUMED;
3774 }
3775 }
3776 return MFW_EVENT_CONSUMED;
3777 }
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789 /*********************************************************************
3790 **********************************************************************
3791
3792 KEYPAD LOCKED EVENT WINDOW. IMPLEMENTATION
3793
3794 *********************************************************************
3795 **********************************************************************/
3796
3797
3798 /*******************************************************************************
3799
3800 $Function: idle_key_pad_locked_create
3801
3802 $Description:
3803
3804 $Returns:
3805
3806 $Arguments:
3807
3808 *******************************************************************************/
3809
3810
3811
3812 T_MFW_HND idle_key_pad_locked_create(MfwHnd parent_window){
3813
3814 T_MFW_WIN * win;
3815 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)ALLOC_MEMORY (sizeof (T_idle_key_pad_locked));
3816
3817 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_key_pad_locked_win_cb);
3818
3819 if (data->win EQ 0)
3820 return 0;
3821
3822 /*
3823 * Create window handler
3824 */
3825 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_key_pad_locked;
3826 data->mmi_control.data = data;
3827 win = ((T_MFW_HDR *)data->win)->data;
3828 win->user = (void *) data;
3829 /*
3830 * Create any other handler
3831 */
3832
3833
3834
3835 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_key_pad_locked_kbd_cb);
3836 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_key_pad_locked_kbd_long_cb);
3837 /* SPR#1428 - SH - New Editor changes */
3838 #ifdef NEW_EDITOR
3839 AUI_edit_SetAttr(&idle_data.editor_attr, WIN_DIALLING, COLOUR_EDITOR_XX, EDITOR_FONT, 0, ED_CURSOR_UNDERLINE, ATB_DCS_ASCII, (UBYTE*)idle_data.edt_buf,EDITOR_SIZE);
3840 memset (idle_data.edt_buf,'\0',EDITOR_SIZE);
3841 data->editor = ATB_edit_Create(&idle_data.editor_attr,0);
3842 ATB_edit_Init(data->editor);
3843 #else /* NEW_EDITOR */
3844 data->edt = edtCreate(data->win,&idle_data.edt_attr,0,0);
3845 #endif /* NEW_EDITOR */
3846
3847 data->win_info = 0;
3848
3849 data->menuPressed = FALSE;
3850
3851 /*
3852 * return window handle
3853 */
3854 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
3855 /* SPR#1428 - SH - New Editor changes */
3856 #ifdef NEW_EDITOR
3857 ATB_edit_Reset(data->editor);
3858 #else /* NEW_EDITOR */
3859 edtReset(data->edt);
3860 #endif /* NEW_EDITOR */
3861 showKeyPadLocked = showNothing;
3862 winShow(data->win);
3863 return data->win;
3864 }
3865
3866
3867 /*******************************************************************************
3868
3869 $Function: idle_key_pad_locked_destroy
3870
3871 $Description:
3872
3873 $Returns:
3874
3875 $Arguments:
3876
3877 *******************************************************************************/
3878
3879
3880 void idle_key_pad_locked_destroy (T_MFW_HND own_window)
3881 {
3882 T_MFW_WIN * win;
3883 T_idle_key_pad_locked * data;
3884
3885 if (own_window)
3886 {
3887 win = ((T_MFW_HDR *)own_window)->data;
3888 data = (T_idle_key_pad_locked *)win->user;
3889
3890 if (data)
3891 {
3892 /*
3893 * Exit Keyboard Handler
3894 */
3895 /*
3896 * Delete WIN Handler
3897 */
3898 win_delete (data->win);
3899 }
3900 FREE_MEMORY ((void *)data, sizeof (T_idle_key_pad_locked));
3901 idle_data.klck_win = NULL;
3902 }
3903 }
3904
3905
3906 /*******************************************************************************
3907
3908 $Function: idle_key_pad_locked
3909
3910 $Description:
3911
3912 $Returns:
3913
3914 $Arguments:
3915
3916 *******************************************************************************/
3917
3918
3919 void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
3920 {
3921 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
3922 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
3923 U8* key_code;
3924 // UBYTE j; // RAVI
3925 // Nov 3, 2004 REF: CRR 25887 xkundadu
3926 //Description: Unable to make an emergency call.
3927 // Added this variable to check whether the entered digit is of length 2.
3928 BOOL bTwodigitECC = FALSE;
3929
3930
3931 TRACE_FUNCTION ("idle_key_pad_locked()");
3932
3933 switch (event)
3934 {
3935 case IDLE_KEYPAD_LOCKED_UPDATE:
3936 key_code = (U8*)parameter;
3937 switch (*key_code)
3938 {
3939
3940 case KCD_RIGHT:
3941 /* API - 10/10/02 - 1162 - Call the emergency Number if this is true
3942 */
3943 if (pin_idle_emerg_call == TRUE)
3944 {
3945 /* SPR#1428 - SH - New Editor changes */
3946 #ifdef NEW_EDITOR
3947 ATB_edit_Hide(data->editor);
3948 #else /* NEW_EDITOR */
3949 edtHide(data->edt);
3950 #endif /* NEW_EDITOR */
3951 callNumber((UBYTE*)idle_data.edt_buf);
3952
3953 /* SPR#1428 - SH - New Editor changes */
3954 #ifdef NEW_EDITOR
3955 ATB_edit_Reset(data->editor);
3956 #else /* NEW_EDITOR */
3957 edtReset(data->edt);
3958 #endif /* NEW_EDITOR */
3959 memset(idle_data.edt_buf,'\0',EDITOR_SIZE); /* sbh */
3960 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
3961 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
3962 showKeyPadLocked = showNothing;
3963 pin_idle_emerg_call = FALSE;
3964 }
3965 else
3966 {
3967 data->menuPressed = TRUE;
3968 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
3969 }
3970 break;
3971 case KCD_STAR:
3972 if (data->menuPressed)
3973 {
3974 TRACE_EVENT ("dactivate the KEYpad");
3975 settingsKeyPadLockOff();
3976 data->menuPressed = FALSE;
3977 idle_key_pad_locked_destroy(win);
3978 return;
3979 }
3980 else
3981 {
3982 /* SPR#1428 - SH - New Editor changes */
3983 #ifdef NEW_EDITOR
3984 ATB_edit_Hide(data->editor);
3985 ATB_edit_Reset(data->editor);
3986 #else /* NEW_EDITOR */
3987 edtHide(data->edt);
3988 edtReset(data->edt);
3989 #endif /* NEW_EDITOR */
3990 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
3991 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
3992 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
3993 showKeyPadLocked = showNothing;
3994 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
3995 }
3996 break;
3997 // Jul 23,2004 CRR:20895 xrashmic - SASKEN
3998 // Description: The keypad should not be unlocked by SEND and *, it
3999 // should be unlocked only by Menu and *
4000 // Fix: SEND key is now handled the same way as rest of the number
4001 // keys. Keypad unlock can be done only through MENU and *.
4002 case KCD_CALL:
4003
4004 case KCD_0:
4005 case KCD_1:
4006 case KCD_2:
4007 case KCD_8:
4008 case KCD_9:
4009 /* API - 10/10/02 - 1162 - Read the Idle KeyPadLock Buffer to see if the inputed valu
4010 is that of an emergency Number
4011 */
4012 data->menuPressed = FALSE;
4013 data->TempkeyPadLockBuf[0] = editControls[*key_code];
4014
4015 strcat((char*)data->keyPadLockBuf, (char*)data->TempkeyPadLockBuf);
4016 TRACE_EVENT_P1("data->keyPadLockBuf: %s",(char*)data->keyPadLockBuf);
4017
4018 if((strlen((char*)data->keyPadLockBuf) > 1) && (strlen((char*)data->keyPadLockBuf) < 4))
4019 {
4020 TRACE_EVENT("cm_check_emergency() TRACE IDLE 1");
4021
4022 // Nov 3, 2004 REF: CRR 25887 xkundadu
4023 //Description: Unable to make an emergency call.
4024 //Fix: Changed the code to make the emergency call when the
4025 // screen is locked.
4026
4027
4028 // Check whether the buffer contains any emergency number or not.
4029 // If the number is ECC then allow the user to make emergency call.
4030
4031 if ((cm_check_emergency((UBYTE*)data->keyPadLockBuf)==TRUE) ||
4032 (( strlen((char*)data->keyPadLockBuf) == ECC_LENGTH) &&
4033 (cm_check_emergency((UBYTE*)&data->keyPadLockBuf[1])==TRUE) &&
4034 (bTwodigitECC == TRUE))) // RAVI - Changed = to == in condition.
4035 {
4036 if(bTwodigitECC == TRUE)
4037 {
4038 // If the last digits form ECC, copy the digits to editor buffer.
4039 memcpy(idle_data.edt_buf, &data->keyPadLockBuf[1], KEYPADLOCK_BUF_SIZE-1);
4040 }
4041 else
4042 {
4043 strcpy((char*)idle_data.edt_buf,(char*)data->keyPadLockBuf);
4044 }
4045 showKeyPadLocked = showSOSCallKeyPadLocked;
4046 pin_idle_emerg_call = TRUE;
4047 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
4048 winUpdate((MfwWin*)mfwControl(win));
4049 }
4050 else
4051 {
4052 /* SPR#1428 - SH - New Editor changes */
4053 #ifdef NEW_EDITOR
4054 ATB_edit_Hide(data->editor);
4055 ATB_edit_Reset(data->editor);
4056 #else /* NEW_EDITOR */
4057 edtHide(data->edt);
4058 edtReset(data->edt);
4059 #endif /* NEW_EDITOR */
4060
4061 // Nov 3, 2004 REF: CRR 25887 xkundadu
4062 //Description: Unable to make an emergency call.
4063 //Fix: Changed the code to make the emergency call when the
4064 // screen is locked.
4065 if(strlen((char *)data->keyPadLockBuf) >= 3)
4066 {
4067 //If the buffer length is greater than or equal to 3 ( i.e ECC_LENGTH)
4068 // remove the first character from the buffer. This is to check
4069 // whether the remaining characters are part of ECC.
4070 memcpy(&data->keyPadLockBuf[0], &data->keyPadLockBuf[1], KEYPADLOCK_BUF_SIZE-1);
4071 }
4072 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
4073 showKeyPadLocked = showNothing;
4074 pin_idle_emerg_call = FALSE;
4075 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
4076 winUpdate((MfwWin*)mfwControl(win));
4077 }
4078 }
4079 else
4080 {
4081 /* SPR#1428 - SH - New Editor changes */
4082 #ifdef NEW_EDITOR
4083 ATB_edit_Hide(data->editor);
4084 ATB_edit_Reset(data->editor);
4085 #else /* NEW_EDITOR */
4086 edtHide(data->edt);
4087 edtReset(data->edt);
4088 #endif /* NEW_EDITOR */
4089 if(strlen((char *)data->keyPadLockBuf) >= 3)
4090 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
4091 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
4092 showKeyPadLocked = showNothing;
4093 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
4094 pin_idle_emerg_call = FALSE;
4095 winUpdate((MfwWin*)mfwControl(win));
4096 }
4097
4098 break;
4099
4100 // Sep 22, 2004 REF: CRR 23871 xkundadu
4101 // Description: Screen Locking: Unlocking screen is happening by other keys
4102 // Fix: handled the other key events except '*' not to unlock the keypad.
4103
4104 case KCD_HASH:
4105 case KCD_MNUDOWN:
4106 case KCD_MNUUP:
4107 case KCD_MNULEFT:
4108 case KCD_MNURIGHT:
4109 case KCD_MNUSELECT:
4110 case KCD_LEFT:
4111 case KCD_3:
4112 case KCD_4:
4113 case KCD_5:
4114 case KCD_6:
4115 case KCD_7:
4116 case KCD_HUP:
4117 // If the user presses key, other than MENU/RSK set the
4118 // menuPressed key to FALSE. This is done to avoid the
4119 // unlocking by keys except MENU and '*'.
4120 data->menuPressed = FALSE;
4121
4122
4123 default:
4124 data->menuPressed = FALSE;
4125
4126 /* SPR#1428 - SH - New Editor changes */
4127 #ifdef NEW_EDITOR
4128 ATB_edit_Hide(data->editor);
4129 ATB_edit_Reset(data->editor);
4130 #else /* NEW_EDITOR */
4131 edtHide(data->edt);
4132 edtReset(data->edt);
4133 #endif /* NEW_EDITOR */
4134 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
4135 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
4136 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
4137 showKeyPadLocked = showNothing;
4138 pin_idle_emerg_call = FALSE;
4139 //winUpdate((MfwWin*)mfwControl(win));
4140 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
4141 break;
4142 }
4143 break;
4144
4145 case IDLE_NEW_SMS:
4146 // show the info about incoming sms on the idle screen
4147 showKeyPadLocked = showNothing;
4148
4149 /* MZ 1942 remove the additional SMS received indication screen */
4150
4151 //data->win_info = idle_information_start(win,2000,showSMSNewMessage,(T_VOID_FUNC)idle_info_destroy_cb);
4152 windowsUpdate();
4153 break;
4154
4155 case IDLE_INFO_ENDED:
4156 data->win_info = 0;
4157 win_show(win);
4158 break;
4159
4160 // Sept 15, 2005 REF: CRR 32410 x0021334
4161 // Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
4162 // Handle IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED event.
4163 case IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED:
4164 data->menuPressed = FALSE;
4165 break;
4166 default:
4167 return;
4168 }
4169
4170 }
4171
4172 /*******************************************************************************
4173
4174 $Function: idle_key_pad_locked_win_cb
4175
4176 $Description:
4177
4178 $Returns:
4179
4180 $Arguments:
4181
4182 *******************************************************************************/
4183
4184
4185
4186 static int idle_key_pad_locked_win_cb(MfwEvt e, MfwWin *w)
4187 {
4188
4189 // T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)w->user; // RAVI
4190
4191 TRACE_FUNCTION ("idle_key_pad_locked_win_cb()");
4192
4193 switch (e)
4194 {
4195 case MfwWinVisible:
4196 /*NM, p022*/
4197 showKeyPadLocked();
4198 break;
4199
4200 default:
4201 return 0;
4202 }
4203
4204 return 1;
4205 }
4206
4207
4208 /*******************************************************************************
4209
4210 $Function: idle_key_pad_locked_kbd_cb
4211
4212 $Description:
4213
4214 $Returns:
4215
4216 $Arguments:
4217
4218 *******************************************************************************/
4219
4220 static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k)
4221 {
4222
4223 T_MFW_HND win = mfw_parent (mfw_header());
4224 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4225 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
4226
4227 TRACE_FUNCTION ("idle_key_pad_locked_kbd_cb()");
4228
4229 SEND_EVENT(data->win,IDLE_KEYPAD_LOCKED_UPDATE,0,&k->code);
4230 return MFW_EVENT_CONSUMED;
4231
4232 }
4233
4234
4235
4236 /*******************************************************************************
4237
4238 $Function: idle_key_pad_locked_kbd_long_cb
4239
4240 $Description:
4241
4242 $Returns:
4243
4244 $Arguments:
4245
4246 *******************************************************************************/
4247
4248
4249
4250 static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k)
4251 {
4252 return MFW_EVENT_CONSUMED;
4253 }
4254
4255
4256 /*******************************************************************************
4257
4258 $Function: showSOSCallKeyPadLocked
4259
4260 $Description:
4261
4262 $Returns:
4263
4264 $Arguments:
4265
4266 *******************************************************************************/
4267
4268
4269
4270
4271 static void showSOSCallKeyPadLocked(void)
4272 {
4273 TRACE_FUNCTION("showSOSCallKeyPadLocked");
4274 /*NM p022*/
4275
4276 /*SPR#2026 - DS - Set up colour for "Emergency?" screen */
4277 resources_setColour(COLOUR_EDITOR);
4278
4279 idle_displayData(IDLE_LOCKED_ECC,TxtEmergency,NULL);
4280 softKeys_displayId(TxtNull,TxtSoftCall,0,COLOUR_EDITOR); /*SPR#2026 - DS - Changed colour from COLOUR_IDLE */
4281 }
4282
4283
4284 /*******************************************************************************
4285
4286 $Function: showNothing
4287
4288 $Description:
4289
4290 $Returns:
4291
4292 $Arguments:
4293
4294 *******************************************************************************/
4295
4296
4297
4298 static void showNothing(void)
4299 {
4300 TRACE_FUNCTION("showNothing");
4301 }
4302
4303
4304
4305 /*******************************************************************************
4306
4307 $Function: showPressMenuStar
4308
4309 $Description:
4310
4311 $Returns:
4312
4313 $Arguments:
4314
4315 *******************************************************************************/
4316
4317
4318 static void showPressMenuStar(void)
4319 {
4320 TRACE_FUNCTION("showPressMenuStar");
4321
4322 idle_displayData(IDLE_LOCKED,TxtLocked,NULL);
4323 idle_displayData(IDLE_MENU_PRESS,TxtPressMenu,NULL);
4324
4325 }
4326
4327
4328
4329 /*******************************************************************************
4330
4331 $Function: showSMSNewMessage
4332
4333 $Description:
4334
4335 $Returns:
4336
4337 $Arguments:
4338
4339 *******************************************************************************/
4340
4341
4342 static void showSMSNewMessage(void)
4343 {
4344 char text[20];
4345 int txtStrId;
4346 int txtNo;
4347 int xOfs; //used to offset text id when a number is to be displayed
4348
4349 TRACE_FUNCTION("showSMSNewMessage");
4350
4351 dspl_Clear(WIN_DIALLING_ORG_X,Mmi_layout_line_icons(2),mmiScrX,Mmi_layout_second_line()+YLINE*2);
4352
4353 txtStrId = smsidle_display_sms_status(&txtNo );
4354
4355 //If data has been set up, then show it
4356 if (txtStrId != TxtNull)
4357 {
4358 if (txtNo != 0)
4359 {//we have a number to display - number of new messages/missed calls
4360 sprintf((char*)text,"%d",txtNo);
4361 dspl_TextOut(4,24,0,text);//always display numbeer as ascii
4362 if (txtNo < 10)
4363 xOfs = 12;
4364 else
4365 xOfs = 18;
4366 }
4367 else
4368 xOfs = 0;
4369
4370 dspl_TextOut(4+xOfs,24,DSPL_TXTATTR_CURRENT_MODE,GET_TEXT(txtStrId));//display as chinese or ascii
4371 }
4372
4373 displaySoftKeys(TxtNull,TxtNull);
4374 }
4375
4376
4377
4378
4379 /*********************************************************************
4380 **********************************************************************
4381
4382 Information WINDOW. IMPLEMENTATION
4383
4384 *********************************************************************
4385 **********************************************************************/
4386
4387
4388
4389 /*******************************************************************************
4390
4391 $Function: idle_information_create
4392
4393 $Description:
4394
4395 $Returns:
4396
4397 $Arguments:
4398
4399 *******************************************************************************/
4400
4401
4402
4403
4404 T_MFW_HND idle_information_create(MfwHnd parent_window){
4405
4406 T_MFW_WIN * win;
4407 T_idle_information * data = (T_idle_information *)ALLOC_MEMORY (sizeof (T_idle_information));
4408
4409 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_information_win_cb);
4410 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_information_kbd_cb);
4411
4412 if (data->win EQ 0)
4413 return 0;
4414
4415 /*
4416 * Create window handler
4417 */
4418 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_information;
4419 data->mmi_control.data = data;
4420 win = ((T_MFW_HDR *)data->win)->data;
4421 win->user = (void *) data;
4422 data->parent_win = parent_window;
4423 /*
4424 * Create any other handler
4425 */
4426
4427
4428
4429 /*
4430 * return window handle
4431 */
4432 return data->win;
4433
4434 }
4435
4436 /*******************************************************************************
4437
4438 $Function: idle_information_destroy
4439
4440 $Description:
4441
4442 $Returns:
4443
4444 $Arguments:
4445
4446 *******************************************************************************/
4447
4448
4449 void idle_information_destroy (T_MFW_HND own_window)
4450 {
4451 T_MFW_WIN * win;
4452 T_idle_information * data;
4453
4454 if (own_window)
4455 {
4456 win = ((T_MFW_HDR *)own_window)->data;
4457 data = (T_idle_information *)win->user;
4458
4459 if (data)
4460 {
4461 /*
4462 * Exit Keyboard Handler
4463 */
4464 /*
4465 * Delete WIN Handler
4466 */
4467 win_delete (data->win);
4468 }
4469 SEND_EVENT(data->parent_win,IDLE_INFO_ENDED,0,0);
4470 FREE_MEMORY ((void *)data, sizeof (T_idle_information));
4471 }
4472 }
4473
4474
4475 /*******************************************************************************
4476
4477 $Function: idle_information_start
4478
4479 $Description:
4480
4481 $Returns:
4482
4483 $Arguments:
4484
4485 *******************************************************************************/
4486
4487
4488
4489 T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb){
4490
4491
4492
4493 T_MFW_HND win = idle_information_create(win_parent);
4494
4495
4496 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
4497 T_idle_information * data = (T_idle_information *)win_data->user;
4498
4499
4500 data->timer = timCreate(win,time,(MfwCb)idle_information_tim_cb);
4501 data->info_cb = (T_VOID_FUNC)info_cb;
4502 timStart(data->timer);
4503 showInformation = show;
4504 winShow(win);
4505 return win;
4506 }
4507
4508
4509 /*******************************************************************************
4510
4511 $Function: idle_information
4512
4513 $Description:
4514
4515 $Returns:
4516
4517 $Arguments:
4518
4519 *******************************************************************************/
4520
4521
4522
4523
4524 void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
4525 {
4526 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
4527 // T_idle_information * data = (T_idle_information *)win_data->user; // RAVI
4528
4529 TRACE_FUNCTION ("idle_information()");
4530
4531 switch (event)
4532 {
4533 default:
4534 return;
4535 }
4536
4537 }
4538
4539
4540 /*******************************************************************************
4541
4542 $Function: idle_information_win_cb
4543
4544 $Description:
4545
4546 $Returns:
4547
4548 $Arguments:
4549
4550 *******************************************************************************/
4551
4552
4553
4554 static int idle_information_win_cb(MfwEvt e, MfwWin *w)
4555 {
4556
4557 TRACE_FUNCTION("idle_information_win_cb");
4558
4559
4560 switch (e)
4561 {
4562 case MfwWinVisible:
4563 showInformation();
4564 break;
4565 default:
4566 return 0;
4567 }
4568
4569 return 1;
4570 }
4571
4572
4573
4574 /*******************************************************************************
4575
4576 $Function: idle_information_kbd_cb
4577
4578 $Description:
4579
4580 $Returns:
4581
4582 $Arguments:
4583
4584 *******************************************************************************/
4585
4586
4587 static int idle_information_kbd_cb(MfwEvt e, MfwKbd *k)
4588 {
4589 T_MFW_HND win = mfw_parent (mfw_header());
4590 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4591 T_idle_information * data = (T_idle_information *)win_data->user;
4592 T_MFW_HND keypad_locked_win;
4593 U8 key_code;
4594
4595
4596 keypad_locked_win = data->parent_win;
4597 key_code = k->code;
4598 TRACE_FUNCTION("idle_information_kbd_cb");
4599 idle_information_destroy(data->win);
4600 SEND_EVENT(keypad_locked_win,IDLE_KEYPAD_LOCKED_UPDATE,0,&key_code);
4601 return MFW_EVENT_CONSUMED;
4602 }
4603
4604
4605 /*******************************************************************************
4606
4607 $Function: idle_information_kbd_long_cb
4608
4609 $Description:
4610
4611 $Returns:
4612
4613 $Arguments:
4614
4615 *******************************************************************************/
4616
4617
4618 static int idle_information_kbd_long_cb(MfwEvt e, MfwKbd *k)
4619 {
4620 return MFW_EVENT_CONSUMED;
4621 }
4622
4623
4624
4625
4626 /*******************************************************************************
4627
4628 $Function: idle_information_tim_cb
4629
4630 $Description:
4631
4632 $Returns:
4633
4634 $Arguments:
4635
4636 *******************************************************************************/
4637
4638
4639
4640 static int idle_information_tim_cb(MfwEvt e, MfwTim *t){
4641
4642 T_MFW_HND win = mfw_parent (mfw_header());
4643 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4644 T_idle_information * data = (T_idle_information *)win_data->user;
4645
4646 TRACE_FUNCTION("idle_information_tim_cb");
4647
4648 // Nov 3, 2004 REF: CRR 25887 xkundadu
4649 //Description: Unable to make an emergency call.
4650 //Fix: Changed the code to make the emergency call when the
4651 // screen is locked.
4652 // If the "keypad locked" message is timed out, reset the key pad buffer to NULL
4653 if(data != NULL)
4654 {
4655 T_MFW_WIN * mywin_data = ((T_MFW_HDR *) data->parent_win)->data;
4656 if(mywin_data != NULL)
4657 {
4658 T_idle_key_pad_locked * mydata = (T_idle_key_pad_locked *)mywin_data->user;
4659
4660 if(mydata->keyPadLockBuf != NULL)
4661 {
4662 // Set the buffer to null once the 'key locked' message
4663 //in the idle screen is timed out.
4664 memset(mydata->keyPadLockBuf, '\0', KEYPADLOCK_BUF_SIZE);
4665 }
4666 }
4667 }
4668
4669 timStop(data->timer);
4670 data->info_cb(data->parent_win,NULL,NULL);
4671
4672 // Sept 15, 2005 REF: CRR 32410 x0021334
4673 // Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
4674 // Send event to notify that the timer has expired.
4675 SEND_EVENT(data->parent_win, IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED, 0, 0);
4676
4677 idle_information_destroy(win);
4678 windowsUpdate(); /* p303 - sbh */
4679 return 1;
4680 }
4681
4682
4683 /*******************************************************************************
4684
4685 $Function: idle_info_destroy_cb
4686
4687 $Description:
4688
4689 $Returns:
4690
4691 $Arguments:
4692
4693 *******************************************************************************/
4694
4695
4696
4697
4698 void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason){
4699
4700 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4701 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
4702
4703 data->win_info = 0;
4704
4705 }
4706 /*******************************************************************************
4707
4708 $Function: showIMEI
4709
4710 $Description:
4711
4712 $Returns:
4713
4714 $Arguments:
4715
4716 *******************************************************************************/
4717
4718
4719 void showIMEI (T_MFW_HND win, char* IMEI)
4720 {
4721 T_DISPLAY_DATA display_info;
4722
4723 /* Marcus: Issue 1603: 28/01/2003: Replaced dlg_initDisplayData_TextId with dlg_initDisplayData_TextStr */
4724 dlg_initDisplayData_TextStr( &display_info, TxtSoftOK, TxtNull, MmiRsrcGetText(TxtIMEI), IMEI, COLOUR_STATUS);
4725 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)idle_imei_info_cb, FOREVER, KEY_CLEAR| KEY_LEFT );
4726
4727 /*
4728 * Call Info Screen
4729 */
4730
4731 idle_data.info_win = info_dialog (win, &display_info);
4732
4733 }
4734
4735 /*******************************************************************************
4736
4737 $Function: idle_imei_info_cb
4738
4739 $Description:
4740
4741 $Returns:
4742
4743 $Arguments:
4744
4745 *******************************************************************************/
4746
4747
4748
4749 static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
4750 {
4751
4752
4753 switch (reason) {
4754 case INFO_KCD_HUP:
4755 case INFO_KCD_LEFT:
4756 break;
4757 }
4758
4759 return 1;
4760 }
4761
4762 /*******************************************************************************
4763
4764 $Function: Ciphering
4765
4766 $Description: Called by mfw
4767 Now this function doesn t seperate between the GSM and GPRS status
4768
4769 $Returns:
4770
4771 $Arguments:
4772
4773 *******************************************************************************/
4774 void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph)
4775 {
4776
4777
4778 if (gsm_ciph == 0 || gprs_ciph == 0)
4779 {
4780
4781 TRACE_FUNCTION ("Ciphering: is deactivated");
4782
4783 idle_data.ciphering = SHOW_CPRS_DEACTIV;
4784 //show the DEACTIVATED ciphering indication
4785 iconsSetState(iconIdCipheringDeActiv);
4786 iconsDeleteState(iconIdCipheringActiv);
4787
4788 }
4789 else if (gsm_ciph == 1 || gprs_ciph == 1)
4790 {
4791 //show the ACTIVATED ciphering indication
4792
4793 TRACE_EVENT ("Ciphering: is activated");
4794
4795 idle_data.ciphering = SHOW_CPRS_ACITV;
4796
4797 iconsSetState(iconIdCipheringActiv);
4798 iconsDeleteState(iconIdCipheringDeActiv);
4799 }
4800 else if (gsm_ciph == 2 || gprs_ciph == 2)
4801 {
4802 //dont show ANY indication !!!
4803
4804 TRACE_EVENT ("Ciphering: is disabled");
4805
4806 idle_data.ciphering = DONT_SHOW_CPRS;
4807
4808 iconsDeleteState(iconIdCipheringActiv);
4809 iconsDeleteState(iconIdCipheringDeActiv);
4810 }
4811
4812 //update the screen
4813 windowsUpdate();
4814
4815 }
4816
4817 /*******************************************************************************
4818
4819 $Function: showVersion
4820
4821 $Description: Displays the version of software and date
4822
4823 $Returns:
4824
4825 $Arguments:
4826
4827 *******************************************************************************/
4828 T_MFW_HND ShowVersion(T_MFW_HND parent_window)
4829 {
4830 T_MFW_HND win = ShowVersion_create(parent_window);
4831 TRACE_FUNCTION("ShowVerion()");
4832 if (win NEQ NULL)
4833 {
4834 SEND_EVENT (win, SHOWVERSION_INIT, 0, 0);
4835 }
4836
4837 return win;
4838 }
4839
4840 /*******************************************************************************
4841
4842 $Function: ShowVersion_create
4843
4844 $Description: creates the window
4845
4846 $Returns:
4847
4848 $Arguments:
4849
4850 *******************************************************************************/
4851 static T_MFW_HND ShowVersion_create(MfwHnd parent_window)
4852 {
4853 tShowVerion* data = (tShowVerion*)ALLOC_MEMORY (sizeof (tShowVerion));
4854 T_MFW_WIN * win;
4855
4856 if (data EQ NULL)
4857 {
4858 return NULL;
4859 }
4860
4861 // Create window handler
4862 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, NULL);
4863 if (data->win EQ NULL)
4864 {
4865
4866 return NULL;
4867 }
4868 // connect the dialog data to the MFW-window
4869 data->mmi_control.dialog = (T_DIALOG_FUNC)ShowVersion_DialogCB;
4870 data->mmi_control.data = data;
4871 win = ((T_MFW_HDR *)data->win)->data;
4872 win->user = (void *)data;
4873 data->parent_win = parent_window;
4874
4875 return data->win;
4876 }
4877
4878
4879 /*******************************************************************************
4880
4881 $Function: showVersion_DialogCB
4882
4883 $Description: CallBack Function
4884
4885 $Returns:
4886
4887 $Arguments:
4888
4889 *******************************************************************************/
4890 static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier,
4891 void *parameter)
4892 {
4893 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
4894 tShowVerion* data = (tShowVerion*) win_data->user;
4895 #ifdef NEW_EDITOR
4896 // T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ // RAVI - Not Used.
4897 #else
4898 // T_EDITOR_DATA editor_data; // RAVI - Not Used.
4899 #endif
4900
4901 TRACE_FUNCTION("ShowVersion_DialogCB()");
4902
4903 switch( e )
4904 { //when window first created
4905 case SHOWVERSION_INIT:
4906 {
4907
4908 strcat(data->buffer, "Date:");
4909 strcat(data->buffer, date);
4910 strcat(data->buffer,"\n");
4911 strcat(data->buffer, "BMI:");
4912 strcat(data->buffer, bmi);
4913 strcat(data->buffer,"\n");
4914 strcat(data->buffer,"GPRS:");
4915 strcat(data->buffer, gprs);
4916 strcat(data->buffer,"\n");
4917 strcat(data->buffer,"TI:");
4918 strcat(data->buffer, ti);
4919
4920 ShowVersionSetEditor(win);//set editor with default attribute values
4921
4922 /* SPR#1428 - SH - New Editor changes */
4923 #ifdef NEW_EDITOR
4924 AUI_edit_Start(win, &data->editor_data);
4925 #else /* NEW_EDITOR */
4926 editor_start(win, &(data->editor_data)); /* start the editor */
4927 #endif /* NEW_EDITOR */
4928
4929 winShow(data->win);
4930 }
4931 break;
4932
4933 default:
4934 {
4935 TRACE_EVENT("ShowVersion_DialogCB(): Unknown Event");
4936 }
4937 break;
4938
4939 }
4940
4941 }
4942
4943 /*******************************************************************************
4944
4945 $Function: ShowVersionSetEditor
4946
4947 $Description: Set the editor up
4948
4949 $Returns:
4950
4951 $Arguments:
4952
4953 *******************************************************************************/
4954 void ShowVersionSetEditor(T_MFW_HND win)
4955 {
4956 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
4957 tShowVerion* data = (tShowVerion*) win_data->user;
4958
4959 /* SPR#1428 - SH - New Editor changes */
4960 #ifdef NEW_EDITOR
4961 AUI_edit_SetDefault(&data->editor_data);
4962 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT);
4963 AUI_edit_SetEvents(&data->editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)ShowVerionCB);
4964 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->buffer, 35);
4965 AUI_edit_SetMode(&data->editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
4966 AUI_edit_SetTextStr(&data->editor_data, TxtNull, TxtSoftBack, TxtNull, NULL);
4967 #else /* NEW_EDITOR */
4968 editor_attr_init(&((data->editor_data).editor_attr), NULL, edtCurNone, 0, (char *)data->buffer, 35, COLOUR_EDITOR);
4969 editor_data_init(&data->editor_data, NULL, TxtSoftBack, TxtNull, 0, 1, READ_ONLY_MODE, FOREVER);
4970 data->editor_data.hide = FALSE;
4971 data->editor_data.Identifier = 0;
4972 data->editor_data.TextString = NULL;
4973 data->editor_data.destroyEditor = TRUE;
4974 data->editor_data.Callback = (T_EDIT_CB)ShowVerionCB;
4975 #endif /* NEW_EDITOR */
4976 }
4977
4978 /*******************************************************************************
4979
4980 $Function: ShowVerionCB
4981
4982 $Description: Callback
4983
4984 $Returns:
4985
4986 $Arguments:
4987
4988 *******************************************************************************/
4989 static void ShowVerionCB( T_MFW_HND win, USHORT Identifier,UBYTE reason)
4990 {
4991 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
4992 tShowVerion*data = (tShowVerion*) win_data->user;
4993
4994
4995 TRACE_FUNCTION("ShowVerionCB()");
4996
4997 switch (reason )
4998 {
4999 case INFO_KCD_LEFT:
5000 case INFO_KCD_HUP:
5001 case INFO_KCD_RIGHT:
5002
5003 default:
5004 showVersion_destroy(data->win);
5005 break;
5006 }
5007 }
5008
5009 /*******************************************************************************
5010
5011 $Function: showVersion_destroy
5012
5013 $Description: Destroys the editor
5014
5015 $Returns:
5016
5017 $Arguments:
5018
5019 *******************************************************************************/
5020 void showVersion_destroy(MfwHnd own_window)
5021 {
5022 T_MFW_WIN * win_data;
5023
5024 tShowVerion* data = NULL;
5025
5026
5027 if (own_window == NULL)
5028 {
5029 TRACE_EVENT ("Error : showVersion_destroy called with NULL Pointer");
5030 return;
5031 }
5032
5033
5034 win_data = ((T_MFW_HDR *)own_window)->data;
5035 if (win_data != NULL)
5036 data = (tShowVerion*)win_data->user;
5037
5038 if (data)
5039 {
5040 TRACE_EVENT ("calc_destroy()");
5041
5042 win_delete (data->win);
5043 // Free Memory
5044 FREE_MEMORY ((void *)data, sizeof (tShowVerion));
5045
5046 }
5047 else
5048 {
5049 TRACE_EVENT ("calc_destroy() called twice");
5050 }
5051 }
5052 //GW 28/11/02 - debug only - to allod display.c to output a trace (for timing only)
5053 void mmi_trace( char* str)
5054 {
5055 TRACE_FUNCTION(str);
5056 }
5057
5058 //xrashmic 26 Aug, 2004 MMI-SPR-23931
5059 // To display the indication of new EMS in the idle screen
5060 void addNewEMS(void)
5061 {
5062 UBYTE currentVoiceTone;
5063 idle_data.ems=TRUE;
5064 //Apr 05, 2005 REF: ENH 29994 xdeepadh
5065 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
5066 //Play SMS tone for EMS alert
5067 #ifdef FF_MIDI_RINGER
5068 mfw_ringer_start(AS_RINGER_MODE_SMS,false,sounds_midi_ringer_start_cb);
5069 #else
5070 currentVoiceTone = getcurrentVoiceTone();
5071 #ifdef FF_MMI_RINGTONE /* MSL SMS Tone */
5072 audio_PlaySoundID( AUDIO_BUZZER, SMSTONE_SELECT, 200, AUDIO_PLAY_ONCE );
5073 #else
5074 audio_PlaySoundID( AUDIO_BUZZER, currentVoiceTone, 200, AUDIO_PLAY_ONCE );
5075 #endif
5076 #endif
5077 }
5078
5079 /*******************************************************************************
5080
5081 $Function: idle_opername_timer_cb
5082
5083 $Description: Callback for timer
5084
5085 $Returns:
5086
5087 $Arguments:
5088
5089 *******************************************************************************/
5090 //x0pleela 14 Feb, 2006 ER: OMAPS00065203
5091 int idle_opername_timer_cb( MfwEvt e, MfwTim *tc )
5092 {
5093 TRACE_FUNCTION("idle_opername_timer_cb()");
5094
5095 //Display text is changed to PLMN name and refresh idle screen
5096 opername_disp_flag = PLMN;
5097 idleEvent(IdleUpdate);
5098
5099 //Stop and delete timer
5100 if( plmn_display)
5101 {
5102 timStop(plmn_display);
5103 }
5104 return MFW_EVENT_CONSUMED;
5105 }
5106