|
26
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2006 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: Layout and graphic factory for Common Playback View
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
// INCLUDE FILES
|
|
|
21 |
#include <AknsUtils.h>
|
|
|
22 |
#include <AknUtils.h>
|
|
|
23 |
#include <barsread.h>
|
|
|
24 |
#include <gulicon.h>
|
|
|
25 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
|
26 |
#include <layoutmetadata.cdl.h>
|
|
|
27 |
#include <data_caging_path_literals.hrh>
|
|
|
28 |
#include <mpxcommonplaybackview.rsg>
|
|
|
29 |
#include <mpxcommonplaybackview.mbg>
|
|
|
30 |
#include <mpxfmtx.rsg> // For FF_FMTX
|
|
|
31 |
#include <featmgr.h>
|
|
|
32 |
#include <centralrepository.h>
|
|
|
33 |
#include <mpxinternalcrkeys.h>
|
|
|
34 |
#include <mpxlbxextendedfeatures.h>
|
|
|
35 |
#include <mpxlog.h>
|
|
|
36 |
#include <mpxuser.h>
|
|
|
37 |
|
|
|
38 |
#include "mpxcommonplaybackviewlayout.h"
|
|
|
39 |
|
|
|
40 |
using namespace AknLayoutScalable_Apps;
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
// CONSTANTS
|
|
|
44 |
_LIT(KMXPanicCategory, "CMPXCommonPlaybackViewLayout");
|
|
|
45 |
//_LIT(KMpxcommonplaybackviewMbmFile, "mpxcommonplaybackview.mbm");
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
// ======== MEMBER FUNCTIONS ========
|
|
|
49 |
|
|
|
50 |
// ---------------------------------------------------------------------------
|
|
|
51 |
// Get layout data for a button.
|
|
|
52 |
// ---------------------------------------------------------------------------
|
|
|
53 |
//
|
|
|
54 |
EXPORT_C TRect CMPXCommonPlaybackViewLayout::ButtonLayout(
|
|
|
55 |
const TRect& aParentRect )
|
|
|
56 |
{
|
|
|
57 |
TAknLayoutRect res;
|
|
|
58 |
TAknWindowComponentLayout layoutItem;
|
|
|
59 |
TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
|
|
|
60 |
if(!isLandscape)
|
|
|
61 |
{
|
|
|
62 |
layoutItem = mup3_rocker_pane(0);
|
|
|
63 |
}
|
|
|
64 |
else
|
|
|
65 |
{
|
|
|
66 |
layoutItem = mup3_rocker_pane(1);
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
res.LayoutRect( aParentRect, layoutItem.LayoutLine() );
|
|
|
70 |
return res.Rect();
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
// ---------------------------------------------------------------------------
|
|
|
74 |
// Get layout data for an graphical indicator.
|
|
|
75 |
// ---------------------------------------------------------------------------
|
|
|
76 |
//
|
|
|
77 |
EXPORT_C TRect CMPXCommonPlaybackViewLayout::IndicatorLayout(
|
|
|
78 |
const TRect& aParentRect,
|
|
|
79 |
TMPXPbvIndicator aIndicator )
|
|
|
80 |
{
|
|
|
81 |
TAknLayoutRect res;
|
|
|
82 |
|
|
|
83 |
TMPXPbvLayoutVariants lafVariant(EPbvUndefinedVariant);
|
|
|
84 |
MPX_TRAPD( err, lafVariant = GetIndicatorVariantL(aIndicator) );
|
|
|
85 |
if ( err != KErrNone || lafVariant == EPbvUndefinedVariant)
|
|
|
86 |
{
|
|
|
87 |
// unsupported
|
|
|
88 |
ASSERT(0);
|
|
|
89 |
}
|
|
|
90 |
else
|
|
|
91 |
{
|
|
|
92 |
TAknWindowComponentLayout layoutItem;
|
|
|
93 |
switch ( aIndicator )
|
|
|
94 |
{
|
|
|
95 |
case EIconPlay:
|
|
|
96 |
case EIconPause:
|
|
|
97 |
case EIconStop:
|
|
|
98 |
{
|
|
|
99 |
layoutItem = main_mup3_pane_g5(lafVariant);
|
|
|
100 |
break;
|
|
|
101 |
}
|
|
|
102 |
case EIconRepeatAll:
|
|
|
103 |
case EIconRepeatOne:
|
|
|
104 |
{
|
|
|
105 |
layoutItem = main_mup3_pane_g4(lafVariant);
|
|
|
106 |
break;
|
|
|
107 |
}
|
|
|
108 |
case EIconRandom:
|
|
|
109 |
{
|
|
|
110 |
layoutItem = main_mup3_pane_g3(lafVariant);
|
|
|
111 |
break;
|
|
|
112 |
}
|
|
|
113 |
case EAlbumArtArea:
|
|
|
114 |
{
|
|
|
115 |
layoutItem = main_mup3_pane_g2(lafVariant);
|
|
|
116 |
break;
|
|
|
117 |
}
|
|
|
118 |
case ESliderPane:
|
|
|
119 |
{
|
|
|
120 |
layoutItem = mup3_progress_pane(lafVariant);
|
|
|
121 |
break;
|
|
|
122 |
}
|
|
|
123 |
case ESliderBackground:
|
|
|
124 |
{
|
|
|
125 |
layoutItem = mup_progress_pane_cp03();
|
|
|
126 |
break;
|
|
|
127 |
}
|
|
|
128 |
case EPlaybackSlider:
|
|
|
129 |
{
|
|
|
130 |
layoutItem = mup_progress_pane_cp03();
|
|
|
131 |
break;
|
|
|
132 |
}
|
|
|
133 |
case EDownloadSlider:
|
|
|
134 |
{
|
|
|
135 |
layoutItem = mup_progress_pane_cp03();
|
|
|
136 |
break;
|
|
|
137 |
}
|
|
|
138 |
#ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER
|
|
|
139 |
case EIconReal:
|
|
|
140 |
{
|
|
|
141 |
if( lafVariant == EPbvPortraitWithRocker )
|
|
|
142 |
{
|
|
|
143 |
layoutItem = main_mup3_pane_g8( 0 );
|
|
|
144 |
}
|
|
|
145 |
else if( lafVariant == EPbvLandscapeWithRocker )
|
|
|
146 |
{
|
|
|
147 |
layoutItem = main_mup3_pane_g8( 15 );
|
|
|
148 |
}
|
|
|
149 |
else
|
|
|
150 |
{
|
|
|
151 |
layoutItem = main_mup3_pane_g8( lafVariant );
|
|
|
152 |
}
|
|
|
153 |
|
|
|
154 |
break;
|
|
|
155 |
}
|
|
|
156 |
#endif
|
|
|
157 |
default:
|
|
|
158 |
{
|
|
|
159 |
__ASSERT_ALWAYS(EFalse,
|
|
|
160 |
User::Panic(KMXPanicCategory, KErrArgument));
|
|
|
161 |
}
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
res.LayoutRect(aParentRect, layoutItem.LayoutLine());
|
|
|
165 |
}
|
|
|
166 |
return res.Rect();
|
|
|
167 |
}
|
|
|
168 |
|
|
|
169 |
// ---------------------------------------------------------------------------
|
|
|
170 |
// Set layout data for a text label.
|
|
|
171 |
// ---------------------------------------------------------------------------
|
|
|
172 |
//
|
|
|
173 |
EXPORT_C void CMPXCommonPlaybackViewLayout::LayoutLabel(
|
|
|
174 |
CEikLabel* aLabel,
|
|
|
175 |
const TRect& aParentRect,
|
|
|
176 |
TMPXPbvTextIndicator aText,
|
|
|
177 |
TInt /*aOffsetx*/, /* =0 */
|
|
|
178 |
TInt /*aOffsety*/ /* =0 */ )
|
|
|
179 |
{
|
|
|
180 |
TMPXPbvLayoutVariants lafVariant(EPbvUndefinedVariant);
|
|
|
181 |
MPX_TRAPD( err, lafVariant = GetTextVariantL(aText) );
|
|
|
182 |
if ( lafVariant == EPbvUndefinedVariant || err != KErrNone )
|
|
|
183 |
{
|
|
|
184 |
ASSERT(0);
|
|
|
185 |
}
|
|
|
186 |
else
|
|
|
187 |
{
|
|
|
188 |
TAknTextComponentLayout layoutItem;
|
|
|
189 |
switch ( aText )
|
|
|
190 |
{
|
|
|
191 |
case ETextTrack:
|
|
|
192 |
{
|
|
|
193 |
layoutItem = main_mup3_pane_t1(lafVariant);
|
|
|
194 |
break;
|
|
|
195 |
}
|
|
|
196 |
case ETextArtist:
|
|
|
197 |
{
|
|
|
198 |
layoutItem = main_mup3_pane_t2(lafVariant);
|
|
|
199 |
break;
|
|
|
200 |
}
|
|
|
201 |
case ETextPlaylistCount:
|
|
|
202 |
{
|
|
|
203 |
if( lafVariant == EPbvLandscapeWithRocker )
|
|
|
204 |
{
|
|
|
205 |
lafVariant = (TMPXPbvLayoutVariants)15;
|
|
|
206 |
}
|
|
|
207 |
layoutItem = main_mup3_pane_t5(lafVariant);
|
|
|
208 |
break;
|
|
|
209 |
}
|
|
|
210 |
case ETextEmpty:
|
|
|
211 |
{
|
|
|
212 |
layoutItem = main_mup3_pane_t6(lafVariant);
|
|
|
213 |
break;
|
|
|
214 |
}
|
|
|
215 |
case ETextElapsedTime:
|
|
|
216 |
{
|
|
|
217 |
layoutItem = mup3_progress_pane_t1();
|
|
|
218 |
break;
|
|
|
219 |
}
|
|
|
220 |
case ETextRemainingTime:
|
|
|
221 |
{
|
|
|
222 |
layoutItem = mup3_progress_pane_t2();
|
|
|
223 |
break;
|
|
|
224 |
}
|
|
|
225 |
case ETextDownloadState:
|
|
|
226 |
{
|
|
|
227 |
layoutItem = mup3_progress_pane_t3();
|
|
|
228 |
break;
|
|
|
229 |
}
|
|
|
230 |
case ETextFMFrequency:
|
|
|
231 |
{
|
|
|
232 |
if( lafVariant == EPbvPortraitWithRocker )
|
|
|
233 |
{
|
|
|
234 |
layoutItem = main_mup3_pane_t7( 15 );
|
|
|
235 |
}
|
|
|
236 |
else if( lafVariant == EPbvLandscapeWithRocker )
|
|
|
237 |
{
|
|
|
238 |
layoutItem = main_mup3_pane_t7( 16 );
|
|
|
239 |
}
|
|
|
240 |
else
|
|
|
241 |
{
|
|
|
242 |
layoutItem = main_mup3_pane_t7(lafVariant);
|
|
|
243 |
}
|
|
|
244 |
break;
|
|
|
245 |
}
|
|
|
246 |
default:
|
|
|
247 |
{
|
|
|
248 |
__ASSERT_ALWAYS(EFalse,
|
|
|
249 |
User::Panic(KMXPanicCategory, KErrArgument));
|
|
|
250 |
}
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
AknLayoutUtils::LayoutLabel(aLabel, aParentRect, layoutItem.LayoutLine());
|
|
|
254 |
|
|
|
255 |
}
|
|
|
256 |
}
|
|
|
257 |
|
|
|
258 |
// ---------------------------------------------------------------------------
|
|
|
259 |
// Get the bitmap and mask for a soft button in a given state.
|
|
|
260 |
// ---------------------------------------------------------------------------
|
|
|
261 |
//
|
|
|
262 |
EXPORT_C void CMPXCommonPlaybackViewLayout::GetButtonBitmapsL(
|
|
|
263 |
TMPXPbvButton /*aButton*/,
|
|
|
264 |
TInt /*aButtonState*/,
|
|
|
265 |
CFbsBitmap*& /*aBitmap*/,
|
|
|
266 |
CFbsBitmap*& /*aMask*/ )
|
|
|
267 |
{
|
|
|
268 |
// do nothing
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
// ---------------------------------------------------------------------------
|
|
|
272 |
// Get the bitmap and mask for a given indicator.
|
|
|
273 |
// ---------------------------------------------------------------------------
|
|
|
274 |
//
|
|
|
275 |
EXPORT_C CGulIcon* CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
|
|
|
276 |
TMPXPbvIndicator aIndicator )
|
|
|
277 |
{
|
|
|
278 |
TParse parse;
|
|
|
279 |
parse.Set( KMPXCommonPlaybackViewIconFile, &KDC_APP_RESOURCE_DIR, NULL );
|
|
|
280 |
TFileName iconFile( parse.FullName() );
|
|
|
281 |
User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
|
|
|
282 |
|
|
|
283 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
|
284 |
|
|
|
285 |
switch ( aIndicator )
|
|
|
286 |
{
|
|
|
287 |
case EIconPlay:
|
|
|
288 |
{
|
|
|
289 |
return AknsUtils::CreateGulIconL(
|
|
|
290 |
skin,
|
|
|
291 |
KAknsIIDQgnIndiMupPlay,
|
|
|
292 |
iconFile,
|
|
|
293 |
EMbmMpxcommonplaybackviewQgn_indi_mup_play,
|
|
|
294 |
EMbmMpxcommonplaybackviewQgn_indi_mup_play_mask);
|
|
|
295 |
}
|
|
|
296 |
case EIconPause:
|
|
|
297 |
{
|
|
|
298 |
return AknsUtils::CreateGulIconL(
|
|
|
299 |
skin,
|
|
|
300 |
KAknsIIDQgnIndiMupPause,
|
|
|
301 |
iconFile,
|
|
|
302 |
EMbmMpxcommonplaybackviewQgn_indi_mup_pause,
|
|
|
303 |
EMbmMpxcommonplaybackviewQgn_indi_mup_pause_mask);
|
|
|
304 |
}
|
|
|
305 |
case EIconStop:
|
|
|
306 |
{
|
|
|
307 |
return AknsUtils::CreateGulIconL(
|
|
|
308 |
skin,
|
|
|
309 |
KAknsIIDQgnIndiMupStop,
|
|
|
310 |
iconFile,
|
|
|
311 |
EMbmMpxcommonplaybackviewQgn_indi_mup_stop,
|
|
|
312 |
EMbmMpxcommonplaybackviewQgn_indi_mup_stop_mask);
|
|
|
313 |
}
|
|
|
314 |
case EIconRepeatAll:
|
|
|
315 |
{
|
|
|
316 |
return CreateColorIconL(
|
|
|
317 |
skin,
|
|
|
318 |
KAknsIIDQgnIndiMupRepeat,
|
|
|
319 |
KAknsIIDQsnIconColors,
|
|
|
320 |
EAknsCIQsnIconColorsCG26,
|
|
|
321 |
iconFile,
|
|
|
322 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_repeat,
|
|
|
323 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_repeat_mask );
|
|
|
324 |
}
|
|
|
325 |
case EIconRepeatOne:
|
|
|
326 |
{
|
|
|
327 |
return CreateColorIconL(
|
|
|
328 |
skin,
|
|
|
329 |
KAknsIIDQgnIndiMupRepeatOne,
|
|
|
330 |
KAknsIIDQsnIconColors,
|
|
|
331 |
EAknsCIQsnIconColorsCG26,
|
|
|
332 |
iconFile,
|
|
|
333 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_repeatone,
|
|
|
334 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_repeatone_mask );
|
|
|
335 |
}
|
|
|
336 |
case EIconRandom:
|
|
|
337 |
{
|
|
|
338 |
return CreateColorIconL(
|
|
|
339 |
skin,
|
|
|
340 |
KAknsIIDQgnIndiMupRandom,
|
|
|
341 |
KAknsIIDQsnIconColors,
|
|
|
342 |
EAknsCIQsnIconColorsCG26,
|
|
|
343 |
iconFile,
|
|
|
344 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_shuffle,
|
|
|
345 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_icon_shuffle_mask );
|
|
|
346 |
}
|
|
|
347 |
case ESliderBackground:
|
|
|
348 |
{
|
|
|
349 |
return AknsUtils::CreateGulIconL(
|
|
|
350 |
skin,
|
|
|
351 |
KAknsIIDQgnGrafMup2BarFrame,
|
|
|
352 |
iconFile,
|
|
|
353 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_bgd,
|
|
|
354 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_bgd_mask );
|
|
|
355 |
}
|
|
|
356 |
case EPlaybackSlider:
|
|
|
357 |
{
|
|
|
358 |
return AknsUtils::CreateGulIconL(
|
|
|
359 |
skin,
|
|
|
360 |
KAknsIIDQgnGrafMup2BarProgress2,
|
|
|
361 |
iconFile,
|
|
|
362 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_top_play,
|
|
|
363 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_top_play_mask );
|
|
|
364 |
}
|
|
|
365 |
case EDownloadSlider:
|
|
|
366 |
{
|
|
|
367 |
return AknsUtils::CreateGulIconL(
|
|
|
368 |
skin,
|
|
|
369 |
KAknsIIDQgnGrafMup2BarProgress,
|
|
|
370 |
iconFile,
|
|
|
371 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_mid_download,
|
|
|
372 |
EMbmMpxcommonplaybackviewQgn_graf_mup_npv_prbar_mid_download_mask );
|
|
|
373 |
}
|
|
|
374 |
case EAlbumArtArea:
|
|
|
375 |
{
|
|
|
376 |
return AknsUtils::CreateGulIconL(
|
|
|
377 |
skin,
|
|
|
378 |
KAknsIIDQgnIndiMupDefaultAlbum,
|
|
|
379 |
iconFile,
|
|
|
380 |
EMbmMpxcommonplaybackviewQgn_indi_mup_default_album,
|
|
|
381 |
EMbmMpxcommonplaybackviewQgn_indi_mup_default_album_mask );
|
|
|
382 |
}
|
|
|
383 |
#ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER
|
|
|
384 |
case EIconReal:
|
|
|
385 |
{
|
|
|
386 |
return AknsUtils::CreateGulIconL(
|
|
|
387 |
skin,
|
|
|
388 |
KAknsIIDQgnIndiMupRp,
|
|
|
389 |
iconFile,
|
|
|
390 |
EMbmMpxcommonplaybackviewQgn_indi_mup_rp,
|
|
|
391 |
EMbmMpxcommonplaybackviewQgn_indi_mup_rp_mask );
|
|
|
392 |
}
|
|
|
393 |
#endif
|
|
|
394 |
default:
|
|
|
395 |
{
|
|
|
396 |
__ASSERT_ALWAYS(
|
|
|
397 |
EFalse,
|
|
|
398 |
User::Panic( KMXPanicCategory, KErrArgument ) );
|
|
|
399 |
break;
|
|
|
400 |
}
|
|
|
401 |
}
|
|
|
402 |
return NULL; // Not reached
|
|
|
403 |
}
|
|
|
404 |
|
|
|
405 |
// ---------------------------------------------------------------------------
|
|
|
406 |
// Create a color-skinned icon.
|
|
|
407 |
// ---------------------------------------------------------------------------
|
|
|
408 |
//
|
|
|
409 |
EXPORT_C CGulIcon* CMPXCommonPlaybackViewLayout::CreateColorIconL(
|
|
|
410 |
MAknsSkinInstance* aSkin,
|
|
|
411 |
const TAknsItemID& aIconSkinId,
|
|
|
412 |
const TAknsItemID& aColorId,
|
|
|
413 |
TInt aColorIndex,
|
|
|
414 |
const TDesC& aBitmapFilename,
|
|
|
415 |
TInt aFileBitmapId,
|
|
|
416 |
TInt aFileMaskId )
|
|
|
417 |
{
|
|
|
418 |
CFbsBitmap* icon = NULL;
|
|
|
419 |
CFbsBitmap* mask = NULL;
|
|
|
420 |
|
|
|
421 |
AknsUtils::CreateColorIconLC(
|
|
|
422 |
aSkin, // aInstance
|
|
|
423 |
aIconSkinId, // aID
|
|
|
424 |
aColorId, // aColorID
|
|
|
425 |
aColorIndex, // aColorIndex
|
|
|
426 |
icon, // aBitmap
|
|
|
427 |
mask, // aMask
|
|
|
428 |
aBitmapFilename, // aFilename
|
|
|
429 |
aFileBitmapId, // aFileBitmapId
|
|
|
430 |
aFileMaskId, // aFileBitmapId
|
|
|
431 |
KRgbBlack ); // aDefaultColor
|
|
|
432 |
|
|
|
433 |
CGulIcon* res = CGulIcon::NewL( icon, mask );
|
|
|
434 |
res->SetBitmapsOwnedExternally( EFalse );
|
|
|
435 |
CleanupStack::Pop(2); // mask, icon
|
|
|
436 |
|
|
|
437 |
return res;
|
|
|
438 |
}
|
|
|
439 |
|
|
|
440 |
// ---------------------------------------------------------------------------
|
|
|
441 |
// Layouts the label by reading in the resource values
|
|
|
442 |
// ---------------------------------------------------------------------------
|
|
|
443 |
//
|
|
|
444 |
EXPORT_C void CMPXCommonPlaybackViewLayout::DoLayoutLabelL(
|
|
|
445 |
CEikLabel* aLabel,
|
|
|
446 |
const TRect& aParentRect,
|
|
|
447 |
TInt aResId,
|
|
|
448 |
TInt aOffsetx,
|
|
|
449 |
TInt aOffsety )
|
|
|
450 |
{
|
|
|
451 |
TResourceReader reader;
|
|
|
452 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
|
|
|
453 |
|
|
|
454 |
// Read the layout from resource file
|
|
|
455 |
TAknTextComponentLayout textLayout;
|
|
|
456 |
textLayout.SetFont( reader.ReadInt16() );
|
|
|
457 |
textLayout.SetC( reader.ReadInt16() );
|
|
|
458 |
textLayout.Setl( reader.ReadInt16() + aOffsetx );
|
|
|
459 |
textLayout.Setr( reader.ReadInt16() - aOffsetx );
|
|
|
460 |
textLayout.Setb( reader.ReadInt16() + aOffsety );
|
|
|
461 |
textLayout.SetW( reader.ReadInt16() );
|
|
|
462 |
textLayout.SetJ( reader.ReadInt16() );
|
|
|
463 |
CleanupStack::PopAndDestroy(); // reader
|
|
|
464 |
|
|
|
465 |
AknLayoutUtils::LayoutLabel(
|
|
|
466 |
aLabel, aParentRect, textLayout.LayoutLine() );
|
|
|
467 |
}
|
|
|
468 |
|
|
|
469 |
// ---------------------------------------------------------------------------
|
|
|
470 |
// Get layout data for a button.
|
|
|
471 |
// ---------------------------------------------------------------------------
|
|
|
472 |
//
|
|
|
473 |
EXPORT_C TRect CMPXCommonPlaybackViewLayout::ButtonLayout(const TRect& aParentRect,
|
|
|
474 |
TInt aButton)
|
|
|
475 |
{
|
|
|
476 |
|
|
|
477 |
|
|
|
478 |
TAknLayoutRect res;
|
|
|
479 |
TAknWindowComponentLayout layoutItem;
|
|
|
480 |
TInt buttonVariant = 0;
|
|
|
481 |
|
|
|
482 |
switch (aButton)
|
|
|
483 |
{
|
|
|
484 |
case EButtonPlay:
|
|
|
485 |
case EButtonPause:
|
|
|
486 |
{
|
|
|
487 |
layoutItem = mup3_control_keys_pane_g3(buttonVariant);
|
|
|
488 |
break;
|
|
|
489 |
}
|
|
|
490 |
case EButtonFastForward:
|
|
|
491 |
{
|
|
|
492 |
layoutItem = mup3_control_keys_pane_g2(buttonVariant);
|
|
|
493 |
break;
|
|
|
494 |
}
|
|
|
495 |
case EButtonRewind:
|
|
|
496 |
{
|
|
|
497 |
layoutItem = mup3_control_keys_pane_g1(buttonVariant);
|
|
|
498 |
break;
|
|
|
499 |
}
|
|
|
500 |
case EButtonStop:
|
|
|
501 |
case EButtonVolumeDown:
|
|
|
502 |
{
|
|
|
503 |
layoutItem = mup3_control_keys_pane_g4(buttonVariant);
|
|
|
504 |
break;
|
|
|
505 |
}
|
|
|
506 |
case EButtonVolumeUp:
|
|
|
507 |
{
|
|
|
508 |
layoutItem = mup3_control_keys_pane_g4_copy1(buttonVariant);
|
|
|
509 |
break;
|
|
|
510 |
}
|
|
|
511 |
default:
|
|
|
512 |
{
|
|
|
513 |
ASSERT(0);
|
|
|
514 |
break;
|
|
|
515 |
}
|
|
|
516 |
}
|
|
|
517 |
|
|
|
518 |
res.LayoutRect( aParentRect, layoutItem.LayoutLine() );
|
|
|
519 |
|
|
|
520 |
return res.Rect();
|
|
|
521 |
}
|
|
|
522 |
|
|
|
523 |
// ---------------------------------------------------------------------------
|
|
|
524 |
// Init common layout data
|
|
|
525 |
// ---------------------------------------------------------------------------
|
|
|
526 |
//
|
|
|
527 |
EXPORT_C void CMPXCommonPlaybackViewLayout::InitCommonLayoutL()
|
|
|
528 |
{
|
|
|
529 |
TInt flags( 0 );
|
|
|
530 |
CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures );
|
|
|
531 |
User::LeaveIfError( repository->Get( KMPXMPLocalVariation, flags ));
|
|
|
532 |
delete repository;
|
|
|
533 |
repository = NULL;
|
|
|
534 |
iShowRockerGraphics = static_cast<TBool>( flags & KMPXRockerMappingSupport );
|
|
|
535 |
}
|
|
|
536 |
|
|
|
537 |
// ---------------------------------------------------------------------------
|
|
|
538 |
// Determine the layout (touch, non-touch, landscape, portrait, rocker, etc...)
|
|
|
539 |
// ---------------------------------------------------------------------------
|
|
|
540 |
//
|
|
|
541 |
EXPORT_C TMPXPbvLayoutVariants CMPXCommonPlaybackViewLayout::DetermineLayoutVariant()
|
|
|
542 |
{
|
|
|
543 |
TMPXPbvLayoutVariants variant(EPbvUndefinedVariant);
|
|
|
544 |
|
|
|
545 |
|
|
|
546 |
TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
|
|
|
547 |
|
|
|
548 |
TBool isTouch = AknLayoutUtils::PenEnabled();
|
|
|
549 |
|
|
|
550 |
if (isTouch && !isLandscape )
|
|
|
551 |
{
|
|
|
552 |
variant = EPbvPortraitNhdTouchWithFM;
|
|
|
553 |
}
|
|
|
554 |
else if (isTouch && isLandscape)
|
|
|
555 |
{
|
|
|
556 |
variant = EPbvLandscapeNhdTouchWithFM;
|
|
|
557 |
}
|
|
|
558 |
else if (!iShowRockerGraphics && !isLandscape )
|
|
|
559 |
{
|
|
|
560 |
variant = EPbvPortraitWithoutRocker;
|
|
|
561 |
}
|
|
|
562 |
else if (!iShowRockerGraphics && isLandscape)
|
|
|
563 |
{
|
|
|
564 |
variant = EPbvLandscapeWithoutRocker;
|
|
|
565 |
}
|
|
|
566 |
else if (iShowRockerGraphics && !isLandscape)
|
|
|
567 |
{
|
|
|
568 |
variant = EPbvPortraitWithRocker;
|
|
|
569 |
}
|
|
|
570 |
else if (iShowRockerGraphics && isLandscape)
|
|
|
571 |
{
|
|
|
572 |
variant = EPbvLandscapeWithRocker;
|
|
|
573 |
}
|
|
|
574 |
|
|
|
575 |
|
|
|
576 |
return(variant);
|
|
|
577 |
}
|
|
|
578 |
|
|
|
579 |
|
|
|
580 |
// ---------------------------------------------------------------------------
|
|
|
581 |
// Determine the layout variant for a text item
|
|
|
582 |
// ---------------------------------------------------------------------------
|
|
|
583 |
//
|
|
|
584 |
EXPORT_C TMPXPbvLayoutVariants CMPXCommonPlaybackViewLayout::GetTextVariantL(TMPXPbvTextIndicator aText)
|
|
|
585 |
{
|
|
|
586 |
TMPXPbvLayoutVariants layoutVariant = DetermineLayoutVariant();
|
|
|
587 |
TMPXPbvLayoutVariants textVariant;
|
|
|
588 |
switch ( aText )
|
|
|
589 |
{
|
|
|
590 |
case ETextTrack:
|
|
|
591 |
case ETextArtist:
|
|
|
592 |
case ETextPlaylistCount:
|
|
|
593 |
case ETextFMFrequency:
|
|
|
594 |
{
|
|
|
595 |
textVariant = layoutVariant;
|
|
|
596 |
break;
|
|
|
597 |
}
|
|
|
598 |
case ETextEmpty:
|
|
|
599 |
case ETextElapsedTime:
|
|
|
600 |
case ETextRemainingTime:
|
|
|
601 |
case ETextDownloadState:
|
|
|
602 |
{
|
|
|
603 |
textVariant = static_cast<TMPXPbvLayoutVariants> (0); // always 0 regardless of layout variant
|
|
|
604 |
break;
|
|
|
605 |
}
|
|
|
606 |
default:
|
|
|
607 |
{
|
|
|
608 |
textVariant = EPbvUndefinedVariant;
|
|
|
609 |
}
|
|
|
610 |
}
|
|
|
611 |
|
|
|
612 |
return(textVariant);
|
|
|
613 |
}
|
|
|
614 |
|
|
|
615 |
// ---------------------------------------------------------------------------
|
|
|
616 |
// Determine the layout variant type for an indicator item
|
|
|
617 |
// ---------------------------------------------------------------------------
|
|
|
618 |
//
|
|
|
619 |
EXPORT_C TMPXPbvLayoutVariants CMPXCommonPlaybackViewLayout::GetIndicatorVariantL(TMPXPbvIndicator aIndicator)
|
|
|
620 |
{
|
|
|
621 |
TMPXPbvLayoutVariants layoutVariant = DetermineLayoutVariant();
|
|
|
622 |
TMPXPbvLayoutVariants indicatorVariant;
|
|
|
623 |
switch ( aIndicator )
|
|
|
624 |
{
|
|
|
625 |
case EAlbumArtArea:
|
|
|
626 |
case EIconRepeatOne:
|
|
|
627 |
case EIconRepeatAll:
|
|
|
628 |
case EIconRandom:
|
|
|
629 |
case EIconPlay:
|
|
|
630 |
case EIconStop:
|
|
|
631 |
case EIconPause:
|
|
|
632 |
case ESliderPane:
|
|
|
633 |
case ESliderBackground:
|
|
|
634 |
case EPlaybackSlider:
|
|
|
635 |
case EDownloadSlider:
|
|
|
636 |
case EIconReal:
|
|
|
637 |
{
|
|
|
638 |
indicatorVariant = layoutVariant;
|
|
|
639 |
break;
|
|
|
640 |
}
|
|
|
641 |
case EIconFastForward:
|
|
|
642 |
case EIconRewind:
|
|
|
643 |
case EIconRemotePlayer:
|
|
|
644 |
case EBackgroundGraphic:
|
|
|
645 |
{
|
|
|
646 |
indicatorVariant = EPbvUndefinedVariant;
|
|
|
647 |
break;
|
|
|
648 |
}
|
|
|
649 |
|
|
|
650 |
default:
|
|
|
651 |
{
|
|
|
652 |
indicatorVariant = EPbvUndefinedVariant;
|
|
|
653 |
}
|
|
|
654 |
}
|
|
|
655 |
|
|
|
656 |
return(indicatorVariant);
|
|
|
657 |
}
|
|
|
658 |
|
|
|
659 |
// End of File
|