572 CleanupStack::Pop( cbSelectorBrush ); // ownership transferred to control bar |
572 CleanupStack::Pop( cbSelectorBrush ); // ownership transferred to control bar |
573 |
573 |
574 iNewEmailText = StringLoader::LoadL( R_COMMAND_AREA_NEW_EMAIL ); |
574 iNewEmailText = StringLoader::LoadL( R_COMMAND_AREA_NEW_EMAIL ); |
575 |
575 |
576 // Set menu, mark and background icons |
576 // Set menu, mark and background icons |
577 iMailTreeListVisualizer->SetMarkOnIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOnIcon ) ); |
577 iMailTreeListVisualizer->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) ); |
578 iMailTreeListVisualizer->SetMarkOffIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOffIcon ) ); |
|
579 iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); |
578 iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); |
580 iMailList->AddObserverL( *this ); |
579 iMailList->AddObserverL( *this ); |
581 iMailList->AddObserverL( *iTouchManager ); |
580 iMailList->AddObserverL( *iTouchManager ); |
582 // Initializing the default stylus long tap popup menu |
581 // Initializing the default stylus long tap popup menu |
583 if( !iStylusPopUpMenu ) |
582 if( !iStylusPopUpMenu ) |
756 // --------------------------------------------------------------------------- |
755 // --------------------------------------------------------------------------- |
757 // |
756 // |
758 void CFSEmailUiMailListVisualiser::UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray<CFSMailMessage>& aMessages) |
757 void CFSEmailUiMailListVisualiser::UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray<CFSMailMessage>& aMessages) |
759 { |
758 { |
760 FUNC_LOG; |
759 FUNC_LOG; |
761 |
|
762 const TInt itemsInModel(iModel->Count()); |
760 const TInt itemsInModel(iModel->Count()); |
763 CreateModelItemsL(aMessages); |
761 |
764 RefreshListItemsL(aParentId, itemsInModel, iModel->Count()); |
762 // cleanup items that are already found in model |
|
763 for (TInt i = 0; i < aMessages.Count(); ) |
|
764 { |
|
765 if ( iModel->ContainsItem( *aMessages[i] ) ) |
|
766 { |
|
767 delete aMessages[i]; |
|
768 aMessages.Remove(i); |
|
769 } |
|
770 else |
|
771 { |
|
772 i++; |
|
773 } |
|
774 } |
|
775 |
|
776 if (aMessages.Count() > 0) |
|
777 { |
|
778 CreateModelItemsL(aMessages); |
|
779 RefreshListItemsL(aParentId, itemsInModel, iModel->Count()); |
|
780 } |
765 } |
781 } |
766 |
782 |
767 // --------------------------------------------------------------------------- |
783 // --------------------------------------------------------------------------- |
768 // @see CMailListModelUpdater::MObserver::UpdateCompleteL |
784 // @see CMailListModelUpdater::MObserver::UpdateCompleteL |
769 // --------------------------------------------------------------------------- |
785 // --------------------------------------------------------------------------- |
1276 break; |
1292 break; |
1277 } |
1293 } |
1278 case ESortRequested: |
1294 case ESortRequested: |
1279 { |
1295 { |
1280 if( !iNewMailTimer->IsActive() && iNewMailTimer->iStatus != KErrInUse ) |
1296 if( !iNewMailTimer->IsActive() && iNewMailTimer->iStatus != KErrInUse ) |
1281 { |
1297 { |
1282 // Size sorting does not use nodes, so disable those, otherwise check from CR |
1298 // Size sorting does not use nodes, so disable those, otherwise check from CR |
1283 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
1299 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
1284 SetSortButtonIconL(); |
1300 SetSortButtonTextAndIconL(); |
1285 |
1301 |
1286 iFocusedControl = EControlBarComponent; |
1302 iFocusedControl = EControlBarComponent; |
1287 iMailList->SetFocusedL( EFalse ); |
1303 iMailList->SetFocusedL( EFalse ); |
1288 iControlBarControl->SetFocusByIdL( iSortButtonId ); |
1304 iControlBarControl->SetFocusByIdL( iSortButtonId ); |
1289 |
1305 |
1385 iNewMailTimer->iStatus = KErrNone; |
1395 iNewMailTimer->iStatus = KErrNone; |
1386 iNewMailTimer->Stop(); |
1396 iNewMailTimer->Stop(); |
1387 return; // leave method |
1397 return; // leave method |
1388 } |
1398 } |
1389 |
1399 |
1390 CFSMailMessage* msgPtr(NULL); |
1400 CFSMailMessage* msgPtr = mailClient->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
1391 TRAPD( err, msgPtr = mailClient->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
|
1392 iMailFolder->GetFolderId(), |
1401 iMailFolder->GetFolderId(), |
1393 iNewMailIds[ 0 ], |
1402 iNewMailIds[ 0 ], |
1394 EFSMsgDataEnvelope ) ); |
1403 EFSMsgDataEnvelope ); |
1395 if ( KErrNone != err ) |
|
1396 { |
|
1397 iNewMailTimer->iStatus = KErrNone; |
|
1398 User::Leave(err); |
|
1399 } |
|
1400 if ( msgPtr != NULL ) |
1404 if ( msgPtr != NULL ) |
1401 { |
1405 { |
1402 __ASSERT_DEBUG( FolderId() == msgPtr->GetFolderId(), User::Invariant() ); |
1406 __ASSERT_DEBUG( FolderId() == msgPtr->GetFolderId(), User::Invariant() ); |
1403 CleanupStack::PushL( msgPtr ); |
1407 CleanupStack::PushL( msgPtr ); |
1404 //first item - show scrollbar |
1408 //first item - show scrollbar |
1405 //last item - update scrollbar |
1409 //last item - update scrollbar |
1406 TBool allowRefresh = ( i == 0 || i == count - 1 ); |
1410 TBool allowRefresh = ( i == 0 || i == count - 1 ); |
1430 // --------------------------------------------------------------------------- |
1434 // --------------------------------------------------------------------------- |
1431 // |
1435 // |
1432 void CFSEmailUiMailListVisualiser::InsertNewMessageL( CFSMailMessage* aNewMessage, const TBool aAllowRefresh ) |
1436 void CFSEmailUiMailListVisualiser::InsertNewMessageL( CFSMailMessage* aNewMessage, const TBool aAllowRefresh ) |
1433 { |
1437 { |
1434 FUNC_LOG; |
1438 FUNC_LOG; |
|
1439 |
|
1440 // If item is already in model, just delete the pointer and return |
|
1441 if ( iModel->ContainsItem( *aNewMessage ) ) |
|
1442 { |
|
1443 delete aNewMessage; |
|
1444 return; |
|
1445 } |
|
1446 |
1435 // Use simple heuristic rule: if the first item is highlighted before the new |
1447 // Use simple heuristic rule: if the first item is highlighted before the new |
1436 // item is added, the highlight is forced to remain on the (possibly new) first |
1448 // item is added, the highlight is forced to remain on the (possibly new) first |
1437 // item. Otherwise the highligh stays on the same item as before. |
1449 // item. Otherwise the highligh stays on the same item as before. |
1438 TBool firstItemWasFocused = |
1450 TBool firstItemWasFocused = |
1439 ( iTreeItemArray.Count() && iTreeItemArray[0].iListItemId == iMailList->FocusedItem() ); |
1451 ( iTreeItemArray.Count() && iTreeItemArray[0].iListItemId == iMailList->FocusedItem() ); |
1654 TRAP_IGNORE( ExitMarkingModeL() ); |
1666 TRAP_IGNORE( ExitMarkingModeL() ); |
1655 } |
1667 } |
1656 } |
1668 } |
1657 |
1669 |
1658 iShowReplyAll = EFalse; |
1670 iShowReplyAll = EFalse; |
1659 TBool bDoFirstStartCalled( EFalse ); |
1671 |
1660 if ( !iFirstStartCompleted ) |
1672 if ( !iFirstStartCompleted ) |
1661 { |
1673 { |
1662 DoFirstStartL(); |
1674 DoFirstStartL(); |
1663 bDoFirstStartCalled = ETrue; |
1675 } |
1664 } |
|
1665 // set when editor was called so reset is needed i.e. here (Called by DoActivate) |
1676 // set when editor was called so reset is needed i.e. here (Called by DoActivate) |
1666 iMailOpened = EFalse; |
1677 iMailOpened = EFalse; |
1667 |
1678 |
1668 // Make sure that pending popup is not displayd |
1679 // Make sure that pending popup is not displayd |
1669 if ( iAppUi.FolderList().IsPopupShown() ) |
1680 if ( iAppUi.FolderList().IsPopupShown() ) |
1670 { |
1681 { |
1671 iAppUi.FolderList().HidePopupL(); |
1682 iAppUi.FolderList().HidePopupL(); |
1672 } |
1683 } |
1673 DisableMailList( EFalse ); |
1684 DisableMailList( EFalse ); |
1674 |
1685 |
1675 UpdateFolderAndMarkingModeTextsL(); |
|
1676 |
|
1677 // inform baseView if view entered with forward navigation |
1686 // inform baseView if view entered with forward navigation |
1678 TBool forwardNavigation = EFalse; |
1687 TBool forwardNavigation = EFalse; |
1679 if ( aCustomMessageId != KStartListReturnToPreviousFolder && |
1688 if ( aCustomMessageId != KStartListReturnToPreviousFolder && |
1680 aCustomMessageId != TUid::Uid(KMailSettingsReturnFromPluginSettings) ) |
1689 aCustomMessageId != TUid::Uid(KMailSettingsReturnFromPluginSettings) ) |
1681 { |
1690 { |
1692 TRect clientRect = iAppUi.ClientRect(); |
1701 TRect clientRect = iAppUi.ClientRect(); |
1693 iScreenAnchorLayout->SetSize( clientRect.Size() ); |
1702 iScreenAnchorLayout->SetSize( clientRect.Size() ); |
1694 SetMailListLayoutAnchors(); |
1703 SetMailListLayoutAnchors(); |
1695 //if the view is already active don't update the icons so they won't "blink" |
1704 //if the view is already active don't update the icons so they won't "blink" |
1696 //when the view is activated. |
1705 //when the view is activated. |
1697 if( !iThisViewActive && !iMarkingMode ) |
1706 if(!iThisViewActive) |
1698 { |
1707 { |
|
1708 ScaleControlBarL(); |
1699 |
1709 |
1700 ScaleControlBarL(); |
1710 // Set icons on toolbar |
1701 if ( !bDoFirstStartCalled ) // Don't set the icon if set by DoFirstStart() |
1711 iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon ); |
1702 { |
1712 iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); |
1703 // Set icons on toolbar |
1713 iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon ); |
1704 iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon ); |
1714 iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); |
1705 iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); |
1715 iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() ); |
1706 iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon ); |
1716 iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) ); |
1707 iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); |
1717 |
1708 iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() ); |
|
1709 iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) ); |
|
1710 } |
|
1711 SetListAndCtrlBarFocusL(); |
1718 SetListAndCtrlBarFocusL(); |
1712 } |
1719 } |
1713 |
1720 |
1714 FadeOut(EFalse); // we can show now CAlfVisuals from CurrentView (to show Folders before updating emails) |
1721 FadeOut(EFalse); // we can show now CAlfVisuals from CurrentView (to show Folders before updating emails) |
1715 |
1722 |
1874 { |
1881 { |
1875 iForceRefresh = EFalse; |
1882 iForceRefresh = EFalse; |
1876 // Set initial sort criteria when folder is changed |
1883 // Set initial sort criteria when folder is changed |
1877 iCurrentSortCriteria.iField = EFSMailSortByDate; |
1884 iCurrentSortCriteria.iField = EFSMailSortByDate; |
1878 iCurrentSortCriteria.iOrder = EFSMailDescending; |
1885 iCurrentSortCriteria.iOrder = EFSMailDescending; |
1879 SetSortButtonIconL(); |
1886 SetSortButtonTextAndIconL(); |
1880 |
1887 |
1881 SafeDelete(iMailFolder); |
1888 SafeDelete(iMailFolder); |
1882 TRAP_IGNORE( iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( |
1889 TRAP_IGNORE( iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( |
1883 activationData.iMailBoxId, activationData.iFolderId ) ); |
1890 activationData.iMailBoxId, activationData.iFolderId ) ); |
1884 if ( !iMailFolder ) |
1891 if ( !iMailFolder ) |
1889 } |
1896 } |
1890 // Safety, try to revert back to standard folder inbox |
1897 // Safety, try to revert back to standard folder inbox |
1891 TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox ); |
1898 TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox ); |
1892 iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( activationData.iMailBoxId, inboxId ); |
1899 iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( activationData.iMailBoxId, inboxId ); |
1893 } |
1900 } |
|
1901 HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); |
|
1902 iFolderListButton->SetTextL( *newFolderName ); |
|
1903 CleanupStack::PopAndDestroy( newFolderName ); |
1894 iMailList->SetFocusedItemL( KFsTreeNoneID ); |
1904 iMailList->SetFocusedItemL( KFsTreeNoneID ); |
1895 refreshState = EFullRefreshNeeded; |
1905 refreshState = EFullRefreshNeeded; |
1896 } |
1906 } |
1897 |
1907 |
1898 // Set mailbox name to status pane |
1908 // Set mailbox name to status pane |
1989 else |
1999 else |
1990 { |
2000 { |
1991 SetControlBarFocusedL(); |
2001 SetControlBarFocusedL(); |
1992 iControlBarControl->MakeSelectorVisible( iAppUi.IsFocusShown() ); |
2002 iControlBarControl->MakeSelectorVisible( iAppUi.IsFocusShown() ); |
1993 } |
2003 } |
|
2004 UpdateButtonTextsL(); |
1994 FocusVisibilityChange( iAppUi.IsFocusShown() ); |
2005 FocusVisibilityChange( iAppUi.IsFocusShown() ); |
1995 iAppUi.ShowTitlePaneConnectionStatus(); |
2006 iAppUi.ShowTitlePaneConnectionStatus(); |
1996 |
|
1997 // if timer stoped when quitting view then restart if more messages available |
|
1998 if ( iNewMailIds.Count() && ( ! iNewMailTimer->IsActive() ) && iSortState == ESortNone ) |
|
1999 { |
|
2000 iNewMailTimer->Start( KNewMailTimerDelay ); |
|
2001 } |
|
2002 |
|
2003 TIMESTAMP( "Message list view opened" ); |
2007 TIMESTAMP( "Message list view opened" ); |
2004 } // CFSEmailUiMailListVisualiser::ChildDoActivateL |
2008 } |
2005 |
2009 |
2006 // --------------------------------------------------------------------------- |
2010 // --------------------------------------------------------------------------- |
2007 // Sets status bar layout |
2011 // Sets status bar layout |
2008 // --------------------------------------------------------------------------- |
2012 // --------------------------------------------------------------------------- |
2009 // |
2013 // |
2218 // "Clear deleted folder" command is available only in Deleted folder |
2221 // "Clear deleted folder" command is available only in Deleted folder |
2219 if ( currentFolderType != EFSDeleted || !iModel->Count() ) |
2222 if ( currentFolderType != EFSDeleted || !iModel->Count() ) |
2220 { |
2223 { |
2221 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsEmptyDeleted, ETrue ); |
2224 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsEmptyDeleted, ETrue ); |
2222 } |
2225 } |
2223 |
2226 } |
2224 CConnectionStatusQueryExtension::TConnectionStatus connetionStatus; |
|
2225 iAppUi.GetConnectionStatusL( connetionStatus ); |
|
2226 if ( connetionStatus == CConnectionStatusQueryExtension::ESynchronizing ) |
|
2227 { |
|
2228 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); |
|
2229 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, EFalse ); |
|
2230 } |
|
2231 else |
|
2232 { |
|
2233 aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, EFalse ); |
|
2234 aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); |
|
2235 } |
|
2236 } |
|
2237 |
|
2238 // MAIN MENU *************************************************************************** |
2227 // MAIN MENU *************************************************************************** |
2239 |
2228 |
2240 |
2229 |
2241 // ACTIONS SUBMENU ********************************************************************* |
2230 // ACTIONS SUBMENU ********************************************************************* |
2242 if ( aResourceId == R_FSEMAILUI_MAILLIST_SUBMENU_MAIL_ACTIONS ) |
2231 if ( aResourceId == R_FSEMAILUI_MAILLIST_SUBMENU_MAIL_ACTIONS ) |
2538 // |
2527 // |
2539 // --------------------------------------------------------------------------- |
2528 // --------------------------------------------------------------------------- |
2540 // |
2529 // |
2541 void CFSEmailUiMailListVisualiser::ExitMarkingModeL() |
2530 void CFSEmailUiMailListVisualiser::ExitMarkingModeL() |
2542 { |
2531 { |
2543 FUNC_LOG; |
2532 FUNC_LOG; |
2544 iMarkingMode = EFalse; |
|
2545 // Hide marking mode text on the place of drop down menus |
2533 // Hide marking mode text on the place of drop down menus |
2546 UpdateFolderAndMarkingModeTextsL(); |
2534 RemoveMarkingModeTitleTextL(); |
2547 iMailList->SetMarkingModeL( EFalse ); |
2535 iMarkingMode = EFalse; |
2548 UnmarkAllItemsL(); |
2536 UnmarkAllItemsL(); |
2549 // Change softkeys back to normal |
2537 // Change softkeys back to normal |
2550 SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK ); |
2538 SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK ); |
2551 // Change options menu back to normal |
2539 // Change options menu back to normal |
2552 CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); |
2540 CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); |
2553 menu->StopDisplayingMenuBar(); |
2541 menu->StopDisplayingMenuBar(); |
2554 menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR); |
2542 menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR); |
|
2543 // Change background back to normal |
|
2544 DisplayMarkingModeBgL( EFalse ); |
2555 // Display drop down menu buttons |
2545 // Display drop down menu buttons |
2556 iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() ); |
2546 iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() ); |
2557 iNewEmailButton->SetDimmed( EFalse ); |
2547 iNewEmailButton->SetDimmed( EFalse ); |
2558 iFolderListButton->SetDimmed( EFalse ); |
2548 iFolderListButton->SetDimmed( EFalse ); |
2559 iSortButton->SetDimmed( EFalse ); |
2549 iSortButton->SetDimmed( EFalse ); |
2560 ScaleControlBarL(); |
2550 ScaleControlBarL(); |
2561 |
|
2562 iMailTreeListVisualizer->HideList(); |
|
2563 SetMailListLayoutAnchors(); |
|
2564 iMailTreeListVisualizer->ShowListL(); |
|
2565 } |
2551 } |
2566 |
2552 |
2567 // --------------------------------------------------------------------------- |
2553 // --------------------------------------------------------------------------- |
2568 // |
2554 // |
2569 // |
2555 // |
2571 // |
2557 // |
2572 void CFSEmailUiMailListVisualiser::EnterMarkingModeL() |
2558 void CFSEmailUiMailListVisualiser::EnterMarkingModeL() |
2573 { |
2559 { |
2574 FUNC_LOG; |
2560 FUNC_LOG; |
2575 iMarkingMode = ETrue; |
2561 iMarkingMode = ETrue; |
2576 iMailList->SetMarkingModeL( ETrue ); |
|
2577 iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked |
2562 iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked |
2578 HandleCommandL( EFsEmailUiCmdActionsExpandAll ); |
2563 HandleCommandL( EFsEmailUiCmdActionsExpandAll ); |
2579 // Change softkeys for marking mode |
2564 // Change softkeys for marking mode |
2580 SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_CANCEL ); |
2565 SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_CANCEL ); |
2581 // Change options menu for marking mode |
2566 // Change options menu for marking mode |
2582 CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); |
2567 CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); |
2583 menu->StopDisplayingMenuBar(); |
2568 menu->StopDisplayingMenuBar(); |
2584 menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR_MARKING_MODE); |
2569 menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR_MARKING_MODE); |
|
2570 // Change background to marking mode |
|
2571 DisplayMarkingModeBgL( ETrue ); |
2585 // Hide drop down menu buttons |
2572 // Hide drop down menu buttons |
2586 iNewEmailButton->SetDimmed(); |
2573 iNewEmailButton->SetDimmed(); |
2587 iFolderListButton->SetDimmed(); |
2574 iFolderListButton->SetDimmed(); |
2588 iSortButton->SetDimmed(); |
2575 iSortButton->SetDimmed(); |
2589 TRect rect(0,0,0,0); |
2576 if( !Layout_Meta_Data::IsLandscapeOrientation() ) |
2590 iControlBarControl->SetRectL( rect ); |
2577 { |
2591 UpdateFolderAndMarkingModeTextsL(); |
|
2592 |
|
2593 iMailTreeListVisualizer->HideList(); |
|
2594 SetMailListLayoutAnchors(); |
|
2595 iMailTreeListVisualizer->ShowListL(); |
|
2596 } |
|
2597 |
|
2598 // --------------------------------------------------------------------------- |
|
2599 // |
|
2600 // |
|
2601 // --------------------------------------------------------------------------- |
|
2602 // |
|
2603 void CFSEmailUiMailListVisualiser::RefreshMarkingModeL() |
|
2604 { |
|
2605 FUNC_LOG; |
|
2606 if ( iMarkingMode ) |
|
2607 { |
|
2608 // Hide drop down menu buttons |
|
2609 TRect rect(0,0,0,0); |
2578 TRect rect(0,0,0,0); |
2610 iControlBarControl->SetRectL( rect ); |
2579 iControlBarControl->SetRectL( rect ); |
2611 iNewEmailButton->SetDimmed(); |
2580 // Display marking mode text on the place of drop down menus |
2612 iFolderListButton->SetDimmed(); |
2581 DisplayMarkingModeTitleTextL(); |
2613 iSortButton->SetDimmed(); |
2582 } |
2614 UpdateFolderAndMarkingModeTextsL(); |
2583 } |
2615 } |
2584 |
2616 } |
2585 // --------------------------------------------------------------------------- |
2617 |
2586 // |
2618 // --------------------------------------------------------------------------- |
2587 // |
2619 // |
2588 // --------------------------------------------------------------------------- |
2620 // |
2589 // |
2621 // --------------------------------------------------------------------------- |
2590 void CFSEmailUiMailListVisualiser::RefreshMarkingModeL() |
2622 // |
2591 { |
2623 void CFSEmailUiMailListVisualiser::DisplayMarkingModeTextOnButtonsL() |
2592 FUNC_LOG; |
|
2593 if ( iMarkingMode ) |
|
2594 { |
|
2595 // Hide drop down menu buttons |
|
2596 if( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
2597 { |
|
2598 TRect rect(0,0,0,0); |
|
2599 iControlBarControl->SetRectL( rect ); |
|
2600 DisplayMarkingModeTitleTextL(); |
|
2601 } |
|
2602 else |
|
2603 { |
|
2604 iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() ); |
|
2605 iNewEmailButton->SetDimmed(); |
|
2606 iFolderListButton->SetDimmed(); |
|
2607 iSortButton->SetDimmed(); |
|
2608 RemoveMarkingModeTitleTextL(); |
|
2609 } |
|
2610 } |
|
2611 } |
|
2612 |
|
2613 // --------------------------------------------------------------------------- |
|
2614 // |
|
2615 // |
|
2616 // --------------------------------------------------------------------------- |
|
2617 // |
|
2618 void CFSEmailUiMailListVisualiser::DisplayMarkingModeTitleTextL() |
2624 { |
2619 { |
2625 FUNC_LOG; |
2620 FUNC_LOG; |
2626 if (!iMarkingModeTextVisual) |
2621 if (!iMarkingModeTextVisual) |
2627 { |
2622 { |
2628 const TRect sortButtonRect( iAppUi.LayoutHandler()->GetControlBarSortButtonRect() ); |
2623 const TRect sortButtonRect( iAppUi.LayoutHandler()->GetControlBarSortButtonRect() ); |
2676 iMarkingModeTextVisual = NULL; |
2671 iMarkingModeTextVisual = NULL; |
2677 iMarkingModeTextContentLayout->RemoveAndDestroyAllD(); |
2672 iMarkingModeTextContentLayout->RemoveAndDestroyAllD(); |
2678 iMarkingModeTextContentLayout = NULL; |
2673 iMarkingModeTextContentLayout = NULL; |
2679 iMarkingModeTextParentLayout->RemoveAndDestroyAllD(); |
2674 iMarkingModeTextParentLayout->RemoveAndDestroyAllD(); |
2680 iMarkingModeTextParentLayout = NULL; |
2675 iMarkingModeTextParentLayout = NULL; |
|
2676 } |
|
2677 } |
|
2678 |
|
2679 // --------------------------------------------------------------------------- |
|
2680 // |
|
2681 // |
|
2682 // --------------------------------------------------------------------------- |
|
2683 // |
|
2684 void CFSEmailUiMailListVisualiser::DisplayMarkingModeBgL( TBool aDisplay ) |
|
2685 { |
|
2686 FUNC_LOG; |
|
2687 if (aDisplay) |
|
2688 { |
|
2689 CAlfBrush* brush = iAppUi.FsTextureManager()->NewMailListMarkingModeBgBrushLC(); |
|
2690 iMailTreeListVisualizer->SetBackgroundBrushL( brush ); |
|
2691 CleanupStack::Pop( brush ); |
|
2692 } |
|
2693 else |
|
2694 { |
|
2695 iMailTreeListVisualizer->ClearBackground(); |
2681 } |
2696 } |
2682 } |
2697 } |
2683 |
2698 |
2684 // --------------------------------------------------------------------------- |
2699 // --------------------------------------------------------------------------- |
2685 // |
2700 // |
3404 FUNC_LOG; |
3419 FUNC_LOG; |
3405 CFsEmailUiViewBase::HandleDynamicVariantSwitchOnBackgroundL( aType ); |
3420 CFsEmailUiViewBase::HandleDynamicVariantSwitchOnBackgroundL( aType ); |
3406 if ( aType == ESkinChanged ) |
3421 if ( aType == ESkinChanged ) |
3407 { |
3422 { |
3408 UpdateThemeL(); |
3423 UpdateThemeL(); |
|
3424 } |
|
3425 else if ( aType == EScreenLayoutChanged ) |
|
3426 { |
|
3427 UpdateButtonTextsL(); |
|
3428 } |
|
3429 } |
|
3430 |
|
3431 // --------------------------------------------------------------------------- |
|
3432 // Update texts for command area buttons |
|
3433 // --------------------------------------------------------------------------- |
|
3434 // |
|
3435 void CFSEmailUiMailListVisualiser::UpdateButtonTextsL() |
|
3436 { |
|
3437 if ( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
3438 { |
|
3439 // No texts in portrait mode |
|
3440 iNewEmailButton->SetTextL( KNullDesC() ); |
|
3441 iSortButton->SetTextL( KNullDesC() ); |
|
3442 } |
|
3443 else |
|
3444 { |
|
3445 // Set button text if necessary |
|
3446 HBufC* buttonText = GetSortButtonTextLC(); |
|
3447 if ( buttonText ) |
|
3448 { |
|
3449 iSortButton->SetTextL( *buttonText ); |
|
3450 CleanupStack::PopAndDestroy( buttonText ); |
|
3451 } |
|
3452 |
|
3453 iNewEmailButton->SetTextL( *iNewEmailText ); |
3409 } |
3454 } |
3410 } |
3455 } |
3411 |
3456 |
3412 // --------------------------------------------------------------------------- |
3457 // --------------------------------------------------------------------------- |
3413 // |
3458 // |
3915 aCommand == EFsEmailUiCmdMarkAsUnread || |
3960 aCommand == EFsEmailUiCmdMarkAsUnread || |
3916 aCommand == EFsEmailUiCmdActionsMove || |
3961 aCommand == EFsEmailUiCmdActionsMove || |
3917 aCommand == EFsEmailUiCmdActionsMoveMessage || |
3962 aCommand == EFsEmailUiCmdActionsMoveMessage || |
3918 aCommand == EFsEmailUiCmdMarkingModeFromPopUp || |
3963 aCommand == EFsEmailUiCmdMarkingModeFromPopUp || |
3919 aCommand == EFsEmailUiCmdActionsCollapseAll || |
3964 aCommand == EFsEmailUiCmdActionsCollapseAll || |
3920 aCommand == EFsEmailUiCmdActionsExpandAll || |
3965 aCommand == EFsEmailUiCmdActionsExpandAll ) ) |
3921 aCommand == EFsEmailUiCmdActionsFlag ) ) |
|
3922 { |
3966 { |
3923 // We end up here if the user selects an option from the pop up menu |
3967 // We end up here if the user selects an option from the pop up menu |
3924 // or exits the menu by tapping outside of it's area. |
3968 // or exits the menu by tapping outside of it's area. |
3925 // Remove the focus from a list item if an item is focused. |
3969 // Remove the focus from a list item if an item is focused. |
3926 iStylusPopUpMenuVisible = EFalse; |
3970 iStylusPopUpMenuVisible = EFalse; |
4613 { |
4649 { |
4614 // If destination folder is not set, it needs to be asked messages are moved after callbak |
4650 // If destination folder is not set, it needs to be asked messages are moved after callbak |
4615 if ( aDestinationFolderId.IsNullId() ) |
4651 if ( aDestinationFolderId.IsNullId() ) |
4616 { |
4652 { |
4617 // Activate folder selection view and handle moving after callback gets destination |
4653 // Activate folder selection view and handle moving after callback gets destination |
|
4654 RemoveMarkingModeTitleTextL(); |
4618 iMoveToFolderOngoing = ETrue; |
4655 iMoveToFolderOngoing = ETrue; |
4619 TFolderListActivationData folderListData; |
4656 TFolderListActivationData folderListData; |
4620 folderListData.iCallback = this; |
4657 folderListData.iCallback = this; |
4621 if(iMailFolder) // Coverity error fix , assuming that inbox is best bet for safe data. |
4658 if(iMailFolder) // Coverity error fix , assuming that inbox is best bet for safe data. |
4622 { |
4659 { |
5885 TAlfAlignHorizontal horizontalAlign = EAlfAlignHLeft; |
5922 TAlfAlignHorizontal horizontalAlign = EAlfAlignHLeft; |
5886 if ( AknLayoutUtils::LayoutMirrored() ) |
5923 if ( AknLayoutUtils::LayoutMirrored() ) |
5887 { |
5924 { |
5888 horizontalAlign = EAlfAlignHRight; |
5925 horizontalAlign = EAlfAlignHRight; |
5889 } |
5926 } |
|
5927 |
5890 // Icons and sort button text |
5928 // Icons and sort button text |
5891 iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); |
5929 iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); |
5892 iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); |
5930 iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); |
5893 SetSortButtonIconL(); |
5931 SetSortButtonTextAndIconL(); |
5894 |
5932 |
5895 iNewEmailButton->SetElemAlignL( |
5933 iNewEmailButton->SetElemAlignL( |
5896 ECBElemIconA, |
5934 ECBElemIconA, |
5897 EAlfAlignHCenter, |
5935 EAlfAlignHCenter, |
5898 EAlfAlignVCenter ); |
5936 EAlfAlignVCenter ); |
5978 // --------------------------------------------------------------------------- |
6012 // --------------------------------------------------------------------------- |
5979 // |
6013 // |
5980 // |
6014 // |
5981 // --------------------------------------------------------------------------- |
6015 // --------------------------------------------------------------------------- |
5982 // |
6016 // |
5983 void CFSEmailUiMailListVisualiser::SetSortButtonIconL() |
6017 void CFSEmailUiMailListVisualiser::SetSortButtonTextAndIconL() |
5984 { |
6018 { |
5985 FUNC_LOG; |
6019 FUNC_LOG; |
|
6020 |
|
6021 // Set button text if necessary |
|
6022 HBufC* buttonText = GetSortButtonTextLC(); |
|
6023 |
|
6024 if ( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
6025 { |
|
6026 if ( buttonText ) |
|
6027 { |
|
6028 buttonText->Des().Zero(); |
|
6029 } |
|
6030 } |
|
6031 |
|
6032 if ( buttonText ) |
|
6033 { |
|
6034 iSortButton->SetTextL( *buttonText ); |
|
6035 } |
|
6036 CleanupStack::PopAndDestroy( buttonText ); |
|
6037 |
5986 iSortButton->SetIconL( |
6038 iSortButton->SetIconL( |
5987 iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ), |
6039 iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ), |
5988 ECBElemIconA ); |
6040 ECBElemIconA ); |
5989 |
6041 |
5990 } |
6042 } |
5998 { |
6050 { |
5999 FUNC_LOG; |
6051 FUNC_LOG; |
6000 |
6052 |
6001 TFSEmailUiTextures textureIndex( ETextureFirst ); |
6053 TFSEmailUiTextures textureIndex( ETextureFirst ); |
6002 switch ( iCurrentSortCriteria.iField ) |
6054 switch ( iCurrentSortCriteria.iField ) |
6003 { |
6055 { |
6004 case EFSMailSortBySubject: |
6056 case EFSMailSortBySubject: |
6005 { |
6057 { |
6006 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6058 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6007 ESortListSubjectAscTexture : ESortListSubjectDescTexture; |
6059 ESortListSubjectDescTexture : |
6008 } |
6060 ESortListSubjectAscTexture; |
6009 break; |
6061 } |
6010 case EFSMailSortByAttachment: |
6062 break; |
6011 { |
6063 case EFSMailSortByAttachment: |
6012 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6064 { |
6013 ESortListAttachmentAscTexture : ESortListAttachmentDescTexture; |
6065 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6014 } |
6066 ESortListAttachmentDescTexture : |
6015 break; |
6067 ESortListAttachmentAscTexture; |
6016 case EFSMailSortByFlagStatus: |
6068 } |
6017 { |
6069 break; |
6018 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6070 case EFSMailSortByFlagStatus: |
6019 ESortListFollowAscTexture : ESortListFollowDescTexture; |
6071 { |
6020 } |
6072 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6021 break; |
6073 ESortListFollowDescTexture : |
6022 case EFSMailSortByRecipient: |
6074 ESortListFollowAscTexture; |
6023 case EFSMailSortBySender: |
6075 } |
6024 { |
6076 break; |
6025 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6077 case EFSMailSortByRecipient: |
6026 ESortListSenderAscTexture : ESortListSenderDescTexture; |
6078 case EFSMailSortBySender: |
6027 } |
6079 { |
6028 break; |
6080 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6029 case EFSMailSortByPriority: |
6081 ESortListSenderDescTexture : |
6030 { |
6082 ESortListSenderAscTexture; |
6031 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6083 } |
6032 ESortListPriorityAscTexture : ESortListPriorityDescTexture; |
6084 break; |
6033 } |
6085 case EFSMailSortByPriority: |
6034 break; |
6086 { |
6035 case EFSMailSortByUnread: |
6087 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6036 { |
6088 ESortListPriorityDescTexture : |
6037 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6089 ESortListPriorityAscTexture; |
6038 ESortListUnreadAscTexture : ESortListUnreadDescTexture; |
6090 } |
6039 } |
6091 break; |
6040 break; |
6092 case EFSMailSortByUnread: |
6041 case EFSMailSortByDate: |
6093 { |
6042 default: |
6094 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6043 { |
6095 ESortListUnreadDescTexture : |
6044 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
6096 ESortListUnreadAscTexture; |
6045 ESortListDateAscTexture : ESortListDateDescTexture; |
6097 } |
6046 } |
6098 break; |
6047 break; |
6099 case EFSMailSortByDate: |
6048 } |
6100 default: |
|
6101 { |
|
6102 textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
6103 ESortListDateDescTexture : |
|
6104 ESortListDateAscTexture; |
|
6105 } |
|
6106 break; |
|
6107 } |
6049 return textureIndex; |
6108 return textureIndex; |
6050 } |
6109 } |
6051 |
6110 |
6052 // --------------------------------------------------------------------------- |
6111 // --------------------------------------------------------------------------- |
6053 // |
6112 // |
6135 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 0, |
6194 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 0, |
6136 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6195 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6137 EAlfAnchorMetricRelativeToSize, EAlfAnchorMetricAbsolute, |
6196 EAlfAnchorMetricRelativeToSize, EAlfAnchorMetricAbsolute, |
6138 TAlfTimedPoint(1, iAppUi.LayoutHandler()->ControlBarHeight() )); |
6197 TAlfTimedPoint(1, iAppUi.LayoutHandler()->ControlBarHeight() )); |
6139 |
6198 |
|
6199 // <cmail> Platform layout changes |
6140 TRect listRect = iAppUi.LayoutHandler()->GetListRect(); |
6200 TRect listRect = iAppUi.LayoutHandler()->GetListRect(); |
6141 // Set anchors so that list leaves space for control bar |
6201 // Set anchors so that list leaves space for control bar |
6142 if( Layout_Meta_Data::IsMirrored() ) |
6202 if( Layout_Meta_Data::IsMirrored() ) |
6143 { |
6203 { |
6144 TInt tlX = listRect.iTl.iX; |
6204 TInt tlX = listRect.iTl.iX; |
6149 } |
6209 } |
6150 iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1, |
6210 iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1, |
6151 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6211 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6152 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6212 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6153 TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); |
6213 TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); |
6154 |
6214 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, |
6155 if (iMarkingMode && Layout_Meta_Data::IsLandscapeOrientation()) |
6215 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6156 { |
6216 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6157 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, |
6217 TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); |
6158 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6218 // </cmail> Platform layout changes |
6159 EAlfAnchorMetricRelativeToSize, EAlfAnchorMetricAbsolute, |
|
6160 TAlfTimedPoint(1, listRect.iBr.iY)); |
|
6161 } |
|
6162 else |
|
6163 { |
|
6164 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, |
|
6165 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
|
6166 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
|
6167 TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); |
|
6168 } |
|
6169 |
6219 |
6170 // Set anchors for connection icon |
6220 // Set anchors for connection icon |
|
6221 |
|
6222 // <cmail> Platform layout changes |
6171 TRect connectionIconRect( iAppUi.LayoutHandler()->GetControlBarConnectionIconRect() ); |
6223 TRect connectionIconRect( iAppUi.LayoutHandler()->GetControlBarConnectionIconRect() ); |
6172 const TPoint& tl( connectionIconRect.iTl ); |
6224 const TPoint& tl( connectionIconRect.iTl ); |
6173 iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 2, |
6225 iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 2, |
6174 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6226 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6175 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6227 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6177 const TPoint& br( connectionIconRect.iBr ); |
6229 const TPoint& br( connectionIconRect.iBr ); |
6178 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 2, |
6230 iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 2, |
6179 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6231 EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
6180 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6232 EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
6181 TAlfTimedPoint( br.iX, br.iY )); |
6233 TAlfTimedPoint( br.iX, br.iY )); |
|
6234 // </cmail> Platform layout changes |
6182 |
6235 |
6183 iScreenAnchorLayout->UpdateChildrenLayout(); |
6236 iScreenAnchorLayout->UpdateChildrenLayout(); |
6184 } |
6237 } |
6185 |
6238 |
6186 // --------------------------------------------------------------------------- |
6239 // --------------------------------------------------------------------------- |
6315 TRAP_IGNORE( confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
6368 TRAP_IGNORE( confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
6316 iMailFolder->GetFolderId(), |
6369 iMailFolder->GetFolderId(), |
6317 modelItem->MessagePtr().GetMessageId() , |
6370 modelItem->MessagePtr().GetMessageId() , |
6318 EFSMsgDataEnvelope ) ); |
6371 EFSMsgDataEnvelope ) ); |
6319 if( aIndex < iTreeItemArray.Count() ) |
6372 if( aIndex < iTreeItemArray.Count() ) |
6320 { |
6373 { |
6321 if ( confirmedMsgPtr ) |
6374 if ( confirmedMsgPtr ) |
6322 { |
6375 { |
6323 const SMailListItem& item = iTreeItemArray[aIndex]; |
6376 const SMailListItem& item = iTreeItemArray[aIndex]; |
6324 // Replace message pointer in model with newly fetched one |
6377 // Replace message pointer in model with newly fetched one |
6325 Model()->ReplaceMessagePtr( aIndex, confirmedMsgPtr ); |
6378 Model()->ReplaceMessagePtr( aIndex, confirmedMsgPtr ); |
6698 FUNC_LOG; |
6751 FUNC_LOG; |
6699 TFSMailMsgId folderId = FolderId(); |
6752 TFSMailMsgId folderId = FolderId(); |
6700 TFSMailMsgId mailBox = iAppUi.GetActiveMailboxId(); |
6753 TFSMailMsgId mailBox = iAppUi.GetActiveMailboxId(); |
6701 RArray<TFSMailMsgId> msgIds; |
6754 RArray<TFSMailMsgId> msgIds; |
6702 CleanupClosePushL( msgIds ); |
6755 CleanupClosePushL( msgIds ); |
6703 for ( TInt i = aEntries.Count() - 1; i >= 0; i-- ) |
6756 for ( TInt i = 0; i < aEntries.Count(); i++ ) |
6704 { |
6757 { |
6705 msgIds.AppendL( MsgIdFromListId( aEntries[i] ) ); |
6758 msgIds.AppendL( MsgIdFromListId( aEntries[i] ) ); |
6706 } |
6759 } |
6707 |
|
6708 // Clear the focused item to avoid repeated selection of a new focused |
|
6709 // item, unnecessary scrolling of the viewport, etc. |
|
6710 iMailTreeListVisualizer->SetFocusedItemL( KFsTreeNoneID ); |
|
6711 |
|
6712 iMailList->BeginUpdate(); |
|
6713 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
6760 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
6714 // Remove from mail list if not already removed by mailbox events |
6761 // Remove from mail list if not already removed by mailbox events |
6715 RemoveMsgItemsFromListIfFoundL( msgIds ); |
6762 RemoveMsgItemsFromListIfFoundL( msgIds ); |
6716 iMailList->EndUpdateL(); |
|
6717 |
|
6718 CleanupStack::PopAndDestroy(); // msgIds.Close() |
6763 CleanupStack::PopAndDestroy(); // msgIds.Close() |
6719 } |
6764 } |
6720 |
6765 |
6721 // --------------------------------------------------------------------------- |
6766 // --------------------------------------------------------------------------- |
6722 // ConfirmDeleteL |
6767 // ConfirmDeleteL |
7146 { |
7199 { |
7147 // Do nothing if can't get the folder object |
7200 // Do nothing if can't get the folder object |
7148 return; |
7201 return; |
7149 } |
7202 } |
7150 |
7203 |
7151 UpdateFolderAndMarkingModeTextsL(); |
7204 // Set new text to folder button in control bar |
|
7205 HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); |
|
7206 iFolderListButton->SetTextL( *newFolderName ); |
|
7207 CleanupStack::PopAndDestroy( newFolderName ); |
7152 |
7208 |
7153 // Set initial sort criteria when folder has changed |
7209 // Set initial sort criteria when folder has changed |
7154 iCurrentSortCriteria.iField = EFSMailSortByDate; |
7210 iCurrentSortCriteria.iField = EFSMailSortByDate; |
7155 iCurrentSortCriteria.iOrder = EFSMailDescending; |
7211 iCurrentSortCriteria.iOrder = EFSMailDescending; |
7156 // reload node state because in file sort mode this is disabled even when globally enabled |
7212 // reload node state because in file sort mode this is disabled even when globally enabled |
7157 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
7213 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
7158 SetSortButtonIconL(); |
7214 SetSortButtonTextAndIconL(); |
7159 |
7215 |
7160 // Update the mail list contents |
7216 // Update the mail list contents |
7161 UpdateMailListModelL(); |
7217 UpdateMailListModelL(); |
7162 RefreshL(); |
7218 RefreshL(); |
7163 } |
7219 } |
7187 // Set initial sort criteria when folder has changed |
7243 // Set initial sort criteria when folder has changed |
7188 iCurrentSortCriteria.iField = EFSMailSortByDate; |
7244 iCurrentSortCriteria.iField = EFSMailSortByDate; |
7189 iCurrentSortCriteria.iOrder = EFSMailDescending; |
7245 iCurrentSortCriteria.iOrder = EFSMailDescending; |
7190 // reload node state because in file sort mode this is disabled even when globally enabled |
7246 // reload node state because in file sort mode this is disabled even when globally enabled |
7191 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
7247 iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
7192 SetSortButtonIconL(); |
7248 SetSortButtonTextAndIconL(); |
7193 |
7249 |
7194 // Set folder name to the control bar button |
7250 // Set folder name to the control bar button |
7195 UpdateFolderAndMarkingModeTextsL(); |
7251 HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); |
|
7252 iFolderListButton->SetTextL( *newFolderName ); |
|
7253 CleanupStack::PopAndDestroy( newFolderName ); |
7196 |
7254 |
7197 // Set mailbox name and icons |
7255 // Set mailbox name and icons |
7198 SetMailboxNameToStatusPaneL(); |
7256 SetMailboxNameToStatusPaneL(); |
7199 SetBrandedListWatermarkL(); |
7257 SetBrandedListWatermarkL(); |
7200 SetBrandedMailBoxIconL(); |
7258 SetBrandedMailBoxIconL(); |
8411 } |
8473 } |
8412 } |
8474 } |
8413 return manualSync; |
8475 return manualSync; |
8414 } |
8476 } |
8415 |
8477 |
8416 |
|
8417 void CFSEmailUiMailListVisualiser::UpdateFolderAndMarkingModeTextsL() |
|
8418 { |
|
8419 if ( iAppUi.CurrentActiveView()->Id() == MailListId ) |
|
8420 { |
|
8421 HBufC* folder = CreateFolderNameLC( iMailFolder ); |
|
8422 if( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
8423 { |
|
8424 iFolderListButton->SetTextL( KNullDesC ); |
|
8425 if (iMarkingMode) |
|
8426 { |
|
8427 RemoveMarkingModeTextOnButtonsL(); |
|
8428 HBufC* txt = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_MARKINGMODE ); |
|
8429 iAppUi.SetNaviPaneTextL( *txt ); |
|
8430 CleanupStack::PopAndDestroy( txt ); |
|
8431 } |
|
8432 else |
|
8433 { |
|
8434 iAppUi.SetNaviPaneTextL( *folder ); |
|
8435 } |
|
8436 } |
|
8437 else // Portrait orientation |
|
8438 { |
|
8439 iAppUi.SetNaviPaneTextL( KNullDesC ); |
|
8440 if (iMarkingMode) |
|
8441 { |
|
8442 DisplayMarkingModeTextOnButtonsL(); |
|
8443 } |
|
8444 else |
|
8445 { |
|
8446 RemoveMarkingModeTextOnButtonsL(); |
|
8447 iFolderListButton->SetTextL( *folder ); |
|
8448 } |
|
8449 } |
|
8450 CleanupStack::PopAndDestroy( folder ); |
|
8451 } |
|
8452 else |
|
8453 { |
|
8454 iAppUi.SetNaviPaneTextL( KNullDesC ); |
|
8455 RemoveMarkingModeTextOnButtonsL(); |
|
8456 } |
|
8457 } |
|
8458 |
|
8459 ////////////////////////////////////////////////////////////////// |
8478 ////////////////////////////////////////////////////////////////// |
8460 // Class implementation CMailListUpdater |
8479 // Class implementation CMailListUpdater |
8461 /////////////////////////////////////////////////////////////////// |
8480 /////////////////////////////////////////////////////////////////// |
8462 |
8481 |
8463 |
8482 |