|
1 /* |
|
2 * Copyright (c) 2006-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: Defines item in display background. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __ALFDISPLAYBACKGROUNDITEM_H__ |
|
21 #define __ALFDISPLAYBACKGROUNDITEM_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <AknsUtils.h> |
|
25 |
|
26 /** |
|
27 * This class specifies an item that is drawn in the display background. |
|
28 * Item can specify background as either: |
|
29 * |
|
30 * "None" - Nothing is drawn to given display area. Can be used to minimize |
|
31 * updates to display background areas that e.g. are not visible |
|
32 * and thus maximize framerate. |
|
33 * |
|
34 * "Color" - Given display area is filled with given color. Can be defined as |
|
35 * skinnable color or normal RGB color.. |
|
36 * |
|
37 * "Skin background" - Given display area is filled with given skin background |
|
38 * graphics. |
|
39 * Usage: |
|
40 * @code |
|
41 * |
|
42 * //Array to cotain background items |
|
43 * RArray<TAlfDisplayBackgroundItem> items; |
|
44 * |
|
45 * //Fill with Skin backgrounds |
|
46 * TAlfDisplayBackgroundItem newItem0( rect, logicalskin ); |
|
47 * newItem0.SetRect( rect ); |
|
48 * newItem0.SetThemeBackground(logicalskin); |
|
49 * |
|
50 * //Append in items |
|
51 * items.AppendL( newItem0 ); |
|
52 * |
|
53 * // Fill with Skin colors |
|
54 * TAlfDisplayBackgroundItem newItem1( rect, logicalskin, skinnedColorIndex1 ); |
|
55 * newItem1.SetRect( rect1 ); |
|
56 * newItem1.SetColor( logicalskin, 1 ); |
|
57 * |
|
58 * //Append in items |
|
59 * items.AppendL( newItem1 ); |
|
60 * |
|
61 * // Fill with Colors |
|
62 * TAlfDisplayBackgroundItem newItem2( rect, 0x0 ); |
|
63 * newItem2.SetRect( rect ); |
|
64 * newItem2.SetColor( KRgbRed ); |
|
65 * |
|
66 * //Append in items vector |
|
67 * items.AppendL( newItem2 ); |
|
68 * |
|
69 * //Create display and set background items |
|
70 * CAlfDisplay* display = iEnv->NewDisplayLiEnv->NewDisplayL( ClientRect(), |
|
71 * CAlfEnv::ENewDisplayAsCoeControl ); |
|
72 * display->SetBackgroundItemsL( items ); |
|
73 * |
|
74 * @endcode |
|
75 * @lib alfclient.lib |
|
76 * @since S60 xxx |
|
77 */ |
|
78 NONSHARABLE_CLASS( TAlfDisplayBackgroundItem ) |
|
79 { |
|
80 public: |
|
81 /** |
|
82 * Constructor. Default constructor. |
|
83 */ |
|
84 IMPORT_C TAlfDisplayBackgroundItem(); |
|
85 |
|
86 /** |
|
87 * Constructor. Creates backgroun item which area is not cleared. |
|
88 * @param aRect Item area in display coordinates (pixels). |
|
89 */ |
|
90 IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect ); |
|
91 |
|
92 /** |
|
93 * Constructor. Creates backgroun item which area is cleared |
|
94 * using the given skin background graphics. |
|
95 * @param aRect Item area in display coordinates (pixels). |
|
96 * @param aSkinID Skin background that is used to clear the item area. |
|
97 * Possible values are e.g. |
|
98 * KAknsIIDQsnBgScreen |
|
99 * KAknsIIDQsnBgScreenIdle |
|
100 * KAknsIIDQsnBgScreenMp |
|
101 * KAknsIIDQsnBgAreaMain |
|
102 * KAknsIIDQsnBgAreaMainAppsGrid |
|
103 * KAknsIIDQsnBgAreaMainHigh |
|
104 * KAknsIIDQsnBgAreaMainFlat |
|
105 * KAknsIIDQsnBgAreaMainSmall |
|
106 * KAknsIIDWallpaper |
|
107 * KAknsIIDQsnBgAreaMainIdle |
|
108 * KAknsIIDQsnBgAreaStatus |
|
109 * KAknsIIDQsnBgAreaStatusIdle |
|
110 * KAknsIIDQsnBgAreaStaconRt |
|
111 * KAknsIIDQsnBgAreaStaconLt |
|
112 * KAknsIIDQsnBgAreaStaconRb |
|
113 * KAknsIIDQsnBgAreaStaconLb |
|
114 * KAknsIIDQsnBgAreaStaconRtIdle |
|
115 * KAknsIIDQsnBgAreaStaconLtIdle |
|
116 * KAknsIIDQsnBgAreaStaconRbIdle |
|
117 * KAknsIIDQsnBgAreaStaconLbIdle |
|
118 * KAknsIIDQsnBgAreaControl |
|
119 * KAknsIIDQsnBgAreaControlPopup |
|
120 * KAknsIIDQsnBgAreaControlMp |
|
121 * KAknsIIDQsnBgAreaControlMp |
|
122 * KAknsIIDQsnBgNavipaneSolid |
|
123 * KAknsIIDQsnBgNavipaneSolidIdle |
|
124 * |
|
125 */ |
|
126 IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect, |
|
127 const TAknsItemID& aSkinID ); |
|
128 |
|
129 /** |
|
130 * Constructor. Creates backgroun item which area is cleared |
|
131 * using the given skin color. |
|
132 * @param aRect Item area in display coordinates (pixels). |
|
133 * @param aSkinID Skin color group that is used to clear the item area. |
|
134 * Possible values are e.g. |
|
135 * KAknsIIDQsnIconColors |
|
136 * KAknsIIDQsnTextColors |
|
137 * KAknsIIDQsnLineColors |
|
138 * KAknsIIDQsnOtherColors |
|
139 * KAknsIIDQsnHighlightColors |
|
140 * etc. |
|
141 * @param aColorIndex Skin color index. |
|
142 */ |
|
143 IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect, |
|
144 const TAknsItemID& aSkinID, |
|
145 TInt aColorIndex ); |
|
146 |
|
147 /** |
|
148 * Constructor. Creates backgroun item which area is cleared |
|
149 * using the given color. |
|
150 * @param aRect Item area in display coordinates (pixels). |
|
151 * @param aColor Color that is used to clear the item area. |
|
152 */ |
|
153 IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect, |
|
154 const TRgb& aColor ); |
|
155 |
|
156 /** |
|
157 * Sets area for the item. |
|
158 * @param aRect Item area in display coordinates (pixels). |
|
159 */ |
|
160 IMPORT_C void SetRect( const TRect& aRect ); |
|
161 |
|
162 /** |
|
163 * Sets color that is used clear the item area. This overrides |
|
164 * old color or the skin background if it has been previously given. |
|
165 * @param Item color. |
|
166 */ |
|
167 IMPORT_C void SetColor( const TRgb& aColor ); |
|
168 |
|
169 /** |
|
170 * Sets skinned color that is used clear the item area. This overrides |
|
171 * old color or skin background if it has been previously given. |
|
172 * @param aSkinID Skin color group that is used to clear the item area. |
|
173 * Possible values are e.g. |
|
174 * KAknsIIDQsnIconColors |
|
175 * KAknsIIDQsnTextColors |
|
176 * KAknsIIDQsnLineColors |
|
177 * KAknsIIDQsnOtherColors |
|
178 * KAknsIIDQsnHighlightColors |
|
179 * etc. |
|
180 * @param aColorIndex Color index. |
|
181 */ |
|
182 IMPORT_C void SetColor( const TAknsItemID& aSkinID, TInt aColorIndex ); |
|
183 |
|
184 /** |
|
185 * Sets skin backgroud that is used clear the item area. This overrides |
|
186 * old color or skin background if it has been previously given. |
|
187 * |
|
188 * @param aSkinID Skin background that is used to clear the item area. |
|
189 * Possible values are e.g. |
|
190 * KAknsIIDQsnBgScreen |
|
191 * KAknsIIDQsnBgScreenIdle |
|
192 * KAknsIIDQsnBgScreenMp |
|
193 * KAknsIIDQsnBgAreaMain |
|
194 * KAknsIIDQsnBgAreaMainAppsGrid |
|
195 * KAknsIIDQsnBgAreaMainHigh |
|
196 * KAknsIIDQsnBgAreaMainFlat |
|
197 * KAknsIIDQsnBgAreaMainSmall |
|
198 * KAknsIIDWallpaper |
|
199 * KAknsIIDQsnBgAreaMainIdle |
|
200 * KAknsIIDQsnBgAreaStatus |
|
201 * KAknsIIDQsnBgAreaStatusIdle |
|
202 * KAknsIIDQsnBgAreaStaconRt |
|
203 * KAknsIIDQsnBgAreaStaconLt |
|
204 * KAknsIIDQsnBgAreaStaconRb |
|
205 * KAknsIIDQsnBgAreaStaconLb |
|
206 * KAknsIIDQsnBgAreaStaconRtIdle |
|
207 * KAknsIIDQsnBgAreaStaconLtIdle |
|
208 * KAknsIIDQsnBgAreaStaconRbIdle |
|
209 * KAknsIIDQsnBgAreaStaconLbIdle |
|
210 * KAknsIIDQsnBgAreaControl |
|
211 * KAknsIIDQsnBgAreaControlPopup |
|
212 * KAknsIIDQsnBgAreaControlMp |
|
213 * KAknsIIDQsnBgAreaControlMp |
|
214 * KAknsIIDQsnBgNavipaneSolid |
|
215 * KAknsIIDQsnBgNavipaneSolidIdle |
|
216 */ |
|
217 IMPORT_C void SetSkinBackground( const TAknsItemID& aSkinID ); |
|
218 |
|
219 private: |
|
220 /** Item draw area, specified in display pixels */ |
|
221 TRect iRect; |
|
222 |
|
223 /** Item skin id. Can be a skin background or skin color */ |
|
224 TAknsItemID iSkinID; |
|
225 |
|
226 /** Item skin color index */ |
|
227 TInt iColorIndex; |
|
228 |
|
229 /** Item color (used if draw mode is clear with color) */ |
|
230 TRgb iColor; |
|
231 |
|
232 /** Item draw mode */ |
|
233 TInt iClearMode; |
|
234 |
|
235 /** Reserved for future use */ |
|
236 TInt iSpare1; |
|
237 TInt iSpare2; |
|
238 TInt iSpare3; |
|
239 }; |
|
240 |
|
241 #endif |