void CGuideContainer::CalculatePortraitLayout() 
{
#ifdef NAV2_CLIENT_SERIES60_V3
   ActivateGc();
   CWindowGc& gc = SystemGc();
   gc.Clear(iCurrStreetLabel->Rect());
   SetLabelExtent(iCurrStreetLabel, CURRSTREET_LABEL_POS, ETrue);
   gc.Clear(iNextStreetLabel->Rect());
   SetLabelExtent(iNextStreetLabel, NEXTSTREET_LABEL_POS, ETrue);
   gc.Clear(iDistanceLabel->Rect());
   SetLabelExtent(iDistanceLabel, DISTANCE_LABEL_POS);

   CEikLabel* instructionLabel = GetTalkingLabel();
   
   // Resets the Edwin control for the screen reader
   gc.Clear(instructionLabel->Rect());
   SetLabelExtent(instructionLabel, TEXT_INSTRUCTION_POS);
	
   DeactivateGc();
   if (iProgressBar) {
      iProgressBar->SetSizeAndPosition(TRect( WFLayoutUtils::
                                              CalculatePosUsingMainPane( PROGRESS_BAR_POS ), 
                                              WFLayoutUtils::
                                              CalculateSizeUsingMainPane( 40, 90 ) ) );
   } else {
      iProgressBar = 
         CGuideProgressBar::NewL(*this, 
                                 TRect( WFLayoutUtils::CalculatePosUsingMainPane( PROGRESS_BAR_POS ), 
                                        WFLayoutUtils::CalculateSizeUsingMainPane( 40, 90 ) ), 
                                 iView->GetMbmName(),  
                                 EMbmWficonsProgress_triangle_grey,
                                 EMbmWficonsProgress_triangle_blue,
                                 EMbmWficonsProgress_triangle_grey_mask,
                                 EMbmWficonsProgress_bar_grey,
                                 EMbmWficonsProgress_bar_blue,
                                 EMbmWficonsProgress_bar_grey_mask);
   }
   
   TRect rect = WFLayoutUtils::GetMainPaneRect();
   CreatePictureL(iGuidePicture, rect, GUIDE_PICTURE_POS, 100, 100);
   //    CreatePictureL(iNextTurnPicture, rect, NEXT_TURN_PICTURE_POS, 24, 24);
   //    CreatePictureL(iDetourPicture, rect, DETOUR_PICTURE_POS, 24, 24);
   SetImage(iNextTurnPicture,
            iGuidePicture->GetRect(),
            &TopRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iDetourPicture,
            iGuidePicture->GetRect(),
            &LowerLeft, 0.24, 0.24, 
            WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   SetImage(iSpeedCamPicture, 
            iGuidePicture->GetRect(),
            &LowerRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   iDetourPicture->SetShow(EFalse);
   iSpeedCamPicture->SetShow(EFalse);
   
   iDetourPicture->CreateIconL(iView->GetMbmName(), 
                               EMbmWficonsDetour_square, 
                               EMbmWficonsDetour_square_mask);
   iSpeedCamPicture->CreateIconL(iView->GetMbmName(), 
                                 EMbmWficonsSpeedcamera_square, 
                                 EMbmWficonsSpeedcamera_square);

   TRect exitRect = Center(iGuidePicture->GetRect(), 
                           TRect(TPoint(), 
                                 WFLayoutUtils::
                                 CalculateSizeUsingSize(iGuidePicture->GetSize(), 
                                                        0.26, 0.16)));

   if (iExitPicture) {
      iExitPicture->SetImageRect(exitRect);
   } else {
      iExitPicture = CImageHandler::NewL(exitRect);
   }
   iExitPicture->SetShow(EFalse);

   // XXX Temporary removed until the above lines are tested.
   // CreatePictureL(iExitPicture, rect, EXIT_PICTURE_POS, 26, 16);

#endif
}
void CGuideContainer::CalculateLandscapeLayout()
{
#ifdef NAV2_CLIENT_SERIES60_V3
   // Landscape mode!

   // Clear all labeltexts before setting the new extent,
   // by doing this we will get rid of the text in the
   // old positions.
   ActivateGc();
   CWindowGc& gc = SystemGc();
   gc.Clear(iCurrStreetLabel->Rect());
   SetLabelExtent(iCurrStreetLabel, 
                  CURR_STREET_LABEL_X_LS, 
                  CURR_STREET_LABEL_Y_LS, 
                  ETrue);
   gc.Clear(iNextStreetLabel->Rect());
   SetLabelExtent(iNextStreetLabel, 
                  NEXT_STREET_LABEL_X_LS, 
                  NEXT_STREET_LABEL_Y_LS, 
                  ETrue);
   gc.Clear(iDistanceLabel->Rect());
   SetLabelExtent(iDistanceLabel, 
                  DIST_STREET_LABEL_X_LS, 
                  DIST_STREET_LABEL_Y_LS);
   // Resets the Edwin control for the screen reader
   CEikLabel* instructionLabel = GetTalkingLabel();
   gc.Clear(instructionLabel->Rect());
   SetLabelExtent(instructionLabel, 
                  TEXT_INSTRUCTION_X_LS, 
                  TEXT_INSTRUCTION_Y_LS);
	
   DeactivateGc();
   if (iGuidePicture) {
      // Recalculate
      iGuidePicture->SetImageRect(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.1, 0.15),
                                        WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.45, 0.70)));
   } else {
      iGuidePicture = 
         CImageHandler::NewL(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.1, 0.15),
                                   WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.45, 0.70)));
   }
   if (iProgressBar) {
      iProgressBar->SetSizeAndPosition(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.7, 0.15),
                                             WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.20, 0.6)));
   } else {
      iProgressBar = 
         CGuideProgressBar::NewL(*this, 
                                 TRect( WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.7, 0.15), 
                                        WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.20, 0.6)), 
                                 iView->GetMbmName(),  
                                 EMbmWficonsProgress_triangle_grey,
                                 EMbmWficonsProgress_triangle_blue,
                                 EMbmWficonsProgress_triangle_grey_mask,
                                 EMbmWficonsProgress_bar_grey,
                                 EMbmWficonsProgress_bar_blue,
                                 EMbmWficonsProgress_bar_grey_mask);
   }

   SetImage(iNextTurnPicture,
            iGuidePicture->GetRect(),
            &TopRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iDetourPicture,
            iGuidePicture->GetRect(),
            &LowerLeft, 0.24, 0.24, 
            WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iSpeedCamPicture,
            iGuidePicture->GetRect(),
            &LowerRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   iDetourPicture->SetShow(EFalse);
   iSpeedCamPicture->SetShow(EFalse);

   iDetourPicture->CreateIconL(iView->GetMbmName(), 
                               EMbmWficonsDetour_square, 
                               EMbmWficonsDetour_square_mask);
   iSpeedCamPicture->CreateIconL(iView->GetMbmName(), 
                                 EMbmWficonsSpeedcamera_square, 
                                 EMbmWficonsSpeedcamera_square);
   
   TRect exitRect = Center(iGuidePicture->GetRect(), 
                           TRect(TPoint(), 
                                 WFLayoutUtils::
                                 CalculateSizeUsingSize(iGuidePicture->GetSize(), 
                                                        0.26, 0.16)));
   if (iExitPicture) {
      iExitPicture->SetImageRect(exitRect);
   } else {
      iExitPicture = CImageHandler::NewL(exitRect);
   }
   iExitPicture->SetShow(EFalse);
#endif
}