author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:48:24 +0300 | |
branch | RCL_3 |
changeset 59 | 978afdc0236f |
parent 56 | d48ab3b357f1 |
child 72 | a5e7a4f63858 |
permissions | -rw-r--r-- |
56 | 1 |
/* |
2 |
* Copyright (c) 2009 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 "HgIndicatorManager.h" |
|
20 |
||
21 |
#include "HgConstants.h" |
|
22 |
#include <ganes/HgItem.h> |
|
23 |
||
24 |
#include <AknIconUtils.h> |
|
25 |
#include <avkon.mbg> |
|
26 |
#include <AknsDrawUtils.h> |
|
27 |
#include <gulicon.h> |
|
28 |
#include <AknUtils.h> |
|
29 |
#include <ganes.mbg> |
|
30 |
#include <AknLayout2ScalableDef.h> |
|
31 |
||
32 |
||
33 |
CHgIndicatorManager* CHgIndicatorManager::NewL() |
|
34 |
{ |
|
35 |
CHgIndicatorManager* self = new (ELeave) CHgIndicatorManager; |
|
36 |
CleanupStack::PushL(self); |
|
37 |
self->ConstructL(); |
|
38 |
CleanupStack::Pop(self); |
|
39 |
return self; |
|
40 |
} |
|
41 |
||
42 |
CHgIndicatorManager::~CHgIndicatorManager() |
|
43 |
{ |
|
44 |
delete iDrmIcon; |
|
45 |
delete iDrmExpIcon; |
|
46 |
delete iVideoIcon; |
|
47 |
delete iPlaybackIndicatorIcon; |
|
48 |
delete iMmcIcon; |
|
49 |
delete iMarkIcon; |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
50 |
delete iMarkIconOff; |
56 | 51 |
delete iPauseIndicatorIcon; |
52 |
delete iBrokenPlaylistIcon; |
|
53 |
delete iBrokenTrackIcon; |
|
54 |
delete iCorruptedTrackIcon; |
|
55 |
delete iMassStorageIcon; |
|
56 |
delete iNewVideoIcon; |
|
57 |
delete iPhoneStorageIcon; |
|
58 |
delete iNewPodcastIcon; |
|
59 |
delete iPlayedPodcastIcon; |
|
60 |
delete iCompletelyPlayedPodcastIcon; |
|
61 |
delete iMoveUpIcon; |
|
62 |
delete iMoveDownIcon; |
|
63 |
delete iMoveUpDownIcon; |
|
64 |
} |
|
65 |
||
66 |
void CHgIndicatorManager::InitIndicatorsL( const TSize& aIndicatorSize ) |
|
67 |
{ |
|
68 |
// Non-Skinned icons |
|
69 |
// Broken Playlist icon |
|
70 |
InitIconL( iBrokenPlaylistIcon, |
|
71 |
EMbmGanesQgn_graf_mup_lst_brokenplayl, |
|
72 |
EMbmGanesQgn_graf_mup_lst_brokenplayl_mask, |
|
73 |
aIndicatorSize ); |
|
74 |
||
75 |
// Broken track icon |
|
76 |
InitIconL( iBrokenTrackIcon, |
|
77 |
EMbmGanesQgn_graf_mup_lst_brokentrack, |
|
78 |
EMbmGanesQgn_graf_mup_lst_brokentrack_mask, |
|
79 |
aIndicatorSize ); |
|
80 |
||
81 |
// Corrupted track icon |
|
82 |
InitIconL( iCorruptedTrackIcon, |
|
83 |
EMbmGanesQgn_graf_mup_lst_corrupttrack, |
|
84 |
EMbmGanesQgn_graf_mup_lst_corrupttrack_mask, |
|
85 |
aIndicatorSize ); |
|
86 |
||
87 |
// New podcast icon |
|
88 |
InitIconL( iNewPodcastIcon, |
|
89 |
EMbmGanesQgn_graf_mup_lst_pdc_new, |
|
90 |
EMbmGanesQgn_graf_mup_lst_pdc_new_mask, |
|
91 |
aIndicatorSize ); |
|
92 |
||
93 |
// Played podcast icon |
|
94 |
InitIconL( iPlayedPodcastIcon, |
|
95 |
EMbmGanesQgn_graf_mup_lst_pdc_partplay, |
|
96 |
EMbmGanesQgn_graf_mup_lst_pdc_partplay_mask, |
|
97 |
aIndicatorSize ); |
|
98 |
||
99 |
// Completely played podcast icon |
|
100 |
InitIconL( iCompletelyPlayedPodcastIcon, |
|
101 |
EMbmGanesQgn_graf_mup_lst_pdc_compplay, |
|
102 |
EMbmGanesQgn_graf_mup_lst_pdc_compplay_mask, |
|
103 |
aIndicatorSize ); |
|
104 |
||
105 |
// Video icon |
|
106 |
InitIconL( iVideoIcon, |
|
107 |
EMbmGanesQgn_indi_media_thumbnail, |
|
108 |
EMbmGanesQgn_indi_media_thumbnail_mask, |
|
109 |
aIndicatorSize ); |
|
110 |
||
111 |
// Skinned icons |
|
112 |
// Mark icon |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
113 |
InitIconL( iMarkIcon, KAknsIIDQgnPropCheckboxOn, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
114 |
EMbmGanesQgn_prop_checkbox_on, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
115 |
EMbmGanesQgn_prop_checkbox_on_mask, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
116 |
aIndicatorSize ); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
117 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
118 |
// Mark icon, off state |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
119 |
InitIconL( iMarkIconOff, KAknsIIDQgnPropCheckboxOff, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
120 |
EMbmGanesQgn_prop_checkbox_off, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
121 |
EMbmGanesQgn_prop_checkbox_off_mask, |
56 | 122 |
aIndicatorSize ); |
123 |
||
124 |
// DRM valid icon |
|
125 |
InitIconL( iDrmIcon, KAknsIIDQgnPropDrmRightsValidSuper, |
|
126 |
EMbmGanesQgn_prop_drm_rights_valid_super, |
|
127 |
EMbmGanesQgn_prop_drm_rights_valid_super_mask, |
|
128 |
aIndicatorSize ); |
|
129 |
||
130 |
// DRM expired icon |
|
131 |
InitIconL( iDrmExpIcon, KAknsIIDQgnPropDrmRightsExpSuper, |
|
132 |
EMbmGanesQgn_prop_drm_rights_exp_super, |
|
133 |
EMbmGanesQgn_prop_drm_rights_exp_super_mask, |
|
134 |
aIndicatorSize ); |
|
135 |
||
136 |
// Playback icon |
|
137 |
InitIconL( iPlaybackIndicatorIcon, KAknsIIDQgnIndiMupPlay, |
|
138 |
EMbmGanesQgn_indi_mup_play, |
|
139 |
EMbmGanesQgn_indi_mup_play_mask, |
|
140 |
aIndicatorSize ); |
|
141 |
||
142 |
// Pause icon |
|
143 |
InitIconL( iPauseIndicatorIcon, KAknsIIDQgnIndiMupPause, |
|
144 |
EMbmGanesQgn_indi_mup_pause, |
|
145 |
EMbmGanesQgn_indi_mup_pause_mask, |
|
146 |
aIndicatorSize ); |
|
147 |
||
148 |
// New Video icon |
|
149 |
InitIconL( iNewVideoIcon, KAknsIIDQgnPropFmgrFileVideo, |
|
150 |
EMbmGanesQgn_prop_fmgr_file_video, |
|
151 |
EMbmGanesQgn_prop_fmgr_file_video_mask, |
|
152 |
aIndicatorSize ); |
|
153 |
||
154 |
// Phone memory icon |
|
155 |
InitIconL( iPhoneStorageIcon, KAknsIIDQgnPropPhoneMemc, |
|
156 |
EMbmGanesQgn_prop_phone_memc, |
|
157 |
EMbmGanesQgn_prop_phone_memc_mask, |
|
158 |
aIndicatorSize ); |
|
159 |
||
160 |
// MMC memory icon |
|
161 |
InitIconL( iMmcIcon, KAknsIIDQgnPropMmcMemc, |
|
162 |
EMbmGanesQgn_prop_mmc_memc, |
|
163 |
EMbmGanesQgn_prop_mmc_memc_mask, |
|
164 |
aIndicatorSize ); |
|
165 |
||
166 |
// Mass memory icon |
|
167 |
InitIconL( iMassStorageIcon, KAknsIIDQgnPropFmgrMsSmall, |
|
168 |
EMbmGanesQgn_prop_fmgr_ms_small, |
|
169 |
EMbmGanesQgn_prop_fmgr_ms_small_mask, |
|
170 |
aIndicatorSize ); |
|
171 |
||
172 |
// Move up icon |
|
173 |
InitIconL( iMoveUpIcon, KAknsIIDQgnGrafMupAdtlReorderUp, |
|
174 |
EMbmGanesQgn_graf_mup_adtl_reorder_up, |
|
175 |
EMbmGanesQgn_graf_mup_adtl_reorder_up_mask, |
|
176 |
aIndicatorSize ); |
|
177 |
||
178 |
// Move down icon |
|
179 |
InitIconL( iMoveDownIcon, KAknsIIDQgnGrafMupAdtlReorderDown, |
|
180 |
EMbmGanesQgn_graf_mup_adtl_reorder_down, |
|
181 |
EMbmGanesQgn_graf_mup_adtl_reorder_down_mask, |
|
182 |
aIndicatorSize ); |
|
183 |
||
184 |
// Move updown icon |
|
185 |
InitIconL( iMoveUpDownIcon, KAknsIIDQgnGrafMupAdtlReorderUpdown, |
|
186 |
EMbmGanesQgn_graf_mup_adtl_reorder_updown, |
|
187 |
EMbmGanesQgn_graf_mup_adtl_reorder_updown_mask, |
|
188 |
aIndicatorSize ); |
|
189 |
} |
|
190 |
||
191 |
void CHgIndicatorManager::DrawIndicators( |
|
192 |
CWindowGc& aGc, |
|
193 |
const TRect& aRect, |
|
194 |
TInt aFlags, |
|
195 |
TAknWindowComponentLayout aFirstIndicatorLayout, |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
196 |
TAknWindowComponentLayout aSecondIndicatorLayout, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
197 |
TBool aMarkingMode |
56 | 198 |
) const |
199 |
{ |
|
200 |
TAknLayoutRect secondIndicator; |
|
201 |
secondIndicator.LayoutRect(aRect, aSecondIndicatorLayout); |
|
202 |
||
203 |
TAknLayoutRect firstIndicator; |
|
204 |
firstIndicator.LayoutRect(aRect, aFirstIndicatorLayout); |
|
205 |
||
206 |
TAknLayoutRect rect = secondIndicator; |
|
207 |
TBool memIndicator = EFalse; |
|
208 |
TInt indicatorsDrawn = 0; |
|
209 |
||
210 |
if( aFlags & CHgItem::EHgItemFlagMarked ) |
|
211 |
{ |
|
212 |
rect.DrawImage(aGc, iMarkIcon->Bitmap(), iMarkIcon->Mask()); |
|
213 |
++indicatorsDrawn; |
|
214 |
rect = firstIndicator; |
|
215 |
} |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
216 |
else if(aMarkingMode) |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
217 |
{ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
218 |
rect.DrawImage(aGc, iMarkIconOff->Bitmap(), iMarkIconOff->Mask()); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
219 |
++indicatorsDrawn; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
220 |
rect = firstIndicator; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
221 |
} |
56 | 222 |
|
223 |
if( DrawIndicator(aGc, rect, aFlags, memIndicator) ) |
|
224 |
{ |
|
225 |
++indicatorsDrawn; |
|
226 |
rect = firstIndicator; |
|
227 |
} |
|
228 |
||
229 |
if( indicatorsDrawn == 1 && !memIndicator ) |
|
230 |
{ |
|
231 |
if( aFlags & CHgItem::EHgItemFlagsMmc ) |
|
232 |
{ |
|
233 |
rect.DrawImage(aGc, iMmcIcon->Bitmap(), iMmcIcon->Mask() ); |
|
234 |
} |
|
235 |
else if( aFlags & CHgItem::EHgItemFlagsMassStorageIndicator ) |
|
236 |
{ |
|
237 |
rect.DrawImage(aGc, iMassStorageIcon->Bitmap(), iMassStorageIcon->Mask() ); |
|
238 |
} |
|
239 |
else if( aFlags & CHgItem::EHgItemFlagsPhoneStorageIndicator ) |
|
240 |
{ |
|
241 |
rect.DrawImage(aGc, iPhoneStorageIcon->Bitmap(), iPhoneStorageIcon->Mask() ); |
|
242 |
} |
|
243 |
} |
|
244 |
||
245 |
} |
|
246 |
||
247 |
TBool CHgIndicatorManager::DrawIndicator( |
|
248 |
CWindowGc& aGc, |
|
249 |
TAknLayoutRect& aRect, |
|
250 |
TInt aFlags, |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
251 |
TBool& aMemIndicator |
56 | 252 |
) const |
253 |
{ |
|
254 |
TBool ret = EFalse; |
|
255 |
||
256 |
if( aFlags & CHgItem::EHgItemFlagsPlaybackIndicator ) |
|
257 |
{ |
|
258 |
aRect.DrawImage(aGc, iPlaybackIndicatorIcon->Bitmap(), iPlaybackIndicatorIcon->Mask() ); |
|
259 |
ret = ETrue; |
|
260 |
} |
|
261 |
else if( aFlags & CHgItem::EHgItemFlagsPauseIndicator ) |
|
262 |
{ |
|
263 |
aRect.DrawImage(aGc, iPauseIndicatorIcon->Bitmap(), iPauseIndicatorIcon->Mask() ); |
|
264 |
ret = ETrue; |
|
265 |
} |
|
266 |
else if( aFlags & CHgItem::EHgItemFlagsDrmRightsValid ) |
|
267 |
{ |
|
268 |
aRect.DrawImage(aGc, iDrmIcon->Bitmap(), iDrmIcon->Mask() ); |
|
269 |
ret = ETrue; |
|
270 |
} |
|
271 |
else if( aFlags & CHgItem::EHgItemFlagsDrmRightsExpired ) |
|
272 |
{ |
|
273 |
aRect.DrawImage(aGc, iDrmExpIcon->Bitmap(), iDrmExpIcon->Mask() ); |
|
274 |
ret = ETrue; |
|
275 |
} |
|
276 |
else if( aFlags & CHgItem::EHgItemFlagsVideo ) |
|
277 |
{ |
|
278 |
aRect.DrawImage(aGc, iVideoIcon->Bitmap(), iVideoIcon->Mask() ); |
|
279 |
ret = ETrue; |
|
280 |
} |
|
281 |
else if( aFlags & CHgItem::EHgItemFlagsBrokenPlaylistIndicator ) |
|
282 |
{ |
|
283 |
aRect.DrawImage(aGc, iBrokenPlaylistIcon->Bitmap(), iBrokenPlaylistIcon->Mask() ); |
|
284 |
ret = ETrue; |
|
285 |
} |
|
286 |
else if( aFlags & CHgItem::EHgItemFlagsBrokenTrackIndicator ) |
|
287 |
{ |
|
288 |
aRect.DrawImage(aGc, iBrokenTrackIcon->Bitmap(), iBrokenTrackIcon->Mask() ); |
|
289 |
ret = ETrue; |
|
290 |
} |
|
291 |
else if( aFlags & CHgItem::EHgItemFlagsCorruptedTrackIndicator ) |
|
292 |
{ |
|
293 |
aRect.DrawImage(aGc, iCorruptedTrackIcon->Bitmap(), iCorruptedTrackIcon->Mask() ); |
|
294 |
ret = ETrue; |
|
295 |
} |
|
296 |
else if( aFlags & CHgItem::EHgItemFlagsNewVideoIndicator ) |
|
297 |
{ |
|
298 |
aRect.DrawImage(aGc, iNewVideoIcon->Bitmap(), iNewVideoIcon->Mask() ); |
|
299 |
ret = ETrue; |
|
300 |
} |
|
301 |
else if( aFlags & CHgItem::EHgItemFlagsNewPodcastIndicator ) |
|
302 |
{ |
|
303 |
aRect.DrawImage(aGc, iNewPodcastIcon->Bitmap(), iNewPodcastIcon->Mask() ); |
|
304 |
ret = ETrue; |
|
305 |
} |
|
306 |
else if( aFlags & CHgItem::EHgItemFlagsPlayedPodcastIndicator ) |
|
307 |
{ |
|
308 |
aRect.DrawImage(aGc, iPlayedPodcastIcon->Bitmap(), iPlayedPodcastIcon->Mask() ); |
|
309 |
ret = ETrue; |
|
310 |
} |
|
311 |
else if( aFlags & CHgItem::EHgItemFlagsCompletelyPlayedPodcastIndicator ) |
|
312 |
{ |
|
313 |
aRect.DrawImage(aGc, iCompletelyPlayedPodcastIcon->Bitmap(), iCompletelyPlayedPodcastIcon->Mask() ); |
|
314 |
ret = ETrue; |
|
315 |
} |
|
316 |
else if( aFlags & CHgItem::EHgItemFlagsMoveUpIndicator ) |
|
317 |
{ |
|
318 |
aRect.DrawImage(aGc, iMoveUpIcon->Bitmap(), iMoveUpIcon->Mask() ); |
|
319 |
ret = ETrue; |
|
320 |
} |
|
321 |
else if( aFlags & CHgItem::EHgItemFlagsMoveDownIndicator ) |
|
322 |
{ |
|
323 |
aRect.DrawImage(aGc, iMoveDownIcon->Bitmap(), iMoveDownIcon->Mask() ); |
|
324 |
ret = ETrue; |
|
325 |
} |
|
326 |
else if( aFlags & CHgItem::EHgItemFlagsMoveUpDownIndicator ) |
|
327 |
{ |
|
328 |
aRect.DrawImage(aGc, iMoveUpDownIcon->Bitmap(), iMoveUpDownIcon->Mask() ); |
|
329 |
ret = ETrue; |
|
330 |
} |
|
331 |
else if( aFlags & CHgItem::EHgItemFlagsMmc ) |
|
332 |
{ |
|
333 |
aRect.DrawImage(aGc, iMmcIcon->Bitmap(), iMmcIcon->Mask() ); |
|
334 |
ret = ETrue; |
|
335 |
aMemIndicator = ETrue; |
|
336 |
} |
|
337 |
else if( aFlags & CHgItem::EHgItemFlagsMassStorageIndicator ) |
|
338 |
{ |
|
339 |
aRect.DrawImage(aGc, iMassStorageIcon->Bitmap(), iMassStorageIcon->Mask() ); |
|
340 |
ret = ETrue; |
|
341 |
aMemIndicator = ETrue; |
|
342 |
} |
|
343 |
else if( aFlags & CHgItem::EHgItemFlagsPhoneStorageIndicator ) |
|
344 |
{ |
|
345 |
aRect.DrawImage(aGc, iPhoneStorageIcon->Bitmap(), iPhoneStorageIcon->Mask() ); |
|
346 |
ret = ETrue; |
|
347 |
aMemIndicator = ETrue; |
|
348 |
} |
|
349 |
return ret; |
|
350 |
} |
|
351 |
||
352 |
// ----------------------------------------------------------------------------- |
|
353 |
// CHgIndicatorManager::InitIconL() |
|
354 |
// ----------------------------------------------------------------------------- |
|
355 |
// |
|
356 |
void CHgIndicatorManager::InitIconL( CGulIcon*& aIcon, |
|
357 |
TInt aIconIndex, |
|
358 |
TInt aMaskIndex, |
|
359 |
TSize aSize ) |
|
360 |
{ |
|
361 |
if( !aIcon ) |
|
362 |
{ |
|
363 |
CFbsBitmap* bitmap, *mask; |
|
364 |
AknIconUtils::CreateIconL( |
|
365 |
bitmap, |
|
366 |
mask, |
|
367 |
KGanesMif, |
|
368 |
aIconIndex, |
|
369 |
aMaskIndex ); |
|
370 |
aIcon = CGulIcon::NewL(bitmap, mask); |
|
371 |
} |
|
372 |
||
373 |
AknIconUtils::SetSize(aIcon->Bitmap(), aSize); |
|
374 |
} |
|
375 |
||
376 |
// ----------------------------------------------------------------------------- |
|
377 |
// CHgIndicatorManager::InitIconL() |
|
378 |
// ----------------------------------------------------------------------------- |
|
379 |
// |
|
380 |
void CHgIndicatorManager::InitIconL( CGulIcon*& aIcon, |
|
381 |
const TAknsItemID& aItemId, |
|
382 |
TInt aIconIndex, |
|
383 |
TInt aMaskIndex, |
|
384 |
TSize aSize ) |
|
385 |
{ |
|
386 |
if( !aIcon ) |
|
387 |
{ |
|
388 |
aIcon = AknsUtils::CreateGulIconL( |
|
389 |
AknsUtils::SkinInstance(), |
|
390 |
aItemId, |
|
391 |
KGanesMif, |
|
392 |
aIconIndex, |
|
393 |
aMaskIndex ); |
|
394 |
} |
|
395 |
||
396 |
AknIconUtils::SetSize(aIcon->Bitmap(), aSize); |
|
397 |
} |
|
398 |
||
399 |
// ----------------------------------------------------------------------------- |
|
400 |
// CHgIndicatorManager::InitIconL() |
|
401 |
// ----------------------------------------------------------------------------- |
|
402 |
// |
|
403 |
void CHgIndicatorManager::InitColorIconL( CGulIcon*& aIcon, |
|
404 |
const TAknsItemID& aItemId, |
|
405 |
TInt aIconIndex, |
|
406 |
TInt aMaskIndex, |
|
407 |
TSize aSize ) |
|
408 |
{ |
|
409 |
if( !aIcon ) |
|
410 |
{ |
|
411 |
TRgb defaultColour( KRgbWhite ); |
|
412 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
413 |
||
414 |
AknsUtils::GetCachedColor( skin, |
|
415 |
defaultColour, |
|
416 |
KAknsIIDQsnIconColors, |
|
417 |
EAknsCIQsnIconColorsCG13 ); |
|
418 |
||
419 |
CFbsBitmap *bitmap,*mask; |
|
420 |
AknsUtils::CreateColorIconL( |
|
421 |
skin, |
|
422 |
aItemId, |
|
423 |
KAknsIIDQsnIconColors, |
|
424 |
EAknsCIQsnIconColorsCG13, |
|
425 |
bitmap, |
|
426 |
mask, |
|
427 |
KGanesMif, |
|
428 |
aIconIndex, |
|
429 |
aMaskIndex, |
|
430 |
defaultColour ); |
|
431 |
||
432 |
aIcon = CGulIcon::NewL(bitmap, mask); |
|
433 |
} |
|
434 |
||
435 |
AknIconUtils::SetSize(aIcon->Bitmap(), aSize); |
|
436 |
} |
|
437 |
||
438 |
TInt CHgIndicatorManager::CountIndicators( TInt aFlags ) |
|
439 |
{ |
|
440 |
TInt count = 0; |
|
441 |
aFlags &= (~CHgItem::EHgItemFlagsIconOverlayIndicator); // overlayindicator not counted |
|
442 |
while(aFlags) |
|
443 |
{ |
|
444 |
count += aFlags & 0x1; |
|
445 |
aFlags = aFlags >> 1; |
|
446 |
} |
|
447 |
return count > KMaxNumberOfTitleIndicators ? KMaxNumberOfTitleIndicators : count; |
|
448 |
} |
|
449 |
||
450 |
CHgIndicatorManager::CHgIndicatorManager() |
|
451 |
{ |
|
452 |
||
453 |
} |
|
454 |
||
455 |
void CHgIndicatorManager::ConstructL() |
|
456 |
{ |
|
457 |
||
458 |
} |