videoplayback/videoplaybackview/viewinc/videoplaybackuserinputhandler.h
changeset 55 4bfa887905cf
child 58 d2b028fd1f7d
equal deleted inserted replaced
50:21fe8338c6bf 55:4bfa887905cf
       
     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:  Implementation of VideoPlaybackUserInputHandler
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  7 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef VIDEOPLAYBACKUSERINPUTHANDLER_H_
       
    23 #define VIDEOPLAYBACKUSERINPUTHANDLER_H_
       
    24 
       
    25 // INCLUDES
       
    26 #include <remconcoreapitargetobserver.h> // Side volume key
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CRemConInterfaceSelector; // Side volume key
       
    31 class CRemConCoreApiTarget;
       
    32 class CMPXVideoViewWrapper;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 class CVideoPlaybackUserInputHandler : public CBase,
       
    37                                        public MRemConCoreApiTargetObserver
       
    38 {
       
    39     public: // Constructors and destructor
       
    40 
       
    41         /**
       
    42         * Two-phased constructor.
       
    43         */
       
    44         static CVideoPlaybackUserInputHandler* NewL(
       
    45                 CMPXVideoViewWrapper* aWrapper, TBool aTvOutConnected );
       
    46 
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CVideoPlaybackUserInputHandler();
       
    51 
       
    52     private:
       
    53 
       
    54         /**
       
    55         * C++ default constructor.
       
    56         */
       
    57         CVideoPlaybackUserInputHandler( CMPXVideoViewWrapper* aWrapper );
       
    58 
       
    59         /**
       
    60         * Symbian 2nd phase constructor.
       
    61         */
       
    62         void ConstructL( TBool aTvOutConnected );
       
    63 
       
    64     public:
       
    65         void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    66 
       
    67 	    void ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
       
    68                               TRemConCoreApiButtonAction aButtonAct );
       
    69 
       
    70 	    void DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
       
    71                                TRemConCoreApiButtonAction aButtonAct );
       
    72 
       
    73         // From MRemConCoreApiTargetObserver
       
    74         /**
       
    75         * Side volume key API from MRemConCoreApiTargetObserver
       
    76         * @since 3.2
       
    77         * @see MRemConCoreApiTargetObserver
       
    78         */
       
    79         virtual void MrccatoPlay(
       
    80                 TRemConCoreApiPlaybackSpeed aSpeed,
       
    81                 TRemConCoreApiButtonAction aButtonAct );
       
    82 
       
    83         virtual void MrccatoCommand(
       
    84                 TRemConCoreApiOperationId aOperationId,
       
    85                 TRemConCoreApiButtonAction aButtonAct );
       
    86 
       
    87         /**
       
    88         * Setter method for iForeground
       
    89         * @param aForeground - the value to be set
       
    90         * @return void
       
    91         */
       
    92         void SetForeground( TBool aForeground );
       
    93  
       
    94         void HandleTVOutEventL( TBool aTVOutConnected );
       
    95                 
       
    96 	private:
       
    97         /**
       
    98         * Handles volume repeat timer timout
       
    99         * @return TInt
       
   100         */
       
   101         static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
       
   102 
       
   103         /**
       
   104         * Adjust volume(+1/-1) for media key
       
   105         * @return void
       
   106         */
       
   107         void HandleVolumeRepeatL();
       
   108 
       
   109         void HandleFastForward( TRemConCoreApiButtonAction aButtonAct );
       
   110 
       
   111         void HandleRewind( TRemConCoreApiButtonAction aButtonAct );
       
   112 
       
   113         void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct );
       
   114 
       
   115         void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct );
       
   116 
       
   117         // Handles the Display light timer timeout
       
   118         static TInt  HandleDisplayTimeout( TAny* aPtr );
       
   119         
       
   120         // Disable the display backlight
       
   121         void DisableBacklight();
       
   122         
       
   123         // Enable the display backlight
       
   124         void EnableBacklight();
       
   125         
       
   126         // Restarts the timer for display light time-out
       
   127         void RestartDisplayTimer();
       
   128 
       
   129     private:
       
   130 
       
   131         TVideoUserInputType                     iProcessingInputType; 	// the type of input being processed
       
   132         TUint                                   iLastPressedKeyCode;     // keycode of last key that sent EEventKeyDown
       
   133         TInt                                    iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
       
   134         TRemConCoreApiOperationId               iLastMediaKeyPressed;    // Id of last mediakey thats sent a button-press
       
   135 
       
   136         CRemConInterfaceSelector*               iInterfaceSelector; 		// Side volume key, owned
       
   137         CRemConCoreApiTarget*                   iCoreTarget;            // Owned by CRemConInterfaceSelector
       
   138 
       
   139         CPeriodic*                              iVolumeRepeatTimer;     // owned
       
   140         TBool                                   iVolumeRepeatUp;
       
   141         TBool                                   iTVOutConnected;        // Flag to indicate if TV is connected
       
   142         CPeriodic*                              iDisplayTimer;          // Timer to timeout the lights time-out
       
   143         TInt                                    iDisplayTimeOut;        // Value of the lights time-out
       
   144 
       
   145         TBool                                   iForeground;
       
   146         CMPXVideoViewWrapper*                   iViewWrapper;
       
   147 };
       
   148 
       
   149 
       
   150 #endif /*VIDEOPLAYBACKUSERINPUTHANDLER_H_*/
       
   151 
       
   152 // End of File