1 /* |
|
2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <imageprintapp.rsg> |
|
20 #include <e32keys.h> |
|
21 #include <aknViewAppUi.h> |
|
22 #include <AknsUtils.h> |
|
23 #include <AknsDrawUtils.h> |
|
24 #include <AknsConstants.h> |
|
25 #include <AknsListBoxBackgroundControlContext.h> |
|
26 |
|
27 #include "cimageprintblankcontainer.h" |
|
28 #include "imageprintapp.hrh" |
|
29 #include "imageprintconsts.h" |
|
30 |
|
31 CImagePrintBlankContainer* CImagePrintBlankContainer::NewL( |
|
32 TRect& aRect ) |
|
33 { |
|
34 CImagePrintBlankContainer* self = NewLC( aRect ); |
|
35 CleanupStack::Pop( self ); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CImagePrintBlankContainer* CImagePrintBlankContainer::NewLC( |
|
40 TRect& aRect ) |
|
41 { |
|
42 CImagePrintBlankContainer* self = new ( ELeave ) CImagePrintBlankContainer(); |
|
43 CleanupStack::PushL( self ); |
|
44 self->ConstructL( aRect ); |
|
45 return self; |
|
46 } |
|
47 |
|
48 // Default constructor |
|
49 CImagePrintBlankContainer::CImagePrintBlankContainer() |
|
50 { |
|
51 } |
|
52 |
|
53 // 2nd phase constructor |
|
54 void CImagePrintBlankContainer::ConstructL( |
|
55 const TRect& aRect ) |
|
56 { |
|
57 CreateWindowL(); |
|
58 SetRect( aRect ); |
|
59 |
|
60 // Fetch the dimensions of the screen |
|
61 TScreenInfoV01 info; |
|
62 TPckgBuf<TScreenInfoV01> buf( info ); |
|
63 UserSvr::ScreenInfo( buf ); |
|
64 info = buf(); |
|
65 TRect screenRect( TPoint( 0, 0 ), info.iScreenSize ); |
|
66 |
|
67 // Create skin control context for filling the background |
|
68 const TAknsItemID *id = &KAknsIIDNone; |
|
69 iSkinControlContext = |
|
70 CAknsListBoxBackgroundControlContext::NewL( |
|
71 KAknsIIDSkinBmpMainPaneUsual, screenRect, ETrue, *id, screenRect ); |
|
72 |
|
73 ActivateL(); |
|
74 } |
|
75 |
|
76 // Destructor |
|
77 CImagePrintBlankContainer::~CImagePrintBlankContainer() |
|
78 { |
|
79 delete iSkinControlContext; |
|
80 } |
|
81 |
|
82 // Draw method |
|
83 void CImagePrintBlankContainer::Draw( |
|
84 const TRect& /*aRect*/ ) const |
|
85 { |
|
86 CWindowGc& gc = SystemGc(); |
|
87 |
|
88 TRect rect = Rect(); |
|
89 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
90 if ( AknsDrawUtils::HasBitmapBackground( skin, iSkinControlContext ) ) |
|
91 { |
|
92 // Draw skin background |
|
93 AknsDrawUtils::Background( skin, iSkinControlContext, NULL, gc, rect ); |
|
94 } |
|
95 else |
|
96 { |
|
97 gc.Clear( rect ); |
|
98 } |
|
99 } |
|
100 |
|
101 void CImagePrintBlankContainer::HandleResourceChange( TInt aType ) |
|
102 { |
|
103 if( aType == KEikDynamicLayoutVariantSwitch ) |
|
104 { |
|
105 CEikAppUi* appUi = static_cast<CEikAppUi*>( iEikonEnv->AppUi() ); |
|
106 TRect rect = appUi->ClientRect(); |
|
107 SetRect( rect ); |
|
108 } |
|
109 } |
|
110 |
|
111 // End of File |
|