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 |
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. |