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