mpxplugins/viewplugins/views/embeddedplaybackview/src/mpxembeddedplaybackviewlayout.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 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     }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // Get the bitmap and mask for a given indicator.
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 CGulIcon* CMPXEmbeddedPlaybackViewLayout::GetIndicatorIconMaskL(
       
   106     TMPXPbvIndicator aIndicator )
       
   107     {
       
   108     TParse parse;
       
   109     parse.Set( KMPXPodcastPlaybackViewIconFile, &KDC_APP_RESOURCE_DIR, NULL );
       
   110     TFileName iconFile( parse.FullName() );
       
   111     User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
       
   112 
       
   113     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   114 
       
   115     switch ( aIndicator )
       
   116         {
       
   117         case EAlbumArtArea:
       
   118             {
       
   119             if( iCommonUiHelper &&
       
   120                 iCommonUiHelper->IsHostPodcastingAppL())
       
   121                 {
       
   122                 return AknsUtils::CreateGulIconL(
       
   123                     skin,
       
   124                     KAknsIIDNone,
       
   125                     iconFile,
       
   126                     EMbmMpxembeddedplaybackviewQgn_indi_mup_default_album_pcast,
       
   127                     EMbmMpxembeddedplaybackviewQgn_indi_mup_default_album_pcast_mask );
       
   128                 }
       
   129             else
       
   130                 {
       
   131                 return CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
       
   132                 aIndicator );
       
   133                 }
       
   134             }
       
   135         default:
       
   136             {
       
   137             return CMPXCommonPlaybackViewLayout::GetIndicatorIconMaskL(
       
   138                 aIndicator );
       
   139             }
       
   140         }
       
   141     }
       
   142 //  End of File