FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiBookPhonebook.c @ 142:ec9f955fc487
mmiBook*.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Nov 2020 08:43:59 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
141:67b91d34f75e | 142:ec9f955fc487 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 | 2 |
3 CONDAT (UK) | 3 CONDAT (UK) |
4 | 4 |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 | 6 |
7 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
8 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
14 $Module: PhoneBook | 14 $Module: PhoneBook |
15 $File: MmiBookPhoneBook.c | 15 $File: MmiBookPhoneBook.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 |
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 sending MMS/EMS. | 34 sending MMS/EMS. |
35 Solution: The new feature to select the number from phonebook while sending | 35 Solution: The new feature to select the number from phonebook while sending |
36 | 36 |
37 Aug 16, 2004 REF: CRR 24323 Deepa M.D | 37 Aug 16, 2004 REF: CRR 24323 Deepa M.D |
38 Bug:Clenup of sprintf used for tracing | 38 Bug:Clenup of sprintf used for tracing |
39 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | 39 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX |
40 | 40 |
41 | 41 |
42 Sep 29, 2004 REF: CRR 25041 xvilliva | 42 Sep 29, 2004 REF: CRR 25041 xvilliva |
43 Bug: add new entry in the FDN , phone gets rebooted. | 43 Bug: add new entry in the FDN , phone gets rebooted. |
44 Fix: The global variable "menuFDN" is reset while menu is destroyed. | 44 Fix: The global variable "menuFDN" is reset while menu is destroyed. |
45 | 45 |
46 Jul 21, 2004 REF: CRR 13348 xvilliva | 46 Jul 21, 2004 REF: CRR 13348 xvilliva |
47 Bug: After selecting HPLMN manually, the idle screen is not shown. | 47 Bug: After selecting HPLMN manually, the idle screen is not shown. |
48 Fix: After phonebook menu is created, we store the window handle in a | 48 Fix: After phonebook menu is created, we store the window handle in a |
49 global. | 49 global. |
50 | 50 |
51 | 51 |
52 25/10/00 Original Condat(UK) BMI version. | 52 25/10/00 Original Condat(UK) BMI version. |
53 | 53 |
54 $End | 54 $End |
55 | 55 |
56 *******************************************************************************/ | 56 *******************************************************************************/ |
57 | 57 |
117 #include "MmiDummy.h" | 117 #include "MmiDummy.h" |
118 #include "MmiDialogs.h" | 118 #include "MmiDialogs.h" |
119 #include "MmiLists.h" | 119 #include "MmiLists.h" |
120 | 120 |
121 | 121 |
122 | |
123 #include "MmiMenu.h" | 122 #include "MmiMenu.h" |
124 #include "mmiCall.h" | 123 #include "mmiCall.h" |
125 #include "Mmiicons.h" | 124 #include "Mmiicons.h" |
126 #include "MmiIdle.h" | 125 #include "MmiIdle.h" |
127 | 126 |
138 #include "cus_aci.h" | 137 #include "cus_aci.h" |
139 #include "mfw_ffs.h" | 138 #include "mfw_ffs.h" |
140 #include "MmiTimers.h" | 139 #include "MmiTimers.h" |
141 | 140 |
142 | 141 |
143 | |
144 | |
145 #include "MmiBookShared.h" | 142 #include "MmiBookShared.h" |
146 #include "MmiBookController.h" | 143 #include "MmiBookController.h" |
147 | 144 |
148 #include "mmiColours.h" | 145 #include "mmiColours.h" |
149 | 146 |
161 | 158 |
162 *******************************************************************************/ | 159 *******************************************************************************/ |
163 | 160 |
164 /******************************************************************************* | 161 /******************************************************************************* |
165 | 162 |
166 $Function: bookPhonebookDialog | 163 $Function: bookPhonebookDialog |
167 | 164 |
168 $Description: Dialog function for the phone book application | 165 $Description: Dialog function for the phone book application |
169 | 166 |
170 $Returns: none | 167 $Returns: none |
171 | 168 |
172 $Arguments: win, window handle | 169 $Arguments: win, window handle |
173 event, event to be handled | 170 event, event to be handled |
174 value, not used | 171 value, not used |
175 parameter, reason for call | 172 parameter, reason for call |
176 | 173 |
177 *******************************************************************************/ | 174 *******************************************************************************/ |
178 | 175 |
179 static void bookPhonebookDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter ) | 176 static void bookPhonebookDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter ) |
180 { | 177 { |
181 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; | 178 T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data; |
182 T_phbk *data = (T_phbk *) win_data->user; | 179 T_phbk *data = (T_phbk *) win_data->user; |
183 SHORT *reason = (SHORT *) parameter; | 180 SHORT *reason = (SHORT *) parameter; |
184 | 181 |
185 TRACE_FUNCTION ("bookPhonebookDialog()"); | 182 TRACE_FUNCTION ("bookPhonebookDialog()"); |
186 switch (event) | 183 switch (event) |
187 { | 184 { |
188 case PHBK_INIT: | 185 case PHBK_INIT: |
189 { | 186 { |
190 /* Initialise the phone book application. | 187 /* Initialise the phone book application. |
191 Note that we need to deal with a number of different | 188 Note that we need to deal with a number of different |
192 initialisation types, depending on the reason given | 189 initialisation types, depending on the reason given |
193 */ | 190 */ |
194 memset( data->edt_buf_name, '\0', sizeof( data->edt_buf_name ) ); | 191 memset( data->edt_buf_name, '\0', sizeof( data->edt_buf_name ) ); |
195 memset( data->edt_buf_number, '\0', sizeof( data->edt_buf_number ) ); | 192 memset( data->edt_buf_number, '\0', sizeof( data->edt_buf_number ) ); |
196 | 193 |
197 /* SPR#1428 - SH - New Editor changes */ | 194 /* SPR#1428 - SH - New Editor changes */ |
198 #ifndef NEW_EDITOR | 195 #ifndef NEW_EDITOR |
199 /* No longer needed for NEW_EDITOR - attributes are initialised when editors created*/ | 196 /* No longer needed for NEW_EDITOR - attributes are initialised when editors created*/ |
200 bookSetEditAttributes( PHONEBOOK_DLG_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, | 197 bookSetEditAttributes( PHONEBOOK_DLG_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, |
201 (char *) data->edt_buf_name, MAX_ALPHA_LEN, &data->edt_attr_name ); | 198 (char *) data->edt_buf_name, MAX_ALPHA_LEN, &data->edt_attr_name ); |
202 bookSetEditAttributes( PHONEBOOK_DLG_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, | 199 bookSetEditAttributes( PHONEBOOK_DLG_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, |
203 (char *) data->edt_buf_number, MAX_ALPHA_LEN, &data->edt_attr_number ); | 200 (char *) data->edt_buf_number, MAX_ALPHA_LEN, &data->edt_attr_number ); |
204 #endif | 201 #endif |
205 | 202 |
206 /* deal with the different initialisation types | 203 /* deal with the different initialisation types |
207 */ | 204 */ |
208 if ((bookPhoneBookLoading()==BOOK_FAILURE)&&(( *reason )!=PhbkMainMenu)) | 205 if ((bookPhoneBookLoading()==BOOK_FAILURE)&&(( *reason )!=PhbkMainMenu)) |
209 { | 206 { |
210 T_DISPLAY_DATA display_info; | 207 T_DISPLAY_DATA display_info; |
211 | 208 |
212 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtPleaseWait, TxtNull , COLOUR_STATUS_WAIT); | 209 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtPleaseWait, TxtNull , COLOUR_STATUS_WAIT); |
213 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_CLEAR ); | 210 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_CLEAR ); |
214 | 211 |
215 /* Call Info Screen | 212 /* Call Info Screen |
216 */ | 213 */ |
217 info_dialog( idle_get_window(), &display_info ); | 214 info_dialog( idle_get_window(), &display_info ); |
218 | 215 |
219 bookPhonebookDestroy(data->win); | 216 bookPhonebookDestroy(data->win); |
220 return; | 217 return; |
221 } | 218 } |
222 switch ( *reason ) | 219 switch ( *reason ) |
223 { | 220 { |
224 case PhbkNormal: | 221 case PhbkNormal: |
225 { | 222 { |
226 /* Normal initialisation | 223 /* Normal initialisation |
227 */ | 224 */ |
228 data->current.status.book = bookActiveBook(READ); | 225 data->current.status.book = bookActiveBook(READ); |
229 data->current.index = 1; | 226 data->current.index = 1; |
230 data->menu_main_win = bookMenuStart( data->win, bookPhonebookMenuAttributes(), *reason); | 227 data->menu_main_win = bookMenuStart( data->win, bookPhonebookMenuAttributes(), *reason); |
231 data->root_win = data->menu_main_win; | 228 data->root_win = data->menu_main_win; |
232 } | 229 } |
233 break; | 230 break; |
234 | 231 |
235 case PhbkMainMenu: | 232 case PhbkMainMenu: |
236 { | 233 { |
237 /* Normal initialisation | 234 /* Normal initialisation |
238 */ | 235 */ |
239 data->current.status.book = bookActiveBook(READ); | 236 data->current.status.book = bookActiveBook(READ); |
240 data->current.index = 1; | 237 data->current.index = 1; |
241 data->menu_main_win = bookMenuStart( data->win, bookMainMenuAttributes(), *reason); | 238 data->menu_main_win = bookMenuStart( data->win, bookMainMenuAttributes(), *reason); |
242 data->root_win = data->menu_main_win; | 239 data->root_win = data->menu_main_win; |
243 } | 240 } |
244 break; | 241 break; |
245 | 242 |
246 case PhbkReplyListNormal: | 243 case PhbkReplyListNormal: |
247 { | 244 { |
248 TRACE_EVENT ("PhbkReplyListNormal"); | 245 TRACE_EVENT ("PhbkReplyListNormal"); |
249 | 246 |
250 /* reply list | 247 /* reply list |
251 */ | 248 */ |
252 bookCallListStart(win,PHB_LRN); | 249 bookCallListStart(win,PHB_LRN); |
253 } | 250 } |
254 break; | 251 break; |
255 case PhbkMissedCallsListNormal: | 252 case PhbkMissedCallsListNormal: |
256 { | 253 { |
257 /* reply list | 254 /* reply list |
258 */ | 255 */ |
259 bookCallListStart(win,PHB_LMN); | 256 bookCallListStart(win,PHB_LMN); |
260 } | 257 } |
261 break; | 258 break; |
262 | 259 |
263 case PhbkRedialListNormal: | 260 case PhbkRedialListNormal: |
264 { | 261 { |
265 /* Redial list | 262 /* Redial list |
266 */ | 263 */ |
267 bookCallListStart(win,PHB_LDN); | 264 bookCallListStart(win,PHB_LDN); |
268 } | 265 } |
269 break; | 266 break; |
270 | 267 |
271 case PhbkNameEnterIdle: | 268 case PhbkNameEnterIdle: |
272 { | 269 { |
273 /* Normal initialisation | 270 /* Normal initialisation |
274 */ | 271 */ |
275 data->current.status.book = bookActiveBook(READ); | 272 data->current.status.book = bookActiveBook(READ); |
276 data->current.index = 1; | 273 data->current.index = 1; |
277 data->menu_main_win = bookMenuStart( data->win, bookPhonebookMenuAttributes(), *reason); | 274 data->menu_main_win = bookMenuStart( data->win, bookPhonebookMenuAttributes(), *reason); |
278 data->root_win = data->menu_main_win; | 275 data->root_win = data->menu_main_win; |
279 data->phbk->UpdateAction = ADD_FROM_IDLE; | 276 data->phbk->UpdateAction = ADD_FROM_IDLE; |
280 } | 277 } |
281 break; | 278 break; |
282 | 279 |
283 case PhbkSearchNormal : | 280 case PhbkSearchNormal : |
284 { | 281 { |
285 /* Search window | 282 /* Search window |
286 */ | 283 */ |
287 data->root_win = data->phbk->search_win; | 284 data->root_win = data->phbk->search_win; |
288 } | 285 } |
289 break; | 286 break; |
290 | 287 |
291 case PhbkFromSms : | 288 case PhbkFromSms : |
292 { | 289 { |
293 /* Invoked from within SMS, need to remember this | 290 /* Invoked from within SMS, need to remember this |
294 */ | 291 */ |
295 data->phbk->fromSMS = TRUE; | 292 data->phbk->fromSMS = TRUE; |
296 data->root_win = data->phbk->search_win; | 293 data->root_win = data->phbk->search_win; |
297 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | 294 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; |
298 data->phbk->current.status.book = bookActiveBook(READ); | 295 data->phbk->current.status.book = bookActiveBook(READ); |
299 data->phbk->search_win = bookSearchStart( data->phbk->win ); | 296 data->phbk->search_win = bookSearchStart( data->phbk->win ); |
300 | 297 |
301 } | 298 } |
302 break; | 299 break; |
303 //CRR: 25302 - xpradipg 10 Nov 2004 | 300 //CRR: 25302 - xpradipg 10 Nov 2004 |
304 //New case added to handle the retrival of number from MMS/EMS | 301 //New case added to handle the retrival of number from MMS/EMS |
305 case PhbkFromMms : | 302 case PhbkFromMms : |
306 { | 303 { |
307 /* Invoked from within MMS/EMS, need to remember this | 304 /* Invoked from within MMS/EMS, need to remember this |
308 */ | 305 */ |
309 data->phbk->fromMmsEms = TRUE; | 306 data->phbk->fromMmsEms = TRUE; |
310 data->root_win = data->phbk->search_win; | 307 data->root_win = data->phbk->search_win; |
311 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | 308 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; |
312 data->phbk->current.status.book = bookActiveBook(READ); | 309 data->phbk->current.status.book = bookActiveBook(READ); |
313 data->phbk->search_win = bookSearchStart( data->phbk->win ); | 310 data->phbk->search_win = bookSearchStart( data->phbk->win ); |
314 | 311 |
315 } | 312 } |
316 break; | 313 break; |
317 | 314 |
318 /*SH*/ | 315 /*SH*/ |
319 case PhbkFromSmsSC : | 316 case PhbkFromSmsSC : |
320 { | 317 { |
321 /* Invoked from within SMS Service centre, need to remember this | 318 /* Invoked from within SMS Service centre, need to remember this |
322 */ | 319 */ |
323 data->phbk->fromSMSSC = TRUE; | 320 data->phbk->fromSMSSC = TRUE; |
324 data->root_win = data->phbk->search_win; | 321 data->root_win = data->phbk->search_win; |
325 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | 322 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; |
326 data->phbk->current.status.book = bookActiveBook(READ); | 323 data->phbk->current.status.book = bookActiveBook(READ); |
327 data->phbk->search_win = bookSearchStart( data->phbk->win ); | 324 data->phbk->search_win = bookSearchStart( data->phbk->win ); |
328 | 325 |
329 } | 326 } |
330 break; | 327 break; |
331 | 328 |
332 case PhbkFromDivert: | 329 case PhbkFromDivert: |
333 { | 330 { |
334 /* Invoked from within Divert, need to remember this | 331 /* Invoked from within Divert, need to remember this |
335 */ | 332 */ |
336 data->phbk->fromDivert = TRUE; | 333 data->phbk->fromDivert = TRUE; |
337 data->root_win = data->phbk->search_win; | 334 data->root_win = data->phbk->search_win; |
338 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | 335 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; |
339 data->phbk->current.status.book = bookActiveBook(READ); | 336 data->phbk->current.status.book = bookActiveBook(READ); |
340 data->phbk->search_win = bookSearchStart( data->phbk->win ); | 337 data->phbk->search_win = bookSearchStart( data->phbk->win ); |
341 | 338 |
342 } | 339 } |
343 | 340 |
344 break; | 341 break; |
345 /*SPR 1392, initialisation from call deflection*/ | 342 /*SPR 1392, initialisation from call deflection*/ |
346 case PhbkFromDeflect: | 343 case PhbkFromDeflect: |
347 { | 344 { |
348 /* Invoked from within Divert, need to remember this | 345 /* Invoked from within Divert, need to remember this |
349 */ | 346 */ |
350 data->phbk->fromDeflect = TRUE; | 347 data->phbk->fromDeflect = TRUE; |
351 data->root_win = data->phbk->search_win; | 348 data->root_win = data->phbk->search_win; |
352 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | 349 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; |
353 data->phbk->current.status.book = bookActiveBook(READ); | 350 data->phbk->current.status.book = bookActiveBook(READ); |
354 data->phbk->search_win = bookSearchStart( data->phbk->win ); | 351 data->phbk->search_win = bookSearchStart( data->phbk->win ); |
355 | 352 |
356 } | 353 } |
357 | 354 |
358 break; | 355 break; |
359 | 356 |
360 default: | 357 default: |
361 { | 358 { |
362 /* No default action required | 359 /* No default action required |
363 */ | 360 */ |
364 } | 361 } |
365 } | 362 } |
366 } | 363 } |
367 break; | 364 break; |
368 case PHBK_SEND_NUMBER: | 365 case PHBK_SEND_NUMBER: |
369 TRACE_EVENT ("PHBK_SEND_NUMBER"); | 366 TRACE_EVENT ("PHBK_SEND_NUMBER"); |
370 /***************************Go-lite Optimization changes Start***********************/ | 367 /***************************Go-lite Optimization changes Start***********************/ |
371 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 368 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
372 TRACE_EVENT_P3 ("win %p parameter %s data->phbk %p",win,(char*)parameter,data->phbk); | 369 TRACE_EVENT_P3 ("win %p parameter %s data->phbk %p",win,(char*)parameter,data->phbk); |
373 /***************************Go-lite Optimization changes end***********************/ | 370 /***************************Go-lite Optimization changes end***********************/ |
374 strncpy( data->phbk->edt_buf_number, (char*)parameter, PHB_MAX_LEN ); | 371 strncpy( data->phbk->edt_buf_number, (char*)parameter, PHB_MAX_LEN ); |
375 break; | 372 break; |
376 default: | 373 default: |
377 { | 374 { |
378 /* No default action required | 375 /* No default action required |
379 */ | 376 */ |
380 } | 377 } |
381 } | 378 } |
382 } | 379 } |
383 | 380 |
384 | 381 |
385 | 382 /******************************************************************************* |
386 | 383 |
387 | 384 $Function: bookPhonebookWindowCB |
388 | 385 |
389 | 386 $Description: Window call back for the phone book application |
390 | 387 |
391 | 388 $Returns: MFW_EVENT_CONSUMED if event is MfwWinVisible, otherwise |
392 /******************************************************************************* | 389 MFW_EVENT_PASSED |
393 | 390 |
394 $Function: bookPhonebookWindowCB | 391 $Arguments: e, event, w, window handle |
395 | |
396 $Description: Window call back for the phone book application | |
397 | |
398 $Returns: MFW_EVENT_CONSUMED if event is MfwWinVisible, otherwise | |
399 MFW_EVENT_PASSED | |
400 | |
401 $Arguments: e, event, w, window handle | |
402 | 392 |
403 *******************************************************************************/ | 393 *******************************************************************************/ |
404 | 394 |
405 static int bookPhonebookWindowCB ( MfwEvt e, MfwWin *w ) | 395 static int bookPhonebookWindowCB ( MfwEvt e, MfwWin *w ) |
406 { | 396 { |
407 TRACE_FUNCTION ("bookPhonebookWindowCB()"); | 397 TRACE_FUNCTION ("bookPhonebookWindowCB()"); |
408 return ( e == MfwWinVisible ) ? MFW_EVENT_CONSUMED : MFW_EVENT_PASSED; | 398 return ( e == MfwWinVisible ) ? MFW_EVENT_CONSUMED : MFW_EVENT_PASSED; |
409 } | 399 } |
410 | 400 |
411 | 401 |
412 | 402 /******************************************************************************* |
413 | 403 |
414 | 404 $Function: bookPhonebookCreate |
415 | 405 |
416 | 406 $Description: Create the phone book application |
417 | 407 |
418 /******************************************************************************* | 408 $Returns: Handle of the newly created window or NULL if error |
419 | 409 |
420 $Function: bookPhonebookCreate | 410 $Arguments: parent, handle of parent window |
421 | |
422 $Description: Create the phone book application | |
423 | |
424 $Returns: Handle of the newly created window or NULL if error | |
425 | |
426 $Arguments: parent, handle of parent window | |
427 | 411 |
428 *******************************************************************************/ | 412 *******************************************************************************/ |
429 | 413 |
430 static T_MFW_HND bookPhonebookCreate( MfwHnd parent ) | 414 static T_MFW_HND bookPhonebookCreate( MfwHnd parent ) |
431 { | 415 { |
432 T_MFW_WIN *win_data; | 416 T_MFW_WIN *win_data; |
433 T_phbk *data; | 417 T_phbk *data; |
434 | 418 |
435 TRACE_FUNCTION ("bookPhonebookCreate()"); | 419 TRACE_FUNCTION ("bookPhonebookCreate()"); |
436 | 420 |
437 if ( ( data = (T_phbk *) ALLOC_MEMORY( sizeof( T_phbk ) ) ) == NULL ) | 421 if ( ( data = (T_phbk *) ALLOC_MEMORY( sizeof( T_phbk ) ) ) == NULL ) |
438 return NULL; | 422 return NULL; |
439 | 423 |
440 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookPhonebookWindowCB ) ) == NULL ) | 424 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookPhonebookWindowCB ) ) == NULL ) |
441 { | 425 { |
442 FREE_MEMORY( (void *) data, sizeof( T_phbk ) ); | 426 FREE_MEMORY( (void *) data, sizeof( T_phbk ) ); |
443 return NULL; | 427 return NULL; |
444 } | 428 } |
445 | 429 |
446 /* Create window handler | 430 /* Create window handler |
447 */ | 431 */ |
448 data->mmi_control.dialog = (T_DIALOG_FUNC) bookPhonebookDialog; | 432 data->mmi_control.dialog = (T_DIALOG_FUNC) bookPhonebookDialog; |
449 data->mmi_control.data = data; | 433 data->mmi_control.data = data; |
450 win_data = ((T_MFW_HDR *)data->win)->data; | 434 win_data = ((T_MFW_HDR *)data->win)->data; |
451 win_data->user = (void *)data; | 435 win_data->user = (void *)data; |
452 winShow(data->win); | 436 winShow(data->win); |
453 | 437 |
454 /* initialise the options structure | 438 /* initialise the options structure |
455 */ | 439 */ |
456 data->root_win = 0; | 440 data->root_win = 0; |
457 data->menu_main_win = 0; | 441 data->menu_main_win = 0; |
458 data->calls_list_win = 0; | 442 data->calls_list_win = 0; |
459 data->menu_options_win = 0; | 443 data->menu_options_win = 0; |
460 data->menu_options_win_2 = 0; | 444 data->menu_options_win_2 = 0; |
461 data->menu_call_options_win = 0; | 445 data->menu_call_options_win = 0; |
462 data->menu_call_options_win_2 = 0; | 446 data->menu_call_options_win_2 = 0; |
463 data->name_details_win = 0; | 447 data->name_details_win = 0; |
464 data->search_win = 0; | 448 data->search_win = 0; |
465 data->fromSMS = FALSE; | 449 data->fromSMS = FALSE; |
466 data->fromSMSSC = FALSE; | 450 data->fromSMSSC = FALSE; |
467 data->fromDivert = FALSE; | 451 data->fromDivert = FALSE; |
468 data->fromDeflect = FALSE;/*SPR 1392*/ | 452 data->fromDeflect = FALSE;/*SPR 1392*/ |
469 data->parent_win = parent; | 453 data->parent_win = parent; |
470 data->phbk = data; | 454 data->phbk = data; |
471 | 455 |
472 /* return window handle | 456 /* return window handle |
473 */ | 457 */ |
474 return data->win; | 458 return data->win; |
475 } | 459 } |
476 | 460 |
477 | 461 |
478 | |
479 | |
480 | |
481 /******************************************************************************* | 462 /******************************************************************************* |
482 | 463 |
483 Public methods | 464 Public methods |
484 | 465 |
485 *******************************************************************************/ | 466 *******************************************************************************/ |
486 | 467 |
487 /******************************************************************************* | 468 /******************************************************************************* |
488 | 469 |
489 $Function: bookPhonebookStart | 470 $Function: bookPhonebookStart |
490 | 471 |
491 $Description: Starts up the phone book application | 472 $Description: Starts up the phone book application |
492 | 473 |
493 $Returns: Handle of window or NULL if error | 474 $Returns: Handle of window or NULL if error |
494 | 475 |
495 $Arguments: parent, window, reason, for invocation | 476 $Arguments: parent, window, reason, for invocation |
496 | 477 |
497 *******************************************************************************/ | 478 *******************************************************************************/ |
498 | 479 |
499 T_MFW_HND bookPhonebookStart( MfwHnd parent, int reason ) | 480 T_MFW_HND bookPhonebookStart( MfwHnd parent, int reason ) |
500 { | 481 { |
501 T_MFW_HND win; | 482 T_MFW_HND win; |
502 | 483 |
503 if ( ( win = bookPhonebookCreate( parent ) ) != NULL ) | 484 if ( ( win = bookPhonebookCreate( parent ) ) != NULL ) |
504 { | 485 { |
505 SEND_EVENT( win, PHBK_INIT, 0, (int *) &reason ); | 486 SEND_EVENT( win, PHBK_INIT, 0, (int *) &reason ); |
506 if(reason == PhbkMainMenu) | 487 if(reason == PhbkMainMenu) |
507 gPhbkMenu = win;//Jul 21, 2004 REF: CRR 13348 xvilliva | 488 gPhbkMenu = win;//Jul 21, 2004 REF: CRR 13348 xvilliva |
508 } | 489 } |
509 return win; | 490 return win; |
510 } | 491 } |
511 | 492 |
512 | 493 |
513 | 494 /******************************************************************************* |
514 | 495 |
515 | 496 $Function: bookPhonebookDestroy |
516 | 497 |
517 /******************************************************************************* | 498 $Description: Destroys the phone book application |
518 | 499 |
519 $Function: bookPhonebookDestroy | 500 $Returns: none |
520 | 501 |
521 $Description: Destroys the phone book application | 502 $Arguments: window, to be destroyed |
522 | |
523 $Returns: none | |
524 | |
525 $Arguments: window, to be destroyed | |
526 | 503 |
527 *******************************************************************************/ | 504 *******************************************************************************/ |
528 | 505 |
529 void bookPhonebookDestroy( MfwHnd window ) | 506 void bookPhonebookDestroy( MfwHnd window ) |
530 { | 507 { |
531 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; | 508 T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; |
532 T_phbk *data = (T_phbk *) win->user; | 509 T_phbk *data = (T_phbk *) win->user; |
533 | 510 |
534 TRACE_FUNCTION ("bookPhonebookDestroy()"); | 511 TRACE_FUNCTION ("bookPhonebookDestroy()"); |
535 | 512 |
536 if ( data ) | 513 if ( data ) |
537 { | 514 { |
538 /* need to clean up all of the subordinate windows which | 515 /* need to clean up all of the subordinate windows which |
539 may have been created during the phone book application | 516 may have been created during the phone book application |
540 */ | 517 */ |
541 data->root_win = 0; | 518 data->root_win = 0; |
542 if (data->search_win) | 519 if (data->search_win) |
543 bookSearchDestroy( data->search_win ); | 520 bookSearchDestroy( data->search_win ); |
544 | 521 |
545 if (data->menu_main_win) | 522 if (data->menu_main_win) |
546 bookMenuDestroy(data->menu_main_win); | 523 bookMenuDestroy(data->menu_main_win); |
547 | 524 |
548 if (data->calls_list_win) | 525 if (data->calls_list_win) |
549 bookCallListDestroy(data->calls_list_win); | 526 bookCallListDestroy(data->calls_list_win); |
550 | 527 |
551 if (data->menu_options_win) | 528 if (data->menu_options_win) |
552 bookMenuDestroy(data->menu_options_win); | 529 bookMenuDestroy(data->menu_options_win); |
553 | 530 |
554 if (data->menu_options_win_2) | 531 if (data->menu_options_win_2) |
555 bookMenuDestroy(data->menu_options_win_2); | 532 bookMenuDestroy(data->menu_options_win_2); |
556 | 533 |
557 if (data->menu_call_options_win) | 534 if (data->menu_call_options_win) |
558 bookMenuDestroy(data->menu_call_options_win); | 535 bookMenuDestroy(data->menu_call_options_win); |
559 | 536 |
560 if (data->menu_call_options_win_2) | 537 if (data->menu_call_options_win_2) |
561 { | 538 { |
562 menuFDN = 0 ;// Sep 29, 2004 REF: CRR 25041 xvilliva | 539 menuFDN = 0 ;// Sep 29, 2004 REF: CRR 25041 xvilliva |
563 bookMenuDestroy(data->menu_call_options_win_2); | 540 bookMenuDestroy(data->menu_call_options_win_2); |
564 } | 541 } |
565 | 542 |
566 if (data->name_details_win) | 543 if (data->name_details_win) |
567 bookDetailsDestroy(data->name_details_win); | 544 bookDetailsDestroy(data->name_details_win); |
568 | 545 |
569 if (data->input_name_win) | 546 if (data->input_name_win) |
570 bookInputDestroy(data->input_name_win); | 547 bookInputDestroy(data->input_name_win); |
571 | 548 |
572 if (data->input_number_win) | 549 if (data->input_number_win) |
573 bookInputDestroy(data->input_number_win); | 550 bookInputDestroy(data->input_number_win); |
574 | 551 |
575 /* delete the window and free any allocated memory | 552 /* delete the window and free any allocated memory |
576 */ | 553 */ |
577 winDelete (data->win); | 554 winDelete (data->win); |
578 FREE_MEMORY( (void *) data, sizeof( T_phbk ) ); | 555 FREE_MEMORY( (void *) data, sizeof( T_phbk ) ); |
579 } | 556 } |
580 //Jul 21, 2004 REF: CRR 13348 xvilliva | 557 //Jul 21, 2004 REF: CRR 13348 xvilliva |
581 //While we destroy the menu assign the handle to NULL. | 558 //While we destroy the menu assign the handle to NULL. |
582 gPhbkMenu = NULL; | 559 gPhbkMenu = NULL; |
583 | 560 |
584 } | 561 } |
585 | 562 |
586 | 563 |
587 /******************************************************************************* | 564 /******************************************************************************* |