commonuis/CommonUi/src/FindItemMenu.cpp
branchRCL_3
changeset 64 85902f042028
parent 56 d48ab3b357f1
child 72 a5e7a4f63858
equal deleted inserted replaced
59:978afdc0236f 64:85902f042028
   880             }
   880             }
   881         }
   881         }
   882     // Replace cmd call with AIW menu if more than one option available in AIW
   882     // Replace cmd call with AIW menu if more than one option available in AIW
   883     // menu
   883     // menu
   884     // Note: count of VoIP profiles is not static. If phone contains VoIP
   884     // Note: count of VoIP profiles is not static. If phone contains VoIP
   885     // profiles there must be Internet call command in call submenu.
   885     // profiles there must be Internet call command in call submenu.   
       
   886     // No context sensitive menu now. And new requirement is to show 
       
   887     // call menu for normal item and voip menu for sip address if voip is enabled.
   886     TInt dummy = 0;
   888     TInt dummy = 0;
   887     if ( ( !iHideCallMenu ||
   889     if ( itemType == CItemFinder::EEmailAddress &&
   888         ( iFindItemVoIPExtension->IsVoIPSupported() &&
   890         iFindItemVoIPExtension->IsVoIPSupported() &&
   889         iFindItemVoIPExtension->VoIPProfilesExistL() ) ) &&
   891         iFindItemVoIPExtension->VoIPProfilesExistL() &&
   890         iMenuPane->MenuItemExists( EFindItemCmdCall, dummy ) &&
   892         iMenuPane->MenuItemExists( EFindItemCmdCall, dummy ) &&
   891         !iHideCallSubMenu )
   893         !( iMenuItemFlags & CFindItemMenu::ECallItem ) 
   892         {
   894         )         
       
   895         { 
       
   896         // CMyMenuPane is used only to get the aiw menu item 
       
   897         // for sip address, as it is an argument of the InitializeMenuPaneL
       
   898         CMyMenuPane* aiwVoipMenu =
       
   899             new ( ELeave ) CMyMenuPane( ( MEikMenuObserver* )this ); // not used really
       
   900         CleanupStack::PushL( aiwVoipMenu );
       
   901         TResourceReader callUiReader;
       
   902         iCoeEnv->CreateResourceReaderLC(
       
   903             callUiReader, R_FINDMENU_CALLUI_AIW_SUBMENU );
       
   904         aiwVoipMenu->ConstructFromResourceL( callUiReader );
       
   905         CleanupStack::PopAndDestroy(); //  callUiReader 
       
   906 
       
   907         CAiwGenericParamList* inList = CAiwGenericParamList::NewLC();
       
   908 
       
   909         // For SIP Address, use sip parameters
       
   910         TAiwGenericParam param( EGenericParamSIPAddress );
       
   911         
       
   912         // get the aiw menu item for sip address
       
   913         inList->AppendL( param );
       
   914         iServiceHandler->InitializeMenuPaneL(
       
   915                 *( CEikMenuPane* )aiwVoipMenu,
       
   916                 R_FINDMENU_CALLUI_AIW_SUBMENU,
       
   917                 EFindMenuPlaceHolderCallUI,
       
   918                 *inList );
       
   919         
       
   920         // Add all the menus for aiw to context main menu now.
       
   921         for ( TInt i = 0; i < aiwVoipMenu->NumberOfItemsInPane(); i++ )
       
   922             {
       
   923             iMenuPane->AddMenuItemL( aiwVoipMenu->ItemDataByIndexL( i ), EFindItemCmdCall );
       
   924             }
       
   925         
       
   926         // Now options of VOIP call and voice call are exclusive.
       
   927         // For email( sip ) address, voip is used. So set the call
       
   928         // menu to dimmed.
   893         iMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
   929         iMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
   894         iMenuPane->AddMenuItemsL(
   930             
   895             R_FINDMENU_CALLUI_AIW_ITEM,
   931         CleanupStack::PopAndDestroy( inList );
   896             EFindItemCmdCall );
   932         CleanupStack::PopAndDestroy( aiwVoipMenu );
   897         }
   933         }
   898     }
   934     }
   899 
   935 
   900 
   936 
   901 // -----------------------------------------------------------------------------
   937 // -----------------------------------------------------------------------------
   930            // Hide SMS if not supported
   966            // Hide SMS if not supported
   931            
   967            
   932            #ifndef RD_UNIFIED_EDITOR
   968            #ifndef RD_UNIFIED_EDITOR
   933            if ( !iEmailOverSmsFeatureSupported )
   969            if ( !iEmailOverSmsFeatureSupported )
   934                {
   970                {
   935            	   mtmFilter->AppendL(KSenduiMtmSmsUid);
   971                mtmFilter->AppendL(KSenduiMtmSmsUid);
   936                }
   972                }
   937            // Hide MMS if not supported
   973            // Hide MMS if not supported
   938            if (!iMMSFeatureSupported)
   974            if (!iMMSFeatureSupported)
   939                {
   975                {
   940                mtmFilter->AppendL(KSenduiMtmMmsUid);
   976                mtmFilter->AppendL(KSenduiMtmMmsUid);
   942            #endif
   978            #endif
   943            
   979            
   944            // Hide E-Mail if nosupported or phonenumber 
   980            // Hide E-Mail if nosupported or phonenumber 
   945            if ( !iEmailUiFeatureSupported || itemType == CItemFinder::EPhoneNumber )
   981            if ( !iEmailUiFeatureSupported || itemType == CItemFinder::EPhoneNumber )
   946                {
   982                {
   947        	       mtmFilter->AppendL(KSenduiMtmSmtpUid);
   983                mtmFilter->AppendL(KSenduiMtmSmtpUid);
   948                mtmFilter->AppendL(KSenduiMtmImap4Uid);
   984                mtmFilter->AppendL(KSenduiMtmImap4Uid);
   949                mtmFilter->AppendL(KSenduiMtmPop3Uid);
   985                mtmFilter->AppendL(KSenduiMtmPop3Uid);
   950                mtmFilter->AppendL(KSenduiMtmSyncMLEmailUid);
   986                mtmFilter->AppendL(KSenduiMtmSyncMLEmailUid);
   951                }
   987                }
   952            // Hide Audio if not supported or E-mail address
   988            // Hide Audio if not supported or E-mail address
   953            if( !iAudioMessagingFeatureSupported || itemType == CItemFinder::EEmailAddress)
   989            if( !iAudioMessagingFeatureSupported || itemType == CItemFinder::EEmailAddress)
   954                {
   990                {
   955            	   mtmFilter->AppendL(KSenduiMtmAudioMessageUid);
   991                mtmFilter->AppendL(KSenduiMtmAudioMessageUid);
   956                }
   992                }
   957            TUid uid = iSendUi->ShowTypedQueryL( CSendUi::EWriteMenu, NULL, sendingCapabilities, mtmFilter );
   993            TUid uid = iSendUi->ShowTypedQueryL( CSendUi::EWriteMenu, NULL, sendingCapabilities, mtmFilter );
   958            
   994            
   959            CleanupStack::PopAndDestroy();
   995            CleanupStack::PopAndDestroy();
   960            if ( uid == KNullUid )
   996            if ( uid == KNullUid )
  1300             fieldArray->AppendL( fieldInfo );
  1336             fieldArray->AppendL( fieldInfo );
  1301             }
  1337             }
  1302         else if ( itemType == CItemFinder::EEmailAddress &&
  1338         else if ( itemType == CItemFinder::EEmailAddress &&
  1303             ( fieldInfo->FieldId() == EPbkFieldIdEmailAddress ||
  1339             ( fieldInfo->FieldId() == EPbkFieldIdEmailAddress ||
  1304 #ifdef __VOIP 
  1340 #ifdef __VOIP 
  1305 			iFindItemVoIPExtension->IsVoIPSupported() && 
  1341             iFindItemVoIPExtension->IsVoIPSupported() && 
  1306 #else
  1342 #else
  1307             iVoIPFeatureSupported &&
  1343             iVoIPFeatureSupported &&
  1308 #endif 
  1344 #endif 
  1309             fieldInfo->FieldId() == EPbkFieldIdVOIP ) )
  1345             fieldInfo->FieldId() == EPbkFieldIdVOIP ) )
  1310             {
  1346             {
  1559         if ( aFormatVoIPDialData )
  1595         if ( aFormatVoIPDialData )
  1560             {
  1596             {
  1561             // sets call type for VoIP
  1597             // sets call type for VoIP
  1562             iDialData->SetCallType( CAiwDialData::EAIWVoiP );
  1598             iDialData->SetCallType( CAiwDialData::EAIWVoiP );
  1563             }
  1599             }
       
  1600         else
       
  1601             {
       
  1602             // sets call type for call, as now only voice call
       
  1603             // exists in menu now.
       
  1604             iDialData->SetCallType( CAiwDialData::EAIWVoice );
       
  1605             }
       
  1606         }
       
  1607     else
       
  1608         {
       
  1609         // sets call type for call, as now only voice call
       
  1610         // exists in menu now.
       
  1611         iDialData->SetCallType( CAiwDialData::EAIWVoice );
  1564         }
  1612         }
  1565 #endif // RD_VOIP_REL_2_2
  1613 #endif // RD_VOIP_REL_2_2
  1566     iDialData->SetPhoneNumberL( numberPtr );
  1614     iDialData->SetPhoneNumberL( numberPtr );
  1567 
  1615 
  1568     CleanupStack::PopAndDestroy(); // number;
  1616     CleanupStack::PopAndDestroy(); // number;