uifw/EikStd/coctlsrc/eikcba.cpp
branchRCL_3
changeset 23 3d340a0166ff
parent 16 71dd06cfe933
child 25 941195f2d488
equal deleted inserted replaced
18:0aa5fbdfbc30 23:3d340a0166ff
    54 #include <AknTasHook.h>
    54 #include <AknTasHook.h>
    55 #include <akncbacontentobserver.h>
    55 #include <akncbacontentobserver.h>
    56 #include <aknitemactionmenu.h>
    56 #include <aknitemactionmenu.h>
    57 #include "akncollectionobserver.h"
    57 #include "akncollectionobserver.h"
    58 #include "aknitemactionmenuregister.h"
    58 #include "aknitemactionmenuregister.h"
       
    59 #include "aknmarkingmode.h"
    59 #include "akntrace.h"
    60 #include "akntrace.h"
    60 /**
    61 /**
    61  * Color value for transparent pixel (ARGB format).
    62  * Color value for transparent pixel (ARGB format).
    62  */
    63  */
    63 const TUint32 KAknCbaColorKey = 0x00000000;
    64 const TUint32 KAknCbaColorKey = 0x00000000;
   211     ECbaParentAsControl, // cba's parent window group is treated as CCoeControl
   212     ECbaParentAsControl, // cba's parent window group is treated as CCoeControl
   212     ECbaActivationDelayed, // activation delayed
   213     ECbaActivationDelayed, // activation delayed
   213     ECbaSingleClickEnabled, // single click enabled in appUi
   214     ECbaSingleClickEnabled, // single click enabled in appUi
   214     ECbaItemSoftkeyDisabled, // item specific softkey disabled
   215     ECbaItemSoftkeyDisabled, // item specific softkey disabled
   215     ECbaItemSpecificSoftkeyInUse, // item specific softkey is in use
   216     ECbaItemSpecificSoftkeyInUse, // item specific softkey is in use
   216     ECbaItemSoftkeyDisabledByClient // client has disabled item specific softkey
   217     ECbaItemSoftkeyDisabledByClient, // client disabled item specific softkey
       
   218     ECbaMultipleMarkingActive // multiple marking has changed RSK
   217     };
   219     };
   218 
   220 
   219 enum TCbaLayers
   221 enum TCbaLayers
   220     {
   222     {
   221     ECbaLayerWallpaper,
   223     ECbaLayerWallpaper,
   715                 aRightButton );
   717                 aRightButton );
   716         _AKNTRACE_FUNC_EXIT;
   718         _AKNTRACE_FUNC_EXIT;
   717         }
   719         }
   718 
   720 
   719     /**
   721     /**
       
   722      * Returns ETrue if the command cancels multiple marking and should not
       
   723      * be forwarded to actual command observer.
       
   724      * 
       
   725      * @return ETrue if multiple marking was cancelled.
       
   726      */
       
   727     TBool CancelMultipleMarking( TInt aCommandId )
       
   728         {
       
   729         _AKNTRACE_FUNC_ENTER;
       
   730         TBool cancelled( EFalse );
       
   731         if ( aCommandId == EAknSoftkeyCancel
       
   732                 && iItemActionMenu
       
   733                 && iOwner.Flags().IsSet( ECbaMultipleMarkingActive ) )
       
   734             {
       
   735             iItemActionMenu->MarkingMode().SetCollectionMultipleMarkingState(
       
   736                     EFalse );
       
   737             cancelled = ETrue;
       
   738             }
       
   739         _AKNTRACE_FUNC_EXIT;
       
   740         return cancelled;
       
   741         }
       
   742 
       
   743     /**
   720      * From MAknCollectionObserver.
   744      * From MAknCollectionObserver.
   721      * This method is used to set the item action menu to observer.
   745      * This method is used to set the item action menu to observer.
   722      * 
   746      * 
   723      * @param aItemActionMenu Item action menu. 
   747      * @param aItemActionMenu Item action menu. 
   724      */
   748      */
   743         if ( aCollectionVisible
   767         if ( aCollectionVisible
   744                 || iOwner.Flags().IsClear( ECbaItemSoftkeyDisabled ) )
   768                 || iOwner.Flags().IsClear( ECbaItemSoftkeyDisabled ) )
   745             {
   769             {
   746             iOwner.UpdateItemSpecificSoftkey();
   770             iOwner.UpdateItemSpecificSoftkey();
   747             }
   771             }
       
   772 
       
   773         iOwner.UpdateMultipleMarkingSoftkey();
   748         _AKNTRACE_FUNC_EXIT;
   774         _AKNTRACE_FUNC_EXIT;
   749         }
   775         }
   750 
   776 
   751     /**
   777     /**
   752      * From MAknCollectionObserver.
   778      * From MAknCollectionObserver.
   762         }
   788         }
   763     
   789     
   764     /*
   790     /*
   765      * Using the special theme Id draw background
   791      * Using the special theme Id draw background
   766      */
   792      */
   767     void DrawSemiTransparency( CWindowGc& aGc, 
   793     void DrawSemiTransparency( CWindowGc& aGc )
   768             const TRect& aRect )
       
   769         {
   794         {
   770         _AKNTRACE_FUNC_ENTER;
   795         _AKNTRACE_FUNC_ENTER;
   771         aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   796         
   772         aGc.SetBrushColor( TRgb(128, 128, 128, 64) );
   797         TAknsItemID SemiButtonID              = KAknsIIDQgnFrSctrlSkButton;
   773         aGc.Clear();
   798         TAknsItemID SemiButtonCenterID        = KAknsIIDQgnFrSctrlSkButtonCenter;
   774         
   799         TAknsItemID SemiButtonPressedID       = KAknsIIDQgnFrSctrlSkButtonPressed;
   775         TAknsItemID SemiButtonID = KAknsIIDQgnHomeButtonWidget;
   800         TAknsItemID SemiButtonPressedCenterID = KAknsIIDQgnFrSctrlSkButtonCenterPressed;
   776         TAknsItemID SemiButtonCenterID = KAknsIIDQgnHomeButtonWidgetCenter;
   801         
   777         TAknsItemID SemiButtonPressedID = KAknsIIDQgnHomeButtonWidget;
       
   778         TAknsItemID SemiButtonPressedCenterID = KAknsIIDQsnFrHomeCenterPressed;
       
   779 
       
   780         CEikCbaButton* button1 = static_cast<CEikCbaButton*>
   802         CEikCbaButton* button1 = static_cast<CEikCbaButton*>
   781             (iOwner.Control(KControlArrayCBAButton1Posn));
   803             (iOwner.Control(KControlArrayCBAButton1Posn));
   782         CEikCbaButton* button2 = static_cast<CEikCbaButton*>
   804         CEikCbaButton* button2 = static_cast<CEikCbaButton*>
   783             (iOwner.Control(KControlArrayCBAButton2Posn));
   805             (iOwner.Control(KControlArrayCBAButton2Posn));
   784 
   806 
   785         if (IsMskEnabledLayoutActive())
   807         if (IsMskEnabledLayoutActive())
   786             {
   808             {
   787             TRect innerRect = iMiddleFrameOuterRect;
       
   788             innerRect.Shrink(4, 4);
       
   789 
       
   790             CEikCbaButton* buttonMSK = static_cast<CEikCbaButton*>
   809             CEikCbaButton* buttonMSK = static_cast<CEikCbaButton*>
   791                 (iOwner.Control(KControlArrayCBAButtonMSKPosn));
   810                 (iOwner.Control(KControlArrayCBAButtonMSKPosn));
   792 
   811 
   793             if (buttonMSK && buttonMSK->PressedDown())
   812             if (buttonMSK && buttonMSK->PressedDown())
   794                 {
   813                 {
   795                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   814                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   796                         iMiddleFrameOuterRect,
   815                         iMiddleFrameOuterRect,
   797                         innerRect,//iMiddleFrameInnerRect,
   816                         iMiddleFrameInnerRect,
   798                         SemiButtonPressedID,
   817                         SemiButtonPressedID,
   799                         SemiButtonPressedCenterID);
   818                         SemiButtonPressedCenterID);
   800                 }
   819                 }
   801             else
   820             else
   802                 {
   821                 {
   803                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   822                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   804                         iMiddleFrameOuterRect,
   823                         iMiddleFrameOuterRect,
   805                         innerRect,//iMiddleFrameInnerRect,
   824                         iMiddleFrameInnerRect,
   806                         SemiButtonID,
   825                         SemiButtonID,
   807                         SemiButtonCenterID);
   826                         SemiButtonCenterID);
   808                 }
   827                 }
   809             }
   828             }
   810 
   829 
   811         TRect innerRect = iLeftFrameOuterRect;
       
   812         innerRect.Shrink(4, 4);
       
   813 
       
   814         if (button1 && button1->PressedDown())
   830         if (button1 && button1->PressedDown())
   815             {
   831             {
   816             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   832             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   817                     iLeftFrameOuterRect,
   833                     iLeftFrameOuterRect,
   818                     innerRect,//iLeftFrameInnerRect,
   834                     iLeftFrameInnerRect,
   819                     SemiButtonPressedID,
   835                     SemiButtonPressedID,
   820                     SemiButtonPressedCenterID);
   836                     SemiButtonPressedCenterID);
   821             }
   837             }
   822         else
   838         else
   823             {
   839             {
   824             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   840             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   825                     iLeftFrameOuterRect,
   841                     iLeftFrameOuterRect,
   826                     innerRect,//iLeftFrameInnerRect,
   842                     iLeftFrameInnerRect,
   827                     SemiButtonID,
   843                     SemiButtonID,
   828                     SemiButtonCenterID);
   844                     SemiButtonCenterID);
   829             }
   845             }
   830 
   846 
   831         innerRect = iRightFrameOuterRect;
       
   832         innerRect.Shrink(4, 4);
       
   833         if (button2 && button2->PressedDown())
   847         if (button2 && button2->PressedDown())
   834             {
   848             {
   835             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   849             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   836                     iRightFrameOuterRect,
   850                     iRightFrameOuterRect,
   837                     innerRect,//iRightFrameInnerRect,
   851                     iRightFrameInnerRect,
   838                     SemiButtonPressedID,
   852                     SemiButtonPressedID,
   839                     SemiButtonPressedCenterID);
   853                     SemiButtonPressedCenterID);
   840             }
   854             }
   841         else
   855         else
   842             {
   856             {
   843             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   857             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
   844                     iRightFrameOuterRect,
   858                     iRightFrameOuterRect,
   845                     innerRect,//iRightFrameInnerRect,
   859                     iRightFrameInnerRect,
   846                     SemiButtonID,
   860                     SemiButtonID,
   847                     SemiButtonCenterID);
   861                     SemiButtonCenterID);
   848             }                    
   862             }                    
   849         _AKNTRACE_FUNC_EXIT;
   863         _AKNTRACE_FUNC_EXIT;
   850         }
   864         }
  1604                 (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->ActivateL();
  1618                 (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->ActivateL();
  1605                 }
  1619                 }
  1606             }
  1620             }
  1607         }
  1621         }
  1608 
  1622 
  1609     // Set CBA faded in case the softkeys are empty.
       
  1610     SetFadeState();
       
  1611     _AKNTRACE_FUNC_EXIT;
  1623     _AKNTRACE_FUNC_EXIT;
  1612     }
  1624     }
  1613 
  1625 
  1614 
  1626 
  1615 void CEikCba::ConstructFromResourceL(TResourceReader& aReader)
  1627 void CEikCba::ConstructFromResourceL(TResourceReader& aReader)
  1701             {
  1713             {
  1702             (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->ActivateL();
  1714             (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->ActivateL();
  1703             }
  1715             }
  1704         }
  1716         }
  1705 
  1717 
  1706     // Set CBA faded in case the softkeys are empty.
       
  1707     SetFadeState();
       
  1708     _AKNTRACE_FUNC_EXIT;
  1718     _AKNTRACE_FUNC_EXIT;
  1709     }
  1719     }
  1710 
  1720 
  1711 
  1721 
  1712 TInt CEikCba::MaxCommands() const
  1722 TInt CEikCba::MaxCommands() const
  2050                            const TDesC* aText, 
  2060                            const TDesC* aText, 
  2051                            const CFbsBitmap* /*aBitmap*/,
  2061                            const CFbsBitmap* /*aBitmap*/,
  2052                            const CFbsBitmap* /*aMask*/ )
  2062                            const CFbsBitmap* /*aMask*/ )
  2053     {
  2063     {
  2054     _AKNTRACE_FUNC_ENTER;
  2064     _AKNTRACE_FUNC_ENTER;
  2055     // We need to check if this call changes the softkeys from being
  2065 
  2056     // empty to having a command or vice versa to be able to maintain
       
  2057     // correct fade state.
       
  2058     TBool isEmptyBefore( IsEmpty() );
       
  2059     
       
  2060     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2066     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2061     groupCtrl.iId = aCommandId;
  2067     groupCtrl.iId = aCommandId;
  2062     groupCtrl.iLongId = 0;
  2068     groupCtrl.iLongId = 0;
  2063     if ( !iFlags.IsSet( ECbaInsideDialog ) )
  2069     if ( !iFlags.IsSet( ECbaInsideDialog ) )
  2064         {
  2070         {
  2082         CAknButton* button = static_cast<CAknButton*>( groupCtrl.iControl );
  2088         CAknButton* button = static_cast<CAknButton*>( groupCtrl.iControl );
  2083         CAknCommandButtonState* buttonState =
  2089         CAknCommandButtonState* buttonState =
  2084             static_cast<CAknCommandButtonState*>( button->State() );
  2090             static_cast<CAknCommandButtonState*>( button->State() );
  2085         buttonState->SetTextL( *aText );
  2091         buttonState->SetTextL( *aText );
  2086         buttonState->SetCommand( aCommandId );
  2092         buttonState->SetCommand( aCommandId );
  2087         }
       
  2088     
       
  2089     TBool isEmptyAfter( IsEmpty() );
       
  2090     
       
  2091     if ( !COMPARE_BOOLS( isEmptyBefore, isEmptyAfter ) )
       
  2092         {
       
  2093         SetFadeState();
       
  2094         }
  2093         }
  2095 
  2094 
  2096     ReportContentChangedEvent();      
  2095     ReportContentChangedEvent();      
  2097     _AKNTRACE_FUNC_EXIT;
  2096     _AKNTRACE_FUNC_EXIT;
  2098     }
  2097     }
  2276 void CEikCba::AddCommandToStackWithoutSizeChangedL(TInt aPosition,
  2275 void CEikCba::AddCommandToStackWithoutSizeChangedL(TInt aPosition,
  2277                                                TInt aCommandId,
  2276                                                TInt aCommandId,
  2278                                                const TDesC* aText)
  2277                                                const TDesC* aText)
  2279     {
  2278     {
  2280     _AKNTRACE_FUNC_ENTER;
  2279     _AKNTRACE_FUNC_ENTER;
  2281     // We need to check if this call changes the softkeys from being
  2280     
  2282     // empty to having a command or vice versa to be able to maintain
  2281     if ( !CommandChangeAllowed() )
  2283     // correct fade state.
  2282         {
  2284     TBool isEmptyBefore( IsEmpty() );
  2283         _AKNTRACE_FUNC_EXIT;
       
  2284         return;
       
  2285         }
  2285     
  2286     
  2286     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2287     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2287     
  2288     
  2288     if ( iFlags.IsSet( ECbaInsideDialog ) )
  2289     if ( iFlags.IsSet( ECbaInsideDialog ) )
  2289         {
  2290         {
  2314     if ( aPosition == KControlArrayCBAButtonMSKPosn )
  2315     if ( aPosition == KControlArrayCBAButtonMSKPosn )
  2315         {
  2316         {
  2316         iMSKset = ETrue;
  2317         iMSKset = ETrue;
  2317         }
  2318         }
  2318     SetMSKIconL(); // If MSK id was changed, this sets MSK icon accordingly.
  2319     SetMSKIconL(); // If MSK id was changed, this sets MSK icon accordingly.
  2319 
       
  2320     TBool isEmptyAfter( IsEmpty() );
       
  2321 
       
  2322     if ( !COMPARE_BOOLS( isEmptyBefore, isEmptyAfter ) )
       
  2323         {
       
  2324         SetFadeState();
       
  2325         }
       
  2326 
  2320 
  2327     ReportContentChangedEvent();
  2321     ReportContentChangedEvent();
  2328     _AKNTRACE_FUNC_EXIT;
  2322     _AKNTRACE_FUNC_EXIT;
  2329     }
  2323     }
  2330 
  2324 
  2501     
  2495     
  2502     // Force labels to be re-formatted...
  2496     // Force labels to be re-formatted...
  2503     SizeChanged();
  2497     SizeChanged();
  2504     
  2498     
  2505     TBool isEmptyAfter( IsEmpty() );
  2499     TBool isEmptyAfter( IsEmpty() );
  2506     
       
  2507     if ( !COMPARE_BOOLS( isEmptyBefore, isEmptyAfter ) )
       
  2508         {
       
  2509         SetFadeState();
       
  2510         }
       
  2511 
  2500 
  2512     DrawDeferred();
  2501     DrawDeferred();
  2513     ReportContentChangedEvent();
  2502     ReportContentChangedEvent();
  2514     _AKNTRACE_FUNC_EXIT;
  2503     _AKNTRACE_FUNC_EXIT;
  2515     }
  2504     }
  3412     _AKNTRACE_FUNC_ENTER;
  3401     _AKNTRACE_FUNC_ENTER;
  3413     iCbaFlags = aFlags;
  3402     iCbaFlags = aFlags;
  3414     
  3403     
  3415     //has not supported semi-transparent, ignore the flag at this moment.
  3404     //has not supported semi-transparent, ignore the flag at this moment.
  3416     //TODO: if the tranparent style CBA is approved and the new icon was delivered, open it again.
  3405     //TODO: if the tranparent style CBA is approved and the new icon was delivered, open it again.
  3417     iCbaFlags &= ~EEikCbaFlagSemiTransparent;
  3406     
       
  3407     //steven yao
       
  3408     //iCbaFlags &= ~EEikCbaFlagSemiTransparent;
  3418     
  3409     
  3419     if (( iCbaFlags & EEikCbaFlagTransparent || iCbaFlags & EEikCbaFlagSemiTransparent ) && 
  3410     if (( iCbaFlags & EEikCbaFlagTransparent || iCbaFlags & EEikCbaFlagSemiTransparent ) && 
  3420             CAknEnv::Static()->TransparencyEnabled() )
  3411             CAknEnv::Static()->TransparencyEnabled() )
  3421         {
  3412         {
  3422         Window().SetRequiredDisplayMode( EColor16MA );
  3413         Window().SetRequiredDisplayMode( EColor16MA );
  3630                 return EKeyWasNotConsumed;
  3621                 return EKeyWasNotConsumed;
  3631                 }
  3622                 }
  3632 
  3623 
  3633             if (aKeyEvent.iRepeats == 0 && shortCommand)
  3624             if (aKeyEvent.iRepeats == 0 && shortCommand)
  3634                 {
  3625                 {
  3635                 iCommandObserver->ProcessCommandL((TInt)shortCommand);
  3626                 // Notify command observer only if multiple marking
       
  3627                 // was not cancelled
       
  3628                 if ( !iExtension || !iExtension->CancelMultipleMarking(
       
  3629                         shortCommand ) )
       
  3630                     {
       
  3631                     iCommandObserver->ProcessCommandL( ( TInt ) shortCommand );
       
  3632                     }
  3636                 }
  3633                 }
  3637             else if (longCommand)
  3634             else if (longCommand)
  3638                 {
  3635                 {
  3639                 iCommandObserver->ProcessCommandL((TInt)longCommand);
  3636                 iCommandObserver->ProcessCommandL((TInt)longCommand);
  3640                 }
  3637                 }
  4174                         iMSKCommandObserver->ProcessCommandL( shortCommand );
  4171                         iMSKCommandObserver->ProcessCommandL( shortCommand );
  4175                         }
  4172                         }
  4176 
  4173 
  4177                     if( shortCommand )
  4174                     if( shortCommand )
  4178                         {
  4175                         {
  4179                         iCommandObserver->ProcessCommandL( shortCommand );
  4176                         // Notify command observer only if multiple marking
       
  4177                         // was not cancelled
       
  4178                         if ( !iExtension || !iExtension->CancelMultipleMarking(
       
  4179                                 shortCommand ) )
       
  4180                             {
       
  4181                             iCommandObserver->ProcessCommandL( shortCommand );
       
  4182                             }
  4180                         }
  4183                         }
  4181 
  4184 
  4182                     break;
  4185                     break;
  4183                     }
  4186                     }
  4184                 }
  4187                 }
  4360             }
  4363             }
  4361 
  4364 
  4362         case KEikMessageUnfadeWindows:
  4365         case KEikMessageUnfadeWindows:
  4363             {
  4366             {
  4364             DoLayoutChange();
  4367             DoLayoutChange();
  4365             SetFadeState();
       
  4366             
  4368             
  4367             if ( iFlags.IsSet( ECbaInsideDialog ) )
  4369             if ( iFlags.IsSet( ECbaInsideDialog ) )
  4368                 {
  4370                 {
  4369                 DrawDeferred();
  4371                 DrawDeferred();
  4370                 }
  4372                 }
  4388             {
  4390             {
  4389             if ( AknLayoutUtils::PenEnabled() &&
  4391             if ( AknLayoutUtils::PenEnabled() &&
  4390                  AknStatuspaneUtils::IdleLayoutActive() )
  4392                  AknStatuspaneUtils::IdleLayoutActive() )
  4391                 {
  4393                 {
  4392                 SetMSKVisibility( MskAllowed() );
  4394                 SetMSKVisibility( MskAllowed() );
  4393                 }                
  4395                 }
  4394             SetFadeState();
       
  4395             break;
  4396             break;
  4396             }
  4397             }
  4397 
  4398 
  4398         default:
  4399         default:
  4399             {
  4400             {
  4537     if ( iFlags.IsSet( ECbaInsideDialog ) )
  4538     if ( iFlags.IsSet( ECbaInsideDialog ) )
  4538         {
  4539         {
  4539         return;
  4540         return;
  4540         }
  4541         }
  4541     
  4542     
  4542 //    if ( iCbaFlags & EEikCbaFlagSemiTransparent )
  4543     if ( iCbaFlags & EEikCbaFlagSemiTransparent )
  4543 //        {
  4544         {
  4544 //        CWindowGc &gc = SystemGc();
  4545         CWindowGc &gc = SystemGc();
  4545 //
  4546 
  4546 //        iExtension->DrawSemiTransparency( gc, Rect() );
  4547         iExtension->DrawSemiTransparency( gc );
  4547 //        return;
  4548         return;
  4548 //        }
  4549         }
  4549 
  4550 
  4550     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  4551     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  4551     
  4552     
  4552     const TRect rect( Rect() );
  4553     const TRect rect( Rect() );
  4553     CWindowGc& gc = SystemGc();
  4554     CWindowGc& gc = SystemGc();
  4602                 gc.BitBlt( rightSKRect.iTl, iExtension->iRskPostingOverlayBitmap, 
  4603                 gc.BitBlt( rightSKRect.iTl, iExtension->iRskPostingOverlayBitmap, 
  4603                     TRect( rightSKSize ) );
  4604                     TRect( rightSKSize ) );
  4604                 gc.BitBlt( leftSKRect.iTl, iExtension->iLskPostingOverlayBitmap, 
  4605                 gc.BitBlt( leftSKRect.iTl, iExtension->iLskPostingOverlayBitmap, 
  4605                     TRect( leftSKSize ) );
  4606                     TRect( leftSKSize ) );
  4606                 }
  4607                 }
  4607             else if ( !( ( iCbaFlags & EEikCbaFlagTransparent) || ( iCbaFlags & EEikCbaFlagSemiTransparent))  )
  4608             else if ( !( iCbaFlags & EEikCbaFlagTransparent ) )
  4608                 {// Old way to render
  4609                 {// Old way to render
  4609                 if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
  4610                 if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
  4610                     {
  4611                     {
  4611                     gc.SetPenStyle( CGraphicsContext::ENullPen );
  4612                     gc.SetPenStyle( CGraphicsContext::ENullPen );
  4612                     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
  4613                     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
  4726             gc.BitBlt( topSKRect.iTl, iExtension->iRskPostingOverlayBitmap, 
  4727             gc.BitBlt( topSKRect.iTl, iExtension->iRskPostingOverlayBitmap, 
  4727                 TRect( topSKRect.Size() ) );
  4728                 TRect( topSKRect.Size() ) );
  4728             gc.BitBlt( bottomSKRect.iTl, iExtension->iLskPostingOverlayBitmap, 
  4729             gc.BitBlt( bottomSKRect.iTl, iExtension->iLskPostingOverlayBitmap, 
  4729                 TRect( bottomSKRect.Size() ) );
  4730                 TRect( bottomSKRect.Size() ) );
  4730             }
  4731             }
  4731         else if ( !( ( iCbaFlags & EEikCbaFlagTransparent) || ( iCbaFlags & EEikCbaFlagSemiTransparent))  )
  4732         else if ( !( iCbaFlags & EEikCbaFlagTransparent) )
  4732             {
  4733             {
  4733             // Old way to render
  4734             // Old way to render
  4734             if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
  4735             if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
  4735                 {
  4736                 {
  4736                 gc.SetPenStyle( CGraphicsContext::ENullPen );
  4737                 gc.SetPenStyle( CGraphicsContext::ENullPen );
  5222     _AKNTRACE_FUNC_ENTER;
  5223     _AKNTRACE_FUNC_ENTER;
  5223     TRect screen;
  5224     TRect screen;
  5224     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
  5225     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
  5225     
  5226     
  5226     TBool isLandscape( Layout_Meta_Data::IsLandscapeOrientation() );
  5227     TBool isLandscape( Layout_Meta_Data::IsLandscapeOrientation() );
  5227     TBool flatLscLayout( isLandscape &&
  5228     TInt spLayout( AknStatuspaneUtils::CurrentStatusPaneLayoutResId() );
  5228                          AknStatuspaneUtils::FlatLayoutActive() );
  5229     
       
  5230     // Treat the empty status pane layout the same way as the flat layout
       
  5231     // in landscape orientation, as the CBA layout is the same in both.
       
  5232     TBool flatLscLayout(
       
  5233         isLandscape &&
       
  5234         ( spLayout == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT || 
       
  5235           spLayout == R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT ||
       
  5236           spLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT ||
       
  5237           spLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT ||
       
  5238           spLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS ||
       
  5239           spLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS ||
       
  5240           spLayout == R_AVKON_STATUS_PANE_LAYOUT_EMPTY ) );
  5229     
  5241     
  5230     // We must check for landscape mode bottom softkeys.
  5242     // We must check for landscape mode bottom softkeys.
  5231     TInt bottomPaneVariety = isLandscape ? ( flatLscLayout ? 2 : 6 ) : 1;
  5243     TInt bottomPaneVariety = isLandscape ? ( flatLscLayout ? 2 : 6 ) : 1;
  5232         
  5244     
       
  5245     // Skip application_window between screen and area_bottom_pane since
       
  5246     // screen and application_window are always the same.
  5233     TAknWindowComponentLayout controlPane(
  5247     TAknWindowComponentLayout controlPane(
  5234         DoCompose(
  5248         DoCompose(
  5235             AknLayoutScalable_Avkon::application_window( 0 ),
  5249             AknLayoutScalable_Avkon::area_bottom_pane( bottomPaneVariety ),
  5236             DoCompose(
  5250             AknLayoutScalable_Avkon::control_pane() ) );
  5237                 AknLayoutScalable_Avkon::area_bottom_pane( bottomPaneVariety ),
       
  5238                 AknLayoutScalable_Avkon::control_pane() ) ) );
       
  5239     
  5251     
  5240     TAknLayoutRect cbarect;
  5252     TAknLayoutRect cbarect;
  5241     cbarect.LayoutRect( screen, controlPane.LayoutLine() );
  5253     cbarect.LayoutRect( screen, controlPane.LayoutLine() );
  5242     TRect rect( cbarect.Rect().Size() );
  5254     TRect rect( cbarect.Rect().Size() );
  5243 
  5255 
  5248 
  5260 
  5249     TBool mskEnabledInApplication( AknLayoutUtils::MSKEnabled() && iMSKset );
  5261     TBool mskEnabledInApplication( AknLayoutUtils::MSKEnabled() && iMSKset );
  5250     
  5262     
  5251     // Set the softkey frame rectangles in touch layouts.
  5263     // Set the softkey frame rectangles in touch layouts.
  5252     if ( iExtension && AknLayoutUtils::PenEnabled() )
  5264     if ( iExtension && AknLayoutUtils::PenEnabled() )
  5253         {        
  5265         {
  5254         TAknLayoutRect layoutRect;
  5266         TAknLayoutRect layoutRect;
  5255         TBool frameSizeChanged( EFalse );
  5267         TBool frameSizeChanged( EFalse );
  5256 
  5268 
  5257         if ( mskEnabledInPlatform || flatLscLayout )
  5269         if ( mskEnabledInPlatform || flatLscLayout )
  5258             {
  5270             {
  7236     _AKNTRACE_FUNC_EXIT;
  7248     _AKNTRACE_FUNC_EXIT;
  7237     }
  7249     }
  7238 
  7250 
  7239 
  7251 
  7240 // ---------------------------------------------------------------------------
  7252 // ---------------------------------------------------------------------------
  7241 // CEikCba::SetFadeState
       
  7242 // Sets the CBA faded if it's contents are empty.
       
  7243 // ---------------------------------------------------------------------------
       
  7244 //
       
  7245 void CEikCba::SetFadeState()
       
  7246     {
       
  7247     _AKNTRACE_FUNC_ENTER;
       
  7248     TBool canBeFaded =
       
  7249         IsEmpty() && !( ( iCbaFlags & EEikCbaFlagTransparent )
       
  7250         || ( iExtension && iExtension->iEnablePostingTransparency ) );
       
  7251 
       
  7252     // No unfading when system is faded
       
  7253     if ( !( !canBeFaded
       
  7254             && static_cast<CAknAppUi*>( iCoeEnv->AppUi() )->IsFaded() ) )
       
  7255         {
       
  7256         Window().SetFaded( canBeFaded, RWindowTreeNode::EFadeIncludeChildren );
       
  7257         }
       
  7258     _AKNTRACE_FUNC_EXIT;
       
  7259     }
       
  7260 
       
  7261 
       
  7262 // ---------------------------------------------------------------------------
       
  7263 // CEikCba::UpdateLabels
  7253 // CEikCba::UpdateLabels
  7264 // Updates softkey labels in case of embedded softkeys.
  7254 // Updates softkey labels in case of embedded softkeys.
  7265 // ---------------------------------------------------------------------------
  7255 // ---------------------------------------------------------------------------
  7266 //
  7256 //
  7267 void CEikCba::UpdateLabels( TBool aDrawDeferred )
  7257 void CEikCba::UpdateLabels( TBool aDrawDeferred )
  7849         }
  7839         }
  7850     _AKNTRACE_FUNC_EXIT;
  7840     _AKNTRACE_FUNC_EXIT;
  7851     }
  7841     }
  7852 
  7842 
  7853 
  7843 
       
  7844 // ---------------------------------------------------------------------------
       
  7845 // CEikCba::UpdateMultipleMarkingSoftkey
       
  7846 // Updates RSK when multiple marking is activated or deactivated.
       
  7847 // ---------------------------------------------------------------------------
       
  7848 //     
       
  7849 void CEikCba::UpdateMultipleMarkingSoftkey()
       
  7850     {
       
  7851     _AKNTRACE_FUNC_ENTER;
       
  7852     if ( iFlags.IsSet( ECbaSingleClickEnabled )
       
  7853             && iExtension && iExtension->iItemActionMenu )
       
  7854         {
       
  7855         TBool markingActive(
       
  7856                 iExtension->iItemActionMenu->MarkingMode(
       
  7857                         ).MultipleMarkingActive() );
       
  7858         TBool markingActivated( iFlags.IsSet( ECbaMultipleMarkingActive ) );
       
  7859         if ( markingActive && !markingActivated )
       
  7860             {
       
  7861             TRAPD( error, 
       
  7862                 AddCommandSetToStackL( R_AVKON_SOFTKEYS_OPTIONS_CANCEL ) );
       
  7863                 
       
  7864             if ( error == KErrNone )
       
  7865                 {
       
  7866                 iFlags.Set( ECbaMultipleMarkingActive );
       
  7867                 }
       
  7868             }
       
  7869         else if ( !markingActive && markingActivated )
       
  7870             {
       
  7871             RemoveCommandFromStack(
       
  7872                     KControlArrayCBAButton1Posn, EAknSoftkeyOptions );
       
  7873             RemoveCommandFromStack(
       
  7874                     KControlArrayCBAButton2Posn, EAknSoftkeyCancel );
       
  7875             iFlags.Clear( ECbaMultipleMarkingActive );
       
  7876             }
       
  7877         }
       
  7878     _AKNTRACE_FUNC_EXIT;
       
  7879     }
       
  7880 
       
  7881 
       
  7882 // ---------------------------------------------------------------------------
       
  7883 // CEikCba::CommandChangeAllowed
       
  7884 // 
       
  7885 // ---------------------------------------------------------------------------
       
  7886 //     
       
  7887 TBool CEikCba::CommandChangeAllowed()
       
  7888     {
       
  7889     if ( iFlags.IsSet( ECbaSingleClickEnabled ) 
       
  7890             && iFlags.IsSet( ECbaMultipleMarkingActive ) )
       
  7891         {
       
  7892         return EFalse;
       
  7893         }
       
  7894     return ETrue;
       
  7895     }
       
  7896 
       
  7897 
  7854 //
  7898 //
  7855 // class CEikCbaButton
  7899 // class CEikCbaButton
  7856 //
  7900 //
  7857 
  7901 
  7858 CEikCbaButton::~CEikCbaButton()
  7902 CEikCbaButton::~CEikCbaButton()