# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1266612661 -7200 # Node ID 6b87b143d312b730fe10e888d2d3dffa5d6232fa # Parent f7f0874bfe7de25e35c6fb89d1cc7332cb932401 Revision: 201003 Kit: 201007 diff -r f7f0874bfe7d -r 6b87b143d312 photos_plat/controllers_collection_api/tsrc/ui_metaDataDialog/group/ui_metaDataDialog_DoxyFile.txt --- a/photos_plat/controllers_collection_api/tsrc/ui_metaDataDialog/group/ui_metaDataDialog_DoxyFile.txt Tue Feb 02 10:12:14 2010 +0200 +++ b/photos_plat/controllers_collection_api/tsrc/ui_metaDataDialog/group/ui_metaDataDialog_DoxyFile.txt Fri Feb 19 22:51:01 2010 +0200 @@ -2,9 +2,9 @@ # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" +# under the terms of the License "Symbian Foundation License v1.0" # which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". # # Initial Contributors: # Nokia Corporation - initial contribution. diff -r f7f0874bfe7d -r 6b87b143d312 photos_plat/controllers_collection_api/tsrc/ut_collectioninfo/group/ut_collectioninfo_DoxyFile.txt --- a/photos_plat/controllers_collection_api/tsrc/ut_collectioninfo/group/ut_collectioninfo_DoxyFile.txt Tue Feb 02 10:12:14 2010 +0200 +++ b/photos_plat/controllers_collection_api/tsrc/ut_collectioninfo/group/ut_collectioninfo_DoxyFile.txt Fri Feb 19 22:51:01 2010 +0200 @@ -2,9 +2,9 @@ # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" +# under the terms of the License "Symbian Foundation License v1.0" # which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". # # Initial Contributors: # Nokia Corporation - initial contribution. diff -r f7f0874bfe7d -r 6b87b143d312 photos_plat/controllers_collection_api/tsrc/ut_collectionmanager/group/ut_collectionmanager_DoxyFile.txt --- a/photos_plat/controllers_collection_api/tsrc/ut_collectionmanager/group/ut_collectionmanager_DoxyFile.txt Tue Feb 02 10:12:14 2010 +0200 +++ b/photos_plat/controllers_collection_api/tsrc/ut_collectionmanager/group/ut_collectionmanager_DoxyFile.txt Fri Feb 19 22:51:01 2010 +0200 @@ -2,9 +2,9 @@ # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" +# under the terms of the License "Symbian Foundation License v1.0" # which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". # # Initial Contributors: # Nokia Corporation - initial contribution. diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h --- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h Fri Feb 19 22:51:01 2010 +0200 @@ -290,6 +290,18 @@ */ TInt SearchStringL(TInt aResourceId); + + /** + * Timer callback to stop scheduler wait + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt SchedulerStopCallback(TAny* aPtr); + + /** + * Starts the scheduler wait timer. When complete, Scheduler is stopped + */ + void SchedulerStopComplete(); private: /** @@ -333,6 +345,16 @@ * */ CGlxStringCache* iStringCache; + + /** + * Timer that checks if scheduler wait needs to be cancelled + */ + CPeriodic* iTimer; + + /** + * Active scheduler wait object. (Owned) + */ + CActiveSchedulerWait* iSchedulerWait; }; #endif //_C_GLXDATASOURCETASKMDSCOMMAND_H_ diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp --- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -291,7 +291,7 @@ #ifdef USE_S60_TNM iTnEngine = CThumbnailManager::NewL( *this); - iTnEngine->SetDisplayModeL( EColor64K ); + iTnEngine->SetDisplayModeL( EColor16MU ); iTnRequestInProgress = EFalse; #else @@ -1121,7 +1121,7 @@ TRACER("CGlxDataSourceMde::ThumbnailPreviewReady()"); TInt error = KErrNotSupported; - if (aThumbnail.Bitmap() != NULL) + if ( aThumbnail.Bitmap() ) { GLX_DEBUG1("CGlxDataSourceMde::ThumbnailPreviewReady preview aval"); error = KErrNone; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp --- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -119,8 +119,8 @@ void CGlxDataSourceTaskMde::CancelRequest() { TRACER("CGlxDataSourceTaskMde::CancelRequest()"); - DestroyQueries(); iCancelled = ETrue; + DestroyQueries(); } // ---------------------------------------------------------------------------- @@ -165,7 +165,7 @@ TRAP(err, HandleQueryCompletedL(aQuery)); } - if (err != KErrNone) + if (err != KErrNone && !iCancelled) { HandleRequestComplete(err); } @@ -443,7 +443,10 @@ } case EGlxFilterSortOrderItemCount: { - //Order rule is not necessary for item count query + //Order rule is needed for tags popularity + TMdEOrderRule orderRule(EOrderRuleTypeUsageCount, aFilterProperties.iSortDirection == + EGlxFilterSortDirectionAscending); + aQuery.AppendOrderRuleL(orderRule); break; } case EGlxFilterSortOrderCaptureDate: @@ -672,7 +675,20 @@ { TRACER("CGlxDataSourceTaskMde::HandleQueryCompletedL()"); DoHandleQueryCompletedL(aQuery); - RemoveQuery(); + + // Both the function calls should be executed if any + // request is not cancelled before completion. + // All the pending Queries are already destroyed in CancelRequest. + // Hence we do not have to call RemoveQuery here. That will lead to + // User 130 crash. + // DoNextQuery tries to get iQueries.Count(). Since iQueries is destroyed + // in CancelRequest + if (iCancelled) + { + GLX_LOG_INFO("***Query already Removed. Hence Return***"); + return; + } + RemoveQuery(); DoNextQueryL(); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp --- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -91,6 +91,10 @@ _LIT(KColonBackslash, ":\\"); _LIT(KFileNameFormatString, "(%+02u)"); +// Items to be deleted from File server at a time before calling scheduler wait +const TInt KDeletedItemCount = 50; +const TInt KDeleteOperationInterval = 200000; + // ---------------------------------------------------------------------------- // Destructor // ---------------------------------------------------------------------------- @@ -103,6 +107,12 @@ delete iTitle; delete iObjectToRename; delete iStringCache; + if(iTimer && iTimer->IsActive()) + { + iTimer->Cancel(); + } + delete iTimer; + delete iSchedulerWait; } @@ -131,7 +141,10 @@ DataSource()->CancelFetchThumbnail(); #else DataSource()->ThumbnailCreator().CancelRequest( TGlxMediaId(0) ); -#endif +#endif + + iTimer = CPeriodic::NewL(CActive::EPriorityStandard); + iSchedulerWait = new (ELeave) CActiveSchedulerWait(); } /// @todo minor: Rowland Cook 12/06/2007 Add method decription. @@ -992,6 +1005,7 @@ (CMdEQuery& aQuery) { TRACER("CGlxDataSourceTaskMdeCommand::DoHandleDeleteItemsQueryCompletedL()"); + TInt deleteItemCounter = 0; ContentAccess::CManager *manager = ContentAccess::CManager::NewL(); CleanupStack::PushL(manager); TInt queryCount = aQuery.Count(); @@ -1010,7 +1024,10 @@ User::LeaveIfError( fs.Connect() ); TInt lastErr = KErrNone; - for(TInt queryPos = queryCount - 1; queryPos >= 0; queryPos--) + + // If Delete operation is cancelled before completion, + // iCancelled because ETrue, break out of for loop. + for(TInt queryPos = queryCount - 1; (queryPos >= 0 && !iCancelled); queryPos--) { CMdEObject& object = static_cast(aQuery.ResultItem(queryPos)); //Removes the Read Only attributes of the file @@ -1020,7 +1037,22 @@ { lastErr = err; } - objectsForRemoval.AppendL(object.Id()); + else + { + // On successful deletion, delete the same from database + objectsForRemoval.AppendL(object.Id()); + } + + // After every 50 items are deleted, break from the for loop + // and process other pending requests if any + if(deleteItemCounter == KDeletedItemCount) + { + iTimer->Start( KDeleteOperationInterval, KDeleteOperationInterval, + TCallBack( &SchedulerStopCallback, (TAny *)this ) ); + iSchedulerWait->Start(); + deleteItemCounter = 0; + } + deleteItemCounter++; } // Calling Close() on file server session CleanupStack::PopAndDestroy( &fs ); @@ -1212,3 +1244,39 @@ return result; } + +// ---------------------------------------------------------------------------- +// CGlxDataSourceTaskMdeCommand::SchedulerStopCallback +// ---------------------------------------------------------------------------- +// +TInt CGlxDataSourceTaskMdeCommand::SchedulerStopCallback(TAny* aPtr) + { + TRACER("CGlxDataSourceTaskMdeCommand::SchedulerStopCallback"); + + CGlxDataSourceTaskMdeCommand* self = (CGlxDataSourceTaskMdeCommand*) aPtr; + if ( self ) + { + self->SchedulerStopComplete(); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// SchedulerStopComplete +// ----------------------------------------------------------------------------- +// +void CGlxDataSourceTaskMdeCommand::SchedulerStopComplete() + { + TRACER("CGlxDataSourceTaskMdeCommand::SchedulerStopComplete"); + + if(iTimer && iTimer->IsActive()) + { + iTimer->Cancel(); + } + + if(iSchedulerWait) + { + iSchedulerWait->AsyncStop(); + } + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/gallery/src/glxdocument.cpp --- a/photosgallery/gallery/src/glxdocument.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/gallery/src/glxdocument.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -73,11 +73,11 @@ CGlxDocument::~CGlxDocument() { TRACER("CGlxDocument::~CGlxDocument()"); - if (iViewUtility != NULL) + if ( iViewUtility ) { iViewUtility->Close(); } - if ( NULL != iImageViewerInstance) + if ( iImageViewerInstance ) { iImageViewerInstance->DeleteInstance(); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/help/data/xhtml.zip Binary file photosgallery/help/data/xhtml.zip has changed diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/help/inc/lgal.hlp.hrh --- a/photosgallery/help/inc/lgal.hlp.hrh Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/help/inc/lgal.hlp.hrh Fri Feb 19 22:51:01 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/imgvwr/src/glxivwrdocument.cpp --- a/photosgallery/imgvwr/src/glxivwrdocument.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/imgvwr/src/glxivwrdocument.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -73,11 +73,11 @@ CGlxIVwrDocument::~CGlxIVwrDocument() { TRACER("CGlxIVwrDocument::~CGlxDocument()"); - if (iViewUtility != NULL) + if ( iViewUtility ) { iViewUtility->Close(); } - if ( NULL != iImageViewerInstance) + if ( iImageViewerInstance ) { iImageViewerInstance->DeleteInstance(); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/slideshow/view/inc/shwgesturecontrol.h --- a/photosgallery/slideshow/view/inc/shwgesturecontrol.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/slideshow/view/inc/shwgesturecontrol.h Fri Feb 19 22:51:01 2010 +0200 @@ -16,8 +16,6 @@ */ - - #ifndef SHWGESTURECONTROL_H #define SHWGESTURECONTROL_H @@ -60,8 +58,7 @@ * @param aEnv, handle to CAlfEnv * @param aDisplay, handle to CAlfDisplay */ - static CShwGestureControl* NewL(CAlfEnv& aEnv,CAlfDisplay& aDisplay, - MShwGestureObserver& aObserver); + static CShwGestureControl* NewL(CAlfEnv& aEnv,CAlfDisplay& aDisplay); /** * HandleGestureL @@ -71,18 +68,32 @@ void HandleGestureL( const GestureHelper::MGestureEvent& aEvent ); /** - * ~~CShwGestureControl + * ~CShwGestureControl * standard C++ destructor */ ~CShwGestureControl(); + /** + * AddObserver + * Add an Observer + * @param aObserver, Observer to be added. + */ + void AddObserver(MShwGestureObserver* aObserver); + + /** + * RemoveObserver + * Remove an Observer + * @param aEngine, handle to the slide show engine + */ + void RemoveObserver(MShwGestureObserver* aObserver); + private: /** * CShwGestureControl * C++ constructor */ - CShwGestureControl(MShwGestureObserver& aObserver); + CShwGestureControl(); /** * ConstructL @@ -92,8 +103,10 @@ private: - /* does not own **/ - MShwGestureObserver& iObserver; + /** Array of observers (does not own ) */ + // As per present design of the SS view, there is need only for one observer, + // but this is more generic. Also this doesnt seem like a perfomance critical path + RPointerArray iObservers; }; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/slideshow/view/src/shwgesturecontrol.cpp --- a/photosgallery/slideshow/view/src/shwgesturecontrol.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/slideshow/view/src/shwgesturecontrol.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -24,23 +24,22 @@ #include #include +#include #include "shwslideshowengine.h" #include "shwgesturecontrol.h" using namespace GestureHelper; - // ----------------------------------------------------------------------------- // NewL. // ----------------------------------------------------------------------------- // -CShwGestureControl* CShwGestureControl::NewL( CAlfEnv& aEnv,CAlfDisplay& aDisplay, - MShwGestureObserver& aObserver) +CShwGestureControl* CShwGestureControl::NewL( CAlfEnv& aEnv,CAlfDisplay& aDisplay) { TRACER("CShwGestureControl::NewL"); GLX_LOG_INFO( "CShwGestureControl::NewL" ); - CShwGestureControl* self = new(ELeave)CShwGestureControl(aObserver); + CShwGestureControl* self = new(ELeave)CShwGestureControl(); CleanupStack::PushL( self ); self->ConstructL( aEnv,aDisplay); CleanupStack::Pop( self ); @@ -51,7 +50,7 @@ // ConstructL. // ----------------------------------------------------------------------------- // -void CShwGestureControl::ConstructL( CAlfEnv& aEnv,CAlfDisplay& aDisplay ) +void CShwGestureControl::ConstructL( CAlfEnv& aEnv,CAlfDisplay& aDisplay) { TRACER("CShwGestureControl::ConstructL"); GLX_LOG_INFO( "CShwGestureControl::ConstructL" ); @@ -64,20 +63,57 @@ // CShwGestureControl. // ----------------------------------------------------------------------------- // -CShwGestureControl::CShwGestureControl( MShwGestureObserver& aObserver): - iObserver(aObserver) +CShwGestureControl::CShwGestureControl( ) { + TRACER("CShwGestureControl::CShwGestureControl"); //no implementation } // ----------------------------------------------------------------------------- // ~CShwGestureControl. // ----------------------------------------------------------------------------- -// +// CShwGestureControl::~CShwGestureControl() - { - //no implementation - } + { + TRACER("CShwGestureControl::~CShwGestureControl"); + //no implementation + } + +// ----------------------------------------------------------------------------- +// AddObserver +// ----------------------------------------------------------------------------- +// +void CShwGestureControl::AddObserver(MShwGestureObserver* aObserver) + { + TRACER("CShwGestureControl::AddObserver"); + GLX_LOG_INFO("CShwGestureControl::AddObserver"); + __ASSERT_DEBUG( NULL != aObserver , Panic(EGlxPanicNullPointer)); + + // dont want to observe the same thing again and again. + if (iObservers.Find(aObserver) == KErrNotFound) + { + iObservers.Append(aObserver); + GLX_LOG_INFO1("CShwGestureControl::AddObserver Observer Added " + "observer count now [%d]", iObservers.Count()); + } + } + +// ----------------------------------------------------------------------------- +// RemoveObserver +// ----------------------------------------------------------------------------- +// +void CShwGestureControl::RemoveObserver(MShwGestureObserver* aObserver) + { + TRACER("CShwGestureControl::RemoveObserver"); + GLX_LOG_INFO("CShwGestureControl::RemoveObserver"); + TInt observerPosition = iObservers.Find(aObserver); + if (observerPosition != KErrNotFound) + { + iObservers.Remove(observerPosition); + GLX_LOG_INFO1("CShwGestureControl::AddObserver One Observer removed " + "observer count now [%d]", iObservers.Count()); + } + } // ----------------------------------------------------------------------------- // HandleGestureL. @@ -87,52 +123,46 @@ { TRACER("CShwGestureControl::HandleGestureL"); GLX_LOG_INFO1( "CShwGestureControl::HandleGestureL(%d)", aEvent.Code( MGestureEvent::EAxisBoth )); - // we are interested in only - // swipe left(EGestureSwipeLeft) - // swipe right(EGestureSwipeRight) - // and tap events - + + // No one is listening? Do not resolve the events for the listeners! + if (iObservers.Count() > 0) + { + MShwGestureObserver::TShwGestureEventType aType = MShwGestureObserver::ENoEvent; switch ( aEvent.Code( MGestureEvent::EAxisBoth ) ) { - case EGestureSwipeLeft: { - //call back the view - iObserver.HandleShwGestureEventL(MShwGestureObserver::ESwipeLeft); - break; - } - case EGestureHoldLeft: - { - //skip for now + aType = MShwGestureObserver::ESwipeLeft ; break; } case EGestureSwipeRight: { - //callback - iObserver.HandleShwGestureEventL(MShwGestureObserver::ESwipeRight); - break; - } - case EGestureHoldRight: - { - //skip for now + aType = MShwGestureObserver::ESwipeRight; break; } case EGestureTap: { - iObserver.HandleShwGestureEventL(MShwGestureObserver::ETapEvent); + aType = MShwGestureObserver::ETapEvent; break; } - //fall through - case EGestureSwipeUp: - case EGestureHoldUp: - case EGestureSwipeDown: - case EGestureHoldDown: default: { + // we are interested in only + // swipe left(EGestureSwipeLeft) + // swipe right(EGestureSwipeRight) + // and tap events + // we wont be handling any other case yet. break; } - } + for (TInt index = 0 ; index < iObservers.Count() ; index ++) + { + if (MShwGestureObserver::ENoEvent != aType ) + { + iObservers[index]->HandleShwGestureEventL(aType); + } + } + } } //end of file diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/slideshow/view/src/shwgestureobserver.h --- a/photosgallery/slideshow/view/src/shwgestureobserver.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/slideshow/view/src/shwgestureobserver.h Fri Feb 19 22:51:01 2010 +0200 @@ -31,7 +31,9 @@ enum TShwGestureEventType { - ETapEvent = 1, + ENoEvent = 0, // This should not be Propogated to observers. + // Reserved for those events we will not handle now. + ETapEvent, ESwipeLeft, ESwipeRight, EHoldEvent diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/slideshow/view/src/shwslideshowbacklighttimer.cpp --- a/photosgallery/slideshow/view/src/shwslideshowbacklighttimer.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/slideshow/view/src/shwslideshowbacklighttimer.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -28,6 +28,9 @@ namespace { const TInt KMicroSecondsInASecond = 1000000; + + // @ref: Minimum slideshow transition delay + const TInt KMinTimeoutDelay = 2; // secs } // ----------------------------------------------------------------------------- @@ -95,6 +98,13 @@ // Take the smaller of the two timeout values iSettingsDelay = Min( iSettingsDelay, screenSaverTimeout ); + + // Set the timeout delay to minimum value as it can not be zero! + if (iSettingsDelay == 0) + { + iSettingsDelay = KMinTimeoutDelay; + } + // Convert the value to microseconds iSettingsDelay *= KMicroSecondsInASecond; // Halve the value to ensure out timer kicks beforehand @@ -110,8 +120,7 @@ // TInt CShwSlideshowBackLightTimer::Tick() { - // Timer must be reset to prevent screen saver to appear in - // Aalto when the slide is closed. Should not cause any side effects. + // Timer must be reset to prevent screen saver to appear User::ResetInactivityTime(); iStartTime.HomeTime(); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/slideshow/view/src/shwslideshowview.cpp --- a/photosgallery/slideshow/view/src/shwslideshowview.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/slideshow/view/src/shwslideshowview.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -334,7 +334,7 @@ iGestureControlGroup = &iEnv->NewControlGroupL( KShwGestureControlGroupId ); // construct the gesture control group - iShwGestureControl = CShwGestureControl::NewL(*iEnv,*iDisplay,*this); + iShwGestureControl = CShwGestureControl::NewL(*iEnv,*iDisplay); iGestureControlGroup->AppendL( iShwGestureControl ); GestureHelper::CGestureControl* gestureControl = GestureHelper::CGestureControl::NewLC( @@ -418,6 +418,7 @@ AppUi()->PopupToolbar()->SetToolbarVisibility( EFalse ); AppUi()->PopupToolbar()->MakeVisible(EFalse); } + iHdmiActive = EFalse; // reset failure flag iEngineStartFailed = EFalse; @@ -462,6 +463,10 @@ InitializeShwFurnitureL(); iUiUtility->Display()->SetVisibleArea(TRect(TPoint(0,0),AlfUtil::ScreenSize())); + // We will require to act on events ONLY when the view is active. + // So listen to them only when the view is active. + iShwGestureControl->AddObserver(this); + } // ----------------------------------------------------------------------------- @@ -551,6 +556,7 @@ //set to NULL to prevent double delete iFilteredList = NULL; } + iShwGestureControl->RemoveObserver(this); iDisplay->Roster().Hide( *iGestureControlGroup ); if(iTicker) @@ -719,6 +725,8 @@ iWaitDialog->ProcessFinishedL(); } iShwState = EShwPlay; + SetImage(); + iHdmiActive = ETrue; ReplaceCommandSetL(R_SHW_SOFTKEYS_END_PAUSE,R_SHW_SOFTKEYS_END_PAUSE); ShowShwFurnitureL(); } @@ -1019,8 +1027,6 @@ } } iFilteredList->SetFocusL( NGlxListDefs::EAbsolute, focusIndex ); - SetImage(); - iHdmiActive = ETrue; // iContextUtility->PublishPhotoContextL(item.Uri()); } @@ -1051,7 +1057,7 @@ // void CShwSlideshowView::HandleTickCancelled() { - + TRACER("CShwSlideshowView::HandleTickCancelled()"); } // ----------------------------------------------------------------------------- @@ -1063,6 +1069,15 @@ { TRACER("CShwSlideshowView::HandleShwGestureEventL"); GLX_LOG_INFO( "CShwSlideshowView::HandleShwGestureEventL" ); + + // If there is no Engine, the vehicle is handicapped and there is no way to know + // whether it is possible for it to PROPERLY respond to events. + // So it is safer to not do so. + if (NULL == iEngine) + { + return ; + } + iTicker->CancelTicking(); switch(aType) { diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp --- a/photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -138,8 +138,12 @@ aList.CommandL(*command); // raise progress note. Note will be closed when complete message received - ProgressNoteL(aCommandId); - + // For EGlxCmdAddMedia we dont need to show dialog as EGlxCmdAddToAlbum or + // EGlxCmdAddTag will show processing dialog. + if (aCommandId != EGlxCmdAddMedia) + { + ProgressNoteL(aCommandId); + } CleanupStack::PopAndDestroy(command); } } @@ -497,6 +501,7 @@ // Close the progress note, if displayed if (iProgressDialog) { + iProgressDialog->MakeVisible(EFalse); iProgressDialog->ProcessFinishedL(); iProgressDialog = NULL; iProgressInfo = NULL; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraddtocontainer.h --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraddtocontainer.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraddtocontainer.h Fri Feb 19 22:51:01 2010 +0200 @@ -99,6 +99,8 @@ /** See @ref CGlxMpxCommandCommandHandler::DoHandleCommandCompleteL */ virtual void DoHandleCommandCompleteL(TAny* aSessionId, CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList); + + virtual TBool OkToExit() const; /** See @ref CGlxCommandHandler::DoActivateL */ void DoActivateL(TInt aViewId); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraiwedit.h --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraiwedit.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraiwedit.h Fri Feb 19 22:51:01 2010 +0200 @@ -28,6 +28,7 @@ class CGlxMedia; class MGlxMediaListProvider; class CAiwServiceHandler; +class CGlxImageViewerManager; /** * CGlxCommandHandlerAiwEdit @@ -90,6 +91,9 @@ TBool iEditSupported; TBool iCommandSingleClick; + + // Not own + CGlxImageViewerManager* iImageViewerInstance; }; #endif // C_GLXCOMMANDHANDLERAIWEDIT_H diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -314,6 +314,11 @@ } } + +TBool CGlxCommandHandlerAddToContainer::OkToExit() const + { + return ETrue; + } // ----------------------------------------------------------------------------- // CGlxCommandHandlerAddToContainer::DoHandleCommandCompleteL // ----------------------------------------------------------------------------- diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include #include @@ -39,15 +39,16 @@ #include "AiwServiceHandler.h" // AIW service handler #include "glxmedia.h" -const TInt KGlxAiwEditCommandSpace = 0x00000200; // ----------------------------------------------------------------------------- // NewL // ----------------------------------------------------------------------------- // -EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL(MGlxMediaListProvider* aMediaListProvider, TBool aCommandSingleClick) +EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL( + MGlxMediaListProvider* aMediaListProvider, TBool aCommandSingleClick) { - CGlxCommandHandlerAiwEdit* self = new (ELeave) CGlxCommandHandlerAiwEdit(aMediaListProvider, aCommandSingleClick); + CGlxCommandHandlerAiwEdit* self = new (ELeave) CGlxCommandHandlerAiwEdit( + aMediaListProvider, aCommandSingleClick); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); @@ -61,6 +62,11 @@ EXPORT_C CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit() { delete iServiceHandler; + + if (NULL != iImageViewerInstance) + { + iImageViewerInstance->DeleteInstance(); + } } // ----------------------------------------------------------------------------- @@ -70,13 +76,13 @@ void CGlxCommandHandlerAiwEdit::ConstructL() { TRAP_IGNORE( - { - iServiceHandler = CAiwServiceHandler::NewL(); - iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST ); - iEditSupported = ETrue; - } ); - - if(iCommandSingleClick) + { + iServiceHandler = CAiwServiceHandler::NewL(); + iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST ); + iEditSupported = ETrue; + }); + + if (iCommandSingleClick) { TCommandInfo info(EGlxCmdAiwSingleClickEdit); AddCommandL(info); @@ -86,15 +92,18 @@ TCommandInfo info(EGlxCmdAiwEdit); AddCommandL(info); } + + iImageViewerInstance = CGlxImageViewerManager::InstanceL(); } // ----------------------------------------------------------------------------- // CGlxCommandHandlerAiwEdit // ----------------------------------------------------------------------------- // -CGlxCommandHandlerAiwEdit::CGlxCommandHandlerAiwEdit( MGlxMediaListProvider* aMediaListProvider, TBool aCommandSingleClick ) - :CGlxMediaListCommandHandler(aMediaListProvider), - iCommandSingleClick(aCommandSingleClick) +CGlxCommandHandlerAiwEdit::CGlxCommandHandlerAiwEdit( + MGlxMediaListProvider* aMediaListProvider, TBool aCommandSingleClick) : + CGlxMediaListCommandHandler(aMediaListProvider), iCommandSingleClick( + aCommandSingleClick) { // Do Nothing } @@ -112,51 +121,68 @@ // DynInitMenuPaneL // ----------------------------------------------------------------------------- // -void CGlxCommandHandlerAiwEdit::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) +void CGlxCommandHandlerAiwEdit::DynInitMenuPaneL(TInt aResourceId, + CEikMenuPane* aMenuPane) { MGlxMediaList& mediaList = MediaList(); TInt pos; - - if (aMenuPane && iCommandSingleClick && aMenuPane->MenuItemExists(EGlxCmdAiwSingleClickEdit, pos) - && (mediaList.SelectionCount() > 1)) + + if (aMenuPane) { - aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue); + //If stylus menu is present, hide it for multiple selection + if (iCommandSingleClick && aMenuPane->MenuItemExists( + EGlxCmdAiwSingleClickEdit, pos) + && (mediaList.SelectionCount() > 1)) + { + aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue); + } + //For Edit menu item present in Options CBA + else if (aMenuPane->MenuItemExists(EGlxCmdAiwEdit, pos)) + { + // If the image path is private or view is in grid & + // selection is not equal to 1, we should hide Edit menu item + if (iImageViewerInstance->IsPrivate() || + (mediaList.SelectionCount() != 1 + && !IsInFullScreenViewingModeL())) + { + aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue); + } + } } - else if (aMenuPane && aMenuPane->MenuItemExists(EGlxCmdAiwEdit, pos) - && (mediaList.SelectionCount() != 1) && !IsInFullScreenViewingModeL()) - { - aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue); - } - } // ----------------------------------------------------------------------------- // DoExecuteL // ----------------------------------------------------------------------------- // -TBool CGlxCommandHandlerAiwEdit::DoExecuteL( TInt aCommandId , MGlxMediaList& aList) +TBool CGlxCommandHandlerAiwEdit::DoExecuteL(TInt aCommandId, + MGlxMediaList& aList) { TBool handled = EFalse; - if (iEditSupported && (EGlxCmdAiwEdit == aCommandId || EGlxCmdAiwSingleClickEdit == aCommandId)) - { + if (iEditSupported && (EGlxCmdAiwEdit == aCommandId + || EGlxCmdAiwSingleClickEdit == aCommandId)) + { CAiwGenericParamList& inputParams = iServiceHandler->InParamListL(); - + TGlxSelectionIterator iterator; iterator.SetToFirst(&aList); TInt index = iterator++; const TGlxMedia& mediaItem = aList.Item(index); - - TAiwGenericParam param( EGenericParamFile, TAiwVariant(mediaItem.Uri())); - inputParams.AppendL( param ); - - TAiwGenericParam param2( EGenericParamMIMEType, TAiwVariant(mediaItem.MimeType())); - inputParams.AppendL( param2 ); + + TAiwGenericParam param(EGenericParamFile, + TAiwVariant(mediaItem.Uri())); + inputParams.AppendL(param); + + TAiwGenericParam param2(EGenericParamMIMEType, TAiwVariant( + mediaItem.MimeType())); + inputParams.AppendL(param2); // Execute the KAiwCmdUpload command EGlxCmdAiwEdit - iServiceHandler->ExecuteServiceCmdL(KAiwCmdEdit, inputParams, iServiceHandler->OutParamListL()); + iServiceHandler->ExecuteServiceCmdL(KAiwCmdEdit, inputParams, + iServiceHandler->OutParamListL()); handled = ETrue; - } + } return handled; } @@ -168,27 +194,30 @@ { TRACER("CGlxCommandHandlerAiwEdit::IsInFullScreenViewingModeL()"); TBool fullscreenViewingMode = EFalse; - CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL(); + CGlxNavigationalState* aNavigationalState = + CGlxNavigationalState::InstanceL(); CMPXCollectionPath* naviState = aNavigationalState->StateLC(); - - if ( naviState->Levels() >= 1) + + if (naviState->Levels() >= 1) { - if (aNavigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) + if (aNavigationalState->ViewingMode() + == NGlxNavigationalState::EBrowse) { // For image viewer collection, goto view mode - if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) + if (naviState->Id() == TMPXItemId( + KGlxCollectionPluginImageViewerImplementationUid)) { //it means we are in img viewer fullscreenViewingMode = ETrue; } - } - else + } + else { //it means we are in Fullscreen fullscreenViewingMode = ETrue; - } + } } - CleanupStack::PopAndDestroy( naviState ); + CleanupStack::PopAndDestroy(naviState); aNavigationalState->Close(); return fullscreenViewingMode; } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -302,7 +302,7 @@ // put to cleanupstack as cleanupstack is emptied before stack objects // are deleted CleanupClosePushL( contextRemover ); - User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, *rootList, ETrue)); + User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, *rootList, ETrue)); // context off the list CleanupStack::PopAndDestroy( &contextRemover ); @@ -341,7 +341,7 @@ // put to cleanupstack as cleanupstack is emptied before stack objects // are deleted CleanupClosePushL( contextRemover ); - User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, aList, ETrue)); + User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, aList, EFalse)); // context off the list CleanupStack::PopAndDestroy( &contextRemover ); CleanupStack::PopAndDestroy(attributeContext); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -89,12 +89,12 @@ } iFs.Close(); - if(iExifData != NULL) + if ( iExifData ) { delete iExifData; iExifData = NULL; } - if(iExifWriter != NULL) + if ( iExifWriter ) { delete iExifWriter; iExifWriter = NULL; @@ -452,12 +452,12 @@ iInitialOrientation = 9; iRotationAngle = 0; iRotationApplied = EFalse; - if(iExifData != NULL) + if ( iExifData ) { delete iExifData; iExifData = NULL; } - if(iExifWriter != NULL) + if ( iExifWriter ) { delete iExifWriter; iExifWriter = NULL; @@ -544,12 +544,12 @@ iGlxItem = NULL; iRotationApplied = EFalse; - if(iExifData != NULL) + if ( iExifData ) { delete iExifData; iExifData = NULL; } - if(iExifWriter != NULL) + if ( iExifWriter ) { delete iExifWriter; iExifWriter = NULL; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersave.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersave.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersave.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -81,7 +81,7 @@ if(aCommandId == EGlxCmdSave) { RFile64& imageHandle = iImageViewerInstance->ImageFileHandle(); - if ( &imageHandle != NULL ) + if ( &imageHandle ) { if ( imageHandle.SubSessionHandle() != KNullHandle ) { diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -16,8 +16,6 @@ */ - - /** * @internal reviewed 06/06/2007 by Dave Schofield * @internal reviewed 13/07/2007 by Aki Vanhatalo @@ -42,16 +40,17 @@ #include #include #include +#include #include // for CGlxResourceUtilities #include #include #include #include #include +#include #include "glxcommandhandlernewmedia.h" - _LIT(KUnselectedIconIndex, "1\t"); _LIT(KAlbumIconIndex, "2\t"); _LIT(KBlankIconIndex, "3\t"); // No icon @@ -60,14 +59,15 @@ const TInt KMediaSelectionPopupMediaListHierarchyId = 0x2000A77A; const TInt KIconArrayGranularity = 2; -const TInt KNewItemId = 12345; +const TInt KNewItemId = 12345; // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- // -EXPORT_C CGlxMediaListAdaptor::CGlxMediaListAdaptor(const MGlxMediaList* aMediaList, TBool aMultiSelection) - : iMediaList(aMediaList), iMultiSelection(aMultiSelection) +EXPORT_C CGlxMediaListAdaptor::CGlxMediaListAdaptor( + const MGlxMediaList* aMediaList, TBool aMultiSelection) : + iMediaList(aMediaList), iMultiSelection(aMultiSelection) { } @@ -77,6 +77,7 @@ // void CGlxMediaListAdaptor::SetEnabled(TBool aEnabled) { + TRACER("CGlxMediaListAdaptor::SetEnabled"); iEnabled = aEnabled; } @@ -86,6 +87,7 @@ // const MGlxMediaList* CGlxMediaListAdaptor::MediaList() { + TRACER("CGlxMediaListAdaptor::MediaList"); return iMediaList; } @@ -104,6 +106,7 @@ // EXPORT_C TInt CGlxMediaListAdaptor::MdcaCount() const { + TRACER("CGlxMediaListAdaptor::MdcaCount"); __ASSERT_DEBUG(iMediaList, Panic(EGlxPanicNullPointer)); if (iEnabled) { @@ -121,10 +124,11 @@ // EXPORT_C TPtrC CGlxMediaListAdaptor::MdcaPoint(TInt aIndex) const { - const TGlxMedia& item = iMediaList->Item(aIndex); + TRACER("CGlxMediaListAdaptor::MdcaPoint"); + const TGlxMedia& item = iMediaList->Item(aIndex); TPtrC title = item.Title(); - if ( item.IsStatic() || title.Length() == 0 ) + if (item.IsStatic() || title.Length() == 0) { // The item is a static item or the item's title length is 0 iCurrentTitleString = KBlankIconIndex; @@ -140,41 +144,47 @@ iCurrentTitleString = KAlbumIconIndex; } } - + // iCurrentTitleString contains a tab character - iCurrentTitleString.Append(title.Left(KMaxTitleStringLength - iCurrentTitleString.Length())); + iCurrentTitleString.Append(title.Left(KMaxTitleStringLength + - iCurrentTitleString.Length())); return TPtrC(iCurrentTitleString); - } + } // --------------------------------------------------------------------------- // CGlxSingleGraphicPopupMenuStyleListBox::IsVisible // --------------------------------------------------------------------------- // TBool CGlxSingleGraphicPopupMenuStyleListBox::IsVisible(TInt aItemIndex) - { - return (TopItemIndex() <= aItemIndex && aItemIndex <= BottomItemIndex()); - } + { + TRACER("CGlxSingleGraphicPopupMenuStyleListBox::IsVisible"); + return (TopItemIndex() <= aItemIndex && aItemIndex <= BottomItemIndex()); + } // --------------------------------------------------------------------------- // CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL() // --------------------------------------------------------------------------- // -EXPORT_C TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox:: - OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) +EXPORT_C TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) { - __ASSERT_DEBUG(dynamic_cast< CGlxMediaListAdaptor* >(Model()->ItemTextArray()), Panic(EGlxPanicCastFailed)); - + TRACER("CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL"); + __ASSERT_DEBUG(dynamic_cast< CGlxMediaListAdaptor*>(Model()->ItemTextArray()), Panic(EGlxPanicCastFailed)); + if (aKeyEvent.iCode == EKeyOK && iView) { - CGlxMediaListAdaptor* mediaListAdaptor = static_cast (Model()->ItemTextArray()); - - if (mediaListAdaptor->MultiSelectionEnabled() && View()->CurrentItemIndex() >= 0 ) + CGlxMediaListAdaptor* mediaListAdaptor = + static_cast (Model()->ItemTextArray()); + + if (mediaListAdaptor->MultiSelectionEnabled() + && View()->CurrentItemIndex() >= 0) { - const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(View()->CurrentItemIndex()); + const TGlxMedia& item = mediaListAdaptor->MediaList()->Item( + View()->CurrentItemIndex()); // Reset the observer to populist - SetListBoxObserver(iPopupList) ; - if ( item.IsStatic() ) + SetListBoxObserver(iPopupList); + if (item.IsStatic()) { iListBoxFlags &= (~EMultipleSelection); // turn off multiple selection } @@ -184,103 +194,143 @@ } } } - - return CAknSingleGraphicPopupMenuStyleListBox::OfferKeyEventL(aKeyEvent, aType); + + return CAknSingleGraphicPopupMenuStyleListBox::OfferKeyEventL(aKeyEvent, + aType); } // --------------------------------------------------------------------------- // CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL() // --------------------------------------------------------------------------- // -void CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType) - { - switch(aEventType) - { - case EEventItemClicked : - case EEventItemSingleClicked : - { - CGlxMediaListAdaptor* mediaListAdaptor = static_cast (Model()->ItemTextArray()); - if (mediaListAdaptor->MultiSelectionEnabled() && View()->CurrentItemIndex() >= 0 ) - { - const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(View()->CurrentItemIndex()); - if ( item.IsStatic() ) - { - // when the user marks a non-static item and then clicks on - // a static item without moving highlight, the control comes here. - iListBoxFlags &= (~EMultipleSelection); // turn off multiple selection - } - else - { - iListBoxFlags |= EMultipleSelection; // turn on multiple selection - - TBool isMarked = View()->ItemIsSelected(View()->CurrentItemIndex()) ; - (isMarked == (TBool) ETrue) ? ( View()->DeselectItem(View()->CurrentItemIndex()) ) - : ( View()->SelectItemL(View()->CurrentItemIndex()) ) ; - } - } - aListBox->DrawDeferred(); - break ; - } - default : - break ; - } - } +void CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL( + CEikListBox *aListBox, TListBoxEvent aEventType) + { + TRACER("CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL"); + switch (aEventType) + { + case EEventItemClicked: + case EEventItemSingleClicked: + { + CGlxMediaListAdaptor + * mediaListAdaptor = + static_cast (Model()->ItemTextArray()); + if (mediaListAdaptor->MultiSelectionEnabled() + && View()->CurrentItemIndex() >= 0) + { + const TGlxMedia& item = mediaListAdaptor->MediaList()->Item( + View()->CurrentItemIndex()); + if (item.IsStatic()) + { + // when the user marks a non-static item and then clicks on + // a static item without moving highlight, the control comes here. + iListBoxFlags &= (~EMultipleSelection); // turn off multiple selection + } + else + { + iListBoxFlags |= EMultipleSelection; // turn on multiple selection + + TBool isMarked = View()->ItemIsSelected( + View()->CurrentItemIndex()); + (isMarked == (TBool) ETrue) + ? (View()->DeselectItem( + View()->CurrentItemIndex())) + : (View()->SelectItemL( + View()->CurrentItemIndex())); + } + } + aListBox->DrawDeferred(); + break; + } + default: + break; + } + } // --------------------------------------------------------------------------- // CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL() // --------------------------------------------------------------------------- // -void CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) - { - CGlxMediaListAdaptor* mediaListAdaptor = static_cast (Model()->ItemTextArray()); - if (mediaListAdaptor->MultiSelectionEnabled()) - { - // Need to handle the case when the highlight is on one item - // and the user clicks on another media item. The notification - // of changed item index is received very late. In order to - // handle this, checking if the index has changed. - TInt changedItemIndex = -1; - TInt itemIndex = View()->CurrentItemIndex(); - TBool isItemChanged = View()->XYPosToItemIndex(aPointerEvent.iPosition, changedItemIndex); - if (isItemChanged) - { - itemIndex = changedItemIndex; - } - const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(itemIndex); - if (item.IsStatic()) - { - // A static item is not markable. Turn off multiple selection - // Set the listbox observer to default that is CAknPopupList - // object, which will process it further. - iListBoxFlags &= (~EMultipleSelection); - SetListBoxObserver(iPopupList) ; - } - else - { - // Markable object. The event is handled in HandleListBoxEventL() - // Set the listbox observer to the current object. - SetListBoxObserver(this) ; - } - } - CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(aPointerEvent) ; - } +void CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + TRACER("CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL"); + CGlxMediaListAdaptor* mediaListAdaptor = + static_cast (Model()->ItemTextArray()); + if (mediaListAdaptor->MultiSelectionEnabled()) + { + // Need to handle the case when the highlight is on one item + // and the user clicks on another media item. The notification + // of changed item index is received very late. In order to + // handle this, checking if the index has changed. + TInt changedItemIndex = -1; + TInt itemIndex = View()->CurrentItemIndex(); + TBool isItemChanged = View()->XYPosToItemIndex( + aPointerEvent.iPosition, changedItemIndex); + if (isItemChanged) + { + itemIndex = changedItemIndex; + } + const TGlxMedia& item = + mediaListAdaptor->MediaList()->Item(itemIndex); + if (item.IsStatic()) + { + // A static item is not markable. Turn off multiple selection + // Set the listbox observer to default that is CAknPopupList + // object, which will process it further. + iListBoxFlags &= (~EMultipleSelection); + SetListBoxObserver(iPopupList); + } + else + { + // Markable object. The event is handled in HandleListBoxEventL() + // Set the listbox observer to the current object. + SetListBoxObserver(this); + } + + CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL( + aPointerEvent); + + const CListBoxView::CSelectionIndexArray* selectionIndices = + View()->SelectionIndexes(); + CEikButtonGroupContainer* cbaContainer = + iPopupList->ButtonGroupContainer(); + if (selectionIndices->Count() || item.IsStatic()) + { + cbaContainer->SetCommandSetL(R_GLX_SOFTKEYS_OK_CANCEL); + } + else + { + cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL); + } + cbaContainer->DrawDeferred(); + } + else + { + CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL( + aPointerEvent); + } + } // --------------------------------------------------------------------------- // CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList() // --------------------------------------------------------------------------- // -void CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList(CAknPopupList* aPopupList) - { - iPopupList = aPopupList; - } +void CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList( + CAknPopupList* aPopupList) + { + TRACER("CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList"); + iPopupList = aPopupList; + } // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- // -EXPORT_C CGlxMediaSelectionPopup::CGlxMediaSelectionPopup() - : CActive(EPriorityStandard) +EXPORT_C CGlxMediaSelectionPopup::CGlxMediaSelectionPopup() : + CActive(EPriorityStandard) { + TRACER("GlxMediaSelectionPopup::CGlxMediaSelectionPopup"); CActiveScheduler::Add(this); } @@ -290,6 +340,7 @@ // void CGlxMediaSelectionPopup::RunL() { + TRACER("CGlxMediaSelectionPopup::RunL"); // The media list adaptor is enabled after the popup list is invoked // to ensure that the popup list is laid out correctly. iMediaListAdaptor->SetEnabled(ETrue); @@ -309,107 +360,109 @@ // CGlxMediaSelectionPopup::ExecuteLD() // --------------------------------------------------------------------------- // -EXPORT_C CMPXCollectionPath* CGlxMediaSelectionPopup::ExecuteLD(CMPXCollectionPath& aPath, - TBool& aAccepted, - TBool aMultiSelection, - TBool aEnableContainerCreation, - CMPXFilter* aFilter) - { +EXPORT_C CMPXCollectionPath* CGlxMediaSelectionPopup::ExecuteLD( + CMPXCollectionPath& aPath, TBool& aAccepted, TBool aMultiSelection, + TBool aEnableContainerCreation, CMPXFilter* aFilter) + { + TRACER("CGlxMediaSelectionPopup::ExecuteLD"); CleanupStack::PushL(this); // if something leaves delete 'this' object - + iEnableContainerCreation = aEnableContainerCreation; - + iCollectionId = TGlxMediaId(aPath.Id(0)); - + FetchTitlesL(); - - iMediaList = MGlxMediaList::InstanceL(aPath, KMediaSelectionPopupMediaListHierarchyId, aFilter); - + + iMediaList = MGlxMediaList::InstanceL(aPath, + KMediaSelectionPopupMediaListHierarchyId, aFilter); + iMediaList->AddMediaListObserverL(this); - iMediaListAdaptor = new(ELeave) CGlxMediaListAdaptor(iMediaList, aMultiSelection); - - + iMediaListAdaptor = new (ELeave) CGlxMediaListAdaptor(iMediaList, + aMultiSelection); + SetupAttributeContextL(); AddResourceFileL(); ConstructPopupListL(aMultiSelection); InitIconsL(); - + CompleteSelf(); // This will cause RunL() to be called by the active scheduler. - + // Invoke the dialog. // The media list adaptor MdcaCount() method must return 0 at this point in order // for the popup to be displayed correctly. If MdcaCount() returns 1 then the popup will contain only // a single row. // iPopupList->ExecuteLD() starts a nested active scheduler so acvtive objects will be executed before // iPopupList->ExecuteLD() completes. - aAccepted = iPopupList->ExecuteLD(); - + aAccepted = iPopupList->ExecuteLD(); + if (iListBox->CurrentItemIndex() < 0) - { - // There is no current item therefore there is nothing to select - // Fix for error ID: ERBS-7BSKFV Application crashes if user attempts to add a tag when in full screen view. - aAccepted = EFalse; - } - + { + // There is no current item therefore there is nothing to select + // Fix for error ID: ERBS-7BSKFV Application crashes if user attempts to add a tag when in full screen view. + aAccepted = EFalse; + } + iMediaList->RemoveMediaListObserver(this); // We no longer require any callbacks from the media list - - + + CMPXCollectionPath* path = NULL; if (aAccepted) { - if(iMediaList->Item(iListBox->CurrentItemIndex()).IsStatic()) - { - - CGlxCommandHandlerNewMedia* commandHandlerNewMedia = CGlxCommandHandlerNewMedia::NewL(this); - TGlxMediaId newMediaId; - TInt error = commandHandlerNewMedia->ExecuteLD(newMediaId); - if (error == KErrNone) - { + if (iMediaList->Item(iListBox->CurrentItemIndex()).IsStatic()) + { + + CGlxCommandHandlerNewMedia* commandHandlerNewMedia = + CGlxCommandHandlerNewMedia::NewL(this); + TGlxMediaId newMediaId; + TInt error = commandHandlerNewMedia->ExecuteLD(newMediaId); + if (error == KErrNone) + { path = CMPXCollectionPath::NewL(aPath); - CleanupStack::PopAndDestroy(this); - CleanupStack::PushL(path); + CleanupStack::PopAndDestroy(this); + CleanupStack::PushL(path); path->AppendL(newMediaId.Value()); CleanupStack::Pop(path); - } - else if (error == KErrCancel) - { + } + else if (error == KErrCancel) + { // The user has cancelled the popup list - aAccepted = EFalse; - CleanupStack::PopAndDestroy(this); - } - else - { + aAccepted = EFalse; + CleanupStack::PopAndDestroy(this); + } + else + { // The error is neither KErrNone or KErrCancel, leave. - User::Leave(error); - } - - } + User::Leave(error); + } + + } else - { - iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iListBox->CurrentItemIndex()); - - const CListBoxView::CSelectionIndexArray* selectionIndices = - iListBox->SelectionIndexes(); - - TInt count = selectionIndices->Count(); - for (TInt i = 0; i < count; i++) - { - iMediaList->SetSelectedL(selectionIndices->At(i), ETrue); - } - - path = iMediaList->PathLC( NGlxListDefs::EPathFocusOrSelection ); - CleanupStack::Pop(path); - CleanupStack::PopAndDestroy(this); - } + { + iMediaList->SetFocusL(NGlxListDefs::EAbsolute, + iListBox->CurrentItemIndex()); + + const CListBoxView::CSelectionIndexArray* selectionIndices = + iListBox->SelectionIndexes(); + + TInt count = selectionIndices->Count(); + for (TInt i = 0; i < count; i++) + { + iMediaList->SetSelectedL(selectionIndices->At(i), ETrue); + } + + path = iMediaList->PathLC(NGlxListDefs::EPathFocusOrSelection); + CleanupStack::Pop(path); + CleanupStack::PopAndDestroy(this); + } } else - { - CleanupStack::PopAndDestroy(this); - } - + { + CleanupStack::PopAndDestroy(this); + } + return path; } @@ -417,7 +470,7 @@ // CGlxMediaSelectionPopup::ListBoxItemsChanged() // --------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::ListBoxItemsChanged( CEikListBox* /*aListBox*/ ) +void CGlxMediaSelectionPopup::ListBoxItemsChanged(CEikListBox* /*aListBox*/) { // Don't do anything. } @@ -427,17 +480,18 @@ // ----------------------------------------------------------------------------- // CGlxMediaSelectionPopup::~CGlxMediaSelectionPopup() - { + { + TRACER("CGlxMediaSelectionPopup::~CGlxMediaSelectionPopup"); Cancel(); - delete iMediaListAdaptor; - delete iListBox; + delete iMediaListAdaptor; + delete iListBox; if (iResourceOffset) { CCoeEnv::Static()->DeleteResourceFile(iResourceOffset); } - + if (iMediaList) { if (iAttributeContext) @@ -445,11 +499,11 @@ iMediaList->RemoveContext(iAttributeContext); } iMediaList->RemoveMediaListObserver(this); // This is required in case ExecuteLD() left. - + iMediaList->Close(); } - - delete iAttributeContext; + + delete iAttributeContext; delete iSelectMediaPopupTitle; delete iNewMediaItemTitle; } @@ -458,40 +512,49 @@ // CGlxMediaSelectionPopup::HandleItemAddedL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleItemAddedL( TInt aStartIndex, - TInt aEndIndex, MGlxMediaList* aList ) - { +void CGlxMediaSelectionPopup::HandleItemAddedL(TInt aStartIndex, + TInt aEndIndex, MGlxMediaList* aList) + { + TRACER("CGlxMediaSelectionPopup::HandleItemAddedL"); // The call to HandleItemAdditionL() should be deferred if all of the new items // don't have title attributes as unnecessary calls to HandleItemAdditionL will // cause the dialog to flicker. if (iListBox) - { + { TBool handleItemAdditionRequired = EFalse; for (TInt i = aStartIndex; i <= aEndIndex; i++) - { - TGlxMedia item = aList->Item(i); - if (item.Title().Length() > 0) - // The title length is greater than 0, i.e. there is a title. - { - handleItemAdditionRequired = ETrue; - break; - } - } - - if (handleItemAdditionRequired) - { - iListBox->HandleItemAdditionL(); - } - else - { - iHandleItemAdditionRequired = ETrue; // defer the call until we have title attributes - } + { + TGlxMedia item = aList->Item(i); + if (item.Title().Length() > 0) + // The title length is greater than 0, i.e. there is a title. + { + handleItemAdditionRequired = ETrue; + break; + } + } + + if (handleItemAdditionRequired) + { + iListBox->HandleItemAdditionL(); + } + else + { + iHandleItemAdditionRequired = ETrue; // defer the call until we have title attributes + } } - CEikButtonGroupContainer* cbaContainer = iPopupList->ButtonGroupContainer(); - cbaContainer->SetCommandSetL(R_GLX_SOFTKEYS_OK_CANCEL); - cbaContainer->DrawDeferred(); - + CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); + CleanupClosePushL(*uiUtility); + if ((iMediaListAdaptor && !iMediaListAdaptor->MultiSelectionEnabled()) + || !uiUtility->IsPenSupported()) + { + CEikButtonGroupContainer* cbaContainer = + iPopupList->ButtonGroupContainer(); + cbaContainer->SetCommandSetL(R_GLX_SOFTKEYS_OK_CANCEL); + cbaContainer->DrawDeferred(); + } + CleanupStack::PopAndDestroy(uiUtility); + ///@todo if required: update the existing selection when items are added } @@ -499,8 +562,8 @@ // CGlxMediaSelectionPopup::HandleMediaL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleMediaL( TInt /*aListIndex*/, - MGlxMediaList* /*aList*/ ) +void CGlxMediaSelectionPopup::HandleMediaL(TInt /*aListIndex*/, + MGlxMediaList* /*aList*/) { // Don't do anything. } @@ -509,9 +572,10 @@ // CGlxMediaSelectionPopup::HandleItemRemovedL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleItemRemovedL( TInt /*aStartIndex*/, - TInt /*aEndIndex*/, MGlxMediaList* /*aList*/ ) +void CGlxMediaSelectionPopup::HandleItemRemovedL(TInt /*aStartIndex*/, + TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) { + TRACER("CGlxMediaSelectionPopup::HandleItemRemovedL"); if (iListBox) { iListBox->HandleItemRemovalL(); @@ -523,17 +587,18 @@ // ----------------------------------------------------------------------------- // void CGlxMediaSelectionPopup::HandleItemModifiedL( - const RArray& aItemIndexes, MGlxMediaList* /*aList*/ ) + const RArray& aItemIndexes, MGlxMediaList* /*aList*/) { + TRACER("CGlxMediaSelectionPopup::HandleItemModifiedL"); if (iListBox) { for (TInt i = 0; i < aItemIndexes.Count(); i++) - { - if (iListBox->IsVisible(aItemIndexes[i])) - { - iListBox->RedrawItem(aItemIndexes[i]); - } - } + { + if (iListBox->IsVisible(aItemIndexes[i])) + { + iListBox->RedrawItem(aItemIndexes[i]); + } + } } } @@ -541,20 +606,21 @@ // CGlxMediaSelectionPopup::HandleAttributesAvailableL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleAttributesAvailableL( TInt aItemIndex, - const RArray& /*aAttributes*/, MGlxMediaList* /*aList*/ ) +void CGlxMediaSelectionPopup::HandleAttributesAvailableL(TInt aItemIndex, + const RArray& /*aAttributes*/, MGlxMediaList* /*aList*/) { + TRACER("CGlxMediaSelectionPopup::HandleAttributesAvailableL"); if (iListBox) - { - if (iHandleItemAdditionRequired) - { - iListBox->HandleItemAdditionL(); - iHandleItemAdditionRequired = EFalse; - } - if(iListBox->IsVisible(aItemIndex)) - { - iListBox->RedrawItem(aItemIndex); - } + { + if (iHandleItemAdditionRequired) + { + iListBox->HandleItemAdditionL(); + iHandleItemAdditionRequired = EFalse; + } + if (iListBox->IsVisible(aItemIndex)) + { + iListBox->RedrawItem(aItemIndex); + } } } @@ -563,8 +629,8 @@ // ----------------------------------------------------------------------------- // void CGlxMediaSelectionPopup::HandleFocusChangedL( - NGlxListDefs::TFocusChangeType /*aType*/, TInt /*aNewIndex*/, - TInt /*aOldIndex*/, MGlxMediaList* /*aList*/ ) + NGlxListDefs::TFocusChangeType /*aType*/, TInt /*aNewIndex*/, + TInt /*aOldIndex*/, MGlxMediaList* /*aList*/) { // Don't do anything. } @@ -573,8 +639,8 @@ // CGlxMediaSelectionPopup::HandleItemSelectedL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleItemSelectedL( TInt /*aIndex*/, - TBool /*aSelected*/, MGlxMediaList* /*aList*/ ) +void CGlxMediaSelectionPopup::HandleItemSelectedL(TInt /*aIndex*/, + TBool /*aSelected*/, MGlxMediaList* /*aList*/) { // Don't do anything. } @@ -583,8 +649,8 @@ // CGlxMediaSelectionPopup::HandleMessageL() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleMessageL( const CMPXMessage& /*aMessage*/, - MGlxMediaList* /*aList*/ ) +void CGlxMediaSelectionPopup::HandleMessageL(const CMPXMessage& /*aMessage*/, + MGlxMediaList* /*aList*/) { // Don't do anything. } @@ -593,7 +659,7 @@ // CGlxMediaSelectionPopup::HandleError() // ----------------------------------------------------------------------------- // -void CGlxMediaSelectionPopup::HandleError( TInt /*aError*/ ) +void CGlxMediaSelectionPopup::HandleError(TInt /*aError*/) { ///@todo implement } @@ -614,12 +680,13 @@ // void CGlxMediaSelectionPopup::AddResourceFileL() { + TRACER("CGlxMediaSelectionPopup::AddResourceFileL"); // Load resource TParse parse; parse.Set(KGlxCommonCommandHandlerResource, &KDC_APP_RESOURCE_DIR, NULL); TFileName resourceFile; resourceFile.Append(parse.FullName()); - CGlxResourceUtilities::GetResourceFilenameL(resourceFile); + CGlxResourceUtilities::GetResourceFilenameL(resourceFile); iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile); } @@ -629,9 +696,10 @@ // void CGlxMediaSelectionPopup::SetupAttributeContextL() { + TRACER("CGlxMediaSelectionPopup::SetupAttributeContextL"); iAttributeContext = new (ELeave) CGlxAttributeContext(&iIterator); iAttributeContext->AddAttributeL(KMPXMediaGeneralTitle); - iMediaList->AddContextL( iAttributeContext, KGlxFetchContextPriorityLow ); + iMediaList->AddContextL(iAttributeContext, KGlxFetchContextPriorityLow); } // ----------------------------------------------------------------------------- @@ -640,38 +708,35 @@ // void CGlxMediaSelectionPopup::InitIconsL() { - CAknIconArray* iconArray = new (ELeave) CAknIconArray(KIconArrayGranularity); - CleanupStack::PushL(iconArray); - + TRACER("CGlxMediaSelectionPopup::InitIconsL"); + CAknIconArray* iconArray = new (ELeave) CAknIconArray( + KIconArrayGranularity); + CleanupStack::PushL(iconArray); + // Sets graphics as ListBox icon. iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray); - + CleanupStack::Pop(iconArray); // iconArray - + ///@todo use mgallery icons when available MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - CGulIcon* icon = AknsUtils::CreateGulIconL( - skin, - KAknsIIDQgnPropCheckboxOn, - KAvkonBitmapFile, - EMbmAvkonQgn_prop_checkbox_on, - EMbmAvkonQgn_prop_checkbox_on_mask ); + CGulIcon* icon = + AknsUtils::CreateGulIconL(skin, KAknsIIDQgnPropCheckboxOn, + KAvkonBitmapFile, EMbmAvkonQgn_prop_checkbox_on, + EMbmAvkonQgn_prop_checkbox_on_mask); CleanupStack::PushL(icon); iconArray->AppendL(icon); CleanupStack::Pop(icon); - - icon = AknsUtils::CreateGulIconL( - skin, - KAknsIIDQgnPropCheckboxOff, - KAvkonBitmapFile, - EMbmAvkonQgn_prop_checkbox_off, - EMbmAvkonQgn_prop_checkbox_off_mask ); + + icon = AknsUtils::CreateGulIconL(skin, KAknsIIDQgnPropCheckboxOff, + KAvkonBitmapFile, EMbmAvkonQgn_prop_checkbox_off, + EMbmAvkonQgn_prop_checkbox_off_mask); CleanupStack::PushL(icon); iconArray->AppendL(icon); CleanupStack::Pop(icon); - + iconArray->AppendFromResourceL(R_GLX_ALBUM_SELECTION_ICONS); - + ///@todo Find a more elegant way of not painting an icon. CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; CleanupStack::PushL(bitmap); @@ -687,14 +752,18 @@ // ----------------------------------------------------------------------------- // void CGlxMediaSelectionPopup::AddNewMediaCreationItemL() - { + { + TRACER("CGlxMediaSelectionPopup::AddNewMediaCreationItemL"); if (iEnableContainerCreation) { - CGlxMedia* newMediaCreationStaticItem = new (ELeave) CGlxMedia(TGlxMediaId(KNewItemId)); + CGlxMedia* newMediaCreationStaticItem = new (ELeave) CGlxMedia( + TGlxMediaId(KNewItemId)); CleanupStack::PushL(newMediaCreationStaticItem); __ASSERT_DEBUG(iNewMediaItemTitle, Panic(EGlxPanicNullPointer)); - newMediaCreationStaticItem->SetTextValueL(KMPXMediaGeneralTitle, *iNewMediaItemTitle); - iMediaList->AddStaticItemL(newMediaCreationStaticItem, NGlxListDefs::EInsertFirst); + newMediaCreationStaticItem->SetTextValueL(KMPXMediaGeneralTitle, + *iNewMediaItemTitle); + iMediaList->AddStaticItemL(newMediaCreationStaticItem, + NGlxListDefs::EInsertFirst); CleanupStack::Pop(newMediaCreationStaticItem); } } @@ -705,9 +774,10 @@ // void CGlxMediaSelectionPopup::CompleteSelf() { - TRequestStatus* status=&iStatus; + TRACER("CGlxMediaSelectionPopup::CompleteSelf"); + TRequestStatus* status = &iStatus; User::RequestComplete(status, KErrNone); - SetActive(); + SetActive(); } // ----------------------------------------------------------------------------- @@ -715,73 +785,84 @@ // ----------------------------------------------------------------------------- // void CGlxMediaSelectionPopup::FetchTitlesL() - { - CMPXCollectionPath* path = CMPXCollectionPath::NewL(); - CleanupStack::PushL(path); - - MGlxMediaList* rootList = MGlxMediaList::InstanceL(*path); - CleanupClosePushL(*rootList); - - TGlxSpecificIdIterator iter(KGlxIdSpaceIdRoot, iCollectionId); - CGlxAttributeContext* attributeContext = new (ELeave) CGlxAttributeContext(&iter); - CleanupStack::PushL(attributeContext); - attributeContext->AddAttributeL(KGlxMediaCollectionPluginSpecificNewMediaItemTitle); - attributeContext->AddAttributeL(KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle); - rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); - - // TGlxContextRemover will remove the context when it goes out of scope + { + TRACER("CGlxMediaSelectionPopup::FetchTitlesL"); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL(path); + + MGlxMediaList* rootList = MGlxMediaList::InstanceL(*path); + CleanupClosePushL(*rootList); + + TGlxSpecificIdIterator iter(KGlxIdSpaceIdRoot, iCollectionId); + CGlxAttributeContext* attributeContext = + new (ELeave) CGlxAttributeContext(&iter); + CleanupStack::PushL(attributeContext); + attributeContext->AddAttributeL( + KGlxMediaCollectionPluginSpecificNewMediaItemTitle); + attributeContext->AddAttributeL( + KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle); + rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); + + // TGlxContextRemover will remove the context when it goes out of scope // Used here to avoid a trap and still have safe cleanup - TGlxFetchContextRemover contextRemover(attributeContext, *rootList); - CleanupClosePushL( contextRemover ); - User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, *rootList, EFalse)); - // context off the list - CleanupStack::PopAndDestroy( &contextRemover ); + TGlxFetchContextRemover contextRemover(attributeContext, *rootList); + CleanupClosePushL(contextRemover); + User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, + *rootList, EFalse)); + // context off the list + CleanupStack::PopAndDestroy(&contextRemover); - TInt index = rootList->Index(KGlxIdSpaceIdRoot, iCollectionId); + TInt index = rootList->Index(KGlxIdSpaceIdRoot, iCollectionId); - __ASSERT_DEBUG(index > KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); - TGlxMedia item = rootList->Item(index); + __ASSERT_DEBUG(index> KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); + TGlxMedia item = rootList->Item(index); - const CGlxMedia* media = item.Properties(); - if (media) - { - iNewMediaItemTitle = media->ValueText(KGlxMediaCollectionPluginSpecificNewMediaItemTitle).AllocL(); - iSelectMediaPopupTitle = media->ValueText(KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle).AllocL(); - } + const CGlxMedia* media = item.Properties(); + if (media) + { + iNewMediaItemTitle = media->ValueText( + KGlxMediaCollectionPluginSpecificNewMediaItemTitle).AllocL(); + iSelectMediaPopupTitle + = media->ValueText( + KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle).AllocL(); + } - - CleanupStack::PopAndDestroy(attributeContext); - CleanupStack::PopAndDestroy(rootList); - CleanupStack::PopAndDestroy(path); - } + CleanupStack::PopAndDestroy(attributeContext); + CleanupStack::PopAndDestroy(rootList); + CleanupStack::PopAndDestroy(path); + } // ----------------------------------------------------------------------------- // CGlxMediaSelectionPopup::ConstructPopupListL() // ----------------------------------------------------------------------------- // void CGlxMediaSelectionPopup::ConstructPopupListL(TBool aMultiSelection) - { - // create the list box + { + TRACER("CGlxMediaSelectionPopup::ConstructPopupListL"); + // create the list box iListBox = new (ELeave) CGlxSingleGraphicPopupMenuStyleListBox; - + // create the popup list iPopupList = CAknPopupList::NewL(iListBox, R_AVKON_SOFTKEYS_CANCEL); - + // set the title of the popup __ASSERT_DEBUG(iSelectMediaPopupTitle, Panic(EGlxPanicNullPointer)); iPopupList->SetTitleL(*iSelectMediaPopupTitle); - - iListBox ->ConstructL(iPopupList, aMultiSelection ? EAknListBoxMultiselectionList : EAknListBoxMenuList); + + iListBox ->ConstructL(iPopupList, + aMultiSelection + ? EAknListBoxMultiselectionList + : EAknListBoxMenuList); iListBox->CreateScrollBarFrameL(); iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); // create the listbox model iListBox->Model()->SetItemTextArray(iMediaListAdaptor); iListBox->View()->CalcBottomItemIndex(); iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); - + // Store the pointer of AknPopupList iListBox->SetPopupList(iPopupList); - } + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h --- a/photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h Fri Feb 19 22:51:01 2010 +0200 @@ -61,8 +61,6 @@ int integer() const ; private: - - void ConsumeDRMRightsL( const TGlxMedia& aMedia ); TSize ThumbnailSize(const CGlxMedia* aMedia); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp --- a/photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -134,13 +134,7 @@ expired = iDrmUtility->CheckOpenRightsL(uri, (cat == EMPXImage)); if( expired ) { - // 200 is to Consume rights only while opening DRM items - // in Cover Flow Widget - if ( aSize.iWidth > 200 && aIsFocused) - { - ConsumeDRMRightsL( aMedia ); - } - if ( isValid ) + if ( isValid ) { // Fix for EABI-7RL9DD // Replaced defaultSize with aSize @@ -166,9 +160,9 @@ TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( icon.bitmapId, resFile, defaultSize ).Id() ); } - else if ( KErrNone == thumbnailError || KErrArgument == thumbnailError || ( drm && isValid == EGlxDrmRightsInvalid ) ) - - { + else if ( (KErrNone == thumbnailError) || (KErrArgument == thumbnailError) + || (KErrDiskFull == thumbnailError) || ( drm && isValid == EGlxDrmRightsInvalid ) ) + { //Try and see if we can scale and show the grid tnm else show the default TBool isGridTnmShown = EFalse; if(HasRelevantThumbnail(aMedia,defaultSize)) @@ -210,52 +204,6 @@ throw std::bad_alloc(); } } - -void GlxThumbnailVariantType::ConsumeDRMRightsL( const TGlxMedia& aMedia ) - { - TRACER("GlxThumbnailVariantType::ConsumeDRMRightsL"); - - const CGlxMedia* media = aMedia.Properties(); - - if(media) - { - if(aMedia.IsDrmProtected()) - { - - TMPXGeneralCategory cat = aMedia.Category(); - const TDesC& uri = aMedia.Uri(); - if( cat != EMPXNoCategory && uri.Length() > 0 ) - { - - // check if rights have expired - TBool expired = !iDrmUtility->CheckOpenRightsL(uri, (cat == EMPXImage)); - - if(expired) - { - return; - } - - TSize size; - if(EMPXImage == cat && aMedia.GetDimensions(size)) - { - // check size - TSize bmpSize = ThumbnailSize(media); - - if(ConsumeRightsBasedOnSize(size, bmpSize)) - { - // pass URI to DRM utility - iDrmUtility->ConsumeRightsL(uri); - } - } - } - } - else - { - // not an DRM'd item no need to check again - } - } - - } // ----------------------------------------------------------------------------- // ConsumeRightsBasedOnSize - check if DRM rights should be consumed @@ -326,7 +274,7 @@ // TSize GlxThumbnailVariantType::ThumbnailSize(const CGlxMedia* aMedia) { - TRACER("CGlxCommandHandlerDrm::ThumbnailSize"); + TRACER("GlxThumbnailVariantType::ThumbnailSize"); TSize bmpSize(0,0); TArray attr = aMedia->Attributes(); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/drmutility/src/glxdrmutility.cpp --- a/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -35,6 +35,7 @@ #include #include #include +#include "glxtracer.h" const TInt KGlxDRMThumbnailHeight = 120; const TInt KGlxDRMThumbnailWidth = 90; @@ -64,9 +65,10 @@ //============================================================================ EXPORT_C CGlxDRMUtility* CGlxDRMUtility::InstanceL() { + TRACER("CGlxDRMUtility::InstanceL()"); CGlxDrmTls* tls = reinterpret_cast(Dll::Tls()); - if(tls==NULL) + if ( !tls ) { CGlxDRMUtility* drmutil = new(ELeave)CGlxDRMUtility(); CleanupStack::PushL(drmutil); @@ -89,9 +91,10 @@ //============================================================================ EXPORT_C void CGlxDRMUtility::Close() { + TRACER("CGlxDRMUtility::Close()"); CGlxDrmTls* tls = reinterpret_cast(Dll::Tls()); - if (tls != NULL) + if ( tls ) { tls->iRefCount--; @@ -111,6 +114,7 @@ //============================================================================ CGlxDRMUtility::~CGlxDRMUtility() { + TRACER("CGlxDRMUtility::~CGlxDRMUtility()"); delete iCManager; delete iDrmHelper; delete iLastConsumedItemUri; @@ -122,6 +126,7 @@ EXPORT_C TBool CGlxDRMUtility::CheckOpenRightsL( const TDesC& aUri, TBool aCheckViewRights ) { + TRACER("CGlxDRMUtility::CheckOpenRightsL()"); // When checking current rights for a URI, clear stored URI TPtr ptr = iLastConsumedItemUri->Des(); ptr.Zero(); @@ -145,6 +150,7 @@ EXPORT_C TBool CGlxDRMUtility::CheckDisplayRightsL( const TDesC& aUri, TBool aCheckViewRights ) { + TRACER("CGlxDRMUtility::CheckDisplayRightsL()"); // Allow to display if rights for a URI was just consumed (i.e. same as stored URI) if ( iLastConsumedItemUri->Length() > 0 ) { @@ -163,6 +169,7 @@ //============================================================================ EXPORT_C TBool CGlxDRMUtility::ConsumeRightsL(const TDesC& aUri) { + TRACER("CGlxDRMUtility::ConsumeRightsL()"); TVirtualPathPtr path( aUri, KDefaultContentObject() ); // Create a CData object to read the content @@ -195,6 +202,7 @@ //============================================================================ EXPORT_C TBool CGlxDRMUtility::CanShowInfoOnlineL(TDesC& aUri) { + TRACER("CGlxDRMUtility::CanShowInfoOnlineL()"); TBool canShowInfoOnline = EFalse; HBufC8* urlBuf = NULL; @@ -211,6 +219,7 @@ //============================================================================ EXPORT_C void CGlxDRMUtility::ShowInfoOnlineL(TDesC& aUri) { + TRACER("CGlxDRMUtility::ShowInfoOnlineL()"); iDrmHelper->OpenInfoUrlL(aUri); } @@ -220,6 +229,7 @@ EXPORT_C TBool CGlxDRMUtility::CanSetAsAutomatedL(const TDesC& aUri, TGlxDrmAutomatedType aType) { + TRACER("CGlxDRMUtility::CanSetAsAutomatedL()"); TBool canSetAutomated = EFalse; switch(aType) { @@ -241,6 +251,7 @@ EXPORT_C void CGlxDRMUtility::SetAsAutomatedL(const TDesC& aUri, TGlxDrmAutomatedType aType) { + TRACER("CGlxDRMUtility::SetAsAutomatedL()"); switch(aType) { case EGlxDrmAutomatedTypeWallpaper: @@ -267,6 +278,7 @@ //============================================================================ EXPORT_C void CGlxDRMUtility::ShowDRMDetailsPaneL( const TDesC& aUri ) { + TRACER("CGlxDRMUtility::ShowDRMDetailsPaneL()"); TRAPD( err, iDrmHelper->LaunchDetailsViewEmbeddedL( aUri ) ); // if no rights ask user to re-activate? if( err == KErrCANoRights ) @@ -283,6 +295,7 @@ //============================================================================ EXPORT_C TBool CGlxDRMUtility::IsForwardLockedL(const TDesC& aUri) { + TRACER("CGlxDRMUtility::IsForwardLockedL()"); TBool forwardLocked = EFalse; TVirtualPathPtr path( aUri, KDefaultContentObject() ); @@ -297,6 +310,7 @@ //============================================================================ EXPORT_C void CGlxDRMUtility::ShowRightsInfoL(const TDesC& aUri) { + TRACER("CGlxDRMUtility::ShowRightsInfoL()"); iDrmHelper->CheckRightsAmountL( aUri ); } @@ -305,6 +319,7 @@ //============================================================================ EXPORT_C TSize CGlxDRMUtility::DRMThumbnailSize(TSize& aSize) { + TRACER("CGlxDRMUtility::DRMThumbnailSize()"); TSize thumbnailSize(KGlxDRMThumbnailWidth, KGlxDRMThumbnailHeight); if((aSize.iWidth*aSize.iHeight)/4 < @@ -322,7 +337,7 @@ */ CGlxDRMUtility::CGlxDRMUtility() { - + TRACER("CGlxDRMUtility::CGlxDRMUtility()"); } /** @@ -330,6 +345,7 @@ */ void CGlxDRMUtility::ConstructL() { + TRACER("CGlxDRMUtility::ConstructL()"); iCManager = ContentAccess::CManager::NewL(); iDrmHelper = CDRMHelper::NewL(); iLastConsumedItemUri = HBufC::NewL(0); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/group/glxmedialists.mmp --- a/photosgallery/viewframework/medialists/group/glxmedialists.mmp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/group/glxmedialists.mmp Fri Feb 19 22:51:01 2010 +0200 @@ -65,14 +65,13 @@ SYSTEMINCLUDE ../../../commonui/inc SYSTEMINCLUDE ../../../inc SYSTEMINCLUDE ../../drmutility/inc -SYSTEMINCLUDE ../../inc // for GlxTvOut +SYSTEMINCLUDE ../../inc // for GlxTvOut SYSTEMINCLUDE ../../../gallery/inc APP_LAYER_SYSTEMINCLUDE // if you comment the lines below out, Photos dB will be used for thumbnail fetching MACRO USE_S60_TNM -MACRO MEDIA_ID_BASED_TN_FETCH_ENABLED #define USE_S60_TNM LIBRARY avkon.lib // CAknView diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/src/glxcache.cpp --- a/photosgallery/viewframework/medialists/src/glxcache.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/src/glxcache.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -173,7 +173,7 @@ RArray newAttributes; CleanupClosePushL(newAttributes); - if (item != NULL) + if ( item ) { GLX_DEBUG2("MGallery - CGlxCacheManager::HandleCollectionMediaL() existing item for item id %d", id.Value()); CopyNewAndModifiedL(*item, aMedia, newAttributes); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/src/glxcachemanager.cpp --- a/photosgallery/viewframework/medialists/src/glxcachemanager.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/src/glxcachemanager.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -121,7 +121,7 @@ #ifdef USE_S60_TNM iTnEngine = CThumbnailManager::NewL( *this); - iTnEngine->SetDisplayModeL( EColor64K ); + iTnEngine->SetDisplayModeL( EColor16MU ); #endif } @@ -589,14 +589,8 @@ } TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); -#ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED - GLX_DEBUG2("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) itemId %d", itemId.Value()); - if (item.Uri().Find(KFileIdentifier) != KErrNotFound || - item.Uri().Length() && itemId.Value()) -#else GLX_DEBUG1("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) Uri"); if (item.Uri().Find(KFileIdentifier) != KErrNotFound) -#endif { #ifdef _DEBUG iStartTime.HomeTime(); // Get home time @@ -635,7 +629,7 @@ { CreateImageViewerInstanceL(); GLX_DEBUG1("KGlxCollectionPluginImageViewerImplementationUid - Fetch (Private) TN!"); - if ( &(iImageViewerInstance->ImageFileHandle()) != NULL ) + if ( &(iImageViewerInstance->ImageFileHandle()) ) { CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(iImageViewerInstance->ImageFileHandle()); iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(*source), spaceId, tnSize, itemId)); @@ -653,13 +647,11 @@ } else { -#ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED - iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(itemId.Value()), spaceId, tnSize, itemId)); -#else - CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(item.Uri(), 0); - iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(*source), spaceId, tnSize, itemId)); - CleanupStack::PopAndDestroy(source); -#endif + CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(item.Uri(), 0); + iThumbnailRequestIds.AppendL(TLoadingTN( + iTnEngine->GetThumbnailL(*source), + spaceId, tnSize, itemId)); + CleanupStack::PopAndDestroy(source); } iThumbnailId = itemId; } @@ -728,7 +720,7 @@ { // private path RFile64& imageHandle = iImageViewerInstance->ImageFileHandle(); - if ( &imageHandle != NULL ) + if ( &imageHandle ) { fileName.Append(imageHandle.FullName(fileName)); } @@ -741,7 +733,7 @@ else { // user data path - if( iImageViewerInstance->ImageUri() != NULL ) + if ( iImageViewerInstance->ImageUri() ) { fileName.Append(iImageViewerInstance->ImageUri()->Des()); RFs fs; @@ -1440,7 +1432,7 @@ { TRACER("CGlxCacheManager::ThumbnailPreviewReady"); TInt error = KErrNotSupported; - if (aThumbnail.Bitmap() != NULL) + if ( aThumbnail.Bitmap() ) { GLX_DEBUG1("CGlxCacheManager::ThumbnailPreviewReady preview aval"); error = KErrNone; @@ -1566,10 +1558,7 @@ void CGlxCacheManager::CreateImageViewerInstanceL() { TRACER("CGlxCacheManager::CreateImageViewerInstanceL"); - if ( iImageViewerInstance == NULL ) - { - iImageViewerInstance = CGlxImageViewerManager::InstanceL(); - } + iImageViewerInstance = CGlxImageViewerManager::InstanceL(); __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); } @@ -1580,7 +1569,7 @@ void CGlxCacheManager::DeleteImageViewerInstance() { TRACER("CGlxCacheManager::DeleteImageViewerInstance"); - if ( iImageViewerInstance != NULL ) + if ( iImageViewerInstance ) { iImageViewerInstance->DeleteInstance(); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/src/glxerrormanager.cpp --- a/photosgallery/viewframework/medialists/src/glxerrormanager.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/src/glxerrormanager.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -191,10 +191,11 @@ /// all errors are temporary switch ( aErrorCode ) { - case KErrArgument: // fallthrough - case KErrNotSupported: // fallthrough - case KErrNoMemory: - case KErrCorrupt: + case KErrArgument: // fallthrough + case KErrNotSupported: // fallthrough + case KErrNoMemory: // fallthrough + case KErrCorrupt: // fallthrough + case KErrDiskFull: // add other permanent error codes here return EFalse; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/src/glximagereader.cpp --- a/photosgallery/viewframework/medialists/src/glximagereader.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/src/glximagereader.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -108,14 +108,14 @@ TInt errInImage = KErrNone; if (iImgViewerMgr->IsPrivate()) { - if ( &(iImgViewerMgr->ImageFileHandle()) != NULL ) + if ( &(iImgViewerMgr->ImageFileHandle()) ) { TRAP(errInImage,iImageDecoder = CImageDecoder::FileNewL(iImgViewerMgr->ImageFileHandle(), ContentAccess::EPeek)); } } else { - if ( iImgViewerMgr->ImageUri() != NULL ) + if ( iImgViewerMgr->ImageUri() ) { TRAP(errInImage,iImageDecoder = CImageDecoder::FileNewL(CCoeEnv::Static()->FsSession(), iImgViewerMgr->ImageUri()->Des())); } @@ -176,14 +176,14 @@ CContent* content = NULL; if(iImgViewerMgr->IsPrivate()) { - if ( &(iImgViewerMgr->ImageFileHandle()) != NULL ) + if ( &(iImgViewerMgr->ImageFileHandle()) ) { content = CContent::NewLC(iImgViewerMgr->ImageFileHandle()); } } else { - if ( iImgViewerMgr->ImageUri() != NULL ) + if ( iImgViewerMgr->ImageUri() ) { content = CContent::NewLC(iImgViewerMgr->ImageUri()->Des()); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/medialists/tsrc/t_cglxgarbagecollector/t_cglxgarbagecollector.cpp --- a/photosgallery/viewframework/medialists/tsrc/t_cglxgarbagecollector/t_cglxgarbagecollector.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/medialists/tsrc/t_cglxgarbagecollector/t_cglxgarbagecollector.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -2333,7 +2333,7 @@ EXPORT_C CIdle* CIdle::New(TInt aPriority) { CIdle *pI=new CIdle(aPriority); - if (pI!=NULL) + if ( pI ) CActiveScheduler::Add(pI); return(pI); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss --- a/photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss Fri Feb 19 22:51:01 2010 +0200 @@ -295,8 +295,7 @@ MENU_ITEM { command = EGlxCmdAiwShareOnOvi; /* txt comes from ShareOnline 4.3 */}, MENU_ITEM { command = EGlxCmdAiwEdit; - txt = qtn_lgal_options_edit; - cascade = AIW_INTELLIGENT_CASCADE_ID|AIW_LOCK_SUBMENU_TITLE; }, + txt = qtn_lgal_options_edit; }, MENU_ITEM { command = EGlxCmdDetails; txt = qtn_lgal_options_details; }, MENU_ITEM { command = EGlxCmdAiwAssign; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss --- a/photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss Fri Feb 19 22:51:01 2010 +0200 @@ -51,7 +51,6 @@ { menubar = r_grid_menubar; cba = r_grid_softkeys; - toolbar = r_glx_grid_view_toolbar; } // Captured Grid View @@ -59,7 +58,6 @@ { menubar = r_grid_menubar; cba = r_grid_softkeys; - toolbar = r_glx_grid_view_toolbar; } // Months Grid View @@ -67,7 +65,6 @@ { menubar = r_grid_menubar; cba = r_grid_softkeys; - toolbar = r_glx_grid_view_toolbar; } // Albums Grid View @@ -75,7 +72,6 @@ { menubar = r_glx_album_grid_menubar; cba = r_grid_softkeys; - toolbar = r_glx_grid_view_toolbar; } // Tag Grid View @@ -83,7 +79,6 @@ { menubar = r_taggrid_menubar; cba = r_grid_softkeys; - toolbar = r_glx_grid_view_toolbar; } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/plugins/tagsbrowserviewplugin/data/glxtagsbrowserview.rss --- a/photosgallery/viewframework/plugins/tagsbrowserviewplugin/data/glxtagsbrowserview.rss Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/plugins/tagsbrowserviewplugin/data/glxtagsbrowserview.rss Fri Feb 19 22:51:01 2010 +0200 @@ -63,17 +63,10 @@ { items= { - MENU_ITEM { command = EGlxCmdSlideshow; - txt = qtn_lgal_options_slideshow; - cascade = r_tile_shw_menu;}, MENU_ITEM { command=EGlxCmdSortByAlphabetical; txt=qtn_lgal_options_alphabetical; }, MENU_ITEM { command=EGlxCmdSortByCount; txt=qtn_lgal_options_most_used; }, - MENU_ITEM { command = EGlxCmdDelete; - txt = qtn_lgal_options_delete;}, - MENU_ITEM { command = EGlxCmdRename; - txt = qtn_lgal_options_rename;}, MENU_ITEM { command=EGlxStopShowing; txt=qtn_lgal_options_stop_show; }, MENU_ITEM { command=EAknCmdHelp; @@ -201,3 +194,22 @@ } }; } + +//Rename Text +RESOURCE TBUF r_glx_tags_rename_title + { + buf = qtn_lgal_options_rename; + } + +// Slide show text +RESOURCE TBUF r_glx_tags_slideshow_title + { + buf = qtn_lgal_options_slideshow; + } + +// Delete text +RESOURCE TBUF r_glx_tags_delete_title + { + buf = qtn_lgal_options_delete; + } + diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp --- a/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -372,7 +372,7 @@ CFbsBitmap* picture = new (ELeave) CFbsBitmap; CleanupStack::PushL(picture); User::LeaveIfError(picture->Create(TSize(KGlxFlatTextureSize, - KGlxFlatTextureSize), EColor64K ) ); + KGlxFlatTextureSize), EColor16MU ) ); CFbsBitmapDevice* drawBufDevice = CFbsBitmapDevice::NewL(picture); CleanupStack::PushL(drawBufDevice); @@ -1005,7 +1005,7 @@ { TRACER("CGlxTextureManagerImpl::SelectAttributeL"); const CGlxMedia& media = *aMedia.Properties(); - if ( aMedia.Properties() == NULL || media.Count() == 0 ) + if ( !aMedia.Properties() || media.Count() == 0 ) { GLX_LOG_INFO("SelectAttributeL - NULL CGlxMedia / No Attribs"); User::Leave( KErrArgument ); @@ -1103,7 +1103,7 @@ TInt textureToBeUnloaded = -1; //check if the image is decoded - if(aBitmap != NULL) + if ( aBitmap ) { iZoomedList[aThumbnailIndex].iBitmap = aBitmap; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/bwins/glxtvoutu.def --- a/photosgallery/viewframework/tvout/bwins/glxtvoutu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/bwins/glxtvoutu.def Fri Feb 19 22:51:01 2010 +0200 @@ -11,4 +11,6 @@ ?IsHDMIConnected@CGlxTv@@QBEHXZ @ 10 NONAME ; int CGlxTv::IsHDMIConnected(void) const ?ActivateZoom@CGlxHdmiController@@QAEXXZ @ 11 NONAME ; void CGlxHdmiController::ActivateZoom(void) ?DeactivateZoom@CGlxHdmiController@@QAEXXZ @ 12 NONAME ; void CGlxHdmiController::DeactivateZoom(void) + ?ShiftToPostingMode@CGlxHdmiController@@QAEXXZ @ 13 NONAME ; void CGlxHdmiController::ShiftToPostingMode(void) + ?ShiftToCloningMode@CGlxHdmiController@@QAEXXZ @ 14 NONAME ; void CGlxHdmiController::ShiftToCloningMode(void) diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/eabi/glxtvoutu.def --- a/photosgallery/viewframework/tvout/eabi/glxtvoutu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/eabi/glxtvoutu.def Fri Feb 19 22:51:01 2010 +0200 @@ -23,4 +23,6 @@ _ZTV17CGlxHdmiDecoderAO @ 22 NONAME _ZTV18CGlxHdmiController @ 23 NONAME _ZTV22CGlxHdmiSurfaceUpdater @ 24 NONAME + _ZN18CGlxHdmiController18ShiftToCloningModeEv @ 25 NONAME + _ZN18CGlxHdmiController18ShiftToPostingModeEv @ 26 NONAME diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/inc/glxhdmicontroller.h --- a/photosgallery/viewframework/tvout/inc/glxhdmicontroller.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/inc/glxhdmicontroller.h Fri Feb 19 22:51:01 2010 +0200 @@ -50,7 +50,7 @@ * @param3 - frame count */ IMPORT_C void SetImageL(const TDesC& aImageFile,TSize aImageDimensions, - TInt aFrameCount, TBool aStore = ETrue); + TInt aFrameCount = 1, TBool aStore = ETrue); /* * To Determine it is a video and not image @@ -65,6 +65,17 @@ * Deactivating zoom in posting mode */ IMPORT_C void DeactivateZoom(); + + /* + * ShiftToCloningMode + */ + IMPORT_C void ShiftToCloningMode(); + + /* + * ShiftToPostingMode + */ + IMPORT_C void ShiftToPostingMode(); + private:// From MGlxTvObserver virtual void HandleTvStatusChangedL ( TTvChangeType aChangeType ); @@ -118,8 +129,6 @@ CGlxHdmiContainer* iHdmiContainer; CGlxHdmiSurfaceUpdater* iSurfaceUpdater; CGlxTv* iGlxTvOut; - TBool iIsHDMIconnected; - TBool iIsHDMIdisConnected; }; #endif /* GLXHDMICONTROLLER_H_ */ diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/inc/glxhdmisurfaceupdater.h --- a/photosgallery/viewframework/tvout/inc/glxhdmisurfaceupdater.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/inc/glxhdmisurfaceupdater.h Fri Feb 19 22:51:01 2010 +0200 @@ -72,6 +72,17 @@ * Zoom in our out depending on parameter */ void Zoom(TBool aZoom); + + /* + ShiftToCloningMOde + */ + void ShiftToCloningMode(); + + /* + ShiftToPostingMode + */ + void ShiftToPostingMode(); + private: /* * Ctor @@ -161,6 +172,7 @@ TPoint iLeftCornerForZoom; CPeriodic* iTimer; TBool iZoom; + TBool iBitmapReady; #ifdef _DEBUG TTime iStartTime; TTime iStopTime; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/src/glxactivedecoder.cpp --- a/photosgallery/viewframework/tvout/src/glxactivedecoder.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/src/glxactivedecoder.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -60,7 +60,6 @@ { TRACER("CGlxHdmiDecoderAO::RunL()"); iHdmiSurfaceUpdater->HandleRunL(); - CActiveScheduler::Stop(); } // ----------------------------------------------------------------------------- @@ -82,7 +81,6 @@ iDecoder = aDecoder; iDecoder->Convert(&iStatus,aBitmap, aFrameNum); SetActive(); - CActiveScheduler::Start(); } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp --- a/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -71,7 +71,6 @@ if (iGlxTvOut->IsHDMIConnected()) { - iIsHDMIconnected = ETrue; if(aImageDimensions.iHeight<=KHdTvHeight && aImageDimensions.iWidth<= KHdTvWidth && aFrameCount > 0) { @@ -144,6 +143,31 @@ iSurfaceUpdater->DeactivateZoom(); } } + +// ----------------------------------------------------------------------------- +// ShiftToCloningMode +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ShiftToCloningMode() + { + TRACER("CGlxHdmiController::ShiftToCloningMode()"); + if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) + { + iSurfaceUpdater->ShiftToCloningMode(); + } + } + +// ----------------------------------------------------------------------------- +// ShiftToPostingMode +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ShiftToPostingMode() + { + TRACER("CGlxHdmiController::ShiftToPostingMode()"); + if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) + { + iSurfaceUpdater->ShiftToPostingMode(); + } + } + // ----------------------------------------------------------------------------- // Constructor // ----------------------------------------------------------------------------- @@ -161,8 +185,6 @@ { TRACER("CGlxHdmiController::ConstructL()"); iGlxTvOut = CGlxTv::NewL(*this); - iIsHDMIconnected = EFalse; - iIsHDMIdisConnected = EFalse; } // ----------------------------------------------------------------------------- @@ -239,27 +261,18 @@ void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) { TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); - if(iIsHDMIdisConnected) - { - iIsHDMIdisConnected = EFalse; - } - else if ( aChangeType == ETvConnectionChanged ) + if ( aChangeType == ETvConnectionChanged ) { if ( iGlxTvOut->IsHDMIConnected() ) { GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); // Calling SetImageL() with appropriate parameters - if(!iIsHDMIconnected) - { - SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse); - } + SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse); } else { // if it gets disconnected, destroy the surface GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); - iIsHDMIconnected = EFalse; - iIsHDMIdisConnected = ETrue; DestroySurfaceUpdater(); } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp --- a/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -60,6 +60,10 @@ { TRACER("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater()"); ReleaseContent(); + if(iWindow) + { + iWindow->RemoveBackgroundSurface(ETrue); + } if(iTimer->IsActive()) { iTimer->Cancel(); @@ -138,7 +142,7 @@ { User::LeaveIfError(error); } - + iBitmapReady = EFalse; // Create the active object iGlxDecoderAO = CGlxHdmiDecoderAO::NewL(this, iFrameCount); CreateImageDecoderL(iImagePath); @@ -171,6 +175,7 @@ TInt /*aFrameCount*/) { TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); + iBitmapReady = EFalse; ReleaseContent(); CreateImageDecoderL(aImageFile); CreateBitmapL(); @@ -203,9 +208,7 @@ CActive::EPriorityStandard-1); CActiveScheduler::Add(iSurfBufferAO); } - - //Set the background Surface - iWindow->SetBackgroundSurface(iSurfId); + } // ----------------------------------------------------------------------------- @@ -240,6 +243,9 @@ } //Map the surface and stride the surface info MapSurfaceL(); + //Set the background Surface + iWindow->SetBackgroundSurface(iSurfId); + } // ----------------------------------------------------------------------------- @@ -365,7 +371,7 @@ GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() ConvertImageL took" " <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); #endif - + iBitmapReady = ETrue; iZoomRectSz = iDecodedBitmap->SizeInPixels(); if (iSurfBufferAO->iStatus != KRequestPending && !iSurfBufferAO->IsActive()) { @@ -375,6 +381,12 @@ iSurfUpdateSession.NotifyWhenAvailable(iSurfBufferAO->iStatus); TInt err = iSurfUpdateSession.SubmitUpdate(1, iSurfId, 0, NULL); } + //release imagedecoder after the conversion is over + if(iImageDecoder) + { + delete iImageDecoder; + iImageDecoder = NULL; + } } // ----------------------------------------------------------------------------- @@ -399,7 +411,7 @@ TRACER("CGlxHdmiSurfaceUpdater::ActivateZoom()"); iConfig.SetSurfaceId(iSurfId); iZoom = ETrue; - if(!iTimer->IsActive()) + if(!iTimer->IsActive() && iBitmapReady) { iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); } @@ -472,3 +484,21 @@ iConfig.SetExtent(TRect(0,0,KHdTvWidth,KHdTvHeight)); iWindow->SetBackgroundSurface(iConfig, ETrue); } + +// ----------------------------------------------------------------------------- +// ShiftToCloningMode +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ShiftToCloningMode() + { + TRACER("CGlxHdmiSurfaceUpdater::ShiftToCloningMode()"); + iWindow->RemoveBackgroundSurface(ETrue); + } + +// ----------------------------------------------------------------------------- +// ShiftToPostingMode +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ShiftToPostingMode() + { + TRACER("CGlxHdmiSurfaceUpdater::ShiftToPostingMode()"); + iWindow->SetBackgroundSurface(iSurfId); + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp --- a/photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -177,9 +177,20 @@ void CGlxTvConnectionMonitor::IssueNotificationL() { GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL"); + TBool previousTvState = iTvOutConnectionState; + TBool previousHDMIState = iHDMIConnectionState; + GLX_LOG_INFO2("previousTvState = %d , previousHDMIState = %d", + previousTvState,previousHDMIState); iTvOutConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeTVOut); iHDMIConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeHDMI); - iConnectionObserver.HandleTvConnectionStatusChangedL(); + // Call Statuschnage only if actually TvState or HDMIState has changed. + if ( previousTvState!= iTvOutConnectionState || + previousHDMIState != iHDMIConnectionState) + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL -" + " TvConnectionStatusChanged"); + iConnectionObserver.HandleTvConnectionStatusChangedL(); + } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/bwins/glxcloudviewu.def --- a/photosgallery/viewframework/views/cloudview/bwins/glxcloudviewu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/bwins/glxcloudviewu.def Fri Feb 19 22:51:01 2010 +0200 @@ -1,16 +1,16 @@ EXPORTS - ??0CGlxInfoBubble@@QAE@XZ @ 1 NONAME ; CGlxInfoBubble::CGlxInfoBubble(void) - ??1CGlxInfoBubble@@UAE@XZ @ 2 NONAME ; CGlxInfoBubble::~CGlxInfoBubble(void) - ?BaseConstructL@CGlxInfoBubble@@QAEXAAVCAlfControl@@AAVCAlfEnv@@@Z @ 3 NONAME ; void CGlxInfoBubble::BaseConstructL(class CAlfControl &, class CAlfEnv &) - ?CreateThumbnailTextureL@CGlxInfoBubble@@IAEAAVCAlfTexture@@ABVTGlxMedia@@ABV?$TGlxId@VTGlxIdSpaceIdBase@@@@ABVTSize@@@Z @ 4 NONAME ; class CAlfTexture & CGlxInfoBubble::CreateThumbnailTextureL(class TGlxMedia const &, class TGlxId const &, class TSize const &) - ?DisappearBubble@CGlxInfoBubble@@IAEXXZ @ 5 NONAME ; void CGlxInfoBubble::DisappearBubble(void) - ?DisplayBubbleL@CGlxInfoBubble@@IAEXVTPoint@@AAVCAlfTexture@@ABVTDesC16@@2@Z @ 6 NONAME ; void CGlxInfoBubble::DisplayBubbleL(class TPoint, class CAlfTexture &, class TDesC16 const &, class TDesC16 const &) - ?NewL@CGlxCloudView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 7 NONAME ; class CGlxCloudView * CGlxCloudView::NewL(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) - ?NewL@CGlxCloudViewImp@Alf@@SAPAV12@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 8 NONAME ; class Alf::CGlxCloudViewImp * Alf::CGlxCloudViewImp::NewL(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) + ?UpdateTextureL@CGlxInfoBubble@@IAEXAAVCAlfTexture@@@Z @ 1 NONAME ; void CGlxInfoBubble::UpdateTextureL(class CAlfTexture &) + ?NewLC@CGlxCloudViewImp@Alf@@SAPAV12@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 2 NONAME ; class Alf::CGlxCloudViewImp * Alf::CGlxCloudViewImp::NewLC(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) + ?ResetImage@CGlxInfoBubble@@IAEXXZ @ 3 NONAME ; void CGlxInfoBubble::ResetImage(void) + ?DisplayBubbleL@CGlxInfoBubble@@IAEXVTPoint@@AAVCAlfTexture@@ABVTDesC16@@2@Z @ 4 NONAME ; void CGlxInfoBubble::DisplayBubbleL(class TPoint, class CAlfTexture &, class TDesC16 const &, class TDesC16 const &) + ?BaseConstructL@CGlxInfoBubble@@QAEXAAVCAlfControl@@AAVCAlfEnv@@@Z @ 5 NONAME ; void CGlxInfoBubble::BaseConstructL(class CAlfControl &, class CAlfEnv &) + ?NewLC@CGlxContainerInfoBubble@@SAPAV1@PAVMGlxMediaList@@AAVCAlfEnv@@AAVCAlfControl@@@Z @ 6 NONAME ; class CGlxContainerInfoBubble * CGlxContainerInfoBubble::NewLC(class MGlxMediaList *, class CAlfEnv &, class CAlfControl &) + ??1CGlxInfoBubble@@UAE@XZ @ 7 NONAME ; CGlxInfoBubble::~CGlxInfoBubble(void) + ??0CGlxInfoBubble@@QAE@XZ @ 8 NONAME ; CGlxInfoBubble::CGlxInfoBubble(void) ?NewL@CGlxContainerInfoBubble@@SAPAV1@PAVMGlxMediaList@@AAVCAlfEnv@@AAVCAlfControl@@@Z @ 9 NONAME ; class CGlxContainerInfoBubble * CGlxContainerInfoBubble::NewL(class MGlxMediaList *, class CAlfEnv &, class CAlfControl &) - ?NewLC@CGlxCloudView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 10 NONAME ; class CGlxCloudView * CGlxCloudView::NewLC(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) - ?NewLC@CGlxCloudViewImp@Alf@@SAPAV12@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 11 NONAME ; class Alf::CGlxCloudViewImp * Alf::CGlxCloudViewImp::NewLC(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) - ?NewLC@CGlxContainerInfoBubble@@SAPAV1@PAVMGlxMediaList@@AAVCAlfEnv@@AAVCAlfControl@@@Z @ 12 NONAME ; class CGlxContainerInfoBubble * CGlxContainerInfoBubble::NewLC(class MGlxMediaList *, class CAlfEnv &, class CAlfControl &) - ?ResetImage@CGlxInfoBubble@@IAEXXZ @ 13 NONAME ; void CGlxInfoBubble::ResetImage(void) - ?UpdateTextureL@CGlxInfoBubble@@IAEXAAVCAlfTexture@@@Z @ 14 NONAME ; void CGlxInfoBubble::UpdateTextureL(class CAlfTexture &) + ?NewL@CGlxCloudViewImp@Alf@@SAPAV12@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 10 NONAME ; class Alf::CGlxCloudViewImp * Alf::CGlxCloudViewImp::NewL(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) + ?NewLC@CGlxCloudView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 11 NONAME ; class CGlxCloudView * CGlxCloudView::NewLC(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) + ?CreateThumbnailTextureL@CGlxInfoBubble@@IAEAAVCAlfTexture@@ABVTGlxMedia@@ABV?$TGlxId@VTGlxIdSpaceIdBase@@@@ABVTSize@@@Z @ 12 NONAME ; class CAlfTexture & CGlxInfoBubble::CreateThumbnailTextureL(class TGlxMedia const &, class TGlxId const &, class TSize const &) + ?DisappearBubble@CGlxInfoBubble@@IAEXXZ @ 13 NONAME ; void CGlxInfoBubble::DisappearBubble(void) + ?NewL@CGlxCloudView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTDesC16@@HHHH@Z @ 14 NONAME ; class CGlxCloudView * CGlxCloudView::NewL(class MGlxMediaListFactory *, class TDesC16 const &, int, int, int, int) diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/eabi/glxcloudviewu.def --- a/photosgallery/viewframework/views/cloudview/eabi/glxcloudviewu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/eabi/glxcloudviewu.def Fri Feb 19 22:51:01 2010 +0200 @@ -22,4 +22,6 @@ _ZTV14CGlxInfoBubble @ 21 NONAME ; ## _ZTV20CGlxCloudViewControl @ 22 NONAME ; ## _ZTV23CGlxContainerInfoBubble @ 23 NONAME ; ## + _ZTI26CGlxTagsContextMenuControl @ 24 NONAME + _ZTV26CGlxTagsContextMenuControl @ 25 NONAME diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp --- a/photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp Fri Feb 19 22:51:01 2010 +0200 @@ -38,6 +38,7 @@ SOURCE glxcloudviewcontrol.cpp SOURCE glxinfobubble.cpp SOURCE glxbubbletimer.cpp +SOURCE glxtagscontextmenucontrol.cpp APP_LAYER_SYSTEMINCLUDE @@ -50,6 +51,7 @@ SYSTEMINCLUDE ../../../../inc SYSTEMINCLUDE ../../../../common/inc SYSTEMINCLUDE ../../../../commonui/inc +SYSTEMINCLUDE ../../../commandhandlers/inc USERINCLUDE ../inc @@ -77,6 +79,9 @@ LIBRARY cdlengine.lib LIBRARY aknlayout2scalable.lib LIBRARY aknphysics.lib - +LIBRARY fbscli.lib +LIBRARY gdi.lib +LIBRARY charconv.lib // For UtfConverter +LIBRARY commonengine.lib // End of File \ No newline at end of file diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h --- a/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h Fri Feb 19 22:51:01 2010 +0200 @@ -31,6 +31,7 @@ //use includes #include #include "glxcontainerinfobubble.h" +#include "glxbubbletimer.h" //for timer functionality #include "glxcloudinfo.h" #include @@ -54,6 +55,8 @@ class MGlxEnterKeyEventObserver; class MGlxCloudViewLayoutObserver; class CAknPhysics; +class CGlxTagsContextMenuControl ; +class MGlxItemMenuObserver; enum TTagEventType { @@ -69,6 +72,7 @@ class CGlxCloudViewControl : public CAlfControl,public IAlfWidgetEventHandler ,public MGlxMediaListObserver ,public MAknPhysicsObserver + ,public MGlxTimerNotifier { public: @@ -83,7 +87,9 @@ MGlxMediaList& aMediaList, const TDesC& aEmptyText ,MGlxCloudViewMskObserver& aObserver ,MGlxEnterKeyEventObserver& aObserverEnterKeyEvent, - CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver); + CAlfAnchorLayout *aAnchorLayout, + MGlxCloudViewLayoutObserver& aLayoutObserver + ,MGlxItemMenuObserver& aItemMenuObserver); /** * Perform the two phase construction @@ -96,7 +102,8 @@ MGlxMediaList& aMediaList, const TDesC& aEmptyText ,MGlxCloudViewMskObserver& aObserver ,MGlxEnterKeyEventObserver& aObserverEnterKeyEvent, - CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver); + CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver + ,MGlxItemMenuObserver& aItemMenuObserver); /** * Destroy the object and release all memory objects @@ -181,6 +188,18 @@ */ void InitializeScrollBar(IAlfScrollBarWidget* aScrollBarWidget); + /** + * Hides/shows the grid layout + * @param aShow - Show value + */ + void ShowContextItemMenu(TBool aShow); + +public://MGlxTimernotifier + /** + * Virtual Function from MGlxTimernotifier + */ + void TimerComplete(); + private: /** * Perform the two phase construction @@ -267,7 +286,8 @@ * Perform the second phase of two phase construction * @param aEmptyText - Specifies the text for the empty list */ - void ConstructL(const TDesC& aEmptyText,CAlfDisplay& aDisplay,CAlfAnchorLayout *aAnchorLayout); + void ConstructL(const TDesC& aEmptyText,CAlfDisplay& aDisplay, + CAlfAnchorLayout *aAnchorLayout,MGlxItemMenuObserver& aItemMenuObserver); /** * Updates Row Structure @@ -549,7 +569,6 @@ // initiates bubble container CGlxContainerInfoBubble *iBubbleContainer; - // Fetch context for list item attributes CGlxDefaultAttributeContext* iAttributeContext; @@ -625,6 +644,15 @@ //boolean to check if dragging really happened TBool iViewDragged; + + /**variable used for providing delay */ + CGlxBubbleTimer* iTimer; + + //Alfcontrol to draw grid layout for handling floating bar menu items + CGlxTagsContextMenuControl* iTagsContextMenuControl; + + /**flag for Timer completion */ + TBool iTimerComplete; }; #endif // C_GLXCLOUDVIEWCONTROL_H diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h --- a/photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h Fri Feb 19 22:51:01 2010 +0200 @@ -31,6 +31,8 @@ #include "glxcloudview.h" //base class #include "mglxcloudviewlayoutobserver.h" +#include "glxtagscontextmenucontrol.h" // MGlxItemMenuObserver + // FORWARD DECLARATIONS class CGlxCloudViewControl; @@ -50,7 +52,8 @@ NONSHARABLE_CLASS(CGlxCloudViewImp): public CGlxCloudView, public MGlxCloudViewMskObserver, public MGlxEnterKeyEventObserver, - public MGlxCloudViewLayoutObserver + public MGlxCloudViewLayoutObserver, + public MGlxItemMenuObserver { public: @@ -109,6 +112,21 @@ * Called when layout is changed */ void HandleLayoutChanged(); +public: + //MGlxItemMenuObserver + /** + * To Handle menu items in Grid layout + * @param aCommand command to be handled + */ + void HandleGridMenuListL(TInt aCommand); + +public: + /** + * Derived classes should use this to initialize the menus if required + * @param aResourceId The menu resource + * @param aMenuPane The menu pane to edit + */ + void ViewDynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane); protected: // From CGlxViewBase diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h Fri Feb 19 22:51:01 2010 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cloud View Context menu control + * +*/ + +#ifndef GLXTAGSCONTEXTMENUCONTROL_H_ +#define GLXTAGSCONTEXTMENUCONTROL_H_ + +#include +#include +#include +#include "glxbubbletimer.h" //for timer functionality + +//Forward Declaration +class CAlfGridLayout; +class CGlxUiUtility; + +/** + *MGlxItemMenuObserver is a class to handle the menu items in grid layout + */ +class MGlxItemMenuObserver + { +public: + /** + * To Handle menu items in Grid layout + * @param aCommand command to be handled + */ + virtual void HandleGridMenuListL(TInt aCommand) = 0; + }; + +class CGlxTagsContextMenuControl : public CAlfControl, public MGlxTimerNotifier + + { +public: + /** + * Perform the two phase construction + * @param aItemMenuObserver - handles the menu items in grid layout + * @return Pointer to newly created object + */ + static CGlxTagsContextMenuControl* NewL( MGlxItemMenuObserver& aItemMenuObserver ); + /** + * Perform the two phase construction + * @param aItemMenuObserver - handles the menu items in grid layout + * @return Pointer to newly created object + */ + static CGlxTagsContextMenuControl* NewLC( MGlxItemMenuObserver& aItemMenuObserver ); + /** + * Destroy the object and release all memory objects + */ + ~CGlxTagsContextMenuControl(); + +public://MGlxTimernotifier + /** + * Virtual Function from MGlxTimernotifier + */ + void TimerComplete(); + +public: + /** + * Sets the grid layout on the screen with the Point specified + * @param aPoint - Point from which grid has to be displayed + */ + void SetDisplay(const TPoint& aPoint); + /** + * Hides/shows the grid layout + * @param aOpacity - Opacity value + */ + void ShowItemMenu(TBool aOpacity); + + /** + * Sets the drawable screen rect + * It also handles coordinates changed from Orientation + * @param aRect - rect area where the Tags are drawn + */ + void SetViewableRect(TRect aRect); + +private: + /** + * constructor + * @param aItemMenuObserver - handles the menu items in grid layout + */ + CGlxTagsContextMenuControl( MGlxItemMenuObserver& aItemMenuObserver ); + + /** + * Perform the second phase of two phase construction + */ + void ConstructL(); + + /** + * Creates the font + * @return the fontId + */ + TInt CreateFontL(); + /** + * Creates the menulist and sets the Text style + * @param aFontId - Sets the text style + */ + void CreateMenuListL(TInt aFontId); + + /** + * Perform the two phase construction + * @param aEvent - key Event to handle + * @return EKeyWasConsumed if key event is processed, + * otherwise EKeyWasNotConsumed + */ + TBool OfferEventL(const TAlfEvent& aEvent); + +private: + + //Ui Utility, not owning, only close + CGlxUiUtility* iUiUtility; + + // Background Image Visual + CAlfImageVisual* iBackgroundBorderImageVisual; + + //Observer to handle the menu items in grid layout + MGlxItemMenuObserver& iItemMenuObserver; + + //Grid layout, not owning + CAlfGridLayout* iGrid; + + //Slideshow text, not owning + CAlfTextVisual* iSlideshowTextVisual; + + //Delete text, not owning + CAlfTextVisual* iDeleteTextVisual; + + //Rename text, not owning + CAlfTextVisual* iRenameTextVisual; + + // Anchor Layout + CAlfAnchorLayout* iMainVisual; + + //variable used for providing delay + CGlxBubbleTimer* iTimer; + + //Viewable rect + TRect iViewableRect; + + //flag for stylus menu visibility + TBool iItemMenuVisibility; + }; + +#endif /* GLXTAGSCONTEXTMENUCONTROL_H_ */ diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp --- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -16,8 +16,6 @@ */ - - // INCLUDE FILES #include "glxcloudviewcontrol.h" //class header //AlfT headers @@ -33,6 +31,8 @@ #include // For CAlfDisplay #include // For alfScrollbar model #include +#include +#include #include // For Kinetic Scrolling #include #include @@ -49,6 +49,7 @@ #include "mglxcloudviewmskobserver.h" // For Msk Observer #include "mglxenterkeyeventobserver.h" // For enterkey observer #include "mglxcloudviewlayoutobserver.h" +#include "glxtagscontextmenucontrol.h" //Constants const TInt KPrimaryFontSize = 21; @@ -68,6 +69,7 @@ const TReal KBoundaryMargin = 0.1; //10% = 10/100 = 0.1 const TInt KFastCloudMovement = 100; //Transition time to move cloud view const TInt KSlowCloudMovement = 1000; //Transition time to move cloud view +const TInt KLongPressTimer = 1500000; //1.5 seconds // --------------------------------------------------------------------------- // Two-phased constructor. @@ -76,11 +78,13 @@ CGlxCloudViewControl *CGlxCloudViewControl::NewL(CAlfDisplay& aDisplay, CAlfEnv &aEnv, MGlxMediaList& aMediaList, const TDesC& aEmptyText, MGlxCloudViewMskObserver& aObserver,MGlxEnterKeyEventObserver& aObserverEnterKeyEvent - ,CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver) + ,CAlfAnchorLayout *aAnchorLayout, + MGlxCloudViewLayoutObserver& aLayoutObserver + ,MGlxItemMenuObserver& aItemMenuObserver) { TRACER("GLX_CLOUD::CGlxCloudViewControl::NewL"); CGlxCloudViewControl *self = CGlxCloudViewControl::NewLC (aDisplay, aEnv, - aMediaList, aEmptyText,aObserver,aObserverEnterKeyEvent,aAnchorLayout,aLayoutObserver); + aMediaList, aEmptyText,aObserver,aObserverEnterKeyEvent,aAnchorLayout,aLayoutObserver,aItemMenuObserver); CleanupStack::Pop (self); return self; } @@ -92,13 +96,14 @@ CGlxCloudViewControl *CGlxCloudViewControl::NewLC(CAlfDisplay& aDisplay, CAlfEnv &aEnv, MGlxMediaList& aMediaList, const TDesC& aEmptyText, MGlxCloudViewMskObserver& aObserver,MGlxEnterKeyEventObserver& aObserverEnterKeyEvent - ,CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver) + ,CAlfAnchorLayout *aAnchorLayout,MGlxCloudViewLayoutObserver& aLayoutObserver + ,MGlxItemMenuObserver& aItemMenuObserver) { TRACER("GLX_CLOUD::CGlxCloudViewControl::NewLC"); CGlxCloudViewControl *self = new(ELeave)CGlxCloudViewControl(aEnv,aMediaList,aObserver ,aObserverEnterKeyEvent,aLayoutObserver); CleanupStack::PushL (self); - self->ConstructL (aEmptyText,aDisplay,aAnchorLayout); + self->ConstructL (aEmptyText,aDisplay,aAnchorLayout,aItemMenuObserver); return self; } @@ -126,7 +131,7 @@ // --------------------------------------------------------------------------- // void CGlxCloudViewControl::ConstructL(const TDesC& aEmptyText,CAlfDisplay& aDisplay - ,CAlfAnchorLayout *aAnchorLayout) + ,CAlfAnchorLayout *aAnchorLayout,MGlxItemMenuObserver& aItemMenuObserver) { TRACER("GLX_CLOUD::CGlxCloudViewControl::ConstructL"); iUiUtility = CGlxUiUtility::UtilityL (); @@ -137,6 +142,16 @@ iEmptyText = aEmptyText.AllocL(); + iTimer = CGlxBubbleTimer::NewL (this); + + CAlfControlGroup* ctrlGroup = iUiUtility->Env()->FindControlGroup(0); + //Creating Grid control for floating menu bar + iTagsContextMenuControl = CGlxTagsContextMenuControl::NewL(aItemMenuObserver); + if(ctrlGroup) + { + ctrlGroup->AppendL(iTagsContextMenuControl); + } + TRect rect; AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect); iScreenHeight = rect.Height (); @@ -240,6 +255,12 @@ iUiUtility->Close (); } delete iEmptyText; + + if ( iTimer) + { + iTimer->Cancel ();//cancels any outstanding requests + delete iTimer; + } delete iPhysics; } @@ -1426,6 +1447,9 @@ EAlfPointerEventReportDrag + EAlfPointerEventReportLongTap + EAlfPointerEventReportUnhandled, *this); Display()->Roster().DisableLongTapEventsWhenDragging(*this); + + //If the grid is already shown , disable it + iTagsContextMenuControl->ShowItemMenu(EFalse); if(tappedvisual) { @@ -1435,13 +1459,14 @@ //if the tapped visual is same as the visual in the layout then focus that visual if(layoutvisual == tappedvisual) { - TInt focus = iMediaList.FocusIndex(); - if (index != focus) - { - iTouchFeedback->InstantFeedback(ETouchFeedbackBasic); - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, index); - SetFocusColor(); - } + iTouchFeedback->InstantFeedback(ETouchFeedbackBasic); + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, index); + + //Start the timer to interpret longpress events + iTimerComplete = EFalse; + iTimer->Cancel ();//cancels any outstanding requests + iTimer->SetDelay (KLongPressTimer); + consumed = ETrue; break; } @@ -1451,6 +1476,7 @@ else if (aEvent.PointerEvent().iType == TPointerEvent::EDrag) { GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::HandlePointerEventL(EDrag) event"); + iTouchFeedback->InstantFeedback(ETouchFeedbackBasic); consumed = HandleDragL(aEvent.PointerEvent()); @@ -1459,6 +1485,12 @@ { Display()->Roster().SetPointerEventObservers(0, *this); consumed = ETrue; + + //If the long press timer is completed , and if upevent is received.. ignore it + if(iTimerComplete) + { + consumed = ETrue; + } //Check if dragging actually happened using iViewDragged if (iDragging && iViewDragged) @@ -1467,11 +1499,14 @@ TPoint drag = iStart - aEvent.PointerEvent().iPosition; iPhysics->StartPhysics(drag, iStartTime); iPhysicsStarted = ETrue; + + iTimer->Cancel ();//cancels any outstanding requests } //If dragging not happened consider it as Tapped event - else if (tappedvisual && !iViewDragged) + //When it recognises the long press event , and if up event is received..Ignore it + else if (tappedvisual && !iViewDragged && !iTimerComplete) { - for (TInt index = 0; index < iLayout->Count(); index++) + for (TInt index = 0; index < iLayout->Count(); index++) { CAlfVisual* layoutvisual = &(iLayout->Visual(index)); //if the tapped visual is same as the visual in the layout then focus that visual @@ -1485,6 +1520,7 @@ iMediaList.SetFocusL(NGlxListDefs::EAbsolute, index); SetFocusColor(); iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); + if( iFocusRowIndex > focusrowindex) { GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::HandleDragL,b4 movedown"); @@ -1681,7 +1717,7 @@ AlfEventStatus status = EEventNotHandled; if(aEvent.IsCustomEvent() && accept(aControl, aEvent)) { - if ((iScrollBarWidget!=NULL)) + if ( iScrollBarWidget ) { if (aEvent.IsCustomEvent()) { @@ -1938,4 +1974,40 @@ return EFalse; } } +// --------------------------------------------------------------------------- +// TimerComplete() +// --------------------------------------------------------------------------- +// +void CGlxCloudViewControl::TimerComplete() + { + iTimerComplete = ETrue; + iTagsContextMenuControl->ShowItemMenu(EFalse); + + CAlfVisual& visual = iLayout->Visual( iMediaList.FocusIndex() ); + TRect focussedItemRect = visual.DisplayRect(); + TPoint midpoint; + midpoint.iX=focussedItemRect.iTl.iX + + ((focussedItemRect.iBr.iX - focussedItemRect.iTl.iX )/2); + midpoint.iY=focussedItemRect.iTl.iY+ + ((focussedItemRect.iBr.iY - focussedItemRect.iTl.iY )/2); + + TRect rect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); + + if(!iPhysicsStarted)//only if physics hasnt started + { + iTagsContextMenuControl->SetViewableRect(rect); + iTagsContextMenuControl->ShowItemMenu(ETrue); + iTagsContextMenuControl->SetDisplay(midpoint); + } + } +// --------------------------------------------------------------------------- +// ShowContextItemMenu() +// --------------------------------------------------------------------------- +// +void CGlxCloudViewControl::ShowContextItemMenu(TBool aShow) + { + iTagsContextMenuControl->ShowItemMenu(aShow); + } + //End of file diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp --- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -41,6 +41,7 @@ #include // For directory paths #include +#include // For resources #include "glxcloudviewcontrol.h"//cloud view control @@ -158,8 +159,8 @@ TBool CGlxCloudViewImp::HandleViewCommandL(TInt aCommand) { TRACER("GLX_CLOUD::CGlxCloudViewImp::HandleViewCommandL"); + TBool consumed = EFalse; - switch (aCommand) { case EAknCmdOpen: @@ -337,9 +338,9 @@ iAnchorlayout->SetFlag(EAlfVisualFlagLayoutUpdateNotification); iAnchorlayout->SetFlag(EAlfVisualFlagAutomaticLocaleMirroringEnabled); - + iCloudControl = CGlxCloudViewControl::NewL (*iDisplay, *iUiUtility->Env (), *iMediaList, - *iEmptyListText, *this,*this,iAnchorlayout,*this); + *iEmptyListText, *this,*this,iAnchorlayout,*this,*this); CAlfControlGroup * ctrlGroup = iUiUtility->Env ()->FindControlGroup(0); if(ctrlGroup) @@ -421,3 +422,25 @@ iAnchorlayout->UpdateChildrenLayout(0); } +// --------------------------------------------------------------------------- +// HandleGridMenuListL() +// --------------------------------------------------------------------------- +// +void CGlxCloudViewImp::HandleGridMenuListL(TInt aCommand) + { + TRACER("GLX_CLOUD::CGlxCloudViewImp::HandleGridMenuListL"); + ProcessCommandL(aCommand); + } + +// ---------------------------------------------------------------------------- +// ViewDynInitMenuPaneL +// ---------------------------------------------------------------------------- +// +void CGlxCloudViewImp::ViewDynInitMenuPaneL(TInt aMenuId, CEikMenuPane* /*aMenuPane*/) + { + TRACER("GLX_CLOUD::CGlxCloudViewImp::ViewDynInitMenuPaneL"); + if( aMenuId == R_TAGSBROWSER_MENU) + { + iCloudControl->ShowContextItemMenu(EFalse); + } + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -0,0 +1,362 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cloud View Context menu control class + * +*/ + +// Alf Headers +#include +#include // For CAlfGridLayout +#include // For CAlfBorderBrush +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "utf.h" // UtfConverter + +// Photos Headers +#include "glxtagscontextmenucontrol.h" +#include "glxcommandfactory.h" +#include //for medialist +#include +#include // Texturemanager +#include // icons +#include // Attribute fetch priority +#include +#include "glxbubbletimer.h" //for timer functionality +#include // For resources +#include // For Logs + +//Left & Top padding of text within text box (In Pixels) +const TInt KMinimalGap = 5; +//Height of each menu item +const TInt KReqHeightPerMenuItem = 47; +//Minimum width for control +const TInt KReqWidth = 113; +//Number of menu items present in stylus menu +const TInt KNumofMenuItems = 3; +//Number of columns present in grid control showing menu +const TInt KNoOfColumns = 1; +//Highest possible value to make control opaque +const TReal KOpacityOpaque = 1.0; +//lowest possible value to make control completely transparent +const TReal KOpacityTransparent = 0.0; +const TPoint KDummyPoint(100,100); +//6 Seconds delay for menu control visibility on screen +const TInt KTimerDelay = 6000000; +//Control complete height +const TInt KGridHeight = KReqHeightPerMenuItem * KNumofMenuItems; +//Text size for menu items +const TInt KTextSizeInPixels = 20; + +//For Tagging the visuals +_LIT8(KTagSlideshow, "SS"); +_LIT8(KTagRename, "Ren"); +_LIT8(KTagDelete, "Del"); + +// --------------------------------------------------------------------------- +// NewL() +// --------------------------------------------------------------------------- +// +CGlxTagsContextMenuControl* CGlxTagsContextMenuControl::NewL( + MGlxItemMenuObserver& aItemMenuObserver) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::NewL"); + CGlxTagsContextMenuControl* self = CGlxTagsContextMenuControl::NewLC( aItemMenuObserver); + CleanupStack::Pop(self); + return self; + } +// --------------------------------------------------------------------------- +// NewLC() +// --------------------------------------------------------------------------- +// +CGlxTagsContextMenuControl* CGlxTagsContextMenuControl::NewLC( + MGlxItemMenuObserver& aItemMenuObserver ) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::NewLC"); + CGlxTagsContextMenuControl* self = new (ELeave) CGlxTagsContextMenuControl( aItemMenuObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } +// --------------------------------------------------------------------------- +// CGlxTagsContextMenuControl() +// --------------------------------------------------------------------------- +// +CGlxTagsContextMenuControl::CGlxTagsContextMenuControl(MGlxItemMenuObserver& aItemMenuObserver) + : iItemMenuObserver(aItemMenuObserver) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CGlxTagsContextMenuControl"); + //Nothing more to do for now + } +// --------------------------------------------------------------------------- +// ConstructL() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::ConstructL() + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::ConstructL"); + iUiUtility = CGlxUiUtility::UtilityL (); + CAlfControl::ConstructL(*(iUiUtility->Env()) ); + + iTimer = CGlxBubbleTimer::NewL(this); + + iMainVisual = CAlfAnchorLayout::AddNewL(*this); + iMainVisual->SetFlag(EAlfVisualFlagManualLayout); + iMainVisual->SetSize(TSize(KReqWidth, KGridHeight)); + iMainVisual->SetPos(TAlfRealPoint(KDummyPoint)); + + CFbsBitmap* bitmap = AknsUtils::GetCachedBitmap( + AknsUtils::SkinInstance(), KAknsIIDQsnFrPopupCenter); + CleanupStack::PushL(bitmap); + + CAlfTexture& backgroundAvkonTexture = + iUiUtility->GlxTextureManager().CreateColorAvkonIconTextureL( + KAknsIIDQsnFrPopupCenter, bitmap->Handle(), KRgbTransparent) ; + + CleanupStack::Pop(bitmap); + + // BackGround Border Image Visual + iBackgroundBorderImageVisual = CAlfImageVisual::AddNewL(*this,iMainVisual); + iBackgroundBorderImageVisual->SetImage(TAlfImage(backgroundAvkonTexture)); + + // Create a new 3x1 grid layout visual. + iGrid = CAlfGridLayout::AddNewL(*this, KNoOfColumns, KNumofMenuItems , + iMainVisual);//columns, rows + + //Finally create the menu list that will appear in screen + CreateMenuListL(CreateFontL()); + ShowItemMenu(EFalse); + } +// --------------------------------------------------------------------------- +// ~CGlxTagsContextMenuControl() +// --------------------------------------------------------------------------- +// +CGlxTagsContextMenuControl::~CGlxTagsContextMenuControl() + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CGlxTagsContextMenuControl"); + if (iMainVisual) + { + iMainVisual->RemoveAndDestroyAllD(); + iMainVisual = NULL; + } + if ( iTimer) + { + iTimer->Cancel();//cancels any outstanding requests + delete iTimer; + iTimer = NULL; + } + + if (iUiUtility) + { + iUiUtility->Close(); + iUiUtility = NULL; + } + } +// --------------------------------------------------------------------------- +// CreateFont() +// --------------------------------------------------------------------------- +// +TInt CGlxTagsContextMenuControl::CreateFontL() + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CreateFont"); + + // Create a new style based on the required font + CAlfTextStyleManager& styleMan = iUiUtility->Env()->TextStyleManager(); + + // remember its id for return later + TInt id = styleMan.CreatePlatformTextStyleL(EAlfTextStyleNormal); + + // Get style. It is not owned + CAlfTextStyle* style = styleMan.TextStyle(id); + + // Set this style to have required size and to be normal weight + style->SetTextSizeInPixels(KTextSizeInPixels); + style->SetBold(ETrue); + + return id; + } + +// --------------------------------------------------------------------------- +// CreateMenuListL() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::CreateMenuListL(TInt aFontId) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CreateMenuList"); + + TRgb color; + //Gets the color of the text specific to skin + AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), + color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + + //Loading the strings from rss + HBufC* renameTitle = StringLoader::LoadLC( R_GLX_TAGS_RENAME_TITLE ); + HBufC* slideshowTitle = StringLoader::LoadLC( R_GLX_TAGS_SLIDESHOW_TITLE ); + HBufC* deleteTitle = StringLoader::LoadLC( R_GLX_TAGS_DELETE_TITLE ); + + iSlideshowTextVisual = CAlfTextVisual::AddNewL(*this, iGrid); + iSlideshowTextVisual->SetTagL(KTagSlideshow); + iSlideshowTextVisual->SetTextStyle(aFontId); + iSlideshowTextVisual->SetColor(color); + iSlideshowTextVisual->SetTextL(*slideshowTitle); + iSlideshowTextVisual->SetOffset(TAlfTimedPoint(10,0)); + iSlideshowTextVisual->SetAlign(EAlfAlignHLocale, EAlfAlignVCenter); + + iDeleteTextVisual = CAlfTextVisual::AddNewL(*this, iGrid); + iDeleteTextVisual->SetTagL(KTagDelete); + iDeleteTextVisual->SetTextStyle(aFontId); + iDeleteTextVisual->SetColor(color); + iDeleteTextVisual->SetTextL(*deleteTitle); + iDeleteTextVisual->SetOffset(TAlfTimedPoint(10,0)); + iDeleteTextVisual->SetAlign(EAlfAlignHLocale, EAlfAlignVCenter); + + iRenameTextVisual = CAlfTextVisual::AddNewL(*this, iGrid); + iRenameTextVisual->SetTagL(KTagRename); + iRenameTextVisual->SetTextStyle(aFontId); + iRenameTextVisual->SetColor(color); + iRenameTextVisual->SetTextL(*renameTitle); + iRenameTextVisual->SetOffset(TAlfTimedPoint(10,0)); + iRenameTextVisual->SetAlign(EAlfAlignHLocale, EAlfAlignVCenter); + + CleanupStack::PopAndDestroy(deleteTitle); // for deleteTitle + CleanupStack::PopAndDestroy(slideshowTitle);// slideshowTitle + CleanupStack::PopAndDestroy(renameTitle);// renameTitle + } +// --------------------------------------------------------------------------- +// SetDisplayL() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::SetDisplay(const TPoint& aPoint) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::SetDisplayL"); + //if already started , cancel it + if(iTimer && iTimer->IsActive()) + { + iTimer->Cancel();//cancels any outstanding requests + } + + TInt upperYPos = aPoint.iY - KMinimalGap; + TInt XPos = aPoint.iX ; + + //Preferred is to display in upper area + TInt upperDisplayableHeight = upperYPos - iViewableRect.iTl.iY; + TInt rightDisplayableWidth = iViewableRect.iBr.iY - XPos; + + //always draw above + if(rightDisplayableWidth < KReqWidth) + { + XPos = aPoint.iX - KReqWidth; + } + if(upperDisplayableHeight < KGridHeight) + { + iMainVisual->SetPos(TAlfRealPoint(XPos , upperYPos )); + } + else + { + iMainVisual->SetPos(TAlfRealPoint(XPos , upperYPos - KGridHeight)); + } + + iTimer->Cancel(); //cancels any outstanding requests + iTimer->SetDelay(KTimerDelay); + } + +// --------------------------------------------------------------------------- +// ShowItemMenu() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::ShowItemMenu (TBool aShow) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::ShowItemMenu"); + if(aShow) + { + iMainVisual->SetOpacity(KOpacityOpaque); + iItemMenuVisibility = ETrue; + } + else + { + iMainVisual->SetOpacity(KOpacityTransparent); + iItemMenuVisibility = EFalse; + } + } +// --------------------------------------------------------------------------- +// OfferEventL() +// --------------------------------------------------------------------------- +// +TBool CGlxTagsContextMenuControl::OfferEventL(const TAlfEvent& aEvent) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::OfferEventL"); + TBool consumed = EFalse; + + if(iItemMenuVisibility && aEvent.IsPointerEvent() && aEvent.PointerDown() ) + { + CAlfVisual* onVisual = aEvent.Visual(); + TInt cmdId = KErrNotFound; + if(AlfUtil::TagMatches(onVisual->Tag(), KTagSlideshow)) + { + cmdId = EGlxCmdSlideshowPlay; + } + else if(AlfUtil::TagMatches(onVisual->Tag(), KTagDelete)) + { + cmdId = EGlxCmdDelete; + } + else if(AlfUtil::TagMatches(onVisual->Tag(), KTagRename)) + { + cmdId = EGlxCmdRename; + } + + if(cmdId >= 0) + { + ShowItemMenu(EFalse); + iItemMenuObserver.HandleGridMenuListL(cmdId); + consumed = ETrue; + } + } + + return consumed; + } + +// --------------------------------------------------------------------------- +// TimerComplete() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::TimerComplete() + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::TimerComplete"); + ShowItemMenu(EFalse); + } + +// --------------------------------------------------------------------------- +// SetViewableRect() +// --------------------------------------------------------------------------- +// +void CGlxTagsContextMenuControl::SetViewableRect(TRect aRect) + { + TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::SetViewableRect"); + iViewableRect.SetRect(aRect.iTl.iX, aRect.iTl.iY, + aRect.iBr.iX, aRect.iBr.iY); + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h --- a/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h Fri Feb 19 22:51:01 2010 +0200 @@ -45,6 +45,7 @@ class CGlxDRMUtility; class CGlxHdmiController; class CGestureHelper; +class TGlxMedia; //class CHgContextUtility; namespace Alf @@ -257,7 +258,11 @@ * Remove the fullscreen texture. */ void RemoveTexture(); - + /** + * Consume DRM rights + */ + void ConsumeDRMRightsL( const TDesC& uri ); + private: /** Softkey resource id's */ TFullScreenViewResourceIds iResourceIds; @@ -309,7 +314,7 @@ TInt iInitialZoomRatio ; //Previous focused index TInt iOldFocusIndex; - + TBool iImgViewerMode; }; #endif diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp --- a/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -67,6 +67,10 @@ //#include #include "glxfullscreenviewimp.h" #include +#include +#include +#include +#include using namespace Alf; @@ -150,7 +154,7 @@ iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); //Register the view to recieve toolbar events. ViewBase handles the events SetToolbarObserver(this); - + iImgViewerMode = EFalse; // Presently image viewer dont have toolbar // So need to remove if image viewer using full screen CGlxNavigationalState* navigationalState = CGlxNavigationalState::InstanceL(); @@ -293,23 +297,37 @@ { toolbar->SetToolbarVisibility(EFalse); } - //Fix For EPKA-7U5DT7-slideshow launched from FullScreen and connect USB in mass storage mode results in Photos crash - if(!iMediaList->Count()) + + CGlxNavigationalState* navigationalState = CGlxNavigationalState::InstanceL(); + CleanupClosePushL( *navigationalState ); + CMPXCollectionPath* naviState = navigationalState->StateLC(); + + if(!iMediaList->Count()) { - CGlxNavigationalState* navigationalState = CGlxNavigationalState::InstanceL(); - CleanupClosePushL( *navigationalState ); - navigationalState->ActivatePreviousViewL(); - CleanupStack::PopAndDestroy( navigationalState ); - } - //need to create the instance first,other wise panics while - // zooming from imgvwr. - iHdmiController = CGlxHdmiController::NewL(); - if(iMediaList->Count()) - { - iOldFocusIndex = iMediaList->FocusIndex(); + //Fix For EPKA-7U5DT7-slideshow launched from FullScreen and connect USB in mass storage mode results in Photos crash + navigationalState->ActivatePreviousViewL(); + } + + if(naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) + { + iImgViewerMode = ETrue; + } + //destroy and close navistate and navipath + CleanupStack::PopAndDestroy( naviState ); + CleanupStack::PopAndDestroy( navigationalState ); + + //Create hdmicontroller when it is only launched from fullscreen. + //From filemanager show only clone mode. + if(!iImgViewerMode && iMediaList->Count()) + { + iHdmiController = CGlxHdmiController::NewL(); + iOldFocusIndex = iMediaList->FocusIndex(); TGlxMedia item = iMediaList->Item( iMediaList->FocusIndex() ); GLX_LOG_INFO("CGlxHdmi - CGlxFullScreenViewImp Create HdmiController"); - if (item.Category() != EMPXVideo) + + //check if the content is not video && has proper DRM rights + //then only call setimage in HDMI + if (item.Category() != EMPXVideo && iDrmUtility->CheckOpenRightsL(item.Uri(),ETrue)) { TInt frameCount(0); TSize orignalSize; @@ -317,7 +335,8 @@ TBool adimension = item.GetDimensions(orignalSize); iHdmiController->SetImageL(item.Uri(), orignalSize, frameCount); } - } + } + iScreenFurniture->SetActiveView(iViewUid); // create the screen furniture for touch devices @@ -468,8 +487,16 @@ TInt index = iMediaList->FocusIndex(); const TGlxMedia& item = iMediaList->Item(index); TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail); - // Display slider only for non corrupted images - if (error == KErrNone && item.Category() == EMPXImage) + + TBool isDrmRightsValid = ETrue; + if(item.IsDrmProtected()) + { + isDrmRightsValid = iDrmUtility->CheckOpenRightsL(item.Uri(), + (item.Category() == EMPXImage)); + } + + // Display slider only for non corrupted images and items with valid DRM license + if (error == KErrNone && item.Category() == EMPXImage && isDrmRightsValid) { //To set the Slider values. SetSliderLevel(); @@ -665,35 +692,43 @@ TInt focus = iMediaList->FocusIndex(); TGlxMedia item = iMediaList->Item( focus ); TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail); - - if(KErrNone == error) - { - if(EMPXImage == item.Category()) + + // Check if DRM rights expired for a specific media item + TBool isDrmRightsValid = ETrue; + if(item.IsDrmProtected()) + { + isDrmRightsValid = iDrmUtility->CheckOpenRightsL(item.Uri(), + (item.Category() == EMPXImage)); + } + // Activate Zoom if the item is an image and its DRM rights is not expired + if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid) + { + if(iZoomControl && !iZoomControl->Activated()) { - if(iZoomControl && !iZoomControl->Activated()) + if(iHdmiController) { iHdmiController->ActivateZoom(); - iZoomControl->ActivateL(GetInitialZoomLevel(),aStartMode, focus, item, apZoomFocus); - - // Now to remove all textures other than the one we are focussing on. - TInt count = iMediaList->Count(); - while (count > 0) + } + iZoomControl->ActivateL(GetInitialZoomLevel(),aStartMode, focus, + item, apZoomFocus,iImgViewerMode); + // Now to remove all textures other than the one we are focussing on. + TInt count = iMediaList->Count(); + while (count > 0) + { + TGlxMedia mediaItem = iMediaList->Item(count-1); + if (mediaItem.Id() != item.Id() ) { - TGlxMedia mediaItem = iMediaList->Item(count-1); - if (mediaItem.Id() != item.Id() ) - { - iUiUtility->GlxTextureManager().RemoveTexture(mediaItem.Id(),EFalse); - } - count--; + iUiUtility->GlxTextureManager().RemoveTexture(mediaItem.Id(),EFalse); } + count--; } - else - { - return; - } - DeactivateFullScreen(); - GlxSetAppState::SetState(EGlxInZoomedView); } + else + { + return; + } + DeactivateFullScreen(); + GlxSetAppState::SetState(EGlxInZoomedView); } } @@ -721,7 +756,14 @@ void CGlxFullScreenViewImp::DoMLViewDeactivate() { TRACER("CGlxFullScreenViewImp::DoMLViewDeactivate"); + // if Medialist Count is Zero, set the navigation state to + // EGlxNavigationBackwards before going back to grid view + if(iMediaList->Count() == 0) + { + iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); + } iScreenFurniture->ViewDeactivated(iViewUid); + iImgViewerMode = EFalse; if (iHdmiController) { delete iHdmiController; @@ -769,6 +811,12 @@ if (!aForeground) { + + if(iHdmiController) + { + iHdmiController->ShiftToCloningMode(); + } + iUiUtility->GlxTextureManager().FlushTextures(); } else @@ -777,6 +825,11 @@ { TInt focusIndex = iMediaList->FocusIndex(); iMediaListMulModelProvider->UpdateItems(focusIndex, 1); + + if(iHdmiController) + { + iHdmiController->ShiftToPostingMode(); + } } } } @@ -958,15 +1011,21 @@ TSize orignalSize; TBool aFramesPresent = item1.GetFrameCount(frameCount); TBool adimension = item1.GetDimensions(orignalSize); - if (item1.Category() != EMPXVideo) + + //check if the content is not video && has proper DRM rights + //then only call next image in HDMI + if(iHdmiController) { - GLX_LOG_INFO("CGlxHdmi - FullscreenView - SetImageL"); - iHdmiController->SetImageL(item1.Uri(), orignalSize, frameCount); + if (item1.Category() != EMPXVideo && iDrmUtility->CheckOpenRightsL(item1.Uri(),ETrue)) + { + GLX_LOG_INFO("CGlxHdmi - FullscreenView - SetImageL"); + iHdmiController->SetImageL(item1.Uri(), orignalSize, frameCount); + } + else + { + iHdmiController->IsVideo(); + } } - else - { - iHdmiController->IsVideo(); - } iOldFocusIndex = iMediaList->FocusIndex(); if ( NGlxNFullScreenUIState::EUiOn == GetUiSate() ) { @@ -1238,17 +1297,36 @@ TRACER("CGlxFullScreenViewImp::ShowDrmExpiaryNoteL"); if(iMediaList->Count()>0) { - const TGlxMedia& media = iMediaList->Item(iMediaList->FocusIndex()); - if (media.IsDrmProtected()) - { - const TDesC& uri = media.Uri(); - if ( !iDrmUtility->CheckOpenRightsL(uri , (media.Category() == EMPXImage)) && ( uri.Length()>0 )) - { - iDrmUtility->ShowRightsInfoL(uri); - } - } - } + const TGlxMedia& media = iMediaList->Item(iMediaList->FocusIndex()); + if (media.IsDrmProtected()) + { + const TDesC& uri = media.Uri(); + ConsumeDRMRightsL(uri); + } + } } + +// --------------------------------------------------------------------------- +// +// consumes DRM rights for DRM files, can leave +// --------------------------------------------------------------------------- +// +void CGlxFullScreenViewImp::ConsumeDRMRightsL( const TDesC& uri ) + { + TRACER("CGlxFullScreenViewImp::ConsumeDRMRightsL"); + if( uri.Length() > 0 ) + { + // check if rights have expired + TBool expired = !iDrmUtility->CheckOpenRightsL(uri,ETrue); + if(expired) + { + iDrmUtility->ShowRightsInfoL(uri); + return; + } + iDrmUtility->ConsumeRightsL(uri); + } + } + // --------------------------------------------------------------------------- // // Gets the Swipe direction diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/group/glxgridview.mmp --- a/photosgallery/viewframework/views/gridview/group/glxgridview.mmp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/group/glxgridview.mmp Fri Feb 19 22:51:01 2010 +0200 @@ -36,7 +36,7 @@ SOURCEPATH ../src SOURCE glxgridviewimp.cpp SOURCE glxgridview.cpp -SOURCE glxgridviewmlobserver.cpp +SOURCE glxgridviewmlobserver.cpp SOURCE glxgridviewcontainer.cpp USERINCLUDE ../inc @@ -57,25 +57,25 @@ APP_LAYER_SYSTEMINCLUDE -LIBRARY avkon.lib // CAknView -LIBRARY cone.lib // MCoeView -LIBRARY commonengine.lib // StringLoader -LIBRARY eikcoctl.lib // CEikMenuBar -LIBRARY eikcore.lib // CEikMenuBar -LIBRARY euser.lib // RAllocator -LIBRARY glxmedialists.lib // CGlxMedialist -LIBRARY glxuiutilities.lib // UiUtilities -LIBRARY glxviewbase.lib // MedilaistViewBsse -LIBRARY glxcommonui.lib // for NGlxZoomStatePublisher::PublishStateL -LIBRARY mpxcommon.lib // Mpx Attributes -LIBRARY flogger.lib // For Logging Tracer -LIBRARY glxdrmutility.lib // For Drm Utility +LIBRARY avkon.lib // CAknView +LIBRARY cone.lib // MCoeView +LIBRARY commonengine.lib // StringLoader +LIBRARY eikcoctl.lib // CEikMenuBar +LIBRARY eikcore.lib // CEikMenuBar +LIBRARY euser.lib // RAllocator +LIBRARY glxmedialists.lib // CGlxMedialist +LIBRARY glxuiutilities.lib // UiUtilities +LIBRARY glxviewbase.lib // MedilaistViewBsse +LIBRARY glxcommonui.lib // for NGlxZoomStatePublisher::PublishStateL +LIBRARY mpxcommon.lib // Mpx Attributes +LIBRARY flogger.lib // For Logging Tracer +LIBRARY glxdrmutility.lib // For Drm Utility LIBRARY ganes.lib LIBRARY fbscli.lib LIBRARY aknicon.lib LIBRARY egul.lib alfclient.lib LIBRARY aknskins.lib -LIBRARY featmgr.lib // FeatureManager +LIBRARY featmgr.lib // FeatureManager // End of File diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h --- a/photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h Fri Feb 19 22:51:01 2010 +0200 @@ -59,7 +59,7 @@ * @since 3.0 * @return Pointer to newly created object. */ - static CGlxGridViewContainer *NewL(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver ); + static CGlxGridViewContainer *NewL(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar ); /** * Two-phased constructor. @@ -67,7 +67,7 @@ * @since 3.0 * @return Pointer to newly created object. */ - static CGlxGridViewContainer *NewLC(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver); + static CGlxGridViewContainer *NewLC(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar); //destructor ~CGlxGridViewContainer(); @@ -97,7 +97,7 @@ /** * C++ default constructor. */ - CGlxGridViewContainer(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver); + CGlxGridViewContainer(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar); /** * By default Symbian 2nd phase constructor is private. */ @@ -142,6 +142,11 @@ * EFalse if relevant thumbnail not available */ TBool HasRelevantThumbnail(TInt aIndex); + /** + * Calculate and return the client rect for HGgrid + * Required as the tool bar is dynamically created. + */ + TRect GetHgGridRect(); private: //medialist @@ -200,6 +205,8 @@ //observer MGlxGridEventObserver& iGlxGridViewObserver; + //toolbar - created dynamically. + CAknToolbar* iToolbar; }; #endif // CGLXGRIDVIEWCONTROL_H diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/inc/glxgridviewimp.h --- a/photosgallery/viewframework/views/gridview/inc/glxgridviewimp.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewimp.h Fri Feb 19 22:51:01 2010 +0200 @@ -122,6 +122,8 @@ //Create control CGlxGridViewContainer* iGlxGridViewContainer; + //toolbar - created dynamically. + CAknToolbar* iToolbar; }; #endif // C_GLXGRIDLVIEWIMP_H diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h --- a/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h Fri Feb 19 22:51:01 2010 +0200 @@ -102,6 +102,12 @@ */ void UpdateItemsL (TInt aItemIndex,const RArray& aAttributes); + /** + * DisplayErrorNote - Show an error note based on input parameter + * @param aError The error based on which the error note is to be shown. + */ + void DisplayErrorNote(TInt aError); + private: MGlxMediaList& iMediaList; @@ -117,6 +123,10 @@ //No of visible items in a page/view TInt iItemsPerPage; + // Has the error in disk (e.g disk error) been shown to the user? + // If a disk is full the user should not be intimated everytime over and over again. + TInt iDiskErrorIntimated; + // Modified Indexes array to refresh the screen RArray iModifiedIndexes; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -19,7 +19,7 @@ #include #include #include - +#include // Ganes Headers #include // Gul Icons #include // HG Items @@ -55,10 +55,10 @@ // CGlxGridViewContainer* CGlxGridViewContainer::NewL(MGlxMediaList *aMediaList, CGlxUiUtility* aUiUtility, - MGlxGridEventObserver& aObserver) + MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar) { TRACER("CGlxGridViewContainer::NewL"); - CGlxGridViewContainer* self = CGlxGridViewContainer::NewLC(aMediaList,aUiUtility,aObserver) ; + CGlxGridViewContainer* self = CGlxGridViewContainer::NewLC(aMediaList,aUiUtility,aObserver,aToolbar) ; CleanupStack::Pop(self) ; return self ; } @@ -69,10 +69,10 @@ // CGlxGridViewContainer* CGlxGridViewContainer::NewLC(MGlxMediaList *aMediaList, CGlxUiUtility* aUiUtility, - MGlxGridEventObserver& aObserver) + MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar) { TRACER("CGlxGridViewContainer::NewLC"); - CGlxGridViewContainer* self = new(ELeave) CGlxGridViewContainer(aMediaList,aUiUtility,aObserver); + CGlxGridViewContainer* self = new(ELeave) CGlxGridViewContainer(aMediaList,aUiUtility,aObserver,aToolbar); CleanupStack::PushL(self ) ; self->ConstructL() ; return self ; @@ -122,8 +122,8 @@ // --------------------------------------------------------------------------- // CGlxGridViewContainer::CGlxGridViewContainer(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility, - MGlxGridEventObserver& aObserver) - : iMediaList(aMediaList),iUiUtility(aUiUtility),iGlxGridViewObserver(aObserver) + MGlxGridEventObserver& aObserver,CAknToolbar* aToolbar) + : iMediaList(aMediaList),iUiUtility(aUiUtility),iGlxGridViewObserver(aObserver),iToolbar(aToolbar) { TRACER("CGlxGridViewContainer::CGlxGridViewContainer"); } @@ -380,9 +380,8 @@ CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, EMbmGlxiconsQgn_prop_image_notcreated); AknIconUtils::SetSize(bitmap, tnSize); - TRect rect = iEikonEnv->EikAppUi()->ClientRect(); // Create Hg grid object - iHgGrid = CHgGrid::NewL (rect,mediaCount,CGulIcon::NewL(bitmap)); + iHgGrid = CHgGrid::NewL (GetHgGridRect(),mediaCount,CGulIcon::NewL(bitmap)); } // Setting to MopParent to update background skin @@ -404,7 +403,33 @@ * note: don't push hggrid to the control stack */ } - +// --------------------------------------------------------------------------- +// GetHgGridRect +// --------------------------------------------------------------------------- +// +TRect CGlxGridViewContainer::GetHgGridRect() + { + TRACER("CGlxGridViewContainer::GetHgGridRect()"); + + TRect clientrect = iEikonEnv->EikAppUi()->ClientRect(); + TRect apprect = iEikonEnv->EikAppUi()->ApplicationRect(); + if(apprect.Height()>apprect.Width()) + { + //portrait: + //height : apprect height - (status pane height + toolbar height + cba height) + //width remains 360. + clientrect.SetHeight(apprect.Height() - ((clientrect.iTl.iY) + (iToolbar->Size().iHeight) + (iEikonEnv->AppUiFactory()->Cba()->Rect().Height()))); + } + else + { + //Landscape: + //height : apprect - (status pane height + cba height) + //width : apprect width - toolbarwidth. + clientrect.SetHeight(apprect.Height() - ((clientrect.iTl.iY) + (iEikonEnv->AppUiFactory()->Cba()->Rect().Height()))); + clientrect.SetWidth(apprect.Width() - iToolbar->Size().iWidth); + } + return clientrect; + } // --------------------------------------------------------------------------- // CreateGridL // --------------------------------------------------------------------------- @@ -522,24 +547,20 @@ iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); GLX_LOG_INFO1("### CGlxGridViewContainer::SetIconsL speedTn-Index is %d",index); } - else if ( KErrNone != tnError && KErrNotSupported != tnError && KErrCANoRights !=tnError) + else if ((KErrCANoRights ==tnError) || (KErrDiskFull ==tnError)) { - GLX_LOG_INFO2("CGlxGridViewContainer::SetIconsL - image_corrupted tnError(%d), i(%d)", - tnError, index); - CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, - EMbmGlxiconsQgn_prop_image_corrupted); - AknIconUtils::SetSize(bitmap, setSize); - iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); - } - else if (KErrCANoRights ==tnError) - { - /*fix for EABI-7RKHDG + /* * this is a safe code added to show default * TNM returns -17452 in case SD DRM files * this code is added as coming from other view to * gridview,it draws broken TN then the callback goes to * glxgridviewobserver and redraws a not-created TN. * with this part of code that TN swich will not be visible + * + * The same thing is needs to be done for the case when there is no + * disk space for the thumbnails to be created. + * In such a case we need to show default thumbnails instead of corrupted. + * */ GLX_LOG_INFO2("CGlxGridViewContainer::SetIconsL - image_defaultthumbnail tnError(%d), i(%d)", tnError, index); @@ -548,15 +569,16 @@ AknIconUtils::SetSize(bitmap, setSize); iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); } - else if(KErrNotSupported == tnError) - { - GLX_LOG_INFO2("CGlxGridViewContainer::SetIconsL - image_defaultthumbnail tnError(%d), i(%d)", - tnError, index); - CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, - EMbmGlxiconsQgn_prop_image_corrupted); - AknIconUtils::SetSize(bitmap, setSize); - iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); - } + else if(KErrNone != tnError) + { + GLX_LOG_INFO2("CGlxGridViewContainer::SetIconsL - image_corrupted tnError(%d), i(%d)", + tnError, index); + CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, + EMbmGlxiconsQgn_prop_image_corrupted); + AknIconUtils::SetSize(bitmap, setSize); + iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); + } + if (item.IsDrmProtected()) { @@ -854,7 +876,7 @@ //@ fix for ESLM-7VRGKH if(iHgGrid) { - iHgGrid->InitScreenL(iEikonEnv->EikAppUi()->ClientRect()); + iHgGrid->InitScreenL(GetHgGridRect()); } retVal = ETrue; break; @@ -875,14 +897,23 @@ { TRACER("CGlxGridViewContainer::HandleResourceChange()"); CCoeControl::HandleResourceChange(aId); - if ( iBgContext ) - { - TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); - iBgContext->SetRect( apRect ); - } - if(iHgGrid) - { - TRAP_IGNORE (iHgGrid->InitScreenL(iEikonEnv->EikAppUi()->ClientRect()); ) - } + switch (aId) + { + case KEikDynamicLayoutVariantSwitch: + { + if ( iBgContext ) + { + TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); + iBgContext->SetRect( apRect ); + } + if(iHgGrid) + { + TRAP_IGNORE (iHgGrid->InitScreenL(GetHgGridRect());) + } + break; + } + default: + break; + } } //end of file diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -106,9 +106,12 @@ ViewBaseConstructL(); MLViewBaseConstructL(aMediaListFactory, aTitle); - //Register the view to recieve toolbar events. ViewBase handles the events + //create the tool bar dynamically + //to reduce the startup time of the application. + iToolbar = CAknToolbar::NewL(R_GLX_GRID_VIEW_TOOLBAR); + SetGridToolBar(iToolbar); SetToolbarObserver(this); - ShowToolbarOnViewActivation(ETrue); + iToolbar->SetToolbarVisibility(ETrue); // Get object that stores the active media list registry iActiveMediaListRegistry = CGlxActiveMediaListRegistry::InstanceL(); @@ -151,9 +154,15 @@ // Setting the Context sensitive menu id MenuBar()->SetContextMenuTitleResourceId( iResourceIds.iOkOptionsMenuId ); iActiveMediaListRegistry->RegisterActiveMediaList(iMediaList); - + if(!iToolbar) + { + iToolbar = CAknToolbar::NewL(R_GLX_GRID_VIEW_TOOLBAR); + SetGridToolBar(iToolbar); + SetToolbarObserver(this); + iToolbar->SetToolbarVisibility(ETrue); + } //Create HG Grid, medialist observer, FS thumbnailcontext - iGlxGridViewContainer = CGlxGridViewContainer::NewL(iMediaList,iUiUtility,*this); + iGlxGridViewContainer = CGlxGridViewContainer::NewL(iMediaList,iUiUtility,*this,iToolbar); iEikonEnv->AppUi()->AddToStackL(*this,iGlxGridViewContainer); } @@ -179,7 +188,13 @@ } // Deregister active media list pointer iActiveMediaListRegistry->DeregisterActiveMediaList(iMediaList); - + if(iToolbar) + { + delete iToolbar; + iToolbar = NULL; + //set the gridtoolbar to NULL in viewbase. + SetGridToolBar(iToolbar); + } // Destroy Grid widget before going to next view DestroyGridWidget(); } @@ -205,7 +220,11 @@ { TRACER("CGlxGridViewImp::~CGlxGridViewImp"); delete iTitletext; - + if(iToolbar) + { + delete iToolbar; + iToolbar = NULL; + } if (iActiveMediaListRegistry) { iActiveMediaListRegistry->Close(); @@ -268,7 +287,7 @@ { TRACER("CGlxGridViewImp::HandleLatchToolbarL()"); CAknButton* markButton = static_cast - (Toolbar()->ControlOrNull( EGlxCmdStartMultipleMarking )); + (iToolbar->ControlOrNull( EGlxCmdStartMultipleMarking )); if(markButton) { diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -24,7 +24,7 @@ //#include #include -//Gallery Headers +//Photos Headers #include // For Tracer #include // For Glx Logging #include // For UiUtility instance @@ -37,11 +37,11 @@ #include // KMPXMediaDrmProtected #include #include // Gridview resource +#include // Framework #include #include - #include // For feature constants #include // Feature Manager #include @@ -59,7 +59,7 @@ EXPORT_C CGlxGridViewMLObserver* CGlxGridViewMLObserver::NewL( MGlxMediaList& aMediaList, CHgGrid* aHgGrid) { - TRACER("CGlxGridViewMLObserver::NewLC()"); + TRACER("CGlxGridViewMLObserver::NewL()"); CGlxGridViewMLObserver* self = new (ELeave) CGlxGridViewMLObserver(aMediaList, aHgGrid); CleanupStack::PushL(self); @@ -75,7 +75,7 @@ CGlxGridViewMLObserver::CGlxGridViewMLObserver(MGlxMediaList& aMediaList, CHgGrid* aHgGrid ) : iMediaList(aMediaList), iHgGrid(aHgGrid) { - TRACER("CGlxGridViewMLObserver::CGlxGridViewMLObserver"); + TRACER("CGlxGridViewMLObserver::CGlxGridViewMLObserver()"); } // --------------------------------------------------------------------------- @@ -84,7 +84,7 @@ // void CGlxGridViewMLObserver::ConstructL() { - TRACER("CGlxGridViewMLObserver::ConstructL"); + TRACER("CGlxGridViewMLObserver::ConstructL()"); iMediaList.AddMediaListObserverL(this); // For DRm Utility iDRMUtility = CGlxDRMUtility::InstanceL(); @@ -103,6 +103,8 @@ iSpeedTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, GlxFullThumbnailAttributeId( EFalse, iGridIconSize.iWidth, iGridIconSize.iHeight ) ); + + iDiskErrorIntimated = EFalse ; } // --------------------------------------------------------------------------- @@ -111,7 +113,7 @@ // CGlxGridViewMLObserver::~CGlxGridViewMLObserver() { - TRACER("CGlxGridViewMLObserver::~CGlxGridViewMLObserver"); + TRACER("CGlxGridViewMLObserver::~CGlxGridViewMLObserver()"); iMediaList.RemoveMediaListObserver( this ); if (iDRMUtility) { @@ -289,7 +291,7 @@ void CGlxGridViewMLObserver::HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, MGlxMediaList* /*aList*/ ) { - TRACER("CGlxGridViewMLObserver::HandleItemSelectedL"); + TRACER("CGlxGridViewMLObserver::HandleItemSelectedL()"); } // ---------------------------------------------------------------------------- @@ -319,39 +321,45 @@ void CGlxGridViewMLObserver::HandleErrorL() { TRACER("CGlxGridViewMLObserver::HandleErrorL()"); + + TInt bitmapId = EMbmGlxiconsQgn_prop_image_notcreated; + TInt flags = CHgItem::EHgItemFlagsNone ; + for ( TInt i = 0; i < iMediaList.Count(); i++ ) { const TGlxMedia& item = iMediaList.Item( i ); TInt thumbnailError = GlxErrorManager::HasAttributeErrorL( item.Properties(), KGlxMediaIdThumbnail ); - - if( thumbnailError== KErrCANoRights) - { - /*fix for EABI-7RKHDG - * this is a safe code added to show default - * TNM returns -17452 in case SD DRM files - */ - TFileName resFile(KDC_APP_BITMAP_DIR); - resFile.Append(KGlxIconsFilename); - CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, - EMbmGlxiconsQgn_prop_image_notcreated); - AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize()); - iHgGrid->ItemL(i).SetIcon(CGulIcon::NewL(bitmap), - CHgItem::EHgItemFlagsDrmRightsExpired); - } - else if (thumbnailError) - { + + if (KErrNone != thumbnailError) + { + switch (thumbnailError) + { + case KErrCANoRights:; // Err id = -17452 + bitmapId = EMbmGlxiconsQgn_prop_image_notcreated; + flags = CHgItem::EHgItemFlagsDrmRightsExpired; + break; + case KErrDiskFull: + bitmapId = EMbmGlxiconsQgn_prop_image_notcreated; + flags = CHgItem::EHgItemFlagsNone ; + if (!iDiskErrorIntimated) + { + DisplayErrorNote(KErrDiskFull); + } + break; + default: + bitmapId = EMbmGlxiconsQgn_prop_image_corrupted; + flags = CHgItem::EHgItemFlagsNone ; + break; + } + TFileName resFile(KDC_APP_BITMAP_DIR); resFile.Append(KGlxIconsFilename); - CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, - EMbmGlxiconsQgn_prop_image_corrupted); - - //@ Fix for EABI-7RJA8C, Changes for HG grid for corrupted icon. + CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, bitmapId); AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize() ); - iHgGrid->ItemL(i).SetIcon(CGulIcon::NewL(bitmap), - CHgItem::EHgItemFlagsNone); + iHgGrid->ItemL(i).SetIcon(CGulIcon::NewL(bitmap), flags); } } iHgGrid->RefreshScreen(iHgGrid->FirstIndexOnScreen()); @@ -443,6 +451,7 @@ void CGlxGridViewMLObserver::RefreshScreen(TInt aItemIndex, const RArray& aAttributes) { + TRACER("CGlxGridViewMLObserver::RefreshScreen()"); TInt mediaCount = iMediaList.Count(); TInt firstIndex = iHgGrid->FirstIndexOnScreen(); firstIndex = (firstIndex<0 ? 0 : firstIndex); @@ -511,9 +520,10 @@ // UpdateItemsL // ---------------------------------------------------------------------------- // -void CGlxGridViewMLObserver::UpdateItemsL (TInt aItemIndex, +void CGlxGridViewMLObserver::UpdateItemsL(TInt aItemIndex, const RArray& aAttributes) { + TRACER("CGlxGridViewMLObserver::UpdateItemsL()"); TInt mediaCount = iMediaList.Count(); const TGlxMedia& item = iMediaList.Item( aItemIndex ); TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match ); @@ -584,3 +594,16 @@ } +// ---------------------------------------------------------------------------- +// DisplayErrorNote +// ---------------------------------------------------------------------------- +// +void CGlxGridViewMLObserver::DisplayErrorNote(TInt aError) + { + TRACER("CGlxGridViewMLObserver::DisplayErrorNote()"); + GLX_LOG_INFO1("CGlxGridViewMLObserver::DisplayErrorNote Error note " + "displayed corresponging to [d]", aError); + GlxGeneralUiUtilities::ShowErrorNoteL(aError); + iDiskErrorIntimated = ETrue; + return ; + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/eabi/glxlistviewu.def --- a/photosgallery/viewframework/views/listview/eabi/glxlistviewu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/eabi/glxlistviewu.def Fri Feb 19 22:51:01 2010 +0200 @@ -1,6 +1,8 @@ EXPORTS _ZN12CGlxListView4NewLEP20MGlxMediaListFactoryiR20TListViewResourceIdsRK7TDesC16 @ 1 NONAME _ZN12CGlxListView5NewLCEP20MGlxMediaListFactoryiR20TListViewResourceIdsRK7TDesC16 @ 2 NONAME - _ZTI12CGlxListView @ 3 NONAME ; ## - _ZTV12CGlxListView @ 4 NONAME ; ## + _ZTI12CGlxListView @ 3 NONAME + _ZTI17CGlxWaitScheduler @ 4 NONAME + _ZTV12CGlxListView @ 5 NONAME + _ZTV17CGlxWaitScheduler @ 6 NONAME diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/group/glxlistview.mmp --- a/photosgallery/viewframework/views/listview/group/glxlistview.mmp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/group/glxlistview.mmp Fri Feb 19 22:51:01 2010 +0200 @@ -76,3 +76,4 @@ LIBRARY aknicon.lib LIBRARY egul.lib LIBRARY aknskins.lib +LIBRARY bitmaptransforms.lib diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/inc/glxlistviewimp.h --- a/photosgallery/viewframework/views/listview/inc/glxlistviewimp.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/inc/glxlistviewimp.h Fri Feb 19 22:51:01 2010 +0200 @@ -36,7 +36,7 @@ class MMPXCollectionUtility; class CGlxPreviewThumbnailBinding; -class CHgList; +class CHgDoubleGraphicListFlat; class CAknsBasicBackgroundControlContext; // CLASS DECLARATION @@ -178,7 +178,7 @@ CAknsBasicBackgroundControlContext* iBgContext; //Own - CHgList* iList; //Own + CHgDoubleGraphicListFlat* iList; //Own MGlxMediaList* iFocusedChildList; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/inc/glxpreviewthumbnailbinding.h --- a/photosgallery/viewframework/views/listview/inc/glxpreviewthumbnailbinding.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/inc/glxpreviewthumbnailbinding.h Fri Feb 19 22:51:01 2010 +0200 @@ -24,7 +24,7 @@ #include "glxmedialistiterator.h" // Interface for going through items in the list in a non-sequential order #include "mglxmedialistobserver.h" // Observes for changes in media list #include - +#include class GlxThumbnailVariantType; class CGlxThumbnailContext; // Fetch context to retrieve thumbnails @@ -78,6 +78,13 @@ * Two phase construction */ void ConstructL(); + + /** + * Scale the source bitmap to list size + * aSrcBitmap - Source bitmap + * aDestBitmap - Scaled destination bitmap + */ + void ScaleBitmapToListSizeL(CFbsBitmap* aSrcBitmap, CFbsBitmap* aDestBitmap); public: void HandleItemChangedL(const CMPXCollectionPath& aPath, @@ -151,7 +158,28 @@ TBool iBackwardNavigation; CMPXFilter* iPreviewFilter; + + CBitmapScaler* iBitmapScaler; }; - + + // ---------------------------------------------------------------------------- + // CWaitScheduler - Active object to scale the bitmap to the desired size. + // ---------------------------------------------------------------------------- + class CGlxWaitScheduler : public CActive + { + public: + static CGlxWaitScheduler* NewL(); + void WaitForRequest(); + + private: + CGlxWaitScheduler(); + void ConstructL(); + virtual ~CGlxWaitScheduler(); + void RunL(); + void DoCancel(); + + private: + CActiveSchedulerWait iScheduler; + }; #endif //_GLXPREVIEWTHUMBNAILBINDING_H_ diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp --- a/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -26,8 +26,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -48,7 +47,7 @@ const TInt KListDataWindowSize(25); const TInt KNoOfPages(2); const TInt KBufferTresholdSize(6); -const TInt KRecreateListSize(5); + // ======== MEMBER FUNCTIONS ======== @@ -456,7 +455,7 @@ CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile, EMbmGlxiconsQgn_prop_image_notcreated); AknIconUtils::SetSize(defaultBitmap, - CHgDoubleGraphicList::PreferredImageSize()); + CHgDoubleGraphicListFlat::PreferredImageSize()); iList->ItemL(focusIndex).SetIcon(CGulIcon::NewL(defaultBitmap)); } @@ -547,9 +546,9 @@ CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, EMbmGlxiconsQgn_prop_image_notcreated); AknIconUtils::SetSize(bitmap, - CHgDoubleGraphicList::PreferredImageSize()); + CHgDoubleGraphicListFlat::PreferredImageSize()); - iList = CHgDoubleGraphicList::NewL( + iList = CHgDoubleGraphicListFlat::NewL( ClientRect(), mediaCount, CGulIcon::NewL(bitmap) ); @@ -568,8 +567,7 @@ //set the text to be shown if the list is empty. HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); iList->SetEmptyTextL(*emptyText); - CleanupStack::PopAndDestroy(emptyText); - iLastFocusedIndex = iList->FirstIndexOnScreen(); + CleanupStack::PopAndDestroy(emptyText); } //Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view @@ -608,32 +606,27 @@ void CGlxListViewImp::HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ) { - TRACER("CGlxListViewImp::HandleItemAddedL"); - if (iList) - { - if ((aEndIndex - aStartIndex) >= KRecreateListSize) - { - iList->ResizeL(aList->Count()); - } - else + TRACER("CGlxListViewImp::HandleItemAddedL"); + + if (iList && aList) + { + iList->ResizeL(aList->Count()); + for (TInt i = aStartIndex; i<= aEndIndex; i++) { - for (TInt i = aStartIndex; i<= aEndIndex; i++) - { - const TGlxMedia& item = iMediaList->Item(i); - iList->InsertItem(CHgItem::NewL(CHgItem::EHgItemFlagsNone, - NULL, item.Title(), item.SubTitle()), i); - } - - if(aStartIndex == aEndIndex ) - { - iLastFocusedIndex = aStartIndex; - iPopulateListTNs = EFalse; - iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); - } - - iList->SetSelectedIndex(iLastFocusedIndex); - iList->RefreshScreen(iLastFocusedIndex); + const TGlxMedia& item = iMediaList->Item(i); + iList->ItemL(i).SetTitleL(item.Title()); + iList->ItemL(i).SetTextL(item.SubTitle()); + } + + if(aStartIndex == aEndIndex ) + { + iLastFocusedIndex = aStartIndex; + iPopulateListTNs = EFalse; + iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); } + + iList->SetSelectedIndex(iLastFocusedIndex); + iList->RefreshScreen(iLastFocusedIndex); } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp --- a/photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -29,6 +29,9 @@ #include // Fetch context priority def'ns +#include + + const TInt KInitialThumbnailsTimeDelay(100000); const TInt KWaitCount(5); const TInt KThumbnailStartTimeDelay(250000); @@ -36,6 +39,57 @@ const TInt KPreviewThumbnailFetchCount(1); // ---------------------------------------------------------------------------- +// CWaitScheduler::NewL() +// ---------------------------------------------------------------------------- +CGlxWaitScheduler* CGlxWaitScheduler::NewL() + { + TRACER("CGlxWaitScheduler::NewL()"); + CGlxWaitScheduler* self = new( ELeave ) CGlxWaitScheduler(); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +CGlxWaitScheduler::CGlxWaitScheduler() +: CActive( EPriorityStandard ) + { + TRACER("CGlxWaitScheduler::CGlxWaitScheduler()"); + CActiveScheduler::Add( this ); + } + +void CGlxWaitScheduler::ConstructL() + { + TRACER("CGlxWaitScheduler::ConstructL()"); + // Do nothing + } + +CGlxWaitScheduler::~CGlxWaitScheduler() + { + TRACER("CGlxWaitScheduler::~CGlxWaitScheduler()"); + Cancel(); + } + +void CGlxWaitScheduler::WaitForRequest() + { + TRACER("CGlxWaitScheduler::WaitForRequest()"); + SetActive(); + iScheduler.Start(); + } + +void CGlxWaitScheduler::RunL() + { + TRACER("CGlxWaitScheduler::RunL()"); + iScheduler.AsyncStop(); + } + +void CGlxWaitScheduler::DoCancel() + { + TRACER("CGlxWaitScheduler::DoCancel()"); + //Do nothing + } + +// ---------------------------------------------------------------------------- // NewL // ---------------------------------------------------------------------------- // @@ -94,6 +148,7 @@ iThumbnailContext->SetDefaultSpec(iGridIconSize.iWidth, iGridIconSize.iHeight); iThumbnailContext->AddAttributeL(tnAttr); + iBitmapScaler = CBitmapScaler::NewL(); } // ---------------------------------------------------------------------------- @@ -121,6 +176,12 @@ delete iTimer; iTimer = NULL; iPreviewItemCount.Close(); + + if(iBitmapScaler) + { + delete iBitmapScaler; + iBitmapScaler = NULL; + } } // ---------------------------------------------------------------------------- @@ -147,7 +208,8 @@ if (value) { CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; - bitmap->Duplicate( value->iBitmap->Handle()); + bitmap->Duplicate( value->iBitmap->Handle()); + //ScaleBitmapToListSizeL(value->iBitmap, bitmap); iObserver.PreviewTNReadyL(bitmap, NULL,iProgressIndex); } } @@ -179,6 +241,7 @@ { CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; bitmap->Duplicate( value->iBitmap->Handle()); + //ScaleBitmapToListSizeL(value->iBitmap, bitmap); iObserver.PreviewTNReadyL(bitmap, NULL,iProgressIndex); } else @@ -425,3 +488,24 @@ StartTimer(iPopulateListTNs); } +// ---------------------------------------------------------------------------- +// ScaleBitmapToListSizeL +// ---------------------------------------------------------------------------- +// +void CGlxPreviewThumbnailBinding::ScaleBitmapToListSizeL( + CFbsBitmap* aSrcBitmap, CFbsBitmap* aDestBitmap) + { + TRACER("CGlxPreviewThumbnailBinding::ScaleBitmapToListSizeL()"); + + // Create the bitmap with the list preferred size + aDestBitmap->Create(CHgDoubleGraphicList::PreferredImageSize(), EColor16MU); + + CGlxWaitScheduler* waitScheduler = CGlxWaitScheduler::NewL(); + CleanupStack::PushL( waitScheduler ); + + iBitmapScaler->Scale(&waitScheduler->iStatus, *aSrcBitmap, + *aDestBitmap, ETrue); + waitScheduler->WaitForRequest(); + + CleanupStack::PopAndDestroy( waitScheduler ); + } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -145,42 +145,42 @@ CGlxMetadataContainer::~CGlxMetadataContainer() { TRACER("CGlxMetadataContainer::~CGlxMetadataContainer"); - if( iItemMediaList ) - { - iItemMediaList->RemoveContext(iMainListAttributecontext); - iItemMediaList->RemoveMediaListObserver(this); - iItemMediaList->Close(); - iItemMediaList = NULL; - } + if( iItemMediaList ) + { + iItemMediaList->RemoveContext(iMainListAttributecontext); + iItemMediaList->RemoveMediaListObserver(this); + iItemMediaList->Close(); + iItemMediaList = NULL; + } if ( iTagMediaList ) - { - iTagMediaList->RemoveContext(iTagContext); - iTagMediaList->RemoveMediaListObserver(this); - iTagMediaList->Close(); - iTagMediaList = NULL; - } + { + iTagMediaList->RemoveContext(iTagContext); + iTagMediaList->RemoveMediaListObserver(this); + iTagMediaList->Close(); + iTagMediaList = NULL; + } if ( iAlbumMediaList ) - { - iAlbumMediaList->RemoveContext(iAlbumContext); - iAlbumMediaList->RemoveMediaListObserver(this); - iAlbumMediaList->Close(); - iAlbumMediaList = NULL; - } + { + iAlbumMediaList->RemoveContext(iAlbumContext); + iAlbumMediaList->RemoveMediaListObserver(this); + iAlbumMediaList->Close(); + iAlbumMediaList = NULL; + } if( iTagContext ) - { + { delete iTagContext; iTagContext = NULL; - } + } if( iAlbumContext ) - { + { delete iAlbumContext; iAlbumContext = NULL; - } + } if( iMainListAttributecontext ) - { - delete iMainListAttributecontext; - iMainListAttributecontext = NULL; - } + { + delete iMainListAttributecontext; + iMainListAttributecontext = NULL; + } if( IsVisible() ) { MakeVisible(EFalse); @@ -314,9 +314,9 @@ const TGlxMedia& item = iItemMediaList->Item(0); TCoordinate coordinate; if(item.GetCoordinate(coordinate)) - { - return EFalse; - } + { + return EFalse; + } return ETrue; } //return ETrue to dim the item @@ -359,42 +359,56 @@ break; } case ETagsItem: - { - //Set the focus of the item - iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0); - //Launch add to container commandhandler via dialog observer. - iDialogObesrver.AddTagL(); - break; - } + { + //Set the focus of the item + iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0); + //Launch add to container commandhandler via dialog observer. + iDialogObesrver.AddTagL(); + break; + } case EAlbumsItem: - { - //Set the focus of the item - iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0); - //Launch add to container commandhandler via dialog observer. - iDialogObesrver.AddAlbumL(); - break; - } + { + //Set the focus of the item + iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0); + //Launch add to container commandhandler via dialog observer. + iDialogObesrver.AddAlbumL(); + break; + } + case ELocationItem: + { + // Get the Media Item + const TGlxMedia& media = iItemMediaList->Item(0); + // Test to see if the Coordinate is Present + TCoordinate coordinate; + if( !media.GetCoordinate(coordinate) ) + { + HBufC *noLocationBuf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION); + GlxGeneralUiUtilities::ShowInfoNoteL(*noLocationBuf,ETrue); + CleanupStack::PopAndDestroy(noLocationBuf); + } + break; + } case EDurationItem: - { - //This is conditionis useful when the license item is selected for a image file - if(iVideo) - { - break; - } - } + { + //This is condition is useful when the license item is selected for a image file + if(iVideo) + { + break; + } + } case ElicenseItem: - { - //Create DRM utility - CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); - CleanupClosePushL(*drmUtility); - drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri()); - CleanupStack::PopAndDestroy(drmUtility); - } - break; + { + //Create DRM utility + CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); + CleanupClosePushL(*drmUtility); + drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri()); + CleanupStack::PopAndDestroy(drmUtility); + } + break; default: - { - break; - } + { + break; + } } } //----------------------------------------------------------------------------- @@ -617,25 +631,25 @@ CleanupStack::PushL( exifWriter ); if(err == KErrNone) { - //Removes the specified IFD structure and all its tags from the Exif data - exifWriter->DeleteIfd ( EIfdGps ); + //Removes the specified IFD structure and all its tags from the Exif data + exifWriter->DeleteIfd ( EIfdGps ); - HBufC8* modifiedExif = exifWriter->WriteDataL( imageData->Des() ); //Modified Image Data - CleanupStack::PushL( modifiedExif ); + HBufC8* modifiedExif = exifWriter->WriteDataL( imageData->Des() ); //Modified Image Data + CleanupStack::PushL( modifiedExif ); - const TUint32 fileSize = modifiedExif->Des().Length(); //Size of Modified File - TInt oldSize; - rFile.Size( oldSize ); - // set position to begin of file & write the Modified data (Without Location Information) - TInt pos = 0; - User::LeaveIfError( rFile.Seek( ESeekStart, pos ) ); - User::LeaveIfError( rFile.Write( modifiedExif->Des(), fileSize ) ); + const TUint32 fileSize = modifiedExif->Des().Length(); //Size of Modified File + TInt oldSize; + rFile.Size( oldSize ); + // set position to begin of file & write the Modified data (Without Location Information) + TInt pos = 0; + User::LeaveIfError( rFile.Seek( ESeekStart, pos ) ); + User::LeaveIfError( rFile.Write( modifiedExif->Des(), fileSize ) ); - TTime lastModified; - lastModified.UniversalTime(); - User::LeaveIfError( rFile.SetModified( lastModified ) ); //Change the Modified Time + TTime lastModified; + lastModified.UniversalTime(); + User::LeaveIfError( rFile.SetModified( lastModified ) ); //Change the Modified Time - CleanupStack::PopAndDestroy( modifiedExif); + CleanupStack::PopAndDestroy( modifiedExif); } CleanupStack::PopAndDestroy( exifWriter); CleanupStack::PopAndDestroy( imageData ); @@ -675,24 +689,24 @@ // ---------------------------------------------------------------------------- // void CGlxMetadataContainer::SetAttributesL(TMPXAttribute attribute) -{ + { TRACER("CGlxMetadataContainer::SetAttributesL"); //create the tags and albums medialist once the item medialist is populated //Tags and albums medialist can be created only with media ID. if(!iTagMediaList) - { - CreateTagsMediaListL(); - } + { + CreateTagsMediaListL(); + } if(!iAlbumMediaList) - { - CreateAlbumsMediaListL(); - } + { + CreateAlbumsMediaListL(); + } if(!iSetVisible) - { - iSetVisible = ETrue; - SetDurationLIicenseItemVisibilityL(); - } + { + iSetVisible = ETrue; + SetDurationLIicenseItemVisibilityL(); + } TGlxMedia item = iItemMediaList->Item(0); //Create the string convertor instance //String convertor class with provide the specific format for date,location and duration and size. @@ -714,46 +728,46 @@ } //get the settings item based on the attribute and set the text. if ( string ) - { - iTextSetter.Copy(KGlxTextSetter); - iTextSetter.Append(*string); - if(attribute == KMPXMediaGeneralSize) - { - EditItemL(ESizeItem,EFalse); - } - else if(attribute == KMPXMediaGeneralDuration) - { - EditItemL(EDurationItem,EFalse); - } - else if(attribute == KMPXMediaGeneralTitle) - { - EditItemL(ENameItem,EFalse); - } - else if(attribute == KMPXMediaGeneralDate) - { - EditItemL(EDateAndTimeItem,EFalse); - } - else if(attribute == KMPXMediaGeneralComment) - { - EditItemL(EDescriptionItem,EFalse); - } - else if(attribute == KGlxMediaGeneralLocation) - { - EditItemL(ELocationItem,EFalse); - } - else if(attribute == KGlxMediaGeneralDimensions) - { - EditItemL(EResolutionItem,EFalse); - } - else - { + { + iTextSetter.Copy(KGlxTextSetter); + iTextSetter.Append(*string); + if(attribute == KMPXMediaGeneralSize) + { + EditItemL(ESizeItem,EFalse); + } + else if(attribute == KMPXMediaGeneralDuration) + { + EditItemL(EDurationItem,EFalse); + } + else if(attribute == KMPXMediaGeneralTitle) + { + EditItemL(ENameItem,EFalse); + } + else if(attribute == KMPXMediaGeneralDate) + { + EditItemL(EDateAndTimeItem,EFalse); + } + else if(attribute == KMPXMediaGeneralComment) + { + EditItemL(EDescriptionItem,EFalse); + } + else if(attribute == KGlxMediaGeneralLocation) + { + EditItemL(ELocationItem,EFalse); + } + else if(attribute == KGlxMediaGeneralDimensions) + { + EditItemL(EResolutionItem,EFalse); + } + else + { - } - delete string; - string = NULL; - } + } + delete string; + string = NULL; + } CleanupStack::PopAndDestroy(stringConverter ); -} + } // ---------------------------------------------------------------------------- // CGlxMetadataContainer::SetNameDescriptionL @@ -845,15 +859,15 @@ iTagSetter.Copy(KGlxTextSetter); //Loop to appened all the tags to the iTagSetter. for( TInt index = 0 ; index < iTagMediaList->Count() ; index++ ) - { - if(iTagSetter.Length()) - { - iTagSetter.Append(KGlxComma); - } - const TGlxMedia& item = iTagMediaList->Item( index ); - const TDesC& title = item.Title(); - iTagSetter.Append(title); - } + { + if(iTagSetter.Length()) + { + iTagSetter.Append(KGlxComma); + } + const TGlxMedia& item = iTagMediaList->Item( index ); + const TDesC& title = item.Title(); + iTagSetter.Append(title); + } EditItemL(ETagsItem,EFalse); } // ---------------------------------------------------------------------------- @@ -863,22 +877,22 @@ void CGlxMetadataContainer::UpdateAlbumsL() { //Get the tag setting item handle to set the text - CAknSettingItem* settingsitem = - (*SettingItemArray())[EAlbumsItem]; - //Set the tag setter to empty string before filling in the data. - iAlbumSetter.Copy(KGlxTextSetter); - //Loop to appened all the tags to the iAlbumSetter. - for( TInt index = 0 ; index < iAlbumMediaList->Count() ; index++ ) - { - if(iAlbumSetter.Length()) - { - iAlbumSetter.Append(KGlxComma); - } - const TGlxMedia& item = iAlbumMediaList->Item( index ); - const TDesC& title = item.Title(); - iAlbumSetter.Append(title); - } - EditItemL(EAlbumsItem,EFalse); + CAknSettingItem* settingsitem = + (*SettingItemArray())[EAlbumsItem]; + //Set the tag setter to empty string before filling in the data. + iAlbumSetter.Copy(KGlxTextSetter); + //Loop to appened all the tags to the iAlbumSetter. + for( TInt index = 0 ; index < iAlbumMediaList->Count() ; index++ ) + { + if(iAlbumSetter.Length()) + { + iAlbumSetter.Append(KGlxComma); + } + const TGlxMedia& item = iAlbumMediaList->Item( index ); + const TDesC& title = item.Title(); + iAlbumSetter.Append(title); + } + EditItemL(EAlbumsItem,EFalse); } // ---------------------------------------------------------------------------- // CGlxMetadataContainer::SetDurationLIicenseItemVisibilityL() @@ -907,14 +921,14 @@ } if( media && media->IsSupported(KMPXMediaDrmProtected)) { - if(item.IsDrmProtected()) - { - hiddenItem = (*SettingItemArray())[ElicenseItem]; - //Set the License item visible - hiddenItem->SetHidden(EFalse); - //Required to refresh the listbox when any items visiblity is changed - this->HandleChangeInItemArrayOrVisibilityL(); - } + if(item.IsDrmProtected()) + { + hiddenItem = (*SettingItemArray())[ElicenseItem]; + //Set the License item visible + hiddenItem->SetHidden(EFalse); + //Required to refresh the listbox when any items visiblity is changed + this->HandleChangeInItemArrayOrVisibilityL(); + } } } //Medialist callbacks. @@ -929,12 +943,12 @@ //generic medialist for the item for all the attributes required other than tags and albums. if(aList == iItemMediaList) { - // Loop untill it checks for all the avialable attributes - for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--) - { - //set attributes to the items in the container - SetAttributesL(aAttributes[i]); - } + // Loop untill it checks for all the avialable attributes + for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--) + { + //set attributes to the items in the container + SetAttributesL(aAttributes[i]); + } } //updation of tags and albums list based on the medialist callback. if(aList == iTagMediaList || aList == iAlbumMediaList) @@ -947,13 +961,13 @@ if( titleAtrribute == aAttributes[i] ) { if(aList == iTagMediaList) - { - UpdateTagsL(); - } - else if(aList == iAlbumMediaList) - { - UpdateAlbumsL(); - } + { + UpdateTagsL(); + } + else if(aList == iAlbumMediaList) + { + UpdateAlbumsL(); + } } } @@ -972,88 +986,88 @@ TRACER("CGlxMetadataContainer::HandleItemAddedL()"); if(!iTagMediaList) - { + { CreateTagsMediaListL(); - } + } if(!iAlbumMediaList) - { + { CreateAlbumsMediaListL(); - } + } if(!iMarquee) - { + { EnableMarqueingL(); - } + } SetDurationLIicenseItemVisibilityL(); if(aList == iTagMediaList) - { - UpdateTagsL(); - } - else if(aList == iAlbumMediaList) - { - UpdateAlbumsL(); - } + { + UpdateTagsL(); + } + else if(aList == iAlbumMediaList) + { + UpdateAlbumsL(); + } if(aList == iItemMediaList) { if(iItemMediaList->Count()) - { - TGlxMedia item = iItemMediaList->Item(0); - CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); - CleanupStack::PushL(stringConverter ); - for(TInt index = 0; index <= 9; index++) - { - HBufC* string = NULL; + { + TGlxMedia item = iItemMediaList->Item(0); + CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); + CleanupStack::PushL(stringConverter ); + for(TInt index = 0; index <= 9; index++) + { + HBufC* string = NULL; - if(index == ESizeItem) - { - stringConverter->AsStringL(item, - KMPXMediaGeneralSize,0, string ); - } - else if(index == EDurationItem) - { - stringConverter->AsStringL(item, - KMPXMediaGeneralDuration,0, string ); - } - else if(index == ENameItem) - { - stringConverter->AsStringL(item, - KMPXMediaGeneralTitle,0, string ); - } - else if(index == EDateAndTimeItem) - { - stringConverter->AsStringL( item, - KMPXMediaGeneralDate, - R_QTN_DATE_USUAL_WITH_ZERO,string ); - } - else if(index == EDescriptionItem) - { - stringConverter->AsStringL(item, - KMPXMediaGeneralComment,0, string ); - } - else if(index == ELocationItem) - { - stringConverter->AsStringL(item, - KGlxMediaGeneralLocation,0, string ); - } - else if(index == EResolutionItem) - { - stringConverter->AsStringL(item, - KGlxMediaGeneralDimensions,0, string ); - } - else - { - //no implementation - } - if(string) - { - iTextSetter.Copy(KGlxTextSetter); - iTextSetter.Append(*string); - } - EditItemL(index,EFalse); - delete string; - string = NULL; - } - CleanupStack::PopAndDestroy(stringConverter ); - } + if(index == ESizeItem) + { + stringConverter->AsStringL(item, + KMPXMediaGeneralSize,0, string ); + } + else if(index == EDurationItem) + { + stringConverter->AsStringL(item, + KMPXMediaGeneralDuration,0, string ); + } + else if(index == ENameItem) + { + stringConverter->AsStringL(item, + KMPXMediaGeneralTitle,0, string ); + } + else if(index == EDateAndTimeItem) + { + stringConverter->AsStringL( item, + KMPXMediaGeneralDate, + R_QTN_DATE_USUAL_WITH_ZERO,string ); + } + else if(index == EDescriptionItem) + { + stringConverter->AsStringL(item, + KMPXMediaGeneralComment,0, string ); + } + else if(index == ELocationItem) + { + stringConverter->AsStringL(item, + KGlxMediaGeneralLocation,0, string ); + } + else if(index == EResolutionItem) + { + stringConverter->AsStringL(item, + KGlxMediaGeneralDimensions,0, string ); + } + else + { + //no implementation + } + if(string) + { + iTextSetter.Copy(KGlxTextSetter); + iTextSetter.Append(*string); + } + EditItemL(index,EFalse); + delete string; + string = NULL; + } + CleanupStack::PopAndDestroy(stringConverter ); + } } } // ---------------------------------------------------------------------------- @@ -1068,6 +1082,18 @@ ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams (KMarqueeLoopCount, KMarqueeScrollAmount, KMarqueeScrollDelay, KMarqueeScrollInterval); ListBox()->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue); + + //Fetch the current item index + TInt index = ListBox()->CurrentItemIndex(); + + //Reset the disable marquee flag, so that marquee effect can continue (this is normally reset by + //base class of glxmetaDatadialog::HandlePointerEventL() + ListBox()->ItemDrawer()->ClearFlags(CListItemDrawer::EDisableMarquee); + + //This is the function which actually starts marquee effect. It is anyway being called from base + //implementation of OfferKeyEventL(), but for pointer event, we have to call + //this function + ListBox()->DrawItem(index); } // ---------------------------------------------------------------------------- // HandleCommandCompleteL @@ -1110,17 +1136,17 @@ //To update the location information once the delete operation is successful. if(aList == iItemMediaList && iLocationinfo && static_cast( this ) == aSessionId) - { - TGlxMedia media = iItemMediaList->Item(0) ; - media.DeleteLocationAttribute(); - iLocationinfo = EFalse; - if ( aError == KErrNone ) - { - iTextSetter.Copy(KGlxTextSetter); - EditItemL(ELocationItem,EFalse); - } - } - } + { + TGlxMedia media = iItemMediaList->Item(0) ; + media.DeleteLocationAttribute(); + iLocationinfo = EFalse; + if ( aError == KErrNone ) + { + iTextSetter.Copy(KGlxTextSetter); + EditItemL(ELocationItem,EFalse); + } + } + } // ---------------------------------------------------------------------------- // HandleItemRemoved @@ -1154,7 +1180,7 @@ // HandleMessageL // ---------------------------------------------------------------------------- // - void CGlxMetadataContainer::HandleMessageL( const CMPXMessage& /*aMessage*/, +void CGlxMetadataContainer::HandleMessageL( const CMPXMessage& /*aMessage*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleMessageL()"); @@ -1243,9 +1269,9 @@ } if ( uiUtility ) - { - uiUtility->Close(); - } + { + uiUtility->Close(); + } } // --------------------------------------------------------------------------- @@ -1279,10 +1305,10 @@ iItemMediaList->Close(); iItemMediaList = NULL; if( iMainListAttributecontext ) - { - delete iMainListAttributecontext; - iMainListAttributecontext = NULL; - } + { + delete iMainListAttributecontext; + iMainListAttributecontext = NULL; + } CreateMediaListForSelectedItemL(ETrue); } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -470,7 +470,20 @@ const TPointerEvent& aPointerEvent) { TRACER("CGlxMetadataDialog::HandlePointerEventL"); + + //This has to be called first, as base class implementation sets the flag of settings dialog with EDisableMarquee CCoeControl::HandlePointerEventL( aPointerEvent ); + + //After the above call we can call our implementation to reset the marque flag and start marqueeing if needed + if(aPointerEvent.iType == TPointerEvent::EButton1Down + || aPointerEvent.iType == TPointerEvent::EButton2Down + || aPointerEvent.iType == TPointerEvent::EButton3Down + || aPointerEvent.iType == TPointerEvent::EDrag) + { + //This has to done at every above mentioned event, since the disable marquee flag is set by base implementation, + //forcing us the need to reset it everytime. + iContainer->EnableMarqueingL(); + } } // --------------------------------------------------------------------------- diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def --- a/photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def Fri Feb 19 22:51:01 2010 +0200 @@ -38,4 +38,6 @@ ?DoPrepareCommandHandlerL@CGlxMediaListViewBase@@MAEXPAVCGlxCommandHandler@@@Z @ 37 NONAME ; void CGlxMediaListViewBase::DoPrepareCommandHandlerL(class CGlxCommandHandler *) ?FetchAttributesForCommandL@CGlxMediaListViewBase@@EAEXH@Z @ 38 NONAME ; void CGlxMediaListViewBase::FetchAttributesForCommandL(int) ?SetToolbarStateL@CGlxViewBase@@MAEXXZ @ 39 NONAME ; void CGlxViewBase::SetToolbarStateL(void) + ?GetToolBar@CGlxViewBase@@QAEPAVCAknToolbar@@XZ @ 40 NONAME ; class CAknToolbar * CGlxViewBase::GetToolBar(void) + ?SetGridToolBar@CGlxViewBase@@QAEXPAVCAknToolbar@@@Z @ 41 NONAME ; void CGlxViewBase::SetGridToolBar(class CAknToolbar *) diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def --- a/photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def Fri Feb 19 22:51:01 2010 +0200 @@ -1,59 +1,61 @@ EXPORTS - _ZN12CGlxViewBase11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 1 NONAME - _ZN12CGlxViewBase12DisableTitleEv @ 2 NONAME - _ZN12CGlxViewBase12DoDeactivateEv @ 3 NONAME - _ZN12CGlxViewBase14HandleCommandLEi @ 4 NONAME - _ZN12CGlxViewBase14ViewActivatedLERK10TVwsViewId4TUidRK6TDesC8 @ 5 NONAME - _ZN12CGlxViewBase15ViewDeactivatedEv @ 6 NONAME - _ZN12CGlxViewBase16DoHandleCommandLEi @ 7 NONAME - _ZN12CGlxViewBase16DoViewAnimationLE23TGlxViewswitchAnimation23TGlxNavigationDirection @ 8 NONAME - _ZN12CGlxViewBase16DynInitMenuPaneLEiP12CEikMenuPane @ 9 NONAME - _ZN12CGlxViewBase16FetchAttributesLEv @ 10 NONAME - _ZN12CGlxViewBase16SetToolbarStateLEv @ 11 NONAME - _ZN12CGlxViewBase17AnimationCompleteEP13MGlxAnimation @ 12 NONAME - _ZN12CGlxViewBase18AddCommandHandlerLEP18CGlxCommandHandler @ 13 NONAME - _ZN12CGlxViewBase18HandleViewCommandLEi @ 14 NONAME - _ZN12CGlxViewBase18OfferToolbarEventLEi @ 15 NONAME - _ZN12CGlxViewBase18SetToolbarObserverEP19MAknToolbarObserver @ 16 NONAME - _ZN12CGlxViewBase18ViewBaseConstructLEv @ 17 NONAME - _ZN12CGlxViewBase20ViewDynInitMenuPaneLEiP12CEikMenuPane @ 18 NONAME - _ZN12CGlxViewBase22ViewAnimationSupportedE23TGlxViewswitchAnimation @ 19 NONAME - _ZN12CGlxViewBase26FetchAttributesForCommandLEi @ 20 NONAME - _ZN12CGlxViewBase9SetTitleLERK7TDesC16 @ 21 NONAME - _ZN12CGlxViewBaseC2Ei @ 22 NONAME - _ZN12CGlxViewBaseD0Ev @ 23 NONAME - _ZN12CGlxViewBaseD1Ev @ 24 NONAME - _ZN12CGlxViewBaseD2Ev @ 25 NONAME - _ZN21CGlxMediaListViewBase15DoViewActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 26 NONAME - _ZN21CGlxMediaListViewBase16DoHandleCommandLEi @ 27 NONAME - _ZN21CGlxMediaListViewBase16DoViewDeactivateEv @ 28 NONAME - _ZN21CGlxMediaListViewBase16FetchAttributesLEv @ 29 NONAME - _ZN21CGlxMediaListViewBase16SetToolbarStateLEv @ 30 NONAME - _ZN21CGlxMediaListViewBase18HandleViewCommandLEi @ 31 NONAME - _ZN21CGlxMediaListViewBase20MLViewBaseConstructLEP20MGlxMediaListFactoryRK7TDesC16i @ 32 NONAME - _ZN21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 33 NONAME - _ZN21CGlxMediaListViewBase24DoPrepareCommandHandlerLEP18CGlxCommandHandler @ 34 NONAME - _ZN21CGlxMediaListViewBase26FetchAttributesForCommandLEi @ 35 NONAME - _ZN21CGlxMediaListViewBase9MediaListEv @ 36 NONAME - _ZN21CGlxMediaListViewBaseC2Ev @ 37 NONAME - _ZN21CGlxMediaListViewBaseD0Ev @ 38 NONAME - _ZN21CGlxMediaListViewBaseD1Ev @ 39 NONAME - _ZN21CGlxMediaListViewBaseD2Ev @ 40 NONAME - _ZNK20MGlxMediaListFactory12CurrentListLER21MMPXCollectionUtility @ 41 NONAME - _ZNK20MGlxMediaListFactory16CreateMediaListLER21MMPXCollectionUtility @ 42 NONAME - _ZTI12CGlxViewBase @ 43 NONAME ; ## - _ZTI16CGlxTitleFetcher @ 44 NONAME ; ## - _ZTI20MGlxMediaListFactory @ 45 NONAME ; ## - _ZTI21CGlxMediaListViewBase @ 46 NONAME ; ## - _ZTV12CGlxViewBase @ 47 NONAME ; ## - _ZTV16CGlxTitleFetcher @ 48 NONAME ; ## - _ZTV20MGlxMediaListFactory @ 49 NONAME ; ## - _ZTV21CGlxMediaListViewBase @ 50 NONAME ; ## - _ZThn12_N12CGlxViewBase16DynInitMenuPaneLEiP12CEikMenuPane @ 51 NONAME ; ## - _ZThn164_N21CGlxMediaListViewBase9MediaListEv @ 52 NONAME ; ## - _ZThn168_N21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 53 NONAME ; ## - _ZThn4_N12CGlxViewBase14ViewActivatedLERK10TVwsViewId4TUidRK6TDesC8 @ 54 NONAME ; ## - _ZThn4_N12CGlxViewBase15ViewDeactivatedEv @ 55 NONAME ; ## - _ZThn80_N12CGlxViewBase17AnimationCompleteEP13MGlxAnimation @ 56 NONAME ; ## - _ZThn84_N12CGlxViewBase18OfferToolbarEventLEi @ 57 NONAME ; ## + _ZN12CGlxViewBase10GetToolBarEv @ 1 NONAME + _ZN12CGlxViewBase11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 2 NONAME + _ZN12CGlxViewBase12DisableTitleEv @ 3 NONAME + _ZN12CGlxViewBase12DoDeactivateEv @ 4 NONAME + _ZN12CGlxViewBase14HandleCommandLEi @ 5 NONAME + _ZN12CGlxViewBase14SetGridToolBarEP11CAknToolbar @ 6 NONAME + _ZN12CGlxViewBase14ViewActivatedLERK10TVwsViewId4TUidRK6TDesC8 @ 7 NONAME + _ZN12CGlxViewBase15ViewDeactivatedEv @ 8 NONAME + _ZN12CGlxViewBase16DoHandleCommandLEi @ 9 NONAME + _ZN12CGlxViewBase16DoViewAnimationLE23TGlxViewswitchAnimation23TGlxNavigationDirection @ 10 NONAME + _ZN12CGlxViewBase16DynInitMenuPaneLEiP12CEikMenuPane @ 11 NONAME + _ZN12CGlxViewBase16FetchAttributesLEv @ 12 NONAME + _ZN12CGlxViewBase16SetToolbarStateLEv @ 13 NONAME + _ZN12CGlxViewBase17AnimationCompleteEP13MGlxAnimation @ 14 NONAME + _ZN12CGlxViewBase18AddCommandHandlerLEP18CGlxCommandHandler @ 15 NONAME + _ZN12CGlxViewBase18HandleViewCommandLEi @ 16 NONAME + _ZN12CGlxViewBase18OfferToolbarEventLEi @ 17 NONAME + _ZN12CGlxViewBase18SetToolbarObserverEP19MAknToolbarObserver @ 18 NONAME + _ZN12CGlxViewBase18ViewBaseConstructLEv @ 19 NONAME + _ZN12CGlxViewBase20ViewDynInitMenuPaneLEiP12CEikMenuPane @ 20 NONAME + _ZN12CGlxViewBase22ViewAnimationSupportedE23TGlxViewswitchAnimation @ 21 NONAME + _ZN12CGlxViewBase26FetchAttributesForCommandLEi @ 22 NONAME + _ZN12CGlxViewBase9SetTitleLERK7TDesC16 @ 23 NONAME + _ZN12CGlxViewBaseC2Ei @ 24 NONAME + _ZN12CGlxViewBaseD0Ev @ 25 NONAME + _ZN12CGlxViewBaseD1Ev @ 26 NONAME + _ZN12CGlxViewBaseD2Ev @ 27 NONAME + _ZN21CGlxMediaListViewBase15DoViewActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 28 NONAME + _ZN21CGlxMediaListViewBase16DoHandleCommandLEi @ 29 NONAME + _ZN21CGlxMediaListViewBase16DoViewDeactivateEv @ 30 NONAME + _ZN21CGlxMediaListViewBase16FetchAttributesLEv @ 31 NONAME + _ZN21CGlxMediaListViewBase16SetToolbarStateLEv @ 32 NONAME + _ZN21CGlxMediaListViewBase18HandleViewCommandLEi @ 33 NONAME + _ZN21CGlxMediaListViewBase20MLViewBaseConstructLEP20MGlxMediaListFactoryRK7TDesC16i @ 34 NONAME + _ZN21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 35 NONAME + _ZN21CGlxMediaListViewBase24DoPrepareCommandHandlerLEP18CGlxCommandHandler @ 36 NONAME + _ZN21CGlxMediaListViewBase26FetchAttributesForCommandLEi @ 37 NONAME + _ZN21CGlxMediaListViewBase9MediaListEv @ 38 NONAME + _ZN21CGlxMediaListViewBaseC2Ev @ 39 NONAME + _ZN21CGlxMediaListViewBaseD0Ev @ 40 NONAME + _ZN21CGlxMediaListViewBaseD1Ev @ 41 NONAME + _ZN21CGlxMediaListViewBaseD2Ev @ 42 NONAME + _ZNK20MGlxMediaListFactory12CurrentListLER21MMPXCollectionUtility @ 43 NONAME + _ZNK20MGlxMediaListFactory16CreateMediaListLER21MMPXCollectionUtility @ 44 NONAME + _ZTI12CGlxViewBase @ 45 NONAME + _ZTI16CGlxTitleFetcher @ 46 NONAME + _ZTI20MGlxMediaListFactory @ 47 NONAME + _ZTI21CGlxMediaListViewBase @ 48 NONAME + _ZTV12CGlxViewBase @ 49 NONAME + _ZTV16CGlxTitleFetcher @ 50 NONAME + _ZTV20MGlxMediaListFactory @ 51 NONAME + _ZTV21CGlxMediaListViewBase @ 52 NONAME + _ZThn12_N12CGlxViewBase16DynInitMenuPaneLEiP12CEikMenuPane @ 53 NONAME + _ZThn168_N21CGlxMediaListViewBase9MediaListEv @ 54 NONAME + _ZThn172_N21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 55 NONAME + _ZThn4_N12CGlxViewBase14ViewActivatedLERK10TVwsViewId4TUidRK6TDesC8 @ 56 NONAME + _ZThn4_N12CGlxViewBase15ViewDeactivatedEv @ 57 NONAME + _ZThn80_N12CGlxViewBase17AnimationCompleteEP13MGlxAnimation @ 58 NONAME + _ZThn84_N12CGlxViewBase18OfferToolbarEventLEi @ 59 NONAME diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/viewbase/inc/glxviewbase.h --- a/photosgallery/viewframework/views/viewbase/inc/glxviewbase.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/viewbase/inc/glxviewbase.h Fri Feb 19 22:51:01 2010 +0200 @@ -91,6 +91,17 @@ */ IMPORT_C virtual TInt DoHandleCommandL(TInt aCommand); + /** + * Sets the grid tool. + * @param grid toolbar handle. + */ + IMPORT_C void SetGridToolBar(CAknToolbar* aToolbar); + + /** + * Returns the current active toolbar + * Needed as grid toolbar is created dynamically + */ + IMPORT_C CAknToolbar* GetToolBar(); protected: // From MCoeView. @@ -270,6 +281,8 @@ /// Status pane for title CAknTitlePane* iTitlePane; + //used store the grid toolbar + CAknToolbar* iToolbar; }; diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp --- a/photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -21,6 +21,7 @@ #include "glxmedialistviewbase.h" #include +#include #include #include #include @@ -164,7 +165,16 @@ } __ASSERT_ALWAYS(iMediaList, Panic(EGlxPanicNullMediaList)); - if(iFixedTitle) + + CMPXCollectionPath* navigationalState = iCollectionUtility->Collection().PathL(); + CleanupStack::PushL( navigationalState ); + if (navigationalState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) + { + // As image viewer is direct fullscreen view, + // it will not have title. + SetTitleL(KBlankTitle); + } + else if(iFixedTitle) { // If there is a fixed title, set it SetTitleL(*iFixedTitle); @@ -179,6 +189,7 @@ iTitleFetcher = CGlxTitleFetcher::NewL(*this, path); CleanupStack::PopAndDestroy(path); } + CleanupStack::PopAndDestroy( navigationalState ); //Allow the MskController to observe medialist everytime a view with a valid //medialist becomes active @@ -198,15 +209,14 @@ CleanupStack::PopAndDestroy(navigationalState); } + DoMLViewActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); //Allow the toolbarController to observe medialist everytime a view with a valid //medialist becomes active - if( Toolbar() && iToolbarControl ) - { - iToolbarControl->AddToObserverL(*iMediaList, Toolbar()); - iToolbarControl->SetStatusOnViewActivationL(iMediaList); - } - - DoMLViewActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); + if( GetToolBar() && iToolbarControl ) + { + iToolbarControl->AddToObserverL(*iMediaList, GetToolBar()); + iToolbarControl->SetStatusOnViewActivationL(iMediaList); + } } // ----------------------------------------------------------------------------- @@ -215,6 +225,15 @@ // EXPORT_C void CGlxMediaListViewBase::DoViewDeactivate() { + TRACER ("CGlxMediaListViewBase::DoViewDeactivate()"); + //Need to be done before the view deactivation + //as the grid toolbar will be deleted in grid deactivation. + + if (GetToolBar() && iToolbarControl && iMediaList) + { + //Remove Toolbarcontroller from medialist observer + iToolbarControl->RemoveFromObserver(*iMediaList); + } DoMLViewDeactivate(); if( iMediaList ) @@ -224,12 +243,6 @@ //Remove Mskcontroller from medialist observer iCbaControl->RemoveFromObserver(*iMediaList); } - if (Toolbar() && iToolbarControl) - { - //Remove Toolbarcontroller from medialist observer - iToolbarControl->RemoveFromObserver(*iMediaList); - } - // Only close the medialist if navigating backwards if (iUiUtility->ViewNavigationDirection() == EGlxNavigationBackwards) { diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp --- a/photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -278,7 +278,7 @@ customMessagePtr.Copy( aCustomMessage ); // show the view specific toolbar - CAknToolbar* toolbar = Toolbar(); + CAknToolbar* toolbar = GetToolBar(); // Get the pointer to the application toolbar // (when there isn't a view specific toolbar) to set it visible @@ -326,7 +326,7 @@ { TRACER( "CGlxViewBase::DoDeactivate" ); // hide the view specific toolbar - CAknToolbar* toolbar = Toolbar(); + CAknToolbar* toolbar = GetToolBar(); // Get the pointer to the application toolbar // (when there isn't a view specific toolbar) to hide it properly @@ -466,7 +466,28 @@ TRACER( "CGlxViewBase::SetToolbarStateL" ); // Derived MediaListViewBase has the implementation. } - +// ----------------------------------------------------------------------------- +// SetGridToolBar +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGlxViewBase::SetGridToolBar(CAknToolbar* aToolbar) + { + TRACER("CGlxViewBase::SetGridToolBar()"); + iToolbar = aToolbar; + } +// ----------------------------------------------------------------------------- +// GetToolBar +// ----------------------------------------------------------------------------- +// +EXPORT_C CAknToolbar* CGlxViewBase::GetToolBar() + { + TRACER("CGlxViewBase::GetToolBar()"); + if(iToolbar) + { + return iToolbar; + } + return Toolbar(); + } // ----------------------------------------------------------------------------- // InitAnimationL // ----------------------------------------------------------------------------- @@ -514,7 +535,7 @@ EXPORT_C void CGlxViewBase::OfferToolbarEventL( TInt aCommand ) { TRACER( "CGlxViewBase::OfferToolbarEventL" ); - CAknToolbar* toolbar = Toolbar(); + CAknToolbar* toolbar = GetToolBar(); if(toolbar) { // Deactivate the toolbar. Don't accept the toolbar input when the command @@ -539,9 +560,9 @@ { TRACER( "CGlxViewBase::SetToolbarObserver" ); //Register the view to recieve toolbar events. ViewBase handles the events - if ( Toolbar() ) + if ( GetToolBar() ) { - Toolbar()->SetToolbarObserver( aObserver ); + GetToolBar()->SetToolbarObserver( aObserver ); } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/bwins/glxzoomviewu.def --- a/photosgallery/viewframework/views/zoomview/bwins/glxzoomviewu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/bwins/glxzoomviewu.def Fri Feb 19 22:51:01 2010 +0200 @@ -1,7 +1,7 @@ EXPORTS - ?ActivateL@CGlxZoomControl@@QAEXHW4TZoomStartMode@@HAAVTGlxMedia@@PAVTPoint@@@Z @ 1 NONAME ; void CGlxZoomControl::ActivateL(int, enum TZoomStartMode, int, class TGlxMedia &, class TPoint *) - ?HandleZoomForegroundEvent@CGlxZoomControl@@QAEXH@Z @ 2 NONAME ; void CGlxZoomControl::HandleZoomForegroundEvent(int) - ?Activated@CGlxZoomControl@@QAEHXZ @ 3 NONAME ; int CGlxZoomControl::Activated(void) - ?NewL@CGlxZoomControl@@SAPAV1@AAVMGlxUiCommandHandler@@AAVMGlxMediaList@@AAVCEikButtonGroupContainer@@AAVIMulSliderWidget@Alf@@PAVCGestureHelper@GestureHelper@@@Z @ 4 NONAME ; class CGlxZoomControl * CGlxZoomControl::NewL(class MGlxUiCommandHandler &, class MGlxMediaList &, class CEikButtonGroupContainer &, class Alf::IMulSliderWidget &, class GestureHelper::CGestureHelper *) - ?Deactivate@CGlxZoomControl@@QAEXXZ @ 5 NONAME ; void CGlxZoomControl::Deactivate(void) + ?HandleZoomForegroundEvent@CGlxZoomControl@@QAEXH@Z @ 1 NONAME ; void CGlxZoomControl::HandleZoomForegroundEvent(int) + ?Activated@CGlxZoomControl@@QAEHXZ @ 2 NONAME ; int CGlxZoomControl::Activated(void) + ?NewL@CGlxZoomControl@@SAPAV1@AAVMGlxUiCommandHandler@@AAVMGlxMediaList@@AAVCEikButtonGroupContainer@@AAVIMulSliderWidget@Alf@@PAVCGestureHelper@GestureHelper@@@Z @ 3 NONAME ; class CGlxZoomControl * CGlxZoomControl::NewL(class MGlxUiCommandHandler &, class MGlxMediaList &, class CEikButtonGroupContainer &, class Alf::IMulSliderWidget &, class GestureHelper::CGestureHelper *) + ?Deactivate@CGlxZoomControl@@QAEXXZ @ 4 NONAME ; void CGlxZoomControl::Deactivate(void) + ?ActivateL@CGlxZoomControl@@QAEXHW4TZoomStartMode@@HAAVTGlxMedia@@PAVTPoint@@H@Z @ 5 NONAME ; void CGlxZoomControl::ActivateL(int, enum TZoomStartMode, int, class TGlxMedia &, class TPoint *, int) diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/eabi/glxzoomviewu.def --- a/photosgallery/viewframework/views/zoomview/eabi/glxzoomviewu.def Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/eabi/glxzoomviewu.def Fri Feb 19 22:51:01 2010 +0200 @@ -2,7 +2,7 @@ _ZN15CGlxZoomControl10DeactivateEv @ 1 NONAME _ZN15CGlxZoomControl25HandleZoomForegroundEventEi @ 2 NONAME _ZN15CGlxZoomControl4NewLER20MGlxUiCommandHandlerR13MGlxMediaListR24CEikButtonGroupContainerRN3Alf16IMulSliderWidgetEPN13GestureHelper14CGestureHelperE @ 3 NONAME - _ZN15CGlxZoomControl9ActivateLEi14TZoomStartModeiR9TGlxMediaP6TPoint @ 4 NONAME + _ZN15CGlxZoomControl9ActivateLEi14TZoomStartModeiR9TGlxMediaP6TPointi @ 4 NONAME _ZN15CGlxZoomControl9ActivatedEv @ 5 NONAME _ZTI15CGlxZoomControl @ 6 NONAME _ZTI23CGlxZoomPanEventHandler @ 7 NONAME diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/inc/glxzoomcontrol.h --- a/photosgallery/viewframework/views/zoomview/inc/glxzoomcontrol.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/inc/glxzoomcontrol.h Fri Feb 19 22:51:01 2010 +0200 @@ -102,9 +102,11 @@ * Show the control and begin zooming in. * @param aIntialZoomLevel:The Initial Zoom Level shown when zoom is active from full screen view. * @param aTap :if the zoom was launched by tapping or by pressing volume key. - */ + * @param aViewingMode :if the image is opened from imgviewer or not + */ IMPORT_C void ActivateL(TInt aIntialZoomRatio,TZoomStartMode aStartMode,TInt aFocusIndex, - TGlxMedia& aItem, TPoint* aZoomFocus = NULL); + TGlxMedia& aItem, TPoint* aZoomFocus = NULL + ,TBool aViewingMode = EFalse); /** * Hide the control and disable zooming. @@ -252,7 +254,7 @@ CGlxTv* iGlxTvOut; CPeriodic* iTimer; TBool iZoomIn; - TBool iIsHDMIconnected; + }; #endif // C_GLXZOOMCONTROL_H diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/inc/glxzoomeventhandler.h --- a/photosgallery/viewframework/views/zoomview/inc/glxzoomeventhandler.h Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/inc/glxzoomeventhandler.h Fri Feb 19 22:51:01 2010 +0200 @@ -113,18 +113,41 @@ */ void HandleDragEvent(const GestureHelper::MGestureEvent& aEvent ); + /** + * Handle the Pinch events for panning + */ void HandlePinchEventL(const GestureHelper::MGestureEvent& aEvent); + /** + * Handle the Double Tap events for panning + */ void HandleDoubleTap(const GestureHelper::MGestureEvent& aEvent ); + /** + * Handle the Single Tap events for panning + */ void HandleSingleTap(const GestureHelper::MGestureEvent& aEvent ); + /** + * Handle the Gesture Released events for panning + */ void HandleGestureReleased(const GestureHelper::MGestureEvent& aEvent ); + /** + * Remembers the previous events code. + */ void SetPreviousEventCode(const GestureHelper::TGestureCode code ); + /** + * Handle a multitouch gesture released event. + */ void HandleMultiTouchReleased(); + /** + * Bring back zoom state to minimum. + */ + void ZoomToMinimumL(); + private: /* * Constructor @@ -142,20 +165,10 @@ TBool HandlekeyEvents(const TAlfEvent &aEvent); /** - * Callback function for zoom - */ - static TInt ZoomIntervalExpired(TAny* aPtr); - - /** * Callback function for pan */ static TInt PanIntervalExpired(TAny* aPtr); - /** - * Start zoom in/out continously - */ - void DoZoom(); - // Zoom by the next zoom increment. // aZoomMode is ignored if aExpectedZoomLevel has a positive value void Zoom(TInt aExpectedZoomLevel, TInt aRelativeZoomFactor, TZoomMode aZoomMode = EZoomIn, TPoint* aZoomFocus = NULL); @@ -165,11 +178,6 @@ void DoPan(); /** - * Starts the timer for continous zooming - */ - void StartZoomTimer(); - - /** * Starts the timer for continous Panning */ void StartPanTimer(); @@ -193,13 +201,6 @@ static TInt ZoomOutTimerL(TAny* aSelf); /** - * Handle zoom key pressed or released. - * @param aZoomIn :ETrue for Zoom In key, EFalse for Zoom Out key - * @param aEventCode :Type of key event. - */ - void HandleZoomKey(TZoomMode aZoomMode, const TEventCode aEventCode); - - /** * Handle the key events for panning * @param aPanDirection: Specifies the pan direction * @param aEvent : Specifies the event values. @@ -270,7 +271,7 @@ TPoint iStartDisplayPoint; // The variable holds the starting pointer posistion to determine the Drag Distance TTime iDoubleTap; // This Variable is used to determine the double tap,by using the difference of the time // between subsequent single Tap. - // [todo] do we need this variable to be at a class level + TInt iInitialZoomRatio; TInt iZoomRatio; TRect iDoubleTapRect; // This varaible holds the rect for the Double Tap TBool iDragOngoing; // Is a drag event ongoing diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp --- a/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -114,7 +114,6 @@ // Hide the Zoom at the construction ShowZoom(EFalse); iZoomActive = EFalse; - iIsHDMIconnected = EFalse; //To know if HDMi cable is connected. iGlxTvOut = CGlxTv::NewL(*this); @@ -274,7 +273,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C void CGlxZoomControl::ActivateL(TInt aInitialZoomRatio, TZoomStartMode aStartMode, - TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus) + TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus,TBool aViewingMode) { TRACER("CGlxZoomControl::ActivateL()"); @@ -293,9 +292,8 @@ iImageVisual->SetImage(*iImageTexture); - if(iGlxTvOut->IsHDMIConnected()) + if(iGlxTvOut->IsHDMIConnected()&& !aViewingMode ) { - iIsHDMIconnected = ETrue; StartZoomAnimation(); } else @@ -416,8 +414,7 @@ EXPORT_C void CGlxZoomControl::Deactivate() { TRACER("CGlxZoomControl::Deactivate()"); - iIsHDMIconnected = EFalse; - + if ( iZoomActive ) { if(iTimer->IsActive()) @@ -891,12 +888,15 @@ void CGlxZoomControl::HandleTvStatusChangedL( TTvChangeType aChangeType ) { TRACER("CGlxZoomControl::HandleTvStatusChangedL()"); - if ( aChangeType == ETvConnectionChanged && !iIsHDMIconnected && iZoomActive) + if ( aChangeType == ETvConnectionChanged ) { - if ( iGlxTvOut->IsHDMIConnected() ) + if ( iGlxTvOut->IsHDMIConnected() && iZoomActive) { - //go to fullscreen. - HandleZoomOutL(KGlxZoomOutCommand); + //initialise all the zoom values to full-screen when hdmi is connected. + if(iEventHandler) + { + iEventHandler->ZoomToMinimumL(); + } } } } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp --- a/photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -236,24 +236,6 @@ } } - -//---------------------------------------------------------------------------------- -// StartZoomTimer:Starts the Zoom timer for continous zoom -//---------------------------------------------------------------------------------- -// -void CGlxZoomPanEventHandler::StartZoomTimer() - { - TRACER("CGlxZoomPanEventHandler::StartZoomTimer"); - - if (iZoomPanTimer->IsActive()) - { - iZoomPanTimer->Cancel(); - } - iZoomPanTimer->Start( KTimerLengthInMicroseconds, - KTimerLengthInMicroseconds, - TCallBack( ZoomIntervalExpired,(TAny*)this) ); - } - //---------------------------------------------------------------------------------- // StartPanTimer:Starts the Pan timer for continous Panning //---------------------------------------------------------------------------------- @@ -405,28 +387,7 @@ HandleZoomStripeAction(EZoomOut,aEvent.Code()); consumed = ETrue; break ; - } - case EStdKeyIncVolume : - case EKeyZoomIn : - case EStdKeyNkpAsterisk : - { - GLX_LOG_INFO1("CGlxZoomControl::HandlekeyEvents VLUP=%d", aEvent.KeyEvent().iScanCode ); - if (iZoomActivated) - { - HandleZoomKey(EZoomIn, aEvent.Code()); - } - consumed = ETrue; - break; - } - case EStdKeyDecVolume : - case EKeyZoomOut : - case EStdKeyHash : - { - GLX_LOG_INFO1("CGlxZoomControl::HandlekeyEvents VLUP_D=%d", aEvent.KeyEvent().iScanCode ); - HandleZoomKey(EZoomOut, aEvent.Code()); - consumed = ETrue; - break; - } + } default: break; } @@ -436,29 +397,6 @@ } // ----------------------------------------------------------------------------- -// HandleZoomKey:Starts the Timer for contionous zoom -// ----------------------------------------------------------------------------- -// -void CGlxZoomPanEventHandler::HandleZoomKey(TZoomMode aZoomMode ,const TEventCode aEventCode ) - { - TRACER("CGlxZoomControl::HandleZoomKey "); - - if ( EEventKeyDown == aEventCode ) - { - CancelUITimer(); - iZoomEventHandler.HandleShowUi(ETrue); - iZoomMode = aZoomMode ; - StartZoomTimer(); - } - else if ( EEventKeyUp == aEventCode ) - { - CancelZoomPanTimer(); - StartUITimer(KGlxScreenTimeout,KGlxScreenTimeout,TCallBack( - UiTimeOut,this )) ; - } - } - -// ----------------------------------------------------------------------------- // HandleZoomStripeAction:Zooms the image on zoom stripe action. // ----------------------------------------------------------------------------- // @@ -847,18 +785,6 @@ } //---------------------------------------------------------------------------------- -// ZoomTimerCallback:Callback function for the Zoom timer -//---------------------------------------------------------------------------------- -// -TInt CGlxZoomPanEventHandler::ZoomIntervalExpired(TAny* aPtr) - { - TRACER("CGlxZoomControl::ZoomIntervalExpired "); - CGlxZoomPanEventHandler* self = static_cast(aPtr); - self->DoZoom(); - return 0; // Timer has finished - } - -//---------------------------------------------------------------------------------- // PanIntervalExpired:Callback function for the pan timer //---------------------------------------------------------------------------------- // @@ -871,16 +797,6 @@ return 0; // Timer has finished } -//---------------------------------------------------------------------------------- -// DoZoom:calls zooming function and updates the slider value -//---------------------------------------------------------------------------------- -// -void CGlxZoomPanEventHandler::DoZoom() - { - TRACER("CGlxZoomPanEventHandler::DoZoom "); - Zoom(0, 0, iZoomMode); - } - //---------------------------------------------------------------------------------- // DoPan:calls Panning function. @@ -913,9 +829,9 @@ { TRACER("CGlxZoomPanEventHandler::OrientationChanged "); + iMathsEngine.OrientationChanged(aNewScreenRect); // Needs to be called before Call to Zoom() inorder to Update the iScreenSize. + Zoom(0, 0, iZoomMode) ; - - iMathsEngine.OrientationChanged(aNewScreenRect); } // ----------------------------------------------------------------------------- @@ -952,7 +868,7 @@ // ActivateZoom // ----------------------------------------------------------------------------- // -void CGlxZoomPanEventHandler::ActivateZoom(TInt /*aInitialZoomRatio*/, +void CGlxZoomPanEventHandler::ActivateZoom(TInt aInitialZoomRatio, TSize aImageSize, TZoomStartMode aStartMode, TInt aMinSliderRange, @@ -975,6 +891,8 @@ // Minimum and Maximum Zoom Ratio iMinZoomRatio = iZoomRatio = aMinSliderRange; iMaxZoomRatio = aMaxSliderRange ; + + iInitialZoomRatio = aInitialZoomRatio; iMathsEngine.Initialize(center, screenSize, @@ -992,7 +910,12 @@ { case EZoomStartKey : { - StartZoomTimer(); + // Fix for issue EPKA-7ZX8FR: Vasco_wk03: Zoom In Key (Volume Up Key), + // gradually Zooms the image to full extent on a single click. + + // We are not getting keyup event which cancle the timer so not + // starting timer to do zoom + Zoom(0, 0, iZoomMode); } break; case EZoomStartDoubleTap : @@ -1048,7 +971,7 @@ // Todo: Combine both these HandleEvents TBool CGlxZoomPanEventHandler::HandleEvent( const TAlfEvent& aEvent ) { - TRACER("CGlxZoomControl::HandleEvent()"); + TRACER("CGlxZoomPanEventHandler::HandleEvent()"); TBool eventHandledState = EFalse; @@ -1123,7 +1046,7 @@ // TBool CGlxZoomPanEventHandler::HandleEventL(const TAlfEvent &aEvent) { - TRACER("CGlxZoomControl::HandleEventL()"); + TRACER("CGlxZoomPanEventHandler::HandleEventL()"); TBool consumed = EFalse; @@ -1145,14 +1068,25 @@ // ----------------------------------------------------------------------------- +// ZoomToMinimum +// ----------------------------------------------------------------------------- +// +void CGlxZoomPanEventHandler::ZoomToMinimumL() + { + TRACER("CGlxZoomPanEventHandler::ZoomToMinimumL( )"); + + Zoom(iInitialZoomRatio, 0, EZoomOut); + CallZoomOutL(); + } + + +// ----------------------------------------------------------------------------- // Zoom // ----------------------------------------------------------------------------- // - - void CGlxZoomPanEventHandler::Zoom(TInt aExpectedZoomLevel, TInt aRelativeZoomFactor, TZoomMode aZoomMode, TPoint* aZoomFocus) { - TRACER("CGlxZoomControl::ZoomL( )"); + TRACER("CGlxZoomPanEventHandler::ZoomL( )"); TPoint viewPortTopLeft(0,0); TSize viewPortDimension(0,0); diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/visuallistmanager/src/glxvisuallistmanager.cpp --- a/photosgallery/viewframework/visuallistmanager/src/glxvisuallistmanager.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/visuallistmanager/src/glxvisuallistmanager.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -69,7 +69,7 @@ CGlxVlmTls* tls = reinterpret_cast(Dll::Tls()); // Create tls struct if does not exist - if (tls == NULL) + if ( !tls ) { // Create list manager instance CGlxVisualListManager* lm = new (ELeave) CGlxVisualListManager(); @@ -101,7 +101,7 @@ __ASSERT_DEBUG(tls != NULL, Panic(EGlxPanicLogicError)); __ASSERT_DEBUG(tls->iReferenceCount > 0, Panic(EGlxPanicLogicError)); // There's nothign to close - if (tls != NULL) + if ( tls ) { tls->iReferenceCount--; @@ -200,7 +200,7 @@ { TRACER("CGlxVisualListManager::ReleaseList"); GLX_LOG_INFO("CGlxVisualListManager::ReleaseList"); - if (aList == NULL) + if ( !aList ) { return; } diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp --- a/photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -118,7 +118,7 @@ // media will be null if aMedia's Properties are not available // so furtur operation need to be cancle - if ( iMediaList->Item( aIndex ).Properties() == NULL) + if ( !iMediaList->Item( aIndex ).Properties() ) { texture = &iUiUtility->Env()->TextureManager().BlankTexture(); }