796 TBool CPbk2MemoryEntryDefaultsDlg::IsSupported |
800 TBool CPbk2MemoryEntryDefaultsDlg::IsSupported |
797 ( const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID ) const |
801 ( const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID ) const |
798 { |
802 { |
799 TBool ret(ETrue); |
803 TBool ret(ETrue); |
800 |
804 |
801 // Skip the line if Email field not supported |
805 // Skip the line if Email field not supported or having no mailbox |
802 if ( aSelectorID == VPbkFieldTypeSelectorFactory::EEmailEditorSelector && |
806 if ( aSelectorID == VPbkFieldTypeSelectorFactory::EEmailEditorSelector ) |
803 !FeatureManager::FeatureSupported( KFeatureIdEmailUi ) ) |
807 { |
804 { |
808 if ( !FeatureManager::FeatureSupported( KFeatureIdEmailUi ) || !HasMailboxAccountsL() ) |
805 ret = EFalse; |
809 { |
|
810 ret = EFalse; |
|
811 } |
806 } |
812 } |
807 // Do not add video fields if they are not enabled |
813 // Do not add video fields if they are not enabled |
808 else if ( ( aSelectorID == VPbkFieldTypeSelectorFactory::EVideoCallSelector ) && |
814 else if ( ( aSelectorID == VPbkFieldTypeSelectorFactory::EVideoCallSelector ) && |
809 !( iLVFlags & EVPbkLVAddVideoTelephonyFields ) ) |
815 !( iLVFlags & EVPbkLVAddVideoTelephonyFields ) ) |
810 { |
816 { |
824 } |
830 } |
825 |
831 |
826 return ret; |
832 return ret; |
827 } |
833 } |
828 |
834 |
|
835 // -------------------------------------------------------------------------- |
|
836 // CPbk2MemoryEntryDefaultsDlg::HasMailboxAccountsL |
|
837 // -------------------------------------------------------------------------- |
|
838 // |
|
839 TBool CPbk2MemoryEntryDefaultsDlg::HasMailboxAccountsL() const |
|
840 { |
|
841 using namespace EmailInterface; |
|
842 |
|
843 TBool result = EFalse; |
|
844 CEmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL(); |
|
845 CleanupStack::PushL( factory ); |
|
846 MEmailInterface* ifPtr = factory->InterfaceL( KEmailClientApiInterface ); |
|
847 MEmailClientApi* clientApi = static_cast<MEmailClientApi*>( ifPtr ); |
|
848 CleanupReleasePushL( *clientApi ); |
|
849 |
|
850 // Get mailboxs |
|
851 RMailboxPtrArray mailboxes; |
|
852 clientApi->GetMailboxesL( mailboxes ); |
|
853 TInt count = mailboxes.Count(); |
|
854 if ( count > 0 ) |
|
855 { |
|
856 result = ETrue; |
|
857 } |
|
858 |
|
859 // Release mailboxs before releasing clientapi |
|
860 for ( TInt i=0; i<count; i++ ) |
|
861 { |
|
862 MEmailMailbox* mailbox = mailboxes[i]; |
|
863 mailbox->Release(); |
|
864 } |
|
865 mailboxes.Close(); |
|
866 CleanupStack::PopAndDestroy( 2 ); // clientApi and factory |
|
867 |
|
868 return result; |
|
869 } |
829 // -------------------------------------------------------------------------- |
870 // -------------------------------------------------------------------------- |
830 // CPbk2MemoryEntryDefaultsDlg::IsAvailable |
871 // CPbk2MemoryEntryDefaultsDlg::IsAvailable |
831 // -------------------------------------------------------------------------- |
872 // -------------------------------------------------------------------------- |
832 // |
873 // |
833 TBool CPbk2MemoryEntryDefaultsDlg::IsAvailableL |
874 TBool CPbk2MemoryEntryDefaultsDlg::IsAvailableL |