uifw/AvKon/src/aknutils.cpp
branchCompilerCompatibility
changeset 8 b57f3d42a10e
parent 4 8ca85d2f0db7
child 10 9f56a4e1b8ab
equal deleted inserted replaced
6:05fbbb041e1f 8:b57f3d42a10e
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  3522                             }
  3522                             }
  3523 
  3523 
  3524                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  3524                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  3525                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
  3525                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
  3526                             {
  3526                             {
  3527                             parent = AknLayoutScalable_Avkon::area_top_pane( 19 );
  3527                             parent = AknLayoutScalable_Avkon::area_top_pane( 2 );
  3528                             line   = AknLayoutScalable_Avkon::status_pane( 4 );
  3528                             line   = AknLayoutScalable_Avkon::status_pane( 1 );
  3529                             break;
  3529                             break;
  3530                             }
  3530                             }
  3531                             
  3531                             
  3532                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
  3532                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
  3533                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
  3533                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
  3665                 case R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT:
  3665                 case R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT:
  3666                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT:
  3666                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT:
  3667                     {                    
  3667                     {                    
  3668                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3668                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3669                         {
  3669                         {
  3670                         if ( PenEnabled() )
  3670                         // main pane variety with 'area_top_pane' and
  3671                             {
  3671                         // 'area_bottom_pane' in landscape (without touch pane).
  3672                             // This is quite awkward but necessary since the fixed
  3672                         variety = 9;
  3673                             // toolbar area can be used by the application main pane
       
  3674                             // if the application doesn't use toolbar.
       
  3675                             TBool toolbarVisible( EFalse );
       
  3676                             if ( iAvkonAppUi )
       
  3677                                 {
       
  3678                                 CAknToolbar* fixedToolbar =
       
  3679                                     iAvkonAppUi->CurrentFixedToolbar();
       
  3680                                 if ( fixedToolbar )
       
  3681                                     {
       
  3682                                     TInt toolbarFlags(  fixedToolbar->ToolbarFlags() );
       
  3683                                     if ( toolbarFlags & KAknToolbarFixed &&
       
  3684                                          !( toolbarFlags & KAknToolbarDefault ) &&
       
  3685                                          fixedToolbar->IsShown()  )
       
  3686                                         {
       
  3687                                         toolbarVisible = ETrue;
       
  3688                                         }
       
  3689                                     }
       
  3690                                 }
       
  3691 
       
  3692                             variety = toolbarVisible ? 21 : 4;
       
  3693                             }
       
  3694                         else
       
  3695                             {
       
  3696                             // main pane variety with 'area_top_pane' and 
       
  3697                             // 'area_bottom_pane' in landscape (without touch pane).
       
  3698                             variety = 9;             
       
  3699                             }                    
       
  3700                         }
  3673                         }
  3701                     else
  3674                     else
  3702                         {
  3675                         {
  3703                         // main pane variety with thin portrait status pane 
  3676                         // main pane variety with thin portrait status pane 
  3704                         variety = 7;
  3677                         variety = 7;
  3759                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  3732                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  3760                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT:
  3733                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT:
  3761                     {
  3734                     {
  3762                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3735                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3763                         {
  3736                         {
  3764                         variety = 21;
  3737                         // This is quite awkward but necessary since the fixed
       
  3738                         // toolbar area can be used by the application main pane
       
  3739                         // if the application doesn't use toolbar.
       
  3740                         TBool toolbarVisible( EFalse );
       
  3741                         if ( iAvkonAppUi )
       
  3742                             {
       
  3743                             CAknToolbar* fixedToolbar =
       
  3744                                 iAvkonAppUi->CurrentFixedToolbar();
       
  3745                             if ( fixedToolbar )
       
  3746                                 {
       
  3747                                 TInt toolbarFlags( fixedToolbar->ToolbarFlags() );
       
  3748                                 if ( toolbarFlags & KAknToolbarFixed &&
       
  3749                                      !( toolbarFlags & KAknToolbarDefault ) &&
       
  3750                                      fixedToolbar->IsShown()  )
       
  3751                                     {
       
  3752                                     toolbarVisible = ETrue;
       
  3753                                     }
       
  3754                                 }
       
  3755                             }
       
  3756 
       
  3757                         variety = toolbarVisible ? 21 : 4;
  3765                         }
  3758                         }
  3766                     break;
  3759                     break;
  3767                     }
  3760                     }
  3768 
  3761 
  3769                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
  3762                 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
  6545     TRect screen( layoutRect.Rect() );
  6538     TRect screen( layoutRect.Rect() );
  6546     
  6539     
  6547     TInt x = ( screen.Width() - aSize.iWidth ) >> 1;
  6540     TInt x = ( screen.Width() - aSize.iWidth ) >> 1;
  6548     TInt y = screen.Height() - aSize.iHeight;
  6541     TInt y = screen.Height() - aSize.iHeight;
  6549 
  6542 
  6550     // Popups are centered on y-axis if screen orientation is landscape or
  6543     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  6551     // softkeys are not visible.
  6544         {
  6552     if ( !aSoftkeysVisible || Layout_Meta_Data::IsLandscapeOrientation() )
  6545         // popups are centered on y-axis on landscape orientation
  6553         {
  6546         y >>= 1;
  6554         y >>= 1; 
  6547         }
       
  6548     else
       
  6549         {
       
  6550         // On portrait popup is located on top of the control pane if it doesn't
       
  6551         // have softkeys visible.
       
  6552         if ( !aSoftkeysVisible )
       
  6553             {
       
  6554             TSize controlPane;
       
  6555             AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EControlPane,
       
  6556                     controlPane );
       
  6557             y -= controlPane.iHeight;
       
  6558             }
  6555         }
  6559         }
  6556 
  6560 
  6557     return TPoint( x, y );
  6561     return TPoint( x, y );
  6558     }
  6562     }
  6559 
  6563 
  6577             }
  6581             }
  6578         }
  6582         }
  6579     
  6583     
  6580     return Position( aSize, softkeys );
  6584     return Position( aSize, softkeys );
  6581     }
  6585     }
  6582     
  6586 
       
  6587 
       
  6588 // -----------------------------------------------------------------------------
       
  6589 // AknListUtils::DrawSeparator
       
  6590 // -----------------------------------------------------------------------------
       
  6591 //
       
  6592 EXPORT_C void AknListUtils::DrawSeparator( CGraphicsContext& aGc, 
       
  6593         const TRect& aRect, const TRgb& aColor )
       
  6594     {
       
  6595     aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
  6596     aGc.SetPenStyle( CGraphicsContext::ESolidPen );
       
  6597     TRgb color( aColor );
       
  6598     color.SetAlpha( 32 );
       
  6599     aGc.SetPenColor( color );
       
  6600     TRect lineRect( aRect );
       
  6601     
       
  6602     TInt gap = AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ).LayoutLine().it; 
       
  6603     lineRect.Shrink( gap, 0 );
       
  6604     lineRect.Move( 0, -1 );
       
  6605     aGc.DrawLine( TPoint( lineRect.iTl.iX, lineRect.iBr.iY ), 
       
  6606             TPoint( lineRect.iBr.iX, lineRect.iBr.iY ) );
       
  6607     }
       
  6608 
  6583 // End of file
  6609 // End of file
  6584 
  6610