mpxplugins/viewplugins/views/podcastplaybackview/src/mpxpodcastplaybackviewlayout.cpp
changeset 0 ff3acec5bc43
child 21 a1247965635c
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     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 Podcast 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 <centralrepository.h>
       
    29 #include <mpxuser.h>
       
    30 
       
    31 #include <mpxpodcastplaybackview.mbg>
       
    32 #include "mpxpodcastplaybackviewlayout.h"
       
    33 #include "mpxlog.h"
       
    34 
       
    35 
       
    36 // CONSTANTS
       
    37 _LIT( KMPXPodcastPlaybackViewIconFile, "mpxpodcastplaybackview.mbm" );
       
    38 
       
    39 
       
    40 using namespace AknLayoutScalable_Apps;
       
    41 
       
    42 
       
    43 // ======== MEMBER FUNCTIONS ========
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // Two-phased constructor.
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CMPXPodcastPlaybackViewLayout* CMPXPodcastPlaybackViewLayout::NewL()
       
    50     {
       
    51     CMPXPodcastPlaybackViewLayout* self = CMPXPodcastPlaybackViewLayout::NewLC();
       
    52     CleanupStack::Pop( self );
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Two-phased constructor.
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CMPXPodcastPlaybackViewLayout* CMPXPodcastPlaybackViewLayout::NewLC()
       
    61     {
       
    62     CMPXPodcastPlaybackViewLayout* self = new ( ELeave ) CMPXPodcastPlaybackViewLayout();
       
    63     CleanupStack::PushL( self );
       
    64     self->ConstructL();
       
    65     return self;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // Destructor
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 CMPXPodcastPlaybackViewLayout::~CMPXPodcastPlaybackViewLayout()
       
    73     {
       
    74     // Do nothing
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // C++ default constructor can NOT contain any code, that
       
    79 // might leave.
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 CMPXPodcastPlaybackViewLayout::CMPXPodcastPlaybackViewLayout()
       
    83     {
       
    84     // Do nothing
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // Symbian 2nd phase constructor can leave.
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 void CMPXPodcastPlaybackViewLayout::ConstructL()
       
    92     {
       
    93     MPX_FUNC( "CMPXPodcastPlaybackViewLayout::ConstructL" );
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // Get the bitmap and mask for a given indicator.
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 CGulIcon* CMPXPodcastPlaybackViewLayout::GetIndicatorIconMaskL(
       
   101     TMPXPbvIndicator aIndicator )
       
   102     {
       
   103     TParse parse;
       
   104     parse.Set( KMPXPodcastPlaybackViewIconFile, &KDC_APP_RESOURCE_DIR, NULL );
       
   105     TFileName iconFile( parse.FullName() );
       
   106     User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
       
   107 
       
   108     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   109 
       
   110     switch ( aIndicator )
       
   111         {
       
   112         case EAlbumArtArea:
       
   113             {
       
   114             return AknsUtils::CreateGulIconL(
       
   115                 skin,
       
   116                 KAknsIIDQgnIndiMupDefaultAlbumPcast,
       
   117                 iconFile,
       
   118                 EMbmMpxpodcastplaybackviewQgn_indi_mup_default_album_pcast,
       
   119                 EMbmMpxpodcastplaybackviewQgn_indi_mup_default_album_pcast_mask );
       
   120             }
       
   121         default:
       
   122             {
       
   123             return CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
       
   124                 aIndicator );
       
   125             }
       
   126         }
       
   127     }
       
   128 
       
   129 //  End of File