videoplayerapp/lwplayer/inc/lwplayerappui.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Declares UI class for LWPlayer application.
       
    15  *
       
    16 */
       
    17 
       
    18 // Version : %version: 5 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _LWPLAYERAPPUI_H_
       
    23 #define _LWPLAYERAPPUI_H_
       
    24 
       
    25 #include <aknViewAppUi.h>
       
    26 #include <AknServerApp.h>
       
    27 
       
    28 //
       
    29 //  FORWARD DECLARATIONS
       
    30 //
       
    31 class CDocumentHandler;
       
    32 class CAiwGenericParamList;
       
    33 
       
    34 /*
       
    35  * Application UI class.
       
    36  * Provides support for the following features:
       
    37  * - EIKON control architecture
       
    38  */
       
    39 
       
    40 class CLWPlayerAppUi : public CAknViewAppUi,
       
    41                        public MAknServerAppExitObserver
       
    42 {
       
    43     public:
       
    44         /*
       
    45          * EPOC default constructor.
       
    46          */
       
    47         void ConstructL();
       
    48 
       
    49         /*
       
    50          * Destructor.
       
    51          */
       
    52         virtual ~CLWPlayerAppUi();
       
    53 
       
    54         // ----------------------------------------------------
       
    55         //  New Methods added for Progressive Download
       
    56         // ----------------------------------------------------
       
    57 
       
    58         /*
       
    59          * Process Commandline Parameters
       
    60          */
       
    61         TBool ProcessCommandParametersL( CApaCommandLine& aCommandLine );
       
    62 
       
    63         /*
       
    64          * Extract Generic Parameters
       
    65          */
       
    66         void ExtractGenericParamsL( const TDesC8& aParams );
       
    67 
       
    68         /*
       
    69          * Handle DlMgr Message
       
    70          */
       
    71         MCoeMessageObserver::TMessageResponse HandleMessageL(
       
    72                 TUint32 aClientHandleOfTWG,
       
    73                 TUid aMessageUid,
       
    74                 const TDesC8& aMessageParameters);
       
    75 
       
    76         /*
       
    77          * From MAknServerAppExitObserver.
       
    78          */
       
    79         void HandleServerAppExit(TInt aReason);
       
    80 
       
    81     private:
       
    82         /*
       
    83          * From CEikAppUi, takes care of command handling.
       
    84          * @param aCommand command to be handled
       
    85          */
       
    86         void HandleCommandL( TInt aCommand );
       
    87 
       
    88         /*
       
    89          * From CEikAppUi, takes care of error handling.
       
    90          * @param aCommand command to be handled
       
    91          */
       
    92         void HandleErrorL( TInt aError );
       
    93 
       
    94         /*
       
    95          *  LaunchMediaPlayerL
       
    96          *
       
    97          *  Uses the document handler framework to open a file
       
    98          *  Used to create the embedded media player
       
    99          *
       
   100          *  @since S60 3.2
       
   101          *  @param afilename   filename of clip to be opened
       
   102          *  @param aparamList  list of parameters for progressive download
       
   103          *  @return error code
       
   104          */
       
   105         TInt LaunchMediaPlayerL( const TDesC& afilename,
       
   106                                  const CAiwGenericParamList* aparamList );
       
   107 
       
   108 
       
   109         /*
       
   110          *  SendMessageL
       
   111          *
       
   112          *  Finds the embedded media player and forwards the message
       
   113          *  from the browser to the embedded Media Player
       
   114          *
       
   115          *  @since S60 3.2
       
   116          *  @param aMessageParameters   list of parameters for prog. download
       
   117          *  @return error code
       
   118          */
       
   119         TInt SendMessageL(const TDesC8& aMessageParameters);
       
   120 
       
   121         /*
       
   122          *  DocumentHandlerL
       
   123          *
       
   124          *  Returns a reference to the Document Handler.
       
   125          *  Sets this class as an exit observer
       
   126          *
       
   127          *  @since S60 3.2
       
   128          *  @return reference to the document handler
       
   129          */
       
   130         CDocumentHandler& DocumentHandlerL();
       
   131 
       
   132         /*
       
   133          *  ActivateClosePlayerActiveObject
       
   134          *
       
   135          *  Starts an active object to close the LWPlayer.
       
   136          *
       
   137          *  @since S60 9.2
       
   138          */
       
   139         void ActivateClosePlayerActiveObject();
       
   140 
       
   141         /*
       
   142          *  Called to stop and exit the LWPlayer
       
   143          *  @since 3.2
       
   144          *  @return void
       
   145          */
       
   146         virtual void DoCloseLWPlayerL();
       
   147 
       
   148         /*
       
   149          *  Provides the static function for the callback to close the LWPlayer
       
   150          *  Called by CIdle iIdle
       
   151          *  @since 3.2
       
   152          *  @param aPtr Pointer to callback class
       
   153          *  @return KErrNone
       
   154          */
       
   155         static TInt CloseLWPlayerL( TAny* aPtr );
       
   156 
       
   157         /*
       
   158          *  Handles the Block Events Timer Timout
       
   159          *  @since 9.2
       
   160          *  @param aPtr Pointer to callback class
       
   161          *  @return KErrNone
       
   162          */
       
   163         static TInt HandleBlockEventsTimeout( TAny* aPtr );
       
   164 
       
   165         /*
       
   166          *  Called to unblock events
       
   167          *  @since 9.2
       
   168          *  @return void
       
   169          */
       
   170         void UnblockEvents();
       
   171 
       
   172         /*
       
   173          *  Called to block events
       
   174          *  @since 9.2
       
   175          *  @return void
       
   176          */
       
   177         void BlockEvents();
       
   178 
       
   179         //
       
   180         //  Member Variables
       
   181         //
       
   182         CDocumentHandler*      iDocHandler;
       
   183         TBool                  iEmbeddedMPCreated;
       
   184         TBool                  iAllowEvents;
       
   185         CIdle*                 iCloseAO;
       
   186         CPeriodic*             iBlockEventsTimer;
       
   187 };
       
   188 
       
   189 #endif
       
   190 
       
   191 // End of File