author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:13:06 +0300 | |
branch | RCL_3 |
changeset 68 | 5b238bc8ffb6 |
parent 64 | 34937ec34dac |
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 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 |
{ |
|
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
557 |
TInt focusIndex = iMediaList->FocusIndex(); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
558 |
if (focusIndex >= 0 && focusIndex < iMediaList->Count()) |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
559 |
{ |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
560 |
TBool dimmed = (EMPXVideo == iMediaList->Item(focusIndex).Category()); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
561 |
Toolbar()->SetItemDimmed(EGlxCmdSlideshowPlay, dimmed, ETrue); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
562 |
} |
60 | 563 |
//show the toolbar |
564 |
EnableFSToolbar(ETrue); |
|
565 |
} |
|
566 |
||
567 |
// For floating toolbar in non-touch devices |
|
568 |
iScreenFurniture->SetToolbarVisibility(ETrue); |
|
569 |
||
570 |
//show the softkeys |
|
571 |
CEikButtonGroupContainer* cba = Cba(); |
|
572 |
cba->SetCommandSetL( R_GLX_FULLSCREEN_SOFTKEYS ); |
|
573 |
cba->MakeVisible( ETrue ); |
|
574 |
cba->DrawNow(); |
|
575 |
||
576 |
//set the ui state to On |
|
577 |
SetUiState(EUiOn); |
|
578 |
||
579 |
//start the timer,for the screen timeout |
|
580 |
iTimer->Cancel(); |
|
581 |
if(aStartTimer) |
|
582 |
{ |
|
583 |
iTimer->Start(KGlxScreenTimeout,KGlxScreenTimeout,TCallBack( TimeOut,this )); |
|
584 |
} |
|
585 |
} |
|
586 |
||
587 |
// --------------------------------------------------------------------------- |
|
588 |
// HideUi |
|
589 |
// --------------------------------------------------------------------------- |
|
590 |
// |
|
591 |
void CGlxFullScreenViewImp::HideUi(TBool aHideSlider) |
|
592 |
{ |
|
593 |
TRACER("CGlxFullScreenViewImp::HideUi"); |
|
594 |
//cancel the timer |
|
595 |
iTimer->Cancel(); |
|
596 |
||
597 |
// For floating toolbar in non-touch devices |
|
598 |
iScreenFurniture->SetToolbarVisibility(EFalse); |
|
599 |
||
600 |
// hide/show the slider |
|
601 |
if(iSliderWidget) |
|
602 |
{ |
|
603 |
iSliderWidget->ShowWidget(!aHideSlider); |
|
604 |
} |
|
605 |
||
606 |
if (iCoverFlowWidget) |
|
607 |
{ |
|
608 |
iCoverFlowWidget->SetUIMode(EFalse); |
|
609 |
} |
|
610 |
||
611 |
//Since the toolbar should not be present for ImageViewer. |
|
612 |
if(!iImgViewerMode) |
|
613 |
{ |
|
614 |
// hide the toolbar |
|
615 |
CAknToolbar* toolbar = Toolbar(); |
|
616 |
if(toolbar) |
|
617 |
{ |
|
618 |
toolbar->SetToolbarVisibility(EFalse); |
|
619 |
} |
|
620 |
} |
|
621 |
||
622 |
// hide the softkeys |
|
623 |
Cba()->MakeVisible( EFalse ); |
|
624 |
Cba()->DrawNow(); |
|
625 |
||
626 |
// set the ui state to On |
|
627 |
SetUiState(EUiOff); |
|
628 |
} |
|
629 |
||
630 |
// --------------------------------------------------------------------------- |
|
631 |
// SetUiState |
|
632 |
// --------------------------------------------------------------------------- |
|
633 |
// |
|
634 |
void CGlxFullScreenViewImp::SetUiState (TUiState aState) |
|
635 |
{ |
|
636 |
TRACER("CGlxFullScreenViewImp::SetUiState"); |
|
637 |
iUiState = aState; |
|
638 |
} |
|
639 |
||
640 |
// --------------------------------------------------------------------------- |
|
641 |
// GetUiState |
|
642 |
// --------------------------------------------------------------------------- |
|
643 |
// |
|
644 |
TUiState CGlxFullScreenViewImp::GetUiState() |
|
645 |
{ |
|
646 |
TRACER("CGlxFullScreenViewImp::GetUiState"); |
|
647 |
return iUiState; |
|
648 |
} |
|
649 |
||
650 |
// --------------------------------------------------------------------------- |
|
651 |
// TimeOut |
|
652 |
// --------------------------------------------------------------------------- |
|
653 |
// |
|
654 |
TInt CGlxFullScreenViewImp::TimeOut(TAny* aSelf) |
|
655 |
{ |
|
656 |
TRACER("CGlxFullScreenViewImp::TimeOut"); |
|
657 |
if(aSelf) |
|
658 |
{ |
|
659 |
CGlxFullScreenViewImp* self = static_cast <CGlxFullScreenViewImp*> (aSelf); |
|
660 |
if (self) |
|
661 |
{ |
|
662 |
if ( EUiOn == self->GetUiState()) |
|
663 |
{ |
|
664 |
// After time out, hide UI only when menu is not being displayed. |
|
665 |
if( self->MenuBar() && !(self->MenuBar()->IsDisplayed()) ) |
|
666 |
{ |
|
667 |
self->HideUi(ETrue); |
|
668 |
} |
|
669 |
} |
|
670 |
} |
|
671 |
} |
|
672 |
return KErrNone; |
|
673 |
} |
|
674 |
||
675 |
// --------------------------------------------------------------------------- |
|
676 |
//DeactivateFullScreen function. |
|
677 |
// --------------------------------------------------------------------------- |
|
678 |
// |
|
679 |
void CGlxFullScreenViewImp::DeactivateFullScreen() |
|
680 |
{ |
|
681 |
TRACER("CGlxFullScreenViewImp::DeactivateFullScreen"); |
|
682 |
if (iCoverFlowWidget) |
|
683 |
{ |
|
684 |
iCoverFlowWidget->RemoveEventHandler(*this); |
|
685 |
iCoverFlowWidget->ShowWidget(EFalse); |
|
686 |
} |
|
687 |
if(iSliderWidget) |
|
688 |
{ |
|
689 |
iSliderWidget->RemoveEventHandler(*this); |
|
690 |
||
691 |
//show/hide the slider based on the return value of |
|
692 |
//IsHidden() |
|
693 |
if(iZoomControl->Activated()) |
|
694 |
{ |
|
695 |
HideUi(iSliderWidget->IsHidden()); |
|
696 |
} |
|
697 |
} |
|
698 |
} |
|
699 |
||
700 |
// --------------------------------------------------------------------------- |
|
701 |
//ActivateFullScreen function. |
|
702 |
// --------------------------------------------------------------------------- |
|
703 |
// |
|
704 |
void CGlxFullScreenViewImp::ActivateFullScreenL() |
|
705 |
{ |
|
706 |
TRACER("CGlxFullScreenViewImp::ActivateFullScreenL"); |
|
707 |
||
708 |
if (iCoverFlowWidget) |
|
709 |
{ |
|
710 |
iCoverFlowWidget->AddEventHandler(*this); |
|
711 |
iCoverFlowWidget->ShowWidget(ETrue); |
|
712 |
} |
|
713 |
if(iSliderWidget) |
|
714 |
{ |
|
715 |
iSliderWidget->AddEventHandler(*this); |
|
716 |
} |
|
717 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
718 |
GlxSetAppState::SetState(EGlxInFullScreenView); |
|
719 |
} |
|
720 |
||
721 |
// --------------------------------------------------------------------------- |
|
722 |
//ActivateZoomControl function. |
|
723 |
// --------------------------------------------------------------------------- |
|
724 |
// |
|
725 |
void CGlxFullScreenViewImp::ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* apZoomFocus) |
|
726 |
{ |
|
727 |
TRACER("CGlxFullScreenViewImp::ActivateZoomControlL"); |
|
728 |
/* |
|
729 |
* We will not do any zoom while HDMI is connected. |
|
730 |
* This is as part of HDMI improvements. |
|
731 |
*/ |
|
732 |
if (iHdmiController && iHdmiController->IsHDMIConnected()) |
|
733 |
{ |
|
734 |
// Hide zoom slider in HDMI mode as Zoom is disable. |
|
735 |
// Let the other screen furnitures intact. |
|
736 |
iSliderWidget->ShowWidget( EFalse); |
|
737 |
return; |
|
738 |
} |
|
739 |
TInt focus = iMediaList->FocusIndex(); |
|
740 |
TGlxMedia item = iMediaList->Item( focus ); |
|
741 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail); |
|
742 |
||
743 |
// Check if DRM rights expired for a specific media item |
|
744 |
TBool isDrmRightsValid = ETrue; |
|
745 |
if(item.IsDrmProtected()) |
|
746 |
{ |
|
747 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
748 |
{ |
|
749 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
750 |
iImageViewerInstance->ImageFileHandle(), (item.Category() |
|
751 |
== EMPXImage)); |
|
752 |
} |
|
753 |
else |
|
754 |
{ |
|
755 |
//Since it is always for the focused item - use DisplayItemRightsCheckL |
|
756 |
//instead of ItemRightsValidityCheckL |
|
757 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
758 |
item.Uri(), (item.Category() == EMPXImage)); |
|
759 |
} |
|
760 |
} |
|
761 |
// Activate Zoom if the item is an image and its DRM rights is not expired |
|
762 |
if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid) |
|
763 |
{ |
|
764 |
if(iZoomControl && !iZoomControl->Activated()) |
|
765 |
{ |
|
766 |
if(iHdmiController) |
|
767 |
{ |
|
768 |
TBool autoZoomOut = ETrue; |
|
769 |
//Set autozoomout to false in pinch zoom, since we would be |
|
770 |
//zooming out on deactivate once we get the release event. |
|
771 |
if(aStartMode == EZoomStartPinch) |
|
772 |
{ |
|
773 |
autoZoomOut = EFalse; |
|
774 |
} |
|
775 |
||
776 |
iHdmiController->ActivateZoom(autoZoomOut); |
|
777 |
} |
|
778 |
||
779 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider MaxRange = %d ", iSliderModel->MaxRange() ); |
|
780 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider MinRange = %d ", iSliderModel->MinRange() ); |
|
781 |
GLX_LOG_INFO1("ActivateZoomControlL: Slider PrimaryValue= %d", iSliderModel->PrimaryValue() ); |
|
782 |
||
783 |
if (aStartMode == EZoomStartSlider) |
|
784 |
{ |
|
785 |
iZoomControl->ActivateL(iSliderModel->PrimaryValue(),aStartMode, focus, |
|
786 |
item, apZoomFocus,iImgViewerMode); |
|
787 |
} |
|
788 |
else |
|
789 |
{ |
|
790 |
iZoomControl->ActivateL(GetInitialZoomLevel(),aStartMode, focus, |
|
791 |
item, apZoomFocus,iImgViewerMode); |
|
792 |
} |
|
793 |
// Now to remove all textures other than the one we are focussing on. |
|
794 |
TInt frameCount = KErrNone; |
|
795 |
item.GetFrameCount(frameCount); |
|
796 |
// If .gif file, then only call stopanimation |
|
797 |
if (frameCount > 1) |
|
798 |
{ |
|
799 |
iUiUtility->GlxTextureManager().AnimateMediaItem( |
|
800 |
item.Id(), EFalse); |
|
801 |
} |
|
802 |
TInt count = iMediaList->Count(); |
|
803 |
while (count > 0) |
|
804 |
{ |
|
805 |
TGlxMedia mediaItem = iMediaList->Item(count-1); |
|
806 |
if (mediaItem.Id() != item.Id() ) |
|
807 |
{ |
|
808 |
iUiUtility->GlxTextureManager().RemoveTexture(mediaItem.Id(),EFalse); |
|
809 |
} |
|
810 |
count--; |
|
811 |
} |
|
812 |
} |
|
813 |
else |
|
814 |
{ |
|
815 |
return; |
|
816 |
} |
|
817 |
DeactivateFullScreen(); |
|
818 |
GlxSetAppState::SetState(EGlxInZoomedView); |
|
819 |
} |
|
820 |
} |
|
821 |
||
822 |
// --------------------------------------------------------------------------- |
|
823 |
//DeactivateZoomControl function. |
|
824 |
// --------------------------------------------------------------------------- |
|
825 |
// |
|
826 |
void CGlxFullScreenViewImp::DeactivateZoomControlL() |
|
827 |
{ |
|
828 |
TRACER("CGlxFullScreenViewImp::DeactivateZoomControlL"); |
|
829 |
ActivateFullScreenL(); |
|
830 |
UpdateItems(); |
|
831 |
//Deactivate HDMI controller for zoom out while pinch zooming. |
|
832 |
if(iHdmiController) |
|
833 |
{ |
|
834 |
iHdmiController->DeactivateZoom(); |
|
835 |
} |
|
836 |
if(iZoomControl->Activated()) |
|
837 |
{ |
|
838 |
iZoomControl->Deactivate(); |
|
839 |
} |
|
840 |
if (iMediaList->FocusIndex() != KErrNotFound) |
|
841 |
{ |
|
842 |
TGlxMedia item = iMediaList->Item(iMediaList->FocusIndex()); |
|
843 |
TInt frameCount = KErrNone; |
|
844 |
item.GetFrameCount(frameCount); |
|
845 |
// If .gif file, then only call start animation |
|
846 |
if (frameCount > 1) |
|
847 |
{ |
|
848 |
iUiUtility->GlxTextureManager().AnimateMediaItem( |
|
849 |
item.Id(), ETrue); |
|
850 |
} |
|
851 |
} |
|
852 |
||
853 |
SetSliderToMin(); |
|
854 |
//check if the slider is already visible in zoom view. |
|
855 |
//if yes then do not disable the slider. |
|
856 |
TBool sliderInvisible = ETrue; |
|
857 |
if (EUiOn == iZoomControl->ZoomUiState()) |
|
858 |
{ |
|
859 |
sliderInvisible = EFalse; |
|
860 |
} |
|
861 |
||
862 |
HideUi(sliderInvisible); |
|
863 |
||
864 |
if (!sliderInvisible) |
|
865 |
{ |
|
866 |
//Set the UI State to On Explicitly since the slider is ON and we have |
|
867 |
//to disable on timeout. The timer is already cancelled in HideUi(). |
|
868 |
SetUiState(EUiOn); |
|
869 |
iTimer->Start(KGlxScreenTimeout,KGlxScreenTimeout,TCallBack( TimeOut,this )); |
|
870 |
} |
|
871 |
} |
|
872 |
||
873 |
// --------------------------------------------------------------------------- |
|
874 |
// From CAknView |
|
875 |
// View deactivation function. |
|
876 |
// --------------------------------------------------------------------------- |
|
877 |
// |
|
878 |
void CGlxFullScreenViewImp::DoMLViewDeactivate() |
|
879 |
{ |
|
880 |
TRACER("CGlxFullScreenViewImp::DoMLViewDeactivate"); |
|
881 |
//Disabling the toolbar here since it would give a crash when |
|
882 |
//we try to enable the toolbar in activate without exiting photos. |
|
883 |
if(!iImgViewerMode) |
|
884 |
{ |
|
885 |
// hide the toolbar |
|
886 |
EnableFSToolbar(EFalse); |
|
887 |
||
888 |
//Setting Soft key to EmptySoftKeys would cause crash |
|
889 |
//When Fullscreen is opened from ImageViewer. |
|
890 |
//And also, when Photos exits from FullScreen View. |
|
891 |
//So Set Soft Keys to empty only when not in Image Viewer mode |
|
892 |
//& Photos is not exiting. |
|
893 |
if( !iUiUtility->IsExitingState() ) |
|
894 |
{ |
|
895 |
CEikButtonGroupContainer* cba = Cba(); |
|
896 |
TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) ); |
|
897 |
cba->DrawNow(); |
|
898 |
} |
|
899 |
} |
|
900 |
else |
|
901 |
{ |
|
902 |
DeleteImageViewerInstance(); |
|
903 |
} |
|
904 |
||
905 |
HideUi(ETrue); |
|
906 |
// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. |
|
907 |
// So we do the below trick. The SK overlap is still there but much much less noticable. |
|
908 |
CCoeEnv::Static()->WsSession().Flush(); |
|
909 |
||
910 |
//Clear the last uri for which DRM Rights were consumed before going back to grid view |
|
911 |
//since the GridView::Activate() and FullScreen::DeActivate() can be called in any order, |
|
912 |
//this call is being made to be on safer side |
|
913 |
iDrmUtility->ClearLastConsumedItemUriL(); |
|
914 |
iScreenFurniture->ViewDeactivated(iViewUid); |
|
915 |
iImgViewerMode = EFalse; |
|
916 |
if (iHdmiController) |
|
917 |
{ |
|
918 |
delete iHdmiController; |
|
919 |
iHdmiController = NULL; |
|
920 |
} |
|
921 |
||
922 |
if(iZoomControl) |
|
923 |
{ |
|
924 |
if(iZoomControl->Activated()) |
|
925 |
{ |
|
926 |
iZoomControl->Deactivate(); |
|
927 |
} |
|
928 |
delete iZoomControl; |
|
929 |
iZoomControl = NULL; |
|
930 |
} |
|
931 |
DestroyWidgets(); |
|
932 |
iTimer->Cancel(); |
|
933 |
// Deregister active media list pointer |
|
934 |
iActiveMediaListRegistry->DeregisterActiveMediaList(iMediaList); |
|
935 |
||
936 |
/* |
|
937 |
* safe code-- if user press back very quickly |
|
938 |
* cancelling the timer while going back to prev view |
|
939 |
*/ |
|
940 |
if (iPeriodic->IsActive()) |
|
941 |
{ |
|
942 |
iPeriodic->Cancel(); |
|
943 |
} |
|
944 |
||
945 |
} |
|
946 |
// --------------------------------------------------------------------------- |
|
947 |
// Foreground event handling function. |
|
948 |
// --------------------------------------------------------------------------- |
|
949 |
// |
|
950 |
void CGlxFullScreenViewImp::HandleForegroundEventL(TBool aForeground) |
|
951 |
{ |
|
952 |
TRACER("CGlxFullScreenViewImp::HandleForegroundEventL"); |
|
953 |
CAknView::HandleForegroundEventL(aForeground); |
|
954 |
||
955 |
iUiUtility->SetForegroundStatus(aForeground); |
|
956 |
||
957 |
if(iMMCState) |
|
958 |
{ |
|
959 |
iMMCState =EFalse; |
|
960 |
NavigateToMainListL(); |
|
961 |
} |
|
962 |
||
963 |
if(iZoomControl && iZoomControl->Activated()) |
|
964 |
{ |
|
965 |
iZoomControl->HandleZoomForegroundEvent(aForeground); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
966 |
if (aForeground && iUri && !ConeUtils::FileExists(iUri->Des())) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
967 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
968 |
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
|
969 |
HandleItemRemovedL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
970 |
} |
60 | 971 |
} |
972 |
||
973 |
if (!aForeground) |
|
974 |
{ |
|
975 |
if(iHdmiController) |
|
976 |
{ |
|
977 |
iHdmiController->ShiftToCloningMode(); |
|
978 |
} |
|
979 |
iUiUtility->GlxTextureManager().FlushTextures(); |
|
980 |
} |
|
981 |
else |
|
982 |
{ |
|
983 |
if (iMediaList) |
|
984 |
{ |
|
985 |
/** if there is no image to show go back to the previous view */ |
|
986 |
if (!iMediaList->Count() && iNaviState->ViewingMode() |
|
987 |
== NGlxNavigationalState::EView) |
|
988 |
{ |
|
989 |
iUiUtility->SetViewNavigationDirection( |
|
990 |
EGlxNavigationBackwards); |
|
991 |
iNaviState->ActivatePreviousViewL(); |
|
992 |
} |
|
993 |
else if (iMediaListMulModelProvider) |
|
994 |
{ |
|
995 |
UpdateItems(); |
|
996 |
||
997 |
if (iHdmiController) |
|
998 |
{ |
|
999 |
iHdmiController->ShiftToPostingMode(); |
|
1000 |
} |
|
1001 |
} |
|
1002 |
} |
|
1003 |
} |
|
1004 |
} |
|
1005 |
||
1006 |
||
1007 |
// --------------------------------------------------------------------------- |
|
1008 |
// From IAlfWidgetEventHandler.. |
|
1009 |
// --------------------------------------------------------------------------- |
|
1010 |
// |
|
1011 |
bool CGlxFullScreenViewImp::accept( CAlfWidgetControl& /*aControl*/, |
|
1012 |
const TAlfEvent& /*aEvent*/) const |
|
1013 |
{ |
|
1014 |
TRACER("CGlxFullScreenViewImp::accept()"); |
|
1015 |
return ETrue; |
|
1016 |
} |
|
1017 |
||
1018 |
// --------------------------------------------------------------------------- |
|
1019 |
// From IAlfWidgetEventHandler.. |
|
1020 |
// --------------------------------------------------------------------------- |
|
1021 |
// |
|
1022 |
AlfEventStatus CGlxFullScreenViewImp::offerEvent( |
|
1023 |
CAlfWidgetControl& /*aControl*/, const TAlfEvent& aEvent) |
|
1024 |
{ |
|
1025 |
TRACER("CGlxFullScreenViewImp::offerEvent"); |
|
1026 |
// The below function call will not add any values except |
|
1027 |
// to reduce the codescanner warnings to one |
|
1028 |
return OfferEventL(aEvent); |
|
1029 |
} |
|
1030 |
||
1031 |
// --------------------------------------------------------------------------- |
|
1032 |
// OfferEventL() |
|
1033 |
// --------------------------------------------------------------------------- |
|
1034 |
// |
|
1035 |
AlfEventStatus CGlxFullScreenViewImp::OfferEventL(const TAlfEvent& aEvent) |
|
1036 |
{ |
|
1037 |
TRACER("CGlxFullScreenViewImp::offerEventL"); |
|
1038 |
if ( aEvent.IsKeyEvent()) |
|
1039 |
{ |
|
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1040 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::OfferEventL aEvent.KeyEvent().iScanCode: %d",aEvent.KeyEvent().iScanCode); |
60 | 1041 |
switch ( aEvent.KeyEvent().iScanCode ) |
1042 |
{ |
|
1043 |
case EStdKeyNkpAsterisk : |
|
1044 |
if(iUiUtility->IsPenSupported()) |
|
1045 |
{ |
|
1046 |
return EEventNotHandled; |
|
1047 |
} |
|
1048 |
case EStdKeyIncVolume : |
|
1049 |
//Listen EStdKeyApplicationD as EKeyZoomIn key is mapped to TKeyCode:: |
|
1050 |
//EKeyApplicationC for which TStdScancode is EStdKeyApplicatoinC |
|
1051 |
case EStdKeyApplicationC: |
|
1052 |
{ |
|
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1053 |
TInt focusIndex = iMediaList->FocusIndex(); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1054 |
if (focusIndex >= 0 && focusIndex < iMediaList->Count()) |
60 | 1055 |
{ |
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1056 |
if (EEventKey == aEvent.Code() && (EMPXImage |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1057 |
== iMediaList->Item(focusIndex).Category())) |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1058 |
{ |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1059 |
HideUi(EFalse); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1060 |
SetSliderToMin(); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1061 |
TRAP_IGNORE(ActivateZoomControlL(EZoomStartKey)); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1062 |
return EEventHandled; |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1063 |
} |
60 | 1064 |
} |
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1065 |
// Fall through to show the UI in case of EMPXVideo |
60 | 1066 |
} |
1067 |
case EStdKeyUpArrow: |
|
1068 |
case EStdKeyDownArrow: |
|
1069 |
case EStdKeyDevice0: |
|
1070 |
case EStdKeyDevice1: |
|
1071 |
//Listen EStdKeyApplicationC as EKeyZoomOut key is mapped to TKeyCode:: |
|
1072 |
//EKeyApplicationD for which TStdScancode is EStdKeyApplicatoinD |
|
1073 |
case EStdKeyApplicationD: |
|
1074 |
{ |
|
1075 |
if ( EUiOff == GetUiState()&& ( |
|
1076 |
aEvent.Code() == EEventKey ) ) |
|
1077 |
{ |
|
1078 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1079 |
ShowUiL(ETrue); |
|
1080 |
} |
|
1081 |
return EEventHandled; |
|
1082 |
} |
|
1083 |
case EStdKeyLeftArrow: |
|
1084 |
case EStdKeyRightArrow: |
|
1085 |
{ |
|
1086 |
if ( EUiOn == GetUiState() ) |
|
1087 |
{ |
|
1088 |
HideUi(ETrue); |
|
1089 |
} |
|
1090 |
return EEventHandled; |
|
1091 |
} |
|
1092 |
case EStdKeyApplication1C: |
|
1093 |
{ |
|
1094 |
if(iUiUtility->IsPenSupported()) |
|
1095 |
{ |
|
1096 |
return EEventNotHandled; |
|
1097 |
} |
|
1098 |
else |
|
1099 |
{ |
|
1100 |
ProcessCommandL(KGlxCmdMnShowMap); |
|
1101 |
return EEventHandled; |
|
1102 |
} |
|
1103 |
} |
|
1104 |
default: |
|
1105 |
return EEventNotHandled; |
|
1106 |
} |
|
1107 |
} |
|
1108 |
if(!aEvent.IsCustomEvent()) |
|
1109 |
{ |
|
1110 |
GLX_LOG_INFO("Event Not Handled"); |
|
1111 |
return EEventNotHandled; |
|
1112 |
} |
|
1113 |
||
1114 |
if(aEvent.IsCustomEvent()) |
|
1115 |
{ |
|
1116 |
TInt eventId = aEvent.CustomParameter(); |
|
1117 |
||
1118 |
switch(eventId) |
|
1119 |
{ |
|
1120 |
case KAlfActionIdDeviceLayoutChanged: |
|
1121 |
{ |
|
1122 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
1123 |
||
1124 |
iScreenFurniture->SetToolbarPosition(); |
|
1125 |
||
1126 |
return EEventNotHandled; |
|
1127 |
} |
|
1128 |
case ETypeSelect: |
|
1129 |
{ |
|
1130 |
TBool pensupport = iUiUtility->IsPenSupported(); |
|
1131 |
if ( pensupport ) |
|
1132 |
{ |
|
1133 |
if ( EUiOn == GetUiState() ) |
|
1134 |
{ |
|
1135 |
//Hide the slider |
|
1136 |
HideUi(ETrue); |
|
1137 |
} |
|
1138 |
else |
|
1139 |
{ |
|
1140 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1141 |
ShowUiL(ETrue); |
|
1142 |
} |
|
1143 |
} |
|
1144 |
else |
|
1145 |
{ |
|
1146 |
if ( EUiOff == GetUiState() ) |
|
1147 |
{ |
|
1148 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1149 |
ShowUiL(ETrue); |
|
1150 |
} |
|
1151 |
} |
|
1152 |
} |
|
1153 |
break; |
|
1154 |
||
1155 |
case ETypeRemove: |
|
1156 |
{ |
|
1157 |
// If From photos, delete the img. |
|
1158 |
// If Image-Viewer collection and not in private Path |
|
1159 |
// handle the "C" or BackSpace key to delete the item |
|
1160 |
if (!iImgViewerMode || (iImageViewerInstance |
|
1161 |
&& !iImageViewerInstance->IsPrivate())) |
|
1162 |
{ |
|
1163 |
ProcessCommandL(EGlxCmdDelete); |
|
1164 |
return EEventConsumed; |
|
1165 |
} |
|
1166 |
return EEventNotHandled; |
|
1167 |
} |
|
1168 |
case ETypeDoubleTap: |
|
1169 |
{ |
|
1170 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeDoubleTap"); |
|
1171 |
||
1172 |
MulDoubleTapData* DoubleTapData = (MulDoubleTapData*)(aEvent.CustomEventData()); |
|
1173 |
TPoint doubleTapPoint = DoubleTapData->mDoubleTapPoint; |
|
1174 |
TInt focus = iMediaList->FocusIndex(); |
|
1175 |
TGlxMedia item = iMediaList->Item( focus ); |
|
1176 |
TSize size; |
|
1177 |
item.GetDimensions( size ); |
|
1178 |
TRect rect = AlfUtil::ScreenSize(); |
|
1179 |
TInt zoomLevel = GetInitialZoomLevel(); |
|
1180 |
TInt tlX = (rect.Width() - (size.iWidth*zoomLevel)/100)/2; |
|
1181 |
TInt tlY = (rect.Height() - (size.iHeight*zoomLevel)/100)/2; |
|
1182 |
TRect imageRect(TPoint(tlX, tlY), TSize((size.iWidth*zoomLevel)/100, (size.iHeight*zoomLevel)/100)); |
|
1183 |
if (imageRect.Contains(doubleTapPoint)) |
|
1184 |
{ |
|
1185 |
SetSliderToMin(); |
|
1186 |
TRAP_IGNORE( ActivateZoomControlL(EZoomStartDoubleTap, &doubleTapPoint) ); |
|
1187 |
} |
|
1188 |
return EEventConsumed; |
|
1189 |
} |
|
1190 |
case ETypeItemRemoved: |
|
1191 |
{ |
|
1192 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeItemRemoved"); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1193 |
HandleItemRemovedL(); |
60 | 1194 |
return EEventConsumed; |
1195 |
} |
|
1196 |
case ETypeHighlight: |
|
1197 |
{ |
|
1198 |
GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeHighlight"); |
|
1199 |
iMediaList->SetFocusL( NGlxListDefs::EAbsolute,(aEvent.CustomEventData())); |
|
1200 |
if (AknLayoutUtils::PenEnabled()) |
|
1201 |
{ |
|
1202 |
iMediaList->SetVisibleWindowIndexL(aEvent.CustomEventData()); |
|
1203 |
} |
|
1204 |
if(iMediaList->Count()> KFullScreenTextureOffset) |
|
1205 |
{ |
|
1206 |
RemoveTexture(); |
|
1207 |
} |
|
1208 |
SetItemToHDMIL(); |
|
1209 |
if ( EUiOn == GetUiState() ) |
|
1210 |
{ |
|
1211 |
HideUi(ETrue); |
|
1212 |
} |
|
1213 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
|
1214 |
return EEventConsumed; |
|
1215 |
} |
|
1216 |
case EVideoIconSelect: |
|
1217 |
{ |
|
1218 |
TGlxMedia item = iMediaList->Item( iMediaList->FocusIndex() ); |
|
1219 |
if(item.Category() == EMPXVideo) |
|
1220 |
{ |
|
1221 |
ProcessCommandL(EGlxCmdPlay); |
|
1222 |
iViewWidget->show(false); |
|
1223 |
} |
|
1224 |
else |
|
1225 |
{ |
|
1226 |
if ( EUiOn == GetUiState() ) |
|
1227 |
{ |
|
1228 |
HideUi(ETrue); |
|
1229 |
} |
|
1230 |
else |
|
1231 |
{ |
|
1232 |
//the Ui timer should be started once the UI screen furniture is shown |
|
1233 |
ShowUiL(ETrue); |
|
1234 |
} |
|
1235 |
} |
|
1236 |
} |
|
1237 |
break; |
|
1238 |
//Zoom Start via pinch |
|
1239 |
case ETypePinch: |
|
1240 |
// Handle only a pinch out. not a pinch in. |
|
1241 |
if (KGlxNeutralPinchPosition < aEvent.CustomEventData()) |
|
1242 |
{ |
|
1243 |
SetSliderToMin(); |
|
1244 |
TRAP_IGNORE( ActivateZoomControlL(EZoomStartPinch)); |
|
1245 |
} |
|
1246 |
return EEventConsumed; // will be consumed even if we are pinching IN (trying to zoom OUT). |
|
1247 |
//slider event handling |
|
1248 |
case ETypePrimaryValueChange: |
|
1249 |
{ |
|
1250 |
iTimer->Cancel(); |
|
1251 |
iSliderWidget->ShowWidget( ETrue, 0 ); |
|
1252 |
TRAPD( err, ActivateZoomControlL(EZoomStartSlider)); |
|
1253 |
if (err != KErrNone) |
|
1254 |
{ |
|
1255 |
iSliderModel->SetPrimaryValue(GetInitialZoomLevel()); |
|
1256 |
} |
|
1257 |
} |
|
1258 |
return EEventConsumed; |
|
1259 |
default: |
|
1260 |
return EEventNotHandled; |
|
1261 |
} |
|
1262 |
} |
|
1263 |
return EEventNotHandled; |
|
1264 |
} |
|
1265 |
// --------------------------------------------------------------------------- |
|
1266 |
// From HandleViewCommandL.. |
|
1267 |
// --------------------------------------------------------------------------- |
|
1268 |
// |
|
1269 |
TBool CGlxFullScreenViewImp::HandleViewCommandL(TInt aCommand) |
|
1270 |
{ |
|
1271 |
TRACER("GCGlxFullScreenViewImp::HandleViewCommandL"); |
|
1272 |
//size calculated for rotation |
|
1273 |
TSize size = iUiUtility->GetRotatedImageSize(); // ViewBase iUiUtility is use |
|
1274 |
TBool consumed = EFalse; |
|
1275 |
switch (aCommand) |
|
1276 |
{ |
|
1277 |
case EGlxCmdResetView: |
|
1278 |
{ |
|
1279 |
HideUi(ETrue); |
|
1280 |
if (iIsDialogLaunched && iIsMMCRemoved) |
|
1281 |
{ |
|
1282 |
ProcessCommandL(EAknSoftkeyExit); |
|
1283 |
} |
|
1284 |
consumed = ETrue; |
|
1285 |
iIsDialogLaunched = EFalse; |
|
1286 |
break; |
|
1287 |
} |
|
1288 |
case EGlxCmdFullScreenBack: |
|
1289 |
DeactivateZoomControlL(); |
|
1290 |
//Show the screen furniture when we press back from zoom |
|
1291 |
ShowUiL(ETrue); |
|
1292 |
consumed = ETrue; |
|
1293 |
break; |
|
1294 |
case EGlxCmdRenameCompleted: |
|
1295 |
{ |
|
1296 |
SetItemToHDMIL(); |
|
1297 |
consumed = ETrue; |
|
1298 |
break; |
|
1299 |
} |
|
1300 |
case EGlxCmdDialogLaunched: |
|
1301 |
{ |
|
1302 |
iIsDialogLaunched = ETrue; |
|
1303 |
break; |
|
1304 |
} |
|
1305 |
case EGlxCmdDialogDismissed: |
|
1306 |
{ |
|
1307 |
if (iIsDialogLaunched && iIsMMCRemoved) |
|
1308 |
{ |
|
1309 |
ProcessCommandL(EAknSoftkeyExit); |
|
1310 |
} |
|
1311 |
consumed = ETrue; |
|
1312 |
iIsDialogLaunched = EFalse; |
|
1313 |
break; |
|
1314 |
} |
|
1315 |
case EAknSoftkeyBack: |
|
1316 |
{ |
|
1317 |
HideUi(ETrue); |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1318 |
// Enable status pane and Set null text |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1319 |
StatusPane()->MakeVisible(ETrue); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1320 |
SetTitlePaneTextL(KNullDesC); |
60 | 1321 |
break; |
1322 |
} |
|
1323 |
} |
|
1324 |
return consumed; |
|
1325 |
} |
|
1326 |
||
1327 |
// --------------------------------------------------------------------------- |
|
1328 |
// From HandleCommandL.. |
|
1329 |
// --------------------------------------------------------------------------- |
|
1330 |
// |
|
1331 |
void CGlxFullScreenViewImp::HandleCommandL(TInt aCommandId, CAlfControl* aControl) |
|
1332 |
{ |
|
1333 |
TRACER("CGlxFullScreenViewImp::HandleCommandLCAlfControl"); |
|
1334 |
//Gets a callback from zoomview if zoomlevel goes beyound the launch zoomlevel |
|
1335 |
// and activates the fullscreenview |
|
1336 |
if (aControl == iZoomControl) |
|
1337 |
{ |
|
1338 |
if (aCommandId == KGlxZoomOutCommand) |
|
1339 |
{ |
|
1340 |
DeactivateZoomControlL(); |
|
1341 |
} |
|
1342 |
else if(aCommandId == KGlxZoomOrientationChange) |
|
1343 |
{ |
|
1344 |
iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); |
|
1345 |
} |
|
1346 |
} |
|
1347 |
} |
|
1348 |
||
1349 |
// --------------------------------------------------------------------------- |
|
1350 |
// From HandleResourceChangeL.. |
|
1351 |
// --------------------------------------------------------------------------- |
|
1352 |
// |
|
1353 |
void CGlxFullScreenViewImp::HandleResourceChangeL (TInt aType) |
|
1354 |
{ |
|
1355 |
TRACER("CGlxFullScreenViewImp::HandleResourceChangeL"); |
|
1356 |
HandleResourceChangeL ( aType); |
|
1357 |
} |
|
1358 |
||
1359 |
//---------------------------------------------------------------------------------- |
|
1360 |
// InitialZoomLevel:Calculate the initial Zoom Level for the Image |
|
1361 |
//---------------------------------------------------------------------------------- |
|
1362 |
// |
|
1363 |
TInt CGlxFullScreenViewImp::GetInitialZoomLevel() |
|
1364 |
{ |
|
1365 |
TRACER("CGlxFullScreenViewImp::InitialZoomLevel"); |
|
1366 |
TInt focus = iMediaList->FocusIndex(); |
|
1367 |
TGlxMedia item = iMediaList->Item( focus ); |
|
1368 |
TSize size; |
|
1369 |
TUint8 initialZoomLevel; |
|
1370 |
item.GetDimensions( size ); |
|
1371 |
if (KGlxDecodingThreshold < (size.iWidth * size.iHeight)) |
|
1372 |
{ |
|
1373 |
TReal areaRatio = TReal(size.iWidth*size.iHeight)/KGlxDecodingThreshold ; |
|
1374 |
||
1375 |
TReal sideRatio; |
|
1376 |
Math::Sqrt(sideRatio, areaRatio); |
|
1377 |
||
1378 |
size.iHeight = size.iHeight / sideRatio ; |
|
1379 |
size.iWidth = size.iWidth / sideRatio ; |
|
1380 |
} |
|
1381 |
TRect rect = AlfUtil::ScreenSize(); |
|
1382 |
||
1383 |
if( rect.Width()>= size.iWidth && rect.Height() >= size.iHeight) |
|
1384 |
{ |
|
1385 |
//if Both the Width and Height are lesser than the screen size,the initial Zoom Level will be 100 |
|
1386 |
initialZoomLevel = KGlxMinSmallImageZoomLevel; |
|
1387 |
} |
|
1388 |
else |
|
1389 |
{ |
|
1390 |
//Calculate (Display Area Width) /Image Width * 100 |
|
1391 |
//Calculate (Display Area Height) /Image Height * 100 |
|
1392 |
//Choose the Minimum Of the above. |
|
1393 |
TReal32 imageWidthRatio = ((TReal32) rect.Width() / size.iWidth )*100.0F; |
|
1394 |
TReal32 imageHeightRatio = ((TReal32)rect.Height()/ size.iHeight )*100.0F; |
|
1395 |
initialZoomLevel = Min(imageWidthRatio,imageHeightRatio); |
|
1396 |
} |
|
1397 |
||
1398 |
// A correction of 0.5 (KGlxRealTruncationPadding) is added to the resultant value. |
|
1399 |
// This ensures that all return values greater than X.5 (e.g lets say 12.8) is pegged to X+1(13) |
|
1400 |
// instead of X(12) while calculating. |
|
1401 |
// Changing the calculations to real might have been a better idea, |
|
1402 |
// but that involves many changes in many places and was therefore avoided, |
|
1403 |
// maybe a good idea to take up in PS2. |
|
1404 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetInitialZoomLevel() = %d ", KGlxRealTruncationPadding + initialZoomLevel); |
|
1405 |
return KGlxRealTruncationPadding + initialZoomLevel ; |
|
1406 |
} |
|
1407 |
||
1408 |
//---------------------------------------------------------------------------------- |
|
1409 |
// SetSliderLevel() Set the Initial Zoom Level for the Image |
|
1410 |
//---------------------------------------------------------------------------------- |
|
1411 |
// |
|
1412 |
void CGlxFullScreenViewImp::SetSliderToMin() |
|
1413 |
{ |
|
1414 |
TRACER("CGlxFullScreenViewImp::SetSliderLevel"); |
|
1415 |
||
1416 |
TInt value = GetInitialZoomLevel(); |
|
1417 |
if(iSliderModel) |
|
1418 |
{ |
|
1419 |
iSliderModel->SetMinRange(value); |
|
1420 |
(value==KGlxMaxBigImageZoomLevel)?(iSliderModel->SetMaxRange(KGlxMaxSmallImageZoomLevel)) |
|
1421 |
:(iSliderModel->SetMaxRange(KGlxMaxBigImageZoomLevel)); |
|
1422 |
iSliderModel->SetPrimaryValue(value); |
|
1423 |
} |
|
1424 |
} |
|
1425 |
||
1426 |
// --------------------------------------------------------------------------- |
|
1427 |
// From IAlfWidgetEventHandler.. |
|
1428 |
// --------------------------------------------------------------------------- |
|
1429 |
// |
|
1430 |
void CGlxFullScreenViewImp::setEventHandlerData( |
|
1431 |
const AlfWidgetEventHandlerInitData& /*aData*/) |
|
1432 |
{ |
|
1433 |
TRACER("CGlxFullScreenViewImp::setEventHandlerData"); |
|
1434 |
} |
|
1435 |
||
1436 |
// --------------------------------------------------------------------------- |
|
1437 |
// From IAlfWidgetEventHandler.. |
|
1438 |
// --------------------------------------------------------------------------- |
|
1439 |
// |
|
1440 |
AlfWidgetEventHandlerInitData* CGlxFullScreenViewImp::eventHandlerData() |
|
1441 |
{ |
|
1442 |
TRACER("CGlxFullScreenViewImp::eventHandlerData"); |
|
1443 |
return NULL; |
|
1444 |
} |
|
1445 |
||
1446 |
// --------------------------------------------------------------------------- |
|
1447 |
// From IAlfWidgetEventHandler. |
|
1448 |
// --------------------------------------------------------------------------- |
|
1449 |
// |
|
1450 |
void CGlxFullScreenViewImp::setActiveStates( unsigned int /*aStates*/ ) |
|
1451 |
{ |
|
1452 |
TRACER("CGlxFullScreenViewImp::setActiveStates"); |
|
1453 |
} |
|
1454 |
||
1455 |
// --------------------------------------------------------------------------- |
|
1456 |
// From IAlfWidgetEventHandler. |
|
1457 |
// --------------------------------------------------------------------------- |
|
1458 |
// |
|
1459 |
||
1460 |
IAlfInterfaceBase* CGlxFullScreenViewImp::makeInterface( const IfId& /*aType*/ ) |
|
1461 |
{ |
|
1462 |
TRACER("CGlxFullScreenViewImp::makeInterface"); |
|
1463 |
return NULL; |
|
1464 |
} |
|
1465 |
||
1466 |
//---------------------------------------------------------------------------------- |
|
1467 |
// eventHandlerType |
|
1468 |
//---------------------------------------------------------------------------------- |
|
1469 |
// |
|
1470 |
IAlfWidgetEventHandler::AlfEventHandlerType CGlxFullScreenViewImp::eventHandlerType() |
|
1471 |
{ |
|
1472 |
TRACER("CGlxFullScreenViewImp::eventHandlerType"); |
|
1473 |
return IAlfWidgetEventHandler::ELogicalEventHandler; |
|
1474 |
} |
|
1475 |
||
1476 |
//---------------------------------------------------------------------------------- |
|
1477 |
// eventExecutionPhase |
|
1478 |
//---------------------------------------------------------------------------------- |
|
1479 |
// |
|
1480 |
IAlfWidgetEventHandler::AlfEventHandlerExecutionPhase CGlxFullScreenViewImp::eventExecutionPhase() |
|
1481 |
{ |
|
1482 |
TRACER("CGlxFullScreenViewImp::eventHandlerType"); |
|
1483 |
return EBubblingPhaseEventHandler; |
|
1484 |
} |
|
1485 |
||
1486 |
// ----------------------------------------------------------------------------- |
|
1487 |
// Callback from periodic timer |
|
1488 |
// ----------------------------------------------------------------------------- |
|
1489 |
// |
|
1490 |
TInt CGlxFullScreenViewImp::PeriodicCallback(TAny* aPtr ) |
|
1491 |
{ |
|
1492 |
TRACER("CGlxFullScreenViewImp::PeriodicCallback"); |
|
1493 |
static_cast< CGlxFullScreenViewImp* >( aPtr )->CallPeriodicCallback(); |
|
1494 |
return KErrNone; |
|
1495 |
} |
|
1496 |
||
1497 |
// ----------------------------------------------------------------------------- |
|
1498 |
// Callback from periodic timer-- non static |
|
1499 |
// ----------------------------------------------------------------------------- |
|
1500 |
// |
|
1501 |
inline void CGlxFullScreenViewImp::CallPeriodicCallback() |
|
1502 |
{ |
|
1503 |
TRACER("CGlxFullScreenViewImp::CallPeriodicCallback"); |
|
1504 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
|
1505 |
} |
|
1506 |
||
1507 |
// --------------------------------------------------------------------------- |
|
1508 |
// Shows expiry note / Consumes DRM rights for expired DRM files |
|
1509 |
// --------------------------------------------------------------------------- |
|
1510 |
// |
|
1511 |
void CGlxFullScreenViewImp::ShowDrmExpiryNoteL() |
|
1512 |
{ |
|
1513 |
TRACER("CGlxFullScreenViewImp::ShowDrmExpiryNoteL"); |
|
1514 |
if (iMediaList->Count() > 0) |
|
1515 |
{ |
|
1516 |
const TGlxMedia& media = iMediaList->Item(iMediaList->FocusIndex()); |
|
1517 |
TInt tnError = GlxErrorManager::HasAttributeErrorL( |
|
1518 |
media.Properties(), KGlxMediaIdThumbnail); |
|
1519 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1520 |
" tnError=%d ", tnError); |
|
1521 |
||
1522 |
if (media.IsDrmProtected()) |
|
1523 |
{ |
|
1524 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1525 |
"- ConsumeDRMRightsL()"); |
|
1526 |
//Consume DRM Rights & cancel Periodic timer for DRM images |
|
1527 |
//only if Quality TN is available |
|
1528 |
ConsumeDRMRightsL(media); |
|
1529 |
} |
|
1530 |
else |
|
1531 |
{ |
|
1532 |
//Cancel the periodic timer if quality thumbnail is available |
|
1533 |
//and no error in fetching quality thumbnail. |
|
1534 |
TSize tnSize = iUiUtility->DisplaySize(); |
|
1535 |
TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1536 |
GlxFullThumbnailAttributeId(ETrue, tnSize.iWidth, |
|
1537 |
tnSize.iHeight)); |
|
1538 |
const CGlxThumbnailAttribute* qtyTn = media.ThumbnailAttribute( |
|
1539 |
qtyTnAttrib); |
|
1540 |
if (qtyTn && tnError == KErrNone) |
|
1541 |
{ |
|
1542 |
if (iPeriodic->IsActive()) |
|
1543 |
{ |
|
1544 |
iPeriodic->Cancel(); |
|
1545 |
} |
|
1546 |
} |
|
1547 |
} |
|
1548 |
||
1549 |
//check if any Error message is to be displayed |
|
1550 |
TMPXGeneralCategory cat = media.Category(); |
|
1551 |
TBool checkViewRights = ETrue; |
|
1552 |
if (media.IsDrmProtected()) |
|
1553 |
{ |
|
1554 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1555 |
"- ItemRightsValidityCheckL()"); |
|
1556 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1557 |
{ |
|
1558 |
checkViewRights = iDrmUtility->ItemRightsValidityCheckL( |
|
1559 |
iImageViewerInstance->ImageFileHandle(), |
|
1560 |
(media.Category() == EMPXImage)); |
|
1561 |
} |
|
1562 |
else |
|
1563 |
{ |
|
1564 |
//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL |
|
1565 |
checkViewRights = iDrmUtility->ItemRightsValidityCheckL( |
|
1566 |
media.Uri(), (media.Category() == EMPXImage)); |
|
1567 |
} |
|
1568 |
} |
|
1569 |
if (checkViewRights && tnError != KErrNone) |
|
1570 |
{ |
|
1571 |
if (iPeriodic->IsActive()) |
|
1572 |
{ |
|
1573 |
iPeriodic->Cancel(); |
|
1574 |
} |
|
1575 |
||
1576 |
if (iImgViewerMode) |
|
1577 |
{ |
|
1578 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()" |
|
1579 |
"- ShowErrorNoteL(%d)", tnError); |
|
1580 |
if (tnError == KErrNoMemory || tnError == KErrNotSupported |
|
1581 |
|| tnError == KErrInUse || tnError == KErrDiskFull |
|
1582 |
|| tnError == KErrTimedOut || tnError |
|
1583 |
== KErrPermissionDenied) |
|
1584 |
{ |
|
1585 |
GlxGeneralUiUtilities::ShowErrorNoteL(tnError); |
|
1586 |
} |
|
1587 |
else |
|
1588 |
{ |
|
1589 |
// Generic "Unable to open image" error note |
|
1590 |
HBufC* str = StringLoader::LoadLC( |
|
1591 |
R_GLX_ERR_FORMAT_UNKNOWN); |
|
1592 |
CAknErrorNote* note = new (ELeave) CAknErrorNote(ETrue); |
|
1593 |
note->ExecuteLD(*str); // ignore return value, not used |
|
1594 |
CleanupStack::PopAndDestroy(str); |
|
1595 |
} |
|
1596 |
} |
|
1597 |
} |
|
1598 |
} |
|
1599 |
} |
|
1600 |
||
1601 |
// --------------------------------------------------------------------------- |
|
1602 |
// Consumes DRM rights / Shows DRM rights (if expired) information |
|
1603 |
// for DRM files |
|
1604 |
// --------------------------------------------------------------------------- |
|
1605 |
// |
|
1606 |
void CGlxFullScreenViewImp::ConsumeDRMRightsL(const TGlxMedia& aMedia) |
|
1607 |
{ |
|
1608 |
TRACER("CGlxFullScreenViewImp::ConsumeDRMRightsL"); |
|
1609 |
const TDesC& uri = aMedia.Uri(); |
|
1610 |
if (uri.Length() > 0) |
|
1611 |
{ |
|
1612 |
// check if rights have expired |
|
1613 |
TBool expired = EFalse; |
|
1614 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1615 |
{ |
|
1616 |
expired = !iDrmUtility->ItemRightsValidityCheckL( |
|
1617 |
iImageViewerInstance->ImageFileHandle(), |
|
1618 |
ETrue); |
|
1619 |
} |
|
1620 |
else |
|
1621 |
{ |
|
1622 |
expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue); |
|
1623 |
} |
|
1624 |
||
1625 |
if (expired) |
|
1626 |
{ |
|
1627 |
if (iPeriodic->IsActive()) |
|
1628 |
{ |
|
1629 |
iPeriodic->Cancel(); |
|
1630 |
} |
|
1631 |
iBusyIcon->ShowBusyIconL(EFalse); |
|
1632 |
if(iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1633 |
{ |
|
1634 |
iDrmUtility->ShowRightsInfoL(iImageViewerInstance->ImageFileHandle()); |
|
1635 |
} |
|
1636 |
else |
|
1637 |
{ |
|
1638 |
iDrmUtility->ShowRightsInfoL(uri); |
|
1639 |
} |
|
1640 |
return; |
|
1641 |
} |
|
1642 |
||
1643 |
TSize tnSize = iUiUtility->DisplaySize(); |
|
1644 |
TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1645 |
GlxFullThumbnailAttributeId(ETrue, tnSize.iWidth, |
|
1646 |
tnSize.iHeight)); |
|
1647 |
const CGlxThumbnailAttribute* qtyTn = aMedia.ThumbnailAttribute( |
|
1648 |
qtyTnAttrib); |
|
1649 |
||
1650 |
TInt tnError = GlxErrorManager::HasAttributeErrorL( |
|
1651 |
aMedia.Properties(), KGlxMediaIdThumbnail); |
|
1652 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::ConsumeDRMRightsL()" |
|
1653 |
" tnError=%d ", tnError); |
|
1654 |
if (qtyTn && tnError == KErrNone) |
|
1655 |
{ |
|
1656 |
if (iPeriodic->IsActive()) |
|
1657 |
{ |
|
1658 |
iPeriodic->Cancel(); |
|
1659 |
} |
|
1660 |
GLX_LOG_INFO("CGlxFullScreenViewImp::ConsumeDRMRightsL()" |
|
1661 |
"- ConsumeRights"); |
|
1662 |
if(iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
1663 |
{ |
|
1664 |
iDrmUtility->ConsumeRightsL(iImageViewerInstance->ImageFileHandle()); |
|
1665 |
} |
|
1666 |
else |
|
1667 |
{ |
|
1668 |
iDrmUtility->ConsumeRightsL(uri); |
|
1669 |
} |
|
1670 |
} |
|
1671 |
} |
|
1672 |
} |
|
1673 |
||
1674 |
// --------------------------------------------------------------------------- |
|
1675 |
// |
|
1676 |
// Gets the Swipe direction |
|
1677 |
// --------------------------------------------------------------------------- |
|
1678 |
// |
|
1679 |
TSwipe CGlxFullScreenViewImp::GetSwipeDirection() |
|
1680 |
{ |
|
1681 |
TRACER("CGlxFullScreenViewImp::GetSwipeDirection"); |
|
1682 |
||
1683 |
TInt count = iMediaList->Count(); |
|
1684 |
TInt focusindex = iMediaList->FocusIndex(); |
|
1685 |
TSwipe swipedirection; |
|
1686 |
||
1687 |
if(focusindex == 0) |
|
1688 |
{ |
|
1689 |
swipedirection = (iOldFocusIndex == 1 ? EBackward : EForward); |
|
1690 |
} |
|
1691 |
else if(focusindex == count-1) |
|
1692 |
{ |
|
1693 |
swipedirection = (iOldFocusIndex == 0 ? EBackward : EForward); |
|
1694 |
} |
|
1695 |
else |
|
1696 |
{ |
|
1697 |
swipedirection = (focusindex-iOldFocusIndex < 0 ? EBackward : EForward) ; |
|
1698 |
} |
|
1699 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetSwipeDirection()" |
|
1700 |
" Direction = [%d] ", swipedirection); |
|
1701 |
||
1702 |
return swipedirection; |
|
1703 |
} |
|
1704 |
||
1705 |
// --------------------------------------------------------------------------- |
|
1706 |
// |
|
1707 |
// Gets the index of the item for which the texture has to be removed |
|
1708 |
// --------------------------------------------------------------------------- |
|
1709 |
// |
|
1710 |
TInt CGlxFullScreenViewImp::GetIndexToBeRemoved() |
|
1711 |
{ |
|
1712 |
TRACER("CGlxFullScreenViewImp::GetIndexToBeRemoved"); |
|
1713 |
||
1714 |
TSwipe swipedirection = GetSwipeDirection(); |
|
1715 |
TInt indextoberemoved; |
|
1716 |
TInt count = iMediaList->Count(); |
|
1717 |
TInt focusindex = iMediaList->FocusIndex(); |
|
1718 |
if(swipedirection == EForward) |
|
1719 |
{ |
|
1720 |
indextoberemoved = focusindex-KFullScreenIterator; |
|
1721 |
if(indextoberemoved < 0) |
|
1722 |
{ |
|
1723 |
indextoberemoved = count+indextoberemoved; |
|
1724 |
} |
|
1725 |
} |
|
1726 |
else |
|
1727 |
{ |
|
1728 |
indextoberemoved = focusindex+KFullScreenIterator; |
|
1729 |
if(indextoberemoved > count-1) |
|
1730 |
{ |
|
1731 |
indextoberemoved = indextoberemoved-count; |
|
1732 |
} |
|
1733 |
} |
|
1734 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::GetIndexToBeRemoved index tobe removed %d",indextoberemoved ); |
|
1735 |
return indextoberemoved; |
|
1736 |
} |
|
1737 |
||
1738 |
// --------------------------------------------------------------------------- |
|
1739 |
// |
|
1740 |
// Remove the texture on every swipe while HDMI is connected. |
|
1741 |
// --------------------------------------------------------------------------- |
|
1742 |
// |
|
1743 |
void CGlxFullScreenViewImp::RemoveTexture() |
|
1744 |
{ |
|
1745 |
TRACER("CGlxFullScreenViewImp::RemoveTexture"); |
|
1746 |
||
1747 |
const TGlxMedia& item = iMediaList->Item(GetIndexToBeRemoved()); |
|
1748 |
iUiUtility->GlxTextureManager().RemoveTexture(item.Id(),EFalse); |
|
1749 |
} |
|
1750 |
||
1751 |
// --------------------------------------------------------------------------- |
|
1752 |
// |
|
1753 |
// Set the focused item to external display - HDMI |
|
1754 |
// --------------------------------------------------------------------------- |
|
1755 |
// |
|
1756 |
void CGlxFullScreenViewImp::SetItemToHDMIL() |
|
1757 |
{ |
|
1758 |
TRACER("CGlxFullScreenViewImp::SetItemToHDMIL()"); |
|
1759 |
||
1760 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
1761 |
||
1762 |
// If we dont know what item we are focussing on |
|
1763 |
// or if our medialist is empty |
|
1764 |
// or if there is no HDMI Controller at all |
|
1765 |
// then dont SetItemToHDMI :) |
|
1766 |
if ((KErrNotFound == focusIndex) || (0 == iMediaList->Count()) || (NULL |
|
1767 |
== iHdmiController)) |
|
1768 |
{ |
|
1769 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Cant Set Image To HDMI"); |
|
1770 |
return; |
|
1771 |
} |
|
1772 |
||
1773 |
TGlxMedia item = iMediaList->Item(focusIndex); |
|
1774 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), |
|
1775 |
KGlxMediaIdThumbnail); |
|
1776 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - error=%d", error); |
|
1777 |
||
1778 |
TBool canView = ETrue; |
|
1779 |
if (item.IsDrmProtected()) |
|
1780 |
{ |
|
1781 |
canView = iDrmUtility->ItemRightsValidityCheckL(item.Uri(), |
|
1782 |
(item.Category() == EMPXImage)); |
|
1783 |
} |
|
1784 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - canView=%d", canView); |
|
1785 |
||
1786 |
// Item will be supported by HDMI ONLY if |
|
1787 |
// it is not a video |
|
1788 |
// and it is DRM protected and has valid DRM Viewing rights |
|
1789 |
// and it has no attribute error |
|
1790 |
if ((item.Category() != EMPXVideo) && canView && (error == KErrNone)) |
|
1791 |
{ |
|
1792 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch FS thumbnail"); |
|
1793 |
TMPXAttribute fsTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1794 |
GlxFullThumbnailAttributeId(ETrue, iScrnSize.iWidth, |
|
1795 |
iScrnSize.iHeight)); |
|
1796 |
const CGlxThumbnailAttribute* fsValue = item.ThumbnailAttribute( |
|
1797 |
fsTnAttrib); |
|
1798 |
if (fsValue) |
|
1799 |
{ |
|
1800 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting FS Bitmap"); |
|
1801 |
CFbsBitmap* fsBitmap = new (ELeave) CFbsBitmap; |
|
1802 |
CleanupStack::PushL(fsBitmap); |
|
1803 |
fsBitmap->Duplicate( fsValue->iBitmap->Handle()); |
|
1804 |
||
1805 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - FS Bitmap Size width=%d, height=%d", |
|
1806 |
fsBitmap->SizeInPixels().iWidth, fsBitmap->SizeInPixels().iHeight); |
|
1807 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, fsBitmap); |
|
1808 |
CleanupStack::PopAndDestroy(fsBitmap); |
|
1809 |
} |
|
1810 |
else |
|
1811 |
{ |
|
1812 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch Grid thumbnail"); |
|
1813 |
TMPXAttribute gridTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, |
|
1814 |
GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
|
1815 |
iGridIconSize.iHeight)); |
|
1816 |
const CGlxThumbnailAttribute* gridvalue = item.ThumbnailAttribute( |
|
1817 |
gridTnAttrib); |
|
1818 |
||
1819 |
if (gridvalue) |
|
1820 |
{ |
|
1821 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Grid Bitmap"); |
|
1822 |
CFbsBitmap* gridBitmap = new (ELeave) CFbsBitmap; |
|
1823 |
CleanupStack::PushL(gridBitmap); |
|
1824 |
gridBitmap->Duplicate( gridvalue->iBitmap->Handle()); |
|
1825 |
||
1826 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - gridBitmap Size width=%d, height=%d", |
|
1827 |
gridBitmap->SizeInPixels().iWidth, gridBitmap->SizeInPixels().iHeight); |
|
1828 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, gridBitmap); |
|
1829 |
CleanupStack::PopAndDestroy(gridBitmap); |
|
1830 |
} |
|
1831 |
else |
|
1832 |
{ |
|
1833 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Default Bitmap"); |
|
1834 |
TFileName resFile(KDC_APP_BITMAP_DIR); |
|
1835 |
resFile.Append(KGlxIconsFilename); |
|
1836 |
CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile, |
|
1837 |
EMbmGlxiconsQgn_prop_image_notcreated); |
|
1838 |
CleanupStack::PushL(defaultBitmap); |
|
1839 |
||
1840 |
// always need to setsize on the raw bitmap for it to be visible |
|
1841 |
AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved); |
|
1842 |
||
1843 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - Default Size width=%d, height=%d", |
|
1844 |
defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight); |
|
1845 |
iHdmiController->SetImageL(item.Uri(), KNullDesC, defaultBitmap); |
|
1846 |
CleanupStack::PopAndDestroy(defaultBitmap); |
|
1847 |
} |
|
1848 |
} |
|
1849 |
} |
|
1850 |
else |
|
1851 |
{ |
|
1852 |
GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Unsupported Item"); |
|
1853 |
//Set the external display to cloning mode if |
|
1854 |
//the current item is something we dont support |
|
1855 |
//(e.g. video, corrupted item, item with invalid DRM) |
|
1856 |
iHdmiController->ItemNotSupported(); |
|
1857 |
} |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1858 |
|
60 | 1859 |
iOldFocusIndex = iMediaList->FocusIndex(); |
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1860 |
delete iUri; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1861 |
iUri = NULL; |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1862 |
iUri = item.Uri().AllocL(); |
60 | 1863 |
} |
1864 |
||
1865 |
// --------------------------------------------------------------------------- |
|
1866 |
// HandleMMCInsertionL |
|
1867 |
// |
|
1868 |
// --------------------------------------------------------------------------- |
|
1869 |
void CGlxFullScreenViewImp::HandleMMCInsertionL() |
|
1870 |
{ |
|
1871 |
TRACER("CGlxFullScreenViewImp::HandleMMCInsertionL()"); |
|
1872 |
iMMCState = ETrue; |
|
1873 |
NavigateToMainListL(); |
|
1874 |
} |
|
1875 |
||
1876 |
// --------------------------------------------------------------------------- |
|
1877 |
// NavigateToMainListL |
|
1878 |
// |
|
1879 |
// --------------------------------------------------------------------------- |
|
1880 |
void CGlxFullScreenViewImp::NavigateToMainListL() |
|
1881 |
{ |
|
1882 |
TRACER("CGlxFullScreenViewImp::NavigateToMainListL()"); |
|
1883 |
if (!iImgViewerMode) |
|
1884 |
{ |
|
1885 |
if (iZoomControl && iZoomControl->Activated()) |
|
1886 |
{ |
|
1887 |
DeactivateZoomControlL(); |
|
1888 |
} |
|
1889 |
ProcessCommandL( EAknSoftkeyClose); |
|
1890 |
} |
|
1891 |
} |
|
1892 |
||
1893 |
// --------------------------------------------------------------------------- |
|
1894 |
// HandleMMCRemovalL |
|
1895 |
// |
|
1896 |
// --------------------------------------------------------------------------- |
|
1897 |
void CGlxFullScreenViewImp::HandleMMCRemovalL() |
|
1898 |
{ |
|
1899 |
TRACER("CGlxFullScreenViewImp::HandleMMCRemovalL()"); |
|
1900 |
iIsMMCRemoved = ETrue; |
|
1901 |
if(!iIsDialogLaunched) |
|
1902 |
{ |
|
1903 |
if(iZoomControl && iZoomControl->Activated()) |
|
1904 |
{ |
|
1905 |
DeactivateZoomControlL(); |
|
1906 |
} |
|
1907 |
ProcessCommandL(EAknSoftkeyExit); |
|
1908 |
} |
|
1909 |
} |
|
1910 |
||
1911 |
// --------------------------------------------------------------------------- |
|
1912 |
// EnableFSToolbar |
|
1913 |
// --------------------------------------------------------------------------- |
|
1914 |
// |
|
1915 |
void CGlxFullScreenViewImp::EnableFSToolbar(TBool aEnable) |
|
1916 |
{ |
|
1917 |
TRACER("CGlxFullScreenViewImp::EnableFSToolbar()"); |
|
1918 |
CAknToolbar* toolbar = Toolbar(); |
|
1919 |
if(toolbar) |
|
1920 |
{ |
|
1921 |
TRAP_IGNORE(toolbar->DisableToolbarL(!aEnable)); |
|
1922 |
toolbar->SetToolbarVisibility(aEnable); |
|
1923 |
} |
|
1924 |
} |
|
1925 |
||
1926 |
// --------------------------------------------------------------------------- |
|
1927 |
// HandleEffectCallback |
|
1928 |
// |
|
1929 |
// --------------------------------------------------------------------------- |
|
1930 |
// |
|
1931 |
void CGlxFullScreenViewImp::HandleEffectCallback(TInt aType, TInt aHandle, |
|
1932 |
TInt /*aStatus*/) |
|
1933 |
{ |
|
1934 |
TRACER("CGlxFullScreenViewImp::HandleEffectCallback()"); |
|
1935 |
if (aHandle == iEffectHandle && aType == EAlfEffectComplete |
|
1936 |
&& iCoverFlowWidget) |
|
1937 |
{ |
|
1938 |
TRAP_IGNORE(const_cast<CAlfLayout&> |
|
1939 |
(iCoverFlowWidget->ContainerLayout()).SetEffectL( |
|
1940 |
KTfxResourceNoEffect)); |
|
1941 |
} |
|
1942 |
} |
|
1943 |
||
1944 |
// ----------------------------------------------------------------------------- |
|
1945 |
// CreateImageViewerInstanceL |
|
1946 |
// ----------------------------------------------------------------------------- |
|
1947 |
// |
|
1948 |
void CGlxFullScreenViewImp::CreateImageViewerInstanceL() |
|
1949 |
{ |
|
1950 |
TRACER("CGlxFullScreenViewImp::CreateImageViewerInstanceL"); |
|
1951 |
iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
|
1952 |
__ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); |
|
1953 |
} |
|
1954 |
||
1955 |
// ----------------------------------------------------------------------------- |
|
1956 |
// DeleteImageViewerInstance |
|
1957 |
// ----------------------------------------------------------------------------- |
|
1958 |
// |
|
1959 |
void CGlxFullScreenViewImp::DeleteImageViewerInstance() |
|
1960 |
{ |
|
1961 |
TRACER("CGlxFullScreenViewImp::DeleteImageViewerInstance"); |
|
1962 |
if ( iImageViewerInstance ) |
|
1963 |
{ |
|
1964 |
iImageViewerInstance->DeleteInstance(); |
|
1965 |
} |
|
1966 |
} |
|
1967 |
||
1968 |
// ----------------------------------------------------------------------------- |
|
1969 |
// HandleTvStatusChangedL |
|
1970 |
// ----------------------------------------------------------------------------- |
|
1971 |
void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
|
1972 |
{ |
|
1973 |
TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()"); |
|
1974 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::HandleTvStatusChangedL(%d)", |
|
1975 |
aChangeType); |
|
1976 |
||
1977 |
if (aChangeType == ETvConnectionChanged) |
|
1978 |
{ |
|
1979 |
// Hide UI furnitures when HDMI cable is connected/Disconnected |
|
1980 |
// irrespective of UI state on/off. |
|
1981 |
HideUi(ETrue); |
|
1982 |
} |
|
1983 |
} |
|
1984 |
||
1985 |
// --------------------------------------------------------------------------- |
|
1986 |
// CheckIfSliderToBeShownL |
|
1987 |
// --------------------------------------------------------------------------- |
|
1988 |
TBool CGlxFullScreenViewImp::CheckIfSliderToBeShownL() |
|
1989 |
{ |
|
1990 |
TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()"); |
|
1991 |
||
1992 |
TInt index = iMediaList->FocusIndex(); |
|
1993 |
const TGlxMedia& item = iMediaList->Item(index); |
|
1994 |
TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), |
|
1995 |
KGlxMediaIdThumbnail); |
|
1996 |
||
1997 |
TBool isDrmRightsValid = ETrue; |
|
1998 |
if(item.IsDrmProtected()) |
|
1999 |
{ |
|
2000 |
if (iImgViewerMode && iImageViewerInstance->IsPrivate()) |
|
2001 |
{ |
|
2002 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
2003 |
iImageViewerInstance->ImageFileHandle(), (item.Category() |
|
2004 |
== EMPXImage)); |
|
2005 |
} |
|
2006 |
else |
|
2007 |
{ |
|
2008 |
//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL |
|
2009 |
isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL( |
|
2010 |
item.Uri(), (item.Category() == EMPXImage)); |
|
2011 |
} |
|
2012 |
} |
|
2013 |
||
2014 |
// Display slider only for non corrupted images and items with valid DRM license |
|
2015 |
if (iHdmiController && iHdmiController->IsHDMIConnected()) |
|
2016 |
{ |
|
2017 |
//hide slider if UI is needed to be on and HDMI is Connected |
|
2018 |
return EFalse; |
|
2019 |
} |
|
2020 |
else if(error == KErrNone && item.Category() == EMPXImage |
|
2021 |
&& isDrmRightsValid ) |
|
2022 |
{ |
|
2023 |
return ETrue; |
|
2024 |
} |
|
2025 |
return EFalse; |
|
2026 |
} |
|
2027 |
||
2028 |
//--------------------------------------------------------------------------- |
|
2029 |
// HandleHDMIDecodingEventL |
|
2030 |
//--------------------------------------------------------------------------- |
|
2031 |
void CGlxFullScreenViewImp::HandleHDMIDecodingEventL( |
|
2032 |
THdmiDecodingStatus /*aStatus*/) |
|
2033 |
{ |
|
2034 |
TRACER("CGlxFullScreenViewImp::HandleHDMIDecodingEventL()"); |
|
2035 |
} |
|
2036 |
||
2037 |
// --------------------------------------------------------------------------- |
|
2038 |
// UpdateItems |
|
2039 |
// --------------------------------------------------------------------------- |
|
2040 |
void CGlxFullScreenViewImp::UpdateItems() |
|
2041 |
{ |
|
2042 |
TRACER("CGlxFullScreenViewImp::UpdateItems()"); |
|
2043 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
2044 |
TInt count = iMediaList->Count(); |
|
2045 |
GLX_LOG_INFO2("CGlxFullScreenViewImp::UpdateItems()" |
|
2046 |
" focusIndex(%d), count(%d)", focusIndex, count); |
|
2047 |
||
2048 |
if (focusIndex != KErrNotFound && count) |
|
2049 |
{ |
|
2050 |
// update the focus index first |
|
2051 |
iMediaListMulModelProvider->UpdateItems(focusIndex, 1); |
|
2052 |
||
2053 |
TInt startIndex = focusIndex; |
|
2054 |
TInt iteratorCount = (KTextureOffset > count) ? |
|
2055 |
count : KTextureOffset; |
|
2056 |
TInt textureCount = (KFullScreenTextureOffset > count)? |
|
2057 |
count : KFullScreenTextureOffset; |
|
2058 |
||
2059 |
startIndex = focusIndex - iteratorCount; |
|
2060 |
if (startIndex < 0) |
|
2061 |
{ |
|
2062 |
startIndex = count + startIndex; |
|
2063 |
} |
|
2064 |
||
2065 |
TInt i = 0; |
|
2066 |
//Update all the textures in the window |
|
2067 |
while (i < textureCount) |
|
2068 |
{ |
|
2069 |
if (startIndex != focusIndex) |
|
2070 |
{ |
|
2071 |
GLX_LOG_INFO1("CGlxFullScreenViewImp::UpdateItems(%d)", startIndex); |
|
2072 |
iMediaListMulModelProvider->UpdateItems(startIndex, 1); |
|
2073 |
} |
|
2074 |
if (++startIndex == count) |
|
2075 |
{ |
|
2076 |
startIndex = 0; |
|
2077 |
} |
|
2078 |
i++; |
|
2079 |
} |
|
2080 |
||
2081 |
// When the focused index is first or last, |
|
2082 |
// need to update the items adjacent to KFullScreenIterator also! |
|
2083 |
if (count > (KFullScreenTextureOffset)) |
|
2084 |
{ |
|
2085 |
TInt lastIndex = count - 1; |
|
2086 |
if (focusIndex == 0) |
|
2087 |
{ |
|
2088 |
iMediaListMulModelProvider->UpdateItems(KFullScreenIterator, |
|
2089 |
1); |
|
2090 |
} |
|
2091 |
else if (focusIndex == lastIndex) |
|
2092 |
{ |
|
2093 |
iMediaListMulModelProvider->UpdateItems(lastIndex |
|
2094 |
- KFullScreenIterator, 1); |
|
2095 |
} |
|
2096 |
} |
|
2097 |
} |
|
2098 |
} |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2099 |
|
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 |
// Sets the title pane text |
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 |
void CGlxFullScreenViewImp::SetTitlePaneTextL(const TDesC& aTitleText) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2104 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2105 |
TRACER("CGlxFullScreenViewImp::SetTitlePaneTextL()"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2106 |
CAknViewAppUi* appui = AppUi(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2107 |
if (appui) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2108 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2109 |
CAknTitlePane* titlePane = |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2110 |
(CAknTitlePane*) appui->StatusPane()->ControlL(TUid::Uid( |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2111 |
EEikStatusPaneUidTitle)); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2112 |
titlePane->SetTextL(aTitleText); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2113 |
titlePane->DrawNow(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2114 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2115 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2116 |
|
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2117 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2118 |
// HandleItemRemovedL |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2119 |
// --------------------------------------------------------------------------- |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2120 |
void CGlxFullScreenViewImp::HandleItemRemovedL() |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2121 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2122 |
TRACER("CGlxFullScreenViewImp::HandleItemRemovedL()"); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2123 |
TInt focusIndex = iMediaList->FocusIndex(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2124 |
TInt mlCount = iMediaList->Count(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2125 |
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
|
2126 |
focusIndex, iOldFocusIndex); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2127 |
// 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
|
2128 |
// 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
|
2129 |
// 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
|
2130 |
// 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
|
2131 |
if (mlCount && (iOldFocusIndex == focusIndex || iOldFocusIndex == mlCount |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2132 |
|| iOldFocusIndex != focusIndex) && iZoomControl |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2133 |
&& iZoomControl->Activated()) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2134 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2135 |
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
|
2136 |
DeactivateZoomControlL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2137 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2138 |
SetItemToHDMIL(); |
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
2139 |
if (focusIndex != KErrNotFound && focusIndex < iMediaList->Count() && EUiOn |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
2140 |
== GetUiState()) |
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2141 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2142 |
// show/hide the slider |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2143 |
if (iSliderWidget) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2144 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2145 |
iSliderWidget->ShowWidget(CheckIfSliderToBeShownL()); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2146 |
} |
68
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
2147 |
TBool dimmed = (EMPXVideo == iMediaList->Item(focusIndex).Category()); |
5b238bc8ffb6
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
2148 |
Toolbar()->SetItemDimmed(EGlxCmdSlideshowPlay, dimmed, ETrue); |
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2149 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2150 |
/** 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
|
2151 |
if (mlCount == 0 && IsForeground() && iNaviState->ViewingMode() |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2152 |
== NGlxNavigationalState::EView) |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2153 |
{ |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2154 |
iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2155 |
iNaviState->ActivatePreviousViewL(); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2156 |
} |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2157 |
TRAP_IGNORE(ShowDrmExpiryNoteL()); |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
2158 |
} |