comparison src/ui/bmi/mmiBookSDNWindow.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children ec9f955fc487
comparison
equal deleted inserted replaced
91:c3d28a37caad 92:c0052fe355d3
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: MmiBookSDNWindow.c 15 $File: MmiBookSDNWindow.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 module provides the service numbers window for the phone book 25 This module provides the service numbers window for the phone book
26 26
27 ******************************************************************************** 27 ********************************************************************************
28 $History: MmiBookSDNWindow.c 28 $History: MmiBookSDNWindow.c
29 29
30 CRR: 25302 - xpradipg 10 Nov 2004 30 CRR: 25302 - xpradipg 10 Nov 2004
31 Description: Should be able to select the number fro the phonebook while 31 Description: Should be able to select the number fro the phonebook while
32 sending MMS/EMS. 32 sending MMS/EMS.
33 Solution: The new feature to select the number from phonebook while sending 33 Solution: The new feature to select the number from phonebook while sending
34 MMS/EMS is added 34 MMS/EMS is added
35 25/10/00 Original Condat(UK) BMI version. 35 25/10/00 Original Condat(UK) BMI version.
36 36
37 $End 37 $End
38 38
39 *******************************************************************************/ 39 *******************************************************************************/
40 40
41 41
42 42
43 43
44 /******************************************************************************* 44 /*******************************************************************************
45 45
46 Include Files 46 Include Files
47 47
48 *******************************************************************************/ 48 *******************************************************************************/
49 #define ENTITY_MFW 49 #define ENTITY_MFW
50 50
51 /* includes */ 51 /* includes */
52 #include <string.h> 52 #include <string.h>
131 131
132 132
133 133
134 134
135 /******************************************************************************* 135 /*******************************************************************************
136 136
137 Private methods 137 Private methods
138 138
139 *******************************************************************************/ 139 *******************************************************************************/
140 140
141 /******************************************************************************* 141 /*******************************************************************************
142 142
143 $Function: bookSDN 143 $Function: bookSDN
144 144
145 $Description: window dialog function 145 $Description: window dialog function
146 146
147 $Returns: none. 147 $Returns: none.
148 148
149 $Arguments: win, window handle 149 $Arguments: win, window handle
150 event, event to be handled 150 event, event to be handled
151 value, not used 151 value, not used
152 parameter, not used 152 parameter, not used
153 153
154 *******************************************************************************/ 154 *******************************************************************************/
155 155
156 static void bookSDN( T_MFW_HND win, USHORT event, SHORT value, void * parameter ) 156 static void bookSDN( T_MFW_HND win, USHORT event, SHORT value, void * parameter )
157 { 157 {
158 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; 158 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
189 if ( ( my->index==1 ) && ( my->selectedName == 0 ) ) 189 if ( ( my->index==1 ) && ( my->selectedName == 0 ) )
190 { 190 {
191 /* select the correct boundary for the list 191 /* select the correct boundary for the list
192 */ 192 */
193 my->selectedName = my->status.used_entries; 193 my->selectedName = my->status.used_entries;
194 if ( my->selectedName > MAX_SEARCH_NAME ) 194 if ( my->selectedName > MAX_SEARCH_NAME )
195 my->selectedName = MAX_SEARCH_NAME; 195 my->selectedName = MAX_SEARCH_NAME;
196 196
197 /* and subtract one cos we are dealing with an array starting 197 /* and subtract one cos we are dealing with an array starting
198 at zero 198 at zero
199 */ 199 */
335 /******************************************************************************* 335 /*******************************************************************************
336 336
337 $Function: bookSDNWinCB 337 $Function: bookSDNWinCB
338 338
339 $Description: Window call back function 339 $Description: Window call back function
340 340
341 $Returns: status indicating if event handled or not 341 $Returns: status indicating if event handled or not
342 342
343 $Arguments: e, event, w, window handle 343 $Arguments: e, event, w, window handle
344 344
345 *******************************************************************************/ 345 *******************************************************************************/
346 346
347 static int bookSDNWinCB( MfwEvt e, MfwWin *w ) 347 static int bookSDNWinCB( MfwEvt e, MfwWin *w )
348 { 348 {
349 tBookStandard *data = (tBookStandard *)w->user; 349 tBookStandard *data = (tBookStandard *)w->user;
381 ElemPtr = MmiBookCallList(i); 381 ElemPtr = MmiBookCallList(i);
382 ElemSize = MmiBookCallListSize(i); 382 ElemSize = MmiBookCallListSize(i);
383 383
384 /* Decide on whether to use number or name 384 /* Decide on whether to use number or name
385 */ 385 */
386 #ifdef NO_ASCIIZ 386 #ifdef NO_ASCIIZ
387 NumPtr = (char*)data->phbk->current.entry[i].name.data; 387 NumPtr = (char*)data->phbk->current.entry[i].name.data;
388 #else 388 #else
389 NumPtr = (char*)data->phbk->current.entry[i].name; 389 NumPtr = (char*)data->phbk->current.entry[i].name;
390 #endif 390 #endif
391 391
392 if ( *NumPtr == '\0' ) 392 if ( *NumPtr == '\0' )
393 { 393 {
394 NumPtr = (char*)data->phbk->current.entry[i].number; 394 NumPtr = (char*)data->phbk->current.entry[i].number;
395 /* x0045876, 14-Aug-2006 (WR - "Position" was set but never used) */ 395 /* x0045876, 14-Aug-2006 (WR - "Position" was set but never used) */
396 /* Position = POS_END; */ 396 /* Position = POS_END; */
403 /* END: x0045876, 14-Aug-2006 (WR - "Position" was set but never used) */ 403 /* END: x0045876, 14-Aug-2006 (WR - "Position" was set but never used) */
404 404
405 /* Clear the buffer, then fill it with the required value 405 /* Clear the buffer, then fill it with the required value
406 */ 406 */
407 memset( ElemPtr, '\0', ElemSize ); 407 memset( ElemPtr, '\0', ElemSize );
408 /*mc, SPR 1442, replaced old truncation function with new one*/ 408 /*mc, SPR 1442, replaced old truncation function with new one*/
409 resources_truncate_to_screen_width(NumPtr, 0, ElemPtr, ElemSize,SCREEN_SIZE_X, FALSE); 409 resources_truncate_to_screen_width(NumPtr, 0, ElemPtr, ElemSize,SCREEN_SIZE_X, FALSE);
410 } 410 }
411 411
412 /* Show the menu and stick up the find prompt 412 /* Show the menu and stick up the find prompt
413 */ 413 */
452 /******************************************************************************* 452 /*******************************************************************************
453 453
454 $Function: bookSDNKbdCB 454 $Function: bookSDNKbdCB
455 455
456 $Description: Keyboard handler 456 $Description: Keyboard handler
457 457
458 $Returns: stats indicating if event handled or not 458 $Returns: stats indicating if event handled or not
459 (Always MFW_EVENT_CONSUMED) 459 (Always MFW_EVENT_CONSUMED)
460 460
461 $Arguments: e, event, k, keyboard handle 461 $Arguments: e, event, k, keyboard handle
462 462
463 *******************************************************************************/ 463 *******************************************************************************/
464 464
465 static int bookSDNKbdCB( MfwEvt e, MfwKbd *k ) 465 static int bookSDNKbdCB( MfwEvt e, MfwKbd *k )
466 { 466 {
467 T_MFW_HND win = mfwParent(mfw_header()); 467 T_MFW_HND win = mfwParent(mfw_header());
599 /******************************************************************************* 599 /*******************************************************************************
600 600
601 $Function: bookSDNKeyLongCB 601 $Function: bookSDNKeyLongCB
602 602
603 $Description: long keyboard event handler 603 $Description: long keyboard event handler
604 604
605 $Returns: MFW_EVENT_CONSUMED always 605 $Returns: MFW_EVENT_CONSUMED always
606 606
607 $Arguments: e, event to handle, k, keyboard handle 607 $Arguments: e, event to handle, k, keyboard handle
608 608
609 *******************************************************************************/ 609 *******************************************************************************/
610 610
611 static int bookSDNKeyLongCB( MfwEvt e, MfwKbd *k ) 611 static int bookSDNKeyLongCB( MfwEvt e, MfwKbd *k )
612 { 612 {
613 T_MFW_HND win = mfwParent(mfw_header()); 613 T_MFW_HND win = mfwParent(mfw_header());
620 if ( (e & KEY_CLEAR) && (e & KEY_LONG) ) 620 if ( (e & KEY_CLEAR) && (e & KEY_LONG) )
621 { 621 {
622 bookSDNDestroy( win ); 622 bookSDNDestroy( win );
623 data->phbk->search_win = 0; 623 data->phbk->search_win = 0;
624 } 624 }
625 625
626 /* Force event consumed always, prevents default behaviour 626 /* Force event consumed always, prevents default behaviour
627 kicking in 627 kicking in
628 */ 628 */
629 return MFW_EVENT_CONSUMED; 629 return MFW_EVENT_CONSUMED;
630 } 630 }
635 /******************************************************************************* 635 /*******************************************************************************
636 636
637 $Function: bookSDNCreate 637 $Function: bookSDNCreate
638 638
639 $Description: Creates the Service numbers widow 639 $Description: Creates the Service numbers widow
640 640
641 $Returns: Window Handle, or NULL if unsuccessfull 641 $Returns: Window Handle, or NULL if unsuccessfull
642 642
643 $Arguments: Parent, handle of the parent window 643 $Arguments: Parent, handle of the parent window
644 644
645 *******************************************************************************/ 645 *******************************************************************************/
646 646
647 static T_MFW_HND bookSDNCreate( MfwHnd parent ) 647 static T_MFW_HND bookSDNCreate( MfwHnd parent )
648 { 648 {
649 T_MFW_WIN *win_data; 649 T_MFW_WIN *win_data;
655 655
656 /* Create the window 656 /* Create the window
657 */ 657 */
658 if ( ( data->win = win_create (parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookSDNWinCB ) ) == NULL ) 658 if ( ( data->win = win_create (parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookSDNWinCB ) ) == NULL )
659 return NULL; 659 return NULL;
660 660
661 /*SPR 2123, MC allocate memory for phonebook list*/ 661 /*SPR 2123, MC allocate memory for phonebook list*/
662 if (create_mmi_phonebook_names_list() == NULL) 662 if (create_mmi_phonebook_names_list() == NULL)
663 return NULL; 663 return NULL;
664 664
665 /* set up the basic window elements, dialog and user data pointers 665 /* set up the basic window elements, dialog and user data pointers
666 */ 666 */
667 data->mmi_control.dialog = (T_DIALOG_FUNC)bookSDN; 667 data->mmi_control.dialog = (T_DIALOG_FUNC)bookSDN;
668 data->mmi_control.data = data; 668 data->mmi_control.data = data;
669 win_data = ((T_MFW_HDR *)data->win)->data; 669 win_data = ((T_MFW_HDR *)data->win)->data;
707 707
708 708
709 709
710 710
711 /******************************************************************************* 711 /*******************************************************************************
712 712
713 Public methods 713 Public methods
714 714
715 *******************************************************************************/ 715 *******************************************************************************/
716 716
717 /******************************************************************************* 717 /*******************************************************************************
718 718
719 $Function: bookSDNStart 719 $Function: bookSDNStart
720 720
721 $Description: This is the entry point for the service numbers window handler 721 $Description: This is the entry point for the service numbers window handler
722 722
723 $Returns: handle of window we are creating 723 $Returns: handle of window we are creating
724 724
725 $Arguments: Parent, handle of the parent window 725 $Arguments: Parent, handle of the parent window
726 726
727 *******************************************************************************/ 727 *******************************************************************************/
728 728
729 T_MFW_HND bookSDNStart( MfwHnd parent ) 729 T_MFW_HND bookSDNStart( MfwHnd parent )
730 { 730 {
731 T_MFW_HND win; 731 T_MFW_HND win;
783 /* We are still running, so set up the menu and edit structures 783 /* We are still running, so set up the menu and edit structures
784 accordingly, and display the window 784 accordingly, and display the window
785 */ 785 */
786 mnu = (MfwMnu *) mfwControl( data->menu ); 786 mnu = (MfwMnu *) mfwControl( data->menu );
787 mnu->lCursor[ mnu->level ] = data->phbk->current.selectedName; 787 mnu->lCursor[ mnu->level ] = data->phbk->current.selectedName;
788 788
789 /* SPR#1428 - SH - New Editor: editActivate no longer needed */ 789 /* SPR#1428 - SH - New Editor: editActivate no longer needed */
790 #ifndef NEW_EDITOR 790 #ifndef NEW_EDITOR
791 editActivate( data->edt, 1 ); 791 editActivate( data->edt, 1 );
792 #endif 792 #endif
793 winShow( data->win ); 793 winShow( data->win );
804 $Function: bookFindNameInSDNPhonebook 804 $Function: bookFindNameInSDNPhonebook
805 805
806 $Description: This routine performs the FindNameInPhoneBook functionality, 806 $Description: This routine performs the FindNameInPhoneBook functionality,
807 tuned to the particular requirements of the service numbers 807 tuned to the particular requirements of the service numbers
808 phonebook. 808 phonebook.
809 809
810 $Returns: handle of window we are creating 810 $Returns: handle of window we are creating
811 811
812 $Arguments: Parent, handle of the parent window 812 $Arguments: Parent, handle of the parent window
813 813
814 *******************************************************************************/ 814 *******************************************************************************/
815 815
816 int bookFindNameInSDNPhonebook( const char* p_pszNumber, T_MFW_PHB_ENTRY* p_pEntry ) 816 int bookFindNameInSDNPhonebook( const char* p_pszNumber, T_MFW_PHB_ENTRY* p_pEntry )
817 { 817 {
818 T_MFW_PHB_LIST phb_list; 818 T_MFW_PHB_LIST phb_list;
821 #endif 821 #endif
822 SHORT phb_index=0; 822 SHORT phb_index=0;
823 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ 823 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/
824 UBYTE l_name[MAX_ALPHA_LEN]; 824 UBYTE l_name[MAX_ALPHA_LEN];
825 int status; 825 int status;
826 char bfr[80]; 826 char bfr[80];
827 TRACE_FUNCTION("bookFindNameInSDNPhonebook()"); 827 TRACE_FUNCTION("bookFindNameInSDNPhonebook()");
828 828
829 /* guard against dodgy input data 829 /* guard against dodgy input data
830 */ 830 */
831 if( ( p_pszNumber == NULL ) || ( p_pEntry == NULL ) ) 831 if( ( p_pszNumber == NULL ) || ( p_pEntry == NULL ) )
837 memset(p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY)); 837 memset(p_pEntry, 0, sizeof(T_MFW_PHB_ENTRY));
838 memset(&phb_list, 0, sizeof(phb_list)); 838 memset(&phb_list, 0, sizeof(phb_list));
839 phb_list.entry = p_pEntry; 839 phb_list.entry = p_pEntry;
840 phb_list.num_entries = 1; 840 phb_list.num_entries = 1;
841 phb_list.book = PHB_SDN; 841 phb_list.book = PHB_SDN;
842 842
843 //GW Set up data structure for NO_ASCIIZ 843 //GW Set up data structure for NO_ASCIIZ
844 #ifdef NO_ASCIIZ 844 #ifdef NO_ASCIIZ
845 p_pszNumberText.dcs = MFW_DCS_8bits; 845 p_pszNumberText.dcs = MFW_DCS_8bits;
846 p_pszNumberText.len = strlen(p_pszNumber); 846 p_pszNumberText.len = strlen(p_pszNumber);
847 strcpy((char*)p_pszNumberText.data, p_pszNumber); 847 strcpy((char*)p_pszNumberText.data, p_pszNumber);
848 #endif 848 #endif
849 849
850 /* see what we can find using the standard search routine for 850 /* see what we can find using the standard search routine for
851 any phone book, giving the service numbers book as a parameter 851 any phone book, giving the service numbers book as a parameter
852 */ 852 */
853 853
854 #ifdef NO_ASCIIZ 854 #ifdef NO_ASCIIZ
855 status = phb_find_entries( (UBYTE)PHB_SDN, &phb_index, (UBYTE)MFW_PHB_NUMBER, 1, &p_pszNumberText, &phb_list ); 855 status = phb_find_entries( (UBYTE)PHB_SDN, &phb_index, (UBYTE)MFW_PHB_NUMBER, 1, &p_pszNumberText, &phb_list );
856 #else 856 #else
857 status = phb_find_entries( PHB_SDN, &phb_index, MFW_PHB_NUMBER, 1, (char *) p_pszNumber, &phb_list ); 857 status = phb_find_entries( PHB_SDN, &phb_index, MFW_PHB_NUMBER, 1, (char *) p_pszNumber, &phb_list );
858 #endif 858 #endif
859 sprintf(bfr,"len:%2d , name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",p_pEntry->name.len); 859 sprintf(bfr,"len:%2d , name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",p_pEntry->name.len);
860 memcpy(&bfr[16], p_pEntry->name.data, PHB_MAX_LEN); 860 memcpy(&bfr[16], p_pEntry->name.data, PHB_MAX_LEN);
861 TRACE_FUNCTION(bfr); 861 TRACE_FUNCTION(bfr);
862 sprintf(bfr,"number:'%s'",p_pEntry->number); 862 sprintf(bfr,"number:'%s'",p_pEntry->number);
863 TRACE_FUNCTION(bfr); 863 TRACE_FUNCTION(bfr);
864 864
865 if (status != MFW_PHB_OK) 865 if (status != MFW_PHB_OK)
866 { 866 {
867 phb_list.result = MFW_NO_ENTRY; 867 phb_list.result = MFW_NO_ENTRY;
868 TRACE_FUNCTION("bookFindNameInSDNPhonebook()- status error"); 868 TRACE_FUNCTION("bookFindNameInSDNPhonebook()- status error");
869 } 869 }
880 880
881 p_pEntry->name.data[0] = 0x00; 881 p_pEntry->name.data[0] = 0x00;
882 882
883 #else 883 #else
884 bookGsm2Alpha( p_pEntry->name ); 884 bookGsm2Alpha( p_pEntry->name );
885 885
886 #endif 886 #endif
887 887
888 /* if we couldn't find any information, null out the return 888 /* if we couldn't find any information, null out the return
889 structure, this will stop people who don't check the return 889 structure, this will stop people who don't check the return
890 status from getting sensible information 890 status from getting sensible information
905 /******************************************************************************* 905 /*******************************************************************************
906 906
907 $Function: bookSDNDestroy 907 $Function: bookSDNDestroy
908 908
909 $Description: destroys the Service Numbers window 909 $Description: destroys the Service Numbers window
910 910
911 $Returns: none. 911 $Returns: none.
912 912
913 $Arguments: window, handle of the window to be destroyed 913 $Arguments: window, handle of the window to be destroyed
914 914
915 *******************************************************************************/ 915 *******************************************************************************/
916 916
917 void bookSDNDestroy( MfwHnd window ) 917 void bookSDNDestroy( MfwHnd window )
918 { 918 {
919 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; 919 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data;
923 923
924 /* Guard against bad incoming data 924 /* Guard against bad incoming data
925 */ 925 */
926 if ( ! data ) 926 if ( ! data )
927 return; 927 return;
928 928
929 /* SPR#1428 - SH - New Editor changes */ 929 /* SPR#1428 - SH - New Editor changes */
930 #ifdef NEW_EDITOR 930 #ifdef NEW_EDITOR
931 /* Editor is no longer destroyed with winDelete, 931 /* Editor is no longer destroyed with winDelete,
932 * so destroy it here. */ 932 * so destroy it here. */
933 if (data->editor) 933 if (data->editor)
958 destroy_mmi_phonebook_names_list(MmiBookMenuDetailsList()); 958 destroy_mmi_phonebook_names_list(MmiBookMenuDetailsList());
959 } 959 }
960 960
961 961
962 /******************************************************************************* 962 /*******************************************************************************
963 963
964 End of File 964 End of File
965 965
966 *******************************************************************************/ 966 *******************************************************************************/
967 967