1332 } |
1332 } |
1333 } |
1333 } |
1334 } |
1334 } |
1335 } |
1335 } |
1336 |
1336 |
1337 TBool hideReplyAll = ( numRecipients <= 1 ); |
1337 TBool hideReplyAll = ( numRecipients <= 1 ); |
1338 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, hideReplyAll ); |
1338 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, hideReplyAll ); |
1339 |
1339 |
1340 // In Sent folder, option forward is shown above options reply and reply all |
1340 // In Sent folder, option forward is shown above options reply and reply all |
1341 TBool forwardAboveReply = ( currentFolder->GetFolderType() == EFSSentFolder ); |
1341 TBool forwardAboveReply = ( currentFolder->GetFolderType() == EFSSentFolder ); |
1342 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, !forwardAboveReply ); |
1342 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, !forwardAboveReply ); |
1343 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward2, forwardAboveReply ); |
1343 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward2, forwardAboveReply ); |
1344 } |
1344 } |
1345 CleanupStack::PopAndDestroy( currentFolder ); |
1345 CleanupStack::PopAndDestroy( currentFolder ); |
1346 } |
1346 } |
1347 |
1347 |
1348 if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_MORE ) |
1348 if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_MORE ) |
1349 { |
1349 { |
1350 TFSMailMsgId currentMessageFolderId = iMessage->GetFolderId(); |
1350 TFSMailMsgId currentMessageFolderId = iMessage->GetFolderId(); |
1351 CFSMailFolder* currentFolder = NULL; |
1351 CFSMailFolder* currentFolder = NULL; |
1352 if ( !iEmbeddedMessageMode ) |
1352 if ( !iEmbeddedMessageMode ) |
1353 { |
1353 { |
1354 TRAP_IGNORE( currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( |
1354 TRAP_IGNORE( currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( |
1355 iMessage->GetMailBoxId(), currentMessageFolderId ) ); |
1355 iMessage->GetMailBoxId(), currentMessageFolderId ) ); |
1356 } |
1356 } |
1357 CleanupStack::PushL( currentFolder ); |
1357 CleanupStack::PushL( currentFolder ); |
1358 if ( !currentFolder || currentFolder->GetFolderType() == EFSOutbox ) |
1358 if ( !currentFolder || currentFolder->GetFolderType() == EFSOutbox ) |
1359 { // outbox folder or embedded message |
1359 { // outbox folder or embedded message |
1360 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
1360 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
1361 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
1361 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
1362 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
1362 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
1363 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
1363 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
1364 // <cmail> Prevent Download Manager opening with attachments |
1364 // <cmail> Prevent Download Manager opening with attachments |
1365 // aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, ETrue ); |
1365 // aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, ETrue ); |
1366 // </cmail> Prevent Download Manager opening with attachments |
1366 // </cmail> Prevent Download Manager opening with attachments |
1367 } |
1367 } |
1368 else // other folders |
1368 else // other folders |
1369 { |
1369 { |
1370 // show read/unread according to current state |
1370 // show read/unread according to current state |
1371 TBool messageIsRead = iMessage->IsFlagSet( EFSMsgFlag_Read ); |
1371 TBool messageIsRead = iMessage->IsFlagSet( EFSMsgFlag_Read ); |
1372 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
1372 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
1373 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
1373 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
1374 |
1374 |
1375 // show/hide move message |
1375 // show/hide move message |
1376 TBool hideMove = !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); |
1376 TBool hideMove = !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); |
1377 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, hideMove ); |
1377 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, hideMove ); |
1378 |
1378 |
1379 // show/hide flag for followup |
1379 // show/hide flag for followup |
1380 TBool hideFlag = !TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ); |
1380 TBool hideFlag = !TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ); |
1381 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, hideFlag ); |
1381 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, hideFlag ); |
1382 |
1382 |
1383 // hide/show download manager option |
1383 // hide/show download manager option |
1384 // <cmail> Prevent Download Manager opening with attachments |
1384 // <cmail> Prevent Download Manager opening with attachments |
1385 // TBool hideDownloadMan = !ShowDownloadManagerMenuInOptions(); |
1385 // TBool hideDownloadMan = !ShowDownloadManagerMenuInOptions(); |
1386 // aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, hideDownloadMan ); |
1386 // aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, hideDownloadMan ); |
1387 // </cmail> |
1387 // </cmail> |
1388 } |
1388 } |
1389 CleanupStack::PopAndDestroy( currentFolder ); |
1389 CleanupStack::PopAndDestroy( currentFolder ); |
1390 } |
1390 } |
1391 |
1391 |
1392 if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_ACTIONS ) |
1392 if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_ACTIONS ) |
1393 { |
1393 { |
1394 // All menu items are hidden by default. |
1394 // All menu items are hidden by default. |
1395 // Undimm items that should be visible in action menu. |
1395 // Undimm items that should be visible in action menu. |
1396 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1396 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1397 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1397 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1398 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
1398 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
1399 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1399 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1400 |
1400 |
1401 TBool remoteLookupAvailable = |
1401 TBool remoteLookupAvailable = |
1402 TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ); |
1402 TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ); |
1403 |
1403 |
1404 if ( ( hotspotType == EHeaderHotspot && ( |
1404 if ( ( hotspotType == EHeaderHotspot && ( |
1405 currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || |
1405 currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || |
1406 currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
1406 currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
1407 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
1407 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
1408 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
1408 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
1409 currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) |
1409 currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) |
1410 || |
1410 || |
1411 ( hotspotType == EBodyHotspot && |
1411 ( hotspotType == EBodyHotspot && |
1412 currentBodyHotSpotData.iItemType == |
1412 currentBodyHotSpotData.iItemType == |
1413 CFindItemEngine::EFindItemSearchMailAddressBin ) ) |
1413 CFindItemEngine::EFindItemSearchMailAddressBin ) ) |
1414 { |
1414 { |
1415 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1415 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1416 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1416 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1417 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMail, EFalse ); |
1417 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMail, EFalse ); |
1418 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); |
1418 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); |
1419 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); |
1419 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); |
1420 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1420 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1421 } |
1421 } |
1422 else if ( hotspotType == EHeaderHotspot && |
1422 else if ( hotspotType == EHeaderHotspot && |
1423 currentHeaderHotSpotData.iType == ETypeAttachment ) |
1423 currentHeaderHotSpotData.iType == ETypeAttachment ) |
1424 { |
1424 { |
1425 TBool hideOpen = !ShowOpenAttachmentOptionL(); |
1425 TBool hideOpen = !ShowOpenAttachmentOptionL(); |
1426 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachment, hideOpen ); |
1426 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachment, hideOpen ); |
1427 TBool hideDownload = !ShowDownloadOptionL(); |
1427 TBool hideDownload = !ShowDownloadOptionL(); |
1428 aMenuPane->SetItemDimmed( EFsEmailUiCmdDownload, hideDownload ); |
1428 aMenuPane->SetItemDimmed( EFsEmailUiCmdDownload, hideDownload ); |
1429 TBool hideCancel = !ShowCancelDownloadOption(); |
1429 TBool hideCancel = !ShowCancelDownloadOption(); |
1430 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelDownload, hideCancel ); |
1430 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelDownload, hideCancel ); |
1431 TBool hideSave = !ShowSaveAttachmentOptionL(); |
1431 TBool hideSave = !ShowSaveAttachmentOptionL(); |
1432 aMenuPane->SetItemDimmed( EFsEmailUiCmdSave, hideSave ); |
1432 aMenuPane->SetItemDimmed( EFsEmailUiCmdSave, hideSave ); |
1433 |
1433 |
1434 TBool hideRemove = hideOpen; |
1434 TBool hideRemove = hideOpen; |
1435 aMenuPane->SetItemDimmed( EFsEmailUiCmdClearFetchedAttachment, hideRemove ); |
1435 aMenuPane->SetItemDimmed( EFsEmailUiCmdClearFetchedAttachment, hideRemove ); |
1436 } |
1436 } |
1437 else if ( hotspotType == EHeaderHotspot && |
1437 else if ( hotspotType == EHeaderHotspot && |
1438 currentHeaderHotSpotData.iType == ETypeAttachments ) |
1438 currentHeaderHotSpotData.iType == ETypeAttachments ) |
1439 { |
1439 { |
1440 TBool hideOpen = !ShowOpenAttachmentOptionL(); |
1440 TBool hideOpen = !ShowOpenAttachmentOptionL(); |
1441 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachmentList, hideOpen ); |
1441 aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachmentList, hideOpen ); |
1442 TBool hideDownload = !ShowDownloadOptionL(); |
1442 TBool hideDownload = !ShowDownloadOptionL(); |
1443 aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadAll, hideDownload ); |
1443 aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadAll, hideDownload ); |
1444 TBool hideCancel = !ShowCancelDownloadOption(); |
1444 TBool hideCancel = !ShowCancelDownloadOption(); |
1445 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelAllDownloads, hideCancel ); |
1445 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelAllDownloads, hideCancel ); |
1446 TBool hideSave = !ShowSaveAttachmentOptionL(); |
1446 TBool hideSave = !ShowSaveAttachmentOptionL(); |
1447 aMenuPane->SetItemDimmed( EFsEmailUiCmdSaveAll, hideSave ); |
1447 aMenuPane->SetItemDimmed( EFsEmailUiCmdSaveAll, hideSave ); |
1448 } |
1448 } |
1449 else if ( hotspotType == EBodyHotspot && |
1449 else if ( hotspotType == EBodyHotspot && |
1450 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
1450 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
1451 { |
1451 { |
1452 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1452 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1453 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); |
1453 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); |
1454 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1454 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1455 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1455 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1456 } |
1456 } |
1457 else if ( hotspotType == EBodyHotspot && |
1457 else if ( hotspotType == EBodyHotspot && |
1458 ( currentBodyHotSpotData.iItemType == |
1458 ( currentBodyHotSpotData.iItemType == |
1459 CFindItemEngine::EFindItemSearchURLBin || |
1459 CFindItemEngine::EFindItemSearchURLBin || |
1460 currentBodyHotSpotData.iItemType == |
1460 currentBodyHotSpotData.iItemType == |
1461 CFindItemEngine::EFindItemSearchScheme ) ) |
1461 CFindItemEngine::EFindItemSearchScheme ) ) |
1462 { |
1462 { |
1463 // Handle action menu for different search scheme, e.g mailto: and call: |
1463 // Handle action menu for different search scheme, e.g mailto: and call: |
1464 TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); |
1464 TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); |
1465 switch ( schemaLinkType ) |
1465 switch ( schemaLinkType ) |
1466 { |
1466 { |
1467 case EFocusOnEMailInBodyText: |
1467 case EFocusOnEMailInBodyText: |
1468 { |
1468 { |
1469 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1469 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1470 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1470 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1471 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); |
1471 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); |
1472 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); |
1472 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); |
1473 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1473 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1474 } |
1474 } |
1475 break; |
1475 break; |
1476 case EFocusOnNumberWithinMessage: |
1476 case EFocusOnNumberWithinMessage: |
1477 { |
1477 { |
1478 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1478 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); |
1479 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); |
1479 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); |
1480 // Drop out "Create message" selection for SIP addresses |
1480 // Drop out "Create message" selection for SIP addresses |
1481 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
1481 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
1482 if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) |
1482 if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) |
1483 { |
1483 { |
1484 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1484 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); |
1485 } |
1485 } |
1486 CleanupStack::PopAndDestroy( schemeText ); |
1486 CleanupStack::PopAndDestroy( schemeText ); |
1487 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1487 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); |
1488 } |
1488 } |
1489 break; |
1489 break; |
1490 default: |
1490 default: |
1491 { |
1491 { |
1492 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsOpenWeb, EFalse ); |
1492 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsOpenWeb, EFalse ); |
1493 |
1493 |
1494 // Handle intranet browsing item by using AIW service |
1494 // Handle intranet browsing item by using AIW service |
1495 // handler's InitializeMenuPaneL-function, it will remove |
1495 // handler's InitializeMenuPaneL-function, it will remove |
1496 // the IB menu item if IB is not available, or make the |
1496 // the IB menu item if IB is not available, or make the |
1497 // item visible if IB is available |
1497 // item visible if IB is available |
1498 if ( iIBServiceHandler && iIBServiceHandler->IsAiwMenu( aResourceId ) ) |
1498 if ( iIBServiceHandler && iIBServiceHandler->IsAiwMenu( aResourceId ) ) |
1499 { |
1499 { |
1500 TAiwGenericParam param( EGenericParamURL ); |
1500 TAiwGenericParam param( EGenericParamURL ); |
1501 CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); |
1501 CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); |
1502 list->AppendL( param ); |
1502 list->AppendL( param ); |
1503 iIBServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId, |
1503 iIBServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId, |
1504 EFsEmailUiCmdActionsOpenInIntranetMenu, *list, ETrue ); |
1504 EFsEmailUiCmdActionsOpenInIntranetMenu, *list, ETrue ); |
1505 CleanupStack::PopAndDestroy( list ); |
1505 CleanupStack::PopAndDestroy( list ); |
1506 } |
1506 } |
1507 |
1507 |
1508 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddBookmark, EFalse ); |
1508 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddBookmark, EFalse ); |
1509 } |
1509 } |
1510 break; |
1510 break; |
1511 } |
1511 } |
1512 } |
1512 } |
1513 } |
1513 } |
1514 |
1514 |
1515 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1515 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1516 CFSEmailUiShortcutBinding::EContextMailViewer ); |
1516 CFSEmailUiShortcutBinding::EContextMailViewer ); |
1517 } |
1517 } |
1518 |
1518 |
1519 |
1519 |
1520 // ----------------------------------------------------------------------------- |
1520 // ----------------------------------------------------------------------------- |
1521 // CFSEmailUiMailViewerVisualiser::HandleCommandL |
1521 // CFSEmailUiMailViewerVisualiser::HandleCommandL |
1522 // Handles menu selections |
1522 // Handles menu selections |
1523 // ----------------------------------------------------------------------------- |
1523 // ----------------------------------------------------------------------------- |
1524 void CFSEmailUiMailViewerVisualiser::HandleCommandL( TInt aCommand ) |
1524 void CFSEmailUiMailViewerVisualiser::HandleCommandL( TInt aCommand ) |
1525 { |
1525 { |
1526 FUNC_LOG; |
1526 FUNC_LOG; |
1527 if ( !iAppUi.ViewSwitchingOngoing() ) |
1527 if ( !iAppUi.ViewSwitchingOngoing() ) |
1528 { |
1528 { |
1529 switch ( aCommand ) |
1529 switch ( aCommand ) |
1530 { |
1530 { |
1531 case EAknSoftkeyBack: |
1531 case EAknSoftkeyBack: |
1532 { |
1532 { |
1533 // Set empty MSK when navigating back |
1533 // Set empty MSK when navigating back |
1534 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1534 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1535 // Cancel MR viewer launching if Back is pressed in the middle |
1535 // Cancel MR viewer launching if Back is pressed in the middle |
1536 // of launching process. |
1536 // of launching process. |
1537 CancelPendingMrCommandL(); |
1537 CancelPendingMrCommandL(); |
1538 NavigateBackL(); |
1538 NavigateBackL(); |
1539 } |
1539 } |
1540 break; |
1540 break; |
1541 // top level options |
1541 // top level options |
1542 case EFsEmailUiCmdActionsMoveToDrafts: |
1542 case EFsEmailUiCmdActionsMoveToDrafts: |
1543 { |
1543 { |
1544 TFsEmailUiUtility::MoveMessageToDraftsL( |
1544 TFsEmailUiUtility::MoveMessageToDraftsL( |
1545 *iAppUi.GetActiveMailbox(), *iMessage ); |
1545 *iAppUi.GetActiveMailbox(), *iMessage ); |
1546 } |
1546 } |
1547 break; |
1547 break; |
1548 case EFsEmailUiCmdCalActionsReplyAsMail: |
1548 case EFsEmailUiCmdCalActionsReplyAsMail: |
1549 case EFsEmailUiCmdActionsReply: |
1549 case EFsEmailUiCmdActionsReply: |
1550 { |
1550 { |
1551 if ( !iEmbeddedMessageMode ) |
1551 if ( !iEmbeddedMessageMode ) |
1552 { |
1552 { |
1553 TEditorLaunchParams params; |
1553 TEditorLaunchParams params; |
1554 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1554 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1555 params.iMsgId = iMessage->GetMessageId(); |
1555 params.iMsgId = iMessage->GetMessageId(); |
1556 params.iActivatedExternally = EFalse; |
1556 params.iActivatedExternally = EFalse; |
1557 iAppUi.LaunchEditorL( KEditorCmdReply, params ); |
1557 iAppUi.LaunchEditorL( KEditorCmdReply, params ); |
1558 } |
1558 } |
1559 } |
1559 } |
1560 break; |
1560 break; |
1561 case EFsEmailUiCmdActionsReplyAll: |
1561 case EFsEmailUiCmdActionsReplyAll: |
1562 { |
1562 { |
1563 if ( !iEmbeddedMessageMode ) |
1563 if ( !iEmbeddedMessageMode ) |
1564 { |
1564 { |
1565 TEditorLaunchParams params; |
1565 TEditorLaunchParams params; |
1566 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1566 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1567 params.iMsgId = iMessage->GetMessageId(); |
1567 params.iMsgId = iMessage->GetMessageId(); |
1568 params.iActivatedExternally = EFalse; |
1568 params.iActivatedExternally = EFalse; |
1569 iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); |
1569 iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); |
1570 } |
1570 } |
1571 } |
1571 } |
1572 break; |
1572 break; |
1573 case EFsEmailUiCmdCalActionsForwardAsMail: |
1573 case EFsEmailUiCmdCalActionsForwardAsMail: |
1574 case EFsEmailUiCmdActionsForward: |
1574 case EFsEmailUiCmdActionsForward: |
1575 case EFsEmailUiCmdActionsForward2: |
1575 case EFsEmailUiCmdActionsForward2: |
1576 { |
1576 { |
1577 if ( !iEmbeddedMessageMode ) |
1577 if ( !iEmbeddedMessageMode ) |
1578 { |
1578 { |
1579 TEditorLaunchParams params; |
1579 TEditorLaunchParams params; |
1580 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1580 params.iMailboxId = iAppUi.GetActiveMailboxId(); |
1581 params.iMsgId = iMessage->GetMessageId(); |
1581 params.iMsgId = iMessage->GetMessageId(); |
1582 params.iActivatedExternally = EFalse; |
1582 params.iActivatedExternally = EFalse; |
1583 iAppUi.LaunchEditorL( KEditorCmdForward, params ); |
1583 iAppUi.LaunchEditorL( KEditorCmdForward, params ); |
1584 } |
1584 } |
1585 } |
1585 } |
1586 break; |
1586 break; |
1587 case EFsEmailUiCmdActionsDelete: |
1587 case EFsEmailUiCmdActionsDelete: |
1588 { |
1588 { |
1589 DeleteMailL( *iMessage, ETrue ); |
1589 DeleteMailL( *iMessage, ETrue ); |
1590 } |
1590 } |
1591 break; |
1591 break; |
1592 case EFsEmailUiCmdActionsCopyToClipboard: |
1592 case EFsEmailUiCmdActionsCopyToClipboard: |
1593 { |
1593 { |
1594 CopyCurrentHotspotToClipBoardL(); |
1594 CopyCurrentHotspotToClipBoardL(); |
1595 } |
1595 } |
1596 break; |
1596 break; |
1597 case EFsEmailUiCmdPreviousMessage: |
1597 case EFsEmailUiCmdPreviousMessage: |
1598 { |
1598 { |
1599 ShowPreviousMessageL(); |
1599 ShowPreviousMessageL(); |
1600 } |
1600 } |
1601 break; |
1601 break; |
1602 case EFsEmailUiCmdNextMessage: |
1602 case EFsEmailUiCmdNextMessage: |
1603 { |
1603 { |
1604 ShowNextMessageL(); |
1604 ShowNextMessageL(); |
1605 } |
1605 } |
1606 break; |
1606 break; |
1607 case EFsEmailUiCmdHelp: |
1607 case EFsEmailUiCmdHelp: |
1608 { |
1608 { |
1609 TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); |
1609 TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); |
1610 } |
1610 } |
1611 break; |
1611 break; |
1612 case EFsEmailUiCmdExit: |
1612 case EFsEmailUiCmdExit: |
1613 { |
1613 { |
1614 iAppUi.Exit(); |
1614 iAppUi.Exit(); |
1615 } |
1615 } |
1616 break; |
1616 break; |
1617 case EFsEmailUiCmdReadEmail: |
1617 case EFsEmailUiCmdReadEmail: |
1618 { |
1618 { |
1619 iAppUi.StartReadingEmailsL(); |
1619 iAppUi.StartReadingEmailsL(); |
1620 } |
1620 } |
1621 break; |
1621 break; |
1622 |
1622 |
1623 // "actions" -sub menu options |
1623 // "actions" -sub menu options |
1624 case EFsEmailUiCmdActionsCall: |
1624 case EFsEmailUiCmdActionsCall: |
1625 { |
1625 { |
1626 CallHotSpotAddressL(); |
1626 CallHotSpotAddressL(); |
1627 } |
1627 } |
1628 break; |
1628 break; |
1629 case EFsEmailUiCmdActionsCreateMessage: |
1629 case EFsEmailUiCmdActionsCreateMessage: |
1630 { |
1630 { |
1631 CreateMessageL(); |
1631 CreateMessageL(); |
1632 } |
1632 } |
1633 break; |
1633 break; |
1634 case EFsEmailUiCmdActionsCreateMail: |
1634 case EFsEmailUiCmdActionsCreateMail: |
1635 { |
1635 { |
1636 ComposeMailL(); |
1636 ComposeMailL(); |
1637 } |
1637 } |
1638 break; |
1638 break; |
1639 case EFsEmailUiCmdActionsContactDetails: |
1639 case EFsEmailUiCmdActionsContactDetails: |
1640 { |
1640 { |
1641 OpenContactDetailsL(); |
1641 OpenContactDetailsL(); |
1642 } |
1642 } |
1643 break; |
1643 break; |
1644 case EFsEmailUiCmdActionsAddContact: |
1644 case EFsEmailUiCmdActionsAddContact: |
1645 case EFsEmailUiCmdActionsAddContact2: |
1645 case EFsEmailUiCmdActionsAddContact2: |
1646 { |
1646 { |
1647 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1647 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1648 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1648 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1649 THotspotType hotspotType = |
1649 THotspotType hotspotType = |
1650 iViewerRichText->FindCurrentHotSpotL( |
1650 iViewerRichText->FindCurrentHotSpotL( |
1651 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1651 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1652 if ( hotspotType == EHeaderHotspot ) |
1652 if ( hotspotType == EHeaderHotspot ) |
1653 { |
1653 { |
1654 HBufC* emailAddress = |
1654 HBufC* emailAddress = |
1655 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
1655 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
1656 currentHeaderHotSpotData ); |
1656 currentHeaderHotSpotData ); |
1657 SaveEmailAsContactL( *emailAddress ); |
1657 SaveEmailAsContactL( *emailAddress ); |
1658 CleanupStack::PopAndDestroy( emailAddress ); |
1658 CleanupStack::PopAndDestroy( emailAddress ); |
1659 } |
1659 } |
1660 else if ( hotspotType == EBodyHotspot ) |
1660 else if ( hotspotType == EBodyHotspot ) |
1661 { |
1661 { |
1662 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
1662 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
1663 currentBodyHotSpotData ); |
1663 currentBodyHotSpotData ); |
1664 if ( currentBodyHotSpotData.iItemType == |
1664 if ( currentBodyHotSpotData.iItemType == |
1665 CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
1665 CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
1666 { |
1666 { |
1667 SavePhoneNumberAsContactL( *hotspotText ); |
1667 SavePhoneNumberAsContactL( *hotspotText ); |
1668 } |
1668 } |
1669 else if ( currentBodyHotSpotData.iItemType == |
1669 else if ( currentBodyHotSpotData.iItemType == |
1670 CFindItemEngine::EFindItemSearchMailAddressBin ) |
1670 CFindItemEngine::EFindItemSearchMailAddressBin ) |
1671 { |
1671 { |
1672 SaveEmailAsContactL( *hotspotText ); |
1672 SaveEmailAsContactL( *hotspotText ); |
1673 } |
1673 } |
1674 else if ( currentBodyHotSpotData.iItemType == |
1674 else if ( currentBodyHotSpotData.iItemType == |
1675 CFindItemEngine::EFindItemSearchScheme) |
1675 CFindItemEngine::EFindItemSearchScheme) |
1676 { |
1676 { |
1677 if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) |
1677 if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) |
1678 { |
1678 { |
1679 // Save email address, prefix is stripped in SaveEmailAsContactL |
1679 // Save email address, prefix is stripped in SaveEmailAsContactL |
1680 SaveEmailAsContactL( *hotspotText ); |
1680 SaveEmailAsContactL( *hotspotText ); |
1681 } |
1681 } |
1682 else if ( hotspotText->FindC( KCallPrefix ) == 0 || |
1682 else if ( hotspotText->FindC( KCallPrefix ) == 0 || |
1683 hotspotText->FindC( KTelPrefix ) == 0 || |
1683 hotspotText->FindC( KTelPrefix ) == 0 || |
1684 hotspotText->FindC( KSmsPrefix ) == 0 || |
1684 hotspotText->FindC( KSmsPrefix ) == 0 || |
1685 hotspotText->FindC( KMmsPrefix ) == 0 ) |
1685 hotspotText->FindC( KMmsPrefix ) == 0 ) |
1686 { |
1686 { |
1687 // Save phone nukmber, prefix is stripped in SavePhoneNumberAsContactL |
1687 // Save phone nukmber, prefix is stripped in SavePhoneNumberAsContactL |
1688 SavePhoneNumberAsContactL( *hotspotText ); |
1688 SavePhoneNumberAsContactL( *hotspotText ); |
1689 } |
1689 } |
1690 } |
1690 } |
1691 CleanupStack::PopAndDestroy( hotspotText ); |
1691 CleanupStack::PopAndDestroy( hotspotText ); |
1692 } |
1692 } |
1693 } |
1693 } |
1694 break; |
1694 break; |
1695 case EFsEmailUiCmdActionsRemoteLookup: |
1695 case EFsEmailUiCmdActionsRemoteLookup: |
1696 { |
1696 { |
1697 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1697 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1698 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1698 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1699 THotspotType hotspotType = |
1699 THotspotType hotspotType = |
1700 iViewerRichText->FindCurrentHotSpotL( |
1700 iViewerRichText->FindCurrentHotSpotL( |
1701 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1701 currentHeaderHotSpotData, currentBodyHotSpotData ); |
1702 if ( hotspotType == EHeaderHotspot ) |
1702 if ( hotspotType == EHeaderHotspot ) |
1703 { |
1703 { |
1704 HBufC* emailAddress = |
1704 HBufC* emailAddress = |
1705 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
1705 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
1706 currentHeaderHotSpotData ); |
1706 currentHeaderHotSpotData ); |
1707 LaunchRemoteLookupL( *emailAddress ); |
1707 LaunchRemoteLookupL( *emailAddress ); |
1708 CleanupStack::PopAndDestroy( emailAddress ); |
1708 CleanupStack::PopAndDestroy( emailAddress ); |
1709 } |
1709 } |
1710 else if ( hotspotType == EBodyHotspot ) |
1710 else if ( hotspotType == EBodyHotspot ) |
1711 { |
1711 { |
1712 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
1712 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
1713 currentBodyHotSpotData ); |
1713 currentBodyHotSpotData ); |
1714 LaunchRemoteLookupL( *hotspotText ); |
1714 LaunchRemoteLookupL( *hotspotText ); |
1715 CleanupStack::PopAndDestroy( hotspotText ); |
1715 CleanupStack::PopAndDestroy( hotspotText ); |
1716 } |
1716 } |
1717 } |
1717 } |
1718 break; |
1718 break; |
1719 case EFsEmailUiCmdActionsOpenHtmlViewer: |
1719 case EFsEmailUiCmdActionsOpenHtmlViewer: |
1720 { |
1720 { |
1721 LaunchHtmlViewerL(); |
1721 LaunchHtmlViewerL(); |
1722 } |
1722 } |
1723 break; |
1723 break; |
1724 case EFsEmailUiCmdActionsOpenWeb: |
1724 case EFsEmailUiCmdActionsOpenWeb: |
1725 { |
1725 { |
1726 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1726 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1727 TBool bodyHotSpotFound = |
1727 TBool bodyHotSpotFound = |
1728 iViewerRichText->FindCurrentBodyHotSpotL( |
1728 iViewerRichText->FindCurrentBodyHotSpotL( |
1729 currentBodyHotSpotData ); |
1729 currentBodyHotSpotData ); |
1730 OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); |
1730 OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); |
1731 } |
1731 } |
1732 break; |
1732 break; |
1733 case EFsEmailUiCmdActionsOpenInIntranetMenu: |
1733 case EFsEmailUiCmdActionsOpenInIntranetMenu: |
1734 { |
1734 { |
1735 OpenLinkInIntranetL( ETrue ); |
1735 OpenLinkInIntranetL( ETrue ); |
1736 } |
1736 } |
1737 break; |
1737 break; |
1738 case EFsEmailUiCmdActionsAddBookmark: |
1738 case EFsEmailUiCmdActionsAddBookmark: |
1739 { |
1739 { |
1740 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1740 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
1741 TBool bodyHotSpotFound = |
1741 TBool bodyHotSpotFound = |
1742 iViewerRichText->FindCurrentBodyHotSpotL( |
1742 iViewerRichText->FindCurrentBodyHotSpotL( |
1743 currentBodyHotSpotData ); |
1743 currentBodyHotSpotData ); |
1744 AddToBookmarksL( currentBodyHotSpotData ); |
1744 AddToBookmarksL( currentBodyHotSpotData ); |
1745 } |
1745 } |
1746 break; |
1746 break; |
1747 case EAknSoftkeyOpen: |
1747 case EAknSoftkeyOpen: |
1748 case EFsEmailUiCmdOpenAttachment: |
1748 case EFsEmailUiCmdOpenAttachment: |
1749 { |
1749 { |
1750 OpenAttachmentL(); |
1750 OpenAttachmentL(); |
1751 } |
1751 } |
1752 break; |
1752 break; |
1753 case EFsEmailUiCmdOpenAttachmentList: |
1753 case EFsEmailUiCmdOpenAttachmentList: |
1754 { |
1754 { |
1755 OpenAttachmentsViewL(); |
1755 OpenAttachmentsViewL(); |
1756 } |
1756 } |
1757 break; |
1757 break; |
1758 case EFsEmailUiCmdDownload: |
1758 case EFsEmailUiCmdDownload: |
1759 case EFsEmailUiCmdDownloadAll: |
1759 case EFsEmailUiCmdDownloadAll: |
1760 { |
1760 { |
1761 StartDowloadingAttachmentsL(); |
1761 StartDowloadingAttachmentsL(); |
1762 } |
1762 } |
1763 break; |
1763 break; |
1764 case EFsEmailUiCmdCancelDownload: |
1764 case EFsEmailUiCmdCancelDownload: |
1765 case EFsEmailUiCmdCancelAllDownloads: |
1765 case EFsEmailUiCmdCancelAllDownloads: |
1766 { |
1766 { |
1767 CancelDowloadingAttachmentsL(); |
1767 CancelDowloadingAttachmentsL(); |
1768 } |
1768 } |
1769 break; |
1769 break; |
1770 case EFsEmailUiCmdSave: |
1770 case EFsEmailUiCmdSave: |
1771 case EFsEmailUiCmdSaveAll: |
1771 case EFsEmailUiCmdSaveAll: |
1772 { |
1772 { |
1773 SaveAllAttachmentsL(); |
1773 SaveAllAttachmentsL(); |
1774 } |
1774 } |
1775 break; |
1775 break; |
1776 case EFsEmailUiCmdClearFetchedAttachment: |
1776 case EFsEmailUiCmdClearFetchedAttachment: |
1777 { |
1777 { |
1778 RemoveFetchedAttachmentL(); |
1778 RemoveFetchedAttachmentL(); |
1779 } |
1779 } |
1780 break; |
1780 break; |
1781 |
1781 |
1782 // "more" -sub menu options |
1782 // "more" -sub menu options |
1783 case EFsEmailUiCmdMarkAsUnread: |
1783 case EFsEmailUiCmdMarkAsUnread: |
1784 { |
1784 { |
1785 ChangeMsgReadStatusL( EFalse, EFalse ); |
1785 ChangeMsgReadStatusL( EFalse, EFalse ); |
1786 } |
1786 } |
1787 break; |
1787 break; |
1788 case EFsEmailUiCmdMarkAsRead: |
1788 case EFsEmailUiCmdMarkAsRead: |
1789 { |
1789 { |
1790 ChangeMsgReadStatusL( ETrue, EFalse ); |
1790 ChangeMsgReadStatusL( ETrue, EFalse ); |
1791 } |
1791 } |
1792 break; |
1792 break; |
1793 case EFsEmailUiCmdActionsMoveMessage: |
1793 case EFsEmailUiCmdActionsMoveMessage: |
1794 { |
1794 { |
1795 OpenFolderListForMessageMovingL(); |
1795 OpenFolderListForMessageMovingL(); |
1796 } |
1796 } |
1797 break; |
1797 break; |
1798 case EFsEmailUiCmdActionsFlag: |
1798 case EFsEmailUiCmdActionsFlag: |
1799 { |
1799 { |
1800 SetMessageFollowupFlagL(); |
1800 SetMessageFollowupFlagL(); |
1801 } |
1801 } |
1802 break; |
1802 break; |
1803 case EFsEmailUiCmdCompose: |
1803 case EFsEmailUiCmdCompose: |
1804 { |
1804 { |
1805 iAppUi.CreateNewMailL(); |
1805 iAppUi.CreateNewMailL(); |
1806 } |
1806 } |
1807 break; |
1807 break; |
1808 case EFsEmailUiCmdComposeTo: |
1808 case EFsEmailUiCmdComposeTo: |
1809 { |
1809 { |
1810 ComposeMailL(); |
1810 ComposeMailL(); |
1811 } |
1811 } |
1812 break; |
1812 break; |
1813 case EFsEmailUiCmdMessageDetails: |
1813 case EFsEmailUiCmdMessageDetails: |
1814 case EFsEmailUiCmdViewAll: |
1814 case EFsEmailUiCmdViewAll: |
1815 { |
1815 { |
1816 TUid activationCmdId = KStartMsgDetailsToBeginning; |
1816 TUid activationCmdId = KStartMsgDetailsToBeginning; |
1817 if ( aCommand == EFsEmailUiCmdViewAll ) |
1817 if ( aCommand == EFsEmailUiCmdViewAll ) |
1818 { |
1818 { |
1819 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1819 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
1820 iViewerRichText->FindCurrentHeaderHotSpotL( currentHeaderHotSpotData ); |
1820 iViewerRichText->FindCurrentHeaderHotSpotL( currentHeaderHotSpotData ); |
1821 if( currentHeaderHotSpotData.iType == ETypeToNMoreRecipients ) |
1821 if( currentHeaderHotSpotData.iType == ETypeToNMoreRecipients ) |
1822 { |
1822 { |
1823 activationCmdId = KStartMsgDetailsToTo; |
1823 activationCmdId = KStartMsgDetailsToTo; |
2696 |
2696 |
2697 // ----------------------------------------------------------------------------- |
2697 // ----------------------------------------------------------------------------- |
2698 // CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight |
2698 // CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight |
2699 // ----------------------------------------------------------------------------- |
2699 // ----------------------------------------------------------------------------- |
2700 void CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight() |
2700 void CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight() |
2701 { |
2701 { |
2702 FUNC_LOG; |
2702 FUNC_LOG; |
2703 CFreestyleEmailUiTextureManager* textureMgr = iAppUi.FsTextureManager(); |
2703 CFreestyleEmailUiTextureManager* textureMgr = iAppUi.FsTextureManager(); |
2704 CFSEmailUiLayoutHandler* layoutMgr = iAppUi.LayoutHandler(); |
2704 CFSEmailUiLayoutHandler* layoutMgr = iAppUi.LayoutHandler(); |
2705 |
2705 |
2706 // get textures from texture manager |
2706 // get textures from texture manager |
2707 CAlfTexture& menuTexture = textureMgr->TextureByIndex( EListControlMenuIcon ); |
2707 CAlfTexture& menuTexture = textureMgr->TextureByIndex( EListControlMenuIcon ); |
2708 CAlfTexture& selectortexture = textureMgr->TextureByIndex( EViewerHighlightTexture ); |
2708 CAlfTexture& selectortexture = textureMgr->TextureByIndex( EViewerHighlightTexture ); |
2709 |
2709 |
2710 iTextViewer->SetLiteLineBg( selectortexture, layoutMgr->ViewerSelectorOpacity() ); |
2710 iTextViewer->SetLiteLineBg( selectortexture, layoutMgr->ViewerSelectorOpacity() ); |
2711 |
2711 |
2712 iTextViewer->SetActionButton( menuTexture, 1 ); |
2712 iTextViewer->SetActionButton( menuTexture, 1 ); |
2713 iTextViewer->SetActionButtonMargin( layoutMgr->ViewerActionMenuIconMargin() ); |
2713 iTextViewer->SetActionButtonMargin( layoutMgr->ViewerActionMenuIconMargin() ); |
2714 TSize btnSize = layoutMgr->ViewerActionMenuIconSize(); |
2714 TSize btnSize = layoutMgr->ViewerActionMenuIconSize(); |
2715 iTextViewer->SetActionButtonSize( btnSize.iWidth, btnSize.iHeight ); |
2715 iTextViewer->SetActionButtonSize( btnSize.iWidth, btnSize.iHeight ); |
2716 } |
2716 } |
2717 |
2717 |
2718 // ----------------------------------------------------------------------------- |
2718 // ----------------------------------------------------------------------------- |
2719 // CFSEmailUiMailViewerVisualiser::LaunchActionMenuL |
2719 // CFSEmailUiMailViewerVisualiser::LaunchActionMenuL |
2720 // ----------------------------------------------------------------------------- |
2720 // ----------------------------------------------------------------------------- |
2721 void CFSEmailUiMailViewerVisualiser::LaunchActionMenuL() |
2721 void CFSEmailUiMailViewerVisualiser::LaunchActionMenuL() |
2722 { |
2722 { |
2723 FUNC_LOG; |
2723 FUNC_LOG; |
2724 // check that current hotspot is visible |
2724 // check that current hotspot is visible |
2725 TInt ignoreThis; // not used here. Only return value is used not this mandatory reference parameter |
2725 TInt ignoreThis; // not used here. Only return value is used not this mandatory reference parameter |
2726 TBool visibleHotsSpot = iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); |
2726 TBool visibleHotsSpot = iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); |
2727 if( visibleHotsSpot ) |
2727 if( visibleHotsSpot ) |
2728 { |
2728 { |
2729 // Remove items |
2729 // Remove items |
2730 CFSEmailUiActionMenu::RemoveAllL(); |
2730 CFSEmailUiActionMenu::RemoveAllL(); |
2731 |
2731 |
2732 // check which hotspot is active. |
2732 // check which hotspot is active. |
2733 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2733 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2734 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2734 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2735 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
2735 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
2736 |
2736 |
2737 TActionMenuType currentActionMenuType = ENoActionMenuFocused; |
2737 TActionMenuType currentActionMenuType = ENoActionMenuFocused; |
2738 if( hotspotType == EHeaderHotspot && ( |
2738 if( hotspotType == EHeaderHotspot && ( |
2739 currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || |
2739 currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || |
2740 currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
2740 currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
2741 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
2741 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
2742 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
2742 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
2743 currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) |
2743 currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) |
2744 { |
2744 { |
2745 currentActionMenuType = EFocusOnNameInAddressField; |
2745 currentActionMenuType = EFocusOnNameInAddressField; |
2746 } |
2746 } |
2747 else if( hotspotType == EHeaderHotspot && ( |
2747 else if( hotspotType == EHeaderHotspot && ( |
2748 currentHeaderHotSpotData.iType == ETypeAttachment ) ) |
2748 currentHeaderHotSpotData.iType == ETypeAttachment ) ) |
2749 { |
2749 { |
2750 currentActionMenuType = EFocusOnAttachmentName; |
2750 currentActionMenuType = EFocusOnAttachmentName; |
2751 } |
2751 } |
2752 else if( hotspotType == EHeaderHotspot && ( |
2752 else if( hotspotType == EHeaderHotspot && ( |
2753 currentHeaderHotSpotData.iType == ETypeAttachments ) ) |
2753 currentHeaderHotSpotData.iType == ETypeAttachments ) ) |
2754 { |
2754 { |
2755 currentActionMenuType = EFocusOnAttachmentsText; |
2755 currentActionMenuType = EFocusOnAttachmentsText; |
2756 } |
2756 } |
2757 else if( hotspotType == EBodyHotspot && |
2757 else if( hotspotType == EBodyHotspot && |
2758 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
2758 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
2759 { |
2759 { |
2760 currentActionMenuType = EFocusOnNumberWithinMessage; |
2760 currentActionMenuType = EFocusOnNumberWithinMessage; |
2761 } |
2761 } |
2762 else if( hotspotType == EBodyHotspot && ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchURLBin || |
2762 else if( hotspotType == EBodyHotspot && ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchURLBin || |
2763 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) ) |
2763 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) ) |
2764 { |
2764 { |
2765 TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); |
2765 TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); |
2766 switch ( schemaLinkType ) |
2766 switch ( schemaLinkType ) |
2767 { |
2767 { |
2768 case EFocusOnEMailInBodyText: |
2768 case EFocusOnEMailInBodyText: |
2769 currentActionMenuType = EFocusOnEMailInBodyText; |
2769 currentActionMenuType = EFocusOnEMailInBodyText; |
2770 break; |
2770 break; |
2771 case EFocusOnNumberWithinMessage: |
2771 case EFocusOnNumberWithinMessage: |
2772 currentActionMenuType = EFocusOnNumberWithinMessage; |
2772 currentActionMenuType = EFocusOnNumberWithinMessage; |
2773 break; |
2773 break; |
2774 default: |
2774 default: |
2775 currentActionMenuType = EFocusOnHyperLinkWithinMessage; |
2775 currentActionMenuType = EFocusOnHyperLinkWithinMessage; |
2776 break; |
2776 break; |
2777 |
2777 |
2778 } |
2778 } |
2779 } |
2779 } |
2780 else if( hotspotType == EBodyHotspot && |
2780 else if( hotspotType == EBodyHotspot && |
2781 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
2781 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
2782 { |
2782 { |
2783 currentActionMenuType = EFocusOnEMailInBodyText; |
2783 currentActionMenuType = EFocusOnEMailInBodyText; |
2784 } |
2784 } |
2785 |
2785 |
2786 |
2786 |
2787 if( currentActionMenuType != ENoActionMenuFocused ) |
2787 if( currentActionMenuType != ENoActionMenuFocused ) |
2788 { |
2788 { |
2789 CreateActionMenuItemsL( currentActionMenuType ); |
2789 CreateActionMenuItemsL( currentActionMenuType ); |
2790 TActionMenuCustomItemId menuResult = CFSEmailUiActionMenu::ExecuteL( EFscCenter ); |
2790 TActionMenuCustomItemId menuResult = CFSEmailUiActionMenu::ExecuteL( EFscCenter ); |
2791 if ( menuResult != FsEActionMenuCasItemSelectedAndExecuted && |
2791 if ( menuResult != FsEActionMenuCasItemSelectedAndExecuted && |
2792 menuResult != FsEActionMenuDismissed ) |
2792 menuResult != FsEActionMenuDismissed ) |
2793 { |
2793 { |
2794 HandleActionMenuCommandL( menuResult, currentActionMenuType ); |
2794 HandleActionMenuCommandL( menuResult, currentActionMenuType ); |
2795 } |
2795 } |
2796 } |
2796 } |
2797 } |
2797 } |
2798 } |
2798 } |
2799 |
2799 |
2800 // ----------------------------------------------------------------------------- |
2800 // ----------------------------------------------------------------------------- |
2801 // CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL |
2801 // CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL |
2802 // ----------------------------------------------------------------------------- |
2802 // ----------------------------------------------------------------------------- |
2803 TInt CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL( CFindItemEngine::SFoundItem aHotSpot ) |
2803 TInt CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL( CFindItemEngine::SFoundItem aHotSpot ) |
2804 { |
2804 { |
2805 FUNC_LOG; |
2805 FUNC_LOG; |
2806 TInt ret( EFocusOnHyperLinkWithinMessage ); |
2806 TInt ret( EFocusOnHyperLinkWithinMessage ); |
2807 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
2807 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
2808 if ( schemeText->FindC( KMailtoPrefix ) == 0 ) |
2808 if ( schemeText->FindC( KMailtoPrefix ) == 0 ) |
2809 { |
2809 { |
2810 ret = EFocusOnEMailInBodyText; |
2810 ret = EFocusOnEMailInBodyText; |
2811 } |
2811 } |
2812 else if ( schemeText->FindC( KCallPrefix ) == 0 || |
2812 else if ( schemeText->FindC( KCallPrefix ) == 0 || |
2813 schemeText->FindC( KTelPrefix ) == 0 || |
2813 schemeText->FindC( KTelPrefix ) == 0 || |
2814 schemeText->FindC( KSmsPrefix ) == 0 || |
2814 schemeText->FindC( KSmsPrefix ) == 0 || |
2815 schemeText->FindC( KMmsPrefix ) == 0 || |
2815 schemeText->FindC( KMmsPrefix ) == 0 || |
2816 schemeText->FindC( KVoipPrefix ) == 0 ) |
2816 schemeText->FindC( KVoipPrefix ) == 0 ) |
2817 { |
2817 { |
2818 ret = EFocusOnNumberWithinMessage; |
2818 ret = EFocusOnNumberWithinMessage; |
2819 } |
2819 } |
2820 else |
2820 else |
2821 { |
2821 { |
2822 ret = EFocusOnHyperLinkWithinMessage; |
2822 ret = EFocusOnHyperLinkWithinMessage; |
2823 } |
2823 } |
2824 CleanupStack::PopAndDestroy( schemeText ); |
2824 CleanupStack::PopAndDestroy( schemeText ); |
2825 return ret; |
2825 return ret; |
2826 } |
2826 } |
2827 |
2827 |
2828 // ----------------------------------------------------------------------------- |
2828 // ----------------------------------------------------------------------------- |
2829 // CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL |
2829 // CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL |
2830 // ----------------------------------------------------------------------------- |
2830 // ----------------------------------------------------------------------------- |
2831 void CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL() |
2831 void CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL() |
2846 |
2846 |
2847 // ----------------------------------------------------------------------------- |
2847 // ----------------------------------------------------------------------------- |
2848 // CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL |
2848 // CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL |
2849 // ----------------------------------------------------------------------------- |
2849 // ----------------------------------------------------------------------------- |
2850 void CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL( |
2850 void CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL( |
2851 TActionMenuType aActionMenuType ) |
2851 TActionMenuType aActionMenuType ) |
2852 { |
2852 { |
2853 FUNC_LOG; |
2853 FUNC_LOG; |
2854 // See the ui spec for all the right action menus according to |
2854 // See the ui spec for all the right action menus according to |
2855 // currently selected hotspot |
2855 // currently selected hotspot |
2856 RArray<TActionMenuCustomItemId> uids; |
2856 RArray<TActionMenuCustomItemId> uids; |
2857 CleanupClosePushL( uids ); |
2857 CleanupClosePushL( uids ); |
2858 if ( aActionMenuType == EFocusOnNumberWithinMessage ) |
2858 if ( aActionMenuType == EFocusOnNumberWithinMessage ) |
2859 { |
2859 { |
2860 uids.Append( FsEActionMenuCall ); |
2860 uids.Append( FsEActionMenuCall ); |
2861 uids.Append( FsEActionMenuAddToContacts ); |
2861 uids.Append( FsEActionMenuAddToContacts ); |
2862 // Drop FsEActionMenuCreateMessage from sip: addresses |
2862 // Drop FsEActionMenuCreateMessage from sip: addresses |
2863 // First check which hotspot is active. |
2863 // First check which hotspot is active. |
2864 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2864 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2865 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2865 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2866 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
2866 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
2867 currentHeaderHotSpotData, currentBodyHotSpotData ); |
2867 currentHeaderHotSpotData, currentBodyHotSpotData ); |
2868 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
2868 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
2869 if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) |
2869 if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) |
2870 { |
2870 { |
2871 uids.Append( FsEActionMenuCreateMessage ); |
2871 uids.Append( FsEActionMenuCreateMessage ); |
2872 } |
2872 } |
2873 CleanupStack::PopAndDestroy( schemeText ); |
2873 CleanupStack::PopAndDestroy( schemeText ); |
2874 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) |
2874 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) |
2875 { |
2875 { |
2876 uids.Append( FsEActionMenuRemoteLookup ); |
2876 uids.Append( FsEActionMenuRemoteLookup ); |
2877 } |
2877 } |
2878 } |
2878 } |
2879 else if ( aActionMenuType == EFocusOnNameInAddressField || |
2879 else if ( aActionMenuType == EFocusOnNameInAddressField || |
2880 aActionMenuType == EFocusOnEMailInBodyText ) |
2880 aActionMenuType == EFocusOnEMailInBodyText ) |
2881 { |
2881 { |
2882 uids.Append( FsEActionMenuCall ); |
2882 uids.Append( FsEActionMenuCall ); |
2883 uids.Append( FsEActionMenuCreateMessage ); |
2883 uids.Append( FsEActionMenuCreateMessage ); |
2884 uids.Append( FsEActionMenuCreateEmail ); |
2884 uids.Append( FsEActionMenuCreateEmail ); |
2885 uids.Append( FsEActionMenuContactDetails ); |
2885 uids.Append( FsEActionMenuContactDetails ); |
2886 uids.Append( FsEActionMenuAddToContacts ); |
2886 uids.Append( FsEActionMenuAddToContacts ); |
2887 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) |
2887 if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) |
2888 { |
2888 { |
2889 uids.Append( FsEActionMenuRemoteLookup ); |
2889 uids.Append( FsEActionMenuRemoteLookup ); |
2890 } |
2890 } |
2891 } |
2891 } |
2892 else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) |
2892 else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) |
2893 { |
2893 { |
2894 uids.Append( FsEActionMenuOpenInWeb ); |
2894 uids.Append( FsEActionMenuOpenInWeb ); |
2895 uids.Append( FsEActionMenuOpenInIntranet ); |
2895 uids.Append( FsEActionMenuOpenInIntranet ); |
2896 uids.Append( FsEActionMenuBookmark ); |
2896 uids.Append( FsEActionMenuBookmark ); |
2897 } |
2897 } |
2898 else if ( aActionMenuType == EFocusOnAttachmentName ) |
2898 else if ( aActionMenuType == EFocusOnAttachmentName ) |
2899 { |
2899 { |
2900 if ( ShowOpenAttachmentOptionL() ) |
|
2901 { |
|
2902 uids.Append( FsEActionAttachmentOpen ); |
|
2903 } |
|
2904 if ( ShowDownloadOptionL() ) |
|
2905 { |
|
2906 uids.Append( FsEActionAttachmentDownload ); |
|
2907 } |
|
2908 if ( ShowCancelDownloadOption() ) |
|
2909 { |
|
2910 uids.Append( FsEActionAttachmentCancelDownload ); |
|
2911 } |
|
2912 if ( ShowSaveAttachmentOptionL() ) |
|
2913 { |
|
2914 uids.Append( FsEActionAttachmentSave ); |
|
2915 } |
|
2916 if ( ShowOpenAttachmentOptionL() ) |
2900 if ( ShowOpenAttachmentOptionL() ) |
2917 { |
2901 { |
|
2902 uids.Append( FsEActionAttachmentOpen ); |
|
2903 } |
|
2904 if ( ShowDownloadOptionL() ) |
|
2905 { |
|
2906 uids.Append( FsEActionAttachmentDownload ); |
|
2907 } |
|
2908 if ( ShowCancelDownloadOption() ) |
|
2909 { |
|
2910 uids.Append( FsEActionAttachmentCancelDownload ); |
|
2911 } |
|
2912 if ( ShowSaveAttachmentOptionL() ) |
|
2913 { |
|
2914 uids.Append( FsEActionAttachmentSave ); |
|
2915 } |
|
2916 if ( ShowOpenAttachmentOptionL() ) |
|
2917 { |
2918 uids.Append( FsEActionAttachmentClearFetchedContent ); |
2918 uids.Append( FsEActionAttachmentClearFetchedContent ); |
2919 } |
2919 } |
2920 } |
2920 } |
2921 else if ( aActionMenuType == EFocusOnAttachmentsText ) |
2921 else if ( aActionMenuType == EFocusOnAttachmentsText ) |
2922 { |
2922 { |
2923 if ( ShowOpenAttachmentOptionL() ) |
2923 if ( ShowOpenAttachmentOptionL() ) |
2924 { |
2924 { |
2925 uids.Append( FsEActionAttachmentViewAll ); |
2925 uids.Append( FsEActionAttachmentViewAll ); |
2926 } |
2926 } |
2927 if ( ShowDownloadOptionL() ) |
2927 if ( ShowDownloadOptionL() ) |
2928 { |
2928 { |
2929 uids.Append( FsEActionAttachmentDownloadAll ); |
2929 uids.Append( FsEActionAttachmentDownloadAll ); |
2930 } |
2930 } |
2931 if ( ShowCancelDownloadOption() ) |
2931 if ( ShowCancelDownloadOption() ) |
2932 { |
2932 { |
2933 uids.Append( FsEActionAttachmentCancelAllDownloads ); |
2933 uids.Append( FsEActionAttachmentCancelAllDownloads ); |
2934 } |
2934 } |
2935 if ( ShowSaveAttachmentOptionL() ) |
2935 if ( ShowSaveAttachmentOptionL() ) |
2936 { |
2936 { |
2937 uids.Append( FsEActionAttachmentSaveAll ); |
2937 uids.Append( FsEActionAttachmentSaveAll ); |
2938 } |
2938 } |
2939 } |
2939 } |
2940 |
2940 |
2941 TInt uidsCount = uids.Count(); |
2941 TInt uidsCount = uids.Count(); |
2942 for ( TInt i = 0; i < uidsCount; i++ ) |
2942 for ( TInt i = 0; i < uidsCount; i++ ) |
2943 { |
2943 { |
2944 CFSEmailUiActionMenu::AddCustomItemL( uids[i] ); |
2944 CFSEmailUiActionMenu::AddCustomItemL( uids[i] ); |
2945 } |
2945 } |
2946 CleanupStack::PopAndDestroy( &uids ); |
2946 CleanupStack::PopAndDestroy( &uids ); |
2947 } |
2947 } |
2948 |
2948 |
2949 |
2949 |
2950 // ----------------------------------------------------------------------------- |
2950 // ----------------------------------------------------------------------------- |
2951 // CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL |
2951 // CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL |
2952 // ----------------------------------------------------------------------------- |
2952 // ----------------------------------------------------------------------------- |
2953 void CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL( |
2953 void CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL( |
2954 TActionMenuCustomItemId aSelectedActionMenuItem, |
2954 TActionMenuCustomItemId aSelectedActionMenuItem, |
2955 TActionMenuType aActionMenuType ) |
2955 TActionMenuType aActionMenuType ) |
2956 { |
2956 { |
2957 FUNC_LOG; |
2957 FUNC_LOG; |
2958 // check which hotspot is active. |
2958 // check which hotspot is active. |
2959 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2959 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
2960 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2960 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
2961 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
2961 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( |
2962 currentHeaderHotSpotData, currentBodyHotSpotData ); |
2962 currentHeaderHotSpotData, currentBodyHotSpotData ); |
2963 |
2963 |
2964 if ( aActionMenuType == EFocusOnNumberWithinMessage ) |
2964 if ( aActionMenuType == EFocusOnNumberWithinMessage ) |
2965 { |
2965 { |
2966 switch ( aSelectedActionMenuItem ) |
2966 switch ( aSelectedActionMenuItem ) |
2967 { |
2967 { |
2968 case FsEActionMenuCall: // Call |
2968 case FsEActionMenuCall: // Call |
2969 { |
2969 { |
2970 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
2970 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
2971 } |
2971 } |
2972 break; |
2972 break; |
2973 case FsEActionMenuAddToContacts: // Add to Contacts |
2973 case FsEActionMenuAddToContacts: // Add to Contacts |
2974 { |
2974 { |
2975 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
2975 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
2976 currentBodyHotSpotData ); |
2976 currentBodyHotSpotData ); |
2977 SavePhoneNumberAsContactL( *hotspotText ); |
2977 SavePhoneNumberAsContactL( *hotspotText ); |
2978 CleanupStack::PopAndDestroy( hotspotText ); |
2978 CleanupStack::PopAndDestroy( hotspotText ); |
2979 } |
2979 } |
2980 break; |
2980 break; |
2981 case FsEActionMenuCreateMessage: // Create message |
2981 case FsEActionMenuCreateMessage: // Create message |
2982 { |
2982 { |
2983 CreateMessageL(); |
2983 CreateMessageL(); |
2984 } |
2984 } |
2985 break; |
2985 break; |
2986 case FsEActionMenuRemoteLookup: // Remote lookup |
2986 case FsEActionMenuRemoteLookup: // Remote lookup |
2987 { |
2987 { |
2988 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
2988 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
2989 currentBodyHotSpotData ); |
2989 currentBodyHotSpotData ); |
2990 LaunchRemoteLookupL( *hotspotText ); |
2990 LaunchRemoteLookupL( *hotspotText ); |
2991 CleanupStack::PopAndDestroy( hotspotText ); |
2991 CleanupStack::PopAndDestroy( hotspotText ); |
2992 } |
2992 } |
2993 break; |
2993 break; |
2994 } |
2994 } |
2995 } |
2995 } |
2996 else if ( aActionMenuType == EFocusOnNameInAddressField ) |
2996 else if ( aActionMenuType == EFocusOnNameInAddressField ) |
2997 { |
2997 { |
2998 switch( aSelectedActionMenuItem ) |
2998 switch( aSelectedActionMenuItem ) |
2999 { |
2999 { |
3000 case FsEActionMenuCall: // Call |
3000 case FsEActionMenuCall: // Call |
3001 { |
3001 { |
3002 CallHotSpotAddressL(); |
3002 CallHotSpotAddressL(); |
3003 } |
3003 } |
3004 break; |
3004 break; |
3005 case FsEActionMenuCreateMessage: // Create message |
3005 case FsEActionMenuCreateMessage: // Create message |
3006 { |
3006 { |
3007 CreateMessageL(); |
3007 CreateMessageL(); |
3008 } |
3008 } |
3009 break; |
3009 break; |
3010 case FsEActionMenuCreateEmail: // Create message |
3010 case FsEActionMenuCreateEmail: // Create message |
3011 { |
3011 { |
3012 ComposeMailL(); |
3012 ComposeMailL(); |
3013 } |
3013 } |
3014 break; |
3014 break; |
3015 case FsEActionMenuContactDetails: // Contact details |
3015 case FsEActionMenuContactDetails: // Contact details |
3016 { |
3016 { |
3017 OpenContactDetailsL(); |
3017 OpenContactDetailsL(); |
3018 } |
3018 } |
3019 break; |
3019 break; |
3020 case FsEActionMenuAddToContacts: // Add to Contacts |
3020 case FsEActionMenuAddToContacts: // Add to Contacts |
3021 { |
3021 { |
3022 HBufC* emailAddress = |
3022 HBufC* emailAddress = |
3023 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
3023 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
3024 currentHeaderHotSpotData ); |
3024 currentHeaderHotSpotData ); |
3025 SaveEmailAsContactL( *emailAddress ); |
3025 SaveEmailAsContactL( *emailAddress ); |
3026 CleanupStack::PopAndDestroy( emailAddress ); |
3026 CleanupStack::PopAndDestroy( emailAddress ); |
3027 } |
3027 } |
3028 break; |
3028 break; |
3029 case FsEActionMenuRemoteLookup: // Remote lookup |
3029 case FsEActionMenuRemoteLookup: // Remote lookup |
3030 { |
3030 { |
3031 HBufC* emailAddress = |
3031 HBufC* emailAddress = |
3032 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
3032 iViewerRichText->GetHeaderHotspotEmailAddressLC( |
3033 currentHeaderHotSpotData ); |
3033 currentHeaderHotSpotData ); |
3034 LaunchRemoteLookupL( *emailAddress ); |
3034 LaunchRemoteLookupL( *emailAddress ); |
3035 CleanupStack::PopAndDestroy( emailAddress ); |
3035 CleanupStack::PopAndDestroy( emailAddress ); |
3036 } |
3036 } |
3037 break; |
3037 break; |
3038 } |
3038 } |
3039 } |
3039 } |
3040 else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) |
3040 else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) |
3041 { |
3041 { |
3042 switch ( aSelectedActionMenuItem ) |
3042 switch ( aSelectedActionMenuItem ) |
3043 { |
3043 { |
3044 case FsEActionMenuOpenInWeb: // Open in web |
3044 case FsEActionMenuOpenInWeb: // Open in web |
3045 { |
3045 { |
3046 OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); |
3046 OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); |
3047 } |
3047 } |
3048 break; |
3048 break; |
3049 case FsEActionMenuOpenInIntranet: // Open in intranet |
3049 case FsEActionMenuOpenInIntranet: // Open in intranet |
3050 { |
3050 { |
3051 OpenLinkInIntranetL( EFalse ); |
3051 OpenLinkInIntranetL( EFalse ); |
3052 } |
3052 } |
3053 break; |
3053 break; |
3054 case FsEActionMenuBookmark: // Bookmark |
3054 case FsEActionMenuBookmark: // Bookmark |
3055 { |
3055 { |
3056 AddToBookmarksL( currentBodyHotSpotData ); |
3056 AddToBookmarksL( currentBodyHotSpotData ); |
3057 } |
3057 } |
3058 break; |
3058 break; |
3059 } |
3059 } |
3060 } |
3060 } |
3061 else if ( aActionMenuType == EFocusOnAttachmentName || |
3061 else if ( aActionMenuType == EFocusOnAttachmentName || |
3062 aActionMenuType == EFocusOnAttachmentsText ) |
3062 aActionMenuType == EFocusOnAttachmentsText ) |
3063 { |
3063 { |
3064 switch ( aSelectedActionMenuItem ) |
3064 switch ( aSelectedActionMenuItem ) |
3065 { |
3065 { |
3066 case FsEActionAttachmentOpen: // Open single attachment |
3066 case FsEActionAttachmentOpen: // Open single attachment |
3067 { |
3067 { |
3068 OpenAttachmentL(); |
3068 OpenAttachmentL(); |
3069 } |
3069 } |
3070 break; |
3070 break; |
3071 case FsEActionAttachmentViewAll: // Open attachments list |
3071 case FsEActionAttachmentViewAll: // Open attachments list |
3072 { |
3072 { |
3073 OpenAttachmentsViewL(); |
3073 OpenAttachmentsViewL(); |
3074 } |
3074 } |
3075 break; |
3075 break; |
3076 case FsEActionAttachmentDownload: // Dowload one |
3076 case FsEActionAttachmentDownload: // Dowload one |
3077 case FsEActionAttachmentDownloadAll : /// all attachments |
3077 case FsEActionAttachmentDownloadAll : /// all attachments |
3078 { |
3078 { |
3079 StartDowloadingAttachmentsL(); |
3079 StartDowloadingAttachmentsL(); |
3080 } |
3080 } |
3081 break; |
3081 break; |
3082 case FsEActionAttachmentCancelDownload: // Cancel one / all downloads |
3082 case FsEActionAttachmentCancelDownload: // Cancel one / all downloads |
3083 case FsEActionAttachmentCancelAllDownloads: |
3083 case FsEActionAttachmentCancelAllDownloads: |
3084 { |
3084 { |
3085 CancelDowloadingAttachmentsL(); |
3085 CancelDowloadingAttachmentsL(); |
3086 } |
3086 } |
3087 break; |
3087 break; |
3088 case FsEActionAttachmentSave: // Save one / all attachments |
3088 case FsEActionAttachmentSave: // Save one / all attachments |
3089 case FsEActionAttachmentSaveAll: |
3089 case FsEActionAttachmentSaveAll: |
3090 { |
3090 { |
3091 SaveAllAttachmentsL(); |
3091 SaveAllAttachmentsL(); |
3092 } |
3092 } |
3093 break; |
3093 break; |
3094 case FsEActionAttachmentClearFetchedContent: |
3094 case FsEActionAttachmentClearFetchedContent: |
3095 { |
3095 { |
3096 RemoveFetchedAttachmentL(); |
3096 RemoveFetchedAttachmentL(); |
3097 } |
3097 } |
3098 break; |
3098 break; |
3099 } |
3099 } |
3100 } |
3100 } |
3101 else if ( aActionMenuType == EFocusOnEMailInBodyText ) |
3101 else if ( aActionMenuType == EFocusOnEMailInBodyText ) |
3102 { |
3102 { |
3103 switch ( aSelectedActionMenuItem ) |
3103 switch ( aSelectedActionMenuItem ) |
3104 { |
3104 { |
3105 case FsEActionMenuCall: // Call |
3105 case FsEActionMenuCall: // Call |
3106 { |
3106 { |
3107 CallHotSpotAddressL(); |
3107 CallHotSpotAddressL(); |
3108 } |
3108 } |
3109 break; |
3109 break; |
3110 case FsEActionMenuCreateMessage: // Create message |
3110 case FsEActionMenuCreateMessage: // Create message |
3111 { |
3111 { |
3112 CreateMessageL(); |
3112 CreateMessageL(); |
3113 } |
3113 } |
3114 break; |
3114 break; |
3115 case FsEActionMenuCreateEmail: // Create message |
3115 case FsEActionMenuCreateEmail: // Create message |
3116 { |
3116 { |
3117 ComposeMailL(); |
3117 ComposeMailL(); |
3118 } |
3118 } |
3119 break; |
3119 break; |
3120 case FsEActionMenuContactDetails: // Contact details |
3120 case FsEActionMenuContactDetails: // Contact details |
3121 { |
3121 { |
3122 OpenContactDetailsL(); |
3122 OpenContactDetailsL(); |
3123 } |
3123 } |
3124 break; |
3124 break; |
3125 case FsEActionMenuAddToContacts: // Add to Contacts |
3125 case FsEActionMenuAddToContacts: // Add to Contacts |
3126 { |
3126 { |
3127 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
3127 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
3128 currentBodyHotSpotData ); |
3128 currentBodyHotSpotData ); |
3129 if ( currentBodyHotSpotData.iItemType == |
3129 if ( currentBodyHotSpotData.iItemType == |
3130 CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3130 CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3131 { |
3131 { |
3132 SavePhoneNumberAsContactL( *hotspotText ); |
3132 SavePhoneNumberAsContactL( *hotspotText ); |
3133 } |
3133 } |
3134 else if ( currentBodyHotSpotData.iItemType == |
3134 else if ( currentBodyHotSpotData.iItemType == |
3135 CFindItemEngine::EFindItemSearchMailAddressBin ) |
3135 CFindItemEngine::EFindItemSearchMailAddressBin ) |
3136 { |
3136 { |
3137 SaveEmailAsContactL( *hotspotText ); |
3137 SaveEmailAsContactL( *hotspotText ); |
3138 } |
3138 } |
3139 else if ( currentBodyHotSpotData.iItemType == |
3139 else if ( currentBodyHotSpotData.iItemType == |
3140 CFindItemEngine::EFindItemSearchScheme ) |
3140 CFindItemEngine::EFindItemSearchScheme ) |
3141 { |
3141 { |
3142 if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) |
3142 if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) |
3143 { |
3143 { |
3144 // Save email as contact, address mailto: strip is done in SaveEmailAsContactL |
3144 // Save email as contact, address mailto: strip is done in SaveEmailAsContactL |
3145 SaveEmailAsContactL( *hotspotText ); |
3145 SaveEmailAsContactL( *hotspotText ); |
3146 } |
3146 } |
3147 } |
3147 } |
3148 CleanupStack::PopAndDestroy( hotspotText ); |
3148 CleanupStack::PopAndDestroy( hotspotText ); |
3149 } |
3149 } |
3150 break; |
3150 break; |
3151 case FsEActionMenuRemoteLookup: // Remote lookup |
3151 case FsEActionMenuRemoteLookup: // Remote lookup |
3152 { |
3152 { |
3153 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
3153 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( |
3154 currentBodyHotSpotData ); |
3154 currentBodyHotSpotData ); |
3155 LaunchRemoteLookupL( *hotspotText ); |
3155 LaunchRemoteLookupL( *hotspotText ); |
3156 CleanupStack::PopAndDestroy( hotspotText ); |
3156 CleanupStack::PopAndDestroy( hotspotText ); |
3157 } |
3157 } |
3158 break; |
3158 break; |
3159 } |
3159 } |
3160 } |
3160 } |
3161 } |
3161 } |
3162 |
3162 |
3163 // ----------------------------------------------------------------------------- |
3163 // ----------------------------------------------------------------------------- |
3164 // CFSEmailUiMailViewerVisualiser::OpenContactDetailsL |
3164 // CFSEmailUiMailViewerVisualiser::OpenContactDetailsL |
3165 // ----------------------------------------------------------------------------- |
3165 // ----------------------------------------------------------------------------- |
3166 void CFSEmailUiMailViewerVisualiser::OpenContactDetailsL() |
3166 void CFSEmailUiMailViewerVisualiser::OpenContactDetailsL() |
3167 { |
3167 { |
3168 FUNC_LOG; |
3168 FUNC_LOG; |
3169 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3169 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3170 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3170 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3171 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3171 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3172 |
3172 |
3173 HBufC* emailAddress = NULL; |
3173 HBufC* emailAddress = NULL; |
3174 if ( hotspotType == EHeaderHotspot ) |
3174 if ( hotspotType == EHeaderHotspot ) |
3175 { |
3175 { |
3176 emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3176 emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3177 } |
3177 } |
3178 else if ( hotspotType == EBodyHotspot ) |
3178 else if ( hotspotType == EBodyHotspot ) |
3179 { |
3179 { |
3180 emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3180 emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3181 // Delete "mailto:" prefix if found |
3181 // Delete "mailto:" prefix if found |
3182 if ( emailAddress->FindC( KMailtoPrefix ) == 0 ) |
3182 if ( emailAddress->FindC( KMailtoPrefix ) == 0 ) |
3183 { |
3183 { |
3184 emailAddress->Des().Delete( 0, KMailtoPrefix().Length() ); |
3184 emailAddress->Des().Delete( 0, KMailtoPrefix().Length() ); |
3185 } |
3185 } |
3186 } |
3186 } |
3187 else |
3187 else |
3188 { |
3188 { |
3189 return; |
3189 return; |
3190 } |
3190 } |
3191 |
3191 |
3192 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->ShowContactDetailsL( |
3192 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->ShowContactDetailsL( |
3193 *emailAddress, EContactUpdateEmail, NULL ); |
3193 *emailAddress, EContactUpdateEmail, NULL ); |
3194 |
3194 |
3195 CleanupStack::PopAndDestroy( emailAddress ); |
3195 CleanupStack::PopAndDestroy( emailAddress ); |
3196 } |
3196 } |
3197 |
3197 |
3198 // ----------------------------------------------------------------------------- |
3198 // ----------------------------------------------------------------------------- |
3199 // CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL |
3199 // CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL |
3200 // ----------------------------------------------------------------------------- |
3200 // ----------------------------------------------------------------------------- |
3201 void CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL() |
3201 void CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL() |
3202 { |
3202 { |
3203 FUNC_LOG; |
3203 FUNC_LOG; |
3204 if ( MessagePartFullyFetchedL( EMessageHtmlBodyPart ) ) |
3204 if ( MessagePartFullyFetchedL( EMessageHtmlBodyPart ) ) |
3205 { |
3205 { |
3206 THtmlViewerActivationData htmlData; |
3206 THtmlViewerActivationData htmlData; |
3207 htmlData.iActivationDataType = THtmlViewerActivationData::EMailMessage; |
3207 htmlData.iActivationDataType = THtmlViewerActivationData::EMailMessage; |
3208 htmlData.iMailBoxId = iMessage->GetMailBoxId(); |
3208 htmlData.iMailBoxId = iMessage->GetMailBoxId(); |
3209 htmlData.iFolderId = iMessage->GetFolderId(); |
3209 htmlData.iFolderId = iMessage->GetFolderId(); |
3210 htmlData.iMessageId = iMessage->GetMessageId(); |
3210 htmlData.iMessageId = iMessage->GetMessageId(); |
3211 htmlData.iEmbeddedMessageMode = iEmbeddedMessageMode; |
3211 htmlData.iEmbeddedMessageMode = iEmbeddedMessageMode; |
3212 TPckgBuf<THtmlViewerActivationData> pckgData( htmlData ); |
3212 TPckgBuf<THtmlViewerActivationData> pckgData( htmlData ); |
3213 |
3213 |
3214 iAppUi.EnterFsEmailViewL( HtmlViewerId, KHtmlViewerOpenNew, pckgData ); |
3214 iAppUi.EnterFsEmailViewL( HtmlViewerId, KHtmlViewerOpenNew, pckgData ); |
3215 } |
3215 } |
3216 else |
3216 else |
3217 { |
3217 { |
3218 StartWaitedFetchingL( EMessageHtmlBodyPart ); |
3218 StartWaitedFetchingL( EMessageHtmlBodyPart ); |
3219 } |
3219 } |
3220 } |
3220 } |
3221 |
3221 |
3222 // ----------------------------------------------------------------------------- |
3222 // ----------------------------------------------------------------------------- |
3223 // CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL |
3223 // CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL |
3224 // ----------------------------------------------------------------------------- |
3224 // ----------------------------------------------------------------------------- |
3225 void CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL( const TDesC& aDes ) const |
3225 void CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL( const TDesC& aDes ) const |
3226 { |
3226 { |
3227 FUNC_LOG; |
3227 FUNC_LOG; |
3228 // this method assumes that remote lookup is available with current plugin. |
3228 // this method assumes that remote lookup is available with current plugin. |
3229 HBufC* textData = HBufC::NewLC( aDes.Length() ); |
3229 HBufC* textData = HBufC::NewLC( aDes.Length() ); |
3230 textData->Des().Append( aDes ); |
3230 textData->Des().Append( aDes ); |
3231 if ( textData->FindC( KMailtoPrefix ) == 0 ) |
3231 if ( textData->FindC( KMailtoPrefix ) == 0 ) |
3232 { |
3232 { |
3233 textData->Des().Delete( 0, KMailtoPrefix().Length() ); |
3233 textData->Des().Delete( 0, KMailtoPrefix().Length() ); |
3234 } |
3234 } |
3235 else if ( textData->FindC( KCallPrefix ) == 0 ) |
3235 else if ( textData->FindC( KCallPrefix ) == 0 ) |
3236 { |
3236 { |
3237 textData->Des().Delete( 0, KCallPrefix().Length() ); |
3237 textData->Des().Delete( 0, KCallPrefix().Length() ); |
3238 } |
3238 } |
3239 else if ( textData->FindC( KTelPrefix ) == 0 ) |
3239 else if ( textData->FindC( KTelPrefix ) == 0 ) |
3240 { |
3240 { |
3241 textData->Des().Delete( 0, KTelPrefix().Length() ); |
3241 textData->Des().Delete( 0, KTelPrefix().Length() ); |
3242 } |
3242 } |
3243 else if ( textData->FindC( KSmsPrefix ) == 0 ) |
3243 else if ( textData->FindC( KSmsPrefix ) == 0 ) |
3244 { |
3244 { |
3245 textData->Des().Delete( 0, KSmsPrefix().Length() ); |
3245 textData->Des().Delete( 0, KSmsPrefix().Length() ); |
3246 } |
3246 } |
3247 else if ( textData->FindC( KMmsPrefix ) == 0 ) |
3247 else if ( textData->FindC( KMmsPrefix ) == 0 ) |
3248 { |
3248 { |
3249 textData->Des().Delete( 0, KMmsPrefix().Length() ); |
3249 textData->Des().Delete( 0, KMmsPrefix().Length() ); |
3250 } |
3250 } |
3251 else if ( textData->FindC( KVoipPrefix ) == 0 ) |
3251 else if ( textData->FindC( KVoipPrefix ) == 0 ) |
3252 { |
3252 { |
3253 textData->Des().Delete( 0, KVoipPrefix().Length() ); |
3253 textData->Des().Delete( 0, KVoipPrefix().Length() ); |
3254 } |
3254 } |
3255 |
3255 |
3256 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *iMailBox, *textData ); |
3256 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *iMailBox, *textData ); |
3257 CleanupStack::PopAndDestroy( textData ); |
3257 CleanupStack::PopAndDestroy( textData ); |
3258 } |
3258 } |
3259 |
3259 |
3260 // ----------------------------------------------------------------------------- |
3260 // ----------------------------------------------------------------------------- |
3261 // CFSEmailUiMailViewerVisualiser::AddToBookmarksL |
3261 // CFSEmailUiMailViewerVisualiser::AddToBookmarksL |
3262 // ----------------------------------------------------------------------------- |
3262 // ----------------------------------------------------------------------------- |
3263 void CFSEmailUiMailViewerVisualiser::AddToBookmarksL( |
3263 void CFSEmailUiMailViewerVisualiser::AddToBookmarksL( |
3264 const CFindItemEngine::SFoundItem& aBodyHotspotData ) const |
3264 const CFindItemEngine::SFoundItem& aBodyHotspotData ) const |
3265 { |
3265 { |
3266 FUNC_LOG; |
3266 FUNC_LOG; |
3267 HBufC* hotspotText = |
3267 HBufC* hotspotText = |
3268 iViewerRichText->GetHotspotTextLC( aBodyHotspotData ); |
3268 iViewerRichText->GetHotspotTextLC( aBodyHotspotData ); |
3269 |
3269 |
3270 RFavouritesSession fSession; |
3270 RFavouritesSession fSession; |
3271 User::LeaveIfError( fSession.Connect() ); |
3271 User::LeaveIfError( fSession.Connect() ); |
3272 CleanupClosePushL( fSession ); |
3272 CleanupClosePushL( fSession ); |
3273 |
3273 |
3274 RFavouritesDb favoris; |
3274 RFavouritesDb favoris; |
3275 User::LeaveIfError( favoris.Open( fSession, KBrowserBookmarks ) ); |
3275 User::LeaveIfError( favoris.Open( fSession, KBrowserBookmarks ) ); |
3276 CleanupClosePushL( favoris ); |
3276 CleanupClosePushL( favoris ); |
3277 |
3277 |
3278 CFavouritesItem *favorisItem = CFavouritesItem::NewLC(); |
3278 CFavouritesItem *favorisItem = CFavouritesItem::NewLC(); |
3279 favorisItem->SetType( CFavouritesItem::EItem ); |
3279 favorisItem->SetType( CFavouritesItem::EItem ); |
3280 favorisItem->SetUrlL( *hotspotText ); |
3280 favorisItem->SetUrlL( *hotspotText ); |
3281 // Should be less than KFavouritesMaxName ( 50 ) |
3281 // Should be less than KFavouritesMaxName ( 50 ) |
3282 if ( hotspotText->Length() > KFavouritesMaxName ) |
3282 if ( hotspotText->Length() > KFavouritesMaxName ) |
3283 { |
3283 { |
3284 favorisItem->SetNameL( hotspotText->Left( KFavouritesMaxName ) ); |
3284 favorisItem->SetNameL( hotspotText->Left( KFavouritesMaxName ) ); |
3285 } |
3285 } |
3286 else |
3286 else |
3287 { |
3287 { |
3288 favorisItem->SetNameL( *hotspotText ); |
3288 favorisItem->SetNameL( *hotspotText ); |
3289 } |
3289 } |
3290 |
3290 |
3291 favorisItem->SetParentFolder( KFavouritesRootUid ); |
3291 favorisItem->SetParentFolder( KFavouritesRootUid ); |
3292 |
3292 |
3293 TInt error = favoris.Add( *favorisItem, ETrue ); |
3293 TInt error = favoris.Add( *favorisItem, ETrue ); |
3294 |
3294 |
3295 CleanupStack::PopAndDestroy( favorisItem ); |
3295 CleanupStack::PopAndDestroy( favorisItem ); |
3296 CleanupStack::PopAndDestroy( &favoris ); |
3296 CleanupStack::PopAndDestroy( &favoris ); |
3297 CleanupStack::PopAndDestroy( &fSession ); |
3297 CleanupStack::PopAndDestroy( &fSession ); |
3298 |
3298 |
3299 CleanupStack::PopAndDestroy( hotspotText ); |
3299 CleanupStack::PopAndDestroy( hotspotText ); |
3300 |
3300 |
3301 if ( error == KErrNone ) |
3301 if ( error == KErrNone ) |
3302 { |
3302 { |
3303 TFsEmailUiUtility::ShowInfoNoteL( |
3303 TFsEmailUiUtility::ShowInfoNoteL( |
3304 R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); |
3304 R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); |
3305 } |
3305 } |
3306 else // Error in bookmark creation, show could not complete message |
3306 else // Error in bookmark creation, show could not complete message |
3307 { |
3307 { |
3308 TFsEmailUiUtility::ShowErrorNoteL( |
3308 TFsEmailUiUtility::ShowErrorNoteL( |
3309 R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); |
3309 R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); |
3310 } |
3310 } |
3311 } |
3311 } |
3312 |
3312 |
3313 // ----------------------------------------------------------------------------- |
3313 // ----------------------------------------------------------------------------- |
3314 // CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL |
3314 // CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL |
3315 // ----------------------------------------------------------------------------- |
3315 // ----------------------------------------------------------------------------- |
3316 void CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL() |
3316 void CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL() |
3317 { |
3317 { |
3318 FUNC_LOG; |
3318 FUNC_LOG; |
3319 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3319 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3320 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3320 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3321 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3321 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3322 |
3322 |
3323 if( hotspotType == EHeaderHotspot && currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName ) |
3323 if( hotspotType == EHeaderHotspot && currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName ) |
3324 { |
3324 { |
3325 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3325 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3326 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3326 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3327 iAppUi.GetActiveMailbox(), this, ETrue /*use call sender text*/); |
3327 iAppUi.GetActiveMailbox(), this, ETrue /*use call sender text*/); |
3328 CleanupStack::PopAndDestroy( emailAddress ); |
3328 CleanupStack::PopAndDestroy( emailAddress ); |
3329 } |
3329 } |
3330 else if( ( hotspotType == EHeaderHotspot && |
3330 else if( ( hotspotType == EHeaderHotspot && |
3331 ( currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
3331 ( currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || |
3332 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
3332 currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || |
3333 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
3333 currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || |
3334 currentHeaderHotSpotData.iType == ETypeEmailAddress ) |
3334 currentHeaderHotSpotData.iType == ETypeEmailAddress ) |
3335 ) |
3335 ) |
3336 ) |
3336 ) |
3337 { |
3337 { |
3338 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3338 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3339 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3339 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3340 iAppUi.GetActiveMailbox(), this, EFalse /*use call sender text*/); |
3340 iAppUi.GetActiveMailbox(), this, EFalse /*use call sender text*/); |
3341 CleanupStack::PopAndDestroy( emailAddress ); |
3341 CleanupStack::PopAndDestroy( emailAddress ); |
3342 } |
3342 } |
3343 else if( hotspotType == EBodyHotspot && |
3343 else if( hotspotType == EBodyHotspot && |
3344 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
3344 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
3345 { |
3345 { |
3346 HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3346 HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3347 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3347 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, |
3348 iAppUi.GetActiveMailbox(), this, EFalse ); |
3348 iAppUi.GetActiveMailbox(), this, EFalse ); |
3349 CleanupStack::PopAndDestroy( emailAddress ); |
3349 CleanupStack::PopAndDestroy( emailAddress ); |
3350 } |
3350 } |
3351 else if( hotspotType == EBodyHotspot && |
3351 else if( hotspotType == EBodyHotspot && |
3352 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3352 currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3353 { |
3353 { |
3354 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
3354 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
3355 } |
3355 } |
3356 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
3356 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
3357 { |
3357 { |
3358 // Get scheme text and make sure there is "mailto:" text or "call:" text |
3358 // Get scheme text and make sure there is "mailto:" text or "call:" text |
3359 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3359 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3360 if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0 ) |
3360 if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0 ) |
3361 { |
3361 { |
3362 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
3362 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
3363 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *schemeText, |
3363 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *schemeText, |
3364 iAppUi.GetActiveMailbox(), this, EFalse); |
3364 iAppUi.GetActiveMailbox(), this, EFalse); |
3365 } |
3365 } |
3366 else if ( schemeText->FindC( KCallPrefix ) == 0 || |
3366 else if ( schemeText->FindC( KCallPrefix ) == 0 || |
3367 schemeText->FindC( KTelPrefix ) == 0 || |
3367 schemeText->FindC( KTelPrefix ) == 0 || |
3368 schemeText->FindC( KSmsPrefix ) == 0 || |
3368 schemeText->FindC( KSmsPrefix ) == 0 || |
3369 schemeText->FindC( KMmsPrefix ) == 0 || |
3369 schemeText->FindC( KMmsPrefix ) == 0 || |
3370 schemeText->FindC( KVoipPrefix ) == 0 ) |
3370 schemeText->FindC( KVoipPrefix ) == 0 ) |
3371 { |
3371 { |
3372 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
3372 CallToBodyHotSpotNumberL( currentBodyHotSpotData ); |
3373 } |
3373 } |
3374 CleanupStack::PopAndDestroy( schemeText ); |
3374 CleanupStack::PopAndDestroy( schemeText ); |
3375 } |
3375 } |
3376 |
3376 |
3377 } |
3377 } |
3378 |
3378 |
3379 // ----------------------------------------------------------------------------- |
3379 // ----------------------------------------------------------------------------- |
3380 // CFSEmailUiMailViewerVisualiser::CreateMessageL |
3380 // CFSEmailUiMailViewerVisualiser::CreateMessageL |
3381 // ----------------------------------------------------------------------------- |
3381 // ----------------------------------------------------------------------------- |
3382 void CFSEmailUiMailViewerVisualiser::CreateMessageL() const |
3382 void CFSEmailUiMailViewerVisualiser::CreateMessageL() const |
3383 { |
3383 { |
3384 FUNC_LOG; |
3384 FUNC_LOG; |
3385 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3385 SViewerHeadingHotSpotData currentHeaderHotSpotData; |
3386 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3386 CFindItemEngine::SFoundItem currentBodyHotSpotData; |
3387 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3387 THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); |
3388 |
3388 |
3389 if( hotspotType == EHeaderHotspot ) |
3389 if( hotspotType == EHeaderHotspot ) |
3390 { |
3390 { |
3391 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3391 HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); |
3392 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3392 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3393 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); |
3393 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); |
3394 CleanupStack::PopAndDestroy( emailAddress ); |
3394 CleanupStack::PopAndDestroy( emailAddress ); |
3395 } |
3395 } |
3396 else if( hotspotType == EBodyHotspot ) |
3396 else if( hotspotType == EBodyHotspot ) |
3397 { |
3397 { |
3398 // Sending based on email address, goes to contact handler |
3398 // Sending based on email address, goes to contact handler |
3399 if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
3399 if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
3400 { |
3400 { |
3401 HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3401 HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3402 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3402 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3403 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); |
3403 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); |
3404 CleanupStack::PopAndDestroy( emailAddress ); |
3404 CleanupStack::PopAndDestroy( emailAddress ); |
3405 } |
3405 } |
3406 // Sending based on found number, goes to utility class |
3406 // Sending based on found number, goes to utility class |
3407 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3407 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
3408 { |
3408 { |
3409 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3409 HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3410 TFsEmailUiUtility::ShowCreateMessageQueryL( *hotspotText ); |
3410 TFsEmailUiUtility::ShowCreateMessageQueryL( *hotspotText ); |
3411 CleanupStack::PopAndDestroy( hotspotText ); |
3411 CleanupStack::PopAndDestroy( hotspotText ); |
3412 } |
3412 } |
3413 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
3413 else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
3414 { |
3414 { |
3415 // Get scheme text and make sure there is "mailto:" text or "call:" text |
3415 // Get scheme text and make sure there is "mailto:" text or "call:" text |
3416 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3416 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); |
3417 if ( schemeText && ( schemeText->FindC( KMailtoPrefix ) == 0 || |
3417 if ( schemeText && ( schemeText->FindC( KMailtoPrefix ) == 0 || |
3418 schemeText->FindC( KVoipPrefix ) == 0) ) |
3418 schemeText->FindC( KVoipPrefix ) == 0) ) |
3419 { |
3419 { |
3420 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
3420 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
3421 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3421 CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); |
3422 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *schemeText, iAppUi.GetActiveMailbox() ); |
3422 cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *schemeText, iAppUi.GetActiveMailbox() ); |
3423 } |
3423 } |
3424 else if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) |
3424 else if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) |
3425 { |
3425 { |
3426 schemeText->Des().Delete( 0, KCallPrefix().Length() ); |
3426 schemeText->Des().Delete( 0, KCallPrefix().Length() ); |
3427 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3427 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3428 } |
3428 } |
3429 else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) |
3429 else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) |
3430 { |
3430 { |
3431 schemeText->Des().Delete( 0, KTelPrefix().Length() ); |
3431 schemeText->Des().Delete( 0, KTelPrefix().Length() ); |
3432 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3432 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3433 } |
3433 } |
3434 else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) |
3434 else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) |
3435 { |
3435 { |
3436 schemeText->Des().Delete( 0, KSmsPrefix().Length() ); |
3436 schemeText->Des().Delete( 0, KSmsPrefix().Length() ); |
3437 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3437 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3438 } |
3438 } |
3439 else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) |
3439 else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) |
3440 { |
3440 { |
3441 schemeText->Des().Delete( 0, KMmsPrefix().Length() ); |
3441 schemeText->Des().Delete( 0, KMmsPrefix().Length() ); |
3442 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3442 TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); |
3443 } |
3443 } |
3444 CleanupStack::PopAndDestroy( schemeText ); |
3444 CleanupStack::PopAndDestroy( schemeText ); |
3445 } |
3445 } |
3446 } |
3446 } |
3447 } |
3447 } |
3448 |
3448 |
3449 TBool CFSEmailUiMailViewerVisualiser::IsCopyToClipBoardAvailableL() const |
3449 TBool CFSEmailUiMailViewerVisualiser::IsCopyToClipBoardAvailableL() const |
3450 { |
3450 { |
3451 FUNC_LOG; |
3451 FUNC_LOG; |
3452 TBool available = EFalse; |
3452 TBool available = EFalse; |
3685 |
3685 |
3686 // ----------------------------------------------------------------------------- |
3686 // ----------------------------------------------------------------------------- |
3687 // CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption |
3687 // CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption |
3688 // ----------------------------------------------------------------------------- |
3688 // ----------------------------------------------------------------------------- |
3689 TBool CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption() |
3689 TBool CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption() |
3690 { |
3690 { |
3691 FUNC_LOG; |
3691 FUNC_LOG; |
3692 TBool ret( EFalse ); |
3692 TBool ret( EFalse ); |
3693 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
3693 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
3694 { |
3694 { |
3695 ret = iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads( |
3695 ret = iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads( |
3696 iMessage->GetMessageId() ); |
3696 iMessage->GetMessageId() ); |
3697 } |
3697 } |
3698 return ret; |
3698 return ret; |
3699 } |
3699 } |
3700 |
3700 |
3701 // ----------------------------------------------------------------------------- |
3701 // ----------------------------------------------------------------------------- |
3702 // CFSEmailUiMailViewerVisualiser::OpenAttachmentL |
3702 // CFSEmailUiMailViewerVisualiser::OpenAttachmentL |
3703 // ----------------------------------------------------------------------------- |
3703 // ----------------------------------------------------------------------------- |
3704 void CFSEmailUiMailViewerVisualiser::OpenAttachmentL() |
3704 void CFSEmailUiMailViewerVisualiser::OpenAttachmentL() |
3705 { |
3705 { |
3706 FUNC_LOG; |
3706 FUNC_LOG; |
3707 if ( !iMessage ) |
3707 if ( !iMessage ) |
3708 { |
3708 { |
3709 User::Leave( KErrNotReady ); |
3709 User::Leave( KErrNotReady ); |
3710 } |
3710 } |
3711 |
3711 |
3712 RPointerArray<CFSMailMessagePart> attachments; |
3712 RPointerArray<CFSMailMessagePart> attachments; |
3713 CleanupResetAndDestroyClosePushL( attachments ); |
3713 CleanupResetAndDestroyClosePushL( attachments ); |
3714 iMessage->AttachmentListL( attachments ); |
3714 iMessage->AttachmentListL( attachments ); |
3715 |
3715 |
3716 // start downloading if not yet downloaded. |
3716 // start downloading if not yet downloaded. |
3717 if ( ShowDownloadOptionL() ) |
3717 if ( ShowDownloadOptionL() ) |
3718 { |
3718 { |
3719 StartDowloadingAttachmentsL(); |
3719 StartDowloadingAttachmentsL(); |
3720 } |
3720 } |
3721 else if ( ShowCancelDownloadOption() ) // show download ongoing info |
3721 else if ( ShowCancelDownloadOption() ) // show download ongoing info |
3722 { |
3722 { |
3723 TFsEmailUiUtility::ShowInfoNoteL( |
3723 TFsEmailUiUtility::ShowInfoNoteL( |
3724 R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS ); |
3724 R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS ); |
3725 } |
3725 } |
3726 else // open if attachment is already downloaded |
3726 else // open if attachment is already downloaded |
3727 { |
3727 { |
3728 TInt attachmentsCount = attachments.Count(); |
3728 TInt attachmentsCount = attachments.Count(); |
3729 if ( attachmentsCount ) |
3729 if ( attachmentsCount ) |
3730 { |
3730 { |
3731 // <cmail> |
3731 // <cmail> |
3732 TFsEmailUiUtility::OpenAttachmentL( *attachments[attachmentsCount-1] ); |
3732 TFsEmailUiUtility::OpenAttachmentL( *attachments[attachmentsCount-1] ); |
3733 // </cmail> |
3733 // </cmail> |
3734 } |
3734 } |
3735 } |
3735 } |
3736 |
3736 |
3737 CleanupStack::PopAndDestroy( &attachments ); |
3737 CleanupStack::PopAndDestroy( &attachments ); |
3738 } |
3738 } |
3739 |
3739 |
3740 // ----------------------------------------------------------------------------- |
3740 // ----------------------------------------------------------------------------- |
3741 // CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL |
3741 // CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL |
3742 // ----------------------------------------------------------------------------- |
3742 // ----------------------------------------------------------------------------- |
3743 void CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL() |
3743 void CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL() |
3744 { |
3744 { |
3745 FUNC_LOG; |
3745 FUNC_LOG; |
3746 // give pointer to current for attachments list view |
3746 // give pointer to current for attachments list view |
3747 TAttachmentListActivationData params; |
3747 TAttachmentListActivationData params; |
3748 params.iMailBoxId = iMessage->GetMailBoxId(); |
3748 params.iMailBoxId = iMessage->GetMailBoxId(); |
3749 params.iFolderId = iMessage->GetFolderId(); |
3749 params.iFolderId = iMessage->GetFolderId(); |
3750 params.iMessageId = iMessage->GetMessageId(); |
3750 params.iMessageId = iMessage->GetMessageId(); |
3751 params.iEmbeddedMsgMode = iEmbeddedMessageMode; |
3751 params.iEmbeddedMsgMode = iEmbeddedMessageMode; |
3752 // use package buffer to pass the params |
3752 // use package buffer to pass the params |
3753 TPckgBuf<TAttachmentListActivationData> buf( params ); |
3753 TPckgBuf<TAttachmentListActivationData> buf( params ); |
3754 TUid emptyCustomMessageId = { 0 }; |
3754 TUid emptyCustomMessageId = { 0 }; |
3755 iAppUi.EnterFsEmailViewL( |
3755 iAppUi.EnterFsEmailViewL( |
3756 AttachmentMngrViewId, emptyCustomMessageId, buf ); |
3756 AttachmentMngrViewId, emptyCustomMessageId, buf ); |
3757 } |
3757 } |
3758 |
3758 |
3759 // ----------------------------------------------------------------------------- |
3759 // ----------------------------------------------------------------------------- |
3760 // CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL |
3760 // CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL |
3761 // ----------------------------------------------------------------------------- |
3761 // ----------------------------------------------------------------------------- |
3762 void CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL() |
3762 void CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL() |
3763 { |
3763 { |
3764 FUNC_LOG; |
3764 FUNC_LOG; |
3765 TPartData partData = MailData(); |
3765 TPartData partData = MailData(); |
3766 |
3766 |
3767 RPointerArray<CFSMailMessagePart> attachments; |
3767 RPointerArray<CFSMailMessagePart> attachments; |
3768 CleanupResetAndDestroyClosePushL( attachments ); |
3768 CleanupResetAndDestroyClosePushL( attachments ); |
3769 iMessage->AttachmentListL( attachments ); |
3769 iMessage->AttachmentListL( attachments ); |
3770 TInt attachmentsCount = attachments.Count(); |
3770 TInt attachmentsCount = attachments.Count(); |
3771 for( TInt i = 0; i < attachmentsCount; i++) |
3771 for( TInt i = 0; i < attachmentsCount; i++) |
3772 { |
3772 { |
3773 if ( attachments[i]->FetchLoadState() == EFSNone || |
3773 if ( attachments[i]->FetchLoadState() == EFSNone || |
3774 attachments[i]->FetchLoadState() == EFSPartial ) |
3774 attachments[i]->FetchLoadState() == EFSPartial ) |
3775 { |
3775 { |
3776 partData.iMessagePartId = attachments[i]->GetPartId(); |
3776 partData.iMessagePartId = attachments[i]->GetPartId(); |
3777 if ( iAppUi.DownloadInfoMediator() ) |
3777 if ( iAppUi.DownloadInfoMediator() ) |
3778 { |
3778 { |
3779 iAppUi.DownloadInfoMediator()->DownloadL( partData ); |
3779 iAppUi.DownloadInfoMediator()->DownloadL( partData ); |
3780 } |
3780 } |
3781 } |
3781 } |
3782 } |
3782 } |
3783 CleanupStack::PopAndDestroy( &attachments ); |
3783 CleanupStack::PopAndDestroy( &attachments ); |
3784 } |
3784 } |
3785 |
3785 |
3786 // ----------------------------------------------------------------------------- |
3786 // ----------------------------------------------------------------------------- |
3787 // CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL |
3787 // CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL |
3788 // ----------------------------------------------------------------------------- |
3788 // ----------------------------------------------------------------------------- |
3789 void CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL() |
3789 void CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL() |
3790 { |
3790 { |
3791 FUNC_LOG; |
3791 FUNC_LOG; |
3792 RPointerArray<CFSMailMessagePart> attachments; |
3792 RPointerArray<CFSMailMessagePart> attachments; |
3793 CleanupResetAndDestroyClosePushL( attachments ); |
3793 CleanupResetAndDestroyClosePushL( attachments ); |
3794 iMessage->AttachmentListL( attachments ); |
3794 iMessage->AttachmentListL( attachments ); |
3795 TInt attachmentsCount = attachments.Count(); |
3795 TInt attachmentsCount = attachments.Count(); |
3796 |
3796 |
3797 // ask confirmation for cancel |
3797 // ask confirmation for cancel |
3798 TInt promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY; |
3798 TInt promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY; |
3799 if ( attachmentsCount > 1 ) |
3799 if ( attachmentsCount > 1 ) |
3800 { |
3800 { |
3801 promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY; |
3801 promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY; |
3802 } |
3802 } |
3803 |
3803 |
3804 if ( TFsEmailUiUtility::ShowConfirmationQueryL(promptTextId) && iAppUi.DownloadInfoMediator() ) |
3804 if ( TFsEmailUiUtility::ShowConfirmationQueryL(promptTextId) && iAppUi.DownloadInfoMediator() ) |
3805 { |
3805 { |
3806 for ( TInt i = 0 ; i < attachmentsCount ; i++ ) |
3806 for ( TInt i = 0 ; i < attachmentsCount ; i++ ) |
3807 { |
3807 { |
3808 TFSPartFetchState fetchState = attachments[i]->FetchLoadState(); |
3808 TFSPartFetchState fetchState = attachments[i]->FetchLoadState(); |
3809 if ( fetchState == EFSPartial || fetchState == EFSNone ) |
3809 if ( fetchState == EFSPartial || fetchState == EFSNone ) |
3810 { |
3810 { |
3811 iAppUi.DownloadInfoMediator()->CancelDownloadL( attachments[i]->GetPartId() ); |
3811 iAppUi.DownloadInfoMediator()->CancelDownloadL( attachments[i]->GetPartId() ); |
3812 } |
3812 } |
3813 } |
3813 } |
3814 } |
3814 } |
3815 CleanupStack::PopAndDestroy( &attachments ); |
3815 CleanupStack::PopAndDestroy( &attachments ); |
3816 } |
3816 } |
3817 |
3817 |
3818 // ----------------------------------------------------------------------------- |
3818 // ----------------------------------------------------------------------------- |
3819 // CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL |
3819 // CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL |
3820 // ----------------------------------------------------------------------------- |
3820 // ----------------------------------------------------------------------------- |
3821 void CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL() |
3821 void CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL() |
3822 { |
3822 { |
3823 FUNC_LOG; |
3823 FUNC_LOG; |
3824 TFileName fileName; |
3824 TFileName fileName; |
3825 if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) |
3825 if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) |
3826 { |
3826 { |
3827 // start downloading attachemts which are not downloaded. |
3827 // start downloading attachemts which are not downloaded. |
3828 // Save all attachment which all already downloaded |
3828 // Save all attachment which all already downloaded |
3829 TPartData partData = MailData(); |
3829 TPartData partData = MailData(); |
3830 |
3830 |
3831 RPointerArray<CFSMailMessagePart> attachments; |
3831 RPointerArray<CFSMailMessagePart> attachments; |
3832 CleanupResetAndDestroyClosePushL( attachments ); |
3832 CleanupResetAndDestroyClosePushL( attachments ); |
3833 iMessage->AttachmentListL( attachments ); |
3833 iMessage->AttachmentListL( attachments ); |
3834 TInt attachmentsCount = attachments.Count(); |
3834 TInt attachmentsCount = attachments.Count(); |
3835 |
3835 |
3836 // <cmail> remove the MRUI part of the message so we |
3836 // <cmail> remove the MRUI part of the message so we |
3837 // don't save unnecessary .ics file |
3837 // don't save unnecessary .ics file |
3838 CFSMailMessagePart* calendarPart = iMessage->FindBodyPartL( KFSMailContentTypeTextCalendar ); |
3838 CFSMailMessagePart* calendarPart = iMessage->FindBodyPartL( KFSMailContentTypeTextCalendar ); |
3839 CleanupStack::PushL( calendarPart ); |
3839 CleanupStack::PushL( calendarPart ); |
3840 // </cmail> |
3840 // </cmail> |
3841 |
3841 |
3842 TInt savedCount( 0 ); |
3842 TInt savedCount( 0 ); |
3843 for ( TInt i = 0; i < attachmentsCount; i++ ) |
3843 for ( TInt i = 0; i < attachmentsCount; i++ ) |
3844 { |
3844 { |
3845 partData.iMessagePartId = attachments[i]->GetPartId(); |
3845 partData.iMessagePartId = attachments[i]->GetPartId(); |
3846 if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) |
3846 if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) |
3847 { // start download and let mediator do the saving |
3847 { // start download and let mediator do the saving |
3848 iAppUi.DownloadInfoMediator()->DownloadAndSaveL( partData, fileName ); |
3848 iAppUi.DownloadInfoMediator()->DownloadAndSaveL( partData, fileName ); |
3849 } |
3849 } |
3850 else // save immediately. |
3850 else // save immediately. |
3851 { |
3851 { |
3852 // <cmail> |
3852 // <cmail> |
3853 if( (calendarPart && partData.iMessagePartId != calendarPart->GetPartId() || |
3853 if( (calendarPart && partData.iMessagePartId != calendarPart->GetPartId() || |
3854 !calendarPart) && TFsEmailUiUtility::OkToSaveFileL( fileName, *attachments[i] ) ) |
3854 !calendarPart) && TFsEmailUiUtility::OkToSaveFileL( fileName, *attachments[i] ) ) |
3855 { |
3855 { |
3856 attachments[i]->CopyContentFileL( fileName ); |
3856 attachments[i]->CopyContentFileL( fileName ); |
3857 savedCount++; |
3857 savedCount++; |
3858 } |
3858 } |
3859 // </cmail> |
3859 // </cmail> |
3860 } |
3860 } |
3861 } |
3861 } |
3862 if ( savedCount ) |
3862 if ( savedCount ) |
3863 { |
3863 { |
3864 TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount ); |
3864 TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount ); |
3865 } |
3865 } |
3866 // <cmail> |
3866 // <cmail> |
3867 CleanupStack::PopAndDestroy( calendarPart ); |
3867 CleanupStack::PopAndDestroy( calendarPart ); |
3868 // </cmail> |
3868 // </cmail> |
3869 CleanupStack::PopAndDestroy( &attachments ); |
3869 CleanupStack::PopAndDestroy( &attachments ); |
3870 } |
3870 } |
3871 } |
3871 } |
3872 |
3872 |
3873 // ----------------------------------------------------------------------------- |
3873 // ----------------------------------------------------------------------------- |
3874 // CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL |
3874 // CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL |
3875 // ----------------------------------------------------------------------------- |
3875 // ----------------------------------------------------------------------------- |
3876 void CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL() |
3876 void CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL() |
3896 |
3896 |
3897 // ----------------------------------------------------------------------------- |
3897 // ----------------------------------------------------------------------------- |
3898 // CFSEmailUiMailViewerVisualiser::MailData |
3898 // CFSEmailUiMailViewerVisualiser::MailData |
3899 // ----------------------------------------------------------------------------- |
3899 // ----------------------------------------------------------------------------- |
3900 TPartData CFSEmailUiMailViewerVisualiser::MailData() |
3900 TPartData CFSEmailUiMailViewerVisualiser::MailData() |
3901 { |
3901 { |
3902 FUNC_LOG; |
3902 FUNC_LOG; |
3903 TPartData newPartData; |
3903 TPartData newPartData; |
3904 newPartData.iMailBoxId = iMessage->GetMailBoxId(); |
3904 newPartData.iMailBoxId = iMessage->GetMailBoxId(); |
3905 newPartData.iFolderId = iMessage->GetFolderId(); |
3905 newPartData.iFolderId = iMessage->GetFolderId(); |
3906 newPartData.iMessageId = iMessage->GetMessageId(); |
3906 newPartData.iMessageId = iMessage->GetMessageId(); |
3907 return newPartData; |
3907 return newPartData; |
3908 } |
3908 } |
3909 |
3909 |
3910 // ----------------------------------------------------------------------------- |
3910 // ----------------------------------------------------------------------------- |
3911 // CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL |
3911 // CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL |
3912 // ----------------------------------------------------------------------------- |
3912 // ----------------------------------------------------------------------------- |
3913 TBool CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL() const |
3913 TBool CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL() const |
3914 { |
3914 { |
3915 FUNC_LOG; |
3915 FUNC_LOG; |
3916 TBool retVal = EFalse; |
3916 TBool retVal = EFalse; |
3917 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
3917 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
3918 if ( textPart ) |
3918 if ( textPart ) |
3919 { |
3919 { |
3920 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
3920 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
3921 if ( currentPlainTextFetchState == EFSNone ) |
3921 if ( currentPlainTextFetchState == EFSNone ) |
3922 { |
3922 { |
3923 retVal = ETrue; |
3923 retVal = ETrue; |
3924 } |
3924 } |
3925 } |
3925 } |
3926 delete textPart; |
3926 delete textPart; |
3927 return retVal; |
3927 return retVal; |
3928 } |
3928 } |
3929 |
3929 |
3930 // ----------------------------------------------------------------------------- |
3930 // ----------------------------------------------------------------------------- |
3931 // CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL |
3931 // CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL |
3932 // ----------------------------------------------------------------------------- |
3932 // ----------------------------------------------------------------------------- |
3933 TBool CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL( TFetchedContentType aFetchedContentType ) const |
3933 TBool CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL( TFetchedContentType aFetchedContentType ) const |
3934 { |
3934 { |
3935 FUNC_LOG; |
3935 FUNC_LOG; |
3936 TBool retVal = ETrue; |
3936 TBool retVal = ETrue; |
3937 if( aFetchedContentType == EMessagePlainTextBodyPart ) |
3937 if( aFetchedContentType == EMessagePlainTextBodyPart ) |
3938 { |
3938 { |
3939 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
3939 CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); |
3940 if( textPart ) |
3940 if( textPart ) |
3941 { |
3941 { |
3942 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
3942 TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); |
3943 if( currentPlainTextFetchState != EFSFull ) |
3943 if( currentPlainTextFetchState != EFSFull ) |
3944 { |
3944 { |
3945 retVal = EFalse; |
3945 retVal = EFalse; |
3946 } |
3946 } |
3947 } |
3947 } |
3948 delete textPart; |
3948 delete textPart; |
3949 } |
3949 } |
3950 else if( aFetchedContentType == EMessageHtmlBodyPart ) |
3950 else if( aFetchedContentType == EMessageHtmlBodyPart ) |
3951 { |
3951 { |
3952 CFSMailMessagePart* htmlPart = iMessage->HtmlBodyPartL(); |
3952 CFSMailMessagePart* htmlPart = iMessage->HtmlBodyPartL(); |
3953 if( htmlPart ) |
3953 if( htmlPart ) |
3954 { |
3954 { |
3955 TFSPartFetchState currentHtmlTextFetchState = htmlPart->FetchLoadState(); |
3955 TFSPartFetchState currentHtmlTextFetchState = htmlPart->FetchLoadState(); |
3956 if( currentHtmlTextFetchState != EFSFull ) |
3956 if( currentHtmlTextFetchState != EFSFull ) |
3957 { |
3957 { |
3958 retVal = EFalse; |
3958 retVal = EFalse; |
3959 } |
3959 } |
3960 } |
3960 } |
3961 delete htmlPart; |
3961 delete htmlPart; |
3962 } |
3962 } |
3963 else if( aFetchedContentType == EMessageStructure ) |
3963 else if( aFetchedContentType == EMessageStructure ) |
3964 { |
3964 { |
3965 retVal = MessageStructureKnown( *iMessage ); |
3965 retVal = MessageStructureKnown( *iMessage ); |
3966 } |
3966 } |
3967 else |
3967 else |
3968 { |
3968 { |
3969 User::Leave( KErrNotSupported ); |
3969 User::Leave( KErrNotSupported ); |
3970 } |
3970 } |
3971 return retVal; |
3971 return retVal; |
3972 } |
3972 } |
3973 |
3973 |
3974 // ----------------------------------------------------------------------------- |
3974 // ----------------------------------------------------------------------------- |
3975 // CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL |
3975 // CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL |
3976 // ----------------------------------------------------------------------------- |
3976 // ----------------------------------------------------------------------------- |
3977 void CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL( CFSMailMessage& aMessagePtr, |
3977 void CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL( CFSMailMessage& aMessagePtr, |
3978 TFetchedContentType aFetchedContentType ) |
3978 TFetchedContentType aFetchedContentType ) |
3979 { |
3979 { |
3980 FUNC_LOG; |
3980 FUNC_LOG; |
3981 if( aFetchedContentType == EMessagePlainTextBodyPart ) |
3981 if( aFetchedContentType == EMessagePlainTextBodyPart ) |
3982 { |
3982 { |
3983 CFSMailMessagePart* textPart = aMessagePtr.PlainTextBodyPartL(); |
3983 CFSMailMessagePart* textPart = aMessagePtr.PlainTextBodyPartL(); |
3984 CleanupStack::PushL( textPart ); |
3984 CleanupStack::PushL( textPart ); |
3985 TFSMailMsgId textPartId = textPart->GetPartId(); |
3985 TFSMailMsgId textPartId = textPart->GetPartId(); |
3986 iFetchingPlainTextMessageBody = ETrue; |
3986 iFetchingPlainTextMessageBody = ETrue; |
3987 iCurrentPlainTextBodyFetchRequestId = textPart->FetchMessagePartL( textPartId, *this, 0 ); |
3987 iCurrentPlainTextBodyFetchRequestId = textPart->FetchMessagePartL( textPartId, *this, 0 ); |
3988 CleanupStack::PopAndDestroy( textPart ); |
3988 CleanupStack::PopAndDestroy( textPart ); |
3989 } |
3989 } |
3990 else if( aFetchedContentType == EMessageHtmlBodyPart ) |
3990 else if( aFetchedContentType == EMessageHtmlBodyPart ) |
3991 { |
3991 { |
3992 CFSMailMessagePart* htmlPart = aMessagePtr.HtmlBodyPartL(); |
3992 CFSMailMessagePart* htmlPart = aMessagePtr.HtmlBodyPartL(); |
3993 CleanupStack::PushL( htmlPart ); |
3993 CleanupStack::PushL( htmlPart ); |
3994 TFSMailMsgId htmlPartId = htmlPart->GetPartId(); |
3994 TFSMailMsgId htmlPartId = htmlPart->GetPartId(); |
3995 iFetchingHtmlMessageBody = ETrue; |
3995 iFetchingHtmlMessageBody = ETrue; |
3996 iCurrentHtmlBodyFetchRequestId = htmlPart->FetchMessagePartL( htmlPartId, *this, 0 ); |
3996 iCurrentHtmlBodyFetchRequestId = htmlPart->FetchMessagePartL( htmlPartId, *this, 0 ); |
3997 CleanupStack::PopAndDestroy( htmlPart ); |
3997 CleanupStack::PopAndDestroy( htmlPart ); |
3998 } |
3998 } |
3999 else if( aFetchedContentType == EMessageStructure ) |
3999 else if( aFetchedContentType == EMessageStructure ) |
4000 { |
4000 { |
4001 StartFetchingMessageStructureL( aMessagePtr ); |
4001 StartFetchingMessageStructureL( aMessagePtr ); |
4002 } |
4002 } |
4003 else |
4003 else |
4004 { |
4004 { |
4005 User::Leave( KErrNotSupported ); |
4005 User::Leave( KErrNotSupported ); |
4006 } |
4006 } |
4007 } |
4007 } |
4008 |
4008 |
4009 // ----------------------------------------------------------------------------- |
4009 // ----------------------------------------------------------------------------- |
4010 // CFSEmailUiMailViewerVisualiser::CancelFetchings |
4010 // CFSEmailUiMailViewerVisualiser::CancelFetchings |
4011 // ----------------------------------------------------------------------------- |
4011 // ----------------------------------------------------------------------------- |
4012 void CFSEmailUiMailViewerVisualiser::CancelFetchings() |
4012 void CFSEmailUiMailViewerVisualiser::CancelFetchings() |
4013 { |
4013 { |
4014 FUNC_LOG; |
4014 FUNC_LOG; |
4015 if( iFetchingPlainTextMessageBody ) |
4015 if( iFetchingPlainTextMessageBody ) |
4016 { |
4016 { |
4017 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentPlainTextBodyFetchRequestId ) ); |
4017 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentPlainTextBodyFetchRequestId ) ); |
4018 iFetchingPlainTextMessageBody = EFalse; |
4018 iFetchingPlainTextMessageBody = EFalse; |
4019 } |
4019 } |
4020 if( iFetchingHtmlMessageBody ) |
4020 if( iFetchingHtmlMessageBody ) |
4021 { |
4021 { |
4022 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentHtmlBodyFetchRequestId ) ); |
4022 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentHtmlBodyFetchRequestId ) ); |
4023 iFetchingHtmlMessageBody = EFalse; |
4023 iFetchingHtmlMessageBody = EFalse; |
4024 } |
4024 } |
4025 if( iFetchingMessageStructure ) |
4025 if( iFetchingMessageStructure ) |
4026 { |
4026 { |
4027 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentStructureFetchRequestId ) ); |
4027 TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentStructureFetchRequestId ) ); |
4028 iFetchingMessageStructure = EFalse; |
4028 iFetchingMessageStructure = EFalse; |
4029 } |
4029 } |
4030 iAsyncProcessComplete = ETrue; |
4030 iAsyncProcessComplete = ETrue; |
4031 //<cmail> |
4031 //<cmail> |
4032 if(iWaitDialog && iDialogNotDismissed) |
4032 if(iWaitDialog && iDialogNotDismissed) |
4033 TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog |
4033 TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog |
4034 //</cmail> |
4034 //</cmail> |
4035 } |
4035 } |
4036 |
4036 |
4037 // ----------------------------------------------------------------------------- |
4037 // ----------------------------------------------------------------------------- |
4038 // CFSEmailUiMailViewerVisualiser::MessageStructureKnownL |
4038 // CFSEmailUiMailViewerVisualiser::MessageStructureKnownL |
4039 // ----------------------------------------------------------------------------- |
4039 // ----------------------------------------------------------------------------- |
4040 TBool CFSEmailUiMailViewerVisualiser::MessageStructureKnown( CFSMailMessage& aMsg ) const |
4040 TBool CFSEmailUiMailViewerVisualiser::MessageStructureKnown( CFSMailMessage& aMsg ) const |
4041 { |
4041 { |
4042 FUNC_LOG; |
4042 FUNC_LOG; |
4043 return TFsEmailUiUtility::IsMessageStructureKnown( aMsg ); |
4043 return TFsEmailUiUtility::IsMessageStructureKnown( aMsg ); |
4044 } |
4044 } |
4045 |
4045 |
4046 // ----------------------------------------------------------------------------- |
4046 // ----------------------------------------------------------------------------- |
4047 // CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL |
4047 // CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL |
4048 // ----------------------------------------------------------------------------- |
4048 // ----------------------------------------------------------------------------- |
4049 void CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL( CFSMailMessage& aMsg ) |
4049 void CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL( CFSMailMessage& aMsg ) |
4050 { |
4050 { |
4051 FUNC_LOG; |
4051 FUNC_LOG; |
4052 TFSMailMsgId currentMailboxId = aMsg.GetMailBoxId(); |
4052 TFSMailMsgId currentMailboxId = aMsg.GetMailBoxId(); |
4053 TFSMailMsgId currentMessageFolderId = aMsg.GetFolderId(); |
4053 TFSMailMsgId currentMessageFolderId = aMsg.GetFolderId(); |
4054 CFSMailFolder* currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( currentMailboxId, currentMessageFolderId ); |
4054 CFSMailFolder* currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( currentMailboxId, currentMessageFolderId ); |
4055 CleanupStack::PushL( currentFolder ); |
4055 CleanupStack::PushL( currentFolder ); |
4056 RArray<TFSMailMsgId> messageIds; |
4056 RArray<TFSMailMsgId> messageIds; |
4057 CleanupClosePushL( messageIds ); |
4057 CleanupClosePushL( messageIds ); |
4058 messageIds.Append( aMsg.GetMessageId() ); |
4058 messageIds.Append( aMsg.GetMessageId() ); |
4059 iFetchingMessageStructure = ETrue; |
4059 iFetchingMessageStructure = ETrue; |
4060 iCurrentStructureFetchRequestId = currentFolder->FetchMessagesL( messageIds, EFSMsgDataStructure, *this ); |
4060 iCurrentStructureFetchRequestId = currentFolder->FetchMessagesL( messageIds, EFSMsgDataStructure, *this ); |
4061 CleanupStack::PopAndDestroy( &messageIds ); |
4061 CleanupStack::PopAndDestroy( &messageIds ); |
4062 CleanupStack::PopAndDestroy( currentFolder ); |
4062 CleanupStack::PopAndDestroy( currentFolder ); |
4063 } |
4063 } |
4064 |
4064 |
4065 // ----------------------------------------------------------------------------- |
4065 // ----------------------------------------------------------------------------- |
4066 // CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL |
4066 // CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL |
4067 // ----------------------------------------------------------------------------- |
4067 // ----------------------------------------------------------------------------- |
4068 void CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL( TFetchedContentType aFetchedContentType ) |
4068 void CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL( TFetchedContentType aFetchedContentType ) |
4069 { |
4069 { |
4070 FUNC_LOG; |
4070 FUNC_LOG; |
4071 iAsyncProcessComplete = EFalse; |
4071 iAsyncProcessComplete = EFalse; |
4072 iFetchingAlready = EFalse; |
4072 iFetchingAlready = EFalse; |
4073 iStartAsyncFetchType = aFetchedContentType; |
4073 iStartAsyncFetchType = aFetchedContentType; |
4074 //<cmail> in cmail we are using different wait dialog, since this wrapper dialog gives |
4074 //<cmail> in cmail we are using different wait dialog, since this wrapper dialog gives |
4690 else |
4690 else |
4691 { |
4691 { |
4692 iIBServiceHandler->ExecuteServiceCmdL( KAiwCmdView, |
4692 iIBServiceHandler->ExecuteServiceCmdL( KAiwCmdView, |
4693 paramList, iIBServiceHandler->OutParamListL() ); |
4693 paramList, iIBServiceHandler->OutParamListL() ); |
4694 } |
4694 } |
4695 CleanupStack::PopAndDestroy( eightBitUrl ); |
4695 CleanupStack::PopAndDestroy( eightBitUrl ); |
4696 CleanupStack::PopAndDestroy( intranetUrl ); |
4696 CleanupStack::PopAndDestroy( intranetUrl ); |
4697 } |
4697 } |
4698 } |
4698 } |
4699 |
4699 |
4700 // ----------------------------------------------------------------------------- |
4700 // ----------------------------------------------------------------------------- |
4701 // CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL |
4701 // CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL |
4702 // ----------------------------------------------------------------------------- |
4702 // ----------------------------------------------------------------------------- |
4703 void CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL( |
4703 void CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL( |
4704 TBool aRead, TBool aCmdFromMrui ) |
4704 TBool aRead, TBool aCmdFromMrui ) |
4705 { |
4705 { |
4706 FUNC_LOG; |
4706 FUNC_LOG; |
4707 if ( iMessage && !iEmbeddedMessageMode ) |
4707 if ( iMessage && !iEmbeddedMessageMode ) |
4708 { |
4708 { |
4709 if ( aRead ) |
4709 if ( aRead ) |
4710 { |
4710 { |
4711 // Send flags, local and server |
4711 // Send flags, local and server |
4712 iMessage->SetFlag( EFSMsgFlag_Read ); |
4712 iMessage->SetFlag( EFSMsgFlag_Read ); |
4713 } |
4713 } |
4714 else |
4714 else |
4715 { |
4715 { |
4716 // Send flags, local and server |
4716 // Send flags, local and server |
4717 iMessage->ResetFlag( EFSMsgFlag_Read ); |
4717 iMessage->ResetFlag( EFSMsgFlag_Read ); |
4718 } |
4718 } |
4719 iMessage->SaveMessageL(); // Save read status |
4719 iMessage->SaveMessageL(); // Save read status |
4720 SendEventToAppUiL( TFSEventMailChanged ); |
4720 SendEventToAppUiL( TFSEventMailChanged ); |
4721 |
4721 |
4722 if ( !aCmdFromMrui && iViewerRichText && iTextViewer ) |
4722 if ( !aCmdFromMrui && iViewerRichText && iTextViewer ) |
4723 { |
4723 { |
4724 iViewerRichText->UpdateIconL( |
4724 iViewerRichText->UpdateIconL( |
4725 CFSEmailUiMailViewerRichText::EViewerEmailStatus ); |
4725 CFSEmailUiMailViewerRichText::EViewerEmailStatus ); |
4726 TInt iconLine = iViewerRichText->EmailStatusIconLine(); |
4726 TInt iconLine = iViewerRichText->EmailStatusIconLine(); |
4727 iTextViewer->ReloadPicturesL( iconLine ); |
4727 iTextViewer->ReloadPicturesL( iconLine ); |
4728 } |
4728 } |
4729 } |
4729 } |
4730 } |
4730 } |
4731 |
4731 |
4732 // ----------------------------------------------------------------------------- |
4732 // ----------------------------------------------------------------------------- |
4733 // CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL |
4733 // CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL |
4734 // ----------------------------------------------------------------------------- |
4734 // ----------------------------------------------------------------------------- |
4735 void CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL( CFindItemEngine::SFoundItem& aHotSpot ) |
4735 void CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL( CFindItemEngine::SFoundItem& aHotSpot ) |
4736 { |
4736 { |
4737 FUNC_LOG; |
4737 FUNC_LOG; |
4738 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchURLBin || |
4738 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchURLBin || |
4739 aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) // Scheme is needed also |
4739 aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) // Scheme is needed also |
4740 { |
4740 { |
4741 // use browser launcher API here |
4741 // use browser launcher API here |
4742 HBufC* urlToOpen = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4742 HBufC* urlToOpen = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4743 // Check if the address is rtsp url and send it media player |
4743 // Check if the address is rtsp url and send it media player |
4744 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme && |
4744 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme && |
4745 urlToOpen->FindC( KRtspUrlPrefix ) == 0 ) |
4745 urlToOpen->FindC( KRtspUrlPrefix ) == 0 ) |
4746 { |
4746 { |
4747 RApaLsSession appArcSession; |
4747 RApaLsSession appArcSession; |
4748 User::LeaveIfError( appArcSession.Connect() ); |
4748 User::LeaveIfError( appArcSession.Connect() ); |
4749 TThreadId id; |
4749 TThreadId id; |
4750 appArcSession.StartDocument( urlToOpen->Des(), KUidMediaPlayer , id ); |
4750 appArcSession.StartDocument( urlToOpen->Des(), KUidMediaPlayer , id ); |
4751 appArcSession.Close(); |
4751 appArcSession.Close(); |
4752 } |
4752 } |
4753 else |
4753 else |
4754 { |
4754 { |
4755 // Check wheter the url text has some prefix (http, https, ftp, etc.). |
4755 // Check wheter the url text has some prefix (http, https, ftp, etc.). |
4756 // If no prefix found, try with the default prefix http. |
4756 // If no prefix found, try with the default prefix http. |
4757 TInt urlPos = urlToOpen->Find( KUrlPrefixIdentifier ); |
4757 TInt urlPos = urlToOpen->Find( KUrlPrefixIdentifier ); |
4758 if ( urlPos == KErrNotFound ) |
4758 if ( urlPos == KErrNotFound ) |
4759 { |
4759 { |
4760 HBufC* newBuf = urlToOpen->ReAllocL( urlToOpen->Length() + KHttpUrlPrefix().Length() ); |
4760 HBufC* newBuf = urlToOpen->ReAllocL( urlToOpen->Length() + KHttpUrlPrefix().Length() ); |
4761 CleanupStack::Pop( urlToOpen ); |
4761 CleanupStack::Pop( urlToOpen ); |
4762 urlToOpen = newBuf; |
4762 urlToOpen = newBuf; |
4763 CleanupStack::PushL( urlToOpen ); |
4763 CleanupStack::PushL( urlToOpen ); |
4764 TPtr urlToOpenPtr = urlToOpen->Des(); |
4764 TPtr urlToOpenPtr = urlToOpen->Des(); |
4765 urlToOpenPtr.Insert( 0, KHttpUrlPrefix ); |
4765 urlToOpenPtr.Insert( 0, KHttpUrlPrefix ); |
4766 } |
4766 } |
4767 |
4767 |
4768 // Use scheme handler to launch the browser as a stand alone application |
4768 // Use scheme handler to launch the browser as a stand alone application |
4769 CSchemeHandler* handler = CSchemeHandler::NewL( *urlToOpen ); |
4769 CSchemeHandler* handler = CSchemeHandler::NewL( *urlToOpen ); |
4770 CleanupStack::PushL( handler ); |
4770 CleanupStack::PushL( handler ); |
4771 handler->HandleUrlStandaloneL(); |
4771 handler->HandleUrlStandaloneL(); |
4772 CleanupStack::PopAndDestroy( handler ); |
4772 CleanupStack::PopAndDestroy( handler ); |
4773 } |
4773 } |
4774 |
4774 |
4775 CleanupStack::PopAndDestroy( urlToOpen ); |
4775 CleanupStack::PopAndDestroy( urlToOpen ); |
4776 } |
4776 } |
4777 } |
4777 } |
4778 |
4778 |
4779 // ----------------------------------------------------------------------------- |
4779 // ----------------------------------------------------------------------------- |
4780 // CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL |
4780 // CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL |
4781 // ----------------------------------------------------------------------------- |
4781 // ----------------------------------------------------------------------------- |
4782 void CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL( CFindItemEngine::SFoundItem& aHotSpot ) |
4782 void CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL( CFindItemEngine::SFoundItem& aHotSpot ) |
4783 { |
4783 { |
4784 FUNC_LOG; |
4784 FUNC_LOG; |
4785 |
4785 |
4786 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
4786 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) |
4787 { |
4787 { |
4788 HBufC* phoneNumber = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4788 HBufC* phoneNumber = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4789 TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( |
4789 TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( |
4790 R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *phoneNumber ); |
4790 R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *phoneNumber ); |
4791 if ( answer ) |
4791 if ( answer ) |
4792 { |
4792 { |
4793 TPtr numberPtr = phoneNumber->Des(); |
4793 TPtr numberPtr = phoneNumber->Des(); |
4794 CommonPhoneParser::ParsePhoneNumber( numberPtr, |
4794 CommonPhoneParser::ParsePhoneNumber( numberPtr, |
4795 CommonPhoneParser::EPhoneClientNumber); |
4795 CommonPhoneParser::EPhoneClientNumber); |
4796 |
4796 |
4797 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *phoneNumber ); |
4797 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *phoneNumber ); |
4798 } |
4798 } |
4799 CleanupStack::PopAndDestroy( phoneNumber ); |
4799 CleanupStack::PopAndDestroy( phoneNumber ); |
4800 } |
4800 } |
4801 else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
4801 else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
4802 { |
4802 { |
4803 TBool voipCall( EFalse ); |
4803 TBool voipCall( EFalse ); |
4804 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4804 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4805 // Strip scheme prefix text if found |
4805 // Strip scheme prefix text if found |
4806 if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) |
4806 if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) |
4807 { |
4807 { |
4808 schemeText->Des().Delete( 0, KCallPrefix().Length() ); |
4808 schemeText->Des().Delete( 0, KCallPrefix().Length() ); |
4809 } |
4809 } |
4810 else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) |
4810 else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) |
4811 { |
4811 { |
4812 schemeText->Des().Delete( 0, KTelPrefix().Length() ); |
4812 schemeText->Des().Delete( 0, KTelPrefix().Length() ); |
4813 } |
4813 } |
4814 else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) |
4814 else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) |
4815 { |
4815 { |
4816 schemeText->Des().Delete( 0, KSmsPrefix().Length() ); |
4816 schemeText->Des().Delete( 0, KSmsPrefix().Length() ); |
4817 } |
4817 } |
4818 else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) |
4818 else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) |
4819 { |
4819 { |
4820 schemeText->Des().Delete( 0, KMmsPrefix().Length() ); |
4820 schemeText->Des().Delete( 0, KMmsPrefix().Length() ); |
4821 } |
4821 } |
4822 else if ( schemeText && schemeText->FindC( KVoipPrefix ) == 0 ) |
4822 else if ( schemeText && schemeText->FindC( KVoipPrefix ) == 0 ) |
4823 { |
4823 { |
4824 voipCall = ETrue; |
4824 voipCall = ETrue; |
4825 schemeText->Des().Delete( 0, KVoipPrefix().Length() ); |
4825 schemeText->Des().Delete( 0, KVoipPrefix().Length() ); |
4826 } |
4826 } |
4827 |
4827 |
4828 TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( |
4828 TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( |
4829 R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *schemeText ); |
4829 R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *schemeText ); |
4830 if ( answer ) |
4830 if ( answer ) |
4831 { |
4831 { |
4832 if ( !voipCall ) |
4832 if ( !voipCall ) |
4833 { |
4833 { |
4834 // use common phone parser for other than voip numbers |
4834 // use common phone parser for other than voip numbers |
4835 TPtr numberPtr = schemeText->Des(); |
4835 TPtr numberPtr = schemeText->Des(); |
4836 CommonPhoneParser::ParsePhoneNumber( numberPtr, |
4836 CommonPhoneParser::ParsePhoneNumber( numberPtr, |
4837 CommonPhoneParser::EPhoneClientNumber ); |
4837 CommonPhoneParser::EPhoneClientNumber ); |
4838 } |
4838 } |
4839 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *schemeText, voipCall ); |
4839 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *schemeText, voipCall ); |
4840 } |
4840 } |
4841 CleanupStack::PopAndDestroy( schemeText ); |
4841 CleanupStack::PopAndDestroy( schemeText ); |
4842 } |
4842 } |
4843 } |
4843 } |
4844 |
4844 |
4845 // ----------------------------------------------------------------------------- |
4845 // ----------------------------------------------------------------------------- |
4846 // CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL |
4846 // CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL |
4847 // ----------------------------------------------------------------------------- |
4847 // ----------------------------------------------------------------------------- |
4848 void CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL( CFindItemEngine::SFoundItem& aHotSpot ) |
4848 void CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL( CFindItemEngine::SFoundItem& aHotSpot ) |
4849 { |
4849 { |
4850 FUNC_LOG; |
4850 FUNC_LOG; |
4851 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
4851 if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) |
4852 { |
4852 { |
4853 delete iNewMailTempAddress; iNewMailTempAddress = NULL; |
4853 delete iNewMailTempAddress; iNewMailTempAddress = NULL; |
4854 iNewMailTempAddress = CFSMailAddress::NewL(); |
4854 iNewMailTempAddress = CFSMailAddress::NewL(); |
4855 HBufC* mailAddress = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4855 HBufC* mailAddress = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4856 iNewMailTempAddress->SetEmailAddress( *mailAddress ); |
4856 iNewMailTempAddress->SetEmailAddress( *mailAddress ); |
4857 CleanupStack::PopAndDestroy( mailAddress ); |
4857 CleanupStack::PopAndDestroy( mailAddress ); |
4858 iAppUi.LaunchEditorL( iNewMailTempAddress ); |
4858 iAppUi.LaunchEditorL( iNewMailTempAddress ); |
4859 } |
4859 } |
4860 else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
4860 else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) |
4861 { |
4861 { |
4862 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4862 HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); |
4863 if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0) |
4863 if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0) |
4864 { |
4864 { |
4865 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
4865 schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); |
4866 delete iNewMailTempAddress; iNewMailTempAddress = NULL; |
4866 delete iNewMailTempAddress; iNewMailTempAddress = NULL; |
4867 iNewMailTempAddress = CFSMailAddress::NewL(); |
4867 iNewMailTempAddress = CFSMailAddress::NewL(); |
4868 iNewMailTempAddress->SetEmailAddress( *schemeText ); |
4868 iNewMailTempAddress->SetEmailAddress( *schemeText ); |
4869 iAppUi.LaunchEditorL( iNewMailTempAddress ); |
4869 iAppUi.LaunchEditorL( iNewMailTempAddress ); |
4870 } |
4870 } |
4871 CleanupStack::PopAndDestroy( schemeText ); |
4871 CleanupStack::PopAndDestroy( schemeText ); |
4872 } |
4872 } |
4873 } |
4873 } |
4874 |
4874 |
4875 void CFSEmailUiMailViewerVisualiser::SaveEmailAsContactL( |
4875 void CFSEmailUiMailViewerVisualiser::SaveEmailAsContactL( |
4876 const TDesC& aEmailAddress ) |
4876 const TDesC& aEmailAddress ) |
4877 { |
4877 { |
4878 FUNC_LOG; |
4878 FUNC_LOG; |
4879 TAddToContactsType type; |
4879 TAddToContactsType type; |
4880 // Query to "update existing" or "Create new" |
4880 // Query to "update existing" or "Create new" |
4881 // --> EFALSE = user chose "cancel" |
4881 // --> EFALSE = user chose "cancel" |
4882 if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> |
4882 if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> |
4883 AddtoContactsQueryL( type ) ) |
4883 AddtoContactsQueryL( type ) ) |
4884 { |
4884 { |
4885 // Create buffer and strip scheme data such as mailto: and call: |
4885 // Create buffer and strip scheme data such as mailto: and call: |
4886 HBufC* textData = aEmailAddress.AllocLC(); |
4886 HBufC* textData = aEmailAddress.AllocLC(); |
4887 if ( textData->FindC( KMailtoPrefix ) == 0 ) |
4887 if ( textData->FindC( KMailtoPrefix ) == 0 ) |
4888 { |
4888 { |
4889 textData->Des().Delete( 0, KMailtoPrefix().Length() ); |
4889 textData->Des().Delete( 0, KMailtoPrefix().Length() ); |
4890 } |
4890 } |
4891 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( |
4891 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( |
4892 *textData, EContactUpdateEmail, type, this ); |
4892 *textData, EContactUpdateEmail, type, this ); |
4893 CleanupStack::PopAndDestroy( textData ); |
4893 CleanupStack::PopAndDestroy( textData ); |
4894 } |
4894 } |
4895 } |
4895 } |
4896 |
4896 |
4897 void CFSEmailUiMailViewerVisualiser::SavePhoneNumberAsContactL( |
4897 void CFSEmailUiMailViewerVisualiser::SavePhoneNumberAsContactL( |
4898 const TDesC& aPhoneNumber ) |
4898 const TDesC& aPhoneNumber ) |
4899 { |
4899 { |
4900 FUNC_LOG; |
4900 FUNC_LOG; |
4901 TAddToContactsType type; |
4901 TAddToContactsType type; |
4902 // Query to "update existing" or "Create new" |
4902 // Query to "update existing" or "Create new" |
4903 // --> EFALSE = user chose "cancel" |
4903 // --> EFALSE = user chose "cancel" |
4904 if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> |
4904 if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> |
4905 AddtoContactsQueryL( type ) ) |
4905 AddtoContactsQueryL( type ) ) |
4906 { |
4906 { |
4907 // Create buffer and strip scheme data such as mailto: and call: |
4907 // Create buffer and strip scheme data such as mailto: and call: |
4908 HBufC* textData = aPhoneNumber.AllocLC(); |
4908 HBufC* textData = aPhoneNumber.AllocLC(); |
4909 // Strip scheme prefix text if found |
4909 // Strip scheme prefix text if found |
4910 if ( textData && textData->FindC( KCallPrefix ) == 0 ) |
4910 if ( textData && textData->FindC( KCallPrefix ) == 0 ) |
4911 { |
4911 { |
4912 textData->Des().Delete( 0, KCallPrefix().Length() ); |
4912 textData->Des().Delete( 0, KCallPrefix().Length() ); |
4913 } |
4913 } |
4914 else if ( textData && textData->FindC( KTelPrefix ) == 0 ) |
4914 else if ( textData && textData->FindC( KTelPrefix ) == 0 ) |
4915 { |
4915 { |
4916 textData->Des().Delete( 0, KTelPrefix().Length() ); |
4916 textData->Des().Delete( 0, KTelPrefix().Length() ); |
4917 } |
4917 } |
4918 else if ( textData && textData->FindC( KSmsPrefix ) == 0 ) |
4918 else if ( textData && textData->FindC( KSmsPrefix ) == 0 ) |
4919 { |
4919 { |
4920 textData->Des().Delete( 0, KSmsPrefix().Length() ); |
4920 textData->Des().Delete( 0, KSmsPrefix().Length() ); |
4921 } |
4921 } |
4922 else if ( textData && textData->FindC( KMmsPrefix ) == 0 ) |
4922 else if ( textData && textData->FindC( KMmsPrefix ) == 0 ) |
4923 { |
4923 { |
4924 textData->Des().Delete( 0, KMmsPrefix().Length() ); |
4924 textData->Des().Delete( 0, KMmsPrefix().Length() ); |
4925 } |
4925 } |
4926 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( |
4926 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( |
4927 *textData, EContactUpdateNumber, type, this ); |
4927 *textData, EContactUpdateNumber, type, this ); |
4928 CleanupStack::PopAndDestroy( textData ); |
4928 CleanupStack::PopAndDestroy( textData ); |
4929 } |
4929 } |
4930 } |
4930 } |
4931 |
4931 |
4932 |
4932 |
4933 void CFSEmailUiMailViewerVisualiser::FlagselectionCompleteL( TInt aSelection ) |
4933 void CFSEmailUiMailViewerVisualiser::FlagselectionCompleteL( TInt aSelection ) |
4934 { |
4934 { |
4935 FUNC_LOG; |
4935 FUNC_LOG; |
4936 // Set message follow up flag |
4936 // Set message follow up flag |
4937 if ( iMessage && aSelection != KErrNotFound ) |
4937 if ( iMessage && aSelection != KErrNotFound ) |
4938 { |
4938 { |
4939 switch ( aSelection ) |
4939 switch ( aSelection ) |
4940 { |
4940 { |
4941 case EFollowUp: |
4941 case EFollowUp: |
4942 { |
4942 { |
4943 iMessage->SetFlag( EFSMsgFlag_FollowUp ); |
4943 iMessage->SetFlag( EFSMsgFlag_FollowUp ); |
4944 iMessage->ResetFlag( EFSMsgFlag_FollowUpComplete ); |
4944 iMessage->ResetFlag( EFSMsgFlag_FollowUpComplete ); |
4945 iMessage->SaveMessageL(); |
4945 iMessage->SaveMessageL(); |
4946 } |
4946 } |
4947 break; |
4947 break; |
4948 case EFollowUpComplete: |
4948 case EFollowUpComplete: |
4949 { |
4949 { |
4950 iMessage->SetFlag( EFSMsgFlag_FollowUpComplete ); |
4950 iMessage->SetFlag( EFSMsgFlag_FollowUpComplete ); |
4951 iMessage->ResetFlag( EFSMsgFlag_FollowUp ); |
4951 iMessage->ResetFlag( EFSMsgFlag_FollowUp ); |
4952 iMessage->SaveMessageL(); |
4952 iMessage->SaveMessageL(); |
4953 } |
4953 } |
4954 break; |
4954 break; |
4955 case EFollowUpClear: |
4955 case EFollowUpClear: |
4956 { |
4956 { |
4957 iMessage->ResetFlag( EFSMsgFlag_FollowUp | EFSMsgFlag_FollowUpComplete ); |
4957 iMessage->ResetFlag( EFSMsgFlag_FollowUp | EFSMsgFlag_FollowUpComplete ); |
4958 iMessage->SaveMessageL(); |
4958 iMessage->SaveMessageL(); |
4959 } |
4959 } |
4960 break; |
4960 break; |
4961 default: |
4961 default: |
4962 break; |
4962 break; |
4963 } |
4963 } |
4964 } |
4964 } |
4965 } |
4965 } |
4966 |
4966 |
4967 |
4967 |
4968 void CFSEmailUiMailViewerVisualiser::SetMailboxNameToStatusPaneL() |
4968 void CFSEmailUiMailViewerVisualiser::SetMailboxNameToStatusPaneL() |
4969 { |
4969 { |
4970 FUNC_LOG; |
4970 FUNC_LOG; |
4971 iAppUi.SetActiveMailboxNameToStatusPaneL(); |
4971 iAppUi.SetActiveMailboxNameToStatusPaneL(); |
4972 } |
4972 } |
4973 |
4973 |
4974 void CFSEmailUiMailViewerVisualiser::GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const |
4974 void CFSEmailUiMailViewerVisualiser::GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const |
4975 { |
4975 { |
4976 if ( iTextViewer ) |
4976 if ( iTextViewer ) |
4977 { |
4977 { |