381 void CPbkxRclSearchResultDlg::DynInitMenuPaneL( |
381 void CPbkxRclSearchResultDlg::DynInitMenuPaneL( |
382 TInt aResourceId, |
382 TInt aResourceId, |
383 CEikMenuPane* aMenuPane ) |
383 CEikMenuPane* aMenuPane ) |
384 { |
384 { |
385 FUNC_LOG; |
385 FUNC_LOG; |
|
386 |
386 if ( aResourceId == R_RCL_SEARCH_RESULT_DIALOG_MENU_PANE ) |
387 if ( aResourceId == R_RCL_SEARCH_RESULT_DIALOG_MENU_PANE ) |
387 { |
388 { |
388 |
389 if ( !iFocusableContactPointed ) // dim stylus popup menu |
|
390 { |
|
391 aMenuPane->SetItemDimmed( ERclCmdVoiceCall,ETrue ); |
|
392 aMenuPane->SetItemDimmed( ERclCmdVideoCall, ETrue ); |
|
393 aMenuPane->SetItemDimmed( ERclCmdSendMsg, ETrue ); |
|
394 aMenuPane->SetItemDimmed( ERclCmdSendEmail, ETrue ); |
|
395 aMenuPane->SetItemDimmed( ERclCmdSendBusinessCard, ETrue ); |
|
396 } |
|
397 |
389 if ( iContactItems.Count() == 0 ) |
398 if ( iContactItems.Count() == 0 ) |
390 { |
399 { |
391 // when there are 0 results, only new search option is available |
400 // when there are 0 results, only new search option is available |
392 aMenuPane->SetItemDimmed( ERclCmdViewDetails, ETrue ); |
401 aMenuPane->SetItemDimmed( ERclCmdViewDetails, ETrue ); |
393 aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); |
402 aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); |
397 } |
406 } |
398 else |
407 else |
399 { |
408 { |
400 if ( !iContactSelectorEnabled ) |
409 if ( !iContactSelectorEnabled ) |
401 { |
410 { |
|
411 // dim Options Menu main level items |
|
412 aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); |
|
413 // send menu is always visible, since business card can always be sent |
|
414 aMenuPane->SetItemDimmed( ERclCmdCall, !CallActionsAvailable() ); |
402 |
415 |
403 aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); |
416 if ( iFocusableContactPointed ) // dim stylus popup menu items |
404 |
417 { |
405 aMenuPane->SetItemDimmed( |
418 // Call menus |
406 ERclCmdCall, |
419 aMenuPane->SetItemDimmed( ERclCmdVoiceCall, !iContactActionService.IsActionEnabled( KFscAtComCallGSM ) ); |
407 !CallActionsAvailable() ); |
420 aMenuPane->SetItemDimmed( ERclCmdVideoCall, !iContactActionService.IsActionEnabled( KFscAtComCallVideo ) ); |
408 |
421 // Send menus |
409 // send menu is always visible, since business card can |
422 aMenuPane->SetItemDimmed( ERclCmdSendMsg, !iContactActionService.IsActionEnabled( KFscAtComSendMsg ) ); |
410 // always be sent |
423 aMenuPane->SetItemDimmed( ERclCmdSendEmail, !iContactActionService.IsActionEnabled( KFscAtComSendEmail ) ); |
|
424 aMenuPane->SetItemDimmed( ERclCmdSendBusinessCard, !iContactActionService.IsActionEnabled( KFscAtSendBusinessCard ) ); |
|
425 } |
411 } |
426 } |
412 else |
427 else |
413 { |
428 { |
|
429 // dim Options Menu main level items |
414 aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); |
430 aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); |
415 aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); |
431 aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); |
|
432 |
|
433 // dim stylus popup menu items |
|
434 aMenuPane->SetItemDimmed( ERclCmdVoiceCall,ETrue ); |
|
435 aMenuPane->SetItemDimmed( ERclCmdVideoCall, ETrue ); |
|
436 aMenuPane->SetItemDimmed( ERclCmdSendMsg, ETrue ); |
|
437 aMenuPane->SetItemDimmed( ERclCmdSendEmail, ETrue ); |
|
438 aMenuPane->SetItemDimmed( ERclCmdSendBusinessCard, ETrue ); |
416 } |
439 } |
417 |
440 |
418 aMenuPane->SetItemDimmed( |
441 aMenuPane->SetItemDimmed( |
419 ERclCmdSaveToContacts, |
442 ERclCmdSaveToContacts, |
420 !iContactActionService.IsActionEnabled( KFscAtManSaveAs ) ); |
443 !iContactActionService.IsActionEnabled( KFscAtManSaveAs ) ); |
421 } |
444 } |
422 } |
445 } |
423 else if ( aResourceId == R_RCL_CALL_MENU_PANE ) |
446 else if ( aResourceId == R_RCL_CALL_MENU_PANE ) |
424 { |
447 { |
425 |
|
426 aMenuPane->SetItemDimmed( |
448 aMenuPane->SetItemDimmed( |
427 ERclCmdVoiceCall, |
449 ERclCmdVoiceCall, |
428 !iContactActionService.IsActionEnabled( KFscAtComCallGSM ) ); |
450 !iContactActionService.IsActionEnabled( KFscAtComCallGSM ) ); |
429 |
451 |
430 aMenuPane->SetItemDimmed( |
452 aMenuPane->SetItemDimmed( |
457 aMenuPane->SetItemDimmed( |
479 aMenuPane->SetItemDimmed( |
458 ERclCmdSendBusinessCard, |
480 ERclCmdSendBusinessCard, |
459 !iContactActionService.IsActionEnabled( KFscAtSendBusinessCard ) ); |
481 !iContactActionService.IsActionEnabled( KFscAtSendBusinessCard ) ); |
460 |
482 |
461 } |
483 } |
|
484 iFocusableContactPointed = EFalse; |
462 } |
485 } |
463 |
486 |
464 // --------------------------------------------------------------------------- |
487 // --------------------------------------------------------------------------- |
465 // CPbkxRclSearchResultDlg::GetHelpContext |
488 // CPbkxRclSearchResultDlg::GetHelpContext |
466 // --------------------------------------------------------------------------- |
489 // --------------------------------------------------------------------------- |
1170 switch ( aPointerEvent.iType ) |
1193 switch ( aPointerEvent.iType ) |
1171 { |
1194 { |
1172 case TPointerEvent::EButton1Down: |
1195 case TPointerEvent::EButton1Down: |
1173 { |
1196 { |
1174 TInt focusIndex; |
1197 TInt focusIndex; |
1175 TBool focusableContactPointed = |
1198 iFocusableContactPointed = |
1176 listBox->View()->XYPosToItemIndex( |
1199 listBox->View()->XYPosToItemIndex( |
1177 aPointerEvent.iPosition, focusIndex ); |
1200 aPointerEvent.iPosition, focusIndex ); |
1178 |
1201 |
1179 if ( focusableContactPointed && focusIndex > 0) |
1202 if ( iFocusableContactPointed ) |
1180 { |
1203 { |
1181 TInt oldIndex = iSelectedItemIndex; |
1204 TInt oldIndex = iSelectedItemIndex; |
1182 iSelectedItemIndex = focusIndex; |
1205 iSelectedItemIndex = focusIndex; |
1183 if ( oldIndex != iSelectedItemIndex ) |
1206 if ( oldIndex != iSelectedItemIndex ) |
1184 { |
1207 { |