|
1 /* |
|
2 * Copyright (c) 2010 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 * statuspane's background cleaner implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 // System includes |
|
20 #include <e32base.h> |
|
21 #include <w32std.h> |
|
22 #include <AknUtils.h> |
|
23 |
|
24 // User includes |
|
25 #include "xnspbgcleaner.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // ============================ LOCAL FUNCTIONS ================================ |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 // --------------------------------------------------------- |
|
34 // CXnSpBgCleaner::NewL |
|
35 // --------------------------------------------------------- |
|
36 // |
|
37 CXnSpBgCleaner* CXnSpBgCleaner::NewL() |
|
38 { |
|
39 CXnSpBgCleaner* self = CXnSpBgCleaner::NewLC(); |
|
40 CleanupStack::Pop(); // self; |
|
41 return self; |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------- |
|
45 // CXnSpBgCleaner::NewLC |
|
46 // --------------------------------------------------------- |
|
47 // |
|
48 CXnSpBgCleaner* CXnSpBgCleaner::NewLC() |
|
49 { |
|
50 CXnSpBgCleaner* self = new ( ELeave ) CXnSpBgCleaner(); |
|
51 CleanupStack::PushL(self); |
|
52 self->ConstructL(); |
|
53 return self; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------- |
|
57 // CXnSpBgCleaner::CXnSpBgCleaner |
|
58 // --------------------------------------------------------- |
|
59 // |
|
60 CXnSpBgCleaner::CXnSpBgCleaner() |
|
61 { |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------- |
|
65 // CXnSpBgCleaner::ConstructL |
|
66 // --------------------------------------------------------- |
|
67 // |
|
68 void CXnSpBgCleaner::ConstructL() |
|
69 { |
|
70 CreateWindowL(); |
|
71 |
|
72 TRect statusPaneRect; |
|
73 AknLayoutUtils::LayoutMetricsRect( |
|
74 AknLayoutUtils::EStatusPane, statusPaneRect ); |
|
75 |
|
76 SetRect( statusPaneRect ); |
|
77 SetNonFocusing(); |
|
78 |
|
79 Window().SetOrdinalPosition( -1 ); |
|
80 Window().SetBackgroundColor( TRgb::Color16MA(0) ); |
|
81 Window().SetVisible( ETrue ); |
|
82 |
|
83 ActivateL(); |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // CXnSpBgCleaner::~CXnSpBgCleaner |
|
88 // --------------------------------------------------------- |
|
89 // |
|
90 CXnSpBgCleaner::~CXnSpBgCleaner() |
|
91 { |
|
92 } |
|
93 |
|
94 // --------------------------------------------------------- |
|
95 // CXnSpBgCleaner::SizeChanged |
|
96 // --------------------------------------------------------- |
|
97 // |
|
98 void CXnSpBgCleaner::SizeChanged() |
|
99 { |
|
100 CCoeControl::SizeChanged(); |
|
101 DrawDeferred(); |
|
102 } |
|
103 |
|
104 // --------------------------------------------------------- |
|
105 // CXnSpBgCleaner::Draw |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 void CXnSpBgCleaner::Draw( const TRect& /*aRect*/ ) const |
|
109 { |
|
110 CWindowGc& gc = SystemGc(); |
|
111 TRgb color( TRgb::Color16MA(0) ); |
|
112 gc.SetPenColor( color ); |
|
113 gc.SetBrushColor( color ); |
|
114 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
115 gc.SetPenStyle(CGraphicsContext::ESolidPen ); |
|
116 gc.SetBrushStyle(CGraphicsContext::ESolidBrush ); |
|
117 gc.Clear(); |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------- |
|
121 // CXnSpBgCleaner::HandleResourceChange |
|
122 // --------------------------------------------------------- |
|
123 // |
|
124 void CXnSpBgCleaner::HandleResourceChange( TInt aType ) |
|
125 { |
|
126 CCoeControl::HandleResourceChange( aType ); |
|
127 |
|
128 if ( KEikDynamicLayoutVariantSwitch == aType ) |
|
129 { |
|
130 TRect statusPaneRect; |
|
131 AknLayoutUtils::LayoutMetricsRect( |
|
132 AknLayoutUtils::EStatusPane, statusPaneRect ); |
|
133 SetRect( statusPaneRect ); |
|
134 } |
|
135 } |
|
136 |
|
137 // End of file |