uifw/AvKon/src/aknutils.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 4 8ca85d2f0db7
child 15 08e69e956a8c
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
   117 #include "AknLayoutUtilsHelpers.h"
   117 #include "AknLayoutUtilsHelpers.h"
   118 
   118 
   119 #include "AknAdaptiveSearch.h"
   119 #include "AknAdaptiveSearch.h"
   120 #include <PtiEngine.h>
   120 #include <PtiEngine.h>
   121 
   121 
   122 #include <akntrace.h> 
   122 #include "akntrace.h"
   123 
   123 
   124 #ifdef RD_HINDI_PHONETIC_INPUT
   124 #ifdef RD_HINDI_PHONETIC_INPUT
   125 #include <ptiindicdefs.h>
   125 #include <ptiindicdefs.h>
   126 #endif
   126 #endif
   127 
   127 
   131 
   131 
   132 const TInt KAknStringBufferSize = 256;
   132 const TInt KAknStringBufferSize = 256;
   133 const TInt KTextColorNone = -1;
   133 const TInt KTextColorNone = -1;
   134 const TInt KFontHeightComparisonDivisor = 20;
   134 const TInt KFontHeightComparisonDivisor = 20;
   135 const TInt KInvalidIndex = -1;
   135 const TInt KInvalidIndex = -1;
       
   136 
       
   137 // Default for list separator line color's alpha value, used if not
       
   138 // found from skin.
       
   139 const TInt KDefaultSeparatorAlpha = 32;
   136 
   140 
   137 enum TAknLayoutEdwinPanic
   141 enum TAknLayoutEdwinPanic
   138     {
   142     {
   139     EAknLayoutEdwinPanicNoEdwin,
   143     EAknLayoutEdwinPanicNoEdwin,
   140     EAknLayoutEdwinPanicNoLinesOverMaxNoLines,
   144     EAknLayoutEdwinPanicNoLinesOverMaxNoLines,
  3405 EXPORT_C TBool AknLayoutUtils::LayoutMetricsRect( TAknLayoutMetrics aParam,
  3409 EXPORT_C TBool AknLayoutUtils::LayoutMetricsRect( TAknLayoutMetrics aParam,
  3406                                                   TRect& aRect )
  3410                                                   TRect& aRect )
  3407     {
  3411     {
  3408     TAknWindowComponentLayout line;
  3412     TAknWindowComponentLayout line;
  3409     TAknLayoutRect rect;
  3413     TAknLayoutRect rect;
  3410     TRect screenRect(0, 0, AKN_LAYOUT_WINDOW_screen.iW, AKN_LAYOUT_WINDOW_screen.iH);
  3414     rect.LayoutRect( TRect( 0, 0, 0, 0 ), AknLayoutScalable_Avkon::Screen() );
  3411     aRect.SetRect( 0, 0, 0, 0 );
  3415     TRect screenRect( rect.Rect() );
  3412     
  3416     
  3413     // No stacon pane active etc. cheking is done here before the switch-case so that we can 
  3417     // No stacon pane active etc. cheking is done here before the switch-case so that we can 
  3414     // have slightly better performance for some other lookups (e.g. screen).
  3418     // have slightly better performance for some other lookups (e.g. screen).
  3415     
  3419     
  3416     switch (aParam)
  3420     switch ( aParam )
  3417         {
  3421         {
  3418         case EScreen:
  3422         case EScreen:
       
  3423             {
  3419             aRect = screenRect;
  3424             aRect = screenRect;
  3420             return ETrue;
  3425             return ETrue;
       
  3426             }
  3421 
  3427 
  3422         case EApplicationWindow:
  3428         case EApplicationWindow:
  3423             rect.LayoutRect(
  3429             {
  3424                 screenRect,
  3430             // Application window is always the same as screen, so skip
  3425                 AknLayoutScalable_Avkon::application_window( 0 ) );
  3431             // reading the application_window from layout data for
  3426             aRect = rect.Rect();
  3432             // performance improvement.
       
  3433             aRect = screenRect;
  3427             return ETrue;
  3434             return ETrue;
       
  3435             }
  3428 
  3436 
  3429         case EStatusPane:
  3437         case EStatusPane:
  3430             {
  3438             {
  3431             CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
  3439             CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
  3432             
  3440             
  3433             if ( statusPane )
  3441             if ( statusPane )
  3434                 {
  3442                 {
  3435                 TInt currentStatusPaneLayoutResId = statusPane->CurrentLayoutResId();
  3443                 TInt currentStatusPaneLayoutResId = statusPane->CurrentLayoutResId();
  3436                 
  3444 
  3437                 if ( AknStatuspaneUtils::StaconPaneActive() )
  3445                 TAknWindowComponentLayout parent;
       
  3446 
       
  3447                 switch ( currentStatusPaneLayoutResId )
  3438                     {
  3448                     {
  3439                     // flat status pane in landscape mode is the whole top pane area  
  3449                     case R_AVKON_STATUS_PANE_LAYOUT_USUAL_WITH_BATTERY_PANE:
  3440                     if ( currentStatusPaneLayoutResId == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
  3450                     case R_AVKON_STATUS_PANE_LAYOUT_USUAL:
  3441                          currentStatusPaneLayoutResId == R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT )
  3451                     case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE:
       
  3452                     case R_AVKON_STATUS_PANE_LAYOUT_USUAL_MIRRORED:
       
  3453                     case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE_MIRRORED:
       
  3454                     case R_AVKON_STATUS_PANE_LAYOUT_VT:
       
  3455                     case R_AVKON_STATUS_PANE_LAYOUT_VT_MIRRORED:
       
  3456                     case R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT:
       
  3457                     default:
  3442                         {
  3458                         {
  3443                         rect.LayoutRect( screenRect, AknLayoutScalable_Avkon::area_top_pane(8) ); // flat area_top_pane in lsc
  3459                         parent = AknLayoutScalable_Avkon::area_top_pane( 0 );
       
  3460                         line = AknLayoutScalable_Avkon::status_pane( 0 );
       
  3461                         break;
       
  3462                         }
       
  3463                     
       
  3464                     case R_AVKON_STATUS_PANE_LAYOUT_IDLE:
       
  3465                     case R_AVKON_STATUS_PANE_LAYOUT_IDLE_MIRRORED:
       
  3466                         {
       
  3467                         parent = AknLayoutScalable_Avkon::area_top_pane( 7 );
       
  3468                         line = AknLayoutScalable_Avkon::status_idle_pane(); // idle status pane
       
  3469                         break;
       
  3470                         }
       
  3471                         
       
  3472                     case R_AVKON_STATUS_PANE_LAYOUT_SMALL:
       
  3473                     case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE:
       
  3474                     case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE_MIRRORED:
       
  3475                         {
       
  3476                         // Small status pane is the whole top area.
       
  3477                         parent = AknLayoutScalable_Avkon::application_window( 0 );
       
  3478                         if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  3479                              AknLayoutUtils::CbaLocation() == AknLayoutUtils::EAknCbaLocationBottom )
       
  3480                             {
       
  3481                             line = AknLayoutScalable_Avkon::area_top_pane( 2 );
       
  3482                             }
       
  3483                         else
       
  3484                             {
       
  3485                             line = AknLayoutScalable_Avkon::area_top_pane( 1 );
       
  3486                             }
       
  3487                             
       
  3488                         break;
       
  3489                         }
       
  3490                         
       
  3491                     case R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT:
       
  3492                     case R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT: // fallthrough
       
  3493                         {
       
  3494                         if ( Layout_Meta_Data::IsLandscapeOrientation() )
       
  3495                             {
       
  3496                             parent = AknLayoutScalable_Avkon::area_top_pane( 2 );
       
  3497                             }
       
  3498                         else
       
  3499                             {
       
  3500                             parent = AknLayoutScalable_Avkon::area_top_pane( 6 );
       
  3501                             }
       
  3502                         line   = AknLayoutScalable_Avkon::status_pane( 1 ); // flat status pane
       
  3503                         break;
       
  3504                         }
       
  3505 
       
  3506                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL:
       
  3507                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE: // fallthrough
       
  3508                         {
       
  3509                         parent = AknLayoutScalable_Avkon::area_top_pane( 8 );
       
  3510                         line   = AknLayoutScalable_Avkon::status_pane( 1 );
       
  3511                         break;
       
  3512                         }
       
  3513 
       
  3514                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
       
  3515                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
       
  3516                         {
       
  3517                         parent = AknLayoutScalable_Avkon::area_top_pane( 2 );
       
  3518                         line   = AknLayoutScalable_Avkon::status_pane( 1 );
       
  3519                         break;
       
  3520                         }
       
  3521                         
       
  3522                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
       
  3523                     case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
       
  3524                         {
       
  3525                         parent = AknLayoutScalable_Avkon::area_top_pane( 20 );
       
  3526                         line   = AknLayoutScalable_Avkon::status_pane( 5 );
       
  3527                         break;
       
  3528                         }
       
  3529                         
       
  3530                     case R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT:
       
  3531                     case R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT:
       
  3532                     case R_AVKON_STACON_PANE_LAYOUT_EMPTY_SOFTKEYS_RIGHT:
       
  3533                     case R_AVKON_STACON_PANE_LAYOUT_EMPTY_SOFTKEYS_LEFT:        
       
  3534                     case R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT:
       
  3535                     case R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_LEFT:
       
  3536                         {
       
  3537                         rect.LayoutRect(
       
  3538                             screenRect,
       
  3539                             TAknWindowComponentLayout::Compose(
       
  3540                                 AknLayoutScalable_Avkon::area_top_pane( 2 ),
       
  3541                                 AknLayoutScalable_Avkon::stacon_top_pane() ) );
  3444                         aRect = rect.Rect();
  3542                         aRect = rect.Rect();
       
  3543 
       
  3544                         rect.LayoutRect(
       
  3545                             aRect,
       
  3546                             AknLayoutScalable_Avkon::control_top_pane_stacon( 0 ) );
       
  3547 
       
  3548                         // Status pane top = stacon top - control pane top.
       
  3549                         aRect.iBr.iX = rect.Rect().iTl.iX;
  3445                         return ETrue;
  3550                         return ETrue;
  3446                         }    
       
  3447                     else
       
  3448                         {
       
  3449                         rect.LayoutRect( screenRect, AknLayoutScalable_Avkon::area_top_pane(2) ); // classic area_top_pane in lsc
       
  3450                         aRect = rect.Rect();
       
  3451                         rect.LayoutRect( aRect, AknLayoutScalable_Avkon::stacon_top_pane() );
       
  3452                         aRect = rect.Rect();
       
  3453                         rect.LayoutRect( aRect, AknLayoutScalable_Avkon::control_top_pane_stacon(0) );
       
  3454                         aRect.iBr.iX = rect.Rect().iTl.iX;  // Status pane top = stacon top - control pane top.
       
  3455                         return ETrue;   
       
  3456                         }
  3551                         }
  3457                     }
  3552                     }
  3458                 else
  3553                 
  3459                     {
  3554                 rect.LayoutRect(
  3460                     TAknWindowComponentLayout parent;
  3555                     screenRect,
  3461                         
  3556                     TAknWindowComponentLayout::Compose( parent, line ) );
  3462                     switch ( currentStatusPaneLayoutResId )
  3557                 aRect = rect.Rect();
  3463                         {
       
  3464                         case R_AVKON_STATUS_PANE_LAYOUT_USUAL_WITH_BATTERY_PANE:
       
  3465                         case R_AVKON_STATUS_PANE_LAYOUT_USUAL:
       
  3466                         case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE:
       
  3467                         case R_AVKON_STATUS_PANE_LAYOUT_USUAL_MIRRORED:
       
  3468                         case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE_MIRRORED:
       
  3469                         case R_AVKON_STATUS_PANE_LAYOUT_VT:
       
  3470                         case R_AVKON_STATUS_PANE_LAYOUT_VT_MIRRORED:
       
  3471                         case R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT:
       
  3472                         default:
       
  3473                             parent = AknLayoutScalable_Avkon::area_top_pane(0);
       
  3474                             line = AknLayoutScalable_Avkon::status_pane(0); // classic status pane
       
  3475                             break;
       
  3476                         
       
  3477                         case R_AVKON_STATUS_PANE_LAYOUT_IDLE:
       
  3478                         case R_AVKON_STATUS_PANE_LAYOUT_IDLE_MIRRORED:
       
  3479                             parent = AknLayoutScalable_Avkon::area_top_pane(7);
       
  3480                             line = AknLayoutScalable_Avkon::status_idle_pane(); // idle status pane
       
  3481                             break;
       
  3482                             
       
  3483                         case R_AVKON_STATUS_PANE_LAYOUT_SMALL:
       
  3484                         case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE:
       
  3485                         case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE_MIRRORED:
       
  3486                             // Small status pane is the whole top area.
       
  3487                             parent = AknLayoutScalable_Avkon::application_window(0);
       
  3488                             if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  3489                                  AknLayoutUtils::CbaLocation() == AknLayoutUtils::EAknCbaLocationBottom )
       
  3490                                 {
       
  3491                                 line = AknLayoutScalable_Avkon::area_top_pane(2);
       
  3492                                 }
       
  3493                             else
       
  3494                                 {
       
  3495                                 line = AknLayoutScalable_Avkon::area_top_pane(1);
       
  3496                                 }
       
  3497                                 
       
  3498                             break;
       
  3499                             
       
  3500                         case R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT:
       
  3501                         case R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT: // fallthrough
       
  3502                             {
       
  3503                             if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  3504                                  Layout_Meta_Data::IsPenEnabled() )
       
  3505                                 {
       
  3506                                 parent = AknLayoutScalable_Avkon::area_top_pane( 2 );
       
  3507                                 }
       
  3508                             else
       
  3509                                 {
       
  3510                                 parent = AknLayoutScalable_Avkon::area_top_pane( 6 );
       
  3511                                 }
       
  3512                             line   = AknLayoutScalable_Avkon::status_pane( 1 ); // flat status pane
       
  3513                             break;
       
  3514                             }
       
  3515 
       
  3516                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL:
       
  3517                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE: // fallthrough
       
  3518                             {
       
  3519                             parent = AknLayoutScalable_Avkon::area_top_pane( 8 );
       
  3520                             line   = AknLayoutScalable_Avkon::status_pane( 1 );
       
  3521                             break;
       
  3522                             }
       
  3523 
       
  3524                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
       
  3525                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
       
  3526                             {
       
  3527                             parent = AknLayoutScalable_Avkon::area_top_pane( 2 );
       
  3528                             line   = AknLayoutScalable_Avkon::status_pane( 1 );
       
  3529                             break;
       
  3530                             }
       
  3531                             
       
  3532                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
       
  3533                         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
       
  3534                             {
       
  3535                             parent = AknLayoutScalable_Avkon::area_top_pane( 20 );
       
  3536                             line   = AknLayoutScalable_Avkon::status_pane( 5 );
       
  3537                             break;
       
  3538                             }
       
  3539                         }
       
  3540                         
       
  3541                     rect.LayoutRect( screenRect, TAknWindowComponentLayout::Compose( parent, line ) );
       
  3542                     aRect = rect.Rect();
       
  3543                     }
       
  3544                 return ETrue;
  3558                 return ETrue;
  3545                 }
  3559                 }
  3546             return EFalse;
  3560 
  3547             }
  3561             return EFalse; // no status pane
       
  3562             }
       
  3563 
  3548         case EPopupParent:
  3564         case EPopupParent:
  3549             {
  3565             {
  3550             if ( screenRect.iBr.iX == 640 && screenRect.iBr.iY == 360 )
  3566             if ( screenRect.iBr.iX == 640 && screenRect.iBr.iY == 360 )
  3551                 {
  3567                 {
  3552                 TInt variety = 16;
  3568                 TInt variety = 16;
  3576             else
  3592             else
  3577                 {
  3593                 {
  3578                 return LayoutMetricsRect( EMainPane, aRect );
  3594                 return LayoutMetricsRect( EMainPane, aRect );
  3579                 }
  3595                 }
  3580             }
  3596             }
       
  3597 
  3581         case EMainPane:
  3598         case EMainPane:
  3582             {
  3599             {
  3583             TInt variety = 3; // classic main pane variety by default
  3600             TInt variety = 3; // classic main pane variety by default
  3584             
  3601             
  3585             TInt currentStatusPaneLayoutResId = AknStatuspaneUtils::CurrentStatusPaneLayoutResId();
  3602             TInt currentStatusPaneLayoutResId = AknStatuspaneUtils::CurrentStatusPaneLayoutResId();
  3624                 case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE_MIRRORED:
  3641                 case R_AVKON_STATUS_PANE_LAYOUT_POWER_OFF_RECHARGE_MIRRORED:
  3625                 case R_AVKON_STATUS_PANE_LAYOUT_VT:
  3642                 case R_AVKON_STATUS_PANE_LAYOUT_VT:
  3626                 case R_AVKON_STATUS_PANE_LAYOUT_VT_MIRRORED:
  3643                 case R_AVKON_STATUS_PANE_LAYOUT_VT_MIRRORED:
  3627                 case R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT:
  3644                 case R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT:
  3628                     {
  3645                     {
  3629                     // main pane variety for usual portrait main pane with
  3646                     // Main pane variety for usual portrait main pane with
  3630                     // 'area_top_pane' and 'area_bottom_pane'
  3647                     // 'area_top_pane' and 'area_bottom_pane'.
  3631 #ifdef RD_SCALABLE_UI_V2
  3648                     variety = 3;
  3632                     variety = 3; 
  3649 
  3633                     if ( iAvkonAppUi && iAvkonAppUi->TouchPane() && iAvkonAppUi->TouchPane()->IsVisible() )
  3650                     if ( iAvkonAppUi )
  3634                         {
  3651                         {
  3635                         variety = 15;
  3652                         CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar(); 
  3636                         }
  3653                         if ( toolbar )
  3637                     else if ( iAvkonAppUi && iAvkonAppUi->CurrentFixedToolbar() )
  3654                             {
  3638                         {
  3655                             TInt flags = toolbar->ToolbarFlags(); 
  3639                         if ( AknLayoutUtils::PenEnabled() )
  3656                             if ( flags & KAknToolbarFixed &&
  3640                              {
  3657                                  !( flags & KAknToolbarDefault ) &&
  3641                              CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar(); 
  3658                                  toolbar->IsShown() ) 
  3642                              TInt flags = toolbar->ToolbarFlags(); 
       
  3643                              if ( flags & KAknToolbarFixed && !( flags & KAknToolbarDefault )
       
  3644                                 && toolbar->IsShown() ) 
       
  3645                                  {
  3659                                  {
  3646                                  variety = 18; 
  3660                                  variety = 18; 
  3647                                  }
  3661                                  }
  3648                              }
  3662                             }
  3649                         }
  3663                         }
  3650 #else
       
  3651                     variety = 3;
       
  3652 #endif // RD_SCALABLE_UI_V2    
       
  3653                     }
  3664                     }
  3654                     break;
  3665                     break;
  3655 
  3666 
  3656                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE:
  3667                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE:
  3657                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE_MIRRORED:
  3668                 case R_AVKON_STATUS_PANE_LAYOUT_IDLE_MIRRORED:
  3682                 case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE:
  3693                 case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE:
  3683                 case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE_MIRRORED:
  3694                 case R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE_MIRRORED:
  3684                     {
  3695                     {
  3685                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3696                     if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3686                         {
  3697                         {
  3687                         if ( PenEnabled() )
  3698                         // main pane variety with small status pane in landscape
  3688                             {
  3699                         // mode with 'area_top_pane', 'area_bottom_pane' and
  3689                             // main pane variety with small status pane in landscape
  3700                         // touch pane
  3690                             // mode with 'area_top_pane', 'area_bottom_pane' and
  3701                         variety = 4;
  3691                             // touch pane
       
  3692                             variety = 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                         }
  3702                         }
  3701                     else
  3703                     else
  3702                         {
  3704                         {
  3703                         // main pane variety with small status pane in portrait mode
  3705                         // main pane variety with small status pane in portrait mode
  3704                         // (with 'area_top_pane' and 'area_bottom_pane').
  3706                         // (with 'area_top_pane' and 'area_bottom_pane').
  3705                         variety = 6;                    
  3707                         variety = 6;                    
  3706                         }
  3708                         }
       
  3709 
       
  3710                     break;
  3707                     }
  3711                     }
  3708                     break;
       
  3709 
  3712 
  3710                 case R_AVKON_STATUS_PANE_EMPTY:
  3713                 case R_AVKON_STATUS_PANE_EMPTY:
  3711                 case R_AVKON_STATUS_PANE_LAYOUT_EMPTY:
  3714                 case R_AVKON_STATUS_PANE_LAYOUT_EMPTY:
  3712                     if ( AknStatuspaneUtils::HDLayoutActive() )
  3715                     if ( AknStatuspaneUtils::HDLayoutActive() )
  3713                         {
  3716                         {
  3779                     
  3782                     
  3780                 default:
  3783                 default:
  3781                     break;
  3784                     break;
  3782                 }
  3785                 }
  3783 
  3786 
  3784             rect.LayoutRect( screenRect, TAknWindowComponentLayout::Compose(
  3787             // Application window is always the same as screen, so use screen
  3785                                      AknLayoutScalable_Avkon::application_window( 0 ),
  3788             // as parent and skip reading the application_window from layout
  3786                                      AknLayoutScalable_Avkon::main_pane( variety ) ) );
  3789             // data for performance improvement.
       
  3790             rect.LayoutRect( screenRect,
       
  3791                              AknLayoutScalable_Avkon::main_pane( variety ) );
  3787                 
  3792                 
  3788             aRect = rect.Rect();
  3793             aRect = rect.Rect();
  3789             return ETrue;
  3794             return ETrue;
  3790             }
  3795             }
  3791 
  3796 
  6546         y >>= 1;
  6551         y >>= 1;
  6547         }
  6552         }
  6548     else
  6553     else
  6549         {
  6554         {
  6550         // On portrait popup is located on top of the control pane if it doesn't
  6555         // On portrait popup is located on top of the control pane if it doesn't
  6551         // have softkeys visible.
  6556         // have softkeys visible and there's enough room i.e. the popup still
       
  6557         // fits to the screen.
  6552         if ( !aSoftkeysVisible )
  6558         if ( !aSoftkeysVisible )
  6553             {
  6559             {
  6554             TSize controlPane;
  6560             TSize controlPane;
  6555             AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EControlPane,
  6561             AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EControlPane,
  6556                     controlPane );
  6562                     controlPane );
  6557             y -= controlPane.iHeight;
  6563             y -= controlPane.iHeight;
       
  6564             
       
  6565             if ( y < 0 )
       
  6566                 {
       
  6567                 y = 0;
       
  6568                 }
  6558             }
  6569             }
  6559         }
  6570         }
  6560 
  6571 
  6561     return TPoint( x, y );
  6572     return TPoint( x, y );
  6562     }
  6573     }
  6584     return Position( aSize, softkeys );
  6595     return Position( aSize, softkeys );
  6585     }
  6596     }
  6586 
  6597 
  6587 
  6598 
  6588 // -----------------------------------------------------------------------------
  6599 // -----------------------------------------------------------------------------
  6589 // AknListUtils::DrawSeparator
  6600 // Draws the separator line between list items.
  6590 // -----------------------------------------------------------------------------
  6601 // -----------------------------------------------------------------------------
  6591 //
  6602 //
  6592 EXPORT_C void AknListUtils::DrawSeparator( CGraphicsContext& aGc, 
  6603 EXPORT_C void AknListUtils::DrawSeparator( CGraphicsContext& aGc, 
  6593         const TRect& aRect, const TRgb& aColor )
  6604                                            const TRect& aRect,
       
  6605                                            const TRgb& aColor,
       
  6606                                            MAknsSkinInstance* aSkin )
  6594     {
  6607     {
  6595     aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
  6608     aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
  6596     aGc.SetPenStyle( CGraphicsContext::ESolidPen );
  6609     aGc.SetPenStyle( CGraphicsContext::ESolidPen );
  6597     TRgb color( aColor );
  6610     TRgb color( aColor );
  6598     color.SetAlpha( 32 );
  6611     
       
  6612     // Get the alpha value from skin.
       
  6613     TRgb colorFromSkin;
       
  6614     TInt err = AknsUtils::GetCachedColor( aSkin ? aSkin : AknsUtils::SkinInstance(),
       
  6615                                           colorFromSkin,
       
  6616                                           KAknsIIDQsnLineColors,
       
  6617                                           EAknsCIQsnLineColorsCG15 );
       
  6618     
       
  6619     color.SetAlpha( !err ? colorFromSkin.Red() : KDefaultSeparatorAlpha );
  6599     aGc.SetPenColor( color );
  6620     aGc.SetPenColor( color );
  6600     TRect lineRect( aRect );
  6621     TRect lineRect( aRect );
  6601     
  6622     
  6602     TInt gap = AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ).LayoutLine().it; 
  6623     TInt gap = AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ).LayoutLine().it; 
  6603     lineRect.Shrink( gap, 0 );
  6624     lineRect.Shrink( gap, 0 );
  6604     lineRect.Move( 0, -1 );
  6625     lineRect.Move( 0, -1 );
  6605     aGc.DrawLine( TPoint( lineRect.iTl.iX, lineRect.iBr.iY ), 
  6626     aGc.DrawLine( TPoint( lineRect.iTl.iX, lineRect.iBr.iY ), 
  6606             TPoint( lineRect.iBr.iX, lineRect.iBr.iY ) );
  6627                   TPoint( lineRect.iBr.iX, lineRect.iBr.iY ) );
  6607     }
  6628     }
  6608 
  6629 
  6609 // End of file
  6630 // End of file
  6610 
  6631