mpxplugins/viewplugins/views/pdplaybackview/inc/mpxpdplaybackviewimp.h
changeset 0 ff3acec5bc43
child 15 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:  MPX Progressive Download playback view implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CMPXPDPLAYBACKVIEWIMP_H
       
    21 #define C_CMPXPDPLAYBACKVIEWIMP_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <mpxplaybackcommanddefs.h>
       
    26 #include "mpxpdplaybackview.h"
       
    27 
       
    28 #include <akntoolbarobserver.h>
       
    29 // FORWARD DECLARATIONS
       
    30 class CMPXPdPlaybackViewContainer;
       
    31 class CMPXPdPlaybackViewLayout;
       
    32 
       
    33 class CAknToolbar;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  *  MPX Progressive Download playback view.
       
    39  *
       
    40  *  @lib mpxpdplaybackview.lib
       
    41  *  @since S60 v3.0
       
    42  */
       
    43 NONSHARABLE_CLASS( CMPXPdPlaybackViewImp ) : public CMPXPdPlaybackView
       
    44                                            ,public MAknToolbarObserver
       
    45     {
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      *
       
    51      * @since 3.0
       
    52      * @return Pointer to newly created object.
       
    53      */
       
    54     static CMPXPdPlaybackViewImp* NewL();
       
    55 
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      *
       
    59      * @since 3.0
       
    60      * @return Pointer to newly created object.
       
    61      */
       
    62     static CMPXPdPlaybackViewImp* NewLC();
       
    63 
       
    64     /**
       
    65      * Destructor.
       
    66      */
       
    67     ~CMPXPdPlaybackViewImp();
       
    68 
       
    69 private:
       
    70 
       
    71     /**
       
    72      * C++ default constructor.
       
    73      */
       
    74     CMPXPdPlaybackViewImp();
       
    75 
       
    76     /**
       
    77      * By default Symbian 2nd phase constructor is private.
       
    78      */
       
    79     void ConstructL();
       
    80 
       
    81     /**
       
    82      * Gets download information
       
    83      */
       
    84     void GetDownloadInformationL(
       
    85         TUint& aTransactionId,
       
    86         TMPXPlaybackPdDownloadState& aState,
       
    87         TInt& aDownloadedBytes,
       
    88         TInt& aTotalBytes );
       
    89 
       
    90     /**
       
    91     * This checks only two things:  Network available, Network Strength>none.
       
    92     * @param: aCheck holds the UID of the failed check.
       
    93     * @param: aState holds the state of the failed check.
       
    94     * @return ETrue if network available and network strength
       
    95     * is Low or Medium or High, otherwise return EFalse.
       
    96     */
       
    97     TBool CheckSignalAvailableL( TUid& aCheck, TInt& aState );
       
    98 
       
    99 
       
   100 	  /**
       
   101      *  Handle playback property
       
   102      *
       
   103      *  @param aProperty the property
       
   104      *  @param aValue the value of the property
       
   105      *  @param aError error code
       
   106      */
       
   107     void DoHandlePropertyL(
       
   108         TMPXPlaybackProperty aProperty,
       
   109         TInt aValue,
       
   110         TInt aError );
       
   111 
       
   112 // from base class CMPXCommonPlaybackViewImp
       
   113     /**
       
   114      *  Handle playback message
       
   115      *
       
   116      *  @param aMessage playback message
       
   117      */
       
   118     void DoHandlePlaybackMessageL(
       
   119         const CMPXMessage& aMessage );
       
   120 
       
   121     /**
       
   122      *  Handle playback state changed.
       
   123      *
       
   124      *  @param aState New Playback state
       
   125      *  @param aData Extra data parameter, used for any extra information
       
   126      *               along with the state change message
       
   127      */
       
   128     void DoHandleStateChangedL(
       
   129         TMPXPlaybackState aState,
       
   130         TInt aData );
       
   131 
       
   132     /**
       
   133      * Updates download state label.
       
   134      */
       
   135     void UpdateDownloadStateLabelL();
       
   136 
       
   137     /**
       
   138      * Displays error notes.
       
   139      *
       
   140      * @param aError Error ID to be handled.
       
   141      */
       
   142     void HandleErrorL( TInt aError );
       
   143 
       
   144 // from base class MEikMenuObserver
       
   145 
       
   146     /**
       
   147      * From MEikMenuObserver
       
   148      * Dynamically initialises a menu pane.
       
   149      *
       
   150      * @param aResourceId The ID of the menu pane.
       
   151      * @param aMenuPane The menu pane itself.
       
   152      */
       
   153     void DynInitMenuPaneL(
       
   154         TInt aResourceId,
       
   155         CEikMenuPane* aMenuPane );
       
   156 
       
   157 
       
   158 // from base class CAknView
       
   159 
       
   160     /**
       
   161      * From CAknView
       
   162      * Returns views id.
       
   163      *
       
   164      * @since 3.0
       
   165      * @return Views Uid
       
   166      */
       
   167     TUid Id() const;
       
   168 
       
   169     /**
       
   170      * From CAknView
       
   171      * Command handling function.
       
   172      *
       
   173      * @since 3.0
       
   174      * @param aCommand Command which is handled
       
   175      */
       
   176     void HandleCommandL( TInt aCommand );
       
   177 
       
   178     /**
       
   179      * From CAknView
       
   180      * Processes user commands.
       
   181      *
       
   182      * @since 3.0
       
   183      * @param aCommand ID of the command to respond to.
       
   184      */
       
   185     void ProcessCommandL( TInt aCommand );
       
   186 
       
   187     /**
       
   188      * From CAknView
       
   189      * Handles a view activation.
       
   190      *
       
   191      * @param aPrevViewId Specifies the view previously active.
       
   192      * @param aCustomMessageId Specifies the message type.
       
   193      * @param aCustomMessage The activation message.
       
   194      */
       
   195     void DoActivateL(
       
   196         const TVwsViewId& aPrevViewId,
       
   197         TUid aCustomMessageId,
       
   198         const TDesC8& aCustomMessage );
       
   199 
       
   200     /**
       
   201      * From MAknToolbarObserver
       
   202      * Processes user commands.
       
   203      *
       
   204      * @since 5.0
       
   205      * @param aCommand ID of the command to respond to.
       
   206      */
       
   207     void OfferToolbarEventL( TInt aCommandId );
       
   208 
       
   209     /**
       
   210      * From MAknToolbarObserver
       
   211      * Used to change toolbar settings before it is made visible
       
   212      *
       
   213      * @since 5.0
       
   214      * @param aCommand ID of the command to respond to.
       
   215      */
       
   216     void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolBar );
       
   217 
       
   218     /**
       
   219     * Update the toolbar state
       
   220     *
       
   221     * @since 5.0
       
   222     *
       
   223     */
       
   224 	void UpdateToolbar();
       
   225 
       
   226 private:    // data
       
   227     CMPXPdPlaybackViewLayout* iPlaybackViewLayout;    // owned
       
   228     TInt iPdResourceOffset;       // must be freed
       
   229     TMPXPlaybackPdDownloadState iDownloadState;
       
   230     TInt iTotalBytes;
       
   231     CAknToolbar* iToolbar; //owned
       
   232     };
       
   233 
       
   234 #endif  // C_CMPXPLAYBACKVIEWIMP_H
       
   235 
       
   236 // End of File