uifw/EikStd/coctlsrc/eikspane.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
child 64 85902f042028
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
     1 /*
     1 /*
     2 * Copyright (c) 2002-2008 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".
    66 /** Default timeout for status pane blanker. */
    66 /** Default timeout for status pane blanker. */
    67 const TInt KDefaultUnblankTimeout = 100000; // 0.1 s
    67 const TInt KDefaultUnblankTimeout = 100000; // 0.1 s
    68 
    68 
    69 /** This flag is used to turn redraw storing on/off in status pane. */
    69 /** This flag is used to turn redraw storing on/off in status pane. */
    70 const TInt KEnableRedrawStoring = ETrue;
    70 const TInt KEnableRedrawStoring = ETrue;
    71 
       
    72 const TUid KActiveIdle2Uid = {0x102750F0};
       
    73 
    71 
    74 inline void CEikStatusPaneBase::TPaneCapabilities::SetPresent()
    72 inline void CEikStatusPaneBase::TPaneCapabilities::SetPresent()
    75     {
    73     {
    76     iFlags |= KStatusPaneCapsPresentBit;
    74     iFlags |= KStatusPaneCapsPresentBit;
    77     }
    75     }
   299             }
   297             }
   300         }
   298         }
   301 	return EFalse;
   299 	return EFalse;
   302 	}
   300 	}
   303 
   301 
       
   302 // ----------------------------------------------------------------------------
       
   303 // Sets the container control for the specified control and updates the
       
   304 // the whole parent hierarchy.
       
   305 // ----------------------------------------------------------------------------
       
   306 //
       
   307 static void SetContainersL( CCoeControl& aControl,
       
   308                             const CCoeControl& aContainer )
       
   309     {
       
   310     aControl.SetContainerWindowL( aContainer );
       
   311 
       
   312     TInt count = aControl.CountComponentControls();
       
   313 
       
   314     for ( TInt i = 0; i < count; ++i )
       
   315         {
       
   316         CCoeControl* child = aControl.ComponentControl( i );
       
   317         SetContainersL( *child, aControl );
       
   318         }
       
   319     }
   304 
   320 
   305 // ---------------------------------------------------------------------------
   321 // ---------------------------------------------------------------------------
   306 // Helper method to compose two layout lines together.
   322 // Helper method to compose two layout lines together.
   307 // ---------------------------------------------------------------------------
   323 // ---------------------------------------------------------------------------
   308 //
   324 //
  1143 
  1159 
  1144     /**
  1160     /**
  1145     * Handles resource change events.
  1161     * Handles resource change events.
  1146     */
  1162     */
  1147     void HandleResourceChange( TInt aType );
  1163     void HandleResourceChange( TInt aType );
       
  1164 
       
  1165     /**
       
  1166      * Sets the parent window of the container control and the child controls
       
  1167      * inside it.
       
  1168      * 
       
  1169      * @param  aParentWindowGroup   If not @c NULL, then the control is made
       
  1170      *                              window-owning with this window group
       
  1171      *                              as parent.
       
  1172      * @param  aParentControl       Control to be set as parent. Note that
       
  1173      *                              specifying this parameter has no effect
       
  1174      *                              if the @c aParentWindowGroup is not
       
  1175      *                              @c NULL.
       
  1176      * @param  aRedrawStoreHandler  Pointer to the redraw store handler should
       
  1177      *                              be also passed if @c aParentWindowGroup
       
  1178      *                              is specified.
       
  1179      * @param  aTransparent         Whether or not the control is transparent.
       
  1180      * @param  aIsFaded             Whether or not the control's window should
       
  1181      *                              be faded or not.
       
  1182      */
       
  1183     void SetParentWindowL( RWindowGroup* aParentWindowGroup,
       
  1184                            CCoeControl* aParentControl,
       
  1185                            CRedrawStoreHandler* aRedrawStoreHandler,
       
  1186                            TBool aTransparent,
       
  1187                            TBool aIsFaded );
       
  1188     
       
  1189     /**
       
  1190      * Sets the container control transparency.
       
  1191      * The background drawer is used if transparency is not enabled.
       
  1192      * 
       
  1193      * @param  aBackground  The background drawer.
       
  1194      */
       
  1195     void SetTransparency( TBool aTransparent,
       
  1196                           MCoeControlBackground* aBackground );
  1148 
  1197 
  1149 public: // From base class @c CCoeControl.
  1198 public: // From base class @c CCoeControl.
  1150 
  1199 
  1151     /**
  1200     /**
  1152     * Sets the dimming status.
  1201     * Sets the dimming status.
  1339     CRedrawStoreHandler& aRedrawStoreHandler )
  1388     CRedrawStoreHandler& aRedrawStoreHandler )
  1340     {
  1389     {
  1341     SetMopParent( iEikonEnv->EikAppUi() );
  1390     SetMopParent( iEikonEnv->EikAppUi() );
  1342 
  1391 
  1343     CreateWindowL( aParent );
  1392     CreateWindowL( aParent );
  1344     
       
  1345     //This is added for homescreen transparent
       
  1346     CEikApplication* app = iEikonEnv->EikAppUi()->Application();
       
  1347     if ( app && app->AppDllUid() == KActiveIdle2Uid  )
       
  1348         {
       
  1349         if( KErrNone == Window().SetTransparencyAlphaChannel())
       
  1350             Window().SetBackgroundColor(~0);
       
  1351         }
       
  1352     else
       
  1353         {
       
  1354         Window().SetBackgroundColor(
       
  1355         iEikonEnv->ControlColor( EColorStatusPaneBackground, *this ) );
       
  1356         }
       
  1357 
  1393 
  1358     // This helps for unsyncronized undimming problems.
  1394     // This helps for unsyncronized undimming problems.
  1359     aRedrawStoreHandler.SetStore( &Window(), KEnableRedrawStoring );
  1395     aRedrawStoreHandler.SetStore( &Window(), KEnableRedrawStoring );
  1360 
  1396 
  1361     iBgContext1 = aBgContext1;
  1397     iBgContext1 = aBgContext1;
  2235             }
  2271             }
  2236 
  2272 
  2237         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  2273         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT:
  2238         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
  2274         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough
  2239             {
  2275             {
       
  2276             if ( aContextNumber == 0 )
       
  2277                 {
       
  2278                 // We use frame as layered context so that we can avoid having
       
  2279                 // two separate background contexts in this class.
       
  2280                 // In any case frame context is implemented using layered
       
  2281                 // context so this should be quite ok thing to do.
       
  2282 
       
  2283                 TAknLayoutRect layoutRect;
       
  2284                 layoutRect.LayoutRect(
       
  2285                     application_window,
       
  2286                     AknLayoutScalable_Avkon::area_top_pane( 2 ) );
       
  2287                 TRect topLayoutRect( layoutRect.Rect() );
       
  2288 
       
  2289                 layoutRect.LayoutRect(
       
  2290                     topLayoutRect,
       
  2291                     AknLayoutScalable_Avkon::status_pane( 1 ) );
       
  2292                 TRect spRect( layoutRect.Rect() );
       
  2293 
       
  2294                 layoutRect.LayoutRect(
       
  2295                     spRect,
       
  2296                     AknLayoutScalable_Avkon::bg_status_flat_pane( 0 ) );
       
  2297                 TRect bgRect( layoutRect.Rect() );
       
  2298 
       
  2299                 if ( aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT )
       
  2300                     {
       
  2301                     TAknLayoutRect extension;
       
  2302                     extension.LayoutRect(
       
  2303                         application_window,
       
  2304                         AknLayoutScalable_Avkon::main_pane( 4 ) );
       
  2305 
       
  2306                     // Wallpaper
       
  2307                     aBgContext->SetLayerImage( ELayerFlatWallpaper,
       
  2308                                                KAknsIIDWallpaper );
       
  2309                     aBgContext->SetLayerRect(  ELayerFlatWallpaper, screen );
       
  2310 
       
  2311                     // Main pane
       
  2312                     aBgContext->SetLayerImage( ELayerFlatMain,
       
  2313                                                KAknsIIDQsnBgAreaMainIdle );
       
  2314                     aBgContext->SetLayerRect( ELayerFlatMain,
       
  2315                                               extension.Rect() );
       
  2316 
       
  2317                     // Skin background, transparency support
       
  2318                     aBgContext->SetLayerImage( ELayerFlatBackground,
       
  2319                                                KAknsIIDQsnBgScreenIdle );
       
  2320                     aBgContext->SetLayerRect(  ELayerFlatBackground,
       
  2321                                                topLayoutRect );
       
  2322 
       
  2323                     // CBA area
       
  2324                     aBgContext->SetLayerImage( ELayerFlatCba,
       
  2325                                                KAknsIIDQsnBgAreaControlIdle );
       
  2326                     aBgContext->SetLayerRect( ELayerFlatCba, cbaRect );
       
  2327                     }
       
  2328                  else
       
  2329                     { // Not Idle.
       
  2330                     // Main pane
       
  2331                     aBgContext->SetLayerImage( ELayerFlatMain, KAknsIIDNone );
       
  2332 
       
  2333                     // Wallpaper
       
  2334                     aBgContext->SetLayerImage( ELayerFlatWallpaper,
       
  2335                                                KAknsIIDNone );
       
  2336 
       
  2337                     // Skin background, transparency support
       
  2338                     aBgContext->SetLayerImage( ELayerFlatBackground,
       
  2339                                                KAknsIIDQsnBgScreen );
       
  2340                     aBgContext->SetLayerRect( ELayerFlatBackground, screen );
       
  2341 
       
  2342                     // CBA area
       
  2343                     aBgContext->SetLayerImage( ELayerFlatCba, aCbaBgID );
       
  2344                     aBgContext->SetLayerRect( ELayerFlatCba, cbaRect );
       
  2345                     }
       
  2346 
       
  2347                 MAknsSkinInstance* si = AknsUtils::SkinInstance();
       
  2348                 CAknsItemData* idata  = NULL;
       
  2349                 if ( si )
       
  2350                     {
       
  2351                     TRAP_IGNORE(
       
  2352                         idata = si->CreateUncachedItemDataL(
       
  2353                             KAknsIIDQsnFrStatusFlat, EAknsITImageTable ) );
       
  2354                     }
       
  2355 
       
  2356                 if ( idata ) // 9 piece frame used
       
  2357                     {
       
  2358                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g2() );
       
  2359                     aBgContext->SetLayerImage( ELayerFlatTl, KAknsIIDQsnFrStatusFlatCornerTl );
       
  2360                     aBgContext->SetLayerRect( ELayerFlatTl, layoutRect.Rect() );
       
  2361 
       
  2362                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g3() );
       
  2363                     aBgContext->SetLayerImage( ELayerFlatTr, KAknsIIDQsnFrStatusFlatCornerTr );
       
  2364                     aBgContext->SetLayerRect( ELayerFlatTr, layoutRect.Rect() );
       
  2365 
       
  2366                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g4() );
       
  2367                     aBgContext->SetLayerImage( ELayerFlatBl, KAknsIIDQsnFrStatusFlatCornerBl );
       
  2368                     aBgContext->SetLayerRect( ELayerFlatBl, layoutRect.Rect() );
       
  2369 
       
  2370                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g5() );
       
  2371                     aBgContext->SetLayerImage( ELayerFlatBr, KAknsIIDQsnFrStatusFlatCornerBr );
       
  2372                     aBgContext->SetLayerRect( ELayerFlatBr, layoutRect.Rect() );
       
  2373 
       
  2374                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g6() );
       
  2375                     aBgContext->SetLayerImage( ELayerFlatT,  KAknsIIDQsnFrStatusFlatSideT);
       
  2376                     aBgContext->SetLayerRect( ELayerFlatT, layoutRect.Rect() );
       
  2377 
       
  2378                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g7() );
       
  2379                     aBgContext->SetLayerImage( ELayerFlatB, KAknsIIDQsnFrStatusFlatSideB );
       
  2380                     aBgContext->SetLayerRect( ELayerFlatB, layoutRect.Rect() );
       
  2381 
       
  2382                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g9() );
       
  2383                     aBgContext->SetLayerImage( ELayerFlatR, KAknsIIDQsnFrStatusFlatSideR );
       
  2384                     aBgContext->SetLayerRect( ELayerFlatR, layoutRect.Rect() );
       
  2385 
       
  2386                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g8() );
       
  2387                     aBgContext->SetLayerImage( ELayerFlatL, KAknsIIDQsnFrStatusFlatSideL );
       
  2388                     aBgContext->SetLayerRect( ELayerFlatL, layoutRect.Rect() );
       
  2389 
       
  2390                     layoutRect.LayoutRect( bgRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g1() );
       
  2391                     aBgContext->SetLayerImage( ELayerFlatCenter, KAknsIIDQsnFrStatusFlatCenter );
       
  2392                     aBgContext->SetLayerRect( ELayerFlatCenter, layoutRect.Rect() );
       
  2393 
       
  2394                     if ( aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT )
       
  2395                         {
       
  2396                         maskIID = KAknsIIDQgnGrafBgLscTopMaskIcon;
       
  2397                         maskRect = spRect;
       
  2398                         }
       
  2399                     }
       
  2400                 else // handle one piece version here
       
  2401                     {
       
  2402                     if ( aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT )
       
  2403                         {
       
  2404                         // Wallpaper
       
  2405                         aBgContext->SetLayerImage( ELayerFlatWallpaper,
       
  2406                                                    KAknsIIDWallpaper );
       
  2407                         aBgContext->SetLayerRect( ELayerFlatWallpaper,
       
  2408                                                   staconTop );
       
  2409 
       
  2410                         // Skin background
       
  2411                         aBgContext->SetLayerImage( ELayerFlatBackground,
       
  2412                                                    KAknsIIDQsnFrStatusFlat );
       
  2413                         aBgContext->SetLayerRect( ELayerFlatBackground,
       
  2414                                                   bgRect );
       
  2415 
       
  2416                         // Set all other frame parts empty as they
       
  2417                         // might already be filled with something
       
  2418                         for ( TInt n = ELayerFlatBackground + 1; n <= ELayerFlatCenter; n++ )
       
  2419                            {
       
  2420                            aBgContext->SetLayerImage( n, KAknsIIDNone );
       
  2421                            }
       
  2422 
       
  2423                         maskIID = KAknsIIDQgnGrafBgLscTopMaskIcon;
       
  2424                         maskRect = spRect;
       
  2425                         }
       
  2426                     else
       
  2427                         {
       
  2428                         aBgContext->SetLayerImage( ELayerFlatWallpaper,
       
  2429                                                    KAknsIIDQsnFrStatusFlat );
       
  2430                         aBgContext->SetLayerRect( ELayerFlatWallpaper,
       
  2431                                                   bgRect );
       
  2432 
       
  2433                         // Set all other frame parts empty as they
       
  2434                         // might already be filled with something
       
  2435                         for ( TInt n = ELayerFlatBackground; n <= ELayerFlatCenter; n++ )
       
  2436                             {
       
  2437                             aBgContext->SetLayerImage( n, KAknsIIDNone );
       
  2438                             }
       
  2439                         }
       
  2440                     }
       
  2441 
       
  2442                 delete idata;
       
  2443                 }
       
  2444             else // context == 1 - this is the area removed from CBA for clock
       
  2445                  // and indicator panes.
       
  2446                 {
       
  2447                 if ( aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT )
       
  2448                     {
       
  2449                     aBgContext->SetLayerImage( ELayerFlatCbaWp,
       
  2450                                                KAknsIIDWallpaper );
       
  2451                     aBgContext->SetLayerRect( ELayerFlatCbaWp, screen );
       
  2452 
       
  2453                     maskIID = KAknsIIDQgnGrafBgLscBottomMaskIcon;
       
  2454                     maskRect = cbaRect;
       
  2455                     }
       
  2456                 else
       
  2457                     {
       
  2458                     aBgContext->SetLayerImage( ELayerFlatCbaWp, KAknsIIDNone );
       
  2459                     }
       
  2460 
       
  2461                 aBgContext->SetLayerImage( ELaterFlatCbaSkin,
       
  2462                                            KAknsIIDQsnBgAreaControlIdle );
       
  2463                 aBgContext->SetLayerRect( ELaterFlatCbaSkin, cbaRect );
       
  2464                 }
       
  2465 
       
  2466             break;
       
  2467             }
       
  2468 
       
  2469         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
       
  2470         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
       
  2471             {
  2240             TBool idleLayout =
  2472             TBool idleLayout =
  2241                 aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT;
  2473                 aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS;
  2242 
  2474 
  2243             TAknLayoutRect flatWideStatusPane;
  2475             TAknLayoutRect flatWideStatusPane;
  2244             flatWideStatusPane.LayoutRect(
  2476             flatWideStatusPane.LayoutRect(
  2245                 application_window,
  2477                 application_window,
  2246                 DoCompose( AknLayoutScalable_Avkon::area_top_pane( 19 ),
  2478                 DoCompose( AknLayoutScalable_Avkon::area_top_pane( 20 ),
  2247                            AknLayoutScalable_Avkon::status_pane( 4 ) ).LayoutLine() );
  2479                            AknLayoutScalable_Avkon::status_pane( 5 ) ).LayoutLine() );
  2248             TRect spRect( flatWideStatusPane.Rect() );
  2480             TRect spRect( flatWideStatusPane.Rect() );
  2249 
  2481 
  2250             if ( idleLayout )
  2482             if ( idleLayout )
  2251                 {
  2483                 {
  2252                 aBgContext->SetLayerImage( ELayerFlatWallpaper, KAknsIIDWallpaper );
  2484                 aBgContext->SetLayerImage( ELayerFlatWallpaper, KAknsIIDWallpaper );
  2258             aBgContext->SetLayerImage( ELayerFlatMain, KAknsIIDNone );
  2490             aBgContext->SetLayerImage( ELayerFlatMain, KAknsIIDNone );
  2259 
  2491 
  2260             aBgContext->SetLayerImage( ELayerFlatCba, KAknsIIDNone );
  2492             aBgContext->SetLayerImage( ELayerFlatCba, KAknsIIDNone );
  2261 
  2493 
  2262             MAknsSkinInstance* si = AknsUtils::SkinInstance();
  2494             MAknsSkinInstance* si = AknsUtils::SkinInstance();
  2263             CAknsItemData* idata = NULL;
  2495             CAknsItemData* idata  = NULL;
  2264             if ( si )
  2496             if ( si )
  2265                 {
  2497                 {
  2266                 TRAP_IGNORE(
  2498                 TRAP_IGNORE(
  2267                     idata = si->CreateUncachedItemDataL( KAknsIIDQsnFrStatusFlat,
  2499                     idata = si->CreateUncachedItemDataL( KAknsIIDQsnFrStatusFlat,
  2268                                                          EAknsITImageTable ) );
  2500                                                          EAknsITImageTable ) );
  2269                 }
  2501                 }
  2270 
  2502 
  2271             if ( idata ) // 9 piece frame used
  2503             if ( idata ) // 9 piece frame used
  2272                 {
  2504                 {
  2273                 if ( aCbaBgID == KAknsIIDQsnBgAreaControlMp )
  2505                 aBgContext->SetLayerImage(
  2274                     {
  2506                     ELayerFlatBackground,
  2275                     aBgContext->SetLayerImage( ELayerFlatBackground,
  2507                     idleLayout ? KAknsIIDQsnBgScreenIdle :
  2276                                                KAknsIIDQsnBgScreenMp );
  2508                                  KAknsIIDQsnBgScreen );
  2277                     }
       
  2278                 else
       
  2279                     {
       
  2280                     aBgContext->SetLayerImage(
       
  2281                         ELayerFlatBackground,
       
  2282                         idleLayout ? KAknsIIDQsnBgScreenIdle :
       
  2283                                      KAknsIIDQsnBgScreen );
       
  2284                     }
       
  2285                 aBgContext->SetLayerRect( ELayerFlatBackground, screen );
  2509                 aBgContext->SetLayerRect( ELayerFlatBackground, screen );
  2286 
  2510 
  2287                 TAknWindowLineLayout layout( AknLayoutScalable_Avkon::bg_status_flat_pane_g2().LayoutLine() );
  2511                 TAknWindowLineLayout layout( AknLayoutScalable_Avkon::bg_status_flat_pane_g2().LayoutLine() );
  2288                 layoutRect.LayoutRect( spRect, layout );
  2512                 layoutRect.LayoutRect( spRect, layout );
  2289                 aBgContext->SetLayerImage( ELayerFlatTl, KAknsIIDQsnFrStatusFlatCornerTl );
  2513                 aBgContext->SetLayerImage( ELayerFlatTl, KAknsIIDQsnFrStatusFlatCornerTl );
  2290                 aBgContext->SetLayerRect( ELayerFlatTl, layoutRect.Rect() );
  2514                 aBgContext->SetLayerRect( ELayerFlatTl, layoutRect.Rect() );
  2291 
  2515 
  2292                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g3().LayoutLine();
  2516                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g3().LayoutLine();
  2293                 layoutRect.LayoutRect( spRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g3() );
  2517                 layoutRect.LayoutRect( spRect, layout );
  2294                 aBgContext->SetLayerImage( ELayerFlatTr, KAknsIIDQsnFrStatusFlatCornerTr );
  2518                 aBgContext->SetLayerImage( ELayerFlatTr, KAknsIIDQsnFrStatusFlatCornerTr );
  2295                 aBgContext->SetLayerRect( ELayerFlatTr, layoutRect.Rect());
  2519                 aBgContext->SetLayerRect( ELayerFlatTr, layoutRect.Rect());
  2296 
  2520 
  2297                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g4().LayoutLine();
  2521                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g4().LayoutLine();
  2298                 layoutRect.LayoutRect( spRect, layout );
  2522                 layoutRect.LayoutRect( spRect, layout );
  2339                 }
  2563                 }
  2340 
  2564 
  2341             break;
  2565             break;
  2342             }
  2566             }
  2343 
  2567 
  2344         case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS:
       
  2345         case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS: // fallthrough
       
  2346             {
       
  2347             TBool idleLayout =
       
  2348                 aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS;
       
  2349 
       
  2350             TAknLayoutRect flatWideStatusPane;
       
  2351             flatWideStatusPane.LayoutRect(
       
  2352                 application_window,
       
  2353                 DoCompose( AknLayoutScalable_Avkon::area_top_pane( 20 ),
       
  2354                            AknLayoutScalable_Avkon::status_pane( 5 ) ).LayoutLine() );
       
  2355             TRect spRect( flatWideStatusPane.Rect() );
       
  2356 
       
  2357             if ( idleLayout )
       
  2358                 {
       
  2359                 aBgContext->SetLayerImage( ELayerFlatWallpaper, KAknsIIDWallpaper );
       
  2360                 aBgContext->SetLayerRect( ELayerFlatWallpaper, screen );
       
  2361                 maskIID  = KAknsIIDQgnGrafBgLscTopMaskIcon;
       
  2362                 maskRect = spRect;
       
  2363                 }
       
  2364 
       
  2365             aBgContext->SetLayerImage( ELayerFlatMain, KAknsIIDNone );
       
  2366 
       
  2367             aBgContext->SetLayerImage( ELayerFlatCba, KAknsIIDNone );
       
  2368 
       
  2369             MAknsSkinInstance* si = AknsUtils::SkinInstance();
       
  2370             CAknsItemData* idata  = NULL;
       
  2371             if ( si )
       
  2372                 {
       
  2373                 TRAP_IGNORE(
       
  2374                     idata = si->CreateUncachedItemDataL( KAknsIIDQsnFrStatusFlat,
       
  2375                                                          EAknsITImageTable ) );
       
  2376                 }
       
  2377 
       
  2378             if ( idata ) // 9 piece frame used
       
  2379                 {
       
  2380                 aBgContext->SetLayerImage(
       
  2381                     ELayerFlatBackground,
       
  2382                     idleLayout ? KAknsIIDQsnBgScreenIdle :
       
  2383                                  KAknsIIDQsnBgScreen );
       
  2384                 aBgContext->SetLayerRect( ELayerFlatBackground, screen );
       
  2385 
       
  2386                 TAknWindowLineLayout layout( AknLayoutScalable_Avkon::bg_status_flat_pane_g2().LayoutLine() );
       
  2387                 layoutRect.LayoutRect( spRect, layout );
       
  2388                 aBgContext->SetLayerImage( ELayerFlatTl, KAknsIIDQsnFrStatusFlatCornerTl );
       
  2389                 aBgContext->SetLayerRect( ELayerFlatTl, layoutRect.Rect() );
       
  2390 
       
  2391                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g3().LayoutLine();
       
  2392                 layoutRect.LayoutRect( spRect, layout );
       
  2393                 aBgContext->SetLayerImage( ELayerFlatTr, KAknsIIDQsnFrStatusFlatCornerTr );
       
  2394                 aBgContext->SetLayerRect( ELayerFlatTr, layoutRect.Rect());
       
  2395 
       
  2396                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g4().LayoutLine();
       
  2397                 layoutRect.LayoutRect( spRect, layout );
       
  2398                 aBgContext->SetLayerImage( ELayerFlatBl, KAknsIIDQsnFrStatusFlatCornerBl );
       
  2399                 aBgContext->SetLayerRect( ELayerFlatBl, layoutRect.Rect() );
       
  2400 
       
  2401                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g5().LayoutLine();
       
  2402                 layoutRect.LayoutRect( spRect, layout );
       
  2403                 aBgContext->SetLayerImage( ELayerFlatBr, KAknsIIDQsnFrStatusFlatCornerBr );
       
  2404                 aBgContext->SetLayerRect( ELayerFlatBr, layoutRect.Rect() );
       
  2405 
       
  2406                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g6().LayoutLine();
       
  2407                 layoutRect.LayoutRect( spRect, layout );
       
  2408                 aBgContext->SetLayerImage( ELayerFlatT,  KAknsIIDQsnFrStatusFlatSideT);
       
  2409                 aBgContext->SetLayerRect( ELayerFlatT, layoutRect.Rect() );
       
  2410 
       
  2411                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g7().LayoutLine();
       
  2412                 layoutRect.LayoutRect( spRect, layout );
       
  2413                 aBgContext->SetLayerImage( ELayerFlatB, KAknsIIDQsnFrStatusFlatSideB );
       
  2414                 aBgContext->SetLayerRect( ELayerFlatB, layoutRect.Rect() );
       
  2415 
       
  2416                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g9().LayoutLine();
       
  2417                 layoutRect.LayoutRect( spRect, layout );
       
  2418                 aBgContext->SetLayerImage( ELayerFlatR, KAknsIIDQsnFrStatusFlatSideR );
       
  2419                 aBgContext->SetLayerRect( ELayerFlatR, layoutRect.Rect() );
       
  2420 
       
  2421                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g8().LayoutLine();
       
  2422                 layoutRect.LayoutRect( spRect, layout );
       
  2423                 aBgContext->SetLayerImage( ELayerFlatL, KAknsIIDQsnFrStatusFlatSideL );
       
  2424                 aBgContext->SetLayerRect( ELayerFlatL, layoutRect.Rect() );
       
  2425 
       
  2426                 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g1().LayoutLine();
       
  2427                 layoutRect.LayoutRect( spRect, layout );
       
  2428                 aBgContext->SetLayerImage( ELayerFlatCenter, KAknsIIDQsnFrStatusFlatCenter );
       
  2429                 aBgContext->SetLayerRect( ELayerFlatCenter, layoutRect.Rect() );
       
  2430 
       
  2431                 delete idata;
       
  2432                 }
       
  2433             else
       
  2434                 {
       
  2435                 aBgContext->SetLayerImage( ELayerFlatBackground,
       
  2436                                            KAknsIIDQsnFrStatusFlat );
       
  2437                 aBgContext->SetLayerRect( ELayerFlatBackground, spRect );
       
  2438                 }
       
  2439 
       
  2440             break;
       
  2441             }
       
  2442 
       
  2443         default:
  2568         default:
  2444             {
  2569             {
  2445             for ( TInt n = 0; n < ELayerFlatN; n++ )
  2570             for ( TInt n = 0; n < ELayerFlatN; n++ )
  2446                 {
  2571                 {
  2447                 aBgContext->SetLayerImage( n, KAknsIIDNone );
  2572                 aBgContext->SetLayerImage( n, KAknsIIDNone );
  2468 
  2593 
  2469     if ( iControl )
  2594     if ( iControl )
  2470         {
  2595         {
  2471         iControl->HandleResourceChange( aType );
  2596         iControl->HandleResourceChange( aType );
  2472         }
  2597         }
       
  2598     }
       
  2599 
       
  2600 
       
  2601 // ---------------------------------------------------------------------------
       
  2602 // Sets the parent window of the container control and the child controls
       
  2603 // inside it.
       
  2604 // ---------------------------------------------------------------------------
       
  2605 //
       
  2606 void CEikStatusPaneContainer::SetParentWindowL(
       
  2607     RWindowGroup* aParentWindowGroup,
       
  2608     CCoeControl* aParentControl,
       
  2609     CRedrawStoreHandler* aRedrawStoreHandler,
       
  2610     TBool aTransparent,
       
  2611     TBool aIsFaded )
       
  2612     {
       
  2613     if ( aParentWindowGroup )
       
  2614         {
       
  2615             
       
  2616         SetMopParent( iEikonEnv->EikAppUi() );
       
  2617         SetParent( NULL );
       
  2618 
       
  2619         // Maintain the window's ordinal position.
       
  2620         TInt ordinalPos = Window().OrdinalPosition();
       
  2621 
       
  2622         if ( OwnsWindow() )
       
  2623             {
       
  2624             CloseWindow();
       
  2625             }
       
  2626 
       
  2627         CreateWindowL( aParentWindowGroup );
       
  2628         
       
  2629 		RWindow& window = Window();
       
  2630         if ( aRedrawStoreHandler )
       
  2631             {
       
  2632             aRedrawStoreHandler->SetStore( &window, KEnableRedrawStoring );
       
  2633             }
       
  2634         
       
  2635         // Enable the transparency only in HomeScreen where it's needed
       
  2636         // for performance reasons.
       
  2637         if ( aTransparent && window.SetTransparencyAlphaChannel() == KErrNone )
       
  2638             {
       
  2639             window.SetBackgroundColor( ~0 );
       
  2640             }
       
  2641         else
       
  2642             {
       
  2643             window.SetBackgroundColor(
       
  2644                 iEikonEnv->ControlColor( EColorStatusPaneBackground, *this ) );
       
  2645             }
       
  2646         
       
  2647         window.SetPointerGrab( ETrue );
       
  2648         window.SetShadowDisabled( ETrue );
       
  2649         window.SetNonFading( !LafStatusPaneContainer::AllowFading() );
       
  2650         EnableDragEvents();
       
  2651 
       
  2652         SetContainersL( *iControl, *this );
       
  2653 
       
  2654         //these 2 lines is to fix the error ou1cimx1#390645
       
  2655         MakeVisible( ETrue );
       
  2656         MakeVisible( EFalse );
       
  2657 		
       
  2658         window.SetFaded( aIsFaded, RWindowTreeNode::EFadeIncludeChildren );
       
  2659         window.SetOrdinalPosition( ordinalPos );
       
  2660         
       
  2661         ActivateL();
       
  2662         }
       
  2663     else if ( aParentControl )
       
  2664         {
       
  2665         SetContainersL( *this, *aParentControl );
       
  2666         MakeVisible( aParentControl->IsVisible() );
       
  2667         }
       
  2668     }
       
  2669 
       
  2670 
       
  2671 // ---------------------------------------------------------------------------
       
  2672 // Sets the container control transparency.
       
  2673 // ---------------------------------------------------------------------------
       
  2674 //
       
  2675 void CEikStatusPaneContainer::SetTransparency(
       
  2676     TBool aTransparent,
       
  2677     MCoeControlBackground* aBackground )
       
  2678     {
       
  2679     RWindow& window = Window();
       
  2680 
       
  2681     if ( aTransparent )
       
  2682         {
       
  2683         if ( window.SetTransparencyAlphaChannel() == KErrNone )
       
  2684             {
       
  2685             window.SetBackgroundColor( ~0 );
       
  2686             }
       
  2687         }
       
  2688     else
       
  2689         {
       
  2690         window.SetBackgroundColor(
       
  2691             iEikonEnv->ControlColor( EColorStatusPaneBackground, *this ) );
       
  2692         }
       
  2693     
       
  2694     // Skin background is not drawn for the subpane if it's transparent
       
  2695     // OR if it's a child of another subpane.
       
  2696     TBool drawBackground( Parent() ? NULL : !aTransparent );
       
  2697     SetBackground( drawBackground ? aBackground : NULL );
  2473     }
  2698     }
  2474 
  2699 
  2475 
  2700 
  2476 // ---------------------------------------------------------------------------
  2701 // ---------------------------------------------------------------------------
  2477 // CEikStatusPaneContainer::Draw
  2702 // CEikStatusPaneContainer::Draw
  2651 
  2876 
  2652 
  2877 
  2653 /**
  2878 /**
  2654  * Internal extension class
  2879  * Internal extension class
  2655  */
  2880  */
  2656 class CEikStatusPaneBaseExtension : public CBase
  2881 class CEikStatusPaneBaseExtension : public CBase,
       
  2882                                     public MCoeControlBackground
  2657     {
  2883     {
  2658 public:
  2884 public:
  2659     static CEikStatusPaneBaseExtension* NewL()
  2885     static CEikStatusPaneBaseExtension* NewL()
  2660         {
  2886         {
  2661         CEikStatusPaneBaseExtension* self =
  2887         CEikStatusPaneBaseExtension* self =
  2673 
  2899 
  2674     ~CEikStatusPaneBaseExtension()
  2900     ~CEikStatusPaneBaseExtension()
  2675         {
  2901         {
  2676         };
  2902         };
  2677 
  2903 
       
  2904     // From base class MCoeControlBackground
       
  2905     // This is used for drawing background of all status pane containers.
       
  2906     void Draw( CWindowGc& aGc,
       
  2907                const CCoeControl& aControl,
       
  2908                const TRect& aRect ) const
       
  2909         {
       
  2910         if ( iCommonBgContext )
       
  2911             {
       
  2912             AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(),
       
  2913                                            AknsDrawUtils::ControlContext( &aControl ),
       
  2914                                            &aControl,
       
  2915                                            aGc,
       
  2916                                            aRect.iTl,
       
  2917                                            aRect,
       
  2918                                            KAknsDrawParamNoClearUnderImage );
       
  2919             }
       
  2920         }
       
  2921 		
  2678 public:
  2922 public:
  2679 
  2923 
  2680     /** Resource id that last has been reuqested by app using switch layout. */
  2924     /** Resource id that last has been reuqested by app using switch layout. */
  2681 	TInt iLastRequestedResourceId;
  2925 	TInt iLastRequestedResourceId;
  2682 
  2926 
  2798 	    	clearer->EnableBlank();
  3042 	    	clearer->EnableBlank();
  2799 	    	forcedBlank = ETrue;
  3043 	    	forcedBlank = ETrue;
  2800 	    	}
  3044 	    	}
  2801     	}
  3045     	}
  2802 
  3046 
       
  3047     // Check if combined pane was used in the previous status pane layout
       
  3048     // to avoid unnecessary subpane parent hierarchy changes.
       
  3049     TBool combinedPaneInOldLayout(
       
  3050         PaneCapabilities(
       
  3051             TUid::Uid( EEikStatusPaneUidCombined ) ).IsInCurrentLayout() );
  2803 
  3052 
  2804     // If AknLayout system is used for placing statuspane elements, then
  3053     // If AknLayout system is used for placing statuspane elements, then
  2805     // we need to be less strict when new layout is applied or size change
  3054     // we need to be less strict when new layout is applied or size change
  2806     // is reported. This is because AknLayout data may change even when
  3055     // is reported. This is because AknLayout data may change even when
  2807     // statuspane layout id doesn't e.g. in dynamic variant changes etc.
  3056     // statuspane layout id doesn't e.g. in dynamic variant changes etc.
  2828 	CEikStatusPaneLayout* newLayout = iModel->CurrentLayout();
  3077 	CEikStatusPaneLayout* newLayout = iModel->CurrentLayout();
  2829 	if ( newLayout != oldLayout || aknLayoutUsed )
  3078 	if ( newLayout != oldLayout || aknLayoutUsed )
  2830 		{
  3079 		{
  2831 		// Need to refresh the model's layout.
  3080 		// Need to refresh the model's layout.
  2832 	    iModel->AknLayoutRefresh();
  3081 	    iModel->AknLayoutRefresh();
       
  3082 
       
  3083         // Update the combined pane's subpane parent hierarchy if necessary. 
       
  3084         TBool combinedPaneInCurrentLayout(
       
  3085             PaneCapabilities(
       
  3086                 TUid::Uid( EEikStatusPaneUidCombined ) ).IsInCurrentLayout() );
       
  3087         if ( !COMPARE_BOOLS( combinedPaneInOldLayout,
       
  3088                              combinedPaneInCurrentLayout ) )
       
  3089             {
       
  3090             SetCombinedPaneVisibilityL( combinedPaneInCurrentLayout );
       
  3091             }
  2833 
  3092 
  2834         TBool drawNavi = ETrue;
  3093         TBool drawNavi = ETrue;
  2835 
  3094 
  2836 		if ( clearer )
  3095 		if ( clearer )
  2837 			{
  3096 			{
  2990 		{
  3249 		{
  2991 		User::Leave( KErrNotFound );
  3250 		User::Leave( KErrNotFound );
  2992 		}
  3251 		}
  2993 
  3252 
  2994 	CCoeControl* oldControl = cont->Control();
  3253 	CCoeControl* oldControl = cont->Control();
       
  3254 	
       
  3255 	// Make the old control invisible and effectively remove it from data
       
  3256     // subscriber's observer array. This ensures that:
       
  3257 	//
       
  3258 	// 1. Old control won't receive messages about layout switch etc.
       
  3259 	// 2. Old control doesn't try to draw. It must be prevented because its
       
  3260 	//    window might be invalid due to layout change.
       
  3261 	if ( oldControl )
       
  3262 	    {
       
  3263         oldControl->MakeVisible( EFalse );
       
  3264         
       
  3265         TInt count = oldControl->CountComponentControls();
       
  3266         
       
  3267         for ( TInt i = 0; i < count; ++i )
       
  3268             {
       
  3269             CCoeControl* child = oldControl->ComponentControl( i );
       
  3270             
       
  3271             if ( child )
       
  3272                 {
       
  3273                 child->MakeVisible( EFalse );
       
  3274                 }
       
  3275             }
       
  3276 	    }
       
  3277 	
       
  3278 	// Make the new control visible and so that it gets added to data
       
  3279 	// subscriber's observer array. This is only done if the new control is
       
  3280     // properly constructed before swapping, i.e. it already
       
  3281     // has a container window set.
       
  3282 	if ( aNewControl && aNewControl->DrawableWindow() )
       
  3283 	    {
       
  3284         SetContainersL( *aNewControl, *cont );
       
  3285 
       
  3286         if ( cont->IsVisible() )
       
  3287             {
       
  3288             aNewControl->MakeVisible( ETrue );
       
  3289 
       
  3290             TInt count = aNewControl->CountComponentControls();
       
  3291             
       
  3292             for ( TInt i = 0; i < count; ++i )
       
  3293                 {
       
  3294                 CCoeControl* child = aNewControl->ComponentControl( i );
       
  3295                 
       
  3296                 if ( child )
       
  3297                     {
       
  3298                     child->MakeVisible( ETrue );
       
  3299                     }
       
  3300                 }
       
  3301             }
       
  3302 	    }
       
  3303 	
  2995 	cont->SetControl( aNewControl );
  3304 	cont->SetControl( aNewControl );
       
  3305 	
       
  3306 	// ensure that indicator's priorities etc are up-to-date
       
  3307 	CAknStatusPaneDataSubscriber* subscriber = DataSubscriber();
       
  3308 	
       
  3309 	if ( subscriber )
       
  3310 	    {
       
  3311         subscriber->RefreshDataL();
       
  3312 	    }
  2996 
  3313 
  2997 	return oldControl;
  3314 	return oldControl;
  2998 	}
  3315 	}
  2999 
  3316 
  3000 
  3317 
  3079 
  3396 
  3080 	iModel = CreateModelL( aCoreResId );
  3397 	iModel = CreateModelL( aCoreResId );
  3081 	iControls =
  3398 	iControls =
  3082 	    new (ELeave) CContainerControls( KEikStatusPaneControlGranularity );
  3399 	    new (ELeave) CContainerControls( KEikStatusPaneControlGranularity );
  3083 	CreatePanesL();
  3400 	CreatePanesL();
       
  3401 	
       
  3402 	SetCombinedPaneVisibilityL(
       
  3403 	    PaneCapabilities(
       
  3404             TUid::Uid( EEikStatusPaneUidCombined ) ).IsInCurrentLayout() );
       
  3405 	
  3084 	ApplyLayoutL( iModel->CurrentLayout(), ENoDraw );
  3406 	ApplyLayoutL( iModel->CurrentLayout(), ENoDraw );
  3085 
  3407 
  3086 	// Clearer is not needed anymore if all panes are drawn in app side.
  3408 	// Clearer is not needed anymore if all panes are drawn in app side.
  3087 	//iExtension->iBlankStatuspane = CAknStatuspaneClearer::NewL(*iParentWindowGroup, 0, !IsApp());
  3409 	//iExtension->iBlankStatuspane = CAknStatuspaneClearer::NewL(*iParentWindowGroup, 0, !IsApp());
  3088     //iExtension->iBlankStatuspane->SetSkinBackgroundContext(CurrentLayoutResId());
  3410     //iExtension->iBlankStatuspane->SetSkinBackgroundContext(CurrentLayoutResId());
  3127             iExtension->iCommonBgContext->GetControlContext( 0 ) ),
  3449             iExtension->iCommonBgContext->GetControlContext( 0 ) ),
  3128         static_cast<CAknsMaskedLayerBackgroundControlContext*>(
  3450         static_cast<CAknsMaskedLayerBackgroundControlContext*>(
  3129             iExtension->iCommonBgContext->GetControlContext( 1 ) ),
  3451             iExtension->iCommonBgContext->GetControlContext( 1 ) ),
  3130         iExtension->iDataSubscriber,
  3452         iExtension->iDataSubscriber,
  3131         *iExtension->iRedrawStoreHandler );
  3453         *iExtension->iRedrawStoreHandler );
       
  3454 
       
  3455     cont->SetBackground( iExtension );
       
  3456 
  3132     CleanupStack::PushL( cont );
  3457     CleanupStack::PushL( cont );
  3133     iControls->AppendL( cont );
  3458     iControls->AppendL( cont );
  3134     CleanupStack::Pop( cont );
  3459     CleanupStack::Pop( cont );
  3135     }
  3460     }
  3136 
  3461 
  3162 
  3487 
  3163      // In stacon, make a second prepare and draw. This is due to that stacon
  3488      // In stacon, make a second prepare and draw. This is due to that stacon
  3164     // has two background contextes.
  3489     // has two background contextes.
  3165     if ( ( layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_LEFT ||
  3490     if ( ( layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_LEFT ||
  3166            layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ||
  3491            layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT ||
  3167            layoutResId == R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT ) )
  3492            layoutResId == R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT ||
       
  3493            layoutResId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT ||
       
  3494            layoutResId == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT ) )
  3168         {
  3495         {
  3169         partOfCombinedContext =
  3496         partOfCombinedContext =
  3170             iExtension->iCommonBgContext->GetControlContext( 1 );
  3497             iExtension->iCommonBgContext->GetControlContext( 1 );
  3171 
  3498 
  3172         CEikStatusPaneContainer::PrepareBackgroundContext(
  3499         CEikStatusPaneContainer::PrepareBackgroundContext(
  3508     // Return largest bounding rect.
  3835     // Return largest bounding rect.
  3509     return largestBoundingRect;
  3836     return largestBoundingRect;
  3510     }
  3837     }
  3511 
  3838 
  3512 
  3839 
       
  3840 // ---------------------------------------------------------------------------
       
  3841 // CEikStatusPaneBase::SetCombinedPaneVisibility
       
  3842 // Updates the parent hierarchy of subpanes in the combined pane based
       
  3843 // on whether or not the combined pane is used in the current status pane
       
  3844 // layout.
       
  3845 // ---------------------------------------------------------------------------
       
  3846 //
       
  3847 void CEikStatusPaneBase::SetCombinedPaneVisibilityL( TBool aVisible )
       
  3848     {
       
  3849     CEikStatusPaneContainer* combinedPane =
       
  3850         Find( TUid::Uid( EEikStatusPaneUidCombined ) );
       
  3851     if ( combinedPane )
       
  3852         {
       
  3853         CCoeControl* combinedPaneControl = combinedPane->Control();
       
  3854         
       
  3855         TBool transparencyEnabled( IsTransparent() );
       
  3856         
       
  3857         // The subpane container controls inside combined pane are it's
       
  3858         // component controls.
       
  3859         TInt count( combinedPaneControl->CountComponentControls() );
       
  3860 
       
  3861         TBool isFaded( IsFaded() );
       
  3862 
       
  3863         for ( TInt i = 0; i < count; ++i )
       
  3864             {
       
  3865             CEikStatusPaneContainer* subPane =
       
  3866                 static_cast<CEikStatusPaneContainer*>(
       
  3867                     combinedPaneControl->ComponentControl( i ) );
       
  3868             if ( subPane )
       
  3869                 {
       
  3870                 if ( aVisible )
       
  3871                     {
       
  3872                     subPane->SetParentWindowL( NULL,
       
  3873                                                combinedPaneControl,
       
  3874                                                NULL,
       
  3875                                                transparencyEnabled,
       
  3876                                                isFaded );
       
  3877 
       
  3878                     // Background is drawn by the combined pane so remove
       
  3879                     // the subpane's own background drawer. 
       
  3880                     subPane->SetBackground( NULL );
       
  3881                     }
       
  3882                 else
       
  3883                     {
       
  3884                     subPane->SetParentWindowL(
       
  3885                         iParentWindowGroup,
       
  3886                         NULL,
       
  3887                         iExtension ? iExtension->iRedrawStoreHandler : NULL,
       
  3888                         transparencyEnabled,
       
  3889                         isFaded );
       
  3890 
       
  3891                     subPane->SetBackground( transparencyEnabled ? NULL :
       
  3892                                                                   iExtension );
       
  3893                     }
       
  3894                 }
       
  3895             }
       
  3896         }
       
  3897     }
       
  3898 
       
  3899 
  3513 /**
  3900 /**
  3514  * Visitor class for collecting the sub-pane areas to a single region.
  3901  * Visitor class for collecting the sub-pane areas to a single region.
  3515  */
  3902  */
  3516 NONSHARABLE_CLASS( TStatusPaneRegionCollector )
  3903 NONSHARABLE_CLASS( TStatusPaneRegionCollector )
  3517     : public MEikStatusPaneLayoutTreeVisitor
  3904     : public MEikStatusPaneLayoutTreeVisitor
  3599 //
  3986 //
  3600 EXPORT_C void CEikStatusPaneBase::SetFlags( TInt aFlags )
  3987 EXPORT_C void CEikStatusPaneBase::SetFlags( TInt aFlags )
  3601 	{
  3988 	{
  3602 	MakeVisible( aFlags & KEikStatusPaneBaseVisibleBit );
  3989 	MakeVisible( aFlags & KEikStatusPaneBaseVisibleBit );
  3603 	SetDimmed( aFlags & KEikStatusPaneBaseDimmedBit );
  3990 	SetDimmed( aFlags & KEikStatusPaneBaseDimmedBit );
  3604 	}
  3991 	EnableTransparent( aFlags & KStatusPaneTransparentBit );
       
  3992 	}
       
  3993 
       
  3994 // ---------------------------------------------------------------------------
       
  3995 // CEikStatusPaneBase::EnableTransparent
       
  3996 // Enables transparency in the status pane.
       
  3997 // ---------------------------------------------------------------------------
       
  3998 //
       
  3999 EXPORT_C void CEikStatusPaneBase::EnableTransparent( TBool aTransparent )
       
  4000     {
       
  4001     if ( COMPARE_BOOLS( aTransparent, IsTransparent() ) )
       
  4002         {
       
  4003         return;
       
  4004         }
       
  4005 
       
  4006     if ( aTransparent )
       
  4007         {
       
  4008         iFlags |= KStatusPaneTransparentBit;
       
  4009         }
       
  4010     else
       
  4011         {
       
  4012         iFlags &= ~KStatusPaneTransparentBit;
       
  4013         }
       
  4014 
       
  4015     // Change the subpane window background colour and background drawer
       
  4016     // based on the transparency.
       
  4017     const TInt count = iControls->Count();
       
  4018     for ( TInt ii = 0; ii < count; ++ii )
       
  4019         {
       
  4020         iControls->At( ii )->SetTransparency( aTransparent, iExtension );
       
  4021         }
       
  4022     
       
  4023     DoDrawNow( EDrawDeferred );
       
  4024     }
       
  4025 
       
  4026 
       
  4027 // ---------------------------------------------------------------------------
       
  4028 // CEikStatusPaneBase::IsTransparent
       
  4029 // Checks if the status pane has transparency enabled.
       
  4030 // ---------------------------------------------------------------------------
       
  4031 //
       
  4032 EXPORT_C TBool CEikStatusPaneBase::IsTransparent() const
       
  4033     {
       
  4034     return iFlags & KStatusPaneTransparentBit;
       
  4035     }
  3605 
  4036 
  3606 
  4037 
  3607 // ---------------------------------------------------------------------------
  4038 // ---------------------------------------------------------------------------
  3608 // CEikStatusPaneBase::Flags
  4039 // CEikStatusPaneBase::Flags
  3609 // Returns the status pane flags.
  4040 // Returns the status pane flags.