branch | RCL_3 |
changeset 55 | aecbbf00d063 |
parent 38 | c52421ed5f07 |
child 56 | d48ab3b357f1 |
51:fcdfafb36fe7 | 55:aecbbf00d063 |
---|---|
1 /* |
1 /* |
2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2008 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}; |
|
71 |
73 |
72 inline void CEikStatusPaneBase::TPaneCapabilities::SetPresent() |
74 inline void CEikStatusPaneBase::TPaneCapabilities::SetPresent() |
73 { |
75 { |
74 iFlags |= KStatusPaneCapsPresentBit; |
76 iFlags |= KStatusPaneCapsPresentBit; |
75 } |
77 } |
297 } |
299 } |
298 } |
300 } |
299 return EFalse; |
301 return EFalse; |
300 } |
302 } |
301 |
303 |
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 } |
|
320 |
304 |
321 // --------------------------------------------------------------------------- |
305 // --------------------------------------------------------------------------- |
322 // Helper method to compose two layout lines together. |
306 // Helper method to compose two layout lines together. |
323 // --------------------------------------------------------------------------- |
307 // --------------------------------------------------------------------------- |
324 // |
308 // |
1159 |
1143 |
1160 /** |
1144 /** |
1161 * Handles resource change events. |
1145 * Handles resource change events. |
1162 */ |
1146 */ |
1163 void HandleResourceChange( TInt aType ); |
1147 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 ); |
|
1197 |
1148 |
1198 public: // From base class @c CCoeControl. |
1149 public: // From base class @c CCoeControl. |
1199 |
1150 |
1200 /** |
1151 /** |
1201 * Sets the dimming status. |
1152 * Sets the dimming status. |
1388 CRedrawStoreHandler& aRedrawStoreHandler ) |
1339 CRedrawStoreHandler& aRedrawStoreHandler ) |
1389 { |
1340 { |
1390 SetMopParent( iEikonEnv->EikAppUi() ); |
1341 SetMopParent( iEikonEnv->EikAppUi() ); |
1391 |
1342 |
1392 CreateWindowL( aParent ); |
1343 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 } |
|
1393 |
1357 |
1394 // This helps for unsyncronized undimming problems. |
1358 // This helps for unsyncronized undimming problems. |
1395 aRedrawStoreHandler.SetStore( &Window(), KEnableRedrawStoring ); |
1359 aRedrawStoreHandler.SetStore( &Window(), KEnableRedrawStoring ); |
1396 |
1360 |
1397 iBgContext1 = aBgContext1; |
1361 iBgContext1 = aBgContext1; |
2271 } |
2235 } |
2272 |
2236 |
2273 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT: |
2237 case R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT: |
2274 case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough |
2238 case R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT: // fallthrough |
2275 { |
2239 { |
2276 if ( aContextNumber == 0 ) |
2240 TBool idleLayout = |
2241 aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT; |
|
2242 |
|
2243 TAknLayoutRect flatWideStatusPane; |
|
2244 flatWideStatusPane.LayoutRect( |
|
2245 application_window, |
|
2246 DoCompose( AknLayoutScalable_Avkon::area_top_pane( 19 ), |
|
2247 AknLayoutScalable_Avkon::status_pane( 4 ) ).LayoutLine() ); |
|
2248 TRect spRect( flatWideStatusPane.Rect() ); |
|
2249 |
|
2250 if ( idleLayout ) |
|
2277 { |
2251 { |
2278 // We use frame as layered context so that we can avoid having |
2252 aBgContext->SetLayerImage( ELayerFlatWallpaper, KAknsIIDWallpaper ); |
2279 // two separate background contexts in this class. |
2253 aBgContext->SetLayerRect( ELayerFlatWallpaper, screen ); |
2280 // In any case frame context is implemented using layered |
2254 maskIID = KAknsIIDQgnGrafBgLscTopMaskIcon; |
2281 // context so this should be quite ok thing to do. |
2255 maskRect = spRect; |
2282 |
2256 } |
2283 TAknLayoutRect layoutRect; |
2257 |
2284 layoutRect.LayoutRect( |
2258 aBgContext->SetLayerImage( ELayerFlatMain, KAknsIIDNone ); |
2285 application_window, |
2259 |
2286 AknLayoutScalable_Avkon::area_top_pane( 2 ) ); |
2260 aBgContext->SetLayerImage( ELayerFlatCba, KAknsIIDNone ); |
2287 TRect topLayoutRect( layoutRect.Rect() ); |
2261 |
2288 |
2262 MAknsSkinInstance* si = AknsUtils::SkinInstance(); |
2289 layoutRect.LayoutRect( |
2263 CAknsItemData* idata = NULL; |
2290 topLayoutRect, |
2264 if ( si ) |
2291 AknLayoutScalable_Avkon::status_pane( 1 ) ); |
2265 { |
2292 TRect spRect( layoutRect.Rect() ); |
2266 TRAP_IGNORE( |
2293 |
2267 idata = si->CreateUncachedItemDataL( KAknsIIDQsnFrStatusFlat, |
2294 layoutRect.LayoutRect( |
2268 EAknsITImageTable ) ); |
2295 spRect, |
2269 } |
2296 AknLayoutScalable_Avkon::bg_status_flat_pane( 0 ) ); |
2270 |
2297 TRect bgRect( layoutRect.Rect() ); |
2271 if ( idata ) // 9 piece frame used |
2298 |
2272 { |
2299 if ( aLayoutId == R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT ) |
2273 if ( aCbaBgID == KAknsIIDQsnBgAreaControlMp ) |
2300 { |
2274 { |
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, |
2275 aBgContext->SetLayerImage( ELayerFlatBackground, |
2319 KAknsIIDQsnBgScreenIdle ); |
2276 KAknsIIDQsnBgScreenMp ); |
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 } |
2277 } |
2456 else |
2278 else |
2457 { |
2279 { |
2458 aBgContext->SetLayerImage( ELayerFlatCbaWp, KAknsIIDNone ); |
2280 aBgContext->SetLayerImage( |
2281 ELayerFlatBackground, |
|
2282 idleLayout ? KAknsIIDQsnBgScreenIdle : |
|
2283 KAknsIIDQsnBgScreen ); |
|
2459 } |
2284 } |
2460 |
2285 aBgContext->SetLayerRect( ELayerFlatBackground, screen ); |
2461 aBgContext->SetLayerImage( ELaterFlatCbaSkin, |
2286 |
2462 KAknsIIDQsnBgAreaControlIdle ); |
2287 TAknWindowLineLayout layout( AknLayoutScalable_Avkon::bg_status_flat_pane_g2().LayoutLine() ); |
2463 aBgContext->SetLayerRect( ELaterFlatCbaSkin, cbaRect ); |
2288 layoutRect.LayoutRect( spRect, layout ); |
2289 aBgContext->SetLayerImage( ELayerFlatTl, KAknsIIDQsnFrStatusFlatCornerTl ); |
|
2290 aBgContext->SetLayerRect( ELayerFlatTl, layoutRect.Rect() ); |
|
2291 |
|
2292 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g3().LayoutLine(); |
|
2293 layoutRect.LayoutRect( spRect, AknLayoutScalable_Avkon::bg_status_flat_pane_g3() ); |
|
2294 aBgContext->SetLayerImage( ELayerFlatTr, KAknsIIDQsnFrStatusFlatCornerTr ); |
|
2295 aBgContext->SetLayerRect( ELayerFlatTr, layoutRect.Rect()); |
|
2296 |
|
2297 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g4().LayoutLine(); |
|
2298 layoutRect.LayoutRect( spRect, layout ); |
|
2299 aBgContext->SetLayerImage( ELayerFlatBl, KAknsIIDQsnFrStatusFlatCornerBl ); |
|
2300 aBgContext->SetLayerRect( ELayerFlatBl, layoutRect.Rect() ); |
|
2301 |
|
2302 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g5().LayoutLine(); |
|
2303 layoutRect.LayoutRect( spRect, layout ); |
|
2304 aBgContext->SetLayerImage( ELayerFlatBr, KAknsIIDQsnFrStatusFlatCornerBr ); |
|
2305 aBgContext->SetLayerRect( ELayerFlatBr, layoutRect.Rect() ); |
|
2306 |
|
2307 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g6().LayoutLine(); |
|
2308 layoutRect.LayoutRect( spRect, layout ); |
|
2309 aBgContext->SetLayerImage( ELayerFlatT, KAknsIIDQsnFrStatusFlatSideT); |
|
2310 aBgContext->SetLayerRect( ELayerFlatT, layoutRect.Rect() ); |
|
2311 |
|
2312 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g7().LayoutLine(); |
|
2313 layoutRect.LayoutRect( spRect, layout ); |
|
2314 aBgContext->SetLayerImage( ELayerFlatB, KAknsIIDQsnFrStatusFlatSideB ); |
|
2315 aBgContext->SetLayerRect( ELayerFlatB, layoutRect.Rect() ); |
|
2316 |
|
2317 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g9().LayoutLine(); |
|
2318 layoutRect.LayoutRect( spRect, layout ); |
|
2319 aBgContext->SetLayerImage( ELayerFlatR, KAknsIIDQsnFrStatusFlatSideR ); |
|
2320 aBgContext->SetLayerRect( ELayerFlatR, layoutRect.Rect() ); |
|
2321 |
|
2322 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g8().LayoutLine(); |
|
2323 layoutRect.LayoutRect( spRect, layout ); |
|
2324 aBgContext->SetLayerImage( ELayerFlatL, KAknsIIDQsnFrStatusFlatSideL ); |
|
2325 aBgContext->SetLayerRect( ELayerFlatL, layoutRect.Rect() ); |
|
2326 |
|
2327 layout = AknLayoutScalable_Avkon::bg_status_flat_pane_g1().LayoutLine(); |
|
2328 layoutRect.LayoutRect( spRect, layout ); |
|
2329 aBgContext->SetLayerImage( ELayerFlatCenter, KAknsIIDQsnFrStatusFlatCenter ); |
|
2330 aBgContext->SetLayerRect( ELayerFlatCenter, layoutRect.Rect() ); |
|
2331 |
|
2332 delete idata; |
|
2333 } |
|
2334 else |
|
2335 { |
|
2336 aBgContext->SetLayerImage( ELayerFlatBackground, |
|
2337 KAknsIIDQsnFrStatusFlat ); |
|
2338 aBgContext->SetLayerRect( ELayerFlatBackground, spRect ); |
|
2464 } |
2339 } |
2465 |
2340 |
2466 break; |
2341 break; |
2467 } |
2342 } |
2468 |
2343 |
2593 |
2468 |
2594 if ( iControl ) |
2469 if ( iControl ) |
2595 { |
2470 { |
2596 iControl->HandleResourceChange( aType ); |
2471 iControl->HandleResourceChange( aType ); |
2597 } |
2472 } |
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 ); |
|
2698 } |
2473 } |
2699 |
2474 |
2700 |
2475 |
2701 // --------------------------------------------------------------------------- |
2476 // --------------------------------------------------------------------------- |
2702 // CEikStatusPaneContainer::Draw |
2477 // CEikStatusPaneContainer::Draw |
2876 |
2651 |
2877 |
2652 |
2878 /** |
2653 /** |
2879 * Internal extension class |
2654 * Internal extension class |
2880 */ |
2655 */ |
2881 class CEikStatusPaneBaseExtension : public CBase, |
2656 class CEikStatusPaneBaseExtension : public CBase |
2882 public MCoeControlBackground |
|
2883 { |
2657 { |
2884 public: |
2658 public: |
2885 static CEikStatusPaneBaseExtension* NewL() |
2659 static CEikStatusPaneBaseExtension* NewL() |
2886 { |
2660 { |
2887 CEikStatusPaneBaseExtension* self = |
2661 CEikStatusPaneBaseExtension* self = |
2899 |
2673 |
2900 ~CEikStatusPaneBaseExtension() |
2674 ~CEikStatusPaneBaseExtension() |
2901 { |
2675 { |
2902 }; |
2676 }; |
2903 |
2677 |
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 |
|
2922 public: |
2678 public: |
2923 |
2679 |
2924 /** Resource id that last has been reuqested by app using switch layout. */ |
2680 /** Resource id that last has been reuqested by app using switch layout. */ |
2925 TInt iLastRequestedResourceId; |
2681 TInt iLastRequestedResourceId; |
2926 |
2682 |
3042 clearer->EnableBlank(); |
2798 clearer->EnableBlank(); |
3043 forcedBlank = ETrue; |
2799 forcedBlank = ETrue; |
3044 } |
2800 } |
3045 } |
2801 } |
3046 |
2802 |
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() ); |
|
3052 |
2803 |
3053 // If AknLayout system is used for placing statuspane elements, then |
2804 // If AknLayout system is used for placing statuspane elements, then |
3054 // we need to be less strict when new layout is applied or size change |
2805 // we need to be less strict when new layout is applied or size change |
3055 // is reported. This is because AknLayout data may change even when |
2806 // is reported. This is because AknLayout data may change even when |
3056 // statuspane layout id doesn't e.g. in dynamic variant changes etc. |
2807 // statuspane layout id doesn't e.g. in dynamic variant changes etc. |
3077 CEikStatusPaneLayout* newLayout = iModel->CurrentLayout(); |
2828 CEikStatusPaneLayout* newLayout = iModel->CurrentLayout(); |
3078 if ( newLayout != oldLayout || aknLayoutUsed ) |
2829 if ( newLayout != oldLayout || aknLayoutUsed ) |
3079 { |
2830 { |
3080 // Need to refresh the model's layout. |
2831 // Need to refresh the model's layout. |
3081 iModel->AknLayoutRefresh(); |
2832 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 } |
|
3092 |
2833 |
3093 TBool drawNavi = ETrue; |
2834 TBool drawNavi = ETrue; |
3094 |
2835 |
3095 if ( clearer ) |
2836 if ( clearer ) |
3096 { |
2837 { |
3249 { |
2990 { |
3250 User::Leave( KErrNotFound ); |
2991 User::Leave( KErrNotFound ); |
3251 } |
2992 } |
3252 |
2993 |
3253 CCoeControl* oldControl = cont->Control(); |
2994 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 |
|
3304 cont->SetControl( aNewControl ); |
2995 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 } |
|
3313 |
2996 |
3314 return oldControl; |
2997 return oldControl; |
3315 } |
2998 } |
3316 |
2999 |
3317 |
3000 |
3396 |
3079 |
3397 iModel = CreateModelL( aCoreResId ); |
3080 iModel = CreateModelL( aCoreResId ); |
3398 iControls = |
3081 iControls = |
3399 new (ELeave) CContainerControls( KEikStatusPaneControlGranularity ); |
3082 new (ELeave) CContainerControls( KEikStatusPaneControlGranularity ); |
3400 CreatePanesL(); |
3083 CreatePanesL(); |
3401 |
|
3402 SetCombinedPaneVisibilityL( |
|
3403 PaneCapabilities( |
|
3404 TUid::Uid( EEikStatusPaneUidCombined ) ).IsInCurrentLayout() ); |
|
3405 |
|
3406 ApplyLayoutL( iModel->CurrentLayout(), ENoDraw ); |
3084 ApplyLayoutL( iModel->CurrentLayout(), ENoDraw ); |
3407 |
3085 |
3408 // Clearer is not needed anymore if all panes are drawn in app side. |
3086 // Clearer is not needed anymore if all panes are drawn in app side. |
3409 //iExtension->iBlankStatuspane = CAknStatuspaneClearer::NewL(*iParentWindowGroup, 0, !IsApp()); |
3087 //iExtension->iBlankStatuspane = CAknStatuspaneClearer::NewL(*iParentWindowGroup, 0, !IsApp()); |
3410 //iExtension->iBlankStatuspane->SetSkinBackgroundContext(CurrentLayoutResId()); |
3088 //iExtension->iBlankStatuspane->SetSkinBackgroundContext(CurrentLayoutResId()); |
3449 iExtension->iCommonBgContext->GetControlContext( 0 ) ), |
3127 iExtension->iCommonBgContext->GetControlContext( 0 ) ), |
3450 static_cast<CAknsMaskedLayerBackgroundControlContext*>( |
3128 static_cast<CAknsMaskedLayerBackgroundControlContext*>( |
3451 iExtension->iCommonBgContext->GetControlContext( 1 ) ), |
3129 iExtension->iCommonBgContext->GetControlContext( 1 ) ), |
3452 iExtension->iDataSubscriber, |
3130 iExtension->iDataSubscriber, |
3453 *iExtension->iRedrawStoreHandler ); |
3131 *iExtension->iRedrawStoreHandler ); |
3454 |
|
3455 cont->SetBackground( iExtension ); |
|
3456 |
|
3457 CleanupStack::PushL( cont ); |
3132 CleanupStack::PushL( cont ); |
3458 iControls->AppendL( cont ); |
3133 iControls->AppendL( cont ); |
3459 CleanupStack::Pop( cont ); |
3134 CleanupStack::Pop( cont ); |
3460 } |
3135 } |
3461 |
3136 |
3487 |
3162 |
3488 // In stacon, make a second prepare and draw. This is due to that stacon |
3163 // In stacon, make a second prepare and draw. This is due to that stacon |
3489 // has two background contextes. |
3164 // has two background contextes. |
3490 if ( ( layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_LEFT || |
3165 if ( ( layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_LEFT || |
3491 layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT || |
3166 layoutResId == R_AVKON_STACON_PANE_LAYOUT_IDLE_SOFTKEYS_RIGHT || |
3492 layoutResId == R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT || |
3167 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 ) ) |
|
3495 { |
3168 { |
3496 partOfCombinedContext = |
3169 partOfCombinedContext = |
3497 iExtension->iCommonBgContext->GetControlContext( 1 ); |
3170 iExtension->iCommonBgContext->GetControlContext( 1 ); |
3498 |
3171 |
3499 CEikStatusPaneContainer::PrepareBackgroundContext( |
3172 CEikStatusPaneContainer::PrepareBackgroundContext( |
3835 // Return largest bounding rect. |
3508 // Return largest bounding rect. |
3836 return largestBoundingRect; |
3509 return largestBoundingRect; |
3837 } |
3510 } |
3838 |
3511 |
3839 |
3512 |
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 |
|
3900 /** |
3513 /** |
3901 * Visitor class for collecting the sub-pane areas to a single region. |
3514 * Visitor class for collecting the sub-pane areas to a single region. |
3902 */ |
3515 */ |
3903 NONSHARABLE_CLASS( TStatusPaneRegionCollector ) |
3516 NONSHARABLE_CLASS( TStatusPaneRegionCollector ) |
3904 : public MEikStatusPaneLayoutTreeVisitor |
3517 : public MEikStatusPaneLayoutTreeVisitor |
3986 // |
3599 // |
3987 EXPORT_C void CEikStatusPaneBase::SetFlags( TInt aFlags ) |
3600 EXPORT_C void CEikStatusPaneBase::SetFlags( TInt aFlags ) |
3988 { |
3601 { |
3989 MakeVisible( aFlags & KEikStatusPaneBaseVisibleBit ); |
3602 MakeVisible( aFlags & KEikStatusPaneBaseVisibleBit ); |
3990 SetDimmed( aFlags & KEikStatusPaneBaseDimmedBit ); |
3603 SetDimmed( aFlags & KEikStatusPaneBaseDimmedBit ); |
3991 EnableTransparent( aFlags & KStatusPaneTransparentBit ); |
3604 } |
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 } |
|
4036 |
3605 |
4037 |
3606 |
4038 // --------------------------------------------------------------------------- |
3607 // --------------------------------------------------------------------------- |
4039 // CEikStatusPaneBase::Flags |
3608 // CEikStatusPaneBase::Flags |
4040 // Returns the status pane flags. |
3609 // Returns the status pane flags. |