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 68 | 5b238bc8ffb6 |
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 FULL-SCREEN view |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
// Avkon and System Headers |
|
22 |
#include <eikbtgpc.h> // CEikButtonGroupContainer |
|
23 |
#include <aknViewAppUi.h> |
|
24 |
#include <data_caging_path_literals.hrh> // for KDC_APP_RESOURCE_DIR |
|
25 |
#include <glxcollectionpluginimageviewer.hrh> |
|
26 |
#include <StringLoader.h> // String Loader |
|
27 |
#include <AknIconUtils.h> |
|
28 |
#include <e32math.h> |
|
29 |
||
30 |
//For animation Effects |
|
31 |
#include <akntranseffect.h> |
|
32 |
#include <akntransitionutils.h> |
|
33 |
#include <alf/alflayout.h> |
|
34 |
||
35 |
// Alf Headers |
|
36 |
#include <alf/ialfwidgetfactory.h> // widget factory |
|
37 |
#include <alf/alfwidgetcontrol.h> // To get CAlfControl from CAlfWidgetControl |
|
38 |
#include <alf/ialfviewwidget.h> // View Widget |
|
39 |
#include <alf/alfwidgetenvextension.h> // Widget Env Extensions to create view widget |
|
40 |
#include <alf/alfutil.h> // AlfUtil |
|
41 |
||
42 |
// Antariksh Headers |
|
43 |
#include <mul/mulevent.h> |
|
44 |
#include <mul/imulcoverflowwidget.h> // Coverflow widget |
|
45 |
#include <mul/imulsliderwidget.h> // For Slider Widget |
|
46 |
#include <mpxcollectionpath.h> |
|
47 |
||
48 |
#include <gesturehelper.h> |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
49 |
#include <coeutils.h> |
60 | 50 |
|
51 |
using namespace GestureHelper; |
|
52 |
||
53 |
#include <glxhdmicontroller.h> |
|
54 |
||
55 |
// Photos Headers |
|
56 |
#include <glxlog.h> // CGlxLogger |
|
57 |
#include <glxtracer.h> // For Log |
|
58 |
#include <glxmedialistmulmodelprovider.h> // For MulModelProvider |
|
59 |
#include <glxcommandhandlers.hrh> // For EGlxCmdFullScreenBack |
|
60 |
#include <glxfullscreenviewdata.rsg> // FS View Resource |
|
61 |
#include <glxthumbnailattributeinfo.h> // KGlxMediaIdThumbnail |
|
62 |
#include <glxactivemedialistregistry.h> // For medialist registry |
|
63 |
#include <glxerrormanager.h> |
|
64 |
#include <glxzoomcontrol.h> |
|
65 |
#include <glxuiutilities.rsg> |
|
66 |
#include <glxgeneraluiutilities.h> |
|
67 |
#include <glxtexturemanager.h> |
|
68 |
#include <glxicons.mbg> |
|
69 |
#include <glxsetappstate.h> |
|
70 |
#include <glxdrmutility.h> |
|
71 |
#include <glxscreenfurniture.h> |
|
72 |
#include "glxfullscreenviewimp.h" |
|
73 |
#include <glxnavigationalstate.h> |
|
74 |
#include <glxmedia.h> |
|
75 |
#include <glxnavigationalstate.h> |
|
76 |
#include <mpxcollectionpath.h> |
|
77 |
#include <glxcollectionpluginimageviewer.hrh> |
|
78 |
#include <glxuistd.h> |
|
79 |
#include "glxfullscreenbusyicon.h" |
|
80 |
||
81 |
using namespace Alf; |
|
82 |
||
83 |
const TInt KGlxScreenTimeout =10000000; |
|
84 |
const TInt KCoverflowDataWindowSize = 1; |
|
85 |
const TInt KGlxMaxSmallImageZoomLevel =150; |
|
86 |
const TInt KGlxMaxBigImageZoomLevel =100; |
|
87 |
const TInt KGlxMinSmallImageZoomLevel =100; |
|
88 |
const TInt KGlxNeutralPinchPosition =100; |
|
89 |
const TInt KGlxSliderTickValue =5; |
|
90 |
const TInt KGlxRealTruncationPadding =0.5; |
|
91 |
||
92 |
/** |
|
93 |
* Start Delay for the periodic timer, in microseconds |
|
94 |
*/ |
|
95 |
const TInt KPeriodicStartDelay = 250000; |
|
96 |
/** |
|
97 |
* Interval delay for the periodic timer, in microseconds |
|
98 |
*/ |
|
99 |
const TInt KPeriodicIntervalDelay = 500000; |
|
100 |
||
101 |
/** |
|
102 |
* Fullscreen texture offset |
|
103 |
*/ |
|
104 |
const TInt KTextureOffset = 2; |
|
105 |
||
106 |
// This constant is used to calculate the index of the item |
|
107 |
// for which texture has to removed. |
|
108 |
const TInt KFullScreenIterator = KTextureOffset + 1; |
|
109 |
||
110 |
// This constant is used to calculate the maximum number of fullscreen textures |
|
111 |
// needs to be updated during foreground event. |
|
112 |
const TInt KFullScreenTextureOffset = KFullScreenIterator + KTextureOffset; |
|
113 |
||
114 |
const TInt KGlxDecodingThreshold = 3000000; // pixels |
|
115 |
||
116 |
_LIT( KTfxResourceActivateFullScreen, "z:\\resource\\effects\\photos_fullscreen_open.fxml" ); |
|
117 |
_LIT( KTfxResourceNoEffect, ""); |
|
118 |
||
119 |
// ======== MEMBER FUNCTIONS ======== |
|
120 |
||
121 |
// --------------------------------------------------------------------------- |
|
122 |
// C++ default constructor can NOT contain any code, that |
|
123 |
// might leave. |
|
124 |
// --------------------------------------------------------------------------- |
|
125 |
// |
|
126 |
CGlxFullScreenViewImp::CGlxFullScreenViewImp( |
|
127 |
const TFullScreenViewResourceIds& aResourceIds, TInt aViewUID) : |
|
128 |
iResourceIds(aResourceIds), iViewUid(aViewUID) |
|
129 |
{ |
|
130 |
TRACER("CGlxFullScreenViewImp::CGlxFullScreenViewImp"); |
|
131 |
} |
|
132 |
||
133 |
// --------------------------------------------------------------------------- |
|
134 |
// Two-phased constructor. |
|
135 |
// --------------------------------------------------------------------------- |
|
136 |
// |
|
137 |
CGlxFullScreenViewImp* CGlxFullScreenViewImp::NewL( |
|
138 |
MGlxMediaListFactory* aMediaListFactory, |
|
139 |
const TFullScreenViewResourceIds& aResourceIds, |
|
140 |
TInt aViewUID, |
|
141 |
const TDesC& aTitle) |
|
142 |
{ |
|
143 |
TRACER("CGlxFullScreenViewImp::NewL"); |
|
144 |
CGlxFullScreenViewImp* self = CGlxFullScreenViewImp::NewLC ( |
|
145 |
aMediaListFactory, aResourceIds, aViewUID, aTitle); |
|
146 |
CleanupStack::Pop (self); |
|
147 |
return self; |
|
148 |
} |
|
149 |
||
150 |
// --------------------------------------------------------------------------- |
|
151 |
// Two-phased constructor. |
|
152 |
// --------------------------------------------------------------------------- |
|
153 |
// |
|
154 |
CGlxFullScreenViewImp* CGlxFullScreenViewImp::NewLC( |
|
155 |
MGlxMediaListFactory* aMediaListFactory, |
|
156 |
const TFullScreenViewResourceIds& aResourceIds, TInt aViewUID, |
|
157 |
const TDesC& aTitle) |
|
158 |
{ |
|
159 |
TRACER("CGlxFullScreenViewImp::NewLC"); |
|
160 |
CGlxFullScreenViewImp* self =new (ELeave) CGlxFullScreenViewImp(aResourceIds, aViewUID); |
|
161 |
CleanupStack::PushL (self); |
|
162 |
self->ConstructL (aMediaListFactory, aTitle); |
|
163 |
return self; |
|
164 |
} |
|
165 |
||
166 |
// --------------------------------------------------------------------------- |
|
167 |
// ConstructL. |
|
168 |
// --------------------------------------------------------------------------- |
|
169 |
// |
|
170 |
void CGlxFullScreenViewImp::ConstructL( |
|
171 |
MGlxMediaListFactory* aMediaListFactory, const TDesC& aTitle) |
|
172 |
{ |
|
173 |
TRACER("CGlxFullScreenViewImp::ConstructL"); |
|
174 |
BaseConstructL (iResourceIds.iViewId); |
|
175 |
ViewBaseConstructL(); |
|
176 |
MLViewBaseConstructL (aMediaListFactory, aTitle , EFalse); |
|
177 |
||
178 |
iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
|
179 |
//Register the view to recieve toolbar events. ViewBase handles the events |
|
180 |
SetToolbarObserver(this); |
|
181 |
iImgViewerMode = EFalse; |
|
182 |
//Disable the toolbar always while entering fullscreen |
|
183 |
EnableFSToolbar(EFalse); |
|
184 |
ShowToolbarOnViewActivation(EFalse); |
|
185 |
||
186 |
//Get the ScreenFurniture instance |
|
187 |
iScreenFurniture = iUiUtility->ScreenFurniture(); |
|
188 |
||
189 |
//Get the env from the uiutilities |
|
190 |
iEnv = iUiUtility->Env (); |
|
191 |
||
192 |
iZoomButtonGroup = CEikButtonGroupContainer::NewL( |
|
193 |
CEikButtonGroupContainer::ECba, // type |
|
194 |
CEikButtonGroupContainer::EHorizontal, // orientation |
|
195 |
this, // command observer |
|
196 |
R_GLX_FULLSCREEN_SOFTKEYS_ZOOM ); |
|
197 |
iZoomButtonGroup->MakeVisible( EFalse ); |
|
198 |
||
199 |
//create the drmutility instance |
|
200 |
iDrmUtility = CGlxDRMUtility::InstanceL(); |
|
201 |
// Get object that stores the active media list registry |
|
202 |
iActiveMediaListRegistry = CGlxActiveMediaListRegistry::InstanceL(); |
|
203 |
||
204 |
iIsDialogLaunched = EFalse; |
|
205 |
iIsMMCRemoved = EFalse; |
|
206 |
||
207 |
iMMCNotifier = CGlxMMCNotifier::NewL(*this); |
|
208 |
if(!iPeriodic) |
|
209 |
{ |
|
210 |
iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard); |
|
211 |
} |
|
212 |
iGlxTvOut = CGlxTv::NewL(*this); |
|
213 |
||
214 |
iNaviState = CGlxNavigationalState::InstanceL(); |
|
215 |
} |
|
216 |
||
217 |
// --------------------------------------------------------------------------- |
|
218 |
// ~CGlxFullScreenViewImp() |
|
219 |
// --------------------------------------------------------------------------- |
|
220 |
// |
|
221 |
CGlxFullScreenViewImp::~CGlxFullScreenViewImp() |
|
222 |
{ |
|
223 |
TRACER("CGlxFullScreenViewImp::~CGlxFullScreenViewImp"); |
|
224 |
if(iAlfEffectObs) |
|
225 |
{ |
|
226 |
delete iAlfEffectObs; |
|
227 |
} |
|
228 |
if(iMMCNotifier) |
|
229 |
{ |
|
230 |
delete iMMCNotifier; |
|
231 |
iMMCNotifier = NULL; |
|
232 |
} |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
233 |
|
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
234 |
if (iUri) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
235 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
236 |
delete iUri; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
237 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
238 |
|
60 | 239 |
if(iMediaListMulModelProvider) |
240 |
{ |
|
241 |
delete iMediaListMulModelProvider; |
|
242 |
} |
|
243 |
if(iTimer) |
|
244 |
{ |
|
245 |
if(iTimer->IsActive()) |
|
246 |
{ |
|
247 |
iTimer->Cancel(); |
|
248 |
} |
|
249 |
delete iTimer; |
|
250 |
} |
|
251 |
if(iZoomButtonGroup) |
|
252 |
{ |
|
253 |
AppUi()->RemoveFromStack( iZoomButtonGroup ); |
|
254 |
delete iZoomButtonGroup; |
|
255 |
} |
|
256 |
if(iGlxTvOut) |
|
257 |
{ |
|
258 |
delete iGlxTvOut; |
|
259 |
} |
|
260 |
if(iActiveMediaListRegistry) |
|
261 |
{ |
|
262 |
iActiveMediaListRegistry->Close(); |
|
263 |
} |
|
264 |
if( iDrmUtility ) |
|
265 |
{ |
|
266 |
iDrmUtility->Close(); |
|
267 |
} |
|
268 |
if (iPeriodic) |
|
269 |
{ |
|
270 |
iPeriodic->Cancel(); |
|
271 |
delete iPeriodic; |
|
272 |
} |
|
273 |
||
274 |
if (iNaviState) |
|
275 |
{ |
|
276 |
iNaviState->Close(); |
|
277 |
} |
|
278 |
} |
|
279 |
// --------------------------------------------------------------------------- |
|
280 |
// From CGlxViewBase |
|
281 |
// --------------------------------------------------------------------------- |
|
282 |
// |
|
283 |
TUid CGlxFullScreenViewImp::Id() const |
|
284 |
{ |
|
285 |
TRACER("CGlxFullScreenViewImp::Id"); |
|
286 |
return TUid::Uid(iViewUid); |
|
287 |
} |
|
288 |
||
289 |
||
290 |
// --------------------------------------------------------------------------- |
|
291 |
// Destroys a coverflow widget |
|
292 |
// --------------------------------------------------------------------------- |
|
293 |
// |
|
294 |
void CGlxFullScreenViewImp::DestroyWidgets() |
|
295 |
{ |
|
296 |
TRACER("CGlxFullScreenViewImp::DestroyCoverflowWidget"); |
|
297 |
if (iCoverFlowWidget) |
|
298 |
{ |
|
299 |
iCoverFlowWidget->RemoveEventHandler(*this); |
|
300 |
} |
|
301 |
// Destror Slider widget |
|
302 |
DestroySliderWidget(); |
|
303 |
||
304 |
delete iMediaListMulModelProvider; |
|
305 |
iMediaListMulModelProvider = NULL; |
|
306 |
||
307 |
IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*iEnv); |
|
308 |
// Destroying this widget calls destructor of single line meta pane |
|
309 |
widgetFactory.destroyWidget(iViewWidget); |
|
310 |
||
311 |
iCoverFlowWidget = NULL; |
|
312 |
iViewWidget = NULL; |
|
313 |
} |
|
314 |
||
315 |
// --------------------------------------------------------------------------- |
|
316 |
// Destroys a Slider widget |
|
317 |
// --------------------------------------------------------------------------- |
|
318 |
// |
|
319 |
void CGlxFullScreenViewImp::DestroySliderWidget() |
|
320 |
{ |
|
321 |
TRACER("CGlxFullScreenViewImp::DestroySliderWidget"); |
|
322 |
if(iSliderWidget) |
|
323 |
{ |
|
324 |
iSliderWidget->RemoveEventHandler(*this); |
|
325 |
} |
|
326 |
iSliderWidget = NULL; |
|
327 |
iSliderModel = NULL; |
|
328 |
} |
|
329 |
// --------------------------------------------------------------------------- |
|
330 |
// From CAknView |
|
331 |
// Handles a view activation. |
|
332 |
// --------------------------------------------------------------------------- |
|
333 |
// |
|
334 |
void CGlxFullScreenViewImp::DoMLViewActivateL( |
|
335 |
const TVwsViewId & /* aPrevViewId */, TUid /* aCustomMessageId */, |
|
336 |
const TDesC8 & /* aCustomMessage */) |
|
337 |
{ |
|
338 |
TRACER("CGlxFullScreenViewImp::DoMLViewActivateL"); |
|
339 |
||
340 |
// hide the toolbar |
|
341 |
EnableFSToolbar(EFalse); |
|
342 |
||
343 |
if (iMediaList->Count() == 0) |
|
344 |
{ |
|
345 |
GLX_LOG_INFO("CGlxFullScreenViewImp::DoMLViewActivateL() - No items!"); |
|
346 |
// While in slideshow from fullscreen view, |
|
347 |
// 1) Connect USB in mass storage mode or |
|
348 |
// 2) Delete items through file manager |
|
349 |
// shall result in activating fullscreen view with no items; so, goto grid view. |
|
350 |
iNaviState->ActivatePreviousViewL(); |
|
351 |
} |
|
352 |
else |
|
353 |
{ |
|
354 |
//fix for ESLM-7YYDXC: When in FullScreen View, view mode must be 'EView' |
|
355 |
//While coming back from SlideShow to FullScreen view, need to set view mode. |
|
356 |
if (iMediaList->Count() && iNaviState->ViewingMode() |
|
357 |
!= NGlxNavigationalState::EView) |
|
358 |
{ |
|
359 |
iNaviState->SetToViewMode(); |
|
360 |
} |
|
361 |
} |
|
362 |
||
363 |
CMPXCollectionPath* collPath = iNaviState->StateLC(); |
|
364 |
if (collPath->Id() == TMPXItemId( |
|
365 |
KGlxCollectionPluginImageViewerImplementationUid)) |
|
366 |
{ |
|
367 |
iImgViewerMode = ETrue; |
|
368 |
CreateImageViewerInstanceL(); |
|
369 |
} |
|
370 |
CleanupStack::PopAndDestroy(collPath); |
|
371 |
||
372 |
iScrnSize = iUiUtility->DisplaySize(); |
|
373 |
iGridIconSize = iUiUtility->GetGridIconSize(); |
|
374 |
||
375 |
iHdmiWidth = (iScrnSize.iWidth > iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight); |
|
376 |
iHdmiHeight = (iScrnSize.iWidth < iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight); |
|
377 |
||
378 |
//Create hdmicontroller when it is only launched from fullscreen. |
|
379 |
//From filemanager show only clone mode. |
|
380 |
iHdmiController = CGlxHdmiController::NewL(*this); |
|
381 |
||
382 |
if( !iImgViewerMode ) |
|
383 |
{ |
|
384 |
SetItemToHDMIL(); |
|
385 |
} |
|
386 |
iScreenFurniture->SetActiveView(iViewUid); |
|
387 |
||
388 |
//set the ui state to off,when the Fullscreen launches |
|
389 |
SetUiState(EUiOff); |
|
390 |
||
391 |
GlxSetAppState::SetState(EGlxInFullScreenView); |
|
392 |
||
393 |
// create the coverflow |
|
394 |
CreateCoverflowWidgetL(); |
|
395 |
||
396 |
CreateSliderWidgetL(); |
|
397 |
||
398 |
iBusyIcon = CGlxFullScreenBusyIcon::NewL(*iMediaList,*iUiUtility); |
|
399 |
// create a zoom control |
|
400 |
iZoomControl = CGlxZoomControl::NewL(*this, *iMediaList, |
|
401 |
*iZoomButtonGroup, *iSliderWidget, iGestureHelper); |
|
402 |
||
403 |
// hide the screen furniture |
|
404 |
HideUi(ETrue); |
|
405 |
// Set active media list pointer, so that UPnP renderer knows about this list |
|
406 |
iActiveMediaListRegistry->RegisterActiveMediaList(iMediaList); |
|
407 |
||
408 |
if ( !iPeriodic->IsActive() ) |
|
409 |
{ |
|
410 |
iPeriodic->Start(KPeriodicStartDelay, KPeriodicIntervalDelay, |
|
411 |
TCallBack(&PeriodicCallback, static_cast<TAny*> (this))); |
|
412 |
} |
|
413 |
||
414 |
//Set the animation effect for the coverflow widget since the animation |
|
415 |
//does not work for both avkon and alf together. This can be done since the |
|
416 |
//UI Screen furnitures are disabled by default while going to fullscreen. |
|
417 |
//Check if the transitions are enabled from themes |
|
418 |
if (CAknTransitionUtils::TransitionsEnabled( |
|
419 |
AknTransEffect::EFullScreenTransitionsOff)) |
|
420 |
{ |
|
421 |
if(!iAlfEffectObs) |
|
422 |
{ |
|
423 |
iAlfEffectObs = CAlfEffectObserver::NewL(); |
|
424 |
} |
|
425 |
const_cast<CAlfLayout&> (iCoverFlowWidget->ContainerLayout()).SetEffectL( |
|
426 |
KTfxResourceActivateFullScreen); |
|
427 |
iEffectHandle = iCoverFlowWidget->ContainerLayout().Identifier(); |
|
428 |
iAlfEffectObs->SubscribeCallbackL(this,iEffectHandle); |
|
429 |
} |
|
430 |
||
431 |
//Disable the status pane here as it causes flicker while animating |
|
432 |
CAknViewAppUi* appui = AppUi(); |
|
433 |
if ( appui ) |
|
434 |
{ |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
435 |
SetTitlePaneTextL(KNullDesC); |
60 | 436 |
appui->StatusPane()->MakeVisible(EFalse); |
437 |
appui->Cba()->MakeVisible(EFalse); |
|
438 |
} |
|
439 |
||
440 |
iViewWidget->show(true); |
|
441 |
} |
|
442 |
||
443 |
||
444 |
// --------------------------------------------------------------------------- |
|
445 |
// Creates a coverflow widget |
|
446 |
// --------------------------------------------------------------------------- |
|
447 |
// |
|
448 |
void CGlxFullScreenViewImp::CreateCoverflowWidgetL() |
|
449 |
{ |
|
450 |
TRACER("CGlxFullScreenViewImp::CreateCoverflowWidgetL"); |
|
451 |
||
452 |
const char* KWidgetName("mulcoverflowwidget"); |
|
453 |
const char* KCoverflowViewWidget("CoverflowViewWidget"); |
|
454 |
const char* KCoverflowWidget("CoverflowWidget"); |
|
455 |
try |
|
456 |
{ |
|
457 |
// Get widget factory from CAlfEnv |
|
458 |
// Factory is then used to create the individual widgets & data model |
|
459 |
||
460 |
IAlfWidgetFactory& widgetFactory = |
|
461 |
AlfWidgetEnvExtension::widgetFactory(*iEnv); |
|
462 |
||
463 |
// create a view widget |
|
464 |
iViewWidget = widgetFactory.createViewWidget(KCoverflowViewWidget, |
|
465 |
0x113); |
|
466 |
// hide control and status pane |
|
467 |
iViewWidget->enableControlPane(EFalse); |
|
468 |
iViewWidget->enableStatusPane(EFalse); |
|
469 |
iViewWidget->setRect(TRect(TPoint(0, 0), AlfUtil::ScreenSize())); |
|
470 |
// create coverflow widget |
|
471 |
iCoverFlowWidget = widgetFactory.createWidget<IMulCoverFlowWidget> ( |
|
472 |
KWidgetName, KCoverflowWidget, *iViewWidget, NULL); |
|
473 |
iCoverFlowWidget->SetFlags(IMulMultiItemWidget::EMulWidgetDoubleTap); |
|
474 |
||
475 |
// Widget takes the ownership |
|
476 |
iCoverFlowWidget->AddEventHandler(*this); |
|
477 |
||
478 |
iCoverFlowWidget->control()->AcquireFocus(); |
|
479 |
iMediaListMulModelProvider = CGlxMediaListMulModelProvider::NewL( |
|
480 |
*iEnv, *iCoverFlowWidget, *iMediaList, iFullScreenBindingSet, |
|
481 |
mulwidget::KTemplate4, KCoverflowDataWindowSize); |
|
482 |
||
483 |
iGestureHelper |
|
484 |
= (GestureHelper::CGestureHelper*) iCoverFlowWidget->Gesturehelper(); |
|
485 |
} |
|
486 |
catch(...) |
|
487 |
{ |
|
488 |
User::Leave(KErrGeneral); |
|
489 |
} |
|
490 |
||
491 |
} |
|
492 |
||
493 |
//---------------------------------------------------------------------------- |
|
494 |
//Initialise the slider widget and the slider model |
|
495 |
//---------------------------------------------------------------------------- |
|
496 |
// |
|
497 |
void CGlxFullScreenViewImp::CreateSliderWidgetL() |
|
498 |
{ |
|
499 |
const char* KSliderWidgetName("mulsliderwidget"); |
|
500 |
const char* KZoomSliderWidget("ZoomSliderWidget"); |
|
501 |
||
502 |
try |
|
503 |
{ |
|
504 |
IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*iEnv); |
|
505 |
||
506 |
iSliderWidget = widgetFactory.createWidget<IMulSliderWidget>( KSliderWidgetName, |
|
507 |
KZoomSliderWidget, *iViewWidget, NULL); |
|
508 |
||
509 |
iSliderWidget->AddEventHandler(*this); |
|
510 |
iSliderWidget->SetHandleKeyEvent(EFalse); |
|
511 |
iSliderModel = widgetFactory.createModel<IMulSliderModel> ("mulslidermodel"); |
|
512 |
iSliderModel->SetTemplate(ESliderTemplate3); |
|
513 |
iSliderWidget->setModel(iSliderModel); |
|
514 |
iSliderWidget->control()->disableState(IAlfWidgetControl::Focusable); |
|
515 |
||
516 |
//adding the range and slider tick value |
|
517 |
if(iSliderModel) |
|
518 |
{ |
|
519 |
iSliderModel->SetTick(KGlxSliderTickValue); |
|
520 |
} |
|
521 |
} |
|
522 |
catch(...) |
|
523 |
{ |
|
524 |
User::Leave(KErrGeneral); |
|
525 |
} |
|
526 |
} |
|
527 |
||
528 |
// --------------------------------------------------------------------------- |
|
529 |
// ShowUiL |
|
530 |
// --------------------------------------------------------------------------- |
|
531 |
// |
|
532 |
void CGlxFullScreenViewImp::ShowUiL(TBool aStartTimer) |
|
533 |
{ |
|
534 |
TRACER("CGlxFullScreenViewImp::ShowUiL"); |
|
535 |
if(CheckIfSliderToBeShownL()) |
|
536 |
{ |
|
537 |
//To set the Slider values. |
|
538 |
SetSliderToMin(); |
|
539 |
//show the slider |
|
540 |
iSliderWidget->ShowWidget(ETrue); |
|
541 |
} |
|
542 |
else |
|
543 |
{ |
|
544 |
//hide slider if UI is needed to be on and HDMI is Connected |
|
545 |
iSliderWidget->ShowWidget(EFalse); |
|
546 |
} |
|
547 |
||
548 |
if (iCoverFlowWidget) |
|
549 |
{ |
|
550 |
// This is done to set the item counter |
|
551 |
iCoverFlowWidget->SetUIMode(ETrue); |
|
552 |
} |
|
553 |
||
554 |
//Since the toolbar should not be present for ImageViewer. |
|
555 |
if(!iImgViewerMode) |
|
556 |
{ |
|
557 |
//show the toolbar |
|
558 |
EnableFSToolbar(ETrue); |
|
559 |
} |
|
560 |
||
561 |
// For floating toolbar in non-touch devices |
|
562 |
iScreenFurniture->SetToolbarVisibility(ETrue); |
|
563 |
||
564 |
//show the softkeys |
|
565 |
CEikButtonGroupContainer* cba = Cba(); |
|
566 |
cba->SetCommandSetL( R_GLX_FULLSCREEN_SOFTKEYS ); |
|
567 |
cba->MakeVisible( ETrue ); |
|
568 |
cba->DrawNow(); |
|
569 |
||
570 |
//set the ui state to On |
|
571 |
SetUiState(EUiOn); |
|
572 |
||
573 |
//start the timer,for the screen timeout |
|
574 |
iTimer->Cancel(); |
|
575 |
if(aStartTimer) |
|
576 |
{ |
|
577 |
iTimer->Start(KGlxScreenTimeout,KGlxScreenTimeout,TCallBack( TimeOut,this )); |
|
578 |
} |
|
579 |
} |
|
580 |
||
581 |
// --------------------------------------------------------------------------- |
|
582 |
// HideUi |
|
583 |
// --------------------------------------------------------------------------- |
|
584 |
// |
|
585 |
void CGlxFullScreenViewImp::HideUi(TBool aHideSlider) |
|
586 |
{ |
|
587 |
TRACER("CGlxFullScreenViewImp::HideUi"); |
|
588 |
//cancel the timer |
|
589 |
iTimer->Cancel(); |
|
590 |
||
591 |
// For floating toolbar in non-touch devices |
|
592 |
iScreenFurniture->SetToolbarVisibility(EFalse); |
|
593 |
||
594 |
// hide/show the slider |
|
595 |
if(iSliderWidget) |
|
596 |
{ |
|
597 |
iSliderWidget->ShowWidget(!aHideSlider); |
|
598 |
} |
|
599 |
||
600 |
if (iCoverFlowWidget) |
|
601 |
{ |
|
602 |
iCoverFlowWidget->SetUIMode(EFalse); |
|
603 |
} |
|
604 |
||
605 |
//Since the toolbar should not be present for ImageViewer. |
|
606 |
if(!iImgViewerMode) |
|
607 |
{ |
|
608 |
// hide the toolbar |
|
609 |
CAknToolbar* toolbar = Toolbar(); |
|
610 |
if(toolbar) |
|
611 |
{ |
|
612 |
toolbar->SetToolbarVisibility(EFalse); |
|
613 |
} |
|
614 |
} |
|
615 |
||
616 |
// hide the softkeys |
|
617 |
Cba()->MakeVisible( EFalse ); |
|
618 |
Cba()->DrawNow(); |
|
619 |
||
620 |
// set the ui state to On |
|
621 |
SetUiState(EUiOff); |
|
622 |
} |
|
623 |
||
624 |
// --------------------------------------------------------------------------- |
|
625 |
// SetUiState |
|
626 |
// --------------------------------------------------------------------------- |
|
627 |
// |
|
628 |
void CGlxFullScreenViewImp::SetUiState (TUiState aState) |
|
629 |
{ |
|
630 |
TRACER("CGlxFullScreenViewImp::SetUiState"); |
|
631 |
iUiState = aState; |
|
632 |
} |
|
633 |
||
634 |
// --------------------------------------------------------------------------- |
|
635 |
// GetUiState |
|
636 |
// --------------------------------------------------------------------------- |
|
637 |
// |
|
638 |
TUiState CGlxFullScreenViewImp::GetUiState() |
|
639 |
{ |
|
640 |
TRACER("CGlxFullScreenViewImp::GetUiState"); |
|
641 |
return iUiState; |
|
642 |
} |
|
643 |
||
644 |
// --------------------------------------------------------------------------- |
|
645 |
// TimeOut |
|
646 |
// --------------------------------------------------------------------------- |
|
647 |
// |
|
648 |
TInt CGlxFullScreenViewImp::TimeOut(TAny* aSelf) |
|
649 |
{ |
|
650 |
TRACER("CGlxFullScreenViewImp::TimeOut"); |
|
651 |
if(aSelf) |
|
652 |
{ |
|
653 |
CGlxFullScreenViewImp* self = static_cast <CGlxFullScreenViewImp*> (aSelf); |
|
654 |
if (self) |
|
655 |
{ |
|
656 |
if ( EUiOn == self->GetUiState()) |
|
657 |
{ |
|
658 |
// After time out, hide UI only when menu is not being displayed. |
|
659 |
if( self->MenuBar() && !(self->MenuBar()->IsDisplayed()) ) |
|
660 |
{ |
|
661 |
self->HideUi(ETrue); |
|
662 |
} |
|
663 |
} |
|
664 |
} |
|
665 |
} |
|
666 |
return KErrNone; |
|
667 |
} |
|
668 |
||
669 |
// --------------------------------------------------------------------------- |
|
670 |
//DeactivateFullScreen function. |
|
671 |
// --------------------------------------------------------------------------- |
|
672 |
// |
|
673 |
void CGlxFullScreenViewImp::DeactivateFullScreen() |
|
674 |
{ |
|
675 |
TRACER("CGlxFullScreenViewImp::DeactivateFullScreen"); |
|
676 |
if (iCoverFlowWidget) |
|
677 |
{ |
|
678 |
iCoverFlowWidget->RemoveEventHandler(*this); |
|
679 |
iCoverFlowWidget->ShowWidget(EFalse); |
|
680 |
} |
|
681 |
if(iSliderWidget) |
|
682 |
{ |
|
683 |
iSliderWidget->RemoveEventHandler(*this); |
|
684 |
||
685 |
//show/hide the slider based on the return value of |
|
686 |
//IsHidden() |
|
687 |
if(iZoomControl->Activated()) |
|
688 |
{ |
|
689 |
HideUi(iSliderWidget->IsHidden()); |
|
690 |
} |
|
691 |
} |
|
692 |
} |
|
693 |
||
694 |
// --------------------------------------------------------------------------- |
|
695 |
//ActivateFullScreen function. |
|
696 |
// --------------------------------------------------------------------------- |
|
697 |
// |
|
698 |
void CGlxFullScreenViewImp::ActivateFullScreenL() |
|
699 |
{ |
|
700 |
TRACER("CGlxFullScreenViewImp::ActivateFullScreenL"); |
|
701 |
||
702 |
if (iCoverFlowWidget) |
|
703 |
{ |
|
704 |
iCoverFlowWidget->AddEventHandler(*this); |
|
705 |
iCoverFlowWidget->ShowWidget(ETrue); |
|
706 |
} |
|
707 |
if(iSliderWidget) |
|
708 |
{ |
|
709 |
iSliderWidget->AddEventHandler(*this); |
|
710 |
} |
|
711 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
712 |
GlxSetAppState::SetState(EGlxInFullScreenView); |
|
713 |
} |
|
714 |
||
715 |
// --------------------------------------------------------------------------- |
|
716 |
//ActivateZoomControl function. |
|
717 |
// --------------------------------------------------------------------------- |
|
718 |
// |
|
719 |
void CGlxFullScreenViewImp::ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* apZoomFocus) |
|
720 |
{ |
|
721 |
TRACER("CGlxFullScreenViewImp::ActivateZoomControlL"); |
|
722 |
/* |
|
723 |
* We will not do any zoom while HDMI is connected. |
|
724 |
* This is as part of HDMI improvements. |
|
725 |
*/ |
|
726 |
if (iHdmiController && iHdmiController->IsHDMIConnected()) |
|
727 |
{ |
|
728 |
// Hide zoom slider in HDMI mode as Zoom is disable. |
|
729 |
// Let the other screen furnitures intact. |
|
730 |
iSliderWidget->ShowWidget( EFalse); |
|
731 |
return; |
|
732 |
} |
|
733 |
TInt focus = iMediaList->FocusIndex(); |
|
734 |
TGlxMedia item = iMediaList->Item( focus ); |
|
735 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail); |
|
736 |
||
737 |
// Check if DRM rights expired for a specific media item |
|
738 |
TBool isDrmRightsValid = ETrue; |
|
739 |
if(item.IsDrmProtected()) |
|
740 |
{ |
|
741 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
742 |
{ |
|
743 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
744 |
iImageViewerInstance->ImageFileHandle(), (item.Category() |
|
745 |
== EMPXImage)); |
|
746 |
} |
|
747 |
else |
|
748 |
{ |
|
749 |
//Since it is always for the focused item - use DisplayItemRightsCheckL |
|
750 |
//instead of ItemRightsValidityCheckL |
|
751 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
752 |
item.Uri(), (item.Category() == EMPXImage)); |
|
753 |
} |
|
754 |
} |
|
755 |
// Activate Zoom if the item is an image and its DRM rights is not expired |
|
756 |
if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid) |
|
757 |
{ |
|
758 |
if(iZoomControl && !iZoomControl->Activated()) |
|
759 |
{ |
|
760 |
if(iHdmiController) |
|
761 |
{ |
|
762 |
TBool autoZoomOut = ETrue; |
|
763 |
//Set autozoomout to false in pinch zoom, since we would be |
|
764 |
//zooming out on deactivate once we get the release event. |
|
765 |
if(aStartMode == EZoomStartPinch) |
|
766 |
{ |
|
767 |
autoZoomOut = EFalse; |
|
768 |
} |
|
769 |
||
770 |
iHdmiController->ActivateZoom(autoZoomOut); |
|
771 |
} |
|
772 |
||
773 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider MaxRange = %d ", iSliderModel->MaxRange() ); |
|
774 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider MinRange = %d ", iSliderModel->MinRange() ); |
|
775 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider PrimaryValue= %d", iSliderModel->PrimaryValue() ); |
|
776 |
||
777 |
if (aStartMode == EZoomStartSlider) |
|
778 |
{ |
|
779 |
iZoomControl->ActivateL(iSliderModel->PrimaryValue(),aStartMode, focus, |
|
780 |
item, apZoomFocus,iImgViewerMode); |
|
781 |
} |
|
782 |
else |
|
783 |
{ |
|
784 |
iZoomControl->ActivateL(GetInitialZoomLevel(),aStartMode, focus, |
|
785 |
item, apZoomFocus,iImgViewerMode); |
|
786 |
} |
|
787 |
// Now to remove all textures other than the one we are focussing on. |
|
788 |
TInt frameCount = KErrNone; |
|
789 |
item.GetFrameCount(frameCount); |
|
790 |
// If .gif file, then only call stopanimation |
|
791 |
if (frameCount > 1) |
|
792 |
{ |
|
793 |
iUiUtility->GlxTextureManager().AnimateMediaItem( |
|
794 |
item.Id(), EFalse); |
|
795 |
} |
|
796 |
TInt count = iMediaList->Count(); |
|
797 |
while (count > 0) |
|
798 |
{ |
|
799 |
TGlxMedia mediaItem = iMediaList->Item(count-1); |
|
800 |
if (mediaItem.Id() != item.Id() ) |
|
801 |
{ |
|
802 |
iUiUtility->GlxTextureManager().RemoveTexture(mediaItem.Id(),EFalse); |
|
803 |
} |
|
804 |
count--; |
|
805 |
} |
|
806 |
} |
|
807 |
else |
|
808 |
{ |
|
809 |
return; |
|
810 |
} |
|
811 |
DeactivateFullScreen(); |
|
812 |
GlxSetAppState::SetState(EGlxInZoomedView); |
|
813 |
} |
|
814 |
} |
|
815 |
||
816 |
// --------------------------------------------------------------------------- |
|
817 |
//DeactivateZoomControl function. |
|
818 |
// --------------------------------------------------------------------------- |
|
819 |
// |
|
820 |
void CGlxFullScreenViewImp::DeactivateZoomControlL() |
|
821 |
{ |
|
822 |
TRACER("CGlxFullScreenViewImp::DeactivateZoomControlL"); |
|
823 |
ActivateFullScreenL(); |
|
824 |
UpdateItems(); |
|
825 |
//Deactivate HDMI controller for zoom out while pinch zooming. |
|
826 |
if(iHdmiController) |
|
827 |
{ |
|
828 |
iHdmiController->DeactivateZoom(); |
|
829 |
} |
|
830 |
if(iZoomControl->Activated()) |
|
831 |
{ |
|
832 |
iZoomControl->Deactivate(); |
|
833 |
} |
|
834 |
if (iMediaList->FocusIndex() != KErrNotFound) |
|
835 |
{ |
|
836 |
TGlxMedia item = iMediaList->Item(iMediaList->FocusIndex()); |
|
837 |
TInt frameCount = KErrNone; |
|
838 |
item.GetFrameCount(frameCount); |
|
839 |
// If .gif file, then only call start animation |
|
840 |
if (frameCount > 1) |
|
841 |
{ |
|
842 |
iUiUtility->GlxTextureManager().AnimateMediaItem( |
|
843 |
item.Id(), ETrue); |
|
844 |
} |
|
845 |
} |
|
846 |
||
847 |
SetSliderToMin(); |
|
848 |
//check if the slider is already visible in zoom view. |
|
849 |
//if yes then do not disable the slider. |
|
850 |
TBool sliderInvisible = ETrue; |
|
851 |
if (EUiOn == iZoomControl->ZoomUiState()) |
|
852 |
{ |
|
853 |
sliderInvisible = EFalse; |
|
854 |
} |
|
855 |
||
856 |
HideUi(sliderInvisible); |
|
857 |
||
858 |
if (!sliderInvisible) |
|
859 |
{ |
|
860 |
//Set the UI State to On Explicitly since the slider is ON and we have |
|
861 |
//to disable on timeout. The timer is already cancelled in HideUi(). |
|
862 |
SetUiState(EUiOn); |
|
863 |
iTimer->Start(KGlxScreenTimeout,KGlxScreenTimeout,TCallBack( TimeOut,this )); |
|
864 |
} |
|
865 |
} |
|
866 |
||
867 |
// --------------------------------------------------------------------------- |
|
868 |
// From CAknView |
|
869 |
// View deactivation function. |
|
870 |
// --------------------------------------------------------------------------- |
|
871 |
// |
|
872 |
void CGlxFullScreenViewImp::DoMLViewDeactivate() |
|
873 |
{ |
|
874 |
TRACER("CGlxFullScreenViewImp::DoMLViewDeactivate"); |
|
875 |
//Disabling the toolbar here since it would give a crash when |
|
876 |
//we try to enable the toolbar in activate without exiting photos. |
|
877 |
if(!iImgViewerMode) |
|
878 |
{ |
|
879 |
// hide the toolbar |
|
880 |
EnableFSToolbar(EFalse); |
|
881 |
||
882 |
//Setting Soft key to EmptySoftKeys would cause crash |
|
883 |
//When Fullscreen is opened from ImageViewer. |
|
884 |
//And also, when Photos exits from FullScreen View. |
|
885 |
//So Set Soft Keys to empty only when not in Image Viewer mode |
|
886 |
//& Photos is not exiting. |
|
887 |
if( !iUiUtility->IsExitingState() ) |
|
888 |
{ |
|
889 |
CEikButtonGroupContainer* cba = Cba(); |
|
890 |
TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) ); |
|
891 |
cba->DrawNow(); |
|
892 |
} |
|
893 |
} |
|
894 |
else |
|
895 |
{ |
|
896 |
DeleteImageViewerInstance(); |
|
897 |
} |
|
898 |
||
899 |
HideUi(ETrue); |
|
900 |
// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. |
|
901 |
// So we do the below trick. The SK overlap is still there but much much less noticable. |
|
902 |
CCoeEnv::Static()->WsSession().Flush(); |
|
903 |
||
904 |
//Clear the last uri for which DRM Rights were consumed before going back to grid view |
|
905 |
//since the GridView::Activate() and FullScreen::DeActivate() can be called in any order, |
|
906 |
//this call is being made to be on safer side |
|
907 |
iDrmUtility->ClearLastConsumedItemUriL(); |
|
908 |
iScreenFurniture->ViewDeactivated(iViewUid); |
|
909 |
iImgViewerMode = EFalse; |
|
910 |
if (iHdmiController) |
|
911 |
{ |
|
912 |
delete iHdmiController; |
|
913 |
iHdmiController = NULL; |
|
914 |
} |
|
915 |
||
916 |
if(iZoomControl) |
|
917 |
{ |
|
918 |
if(iZoomControl->Activated()) |
|
919 |
{ |
|
920 |
iZoomControl->Deactivate(); |
|
921 |
} |
|
922 |
delete iZoomControl; |
|
923 |
iZoomControl = NULL; |
|
924 |
} |
|
925 |
DestroyWidgets(); |
|
926 |
iTimer->Cancel(); |
|
927 |
// Deregister active media list pointer |
|
928 |
iActiveMediaListRegistry->DeregisterActiveMediaList(iMediaList); |
|
929 |
||
930 |
/* |
|
931 |
* safe code-- if user press back very quickly |
|
932 |
* cancelling the timer while going back to prev view |
|
933 |
*/ |
|
934 |
if (iPeriodic->IsActive()) |
|
935 |
{ |
|
936 |
iPeriodic->Cancel(); |
|
937 |
} |
|
938 |
||
939 |
} |
|
940 |
// --------------------------------------------------------------------------- |
|
941 |
// Foreground event handling function. |
|
942 |
// --------------------------------------------------------------------------- |
|
943 |
// |
|
944 |
void CGlxFullScreenViewImp::HandleForegroundEventL(TBool aForeground) |
|
945 |
{ |
|
946 |
TRACER("CGlxFullScreenViewImp::HandleForegroundEventL"); |
|
947 |
CAknView::HandleForegroundEventL(aForeground); |
|
948 |
||
949 |
iUiUtility->SetForegroundStatus(aForeground); |
|
950 |
||
951 |
if(iMMCState) |
|
952 |
{ |
|
953 |
iMMCState =EFalse; |
|
954 |
NavigateToMainListL(); |
|
955 |
} |
|
956 |
||
957 |
if(iZoomControl && iZoomControl->Activated()) |
|
958 |
{ |
|
959 |
iZoomControl->HandleZoomForegroundEvent(aForeground); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
960 |
if (aForeground && iUri && !ConeUtils::FileExists(iUri->Des())) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
961 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
962 |
GLX_LOG_INFO("File does not exist, Exit zoom view!"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
963 |
HandleItemRemovedL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
964 |
} |
60 | 965 |
} |
966 |
||
967 |
if (!aForeground) |
|
968 |
{ |
|
969 |
if(iHdmiController) |
|
970 |
{ |
|
971 |
iHdmiController->ShiftToCloningMode(); |
|
972 |
} |
|
973 |
iUiUtility->GlxTextureManager().FlushTextures(); |
|
974 |
} |
|
975 |
else |
|
976 |
{ |
|
977 |
if (iMediaList) |
|
978 |
{ |
|
979 |
/** if there is no image to show go back to the previous view */ |
|
980 |
if (!iMediaList->Count() && iNaviState->ViewingMode() |
|
981 |
== NGlxNavigationalState::EView) |
|
982 |
{ |
|
983 |
iUiUtility->SetViewNavigationDirection( |
|
984 |
EGlxNavigationBackwards); |
|
985 |
iNaviState->ActivatePreviousViewL(); |
|
986 |
} |
|
987 |
else if (iMediaListMulModelProvider) |
|
988 |
{ |
|
989 |
UpdateItems(); |
|
990 |
||
991 |
if (iHdmiController) |
|
992 |
{ |
|
993 |
iHdmiController->ShiftToPostingMode(); |
|
994 |
} |
|
995 |
} |
|
996 |
} |
|
997 |
} |
|
998 |
} |
|
999 |
||
1000 |
||
1001 |
// --------------------------------------------------------------------------- |
|
1002 |
// From IAlfWidgetEventHandler.. |
|
1003 |
// --------------------------------------------------------------------------- |
|
1004 |
// |
|
1005 |
bool CGlxFullScreenViewImp::accept( CAlfWidgetControl& /*aControl*/, |
|
1006 |
const TAlfEvent& /*aEvent*/) const |
|
1007 |
{ |
|
1008 |
TRACER("CGlxFullScreenViewImp::accept()"); |
|
1009 |
return ETrue; |
|
1010 |
} |
|
1011 |
||
1012 |
// --------------------------------------------------------------------------- |
|
1013 |
// From IAlfWidgetEventHandler.. |
|
1014 |
// --------------------------------------------------------------------------- |
|
1015 |
// |
|
1016 |
AlfEventStatus CGlxFullScreenViewImp::offerEvent( |
|
1017 |
CAlfWidgetControl& /*aControl*/, const TAlfEvent& aEvent) |
|
1018 |
{ |
|
1019 |
TRACER("CGlxFullScreenViewImp::offerEvent"); |
|
1020 |
// The below function call will not add any values except |
|
1021 |
// to reduce the codescanner warnings to one |
|
1022 |
return OfferEventL(aEvent); |
|
1023 |
} |
|
1024 |
||
1025 |
// --------------------------------------------------------------------------- |
|
1026 |
// OfferEventL() |
|
1027 |
// --------------------------------------------------------------------------- |
|
1028 |
// |
|
1029 |
AlfEventStatus CGlxFullScreenViewImp::OfferEventL(const TAlfEvent& aEvent) |
|
1030 |
{ |
|
1031 |
TRACER("CGlxFullScreenViewImp::offerEventL"); |
|
1032 |
if ( aEvent.IsKeyEvent()) |
|
1033 |
{ |
|
1034 |
switch ( aEvent.KeyEvent().iScanCode ) |
|
1035 |
{ |
|
1036 |
case EStdKeyNkpAsterisk : |
|
1037 |
if(iUiUtility->IsPenSupported()) |
|
1038 |
{ |
|
1039 |
return EEventNotHandled; |
|
1040 |
} |
|
1041 |
case EStdKeyIncVolume : |
|
1042 |
//Listen EStdKeyApplicationD as EKeyZoomIn key is mapped to TKeyCode:: |
|
1043 |
//EKeyApplicationC for which TStdScancode is EStdKeyApplicatoinC |
|
1044 |
case EStdKeyApplicationC: |
|
1045 |
{ |
|
1046 |
if(EEventKeyDown == aEvent.Code()) |
|
1047 |
{ |
|
1048 |
HideUi(EFalse); |
|
1049 |
TRAP_IGNORE( ActivateZoomControlL(EZoomStartKey)); |
|
1050 |
return EEventConsumed; |
|
1051 |
} |
|
1052 |
} |
|
1053 |
case EStdKeyUpArrow: |
|
1054 |
case EStdKeyDownArrow: |
|
1055 |
case EStdKeyDevice0: |
|
1056 |
case EStdKeyDevice1: |
|
1057 |
//Listen EStdKeyApplicationC as EKeyZoomOut key is mapped to TKeyCode:: |
|
1058 |
//EKeyApplicationD for which TStdScancode is EStdKeyApplicatoinD |
|
1059 |
case EStdKeyApplicationD: |
|
1060 |
{ |
|
1061 |
if ( EUiOff == GetUiState()&& ( |
|
1062 |
aEvent.Code() == EEventKey ) ) |
|
1063 |
{ |
|
1064 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1065 |
ShowUiL(ETrue); |
|
1066 |
} |
|
1067 |
return EEventHandled; |
|
1068 |
} |
|
1069 |
case EStdKeyLeftArrow: |
|
1070 |
case EStdKeyRightArrow: |
|
1071 |
{ |
|
1072 |
if ( EUiOn == GetUiState() ) |
|
1073 |
{ |
|
1074 |
HideUi(ETrue); |
|
1075 |
} |
|
1076 |
return EEventHandled; |
|
1077 |
} |
|
1078 |
case EStdKeyApplication1C: |
|
1079 |
{ |
|
1080 |
if(iUiUtility->IsPenSupported()) |
|
1081 |
{ |
|
1082 |
return EEventNotHandled; |
|
1083 |
} |
|
1084 |
else |
|
1085 |
{ |
|
1086 |
ProcessCommandL(KGlxCmdMnShowMap); |
|
1087 |
return EEventHandled; |
|
1088 |
} |
|
1089 |
} |
|
1090 |
default: |
|
1091 |
return EEventNotHandled; |
|
1092 |
} |
|
1093 |
} |
|
1094 |
if(!aEvent.IsCustomEvent()) |
|
1095 |
{ |
|
1096 |
GLX_LOG_INFO("Event Not Handled"); |
|
1097 |
return EEventNotHandled; |
|
1098 |
} |
|
1099 |
||
1100 |
if(aEvent.IsCustomEvent()) |
|
1101 |
{ |
|
1102 |
TInt eventId = aEvent.CustomParameter(); |
|
1103 |
||
1104 |
switch(eventId) |
|
1105 |
{ |
|
1106 |
case KAlfActionIdDeviceLayoutChanged: |
|
1107 |
{ |
|
1108 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
1109 |
||
1110 |
iScreenFurniture->SetToolbarPosition(); |
|
1111 |
||
1112 |
return EEventNotHandled; |
|
1113 |
} |
|
1114 |
case ETypeSelect: |
|
1115 |
{ |
|
1116 |
TBool pensupport = iUiUtility->IsPenSupported(); |
|
1117 |
if ( pensupport ) |
|
1118 |
{ |
|
1119 |
if ( EUiOn == GetUiState() ) |
|
1120 |
{ |
|
1121 |
//Hide the slider |
|
1122 |
HideUi(ETrue); |
|
1123 |
} |
|
1124 |
else |
|
1125 |
{ |
|
1126 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1127 |
ShowUiL(ETrue); |
|
1128 |
} |
|
1129 |
} |
|
1130 |
else |
|
1131 |
{ |
|
1132 |
if ( EUiOff == GetUiState() ) |
|
1133 |
{ |
|
1134 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1135 |
ShowUiL(ETrue); |
|
1136 |
} |
|
1137 |
} |
|
1138 |
} |
|
1139 |
break; |
|
1140 |
||
1141 |
case ETypeRemove: |
|
1142 |
{ |
|
1143 |
// If From photos, delete the img. |
|
1144 |
// If Image-Viewer collection and not in private Path |
|
1145 |
// handle the "C" or BackSpace key to delete the item |
|
1146 |
if (!iImgViewerMode || (iImageViewerInstance |
|
1147 |
&& !iImageViewerInstance->IsPrivate())) |
|
1148 |
{ |
|
1149 |
ProcessCommandL(EGlxCmdDelete); |
|
1150 |
return EEventConsumed; |
|
1151 |
} |
|
1152 |
return EEventNotHandled; |
|
1153 |
} |
|
1154 |
case ETypeDoubleTap: |
|
1155 |
{ |
|
1156 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeDoubleTap"); |
|
1157 |
||
1158 |
MulDoubleTapData* DoubleTapData = (MulDoubleTapData*)(aEvent.CustomEventData()); |
|
1159 |
TPoint doubleTapPoint = DoubleTapData->mDoubleTapPoint; |
|
1160 |
TInt focus = iMediaList->FocusIndex(); |
|
1161 |
TGlxMedia item = iMediaList->Item( focus ); |
|
1162 |
TSize size; |
|
1163 |
item.GetDimensions( size ); |
|
1164 |
TRect rect = AlfUtil::ScreenSize(); |
|
1165 |
TInt zoomLevel = GetInitialZoomLevel(); |
|
1166 |
TInt tlX = (rect.Width() - (size.iWidth*zoomLevel)/100)/2; |
|
1167 |
TInt tlY = (rect.Height() - (size.iHeight*zoomLevel)/100)/2; |
|
1168 |
TRect imageRect(TPoint(tlX, tlY), TSize((size.iWidth*zoomLevel)/100, (size.iHeight*zoomLevel)/100)); |
|
1169 |
if (imageRect.Contains(doubleTapPoint)) |
|
1170 |
{ |
|
1171 |
SetSliderToMin(); |
|
1172 |
TRAP_IGNORE( ActivateZoomControlL(EZoomStartDoubleTap, &doubleTapPoint) ); |
|
1173 |
} |
|
1174 |
return EEventConsumed; |
|
1175 |
} |
|
1176 |
case ETypeItemRemoved: |
|
1177 |
{ |
|
1178 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeItemRemoved"); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1179 |
HandleItemRemovedL(); |
60 | 1180 |
return EEventConsumed; |
1181 |
} |
|
1182 |
case ETypeHighlight: |
|
1183 |
{ |
|
1184 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeHighlight"); |
|
1185 |
iMediaList->SetFocusL( NGlxListDefs::EAbsolute,(aEvent.CustomEventData())); |
|
1186 |
if (AknLayoutUtils::PenEnabled()) |
|
1187 |
{ |
|
1188 |
iMediaList->SetVisibleWindowIndexL(aEvent.CustomEventData()); |
|
1189 |
} |
|
1190 |
if(iMediaList->Count()> KFullScreenTextureOffset) |
|
1191 |
{ |
|
1192 |
RemoveTexture(); |
|
1193 |
} |
|
1194 |
SetItemToHDMIL(); |
|
1195 |
if ( EUiOn == GetUiState() ) |
|
1196 |
{ |
|
1197 |
HideUi(ETrue); |
|
1198 |
} |
|
1199 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
|
1200 |
return EEventConsumed; |
|
1201 |
} |
|
1202 |
case EVideoIconSelect: |
|
1203 |
{ |
|
1204 |
TGlxMedia item = iMediaList->Item( iMediaList->FocusIndex() ); |
|
1205 |
if(item.Category() == EMPXVideo) |
|
1206 |
{ |
|
1207 |
ProcessCommandL(EGlxCmdPlay); |
|
1208 |
iViewWidget->show(false); |
|
1209 |
} |
|
1210 |
else |
|
1211 |
{ |
|
1212 |
if ( EUiOn == GetUiState() ) |
|
1213 |
{ |
|
1214 |
HideUi(ETrue); |
|
1215 |
} |
|
1216 |
else |
|
1217 |
{ |
|
1218 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1219 |
ShowUiL(ETrue); |
|
1220 |
} |
|
1221 |
} |
|
1222 |
} |
|
1223 |
break; |
|
1224 |
//Zoom Start via pinch |
|
1225 |
case ETypePinch: |
|
1226 |
// Handle only a pinch out. not a pinch in. |
|
1227 |
if (KGlxNeutralPinchPosition < aEvent.CustomEventData()) |
|
1228 |
{ |
|
1229 |
SetSliderToMin(); |
|
1230 |
TRAP_IGNORE( ActivateZoomControlL(EZoomStartPinch)); |
|
1231 |
} |
|
1232 |
return EEventConsumed; // will be consumed even if we are pinching IN (trying to zoom OUT). |
|
1233 |
//slider event handling |
|
1234 |
case ETypePrimaryValueChange: |
|
1235 |
{ |
|
1236 |
iTimer->Cancel(); |
|
1237 |
iSliderWidget->ShowWidget( ETrue, 0 ); |
|
1238 |
TRAPD( err, ActivateZoomControlL(EZoomStartSlider)); |
|
1239 |
if (err != KErrNone) |
|
1240 |
{ |
|
1241 |
iSliderModel->SetPrimaryValue(GetInitialZoomLevel()); |
|
1242 |
} |
|
1243 |
} |
|
1244 |
return EEventConsumed; |
|
1245 |
default: |
|
1246 |
return EEventNotHandled; |
|
1247 |
} |
|
1248 |
} |
|
1249 |
return EEventNotHandled; |
|
1250 |
} |
|
1251 |
// --------------------------------------------------------------------------- |
|
1252 |
// From HandleViewCommandL.. |
|
1253 |
// --------------------------------------------------------------------------- |
|
1254 |
// |
|
1255 |
TBool CGlxFullScreenViewImp::HandleViewCommandL(TInt aCommand) |
|
1256 |
{ |
|
1257 |
TRACER("GCGlxFullScreenViewImp::HandleViewCommandL"); |
|
1258 |
//size calculated for rotation |
|
1259 |
TSize size = iUiUtility->GetRotatedImageSize(); // ViewBase iUiUtility is use |
|
1260 |
TBool consumed = EFalse; |
|
1261 |
switch (aCommand) |
|
1262 |
{ |
|
1263 |
case EGlxCmdResetView: |
|
1264 |
{ |
|
1265 |
HideUi(ETrue); |
|
1266 |
if (iIsDialogLaunched && iIsMMCRemoved) |
|
1267 |
{ |
|
1268 |
ProcessCommandL(EAknSoftkeyExit); |
|
1269 |
} |
|
1270 |
consumed = ETrue; |
|
1271 |
iIsDialogLaunched = EFalse; |
|
1272 |
break; |
|
1273 |
} |
|
1274 |
case EGlxCmdFullScreenBack: |
|
1275 |
DeactivateZoomControlL(); |
|
1276 |
//Show the screen furniture when we press back from zoom |
|
1277 |
ShowUiL(ETrue); |
|
1278 |
consumed = ETrue; |
|
1279 |
break; |
|
1280 |
case EGlxCmdRenameCompleted: |
|
1281 |
{ |
|
1282 |
SetItemToHDMIL(); |
|
1283 |
consumed = ETrue; |
|
1284 |
break; |
|
1285 |
} |
|
1286 |
case EGlxCmdDialogLaunched: |
|
1287 |
{ |
|
1288 |
iIsDialogLaunched = ETrue; |
|
1289 |
break; |
|
1290 |
} |
|
1291 |
case EGlxCmdDialogDismissed: |
|
1292 |
{ |
|
1293 |
if (iIsDialogLaunched && iIsMMCRemoved) |
|
1294 |
{ |
|
1295 |
ProcessCommandL(EAknSoftkeyExit); |
|
1296 |
} |
|
1297 |
consumed = ETrue; |
|
1298 |
iIsDialogLaunched = EFalse; |
|
1299 |
break; |
|
1300 |
} |
|
1301 |
case EAknSoftkeyBack: |
|
1302 |
{ |
|
1303 |
HideUi(ETrue); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1304 |
// Enable status pane and Set null text |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1305 |
StatusPane()->MakeVisible(ETrue); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1306 |
SetTitlePaneTextL(KNullDesC); |
60 | 1307 |
break; |
1308 |
} |
|
1309 |
} |
|
1310 |
return consumed; |
|
1311 |
} |
|
1312 |
||
1313 |
// --------------------------------------------------------------------------- |
|
1314 |
// From HandleCommandL.. |
|
1315 |
// --------------------------------------------------------------------------- |
|
1316 |
// |
|
1317 |
void CGlxFullScreenViewImp::HandleCommandL(TInt aCommandId, CAlfControl* aControl) |
|
1318 |
{ |
|
1319 |
TRACER("CGlxFullScreenViewImp::HandleCommandLCAlfControl"); |
|
1320 |
//Gets a callback from zoomview if zoomlevel goes beyound the launch zoomlevel |
|
1321 |
// and activates the fullscreenview |
|
1322 |
if (aControl == iZoomControl) |
|
1323 |
{ |
|
1324 |
if (aCommandId == KGlxZoomOutCommand) |
|
1325 |
{ |
|
1326 |
DeactivateZoomControlL(); |
|
1327 |
} |
|
1328 |
else if(aCommandId == KGlxZoomOrientationChange) |
|
1329 |
{ |
|
1330 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
1331 |
} |
|
1332 |
} |
|
1333 |
} |
|
1334 |
||
1335 |
// --------------------------------------------------------------------------- |
|
1336 |
// From HandleResourceChangeL.. |
|
1337 |
// --------------------------------------------------------------------------- |
|
1338 |
// |
|
1339 |
void CGlxFullScreenViewImp::HandleResourceChangeL (TInt aType) |
|
1340 |
{ |
|
1341 |
TRACER("CGlxFullScreenViewImp::HandleResourceChangeL"); |
|
1342 |
HandleResourceChangeL ( aType); |
|
1343 |
} |
|
1344 |
||
1345 |
//---------------------------------------------------------------------------------- |
|
1346 |
// InitialZoomLevel:Calculate the initial Zoom Level for the Image |
|
1347 |
//---------------------------------------------------------------------------------- |
|
1348 |
// |
|
1349 |
TInt CGlxFullScreenViewImp::GetInitialZoomLevel() |
|
1350 |
{ |
|
1351 |
TRACER("CGlxFullScreenViewImp::InitialZoomLevel"); |
|
1352 |
TInt focus = iMediaList->FocusIndex(); |
|
1353 |
TGlxMedia item = iMediaList->Item( focus ); |
|
1354 |
TSize size; |
|
1355 |
TUint8 initialZoomLevel; |
|
1356 |
item.GetDimensions( size ); |
|
1357 |
if (KGlxDecodingThreshold < (size.iWidth * size.iHeight)) |
|
1358 |
{ |
|
1359 |
TReal areaRatio = TReal(size.iWidth*size.iHeight)/KGlxDecodingThreshold ; |
|
1360 |
||
1361 |
TReal sideRatio; |
|
1362 |
Math::Sqrt(sideRatio, areaRatio); |
|
1363 |
||
1364 |
size.iHeight = size.iHeight / sideRatio ; |
|
1365 |
size.iWidth = size.iWidth / sideRatio ; |
|
1366 |
} |
|
1367 |
TRect rect = AlfUtil::ScreenSize(); |
|
1368 |
||
1369 |
if( rect.Width()>= size.iWidth && rect.Height() >= size.iHeight) |
|
1370 |
{ |
|
1371 |
//if Both the Width and Height are lesser than the screen size,the initial Zoom Level will be 100 |
|
1372 |
initialZoomLevel = KGlxMinSmallImageZoomLevel; |
|
1373 |
} |
|
1374 |
else |
|
1375 |
{ |
|
1376 |
//Calculate (Display Area Width) /Image Width * 100 |
|
1377 |
//Calculate (Display Area Height) /Image Height * 100 |
|
1378 |
//Choose the Minimum Of the above. |
|
1379 |
TReal32 imageWidthRatio = ((TReal32) rect.Width() / size.iWidth )*100.0F; |
|
1380 |
TReal32 imageHeightRatio = ((TReal32)rect.Height()/ size.iHeight )*100.0F; |
|
1381 |
initialZoomLevel = Min(imageWidthRatio,imageHeightRatio); |
|
1382 |
} |
|
1383 |
||
1384 |
// A correction of 0.5 (KGlxRealTruncationPadding) is added to the resultant value. |
|
1385 |
// This ensures that all return values greater than X.5 (e.g lets say 12.8) is pegged to X+1(13) |
|
1386 |
// instead of X(12) while calculating. |
|
1387 |
// Changing the calculations to real might have been a better idea, |
|
1388 |
// but that involves many changes in many places and was therefore avoided, |
|
1389 |
// maybe a good idea to take up in PS2. |
|
1390 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetInitialZoomLevel() = %d ", KGlxRealTruncationPadding + initialZoomLevel); |
|
1391 |
return KGlxRealTruncationPadding + initialZoomLevel ; |
|
1392 |
} |
|
1393 |
||
1394 |
//---------------------------------------------------------------------------------- |
|
1395 |
// SetSliderLevel() Set the Initial Zoom Level for the Image |
|
1396 |
//---------------------------------------------------------------------------------- |
|
1397 |
// |
|
1398 |
void CGlxFullScreenViewImp::SetSliderToMin() |
|
1399 |
{ |
|
1400 |
TRACER("CGlxFullScreenViewImp::SetSliderLevel"); |
|
1401 |
||
1402 |
TInt value = GetInitialZoomLevel(); |
|
1403 |
if(iSliderModel) |
|
1404 |
{ |
|
1405 |
iSliderModel->SetMinRange(value); |
|
1406 |
(value==KGlxMaxBigImageZoomLevel)?(iSliderModel->SetMaxRange(KGlxMaxSmallImageZoomLevel)) |
|
1407 |
:(iSliderModel->SetMaxRange(KGlxMaxBigImageZoomLevel)); |
|
1408 |
iSliderModel->SetPrimaryValue(value); |
|
1409 |
} |
|
1410 |
} |
|
1411 |
||
1412 |
// --------------------------------------------------------------------------- |
|
1413 |
// From IAlfWidgetEventHandler.. |
|
1414 |
// --------------------------------------------------------------------------- |
|
1415 |
// |
|
1416 |
void CGlxFullScreenViewImp::setEventHandlerData( |
|
1417 |
const AlfWidgetEventHandlerInitData& /*aData*/) |
|
1418 |
{ |
|
1419 |
TRACER("CGlxFullScreenViewImp::setEventHandlerData"); |
|
1420 |
} |
|
1421 |
||
1422 |
// --------------------------------------------------------------------------- |
|
1423 |
// From IAlfWidgetEventHandler.. |
|
1424 |
// --------------------------------------------------------------------------- |
|
1425 |
// |
|
1426 |
AlfWidgetEventHandlerInitData* CGlxFullScreenViewImp::eventHandlerData() |
|
1427 |
{ |
|
1428 |
TRACER("CGlxFullScreenViewImp::eventHandlerData"); |
|
1429 |
return NULL; |
|
1430 |
} |
|
1431 |
||
1432 |
// --------------------------------------------------------------------------- |
|
1433 |
// From IAlfWidgetEventHandler. |
|
1434 |
// --------------------------------------------------------------------------- |
|
1435 |
// |
|
1436 |
void CGlxFullScreenViewImp::setActiveStates( unsigned int /*aStates*/ ) |
|
1437 |
{ |
|
1438 |
TRACER("CGlxFullScreenViewImp::setActiveStates"); |
|
1439 |
} |
|
1440 |
||
1441 |
// --------------------------------------------------------------------------- |
|
1442 |
// From IAlfWidgetEventHandler. |
|
1443 |
// --------------------------------------------------------------------------- |
|
1444 |
// |
|
1445 |
||
1446 |
IAlfInterfaceBase* CGlxFullScreenViewImp::makeInterface( const IfId& /*aType*/ ) |
|
1447 |
{ |
|
1448 |
TRACER("CGlxFullScreenViewImp::makeInterface"); |
|
1449 |
return NULL; |
|
1450 |
} |
|
1451 |
||
1452 |
//---------------------------------------------------------------------------------- |
|
1453 |
// eventHandlerType |
|
1454 |
//---------------------------------------------------------------------------------- |
|
1455 |
// |
|
1456 |
IAlfWidgetEventHandler::AlfEventHandlerType CGlxFullScreenViewImp::eventHandlerType() |
|
1457 |
{ |
|
1458 |
TRACER("CGlxFullScreenViewImp::eventHandlerType"); |
|
1459 |
return IAlfWidgetEventHandler::ELogicalEventHandler; |
|
1460 |
} |
|
1461 |
||
1462 |
//---------------------------------------------------------------------------------- |
|
1463 |
// eventExecutionPhase |
|
1464 |
//---------------------------------------------------------------------------------- |
|
1465 |
// |
|
1466 |
IAlfWidgetEventHandler::AlfEventHandlerExecutionPhase CGlxFullScreenViewImp::eventExecutionPhase() |
|
1467 |
{ |
|
1468 |
TRACER("CGlxFullScreenViewImp::eventHandlerType"); |
|
1469 |
return EBubblingPhaseEventHandler; |
|
1470 |
} |
|
1471 |
||
1472 |
// ----------------------------------------------------------------------------- |
|
1473 |
// Callback from periodic timer |
|
1474 |
// ----------------------------------------------------------------------------- |
|
1475 |
// |
|
1476 |
TInt CGlxFullScreenViewImp::PeriodicCallback(TAny* aPtr ) |
|
1477 |
{ |
|
1478 |
TRACER("CGlxFullScreenViewImp::PeriodicCallback"); |
|
1479 |
static_cast< CGlxFullScreenViewImp* >( aPtr )->CallPeriodicCallback(); |
|
1480 |
return KErrNone; |
|
1481 |
} |
|
1482 |
||
1483 |
// ----------------------------------------------------------------------------- |
|
1484 |
// Callback from periodic timer-- non static |
|
1485 |
// ----------------------------------------------------------------------------- |
|
1486 |
// |
|
1487 |
inline void CGlxFullScreenViewImp::CallPeriodicCallback() |
|
1488 |
{ |
|
1489 |
TRACER("CGlxFullScreenViewImp::CallPeriodicCallback"); |
|
1490 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
|
1491 |
} |
|
1492 |
||
1493 |
// --------------------------------------------------------------------------- |
|
1494 |
// Shows expiry note / Consumes DRM rights for expired DRM files |
|
1495 |
// --------------------------------------------------------------------------- |
|
1496 |
// |
|
1497 |
void CGlxFullScreenViewImp::ShowDrmExpiryNoteL() |
|
1498 |
{ |
|
1499 |
TRACER("CGlxFullScreenViewImp::ShowDrmExpiryNoteL"); |
|
1500 |
if (iMediaList->Count() > 0) |
|
1501 |
{ |
|
1502 |
const TGlxMedia& media = iMediaList->Item(iMediaList->FocusIndex()); |
|
1503 |
TInt tnError = GlxErrorManager::HasAttributeErrorL( |
|
1504 |
media.Properties(), KGlxMediaIdThumbnail); |
|
1505 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1506 |
" tnError=%d ", tnError); |
|
1507 |
||
1508 |
if (media.IsDrmProtected()) |
|
1509 |
{ |
|
1510 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1511 |
"- ConsumeDRMRightsL()"); |
|
1512 |
//Consume DRM Rights & cancel Periodic timer for DRM images |
|
1513 |
//only if Quality TN is available |
|
1514 |
ConsumeDRMRightsL(media); |
|
1515 |
} |
|
1516 |
else |
|
1517 |
{ |
|
1518 |
//Cancel the periodic timer if quality thumbnail is available |
|
1519 |
//and no error in fetching quality thumbnail. |
|
1520 |
TSize tnSize = iUiUtility->DisplaySize(); |
|
1521 |
TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1522 |
GlxFullThumbnailAttributeId(ETrue, tnSize.iWidth, |
|
1523 |
tnSize.iHeight)); |
|
1524 |
const CGlxThumbnailAttribute* qtyTn = media.ThumbnailAttribute( |
|
1525 |
qtyTnAttrib); |
|
1526 |
if (qtyTn && tnError == KErrNone) |
|
1527 |
{ |
|
1528 |
if (iPeriodic->IsActive()) |
|
1529 |
{ |
|
1530 |
iPeriodic->Cancel(); |
|
1531 |
} |
|
1532 |
} |
|
1533 |
} |
|
1534 |
||
1535 |
//check if any Error message is to be displayed |
|
1536 |
TMPXGeneralCategory cat = media.Category(); |
|
1537 |
TBool checkViewRights = ETrue; |
|
1538 |
if (media.IsDrmProtected()) |
|
1539 |
{ |
|
1540 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1541 |
"- ItemRightsValidityCheckL()"); |
|
1542 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1543 |
{ |
|
1544 |
checkViewRights = iDrmUtility->ItemRightsValidityCheckL( |
|
1545 |
iImageViewerInstance->ImageFileHandle(), |
|
1546 |
(media.Category() == EMPXImage)); |
|
1547 |
} |
|
1548 |
else |
|
1549 |
{ |
|
1550 |
//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL |
|
1551 |
checkViewRights = iDrmUtility->ItemRightsValidityCheckL( |
|
1552 |
media.Uri(), (media.Category() == EMPXImage)); |
|
1553 |
} |
|
1554 |
} |
|
1555 |
if (checkViewRights && tnError != KErrNone) |
|
1556 |
{ |
|
1557 |
if (iPeriodic->IsActive()) |
|
1558 |
{ |
|
1559 |
iPeriodic->Cancel(); |
|
1560 |
} |
|
1561 |
||
1562 |
if (iImgViewerMode) |
|
1563 |
{ |
|
1564 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1565 |
"- ShowErrorNoteL(%d)", tnError); |
|
1566 |
if (tnError == KErrNoMemory || tnError == KErrNotSupported |
|
1567 |
|| tnError == KErrInUse || tnError == KErrDiskFull |
|
1568 |
|| tnError == KErrTimedOut || tnError |
|
1569 |
== KErrPermissionDenied) |
|
1570 |
{ |
|
1571 |
GlxGeneralUiUtilities::ShowErrorNoteL(tnError); |
|
1572 |
} |
|
1573 |
else |
|
1574 |
{ |
|
1575 |
// Generic "Unable to open image" error note |
|
1576 |
HBufC* str = StringLoader::LoadLC( |
|
1577 |
R_GLX_ERR_FORMAT_UNKNOWN); |
|
1578 |
CAknErrorNote* note = new (ELeave) CAknErrorNote(ETrue); |
|
1579 |
note->ExecuteLD(*str); // ignore return value, not used |
|
1580 |
CleanupStack::PopAndDestroy(str); |
|
1581 |
} |
|
1582 |
} |
|
1583 |
} |
|
1584 |
} |
|
1585 |
} |
|
1586 |
||
1587 |
// --------------------------------------------------------------------------- |
|
1588 |
// Consumes DRM rights / Shows DRM rights (if expired) information |
|
1589 |
// for DRM files |
|
1590 |
// --------------------------------------------------------------------------- |
|
1591 |
// |
|
1592 |
void CGlxFullScreenViewImp::ConsumeDRMRightsL(const TGlxMedia& aMedia) |
|
1593 |
{ |
|
1594 |
TRACER("CGlxFullScreenViewImp::ConsumeDRMRightsL"); |
|
1595 |
const TDesC& uri = aMedia.Uri(); |
|
1596 |
if (uri.Length() > 0) |
|
1597 |
{ |
|
1598 |
// check if rights have expired |
|
1599 |
TBool expired = EFalse; |
|
1600 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1601 |
{ |
|
1602 |
expired = !iDrmUtility->ItemRightsValidityCheckL( |
|
1603 |
iImageViewerInstance->ImageFileHandle(), |
|
1604 |
ETrue); |
|
1605 |
} |
|
1606 |
else |
|
1607 |
{ |
|
1608 |
expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue); |
|
1609 |
} |
|
1610 |
||
1611 |
if (expired) |
|
1612 |
{ |
|
1613 |
if (iPeriodic->IsActive()) |
|
1614 |
{ |
|
1615 |
iPeriodic->Cancel(); |
|
1616 |
} |
|
1617 |
iBusyIcon->ShowBusyIconL(EFalse); |
|
1618 |
if(iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1619 |
{ |
|
1620 |
iDrmUtility->ShowRightsInfoL(iImageViewerInstance->ImageFileHandle()); |
|
1621 |
} |
|
1622 |
else |
|
1623 |
{ |
|
1624 |
iDrmUtility->ShowRightsInfoL(uri); |
|
1625 |
} |
|
1626 |
return; |
|
1627 |
} |
|
1628 |
||
1629 |
TSize tnSize = iUiUtility->DisplaySize(); |
|
1630 |
TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1631 |
GlxFullThumbnailAttributeId(ETrue, tnSize.iWidth, |
|
1632 |
tnSize.iHeight)); |
|
1633 |
const CGlxThumbnailAttribute* qtyTn = aMedia.ThumbnailAttribute( |
|
1634 |
qtyTnAttrib); |
|
1635 |
||
1636 |
TInt tnError = GlxErrorManager::HasAttributeErrorL( |
|
1637 |
aMedia.Properties(), KGlxMediaIdThumbnail); |
|
1638 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ConsumeDRMRightsL()" |
|
1639 |
" tnError=%d ", tnError); |
|
1640 |
if (qtyTn && tnError == KErrNone) |
|
1641 |
{ |
|
1642 |
if (iPeriodic->IsActive()) |
|
1643 |
{ |
|
1644 |
iPeriodic->Cancel(); |
|
1645 |
} |
|
1646 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ConsumeDRMRightsL()" |
|
1647 |
"- ConsumeRights"); |
|
1648 |
if(iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1649 |
{ |
|
1650 |
iDrmUtility->ConsumeRightsL(iImageViewerInstance->ImageFileHandle()); |
|
1651 |
} |
|
1652 |
else |
|
1653 |
{ |
|
1654 |
iDrmUtility->ConsumeRightsL(uri); |
|
1655 |
} |
|
1656 |
} |
|
1657 |
} |
|
1658 |
} |
|
1659 |
||
1660 |
// --------------------------------------------------------------------------- |
|
1661 |
// |
|
1662 |
// Gets the Swipe direction |
|
1663 |
// --------------------------------------------------------------------------- |
|
1664 |
// |
|
1665 |
TSwipe CGlxFullScreenViewImp::GetSwipeDirection() |
|
1666 |
{ |
|
1667 |
TRACER("CGlxFullScreenViewImp::GetSwipeDirection"); |
|
1668 |
||
1669 |
TInt count = iMediaList->Count(); |
|
1670 |
TInt focusindex = iMediaList->FocusIndex(); |
|
1671 |
TSwipe swipedirection; |
|
1672 |
||
1673 |
if(focusindex == 0) |
|
1674 |
{ |
|
1675 |
swipedirection = (iOldFocusIndex == 1 ? EBackward : EForward); |
|
1676 |
} |
|
1677 |
else if(focusindex == count-1) |
|
1678 |
{ |
|
1679 |
swipedirection = (iOldFocusIndex == 0 ? EBackward : EForward); |
|
1680 |
} |
|
1681 |
else |
|
1682 |
{ |
|
1683 |
swipedirection = (focusindex-iOldFocusIndex < 0 ? EBackward : EForward) ; |
|
1684 |
} |
|
1685 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetSwipeDirection()" |
|
1686 |
" Direction = [%d] ", swipedirection); |
|
1687 |
||
1688 |
return swipedirection; |
|
1689 |
} |
|
1690 |
||
1691 |
// --------------------------------------------------------------------------- |
|
1692 |
// |
|
1693 |
// Gets the index of the item for which the texture has to be removed |
|
1694 |
// --------------------------------------------------------------------------- |
|
1695 |
// |
|
1696 |
TInt CGlxFullScreenViewImp::GetIndexToBeRemoved() |
|
1697 |
{ |
|
1698 |
TRACER("CGlxFullScreenViewImp::GetIndexToBeRemoved"); |
|
1699 |
||
1700 |
TSwipe swipedirection = GetSwipeDirection(); |
|
1701 |
TInt indextoberemoved; |
|
1702 |
TInt count = iMediaList->Count(); |
|
1703 |
TInt focusindex = iMediaList->FocusIndex(); |
|
1704 |
if(swipedirection == EForward) |
|
1705 |
{ |
|
1706 |
indextoberemoved = focusindex-KFullScreenIterator; |
|
1707 |
if(indextoberemoved < 0) |
|
1708 |
{ |
|
1709 |
indextoberemoved = count+indextoberemoved; |
|
1710 |
} |
|
1711 |
} |
|
1712 |
else |
|
1713 |
{ |
|
1714 |
indextoberemoved = focusindex+KFullScreenIterator; |
|
1715 |
if(indextoberemoved > count-1) |
|
1716 |
{ |
|
1717 |
indextoberemoved = indextoberemoved-count; |
|
1718 |
} |
|
1719 |
} |
|
1720 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetIndexToBeRemoved index tobe removed %d",indextoberemoved ); |
|
1721 |
return indextoberemoved; |
|
1722 |
} |
|
1723 |
||
1724 |
// --------------------------------------------------------------------------- |
|
1725 |
// |
|
1726 |
// Remove the texture on every swipe while HDMI is connected. |
|
1727 |
// --------------------------------------------------------------------------- |
|
1728 |
// |
|
1729 |
void CGlxFullScreenViewImp::RemoveTexture() |
|
1730 |
{ |
|
1731 |
TRACER("CGlxFullScreenViewImp::RemoveTexture"); |
|
1732 |
||
1733 |
const TGlxMedia& item = iMediaList->Item(GetIndexToBeRemoved()); |
|
1734 |
iUiUtility->GlxTextureManager().RemoveTexture(item.Id(),EFalse); |
|
1735 |
} |
|
1736 |
||
1737 |
// --------------------------------------------------------------------------- |
|
1738 |
// |
|
1739 |
// Set the focused item to external display - HDMI |
|
1740 |
// --------------------------------------------------------------------------- |
|
1741 |
// |
|
1742 |
void CGlxFullScreenViewImp::SetItemToHDMIL() |
|
1743 |
{ |
|
1744 |
TRACER("CGlxFullScreenViewImp::SetItemToHDMIL()"); |
|
1745 |
||
1746 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
1747 |
||
1748 |
// If we dont know what item we are focussing on |
|
1749 |
// or if our medialist is empty |
|
1750 |
// or if there is no HDMI Controller at all |
|
1751 |
// then dont SetItemToHDMI :) |
|
1752 |
if ((KErrNotFound == focusIndex) || (0 == iMediaList->Count()) || (NULL |
|
1753 |
== iHdmiController)) |
|
1754 |
{ |
|
1755 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Cant Set Image To HDMI"); |
|
1756 |
return; |
|
1757 |
} |
|
1758 |
||
1759 |
TGlxMedia item = iMediaList->Item(focusIndex); |
|
1760 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), |
|
1761 |
KGlxMediaIdThumbnail); |
|
1762 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - error=%d", error); |
|
1763 |
||
1764 |
TBool canView = ETrue; |
|
1765 |
if (item.IsDrmProtected()) |
|
1766 |
{ |
|
1767 |
canView = iDrmUtility->ItemRightsValidityCheckL(item.Uri(), |
|
1768 |
(item.Category() == EMPXImage)); |
|
1769 |
} |
|
1770 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - canView=%d", canView); |
|
1771 |
||
1772 |
// Item will be supported by HDMI ONLY if |
|
1773 |
// it is not a video |
|
1774 |
// and it is DRM protected and has valid DRM Viewing rights |
|
1775 |
// and it has no attribute error |
|
1776 |
if ((item.Category() != EMPXVideo) && canView && (error == KErrNone)) |
|
1777 |
{ |
|
1778 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch FS thumbnail"); |
|
1779 |
TMPXAttribute fsTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1780 |
GlxFullThumbnailAttributeId(ETrue, iScrnSize.iWidth, |
|
1781 |
iScrnSize.iHeight)); |
|
1782 |
const CGlxThumbnailAttribute* fsValue = item.ThumbnailAttribute( |
|
1783 |
fsTnAttrib); |
|
1784 |
if (fsValue) |
|
1785 |
{ |
|
1786 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting FS Bitmap"); |
|
1787 |
CFbsBitmap* fsBitmap = new (ELeave) CFbsBitmap; |
|
1788 |
CleanupStack::PushL(fsBitmap); |
|
1789 |
fsBitmap->Duplicate( fsValue->iBitmap->Handle()); |
|
1790 |
||
1791 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - FS Bitmap Size width=%d, height=%d", |
|
1792 |
fsBitmap->SizeInPixels().iWidth, fsBitmap->SizeInPixels().iHeight); |
|
1793 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, fsBitmap); |
|
1794 |
CleanupStack::PopAndDestroy(fsBitmap); |
|
1795 |
} |
|
1796 |
else |
|
1797 |
{ |
|
1798 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch Grid thumbnail"); |
|
1799 |
TMPXAttribute gridTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1800 |
GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
|
1801 |
iGridIconSize.iHeight)); |
|
1802 |
const CGlxThumbnailAttribute* gridvalue = item.ThumbnailAttribute( |
|
1803 |
gridTnAttrib); |
|
1804 |
||
1805 |
if (gridvalue) |
|
1806 |
{ |
|
1807 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Grid Bitmap"); |
|
1808 |
CFbsBitmap* gridBitmap = new (ELeave) CFbsBitmap; |
|
1809 |
CleanupStack::PushL(gridBitmap); |
|
1810 |
gridBitmap->Duplicate( gridvalue->iBitmap->Handle()); |
|
1811 |
||
1812 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - gridBitmap Size width=%d, height=%d", |
|
1813 |
gridBitmap->SizeInPixels().iWidth, gridBitmap->SizeInPixels().iHeight); |
|
1814 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, gridBitmap); |
|
1815 |
CleanupStack::PopAndDestroy(gridBitmap); |
|
1816 |
} |
|
1817 |
else |
|
1818 |
{ |
|
1819 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Default Bitmap"); |
|
1820 |
TFileName resFile(KDC_APP_BITMAP_DIR); |
|
1821 |
resFile.Append(KGlxIconsFilename); |
|
1822 |
CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile, |
|
1823 |
EMbmGlxiconsQgn_prop_image_notcreated); |
|
1824 |
CleanupStack::PushL(defaultBitmap); |
|
1825 |
||
1826 |
// always need to setsize on the raw bitmap for it to be visible |
|
1827 |
AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved); |
|
1828 |
||
1829 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - Default Size width=%d, height=%d", |
|
1830 |
defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight); |
|
1831 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, defaultBitmap); |
|
1832 |
CleanupStack::PopAndDestroy(defaultBitmap); |
|
1833 |
} |
|
1834 |
} |
|
1835 |
} |
|
1836 |
else |
|
1837 |
{ |
|
1838 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Unsupported Item"); |
|
1839 |
//Set the external display to cloning mode if |
|
1840 |
//the current item is something we dont support |
|
1841 |
//(e.g. video, corrupted item, item with invalid DRM) |
|
1842 |
iHdmiController->ItemNotSupported(); |
|
1843 |
} |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1844 |
|
60 | 1845 |
iOldFocusIndex = iMediaList->FocusIndex(); |
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1846 |
delete iUri; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1847 |
iUri = NULL; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1848 |
iUri = item.Uri().AllocL(); |
60 | 1849 |
} |
1850 |
||
1851 |
// --------------------------------------------------------------------------- |
|
1852 |
// HandleMMCInsertionL |
|
1853 |
// |
|
1854 |
// --------------------------------------------------------------------------- |
|
1855 |
void CGlxFullScreenViewImp::HandleMMCInsertionL() |
|
1856 |
{ |
|
1857 |
TRACER("CGlxFullScreenViewImp::HandleMMCInsertionL()"); |
|
1858 |
iMMCState = ETrue; |
|
1859 |
NavigateToMainListL(); |
|
1860 |
} |
|
1861 |
||
1862 |
// --------------------------------------------------------------------------- |
|
1863 |
// NavigateToMainListL |
|
1864 |
// |
|
1865 |
// --------------------------------------------------------------------------- |
|
1866 |
void CGlxFullScreenViewImp::NavigateToMainListL() |
|
1867 |
{ |
|
1868 |
TRACER("CGlxFullScreenViewImp::NavigateToMainListL()"); |
|
1869 |
if (!iImgViewerMode) |
|
1870 |
{ |
|
1871 |
if (iZoomControl && iZoomControl->Activated()) |
|
1872 |
{ |
|
1873 |
DeactivateZoomControlL(); |
|
1874 |
} |
|
1875 |
ProcessCommandL( EAknSoftkeyClose); |
|
1876 |
} |
|
1877 |
} |
|
1878 |
||
1879 |
// --------------------------------------------------------------------------- |
|
1880 |
// HandleMMCRemovalL |
|
1881 |
// |
|
1882 |
// --------------------------------------------------------------------------- |
|
1883 |
void CGlxFullScreenViewImp::HandleMMCRemovalL() |
|
1884 |
{ |
|
1885 |
TRACER("CGlxFullScreenViewImp::HandleMMCRemovalL()"); |
|
1886 |
iIsMMCRemoved = ETrue; |
|
1887 |
if(!iIsDialogLaunched) |
|
1888 |
{ |
|
1889 |
if(iZoomControl && iZoomControl->Activated()) |
|
1890 |
{ |
|
1891 |
DeactivateZoomControlL(); |
|
1892 |
} |
|
1893 |
ProcessCommandL(EAknSoftkeyExit); |
|
1894 |
} |
|
1895 |
} |
|
1896 |
||
1897 |
// --------------------------------------------------------------------------- |
|
1898 |
// EnableFSToolbar |
|
1899 |
// --------------------------------------------------------------------------- |
|
1900 |
// |
|
1901 |
void CGlxFullScreenViewImp::EnableFSToolbar(TBool aEnable) |
|
1902 |
{ |
|
1903 |
TRACER("CGlxFullScreenViewImp::EnableFSToolbar()"); |
|
1904 |
CAknToolbar* toolbar = Toolbar(); |
|
1905 |
if(toolbar) |
|
1906 |
{ |
|
1907 |
TRAP_IGNORE(toolbar->DisableToolbarL(!aEnable)); |
|
1908 |
toolbar->SetToolbarVisibility(aEnable); |
|
1909 |
} |
|
1910 |
} |
|
1911 |
||
1912 |
// --------------------------------------------------------------------------- |
|
1913 |
// HandleEffectCallback |
|
1914 |
// |
|
1915 |
// --------------------------------------------------------------------------- |
|
1916 |
// |
|
1917 |
void CGlxFullScreenViewImp::HandleEffectCallback(TInt aType, TInt aHandle, |
|
1918 |
TInt /*aStatus*/) |
|
1919 |
{ |
|
1920 |
TRACER("CGlxFullScreenViewImp::HandleEffectCallback()"); |
|
1921 |
if (aHandle == iEffectHandle && aType == EAlfEffectComplete |
|
1922 |
&& iCoverFlowWidget) |
|
1923 |
{ |
|
1924 |
TRAP_IGNORE(const_cast<CAlfLayout&> |
|
1925 |
(iCoverFlowWidget->ContainerLayout()).SetEffectL( |
|
1926 |
KTfxResourceNoEffect)); |
|
1927 |
} |
|
1928 |
} |
|
1929 |
||
1930 |
// ----------------------------------------------------------------------------- |
|
1931 |
// CreateImageViewerInstanceL |
|
1932 |
// ----------------------------------------------------------------------------- |
|
1933 |
// |
|
1934 |
void CGlxFullScreenViewImp::CreateImageViewerInstanceL() |
|
1935 |
{ |
|
1936 |
TRACER("CGlxFullScreenViewImp::CreateImageViewerInstanceL"); |
|
1937 |
iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
|
1938 |
__ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); |
|
1939 |
} |
|
1940 |
||
1941 |
// ----------------------------------------------------------------------------- |
|
1942 |
// DeleteImageViewerInstance |
|
1943 |
// ----------------------------------------------------------------------------- |
|
1944 |
// |
|
1945 |
void CGlxFullScreenViewImp::DeleteImageViewerInstance() |
|
1946 |
{ |
|
1947 |
TRACER("CGlxFullScreenViewImp::DeleteImageViewerInstance"); |
|
1948 |
if ( iImageViewerInstance ) |
|
1949 |
{ |
|
1950 |
iImageViewerInstance->DeleteInstance(); |
|
1951 |
} |
|
1952 |
} |
|
1953 |
||
1954 |
// ----------------------------------------------------------------------------- |
|
1955 |
// HandleTvStatusChangedL |
|
1956 |
// ----------------------------------------------------------------------------- |
|
1957 |
void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
|
1958 |
{ |
|
1959 |
TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()"); |
|
1960 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::HandleTvStatusChangedL(%d)", |
|
1961 |
aChangeType); |
|
1962 |
||
1963 |
if (aChangeType == ETvConnectionChanged) |
|
1964 |
{ |
|
1965 |
// Hide UI furnitures when HDMI cable is connected/Disconnected |
|
1966 |
// irrespective of UI state on/off. |
|
1967 |
HideUi(ETrue); |
|
1968 |
} |
|
1969 |
} |
|
1970 |
||
1971 |
// --------------------------------------------------------------------------- |
|
1972 |
// CheckIfSliderToBeShownL |
|
1973 |
// --------------------------------------------------------------------------- |
|
1974 |
TBool CGlxFullScreenViewImp::CheckIfSliderToBeShownL() |
|
1975 |
{ |
|
1976 |
TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()"); |
|
1977 |
||
1978 |
TInt index = iMediaList->FocusIndex(); |
|
1979 |
const TGlxMedia& item = iMediaList->Item(index); |
|
1980 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), |
|
1981 |
KGlxMediaIdThumbnail); |
|
1982 |
||
1983 |
TBool isDrmRightsValid = ETrue; |
|
1984 |
if(item.IsDrmProtected()) |
|
1985 |
{ |
|
1986 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1987 |
{ |
|
1988 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
1989 |
iImageViewerInstance->ImageFileHandle(), (item.Category() |
|
1990 |
== EMPXImage)); |
|
1991 |
} |
|
1992 |
else |
|
1993 |
{ |
|
1994 |
//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL |
|
1995 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
1996 |
item.Uri(), (item.Category() == EMPXImage)); |
|
1997 |
} |
|
1998 |
} |
|
1999 |
||
2000 |
// Display slider only for non corrupted images and items with valid DRM license |
|
2001 |
if (iHdmiController && iHdmiController->IsHDMIConnected()) |
|
2002 |
{ |
|
2003 |
//hide slider if UI is needed to be on and HDMI is Connected |
|
2004 |
return EFalse; |
|
2005 |
} |
|
2006 |
else if(error == KErrNone && item.Category() == EMPXImage |
|
2007 |
&& isDrmRightsValid ) |
|
2008 |
{ |
|
2009 |
return ETrue; |
|
2010 |
} |
|
2011 |
return EFalse; |
|
2012 |
} |
|
2013 |
||
2014 |
//--------------------------------------------------------------------------- |
|
2015 |
// HandleHDMIDecodingEventL |
|
2016 |
//--------------------------------------------------------------------------- |
|
2017 |
void CGlxFullScreenViewImp::HandleHDMIDecodingEventL( |
|
2018 |
THdmiDecodingStatus /*aStatus*/) |
|
2019 |
{ |
|
2020 |
TRACER("CGlxFullScreenViewImp::HandleHDMIDecodingEventL()"); |
|
2021 |
} |
|
2022 |
||
2023 |
// --------------------------------------------------------------------------- |
|
2024 |
// UpdateItems |
|
2025 |
// --------------------------------------------------------------------------- |
|
2026 |
void CGlxFullScreenViewImp::UpdateItems() |
|
2027 |
{ |
|
2028 |
TRACER("CGlxFullScreenViewImp::UpdateItems()"); |
|
2029 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
2030 |
TInt count = iMediaList->Count(); |
|
2031 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::UpdateItems()" |
|
2032 |
" focusIndex(%d), count(%d)", focusIndex, count); |
|
2033 |
||
2034 |
if (focusIndex != KErrNotFound && count) |
|
2035 |
{ |
|
2036 |
// update the focus index first |
|
2037 |
iMediaListMulModelProvider->UpdateItems(focusIndex, 1); |
|
2038 |
||
2039 |
TInt startIndex = focusIndex; |
|
2040 |
TInt iteratorCount = (KTextureOffset > count) ? |
|
2041 |
count : KTextureOffset; |
|
2042 |
TInt textureCount = (KFullScreenTextureOffset > count)? |
|
2043 |
count : KFullScreenTextureOffset; |
|
2044 |
||
2045 |
startIndex = focusIndex - iteratorCount; |
|
2046 |
if (startIndex < 0) |
|
2047 |
{ |
|
2048 |
startIndex = count + startIndex; |
|
2049 |
} |
|
2050 |
||
2051 |
TInt i = 0; |
|
2052 |
//Update all the textures in the window |
|
2053 |
while (i < textureCount) |
|
2054 |
{ |
|
2055 |
if (startIndex != focusIndex) |
|
2056 |
{ |
|
2057 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::UpdateItems(%d)", startIndex); |
|
2058 |
iMediaListMulModelProvider->UpdateItems(startIndex, 1); |
|
2059 |
} |
|
2060 |
if (++startIndex == count) |
|
2061 |
{ |
|
2062 |
startIndex = 0; |
|
2063 |
} |
|
2064 |
i++; |
|
2065 |
} |
|
2066 |
||
2067 |
// When the focused index is first or last, |
|
2068 |
// need to update the items adjacent to KFullScreenIterator also! |
|
2069 |
if (count > (KFullScreenTextureOffset)) |
|
2070 |
{ |
|
2071 |
TInt lastIndex = count - 1; |
|
2072 |
if (focusIndex == 0) |
|
2073 |
{ |
|
2074 |
iMediaListMulModelProvider->UpdateItems(KFullScreenIterator, |
|
2075 |
1); |
|
2076 |
} |
|
2077 |
else if (focusIndex == lastIndex) |
|
2078 |
{ |
|
2079 |
iMediaListMulModelProvider->UpdateItems(lastIndex |
|
2080 |
- KFullScreenIterator, 1); |
|
2081 |
} |
|
2082 |
} |
|
2083 |
} |
|
2084 |
} |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2085 |
|
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2086 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2087 |
// Sets the title pane text |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2088 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2089 |
void CGlxFullScreenViewImp::SetTitlePaneTextL(const TDesC& aTitleText) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2090 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2091 |
TRACER("CGlxFullScreenViewImp::SetTitlePaneTextL()"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2092 |
CAknViewAppUi* appui = AppUi(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2093 |
if (appui) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2094 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2095 |
CAknTitlePane* titlePane = |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2096 |
(CAknTitlePane*) appui->StatusPane()->ControlL(TUid::Uid( |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2097 |
EEikStatusPaneUidTitle)); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2098 |
titlePane->SetTextL(aTitleText); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2099 |
titlePane->DrawNow(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2100 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2101 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2102 |
|
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2103 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2104 |
// HandleItemRemovedL |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2105 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2106 |
void CGlxFullScreenViewImp::HandleItemRemovedL() |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2107 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2108 |
TRACER("CGlxFullScreenViewImp::HandleItemRemovedL()"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2109 |
TInt focusIndex = iMediaList->FocusIndex(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2110 |
TInt mlCount = iMediaList->Count(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2111 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::HandleItemRemovedL focusIndex=%d, iOldFocusIndex=%d", |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2112 |
focusIndex, iOldFocusIndex); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2113 |
// When photos is in background, the Following scenario could happen, |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2114 |
// 1) First item is deleted => iOldFocusIndex == focusIndex (or) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2115 |
// 2) Last item is deleted => iOldFocusIndex == mlCount (or) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2116 |
// 3) New item is added and focused item is deleted => iOldFocusIndex != focusIndex |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2117 |
if (mlCount && (iOldFocusIndex == focusIndex || iOldFocusIndex == mlCount |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2118 |
|| iOldFocusIndex != focusIndex) && iZoomControl |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2119 |
&& iZoomControl->Activated()) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2120 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2121 |
GLX_LOG_INFO("Focused item is removed, Exit zoom view!"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2122 |
DeactivateZoomControlL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2123 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2124 |
SetItemToHDMIL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2125 |
if (focusIndex != KErrNotFound && EUiOn == GetUiState()) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2126 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2127 |
// show/hide the slider |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2128 |
if (iSliderWidget) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2129 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2130 |
iSliderWidget->ShowWidget(CheckIfSliderToBeShownL()); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2131 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2132 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2133 |
/** if this is the last image deleted when Photo is in foreground, go back to the previous view*/ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2134 |
if (mlCount == 0 && IsForeground() && iNaviState->ViewingMode() |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2135 |
== NGlxNavigationalState::EView) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2136 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2137 |
iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2138 |
iNaviState->ActivatePreviousViewL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2139 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2140 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2141 |
} |