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; |
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 |