emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp
branchRCL_3
changeset 73 c8382f7b54ef
parent 70 968773a0b6ef
child 80 726fba06891a
equal deleted inserted replaced
70:968773a0b6ef 73:c8382f7b54ef
   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->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) );
   577     iMailTreeListVisualizer->SetMarkOnIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOnIcon ) );
       
   578     iMailTreeListVisualizer->SetMarkOffIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOffIcon ) );
   578     iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) );
   579     iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) );
   579     iMailList->AddObserverL( *this );
   580     iMailList->AddObserverL( *this );
   580     iMailList->AddObserverL( *iTouchManager );
   581     iMailList->AddObserverL( *iTouchManager );
   581     // Initializing the default stylus long tap popup menu
   582     // Initializing the default stylus long tap popup menu
   582     if( !iStylusPopUpMenu )
   583     if( !iStylusPopUpMenu )
  1653             TRAP_IGNORE( ExitMarkingModeL() );
  1654             TRAP_IGNORE( ExitMarkingModeL() );
  1654             }
  1655             }
  1655         }
  1656         }
  1656 
  1657 
  1657     iShowReplyAll = EFalse;
  1658     iShowReplyAll = EFalse;
  1658 
  1659     TBool bDoFirstStartCalled( EFalse );
  1659 	if ( !iFirstStartCompleted )
  1660     if ( !iFirstStartCompleted )
  1660 	    {
  1661         {
  1661 	    DoFirstStartL();
  1662         DoFirstStartL();
  1662 	    }
  1663         bDoFirstStartCalled = ETrue;
       
  1664         }
  1663     // set when editor was called so reset is needed i.e. here (Called by DoActivate)
  1665     // set when editor was called so reset is needed i.e. here (Called by DoActivate)
  1664    	iMailOpened = EFalse; 
  1666     iMailOpened = EFalse; 
  1665 
  1667 
  1666     // Make sure that pending popup is not displayd
  1668     // Make sure that pending popup is not displayd
  1667 	if ( iAppUi.FolderList().IsPopupShown() )
  1669     if ( iAppUi.FolderList().IsPopupShown() )
  1668         {
  1670         {
  1669         iAppUi.FolderList().HidePopupL();
  1671         iAppUi.FolderList().HidePopupL();
  1670         }
  1672         }
  1671     DisableMailList( EFalse );
  1673     DisableMailList( EFalse );
  1672 
  1674 
  1690     TRect clientRect = iAppUi.ClientRect();
  1692     TRect clientRect = iAppUi.ClientRect();
  1691     iScreenAnchorLayout->SetSize( clientRect.Size() );
  1693     iScreenAnchorLayout->SetSize( clientRect.Size() );
  1692     SetMailListLayoutAnchors();
  1694     SetMailListLayoutAnchors();
  1693     //if the view is already active don't update the icons so they won't "blink" 
  1695     //if the view is already active don't update the icons so they won't "blink" 
  1694     //when the view is activated.
  1696     //when the view is activated.
  1695     if(!iThisViewActive && !iMarkingMode)
  1697     if( !iThisViewActive && !iMarkingMode )
  1696         {     
  1698         {     
       
  1699         
  1697         ScaleControlBarL();
  1700         ScaleControlBarL();
  1698         
  1701         if ( !bDoFirstStartCalled ) // Don't set the icon if set by DoFirstStart()
  1699         // Set icons on toolbar
  1702             { 
  1700         iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon );
  1703             // Set icons on toolbar
  1701         iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) );
  1704             iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon );
  1702         iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon );
  1705             iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) );
  1703         iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) );
  1706             iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon );
  1704         iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() );
  1707             iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) );
  1705         iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) );
  1708             iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() );
  1706 
  1709             iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) );
       
  1710             }
  1707         SetListAndCtrlBarFocusL();
  1711         SetListAndCtrlBarFocusL();
  1708         }
  1712         }
  1709 
  1713 
  1710 	FadeOut(EFalse); // we can show now CAlfVisuals from CurrentView (to show Folders before updating emails)
  1714 	FadeOut(EFalse); // we can show now CAlfVisuals from CurrentView (to show Folders before updating emails)
  1711     
  1715     
  2538     {
  2542     {
  2539     FUNC_LOG;
  2543     FUNC_LOG;
  2540     iMarkingMode = EFalse;    
  2544     iMarkingMode = EFalse;    
  2541     // Hide marking mode text on the place of drop down menus
  2545     // Hide marking mode text on the place of drop down menus
  2542     UpdateFolderAndMarkingModeTextsL();
  2546     UpdateFolderAndMarkingModeTextsL();
       
  2547     iMailList->SetMarkingModeL( EFalse );
  2543     UnmarkAllItemsL();
  2548     UnmarkAllItemsL();
  2544     // Change softkeys back to normal
  2549     // Change softkeys back to normal
  2545     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK );
  2550     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK );
  2546     // Change options menu back to normal
  2551     // Change options menu back to normal
  2547     CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar();
  2552     CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar();
  2548     menu->StopDisplayingMenuBar();
  2553     menu->StopDisplayingMenuBar();
  2549     menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR);
  2554     menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR);
  2550     // Change background back to normal
       
  2551     DisplayMarkingModeBgL( EFalse );   
       
  2552     // Display drop down menu buttons
  2555     // Display drop down menu buttons
  2553     iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  2556     iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  2554     iNewEmailButton->SetDimmed( EFalse );
  2557     iNewEmailButton->SetDimmed( EFalse );
  2555     iFolderListButton->SetDimmed( EFalse );   
  2558     iFolderListButton->SetDimmed( EFalse );   
  2556     iSortButton->SetDimmed( EFalse );
  2559     iSortButton->SetDimmed( EFalse );
  2568 //
  2571 //
  2569 void CFSEmailUiMailListVisualiser::EnterMarkingModeL()
  2572 void CFSEmailUiMailListVisualiser::EnterMarkingModeL()
  2570     {
  2573     {
  2571     FUNC_LOG;	
  2574     FUNC_LOG;	
  2572     iMarkingMode = ETrue;
  2575     iMarkingMode = ETrue;
       
  2576     iMailList->SetMarkingModeL( ETrue );
  2573 	iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked
  2577 	iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked
  2574     HandleCommandL( EFsEmailUiCmdActionsExpandAll );
  2578     HandleCommandL( EFsEmailUiCmdActionsExpandAll );
  2575     // Change softkeys for marking mode
  2579     // Change softkeys for marking mode
  2576     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_CANCEL );
  2580     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_CANCEL );
  2577     // Change options menu for marking mode
  2581     // Change options menu for marking mode
  2587     UpdateFolderAndMarkingModeTextsL();
  2591     UpdateFolderAndMarkingModeTextsL();
  2588     
  2592     
  2589     iMailTreeListVisualizer->HideList();   
  2593     iMailTreeListVisualizer->HideList();   
  2590     SetMailListLayoutAnchors();
  2594     SetMailListLayoutAnchors();
  2591     iMailTreeListVisualizer->ShowListL();
  2595     iMailTreeListVisualizer->ShowListL();
  2592     // Change background to marking mode
       
  2593     DisplayMarkingModeBgL( ETrue );    
       
  2594     }
  2596     }
  2595 
  2597 
  2596 // ---------------------------------------------------------------------------
  2598 // ---------------------------------------------------------------------------
  2597 //
  2599 //
  2598 //
  2600 //
  2674         iMarkingModeTextVisual = NULL;
  2676         iMarkingModeTextVisual = NULL;
  2675         iMarkingModeTextContentLayout->RemoveAndDestroyAllD();
  2677         iMarkingModeTextContentLayout->RemoveAndDestroyAllD();
  2676         iMarkingModeTextContentLayout = NULL;
  2678         iMarkingModeTextContentLayout = NULL;
  2677         iMarkingModeTextParentLayout->RemoveAndDestroyAllD();
  2679         iMarkingModeTextParentLayout->RemoveAndDestroyAllD();
  2678         iMarkingModeTextParentLayout = NULL;
  2680         iMarkingModeTextParentLayout = NULL;
  2679         }
       
  2680     }
       
  2681 
       
  2682 // ---------------------------------------------------------------------------
       
  2683 //
       
  2684 //
       
  2685 // ---------------------------------------------------------------------------
       
  2686 //
       
  2687 void CFSEmailUiMailListVisualiser::DisplayMarkingModeBgL( TBool aDisplay )
       
  2688     {
       
  2689     FUNC_LOG;
       
  2690     if (aDisplay)
       
  2691         {
       
  2692         CAlfBrush* brush = iAppUi.FsTextureManager()->NewMailListMarkingModeBgBrushLC();
       
  2693         iMailTreeListVisualizer->SetBackgroundBrushL( brush );
       
  2694         CleanupStack::Pop( brush );
       
  2695         }
       
  2696     else
       
  2697         {
       
  2698         iMailTreeListVisualizer->ClearBackground();
       
  2699         }
  2681         }
  2700     }
  2682     }
  2701 
  2683 
  2702 // ---------------------------------------------------------------------------
  2684 // ---------------------------------------------------------------------------
  2703 //
  2685 //
  5927         ECBElemIconA,
  5909         ECBElemIconA,
  5928         EAlfAlignHCenter,
  5910         EAlfAlignHCenter,
  5929         EAlfAlignVCenter );
  5911         EAlfAlignVCenter );
  5930 
  5912 
  5931 	// Show the buttons
  5913 	// Show the buttons
  5932   	iNewEmailButton->ShowButtonL();
  5914     if( iThisViewActive || iMarkingMode )
  5933     iFolderListButton->ShowButtonL();
  5915         {
  5934     iSortButton->ShowButtonL();
  5916         iNewEmailButton->ShowButtonL();
  5935 	}
  5917         iFolderListButton->ShowButtonL();
       
  5918         iSortButton->ShowButtonL();
       
  5919         }
       
  5920     // else buttons shown later in ChildDoActivete() by ScaleControlBarL()
       
  5921     }
  5936 
  5922 
  5937 // ---------------------------------------------------------------------------
  5923 // ---------------------------------------------------------------------------
  5938 //
  5924 //
  5939 //
  5925 //
  5940 // ---------------------------------------------------------------------------
  5926 // ---------------------------------------------------------------------------
  6012     {
  5998     {
  6013     FUNC_LOG;
  5999     FUNC_LOG;
  6014     
  6000     
  6015     TFSEmailUiTextures textureIndex( ETextureFirst );
  6001     TFSEmailUiTextures textureIndex( ETextureFirst );
  6016     switch ( iCurrentSortCriteria.iField )
  6002     switch ( iCurrentSortCriteria.iField )
  6017 		{
  6003         {
  6018 		case EFSMailSortBySubject:
  6004         case EFSMailSortBySubject:
  6019 			{
  6005             {
  6020 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6006             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6021 						   ESortListSubjectDescTexture :
  6007                 ESortListSubjectAscTexture : ESortListSubjectDescTexture;
  6022 						   ESortListSubjectAscTexture;
  6008             }
  6023 			}
  6009             break;
  6024 			break;
  6010         case EFSMailSortByAttachment:
  6025 		case EFSMailSortByAttachment:
  6011             {
  6026 			{
  6012             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6027 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6013                 ESortListAttachmentAscTexture : ESortListAttachmentDescTexture;
  6028 						   ESortListAttachmentDescTexture :
  6014             }
  6029 						   ESortListAttachmentAscTexture;
  6015             break;
  6030 			}
  6016         case EFSMailSortByFlagStatus:
  6031 			break;
  6017             {
  6032 		case EFSMailSortByFlagStatus:
  6018             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6033 			{
  6019                 ESortListFollowAscTexture : ESortListFollowDescTexture;
  6034 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6020             }
  6035 						   ESortListFollowDescTexture :
  6021             break;
  6036 						   ESortListFollowAscTexture;
  6022         case EFSMailSortByRecipient:
  6037 			}
  6023         case EFSMailSortBySender:
  6038 			break;
  6024             {
  6039 		case EFSMailSortByRecipient:
  6025             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6040 		case EFSMailSortBySender:
  6026                 ESortListSenderAscTexture : ESortListSenderDescTexture;
  6041 			{
  6027             }
  6042 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6028             break;
  6043 						   ESortListSenderDescTexture :
  6029         case EFSMailSortByPriority:
  6044 						   ESortListSenderAscTexture;
  6030             {
  6045 			}
  6031             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6046 			break;
  6032                 ESortListPriorityAscTexture : ESortListPriorityDescTexture;
  6047 		case EFSMailSortByPriority:
  6033             }
  6048 			{
  6034             break;
  6049 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6035         case EFSMailSortByUnread:
  6050 						   ESortListPriorityDescTexture :
  6036             {
  6051 						   ESortListPriorityAscTexture;
  6037             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6052 			}
  6038                 ESortListUnreadAscTexture : ESortListUnreadDescTexture;
  6053 			break;
  6039             }
  6054 		case EFSMailSortByUnread:
  6040             break;
  6055 			{
  6041         case EFSMailSortByDate:
  6056 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6042         default:
  6057 						   ESortListUnreadDescTexture :
  6043             {
  6058 						   ESortListUnreadAscTexture;
  6044             textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
  6059 			}
  6045                 ESortListDateAscTexture : ESortListDateDescTexture;
  6060 			break;
  6046             }
  6061 		case EFSMailSortByDate:
  6047             break;
  6062 		default:
  6048         }
  6063 			{
       
  6064 			textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ?
       
  6065 						   ESortListDateDescTexture :
       
  6066 						   ESortListDateAscTexture;
       
  6067 			}
       
  6068 			break;
       
  6069   		}
       
  6070     return textureIndex;
  6049     return textureIndex;
  6071 	}
  6050 	}
  6072 
  6051 
  6073 // ---------------------------------------------------------------------------
  6052 // ---------------------------------------------------------------------------
  6074 //
  6053 //