mpxplugins/viewplugins/views/audioeffectsview/src/mpxaudioeffectsviewimp.cpp
branchRCL_3
changeset 21 cb96c29156b2
parent 12 171e07ac910f
equal deleted inserted replaced
19:a12246c97fcc 21:cb96c29156b2
    22 #include <eikmenub.h>
    22 #include <eikmenub.h>
    23 #include <AknUtils.h>
    23 #include <AknUtils.h>
    24 #include <hlplch.h>
    24 #include <hlplch.h>
    25 #include <data_caging_path_literals.hrh>
    25 #include <data_caging_path_literals.hrh>
    26 #include <avkon.rsg>
    26 #include <avkon.rsg>
       
    27 #include <akntitle.h>
    27 #include <mpxuser.h>
    28 #include <mpxuser.h>
       
    29 #include <mpxmusicplayerviewplugin.hrh>
    28 
    30 
    29 #include <mpxplaybackutility.h>
    31 #include <mpxplaybackutility.h>
    30 #include <mpxaudioeffectsview.rsg>
    32 #include <mpxaudioeffectsview.rsg>
    31 #include <mpxviewutility.h>
    33 #include <mpxviewutility.h>
    32 #include "mpxaudioeffectengine.h"
    34 #include "mpxaudioeffectengine.h"
    37 #include "mpxaudioeffects.hrh"
    39 #include "mpxaudioeffects.hrh"
    38 
    40 
    39 
    41 
    40 // CONSTANTS
    42 // CONSTANTS
    41 _LIT( KMPXAudioEffectsRscPath, "mpxaudioeffectsview.rsc" );
    43 _LIT( KMPXAudioEffectsRscPath, "mpxaudioeffectsview.rsc" );
    42 
    44 _LIT(KEmptyTitle, " ");
    43 
    45 
    44 // ======== MEMBER FUNCTIONS ========
    46 // ======== MEMBER FUNCTIONS ========
    45 
    47 
    46 // ---------------------------------------------------------------------------
    48 // ---------------------------------------------------------------------------
    47 // C++ default constructor can NOT contain any code, that
    49 // C++ default constructor can NOT contain any code, that
    72     iPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
    74     iPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeDefault );
    73 
    75 
    74     iModel = CMPXAudioEffectsModel::NewL( *iPlaybackUtility );
    76     iModel = CMPXAudioEffectsModel::NewL( *iPlaybackUtility );
    75         
    77         
    76     iViewUtility = MMPXViewUtility::UtilityL();
    78     iViewUtility = MMPXViewUtility::UtilityL();
       
    79     iViewUtility->AddObserverL(this);
       
    80     iGoPreviousView = EFalse;
    77     }
    81     }
    78 
    82 
    79 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    80 // Two-phased constructor.
    84 // Two-phased constructor.
    81 // ---------------------------------------------------------------------------
    85 // ---------------------------------------------------------------------------
   117         CCoeEnv::Static()->DeleteResourceFile( iResourceOffset );
   121         CCoeEnv::Static()->DeleteResourceFile( iResourceOffset );
   118         }
   122         }
   119 
   123 
   120     if ( iViewUtility )
   124     if ( iViewUtility )
   121         {
   125         {
       
   126 		iViewUtility->RemoveObserver( this );
   122         iViewUtility->Close();
   127         iViewUtility->Close();
   123         }
   128         }
   124 
   129 
   125     }
   130     }
   126 
   131 
   168             AppUi()->AppHelpContextL());
   173             AppUi()->AppHelpContextL());
   169             break;
   174             break;
   170             }
   175             }
   171         case EAknSoftkeyBack:
   176         case EAknSoftkeyBack:
   172             {
   177             {
       
   178             iGoPreviousView = ETrue;
   173             iViewUtility->ActivatePreviousViewL();
   179             iViewUtility->ActivatePreviousViewL();
   174             break;
   180             break;
   175             }
   181             }
   176         default:
   182         default:
   177             {
   183             {
   203         AppUi()->AddToStackL( *this, iContainer );
   209         AppUi()->AddToStackL( *this, iContainer );
   204         }
   210         }
   205     }
   211     }
   206 
   212 
   207 // -----------------------------------------------------------------------------
   213 // -----------------------------------------------------------------------------
       
   214 // CMPXAudioEffectsViewImp::HandleViewActivation
       
   215 // Handle view activation
       
   216 // -----------------------------------------------------------------------------
       
   217 //
       
   218 void CMPXAudioEffectsViewImp::HandleViewActivation(
       
   219     const TUid& aCurrentViewType,
       
   220     const TUid& /*aPreviousViewType*/ )
       
   221     {
       
   222     MPX_FUNC( "CMPXAudioEffectsViewImp::HandleViewActivation" );
       
   223     if ( ( aCurrentViewType.iUid == KMPXPluginTypePlaybackUid ) && ( iGoPreviousView == EFalse ) )
       
   224         {
       
   225 		// It is view switching when launched from other applications
       
   226 		// deactivate this view to avoid flickering 
       
   227 		// since this view is the current active view, it receives this event
       
   228     
       
   229         if ( iContainer )
       
   230             {      
       
   231             // set title to blank to avoid title flickering
       
   232             CAknTitlePane* title( static_cast<CAknTitlePane*>
       
   233                 ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ))));
       
   234             if ( title )
       
   235                 {
       
   236                 title->SetTextL(KEmptyTitle); 
       
   237                 title->DrawNow();
       
   238                 }
       
   239             }
       
   240         
       
   241         DoDeactivate();
       
   242         }
       
   243     }
       
   244 
       
   245 // -----------------------------------------------------------------------------
       
   246 // CMPXAudioEffectsViewImp::HandleViewUpdate
       
   247 // -----------------------------------------------------------------------------
       
   248 //
       
   249 void CMPXAudioEffectsViewImp::HandleViewUpdate(
       
   250     TUid /* aViewUid */,
       
   251     MMPXViewActivationObserver::TViewUpdateEvent /* aUpdateEvent */,
       
   252     TBool /* aLoaded */,
       
   253     TInt /* aData */)
       
   254     {
       
   255     // Do nothing, this should be handled by the AppUI
       
   256     }
       
   257 
       
   258 // -----------------------------------------------------------------------------
   208 // CMPXAudioEffectsViewImp::DoDeactivate
   259 // CMPXAudioEffectsViewImp::DoDeactivate
   209 // (other items were commented in a header).
   260 // (other items were commented in a header).
   210 // -----------------------------------------------------------------------------
   261 // -----------------------------------------------------------------------------
   211 //
   262 //
   212 void CMPXAudioEffectsViewImp::DoDeactivate()
   263 void CMPXAudioEffectsViewImp::DoDeactivate()
   214     if ( iContainer )
   265     if ( iContainer )
   215         {
   266         {
   216         AppUi()->RemoveFromStack( iContainer );
   267         AppUi()->RemoveFromStack( iContainer );
   217         delete iContainer;
   268         delete iContainer;
   218         iContainer = NULL;
   269         iContainer = NULL;
       
   270         iGoPreviousView = EFalse;
   219         }
   271         }
   220     }
   272     }
   221 
   273 
   222 // ---------------------------------------------------------------------------
   274 // ---------------------------------------------------------------------------
   223 // From CAknView
   275 // From CAknView