author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:32:09 +0300 | |
branch | RCL_3 |
changeset 75 | 01504893d9cb |
parent 60 | 5b3385a43d68 |
permissions | -rw-r--r-- |
60 | 1 |
/* |
2 |
* Copyright (c) 2007 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: Slideshow view implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_SHWSLIDESHOWVIEW_H |
|
20 |
#define C_SHWSLIDESHOWVIEW_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include <glxviewbase.h> |
|
24 |
#include <mglxmedialistobserver.h> |
|
25 |
#include <AknProgressDialog.h> |
|
26 |
#include <gestureobserver.h> |
|
27 |
#include <gesturehelper.h> |
|
28 |
#include "shwengineobserver.h" |
|
29 |
#include "shwmusicobserver.h" |
|
30 |
#include "shwconstants.h" |
|
31 |
#include "shwtickobserver.h" |
|
32 |
#include "shwgestureobserver.h" |
|
33 |
#include "gesturecontrol.h" |
|
34 |
#include "glxmmcnotifier.h" |
|
35 |
#include <mglxtvobserver.h> |
|
36 |
#include <glxtv.h> |
|
37 |
#include <mglxhdmidecoderobserver.h> |
|
38 |
||
39 |
// FORWARD DECLARATIONS |
|
40 |
class CAlfEnv; |
|
41 |
class CAlfDisplay; |
|
42 |
class CAlfDisplayCoeControl; |
|
43 |
class CAlfControlGroup; |
|
44 |
class CAlfSoftKeyControl; |
|
45 |
class CGlxUiUtility; |
|
46 |
class CGlxMediaListManager; |
|
47 |
class MGlxMediaList; |
|
48 |
class CShwSlideshowEngine; |
|
49 |
class CAknWaitDialog; |
|
50 |
class CShwSlideshowVolumeControl; |
|
51 |
class CShwSlideshowBackLightTimer; |
|
52 |
class CShwSlideShowPauseHandler; |
|
53 |
class CShwSlideShowKeyHandler; |
|
54 |
class CShwTelephoneHandler; |
|
55 |
class CMPXCollectionPath; |
|
56 |
class CEikButtonGroupContainer; |
|
57 |
class CShwGestureControl; |
|
58 |
class CShwTicker; |
|
59 |
class CShwMediaKeyUtility; |
|
60 |
class CGestureControl; |
|
61 |
class CGlxHdmiController; |
|
62 |
/** |
|
63 |
* Slideshow view. |
|
64 |
* |
|
65 |
* @internal reviewed 07/06/2007 by Kimmo Hoikka |
|
66 |
*/ |
|
67 |
NONSHARABLE_CLASS(CShwSlideshowView) : public CGlxViewBase, |
|
68 |
public MGlxMediaListObserver, |
|
69 |
public MShwEngineObserver, |
|
70 |
public MShwMusicObserver, |
|
71 |
public MProgressDialogCallback, |
|
72 |
public MShwTickObserver, |
|
73 |
public MShwGestureObserver, |
|
74 |
public MStorageNotifierObserver, |
|
75 |
public MGlxTvObserver, |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
76 |
public MGlxHDMIDecoderObserver |
60 | 77 |
{ |
78 |
public: |
|
79 |
||
80 |
/** |
|
81 |
* Two-phased constructor. |
|
82 |
* |
|
83 |
* @return Pointer to newly created object. |
|
84 |
*/ |
|
85 |
static CShwSlideshowView* NewLC(); |
|
86 |
||
87 |
/** |
|
88 |
* Destructor. |
|
89 |
*/ |
|
90 |
~CShwSlideshowView(); |
|
91 |
||
92 |
public: // Callback functions |
|
93 |
/** |
|
94 |
* Show the progress dialog |
|
95 |
* this needs to be public as it is a callback. |
|
96 |
* @return TInt, a non-zero value if it is intended to |
|
97 |
* be called again, otherwise it should return zero. |
|
98 |
*/ |
|
99 |
TInt ShowProgressDialogL(); |
|
100 |
||
101 |
||
102 |
/** |
|
103 |
* Start the engine |
|
104 |
* this needs to be public as it is a callback. |
|
105 |
* @return TInt, a non-zero value if it is intended to |
|
106 |
* be called again, otherwise it should return zero. |
|
107 |
*/ |
|
108 |
TInt StartEngineL(); |
|
109 |
||
110 |
/** |
|
111 |
* Populate the media list |
|
112 |
* this needs to be public as it is a callback. |
|
113 |
* @return TInt, a non-zero value if it is intended to |
|
114 |
* be called again, otherwise it should return zero. |
|
115 |
*/ |
|
116 |
TInt PopulateListL(); |
|
117 |
||
118 |
private: |
|
119 |
||
120 |
/** |
|
121 |
* C++ default constructor. |
|
122 |
*/ |
|
123 |
CShwSlideshowView(); |
|
124 |
||
125 |
/** |
|
126 |
* 2nd phase constructor |
|
127 |
*/ |
|
128 |
void ConstructL(); |
|
129 |
||
130 |
private: // from base class CAknView |
|
131 |
||
132 |
/** |
|
133 |
* @ref CAknView::Id |
|
134 |
*/ |
|
135 |
TUid Id() const; |
|
136 |
||
137 |
/** |
|
138 |
* @ref CAknView::HandleForegroundEventL |
|
139 |
*/ |
|
140 |
void HandleForegroundEventL(TBool aForeground); |
|
141 |
||
142 |
public: // From CGlxViewBase |
|
143 |
||
144 |
/** |
|
145 |
* @ref CGlxViewBase::DoViewActivateL |
|
146 |
*/ |
|
147 |
void DoViewActivateL( const TVwsViewId& aPrevViewId, |
|
148 |
TUid aCustomMessageId, const TDesC8& aCustomMessage ); |
|
149 |
/** |
|
150 |
* @ref CGlxViewBase::DoViewDeactivate |
|
151 |
*/ |
|
152 |
void DoViewDeactivate(); |
|
153 |
||
154 |
public://From MGlxHDMIDecoderObserver |
|
155 |
/** |
|
156 |
* Handle notification of HDMI Image Decoder. |
|
157 |
*/ |
|
158 |
void HandleHDMIDecodingEventL(THdmiDecodingStatus aStatus); |
|
159 |
||
160 |
private: // from MGlxMediaListObserver |
|
161 |
||
162 |
/// @ref MGlxMediaListObserver::HandleItemAddedL |
|
163 |
void HandleItemAddedL( TInt aStartIndex, |
|
164 |
TInt aEndIndex, |
|
165 |
MGlxMediaList* aList ); |
|
166 |
/// @ref MGlxMediaListObserver::HandleMediaL |
|
167 |
void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); |
|
168 |
/// @ref MGlxMediaListObserver::HandleItemRemovedL |
|
169 |
void HandleItemRemovedL( TInt aStartIndex, |
|
170 |
TInt aEndIndex, |
|
171 |
MGlxMediaList* aList ); |
|
172 |
/// @ref MGlxMediaListObserver::HandleItemModifiedL |
|
173 |
void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, |
|
174 |
MGlxMediaList* aList ); |
|
175 |
/// @ref MGlxMediaListObserver::HandleAttributesAvailableL |
|
176 |
void HandleAttributesAvailableL( TInt aItemIndex, |
|
177 |
const RArray<TMPXAttribute>& aAttributes, |
|
178 |
MGlxMediaList* aList ); |
|
179 |
/// @ref MGlxMediaListObserver::HandleFocusChangedL |
|
180 |
void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, |
|
181 |
TInt aNewIndex, |
|
182 |
TInt aOldIndex, |
|
183 |
MGlxMediaList* aList ); |
|
184 |
/// @ref MGlxMediaListObserver::HandleItemSelectedL |
|
185 |
void HandleItemSelectedL( TInt aIndex, |
|
186 |
TBool aSelected, |
|
187 |
MGlxMediaList* aList ); |
|
188 |
/// @ref MGlxMediaListObserver::HandleMessageL |
|
189 |
void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); |
|
190 |
||
191 |
/// @ref MGlxMediaListObserver::HandlePopulatedL |
|
192 |
void HandlePopulatedL( MGlxMediaList* aList ); |
|
193 |
||
194 |
// From MGlxTVObserver |
|
195 |
virtual void HandleTvStatusChangedL ( TTvChangeType aChangeType ); |
|
196 |
||
197 |
//form CAknView |
|
198 |
void ProcessCommandL(TInt aCommandId); |
|
199 |
private: // From MShwEngineObserver |
|
200 |
||
201 |
/** |
|
202 |
* @ref MShwEngineObserver::EngineStartedL |
|
203 |
*/ |
|
204 |
void EngineStartedL(); |
|
205 |
||
206 |
/** |
|
207 |
* @ref MShwEngineObserver::EnginePausedL |
|
208 |
*/ |
|
209 |
void EnginePausedL(); |
|
210 |
||
211 |
/** |
|
212 |
* @ref MShwEngineObserver::EngineResumedL |
|
213 |
*/ |
|
214 |
void EngineResumedL(); |
|
215 |
||
216 |
/** |
|
217 |
* @ref MShwEngineObserver::EngineToggleUiStateL |
|
218 |
*/ |
|
219 |
void EngineToggleUiStateL(); |
|
220 |
/** |
|
221 |
* @ref MShwEngineObserver::EngineLSKPressedL |
|
222 |
*/ |
|
223 |
void EngineLSKPressedL(); |
|
224 |
||
225 |
/** |
|
226 |
* @ref MShwEngineObserver::ErrorDuringSlideshowL |
|
227 |
*/ |
|
228 |
void ErrorDuringSlideshowL(); |
|
229 |
||
230 |
private: // from MShwMusicObserver |
|
231 |
||
232 |
/** |
|
233 |
* @ref MShwMusicObserver::MusicOn |
|
234 |
*/ |
|
235 |
void MusicOnL(); |
|
236 |
||
237 |
/** |
|
238 |
* @ref MShwMusicObserver::MusicOff |
|
239 |
*/ |
|
240 |
void MusicOff(); |
|
241 |
||
242 |
/** |
|
243 |
* @ref MShwMusicObserver::MusicOn |
|
244 |
*/ |
|
245 |
void MusicVolumeL(TInt aCurrentVolume, TInt aMaxVolume); |
|
246 |
||
247 |
/** |
|
248 |
* @ref MShwMusicObserver::ErrorWithTrackL |
|
249 |
*/ |
|
250 |
void ErrorWithTrackL( TInt aErrorCode ); |
|
251 |
||
252 |
private: // from MProgressDialogCallback |
|
253 |
||
254 |
void DialogDismissedL( TInt aButtonId ); |
|
255 |
||
256 |
private: // Helper functions |
|
257 |
||
258 |
/** |
|
259 |
* Setup the screen furniture |
|
260 |
*/ |
|
261 |
void SetupScreenFurnitureL(); |
|
262 |
||
263 |
/** |
|
264 |
* Method that creates a local, ordered copy of the media list |
|
265 |
* @param aData from which to extract the play direction and the path |
|
266 |
*/ |
|
267 |
void GetPathAndPlaybackDirectionL( const TDesC8& aData ); |
|
268 |
||
269 |
/** |
|
270 |
* Helper function to set the focus in the filtered list, depending |
|
271 |
* on the selection or focus of the original list. |
|
272 |
*/ |
|
273 |
void SetListFocusL(); |
|
274 |
||
275 |
/** |
|
276 |
* @ref MShwTickObserver::HandleTickL |
|
277 |
*/ |
|
278 |
void HandleTickL(); |
|
279 |
||
280 |
/** |
|
281 |
* @ref MShwTickObserver::HandleTickCancelled |
|
282 |
*/ |
|
283 |
void HandleTickCancelled(); |
|
284 |
||
285 |
/** |
|
286 |
* @ref MShwGestureObserver::HandleShwGestureEventL |
|
287 |
*/ |
|
288 |
void HandleShwGestureEventL(MShwGestureObserver::TShwGestureEventType aType); |
|
289 |
||
290 |
/** |
|
291 |
* Initializes the screen furniture for the slide show view |
|
292 |
*/ |
|
293 |
void InitializeShwFurnitureL(); |
|
294 |
||
295 |
/** |
|
296 |
* Initializes the soft keys |
|
297 |
*/ |
|
298 |
void InitializeCbaL(); |
|
299 |
||
300 |
/** |
|
301 |
* Hides the screen furniture |
|
302 |
*/ |
|
303 |
void HideShwFurniture(); |
|
304 |
||
305 |
/** |
|
306 |
* Makes the screen furniture visible |
|
307 |
*/ |
|
308 |
void ShowShwFurnitureL(); |
|
309 |
||
310 |
/** |
|
311 |
* Replaces an existing command set with a new one |
|
312 |
*@ |
|
313 |
*/ |
|
314 |
void ReplaceCommandSetL(TInt aNewComandId, TInt aOldCommandSet ); |
|
315 |
||
316 |
/** |
|
317 |
* returns the index of item for which texture can be removed for cleanup |
|
318 |
* The index will be out the iterator offsets w.r.t focssed index. |
|
319 |
*/ |
|
320 |
TInt GetIndexToBeRemoved(); |
|
321 |
||
322 |
/** |
|
323 |
* Remove the fullscreen texture. |
|
324 |
*/ |
|
325 |
void RemoveTexture(); |
|
326 |
||
327 |
/** |
|
328 |
* Set the current Item to HDMI. |
|
329 |
*/ |
|
330 |
void SetItemToHDMIL(); |
|
331 |
/** |
|
332 |
* HandleMMCInsertionL. |
|
333 |
*/ |
|
334 |
void HandleMMCInsertionL(); |
|
335 |
/** |
|
336 |
* HandleMMCRemovalL. |
|
337 |
*/ |
|
338 |
void HandleMMCRemovalL(); |
|
339 |
/** |
|
340 |
* Returns the index of the next item |
|
341 |
* for which HDMI advance decoding will be done |
|
342 |
*/ |
|
343 |
TInt GetNextIndex(); |
|
344 |
public: |
|
345 |
//to keep in track which of the command set is active/on top |
|
346 |
enum TShwState |
|
347 |
{ |
|
348 |
EShwPause = 1 , |
|
349 |
EShwPlay, |
|
350 |
EShwExiting |
|
351 |
}; |
|
352 |
private: // Data |
|
353 |
||
354 |
TInt iResourceOffset; |
|
355 |
||
356 |
/** |
|
357 |
* HUIToolkit environment. |
|
358 |
* not owned |
|
359 |
*/ |
|
360 |
CAlfEnv* iEnv; |
|
361 |
||
362 |
CAlfDisplay* iDisplay; // not owned |
|
363 |
||
364 |
/** Slideshow Engine */ |
|
365 |
CShwSlideshowEngine* iEngine; // owned |
|
366 |
||
367 |
CAlfControlGroup* iVolumeControlGroup; // owned |
|
368 |
||
369 |
CAknWaitDialog* iWaitDialog; // owned |
|
370 |
||
371 |
/// Own: Pause handler |
|
372 |
CShwSlideShowPauseHandler* iPauseHandler; |
|
373 |
||
374 |
/// Own: Key handler |
|
375 |
CShwSlideShowKeyHandler* iKeyHandler; |
|
376 |
||
377 |
CShwSlideshowVolumeControl* iVolumeControl; // owned |
|
378 |
||
379 |
TInt iCurrentVolume;// owned |
|
380 |
||
381 |
CShwSlideshowBackLightTimer* iBackLightTimer; // owned |
|
382 |
||
383 |
// This flag is used to determine whether or not the slideshow |
|
384 |
// should resume when it returns to the foreground |
|
385 |
TBool iPauseOnForeground; // owned |
|
386 |
||
387 |
MGlxMediaList* iFilteredList; // owned |
|
388 |
MGlxMediaList* iMediaList; // owned |
|
389 |
/// Own: Flag to tell that input list is ready to be used |
|
390 |
TBool iInputListReady; |
|
391 |
/// Own: Flag to tell that play list is ready to be used |
|
392 |
TBool iPlayListReady; |
|
393 |
||
394 |
/// Own: asynch callback needed for engine start |
|
395 |
CAsyncCallBack* iAsyncCallBack; |
|
396 |
||
397 |
// handle interruptions from incoming telephone calls |
|
398 |
CShwTelephoneHandler* iTelephoneHandler; |
|
399 |
||
400 |
CMPXCollectionPath* iCollectionPath; // owned |
|
401 |
NShwSlideshow::TPlayDirection iPlayDirection; // owned |
|
402 |
||
403 |
/// Own: The TV connection monitor |
|
404 |
CGlxTv * iTvConnection; |
|
405 |
||
406 |
TBool iEngineStartFailed; |
|
407 |
||
408 |
/// Own: asynch callback needed for media list population |
|
409 |
CAsyncCallBack* iPopulateListCallBack; |
|
410 |
CEikButtonGroupContainer* iShwCba; |
|
411 |
||
412 |
//Flag for event generated by MSK |
|
413 |
TBool iMSKPressed; |
|
414 |
||
415 |
//Flag for event generated by LSK |
|
416 |
TBool iLSKPressed; |
|
417 |
||
418 |
//to keep track of whether the furniture is visible or not |
|
419 |
//and to toggle on tap |
|
420 |
enum TShwFurniture |
|
421 |
{ |
|
422 |
EFurnitureVisible = 1, |
|
423 |
EFurnitureHidden |
|
424 |
}; |
|
425 |
||
426 |
TShwState iShwState; |
|
427 |
TShwFurniture iShwFurniture; |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
428 |
TInt iCurrentActiveCommandSet; |
60 | 429 |
CShwGestureControl* iShwGestureControl; |
430 |
GestureHelper::CGestureControl* iGestureControl; |
|
431 |
CAlfControlGroup* iGestureControlGroup; |
|
432 |
CShwTicker* iTicker; |
|
433 |
CShwMediaKeyUtility* iMediaKeyHandler; |
|
434 |
CGlxHdmiController* iHdmiController; |
|
435 |
TBool iHdmiActive; |
|
436 |
CGlxMMCNotifier* iMMCNotifier; |
|
437 |
TBool iMMCState; |
|
438 |
TBool iIsForegrnd; |
|
439 |
TSize iScrnSize; |
|
440 |
TSize iGridIconSize; |
|
441 |
//to check if slideshow is paused in BG |
|
442 |
//and after that we are bringing to foreground |
|
443 |
TBool iPrevNotInBackground; |
|
444 |
||
445 |
TInt iHdmiWidth; |
|
446 |
TInt iHdmiHeight; |
|
447 |
}; |
|
448 |
||
449 |
#endif // C_SHWSLIDESHOWVIEW_H |
|
450 |
||
451 |
// End of File |