author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:19:17 +0300 | |
branch | RCL_3 |
changeset 64 | 34937ec34dac |
parent 60 | 5b3385a43d68 |
child 75 | 01504893d9cb |
permissions | -rw-r--r-- |
60 | 1 |
/* |
2 |
* Copyright (c) 2008-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 Fullscreen view |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_CGLXFULLSCREENIMP_C |
|
19 |
#define C_CGLXFULLSCREENIMP_C |
|
20 |
||
21 |
#include <alf/ialfwidgeteventhandler.h> |
|
22 |
#include <mglxuicommandhandler.h> |
|
23 |
#include <gesturehelper.h> |
|
24 |
#include <gestureobserver.h> |
|
25 |
#include <glximageviewermanager.h> |
|
26 |
#include <alf/alfcompositionutility.h> |
|
27 |
||
28 |
#include "glxfullscreenview.h" |
|
29 |
#include "glxfullscreenbindingsetfactory.h" |
|
30 |
#include "glxfullscreenview.hrh" |
|
31 |
#include "glxmmcnotifier.h" |
|
32 |
#include "glxtv.h" |
|
33 |
#include "mglxhdmidecoderobserver.h" //for MGlxHDMIDecoderObserver |
|
34 |
||
35 |
//Gesture Helper namespace |
|
36 |
namespace GestureHelper |
|
37 |
{ |
|
38 |
class CGestureHelper; |
|
39 |
} |
|
40 |
||
41 |
// FORWARD DECLARATIONS |
|
42 |
class CAlfEnv; |
|
43 |
class CGlxMediaListMulModelProvider; |
|
44 |
class TGlxMulFullScreenBindingSetFactory; |
|
45 |
class CEikButtonGroupContainer; |
|
46 |
class CGlxActiveMediaListRegistry; |
|
47 |
class CGlxZoomControl; |
|
48 |
class CGlxSingleLineMetaPane; |
|
49 |
class CGlxCommandHandlerAiwShowMapHardKey; |
|
50 |
class CGlxDRMUtility; |
|
51 |
class CGlxHdmiController; |
|
52 |
class CGestureHelper; |
|
53 |
class TGlxMedia; |
|
54 |
class CGlxFullScreenBusyIcon; |
|
55 |
class CGlxNavigationalState; |
|
56 |
||
57 |
namespace Alf |
|
58 |
{ |
|
59 |
class IMulCoverFlowWidget; |
|
60 |
class IMulModel; |
|
61 |
class IMulSliderWidget; |
|
62 |
class IMulSliderModel; |
|
63 |
} |
|
64 |
/* |
|
65 |
Defines the swipe direction |
|
66 |
*/ |
|
67 |
enum TSwipe |
|
68 |
{ |
|
69 |
EForward,EBackward |
|
70 |
}; |
|
71 |
||
72 |
NONSHARABLE_CLASS (CGlxFullScreenViewImp): public CGlxFullScreenView, |
|
73 |
public IAlfWidgetEventHandler, |
|
74 |
public MGlxUiCommandHandler, |
|
75 |
public MStorageNotifierObserver, |
|
76 |
public CAlfEffectObserver::MAlfEffectObserver, |
|
77 |
public MGlxTvObserver, |
|
78 |
public MGlxHDMIDecoderObserver |
|
79 |
{ |
|
80 |
public: |
|
81 |
/** |
|
82 |
* Two-phased constructor.` |
|
83 |
* |
|
84 |
* @return Pointer to newly created object. |
|
85 |
*/ |
|
86 |
static CGlxFullScreenViewImp* NewL(MGlxMediaListFactory* aMediaListFactory, |
|
87 |
const TFullScreenViewResourceIds& aResourceIds, |
|
88 |
TInt aViewUID, |
|
89 |
const TDesC& aTitle); |
|
90 |
||
91 |
/** |
|
92 |
* Two-phased constructor. |
|
93 |
* |
|
94 |
* @return Pointer to newly created object. |
|
95 |
*/ |
|
96 |
static CGlxFullScreenViewImp* NewLC(MGlxMediaListFactory* aMediaListFactory, |
|
97 |
const TFullScreenViewResourceIds& aResourceIds,TInt aViewUID, const TDesC& aTitle); |
|
98 |
||
99 |
/** |
|
100 |
* Destructor. |
|
101 |
*/ |
|
102 |
virtual ~CGlxFullScreenViewImp(); |
|
103 |
||
104 |
public:// CGlxViewBase |
|
105 |
virtual TBool HandleViewCommandL(TInt aCommand); |
|
106 |
||
107 |
void HandleCommandL(TInt aCommandId, CAlfControl* aControl) ; |
|
108 |
||
109 |
void HandleResourceChangeL (TInt aType); |
|
110 |
||
111 |
public:// CAknView |
|
112 |
void HandleForegroundEventL(TBool aForeground); |
|
113 |
||
114 |
TUid Id() const; |
|
115 |
||
116 |
void DoMLViewActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
117 |
const TDesC8& aCustomMessage); |
|
118 |
void DoMLViewDeactivate(); |
|
119 |
||
120 |
//Shows the exipry note/dialog for expired DRM files |
|
121 |
void ShowDrmExpiryNoteL(); |
|
122 |
||
123 |
// Callback for periodic timer, static, |
|
124 |
static TInt PeriodicCallback( TAny* aPtr ); |
|
125 |
//nonstatic func called from periodic timer |
|
126 |
void CallPeriodicCallback(); |
|
127 |
public: |
|
128 |
//From IAlfWidgetEventHandler |
|
129 |
bool accept( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ) const; |
|
130 |
||
131 |
AlfEventStatus offerEvent( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ); |
|
132 |
||
133 |
void setEventHandlerData( const AlfWidgetEventHandlerInitData& aData ); |
|
134 |
||
135 |
AlfWidgetEventHandlerInitData* eventHandlerData(); |
|
136 |
||
137 |
void setActiveStates( unsigned int aStates ); |
|
138 |
||
139 |
IAlfInterfaceBase* makeInterface( const IfId& aType ); |
|
140 |
||
141 |
AlfEventHandlerType eventHandlerType() ; |
|
142 |
||
143 |
AlfEventHandlerExecutionPhase eventExecutionPhase() ; |
|
144 |
||
145 |
//From MAlfEffectObserver |
|
146 |
void HandleEffectCallback(TInt aType, TInt aHandle, TInt aStatus); |
|
147 |
||
148 |
public: |
|
149 |
//From MGlxHDMIDecoderObserver |
|
150 |
/* |
|
151 |
* Handle completion notification of HDMI Image Decoder. |
|
152 |
*/ |
|
153 |
void HandleHDMIDecodingEventL(THdmiDecodingStatus aStatus); |
|
154 |
||
155 |
private: |
|
156 |
/* |
|
157 |
* Constructor |
|
158 |
*/ |
|
159 |
CGlxFullScreenViewImp(const TFullScreenViewResourceIds& aResourceIds,TInt aViewUID); |
|
160 |
||
161 |
/* |
|
162 |
* By default Symbian 2nd phase constructor is private. |
|
163 |
*/ |
|
164 |
void ConstructL(MGlxMediaListFactory* aMediaListFactory,const TDesC& aTitle ); |
|
165 |
||
166 |
/* |
|
167 |
* Creates a coverflow widget |
|
168 |
*/ |
|
169 |
void CreateCoverflowWidgetL(); |
|
170 |
||
171 |
/* |
|
172 |
* Destroys Widgets, Coverflow and also calls DestroySliderWidget() |
|
173 |
*/ |
|
174 |
void DestroyWidgets(); |
|
175 |
||
176 |
/* |
|
177 |
* Destroys Slider widget |
|
178 |
*/ |
|
179 |
void DestroySliderWidget(); |
|
180 |
||
181 |
/* |
|
182 |
* Activate zoomcontrol |
|
183 |
* @param:aTap: specifies whether zoom control is launched by tapping or by pressing volume keys |
|
184 |
*/ |
|
185 |
void ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* aZoomFocus = NULL); |
|
186 |
||
187 |
/* |
|
188 |
* DeActivate zoomcontrol |
|
189 |
*/ |
|
190 |
void DeactivateZoomControlL(); |
|
191 |
||
192 |
/* |
|
193 |
* DeactivateFullScreen |
|
194 |
*/ |
|
195 |
void DeactivateFullScreen(); |
|
196 |
||
197 |
/* |
|
198 |
* ActivateFullScreen |
|
199 |
*/ |
|
200 |
void ActivateFullScreenL(); |
|
201 |
||
202 |
/* |
|
203 |
* Trun the UI on |
|
204 |
* @param aStartTimer:Incase of starting the zoom :we shouldn't be starting the timer. |
|
205 |
* else we need to start the Ui timer to hide the screen furniture |
|
206 |
* so for the rest of the cases we need to have aStartTimer = ETrue |
|
207 |
*/ |
|
208 |
void ShowUiL(TBool aStartTimer); |
|
209 |
||
210 |
/* |
|
211 |
* Hide the UI off |
|
212 |
* @param aHideSlider:When we start zooming using the slider widget,for continous zooming from the |
|
213 |
* fullscreen view to zoom control, we need to have the slider visible so in this case we shouldnt |
|
214 |
* be hiding the slider so pass EFalse,else case asliderstatus = ETrue |
|
215 |
*/ |
|
216 |
void HideUi(TBool aHideSlider); |
|
217 |
||
218 |
/* |
|
219 |
* Sets the UI state |
|
220 |
*/ |
|
221 |
void SetUiState (TUiState aState); |
|
222 |
||
223 |
/* |
|
224 |
* returns the Ui state |
|
225 |
*/ |
|
226 |
TUiState GetUiState(); |
|
227 |
||
228 |
/* |
|
229 |
* Call back function for the CPeriodic |
|
230 |
*/ |
|
231 |
static TInt TimeOut(TAny* aSelf); |
|
232 |
||
233 |
/* |
|
234 |
* Calculates and returns the Initial Zoom factor |
|
235 |
*/ |
|
236 |
TInt GetInitialZoomLevel(); |
|
237 |
||
238 |
/* |
|
239 |
* Calls GetInitialZoomLevel() to get the Zoom Level and Sets the Value to the |
|
240 |
* Slider Level |
|
241 |
*/ |
|
242 |
void SetSliderToMin(); |
|
243 |
||
244 |
/* |
|
245 |
* Creates and Initializes the slider model/widget |
|
246 |
*/ |
|
247 |
void CreateSliderWidgetL(); |
|
248 |
||
249 |
/** |
|
250 |
* This function doesnt add any value, added to remove codescanner warnings |
|
251 |
*/ |
|
252 |
AlfEventStatus OfferEventL(const TAlfEvent& aEvent); |
|
253 |
/** |
|
254 |
* returns the swipe direction of coverflow |
|
255 |
*/ |
|
256 |
TSwipe GetSwipeDirection(); |
|
257 |
/** |
|
258 |
* returns the index of item for which texture can be removed for cleanup |
|
259 |
* The index will be out the iterator offsets w.r.t focssed index. |
|
260 |
*/ |
|
261 |
TInt GetIndexToBeRemoved(); |
|
262 |
/** |
|
263 |
* Remove the fullscreen texture. |
|
264 |
*/ |
|
265 |
void RemoveTexture(); |
|
266 |
/** |
|
267 |
* Consume DRM rights |
|
268 |
*/ |
|
269 |
void ConsumeDRMRightsL(const TGlxMedia& aMedia); |
|
270 |
/** |
|
271 |
* Set the image to external display - HDMI |
|
272 |
*/ |
|
273 |
void SetItemToHDMIL(); |
|
274 |
/** |
|
275 |
* handle MMC insertion |
|
276 |
*/ |
|
277 |
void HandleMMCInsertionL(); |
|
278 |
/** |
|
279 |
* handle MMC removal |
|
280 |
*/ |
|
281 |
void HandleMMCRemovalL(); |
|
282 |
||
283 |
/** |
|
284 |
* navigate to main list |
|
285 |
*/ |
|
286 |
void NavigateToMainListL(); |
|
287 |
||
288 |
/** |
|
289 |
* Disable/enable the fullscreen toolbar |
|
290 |
*/ |
|
291 |
void EnableFSToolbar(TBool aEnable); |
|
292 |
||
293 |
/** |
|
294 |
* Create Image Viewer manager Instance |
|
295 |
*/ |
|
296 |
void CreateImageViewerInstanceL(); |
|
297 |
||
298 |
/** |
|
299 |
* Delete Image Viewer manager Instance |
|
300 |
*/ |
|
301 |
void DeleteImageViewerInstance(); |
|
302 |
||
303 |
/* |
|
304 |
* Get the HDMI cable insert/removal notification. |
|
305 |
*/ |
|
306 |
void HandleTvStatusChangedL( TTvChangeType aChangeType ); |
|
307 |
||
308 |
/** |
|
309 |
* Checks if the slider to be show for the focus index |
|
310 |
*/ |
|
311 |
TBool CheckIfSliderToBeShownL(); |
|
312 |
||
313 |
/** |
|
314 |
* Update coverflow items after zoom/foreground event |
|
315 |
*/ |
|
316 |
void UpdateItems(); |
|
317 |
||
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
318 |
/** |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
319 |
* Handle coverflow item removed event / |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
320 |
* external file deletion while gaining foreground |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
321 |
*/ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
322 |
void HandleItemRemovedL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
323 |
|
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
324 |
/** |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
325 |
* Sets the title pane text |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
326 |
* @param aTitleText Title text |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
327 |
*/ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
328 |
void SetTitlePaneTextL(const TDesC& aTitleText); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
329 |
|
60 | 330 |
private: |
331 |
/** Softkey resource id's */ |
|
332 |
TFullScreenViewResourceIds iResourceIds; |
|
333 |
// /** Avkon unique ViewId */ |
|
334 |
TInt iViewUid; |
|
335 |
||
336 |
/** Alf environment (not owned) */ |
|
337 |
CAlfEnv* iEnv; |
|
338 |
||
339 |
/// Active media list registry stores the pointer to the active media list |
|
340 |
/// Allows UPnP to know when list has changed |
|
341 |
CGlxActiveMediaListRegistry* iActiveMediaListRegistry; |
|
342 |
||
343 |
/** Data Provider */ |
|
344 |
CGlxMediaListMulModelProvider* iMediaListMulModelProvider; |
|
345 |
TGlxMulFullScreenBindingSetFactory iFullScreenBindingSet; |
|
346 |
||
347 |
//creating instance of viewWidget |
|
348 |
IAlfViewWidget* iViewWidget; |
|
349 |
||
350 |
/** The 2D Coverflow Widget ( owned )*/ |
|
351 |
IMulCoverFlowWidget* iCoverFlowWidget; |
|
352 |
IMulSliderWidget* iSliderWidget; |
|
353 |
IMulSliderModel* iSliderModel; |
|
354 |
||
355 |
//creating zoomcontrol |
|
356 |
CGlxZoomControl* iZoomControl; |
|
357 |
||
358 |
// Holds the state of the Ui in Fullscreen |
|
359 |
TUiState iUiState; |
|
360 |
||
361 |
// used to turn the Ui off,if the screen is inactive for 10 sec |
|
362 |
CPeriodic* iTimer; |
|
363 |
CEikButtonGroupContainer* iZoomButtonGroup; |
|
364 |
CGlxCommandHandlerAiwShowMapHardKey* iShowOnMapHardKeyhandler; |
|
365 |
||
366 |
CGlxScreenFurniture* iScreenFurniture; |
|
367 |
CGlxHdmiController* iHdmiController; |
|
368 |
||
369 |
CGlxDRMUtility* iDrmUtility; |
|
370 |
CPeriodic* iPeriodic; |
|
371 |
CGlxFullScreenBusyIcon* iBusyIcon; |
|
372 |
||
373 |
CGlxNavigationalState* iNaviState; |
|
374 |
||
375 |
GestureHelper::CGestureHelper* iGestureHelper; |
|
376 |
TBool iMultiTouchGestureOngoing ; |
|
377 |
||
378 |
// stores the initial zoom percentage |
|
379 |
TInt iInitialZoomRatio ; |
|
380 |
//Previous focused index |
|
381 |
TInt iOldFocusIndex; |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
382 |
// Previous focused Uri |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
383 |
HBufC* iUri; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
384 |
|
60 | 385 |
TBool iImgViewerMode; |
386 |
CGlxMMCNotifier* iMMCNotifier; |
|
387 |
TBool iMMCState; |
|
388 |
TSize iScrnSize; // ScrnSize |
|
389 |
TSize iGridIconSize; // grid icon size |
|
390 |
TBool iIsDialogLaunched; |
|
391 |
TBool iIsMMCRemoved; |
|
392 |
CAlfEffectObserver* iAlfEffectObs; |
|
393 |
TInt iEffectHandle; |
|
394 |
// For image viewer, not own |
|
395 |
CGlxImageViewerManager* iImageViewerInstance; |
|
396 |
CGlxTv* iGlxTvOut; |
|
397 |
TInt iHdmiWidth; |
|
398 |
TInt iHdmiHeight; |
|
399 |
}; |
|
400 |
||
401 |
#endif |
|
402 |