554 TInt index = iIndex; |
539 TInt index = iIndex; |
555 |
540 |
556 TBuf<KMaxMenuTextLength> tempBuf; |
541 TBuf<KMaxMenuTextLength> tempBuf; |
557 |
542 |
558 // Adds menu items depending the selected item |
543 // Adds menu items depending the selected item |
559 if ( HasSelection() ) |
544 switch ( itemType ) |
560 { |
545 { |
561 switch ( itemType ) |
546 case CItemFinder::EPhoneNumber: |
562 { |
547 { |
563 case CItemFinder::EPhoneNumber: |
548 #ifdef RD_VOIP_REL_2_2 |
|
549 if ( FeatureManager::FeatureSupported(KFeatureIdCommonVoip ) ) |
564 { |
550 { |
565 #ifdef RD_VOIP_REL_2_2 |
551 // show call menu if allowed |
566 if ( FeatureManager::FeatureSupported(KFeatureIdCommonVoip ) ) |
552 if ( !( iMenuItemFlags & CFindItemMenu::ECallItem ) ) |
567 { |
|
568 // show call menu if allowed |
|
569 if ( !( iMenuItemFlags & CFindItemMenu::ECallItem ) ) |
|
570 { |
|
571 // Call |
|
572 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
573 AddMenuItemL( |
|
574 *iMenuPane, |
|
575 EFindItemCmdCall, |
|
576 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
577 0, |
|
578 tempBuf ); |
|
579 } |
|
580 // if context menu, we will show call item anyway |
|
581 else if ( iIsContextMenu ) |
|
582 { |
|
583 // Call |
|
584 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
585 AddMenuItemL( |
|
586 *iMenuPane, |
|
587 EFindItemCmdCall, |
|
588 EFindItemContextMenuPlaceHolder, |
|
589 0, |
|
590 tempBuf ); |
|
591 } |
|
592 } |
|
593 else |
|
594 { |
553 { |
595 // Call |
554 // Call |
596 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
555 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
597 AddMenuItemL( |
556 AddMenuItemL( |
598 *iMenuPane, |
557 *iMenuPane, |
599 EFindItemCmdCall, |
558 EFindItemCmdCall, |
600 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
559 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
601 0, |
560 0, |
602 tempBuf ); |
561 tempBuf ); |
603 } |
562 } |
604 index = EFindItemCmdCall; |
563 // if context menu, we will show call item anyway |
605 #else |
564 else if ( iIsContextMenu ) |
|
565 { |
|
566 // Call |
|
567 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
568 AddMenuItemL( |
|
569 *iMenuPane, |
|
570 EFindItemCmdCall, |
|
571 EFindItemContextMenuPlaceHolder, |
|
572 0, |
|
573 tempBuf ); |
|
574 } |
|
575 } |
|
576 else |
|
577 { |
606 // Call |
578 // Call |
607 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
579 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
608 AddMenuItemL( |
580 AddMenuItemL( |
609 *iMenuPane, |
581 *iMenuPane, |
610 EFindItemCmdCall, |
582 EFindItemCmdCall, |
611 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
583 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
612 0, |
584 0, |
613 tempBuf ); |
585 tempBuf ); |
614 index = EFindItemCmdCall; |
586 } |
|
587 index = EFindItemCmdCall; |
|
588 #else |
|
589 // Call |
|
590 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
591 AddMenuItemL( |
|
592 *iMenuPane, |
|
593 EFindItemCmdCall, |
|
594 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
595 0, |
|
596 tempBuf ); |
|
597 index = EFindItemCmdCall; |
615 #endif // RD_VOIP_REL_2_2 |
598 #endif // RD_VOIP_REL_2_2 |
616 // Write |
599 // Write |
|
600 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_MESSAGE_SUB ); |
|
601 AddMenuItemL( |
|
602 *iMenuPane, |
|
603 EFindItemSubMenuSend, |
|
604 index, |
|
605 0,//R_FINDITEM_NUMBER_MESSAGE_SUBMENU, |
|
606 tempBuf ); |
|
607 index = EFindItemSubMenuSend; |
|
608 |
|
609 break; |
|
610 } |
|
611 case CItemFinder::EUrlAddress: |
|
612 { |
|
613 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_GOTO_URL ); |
|
614 |
|
615 // check if not rstp |
|
616 if ( iAutomaticFind->CurrentItemExt().iItemDescriptor->FindF( KRtspUrlAddress ) == KErrNotFound ) |
|
617 { |
|
618 AddMenuItemL( |
|
619 *iMenuPane, |
|
620 EFindItemCmdGoToUrl, |
|
621 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
622 0, |
|
623 tempBuf); |
|
624 index = EFindItemCmdGoToUrl; |
|
625 |
|
626 if ( !iIsContextMenu ) |
|
627 { |
|
628 // Add bookmark |
|
629 iCoeEnv->ReadResourceL( |
|
630 tempBuf, R_FINDITEMMENU_ADD_BOOKMARK ); |
|
631 AddMenuItemL( |
|
632 *iMenuPane, |
|
633 EFindItemCmdAddToBookmark, |
|
634 index, |
|
635 0, |
|
636 tempBuf ); |
|
637 index = EFindItemCmdAddToBookmark; |
|
638 } |
|
639 } |
|
640 else |
|
641 { |
|
642 AddMenuItemL( |
|
643 *iMenuPane, |
|
644 EFindItemCmdGoToRstp, |
|
645 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
646 0, |
|
647 tempBuf ); |
|
648 index = EFindItemCmdGoToRstp; |
|
649 |
|
650 if ( !iIsContextMenu ) |
|
651 { |
|
652 iCoeEnv->ReadResourceL( |
|
653 tempBuf, R_FINDITEMMENU_ADD_TO_GALLERY ); |
|
654 AddMenuItemL( |
|
655 *iMenuPane, |
|
656 EFindItemCmdAddToGallery, |
|
657 index, |
|
658 0, |
|
659 tempBuf ); |
|
660 index = EFindItemCmdAddToGallery; |
|
661 } |
|
662 } |
|
663 break; |
|
664 } |
|
665 case CItemFinder::EEmailAddress: |
|
666 { |
|
667 // Checks VoIP profile count and local variation |
|
668 if ( iIsContextMenu && iFindItemVoIPExtension->VoIPProfilesExistL() ) |
|
669 { |
|
670 //Call |
|
671 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
672 AddMenuItemL( |
|
673 *iMenuPane, |
|
674 EFindItemCmdCall, |
|
675 EFindItemContextMenuPlaceHolder, |
|
676 0, |
|
677 tempBuf ); |
|
678 index = EFindItemCmdCall; // Replaces the call ui menu when email |
|
679 // field is selected. |
|
680 } |
|
681 |
|
682 // Write |
|
683 if( iEmailOverSmsFeatureSupported || iMMSFeatureSupported || |
|
684 iEmailUiFeatureSupported ) // Sometimes submenu can be empty. |
|
685 { |
617 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_MESSAGE_SUB ); |
686 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_MESSAGE_SUB ); |
618 AddMenuItemL( |
687 AddMenuItemL( |
619 *iMenuPane, |
688 *iMenuPane, |
620 EFindItemSubMenuSend, |
689 EFindItemSubMenuSend, |
621 index, |
690 ( ( iIsContextMenu && |
622 0,//R_FINDITEM_NUMBER_MESSAGE_SUBMENU, |
691 !iFindItemVoIPExtension->VoIPProfilesExistL() ) ? |
|
692 EFindItemContextMenuPlaceHolder : index ), |
|
693 0,//R_FINDITEM_EMAIL_MESSAGE_SUBMENU, |
623 tempBuf ); |
694 tempBuf ); |
624 index = EFindItemSubMenuSend; |
695 index = EFindItemSubMenuSend; |
625 |
|
626 break; |
|
627 } |
696 } |
628 case CItemFinder::EUrlAddress: |
697 break; |
629 { |
698 } |
630 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_GOTO_URL ); |
699 case CItemFinder::EUriScheme: |
631 |
700 { |
632 // check if not rstp |
701 // Use |
633 if ( iAutomaticFind->CurrentItemExt().iItemDescriptor->FindF( KRtspUrlAddress ) == KErrNotFound ) |
702 iCoeEnv->ReadResourceL( tempBuf, R_QTN_OPTIONS_SCHEME_USE ); |
634 { |
703 AddMenuItemL( |
635 AddMenuItemL( |
704 *iMenuPane, |
636 *iMenuPane, |
705 EFindItemCmdUse, |
637 EFindItemCmdGoToUrl, |
706 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
638 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
707 0, |
639 0, |
708 tempBuf ); |
640 tempBuf); |
709 index = EFindItemCmdUse; |
641 index = EFindItemCmdGoToUrl; |
710 break; |
642 |
711 } |
643 if ( !iIsContextMenu ) |
712 default: |
644 { |
713 { |
645 // Add bookmark |
714 // Something else, probably nothing selected or new type which we |
646 iCoeEnv->ReadResourceL( |
715 // don't support. |
647 tempBuf, R_FINDITEMMENU_ADD_BOOKMARK ); |
716 break; |
648 AddMenuItemL( |
717 } |
649 *iMenuPane, |
718 } |
650 EFindItemCmdAddToBookmark, |
|
651 index, |
|
652 0, |
|
653 tempBuf ); |
|
654 index = EFindItemCmdAddToBookmark; |
|
655 } |
|
656 } |
|
657 else |
|
658 { |
|
659 AddMenuItemL( |
|
660 *iMenuPane, |
|
661 EFindItemCmdGoToRstp, |
|
662 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
663 0, |
|
664 tempBuf ); |
|
665 index = EFindItemCmdGoToRstp; |
|
666 |
|
667 if ( !iIsContextMenu ) |
|
668 { |
|
669 iCoeEnv->ReadResourceL( |
|
670 tempBuf, R_FINDITEMMENU_ADD_TO_GALLERY ); |
|
671 AddMenuItemL( |
|
672 *iMenuPane, |
|
673 EFindItemCmdAddToGallery, |
|
674 index, |
|
675 0, |
|
676 tempBuf ); |
|
677 index = EFindItemCmdAddToGallery; |
|
678 } |
|
679 } |
|
680 break; |
|
681 } |
|
682 case CItemFinder::EEmailAddress: |
|
683 { |
|
684 // Checks VoIP profile count and local variation |
|
685 if ( iIsContextMenu && iFindItemVoIPExtension->VoIPProfilesExistL() ) |
|
686 { |
|
687 //Call |
|
688 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_CALL ); |
|
689 AddMenuItemL( |
|
690 *iMenuPane, |
|
691 EFindItemCmdCall, |
|
692 EFindItemContextMenuPlaceHolder, |
|
693 0, |
|
694 tempBuf ); |
|
695 index = EFindItemCmdCall; // Replaces the call ui menu when email |
|
696 // field is selected. |
|
697 } |
|
698 |
|
699 // Write |
|
700 if( iEmailOverSmsFeatureSupported || iMMSFeatureSupported || |
|
701 iEmailUiFeatureSupported ) // Sometimes submenu can be empty. |
|
702 { |
|
703 iCoeEnv->ReadResourceL( tempBuf, R_FINDITEMMENU_MESSAGE_SUB ); |
|
704 AddMenuItemL( |
|
705 *iMenuPane, |
|
706 EFindItemSubMenuSend, |
|
707 ( ( iIsContextMenu && |
|
708 !iFindItemVoIPExtension->VoIPProfilesExistL() ) ? |
|
709 EFindItemContextMenuPlaceHolder : index ), |
|
710 0,//R_FINDITEM_EMAIL_MESSAGE_SUBMENU, |
|
711 tempBuf ); |
|
712 index = EFindItemSubMenuSend; |
|
713 } |
|
714 break; |
|
715 } |
|
716 case CItemFinder::EUriScheme: |
|
717 { |
|
718 // Use |
|
719 iCoeEnv->ReadResourceL( tempBuf, R_QTN_OPTIONS_SCHEME_USE ); |
|
720 AddMenuItemL( |
|
721 *iMenuPane, |
|
722 EFindItemCmdUse, |
|
723 ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ), |
|
724 0, |
|
725 tempBuf ); |
|
726 index = EFindItemCmdUse; |
|
727 break; |
|
728 } |
|
729 default: |
|
730 { |
|
731 // Something else, probably nothing selected or new type which we |
|
732 // don't support. |
|
733 break; |
|
734 } |
|
735 } |
|
736 } |
|
737 |
|
738 // Call |
719 // Call |
739 if ( HasSelection() && ( |
720 if ( |
740 ( itemType == CItemFinder::ENoneSelected ) && |
721 ( itemType == CItemFinder::ENoneSelected ) && |
741 ( |
722 ( |
742 ( |
723 ( |
743 iSenderDescriptor->Length() && |
724 iSenderDescriptor->Length() && |
744 iSenderDescType == CItemFinder::EPhoneNumber || |
725 iSenderDescType == CItemFinder::EPhoneNumber || |