|
1 /* |
|
2 * Copyright (c) 2010 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 VideoPlaybackControlsController |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 4 % |
|
19 |
|
20 |
|
21 |
|
22 #ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_ |
|
23 #define VIDEOPLAYBACKCONTROLSCONTROLLER_H_ |
|
24 |
|
25 // INCLUDES |
|
26 #include <qobject> |
|
27 |
|
28 #include <mpxplaybackframeworkdefs.h> |
|
29 |
|
30 #include "mpxvideo_debug.h" |
|
31 #include "videoplaybackcontrol.hrh" |
|
32 #include "mpxcommonvideoplaybackview.hrh" |
|
33 #include "videoplaybackviewfiledetails.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class VideoBasePlaybackView; |
|
37 class VideoPlaybackDocumentLoader; |
|
38 class VideoPlaybackFullScreenControl; |
|
39 class VideoPlaybackControlsController; |
|
40 |
|
41 |
|
42 // DATA TYPES |
|
43 |
|
44 enum TTimerAction |
|
45 { |
|
46 ETimerCancel, |
|
47 ETimerReset |
|
48 }; |
|
49 |
|
50 enum TPlaybackViewMode |
|
51 { |
|
52 EFullScreenView, |
|
53 EDetailsView, |
|
54 EAudioOnlyView |
|
55 }; |
|
56 |
|
57 |
|
58 // CLASS DECLARATION |
|
59 |
|
60 class VideoPlaybackControlsController : public QObject |
|
61 { |
|
62 Q_OBJECT |
|
63 |
|
64 public: |
|
65 |
|
66 /** |
|
67 * constructor. |
|
68 */ |
|
69 VideoPlaybackControlsController( |
|
70 VideoBasePlaybackView *view, |
|
71 VideoPlaybackViewFileDetails *details ); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 virtual ~VideoPlaybackControlsController(); |
|
77 |
|
78 public: |
|
79 /** |
|
80 * Reset or cancel timers for the controls |
|
81 */ |
|
82 void resetDisappearingTimers( TTimerAction timerAction ); |
|
83 |
|
84 /* |
|
85 * Return state |
|
86 */ |
|
87 inline TMPXPlaybackState state(); |
|
88 |
|
89 /** |
|
90 * Return file details |
|
91 */ |
|
92 inline VideoPlaybackViewFileDetails* fileDetails(); |
|
93 |
|
94 VideoPlaybackDocumentLoader* layoutLoader(); |
|
95 |
|
96 inline VideoBasePlaybackView* view(); |
|
97 |
|
98 void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true ); |
|
99 |
|
100 TPlaybackViewMode viewMode(); |
|
101 |
|
102 public: |
|
103 /** |
|
104 * Initialize controller |
|
105 */ |
|
106 void initializeController(); |
|
107 |
|
108 /** |
|
109 * Create controls |
|
110 */ |
|
111 void createControls(); |
|
112 |
|
113 /** |
|
114 * Update controls |
|
115 */ |
|
116 void handleStateChange( TMPXPlaybackState newState ); |
|
117 |
|
118 /** |
|
119 * Update Control's visibility |
|
120 */ |
|
121 void updateControlsVisibility(); |
|
122 |
|
123 public: |
|
124 VideoBasePlaybackView *mView; |
|
125 VideoPlaybackViewFileDetails *mFileDetails; |
|
126 |
|
127 QList<VideoPlaybackFullScreenControl*> mControls; |
|
128 |
|
129 VideoPlaybackDocumentLoader *mLoader; |
|
130 |
|
131 TMPXPlaybackState mState; |
|
132 TPlaybackViewMode mViewMode; |
|
133 TTimerAction mTimerAction; |
|
134 |
|
135 }; |
|
136 |
|
137 // INLINE METHODS |
|
138 // ------------------------------------------------------------------------------------------------- |
|
139 // VideoPlaybackControlsController::state |
|
140 // ------------------------------------------------------------------------------------------------- |
|
141 // |
|
142 inline |
|
143 TMPXPlaybackState VideoPlaybackControlsController::state() |
|
144 { |
|
145 return mState; |
|
146 } |
|
147 |
|
148 // ------------------------------------------------------------------------------------------------- |
|
149 // VideoPlaybackControlsController::fileDetails |
|
150 // ------------------------------------------------------------------------------------------------- |
|
151 // |
|
152 inline |
|
153 VideoPlaybackViewFileDetails* VideoPlaybackControlsController::fileDetails() |
|
154 { |
|
155 return mFileDetails; |
|
156 } |
|
157 |
|
158 // ------------------------------------------------------------------------------------------------- |
|
159 // VideoPlaybackControlsController::view |
|
160 // ------------------------------------------------------------------------------------------------- |
|
161 // |
|
162 inline |
|
163 VideoBasePlaybackView* VideoPlaybackControlsController::view() |
|
164 { |
|
165 return mView; |
|
166 } |
|
167 |
|
168 #endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/ |
|
169 |
|
170 // End of File |