|
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 |
|
19 // Version : %version: 10 % |
|
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 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 class CMPXVideoPlaybackUserInputHandler : public CBase, |
|
45 public MRemConCoreApiTargetObserver |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 IMPORT_C static CMPXVideoPlaybackUserInputHandler* NewL( CMPXVideoPlaybackContainer* iContainer ); |
|
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( ); |
|
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 /* |
|
107 * Function will block all user inputs until the new PDL command is received |
|
108 * @param aBlockInputs - the value to be set |
|
109 */ |
|
110 void BlockPdlUserInputs( TBool aBlockInputs ); |
|
111 |
|
112 private: |
|
113 /** |
|
114 * Handles volume repeat timer timout |
|
115 * @return TInt |
|
116 */ |
|
117 static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr ); |
|
118 |
|
119 /** |
|
120 * Adjust volume(+1/-1) for media key |
|
121 * @return void |
|
122 */ |
|
123 void HandleVolumeRepeatL(); |
|
124 |
|
125 void HandleFastForward( TRemConCoreApiButtonAction aButtonAct ); |
|
126 |
|
127 void HandleRewind( TRemConCoreApiButtonAction aButtonAct ); |
|
128 |
|
129 void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct ); |
|
130 |
|
131 void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct ); |
|
132 |
|
133 void ReRoutePointerEventL( CCoeControl* aControl, |
|
134 const TPointerEvent& aPointerEvent, |
|
135 TMPXVideoControlType aMPXControl ); |
|
136 |
|
137 TBool IsUserInputAllowed(); |
|
138 |
|
139 private: |
|
140 |
|
141 TMPXVideoUserInputType iProcessingInputType; // the type of input being processed |
|
142 TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown |
|
143 TRemConCoreApiOperationId iLastMediaKeyPressed; // Id of last mediakey thats sent a button-press |
|
144 |
|
145 CRemConInterfaceSelector* iInterfaceSelector; // Side volume key, owned |
|
146 CRemConCoreApiTarget* iCoreTarget; // Owned by CRemConInterfaceSelector |
|
147 |
|
148 CPeriodic* iVolumeRepeatTimer; // owned |
|
149 TBool iVolumeRepeatUp; |
|
150 TBool iForeground; |
|
151 TBool iBlockPdlInputs; |
|
152 |
|
153 CMPXVideoPlaybackContainer* iContainer; // not owned |
|
154 CCoeControl* iActiveControlPtr; // not owned |
|
155 TMPXVideoControlType iActiveControlType; |
|
156 }; |
|
157 |
|
158 |
|
159 #endif /*MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_*/ |
|
160 |
|
161 // End of File |