|
1 /* |
|
2 * Copyright (c) 2005 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: SmilPlayerIndicatorController declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SMILPLAYERINDICATORCONTROLLER_H |
|
20 #define SMILPLAYERINDICATORCONTROLLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <coecobs.h> |
|
25 #include "SmilPlayerTimeObserver.h" |
|
26 #include "SmilPlayerPauseObserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CSmilPlayerPresentationController; |
|
30 class CSmilPlayerVolumeIndicatorController; |
|
31 class CSmilPlayerTimeIndicatorTimer; |
|
32 class CSmilPlayerPauseIndicatorTimer; |
|
33 class CEikLabel; |
|
34 class CEikImage; |
|
35 class CCoeBrushAndPenContext; |
|
36 class TAknsItemID; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * Controller class of the indicators. |
|
41 */ |
|
42 NONSHARABLE_CLASS(CSmilPlayerIndicatorController) : public CCoeControl, |
|
43 public MCoeForegroundObserver, |
|
44 public MCoeControlObserver, |
|
45 public MSmilPlayerTimeObserver, |
|
46 public MSmilPlayerPauseObserver |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Constructor. |
|
52 * |
|
53 * @param aParent Parent control. |
|
54 * @param aPresController Presentation controller. |
|
55 * @param aVolumeEnabled Specifies whether volume is enabled. |
|
56 * |
|
57 * @return pointer to the object |
|
58 */ |
|
59 static CSmilPlayerIndicatorController * NewL( const CCoeControl* aParent, |
|
60 CSmilPlayerPresentationController* aPresController, |
|
61 TBool aVolumeEnabled ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CSmilPlayerIndicatorController(); |
|
67 |
|
68 public: // Functions from base classes |
|
69 |
|
70 /** |
|
71 * From CoeControl |
|
72 * See the documentation from the coecntrl.h |
|
73 */ |
|
74 TInt CountComponentControls() const; |
|
75 |
|
76 /** |
|
77 * From CCoeControl |
|
78 * See the documentation from the coecntrl.h |
|
79 */ |
|
80 CCoeControl* ComponentControl(TInt aIndex) const; |
|
81 |
|
82 /** |
|
83 * From CCoeControl |
|
84 * See the documentation from the coecntrl.h |
|
85 */ |
|
86 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
87 TEventCode aType ); |
|
88 |
|
89 /** |
|
90 * From MSmilPlayerTimeObserver |
|
91 * See the documentation from the SmilPlayerTimeObserver.h |
|
92 */ |
|
93 void TimeChangedL( const TDesC& aTimeString ); |
|
94 |
|
95 /** |
|
96 * From MSmilPlayerTimeObserver |
|
97 * See the documentation from the SmilPlayerTimeObserver.h |
|
98 */ |
|
99 TInt CurrentTime() const; |
|
100 |
|
101 /** |
|
102 * From MSmilPlayerTimeObserver |
|
103 * See the documentation from the SmilPlayerTimeObserver.h |
|
104 */ |
|
105 TInt PresentationDuration() const; |
|
106 |
|
107 /** |
|
108 * From MSmilPlayerTimeObserver |
|
109 * See the documentation from the SmilPlayerTimeObserver.h |
|
110 */ |
|
111 TBool IsDurationFinite() const; |
|
112 |
|
113 /** |
|
114 * From MSmilPlayerPauseObserver |
|
115 * See the documentation from the SmilPlayerPauseObserver.h |
|
116 */ |
|
117 void TogglePauseIndicator() const; |
|
118 |
|
119 /** |
|
120 * From MCoeForegroundObserver |
|
121 * See the documentation from the coemain.h |
|
122 */ |
|
123 void HandleGainingForeground(); |
|
124 |
|
125 /** |
|
126 * From MCoeForegroundObserver |
|
127 * See the documentation from the coemain.h |
|
128 */ |
|
129 void HandleLosingForeground(); |
|
130 |
|
131 /** |
|
132 * From MCoeControlObserver |
|
133 * See the documentation from the coecobs.h |
|
134 */ |
|
135 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
136 |
|
137 /** |
|
138 * From CCoeControl |
|
139 * See the documentation from the coecntrl.h |
|
140 */ |
|
141 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
142 |
|
143 /** |
|
144 * From CCoeControl |
|
145 * See the documentation from the coecntrl.h |
|
146 */ |
|
147 void HandleResourceChange( TInt aType ); |
|
148 |
|
149 public: // new functions |
|
150 |
|
151 /** |
|
152 * Performs approriate tasks when presentation has been stopped. |
|
153 * |
|
154 * @since 3.0 |
|
155 */ |
|
156 void Stop(); |
|
157 |
|
158 /** |
|
159 * Performs approriate tasks when presentation has been started. |
|
160 * |
|
161 * @since 3.0 |
|
162 */ |
|
163 void Start(); |
|
164 |
|
165 /** |
|
166 * Performs approriate tasks when presentation has been resumed. |
|
167 * |
|
168 * @since 3.0 |
|
169 */ |
|
170 void Resume(); |
|
171 |
|
172 /** |
|
173 * Performs approriate tasks when presentation has been paused. |
|
174 * |
|
175 * @since 3.0 |
|
176 */ |
|
177 void Pause(); |
|
178 |
|
179 /** |
|
180 * Performs approriate tasks when presentation end has been reached. |
|
181 * |
|
182 * @since 3.0 |
|
183 */ |
|
184 void EndReached(); |
|
185 |
|
186 /** |
|
187 * Returns current volume value. |
|
188 * |
|
189 * @since 3.0 |
|
190 * |
|
191 * @return Current volume level. |
|
192 */ |
|
193 TInt VolumeValue() const; |
|
194 |
|
195 /** |
|
196 * Sets correct layout for indicator. |
|
197 * |
|
198 * @since 3.0 |
|
199 */ |
|
200 void LayoutIndicators(); |
|
201 |
|
202 private: |
|
203 |
|
204 /** |
|
205 * C++ constructor. |
|
206 */ |
|
207 CSmilPlayerIndicatorController ( CSmilPlayerPresentationController* aPresController ); |
|
208 |
|
209 /** |
|
210 * By default Symbian 2nd phase constructor is private. |
|
211 */ |
|
212 void ConstructL( const CCoeControl* aParent, |
|
213 TBool aVolumeEnabled ); |
|
214 |
|
215 /** |
|
216 * Initializes indicator. |
|
217 */ |
|
218 void InitializeIconIndicatorL( CEikImage*& aIndicator, |
|
219 const TAknsItemID& aItem, |
|
220 const TInt aBitmapIndex, |
|
221 const TInt aMaskIndex ) const; |
|
222 |
|
223 /** |
|
224 * Sets pause indicator blinking on/off. |
|
225 */ |
|
226 void SetPauseIndicatorBlinking( TBool aValue ); |
|
227 |
|
228 /** |
|
229 * Handles skin change event. |
|
230 */ |
|
231 void DoHandleSkinChangeL(); |
|
232 |
|
233 /** |
|
234 * Updates the text color from currently used skin. |
|
235 */ |
|
236 void UpdateTextColorL(); |
|
237 |
|
238 /** |
|
239 * Sets correct bitmap for icon indicator. |
|
240 */ |
|
241 void SetIconIndicatorBitmapL( CEikImage*& aIndicator, |
|
242 const TAknsItemID& aItem, |
|
243 const TInt aBitmapIndex, |
|
244 const TInt aMaskIndex ) const; |
|
245 |
|
246 /** |
|
247 * Sets specified icons extent to given one. |
|
248 */ |
|
249 void SetIconIndicatorExtent( CEikImage* aIconIndicator, |
|
250 TRect aExtent ) const; |
|
251 |
|
252 private: // data |
|
253 |
|
254 /** Controller class for this class */ |
|
255 CSmilPlayerPresentationController* iPresController; |
|
256 |
|
257 /** Controller class for volume indicator */ |
|
258 CSmilPlayerVolumeIndicatorController* iVolumeController; |
|
259 |
|
260 /** Model class for time control. */ |
|
261 CSmilPlayerTimeIndicatorTimer* iTimeModel; |
|
262 |
|
263 /** View class for time control*/ |
|
264 CEikLabel* iTimeIndicator; |
|
265 |
|
266 /** View class for pause indicator. */ |
|
267 CEikImage* iPauseIndicator; |
|
268 |
|
269 /** View class for play indicator. */ |
|
270 CEikImage* iPlayIndicator; |
|
271 |
|
272 /** Timer for pause indicator. */ |
|
273 CSmilPlayerPauseIndicatorTimer* iPauseTimer; |
|
274 |
|
275 /** Specifies whether time indicator should be shown. */ |
|
276 TBool iShowTimeIndicator; |
|
277 }; |
|
278 |
|
279 #endif // SMILPLAYERINDICATORCONTROLLER_H |
|
280 |
|
281 // End of File |