emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 10 f5907b1a1053
child 16 b5fbb9b25d57
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
   169     scrollBarRect.LayoutRect( mainPaneRect,
   169     scrollBarRect.LayoutRect( mainPaneRect,
   170     	AknLayoutScalable_Avkon::aid_size_touch_scroll_bar() );
   170     	AknLayoutScalable_Avkon::aid_size_touch_scroll_bar() );
   171     TRect gridRect = mainPaneRect;
   171     TRect gridRect = mainPaneRect;
   172     gridRect.iBr.iX -= scrollBarRect.Rect().Width();
   172     gridRect.iBr.iX -= scrollBarRect.Rect().Width();
   173 
   173 
   174     TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0;
   174     iVisibleRows = iAppUi.LayoutHandler()->GridRowsInThisResolution();
   175     iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1;
   175     iVisibleColumns = iAppUi.LayoutHandler()->GridColumnsInThisResolution();
   176     iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1;
       
   177 
   176 
   178     iStartupAnimation = ETrue;
   177     iStartupAnimation = ETrue;
   179     iCurrentLevel.iSelected = KDefaultSelection;
   178     iCurrentLevel.iSelected = KDefaultSelection;
   180     CAlfTextureManager& manager = iEnv.TextureManager();
   179     CAlfTextureManager& manager = iEnv.TextureManager();
   181 
   180 
   212 
   211 
   213     UpdateFocusVisibility();
   212     UpdateFocusVisibility();
   214     iSelectorImageVisual = CAlfImageVisual::AddNewL( *iControl, iSelector );
   213     iSelectorImageVisual = CAlfImageVisual::AddNewL( *iControl, iSelector );
   215     iSelectorImageVisual->SetScaleMode( CAlfImageVisual::EScaleFit );
   214     iSelectorImageVisual->SetScaleMode( CAlfImageVisual::EScaleFit );
   216 
   215 
       
   216     const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 );
       
   217 
   217     // Use layout data instead of hard-coded values
   218     // Use layout data instead of hard-coded values
   218     iSelectorImageVisual->SetSize( iAppUi.LayoutHandler()->SelectorVisualSizeInThisResolution() );
       
   219     TAknLayoutRect itemRect;
   219     TAknLayoutRect itemRect;
   220     itemRect.LayoutRect( gridRect,
   220     itemRect.LayoutRect( gridRect,
   221     	AknLayoutScalable_Apps::cell_cmail_l_pane( var, 0, 0 ) );
   221     	AknLayoutScalable_Apps::cell_cmail_l_pane( var, 0, 0 ) );
   222     iSelectorImageVisual->SetSize( itemRect.Rect().Size() );
   222     iSelectorImageVisual->SetSize( itemRect.Rect().Size() );
   223     iSelectorImageVisual->EnableBrushesL();
   223     iSelectorImageVisual->EnableBrushesL();
  2056 
  2056 
  2057 	    TAknLayoutRect selectorRect;
  2057 	    TAknLayoutRect selectorRect;
  2058 	    selectorRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::grid_highlight_pane_cp018(var));
  2058 	    selectorRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::grid_highlight_pane_cp018(var));
  2059 
  2059 
  2060 	    CFSEmailUiLayoutHandler* layoutHandler = iAppUi.LayoutHandler();
  2060 	    CFSEmailUiLayoutHandler* layoutHandler = iAppUi.LayoutHandler();
  2061 	    iSelectorImageVisual->SetSize( selectorRect.Rect().Size() ); // layoutHandler->SelectorVisualSizeInThisResolution() );
  2061 	    iSelectorImageVisual->SetSize( selectorRect.Rect().Size() );
  2062 
  2062 
  2063 	    TSize displaySize = mainPaneRect.Size();//iControl->DisplayArea().Size();
  2063 	    TSize displaySize = mainPaneRect.Size();
  2064 
  2064 
  2065 	    TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; //layoutHandler->GridColumnsInThisResolution();
  2065 	    TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; 
  2066 	    TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; //layoutHandler->GridRowsInThisResolution();
  2066 	    TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; 
  2067 
  2067 
  2068 	// </cmail>
  2068 	// </cmail>
  2069 
  2069 
  2070         iCurrentLevel.iGridLayout->SetSize( gridRect.Size() );
  2070         iCurrentLevel.iGridLayout->SetSize( gridRect.Size() );
  2071         iCurrentLevel.iGridLayout->SetColumnsL( columns );
  2071         iCurrentLevel.iGridLayout->SetColumnsL( columns );
  2157 	    // <cmail>
  2157 	    // <cmail>
  2158         TRect scrollbarRect;
  2158         TRect scrollbarRect;
  2159         scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY);
  2159         scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY);
  2160         scrollbarRect.Move(mainPaneRect.iTl);
  2160         scrollbarRect.Move(mainPaneRect.iTl);
  2161         iScrollbar->SetRect(scrollbarRect);
  2161         iScrollbar->SetRect(scrollbarRect);
       
  2162         iScrollbar->DrawDeferred();
  2162 	    // </cmail>
  2163 	    // </cmail>
  2163         iRefreshNeeded = EFalse;
  2164         iRefreshNeeded = EFalse;
  2164         }
  2165         }
  2165     }
  2166     }
  2166 
  2167 
  2687 	iStylusPopUpMenu->ShowMenu();
  2688 	iStylusPopUpMenu->ShowMenu();
  2688 	iStylusPopUpMenuLaunched = ETrue;
  2689 	iStylusPopUpMenuLaunched = ETrue;
  2689 	}
  2690 	}
  2690 
  2691 
  2691 void CFSEmailUiLauncherGridVisualiser::HandleAppForegroundEventL( TBool aForeground )
  2692 void CFSEmailUiLauncherGridVisualiser::HandleAppForegroundEventL( TBool aForeground )
  2692 	{
  2693     {
  2693 	CFsEmailUiViewBase::HandleAppForegroundEventL( aForeground );
  2694     FUNC_LOG;
  2694 	// If the view is not visible try to visualise it after a while
  2695     
  2695 	if ( aForeground && ( !iWasActiveControlGroup ) )
  2696     // If the view is not visible try to visualise it after a while
  2696 		{
  2697     if ( aForeground && !iWasActiveControlGroup )
  2697 		//
  2698         {
  2698 		iStartupCallbackTimer->Cancel(); // just in case
  2699         iStartupCallbackTimer->Cancel(); // just in case
  2699 		iStartupCallbackTimer->SetPriority( CActive::EPriorityIdle );
  2700         iStartupCallbackTimer->SetPriority( CActive::EPriorityIdle );
  2700 		// EPriorityIdle, EPriorityLow, EPriorityStandard 
  2701         iStartupCallbackTimer->Start( 200 );
  2701 		iStartupCallbackTimer->Start( 200 );
  2702         }
  2702 		}
  2703 
  2703 	}
  2704     CFsEmailUiViewBase::HandleAppForegroundEventL( aForeground );	
  2704 
  2705     }
       
  2706 
       
  2707 // ----------------------------------------------------------------------------
       
  2708 // CFSEmailUiLauncherGridVisualiser::TimerEventL()
  2705 // Fire timer callback
  2709 // Fire timer callback
       
  2710 // ----------------------------------------------------------------------------
  2706 void CFSEmailUiLauncherGridVisualiser::TimerEventL( CFSEmailUiGenericTimer* /* aTriggeredTimer */ )
  2711 void CFSEmailUiLauncherGridVisualiser::TimerEventL( CFSEmailUiGenericTimer* /* aTriggeredTimer */ )
  2707 {
  2712     {
  2708   // if view is still active then 
  2713     FUNC_LOG;
  2709   if ( ( NULL != iAppUi.CurrentActiveView() ) && ( iAppUi.CurrentActiveView()->Id() == Id() ) )	  
  2714 
  2710 		  {
  2715     // if view is still active then 
  2711 		  iWasActiveControlGroup = ETrue;
  2716     if ( iAppUi.CurrentActiveView() && iAppUi.CurrentActiveView()->Id() == Id() )	  
  2712 		  HandleAppForegroundEventL( ETrue );
  2717         {
  2713 		  }
  2718         iWasActiveControlGroup = ETrue;
  2714 };
  2719         CFsEmailUiViewBase::HandleAppForegroundEventL( ETrue );
  2715 
  2720         }
       
  2721 
       
  2722     iStartupCallbackTimer->Cancel();
       
  2723     }
       
  2724