videoplayback/inc/mpxvideobaseplaybackview.h
changeset 0 96612d01cf9f
child 8 ce5ada96ab30
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 Video base playback view
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 16 %
       
    19 
       
    20 
       
    21 // This file defines the API for VideoBasePlaybackView.dll
       
    22 
       
    23 #ifndef __VIDEOBASEPLAYBACKVIEW_H__
       
    24 #define __VIDEOBASEPLAYBACKVIEW_H__
       
    25 
       
    26 //  Include Files
       
    27 #include <e32base.h>    // CBase
       
    28 #include <e32std.h>     // TBuf
       
    29 #include <aknview.h>
       
    30 #include <mpxplaybackobserver.h>
       
    31 #include <mpxviewactivationobserver.h>
       
    32 #include <mpxcollectionobserver.h>
       
    33 
       
    34 #include "mpxvideoplaybackcontrol.hrh"
       
    35 #include "mpxvideoplaybackdisplayhandler.h"
       
    36 #include <mpxvideoplaybackdefs.h>
       
    37 
       
    38 //  Constants
       
    39 
       
    40 //  Forward Declarations
       
    41 class CMPXVideoPlaybackContainer;
       
    42 class MMPXPlaybackUtility;
       
    43 class MMPXViewUtility;
       
    44 class MMPXCollectionUtility;
       
    45 class CMPFileDetailsDialog;
       
    46 class CMPFileDetails;
       
    47 
       
    48 class CMPXVideoPlaybackViewFileDetails;
       
    49 
       
    50 
       
    51 //  Class Definitions
       
    52 
       
    53 class CMPXVideoBasePlaybackView : public CAknView,
       
    54                                   public MMPXPlaybackObserver,
       
    55                                   public MMPXViewActivationObserver,
       
    56                                   public MMPXPlaybackCallback,
       
    57                                   public MMPXCollectionObserver
       
    58 {
       
    59     public:
       
    60         ~CMPXVideoBasePlaybackView();
       
    61 
       
    62         /**
       
    63         * From CAknView
       
    64         * Command handling function.
       
    65         *
       
    66         * @param aCommand Command which is handled
       
    67         */
       
    68         virtual void HandleCommandL( TInt aCommand );
       
    69 
       
    70         void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
       
    71 
       
    72     protected:
       
    73 
       
    74         /**
       
    75         * From CAknView
       
    76         * Processes user commands.
       
    77         *
       
    78         * @param aCommand ID of the command to respond to.
       
    79         */
       
    80         virtual void ProcessCommandL( TInt aCommand );
       
    81 
       
    82         /**
       
    83         * From CAknView
       
    84         * Event handler for status pane size changes.
       
    85         *
       
    86         */
       
    87         virtual void HandleStatusPaneSizeChange();
       
    88 
       
    89         /**
       
    90         * From CAknView
       
    91         * Handles a view activation.
       
    92         *
       
    93         * @param aPrevViewId Specifies the view previously active.
       
    94         * @param aCustomMessageId Specifies the message type.
       
    95         * @param aCustomMessage The activation message.
       
    96         */
       
    97         virtual void DoActivateL( const TVwsViewId& aPrevViewId,
       
    98                                   TUid aCustomMessageId,
       
    99                                   const TDesC8& aCustomMessage );
       
   100 
       
   101         /**
       
   102         * From CAknView
       
   103         * View deactivation function.
       
   104         */
       
   105         virtual void DoDeactivate();
       
   106 
       
   107         /**
       
   108         * From CAknView
       
   109         * Foreground event handling function.
       
   110         *
       
   111         * @param aForeground Indicates the required focus state of the control.
       
   112         */
       
   113         virtual void HandleForegroundEventL( TBool aForeground );
       
   114 
       
   115         /**
       
   116         * From MEikMenuObserver
       
   117         */
       
   118         virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   119 
       
   120         /**
       
   121         * From MMPXPlaybackObserver
       
   122         * Handle playback message
       
   123         *
       
   124         * @param aMessage Playback Message
       
   125         * @param aErr system error code.
       
   126         */
       
   127         virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
       
   128 
       
   129         /*
       
   130          *  From MMPXViewActivationObserver
       
   131          *  Handle view activation.
       
   132          *
       
   133          *  @param aCurrentViewType Current view type Uid.
       
   134          *  @param aPreviousViewType Previous view type Uid.
       
   135          */
       
   136         void HandleViewActivation( const TUid& aCurrentViewType, const TUid& aPreviousViewType );
       
   137 
       
   138         /**
       
   139         *  From MMPXPlaybackCallback
       
   140         *  Handle playback property
       
   141         *
       
   142         *  @param aProperty the property
       
   143         *  @param aValue the value of the property
       
   144         *  @param aError error code
       
   145         */
       
   146         void HandlePropertyL( TMPXPlaybackProperty aProperty,
       
   147                               TInt aValue,
       
   148                               TInt aError );
       
   149 
       
   150         /**
       
   151         *  Method is called continously until aComplete=ETrue, signifying that
       
   152         *  it is done and there will be no more callbacks
       
   153         *  Only new items are passed each time
       
   154         *
       
   155         *  @param aPlayer UID of the subplayer
       
   156         *  @param aSubPlayers a list of sub players
       
   157         *  @param aComplete ETrue no more sub players. EFalse more subplayer
       
   158         *                   expected
       
   159         *  @param aError error code
       
   160         */
       
   161         inline void HandleSubPlayerNamesL( TUid /*aPlayer*/,
       
   162                                            const MDesCArray* /*aSubPlayers*/,
       
   163                                            TBool /*aComplete*/,
       
   164                                            TInt /*aError*/ )
       
   165         {}
       
   166 
       
   167         /**
       
   168         *  Call back of media request
       
   169         *
       
   170         *  @param aMedia media
       
   171         *  @param aError error code
       
   172         */
       
   173         void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
       
   174 
       
   175         void UpdatePbPluginMediaL( TBool aSeek);
       
   176 
       
   177 
       
   178         /**
       
   179         *  Handle completion of a asynchronous command
       
   180         *  @param aCommandResult result of the command, NULL if error
       
   181         *  @param aError error code
       
   182         */
       
   183         void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
       
   184                                             TInt /*aError*/);
       
   185         /*
       
   186          *  From base class MMPXCollectionMediaObserver
       
   187          *  (via MMPXCollectionObserver)
       
   188          *  Handle extended media properties
       
   189          *
       
   190          *  @param aMedia media
       
   191          *  @param aError error code
       
   192          */
       
   193         inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
       
   194 
       
   195         /*
       
   196          *  From base class MMPXCollectionObserver
       
   197          */
       
   198         inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {}
       
   199 
       
   200         inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
       
   201                                  TInt /*aIndex*/,
       
   202                                  TBool /*aComplete*/,
       
   203                                  TInt /*aError*/ ) {}
       
   204 
       
   205         inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
       
   206 
       
   207     public:
       
   208         /**
       
   209         * Set property
       
   210         */
       
   211         void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
       
   212         virtual void RetrievePdlInformationL();
       
   213 
       
   214     protected:
       
   215 
       
   216         virtual void CloseEmbeddedPlaybackViewL() = 0;
       
   217 
       
   218         /*
       
   219          *  Handle Download State Change
       
   220          *  @param  aState  new state of the download
       
   221          */
       
   222         virtual void HandlePdlStateChangeL( TInt aState ) = 0;
       
   223 
       
   224         /*
       
   225          *  Handle transition to the stopped state
       
   226          */
       
   227         virtual void HandleStoppedStateL() = 0;
       
   228 
       
   229         virtual void HandlePluginErrorL( TInt aError );
       
   230 
       
   231         virtual void ClosePlaybackViewL();
       
   232 
       
   233         virtual void HandleBufferingStateL();
       
   234 
       
   235         virtual void IssuePlayCommandL();
       
   236 
       
   237         void InitializeVideoPlaybackViewL();
       
   238         void DisplayInfoMessageL( TInt aResourceId, TBool aWaitingDialog = EFalse );
       
   239         void DisplayErrorMessageL( TInt aResourceId );
       
   240 
       
   241 
       
   242         CMPXVideoBasePlaybackView();
       
   243 
       
   244         /*
       
   245          *  Activates an active object to close the player
       
   246          *  @since 5.0
       
   247          */
       
   248         void ActivateClosePlayerActiveObject();
       
   249 
       
   250         /*
       
   251          *  Provides the static function for the callback to close the player
       
   252          *  Called by CIdle iIdle
       
   253          *  @since 3.2
       
   254          *  @param aPtr Pointer to callback class
       
   255          *  @return KErrNone
       
   256          */
       
   257         static TInt ClosePlayerL( TAny* aPtr );
       
   258 
       
   259         /*
       
   260          *  Called to stop and exit the player
       
   261          *  @since 3.2
       
   262          *  @return void
       
   263          */
       
   264         virtual void DoClosePlayerL();
       
   265 
       
   266 
       
   267         virtual void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
       
   268 
       
   269         /**
       
   270          * Returns views Implementation id.
       
   271          * @return id for this view.
       
   272          */
       
   273         virtual TUid ViewImplementationId() const = 0;
       
   274 
       
   275         virtual void HandleClosePlaybackViewL();
       
   276 
       
   277         TBool IsAppInFrontL();
       
   278 
       
   279         TInt RetrieveBufferingPercentageL();
       
   280 
       
   281     private:
       
   282 
       
   283         /**
       
   284         *  Handle playback message
       
   285         *
       
   286         *  @param aMsg playback message
       
   287         */
       
   288         virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
       
   289 
       
   290         /**
       
   291         *  Handle playback error message
       
   292         *
       
   293         *  @param aErr system error code.
       
   294         */
       
   295         void DoHandleErrorPlaybackMessageL( TInt aError );
       
   296 
       
   297         void SetDisplayWindowL();
       
   298 
       
   299         void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd );
       
   300 
       
   301         void SetVideoRectL();
       
   302 
       
   303 
       
   304         void DisplayFileDetailsDialogL();
       
   305 
       
   306         /**
       
   307         *  Handle media properties.
       
   308         *
       
   309         *  @param aMedia media properties
       
   310         *  @param aError error code
       
   311         */
       
   312         virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
       
   313 
       
   314         void CreateAbortDsaCmdL();
       
   315 
       
   316         void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
       
   317 
       
   318         void RestartDsaL();
       
   319 
       
   320         void RequestMediaL();
       
   321         void RequestCollectionMediaL();
       
   322         void RequestPlaybackMediaL();
       
   323 
       
   324         void ParseMetaDataL( const CMPXMedia& aMedia );
       
   325 
       
   326         void DoHandleStateChangeL( TInt aNewState );
       
   327 
       
   328         void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
       
   329 
       
   330         void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
   331 
       
   332         void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
       
   333 
       
   334         void HandleShortPressBackwardL();
       
   335 
       
   336         TInt AddDllPath( TDes& aFileName );
       
   337 
       
   338         void ShowFileDetailsDialogL();
       
   339 
       
   340         void HandleDrmErrorsL( TInt aError );
       
   341         TBool IsMultiItemPlaylist();
       
   342         TInt OpenDrmFileHandleL( RFile& aFile );
       
   343         void LaunchDRMDetailsL();
       
   344         
       
   345 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   346         TInt OpenDrmFileHandle64L( RFile64& aFile );        
       
   347 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   348         
       
   349     protected: // data
       
   350         MMPXPlaybackUtility*                iPlaybackUtility;
       
   351         MMPXViewUtility*                    iViewUtility;
       
   352         MMPXCollectionUtility*              iCollectionUtility;
       
   353         CMPXVideoPlaybackDisplayHandler*    iDisplayHandler;
       
   354 
       
   355         TMPXPlaybackState                   iPlaybackState;
       
   356 
       
   357         CMPXVideoPlaybackContainer*         iContainer;
       
   358 
       
   359         TInt                                iVideoResourceOffset;
       
   360 
       
   361         CMPFileDetailsDialog*               iFileDetailsDialog;
       
   362         CMPXVideoPlaybackViewFileDetails*   iFileDetails;
       
   363         CIdle*                              iCloseAO;
       
   364 
       
   365         TBool                               iMediaRequested;
       
   366         TBool                               iPlaylistView;
       
   367         TBool                               iCollectionMediaRequested;
       
   368 
       
   369         HBufC*                              iClipName;
       
   370 };
       
   371 
       
   372 #endif  // __VIDEOBASEPLAYBACKVIEW_H__
       
   373 
       
   374 // EOF