comparison src/ui/bmi/mmiSmsSend.c @ 174:6838be2e9067

mmiSmsSend.c: formatting fixes and dead code elimination
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 03:09:30 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
173:0a0d54877239 174:6838be2e9067
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 13 $Project code: BMI
14 $Module: SMS 14 $Module: SMS
15 $File: MmiSmsSend.c 15 $File: MmiSmsSend.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
73 Bug:Not getting proper display, When Messages Memory is Full. 73 Bug:Not getting proper display, When Messages Memory is Full.
74 Fix:A new Dialog displaying "Full Not Saved" will be displayed, 74 Fix:A new Dialog displaying "Full Not Saved" will be displayed,
75 when memory is full and saving a message fails. 75 when memory is full and saving a message fails.
76 76
77 77
78
79
80 Jul 13, 2004 REF: CRR 21615 Deepa M.D 78 Jul 13, 2004 REF: CRR 21615 Deepa M.D
81 Bug:Message once entered into message editor not storing in memory. 79 Bug:Message once entered into message editor not storing in memory.
82 Fix:When a SMS is typed in the Editor, it is stored in a temporary buffer. 80 Fix:When a SMS is typed in the Editor, it is stored in a temporary buffer.
83 When the user accesses the editor,the temporary buffer is copied into the 81 When the user accesses the editor,the temporary buffer is copied into the
84 Editor back. 82 Editor back.
85 83
86 25/10/00 Original Condat(UK) BMI version. 84 25/10/00 Original Condat(UK) BMI version.
87 85
88 $End 86 $End
89 87
90 *******************************************************************************/ 88 *******************************************************************************/
91 89
182 180
183 181
184 /********************************************************************* 182 /*********************************************************************
185 ********************************************************************** 183 **********************************************************************
186 184
187 DYNAMIC MENU WINDOW. DECLARATION 185 DYNAMIC MENU WINDOW. DECLARATION
188 186
189 ********************************************************************* 187 *********************************************************************
190 **********************************************************************/ 188 **********************************************************************/
191 /* MZ 10202, 10758 */ 189 /* MZ 10202, 10758 */
192 static UBYTE* msgBuffer = NULL; 190 static UBYTE* msgBuffer = NULL;
194 /* General functions */ 192 /* General functions */
195 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); 193 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);
196 static int SmsSend_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason); 194 static int SmsSend_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
197 /* SPR#1428 - SH - New Editor: no longer required */ 195 /* SPR#1428 - SH - New Editor: no longer required */
198 #ifndef NEW_EDITOR 196 #ifndef NEW_EDITOR
199 void SmsSend_loadEditDefault(T_EDITOR_DATA * edit_info); 197 void SmsSend_loadEditDefault(T_EDITOR_DATA * edit_info);
200 static void SmsSend_loadUCS2EditDefault(T_EDITOR_DATA *editor_data); 198 static void SmsSend_loadUCS2EditDefault(T_EDITOR_DATA *editor_data);
201 #endif 199 #endif
202 200
203 /* prototyps */ 201 /* prototyps */
204 static T_MFW_HND SmsSend_SEND_create (T_MFW_HND parent); 202 static T_MFW_HND SmsSend_SEND_create (T_MFW_HND parent);
212 static void SmsSend_TEXTEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter); 210 static void SmsSend_TEXTEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter);
213 static void SmsSend_NBEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter); 211 static void SmsSend_NBEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter);
214 static void SmsSend_CENTREEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter); 212 static void SmsSend_CENTREEDIT_exec_cb (T_MFW_HND win, USHORT event, void * parameter);
215 213
216 // Callback functions of the various editors 214 // Callback functions of the various editors
217 static void SmsSend_TEXTEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); 215 static void SmsSend_TEXTEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);
218 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); 216 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);
219 static void SmsSend_CENTREEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); 217 static void SmsSend_CENTREEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);
220 218
221 // Callback function for the MFW events 219 // Callback function for the MFW events
222 static int SmsSend_SEND_mfw_cb (MfwEvt event, void *data); 220 static int SmsSend_SEND_mfw_cb (MfwEvt event, void *data);
223 221
224 // This function initiate the sending of the SMS 222 // This function initiate the sending of the SMS
232 extern UBYTE TempTextBuffer[MAX_MSG_LEN_ARRAY]; 230 extern UBYTE TempTextBuffer[MAX_MSG_LEN_ARRAY];
233 231
234 extern UBYTE reply_path_bit ; 232 extern UBYTE reply_path_bit ;
235 233
236 /*************************************************** 234 /***************************************************
237 **** **** 235 **** ****
238 **** MANAGEMENT OF SMS OPTIONS **** 236 **** MANAGEMENT OF SMS OPTIONS ****
239 **** **** 237 **** ****
240 ***************************************************/ 238 ***************************************************/
241 239
242 240
243 typedef struct 241 typedef struct
244 { 242 {
259 257
260 /* internal data */ 258 /* internal data */
261 259
262 /* !!! **************************************** modify here **************************************** !!!*/ 260 /* !!! **************************************** modify here **************************************** !!!*/
263 BOOL answer; /* TRUE == YES, FALSE == NO */ 261 BOOL answer; /* TRUE == YES, FALSE == NO */
264 T_MFW_HND sms; 262 T_MFW_HND sms;
265 T_MFW_HND dialog_win; 263 T_MFW_HND dialog_win;
266 T_SEND *parent_data; 264 T_SEND *parent_data;
267 /* !!! **************************************** end modify here **************************************** !!! */ 265 /* !!! **************************************** end modify here **************************************** !!! */
268 } T_SMSSEND_R_OPT; 266 } T_SMSSEND_R_OPT;
269 267
270 typedef struct 268 typedef struct
271 { 269 {
276 T_MFW_HND parent; 274 T_MFW_HND parent;
277 T_MFW_HND child_dialog;/* to keep the window of dialog */ 275 T_MFW_HND child_dialog;/* to keep the window of dialog */
278 T_MFW_HND sms_handler; 276 T_MFW_HND sms_handler;
279 SHORT id; 277 SHORT id;
280 /*SPR1991, removed edt_data: not needed*/ 278 /*SPR1991, removed edt_data: not needed*/
281 /* will call from idle or phonebook */ 279 /* will call from idle or phonebook */
282 } T_SAVE; 280 } T_SAVE;
283 281
284 static T_MFW_HND SmsSend_SAVE_create (T_MFW_HND parent); 282 static T_MFW_HND SmsSend_SAVE_create (T_MFW_HND parent);
285 static void SmsSend_SAVE_destroy (T_MFW_HND window); 283 static void SmsSend_SAVE_destroy (T_MFW_HND window);
286 static void SmsSend_SAVE_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); 284 static void SmsSend_SAVE_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
287 static int SmsSend_SAVE_mfw_cb (MfwEvt event, void *info); 285 static int SmsSend_SAVE_mfw_cb (MfwEvt event, void *info);
288 286
289 static T_MFW_HND SmsSend_R_OPT_create (T_MFW_HND parent); 287 static T_MFW_HND SmsSend_R_OPT_create (T_MFW_HND parent);
290 static void SmsSend_R_OPT_destroy (T_MFW_HND window); 288 static void SmsSend_R_OPT_destroy (T_MFW_HND window);
291 static void SmsSend_R_OPT_StandardDialog(T_MFW_HND win, char *text, ULONG duration); 289 static void SmsSend_R_OPT_StandardDialog(T_MFW_HND win, char *text, ULONG duration);
292 static void SmsSend_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); 290 static void SmsSend_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
301 //Sep 01, 2004 REF: CRR 21380 Deepa M.D 299 //Sep 01, 2004 REF: CRR 21380 Deepa M.D
302 static UBYTE memfull=FALSE; //Variable used check whether E_SMS_MEM_FULL event has been received. 300 static UBYTE memfull=FALSE; //Variable used check whether E_SMS_MEM_FULL event has been received.
303 /* !!! **************************************** end modify here **************************************** !!! */ 301 /* !!! **************************************** end modify here **************************************** !!! */
304 302
305 303
306
307 /********************************************************************* 304 /*********************************************************************
308 ********************************************************************** 305 **********************************************************************
309 306
310 DYNAMIC MENU WINDOW. CONTENTS DECLARATION 307 DYNAMIC MENU WINDOW. CONTENTS DECLARATION
311 308
312 ********************************************************************* 309 *********************************************************************
313 **********************************************************************/ 310 **********************************************************************/
314 311
315 /* !!! **************************************** modify here **************************************** !!!*/ 312 /* !!! **************************************** modify here **************************************** !!!*/
329 { 326 {
330 &SmsSend_R_OPTArea, 327 &SmsSend_R_OPTArea,
331 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */ 328 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
332 /* x0045876, 14-Aug-2006 (WR - integer conversion resulted in a change of sign) */ 329 /* x0045876, 14-Aug-2006 (WR - integer conversion resulted in a change of sign) */
333 (UBYTE) -1, /* use default font */ 330 (UBYTE) -1, /* use default font */
334 (MfwMnuItem*)SmsSend_R_OPTItems, /* with these items */ 331 (MfwMnuItem*)SmsSend_R_OPTItems, /* with these items */
335 sizeof(SmsSend_R_OPTItems)/sizeof(MfwMnuItem), /* number of items */ 332 sizeof(SmsSend_R_OPTItems)/sizeof(MfwMnuItem), /* number of items */
336 COLOUR_LIST_SMS, TxtNull, NULL, MNUATTRSPARE 333 COLOUR_LIST_SMS, TxtNull, NULL, MNUATTRSPARE
337
338 }; 334 };
339 335
340 336
341 /*JVJ SPR1298 added a new output parameter to avoid stack overload */ 337 /*JVJ SPR1298 added a new output parameter to avoid stack overload */
342 void convertToUnicodeForOutput( UBYTE * ipText,UBYTE* outText, USHORT* outLen) 338 void convertToUnicodeForOutput( UBYTE * ipText,UBYTE* outText, USHORT* outLen)
343 { 339 {
344
345 int i; 340 int i;
346 UBYTE* temp_conv_buffer = outText; 341 UBYTE* temp_conv_buffer = outText;
347 342
348 if (ipText[0] == 0x80) 343 if (ipText[0] == 0x80)
349 { //skip first 2 chars 344 { //skip first 2 chars
350 *outLen = 0; 345 *outLen = 0;
351 for (i=0;i<MAX_MSG_LEN/2;i++) 346 for (i=0;i<MAX_MSG_LEN/2;i++)
352 { /*SPR 2175, bytes should not be swapped*/ 347 { /*SPR 2175, bytes should not be swapped*/
353 temp_conv_buffer[i*2+1] = ipText[i*2+2+1]; 348 temp_conv_buffer[i*2+1] = ipText[i*2+2+1];
354 temp_conv_buffer[i*2] =ipText[i*2+2]; 349 temp_conv_buffer[i*2] =ipText[i*2+2];
355
356
357
358 350
359 if ((*outLen ==0) && 351 if ((*outLen ==0) &&
360 (temp_conv_buffer[i*2] == 0x00) && 352 (temp_conv_buffer[i*2] == 0x00) &&
361 (temp_conv_buffer[i*2+1] == 0x00)) 353 (temp_conv_buffer[i*2+1] == 0x00))
362 *outLen = i*2+2; 354 *outLen = i*2+2;
364 if (*outLen == 0) 356 if (*outLen == 0)
365 {//Reached end of message without finding 0x0000 - set last word to 0x0000 357 {//Reached end of message without finding 0x0000 - set last word to 0x0000
366 *outLen = MAX_MSG_LEN; 358 *outLen = MAX_MSG_LEN;
367 temp_conv_buffer[MAX_MSG_LEN-2] = 0x00; 359 temp_conv_buffer[MAX_MSG_LEN-2] = 0x00;
368 temp_conv_buffer[MAX_MSG_LEN-1] = 0x00; 360 temp_conv_buffer[MAX_MSG_LEN-1] = 0x00;
369
370
371 } 361 }
372 return; 362 return;
373
374 } 363 }
375 else 364 else
376 { 365 {
377 *outLen = strlen((char*)ipText); 366 *outLen = strlen((char*)ipText);
378 /*MC SPR1319, use string's actual length to convert to GSM alphabet*/ 367 /*MC SPR1319, use string's actual length to convert to GSM alphabet*/
386 375
387 $Function: SmsSend_R_OPTExeSend 376 $Function: SmsSend_R_OPTExeSend
388 377
389 $Description: Start the creation of the main window for SMS Send. 378 $Description: Start the creation of the main window for SMS Send.
390 379
391 $Returns: none 380 $Returns: none
392 381
393 $Arguments: m - Menu handle 382 $Arguments: m - Menu handle
394 i - Menu item selected. 383 i - Menu item selected.
395 384
396 *******************************************************************************/ 385 *******************************************************************************/
397 386
398 static int SmsSend_R_OPTExeSend(MfwMnu* m, MfwMnuItem* i) 387 static int SmsSend_R_OPTExeSend(MfwMnu* m, MfwMnuItem* i)
399 { 388 {
400 T_MFW_HND win = mfwParent(mfw_header()); 389 T_MFW_HND win = mfwParent(mfw_header());
401 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 390 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
402 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user; 391 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user;
403 /* access to data from parent */ 392 /* access to data from parent */
404 T_SEND * parent_data = (T_SEND *)data->parent_data; 393 T_SEND * parent_data = (T_SEND *)data->parent_data;
405
406 394
407 #ifdef NEW_EDITOR 395 #ifdef NEW_EDITOR
408 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 396 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
409 #else 397 #else
410 T_EDITOR_DATA editor_data; 398 T_EDITOR_DATA editor_data;
442 editor_data.Callback = (T_EDIT_CB)SmsSend_NBEDIT_edit_cb; 430 editor_data.Callback = (T_EDIT_CB)SmsSend_NBEDIT_edit_cb;
443 editor_data.destroyEditor = FALSE; 431 editor_data.destroyEditor = FALSE;
444 parent_data->number_editor = editor_start(parent_data->win, &editor_data); /* start the editor */ 432 parent_data->number_editor = editor_start(parent_data->win, &editor_data); /* start the editor */
445 #endif /* NEW_EDITOR */ 433 #endif /* NEW_EDITOR */
446 return 1; // ADDED BY RAVI - 28-11-2005 434 return 1; // ADDED BY RAVI - 28-11-2005
447
448 } 435 }
449 436
450 /******************************************************************************* 437 /*******************************************************************************
451 438
452 $Function: SmsSend_R_OPTExeDiscard 439 $Function: SmsSend_R_OPTExeDiscard
453 440
454 $Description: 441 $Description:
455 442
456 $Returns: execution status 443 $Returns: execution status
457 444
458 $Arguments: m - Menu handle 445 $Arguments: m - Menu handle
459 i - Menu item selected. 446 i - Menu item selected.
460 447
461 *******************************************************************************/ 448 *******************************************************************************/
462 449
463 static int SmsSend_R_OPTExeDiscard(MfwMnu* m, MfwMnuItem* i) 450 static int SmsSend_R_OPTExeDiscard(MfwMnu* m, MfwMnuItem* i)
464 { 451 {
465 T_MFW_HND win = mfwParent(mfw_header()); 452 T_MFW_HND win = mfwParent(mfw_header());
466 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 453 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
467 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user; 454 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user;
468 /* access to data from parent */ 455 /* access to data from parent */
469 T_SEND * parent_data = (T_SEND *)data->parent_data; 456 T_SEND * parent_data = (T_SEND *)data->parent_data;
470 457
471 TRACE_EVENT("SmsSend_R_OPTExeDiscard"); 458 TRACE_EVENT("SmsSend_R_OPTExeDiscard");
472 459
473 SmsSend_R_OPT_destroy(parent_data->options_win); 460 SmsSend_R_OPT_destroy(parent_data->options_win);
488 msgBuffer = NULL; 475 msgBuffer = NULL;
489 } 476 }
490 parent_data->text_editor = 0; 477 parent_data->text_editor = 0;
491 SmsSend_SEND_destroy(parent_data->win); 478 SmsSend_SEND_destroy(parent_data->win);
492 479
493
494 return 1; 480 return 1;
495 } 481 }
496 482
497 483
498 /******************************************************************************* 484 /*******************************************************************************
499 485
500 $Function: SmsSend_R_OPTExeSave 486 $Function: SmsSend_R_OPTExeSave
501 487
502 $Description: called when the user press Call sender in the Option menu 488 $Description: called when the user press Call sender in the Option menu
503 489
504 $Returns: execution status 490 $Returns: execution status
505 491
506 $Arguments: m - Menu handle 492 $Arguments: m - Menu handle
507 i - Menu item selected. 493 i - Menu item selected.
508 494
509 *******************************************************************************/ 495 *******************************************************************************/
510 496
511 static int SmsSend_R_OPTExeSave(MfwMnu* m, MfwMnuItem* i) 497 static int SmsSend_R_OPTExeSave(MfwMnu* m, MfwMnuItem* i)
512 { 498 {
536 522
537 $Function: SmsSend_OPT_start 523 $Function: SmsSend_OPT_start
538 524
539 $Description: called when the user press Call sender in the Option menu 525 $Description: called when the user press Call sender in the Option menu
540 526
541 $Returns: execution status 527 $Returns: execution status
542 528
543 $Arguments: parent_window -parent window handle 529 $Arguments: parent_window -parent window handle
544 menuAttr - Menu attributes. 530 menuAttr - Menu attributes.
545 531
546 *******************************************************************************/ 532 *******************************************************************************/
547 533
548 T_MFW_HND SmsSend_OPT_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) 534 T_MFW_HND SmsSend_OPT_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
549 { 535 {
552 TRACE_FUNCTION ("SmsSend_OPT_start()"); 538 TRACE_FUNCTION ("SmsSend_OPT_start()");
553 539
554 win = SmsSend_R_OPT_create (parent_window); 540 win = SmsSend_R_OPT_create (parent_window);
555 541
556 if (win NEQ NULL) 542 if (win NEQ NULL)
557 { 543 {
558 SEND_EVENT (win, E_INIT, NULL, (void *)menuAttr); 544 SEND_EVENT (win, E_INIT, NULL, (void *)menuAttr);
559 } 545 }
560 return win; 546 return win;
561 } 547 }
562 548
563 /******************************************************************************* 549 /*******************************************************************************
564 550
565 $Function: SmsSend_R_OPT_create 551 $Function: SmsSend_R_OPT_create
566 552
567 $Description: Create the Option window 553 $Description: Create the Option window
568 554
569 $Returns: mfw window handle 555 $Returns: mfw window handle
570 556
571 $Arguments: parent_window -parent window handle 557 $Arguments: parent_window -parent window handle
572 558
573 *******************************************************************************/ 559 *******************************************************************************/
574 560
584 */ 570 */
585 571
586 data->win = 572 data->win =
587 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsSend_R_OPT_win_cb); 573 win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsSend_R_OPT_win_cb);
588 if (data->win EQ NULL) 574 if (data->win EQ NULL)
589 { 575 {
590 return NULL; 576 return NULL;
591 } 577 }
578
592 /* 579 /*
593 * connect the dialog data to the MFW-window 580 * connect the dialog data to the MFW-window
594 */ 581 */
595
596 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_R_OPT_exec_cb; 582 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_R_OPT_exec_cb;
597 data->mmi_control.data = data; 583 data->mmi_control.data = data;
598 win = ((T_MFW_HDR *)data->win)->data; 584 win = ((T_MFW_HDR *)data->win)->data;
599 win->user = (void *)data; 585 win->user = (void *)data;
600 data->parent = parent_window; 586 data->parent = parent_window;
610 596
611 $Function: SmsSend_R_OPT_destroy 597 $Function: SmsSend_R_OPT_destroy
612 598
613 $Description: Destroy the Option window 599 $Description: Destroy the Option window
614 600
615 $Returns: mfw window handle 601 $Returns: mfw window handle
616 602
617 $Arguments: own_window - current window 603 $Arguments: own_window - current window
618 604
619 *******************************************************************************/ 605 *******************************************************************************/
620 606
624 T_SMSSEND_R_OPT * data; 610 T_SMSSEND_R_OPT * data;
625 611
626 TRACE_FUNCTION ("SmsSend_R_OPT_destroy()"); 612 TRACE_FUNCTION ("SmsSend_R_OPT_destroy()");
627 613
628 if (own_window) 614 if (own_window)
629 { 615 {
630 win_data = ((T_MFW_HDR *)own_window)->data; 616 win_data = ((T_MFW_HDR *)own_window)->data;
631 data = (T_SMSSEND_R_OPT *)win_data->user; 617 data = (T_SMSSEND_R_OPT *)win_data->user;
632 618
633 if (data) 619 if (data)
634 { 620 {
635 /* 621 /*
636 * Delete WIN handler 622 * Delete WIN handler
637 */ 623 */
638 data->parent_data->options_win = 0; 624 data->parent_data->options_win = 0;
639 win_delete (data->win); 625 win_delete (data->win);
640 626
641 /* 627 /*
642 * Free Memory 628 * Free Memory
643 */ 629 */
644 FREE_MEMORY ((void *)data, sizeof (T_SMSSEND_R_OPT)); 630 FREE_MEMORY ((void *)data, sizeof (T_SMSSEND_R_OPT));
645 } 631 }
646 else 632 else
647 { 633 {
648 TRACE_EVENT ("SmsSend_R_OPT_destroy() called twice"); 634 TRACE_EVENT ("SmsSend_R_OPT_destroy() called twice");
649 } 635 }
650 } 636 }
651 } 637 }
652 638
653 /******************************************************************************* 639 /*******************************************************************************
654 640
655 $Function: SmsSend_R_OPT_exec_cb 641 $Function: SmsSend_R_OPT_exec_cb
656 642
657 $Description: Exec callback function for the Option window 643 $Description: Exec callback function for the Option window
658 644
659 $Returns: none 645 $Returns: none
660 646
661 $Arguments: win - current window 647 $Arguments: win - current window
662 event - event id 648 event - event id
663 value - unique id 649 value - unique id
664 parameter - optional data. 650 parameter - optional data.
665 651
666 *******************************************************************************/ 652 *******************************************************************************/
667 653
668 void SmsSend_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) 654 void SmsSend_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
669 /* callback handler for events sent to to trigger execution */ 655 /* callback handler for events sent to to trigger execution */
671 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 657 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
672 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user; 658 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user;
673 // T_MFW_HND * l_parent; // RAVI 659 // T_MFW_HND * l_parent; // RAVI
674 // SHORT l_id; // RAVI 660 // SHORT l_id; // RAVI
675 T_MFW_HDR * parent = data->parent; 661 T_MFW_HDR * parent = data->parent;
676 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data; 662 T_MFW_WIN * win_data2 = ((T_MFW_HDR *)parent)->data;
677 T_SEND * parent_data = (T_SEND *)win_data2->user; 663 T_SEND * parent_data = (T_SEND *)win_data2->user;
678 664
679 // T_MFW_EVENT MfwEvents; // RAVI 665 // T_MFW_EVENT MfwEvents; // RAVI
680 666
681 TRACE_FUNCTION ("SmsSend_R_OPT_exec_cb()"); 667 TRACE_FUNCTION ("SmsSend_R_OPT_exec_cb()");
682
683 668
684 switch (event) 669 switch (event)
685 { 670 {
686 case E_INIT: 671 case E_INIT:
687 672
706 691
707 $Function: SmsSend_R_OPT_mnu_cb 692 $Function: SmsSend_R_OPT_mnu_cb
708 693
709 $Description: Menu callback function for the Option window 694 $Description: Menu callback function for the Option window
710 695
711 $Returns: none 696 $Returns: none
712 697
713 $Arguments: e - event id 698 $Arguments: e - event id
714 m - menu handle 699 m - menu handle
715 *******************************************************************************/ 700 *******************************************************************************/
716 701
717 static int SmsSend_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m) 702 static int SmsSend_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m)
718
719 { 703 {
720 T_MFW_HND win = mfwParent(mfw_header()); 704 T_MFW_HND win = mfwParent(mfw_header());
721 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 705 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
722 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user; 706 T_SMSSEND_R_OPT * data = (T_SMSSEND_R_OPT *)win_data->user;
723 // T_MFW_HND * l_parent; // RAVI 707 // T_MFW_HND * l_parent; // RAVI
740 724
741 $Function: SmsSend_R_OPT_win_cb 725 $Function: SmsSend_R_OPT_win_cb
742 726
743 $Description: Window callback function for the Option window 727 $Description: Window callback function for the Option window
744 728
745 $Returns: execution status 729 $Returns: execution status
746 730
747 $Arguments: e - event id 731 $Arguments: e - event id
748 w - window handle 732 w - window handle
749 *******************************************************************************/ 733 *******************************************************************************/
750 734
751 static int SmsSend_R_OPT_win_cb (MfwEvt e, MfwWin *w) 735 static int SmsSend_R_OPT_win_cb (MfwEvt e, MfwWin *w)
752 { 736 {
753 TRACE_FUNCTION ("SmsSend_R_OPT_win_cb()"); 737 TRACE_FUNCTION ("SmsSend_R_OPT_win_cb()");
754 738
755 switch (e) 739 switch (e)
756 { 740 {
757 case MfwWinVisible: /* window is visible */ 741 case MfwWinVisible: /* window is visible */
758 dspl_ClearAll(); 742 dspl_ClearAll();
759 displaySoftKeys(TxtSoftSelect,TxtSoftBack); 743 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
760 break; 744 break;
761 case MfwWinFocussed: /* input focus / selected */ 745 case MfwWinFocussed: /* input focus / selected */
762 case MfwWinDelete: /* window will be deleted */ 746 case MfwWinDelete: /* window will be deleted */
763 default: 747 default:
770 754
771 $Function: SmsSend_R_OPT_kbd_cb 755 $Function: SmsSend_R_OPT_kbd_cb
772 756
773 $Description: Exec callback function for the Option window 757 $Description: Exec callback function for the Option window
774 758
775 $Returns: execution status 759 $Returns: execution status
776 760
777 $Arguments: e - event id 761 $Arguments: e - event id
778 k - keyboard info 762 k - keyboard info
779 *******************************************************************************/ 763 *******************************************************************************/
780 764
781 static int SmsSend_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k) 765 static int SmsSend_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k)
782 /* SmsRead_R_OPT keyboard event handler */ 766 /* SmsRead_R_OPT keyboard event handler */
783 { 767 {
829 813
830 $Function: SmsSend_SEND_start 814 $Function: SmsSend_SEND_start
831 815
832 $Description: Create SMS send window 816 $Description: Create SMS send window
833 817
834 $Returns: execution status 818 $Returns: execution status
835 819
836 $Arguments: parent_window - parent window. 820 $Arguments: parent_window - parent window.
837 UserData - SMS data 821 UserData - SMS data
838 *******************************************************************************/ 822 *******************************************************************************/
839 823
840 T_MFW_HND SmsSend_SEND_start(T_MFW_HND parent_window, T_SmsUserData *UserData) 824 T_MFW_HND SmsSend_SEND_start(T_MFW_HND parent_window, T_SmsUserData *UserData)
841 { 825 {
842 T_MFW_HND win; 826 T_MFW_HND win;
857 841
858 $Function: SmsSend_SEND_create 842 $Function: SmsSend_SEND_create
859 843
860 $Description: Create a window for entering the text 844 $Description: Create a window for entering the text
861 845
862 $Returns: window handle 846 $Returns: window handle
863 847
864 $Arguments: parent_window - parent window. 848 $Arguments: parent_window - parent window.
865 849
866 *******************************************************************************/ 850 *******************************************************************************/
867 851
883 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_main_exec_cb; 867 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_main_exec_cb;
884 data->mmi_control.data = data; 868 data->mmi_control.data = data;
885 win = ((T_MFW_HDR *)data->win)->data; 869 win = ((T_MFW_HDR *)data->win)->data;
886 win->user = (MfwUserDataPtr)data; 870 win->user = (MfwUserDataPtr)data;
887 data->parent = parent_window; 871 data->parent = parent_window;
888 data->id = SEND_ID; 872 data->id = SEND_ID;
889 873
890 winShow(data->win); 874 winShow(data->win);
891 return data->win; 875 return data->win;
892 } 876 }
893 877
895 879
896 $Function: SmsSend_SEND_destroy 880 $Function: SmsSend_SEND_destroy
897 881
898 $Description: Destroy the windows for entering the text 882 $Description: Destroy the windows for entering the text
899 883
900 $Returns: none 884 $Returns: none
901 885
902 $Arguments: own_window - window. 886 $Arguments: own_window - window.
903 887
904 *******************************************************************************/ 888 *******************************************************************************/
905 889
906 static void SmsSend_SEND_destroy(MfwHnd own_window) 890 static void SmsSend_SEND_destroy(MfwHnd own_window)
907 { 891 {
908 T_MFW_WIN * win_data; 892 T_MFW_WIN * win_data;
909 T_SEND * data = NULL; 893 T_SEND * data = NULL;
910 894
911 TRACE_FUNCTION ("SmsSend_SEND_destroy()"); 895 TRACE_FUNCTION ("SmsSend_SEND_destroy()");
912 896
913 if (own_window) 897 if (own_window)
914 { 898 {
915 win_data = ((T_MFW_HDR *)own_window)->data; 899 win_data = ((T_MFW_HDR *)own_window)->data;
916 if (win_data != NULL) 900 if (win_data != NULL)
917 data = (T_SEND *)win_data->user; 901 data = (T_SEND *)win_data->user;
918 902
919 if (data) 903 if (data)
904 {
905 // Delete sms handle
906 if (data->sms_handler != NULL)
907 sms_delete(data->sms_handler);
908
909 if (data->child_dialog != NULL)
920 { 910 {
921 911 TRACE_EVENT("child_dialog not deleted?");
922 // Delete sms handle
923 if (data->sms_handler != NULL)
924 sms_delete(data->sms_handler);
925
926 if (data->child_dialog != NULL)
927 {
928 TRACE_EVENT("child_dialog not deleted?");
929 }
930
931 if (data->text_editor != NULL)
932 {
933 TRACE_EVENT("current_editor not deleted?");
934
935
936 }
937
938
939 // Delete WIN handler
940 win_delete (data->win);
941
942 // Free Memory
943 FREE_MEMORY ((void *)data, sizeof (T_SEND));
944 //win_data->user = NULL;
945 } 912 }
946 else 913
914 if (data->text_editor != NULL)
947 { 915 {
948 TRACE_EVENT ("SmsSend_SEND_destroy() called twice"); 916 TRACE_EVENT("current_editor not deleted?");
949 } 917 }
950 } 918
919 // Delete WIN handler
920 win_delete (data->win);
921
922 // Free Memory
923 FREE_MEMORY ((void *)data, sizeof (T_SEND));
924 //win_data->user = NULL;
925 }
926 else
927 {
928 TRACE_EVENT ("SmsSend_SEND_destroy() called twice");
929 }
930 }
951 } 931 }
952 932
953 /******************************************************************************* 933 /*******************************************************************************
954 934
955 $Function: SmsSend_main_exec_cb 935 $Function: SmsSend_main_exec_cb
956 936
957 $Description: Main callback handler for events sent to to trigger execution 937 $Description: Main callback handler for events sent to to trigger execution
958 938
959 $Returns: none 939 $Returns: none
960 940
961 $Arguments: win - current window 941 $Arguments: win - current window
962 event - event id 942 event - event id
963 identifier - unique id 943 identifier - unique id
964 parameter - optional data. 944 parameter - optional data.
965 *******************************************************************************/ 945 *******************************************************************************/
966 946
967 static void SmsSend_main_exec_cb (T_MFW_HND win, USHORT event, SHORT identifier, void * parameter) 947 static void SmsSend_main_exec_cb (T_MFW_HND win, USHORT event, SHORT identifier, void * parameter)
968 { 948 {
969 TRACE_FUNCTION ("SmsSend_main_exec_cb()"); 949 TRACE_FUNCTION ("SmsSend_main_exec_cb()");
1002 982
1003 $Function: SmsSend_SEND_exec_cb 983 $Function: SmsSend_SEND_exec_cb
1004 984
1005 $Description: Callback handler for events sent by the window itself 985 $Description: Callback handler for events sent by the window itself
1006 986
1007 $Returns: none 987 $Returns: none
1008 988
1009 $Arguments: win - current window 989 $Arguments: win - current window
1010 event - event id 990 event - event id
1011 parameter - optional data. 991 parameter - optional data.
1012 *******************************************************************************/ 992 *******************************************************************************/
1013 993
1014 static void SmsSend_SEND_exec_cb(T_MFW_HND win, USHORT event, void *parameter) 994 static void SmsSend_SEND_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
1015 { 995 {
1016 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 996 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1278 1258
1279 $Function: SmsSend_PHBK_exec_cb 1259 $Function: SmsSend_PHBK_exec_cb
1280 1260
1281 $Description: Callback handler for events sent by the phonebook window 1261 $Description: Callback handler for events sent by the phonebook window
1282 1262
1283 $Returns: none 1263 $Returns: none
1284 1264
1285 $Arguments: win - current window 1265 $Arguments: win - current window
1286 event - event id 1266 event - event id
1287 parameter - optional data. 1267 parameter - optional data.
1288 *******************************************************************************/ 1268 *******************************************************************************/
1289 1269
1290 static void SmsSend_PHBK_exec_cb(T_MFW_HND win, USHORT event, void *parameter) 1270 static void SmsSend_PHBK_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
1291 { 1271 {
1292 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1272 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1329 1309
1330 $Function: SmsSend_TEXTEDIT_exec_cb 1310 $Function: SmsSend_TEXTEDIT_exec_cb
1331 1311
1332 $Description: Callback handler for events sent by the TEXTEDIT editor 1312 $Description: Callback handler for events sent by the TEXTEDIT editor
1333 1313
1334 $Returns: none 1314 $Returns: none
1335 1315
1336 $Arguments: win - current window 1316 $Arguments: win - current window
1337 event - event id 1317 event - event id
1338 parameter - optional data. 1318 parameter - optional data.
1339 *******************************************************************************/ 1319 *******************************************************************************/
1340 1320
1341 static void SmsSend_TEXTEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter) 1321 static void SmsSend_TEXTEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
1342 { 1322 {
1343 TRACE_FUNCTION ("SmsSend_TEXTEDIT_exec_cb()"); 1323 TRACE_FUNCTION ("SmsSend_TEXTEDIT_exec_cb()");
1358 1338
1359 $Function: SmsSend_NBEDIT_exec_cb 1339 $Function: SmsSend_NBEDIT_exec_cb
1360 1340
1361 $Description: Callback handler for events sent by the NBEDIT editor 1341 $Description: Callback handler for events sent by the NBEDIT editor
1362 1342
1363 $Returns: none 1343 $Returns: none
1364 1344
1365 $Arguments: win - current window 1345 $Arguments: win - current window
1366 event - event id 1346 event - event id
1367 parameter - optional data. 1347 parameter - optional data.
1368 *******************************************************************************/ 1348 *******************************************************************************/
1369 1349
1370 static void SmsSend_NBEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter) 1350 static void SmsSend_NBEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
1371 { 1351 {
1372 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1352 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1373 T_SEND * data = (T_SEND *)win_data->user; 1353 T_SEND * data = (T_SEND *)win_data->user;
1374 T_MFW_SMS_INFO sms_parameter; 1354 T_MFW_SMS_INFO sms_parameter;
1375 #ifdef NEW_EDITOR 1355 #ifdef NEW_EDITOR
1376 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ 1356 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
1377 #else 1357 #else
1378 T_EDITOR_DATA editor_data; 1358 T_EDITOR_DATA editor_data;
1379 #endif 1359 #endif
1380 1360
1381 TRACE_FUNCTION ("SmsSend_NBEDIT_exec_cb()"); 1361 TRACE_FUNCTION ("SmsSend_NBEDIT_exec_cb()");
1382 1362
1383 switch (event) 1363 switch (event)
1461 1441
1462 $Function: SmsSend_CENTREEDIT_exec_cb 1442 $Function: SmsSend_CENTREEDIT_exec_cb
1463 1443
1464 $Description: Callback handler for events sent by the CENTREEDIT editor 1444 $Description: Callback handler for events sent by the CENTREEDIT editor
1465 1445
1466 $Returns: none 1446 $Returns: none
1467 1447
1468 $Arguments: win - current window 1448 $Arguments: win - current window
1469 event - event id 1449 event - event id
1470 parameter - optional data. 1450 parameter - optional data.
1471 *******************************************************************************/ 1451 *******************************************************************************/
1472 1452
1473 static void SmsSend_CENTREEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter) 1453 static void SmsSend_CENTREEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
1474 { 1454 {
1475 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1455 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1529 1509
1530 $Function: SmsSend_TEXTEDIT_edit_cb 1510 $Function: SmsSend_TEXTEDIT_edit_cb
1531 1511
1532 $Description: Callback function for the text editor 1512 $Description: Callback function for the text editor
1533 1513
1534 $Returns: none 1514 $Returns: none
1535 1515
1536 $Arguments: win - current window 1516 $Arguments: win - current window
1537 Identifier - unique id 1517 Identifier - unique id
1538 reason - event cause 1518 reason - event cause
1539 *******************************************************************************/ 1519 *******************************************************************************/
1540 1520
1541 static void SmsSend_TEXTEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) 1521 static void SmsSend_TEXTEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
1542 { 1522 {
1543 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1523 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1591 1571
1592 $Function: SmsSend_NBEDIT_edit_cb 1572 $Function: SmsSend_NBEDIT_edit_cb
1593 1573
1594 $Description: Callback function for the number editor 1574 $Description: Callback function for the number editor
1595 1575
1596 $Returns: none 1576 $Returns: none
1597 1577
1598 $Arguments: win - current window 1578 $Arguments: win - current window
1599 Identifier - unique id 1579 Identifier - unique id
1600 reason - event cause 1580 reason - event cause
1601 *******************************************************************************/ 1581 *******************************************************************************/
1602 1582
1603 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) 1583 static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
1604 { 1584 {
1605 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 1585 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1607 1587
1608 T_MFW_SMS_INFO sms_parameter; 1588 T_MFW_SMS_INFO sms_parameter;
1609 USHORT parameter; 1589 USHORT parameter;
1610 1590
1611 TRACE_FUNCTION ("SmsSend_NBEDIT_edit_cb()"); 1591 TRACE_FUNCTION ("SmsSend_NBEDIT_edit_cb()");
1612
1613 1592
1614 switch (reason) 1593 switch (reason)
1615 { 1594 {
1616 case INFO_KCD_LEFT: 1595 case INFO_KCD_LEFT:
1617 // Check if we can go to the next stage 1596 // Check if we can go to the next stage
1714 1693
1715 $Function: SmsSend_CENTREEDIT_edit_cb 1694 $Function: SmsSend_CENTREEDIT_edit_cb
1716 1695
1717 $Description: Callback function for the center number editor 1696 $Description: Callback function for the center number editor
1718 1697
1719 $Returns: none 1698 $Returns: none
1720 1699
1721 $Arguments: win - current window 1700 $Arguments: win - current window
1722 Identifier - unique id 1701 Identifier - unique id
1723 reason - event cause 1702 reason - event cause
1724 *******************************************************************************/ 1703 *******************************************************************************/
1725 1704
1726 static void SmsSend_CENTREEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) 1705 static void SmsSend_CENTREEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
1727 { 1706 {
1728 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI 1707 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
1757 1736
1758 $Function: SmsSend_SEND_mfw_cb 1737 $Function: SmsSend_SEND_mfw_cb
1759 1738
1760 $Description: Callback functyion for handling SMS events from the MFW. 1739 $Description: Callback functyion for handling SMS events from the MFW.
1761 1740
1762 $Returns: execution status 1741 $Returns: execution status
1763 1742
1764 $Arguments: event - window event id 1743 $Arguments: event - window event id
1765 info - optional info 1744 info - optional info
1766 reason - event cause 1745 reason - event cause
1767 *******************************************************************************/ 1746 *******************************************************************************/
1768 1747
1769 static int SmsSend_SEND_mfw_cb (MfwEvt event, void *info) 1748 static int SmsSend_SEND_mfw_cb (MfwEvt event, void *info)
1770 { 1749 {
1771 /* get the top window*/ 1750 /* get the top window*/
1772 T_MFW_HND win = mfw_parent(mfw_header()); 1751 T_MFW_HND win = mfw_parent(mfw_header());
1773 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 1752 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1774 T_SEND * data = (T_SEND *)win_data->user; 1753 T_SEND * data = (T_SEND *)win_data->user;
1775
1776 1754
1777 TRACE_FUNCTION ("SmsSend_SEND_mfw_cb()"); 1755 TRACE_FUNCTION ("SmsSend_SEND_mfw_cb()");
1778 1756
1779 switch (event) 1757 switch (event)
1780 { 1758 {
1836 1814
1837 $Function: SmsSend_SAVE_start 1815 $Function: SmsSend_SAVE_start
1838 1816
1839 $Description: Create the Save SMS text window. 1817 $Description: Create the Save SMS text window.
1840 1818
1841 $Returns: mfw window handle 1819 $Returns: mfw window handle
1842 1820
1843 $Arguments: parent_window - parent window 1821 $Arguments: parent_window - parent window
1844 UserData - SMS info 1822 UserData - SMS info
1845 1823
1846 *******************************************************************************/ 1824 *******************************************************************************/
1847 1825
1848 T_MFW_HND SmsSend_SAVE_start(T_MFW_HND parent_window, T_SmsUserData *UserData) 1826 T_MFW_HND SmsSend_SAVE_start(T_MFW_HND parent_window, T_SmsUserData *UserData)
1849 { 1827 {
1852 TRACE_FUNCTION ("SmsSend_SAVE_start()"); 1830 TRACE_FUNCTION ("SmsSend_SAVE_start()");
1853 1831
1854 win = SmsSend_SAVE_create (parent_window); 1832 win = SmsSend_SAVE_create (parent_window);
1855 1833
1856 if (win NEQ NULL) 1834 if (win NEQ NULL)
1857 { 1835 {
1858 SEND_EVENT (win, E_INIT, 0, (void *)UserData); 1836 SEND_EVENT (win, E_INIT, 0, (void *)UserData);
1859 } 1837 }
1860 return win; 1838 return win;
1861 } 1839 }
1862 1840
1863 /******************************************************************************* 1841 /*******************************************************************************
1864 1842
1865 $Function: SmsSend_SAVE_create 1843 $Function: SmsSend_SAVE_create
1866 1844
1867 $Description: Create a window for info dialog 1845 $Description: Create a window for info dialog
1868 1846
1869 $Returns: mfw window handle 1847 $Returns: mfw window handle
1870 1848
1871 $Arguments: parent_window - parent window 1849 $Arguments: parent_window - parent window
1872 1850
1873 *******************************************************************************/ 1851 *******************************************************************************/
1874 1852
1894 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_SAVE_exec_cb; 1872 data->mmi_control.dialog = (T_DIALOG_FUNC)SmsSend_SAVE_exec_cb;
1895 data->mmi_control.data = data; 1873 data->mmi_control.data = data;
1896 win = ((T_MFW_HDR *)data->win)->data; 1874 win = ((T_MFW_HDR *)data->win)->data;
1897 win->user = (MfwUserDataPtr)data; 1875 win->user = (MfwUserDataPtr)data;
1898 data->parent = parent_window; 1876 data->parent = parent_window;
1899 data->id = SAVE_ID; 1877 data->id = SAVE_ID;
1900 1878
1901 winShow(data->win); 1879 winShow(data->win);
1902 return data->win; 1880 return data->win;
1903 } 1881 }
1904 1882
1906 1884
1907 $Function: SmsSend_SAVE_destroy 1885 $Function: SmsSend_SAVE_destroy
1908 1886
1909 $Description: Destroy the windows for info dialog 1887 $Description: Destroy the windows for info dialog
1910 1888
1911 $Returns: none 1889 $Returns: none
1912 1890
1913 $Arguments: own_window - current window 1891 $Arguments: own_window - current window
1914 1892
1915 *******************************************************************************/ 1893 *******************************************************************************/
1916 1894
1917 static void SmsSend_SAVE_destroy(MfwHnd own_window) 1895 static void SmsSend_SAVE_destroy(MfwHnd own_window)
1918 { 1896 {
1919 T_MFW_WIN * win_data; 1897 T_MFW_WIN * win_data;
1920 T_SAVE * data = NULL; 1898 T_SAVE * data = NULL;
1921 1899
1922 TRACE_FUNCTION ("SmsSend_SAVE_destroy()"); 1900 TRACE_FUNCTION ("SmsSend_SAVE_destroy()");
1923 1901
1924 if (own_window) 1902 if (own_window)
1925 { 1903 {
1926 win_data = ((T_MFW_HDR *)own_window)->data; 1904 win_data = ((T_MFW_HDR *)own_window)->data;
1927 if (win_data) 1905 if (win_data)
1928 data = (T_SAVE *)win_data->user; 1906 data = (T_SAVE *)win_data->user;
1929 1907
1930 if (data) 1908 if (data)
1931 { 1909 {
1932 // Delete sms handle 1910 // Delete sms handle
1933 if (data->sms_handler != NULL) 1911 if (data->sms_handler != NULL)
1934 sms_delete(data->sms_handler); 1912 sms_delete(data->sms_handler);
1935 1913
1936 if (data->child_dialog != NULL) 1914 if (data->child_dialog != NULL)
1937 { 1915 {
1938 TRACE_EVENT("child_dialog not deleted?"); 1916 TRACE_EVENT("child_dialog not deleted?");
1939 } 1917 }
1940 1918
1941 // Delete WIN handler 1919 // Delete WIN handler
1942 win_delete (data->win); 1920 win_delete (data->win);
1943 1921
1944 // Free Memory 1922 // Free Memory
1945 FREE_MEMORY ((void *)data, sizeof (T_SAVE)); 1923 FREE_MEMORY ((void *)data, sizeof (T_SAVE));
1946 1924 }
1947 } 1925 else
1948 else 1926 {
1949 { 1927 TRACE_EVENT ("SmsSend_SAVE_destroy() called twice");
1950 TRACE_EVENT ("SmsSend_SAVE_destroy() called twice"); 1928 }
1951 } 1929 }
1952 }
1953 } 1930 }
1954 1931
1955 /******************************************************************************* 1932 /*******************************************************************************
1956 1933
1957 $Function: SmsSend_SAVE_exec_cb 1934 $Function: SmsSend_SAVE_exec_cb
1958 1935
1959 $Description: Callback handler for events sent to to trigger execution 1936 $Description: Callback handler for events sent to to trigger execution
1960 1937
1961 $Returns: none 1938 $Returns: none
1962 1939
1963 $Arguments: own_window - current window 1940 $Arguments: own_window - current window
1964 1941
1965 *******************************************************************************/ 1942 *******************************************************************************/
1966 1943
2084 2061
2085 $Function: SmsSend_SAVE_mfw_cb 2062 $Function: SmsSend_SAVE_mfw_cb
2086 2063
2087 $Description: Handles SMS events from the MFW. 2064 $Description: Handles SMS events from the MFW.
2088 2065
2089 $Returns: none 2066 $Returns: none
2090 2067
2091 $Arguments: event - event id 2068 $Arguments: event - event id
2092 info - optional info 2069 info - optional info
2093 2070
2094 *******************************************************************************/ 2071 *******************************************************************************/
2095 2072
2096 static int SmsSend_SAVE_mfw_cb (MfwEvt event, void *info) 2073 static int SmsSend_SAVE_mfw_cb (MfwEvt event, void *info)
2097 { 2074 {
2192 2169
2193 $Function: SmsSend_send_to_mfw 2170 $Function: SmsSend_send_to_mfw
2194 2171
2195 $Description: This function sends a SMS message. 2172 $Description: This function sends a SMS message.
2196 2173
2197 $Returns: execution status 2174 $Returns: execution status
2198 2175
2199 $Arguments: event - current window 2176 $Arguments: event - current window
2200 2177
2201 $History 2178 $History
2202 GW 09/10/01 - Added code to convert unicode strings from 8 bits to 7 bits. 2179 GW 09/10/01 - Added code to convert unicode strings from 8 bits to 7 bits.
2203 2180
2204 *******************************************************************************/ 2181 *******************************************************************************/
2205 2182
2206 static int SmsSend_send_to_mfw (T_MFW_HND win) 2183 static int SmsSend_send_to_mfw (T_MFW_HND win)
2207 { 2184 {
2208 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 2185 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
2209 T_SEND * data = (T_SEND *)win_data->user; 2186 T_SEND * data = (T_SEND *)win_data->user;
2210 T_MFW submit_status; /* Result of SMS send operation. */ 2187 T_MFW submit_status; /* Result of SMS send operation. */
2211 T_MFW_SMS_INFO sms_parameter; 2188 T_MFW_SMS_INFO sms_parameter;
2212 2189
2213 USHORT outLen; 2190 USHORT outLen;
2214 2191
2215 /*SPR2453 only alloc memory when you need it */ 2192 /*SPR2453 only alloc memory when you need it */
2225 sms_parameter.dcs = MFW_DCS_7bits; 2202 sms_parameter.dcs = MFW_DCS_7bits;
2226 } 2203 }
2227 2204
2228 SmsSend_set_dcs_number (&sms_parameter); 2205 SmsSend_set_dcs_number (&sms_parameter);
2229 /* Send the SMS */ 2206 /* Send the SMS */
2230
2231
2232 2207
2233 #ifdef NO_ASCIIZ 2208 #ifdef NO_ASCIIZ
2234 { 2209 {
2235 2210
2236 convertToUnicodeForOutput(data->edt_data.TextBuffer,msgBuffer, &outLen); 2211 convertToUnicodeForOutput(data->edt_data.TextBuffer,msgBuffer, &outLen);
2259 (char *)data->edt_data.NumberBuffer, /* dest. address */ 2234 (char *)data->edt_data.NumberBuffer, /* dest. address */
2260 msgBuffer, /* sms message */ 2235 msgBuffer, /* sms message */
2261 outLen, // sbh - added this, see function definition 2236 outLen, // sbh - added this, see function definition
2262 (char *)data->edt_data.CentreBuffer);/* sevice center num. */ 2237 (char *)data->edt_data.CentreBuffer);/* sevice center num. */
2263 2238
2264
2265 #endif 2239 #endif
2266 2240
2267 } 2241 }
2268 #endif 2242 #endif
2269
2270
2271 2243
2272 /* display "Please wait" for sent sms */ 2244 /* display "Please wait" for sent sms */
2273 if (submit_status EQ MFW_SMS_OK) 2245 if (submit_status EQ MFW_SMS_OK)
2274 { 2246 {
2275 T_DISPLAY_DATA display_info; 2247 T_DISPLAY_DATA display_info;
2304 2276
2305 $Function: SmsSend_get_config_data 2277 $Function: SmsSend_get_config_data
2306 2278
2307 $Description: Called by external processes to read SMS PP config data. 2279 $Description: Called by external processes to read SMS PP config data.
2308 2280
2309 $Returns: execution status 2281 $Returns: execution status
2310 2282
2311 $Arguments: config_data - SMS info 2283 $Arguments: config_data - SMS info
2312 2284
2313 *******************************************************************************/ 2285 *******************************************************************************/
2314 2286
2315 UBYTE SmsSend_get_config_data (T_MFW_SMS_INFO *config_data) 2287 UBYTE SmsSend_get_config_data (T_MFW_SMS_INFO *config_data)
2316 { 2288 {
2317 T_MFW Submit_Status; /* store theh result of SMS send operation. */ 2289 T_MFW Submit_Status; /* store theh result of SMS send operation. */
2318 2290
2319 TRACE_FUNCTION ("SmsSend_get_config_data()"); 2291 TRACE_FUNCTION ("SmsSend_get_config_data()");
2320 // get the current config data from SIM 2292 // get the current config data from SIM
2321 Submit_Status = sms_parameter(config_data, TRUE); 2293 Submit_Status = sms_parameter(config_data, TRUE);
2322 2294
2323 if (Submit_Status == MFW_SMS_FAIL) 2295 if (Submit_Status == MFW_SMS_FAIL)
2324 { 2296 {
2325 TRACE_EVENT ("ret MFW_SMS_FAIL"); 2297 TRACE_EVENT ("ret MFW_SMS_FAIL");
2335 2307
2336 $Function: SmsSend_set_SrvCntr_number 2308 $Function: SmsSend_set_SrvCntr_number
2337 2309
2338 $Description: Called by external processes to write/Set SMS PP config data. 2310 $Description: Called by external processes to write/Set SMS PP config data.
2339 2311
2340 $Returns: execution status 2312 $Returns: execution status
2341 2313
2342 $Arguments: config_data - SMS info 2314 $Arguments: config_data - SMS info
2343 2315
2344 *******************************************************************************/ 2316 *******************************************************************************/
2345 2317
2346 UBYTE SmsSend_set_SrvCntr_number (T_MFW_SMS_INFO *config_data) 2318 UBYTE SmsSend_set_SrvCntr_number (T_MFW_SMS_INFO *config_data)
2347 { 2319 {
2348 T_MFW Submit_Status; /* store theh result of SMS send operation. */ 2320 T_MFW Submit_Status; /* store theh result of SMS send operation. */
2349 2321
2350 TRACE_FUNCTION ("SmsSend_set_SrvCntr_number()"); 2322 TRACE_FUNCTION ("SmsSend_set_SrvCntr_number()");
2351 // get the current config data from SIM 2323 // get the current config data from SIM
2352 Submit_Status = sms_set_SrvCntr_number(config_data); 2324 Submit_Status = sms_set_SrvCntr_number(config_data);
2353 2325
2354 if (Submit_Status == MFW_SMS_FAIL) 2326 if (Submit_Status == MFW_SMS_FAIL)
2355 { 2327 {
2356 TRACE_EVENT ("ret MFW_SMS_FAIL"); 2328 TRACE_EVENT ("ret MFW_SMS_FAIL");
2360 { 2332 {
2361 TRACE_EVENT ("ret OK"); 2333 TRACE_EVENT ("ret OK");
2362 return TRUE; 2334 return TRUE;
2363 } 2335 }
2364 } 2336 }
2337
2365 UBYTE SmsSend_set_dcs_number (T_MFW_SMS_INFO *config_data) 2338 UBYTE SmsSend_set_dcs_number (T_MFW_SMS_INFO *config_data)
2366 { 2339 {
2367 T_MFW Submit_Status; /* store theh result of SMS send operation. */ 2340 T_MFW Submit_Status; /* store theh result of SMS send operation. */
2368 2341
2369 TRACE_EVENT ("SmsSend_set_dcs_number()"); 2342 TRACE_EVENT ("SmsSend_set_dcs_number()");
2370 // get the current config data from SIM 2343 // get the current config data from SIM
2371 Submit_Status = sms_set_dcs_number(config_data); 2344 Submit_Status = sms_set_dcs_number(config_data);
2372 2345
2373 if (Submit_Status == MFW_SMS_FAIL) 2346 if (Submit_Status == MFW_SMS_FAIL)
2374 { 2347 {
2375 TRACE_EVENT ("ret MFW_SMS_FAIL"); 2348 TRACE_EVENT ("ret MFW_SMS_FAIL");
2380 TRACE_EVENT ("ret OK"); 2353 TRACE_EVENT ("ret OK");
2381 return TRUE; 2354 return TRUE;
2382 } 2355 }
2383 } 2356 }
2384 2357
2385 /* SPR#1428 - SH - New Editor: no longer required */
2386 #ifndef NEW_EDITOR
2387 /*******************************************************************************
2388
2389 $Function: SmsSend_loadEditDefault
2390
2391 $Description: Configure T_EDITOR_DATA structure with default editor settings.
2392
2393 $Returns: none
2394
2395 $Arguments: editor_data - editor data.
2396
2397 *******************************************************************************/
2398
2399 void SmsSend_loadEditDefault(T_EDITOR_DATA *editor_data)
2400 {
2401 TRACE_FUNCTION ("SmsSend_loadEditDefault()");
2402
2403 editor_attr_init(&editor_data->editor_attr, NULL, edtCurBar1, 0, 0, 0, COLOUR_EDITOR);
2404 editor_data_init(editor_data, NULL, TxtSoftSelect, TxtSoftBack, 0, 1, ALPHA_MODE, FOREVER);
2405 editor_data->hide = FALSE;
2406 editor_data->AlternateLeftSoftKey = TxtNull;
2407 editor_data->Identifier = 0;
2408 editor_data->TextString = NULL;
2409 editor_data->destroyEditor = TRUE ;
2410 }
2411
2412
2413 /*******************************************************************************
2414
2415 $Function: SmsSend_loadUCS2EditDefault
2416
2417 $Description: Configure T_EDITOR2_DATA structure with default editor settings.
2418
2419 $Returns: none
2420
2421 $Arguments: editor_data - editor data.
2422
2423 *******************************************************************************/
2424
2425 static void SmsSend_loadUCS2EditDefault(T_EDITOR_DATA *editor_data)
2426 {
2427 TRACE_FUNCTION ("SmsSend_loadUCS2EditDefault()");
2428
2429 memset(editor_data, 0, sizeof(T_EDITOR_DATA));
2430 editor_data->hide = FALSE;
2431 editor_data->LeftSoftKey = TxtSend;
2432 editor_data->AlternateLeftSoftKey = TxtSend;
2433 editor_data->RightSoftKey = TxtSave;
2434 editor_data->Identifier = SMSSEND_ID_TEXTEDIT;
2435 editor_data->mode = ALPHA_MODE;
2436 editor_data->min_enter = 0;
2437 editor_data->timeout = FOREVER;
2438 editor_data->Callback = (T_EDIT_CB)SmsSend_TEXTEDIT_edit_cb;
2439 }
2440 #endif /* NEW_EDITOR */
2441
2442
2443 /******************************************************************************* 2358 /*******************************************************************************
2444 2359
2445 $Function: SmsSend_standard_dialog_cb 2360 $Function: SmsSend_standard_dialog_cb
2446 2361
2447 $Description: Callback function for standard dialogs in smssend module 2362 $Description: Callback function for standard dialogs in smssend module
2448 2363
2449 $Returns: none 2364 $Returns: none
2450 2365
2451 $Arguments: win - current window 2366 $Arguments: win - current window
2452 Identifier - unique id 2367 Identifier - unique id
2453 Reason - event id 2368 Reason - event id
2454 2369
2455 *******************************************************************************/ 2370 *******************************************************************************/
2456 2371
2457 static int SmsSend_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason) 2372 static int SmsSend_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
2458 { 2373 {
2459 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 2374 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
2460 T_SAVE * save_data = NULL; 2375 T_SAVE * save_data = NULL;
2461 T_SEND * send_data = NULL; 2376 T_SEND * send_data = NULL;
2462 T_MFW_HND * l_parent = NULL; 2377 T_MFW_HND * l_parent = NULL;
2463 2378
2464 TRACE_FUNCTION ("SmsSend_standard_dialog_cb()"); 2379 TRACE_FUNCTION ("SmsSend_standard_dialog_cb()");
2465
2466
2467 2380
2468 switch (Identifier) 2381 switch (Identifier)
2469 { 2382 {
2470
2471 case SMSSEND_ID_SAVE_NOT_READY: 2383 case SMSSEND_ID_SAVE_NOT_READY:
2472 case SMSSEND_ID_SC_NOT_READY: 2384 case SMSSEND_ID_SC_NOT_READY:
2473 // SEND an event to recreate the text editor 2385 // SEND an event to recreate the text editor
2474 // or to recreate the destination address number editor 2386 // or to recreate the destination address number editor
2475 SEND_EVENT (win, E_RETURN, Identifier, NULL); 2387 SEND_EVENT (win, E_RETURN, Identifier, NULL);
2525 SEND_EVENT(l_parent, E_EXIT, SAVE_ID, NULL); 2437 SEND_EVENT(l_parent, E_EXIT, SAVE_ID, NULL);
2526 2438
2527 } 2439 }
2528 break; 2440 break;
2529 2441
2530
2531 default: 2442 default:
2532 TRACE_EVENT("MFW_EVENT_REJECTED"); 2443 TRACE_EVENT("MFW_EVENT_REJECTED");
2533 return MFW_EVENT_REJECTED; 2444 return MFW_EVENT_REJECTED;
2534 } 2445 }
2535 return MFW_EVENT_CONSUMED; 2446 return MFW_EVENT_CONSUMED;
2538 /******************************************************************************* 2449 /*******************************************************************************
2539 2450
2540 $Function: SmsSend_convert_to_inter 2451 $Function: SmsSend_convert_to_inter
2541 2452
2542 $Description: Transform a phone number in T_MFW_SMS_ADDR format to a string 2453 $Description: Transform a phone number in T_MFW_SMS_ADDR format to a string
2543 with a '+' character if international number 2454 with a '+' character if international number
2544 2455
2545 $Returns: none 2456 $Returns: none
2546 2457
2547 $Arguments: source_number - calling number 2458 $Arguments: source_number - calling number
2548 dest_number - called number 2459 dest_number - called number
2549 *******************************************************************************/ 2460 *******************************************************************************/
2550 2461
2551 void SmsSend_convert_to_inter(T_MFW_SMS_ADDR *source_number, // The number to convert 2462 void SmsSend_convert_to_inter(T_MFW_SMS_ADDR *source_number, // The number to convert
2552 char *dest_number) // The dest number with a '+' if needed 2463 char *dest_number) // The dest number with a '+' if needed
2553 { 2464 {
2554 USHORT nb_char; 2465 USHORT nb_char;
2555 USHORT i = 0; 2466 USHORT i = 0;
2556 char *pt_digit = dest_number; 2467 char *pt_digit = dest_number;
2557 2468
2573 2484
2574 $Function: SmsSend_R_OPTExeCentreEdit 2485 $Function: SmsSend_R_OPTExeCentreEdit
2575 2486
2576 $Description: Create editor for entering the Service center number. 2487 $Description: Create editor for entering the Service center number.
2577 2488
2578 $Returns: none 2489 $Returns: none
2579 2490
2580 $Arguments: m - menu handler 2491 $Arguments: m - menu handler
2581 i - menu item selected. 2492 i - menu item selected.
2582 *******************************************************************************/ 2493 *******************************************************************************/
2583 2494
2584 2495
2585 int SmsSend_R_OPTExeCentreEdit(MfwMnu* m, MfwMnuItem* i) 2496 int SmsSend_R_OPTExeCentreEdit(MfwMnu* m, MfwMnuItem* i)
2586 { 2497 {
2593 2504
2594 $Function: SmsSend_SCNBEDIT_edit_cb 2505 $Function: SmsSend_SCNBEDIT_edit_cb
2595 2506
2596 $Description: Callback function for the SC number editor. 2507 $Description: Callback function for the SC number editor.
2597 2508
2598 $Returns: none 2509 $Returns: none
2599 2510
2600 $Arguments: win - current window 2511 $Arguments: win - current window
2601 Identifier - unique id 2512 Identifier - unique id
2602 reason - event cause 2513 reason - event cause
2603 *******************************************************************************/ 2514 *******************************************************************************/
2604 2515
2605 static void SmsSend_SCNBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) 2516 static void SmsSend_SCNBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
2606 { 2517 {
2607 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; 2518 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
2608 T_SEND * data = (T_SEND *)win_data->user; 2519 T_SEND * data = (T_SEND *)win_data->user;
2609 2520
2610 T_MFW_SMS_INFO sms_parameter; 2521 T_MFW_SMS_INFO sms_parameter;
2611 2522
2612
2613 TRACE_FUNCTION ("SmsSend_SCNBEDIT_edit_cb()"); 2523 TRACE_FUNCTION ("SmsSend_SCNBEDIT_edit_cb()");
2614
2615 2524
2616 switch (reason) 2525 switch (reason)
2617 { 2526 {
2618 case INFO_KCD_LEFT: 2527 case INFO_KCD_LEFT:
2619 TRACE_EVENT("INFO_KCD_LEFT"); 2528 TRACE_EVENT("INFO_KCD_LEFT");
2679 // KEY_RIGHT and KEY_HUP registered instead of KEY_ALL 2588 // KEY_RIGHT and KEY_HUP registered instead of KEY_ALL
2680 /******************************************************************************* 2589 /*******************************************************************************
2681 2590
2682 $Function: mmi_dialog_information_screen_save_sms 2591 $Function: mmi_dialog_information_screen_save_sms
2683 2592
2684 $Description: Function to display SMS "Saved" info screen 2593 $Description: Function to display SMS "Saved" info screen
2685 2594
2686 $Returns: info_dialog 2595 $Returns: info_dialog
2687 2596
2688 $Arguments: 2597 $Arguments:
2689 2598
2694 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS); 2603 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS);
2695 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_RIGHT | KEY_HUP ); 2604 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_RIGHT | KEY_HUP );
2696 display_info.TextString2 = text; 2605 display_info.TextString2 = text;
2697 display_info.Identifier = identifier; 2606 display_info.Identifier = identifier;
2698 return info_dialog(parent_win,&display_info); //information screen 2607 return info_dialog(parent_win,&display_info); //information screen
2699
2700 } 2608 }
2701 2609
2702 #undef MMI_SMSSEND_C 2610 #undef MMI_SMSSEND_C