mpxplugins/viewplugins/views/embeddedplaybackview/src/mpxembeddedplaybackviewcontainer.cpp
changeset 0 ff3acec5bc43
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:  Implementation of Embedded Playback view's container.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include <AknDef.h>
       
    23 #include <mpxconstants.h>
       
    24 
       
    25 #include "mpxembeddedplaybackview.hlp.hrh"
       
    26 #include "mpxembeddedplaybackviewcontainer.h"
       
    27 #include "mpxplaybackviewlayoutinterface.h"
       
    28 #include "mpxcommonuihelper.h"
       
    29 #include "mpxlog.h"
       
    30 
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 
       
    35 // ======== MEMBER FUNCTIONS ========
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // C++ default constructor can NOT contain any code, that
       
    39 // might leave.
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CMPXEmbeddedPlaybackViewContainer::CMPXEmbeddedPlaybackViewContainer(
       
    43     MEikCommandObserver* aCommandObserver,
       
    44     MMPXLayoutSwitchObserver* aLayoutObserver,
       
    45     MMPXPlaybackViewLayout* aLayout,
       
    46     CMPXCommonUiHelper* aCommonUiHelper )
       
    47     {
       
    48     iCommandObserver = aCommandObserver;
       
    49     iLayoutObserver = aLayoutObserver;
       
    50     iMode = EUninitialized;
       
    51     iLayout = aLayout;
       
    52     iCommonUiHelper = aCommonUiHelper;
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // Symbian 2nd phase constructor can leave.
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 void CMPXEmbeddedPlaybackViewContainer::ConstructL( const TRect& aRect )
       
    60     {
       
    61     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::ConstructL() entering" );
       
    62 
       
    63     CMPXCommonPlaybackViewContainer::ConstructL( aRect );
       
    64 
       
    65     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::ConstructL() exiting" );
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // Destructor
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 CMPXEmbeddedPlaybackViewContainer::~CMPXEmbeddedPlaybackViewContainer()
       
    73     {
       
    74     }
       
    75 
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Set layout for all elements and set sizes for icons.
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void CMPXEmbeddedPlaybackViewContainer::UpdateLayout()
       
    82     {
       
    83     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::UpdateLayout() entering" );
       
    84 
       
    85     CMPXCommonPlaybackViewContainer::UpdateLayout();
       
    86 
       
    87     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::UpdateLayout() exiting" );
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // sets display mode
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 void CMPXEmbeddedPlaybackViewContainer::SetMode( TMPXPbvPlaybackMode aMode )
       
    95     {
       
    96     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::SetMode() entering" );
       
    97 
       
    98     if ( aMode != ENoTracksMode )
       
    99         {
       
   100         CMPXCommonPlaybackViewContainer::SetMode( aMode );
       
   101         }
       
   102     else
       
   103         {
       
   104         // the only chance this will be ENoTracksMode in embedded view
       
   105         // is when the file is saving (playback engine state change to not initialized)
       
   106         // when that happens, ignore the event so that the view
       
   107         // doesn't go blank
       
   108         MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::SetMode no tracks mode, ignoring" );
       
   109         }
       
   110 
       
   111     MPX_DEBUG1( "CMPXEmbeddedPlaybackViewContainer::SetMode() exiting" );
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // From CCoeControl
       
   116 // Handles key events.
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 TKeyResponse CMPXEmbeddedPlaybackViewContainer::OfferKeyEventL(
       
   120     const TKeyEvent& aKeyEvent,
       
   121     TEventCode aType )
       
   122     {
       
   123     MPX_DEBUG4( "CMPXEmbeddedPlaybackViewContainer::OfferKeyEventL(iCode=%d, iScanCode=%d, aType=%d)",
       
   124         aKeyEvent.iCode, aKeyEvent.iScanCode, aType );
       
   125 
       
   126     return CMPXCommonPlaybackViewContainer::OfferKeyEventL( aKeyEvent, aType );
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // From CCoeControl
       
   131 // Gets the control's help context.
       
   132 // ---------------------------------------------------------------------------
       
   133 //
       
   134 void CMPXEmbeddedPlaybackViewContainer::GetHelpContext(
       
   135     TCoeHelpContext& aContext ) const
       
   136     {
       
   137     aContext.iMajor = KAppUidMusicPlayerX;
       
   138     TRAP_IGNORE(
       
   139         {
       
   140         if ( iCommonUiHelper->IsHostBrowserL() )
       
   141             {
       
   142             aContext.iContext = KMUS_HLP_EMBED_BROWSER;
       
   143             }
       
   144         else if ( iCommonUiHelper->IsHostMessagingL() )
       
   145             {
       
   146             aContext.iContext = KMUS_HLP_EMBED_MESSAGING;
       
   147             }
       
   148         else
       
   149             {
       
   150             aContext.iContext = KMUS_HLP_EMBED_GENERAL;
       
   151             }
       
   152         } );
       
   153     }
       
   154 
       
   155 
       
   156 //  End of File