FreeCalypso > hg > tcs211-l1-reconst
comparison g23m/condat/ms/src/bmi/mmimmssetting.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /******************************************************************************* | |
2 | |
3 TI (Shanghai) | |
4 | |
5 ******************************************************************************** | |
6 | |
7 This software product is the property of TI (Shanghai) Ltd and may not be | |
8 disclosed to any third party without the express permission of the owner. | |
9 | |
10 ******************************************************************************** | |
11 | |
12 $Project name: TISHMMS Project | |
13 $Project code: BMI (6349) | |
14 $Module: MMS | |
15 $File: MmiMMSSetting.c | |
16 $Revision: 1.0 | |
17 | |
18 $Author: Yan Bin(bin-yan@ti.com) | |
19 $Date: 26/08/03 | |
20 | |
21 ******************************************************************************** | |
22 | |
23 Description: | |
24 | |
25 This module provides definitions of the types and | |
26 constants which are shared across the MMS | |
27 application modules. | |
28 | |
29 ******************************************************************************** | |
30 $History: MmiMMSSetting.c | |
31 | |
32 Bug Id 26: 16 Aug 2004 | |
33 Description: The MMSc Address is changed pressing the delete sokftkey / the hangup key | |
34 Solution: The change is stored onto a temporary buffer and updated only when the user confirms | |
35 | |
36 17/01/04 Replace mfw edit with AUI edit. | |
37 | |
38 29/10/03 Original TI(Shanghai) BMI version. | |
39 | |
40 $End | |
41 | |
42 *******************************************************************************/ | |
43 | |
44 #define MMI_MMSSETTING_C | |
45 | |
46 #define ENTITY_MFW | |
47 | |
48 /* includes */ | |
49 #include <string.h> | |
50 #include <stdio.h> | |
51 #include <stdlib.h> | |
52 | |
53 #if defined (NEW_FRAME) | |
54 | |
55 #include "typedefs.h" | |
56 #include "vsi.h" | |
57 #include "pei.h" | |
58 #include "custom.h" | |
59 #include "gsm.h" | |
60 | |
61 #else | |
62 | |
63 #include "STDDEFS.H" | |
64 #include "custom.h" | |
65 #include "gsm.h" | |
66 #include "vsi.h" | |
67 | |
68 #endif | |
69 #include "prim.h" | |
70 | |
71 #include "mfw_mfw.h" | |
72 #include "mfw_win.h" | |
73 | |
74 #include "mfw_tim.h" | |
75 #include "mfw_phb.h" | |
76 #include "ksd.h" | |
77 #include "psa.h" | |
78 #include "mfw_sms.h" | |
79 #include "mfw_smsi.h" | |
80 #include "mfw_icn.h" | |
81 #include "mfw_mnu.h" | |
82 #include "mfw_lng.h" | |
83 #include "mfw_sat.h" | |
84 #include "mfw_kbd.h" | |
85 #include "mfw_nm.h" | |
86 | |
87 | |
88 #include "dspl.h" | |
89 | |
90 #include "MmiMain.h" | |
91 #include "MmiDummy.h" | |
92 #include "MmiMmi.h" | |
93 | |
94 #include "MmiDialogs.h" | |
95 #include "MmiLists.h" | |
96 #include "MmiMenu.h" | |
97 #include "MmiSoftKeys.h" | |
98 | |
99 #ifdef NEW_EDITOR | |
100 #include "ATBCommon.h" | |
101 #include "ATBDisplay.h" | |
102 #include "ATBEditor.h" | |
103 #include "AUIEditor.h" | |
104 #else /* NEW_EDITOR */ | |
105 #ifdef EASY_TEXT_ENABLED | |
106 #include "MmiLatinPredText.h" | |
107 #endif /* EASY_TEXT_ENABLED */ | |
108 #include "MmiEditor.h" | |
109 #endif /* NEW_EDITOR */ | |
110 | |
111 #include "MmiBookShared.h" | |
112 #include "mmimmsmenu.h" | |
113 #include "mmimmssetting.h" | |
114 #include "mmiwindow.h" | |
115 | |
116 #include "mmiSmsMenu.h" | |
117 #include "mmismssend.h" | |
118 | |
119 #include "cus_aci.h" | |
120 | |
121 #include "mfw_ffs.h" | |
122 //#include "pcm.h" | |
123 | |
124 #include "mmiColours.h" | |
125 | |
126 //Bug ID 26: 16 Aug 2004 - xpradipg | |
127 //the maximum length of the MMSc Address | |
128 #define MMS_ADDR_MAX_LEN 150 | |
129 | |
130 | |
131 static char scenter[32]="\0"; | |
132 static T_MFW_HND editor=NULL; | |
133 //Bug Id 26: 16 Aug 2004 - xpradipg | |
134 //Temporary buffer added to hold the MMSc address, the address is updated only | |
135 //when the user confirms | |
136 UBYTE *Temp_MMSC_Addr; | |
137 static void MMSSetting_edit_cb( T_MFW_HND win, USHORT Identifier,UBYTE reason) | |
138 { | |
139 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
140 T_DISPLAY_DATA display_info; | |
141 char* pMmscAddress = NULL; | |
142 TRACE_EVENT_P1("MMSSetting_edit_cb() %d", Identifier); | |
143 | |
144 | |
145 switch (reason) | |
146 { | |
147 case INFO_KCD_LEFT: // confirm (press LEFT soft key) | |
148 TRACE_EVENT_P1("scenter: %s",scenter); | |
149 //Bug Id 26: 16 Aug 2004 - xpradipg | |
150 //retrieve the original buffer to which the MMSc address is to be updated | |
151 //and update and save it with the temprorary buffer contents | |
152 pMmscAddress =(char*) ATB_mms_get_MmscAddress(); | |
153 strcpy(pMmscAddress,(char*)Temp_MMSC_Addr); | |
154 ATB_mms_profile_save(); | |
155 /* save mmsc profile */ | |
156 MMI_DestoryWindow(win); | |
157 break; | |
158 | |
159 case INFO_KCD_RIGHT: | |
160 case INFO_KCD_HUP: | |
161 MMI_DestoryWindow(win); | |
162 break; | |
163 default: | |
164 TRACE_EVENT("Err: Default"); | |
165 break; | |
166 } | |
167 | |
168 } | |
169 | |
170 /******************************************************************************* | |
171 | |
172 $Function: MMSSetting_exec_cb | |
173 | |
174 $Description: Callback handler for events sent by the window itself | |
175 | |
176 $Returns: none | |
177 | |
178 $Arguments: win - current window | |
179 event - event id | |
180 parameter - optional data. | |
181 *******************************************************************************/ | |
182 extern char* ATB_mms_get_MmscAddress(void); | |
183 static void MMSSetting_exec_cb(T_MFW_HND win, USHORT event, void *parameter) | |
184 { | |
185 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | |
186 //T_EDITOR_DATA editor_data; | |
187 T_AUI_EDITOR_DATA editor_data; | |
188 char* pMmscAddress = NULL; | |
189 | |
190 | |
191 TRACE_FUNCTION ("MMSSetting_exec_cb()"); | |
192 | |
193 switch (event) | |
194 { | |
195 case MWM_CREATE: | |
196 //MMSSetting_loadEditDefault(&editor_data); | |
197 //Bug Id 26: 16 Aug 2004 - xpradipg | |
198 //Allocate memory to hold the MMSc Address | |
199 Temp_MMSC_Addr=(UBYTE*)mfwAlloc(MMS_ADDR_MAX_LEN+1); | |
200 memset(Temp_MMSC_Addr,'\0',MMS_ADDR_MAX_LEN+1); | |
201 pMmscAddress = ATB_mms_get_MmscAddress(); | |
202 //Bug Id 26: 16 Aug 2004 - xpradipg | |
203 //and retrieve the current MMSc address to the temp buffer | |
204 strcpy((char*)Temp_MMSC_Addr,pMmscAddress); | |
205 AUI_edit_SetDefault(&editor_data); | |
206 AUI_edit_SetDisplay(&editor_data, PHNO_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); | |
207 AUI_edit_SetEvents(&editor_data, SMSSEND_ID_NBEDIT, TRUE, FOREVER, (T_AUI_EDIT_CB)MMSSetting_edit_cb); | |
208 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtServiceCentre, NULL); | |
209 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack); | |
210 AUI_edit_SetMode(&editor_data,ED_MODE_ALPHA, ED_CURSOR_UNDERLINE); | |
211 //Bug Id 26: 16 Aug 2004 - xpradipg | |
212 //pass the temporary buffer to the editor | |
213 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)Temp_MMSC_Addr, 50); | |
214 editor = AUI_edit_Start(win, &editor_data); | |
215 break; | |
216 case MWM_ONDRAW: | |
217 break; | |
218 case MWM_DESTORY: | |
219 //Bug Id 26: 16 Aug 2004 - xpradipg | |
220 //free the memory allocated for the temp buffer | |
221 mfwFree(Temp_MMSC_Addr,MMS_ADDR_MAX_LEN+1); | |
222 break; | |
223 default: | |
224 TRACE_EVENT("Err: Default"); | |
225 break; | |
226 } | |
227 } | |
228 | |
229 | |
230 T_MFW_HND MMSSetting_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr) | |
231 { | |
232 MMI_CreateWindow(parent_window, (T_DIALOG_FUNC) MMSSetting_exec_cb, (void *) menuAttr, 0, 0, 0); | |
233 } | |
234 | |
235 | |
236 #undef MMI_MMSSETTING_C | |
237 | |
238 |