mpxplugins/viewplugins/views/embeddedplaybackview/inc/mpxembeddedplaybackviewimp.h
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:  MPX embeddedplayback view implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CMPXEMBEDDEDPLAYBACKVIEWIMP_H
       
    21 #define C_CMPXEMBEDDEDPLAYBACKVIEWIMP_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <AknProgressDialog.h>  // MProgressDialogCallback
       
    26 #include <mpxcollectionhelper.h>
       
    27 #include <mpxcollectionuihelper.h>
       
    28 #include "mpxembeddedplaybackview.h"
       
    29 #include <akntoolbarobserver.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CMPXEmbeddedPlaybackViewContainer;
       
    33 class CMPXEmbeddedPlaybackViewLayout;
       
    34 class CAknToolbar;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  *  MPX playback view.
       
    40  *
       
    41  *  @lib mpxplaybackview.lib
       
    42  *  @since S60 v3.0
       
    43  */
       
    44 NONSHARABLE_CLASS( CMPXEmbeddedPlaybackViewImp ) : public CMPXEmbeddedPlaybackView
       
    45                                            ,public MAknToolbarObserver
       
    46     {
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Two-phased constructor.
       
    51      *
       
    52      * @since 3.0
       
    53      * @return Pointer to newly created object.
       
    54      */
       
    55     static CMPXEmbeddedPlaybackViewImp* NewL();
       
    56 
       
    57     /**
       
    58      * Two-phased constructor.
       
    59      *
       
    60      * @since 3.0
       
    61      * @return Pointer to newly created object.
       
    62      */
       
    63     static CMPXEmbeddedPlaybackViewImp* NewLC();
       
    64 
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     ~CMPXEmbeddedPlaybackViewImp();
       
    69 
       
    70 private:
       
    71     enum TMPXNpvSaveMode
       
    72     {
       
    73     EMPXNpvUsePreviousMode = 0,
       
    74     EMPXNpvOpenAfterSave,
       
    75     EMXPNpvExitAppAfterSave,
       
    76     EMPXNpvExitHostAppAfterSave
       
    77     };    
       
    78 
       
    79 private:
       
    80 
       
    81     /**
       
    82      * C++ default constructor.
       
    83      */
       
    84     CMPXEmbeddedPlaybackViewImp();
       
    85 
       
    86     /**
       
    87      * By default Symbian 2nd phase constructor is private.
       
    88      */
       
    89     void ConstructL();
       
    90     
       
    91 // from base class CMPXCommonPlaybackViewImp
       
    92 
       
    93     /**
       
    94      * Updates the title pane
       
    95      */
       
    96     void UpdateTitlePaneL();
       
    97 
       
    98     /**
       
    99      * Updates track info field.
       
   100      *
       
   101      * @param aMedia Media's properties. If NULL, default info will
       
   102      *                    be shown.
       
   103      */
       
   104     void UpdateTrackInfoL( const CMPXMedia* aMedia );
       
   105     
       
   106     /**
       
   107      * Displays error notes.
       
   108      *
       
   109      * @param aError Error ID to be handled.
       
   110      */
       
   111     virtual void HandleErrorL( TInt aError );
       
   112     
       
   113     /**
       
   114      *  Handle playback property
       
   115      *
       
   116      *  @param aProperty the property
       
   117      *  @param aValue the value of the property
       
   118      *  @param aError error code
       
   119      */
       
   120     virtual void DoHandlePropertyL(
       
   121         TMPXPlaybackProperty aProperty,
       
   122         TInt aValue, 
       
   123         TInt aError ); 
       
   124 
       
   125 // from base class MMPXCHelperEmbeddedOpenObserver
       
   126 
       
   127     /**
       
   128     * From MMPXCHelperEmbeddedOpenObserver
       
   129     * Handles errors from opening in embedded mode
       
   130     * @param aErr, error code
       
   131     */
       
   132     void HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory aCategory );
       
   133     
       
   134 // from base class MEikMenuObserver
       
   135 
       
   136     /**
       
   137      * From MEikMenuObserver
       
   138      * Dynamically initialises a menu pane.
       
   139      *
       
   140      * @param aResourceId The ID of the menu pane.
       
   141      * @param aMenuPane The menu pane itself.
       
   142      */
       
   143     void DynInitMenuPaneL(
       
   144         TInt aResourceId, 
       
   145         CEikMenuPane* aMenuPane );
       
   146 
       
   147 
       
   148 // from base class CAknView
       
   149 
       
   150     /**
       
   151      * From CAknView
       
   152      * Returns views id.
       
   153      *
       
   154      * @since 3.0
       
   155      * @return Views Uid
       
   156      */
       
   157     TUid Id() const;
       
   158 
       
   159     /**
       
   160      * From CAknView
       
   161      * Command handling function.
       
   162      *
       
   163      * @since 3.0
       
   164      * @param aCommand Command which is handled
       
   165      */
       
   166     void HandleCommandL( TInt aCommand );
       
   167 
       
   168     /**
       
   169      * From CAknView
       
   170      * Handles a view activation.
       
   171      *
       
   172      * @param aPrevViewId Specifies the view previously active.
       
   173      * @param aCustomMessageId Specifies the message type.
       
   174      * @param aCustomMessage The activation message.
       
   175      */
       
   176     void DoActivateL(
       
   177         const TVwsViewId& aPrevViewId,
       
   178         TUid aCustomMessageId,
       
   179         const TDesC8& aCustomMessage );
       
   180 
       
   181 
       
   182 private:    // new methods
       
   183 
       
   184     /**
       
   185      *  Handle media properties.
       
   186      *  
       
   187      *  @param aMedia media properties
       
   188      *  @param aError error code    
       
   189      */
       
   190     void DoHandleMediaL(
       
   191         const CMPXMedia& aMedia,
       
   192         TInt aError );
       
   193 
       
   194     /**
       
   195      * Handle saving a file
       
   196      *
       
   197      * @param aMode The action to perform after save is completed
       
   198      */
       
   199     void HandleSaveL( TMPXNpvSaveMode aMode );
       
   200     void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
       
   201 
       
   202     /**
       
   203      * From MAknToolbarObserver
       
   204      * Processes user commands.
       
   205      *
       
   206      * @since 5.0
       
   207      * @param aCommand ID of the command to respond to.
       
   208      */
       
   209     void OfferToolbarEventL( TInt aCommandId );
       
   210       
       
   211     /**
       
   212      * From MAknToolbarObserver
       
   213      * Used to change toolbar settings before it is made visible
       
   214      *
       
   215      * @since 5.0
       
   216      * @param aCommand ID of the command to respond to.
       
   217      */
       
   218     void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolBar );
       
   219 
       
   220 private:    // data
       
   221     TInt iEmbeddedResourceOffset;
       
   222     CMPXEmbeddedPlaybackViewLayout* iPlaybackViewLayout;    // owned
       
   223     TBool iSaveInProgress;
       
   224     TBool iPrepareToSave;
       
   225     TMPXNpvSaveMode iSaveMode;
       
   226     CAknToolbar* iToolbar; //owned
       
   227     };
       
   228 
       
   229 #endif  // C_CMPXPLAYBACKVIEWIMP_H
       
   230 
       
   231 // End of File