FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiBookController.c @ 3:67bfe9f274f6
src/ui: import of src/ui3 from Magnetite
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 16 Oct 2020 06:33:10 +0000 |
| parents | |
| children | c0052fe355d3 |
comparison
equal
deleted
inserted
replaced
| 2:3a14ee9a9843 | 3:67bfe9f274f6 |
|---|---|
| 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: PhoneBook | |
| 15 $File: MmiBookController.c | |
| 16 $Revision: 1.0 | |
| 17 | |
| 18 $Author: Condat(UK) | |
| 19 $Date: 25/10/00 | |
| 20 | |
| 21 ******************************************************************************** | |
| 22 | |
| 23 Description: | |
| 24 | |
| 25 The book controller module provides the external | |
| 26 interface to the phone book. It provides ALL external | |
| 27 entry points to the phone book system. | |
| 28 | |
| 29 ******************************************************************************** | |
| 30 | |
| 31 $History: MmiBookController.c | |
| 32 | |
| 33 Nov 10, 2006 DRT: OMAPS000103354 x0039928 | |
| 34 Description: Delete all failure in LDN Phonebook | |
| 35 Solution: phb_delete_all is called with the proper phone book as input. | |
| 36 | |
| 37 Aug 18, 2006 ER: OMAPS00089840 x0039928 | |
| 38 Description: Changes to be made in MMI for the functionality "Delete all" ADN entries | |
| 39 Solution: A new menu item "Delete All" is added in the phone book menu. | |
| 40 | |
| 41 July 21,2006 REF:DR OMAPS00085695 x0047075 | |
| 42 Description:Fail to delete the correct entry in LDN, LRN and LMN with Locosto. | |
| 43 Solution:After deleting any entry in the LDN,LRN,LMN book,we highlight the first entry as the | |
| 44 current selected entry. | |
| 45 | |
| 46 Jun 13, 2005 REF: SPR 31705 x0021308 | |
| 47 Description: Once maximum limit of the My Number is exceeded, display info : Phonebook full, | |
| 48 expected is MyNumber Full | |
| 49 Solution: Replaced the Return tag in function Protected Menu Handler(booksetownNumber) from | |
| 50 Phonebookfull with MyNumberfull. | |
| 51 | |
| 52 Jun 13, 2005 REF: SPR 31710 x0021308 | |
| 53 Description: Once maximum limit of the FDN Number is exceeded, display info : Phonebook full, | |
| 54 expected is FDNList Full | |
| 55 Solution: Replaced the Return tag in function Protected Menu Handler(booksetownNumber) from | |
| 56 Phonebookfull with FDNListfull While checking whether in FDNMenu is active using MenuFDN global | |
| 57 variable. | |
| 58 | |
| 59 | |
| 60 Sep 22, 2004 REF: CRR 21392 xvilliva | |
| 61 Bug: PIN2 Screen is not displaying, While Adding FDN Number thru | |
| 62 Recent call Menu. | |
| 63 Fix: We add the "bookRepRedNameEnter" to "ProtectedActions" array. | |
| 64 If FDN is enabled, Pin2 will be asked. | |
| 65 | |
| 66 June 26, 2006 REF : OMAPS00083148 x0023848 | |
| 67 Bug: SMS send is failed when trying through missed call list | |
| 68 Fix: Assignemnt of SmsData.called_from_reply_item to FALSE is Added | |
| 69 | |
| 70 25/10/00 Original Condat(UK) BMI version. | |
| 71 | |
| 72 | |
| 73 | |
| 74 $End | |
| 75 | |
| 76 // Issue Number : MMI-FIX-12161 on 07/04/04 by Nishikant Kulkarni/Ajith K.P | |
| 77 | |
| 78 *******************************************************************************/ | |
| 79 | |
| 80 | |
| 81 /******************************************************************************* | |
| 82 | |
| 83 Include Files | |
| 84 | |
| 85 *******************************************************************************/ | |
| 86 | |
| 87 /* MMI phone book specific include files | |
| 88 */ | |
| 89 #define ENTITY_MFW | |
| 90 | |
| 91 /* includes */ | |
| 92 #include <string.h> | |
| 93 #include <stdio.h> | |
| 94 #include <stdlib.h> | |
| 95 | |
| 96 #if defined (NEW_FRAME) | |
| 97 | |
| 98 #include "typedefs.h" | |
| 99 #include "vsi.h" | |
| 100 #include "pei.h" | |
| 101 #include "custom.h" | |
| 102 #include "gsm.h" | |
| 103 | |
| 104 #else | |
| 105 | |
| 106 #include "STDDEFS.H" | |
| 107 #include "custom.h" | |
| 108 #include "gsm.h" | |
| 109 #include "vsi.h" | |
| 110 | |
| 111 #endif | |
| 112 #include "mfw_sys.h" | |
| 113 | |
| 114 #include "mfw_mfw.h" | |
| 115 #include "mfw_win.h" | |
| 116 #include "mfw_kbd.h" | |
| 117 #include "mfw_lng.h" | |
| 118 /* SPR#1428 - SH - New Editor changes */ | |
| 119 #ifndef NEW_EDITOR | |
| 120 #include "mfw_edt.h" | |
| 121 #endif | |
| 122 #include "mfw_icn.h" | |
| 123 #include "mfw_mnu.h" | |
| 124 #include "mfw_tim.h" | |
| 125 | |
| 126 #include "mfw_sim.h" | |
| 127 #include "mfw_cm.h" | |
| 128 #include "mfw_nm.h" | |
| 129 #include "mfw_phb.h" | |
| 130 #include "mfw_mme.h" | |
| 131 #include "mfw_sat.h" | |
| 132 #include "mfw_sms.h" | |
| 133 | |
| 134 #include "dspl.h" | |
| 135 | |
| 136 #include "ksd.h" | |
| 137 #include "psa.h" | |
| 138 | |
| 139 #include "MmiMain.h" | |
| 140 #include "MmiBookController.h" | |
| 141 #include "MmiDummy.h" | |
| 142 #include "MmiDialogs.h" | |
| 143 #include "MmiLists.h" | |
| 144 | |
| 145 | |
| 146 | |
| 147 #include "MmiMenu.h" | |
| 148 #include "mmiCall.h" | |
| 149 #include "Mmiicons.h" | |
| 150 #include "MmiIdle.h" | |
| 151 | |
| 152 #include "MmiSoftKeys.h" | |
| 153 #include "MmiSounds.h" | |
| 154 #include "MmiIdle.h" | |
| 155 #include "MmiNetwork.h" | |
| 156 #include "mmiSat_i.h" | |
| 157 #include "MmiAoc.h" | |
| 158 | |
| 159 #include "gdi.h" | |
| 160 #include "audio.h" | |
| 161 | |
| 162 #include "cus_aci.h" | |
| 163 #include "MmiTimers.h" | |
| 164 | |
| 165 | |
| 166 #include "MmiBookController.h" | |
| 167 #include "MmiBookUtils.h" | |
| 168 | |
| 169 /* MMI specific includes, outside scope of phone book | |
| 170 */ | |
| 171 #include "MmiPins.h" | |
| 172 #include "mmiSmsMenu.h" | |
| 173 #include "mmismssend.h" | |
| 174 #include "mmiCall.h" | |
| 175 #include "MmiIdle.h" | |
| 176 #include "MmiCPHS.h" | |
| 177 | |
| 178 | |
| 179 /******************************************************************************* | |
| 180 | |
| 181 Definitions | |
| 182 | |
| 183 *******************************************************************************/ | |
| 184 | |
| 185 /* Since we want to make sure all of the menu handlers get | |
| 186 treated the same way, and have a protected handler, define | |
| 187 a new macro, in terms of the MENU_HANDLER, which will | |
| 188 invoke the protected function correctly (See below for | |
| 189 further details) | |
| 190 */ | |
| 191 #define PROTECTED_MENU_HANDLER( Name ) \ | |
| 192 static MENU_HANDLER( Protected##Name ); \ | |
| 193 MENU_HANDLER( Name ) \ | |
| 194 { \ | |
| 195 return Protected( Name, Protected##Name, Menu, Item ); \ | |
| 196 } \ | |
| 197 static MENU_HANDLER( Protected##Name ) | |
| 198 | |
| 199 /* | |
| 200 ** Since PROTECTED_MENU_HANDLER handles only FDN protection, the following is a menu handler to ensure | |
| 201 ** that PIN2 entry is required for any associated menu action | |
| 202 */ | |
| 203 #define PIN2RQD_MENU_HANDLER( Name ) \ | |
| 204 static MENU_HANDLER( Pin2Rqd##Name ); \ | |
| 205 MENU_HANDLER( Name ) \ | |
| 206 { \ | |
| 207 return Pin2Rqd( Name, Pin2Rqd##Name, Menu, Item ); \ | |
| 208 } \ | |
| 209 static MENU_HANDLER( Pin2Rqd##Name ) | |
| 210 | |
| 211 /*Added For Fix: MMI-FIX-12161 on 07/04/04 by Nishikant Kulkarni/Ajith K.P */ | |
| 212 extern T_idle idle_data; | |
| 213 | |
| 214 | |
| 215 /******************************************************************************* | |
| 216 | |
| 217 Local structures | |
| 218 | |
| 219 *******************************************************************************/ | |
| 220 | |
| 221 /* A number of the actions the phone book is required to perform | |
| 222 can only be activated when the user enters a security PIN number, | |
| 223 the PIN2 code. In order to make the operation of the module | |
| 224 clear, we will build a list of the protected actions, and then | |
| 225 drive all menu operations through a single clearing process. | |
| 226 | |
| 227 The module will use the following action list perform the | |
| 228 protection, note that the last entry in this list must be | |
| 229 NULL | |
| 230 */ | |
| 231 typedef tBookStatus (*tProtectFunction)( tBookMfwMenu *Menu, tBookMfwMenuItem *Item ); | |
| 232 | |
| 233 tProtectFunction ProtectedActions[] = { | |
| 234 bookNameEnter, | |
| 235 bookNameEdit, | |
| 236 bookNameDelete, | |
| 237 bookNameDeleteAll, | |
| 238 // Sep 22, 2004 REF: CRR 21392 xvilliva | |
| 239 // A function, if added to this array would ask Pin2 when called. | |
| 240 // Storing a number from recent call list would ask for Pin2, if FDN is enabled. | |
| 241 bookRepRedNameEnter, | |
| 242 NULL }; | |
| 243 | |
| 244 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) | |
| 245 // This flag will indicate when we are in FDN menu | |
| 246 int menuFDN; | |
| 247 extern T_call call_data; | |
| 248 | |
| 249 | |
| 250 /******************************************************************************* | |
| 251 | |
| 252 Private methods | |
| 253 | |
| 254 *******************************************************************************/ | |
| 255 | |
| 256 /******************************************************************************* | |
| 257 | |
| 258 $Function: Mmir_BaseAddress | |
| 259 | |
| 260 $Description: returns the base address of the Master Index Table | |
| 261 | |
| 262 $Returns: As above | |
| 263 | |
| 264 $Arguments: none. | |
| 265 | |
| 266 *******************************************************************************/ | |
| 267 | |
| 268 /* Provide a local routine which will perform the protection | |
| 269 method. This will scan the list of protected actions, looking | |
| 270 for the provided function, if it isn't a protected function | |
| 271 then we will just call it directly, otherwise we will guard | |
| 272 it with the PIN2 security code if we have a protected book | |
| 273 */ | |
| 274 static int Protected( tProtectFunction FunTag, tProtectFunction FunPtr, tBookMfwMenu *Menu, tBookMfwMenuItem *Item ) | |
| 275 { | |
| 276 pBookMfwWin win_data = (pBookMfwWin) bookWindowData(); | |
| 277 pBookPhonebook book = ((pBookStandard)win_data->user)->phbk; | |
| 278 int i; | |
| 279 | |
| 280 /* Check for a protected book being used (details to be sorted | |
| 281 out at a later date) | |
| 282 */ | |
| 283 | |
| 284 // Sep 22, 2004 REF: CRR 21388 xvilliva | |
| 285 // We check if the call is not from FDN menu and if the current storage | |
| 286 // for phonebook is internal phone book, we avoid asking Pin2 accordingly. | |
| 287 if(menuFDN == 0 && bookActiveBook(WRITE) == PHB_IPB) | |
| 288 { | |
| 289 //Do nothing. | |
| 290 } | |
| 291 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) | |
| 292 // Pin2 should be prompted when user does FDN related operations in FDN menu | |
| 293 // In FDN menu, receie an active call and FDN is disabled, pin2 should not be prompted for in call addressbook operations | |
| 294 else if ( phb_get_mode() == PHB_RESTRICTED || (menuFDN && (call_data.calls.numCalls==0))) | |
| 295 { | |
| 296 /* Is the requested function one of the ones we need | |
| 297 to protect ? | |
| 298 */ | |
| 299 TRACE_FUNCTION("Phone Book in FDN mode:ask for pin 2"); | |
| 300 for ( i = 0; ProtectedActions[i]; i++ ) | |
| 301 { | |
| 302 if ( FunTag == ProtectedActions[i] ) | |
| 303 { | |
| 304 /* Yup, so we need to store the pending action for | |
| 305 this window, this will be invoked by the checking | |
| 306 operation, indirectly, if the check is successful | |
| 307 */ | |
| 308 book->pin2_next = (T_VOID_FUNC) FunPtr; | |
| 309 | |
| 310 //We're cheating and passing the current window to the | |
| 311 //handler via the unused menu parameter -- MC | |
| 312 book->menu = (tBookMfwMenu*) bookCurrentWindow(); | |
| 313 book->item = Item; | |
| 314 | |
| 315 /* Call out to get the pin2 number checked, this will | |
| 316 respond with a message back to this object, which | |
| 317 we will deal with on receipt | |
| 318 */ | |
| 319 return pin2_check( bookCurrentWindow()); | |
| 320 } | |
| 321 } | |
| 322 } | |
| 323 | |
| 324 /* we've come through the list of functions and either don't | |
| 325 have a protected action to perform, or the book itself | |
| 326 is not protected, so just invoke the requested action | |
| 327 */ | |
| 328 return (FunPtr)( (tBookMfwMenu*) bookCurrentWindow()/*Menu*/, Item ); | |
| 329 } | |
| 330 | |
| 331 | |
| 332 /* | |
| 333 ** This function will apply PIN2 protection to the associated menu functions at ALL times | |
| 334 ** | |
| 335 */ | |
| 336 static int Pin2Rqd( tProtectFunction FunTag, tProtectFunction FunPtr, tBookMfwMenu *Menu, tBookMfwMenuItem *Item ) | |
| 337 { | |
| 338 pBookMfwWin win_data = (pBookMfwWin) bookWindowData(); | |
| 339 pBookPhonebook book = ((pBookStandard)win_data->user)->phbk; | |
| 340 // int i; // RAVI | |
| 341 | |
| 342 /* Yup, so we need to store the pending action for | |
| 343 this window, this will be invoked by the checking | |
| 344 operation, indirectly, if the check is successful | |
| 345 */ | |
| 346 book->pin2_next = (T_VOID_FUNC) FunPtr; | |
| 347 | |
| 348 //We're cheating and passing the current window to the | |
| 349 //handler via the unused menu parameter -- MC | |
| 350 book->menu = (tBookMfwMenu*) bookCurrentWindow(); | |
| 351 book->item = Item; | |
| 352 | |
| 353 /* Call out to get the pin2 number checked, this will | |
| 354 respond with a message back to this object, which | |
| 355 we will deal with on receipt | |
| 356 */ | |
| 357 return pin2_check( bookCurrentWindow()); | |
| 358 } | |
| 359 | |
| 360 /******************************************************************************* | |
| 361 | |
| 362 Public methods | |
| 363 | |
| 364 *******************************************************************************/ | |
| 365 | |
| 366 /* Menu Handlers | |
| 367 | |
| 368 We are routing all of the phone book functionality through | |
| 369 this module to allow the functional modules to be developed | |
| 370 independantly where possible. | |
| 371 | |
| 372 This gives a single interface point for the rest of the | |
| 373 MMI subsystem. | |
| 374 | |
| 375 All of the following functions use the MENU_HANDLER macro, | |
| 376 as such they all have a common interface, this is not therefore | |
| 377 documented in each case. The following information is common | |
| 378 for each menu handler | |
| 379 | |
| 380 | |
| 381 $Returns: Status from worker routine | |
| 382 | |
| 383 $Arguments: Menu, the menu from which the function was activated | |
| 384 Item, the item associated with the call | |
| 385 | |
| 386 */ | |
| 387 | |
| 388 | |
| 389 /******************************************************************************* | |
| 390 | |
| 391 $Function: bookNameEnter | |
| 392 | |
| 393 $Description: | |
| 394 | |
| 395 Add new name to the phone book | |
| 396 | |
| 397 $Returns: Refer Menu Handlers Definition Block Above | |
| 398 | |
| 399 $Arguments: Refer Menu Handlers Definition Block Above | |
| 400 | |
| 401 *******************************************************************************/ | |
| 402 | |
| 403 PROTECTED_MENU_HANDLER( bookNameEnter ) | |
| 404 { | |
| 405 //recast the menu parameter as the current window -- MC | |
| 406 T_MFW_HND win = (T_MFW_HND)Menu; | |
| 407 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 408 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 409 T_phbk *Phbk = data->phbk; | |
| 410 | |
| 411 TRACE_FUNCTION("bookNameEnter"); | |
| 412 /* Clear the input editor structures before we go any further | |
| 413 */ | |
| 414 | |
| 415 if (Phbk->UpdateAction!=ADD_FROM_IDLE) | |
| 416 memset( Phbk->phbk->edt_buf_number, '\0', PHB_MAX_LEN ); | |
| 417 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ | |
| 418 memset( Phbk->phbk->edt_buf_name, '\0', MAX_ALPHA_LEN ); | |
| 419 /* Indicate this is an additional entry being created | |
| 420 */ | |
| 421 Phbk->UpdateAction = CREATE_ENTRY; | |
| 422 | |
| 423 // May 3, 2004 REF: CRR MMI-SPR-18555 Rashmi C N(Sasken) | |
| 424 // As the book is being changed for FDN menu operations, we need to | |
| 425 // get back the current book for the normal phonbook operations | |
| 426 Phbk->current.status.book = bookActiveBook(READ); | |
| 427 | |
| 428 /* Determine if we have room to add any new entries | |
| 429 */ | |
| 430 bookGetCurrentStatus( &Phbk->phbk->current.status ); | |
| 431 if ( Phbk->phbk->current.status.avail_entries ) | |
| 432 { | |
| 433 /* We are okay to input the number, use a worker routine | |
| 434 from the input handler module to actually deal with this | |
| 435 */ | |
| 436 Phbk->input_number_win = bookInputStartNumberEditor( win, Phbk->edt_buf_number ); | |
| 437 } | |
| 438 else | |
| 439 { | |
| 440 /* We have no room available to add the name, so check if | |
| 441 we have filled the namespace or not | |
| 442 */ | |
| 443 | |
| 444 /*If FDN menu active and no room for entries, then display FDN list full */ | |
| 445 tIndexTagNames Tag ; | |
| 446 if(menuFDN) | |
| 447 { | |
| 448 Tag = ( Phbk->phbk->current.status.used_entries ) | |
| 449 ? TxtFDNListFull : TxtOperationNotAvail; //SPR 31710 x0021308:RamG | |
| 450 } | |
| 451 else | |
| 452 { | |
| 453 Tag = ( Phbk->phbk->current.status.used_entries ) | |
| 454 ? TxtPhbkFull : TxtOperationNotAvail; | |
| 455 } | |
| 456 bookShowInformation( win, Tag,NULL, NULL ); | |
| 457 | |
| 458 | |
| 459 } | |
| 460 | |
| 461 /* Always return event consumed | |
| 462 */ | |
| 463 return MFW_EVENT_CONSUMED; | |
| 464 } | |
| 465 | |
| 466 | |
| 467 /******************************************************************************* | |
| 468 | |
| 469 $Function: bookNameEdit | |
| 470 | |
| 471 $Description: | |
| 472 | |
| 473 Edit the name in the phone book | |
| 474 | |
| 475 $Returns: Refer Menu Handlers Definition Block Above | |
| 476 | |
| 477 $Arguments: Refer Menu Handlers Definition Block Above | |
| 478 | |
| 479 *******************************************************************************/ | |
| 480 | |
| 481 PROTECTED_MENU_HANDLER( bookNameEdit ) | |
| 482 { | |
| 483 //recast the menu parameter as the current window -- MC | |
| 484 T_MFW_HND win = /*mfwParent( mfw_header() )*/(T_MFW_HND)Menu; | |
| 485 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 486 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 487 T_phbk *Phbk = data->phbk; | |
| 488 | |
| 489 /* Indicate this is an edit of a current entry | |
| 490 */ | |
| 491 Phbk->UpdateAction = MODIFY_EXISTING; | |
| 492 /*MC SPR 1327, if UPN don't change phonebook type*/ | |
| 493 if (data->phbk->current.status.book != PHB_UPN) | |
| 494 data->phbk->current.status.book = bookActiveBook(READ); | |
| 495 | |
| 496 /*api - clear buffers before edit | |
| 497 */ | |
| 498 memset( Phbk->phbk->edt_buf_number, '\0', PHB_MAX_LEN ); | |
| 499 memset( Phbk->phbk->edt_buf_name, '\0', MAX_ALPHA_LEN ); | |
| 500 | |
| 501 TRACE_EVENT_P2("current phbk is = %d and current entry is = %d", data->phbk->current.status.book,data->phbk->current.entry[ data->phbk->current.selectedName ].book); | |
| 502 | |
| 503 if(data->phbk->current.status.book == PHB_ADN_FDN) | |
| 504 { | |
| 505 if(data->phbk->current.entry[ data->phbk->current.selectedName ].book==PHB_FDN) | |
| 506 { | |
| 507 bookActivateFDN((T_MFW_HND)Menu); | |
| 508 } | |
| 509 else | |
| 510 { | |
| 511 /* And populate the buffers with the information to be modified | |
| 512 */ | |
| 513 #ifdef NO_ASCIIZ | |
| 514 /*MC , SPR 1242 copy whole name, merged from b-sample build*/ | |
| 515 memcpy( Phbk->phbk->edt_buf_name, Phbk->current.entry[ Phbk->current.selectedName ].name.data, MAX_ALPHA_LEN /*Phbk->current.entry[ Phbk->current.selectedName ].name.len*/); | |
| 516 #else | |
| 517 memcpy( Phbk->phbk->edt_buf_name, Phbk->current.entry[ Phbk->current.selectedName ].name, MAX_ALPHA_LEN ); | |
| 518 #endif | |
| 519 memcpy( Phbk->phbk->edt_buf_number, Phbk->current.entry[ Phbk->current.selectedName ].number, PHB_MAX_LEN ); | |
| 520 | |
| 521 /* And edit the entry we currently have active | |
| 522 */ | |
| 523 Phbk->input_number_win = bookInputStartNumberEditor( win, Phbk->edt_buf_number ); | |
| 524 } | |
| 525 } | |
| 526 else | |
| 527 { | |
| 528 /* And populate the buffers with the information to be modified | |
| 529 */ | |
| 530 #ifdef NO_ASCIIZ | |
| 531 /*MC , SPR 1242 copy whole name, merged from b-sample build*/ | |
| 532 memcpy( Phbk->phbk->edt_buf_name, Phbk->current.entry[ Phbk->current.selectedName ].name.data, MAX_ALPHA_LEN/*Phbk->current.entry[ Phbk->current.selectedName ].name.len*/); | |
| 533 #else | |
| 534 memcpy( Phbk->phbk->edt_buf_name, Phbk->current.entry[ Phbk->current.selectedName ].name, MAX_ALPHA_LEN ); | |
| 535 #endif | |
| 536 memcpy( Phbk->phbk->edt_buf_number, Phbk->current.entry[ Phbk->current.selectedName ].number, PHB_MAX_LEN ); | |
| 537 | |
| 538 /* And edit the entry we currently have active | |
| 539 */ | |
| 540 Phbk->input_number_win = bookInputStartNumberEditor( win, Phbk->edt_buf_number ); | |
| 541 } | |
| 542 /* Always return event consumed | |
| 543 */ | |
| 544 return MFW_EVENT_CONSUMED; | |
| 545 } | |
| 546 | |
| 547 | |
| 548 /******************************************************************************* | |
| 549 | |
| 550 $Function: bookNameDelete | |
| 551 | |
| 552 $Description: | |
| 553 | |
| 554 Delete name in phone book | |
| 555 | |
| 556 $Returns: Refer Menu Handlers Definition Block Above | |
| 557 | |
| 558 $Arguments: Refer Menu Handlers Definition Block Above | |
| 559 | |
| 560 *******************************************************************************/ | |
| 561 | |
| 562 PROTECTED_MENU_HANDLER( bookNameDelete ) | |
| 563 { | |
| 564 | |
| 565 //recast the menu parameter as the current window -- MC | |
| 566 //and pass it on | |
| 567 //when ADN_FDN phonebook in use check if current entry is FDN | |
| 568 //is so then call information screen or allow entry to be deleted. --- AP 23/01/02 | |
| 569 //Issue 1944 MZ Allow an entry in FDN list to be deleted. | |
| 570 T_MFW_HND win = (T_MFW_HND)Menu; | |
| 571 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 572 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 573 | |
| 574 /*MC SPR 1327, if UPN don't change phonebook type*/ | |
| 575 if (data->phbk->current.status.book != PHB_UPN) | |
| 576 data->phbk->current.status.book = bookActiveBook(READ); | |
| 577 if(data->phbk->current.status.book == PHB_ADN_FDN) | |
| 578 if(data->phbk->current.entry[ data->phbk->current.selectedName ].book==PHB_FDN) | |
| 579 bookActivateFDN((T_MFW_HND)Menu); | |
| 580 else | |
| 581 bookDeleteEntry((T_MFW_HND)Menu); | |
| 582 else | |
| 583 bookDeleteEntry((T_MFW_HND)Menu); | |
| 584 | |
| 585 return MFW_EVENT_CONSUMED; | |
| 586 } | |
| 587 | |
| 588 /******************************************************************************* | |
| 589 | |
| 590 $Function: bookNameCall | |
| 591 | |
| 592 $Description: | |
| 593 | |
| 594 Call name in phone book | |
| 595 | |
| 596 $Returns: Refer Menu Handlers Definition Block Above | |
| 597 | |
| 598 $Arguments: Refer Menu Handlers Definition Block Above | |
| 599 | |
| 600 *******************************************************************************/ | |
| 601 | |
| 602 PROTECTED_MENU_HANDLER( bookNameCall ) | |
| 603 { T_MFW_HND win = mfwParent( mfw_header() ); | |
| 604 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 605 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 606 T_phbk *Phbk = data->phbk; | |
| 607 | |
| 608 callNumber( Phbk->current.entry[ Phbk->current.selectedName ].number ); | |
| 609 return MFW_EVENT_CONSUMED; | |
| 610 } | |
| 611 | |
| 612 | |
| 613 /******************************************************************************* | |
| 614 | |
| 615 $Function: bookDeleteAll | |
| 616 | |
| 617 $Description: | |
| 618 | |
| 619 Delete name in phone book | |
| 620 | |
| 621 $Returns: Refer Menu Handlers Definition Block Above | |
| 622 | |
| 623 $Arguments: Refer Menu Handlers Definition Block Above | |
| 624 | |
| 625 *******************************************************************************/ | |
| 626 | |
| 627 PROTECTED_MENU_HANDLER( bookDeleteAll ) | |
| 628 { | |
| 629 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 630 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 631 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 632 T_phbk *Phbk = data->phbk; | |
| 633 | |
| 634 // Aug 18, 2006 ER: OMAPS00089840 x0039928 | |
| 635 bookDeleteBook(Phbk->win); | |
| 636 | |
| 637 return MFW_EVENT_CONSUMED; | |
| 638 } | |
| 639 | |
| 640 // Nov 10, 2006 DRT: OMAPS000103354 x0039928 | |
| 641 // Fix: phb_delete_book() is called with proper book information instead of bookDeleteBook(). | |
| 642 /******************************************************************************* | |
| 643 | |
| 644 $Function: bookDeleteRec | |
| 645 | |
| 646 $Description: | |
| 647 | |
| 648 Delete name in phone book | |
| 649 | |
| 650 $Returns: Refer Menu Handlers Definition Block Above | |
| 651 | |
| 652 $Arguments: Refer Menu Handlers Definition Block Above | |
| 653 | |
| 654 *******************************************************************************/ | |
| 655 | |
| 656 PROTECTED_MENU_HANDLER( bookDeleteRec ) | |
| 657 { | |
| 658 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 659 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 660 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 661 T_phbk *Phbk = data->phbk; | |
| 662 | |
| 663 if (phb_delete_book(Phbk->current.status.book)==MFW_PHB_OK) | |
| 664 { | |
| 665 MmiBookSetCurrentText( TxtEntryDeleted); | |
| 666 bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); | |
| 667 bookPhonebookDestroy(Phbk->win); | |
| 668 } | |
| 669 else | |
| 670 { | |
| 671 MmiBookSetCurrentText(TxtFailed); | |
| 672 bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); | |
| 673 bookPhonebookDestroy(Phbk->win); | |
| 674 } | |
| 675 | |
| 676 return MFW_EVENT_CONSUMED; | |
| 677 } | |
| 678 | |
| 679 /******************************************************************************* | |
| 680 | |
| 681 $Function: bookNameSearch | |
| 682 | |
| 683 $Description: | |
| 684 | |
| 685 Search for name in phone book | |
| 686 | |
| 687 $Returns: Refer Menu Handlers Definition Block Above | |
| 688 | |
| 689 $Arguments: Refer Menu Handlers Definition Block Above | |
| 690 | |
| 691 *******************************************************************************/ | |
| 692 | |
| 693 PROTECTED_MENU_HANDLER( bookNameSearch ) | |
| 694 { | |
| 695 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 696 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 697 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 698 | |
| 699 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | |
| 700 data->phbk->current.status.book = bookActiveBook(READ); | |
| 701 data->phbk->search_win = bookSearchStart( data->phbk->win ); | |
| 702 | |
| 703 return MFW_EVENT_CONSUMED; | |
| 704 } | |
| 705 | |
| 706 | |
| 707 | |
| 708 /******************************************************************************* | |
| 709 | |
| 710 $Function: bookNumberSearch | |
| 711 | |
| 712 $Description: | |
| 713 | |
| 714 Search for name in phone book, order the elements by the phone book number | |
| 715 | |
| 716 $Returns: Refer Menu Handlers Definition Block Above | |
| 717 | |
| 718 $Arguments: Refer Menu Handlers Definition Block Above | |
| 719 | |
| 720 *******************************************************************************/ | |
| 721 | |
| 722 PROTECTED_MENU_HANDLER( bookNumberSearch ) | |
| 723 { | |
| 724 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 725 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 726 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 727 | |
| 728 data->phbk->current.KindOfSearch = SEARCH_BY_NUMBER; | |
| 729 data->phbk->current.status.book = bookActiveBook(READ); | |
| 730 data->phbk->search_win = bookSearchStart( data->phbk->win ); | |
| 731 | |
| 732 return MFW_EVENT_CONSUMED; | |
| 733 } | |
| 734 | |
| 735 | |
| 736 /******************************************************************************* | |
| 737 | |
| 738 $Function: bookLocationSearch | |
| 739 | |
| 740 $Description: | |
| 741 | |
| 742 Search for number in phone book, using SIM location to order search | |
| 743 window output | |
| 744 | |
| 745 $Returns: Refer Menu Handlers Definition Block Above | |
| 746 | |
| 747 $Arguments: Refer Menu Handlers Definition Block Above | |
| 748 | |
| 749 *******************************************************************************/ | |
| 750 | |
| 751 PROTECTED_MENU_HANDLER( bookLocationSearch ) | |
| 752 { | |
| 753 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 754 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 755 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 756 | |
| 757 data->phbk->current.KindOfSearch = SEARCH_BY_LOCATION; | |
| 758 data->phbk->current.status.book = bookActiveBook(READ); | |
| 759 data->phbk->search_win = bookSearchStart( data->phbk->win ); | |
| 760 | |
| 761 return MFW_EVENT_CONSUMED; | |
| 762 } | |
| 763 | |
| 764 | |
| 765 /******************************************************************************* | |
| 766 | |
| 767 $Function: bookNameDeleteAll | |
| 768 | |
| 769 $Description: | |
| 770 | |
| 771 Delete all names associated with a phone book | |
| 772 | |
| 773 $Returns: Refer Menu Handlers Definition Block Above | |
| 774 | |
| 775 $Arguments: Refer Menu Handlers Definition Block Above | |
| 776 | |
| 777 *******************************************************************************/ | |
| 778 | |
| 779 PROTECTED_MENU_HANDLER( bookNameDeleteAll ) | |
| 780 { | |
| 781 return NULL; | |
| 782 } | |
| 783 | |
| 784 | |
| 785 | |
| 786 | |
| 787 /******************************************************************************* | |
| 788 | |
| 789 $Function: bookNameMessage | |
| 790 | |
| 791 $Description: | |
| 792 | |
| 793 Send message to the number selected | |
| 794 | |
| 795 $Returns: Refer Menu Handlers Definition Block Above | |
| 796 | |
| 797 $Arguments: Refer Menu Handlers Definition Block Above | |
| 798 | |
| 799 *******************************************************************************/ | |
| 800 | |
| 801 PROTECTED_MENU_HANDLER( bookSendMessage ) | |
| 802 { | |
| 803 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 804 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 805 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 806 T_phbk *Phbk = data->phbk; | |
| 807 T_SmsUserData SmsData; | |
| 808 | |
| 809 /* Copy the number and name information to the SMS buffer | |
| 810 */ | |
| 811 /* API - 13-01-03 - 1409 - Minus the Phbk->current.missedCallsOffset to point at the correct number in the missed calls */ | |
| 812 memcpy( SmsData.NumberBuffer, (UBYTE *) Phbk->current.entry[ Phbk->current.selectedName - Phbk->current.missedCallsOffset ].number, | |
| 813 sizeof( SmsData.NumberBuffer ) ); | |
| 814 /*MC SPR 1257, zero whole buffer for unicode*/ | |
| 815 memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_ARRAY); | |
| 816 /* OMAPS00083148 - Assignement called_from_reply_item to FALSE is added*/ | |
| 817 SmsData.called_from_reply_item = FALSE; | |
| 818 | |
| 819 /* Create a dynamic menu window to perform the SMS sending | |
| 820 */ | |
| 821 SmsSend_SEND_start( win, (void *) &SmsData ); | |
| 822 | |
| 823 return MFW_EVENT_CONSUMED; | |
| 824 | |
| 825 } | |
| 826 | |
| 827 | |
| 828 /******************************************************************************* | |
| 829 | |
| 830 $Function: bookGetOwnNumber | |
| 831 | |
| 832 $Description: | |
| 833 | |
| 834 Get own number | |
| 835 | |
| 836 $Returns: Refer Menu Handlers Definition Block Above | |
| 837 | |
| 838 $Arguments: Refer Menu Handlers Definition Block Above | |
| 839 | |
| 840 *******************************************************************************/ | |
| 841 | |
| 842 PROTECTED_MENU_HANDLER( bookGetOwnNumber ) | |
| 843 { | |
| 844 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 845 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 846 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 847 | |
| 848 | |
| 849 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | |
| 850 data->phbk->current.status.book = PHB_UPN; | |
| 851 data->phbk->search_win = bookSearchStart( data->phbk->win ); | |
| 852 | |
| 853 return MFW_EVENT_CONSUMED; | |
| 854 } | |
| 855 | |
| 856 | |
| 857 /******************************************************************************* | |
| 858 | |
| 859 $Function: bookSetOwnNumber | |
| 860 | |
| 861 $Description: | |
| 862 | |
| 863 Set own number | |
| 864 | |
| 865 $Returns: Refer Menu Handlers Definition Block Above | |
| 866 | |
| 867 $Arguments: Refer Menu Handlers Definition Block Above | |
| 868 | |
| 869 *******************************************************************************/ | |
| 870 | |
| 871 PROTECTED_MENU_HANDLER( bookSetOwnNumber ) | |
| 872 { T_MFW_HND win = mfwParent( mfw_header() ); | |
| 873 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 874 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 875 T_phbk *Phbk = data->phbk; | |
| 876 | |
| 877 /* Clear the input editor structures before we go any further | |
| 878 */ | |
| 879 /*MC SPR 1257, replacing PHB_MAX_LEN with MAX_ALPHA_LEN for name strings*/ | |
| 880 memset( Phbk->phbk->edt_buf_name, '\0', MAX_ALPHA_LEN ); | |
| 881 memset( Phbk->phbk->edt_buf_number, '\0', PHB_MAX_LEN ); | |
| 882 | |
| 883 /* Indicate this is an additional entry being created | |
| 884 */ | |
| 885 Phbk->UpdateAction = CREATE_ENTRY; | |
| 886 data->phbk->current.status.book = PHB_UPN; | |
| 887 /* Determine if we have room to add any new entries | |
| 888 */ | |
| 889 bookGetCurrentStatus( &Phbk->phbk->current.status ); | |
| 890 if ( Phbk->phbk->current.status.avail_entries ) | |
| 891 { | |
| 892 /* We are okay to input the number, use a worker routine | |
| 893 from the input handler module to actually deal with this | |
| 894 */ | |
| 895 Phbk->input_number_win = bookInputStartNumberEditor( win, Phbk->edt_buf_number ); | |
| 896 } | |
| 897 else | |
| 898 { | |
| 899 /* We have no room available to add the name, so check if | |
| 900 we have filled the namespace or not | |
| 901 */ | |
| 902 tIndexTagNames Tag = ( Phbk->phbk->current.status.used_entries ) | |
| 903 ? TxtMyNumberFull : TxtOperationNotAvail; //SPR 31705 x0021308:RamG. | |
| 904 bookShowInformation( win, Tag, NULL, NULL ); | |
| 905 } | |
| 906 | |
| 907 /* Always return event consumed | |
| 908 */ | |
| 909 return MFW_EVENT_CONSUMED; | |
| 910 } | |
| 911 | |
| 912 | |
| 913 /******************************************************************************* | |
| 914 | |
| 915 $Function: bookRepRedNameEnter | |
| 916 | |
| 917 $Description: | |
| 918 | |
| 919 Enter name associated with Reply-Redial number | |
| 920 | |
| 921 $Returns: Refer Menu Handlers Definition Block Above | |
| 922 | |
| 923 $Arguments: Refer Menu Handlers Definition Block Above | |
| 924 | |
| 925 *******************************************************************************/ | |
| 926 | |
| 927 PROTECTED_MENU_HANDLER( bookRepRedNameEnter ) | |
| 928 { | |
| 929 // Sep 22, 2004 REF: CRR 21392 xvilliva | |
| 930 // We use the variable "Menu", similar to bookNameEnter() to avoid a crash. | |
| 931 T_MFW_HND win = (T_MFW_HND)Menu; | |
| 932 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 933 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 934 T_phbk *Phbk = data->phbk; | |
| 935 char* selected_number; | |
| 936 | |
| 937 selected_number = (char*)data->phbk->current.entry[data->phbk->current.selectedName].number; | |
| 938 // Sep 22, 2004 REF: CRR 21392 xvilliva | |
| 939 // We get the exact book that is selected. | |
| 940 data->phbk->current.status.book = bookActiveBook(WRITE); | |
| 941 | |
| 942 Phbk->UpdateAction = CREATE_ENTRY; | |
| 943 bookGetCurrentStatus( &Phbk->phbk->current.status ); | |
| 944 if ( Phbk->phbk->current.status.avail_entries ) | |
| 945 { | |
| 946 /* We are okay to input the number, use a worker routine | |
| 947 from the input handler module to actually deal with this | |
| 948 */ | |
| 949 | |
| 950 bookAddName(win,selected_number); | |
| 951 } | |
| 952 else | |
| 953 { | |
| 954 /* We have no room available to add the name, so check if | |
| 955 we have filled the namespace or not | |
| 956 */ | |
| 957 tIndexTagNames Tag = ( Phbk->phbk->current.status.used_entries ) | |
| 958 ? TxtPhbkFull : TxtOperationNotAvail; | |
| 959 bookShowInformation( win, Tag, NULL, NULL ); | |
| 960 } | |
| 961 /* free( selected_number); x0039928 - Lint warning removal */ | |
| 962 return 1; | |
| 963 } | |
| 964 | |
| 965 | |
| 966 /******************************************************************************* | |
| 967 | |
| 968 $Function: bookRepRedDelete | |
| 969 | |
| 970 $Description: | |
| 971 | |
| 972 Delete name associated with Reply-Redial Number | |
| 973 | |
| 974 $Returns: Refer Menu Handlers Definition Block Above | |
| 975 | |
| 976 $Arguments: Refer Menu Handlers Definition Block Above | |
| 977 | |
| 978 *******************************************************************************/ | |
| 979 | |
| 980 PROTECTED_MENU_HANDLER( bookRepRedDelete ) | |
| 981 { | |
| 982 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 983 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 984 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 985 T_phbk *Phbk = data->phbk; | |
| 986 | |
| 987 | |
| 988 | |
| 989 deleteFromFile(Phbk,Phbk->current.status.book); | |
| 990 bookShowInformation( Phbk->win, MmiBookCurrentText(),NULL, NULL ); | |
| 991 bookMenuDestroy(Phbk->menu_call_options_win); | |
| 992 // July 21, 2006 REF:DR OMAPS00085695 x0047075 | |
| 993 // Fix : Always sending the CALLS_LIST_INIT event whenever we delete an entry from LDN ,LRN,LMN phonebook. | |
| 994 // if(Phbk->current.status.used_entries > 0) | |
| 995 // SEND_EVENT(Phbk->calls_list_win, SEARCH_SCROLL_UP, 0, 0 ); | |
| 996 SEND_EVENT(Phbk->calls_list_win, CALLS_LIST_INIT, 0, (void*)Phbk->current.status.book ); | |
| 997 return 1; | |
| 998 } | |
| 999 | |
| 1000 | |
| 1001 /******************************************************************************* | |
| 1002 | |
| 1003 $Function: bookCallListDetails | |
| 1004 | |
| 1005 $Description: | |
| 1006 | |
| 1007 Retrieve details for call list | |
| 1008 | |
| 1009 $Returns: Refer Menu Handlers Definition Block Above | |
| 1010 | |
| 1011 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1012 | |
| 1013 *******************************************************************************/ | |
| 1014 | |
| 1015 PROTECTED_MENU_HANDLER( bookCallListDetails ) | |
| 1016 { | |
| 1017 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1018 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1019 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1020 T_phbk *Phbk = data->phbk; | |
| 1021 | |
| 1022 bookCallDetailsStart( Phbk->win); | |
| 1023 return 1; | |
| 1024 | |
| 1025 } | |
| 1026 | |
| 1027 | |
| 1028 | |
| 1029 /******************************************************************************* | |
| 1030 | |
| 1031 $Function: bookServiceNumbers | |
| 1032 | |
| 1033 $Description: | |
| 1034 | |
| 1035 Get service numbers | |
| 1036 | |
| 1037 $Returns: Refer Menu Handlers Definition Block Above | |
| 1038 | |
| 1039 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1040 | |
| 1041 *******************************************************************************/ | |
| 1042 | |
| 1043 PROTECTED_MENU_HANDLER( bookServiceNumbers ) | |
| 1044 { | |
| 1045 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1046 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1047 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1048 | |
| 1049 data->phbk->current.KindOfSearch = SEARCH_BY_NAME; | |
| 1050 data->phbk->current.status.book = PHB_SDN; | |
| 1051 data->phbk->search_win = bookSearchStart( data->phbk->win ); | |
| 1052 | |
| 1053 return MFW_EVENT_CONSUMED; | |
| 1054 } | |
| 1055 | |
| 1056 | |
| 1057 /******************************************************************************* | |
| 1058 | |
| 1059 $Function: bookMemoryStatus | |
| 1060 | |
| 1061 $Description: | |
| 1062 | |
| 1063 Show the status of the phone book memory. | |
| 1064 | |
| 1065 $Returns: Refer Menu Handlers Definition Block Above | |
| 1066 | |
| 1067 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1068 | |
| 1069 *******************************************************************************/ | |
| 1070 | |
| 1071 PROTECTED_MENU_HANDLER( bookMemoryStatus ) | |
| 1072 { | |
| 1073 /* This performs the memory view functions, and returns MFW_EVENT_CONSUMED | |
| 1074 in all cases. | |
| 1075 */ | |
| 1076 bookMemoryView(); | |
| 1077 return MFW_EVENT_CONSUMED; | |
| 1078 } | |
| 1079 | |
| 1080 | |
| 1081 /******************************************************************************* | |
| 1082 | |
| 1083 $Function: bookFDNActivate | |
| 1084 | |
| 1085 $Description: | |
| 1086 | |
| 1087 The FDN Activate routine is simply a wrapper for the real | |
| 1088 FDN Activate handler which resides in mmiPins.c | |
| 1089 | |
| 1090 $Returns: Refer Menu Handlers Definition Block Above | |
| 1091 | |
| 1092 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1093 | |
| 1094 *******************************************************************************/ | |
| 1095 | |
| 1096 PROTECTED_MENU_HANDLER( bookFDNActivate ) | |
| 1097 { | |
| 1098 return fdnActivate( Menu, Item ); | |
| 1099 } | |
| 1100 | |
| 1101 | |
| 1102 /******************************************************************************* | |
| 1103 | |
| 1104 $Function: bookFDNDeactivate | |
| 1105 | |
| 1106 $Description: | |
| 1107 | |
| 1108 The FDN Deactivate routine is simply a wrapper for the real | |
| 1109 FDN Deactivate handler which resides in mmiPins.c | |
| 1110 | |
| 1111 $Returns: Refer Menu Handlers Definition Block Above | |
| 1112 | |
| 1113 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1114 | |
| 1115 *******************************************************************************/ | |
| 1116 | |
| 1117 PROTECTED_MENU_HANDLER( bookFDNDeactivate ) | |
| 1118 { | |
| 1119 return fdnDeactivate( Menu, Item ); | |
| 1120 } | |
| 1121 | |
| 1122 /******************************************************************************* | |
| 1123 | |
| 1124 $Function: bookEnterLDN | |
| 1125 | |
| 1126 $Description: | |
| 1127 | |
| 1128 Enters de LDN List | |
| 1129 | |
| 1130 $Returns: Refer Menu Handlers Definition Block Above | |
| 1131 | |
| 1132 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1133 | |
| 1134 *******************************************************************************/ | |
| 1135 | |
| 1136 PROTECTED_MENU_HANDLER( bookEnterLDN ) | |
| 1137 { | |
| 1138 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1139 | |
| 1140 bookPhonebookStart(win,PhbkRedialListNormal); | |
| 1141 return MFW_EVENT_CONSUMED; | |
| 1142 } | |
| 1143 /******************************************************************************* | |
| 1144 | |
| 1145 $Function: bookEnterLRN | |
| 1146 | |
| 1147 $Description: | |
| 1148 | |
| 1149 Enters de LRN List | |
| 1150 | |
| 1151 $Returns: Refer Menu Handlers Definition Block Above | |
| 1152 | |
| 1153 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1154 | |
| 1155 *******************************************************************************/ | |
| 1156 | |
| 1157 PROTECTED_MENU_HANDLER( bookEnterLRN ) | |
| 1158 { | |
| 1159 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1160 | |
| 1161 bookPhonebookStart(win,PhbkReplyListNormal); | |
| 1162 return MFW_EVENT_CONSUMED; | |
| 1163 } | |
| 1164 | |
| 1165 /******************************************************************************* | |
| 1166 | |
| 1167 $Function: bookEnterLMN | |
| 1168 | |
| 1169 $Description: | |
| 1170 | |
| 1171 Enters de LMN List | |
| 1172 | |
| 1173 $Returns: Refer Menu Handlers Definition Block Above | |
| 1174 | |
| 1175 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1176 | |
| 1177 *******************************************************************************/ | |
| 1178 | |
| 1179 PROTECTED_MENU_HANDLER( bookEnterLMN ) | |
| 1180 { | |
| 1181 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1182 | |
| 1183 /* Issue Number : MMI-FIX-1216 on 07/04/04 by Nishikant Kulkarni and Ajith K.P | |
| 1184 Bug : missed call message is displayed after deleting all missed calls from the list | |
| 1185 Solution: idle_data.missedcalls flag was not updated if the user ckecks/deletes the missed call list | |
| 1186 We rectified the same.*/ | |
| 1187 | |
| 1188 idle_data.missedCalls = 0; | |
| 1189 | |
| 1190 bookPhonebookStart(win,PhbkMissedCallsListNormal); | |
| 1191 return MFW_EVENT_CONSUMED; | |
| 1192 } | |
| 1193 | |
| 1194 /* SPR#1112 - Internal phonebook menu options*/ | |
| 1195 #ifdef INT_PHONEBOOK | |
| 1196 | |
| 1197 /******************************************************************************* | |
| 1198 | |
| 1199 $Function: bookSelectBook | |
| 1200 | |
| 1201 $Description: Open the select book menu, preselecting the appropriate option | |
| 1202 | |
| 1203 $Returns: Refer Menu Handlers Definition Block Above | |
| 1204 | |
| 1205 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1206 | |
| 1207 *******************************************************************************/ | |
| 1208 | |
| 1209 PROTECTED_MENU_HANDLER( bookSelectBook ) | |
| 1210 { | |
| 1211 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1212 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1213 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1214 T_phbk *Phbk = data->phbk; | |
| 1215 T_MFW_HND menu_win; | |
| 1216 UBYTE selectedBook; | |
| 1217 | |
| 1218 TRACE_FUNCTION("bookSelectBook"); | |
| 1219 | |
| 1220 if (bookGetBookAvailable()) | |
| 1221 { | |
| 1222 selectedBook = (UBYTE)bookGetBookSelected(); | |
| 1223 menu_win = bookMenuStart(Phbk->win, SelectBookAttributes(), 0); | |
| 1224 SEND_EVENT(menu_win, DEFAULT_OPTION, NULL, (void *)&selectedBook); // Add our own callback | |
| 1225 } | |
| 1226 else | |
| 1227 { | |
| 1228 bookShowInformation( Phbk->win, TxtNotAvailable, NULL, NULL); | |
| 1229 } | |
| 1230 | |
| 1231 return MFW_EVENT_CONSUMED; | |
| 1232 } | |
| 1233 | |
| 1234 | |
| 1235 /******************************************************************************* | |
| 1236 | |
| 1237 $Function: bookSelectBookSIM | |
| 1238 | |
| 1239 $Description: Select the SIM phone book | |
| 1240 | |
| 1241 $Returns: Refer Menu Handlers Definition Block Above | |
| 1242 | |
| 1243 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1244 | |
| 1245 *******************************************************************************/ | |
| 1246 | |
| 1247 PROTECTED_MENU_HANDLER( bookSelectBookSIM ) | |
| 1248 { | |
| 1249 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1250 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1251 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1252 T_phbk *Phbk = data->phbk; | |
| 1253 | |
| 1254 if (bookGetBookAvailable()) | |
| 1255 { | |
| 1256 bookSetBookSelected(FALSE); | |
| 1257 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookChangePB, (USHORT)bookGetBookSelected(), 100); | |
| 1258 } | |
| 1259 else | |
| 1260 bookShowInfoScreen( Phbk->win, TxtPhonebook, TxtChanged, NULL, NULL, 3000); | |
| 1261 | |
| 1262 return MFW_EVENT_CONSUMED; | |
| 1263 } | |
| 1264 | |
| 1265 | |
| 1266 /******************************************************************************* | |
| 1267 | |
| 1268 $Function: bookSelectBookSIM | |
| 1269 | |
| 1270 $Description: Select the SIM phone book | |
| 1271 | |
| 1272 $Returns: Refer Menu Handlers Definition Block Above | |
| 1273 | |
| 1274 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1275 | |
| 1276 *******************************************************************************/ | |
| 1277 | |
| 1278 PROTECTED_MENU_HANDLER( bookSelectBookPhone ) | |
| 1279 { | |
| 1280 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1281 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1282 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1283 T_phbk *Phbk = data->phbk; | |
| 1284 | |
| 1285 if (bookGetBookAvailable()) | |
| 1286 { | |
| 1287 bookSetBookSelected(TRUE); | |
| 1288 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookChangePB, (USHORT)bookGetBookSelected(), 100); | |
| 1289 } | |
| 1290 else | |
| 1291 { | |
| 1292 bookShowInformation( Phbk->win, TxtNotAvailable,NULL, NULL ); | |
| 1293 } | |
| 1294 | |
| 1295 return MFW_EVENT_CONSUMED; | |
| 1296 } | |
| 1297 | |
| 1298 /******************************************************************************* | |
| 1299 | |
| 1300 $Function: bookCopyEntry | |
| 1301 | |
| 1302 $Description: Copy a single entry from/to internal memory | |
| 1303 | |
| 1304 $Returns: Refer Menu Handlers Definition Block Above | |
| 1305 | |
| 1306 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1307 | |
| 1308 *******************************************************************************/ | |
| 1309 | |
| 1310 PROTECTED_MENU_HANDLER( bookCopyEntry ) | |
| 1311 { | |
| 1312 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1313 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1314 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1315 T_phbk *Phbk = data->phbk; | |
| 1316 | |
| 1317 TRACE_FUNCTION( "bookCopyEntry()" ); | |
| 1318 | |
| 1319 if (bookGetBookAvailable()) | |
| 1320 { | |
| 1321 /* Show Please Wait dialog briefly, then call copy function | |
| 1322 */ | |
| 1323 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopySingle, (USHORT)FALSE, 100); | |
| 1324 } | |
| 1325 else | |
| 1326 { | |
| 1327 bookShowInformation( Phbk->win, TxtNotAvailable, NULL, NULL); | |
| 1328 } | |
| 1329 | |
| 1330 return MFW_EVENT_CONSUMED; | |
| 1331 } | |
| 1332 | |
| 1333 /******************************************************************************* | |
| 1334 | |
| 1335 $Function: bookCopyAll | |
| 1336 | |
| 1337 $Description: Copy all entries from/to internal memory | |
| 1338 | |
| 1339 $Returns: Refer Menu Handlers Definition Block Above | |
| 1340 | |
| 1341 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1342 | |
| 1343 *******************************************************************************/ | |
| 1344 | |
| 1345 PROTECTED_MENU_HANDLER( bookCopyAll ) | |
| 1346 { | |
| 1347 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1348 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1349 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1350 T_phbk *Phbk = data->phbk; | |
| 1351 | |
| 1352 TRACE_FUNCTION( "bookCopyAll()" ); | |
| 1353 | |
| 1354 if (bookGetBookAvailable()) | |
| 1355 { | |
| 1356 /* Copy | |
| 1357 */ | |
| 1358 bookCopyMultiple(Phbk->win, FALSE, 0); | |
| 1359 } | |
| 1360 else | |
| 1361 { | |
| 1362 bookShowInformation( Phbk->win, TxtNotAvailable, NULL, NULL); | |
| 1363 } | |
| 1364 | |
| 1365 return MFW_EVENT_CONSUMED; | |
| 1366 } | |
| 1367 | |
| 1368 /******************************************************************************* | |
| 1369 | |
| 1370 $Function: bookMoveEntry | |
| 1371 | |
| 1372 $Description: Move a single entry from/to internal memory | |
| 1373 | |
| 1374 $Returns: Refer Menu Handlers Definition Block Above | |
| 1375 | |
| 1376 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1377 | |
| 1378 *******************************************************************************/ | |
| 1379 | |
| 1380 PROTECTED_MENU_HANDLER( bookMoveEntry ) | |
| 1381 { | |
| 1382 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1383 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1384 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1385 T_phbk *Phbk = data->phbk; | |
| 1386 | |
| 1387 TRACE_FUNCTION( "bookMoveEntry()" ); | |
| 1388 | |
| 1389 if (bookGetBookAvailable()) | |
| 1390 { | |
| 1391 /* Show Please Wait dialog briefly, then call move function | |
| 1392 */ | |
| 1393 bookShowInfoScreen( Phbk->win, TxtPleaseWait, NULL, (T_VOID_FUNC)bookCopySingle, (USHORT)TRUE, 100); | |
| 1394 } | |
| 1395 else | |
| 1396 { | |
| 1397 bookShowInformation( Phbk->win, TxtNotAvailable, NULL, NULL); | |
| 1398 } | |
| 1399 | |
| 1400 return MFW_EVENT_CONSUMED; | |
| 1401 } | |
| 1402 | |
| 1403 /******************************************************************************* | |
| 1404 | |
| 1405 $Function: bookMoveAll | |
| 1406 | |
| 1407 $Description: Move all entries from/to internal memory | |
| 1408 | |
| 1409 $Returns: Refer Menu Handlers Definition Block Above | |
| 1410 | |
| 1411 $Arguments: Refer Menu Handlers Definition Block Above | |
| 1412 | |
| 1413 *******************************************************************************/ | |
| 1414 | |
| 1415 PROTECTED_MENU_HANDLER( bookMoveAll ) | |
| 1416 { | |
| 1417 T_MFW_HND win = mfwParent( mfw_header() ); | |
| 1418 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | |
| 1419 tBookStandard *data = (tBookStandard *) win_data->user; | |
| 1420 T_phbk *Phbk = data->phbk; | |
| 1421 | |
| 1422 TRACE_FUNCTION( "bookMoveAll()" ); | |
| 1423 | |
| 1424 if (bookGetBookAvailable()) | |
| 1425 { | |
| 1426 /* Show Please Wait dialog briefly, then call copy function | |
| 1427 */ | |
| 1428 bookCopyMultiple(Phbk->win, TRUE, 0); | |
| 1429 } | |
| 1430 else | |
| 1431 { | |
| 1432 bookShowInformation( Phbk->win, TxtNotAvailable, NULL, NULL); | |
| 1433 } | |
| 1434 | |
| 1435 return MFW_EVENT_CONSUMED; | |
| 1436 } | |
| 1437 | |
| 1438 #endif | |
| 1439 | |
| 1440 PIN2RQD_MENU_HANDLER( CphsAlsLock ) | |
| 1441 { | |
| 1442 return cphs_lock_als( Menu, Item ); | |
| 1443 } | |
| 1444 | |
| 1445 PIN2RQD_MENU_HANDLER( CphsAlsUnlock ) | |
| 1446 { | |
| 1447 return cphs_unlock_als( Menu, Item ); | |
| 1448 } | |
| 1449 /******************************************************************************* | |
| 1450 | |
| 1451 End of File | |
| 1452 | |
| 1453 *******************************************************************************/ | |
| 1454 | |
| 1455 | |
| 1456 |
