emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp
branchRCL_3
changeset 19 b13141f05c3d
parent 17 8592a65ad3fb
child 24 b5fbb9b25d57
equal deleted inserted replaced
17:8592a65ad3fb 19:b13141f05c3d
    55 #include "esmailsettingspluginuids.hrh"
    55 #include "esmailsettingspluginuids.hrh"
    56 #include "esmailsettingsplugin.h"
    56 #include "esmailsettingsplugin.h"
    57 #include "mfsmailbrandmanager.h"
    57 #include "mfsmailbrandmanager.h"
    58 #include <AknWaitDialog.h>
    58 #include <AknWaitDialog.h>
    59 #include <aknlayoutscalable_apps.cdl.h>
    59 #include <aknlayoutscalable_apps.cdl.h>
       
    60 #include <aknlayoutscalable_avkon.cdl.h>
    60 #include <layoutmetadata.cdl.h>
    61 #include <layoutmetadata.cdl.h>
    61 #include <csxhelp/cmail.hlp.hrh>
    62 #include <csxhelp/cmail.hlp.hrh>
    62 // Meeting request
    63 // Meeting request
    63 #include <MeetingRequestUids.hrh>
    64 #include <MeetingRequestUids.hrh>
    64 #include "cesmricalviewer.h"
    65 #include "cesmricalviewer.h"
  1323                      TUid aCustomMessageId,
  1324                      TUid aCustomMessageId,
  1324                      const TDesC8& aCustomMessage)
  1325                      const TDesC8& aCustomMessage)
  1325 	{
  1326 	{
  1326     FUNC_LOG;
  1327     FUNC_LOG;
  1327     TIMESTAMP( "Opening message list view" );
  1328     TIMESTAMP( "Opening message list view" );
       
  1329     
       
  1330     if (iMarkingModeWaitingToExit)
       
  1331         {
       
  1332         if ( iAppUi.CurrentActiveView()->Id() == MailListId )
       
  1333             {
       
  1334             iMarkingModeWaitingToExit = EFalse;
       
  1335             TRAP_IGNORE( ExitMarkingModeL() );
       
  1336             }
       
  1337         }
       
  1338 
  1328     iShowReplyAll = EFalse;
  1339     iShowReplyAll = EFalse;
  1329 
  1340 
  1330 	if ( !iFirstStartCompleted )
  1341 	if ( !iFirstStartCompleted )
  1331 	    {
  1342 	    {
  1332 	    DoFirstStartL();
  1343 	    DoFirstStartL();
  2173 // ---------------------------------------------------------------------------
  2184 // ---------------------------------------------------------------------------
  2174 //
  2185 //
  2175 void CFSEmailUiMailListVisualiser::ExitMarkingModeL()
  2186 void CFSEmailUiMailListVisualiser::ExitMarkingModeL()
  2176     {
  2187     {
  2177     FUNC_LOG;	
  2188     FUNC_LOG;	
       
  2189     // Hide marking mode text on the place of drop down menus
       
  2190     RemoveMarkingModeTitleTextL();	
  2178     iMarkingMode = EFalse;
  2191     iMarkingMode = EFalse;
  2179     UnmarkAllItemsL();
  2192     UnmarkAllItemsL();
  2180     // Change softkeys back to normal
  2193     // Change softkeys back to normal
  2181     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK );
  2194     SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK );
  2182     // Change options menu back to normal
  2195     // Change options menu back to normal
  2184     menu->StopDisplayingMenuBar();
  2197     menu->StopDisplayingMenuBar();
  2185     menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR);
  2198     menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR);
  2186     // Change background back to normal
  2199     // Change background back to normal
  2187     DisplayMarkingModeBgL( EFalse );   
  2200     DisplayMarkingModeBgL( EFalse );   
  2188     // Display drop down menu buttons
  2201     // Display drop down menu buttons
  2189     iNewEmailButton->ShowButtonL();
  2202     iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  2190     iFolderListButton->ShowButtonL();
       
  2191     iSortButton->ShowButtonL();
       
  2192     iNewEmailButton->SetDimmed( EFalse );
  2203     iNewEmailButton->SetDimmed( EFalse );
  2193     iFolderListButton->SetDimmed( EFalse );   
  2204     iFolderListButton->SetDimmed( EFalse );   
  2194     iSortButton->SetDimmed( EFalse );
  2205     iSortButton->SetDimmed( EFalse );
  2195     // Hide marking mode text on the place of drop down menus
  2206     ScaleControlBarL();
  2196     RemoveMarkingModeTitleTextL();
       
  2197     }
  2207     }
  2198 
  2208 
  2199 // ---------------------------------------------------------------------------
  2209 // ---------------------------------------------------------------------------
  2200 //
  2210 //
  2201 //
  2211 //
  2222         iFolderListButton->SetDimmed();   
  2232         iFolderListButton->SetDimmed();   
  2223         iSortButton->SetDimmed();
  2233         iSortButton->SetDimmed();
  2224         }
  2234         }
  2225     else
  2235     else
  2226         {
  2236         {
  2227         iNewEmailButton->HideButton();
  2237         TRect rect(0,0,0,0);
  2228         iFolderListButton->HideButton();
  2238         iControlBarControl->SetRectL( rect );
  2229         iSortButton->HideButton();
  2239         // Display marking mode text on the place of drop down menus   
  2230         }
  2240         DisplayMarkingModeTitleTextL();
  2231     // Display marking mode text on the place of drop down menus   
  2241         }
  2232     DisplayMarkingModeTitleTextL();
       
  2233     }
  2242     }
  2234 
  2243 
  2235 // ---------------------------------------------------------------------------
  2244 // ---------------------------------------------------------------------------
  2236 //
  2245 //
  2237 //
  2246 //
  2243     if ( iMarkingMode )
  2252     if ( iMarkingMode )
  2244         {
  2253         {
  2245         // Hide drop down menu buttons    
  2254         // Hide drop down menu buttons    
  2246         if( !Layout_Meta_Data::IsLandscapeOrientation() )
  2255         if( !Layout_Meta_Data::IsLandscapeOrientation() )
  2247             {
  2256             {
  2248             iNewEmailButton->ShowButtonL();
  2257             TRect rect(0,0,0,0);
  2249             iNewEmailButton->HideButton();
  2258             iControlBarControl->SetRectL( rect );
  2250             iFolderListButton->ShowButtonL();
  2259             DisplayMarkingModeTitleTextL();
  2251             iFolderListButton->HideButton();
       
  2252             iSortButton->ShowButtonL();    
       
  2253             iSortButton->HideButton();
       
  2254             }
  2260             }
  2255         else
  2261         else
  2256             {
  2262             {
  2257             iNewEmailButton->ShowButtonL();
  2263             iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  2258             iNewEmailButton->SetDimmed();
  2264             iNewEmailButton->SetDimmed();
  2259             iFolderListButton->ShowButtonL();
       
  2260             iFolderListButton->SetDimmed();
  2265             iFolderListButton->SetDimmed();
  2261             iSortButton->ShowButtonL();    
       
  2262             iSortButton->SetDimmed();
  2266             iSortButton->SetDimmed();
  2263             }
  2267             RemoveMarkingModeTitleTextL();
  2264   
  2268             }
  2265         RemoveMarkingModeTitleTextL();
       
  2266         DisplayMarkingModeTitleTextL();
       
  2267         }
  2269         }
  2268     }
  2270     }
  2269 
  2271 
  2270 // ---------------------------------------------------------------------------
  2272 // ---------------------------------------------------------------------------
  2271 //
  2273 //
  2513 
  2515 
  2514     if ( iAsyncRedrawer && iAsyncRedrawer->IsActive() )
  2516     if ( iAsyncRedrawer && iAsyncRedrawer->IsActive() )
  2515         {
  2517         {
  2516         iAsyncRedrawer->Cancel();
  2518         iAsyncRedrawer->Cancel();
  2517         DoRefresh( this );
  2519         DoRefresh( this );
  2518         }
       
  2519 
       
  2520     if (iMarkingModeWaitingToExit)
       
  2521         {
       
  2522         if ( iAppUi.CurrentActiveView()->Id() == MailListId )
       
  2523             {
       
  2524             iMarkingModeWaitingToExit = EFalse;
       
  2525             TRAP_IGNORE( ExitMarkingModeL() );
       
  2526             }
       
  2527         }
  2520         }
  2528     }
  2521     }
  2529 
  2522 
  2530 // ---------------------------------------------------------------------------
  2523 // ---------------------------------------------------------------------------
  2531 //
  2524 //
  3452 //
  3445 //
  3453 // ---------------------------------------------------------------------------
  3446 // ---------------------------------------------------------------------------
  3454 //
  3447 //
  3455 void CFSEmailUiMailListVisualiser::UpdateThemeL(const TBool aSystemUpdate)
  3448 void CFSEmailUiMailListVisualiser::UpdateThemeL(const TBool aSystemUpdate)
  3456     {
  3449     {
  3457     iSkinChanged = aSystemUpdate;
  3450     iSkinChanged = iSkinChanged || aSystemUpdate;
  3458 
  3451 
  3459     TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
  3452     TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
  3460     TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
  3453     TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
  3461 
  3454 
  3462     iNewEmailButton->SetNormalTextColor( normalTextColor );
  3455     iNewEmailButton->SetNormalTextColor( normalTextColor );
  3465     iFolderListButton->SetNormalTextColor( normalTextColor );
  3458     iFolderListButton->SetNormalTextColor( normalTextColor );
  3466     iFolderListButton->SetFocusedTextColor( focusedTextColor );
  3459     iFolderListButton->SetFocusedTextColor( focusedTextColor );
  3467 
  3460 
  3468     iSortButton->SetNormalTextColor( normalTextColor );
  3461     iSortButton->SetNormalTextColor( normalTextColor );
  3469     iSortButton->SetFocusedTextColor( focusedTextColor );
  3462     iSortButton->SetFocusedTextColor( focusedTextColor );
  3470     
  3463 
  3471     //TJOS-83DELP fix/workaround 
       
  3472     //sometimes theme wasn't properly refreshed on buttons, this helps
  3464     //sometimes theme wasn't properly refreshed on buttons, this helps
  3473     iNewEmailButton->HideButton();
  3465     iNewEmailButton->HideButton();
  3474     iNewEmailButton->ShowButtonL();
  3466     iNewEmailButton->ShowButtonL();
  3475     
  3467 
  3476     iFolderListButton->HideButton();
  3468     iFolderListButton->HideButton();
  3477     iFolderListButton->ShowButtonL();
  3469     iFolderListButton->ShowButtonL();
  3478     
  3470 
  3479     iSortButton->HideButton();
  3471     iSortButton->HideButton();
  3480     iSortButton->ShowButtonL();
  3472     iSortButton->ShowButtonL();
  3481     }
  3473     }
  3482 
  3474 
  3483 // ---------------------------------------------------------------------------
  3475 // ---------------------------------------------------------------------------
  5631 // ---------------------------------------------------------------------------
  5623 // ---------------------------------------------------------------------------
  5632 //
  5624 //
  5633 void CFSEmailUiMailListVisualiser::ScaleControlBarL()
  5625 void CFSEmailUiMailListVisualiser::ScaleControlBarL()
  5634 	{
  5626 	{
  5635     FUNC_LOG;
  5627     FUNC_LOG;
       
  5628     
       
  5629     if( !Layout_Meta_Data::IsLandscapeOrientation() && iMarkingMode)
       
  5630         {
       
  5631         // No control bar buttons in portrait marking mode
       
  5632         return;    
       
  5633         }    
       
  5634     
  5636     TRect screenRect = iAppUi.ClientRect();
  5635     TRect screenRect = iAppUi.ClientRect();
  5637 
  5636 
  5638 	// First set pos, widht and height
  5637 	// First set pos, widht and height
  5639   	iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  5638   	iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
  5640 
  5639 
  5656 	iNewEmailButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5655 	iNewEmailButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5657  	iFolderListButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5656  	iFolderListButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5658  	iSortButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5657  	iSortButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() );
  5659 
  5658 
  5660  	UpdateThemeL(EFalse);
  5659  	UpdateThemeL(EFalse);
  5661  	if (!iMarkingMode)
  5660 
  5662  	    {
  5661     iNewEmailButton->ShowButtonL();
  5663         iNewEmailButton->ShowButtonL();
  5662     iFolderListButton->ShowButtonL();
  5664         iFolderListButton->ShowButtonL();
  5663     iSortButton->ShowButtonL();
  5665         iSortButton->ShowButtonL();
       
  5666  	    }
       
  5667 	}
  5664 	}
  5668 
  5665 
  5669 // ---------------------------------------------------------------------------
  5666 // ---------------------------------------------------------------------------
  5670 //
  5667 //
  5671 //
  5668 //
  5844         TAlfTimedPoint(1, iAppUi.LayoutHandler()->ControlBarHeight() ));
  5841         TAlfTimedPoint(1, iAppUi.LayoutHandler()->ControlBarHeight() ));
  5845 
  5842 
  5846     // <cmail> Platform layout changes
  5843     // <cmail> Platform layout changes
  5847     TRect listRect = iAppUi.LayoutHandler()->GetListRect();
  5844     TRect listRect = iAppUi.LayoutHandler()->GetListRect();
  5848 	// Set anchors so that list leaves space for control bar
  5845 	// Set anchors so that list leaves space for control bar
       
  5846     if( Layout_Meta_Data::IsMirrored() ) 
       
  5847         { 
       
  5848         TInt tlX = listRect.iTl.iX; 
       
  5849         TInt brX = listRect.iBr.iX;
       
  5850         
       
  5851         listRect.iTl.iX = AknLayoutScalable_Avkon::Screen().LayoutLine().iW - brX; 
       
  5852         listRect.iBr.iX = AknLayoutScalable_Avkon::Screen().LayoutLine().iW - tlX; 
       
  5853         } 
  5849     iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1,
  5854     iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1,
  5850         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
  5855         EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
  5851         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
  5856         EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
  5852         TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY));
  5857         TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY));
  5853     iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1,
  5858     iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1,