commonuis/CommonUi/src/FindItemMenu.cpp
branchRCL_3
changeset 51 fcdfafb36fe7
parent 16 71dd06cfe933
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
   621                     ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ),
   621                     ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ),
   622                     0,
   622                     0,
   623                     tempBuf);
   623                     tempBuf);
   624                 index = EFindItemCmdGoToUrl;
   624                 index = EFindItemCmdGoToUrl;
   625 
   625 
   626                 if ( !iIsContextMenu )
   626                 // Add bookmark
   627                     {
   627                 iCoeEnv->ReadResourceL(
   628                     // Add bookmark
   628                     tempBuf, R_FINDITEMMENU_ADD_BOOKMARK );
   629                     iCoeEnv->ReadResourceL(
   629                 AddMenuItemL(
   630                         tempBuf, R_FINDITEMMENU_ADD_BOOKMARK );
   630                     *iMenuPane,
   631                     AddMenuItemL(
   631                     EFindItemCmdAddToBookmark,
   632                         *iMenuPane,
   632                     index,
   633                         EFindItemCmdAddToBookmark,
   633                     0,
   634                         index,
   634                     tempBuf );
   635                         0,
   635                 index = EFindItemCmdAddToBookmark;
   636                         tempBuf );
   636                    
   637                     index = EFindItemCmdAddToBookmark;
       
   638                     }
       
   639                 }
   637                 }
   640             else
   638             else
   641                 {
   639                 {
   642                 AddMenuItemL(
   640                 AddMenuItemL(
   643                     *iMenuPane,
   641                     *iMenuPane,
   645                     ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ),
   643                     ( iIsContextMenu ? EFindItemContextMenuPlaceHolder : index ),
   646                     0,
   644                     0,
   647                     tempBuf );
   645                     tempBuf );
   648                 index = EFindItemCmdGoToRstp;
   646                 index = EFindItemCmdGoToRstp;
   649 
   647 
   650                 if ( !iIsContextMenu )
   648                 iCoeEnv->ReadResourceL(
   651                     {
   649                     tempBuf, R_FINDITEMMENU_ADD_TO_GALLERY );
   652                     iCoeEnv->ReadResourceL(
   650                 AddMenuItemL(
   653                         tempBuf, R_FINDITEMMENU_ADD_TO_GALLERY );
   651                     *iMenuPane,
   654                     AddMenuItemL(
   652                     EFindItemCmdAddToGallery,
   655                         *iMenuPane,
   653                     index,
   656                         EFindItemCmdAddToGallery,
   654                     0,
   657                         index,
   655                     tempBuf );
   658                         0,
   656                 index = EFindItemCmdAddToGallery;
   659                         tempBuf );
   657                   
   660                     index = EFindItemCmdAddToGallery;
       
   661                     }
       
   662                 }
   658                 }
   663             break;
   659             break;
   664             }
   660             }
   665         case CItemFinder::EEmailAddress:
   661         case CItemFinder::EEmailAddress:
   666             {
   662             {
   840        
   836        
   841         }
   837         }
   842 
   838 
   843      // Add to contacts
   839      // Add to contacts
   844      if ( ( itemType != CItemFinder::EUriScheme ) &&
   840      if ( ( itemType != CItemFinder::EUriScheme ) &&
   845         !( itemType == CItemFinder::EUrlAddress &&
       
   846         iIsContextMenu ) &&
       
   847         ( ( ( ( !iIsSenderKnown &&
   841         ( ( ( ( !iIsSenderKnown &&
   848         iSenderDescriptor->Length() ) ||
   842         iSenderDescriptor->Length() ) ||
   849         iCallbackNumber ) &&
   843         iCallbackNumber ) &&
   850         itemType == CItemFinder::ENoneSelected ) ||
   844         itemType == CItemFinder::ENoneSelected ) ||
   851         itemType != CItemFinder::ENoneSelected ) )
   845         itemType != CItemFinder::ENoneSelected ) )
   891     // profiles there must be Internet call command in call submenu.
   885     // profiles there must be Internet call command in call submenu.
   892     TInt dummy = 0;
   886     TInt dummy = 0;
   893     if ( ( !iHideCallMenu ||
   887     if ( ( !iHideCallMenu ||
   894         ( iFindItemVoIPExtension->IsVoIPSupported() &&
   888         ( iFindItemVoIPExtension->IsVoIPSupported() &&
   895         iFindItemVoIPExtension->VoIPProfilesExistL() ) ) &&
   889         iFindItemVoIPExtension->VoIPProfilesExistL() ) ) &&
   896         iMenuPane->MenuItemExists( EFindItemCmdCall, dummy ) )
   890         iMenuPane->MenuItemExists( EFindItemCmdCall, dummy ) &&
       
   891         !iHideCallSubMenu )
   897         {
   892         {
   898         iMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
   893         iMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
   899         iMenuPane->AddMenuItemsL(
   894         iMenuPane->AddMenuItemsL(
   900             R_FINDMENU_CALLUI_AIW_ITEM,
   895             R_FINDMENU_CALLUI_AIW_ITEM,
   901             EFindItemCmdCall );
   896             EFindItemCmdCall );
   902         }
   897         }
   903     }
   898     }
       
   899 
       
   900 
       
   901 // -----------------------------------------------------------------------------
       
   902 // CFindItemMenu::SetCallSubMenuVisibility
       
   903 // Sets AIW submenu visibility
       
   904 // -----------------------------------------------------------------------------
       
   905 //
       
   906 EXPORT_C void CFindItemMenu::SetCallSubMenuVisibility( TBool aVisible )
       
   907     {
       
   908     iHideCallSubMenu = !aVisible;
       
   909     }
       
   910 
   904 
   911 
   905 EXPORT_C void CFindItemMenu::HandleItemFinderCommandL( TInt aCommand )
   912 EXPORT_C void CFindItemMenu::HandleItemFinderCommandL( TInt aCommand )
   906     {
   913     {
   907     switch ( aCommand )
   914     switch ( aCommand )
   908         {
   915         {