uifw/EikStd/coctlsrc/eikcba.cpp
branchRCL_3
changeset 38 c52421ed5f07
parent 25 941195f2d488
child 51 fcdfafb36fe7
equal deleted inserted replaced
29:a8834a2e9a96 38:c52421ed5f07
  1335     iExtension = CEikCbaExtension::NewL( *this );
  1335     iExtension = CEikCbaExtension::NewL( *this );
  1336 
  1336 
  1337     // Skin background is not drawn by embedded CBA.
  1337     // Skin background is not drawn by embedded CBA.
  1338     if ( !iFlags.IsSet( ECbaEmbedded ) )
  1338     if ( !iFlags.IsSet( ECbaEmbedded ) )
  1339         {
  1339         {
  1340         TRect screen;
       
  1341         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
  1342 
       
  1343         // Construct background control context, SizeChanged will update
  1340         // Construct background control context, SizeChanged will update
  1344         // the layout rectangle.
  1341         // the layout rectangle.
  1345         iBgIID = AknStatuspaneUtils::IdleLayoutActive() ?
  1342         iBgIID = AknStatuspaneUtils::IdleLayoutActive() ?
  1346             KAknsIIDQsnBgAreaControlIdle :
  1343             KAknsIIDQsnBgAreaControlIdle :
  1347             KAknsIIDQsnBgAreaControl;
  1344             KAknsIIDQsnBgAreaControl;
  1351             TRect( 0, 0, 1, 1 ),
  1348             TRect( 0, 0, 1, 1 ),
  1352             ETrue,
  1349             ETrue,
  1353             2 );
  1350             2 );
  1354 
  1351 
  1355         // Other context for staconpane
  1352         // Other context for staconpane
  1356 
  1353         if ( AknStatuspaneUtils::StaconPaneActive() )
  1357         // There is a need for two layers in each context: one for wallpaper, 
  1354             {
  1358         // the other for skin graphics.
  1355             CheckAndCreateStaconContextsL();
  1359         iStaconBgContextTop = CAknsMaskedLayerBackgroundControlContext::NewL(
  1356             }
  1360             KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
       
  1361         iStaconBgContextBottom = CAknsMaskedLayerBackgroundControlContext::NewL(
       
  1362             KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
       
  1363             
       
  1364         for ( TInt i = 0; i < ECbaLayerN; i++ )
       
  1365             {
       
  1366             iStaconBgContextBottom->SetLayerImage( i, KAknsIIDNone );
       
  1367             }
       
  1368         
       
  1369         TAknWindowLineLayout layout( AknLayoutScalable_Avkon::area_top_pane(2).LayoutLine() );
       
  1370         TAknLayoutRect layoutRect;
       
  1371         layoutRect.LayoutRect( screen, layout );
       
  1372         TRect staconTop( layoutRect.Rect() );
       
  1373     
       
  1374         layout = AknLayoutScalable_Avkon::area_bottom_pane(2).LayoutLine();
       
  1375         layoutRect.LayoutRect( screen, layout );        
       
  1376         TRect staconBottom( layoutRect.Rect() );
       
  1377     
       
  1378         // Set layers to stacon contexts.
       
  1379         // Set bottom as parent to top, so that top is re-drawn, if bottom is drawn.
       
  1380         iStaconBgContextTop->SetLayerImage( ECbaLayerWallpaper, KAknsIIDWallpaper );
       
  1381         iStaconBgContextTop->SetLayerRect( ECbaLayerWallpaper, screen );
       
  1382         iStaconBgContextTop->SetLayerImage( ECbaLayerBackground, KAknsIIDQsnBgAreaStaconRt );
       
  1383         iStaconBgContextTop->SetLayerRect( ECbaLayerBackground, staconTop );
       
  1384     
       
  1385         iStaconBgContextBottom->SetLayerImage( ECbaLayerWallpaper, KAknsIIDWallpaper );
       
  1386         iStaconBgContextBottom->SetLayerRect( ECbaLayerWallpaper, screen );
       
  1387         iStaconBgContextBottom->SetLayerImage( ECbaLayerBackground, KAknsIIDQsnBgAreaStaconRb );
       
  1388         iStaconBgContextBottom->SetLayerRect( ECbaLayerBackground, staconBottom );
       
  1389         iStaconBgContextBottom->SetParentPos( TPoint( 0, 0 ) );
       
  1390     
       
  1391         iStaconBgContextTop->SetParentContext( iStaconBgContextBottom );
       
  1392     
       
  1393         TBool idle = AknLayoutFlags() & EAknLayoutCbaInStaconPaneIdle;
       
  1394         if ( idle )
       
  1395             {
       
  1396             iStaconBgContextTop->SetLayerMaskAndSizeL( KAknsIIDQgnGrafBgLscTopMaskIcon, staconTop );
       
  1397             iStaconBgContextBottom->SetLayerMaskAndSizeL( KAknsIIDQgnGrafBgLscBottomMaskIcon, staconBottom );
       
  1398             }
       
  1399 
       
  1400         }
  1357         }
  1401 
  1358 
  1402     iExtension->UpdateSoftkeyFrameL( EFalse );
  1359     iExtension->UpdateSoftkeyFrameL( EFalse );
  1403     
  1360     
  1404     CRepository* cenRep = NULL;
  1361     CRepository* cenRep = NULL;
  4302             {
  4259             {
  4303             if ( IsVisible() )
  4260             if ( IsVisible() )
  4304                 {
  4261                 {
  4305                 DoLayoutChange();
  4262                 DoLayoutChange();
  4306                 SetBoundingRect( TRect() );
  4263                 SetBoundingRect( TRect() );
       
  4264                 if( iExtension->iIfMskIconSet 
       
  4265                 	    && ( iCbaFlags & EEikCbaFlagAppMskIcon ) )
       
  4266                     {
       
  4267                     TRAP_IGNORE( UpdateIconL() );
       
  4268                     }
  4307                 if ( iFlags.IsSet( ECbaInsideDialog )
  4269                 if ( iFlags.IsSet( ECbaInsideDialog )
  4308                         || iFlags.IsSet( ECbaEmbedded ) )
  4270                         || iFlags.IsSet( ECbaEmbedded ) )
  4309                     {
  4271                     {
  4310                     DrawDeferred();
  4272                     DrawDeferred();
  4311                     }
  4273                     }
  4532         else
  4494         else
  4533             {
  4495             {
  4534             // Always provide top object to mop-chain.
  4496             // Always provide top object to mop-chain.
  4535             // Bottom is parent of Top, so bottom is re-drawn
  4497             // Bottom is parent of Top, so bottom is re-drawn
  4536             // automatically when top is drawn.
  4498             // automatically when top is drawn.
       
  4499             // Ensure that the context exists.
       
  4500             TRAP_IGNORE( CheckAndCreateStaconContextsL() );
       
  4501 
  4537             _AKNTRACE_FUNC_EXIT;
  4502             _AKNTRACE_FUNC_EXIT;
  4538             return MAknsControlContext::SupplyMopObject( aId, iStaconBgContextTop );
  4503             return MAknsControlContext::SupplyMopObject( aId, iStaconBgContextTop );
  4539             }
  4504             }
  4540         }
  4505         }
  4541         
  4506         
  5739     {  
  5704     {  
  5740     _AKNTRACE_FUNC_ENTER;  
  5705     _AKNTRACE_FUNC_ENTER;  
  5741     TRect screen( iAvkonAppUi->ApplicationRect() );
  5706     TRect screen( iAvkonAppUi->ApplicationRect() );
  5742     TBool softKeysUpAndDownMirrored = EFalse;
  5707     TBool softKeysUpAndDownMirrored = EFalse;
  5743 
  5708 
       
  5709     TRAP_IGNORE( CheckAndCreateStaconContextsL() );
       
  5710     
  5744     TInt variety = 0;
  5711     TInt variety = 0;
  5745     if (AknLayoutFlags() & EAknLayoutCbaInStaconPaneLeft)
  5712     if (AknLayoutFlags() & EAknLayoutCbaInStaconPaneLeft)
  5746         {
  5713         {
  5747         variety = 1;
  5714         variety = 1;
  5748         }
  5715         }
  7916     return ( !( iFlags.IsSet( ECbaSingleClickEnabled ) 
  7883     return ( !( iFlags.IsSet( ECbaSingleClickEnabled ) 
  7917             && iFlags.IsSet( ECbaMultipleMarkingActive ) ) );
  7884             && iFlags.IsSet( ECbaMultipleMarkingActive ) ) );
  7918     }
  7885     }
  7919 
  7886 
  7920 
  7887 
       
  7888 // ---------------------------------------------------------------------------
       
  7889 // CEikCba::CheckAndCreateStaconContextsL
       
  7890 // Creates the skin background contexts used in StaCon layout.
       
  7891 // ---------------------------------------------------------------------------
       
  7892 //
       
  7893 void CEikCba::CheckAndCreateStaconContextsL()
       
  7894     {
       
  7895     if ( !iStaconBgContextTop && !iStaconBgContextBottom )
       
  7896         {
       
  7897         TRect screen;
       
  7898         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
  7899         
       
  7900         // There is a need for two layers in each context: one for wallpaper, 
       
  7901         // the other for skin graphics.
       
  7902         if ( !iStaconBgContextTop )
       
  7903             {
       
  7904             iStaconBgContextTop =
       
  7905                 CAknsMaskedLayerBackgroundControlContext::NewL(
       
  7906                     KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
       
  7907             }
       
  7908         
       
  7909         if ( !iStaconBgContextBottom )
       
  7910             {
       
  7911             iStaconBgContextBottom =
       
  7912                 CAknsMaskedLayerBackgroundControlContext::NewL(
       
  7913                     KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
       
  7914             }
       
  7915             
       
  7916         for ( TInt i = 0; i < ECbaLayerN; i++ )
       
  7917             {
       
  7918             iStaconBgContextBottom->SetLayerImage( i, KAknsIIDNone );
       
  7919             }
       
  7920     
       
  7921         TAknLayoutRect layoutRect;
       
  7922         layoutRect.LayoutRect( screen,
       
  7923                                AknLayoutScalable_Avkon::area_top_pane( 2 ) );
       
  7924         TRect staconTop( layoutRect.Rect() );
       
  7925     
       
  7926         layoutRect.LayoutRect( screen,
       
  7927                                AknLayoutScalable_Avkon::area_bottom_pane( 2 ) );        
       
  7928         TRect staconBottom( layoutRect.Rect() );
       
  7929     
       
  7930         // Set layers to stacon contexts.
       
  7931         // Set bottom as parent to top, so that top is re-drawn, if bottom is drawn.
       
  7932         iStaconBgContextTop->SetLayerImage( ECbaLayerWallpaper,
       
  7933                                             KAknsIIDWallpaper );
       
  7934         iStaconBgContextTop->SetLayerRect( ECbaLayerWallpaper, screen );
       
  7935         iStaconBgContextTop->SetLayerImage( ECbaLayerBackground,
       
  7936                                             KAknsIIDQsnBgAreaStaconRt );
       
  7937         iStaconBgContextTop->SetLayerRect( ECbaLayerBackground, staconTop );
       
  7938     
       
  7939         iStaconBgContextBottom->SetLayerImage( ECbaLayerWallpaper,
       
  7940                                                KAknsIIDWallpaper );
       
  7941         iStaconBgContextBottom->SetLayerRect( ECbaLayerWallpaper, screen );
       
  7942         iStaconBgContextBottom->SetLayerImage( ECbaLayerBackground,
       
  7943                                                KAknsIIDQsnBgAreaStaconRb );
       
  7944         iStaconBgContextBottom->SetLayerRect( ECbaLayerBackground, staconBottom );
       
  7945         iStaconBgContextBottom->SetParentPos( TPoint( 0, 0 ) );
       
  7946     
       
  7947         iStaconBgContextTop->SetParentContext( iStaconBgContextBottom );
       
  7948     
       
  7949         TBool idle = AknLayoutFlags() & EAknLayoutCbaInStaconPaneIdle;
       
  7950         if ( idle )
       
  7951             {
       
  7952             iStaconBgContextTop->SetLayerMaskAndSizeL(
       
  7953                 KAknsIIDQgnGrafBgLscTopMaskIcon, staconTop );
       
  7954             iStaconBgContextBottom->SetLayerMaskAndSizeL(
       
  7955                 KAknsIIDQgnGrafBgLscBottomMaskIcon, staconBottom );
       
  7956             }
       
  7957         }
       
  7958     }
       
  7959 
       
  7960 
       
  7961 
  7921 //
  7962 //
  7922 // class CEikCbaButton
  7963 // class CEikCbaButton
  7923 //
  7964 //
  7924 
  7965 
  7925 CEikCbaButton::~CEikCbaButton()
  7966 CEikCbaButton::~CEikCbaButton()
  8751     
  8792     
  8752     for ( TInt i = 0; i < count; i++ )
  8793     for ( TInt i = 0; i < count; i++ )
  8753         {       
  8794         {       
  8754         TInt priorities( reader.ReadInt16() ); // Amount of priorities for current button.
  8795         TInt priorities( reader.ReadInt16() ); // Amount of priorities for current button.
  8755         RArray<TInt> arr;
  8796         RArray<TInt> arr;
       
  8797         CleanupClosePushL( arr );
  8756         for ( TInt ii = 0; ii < priorities; ii++ )
  8798         for ( TInt ii = 0; ii < priorities; ii++ )
  8757             {
  8799             {
  8758             TInt8 commandType( reader.ReadInt8() );
  8800             TInt8 commandType( reader.ReadInt8() );
  8759             arr.Append( commandType );
  8801             arr.AppendL( commandType );
  8760             }
  8802             }
  8761         iPriorities.Append( arr );
  8803         iPriorities.AppendL( arr );
       
  8804         CleanupStack::Pop(); //arr
  8762         }
  8805         }
  8763     
  8806     
  8764     CleanupStack::PopAndDestroy(); // reader
  8807     CleanupStack::PopAndDestroy(); // reader
  8765 #endif    
  8808 #endif    
  8766     _AKNTRACE_FUNC_EXIT;
  8809     _AKNTRACE_FUNC_EXIT;