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 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 <mpxembeddedplaybackview.rsg>
|
|
29 |
#include <mpxembeddedplaybackview.mbg>
|
|
30 |
#include <centralrepository.h>
|
|
31 |
#include <mpxinternalcrkeys.h>
|
|
32 |
#include <mpxlbxextendedfeatures.h>
|
|
33 |
#include <mpxuser.h>
|
|
34 |
#include "mpxembeddedplaybackviewlayout.h"
|
|
35 |
#include "mpxlog.h"
|
|
36 |
|
|
37 |
using namespace AknLayoutScalable_Apps;
|
|
38 |
|
|
39 |
// CONSTANTS
|
|
40 |
_LIT( KMPXPodcastPlaybackViewIconFile, "mpxembeddedplaybackview.mbm" );
|
|
41 |
|
|
42 |
// ======== MEMBER FUNCTIONS ========
|
|
43 |
|
|
44 |
// ---------------------------------------------------------------------------
|
|
45 |
// Two-phased constructor.
|
|
46 |
// ---------------------------------------------------------------------------
|
|
47 |
//
|
|
48 |
CMPXEmbeddedPlaybackViewLayout* CMPXEmbeddedPlaybackViewLayout::NewL()
|
|
49 |
{
|
|
50 |
CMPXEmbeddedPlaybackViewLayout* self = CMPXEmbeddedPlaybackViewLayout::NewLC();
|
|
51 |
CleanupStack::Pop( self );
|
|
52 |
return self;
|
|
53 |
}
|
|
54 |
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
// Two-phased constructor.
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
CMPXEmbeddedPlaybackViewLayout* CMPXEmbeddedPlaybackViewLayout::NewLC()
|
|
60 |
{
|
|
61 |
CMPXEmbeddedPlaybackViewLayout* self = new ( ELeave ) CMPXEmbeddedPlaybackViewLayout();
|
|
62 |
CleanupStack::PushL( self );
|
|
63 |
self->ConstructL();
|
|
64 |
return self;
|
|
65 |
}
|
|
66 |
|
|
67 |
// ---------------------------------------------------------------------------
|
|
68 |
// Destructor
|
|
69 |
// ---------------------------------------------------------------------------
|
|
70 |
//
|
|
71 |
CMPXEmbeddedPlaybackViewLayout::~CMPXEmbeddedPlaybackViewLayout()
|
|
72 |
{
|
|
73 |
// Do nothing
|
|
74 |
if(iCommonUiHelper)
|
|
75 |
{
|
|
76 |
delete iCommonUiHelper;
|
|
77 |
iCommonUiHelper = NULL;
|
|
78 |
}
|
|
79 |
}
|
|
80 |
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
// C++ default constructor can NOT contain any code, that
|
|
83 |
// might leave.
|
|
84 |
// ---------------------------------------------------------------------------
|
|
85 |
//
|
|
86 |
CMPXEmbeddedPlaybackViewLayout::CMPXEmbeddedPlaybackViewLayout()
|
|
87 |
{
|
|
88 |
// Do nothing
|
|
89 |
}
|
|
90 |
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
// Symbian 2nd phase constructor can leave.
|
|
93 |
// ---------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
void CMPXEmbeddedPlaybackViewLayout::ConstructL()
|
|
96 |
{
|
|
97 |
MPX_FUNC( "CMPXEmbeddedPlaybackViewLayout::ConstructL" );
|
|
98 |
iCommonUiHelper = CMPXCommonUiHelper::NewL();
|
|
99 |
InitCommonLayoutL();
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
// Get the bitmap and mask for a given indicator.
|
|
104 |
// ---------------------------------------------------------------------------
|
|
105 |
//
|
|
106 |
CGulIcon* CMPXEmbeddedPlaybackViewLayout::GetIndicatorIconMaskL(
|
|
107 |
TMPXPbvIndicator aIndicator )
|
|
108 |
{
|
|
109 |
TParse parse;
|
|
110 |
parse.Set( KMPXPodcastPlaybackViewIconFile, &KDC_APP_RESOURCE_DIR, NULL );
|
|
111 |
TFileName iconFile( parse.FullName() );
|
|
112 |
User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
|
|
113 |
|
|
114 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
115 |
|
|
116 |
switch ( aIndicator )
|
|
117 |
{
|
|
118 |
case EAlbumArtArea:
|
|
119 |
{
|
|
120 |
if( iCommonUiHelper &&
|
|
121 |
iCommonUiHelper->IsHostPodcastingAppL())
|
|
122 |
{
|
|
123 |
return AknsUtils::CreateGulIconL(
|
|
124 |
skin,
|
|
125 |
KAknsIIDNone,
|
|
126 |
iconFile,
|
|
127 |
EMbmMpxembeddedplaybackviewQgn_indi_mup_default_album_pcast,
|
|
128 |
EMbmMpxembeddedplaybackviewQgn_indi_mup_default_album_pcast_mask );
|
|
129 |
}
|
|
130 |
else
|
|
131 |
{
|
|
132 |
return CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
|
|
133 |
aIndicator );
|
|
134 |
}
|
|
135 |
}
|
|
136 |
default:
|
|
137 |
{
|
|
138 |
return CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
|
|
139 |
aIndicator );
|
|
140 |
}
|
|
141 |
}
|
|
142 |
}
|
|
143 |
// End of File
|