|
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: Popup control for full screen container |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 9 % |
|
19 |
|
20 |
|
21 #ifndef MPXVIDEOPLAYBACKBUTTONBAR_H |
|
22 #define MPXVIDEOPLAYBACKBUTTONBAR_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <coecntrl.h> |
|
26 #include <mpxplaybackframeworkdefs.h> |
|
27 |
|
28 #include "mpxhelixplaybackplugindefs.h" |
|
29 #include "mpxvideo_debug.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CMPXVideoPlaybackButton; |
|
33 class CMPXVideoPlaybackViewFileDetails; |
|
34 class CMPXVideoPlaybackControlsController; |
|
35 |
|
36 #ifdef RD_TACTILE_FEEDBACK |
|
37 class MTouchFeedback; |
|
38 #endif //RD_TACTILE_FEEDBACK |
|
39 |
|
40 // DATA TYPES |
|
41 enum TMPXButton |
|
42 { |
|
43 EMPXButtonFastForward, |
|
44 EMPXButtonPlay, |
|
45 EMPXButtonRewind, |
|
46 EMPXButtonPause, |
|
47 EMPXButtonCount // Should always be the last value |
|
48 }; |
|
49 |
|
50 enum TMPXButtonPressed |
|
51 { |
|
52 EMPXNotPressed, |
|
53 EMPXTopButtonPressed, |
|
54 EMPXMiddleButtonPressed, |
|
55 EMPXBottomButtonPressed |
|
56 }; |
|
57 |
|
58 |
|
59 class CMPXVideoPlaybackButtonBar : public CCoeControl |
|
60 { |
|
61 public: |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 */ |
|
65 static CMPXVideoPlaybackButtonBar* NewL( CMPXVideoPlaybackControlsController* aController, |
|
66 TRect aRect ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CMPXVideoPlaybackButtonBar(); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * C++ default constructor. |
|
77 */ |
|
78 CMPXVideoPlaybackButtonBar( CMPXVideoPlaybackControlsController* aController ); |
|
79 |
|
80 /** |
|
81 * By default Symbian 2nd phase constructor is private. |
|
82 */ |
|
83 void ConstructL( TRect aRect ); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * From CoeControl,CountComponentControls. |
|
89 * @return Number of contained component controls. |
|
90 */ |
|
91 TInt CountComponentControls() const; |
|
92 |
|
93 /** |
|
94 * From CCoeControl,ComponentControl. |
|
95 * @param aIndex index of a contained component control. |
|
96 */ |
|
97 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
98 |
|
99 /** |
|
100 * From CCoeControl,Draw. |
|
101 * @param aRect drawable area. |
|
102 */ |
|
103 void Draw( const TRect& aRect ) const; |
|
104 |
|
105 |
|
106 public: // from CoeControl |
|
107 |
|
108 /** |
|
109 * From CoeControl,HandleResourceChange |
|
110 */ |
|
111 void HandleResourceChange( TInt aType ); |
|
112 |
|
113 /** |
|
114 * From CoeControl,SetContainerWindowL |
|
115 */ |
|
116 void SetContainerWindowL( const CCoeControl& aContainer ); |
|
117 |
|
118 /** |
|
119 * From CoeControl,OfferKeyEventL |
|
120 */ |
|
121 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
122 |
|
123 public: |
|
124 |
|
125 /** |
|
126 * Set changed state |
|
127 * @return void |
|
128 */ |
|
129 void UpdateStateOnButtonBar( TMPXPlaybackState aState ); |
|
130 |
|
131 /* |
|
132 * Update button's state based on file details |
|
133 * @since 5.0 |
|
134 */ |
|
135 void UpdateButtonBarState( CMPXVideoPlaybackViewFileDetails* aDetails ); |
|
136 |
|
137 /* |
|
138 * Bring the button bar to its original state |
|
139 * @since 5.0 |
|
140 */ |
|
141 void Reset(); |
|
142 |
|
143 private: |
|
144 /** |
|
145 * Creates buttons |
|
146 * @return void |
|
147 */ |
|
148 void CreateButtonsL(); |
|
149 |
|
150 /** |
|
151 * Creates new skins for the control. |
|
152 * @return void |
|
153 */ |
|
154 void SkinChangeL(); |
|
155 |
|
156 // |
|
157 // Performs logic for the button down events |
|
158 // |
|
159 void HandleButtonDownEventL( const TPointerEvent& aPointerEvent ); |
|
160 |
|
161 // |
|
162 // Performs logic for the button up events for top button |
|
163 // |
|
164 void HandleTopButtonUpEventL( const TPointerEvent& aPointerEvent ); |
|
165 |
|
166 // |
|
167 // Performs logic for the button up events for middle button |
|
168 // |
|
169 void HandleMiddleButtonUpEventL(); |
|
170 |
|
171 // |
|
172 // Performs logic for the button up events for bottom button |
|
173 // |
|
174 void HandleBottomButtonUpEventL( const TPointerEvent& aPointerEvent ); |
|
175 |
|
176 // |
|
177 // Callback fuction of iSeekingTimer |
|
178 // |
|
179 static TInt StartSeekingL( TAny* aPtr ); |
|
180 |
|
181 // |
|
182 // Start seeking |
|
183 // |
|
184 void DoStartSeekingL(); |
|
185 |
|
186 private: // Data |
|
187 CArrayPtrFlat< CMPXVideoPlaybackButton > iButtons; |
|
188 CMPXVideoPlaybackControlsController* iController; |
|
189 |
|
190 TBool iSeeking; |
|
191 |
|
192 TRect iTopButtonRect; |
|
193 TRect iMiddleButtonRect; |
|
194 TRect iBottomButtonRect; |
|
195 |
|
196 TMPXButtonPressed iButtonPressed; |
|
197 CPeriodic* iSeekingTimer; |
|
198 |
|
199 #ifdef RD_TACTILE_FEEDBACK |
|
200 MTouchFeedback* iFeedback; |
|
201 #endif //RD_TACTILE_FEEDBACK |
|
202 }; |
|
203 |
|
204 #endif //MPXVIDEOPLAYBACKBUTTONBAR_H |
|
205 |
|
206 // End of File |