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