FreeCalypso > hg > leo2moko-debug
comparison g23m/condat/ms/src/bmi/MmiMenu.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /******************************************************************************* | |
2 | |
3 CONDAT (UK) | |
4 | |
5 ******************************************************************************** | |
6 | |
7 This software product is the property of Condat (UK) Ltd and may not be | |
8 disclosed to any third party without the express permission of the owner. | |
9 | |
10 ******************************************************************************** | |
11 | |
12 $Project name: Basic MMI | |
13 $Project code: BMI (6349) | |
14 $Module: Menus | |
15 $File: MmiMenu.c | |
16 $Revision: 1.0 | |
17 | |
18 $Author: Condat(UK) | |
19 $Date: 25/10/00 | |
20 | |
21 ******************************************************************************** | |
22 | |
23 Description: | |
24 | |
25 This provides the implementation of the main menu handling for the basic | |
26 MMI | |
27 | |
28 ******************************************************************************** | |
29 $History: MmiMenu.c | |
30 | |
31 25/10/00 Original Condat(UK) BMI version. | |
32 | |
33 $End | |
34 | |
35 *******************************************************************************/ | |
36 | |
37 | |
38 /******************************************************************************* | |
39 | |
40 Include files | |
41 | |
42 *******************************************************************************/ | |
43 | |
44 #define ENTITY_MFW | |
45 | |
46 /* includes */ | |
47 #include <string.h> | |
48 #include <stdio.h> | |
49 #include <stdlib.h> | |
50 | |
51 #if defined (NEW_FRAME) | |
52 | |
53 #include "typedefs.h" | |
54 #include "vsi.h" | |
55 #include "pei.h" | |
56 #include "custom.h" | |
57 #include "gsm.h" | |
58 | |
59 #else | |
60 | |
61 #include "STDDEFS.H" | |
62 #include "custom.h" | |
63 #include "gsm.h" | |
64 #include "vsi.h" | |
65 | |
66 #endif | |
67 #include "mfw_sys.h" | |
68 | |
69 #include "prim.h" | |
70 | |
71 | |
72 #include "mfw_mfw.h" | |
73 #include "mfw_win.h" | |
74 #include "mfw_kbd.h" | |
75 #include "mfw_lng.h" | |
76 /* SPR#1428 - SH - New Editor changes */ | |
77 #ifndef NEW_EDITOR | |
78 #include "mfw_edt.h" | |
79 #endif | |
80 #include "mfw_icn.h" | |
81 #include "mfw_mnu.h" | |
82 #include "mfw_phb.h" | |
83 #include "mfw_sim.h" | |
84 #include "mfw_nm.h" | |
85 #include "mfw_tim.h" | |
86 #include "mfw_sms.h" | |
87 #include "mfw_icn.h" | |
88 #include "mfw_sat.h" | |
89 | |
90 #include "dspl.h" | |
91 | |
92 #include "ksd.h" | |
93 #include "psa.h" | |
94 | |
95 | |
96 #include "MmiMmi.h" | |
97 #include "MmiMain.h" | |
98 #include "MmiStart.h" | |
99 | |
100 #include "MmiDummy.h" | |
101 #include "MmiDialogs.h" | |
102 #include "MmiLists.h" | |
103 #include "mmiSmsBroadcast.h" | |
104 | |
105 #include "MmiMenu.h" | |
106 #include "MmiSimToolkit.h" | |
107 | |
108 | |
109 #include "MmiSounds.h" | |
110 #include "MmiSettings.h" | |
111 #include "MmiServices.h" | |
112 #include "MmiPins.h" | |
113 #include "Mmiicons.h" | |
114 #include "MmiNetwork.h" | |
115 #include "MmiUserData.h" | |
116 #include "MmiSoftKeys.h" | |
117 #include "MmiTimeDate.h" | |
118 #include "MmiIdle.h" | |
119 | |
120 | |
121 #include "cus_aci.h" | |
122 | |
123 #include "prim.h" | |
124 #ifndef PCM_2_FFS | |
125 #include "pcm.h" | |
126 #endif | |
127 | |
128 /******************************************************************************* | |
129 | |
130 Private definitions | |
131 | |
132 *******************************************************************************/ | |
133 | |
134 | |
135 /* next define used for code that might be removed | |
136 */ | |
137 #define KEEP 0 | |
138 | |
139 | |
140 | |
141 | |
142 /******************************************************************************* | |
143 | |
144 Global Data Elements | |
145 | |
146 *******************************************************************************/ | |
147 | |
148 /* Menus display area | |
149 */ | |
150 | |
151 | |
152 | |
153 /******************************************************************************* | |
154 | |
155 Module Global Data Elements | |
156 | |
157 *******************************************************************************/ | |
158 | |
159 MfwHnd MenuWin = (MfwHnd) 0; | |
160 | |
161 static MfwHnd win=0; /* our window */ | |
162 static MfwHnd mnu; /* our menu */ | |
163 static MfwHnd kbd; /* our keyboard */ | |
164 static MfwHnd kbdLong; | |
165 | |
166 | |
167 static SimMenuFunc SimCallback; | |
168 static MfwHnd SimWindow; | |
169 | |
170 static MmiState nextState; /* next state when finished */ | |
171 static BOOL fromHotKey; | |
172 static BOOL flagHotKey; | |
173 | |
174 static const int OperatorIndex = 1; | |
175 | |
176 | |
177 /******************************************************************************* | |
178 | |
179 Local function prototypes | |
180 | |
181 *******************************************************************************/ | |
182 | |
183 | |
184 /******************************************************************************* | |
185 | |
186 $Function: leftKeyEventHandler | |
187 | |
188 $Description: invokes the menu select handler | |
189 | |
190 $Returns: as per mnuSelect | |
191 | |
192 $Arguments: event, to be handled | |
193 keynoard, handle | |
194 | |
195 *******************************************************************************/ | |
196 | |
197 static int leftKeyEventHandler( MfwEvt event, MfwKbd *keyboard) | |
198 { | |
199 return mnuSelect(mnu); | |
200 } | |
201 | |
202 | |
203 | |
204 | |
205 | |
206 /******************************************************************************* | |
207 | |
208 $Function: rightKeyEventHandler | |
209 | |
210 $Description: invokes the menu escape handler | |
211 | |
212 $Returns: as per mnuEscape | |
213 | |
214 $Arguments: event, to be handled | |
215 keynoard, handle | |
216 | |
217 *******************************************************************************/ | |
218 | |
219 static int rightKeyEventHandler( MfwEvt event, MfwKbd *keyboard) | |
220 { | |
221 return mnuEscape(mnu); | |
222 } | |
223 | |
224 | |
225 | |
226 | |
227 | |
228 /******************************************************************************* | |
229 | |
230 $Function: menuSimItemCallback | |
231 | |
232 $Description: invokes the SimCallback function if it is allocated | |
233 | |
234 $Returns: MfwResOk, always | |
235 | |
236 $Arguments: m, menu being activated, i, item in menu | |
237 | |
238 *******************************************************************************/ | |
239 | |
240 int menuSimItemCallback( MfwMnu* m, MfwMnuItem* i) | |
241 { | |
242 if( SimCallback != NULL ) | |
243 SimCallback(SimWindow); | |
244 | |
245 return MfwResOk; | |
246 } | |
247 | |
248 | |
249 | |
250 | |
251 /******************************************************************************* | |
252 | |
253 Public Routines | |
254 | |
255 *******************************************************************************/ | |
256 | |
257 /******************************************************************************* | |
258 | |
259 $Function: item_flag_none | |
260 | |
261 $Description: Attribut function for menu entries. This function shall | |
262 be used for all cases of no specific attributes (default) | |
263 | |
264 $Returns: zero always | |
265 | |
266 $Arguments: m, ma, mi - not used | |
267 | |
268 *******************************************************************************/ | |
269 | |
270 USHORT item_flag_none( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
271 { | |
272 return 0; | |
273 } | |
274 | |
275 //xpradipg - Aug 4:changes for WAP2.0 Menu | |
276 #if defined (FF_WAP) && defined (FF_GPF_TCPIP) | |
277 USHORT item_flag_WAP_2_0( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) | |
278 { | |
279 return (HTTP_Selected()?0:1); | |
280 } | |
281 #endif | |
282 /******************************************************************************* | |
283 | |
284 $Function: item_flag_hide | |
285 | |
286 $Description: Attribut function for menu entries. This function shall | |
287 be used for all cases of hiding menu entries. | |
288 | |
289 $Returns: MNU_ITEM_HIDE always | |
290 | |
291 $Arguments: m, ma, mi - not used | |
292 | |
293 *******************************************************************************/ | |
294 | |
295 USHORT item_flag_hide( T_MFW_MNU *m, T_MFW_MNU_ATTR *ma, T_MFW_MNU_ITEM *mi ) | |
296 { | |
297 return MNU_ITEM_HIDE; | |
298 } | |
299 | |
300 | |
301 | |
302 | |
303 | |
304 | |
305 | |
306 /******************************************************************************* | |
307 | |
308 $Function: menuIsFocussed | |
309 | |
310 $Description: Returns 1 if the menu window has the focus, else returns 0. | |
311 | |
312 $Returns: Returns 1 if the menu window has the focus, else returns 0. | |
313 | |
314 $Arguments: None | |
315 | |
316 *******************************************************************************/ | |
317 | |
318 int menuIsFocussed( void ) | |
319 { | |
320 return winIsFocussed( win ); | |
321 } | |
322 | |
323 | |
324 | |
325 | |
326 | |
327 | |
328 | |
329 | |
330 | |
331 /******************************************************************************* | |
332 | |
333 $Function: menuEnableSimMenu | |
334 | |
335 $Description: Unhides the SIM toolkit menu item, using <label> as the label. | |
336 If <label> is 0, the default label is used. If the SIM toolkit | |
337 menu item is invoked by the user, <simCallback> gets called | |
338 with argument <window>, unless <simCallback> is 0. | |
339 | |
340 $Returns: None | |
341 | |
342 $Arguments: label, simCallBack, simWindow as indicated above | |
343 | |
344 *******************************************************************************/ | |
345 | |
346 void menuEnableSimMenu( char *label, SimMenuFunc simCallback, MfwHnd simWindow ) | |
347 { | |
348 | |
349 TRACE_FUNCTION("menuEnableSimMenu"); | |
350 | |
351 SimCallback = simCallback; | |
352 | |
353 /* parameter to callback | |
354 */ | |
355 SimWindow = simWindow; | |
356 } | |
357 | |
358 | |
359 | |
360 | |
361 | |
362 | |
363 /******************************************************************************* | |
364 | |
365 $Function: menuDisableSimMenu | |
366 | |
367 $Description: Hides the SIM toolkit menu item | |
368 | |
369 $Returns: None | |
370 | |
371 $Arguments: None | |
372 | |
373 *******************************************************************************/ | |
374 | |
375 void menuDisableSimMenu(void) | |
376 { | |
377 TRACE_FUNCTION("menuDisableSimMenu"); | |
378 } | |
379 | |
380 /******************************************************************************* | |
381 | |
382 End Of File | |
383 | |
384 *******************************************************************************/ | |
385 |