comparison src/ui/bmi/mmiBookCallDetailsWindow.c @ 142:ec9f955fc487

mmiBook*.c: bogotab fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Nov 2020 08:43:59 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
141:67b91d34f75e 142:ec9f955fc487
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 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. 8 disclosed to any third party without the express permission of the owner.
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: PhoneBook 14 $Module: PhoneBook
15 $File: MmiBookCallDetailsWindow.c 15 $File: MmiBookCallDetailsWindow.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 25/10/00 19 $Date: 25/10/00
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
25 This provides the implementation of the call details window for the 25 This provides the implementation of the call details window for the
26 phone book module 26 phone book module
27 27
28 ******************************************************************************** 28 ********************************************************************************
29 $History: MmiBookCallDetailsWindow.c 29 $History: MmiBookCallDetailsWindow.c
30 Feb 22, 2007 OMAPS00115777 a0393213(R.Prabakar) 30 Feb 22, 2007 OMAPS00115777 a0393213(R.Prabakar)
31 Description : Details of any Missed call number shows Invalid information 31 Description : Details of any Missed call number shows Invalid information
32 Fix : Data was not initialized properly. Now it's initialized properly and 32 Fix : Data was not initialized properly. Now it's initialized properly and
33 the fix done as part of CRR 22638 reverted back as it isn't clean 33 the fix done as part of CRR 22638 reverted back as it isn't clean
34 34
35 Aug 24, 2004 REF: CRR 22638 xrashmic 35 Aug 24, 2004 REF: CRR 22638 xrashmic
36 Bug: E-Sample switches off when you attempt to look at details of a number 36 Bug: E-Sample switches off when you attempt to look at details of a number
37 in call list. 37 in call list.
38 Fix: Using the data stored in global variable to avoid corrupt data. 38 Fix: Using the data stored in global variable to avoid corrupt data.
39 39
40 25/10/00 Original Condat(UK) BMI version. 40 25/10/00 Original Condat(UK) BMI version.
41 41
42 $End 42 $End
43 // Issue Number : SPR#12874 on 31/03/04 by Rashmi.C.N. 43 // Issue Number : SPR#12874 on 31/03/04 by Rashmi.C.N.
44 *******************************************************************************/ 44 *******************************************************************************/
45
46 45
47 46
48 47
49 /******************************************************************************* 48 /*******************************************************************************
50 49
150 149
151 150
152 151
153 /******************************************************************************* 152 /*******************************************************************************
154 153
155 $Function: bookCallDetails 154 $Function: bookCallDetails
156 155
157 $Description: dialog function for the call details windows 156 $Description: dialog function for the call details windows
158 157
159 $Returns: None. 158 $Returns: None.
160 159
161 $Arguments: win, window handle 160 $Arguments: win, window handle
162 event, event to be handled 161 event, event to be handled
163 value, not used 162 value, not used
164 parameter, not used 163 parameter, not used
165 164
166 *******************************************************************************/ 165 *******************************************************************************/
167 166
168 static void bookCallDetails( T_MFW_HND win, USHORT event, SHORT value, void * parameter ) 167 static void bookCallDetails( T_MFW_HND win, USHORT event, SHORT value, void * parameter )
169 { 168 {
170 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 169 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
171 tBookStandard *data = (tBookStandard *)win_data->user; 170 tBookStandard *data = (tBookStandard *)win_data->user;
172 #ifdef NEW_EDITOR 171 #ifdef NEW_EDITOR
173 T_MFW_PHB_ENTRY p_pEntry; 172 T_MFW_PHB_ENTRY p_pEntry;
174 tMmiPhbData current = data->phbk->current; 173 tMmiPhbData current = data->phbk->current;
175 T_MFW_PHB_ENTRY *my = &current.entry[ current.selectedName - current.missedCallsOffset ]; 174 T_MFW_PHB_ENTRY *my = &current.entry[ current.selectedName - current.missedCallsOffset ];
176 T_ATB_TEXT nameText; 175 T_ATB_TEXT nameText;
177 T_ATB_TEXT numberText; 176 T_ATB_TEXT numberText;
178 T_ATB_TEXT otherText; 177 T_ATB_TEXT otherText;
179 char *TempBuffer = (char *)ALLOC_MEMORY(CALLDETAILS_INFO_LEN); 178 char *TempBuffer = (char *)ALLOC_MEMORY(CALLDETAILS_INFO_LEN);
180 char *time; 179 char *time;
181 char *date; 180 char *date;
182 TRACE_FUNCTION( "bookCallDetails()" ); 181 TRACE_FUNCTION( "bookCallDetails()" );
183 182
184 /* SPR#1428 - SH - New Editor changes 183 /* SPR#1428 - SH - New Editor changes
185 * Moved all this stuff here from the WinCb - it shouldn't be there! */ 184 * Moved all this stuff here from the WinCb - it shouldn't be there! */
186 185
187 /* try to get the name from the phone book, null the structure out 186 /* try to get the name from the phone book, null the structure out
188 if we can't find it at all 187 if we can't find it at all
189 */ 188 */
190 189
191 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) ) 190 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
192 { 191 {
193 bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN); 192 bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN);
194 my->name.len = p_pEntry.name.len; 193 my->name.len = p_pEntry.name.len;
195 } 194 }
196 else 195 else
197 { 196 {
198 my->name.len = 0; 197 my->name.len = 0;
199 } 198 }
200 199
201 numberText.dcs = ATB_DCS_ASCII; 200 numberText.dcs = ATB_DCS_ASCII;
202 numberText.data = my->number; 201 numberText.data = my->number;
203 ATB_string_Length(&numberText); 202 ATB_string_Length(&numberText);
204 203
205 #ifdef EASY_TEXT_ENABLED 204 #ifdef EASY_TEXT_ENABLED
206 if ( my->name.data[0] ==0x80) 205 if ( my->name.data[0] ==0x80)
207 { 206 {
208 /* UNICODE */ 207 /* UNICODE */
209 nameText.dcs = ATB_DCS_UNICODE; 208 nameText.dcs = ATB_DCS_UNICODE;
210 nameText.data = &my->name.data[2]; 209 nameText.data = &my->name.data[2];
211 } 210 }
212 else 211 else
213 #endif /* EASY_TEXT_ENABLED */ 212 #endif /* EASY_TEXT_ENABLED */
214 { 213 {
215 /* ASCII */ 214 /* ASCII */
216 nameText.dcs = ATB_DCS_ASCII; 215 nameText.dcs = ATB_DCS_ASCII;
217 nameText.data = my->name.data; 216 nameText.data = my->name.data;
218 } 217 }
219 218
220 ATB_string_Length(&nameText); 219 ATB_string_Length(&nameText);
221 220
222 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */ 221 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
223 ATB_edit_ClearAll(data->editor); /* Blank the editor */ 222 ATB_edit_ClearAll(data->editor); /* Blank the editor */
224 ATB_edit_InsertString(data->editor, &nameText); 223 ATB_edit_InsertString(data->editor, &nameText);
225 ATB_edit_Char(data->editor, ctrlEnter, FALSE); 224 ATB_edit_Char(data->editor, ctrlEnter, FALSE);
226 ATB_edit_InsertString(data->editor, &numberText); 225 ATB_edit_InsertString(data->editor, &numberText);
227 ATB_edit_Char(data->editor, ctrlEnter, FALSE); 226 ATB_edit_Char(data->editor, ctrlEnter, FALSE);
228 227
229 if (CphsPresent() == TRUE) 228 if (CphsPresent() == TRUE)
230 { 229 {
231 sprintf(TempBuffer, "Line %d", my->line); 230 sprintf(TempBuffer, "Line %d", my->line);
232 otherText.dcs = ATB_DCS_ASCII; 231 otherText.dcs = ATB_DCS_ASCII;
233 otherText.data = (UBYTE *)TempBuffer; 232 otherText.data = (UBYTE *)TempBuffer;
234 ATB_string_Length(&otherText); 233 ATB_string_Length(&otherText);
235 ATB_edit_InsertString(data->editor, &otherText); 234 ATB_edit_InsertString(data->editor, &otherText);
236 ATB_edit_Char(data->editor, ctrlEnter, FALSE); 235 ATB_edit_Char(data->editor, ctrlEnter, FALSE);
237 } 236 }
238 237
239 /* API - 10/09/03 - SPR2513 - Add support to display chinese Data & Time */ 238 /* API - 10/09/03 - SPR2513 - Add support to display chinese Data & Time */
240 /* API - 05/09/03 - SPR2357 - Get the character string for the date */ 239 /* API - 05/09/03 - SPR2357 - Get the character string for the date */
241 240
242 date = MmiRsrcGetText(TxtCallDate); 241 date = MmiRsrcGetText(TxtCallDate);
243 242
244 if(Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) 243 if(Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
245 { 244 {
246 otherText.dcs = ATB_DCS_UNICODE; 245 otherText.dcs = ATB_DCS_UNICODE;
247 otherText.data = (UBYTE *)date; 246 otherText.data = (UBYTE *)date;
248 } 247 }
249 else 248 else
250 { 249 {
251 otherText.dcs = ATB_DCS_ASCII; 250 otherText.dcs = ATB_DCS_ASCII;
252 otherText.data = (UBYTE *)date; 251 otherText.data = (UBYTE *)date;
253 } 252 }
254 ATB_string_Length(&otherText); 253 ATB_string_Length(&otherText);
255 ATB_edit_InsertString(data->editor, &otherText); 254 ATB_edit_InsertString(data->editor, &otherText);
256 255
257 /* API - 05/09/03 - SPR2357 - END */ 256 /* API - 05/09/03 - SPR2357 - END */
258 /* API - 10/09/03 - SPR2513 - END */ 257 /* API - 10/09/03 - SPR2513 - END */
259 258
260 // API - 21-01-03 - 1566 - Date and Time displayed for Recent calls 259 // API - 21-01-03 - 1566 - Date and Time displayed for Recent calls
261 260
262 // change by Sasken ( Rashmi C N) on March 31th 2004 261 // change by Sasken ( Rashmi C N) on March 31th 2004
263 // Issue Number : MMI-SPR-12874 262 // Issue Number : MMI-SPR-12874
264 // Bug: Wrong date and time in the Missed call details. 263 // Bug: Wrong date and time in the Missed call details.
265 // Solution: converting the date and time into decimal format used in the 264 // Solution: converting the date and time into decimal format used in the
266 // phonebook management. 265 // phonebook management.
267 266
268 sprintf((char*)TempBuffer, "%.2d/%.2d/%.2d",(UBYTE)((my->date.day[0])<<4)+(UBYTE) my->date.day[1], 267 sprintf((char*)TempBuffer, "%.2d/%.2d/%.2d",(UBYTE)((my->date.day[0])<<4)+(UBYTE) my->date.day[1],
269 (UBYTE) ((my->date.month[0])<<4)+(UBYTE) my->date.month[1], 268 (UBYTE) ((my->date.month[0])<<4)+(UBYTE) my->date.month[1],
270 (UBYTE) ((my->date.year[0])<<4)+(UBYTE) my->date.year[1]); 269 (UBYTE) ((my->date.year[0])<<4)+(UBYTE) my->date.year[1]);
271 otherText.dcs = ATB_DCS_ASCII; 270 otherText.dcs = ATB_DCS_ASCII;
272 otherText.data = (UBYTE *)TempBuffer; 271 otherText.data = (UBYTE *)TempBuffer;
273 ATB_string_Length(&otherText); 272 ATB_string_Length(&otherText);
274 ATB_edit_InsertString(data->editor, &otherText); 273 ATB_edit_InsertString(data->editor, &otherText);
275 ATB_edit_Char(data->editor, ctrlEnter, FALSE); 274 ATB_edit_Char(data->editor, ctrlEnter, FALSE);
276 275
277 276
278 277 /* API - 10/09/03 - SPR2513 - Add support to display chinese Data & Time */
279 /* API - 10/09/03 - SPR2513 - Add support to display chinese Data & Time */ 278 /* API - 05/09/03 - SPR2357 - Get the character string for the Time */
280 /* API - 05/09/03 - SPR2357 - Get the character string for the Time */ 279
281 280 time = MmiRsrcGetText(TxtCallTime);
282 time = MmiRsrcGetText(TxtCallTime); 281
283 282 if(Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
284 if(Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) 283 {
285 { 284 otherText.dcs = ATB_DCS_UNICODE;
286 otherText.dcs = ATB_DCS_UNICODE; 285 otherText.data = (UBYTE *)time;
287 otherText.data = (UBYTE *)time; 286 }
288 } 287 else
289 else 288 {
290 { 289 otherText.dcs = ATB_DCS_ASCII;
291 otherText.dcs = ATB_DCS_ASCII; 290 otherText.data = (UBYTE *)time;
292 otherText.data = (UBYTE *)time; 291 }
293 } 292
294 293 ATB_edit_InsertString(data->editor, &otherText);
295 ATB_edit_InsertString(data->editor, &otherText); 294
296 295 /* API - 05/09/03 - SPR2357 - END */
297 /* API - 05/09/03 - SPR2357 - END */ 296 /* API - 10/09/03 - SPR2513 - END */
298 /* API - 10/09/03 - SPR2513 - END */ 297
299 298 // API - 21-01-03 - 1566 - Date and Time displayed for Recent calls
300 // API - 21-01-03 - 1566 - Date and Time displayed for Recent calls 299
301 300 // change by Sasken ( Rashmi C N) on March 31th 2004
302 // change by Sasken ( Rashmi C N) on March 31th 2004 301 // Issue Number : MMI-SPR-12874
303 // Issue Number : MMI-SPR-12874 302 // Bug: Wrong date and time in the Missed call details.
304 // Bug: Wrong date and time in the Missed call details. 303 // Solution: converting the date and time into decimal format used in the
305 // Solution: converting the date and time into decimal format used in the
306 // phonebook management. 304 // phonebook management.
307 sprintf((char*)TempBuffer, "%.2d:%.2d", (UBYTE) ((my->time.hour[0])<<4)+(UBYTE) my->time.hour[1], 305 sprintf((char*)TempBuffer, "%.2d:%.2d", (UBYTE) ((my->time.hour[0])<<4)+(UBYTE) my->time.hour[1],
308 (UBYTE) ((my->time.minute[0])<<4)+(UBYTE) my->time.minute[1]); 306 (UBYTE) ((my->time.minute[0])<<4)+(UBYTE) my->time.minute[1]);
309 307
310 otherText.dcs = ATB_DCS_ASCII; 308 otherText.dcs = ATB_DCS_ASCII;
311 otherText.data = (UBYTE *)TempBuffer; 309 otherText.data = (UBYTE *)TempBuffer;
312 ATB_string_Length(&otherText); 310 ATB_string_Length(&otherText);
313 ATB_edit_InsertString(data->editor, &otherText); 311 ATB_edit_InsertString(data->editor, &otherText);
314 312
315 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */ 313 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
316 314
317 315
318 FREE_MEMORY((void *)TempBuffer, CALLDETAILS_INFO_LEN); 316 FREE_MEMORY((void *)TempBuffer, CALLDETAILS_INFO_LEN);
319 317
320 /* show the editor and update the soft keys 318 /* show the editor and update the soft keys
321 */ 319 */
322 /* SH - the string has changed, so we need to refresh the word-wrap */ 320 /* SH - the string has changed, so we need to refresh the word-wrap */
323 ATB_edit_Refresh(data->editor); 321 ATB_edit_Refresh(data->editor);
324 win_show(data->win); 322 win_show(data->win);
325 323
326 #else /* NEW_EDITOR */ 324 #else /* NEW_EDITOR */
327 325
328 if ( event == CALL_DETAILS_INIT ) 326 if ( event == CALL_DETAILS_INIT )
329 winShow( data->win ); 327 winShow( data->win );
330 328
331 #endif /* NEW_EDITOR */ 329 #endif /* NEW_EDITOR */
332 } 330 }
333 331
334 332
335 333 /*******************************************************************************
336 334
337 /******************************************************************************* 335 $Function: bookCallDetailsWinCB
338 336
339 $Function: bookCallDetailsWinCB 337 $Description: Window call back function
340 338
341 $Description: Window call back function 339 $Returns: MFW_EVENT_CONSUMED
342 340
343 $Returns: MFW_EVENT_CONSUMED 341 $Arguments: e, event to be handles, w, window handle
344
345 $Arguments: e, event to be handles, w, window handle
346 342
347 *******************************************************************************/ 343 *******************************************************************************/
348 344
349 static int bookCallDetailsWinCB( MfwEvt e, MfwWin *w ) 345 static int bookCallDetailsWinCB( MfwEvt e, MfwWin *w )
350 { 346 {
351 tBookStandard * data = (tBookStandard *)w->user; 347 tBookStandard * data = (tBookStandard *)w->user;
352 // char *Time; // RAVI 348 // char *Time; // RAVI
353 // char *Date; // RAVI 349 // char *Date; // RAVI
354 350
355 TRACE_FUNCTION("bookCallDetailsWinCB"); 351 TRACE_FUNCTION("bookCallDetailsWinCB");
356 switch( e ) 352 switch( e )
357 { 353 {
358 case MfwWinVisible: 354 case MfwWinVisible:
359 { 355 {
360 /* SPR#1428 - SH - New Editor changes - Just show editor, calculate text 356 /* SPR#1428 - SH - New Editor changes - Just show editor, calculate text
361 * string to display in bookCallDetails() */ 357 * string to display in bookCallDetails() */
362 #ifdef NEW_EDITOR 358 #ifdef NEW_EDITOR
363 ATB_edit_Show(data->editor); 359 ATB_edit_Show(data->editor);
364 resources_setTitleColour(COLOUR_EDITOR); 360 resources_setTitleColour(COLOUR_EDITOR);
365 361
366 /* TITLE */ 362 /* TITLE */
367 363
368 dspl_Clear(0,0, SCREEN_SIZE_X-1, data->editor->attr->win_size.py-1); 364 dspl_Clear(0,0, SCREEN_SIZE_X-1, data->editor->attr->win_size.py-1);
369 PROMPT(0,0,0,TxtDetails); 365 PROMPT(0,0,0,TxtDetails);
370 #else /* NEW_EDITOR */ 366 #else /* NEW_EDITOR */
371 char TempBuffer[32]; 367 char TempBuffer[32];
372 T_MFW_PHB_ENTRY p_pEntry; 368 T_MFW_PHB_ENTRY p_pEntry;
373 tMmiPhbData current = data->phbk->current; 369 tMmiPhbData current = data->phbk->current;
374 T_MFW_PHB_ENTRY *my = &current.entry[ current.selectedName - current.missedCallsOffset ]; 370 T_MFW_PHB_ENTRY *my = &current.entry[ current.selectedName - current.missedCallsOffset ];
375 371
376 /* default screen update prior to painting below 372 /* default screen update prior to painting below
377 */ 373 */
378 dspl_ClearAll(); 374 dspl_ClearAll();
379 375
380 /* try to get the name from the phone book, null the structure out 376 /* try to get the name from the phone book, null the structure out
381 if we can't find it at all 377 if we can't find it at all
382 */ 378 */
383 379
384 #ifdef NO_ASCIIZ 380 #ifdef NO_ASCIIZ
385 { 381 {
386 UBYTE result; 382 UBYTE result;
387 383
388 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) ) 384 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
389 { 385 {
390
391 386
392 //GW Copy name and length 387 //GW Copy name and length
393 bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN); 388 bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN);
394 my->name.len = p_pEntry.name.len; 389 my->name.len = p_pEntry.name.len;
395 } 390 }
396 else 391 else
397 { 392 {
398 TRACE_EVENT(">>>>Length set to zero"); 393 TRACE_EVENT(">>>>Length set to zero");
399 my->name.len = 0; 394 my->name.len = 0;
400 } 395 }
401 396
402 } 397 }
403 #else /* NO_ASCIIZ */ 398 #else /* NO_ASCIIZ */
404 399
405 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) ) 400 if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
406 bookCopyPhbName(my, &p_pEntry, NAME_SCREEN_MAX); //GW Copy name 401 bookCopyPhbName(my, &p_pEntry, NAME_SCREEN_MAX); //GW Copy name
407 else 402 else
408 memset( (char*) my->name, '\0', NAME_SCREEN_MAX ); 403 memset( (char*) my->name, '\0', NAME_SCREEN_MAX );
409 #endif /* NO_ASCIIZ */ 404 #endif /* NO_ASCIIZ */
410 405
411 memset((char*)TempBuffer ,'\0',32); 406 memset((char*)TempBuffer ,'\0',32);
412 407
413 408
414 /* API - 1203 - 30/09/02 - Add the Data and the Time to the TempBuffer to be shown when the details of a 409 /* API - 1203 - 30/09/02 - Add the Data and the Time to the TempBuffer to be shown when the details of a
415 LDN, LMN etc is looked at. Currently commented out as the ACI does not store the 410 LDN, LMN etc is looked at. Currently commented out as the ACI does not store the
416 numbers at present and garbage would be displayed. 411 numbers at present and garbage would be displayed.
417 */ 412 */
418 413
419 /* API - 1542 - 10/01/03 - Update from issue above Added the values written to the structure by ACI to 414 /* API - 1542 - 10/01/03 - Update from issue above Added the values written to the structure by ACI to
420 display them to the user. 415 display them to the user.
421 */ 416 */
422 417
423 /* API - 05/09/03 - SPR2357 - Get the character string for the date and time */ 418 /* API - 05/09/03 - SPR2357 - Get the character string for the date and time */
424 Time = MmiRsrcGetText(TxtCallTime); 419 Time = MmiRsrcGetText(TxtCallTime);
425 Date = MmiRsrcGetText(TxtCallDate); 420 Date = MmiRsrcGetText(TxtCallDate);
426 421
427 sprintf((char*)TempBuffer,"%s%d%d%s%d%d%s %s%d%d%s%d%d%s%d%d%s", 422 sprintf((char*)TempBuffer,"%s%d%d%s%d%d%s %s%d%d%s%d%d%s%d%d%s",
428 Time, (UBYTE) my->time.hour[0], (UBYTE) my->time.hour[1], ":", 423 Time, (UBYTE) my->time.hour[0], (UBYTE) my->time.hour[1], ":",
429 (UBYTE) my->time.minute[0], (UBYTE) my->time.minute[1], "\n", 424 (UBYTE) my->time.minute[0], (UBYTE) my->time.minute[1], "\n",
430 Date, (UBYTE) my->date.day[0], (UBYTE) my->date.day[1], "/", 425 Date, (UBYTE) my->date.day[0], (UBYTE) my->date.day[1], "/",
431 (UBYTE) my->date.month[0], (UBYTE) my->date.month[1], "/", 426 (UBYTE) my->date.month[0], (UBYTE) my->date.month[1], "/",
432 (UBYTE) my->date.year[0], (UBYTE) my->date.year[1], "\n"); 427 (UBYTE) my->date.year[0], (UBYTE) my->date.year[1], "\n");
433 /* API - 05/09/03 - SPR2357 - END */ 428 /* API - 05/09/03 - SPR2357 - END */
434 429
435 430
436 431
437 #ifdef NO_ASCIIZ 432 #ifdef NO_ASCIIZ
438 #ifdef EASY_TEXT_ENABLED 433 #ifdef EASY_TEXT_ENABLED
439 /*MC SPR 1242, changed macros to function calls e.g FIRST_LINE_CHINESE->Mmi_layout_first_line()*/ 434 /*MC SPR 1242, changed macros to function calls e.g FIRST_LINE_CHINESE->Mmi_layout_first_line()*/
440 if (my->name.data[0] ==0x80)//if unicode 435 if (my->name.data[0] ==0x80)//if unicode
441 { //display name as unicode 436 { //display name as unicode
442 dspl_TextOut(0,0, DSPL_TXTATTR_UNICODE, (char *)my->name.data); 437 dspl_TextOut(0,0, DSPL_TXTATTR_UNICODE, (char *)my->name.data);
443 if ((my->name.data[MAX_LINE+2] != 0) && (my->name.data[MAX_LINE+3] != 0)) 438 if ((my->name.data[MAX_LINE+2] != 0) && (my->name.data[MAX_LINE+3] != 0))
444 dspl_TextOut(0, Mmi_layout_first_line(), 0, (char *) &my->name.data[MAX_LINE+2]); 439 dspl_TextOut(0, Mmi_layout_first_line(), 0, (char *) &my->name.data[MAX_LINE+2]);
445 //display number 440 //display number
446 dspl_TextOut(0, Mmi_layout_second_line(), 0, (char *) my->number); 441 dspl_TextOut(0, Mmi_layout_second_line(), 0, (char *) my->number);
447 if (strlen((char *) my->number) > MAX_LINE) 442 if (strlen((char *) my->number) > MAX_LINE)
448 /*MC end*/ dspl_TextOut(0, Mmi_layout_second_line() + 8, 0, (char *) &my->number[MAX_LINE]); 443 /*MC end*/ dspl_TextOut(0, Mmi_layout_second_line() + 8, 0, (char *) &my->number[MAX_LINE]);
449 } 444 }
450 else 445 else
451 #endif /* EASY_TEXT_ENABLED */ 446 #endif /* EASY_TEXT_ENABLED */
452 { 447 {
453 if (CphsPresent() == TRUE) 448 if (CphsPresent() == TRUE)
454 { 449 {
455 sprintf( (char *) data->edtBuf, "%s%s%s%s%d%s%s", 450 sprintf( (char *) data->edtBuf, "%s%s%s%s%d%s%s",
456 (char *) my->name.data, "\n", 451 (char *) my->name.data, "\n",
457 (char *) my->number,"\n Line ", my->line,"\n", 452 (char *) my->number,"\n Line ", my->line,"\n",
458 TempBuffer ); 453 TempBuffer );
459 } 454 }
460 else 455 else
461 sprintf( (char *) data->edtBuf, "%s%s%s%s%s", 456 sprintf( (char *) data->edtBuf, "%s%s%s%s%s",
462 (char *) my->name.data, "\n", 457 (char *) my->name.data, "\n",
463 (char *) my->number,"\n", 458 (char *) my->number,"\n",
464 TempBuffer ); 459 TempBuffer );
465 460
466 /* show the editor and update the soft keys 461 /* show the editor and update the soft keys
467 */ 462 */
468 edtShow( data->edt ); 463 edtShow( data->edt );
469 } 464 }
470 465
471 #else /* NO_ASCIIZ */ 466 #else /* NO_ASCIIZ */
472 if (CphsPresent() == TRUE) 467 if (CphsPresent() == TRUE)
473 { 468 {
474 sprintf( (char *) data->edtBuf, "%s%s%s%s%d%s%s", 469 sprintf( (char *) data->edtBuf, "%s%s%s%s%d%s%s",
475 (char *) my->name, "\n", 470 (char *) my->name, "\n",
476 (char *) my->number,"\n Line ", my->line,"\n", 471 (char *) my->number,"\n Line ", my->line,"\n",
477 TempBuffer ); 472 TempBuffer );
478 } 473 }
479 else 474 else
480 sprintf( (char *) data->edtBuf, "%s%s%s%s%s", 475 sprintf( (char *) data->edtBuf, "%s%s%s%s%s",
481 (char *) my->name, "\n", 476 (char *) my->name, "\n",
482 (char *) my->number,"\n", 477 (char *) my->number,"\n",
483 TempBuffer ); 478 TempBuffer );
484 479
485 /* show the editor and update the soft keys 480 /* show the editor and update the soft keys
486 */ 481 */
487 edtShow( data->edt ); 482 edtShow( data->edt );
488 #endif /* NO_ASCIIZ */ 483 #endif /* NO_ASCIIZ */
489 #endif /* NEW_EDITOR */ 484 #endif /* NEW_EDITOR */
490 485
491 displaySoftKeys( TxtNull, TxtSoftBack ); 486 displaySoftKeys( TxtNull, TxtSoftBack );
492 } 487 }
493 break; 488 break;
494 489
495 default: 490 default:
496 { 491 {
497 /* default processing, we return IGNORED here and let the 492 /* default processing, we return IGNORED here and let the
498 default handler pick up the ball 493 default handler pick up the ball
499 */ 494 */
500 return MFW_EVENT_PASSED; 495 return MFW_EVENT_PASSED;
501 } 496 }
502 } 497 }
503 498
504 return MFW_EVENT_CONSUMED; 499 return MFW_EVENT_CONSUMED;
505 } 500 }
506 501
507 502
508 503 /*******************************************************************************
509 504
510 /******************************************************************************* 505 $Function: bookCallDetailsKeyCB
511 506
512 $Function: bookCallDetailsKeyCB 507 $Description: normal keyboard handler
513 508
514 $Description: normal keyboard handler 509 $Returns: MFW_EVENT_CONSUMED in all cases
515 510
516 $Returns: MFW_EVENT_CONSUMED in all cases 511 $Arguments: e, event to be handled, k keyboard handle
517
518 $Arguments: e, event to be handled, k keyboard handle
519 512
520 *******************************************************************************/ 513 *******************************************************************************/
521 514
522 static int bookCallDetailsKeyCB( MfwEvt e, MfwKbd *k ) 515 static int bookCallDetailsKeyCB( MfwEvt e, MfwKbd *k )
523 { 516 {
524 T_MFW_HND win = mfwParent( mfw_header() ); 517 T_MFW_HND win = mfwParent( mfw_header() );
525 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 518 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
526 tBookStandard *data = (tBookStandard *) win_data->user; 519 tBookStandard *data = (tBookStandard *) win_data->user;
527 520
528 /* make sure we handle null keyboards 521 /* make sure we handle null keyboards
529 */ 522 */
530 if ( k == NULL ) 523 if ( k == NULL )
531 return MFW_EVENT_CONSUMED; 524 return MFW_EVENT_CONSUMED;
532 525
533 /* deal with the incoming key code 526 /* deal with the incoming key code
534 */ 527 */
535 switch( k->code ) 528 switch( k->code )
536 { 529 {
537 case KCD_MNUDOWN: 530 case KCD_MNUDOWN:
538 { 531 {
539 /* scroll down event 532 /* scroll down event
540 */ 533 */
541 534
542 if ( data->phbk->current.selectedName == data->phbk->current.status.used_entries-1 ) 535 if ( data->phbk->current.selectedName == data->phbk->current.status.used_entries-1 )
543 { 536 {
544 data->phbk->current.selectedName = 0; 537 data->phbk->current.selectedName = 0;
545 } 538 }
546 else 539 else
547 data->phbk->current.selectedName++; 540 data->phbk->current.selectedName++;
548 541
549 } 542 }
550 break; 543 break;
551 544
552 case KCD_MNUUP: 545 case KCD_MNUUP:
553 { 546 {
554 /* scroll up event 547 /* scroll up event
555 */ 548 */
556 if ( data->phbk->current.selectedName == 0 ) 549 if ( data->phbk->current.selectedName == 0 )
557 { 550 {
558 data->phbk->current.selectedName = data->phbk->current.status.used_entries-1; 551 data->phbk->current.selectedName = data->phbk->current.status.used_entries-1;
559 } 552 }
560 else 553 else
561 data->phbk->current.selectedName--; 554 data->phbk->current.selectedName--;
562 } 555 }
563 break; 556 break;
564 557
565 case KCD_CALL: 558 case KCD_CALL:
566 { 559 {
567 /* left, implies make call 560 /* left, implies make call
568 */ 561 */
569 callNumber( data->phbk->current.entry[data->phbk->current.selectedName].number ); 562 callNumber( data->phbk->current.entry[data->phbk->current.selectedName].number );
570 bookPhonebookDestroy( data->phbk->win ); 563 bookPhonebookDestroy( data->phbk->win );
571 } 564 }
572 break; 565 break;
573 566
574 case KCD_RIGHT: 567 case KCD_RIGHT:
575 { 568 {
576 bookCallDetailsDestroy(data->win); 569 bookCallDetailsDestroy(data->win);
577 } 570 }
578 break; 571 break;
579 572
580 case KCD_HUP: 573 case KCD_HUP:
581 { 574 {
582 /* clear, destroy the window 575 /* clear, destroy the window
583 */ 576 */
584 bookCallDetailsDestroy( data->win ); 577 bookCallDetailsDestroy( data->win );
585 } 578 }
586 break; 579 break;
587 580
588 default: 581 default:
589 { 582 {
590 /* no default behaviour required 583 /* no default behaviour required
591 */ 584 */
592 } 585 }
593 break; 586 break;
594 } 587 }
595 588
596 /* if we have scrolled then the behaviour needs to be to perform another 589 /* if we have scrolled then the behaviour needs to be to perform another
597 search to get the window updated correctly 590 search to get the window updated correctly
598 */ 591 */
599 if ( ( k->code == KCD_MNUUP ) || ( k->code == KCD_MNUDOWN ) ) 592 if ( ( k->code == KCD_MNUUP ) || ( k->code == KCD_MNUDOWN ) )
600 { 593 {
601 SEND_EVENT(data->win, 0, 0, 0); 594 SEND_EVENT(data->win, 0, 0, 0);
602 winShow( win ); 595 winShow( win );
603 } 596 }
604 597
605 /* and always return consumed 598 /* and always return consumed
606 */ 599 */
607 return MFW_EVENT_CONSUMED; 600 return MFW_EVENT_CONSUMED;
608 } 601 }
609 602
610 603
611 604 /*******************************************************************************
612 /******************************************************************************* 605
613 606 $Function: bookCallDetailsKbdLongCB
614 $Function: bookCallDetailsKbdLongCB 607
615 608 $Description: Keyboard Long Press event handler
616 $Description: Keyboard Long Press event handler 609
617 610 $Returns: MFW_EVENT_CONSUMED always
618 $Returns: MFW_EVENT_CONSUMED always 611
619 612 $Arguments: e, event, k, keyboard handle
620 $Arguments: e, event, k, keyboard handle
621 613
622 *******************************************************************************/ 614 *******************************************************************************/
623 615
624 static int bookCallDetailsKeyLongCB( MfwEvt e, MfwKbd *k ) 616 static int bookCallDetailsKeyLongCB( MfwEvt e, MfwKbd *k )
625 { 617 {
626 T_MFW_HND win = mfwParent( mfw_header() ); 618 T_MFW_HND win = mfwParent( mfw_header() );
627 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 619 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
628 tBookStandard *data = (tBookStandard *) win_data->user; 620 tBookStandard *data = (tBookStandard *) win_data->user;
629 621
630 /* hand a long clear event only 622 /* hand a long clear event only
631 */ 623 */
632 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) ) 624 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) )
633 bookCallDetailsDestroy( data->win ); 625 bookCallDetailsDestroy( data->win );
634 626
635 return MFW_EVENT_CONSUMED; 627 return MFW_EVENT_CONSUMED;
636 } 628 }
637 629
638 630
639 631 /*******************************************************************************
640 632
641 /******************************************************************************* 633 $Function: bookCallDetailsCreate
642 634
643 $Function: bookCallDetailsCreate 635 $Description: Creates the window and associates editors and keyboards
644
645 $Description: Creates the window and associates editors and keyboards
646 with it. 636 with it.
647 637
648 $Returns: handle of the newly created window, or NULL if failure 638 $Returns: handle of the newly created window, or NULL if failure
649 639
650 $Arguments: parent, handle of parent window 640 $Arguments: parent, handle of parent window
651 641
652 *******************************************************************************/ 642 *******************************************************************************/
653 643
654 static T_MFW_HND bookCallDetailsCreate( MfwHnd parent ) 644 static T_MFW_HND bookCallDetailsCreate( MfwHnd parent )
655 { 645 {
656 T_MFW_WIN *win_data; 646 T_MFW_WIN *win_data;
657 tBookStandard *data = (tBookStandard *) ALLOC_MEMORY( sizeof( tBookStandard ) ); 647 tBookStandard *data = (tBookStandard *) ALLOC_MEMORY( sizeof( tBookStandard ) );
658 T_MFW_WIN *parent_win_data = ((T_MFW_HDR *)parent)->data; 648 T_MFW_WIN *parent_win_data = ((T_MFW_HDR *)parent)->data;
659 T_phbk *phbk = (T_phbk *)parent_win_data->user; 649 T_phbk *phbk = (T_phbk *)parent_win_data->user;
660 650
661 TRACE_FUNCTION ("phbk_call_details_create()"); 651 TRACE_FUNCTION ("phbk_call_details_create()");
662 652
663 /* Deal with allocation failure on the data block 653 /* Deal with allocation failure on the data block
664 */ 654 */
665 if ( ! data ) 655 if ( ! data )
666 return NULL; 656 return NULL;
667 657
668 /* create the window 658 /* create the window
669 */ 659 */
670 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookCallDetailsWinCB ) ) == NULL ) 660 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookCallDetailsWinCB ) ) == NULL )
671 return NULL; 661 return NULL;
672 662
673 /* Associate the dialog and user data areas 663 /* Associate the dialog and user data areas
674 */ 664 */
675 data->mmi_control.dialog = (T_DIALOG_FUNC) bookCallDetails; 665 data->mmi_control.dialog = (T_DIALOG_FUNC) bookCallDetails;
676 data->mmi_control.data = data; 666 data->mmi_control.data = data;
677 win_data = ((T_MFW_HDR *)data->win)->data; 667 win_data = ((T_MFW_HDR *)data->win)->data;
678 win_data->user = (void *) data; 668 win_data->user = (void *) data;
679 data->parent_win = parent; 669 data->parent_win = parent;
680 670
681 /* Create the keyboards and editor objects, and associate a phone book handler 671 /* Create the keyboards and editor objects, and associate a phone book handler
682 */ 672 */
683 data->kbd = kbdCreate( data->win, KEY_ALL, (MfwCb) bookCallDetailsKeyCB ); 673 data->kbd = kbdCreate( data->win, KEY_ALL, (MfwCb) bookCallDetailsKeyCB );
684 data->kbd_long = kbdCreate( data->win, KEY_ALL | KEY_LONG, (MfwCb) bookCallDetailsKeyLongCB ); 674 data->kbd_long = kbdCreate( data->win, KEY_ALL | KEY_LONG, (MfwCb) bookCallDetailsKeyLongCB );
685 /*OMAPS00115777 - a0393213(R.Prabakar) - Details of any Missed call number shows Invalid information 675 /*OMAPS00115777 - a0393213(R.Prabakar) - Details of any Missed call number shows Invalid information
686 The phonebook should be set before sending any event to 'call details window'*/ 676 The phonebook should be set before sending any event to 'call details window'*/
687 data->phbk = phbk; 677 data->phbk = phbk;
688 /* 1945 MZ Initialise the edtBuf */ 678 /* 1945 MZ Initialise the edtBuf */
689 memset(data->edtBuf,'\0', STANDARD_EDITOR_SIZE ); 679 memset(data->edtBuf,'\0', STANDARD_EDITOR_SIZE );
690 680
691 /* SPR#1428 - SH - New Editor changes */ 681 /* SPR#1428 - SH - New Editor changes */
692 #ifdef NEW_EDITOR 682 #ifdef NEW_EDITOR
693 AUI_edit_SetAttr( &data->editor_attr, PHB_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT, 683 AUI_edit_SetAttr( &data->editor_attr, PHB_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT,
694 ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_UNICODE/*SPR2102*/, (UBYTE*) data->edtBuf, STANDARD_EDITOR_SIZE); 684 ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_UNICODE/*SPR2102*/, (UBYTE*) data->edtBuf, STANDARD_EDITOR_SIZE);
695 data->editor = ATB_edit_Create(&data->editor_attr,0); 685 data->editor = ATB_edit_Create(&data->editor_attr,0);
696 SEND_EVENT(data->win, 0, 0, 0); 686 SEND_EVENT(data->win, 0, 0, 0);
697 ATB_edit_Init(data->editor); 687 ATB_edit_Init(data->editor);
698 #else/*NEW_EDITOR*/ 688 #else/*NEW_EDITOR*/
699 bookSetEditAttributes( PHB_EDITOR, COLOUR_EDITOR_XX , 0, edtCurBar1, 0, 689 bookSetEditAttributes( PHB_EDITOR, COLOUR_EDITOR_XX , 0, edtCurBar1, 0,
700 (char*) data->edtBuf, STANDARD_EDITOR_SIZE, &data->attr ); 690 (char*) data->edtBuf, STANDARD_EDITOR_SIZE, &data->attr );
701 data->edt = edtCreate( data->win, &data->attr, 0, 0 ); 691 data->edt = edtCreate( data->win, &data->attr, 0, 0 );
702 #endif /*NEW_EDITOR*/ 692 #endif /*NEW_EDITOR*/
703 693
704 694
705 695 /* return the handle to the newly created window
706 /* return the handle to the newly created window 696 */
707 */
708 return data->win; 697 return data->win;
709 } 698 }
710 699
711 700
712 /******************************************************************************* 701 /*******************************************************************************
717 706
718 707
719 708
720 /******************************************************************************* 709 /*******************************************************************************
721 710
722 $Function: bookCallDetailsStart 711 $Function: bookCallDetailsStart
723 712
724 $Description: entry point for the call details window 713 $Description: entry point for the call details window
725 714
726 $Returns: handle of newly created window, or NULL 715 $Returns: handle of newly created window, or NULL
727 716
728 $Arguments: parent, handle of the parent window 717 $Arguments: parent, handle of the parent window
729 718
730 *******************************************************************************/ 719 *******************************************************************************/
731 720
732 T_MFW_HND bookCallDetailsStart( MfwHnd parent ) 721 T_MFW_HND bookCallDetailsStart( MfwHnd parent )
733 { 722 {
734 T_MFW_HND win; 723 T_MFW_HND win;
735 724
736 TRACE_FUNCTION( "bookCallDetailsStart()" ); 725 TRACE_FUNCTION( "bookCallDetailsStart()" );
737 726
738 /* create and initialise the window 727 /* create and initialise the window
739 */ 728 */
740 if ( ( win = bookCallDetailsCreate( parent ) ) != NULL ) 729 if ( ( win = bookCallDetailsCreate( parent ) ) != NULL )
741 SEND_EVENT( win, CALL_DETAILS_INIT, 0, 0 ); 730 SEND_EVENT( win, CALL_DETAILS_INIT, 0, 0 );
742 731
743 /* return the handle, or NULL if it failed to be created correctly 732 /* return the handle, or NULL if it failed to be created correctly
744 */ 733 */
745 return win; 734 return win;
746 } 735 }
747 736
748 737
749 738 /*******************************************************************************
750 /******************************************************************************* 739
751 740 $Function: bookCallDetailsDestroy
752 $Function: bookCallDetailsDestroy 741
753 742 $Description: destroys the call details window
754 $Description: destroys the call details window 743
755 744 $Returns: None.
756 $Returns: None. 745
757 746 $Arguments: window, hande of the window to be destroyed
758 $Arguments: window, hande of the window to be destroyed
759 747
760 *******************************************************************************/ 748 *******************************************************************************/
761 749
762 void bookCallDetailsDestroy( MfwHnd window ) 750 void bookCallDetailsDestroy( MfwHnd window )
763 { 751 {
764 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; 752 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data;
765 tBookStandard *data = (tBookStandard *)win->user; 753 tBookStandard *data = (tBookStandard *)win->user;
766 754
767 TRACE_FUNCTION ("bookCallDetailsDestroy()"); 755 TRACE_FUNCTION ("bookCallDetailsDestroy()");
768 756
769 if ( data ) 757 if ( data )
770 { 758 {
771 /* SPR#1428 - SH - New Editor changes */ 759 /* SPR#1428 - SH - New Editor changes */
772 #ifdef NEW_EDITOR 760 #ifdef NEW_EDITOR
773 /* New editor isn't automatically destroyed with winDelete, 761 /* New editor isn't automatically destroyed with winDelete,
774 * so we destroy it here */ 762 * so we destroy it here */
775 if (data->editor) 763 if (data->editor)
776 { 764 {
777 ATB_edit_Destroy(data->editor); 765 ATB_edit_Destroy(data->editor);
778 } 766 }
779 #endif 767 #endif
780 winDelete( data->win ); 768 winDelete( data->win );
781 FREE_MEMORY( (unsigned char *) data, sizeof( tBookStandard ) ); 769 FREE_MEMORY( (unsigned char *) data, sizeof( tBookStandard ) );
782 } 770 }
783 } 771 }
784 772
785 773
786
787
788
789
790 /******************************************************************************* 774 /*******************************************************************************
791 775
792 End of File 776 End of File
793 777
794 *******************************************************************************/ 778 *******************************************************************************/