1 /* |
|
2 * Copyright (c) 2009 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 QMPXVideoPlaybackButtonBar |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#12 % |
|
19 |
|
20 |
|
21 |
|
22 #ifndef MPXVIDEOPLAYBACKBUTTONBAR_H_ |
|
23 #define MPXVIDEOPLAYBACKBUTTONBAR_H_ |
|
24 |
|
25 #include <hbwidget.h> |
|
26 #include <MMFScalingCustomCommandConstants.h> |
|
27 #include <mpxplaybackframeworkdefs.h> |
|
28 |
|
29 |
|
30 class HbPushButton; |
|
31 class QActionGroup; |
|
32 class QMPXVideoPlaybackViewFileDetails; |
|
33 class QMPXVideoPlaybackControlsController; |
|
34 |
|
35 // DATA TYPES |
|
36 enum TMPXButton |
|
37 { |
|
38 EMPXButtonRW, |
|
39 EMPXButtonPlay, |
|
40 EMPXButtonPause, |
|
41 EMPXButtonFF, |
|
42 EMPXButtonNatural, |
|
43 EMPXButtonStretch, |
|
44 EMPXButtonZoom, |
|
45 EMPXButtonDetails, |
|
46 EMPXButtonAttach, |
|
47 EMPXButtonCount // Should always be the last value |
|
48 }; |
|
49 |
|
50 enum TMPXSeekingState |
|
51 { |
|
52 EMPXNotSeeking, |
|
53 EMPXFastForwarding, |
|
54 EMPXRewinding |
|
55 }; |
|
56 |
|
57 const int KMPXFastForward = 30; |
|
58 const int KMPXRewind = -10; |
|
59 |
|
60 class QMPXVideoPlaybackButtonBar : public HbWidget |
|
61 { |
|
62 Q_OBJECT |
|
63 |
|
64 public: |
|
65 QMPXVideoPlaybackButtonBar( QMPXVideoPlaybackControlsController* controller ); |
|
66 virtual ~QMPXVideoPlaybackButtonBar(); |
|
67 void updateState( TMPXPlaybackState state ); |
|
68 void aspectRatioChanged( int aspectRatio ); |
|
69 void initialize(); |
|
70 void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details ); |
|
71 void positionChanged( int position ); |
|
72 void durationChanged( int duration ); |
|
73 |
|
74 private slots: |
|
75 void play(); |
|
76 void pause(); |
|
77 void changeAspectRatio(); |
|
78 void handleButtonPressed(); |
|
79 void ffPressing(); |
|
80 void rwPressing(); |
|
81 void ffReleased(); |
|
82 void rwReleased(); |
|
83 void openDetailsView(); |
|
84 |
|
85 private: |
|
86 QMPXVideoPlaybackControlsController *mController; |
|
87 QList<HbPushButton*> mButtons; |
|
88 TMPXSeekingState mSeekingState; |
|
89 |
|
90 bool mInitialized; |
|
91 int mPosition; |
|
92 int mDuration; |
|
93 }; |
|
94 |
|
95 #endif /*MPXVIDEOPLAYBACKBUTTONBAR_H_*/ |
|