uifw/EikStd/coctlsrc/eikcba.cpp
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 9 aabf2c525e0f
equal deleted inserted replaced
0:2f259fa3e83a 4:8ca85d2f0db7
     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".
    24 #include <eiklabel.h>
    24 #include <eiklabel.h>
    25 #include <eiksoftkeyimage.h>
    25 #include <eiksoftkeyimage.h>
    26 #include <eiksoftkeypostingtransparency.h>
    26 #include <eiksoftkeypostingtransparency.h>
    27 #include <eikbtgpc.h>
    27 #include <eikbtgpc.h>
    28 #include <aknappui.h>
    28 #include <aknappui.h>
       
    29 #include <eikappui.h>
       
    30 #include <eikapp.h>
    29 #include <AknUtils.h> // LayoutUtils
    31 #include <AknUtils.h> // LayoutUtils
    30 #include <aknlayoutscalable_apps.cdl.h>
    32 #include <aknlayoutscalable_apps.cdl.h>
    31 #include <AknsBasicBackgroundControlContext.h>
    33 #include <AknsBasicBackgroundControlContext.h>
    32 #include <AknsMaskedLayerBackgroundControlContext.h>
    34 #include <AknsMaskedLayerBackgroundControlContext.h>
    33 #include <AknsDrawUtils.h>
    35 #include <AknsDrawUtils.h>
   266         
   268         
   267         iBackgroundMaskID = KAknsIIDNone;
   269         iBackgroundMaskID = KAknsIIDNone;
   268         iCbaRect = TRect( 0,0,0,0 );
   270         iCbaRect = TRect( 0,0,0,0 );
   269         iIfSkinChanged = EFalse;
   271         iIfSkinChanged = EFalse;
   270         iIfMskIconSet = EFalse;
   272         iIfMskIconSet = EFalse;
   271         iSemiBgID = KAknsIIDNone;
       
   272 
   273 
   273         if ( iOwner.Flags().IsSet( ECbaSingleClickEnabled ) )
   274         if ( iOwner.Flags().IsSet( ECbaSingleClickEnabled ) )
   274             {
   275             {
   275             AknItemActionMenuRegister::RegisterCollectionObserverL(
   276             AknItemActionMenuRegister::RegisterCollectionObserverL(
   276                     *this );
   277                     *this );
   729      * Using the special theme Id draw background
   730      * Using the special theme Id draw background
   730      */
   731      */
   731     void DrawSemiTransparencyL(CWindowGc& aGc, 
   732     void DrawSemiTransparencyL(CWindowGc& aGc, 
   732             const TRect& aRect)
   733             const TRect& aRect)
   733     	{
   734     	{
   734     	//Temporary inner rectangal value
   735         aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   735     	TRect innerRect = aRect;
   736         aGc.SetBrushColor( TRgb(128, 128, 128, 64) );
   736     	innerRect.Shrink( 5, 5 );
   737         aGc.Clear();
   737     	if ( iSemiBgID != KAknsIIDNone )
   738         
   738 	        {
   739         TAknsItemID SemiButtonID = KAknsIIDQgnHomeButtonWidget;
   739 	        AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
   740         TAknsItemID SemiButtonCenterID = KAknsIIDQgnHomeButtonWidgetCenter;
   740 	            aGc, aRect, innerRect, iSemiBgID, iSemiBgCenterID );
   741         TAknsItemID SemiButtonPressedID = KAknsIIDQgnHomeButtonWidget;
   741 	        }
   742         TAknsItemID SemiButtonPressedCenterID = KAknsIIDQsnFrHomeCenterPressed;
       
   743 
       
   744         CEikCbaButton* button1 = static_cast<CEikCbaButton*>
       
   745             (iOwner.Control(KControlArrayCBAButton1Posn));
       
   746         CEikCbaButton* button2 = static_cast<CEikCbaButton*>
       
   747             (iOwner.Control(KControlArrayCBAButton2Posn));
       
   748 
       
   749         if (IsMskEnabledLayoutActive())
       
   750             {
       
   751             TRect innerRect = iMiddleFrameOuterRect;
       
   752             innerRect.Shrink(4, 4);
       
   753 
       
   754             CEikCbaButton* buttonMSK = static_cast<CEikCbaButton*>
       
   755                 (iOwner.Control(KControlArrayCBAButtonMSKPosn));
       
   756 
       
   757             if (buttonMSK && buttonMSK->PressedDown())
       
   758                 {
       
   759                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   760                         iMiddleFrameOuterRect,
       
   761                         innerRect,//iMiddleFrameInnerRect,
       
   762                         SemiButtonPressedID,
       
   763                         SemiButtonPressedCenterID);
       
   764                 }
       
   765             else
       
   766                 {
       
   767                 AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   768                         iMiddleFrameOuterRect,
       
   769                         innerRect,//iMiddleFrameInnerRect,
       
   770                         SemiButtonID,
       
   771                         SemiButtonCenterID);
       
   772                 }
       
   773             }
       
   774 
       
   775         TRect innerRect = iLeftFrameOuterRect;
       
   776         innerRect.Shrink(4, 4);
       
   777 
       
   778         if (button1 && button1->PressedDown())
       
   779             {
       
   780             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   781                     iLeftFrameOuterRect,
       
   782                     innerRect,//iLeftFrameInnerRect,
       
   783                     SemiButtonPressedID,
       
   784                     SemiButtonPressedCenterID);
       
   785             }
       
   786         else
       
   787             {
       
   788             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   789                     iLeftFrameOuterRect,
       
   790                     innerRect,//iLeftFrameInnerRect,
       
   791                     SemiButtonID,
       
   792                     SemiButtonCenterID);
       
   793             }
       
   794 
       
   795         innerRect = iRightFrameOuterRect;
       
   796         innerRect.Shrink(4, 4);
       
   797         if (button2 && button2->PressedDown())
       
   798             {
       
   799             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   800                     iRightFrameOuterRect,
       
   801                     innerRect,//iRightFrameInnerRect,
       
   802                     SemiButtonPressedID,
       
   803                     SemiButtonPressedCenterID);
       
   804             }
       
   805         else
       
   806             {
       
   807             AknsDrawUtils::DrawFrame(AknsUtils::SkinInstance(), aGc,
       
   808                     iRightFrameOuterRect,
       
   809                     innerRect,//iRightFrameInnerRect,
       
   810                     SemiButtonID,
       
   811                     SemiButtonCenterID);
       
   812             }                    
   742     	}
   813     	}
   743 
       
   744 public:
   814 public:
   745     
   815     
   746     CEikCba&               iOwner;
   816     CEikCba&               iOwner;
   747     CRepository*           iRepository;
   817     CRepository*           iRepository;
   748     CCenRepNotifyHandler*  iCRListener;
   818     CCenRepNotifyHandler*  iCRListener;
   794     /**
   864     /**
   795      * Outer rect used in UpdateSoftkeyFrameL method.
   865      * Outer rect used in UpdateSoftkeyFrameL method.
   796      */
   866      */
   797     TRect iUpdateFrameOuterRect;
   867     TRect iUpdateFrameOuterRect;
   798     
   868     
   799     /*
       
   800      * Frame and center theme ID, using for semi-transparent  
       
   801      */
       
   802     TAknsItemID            iSemiBgID;
       
   803     TAknsItemID	           iSemiBgCenterID;
       
   804     /**
   869     /**
   805      * Inner rect used in UpdateSoftkeyFrameL method.
   870      * Inner rect used in UpdateSoftkeyFrameL method.
   806      */
   871      */
   807     TRect iUpdateFrameInnerRect;
   872     TRect iUpdateFrameInnerRect;
   808 
   873 
  1193             iCbaFlags &= ~EEikCbaFlagTransparent;
  1258             iCbaFlags &= ~EEikCbaFlagTransparent;
  1194             }
  1259             }
  1195         }
  1260         }
  1196 
  1261 
  1197     iExtension = CEikCbaExtension::NewL( *this );
  1262     iExtension = CEikCbaExtension::NewL( *this );
  1198     //create bitmap for semi-transparent background
       
  1199     if ( iCbaFlags & EEikCbaFlagSemiTransparent && iExtension )
       
  1200         {
       
  1201         iExtension->iSemiBgID = KAknsIIDQsnHomeBgWidget;
       
  1202         iExtension->iSemiBgCenterID = KAknsIIDQsnHomeBgWidgetCenter;
       
  1203         }
       
  1204 
  1263 
  1205     // Skin background is not drawn by embedded CBA.
  1264     // Skin background is not drawn by embedded CBA.
  1206     if ( !iFlags.IsSet( ECbaEmbedded ) )
  1265     if ( !iFlags.IsSet( ECbaEmbedded ) )
  1207         {
  1266         {
  1208         TRect screen;
  1267         TRect screen;
  1331     if (aResourceId != KNoResource)
  1390     if (aResourceId != KNoResource)
  1332         {
  1391         {
  1333         TResourceReader reader;
  1392         TResourceReader reader;
  1334         iCoeEnv->CreateResourceReaderLC(reader, aResourceId);
  1393         iCoeEnv->CreateResourceReaderLC(reader, aResourceId);
  1335         iCbaFlags = reader.ReadInt32();        // flags resource
  1394         iCbaFlags = reader.ReadInt32();        // flags resource
       
  1395         
       
  1396         const TUid KActiveIdle2Uid = {0x102750F0};
       
  1397         CEikApplication* app = CEikonEnv::Static()->EikAppUi()->Application();
       
  1398         if ( app && app->AppDllUid() == KActiveIdle2Uid )
       
  1399             {
       
  1400             //it's intereting that the transparent can't not be set after the CBA was created for a while.
       
  1401             //it just can be done in the CBA constructor, maybe some defect in Window server, but I'm not sure
       
  1402             //about that, in order to fix the defect I have hardcode the transparent flag for homescreen the only usercase.
       
  1403             //it should be fixed later.  
       
  1404             iCbaFlags |= EEikCbaFlagSemiTransparent;
       
  1405             }
  1336     
  1406     
  1337         // If using enhanced cba.
  1407         // If using enhanced cba.
  1338         if ( (iCbaFlags & EEikEnhancedButtonGroup) == EEikEnhancedButtonGroup ) 
  1408         if ( (iCbaFlags & EEikEnhancedButtonGroup) == EEikEnhancedButtonGroup ) 
  1339             { 
  1409             { 
  1340 #ifdef RD_ENHANCED_CBA            
  1410 #ifdef RD_ENHANCED_CBA            
  2771         // 
  2841         // 
  2772         // NOTE: MSK is not supported in landscape.
  2842         // NOTE: MSK is not supported in landscape.
  2773         //
  2843         //
  2774         if ( statusPane &&
  2844         if ( statusPane &&
  2775              statusPane->IsVisible() &&
  2845              statusPane->IsVisible() &&
  2776              AknStatuspaneUtils::ExtendedFlatLayoutActive() && 
  2846              AknStatuspaneUtils::ExtendedFlatLayoutActive() )
  2777              ( iBgIID == KAknsIIDQsnBgAreaControl || 
  2847             { 
  2778                iBgIID == KAknsIIDQsnBgAreaControlIdle ||
       
  2779                iBgIID == KAknsIIDQsnBgAreaControlMp ||
       
  2780                ( iBgIID == KAknsIIDWallpaper &&
       
  2781                  AknStatuspaneUtils::IdleLayoutActive() ) ) ) 
       
  2782             {
       
  2783             TRect digitalClockRect( 0,0,0,0 );
       
  2784             TRect indicatorRect( 0,0,0,0 );
       
  2785  
       
  2786             if ( iBgIID == KAknsIIDQsnBgAreaControlMp )
  2848             if ( iBgIID == KAknsIIDQsnBgAreaControlMp )
  2787                 {
  2849                 {
  2788                 if ( !iIsClockIndicBgIIDSet )
  2850                 if ( !iIsClockIndicBgIIDSet )
  2789                     {
  2851                     {
  2790                     statusPane->SetCbaAreaBackgroundID(
  2852                     statusPane->SetCbaAreaBackgroundID(
  2801                         iBgIID,
  2863                         iBgIID,
  2802                         CEikStatusPaneBase::EDrawDeferred );
  2864                         CEikStatusPaneBase::EDrawDeferred );
  2803                     }
  2865                     }
  2804                 }
  2866                 }
  2805 
  2867 
  2806             TRAPD( err1,
  2868             if ( statusPane->PaneCapabilities(
  2807                    indicatorRect = statusPane->PaneRectL( TUid::Uid( 
  2869                      TUid::Uid( EEikStatusPaneUidCombined ) ).IsInCurrentLayout() )
  2808                         EEikStatusPaneUidIndic ) ) );
  2870                 {
  2809                                    
  2871                 TRect combinedPaneRect( 0, 0, 0, 0 );
  2810             TRAPD( err2,
  2872                 TRAPD( err,
  2811                    digitalClockRect = statusPane->PaneRectL( TUid::Uid( 
  2873                        combinedPaneRect =
  2812                         EEikStatusPaneUidDigitalClock ) ) );
  2874                            statusPane->PaneRectL( TUid::Uid( 
  2813 
  2875                                EEikStatusPaneUidCombined ) ) );
  2814             if ( !err1 && !err2 )
  2876                 
  2815                 {
  2877                 if ( !err )
  2816                 TPoint cbaPositionRelativeToScreen( PositionRelativeToScreen() );
       
  2817                 TRect cbaRectRelativeToScreen( cbaPositionRelativeToScreen, Size() );
       
  2818 
       
  2819                 if ( cbaRectRelativeToScreen.Intersects( indicatorRect ) )
       
  2820                     {
  2878                     {
  2821                     indicatorRect.Move(
  2879                     TPoint cbaPositionRelativeToScreen( PositionRelativeToScreen() );
  2822                         -cbaPositionRelativeToScreen.iX,
  2880                     TRect cbaRectRelativeToScreen( cbaPositionRelativeToScreen, Size() );
  2823                         -cbaPositionRelativeToScreen.iY );
  2881                     
  2824                         
  2882                     if ( cbaRectRelativeToScreen.Intersects( combinedPaneRect ) )
  2825                     region.SubRect( indicatorRect );                              
  2883                         {
       
  2884                         combinedPaneRect.Move(
       
  2885                             -cbaPositionRelativeToScreen.iX,
       
  2886                             -cbaPositionRelativeToScreen.iY );
       
  2887                             
       
  2888                         region.SubRect( combinedPaneRect );                              
       
  2889                         }
  2826                     }
  2890                     }
       
  2891                 }
       
  2892             else
       
  2893                 {
       
  2894                 TRect digitalClockRect( 0, 0, 0, 0 );
       
  2895                 TRect indicatorRect( 0, 0, 0, 0 );
       
  2896 
       
  2897                 TRAPD( err1,
       
  2898                        indicatorRect = statusPane->PaneRectL( TUid::Uid( 
       
  2899                            EEikStatusPaneUidIndic ) ) );
       
  2900                                                
       
  2901                 TRAPD( err2,
       
  2902                        digitalClockRect = statusPane->PaneRectL( TUid::Uid( 
       
  2903                            EEikStatusPaneUidDigitalClock ) ) );
  2827                 
  2904                 
  2828                 if ( cbaRectRelativeToScreen.Intersects( digitalClockRect ) )
  2905                 if ( !err1 && !err2 )
  2829                     {
  2906                     {
  2830                     digitalClockRect.Move(
  2907                     TPoint cbaPositionRelativeToScreen( PositionRelativeToScreen() );
  2831                         -cbaPositionRelativeToScreen.iX,
  2908                     TRect cbaRectRelativeToScreen( cbaPositionRelativeToScreen, Size() );
  2832                         -cbaPositionRelativeToScreen.iY );
  2909 
  2833                         
  2910                     if ( cbaRectRelativeToScreen.Intersects( indicatorRect ) )
  2834                     region.SubRect( digitalClockRect );       
  2911                         {
       
  2912                         indicatorRect.Move(
       
  2913                             -cbaPositionRelativeToScreen.iX,
       
  2914                             -cbaPositionRelativeToScreen.iY );
       
  2915                             
       
  2916                         region.SubRect( indicatorRect );                              
       
  2917                         }
       
  2918                     
       
  2919                     if ( cbaRectRelativeToScreen.Intersects( digitalClockRect ) )
       
  2920                         {
       
  2921                         digitalClockRect.Move(
       
  2922                             -cbaPositionRelativeToScreen.iX,
       
  2923                             -cbaPositionRelativeToScreen.iY );
       
  2924                             
       
  2925                         region.SubRect( digitalClockRect );       
       
  2926                         }
  2835                     }
  2927                     }
  2836                 }
  2928                 }
  2837             }
  2929             }
  2838 
  2930 
  2839         if ( !region.CheckError() )
  2931         if ( !region.CheckError() )
  3177         }
  3269         }
  3178     else
  3270     else
  3179         {
  3271         {
  3180         iCbaFlags &= ~EEikCbaFlagTransparent;
  3272         iCbaFlags &= ~EEikCbaFlagTransparent;
  3181         }
  3273         }
  3182     if ( iCbaFlags & EEikCbaFlagSemiTransparent )
       
  3183         {
       
  3184         if ( iExtension )
       
  3185             {
       
  3186             iExtension->iSemiBgID = KAknsIIDQsnHomeBgWidget;
       
  3187             iExtension->iSemiBgCenterID = KAknsIIDQsnHomeBgWidgetCenter;
       
  3188             }
       
  3189         }
       
  3190     else
       
  3191         {
       
  3192         if ( iExtension )
       
  3193             {
       
  3194             iExtension->iSemiBgID = KAknsIIDNone;
       
  3195             iExtension->iSemiBgCenterID = KAknsIIDNone;
       
  3196             }
       
  3197         }
       
  3198     
  3274     
  3199     UpdateFonts();
  3275     UpdateFonts();
  3200     }
  3276     }
  3201 
  3277 
  3202 // -----------------------------------------------------------------------------
  3278 // -----------------------------------------------------------------------------
  3283         (aKeyEvent.iModifiers & EModifierCtrl) || 
  3359         (aKeyEvent.iModifiers & EModifierCtrl) || 
  3284         (aKeyEvent.iModifiers & EModifierRightCtrl);  
  3360         (aKeyEvent.iModifiers & EModifierRightCtrl);  
  3285 
  3361 
  3286     TKeyResponse response(EKeyWasNotConsumed);
  3362     TKeyResponse response(EKeyWasNotConsumed);
  3287 
  3363 
       
  3364     CEikCbaButton* button1 =
       
  3365         static_cast<CEikCbaButton*>(
       
  3366             (*iControlArray)[KControlArrayCBAButton1Posn].iControl );
       
  3367     CEikCbaButton* button2 =
       
  3368         static_cast<CEikCbaButton*>(
       
  3369             (*iControlArray)[KControlArrayCBAButton2Posn].iControl );
       
  3370     CEikCbaButton* buttonMSK = NULL;
       
  3371     if ( iMSKset && AknLayoutUtils::MSKEnabled() )
       
  3372         {
       
  3373         buttonMSK =
       
  3374             static_cast<CEikCbaButton*>(
       
  3375                 (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl );
       
  3376         }
       
  3377     
  3288     // AknLaf - changed to use keys defined in AknKeys.h.
  3378     // AknLaf - changed to use keys defined in AknKeys.h.
  3289     // Left soft key will be returned also when MSK is enabled but not defined.
  3379     // Left soft key will be returned also when MSK is enabled but not defined.
  3290     if (aKeyEvent.iCode == EKeyCBA1)
  3380     if (aKeyEvent.iCode == EKeyCBA1)
  3291         {
  3381         {
  3292         if (KControlArrayCBAButton1Posn < iControlArray->Count())
  3382         if (KControlArrayCBAButton1Posn < iControlArray->Count())
  3293             {
  3383             {
       
  3384             if( button1->IsDimmed() )
       
  3385                 {
       
  3386                 return EKeyWasConsumed;
       
  3387                 }
  3294             // Return immediately if the button is invisible                        
  3388             // Return immediately if the button is invisible                        
  3295             if ( (*iControlArray)[KControlArrayCBAButton1Posn].iControl &&
  3389             if ( (*iControlArray)[KControlArrayCBAButton1Posn].iControl &&
  3296                  !(*iControlArray)[KControlArrayCBAButton1Posn].iControl->IsVisible() && 
  3390                  !(*iControlArray)[KControlArrayCBAButton1Posn].iControl->IsVisible() && 
  3297                  !(iCbaFlags & EAknCBAFlagRespondWhenInvisible) )
  3391                  !(iCbaFlags & EAknCBAFlagRespondWhenInvisible) )
  3298                 {
  3392                 {
  3320         }
  3414         }
  3321     else if (aKeyEvent.iCode == EKeyCBA2)
  3415     else if (aKeyEvent.iCode == EKeyCBA2)
  3322         {
  3416         {
  3323         if (KControlArrayCBAButton2Posn < iControlArray->Count())
  3417         if (KControlArrayCBAButton2Posn < iControlArray->Count())
  3324             {
  3418             {
       
  3419             if( button2->IsDimmed() )
       
  3420                 {
       
  3421                 return EKeyWasConsumed;
       
  3422                 }
  3325             // Return immediately if the button is invisible.
  3423             // Return immediately if the button is invisible.
  3326             if ( (*iControlArray)[KControlArrayCBAButton2Posn].iControl &&
  3424             if ( (*iControlArray)[KControlArrayCBAButton2Posn].iControl &&
  3327                  !(*iControlArray)[KControlArrayCBAButton2Posn].iControl->IsVisible() && 
  3425                  !(*iControlArray)[KControlArrayCBAButton2Posn].iControl->IsVisible() && 
  3328                  !(iCbaFlags&EAknCBAFlagRespondWhenInvisible) )
  3426                  !(iCbaFlags&EAknCBAFlagRespondWhenInvisible) )
  3329                 {
  3427                 {
  3363                 && AknLayoutUtils::MSKEnabled()
  3461                 && AknLayoutUtils::MSKEnabled()
  3364                 && iMSKset
  3462                 && iMSKset
  3365                 && aKeyEvent.iCode == EKeyOK
  3463                 && aKeyEvent.iCode == EKeyOK
  3366                 && !Window().IsFaded() )
  3464                 && !Window().IsFaded() )
  3367         {
  3465         {
       
  3466         if( buttonMSK->IsDimmed() )
       
  3467             {
       
  3468             return EKeyWasConsumed;
       
  3469             }
  3368         if (KControlArrayCBAButtonMSKPosn < iControlArray->Count())
  3470         if (KControlArrayCBAButtonMSKPosn < iControlArray->Count())
  3369             {
  3471             {
  3370             // Return immediately if the button is invisible.
  3472             // Return immediately if the button is invisible.
  3371             if ( (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl &&
  3473             if ( (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl &&
  3372                  !(*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->IsVisible() && 
  3474                  !(*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl->IsVisible() && 
  3575         }
  3677         }
  3576 
  3678 
  3577     // If hits the left softkey.
  3679     // If hits the left softkey.
  3578     if ( button1Rect.Contains( aPointerEvent.iPosition ) && !button1Empty )
  3680     if ( button1Rect.Contains( aPointerEvent.iPosition ) && !button1Empty )
  3579         {
  3681         {
       
  3682         if( button1->IsDimmed() )
       
  3683             {
       
  3684         	CCoeControl::HandlePointerEventL( aPointerEvent );
       
  3685         	return;
       
  3686             }
  3580         if ( button1->IsVisible() )
  3687         if ( button1->IsVisible() )
  3581             {
  3688             {
  3582             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3689             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3583                 {
  3690                 {
  3584                 button1->SetPressedDown( ETrue );
  3691                 button1->SetPressedDown( ETrue );
  3634             noHits = ETrue;
  3741             noHits = ETrue;
  3635             }
  3742             }
  3636         }
  3743         }
  3637     else if ( button2Rect.Contains( aPointerEvent.iPosition ) && !button2Empty )
  3744     else if ( button2Rect.Contains( aPointerEvent.iPosition ) && !button2Empty )
  3638         {              
  3745         {              
       
  3746         if( button2->IsDimmed() )
       
  3747             {
       
  3748         	CCoeControl::HandlePointerEventL( aPointerEvent );
       
  3749         	return;
       
  3750             }             
  3639         if ( button2->IsVisible() )
  3751         if ( button2->IsVisible() )
  3640             {
  3752             {
  3641             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3753             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3642                 {
  3754                 {
  3643                 button2->SetPressedDown( ETrue );
  3755                 button2->SetPressedDown( ETrue );
  3695         }
  3807         }
  3696     else if ( buttonMSK &&
  3808     else if ( buttonMSK &&
  3697               !buttonMSKEmpty &&
  3809               !buttonMSKEmpty &&
  3698               buttonMSKRect.Contains( aPointerEvent.iPosition ) )
  3810               buttonMSKRect.Contains( aPointerEvent.iPosition ) )
  3699         {
  3811         {
       
  3812         if( buttonMSK->IsDimmed() )
       
  3813             {
       
  3814         	CCoeControl::HandlePointerEventL( aPointerEvent );
       
  3815         	return;
       
  3816             }
  3700         if  ( buttonMSK->IsVisible() )
  3817         if  ( buttonMSK->IsVisible() )
  3701             {
  3818             {
  3702             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3819             if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
  3703                 {
  3820                 {
  3704                 buttonMSK->SetPressedDown( ETrue );
  3821                 buttonMSK->SetPressedDown( ETrue );
  4197     // Embedded CBA doesn't draw anything
  4314     // Embedded CBA doesn't draw anything
  4198     if ( iFlags.IsSet( ECbaInsideDialog ) )
  4315     if ( iFlags.IsSet( ECbaInsideDialog ) )
  4199         {
  4316         {
  4200         return;
  4317         return;
  4201         }
  4318         }
       
  4319     
       
  4320     if ( iCbaFlags & EEikCbaFlagSemiTransparent )
       
  4321         {
       
  4322         CWindowGc &gc = SystemGc();
       
  4323 
       
  4324         iExtension->DrawSemiTransparencyL( gc, Rect() );
       
  4325         return;
       
  4326         }
  4202 
  4327 
  4203     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  4328     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  4204     
  4329     
  4205     const TRect rect( Rect() );
  4330     const TRect rect( Rect() );
  4206     CWindowGc& gc = SystemGc();
  4331     CWindowGc& gc = SystemGc();
  4207 
       
  4208     TRgb rgb( TRgb::Color16MA( 0 ) );
       
  4209     gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
       
  4210     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
  4211     gc.SetBrushColor( rgb );        
       
  4212     gc.Clear();
       
  4213   
       
  4214     MAknsControlContext* cc = iMLBgContext;
  4332     MAknsControlContext* cc = iMLBgContext;
  4215     
  4333     
  4216     if ( iFlags.IsSet( ECbaEmbedded ) )
  4334     if ( iFlags.IsSet( ECbaEmbedded ) )
  4217         {
  4335         {
  4218         // Embedded CBA is drawn inside dialog
  4336         // Embedded CBA is drawn inside dialog
  4441                                               KAknsIIDQgnFrSctrlSkButton,
  4559                                               KAknsIIDQgnFrSctrlSkButton,
  4442                                               KAknsIIDQgnFrSctrlSkButtonCenter );
  4560                                               KAknsIIDQgnFrSctrlSkButtonCenter );
  4443                     }
  4561                     }
  4444                 }
  4562                 }
  4445             }
  4563             }
  4446         else if ( ( iCbaFlags & EEikCbaFlagSemiTransparent) && iExtension )
       
  4447             {
       
  4448             if ( iExtension->iSemiBgID != KAknsIIDNone )
       
  4449                 {
       
  4450                 iExtension->DrawSemiTransparencyL( gc, rect );
       
  4451                 }
       
  4452             }
       
  4453         else
  4564         else
  4454             {
  4565             {
  4455             // No background since EEikCbaFlagTransparent is set.
  4566             // No background since EEikCbaFlagTransparent is set.
  4456             // Do nothing.
  4567             // Do nothing.
  4457             }
  4568             }
  5019         textVariety  = 0;
  5130         textVariety  = 0;
  5020         graphVariety = 4;
  5131         graphVariety = 4;
  5021         }
  5132         }
  5022         
  5133         
  5023     if ( iExtension->iEnablePostingTransparency ||
  5134     if ( iExtension->iEnablePostingTransparency ||
  5024          ( iCbaFlags & EEikCbaFlagTransparent ) || ( iCbaFlags & EEikCbaFlagSemiTransparent ) )
  5135          ( iCbaFlags & EEikCbaFlagTransparent ) )
  5025         {
  5136         {
  5026         textVariety = 6; // Outline font used
  5137         textVariety = 6; // Outline font used
  5027         }
  5138         }
  5028 
  5139 
  5029     // This uses correct coordinates to calculate the positions of softkey labels.
  5140     // This uses correct coordinates to calculate the positions of softkey labels.
  5111                 rect,
  5222                 rect,
  5112                 AKN_LAYOUT_WINDOW_Control_pane_elements_Line_1 );
  5223                 AKN_LAYOUT_WINDOW_Control_pane_elements_Line_1 );
  5113             }
  5224             }
  5114 
  5225 
  5115         TInt textMSKVariety = 3;
  5226         TInt textMSKVariety = 3;
  5116         TInt graphicMSKVariety = 0;
  5227         TInt graphicMSKVariety = 1;
  5117 
  5228 
  5118         if ( mskEnabledInApplication && mskEnabledInPlatform )
  5229         if ( mskEnabledInApplication && mskEnabledInPlatform )
  5119             {
  5230             {
  5120             MSKSoftkey = (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl;
  5231             MSKSoftkey = (*iControlArray)[KControlArrayCBAButtonMSKPosn].iControl;
  5121             MSKButton = static_cast<CEikCbaButton*>( MSKSoftkey );
  5232             MSKButton = static_cast<CEikCbaButton*>( MSKSoftkey );
  5161                 }
  5272                 }
  5162             }
  5273             }
  5163 
  5274 
  5164         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  5275         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  5165         const TBool transparentSoftkeys = 
  5276         const TBool transparentSoftkeys = 
  5166             iExtension->iEnablePostingTransparency || 
  5277             iExtension->iEnablePostingTransparency || ( iCbaFlags & EEikCbaFlagTransparent );
  5167             ( iCbaFlags & EEikCbaFlagTransparent ) || 
       
  5168             ( iCbaFlags & EEikCbaFlagSemiTransparent );
       
  5169         TRgb leftColor;
  5278         TRgb leftColor;
  5170         TRgb rightColor;
  5279         TRgb rightColor;
  5171         TRgb MSKColor;
  5280         TRgb MSKColor;
  5172         TInt errorl;
  5281         TInt errorl;
  5173         TInt errorr;
  5282         TInt errorr;
  6074     
  6183     
  6075     // Right pane:    
  6184     // Right pane:    
  6076     TInt rightPaneTextVariety = 0;
  6185     TInt rightPaneTextVariety = 0;
  6077     
  6186     
  6078     if ( iExtension->iEnablePostingTransparency ||
  6187     if ( iExtension->iEnablePostingTransparency ||
  6079          ( iCbaFlags & EEikCbaFlagTransparent ) || ( iCbaFlags & EEikCbaFlagSemiTransparent ) )
  6188          ( iCbaFlags & EEikCbaFlagTransparent ) )
  6080         {
  6189         {
  6081         rightPaneTextVariety = 1; // Outline font used
  6190         rightPaneTextVariety = 1; // Outline font used
  6082         }
  6191         }
  6083 
  6192 
  6084     TAknTextLineLayout rightPaneTextLayout(
  6193     TAknTextLineLayout rightPaneTextLayout(
  7248       
  7357       
  7249         TAknLayoutRect qgn_graf_sk_msk;
  7358         TAknLayoutRect qgn_graf_sk_msk;
  7250         TRect rect;
  7359         TRect rect;
  7251         qgn_graf_sk_msk.LayoutRect(
  7360         qgn_graf_sk_msk.LayoutRect(
  7252             rect,
  7361             rect,
  7253             AknLayoutScalable_Avkon::control_pane_g4( 0 ).LayoutLine() );
  7362             AknLayoutScalable_Avkon::control_pane_g4( 1 ).LayoutLine() );
  7254 
  7363 
  7255         TSize iconSize( qgn_graf_sk_msk.Rect().Width(),
  7364         TSize iconSize( qgn_graf_sk_msk.Rect().Width(),
  7256                         qgn_graf_sk_msk.Rect().Height() );
  7365                         qgn_graf_sk_msk.Rect().Height() );
  7257         
  7366         
  7258         AknsUtils::CreateIconL(
  7367         AknsUtils::CreateIconL(