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