# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286969529 -10800 # Node ID 01504893d9cb0dd7c4fe1dd376bd71d5e0656e12 # Parent 5b238bc8ffb637aa38c7082fdb09952c515ca5bc Revision: 201039 Kit: 201041 diff -r 5b238bc8ffb6 -r 01504893d9cb photos_plat/gallery_utilities_api/inc/glxmediageneraldefs.h --- a/photos_plat/gallery_utilities_api/inc/glxmediageneraldefs.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photos_plat/gallery_utilities_api/inc/glxmediageneraldefs.h Wed Oct 13 14:32:09 2010 +0300 @@ -114,9 +114,4 @@ EGlxDrmRightsValid, EGlxDrmRightsInvalid }; - -// Maximum length of a media pop-up text -// Example, Album/Tag/Title/Description's length is set to 40 chars maximum -const TInt KMaxMediaPopupTextLength = 40; - #endif // __T_GLXMEDIAGENERALDEFS_H__ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp --- a/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -314,10 +314,6 @@ { __ASSERT_DEBUG((EGlxFilterImage == aFilterProperties.iItemType), Panic( EGlxPanicIllegalArgument)); - - CMdEPropertyDef& drmProperty = DataSource()->ImageDef().GetPropertyDefL(MdeConstants::MediaObject::KDRMProperty); - CMdEPropertyCondition& drmPropertyCondition = aLogicCondition.AddPropertyConditionL(drmProperty); - drmPropertyCondition.SetNegate(ETrue); } if( aFilterProperties.iPath ) // If this is set. Then we need to filter on the Ids it supplies diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/common/src/glxfilterfactory.cpp --- a/photosgallery/common/src/glxfilterfactory.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/common/src/glxfilterfactory.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -230,20 +230,16 @@ // Creates a filter most suited for the SlideShow // --------------------------------------------------------------------------- // -EXPORT_C CMPXFilter* TGlxFilterFactory::CreateSlideShowFilterFromExistingFilterL( - CMPXFilter* aOriginalFilter, CMPXCollectionPath* aSelectedListPath, - TBool aReverseSortDirection) - { +EXPORT_C CMPXFilter* TGlxFilterFactory::CreateSlideShowFilterFromExistingFilterL( CMPXFilter* aOriginalFilter, + CMPXCollectionPath* aSelectedListPath, + TBool aReverseSortDirection) + { TGlxFilterProperties filterProperties; - // Ref:NShwSlideshow::TPlayDirection - // EPlayForwards = 0; Chronological Order (Older to newer) - // EPlayBackwards = 1; Reverse Chronological Order (Newer to older) - filterProperties.iSortDirection = aReverseSortDirection ? - EGlxFilterSortDirectionNotUsed : EGlxFilterSortDirectionReverse; + filterProperties.iSortDirection = aReverseSortDirection ? EGlxFilterSortDirectionReverse : EGlxFilterSortDirectionNotUsed; filterProperties.iItemType = EGlxFilterImage; filterProperties.iPath = aSelectedListPath; - filterProperties.iNoDRM = ETrue; - filterProperties.iExcludeAnimation = ETrue; + filterProperties.iNoDRM = ETrue;; + filterProperties.iExcludeAnimation = ETrue;; return CreateCombinedFilterL(filterProperties, aOriginalFilter); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/data/glxfetcherdialog.rss --- a/photosgallery/controllers/fetcher/data/glxfetcherdialog.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/data/glxfetcherdialog.rss Wed Oct 13 14:32:09 2010 +0300 @@ -152,19 +152,79 @@ }; } -RESOURCE DIALOG r_glx_fetcher_dialog - { - // blocking dialog with CBA and no border please - flags=EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | - EEikDialogFlagCbaButtons | EEikDialogFlagWait | - EEikDialogFlagNoBackgroundFade |EEikDialogFlagNoBorder; - buttons = R_AVKON_SOFTKEYS_CANCEL; - // Do not add any items - } +RESOURCE MENU_BAR r_multiselect_ok_menubar + { + titles= + { + MENU_TITLE { menu_pane=r_multiselect_ok_menu; txt=""; } + }; + } + + +RESOURCE MENU_PANE r_multiselect_ok_menu + { + items= + { + MENU_ITEM + { + command=EAknSoftkeySelect; + txt = qtn_cffh_options_select; + }, -RESOURCE TBUF r_glx_softkey_cancel - {buf = text_softkey_cancel;} + MENU_ITEM + { + command=EGlxCmdSelectMarked; + txt = qtn_cffh_select_marked; + }, + MENU_ITEM + { + command = EGlxCmdStartMultipleMarking; + txt = qtn_lgal_options_mark_multi; + }, + MENU_ITEM + { + command=EGlxCmdMarkingSubmenu; + txt = qtn_options_list; + cascade = r_multiselect_marking_submenu; + } + }; + } + + +//End of MultiSelect + +RESOURCE DIALOG r_modal_single_dialog + { + // blocking dialog with CBA and no border please + flags=EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | + EEikDialogFlagCbaButtons | EEikDialogFlagWait | + EEikDialogFlagNoBackgroundFade |EEikDialogFlagNoBorder; + buttons = R_AVKON_SOFTKEYS_CANCEL; + // Do not add any items + } + +RESOURCE DIALOG r_modal_multi_dialog + { + // blocking dialog with CBA and no border please + flags=EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | + EEikDialogFlagCbaButtons | EEikDialogFlagWait | + EEikDialogFlagNoBackgroundFade |EEikDialogFlagNoBorder; + buttons = R_AVKON_SOFTKEYS_CANCEL; + // Do not add any items + } + +RESOURCE TBUF r_glx_softkey_cancel { buf = text_softkey_cancel; } RESOURCE TBUF r_glx_marking_mark - {buf=qtn_msk_mark;} + { buf=qtn_msk_mark; } +// custom CBA resource for options - ok options menu - cancel +RESOURCE CBA r_glx_softkeys_options_cancel_context + { + buttons = + { + CBA_BUTTON { id=EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id=EAknSoftkeyCancel; txt = text_softkey_cancel; }, + CBA_BUTTON { id=EAknSoftkeyContextOptions; txt = text_softkey_option; } + }; + } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/inc/glxfetchercontainer.h --- a/photosgallery/controllers/fetcher/inc/glxfetchercontainer.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/inc/glxfetchercontainer.h Wed Oct 13 14:32:09 2010 +0300 @@ -178,7 +178,7 @@ /** * Set the Icons */ - void SetIconsL(TInt aIndex); + void SetIconsL(TInt index); /** * This doesnt add up any value to the code, just to satisfy the compiler diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/inc/glxfetcherdialog.h --- a/photosgallery/controllers/fetcher/inc/glxfetcherdialog.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/inc/glxfetcherdialog.h Wed Oct 13 14:32:09 2010 +0300 @@ -75,7 +75,12 @@ * @ref CEikDialog */ TBool OkToExitL(TInt aKeycode); - + + /** + * From MEikMenuObserver + */ + void DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane) ; + protected: // From CAknDialog /** * From MEikMenuObserver @@ -121,6 +126,9 @@ */ SEikControlInfo CreateCustomControlL(TInt aControlType); + private: // CAknDialog + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + private:// From MGlxEventObserver virtual void HandleDoubleTapEventL(TInt aCommandId); @@ -137,10 +145,12 @@ */ void HandleMMCRemovalL(); + private: CGlxFetcherContainer* iFetcherContainer ; //Container Object CGlxUiUtility* iUiUtility; // UiUtility - + CAlfEnv* iEnv; // Alf Environment + // Selected items array // Not Own. Owned by the client CDesCArray& iSelectedFiles; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/src/glxfetcher.cpp --- a/photosgallery/controllers/fetcher/src/glxfetcher.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/src/glxfetcher.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -199,11 +199,18 @@ } } // create the dialog first - iDialog = CGlxFetcherDialog::NewL(aSelectedFiles, iVerifier, iFilterType, - *iTitle, iIsMultiSelection); + iDialog = + CGlxFetcherDialog::NewL( aSelectedFiles, iVerifier ,iFilterType ,*iTitle, iIsMultiSelection ); // Returns zero when Fetcher is cancelled by User. - buttonId = iDialog->ExecuteLD( R_GLX_FETCHER_DIALOG ); + if( iIsMultiSelection ) + { + buttonId = iDialog->ExecuteLD( R_MODAL_MULTI_DIALOG ); + } + else + { + buttonId = iDialog->ExecuteLD( R_MODAL_SINGLE_DIALOG ); + } // Return false if the fetcher was canceled by user return ( 0 != buttonId && aSelectedFiles.Count()!=0); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/src/glxfetchercontainer.cpp --- a/photosgallery/controllers/fetcher/src/glxfetchercontainer.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/src/glxfetchercontainer.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -32,6 +32,7 @@ #include // Background Context #include // KGlxFetchontextPriorityNormal and KGlxIconsFilename +#include // All item collection plugin id #include // For Filters required in Medilaits #include // for CGlxResourceUtilities #include // FOR GETTING Dialog ID AND RESOURCE ID @@ -57,6 +58,11 @@ #include "glxfetchercommandhandler.h" const TInt KPadding(7); +const TInt KNoOfPages(4); +const TInt KBufferTreshold(1); +const TInt KItemsPerPage(18); +const TInt KBufferSize(KNoOfPages * KItemsPerPage); +const TInt KBufferTresholdSize(KBufferTreshold * KItemsPerPage); //----------------------------------------------------------------------------- // Two-phased constructor. @@ -137,6 +143,7 @@ } } + // --------------------------------------------------------------------------- // CreateAndDisplayGridL // --------------------------------------------------------------------------- @@ -162,7 +169,6 @@ iMultipleMarkNotStarted = EFalse; } } - // --------------------------------------------------------------------------- // CreateMediaListL() // Creates a collection path @@ -193,7 +199,6 @@ CleanupStack::PopAndDestroy( path ); } - // --------------------------------------------------------------------------- // CreateHgGridWidgetL // --------------------------------------------------------------------------- @@ -247,9 +252,7 @@ // This Displays the scrollbar at the opening of the Grid view iHgGrid->SetScrollBarTypeL(CHgScroller::EHgScrollerTimeStrip ); // Enable Buffer support - iHgGrid->EnableScrollBufferL(*this, (KNoOfPages - * iUiUtility->VisibleItemsInPageGranularityL()), - KBufferTresholdSize); + iHgGrid->EnableScrollBufferL(*this, KBufferSize, KBufferTresholdSize); // Enable Marking support iHgGrid->SetMarkingObserver(*this); @@ -262,12 +265,12 @@ // void CGlxFetcherContainer::CreateGridMediaListObserverL() { - iGlxGridMLObserver = CGlxGridViewMLObserver::NewL(*this, *iMediaList, - iHgGrid, iFilterType); + iGlxGridMLObserver = CGlxGridViewMLObserver::NewL(*iMediaList, iHgGrid, + iFilterType); } // --------------------------------------------------------------------------- -// Request +// BufferPositionChanged // --------------------------------------------------------------------------- // void CGlxFetcherContainer::Request(TInt aRequestStart, TInt aRequestEnd, @@ -276,7 +279,6 @@ TRACER("CGlxFetcherContainer::Request()"); TRAP_IGNORE(RequestL( aRequestStart, aRequestEnd )); } - // --------------------------------------------------------------------------- // RequestL // --------------------------------------------------------------------------- @@ -301,7 +303,7 @@ visIndex = 0; } - GLX_LOG_INFO1("CGlxFetcherContainer::Request - SetVisibleWindowIndex " + GLX_LOG_INFO1("CGlxGridViewImp::Request - SetVisibleWindowIndex " "visIndex(%d)", visIndex); iMediaList->SetVisibleWindowIndexL(visIndex); } @@ -312,14 +314,13 @@ TInt lastOnScreen = firstIndex + iHgGrid->ItemsOnScreen() - 1; if (i >= firstIndex && i <= lastOnScreen) { - GLX_LOG_INFO1("CGlxFetcherContainer::Request - RefreshScreen i(%d)", i); + GLX_LOG_INFO1("CGlxGridViewImp::Request - RefreshScreen i(%d)", i); iHgGrid->RefreshScreen(i); } } } - // --------------------------------------------------------------------------- -// SetIconsL +// SetIcons // --------------------------------------------------------------------------- // void CGlxFetcherContainer::SetIconsL(TInt aIndex) @@ -342,11 +343,11 @@ CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; bitmap->Duplicate( value->iBitmap->Handle()); iHgGrid->ItemL(aIndex).SetIcon(CGulIcon::NewL(bitmap)); - GLX_LOG_INFO1("### CGlxFetcherContainer::Request value-Index is %d",aIndex); + GLX_LOG_INFO1("### CGlxGridViewImp::Request value-Index is %d",aIndex); } else if (item.GetIconInfo(icon)) { - GLX_LOG_INFO1("CGlxFetcherContainer::Request - icon(%d)", aIndex); + GLX_LOG_INFO1("CGlxGridViewImp::Request - icon(%d)", aIndex); CFbsBitmap* bitmap = NULL; CFbsBitmap* mask = NULL; AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone, @@ -362,13 +363,13 @@ iHgGrid->ItemL(aIndex).SetIcon(CGulIcon::NewL(bitmap, mask)); CleanupStack::Pop(mask); CleanupStack::Pop(bitmap); - GLX_LOG_INFO1("### CGlxFetcherContainer::Request GetIconInfo-Index is %d", + GLX_LOG_INFO1("### CGlxGridViewImp::Request GetIconInfo-Index is %d", aIndex); } else if (KErrNone != tnError && KErrNotSupported != tnError) { GLX_LOG_INFO2( - "CGlxFetcherContainer::Request - image_corrupted tnError(%d), " + "CGlxGridViewImp::Request - image_corrupted tnError(%d), " "i(%d)", tnError, aIndex); CFbsBitmap* bitmap = NULL; @@ -440,29 +441,22 @@ } // --------------------------------------------------------------------------- -// HandleSelectL +// HandleSelect // --------------------------------------------------------------------------- // void CGlxFetcherContainer::HandleSelectL( TInt aIndex ) { - TRACER("CGlxFetcherContainer::HandleSelectL()"); - GLX_LOG_INFO1("CGlxFetcherContainer::HandleSelectL(%d)", aIndex); + TRACER("CGlxGridViewImp::HandleSelect()"); // Make sure that the Selection Index is inside medialist count - if (aIndex < iMediaList->Count() && aIndex >= 0) + if (aIndex Count() && aIndex >=0) { // Setting the focus of the medialist - iMediaList->SetFocusL(NGlxListDefs::EAbsolute, aIndex); - - //Show Left Soft Key when media is selected - CEikButtonGroupContainer* cbaContainer = - CEikButtonGroupContainer::Current(); - cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_OK_CANCEL); - cbaContainer->DrawDeferred(); + iMediaList->SetFocusL(NGlxListDefs::EAbsolute, aIndex); } } // --------------------------------------------------------------------------- -// HandleOpenL +// HandleOpen // --------------------------------------------------------------------------- // void CGlxFetcherContainer::HandleOpenL( TInt aIndex ) @@ -488,7 +482,7 @@ // void CGlxFetcherContainer::HandleMarkingL( TInt aIndex, TBool/* aMarked*/ ) { - TRACER("CGlxFetcherContainer::HandleMarkingL()"); + TRACER("CGlxGridViewImp::HandleMarkingL()"); HandleMultipleMarkingL(aIndex); iEventObserver.HandleMarkEventL(); } @@ -499,7 +493,7 @@ // void CGlxFetcherContainer::HandleMultipleMarkingL(TInt aIndex ) { - TRACER("CGlxFetcherContainer::HandleMultipleMarkingL()"); + TRACER("CGlxGridViewImp::HandleMultipleMarkingL()"); if(iMediaList->IsSelected(aIndex)) { if(iHgGrid) @@ -609,6 +603,7 @@ return retVal; } + // ----------------------------------------------------------------------------- // Retrieve Uris // ----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/fetcher/src/glxfetcherdialog.cpp --- a/photosgallery/controllers/fetcher/src/glxfetcherdialog.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/fetcher/src/glxfetcherdialog.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -142,6 +142,7 @@ // Get the Hitchcock environment. iUiUtility = CGlxUiUtility::UtilityL(); + iEnv = iUiUtility->Env(); iFetchUri = EFalse; iMMCNotifier = CGlxMMCNotifier::NewL(*this); } @@ -207,7 +208,6 @@ } } } - //----------------------------------------------------------------------------- // CGlxFetcherDialog::OkToExitL //----------------------------------------------------------------------------- @@ -394,6 +394,16 @@ } //----------------------------------------------------------------------------- +// CGlxFetcherDialog::DynInitMenuPaneL +//----------------------------------------------------------------------------- +void CGlxFetcherDialog::DynInitMenuPaneL( + TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ ) + { + TRACER("CGlxFetcherDialog::DynInitMenuPaneL"); + // No Implementation + } + +//----------------------------------------------------------------------------- // CGlxFetcherDialog::OfferKeyEventL //----------------------------------------------------------------------------- TKeyResponse CGlxFetcherDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, @@ -404,15 +414,28 @@ response = iFetcherContainer->OfferKeyEventL(aKeyEvent,aType); if(response == EKeyWasNotConsumed) - { response = CAknDialog::OfferKeyEventL(aKeyEvent,aType); - } return response; } //----------------------------------------------------------------------------- -// CGlxFetcherDialog::HandleDoubleTapEventL +// CGlxFetcherDialog::HandlePointerEventL +// Handles all pointer events to the screen. +// Offers the events to the primary display control (container - widgets) +// and also finally calls handlescreenbufferevent and draws the bitmap onto +// the screen +//----------------------------------------------------------------------------- +void CGlxFetcherDialog::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + TRACER("CGlxFetcherDialog::HandlePointerEventL"); + CCoeControl::HandlePointerEventL( aPointerEvent ); + iEnv->PrimaryDisplay().HandlePointerEventL( aPointerEvent ); + } + +//----------------------------------------------------------------------------- +// CGlxFetcherDialog::HandleDoubleTapEvent // Callback from the container for double tap events // Offers the event from container to Dialog //----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/imageviewer/bwins/glximageviewermanageru.def --- a/photosgallery/controllers/imageviewer/bwins/glximageviewermanageru.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/imageviewer/bwins/glximageviewermanageru.def Wed Oct 13 14:32:09 2010 +0300 @@ -1,13 +1,11 @@ EXPORTS - ?SetImageUriL@CGlxImageViewerManager@@QAEXABVTDesC16@@@Z @ 1 NONAME ; void CGlxImageViewerManager::SetImageUriL(class TDesC16 const &) - ?CloseImageDecoder@CGlxImageViewerManager@@QAEXXZ @ 2 NONAME ; void CGlxImageViewerManager::CloseImageDecoder(void) - ?Reset@CGlxImageViewerManager@@QAEXXZ @ 3 NONAME ; void CGlxImageViewerManager::Reset(void) - ?ImageUri@CGlxImageViewerManager@@QAEPAVHBufC16@@XZ @ 4 NONAME ; class HBufC16 * CGlxImageViewerManager::ImageUri(void) - ?ImageFileHandle@CGlxImageViewerManager@@QAEAAVRFile64@@XZ @ 5 NONAME ; class RFile64 & CGlxImageViewerManager::ImageFileHandle(void) - ?InstanceL@CGlxImageViewerManager@@SAPAV1@XZ @ 6 NONAME ; class CGlxImageViewerManager * CGlxImageViewerManager::InstanceL(void) - ?CreateImageDecoderL@CGlxImageViewerManager@@QAEXXZ @ 7 NONAME ; void CGlxImageViewerManager::CreateImageDecoderL(void) - ?SetImageFileHandleL@CGlxImageViewerManager@@QAEXABVRFile@@@Z @ 8 NONAME ; void CGlxImageViewerManager::SetImageFileHandleL(class RFile const &) - ?DeleteInstance@CGlxImageViewerManager@@QAEXXZ @ 9 NONAME ; void CGlxImageViewerManager::DeleteInstance(void) - ?IsPrivate@CGlxImageViewerManager@@QAEHXZ @ 10 NONAME ; int CGlxImageViewerManager::IsPrivate(void) - ?IsPrivateGif@CGlxImageViewerManager@@QAEHXZ @ 11 NONAME ; int CGlxImageViewerManager::IsPrivateGif(void) + ?SetImageFileHandleL@CGlxImageViewerManager@@QAEXABVRFile@@@Z @ 1 NONAME ; void CGlxImageViewerManager::SetImageFileHandleL(class RFile const &) + ?SetImageUriL@CGlxImageViewerManager@@QAEXABVTDesC16@@@Z @ 2 NONAME ; void CGlxImageViewerManager::SetImageUriL(class TDesC16 const &) + ?DeleteInstance@CGlxImageViewerManager@@QAEXXZ @ 3 NONAME ; void CGlxImageViewerManager::DeleteInstance(void) + ?Reset@CGlxImageViewerManager@@QAEXXZ @ 4 NONAME ; void CGlxImageViewerManager::Reset(void) + ?IsPrivate@CGlxImageViewerManager@@QAEHXZ @ 5 NONAME ; int CGlxImageViewerManager::IsPrivate(void) + ?ImageUri@CGlxImageViewerManager@@QAEPAVHBufC16@@XZ @ 6 NONAME ; class HBufC16 * CGlxImageViewerManager::ImageUri(void) + ?ImageFileHandle@CGlxImageViewerManager@@QAEAAVRFile64@@XZ @ 7 NONAME ; class RFile64 & CGlxImageViewerManager::ImageFileHandle(void) + ?InstanceL@CGlxImageViewerManager@@SAPAV1@XZ @ 8 NONAME ; class CGlxImageViewerManager * CGlxImageViewerManager::InstanceL(void) + ?IsPrivateGif@CGlxImageViewerManager@@QAEHXZ @ 9 NONAME ; int CGlxImageViewerManager::IsPrivateGif(void) diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/imageviewer/eabi/glximageviewermanageru.def --- a/photosgallery/controllers/imageviewer/eabi/glximageviewermanageru.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/imageviewer/eabi/glximageviewermanageru.def Wed Oct 13 14:32:09 2010 +0300 @@ -1,15 +1,13 @@ EXPORTS - _ZN22CGlxImageViewerManager12IsPrivateGifEv @ 1 NONAME - _ZN22CGlxImageViewerManager12SetImageUriLERK7TDesC16 @ 2 NONAME - _ZN22CGlxImageViewerManager14DeleteInstanceEv @ 3 NONAME - _ZN22CGlxImageViewerManager15ImageFileHandleEv @ 4 NONAME - _ZN22CGlxImageViewerManager17CloseImageDecoderEv @ 5 NONAME - _ZN22CGlxImageViewerManager19CreateImageDecoderLEv @ 6 NONAME - _ZN22CGlxImageViewerManager19SetImageFileHandleLERK5RFile @ 7 NONAME - _ZN22CGlxImageViewerManager5ResetEv @ 8 NONAME - _ZN22CGlxImageViewerManager8ImageUriEv @ 9 NONAME - _ZN22CGlxImageViewerManager9InstanceLEv @ 10 NONAME - _ZN22CGlxImageViewerManager9IsPrivateEv @ 11 NONAME - _ZTI22CGlxImageViewerManager @ 12 NONAME - _ZTV22CGlxImageViewerManager @ 13 NONAME + _ZN22CGlxImageViewerManager12SetImageUriLERK7TDesC16 @ 1 NONAME + _ZN22CGlxImageViewerManager14DeleteInstanceEv @ 2 NONAME + _ZN22CGlxImageViewerManager15ImageFileHandleEv @ 3 NONAME + _ZN22CGlxImageViewerManager19SetImageFileHandleLERK5RFile @ 4 NONAME + _ZN22CGlxImageViewerManager5ResetEv @ 5 NONAME + _ZN22CGlxImageViewerManager8ImageUriEv @ 6 NONAME + _ZN22CGlxImageViewerManager9InstanceLEv @ 7 NONAME + _ZN22CGlxImageViewerManager9IsPrivateEv @ 8 NONAME + _ZTI22CGlxImageViewerManager @ 9 NONAME + _ZTV22CGlxImageViewerManager @ 10 NONAME + _ZN22CGlxImageViewerManager12IsPrivateGifEv @ 11 NONAME diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/imageviewer/group/glximageviewermanager.mmp --- a/photosgallery/controllers/imageviewer/group/glximageviewermanager.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/imageviewer/group/glximageviewermanager.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -38,12 +38,12 @@ USERINCLUDE ../inc -LIBRARY efsrv.lib -LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY euser.lib LIBRARY caf.lib // ContentAccess::CManager LIBRARY flogger.lib // For Logging Tracer LIBRARY glxcommon.lib // CGlxSingetonStore LIBRARY cone.lib // ConeUtils LIBRARY platformenv.lib // DriveInfo -LIBRARY imageconversion.lib // CImageDecoder + //EXPORTUNFROZEN \ No newline at end of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/imageviewer/inc/glximageviewermanager.h --- a/photosgallery/controllers/imageviewer/inc/glximageviewermanager.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/imageviewer/inc/glximageviewermanager.h Wed Oct 13 14:32:09 2010 +0300 @@ -23,7 +23,7 @@ #include #include #include -#include + // CLASS DECLARATION class RFile; class RFile64; @@ -55,8 +55,6 @@ IMPORT_C void SetImageUriL(const TDesC& aFileName); IMPORT_C void SetImageFileHandleL(const RFile& aFileHandle); IMPORT_C void Reset(); - IMPORT_C void CreateImageDecoderL(); - IMPORT_C void CloseImageDecoder(); private: @@ -97,9 +95,6 @@ /// Flag that stores if the gif file is in a private folder. /// ETrue means the gif is from private path, else EFalse TBool iIsPrivateGif; - - /// Image Decoder, which keeps the file in use while viewing - CImageDecoder* iImageDecoder; }; #endif // GLXIMAGEVIEWERMANAGER_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp --- a/photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -26,7 +26,6 @@ #include #include #include -#include _LIT( KPrivateFolder, "\\Private\\" ); _LIT( KGifFileMime, "image/gif" ); @@ -122,7 +121,6 @@ User::Leave(KErrNotSupported); } iImageUri = aFileName.AllocL(); - CreateImageDecoderL(); } // --------------------------------------------------------------------------- @@ -139,8 +137,6 @@ delete iFile; iFile = NULL; - CloseImageDecoder(); - if (iIsPrivateGif) { iManager->DeleteFile(iImageUri->Des()); @@ -212,51 +208,3 @@ } SetImageUriL( filePath ); } - -// --------------------------------------------------------------------------- -// CloseImageDecoder -// --------------------------------------------------------------------------- -// -EXPORT_C void CGlxImageViewerManager::CloseImageDecoder() - { - TRACER("void CGlxImageViewerManager::CloseImageDecoder()"); - if (iImageDecoder) - { - delete iImageDecoder; - iImageDecoder = NULL; - } - } - -// --------------------------------------------------------------------------- -// CreateImageDecoderL -// --------------------------------------------------------------------------- -// -EXPORT_C void CGlxImageViewerManager::CreateImageDecoderL() - { - TRACER("void CGlxImageViewerManager::CreateImageDecoderL()"); - - CloseImageDecoder(); - - TInt err = KErrNone; - if (IsPrivate()) - { - if (&ImageFileHandle()) - { - GLX_DEBUG1("CGlxImageViewerManager::CreateImageDecoderL() FH"); - TRAP(err, iImageDecoder = CImageDecoder::FileNewL( - ImageFileHandle(), ContentAccess::EPeek)); - } - } - else - { - if (ImageUri()) - { - GLX_DEBUG1("CGlxImageViewerManager::CreateImageDecoderL() FN"); - TRAP(err, iImageDecoder = CImageDecoder::FileNewL( - CCoeEnv::Static()->FsSession(), ImageUri()->Des())); - } - } - - GLX_DEBUG2("CGlxImageViewerManager::CreateImageDecoderL() err(%d)", err); - User::LeaveIfError(err); - } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/gallery/inc/glxappui.h --- a/photosgallery/gallery/inc/glxappui.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/gallery/inc/glxappui.h Wed Oct 13 14:32:09 2010 +0300 @@ -153,33 +153,25 @@ void ReserveMemoryL(TEntryType aType); //OOM - /** - * Invoked by the OOM framework FreeRam event - * to free the memory for other applications. - */ + /* + *Invoked by the OOM framwork when photos app needs to free memory for other applications. + */ void StartCleanupL(); //OOM - /** - * Invoked by the OOM framework MemoryGood event - * to stop the memory clean-up operation. - */ + /* + *Invoked by the OOM framwork when photos app needs to free memory for other applications. + */ void StopCleanupL(); - - /** + + /** * Check for updates via IAD. */ void DoCheckForIADUpdatesL(); - /** * close photos app. */ - void ClosePhotosL(); - - /** - * Open navigational state at root level - */ - void NavigateToMainListL(); + void ClosePhotosL(); private: MMPXViewUtility* iViewUtility; @@ -210,17 +202,23 @@ * IAD updater class */ CGlxIadUpdate* iIadUpdate; + + /** + *This flag to chk whether red key has been pressed + */ + TBool iEndKeyPressed; /** - * Timer to check for IAD updates 30 seconds after application startup. + *Timer to check for IAD updates 30 seconds after application startup. */ - CPeriodic* iPeriodic; + CPeriodic* iPeriodic ; + + /** + * Flag to filter any spurious EPathChanged event from MPX Collection f/w. + */ + TBool iStateChangeRequested; +} ; - /** - * Flag to filter any spurious EPathChanged event from MPX Collection f/w. - */ - TBool iStateChangeRequested; - }; #endif // C_GLXWERAPPUI_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/gallery/loc/photos.loc --- a/photosgallery/gallery/loc/photos.loc Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/gallery/loc/photos.loc Wed Oct 13 14:32:09 2010 +0300 @@ -598,12 +598,6 @@ // #define qtn_lgal_details_description "Description" -// d:Type field in the details view. -// l:list_logical_template_5_title -// r:8.0 -// -#define qtn_lgal_details_type "Type" - // d:Location field in the details view. // l:list_logical_template_5_title // r:8.0 @@ -1358,129 +1352,3 @@ // r:4.0 // #define qtn_lgal_slideshow_softkey_end "End" - -//----------------------------------------------------------------------------- -// Removal of suites view - related strings -//----------------------------------------------------------------------------- -// -// d:Icon text for "All" toolbar extn button -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_all_nc "All" - -// d:Icon text for "All" toolbar extn button -// d:%N will be replaced with count of items present in All -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_all "All (%N)" - -// d:Icon text for "Album" toolbar extn button -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_album_nc "Albums" - -// d:Icon text for "Album" toolbar extn button -// d:%N will be replaced with count of albums present -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_album "Albums (%N)" - -// d:Icon text for "Tags" toolbar extn button -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_tags_nc "Tags" - -// d:Icon text for "Tags" toolbar extn button -// d:%N will be replaced with count of tags present -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_tags "Tags (%N)" - -// d:Icon text for "Places" toolbar extn button -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_places_nc "Places" - -// d:Icon text for "Places" toolbar extn button -// d:%N will be replaced with count of places present -// l:cell_tb_ext_pane_t1/opt1 -// r:11.0 -// -#define qtn_lgal_toolbar_extension_places "Places (%N)" - -// d: Tooltip string for "Change View" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_change_view "Change View" - -// d: Tooltip string for "All" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_all "All" - -// d: Tooltip string for "Albums" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_albums "Albums" - -// d: Tooltip string for "Tags" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_tags "Tags" - -// d: Tooltip string for "places" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_places "Places" - -// d: Tooltip string for "New album" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_preview_tooltip_new_album "New album" - -// d: Tooltip string for "New tag" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_new_tag "New Tag" - -// d: Tooltip string for "Sort" toolbar item -// l: popup_preview_text_window_t1 -// r: 11.0 -#define qtn_lgal_tooltip_sort "Sort" - -// d: Options menu item to open All items in grid view -// l: list_single_pane_t1_cp2 -// r: 11.0 -#define qtn_lgal_option_all "All" - -// d: Options menu item to open Albums list view -// l: list_single_pane_t1_cp2 -// r: 11.0 -#define qtn_lgal_option_albums "Albums" - -// d: Options menu item to open Places list view -// l: list_single_pane_t1_cp2 -// r: 11.0 -#define qtn_lgal_option_places "Places" - -// d: Options menu item to open Tags cloud view -// l: list_single_pane_t1_cp2 -// r: 11.0 -#define qtn_lgal_option_tags "Tags" - -// d: "Birthday" option in select album pop-up or select tag popup -// l:list_single_pane_t1 -// r: 11.0 -#define qtn_lgal_option_birthday "Birthday" - -// d: "Personal" option in select album pop-up or select tag popup -// l:list_single_pane_t1 -// r: 11.0 -#define qtn_lgal_option_personal "Personal" diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/gallery/src/glxappui.cpp --- a/photosgallery/gallery/src/glxappui.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/gallery/src/glxappui.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -60,10 +60,6 @@ #include #include #include -#include -#include -#include -#include //OOM #include @@ -123,6 +119,7 @@ ReserveMemoryL(EEntryTypeStartUp); // publish zoom context, no zoom keys for now NGlxZoomStatePublisher::PublishStateL( EFalse ); + iEndKeyPressed = EFalse; iStateChangeRequested = EFalse; } @@ -133,6 +130,7 @@ CGlxAppUi::~CGlxAppUi() { TRACER("CGlxAppUi::~CGlxAppUi()"); + iEndKeyPressed = EFalse; if ( iNavigationalState ) { iNavigationalState->RemoveObserver(*this); @@ -245,7 +243,12 @@ TRAPD(err, HandleActivationMessageL(aCommand, aDocumentName, aTail)); if ( KErrNone != err ) { - NavigateToMainListL(); + // Open navigational state at root level + CMPXCollectionPath* newState = CMPXCollectionPath::NewL(); + CleanupStack::PushL( newState ); + iNavigationalState->NavigateToL( *newState ); + iStateChangeRequested = ETrue; + CleanupStack::PopAndDestroy( newState ); } //Start a timer to check for thr IAD update after 60 Secs. @@ -450,7 +453,12 @@ if (aData.Length() == 0 ) { - NavigateToMainListL(); + // Open navigational state at root level + CMPXCollectionPath* newState = CMPXCollectionPath::NewL(); + CleanupStack::PushL(newState); + iNavigationalState->NavigateToL(*newState); + iStateChangeRequested = ETrue; + CleanupStack::PopAndDestroy(newState); } else { @@ -460,21 +468,6 @@ } // --------------------------------------------------------------------------- -// NavigateToMainListL -// --------------------------------------------------------------------------- -// -void CGlxAppUi::NavigateToMainListL() - { - TRACER("void CGlxAppUi::NavigateToMainListL()"); - // Open navigational state at root level - CMPXCollectionPath* collPath = CMPXCollectionPath::NewL(); - CleanupStack::PushL(collPath); - iNavigationalState->NavigateToL(*collPath); - iStateChangeRequested = ETrue; - CleanupStack::PopAndDestroy(collPath); - } - -// --------------------------------------------------------------------------- // HandleActivationMessageL // --------------------------------------------------------------------------- // @@ -492,8 +485,8 @@ RDesReadStream stream(aData); CleanupClosePushL(stream); stream >> msgUid; - - switch (msgUid.iUid) + + switch ( msgUid.iUid ) { case KGlxActivationCmdShowLastModified: case KGlxActivationCameraAlbum: @@ -501,64 +494,17 @@ { GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: Creating Screen Clearer"); iUiUtility->DisplayScreenClearerL(); - HBufC8* activationParam = HBufC8::NewLC(KMaxUidName); - // While harvesting is in progress, activate the Camera Album - // instead of All grid. However, do not change the activation - // parameter as it is used within photos. activationParam->Des().AppendNum(KGlxActivationCmdShowAll); SetActivationParamL(*activationParam); CleanupStack::PopAndDestroy(activationParam); - + + // Go to All grid view + GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: All Grid View"); // Send the command to reset the view ProcessCommandL(EGlxCmdResetView); iNavigationalState->SetBackExitStatus(ETrue); - - // 1)While harvesting is going on, TNM publishes itemsleft 'PSkey' value. - // After harvesting is over, itemsleft count will be 0. - // 2)Tnm sets the value to KErrNotReady until it gets the total count while harvesting. - // TNM doesn't update the key value in batches. It updates @ a single shot. - // so need to check against KErrNotReady also. - if (iUiUtility->GetItemsLeftCount() == KErrNotReady - || iUiUtility->GetItemsLeftCount()) - { - // Go to Camera Album grid view - GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: Camera Album Grid View"); - path->AppendL(KGlxCollectionPluginAlbumsImplementationUid); - MGlxMediaList* mediaList = MGlxMediaList::InstanceL(*path); - CleanupClosePushL(*mediaList); - - TGlxSequentialIterator iter; - CGlxAttributeContext* attributeContext = - new (ELeave) CGlxAttributeContext(&iter); - CleanupStack::PushL(attributeContext); - iter.SetRange(1); - attributeContext->AddAttributeL(KMPXMediaGeneralTitle); - mediaList->AddContextL(attributeContext, - KGlxFetchContextPriorityBlocking); - TRAPD(err, GlxAttributeRetriever::RetrieveL( - *attributeContext, *mediaList, EFalse)); - if (err != KErrNone) - { - mediaList->RemoveContext(attributeContext); - User::Leave( err); - } - TInt count = mediaList->Count(); - GLX_LOG_INFO1("CGlxAppUi::HandleActivationMessageL() count=%d", count); - __ASSERT_DEBUG(count != 0, Panic(EGlxPanicRequiredItemNotFound)); - - path->AppendL(TMPXItemId(mediaList->Item(0).Id().Value())); - - mediaList->RemoveContext(attributeContext); - CleanupStack::PopAndDestroy(attributeContext); - CleanupStack::PopAndDestroy(mediaList); - } - else - { - // Go to All grid view - GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: All Grid View"); - path->AppendL(KGlxCollectionPluginAllImplementationUid); - } + path->AppendL(KGlxCollectionPluginAllImplementationUid); } break; @@ -568,10 +514,10 @@ } CleanupStack::PopAndDestroy(&stream); iNavigationalState->SetStartingLevel(path->Levels()); - iNavigationalState->NavigateToL(*path); + iNavigationalState->NavigateToL( *path ); iStateChangeRequested = ETrue; CleanupStack::PopAndDestroy(path); - + // Introduced to fix bug EMJN-78GH6N. if (0 != iEikonEnv->RootWin().OrdinalPosition()) { @@ -703,34 +649,36 @@ // Handle OOM events. // --------------------------------------------------------------------------- // -void CGlxAppUi::HandleApplicationSpecificEventL(TInt aEventType, - const TWsEvent& aWsEvent) - { - TRACER("CGlxAppUi::HandleApplicationSpecificEventL"); - GLX_LOG_INFO1("CGlxAppUi::HandleApplicationSpecificEventL() aEventType=%d", aEventType); - CAknViewAppUi::HandleApplicationSpecificEventL(aEventType, aWsEvent); - if (aWsEvent.Type() == KAknUidValueEndKeyCloseEvent) - { - ClosePhotosL(); - } - - switch (aEventType) - { - case KAppOomMonitor_FreeRam: - { - StartCleanupL(); - } - break; - case KAppOomMonitor_MemoryGood: - { - StopCleanupL(); - } - break; - default: - break; - } - } +void CGlxAppUi::HandleApplicationSpecificEventL(TInt aEventType, const TWsEvent& aWsEvent) +{ +TRACER("CGlxAppUi::HandleApplicationSpecificEventL"); +CAknViewAppUi::HandleApplicationSpecificEventL(aEventType,aWsEvent); + if(aWsEvent.Type() == KAknUidValueEndKeyCloseEvent) + { + /** + * Making the flag etrue ensures that it will not call LaunchMmViewL in handlecommandl while + * red key is pressed. Otherwise it will launch matrix menu, not idle screen. + */ + iEndKeyPressed = ETrue; + ClosePhotosL(); + } +switch(aEventType) + { + case KAppOomMonitor_FreeRam: + { + StartCleanupL(); + } + break; + case KAppOomMonitor_MemoryGood: + { + StopCleanupL(); + } + break; + default: + break; + } +} // --------------------------------------------------------------------------- // StartCleanup @@ -739,7 +687,6 @@ // void CGlxAppUi::StartCleanupL() { - TRACER("CGlxAppUi::StartCleanupL"); MGlxCache* cacheManager = MGlxCache::InstanceL(); cacheManager->ReleaseRAML(); cacheManager->Close(); @@ -752,7 +699,6 @@ // void CGlxAppUi::StopCleanupL() { - TRACER("CGlxAppUi::StopCleanupL"); MGlxCache* cacheManager = MGlxCache::InstanceL(); cacheManager->StopRAMReleaseL(); cacheManager->Close(); diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/help/data/xhtml.zip Binary file photosgallery/help/data/xhtml.zip has changed diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/imgvwr/src/glxivwrappui.cpp --- a/photosgallery/imgvwr/src/glxivwrappui.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/imgvwr/src/glxivwrappui.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -37,7 +37,7 @@ #include #include #include -#include + //constants @@ -73,13 +73,7 @@ // Enable Avkon skins. BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); - - // Hide status pane - StatusPane()->MakeVisible(EFalse); - // Hide Softkeys - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - cba->MakeVisible(EFalse); - + // Create navigational state iNavigationalState = CGlxNavigationalState::InstanceL(); iNavigationalState->AddObserverL( *this ); diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/inc/shwconstants.h --- a/photosgallery/slideshow/engine/inc/shwconstants.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/engine/inc/shwconstants.h Wed Oct 13 14:32:09 2010 +0300 @@ -34,10 +34,9 @@ { enum TPlayDirection { - // Chronological Order (Older to newer) - EPlayForwards = 0, - // Reverse Chronological Order (Newer to older) - EPlayBackwards = 1 // default + EPlayForwards = 1, // default + EPlayBackwards, + EPlayRandom }; // Named constants for navigation directions diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/bld.inf --- a/photosgallery/slideshow/engine/tsrc/group/bld.inf Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/engine/tsrc/group/bld.inf Wed Oct 13 14:32:09 2010 +0300 @@ -26,10 +26,17 @@ PRJ_EXPORTS PRJ_TESTMMPFILES +//t_cshwzoomandpaneffect.mmp t_cshwdefaulteffectmanager.mmp t_cshwtimercontrol.mmp t_cshwviewcontrol.mmp t_cshweventrouter.mmp +//t_cshwmusiccontrol.mmp +//t_cshwsettingsmodel.mmp +//t_cshweffects.mmp +//t_cshweffectcontrol.mmp +//t_cshwslideshowengine.mmp +//t_cshwplaybackfactory.mmp PRJ_MMPFILES ../../group/shwslideshowengine.mmp diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshweffectcontrol.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshweffectcontrol.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2006-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshweffectcontrol.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +SOURCEPATH ../t_cshweffectcontrol +SOURCE t_cshweffectcontrol.cpp +SOURCE t_cshweffectcontrol_dllmain.cpp + +SOURCEPATH ../stubs +SOURCE tmglxvisuallist_adapter.cpp +SOURCE stub_tglxlayoutsplitter.cpp +SOURCE tmshweffectmanager_adapter.cpp +SOURCE stub_glxfetchcontexts.cpp + +// Sources required by the test suite +SOURCEPATH ../../controlsrc +SOURCE shweffectcontrol.cpp +SOURCE shweventpublisherbase.cpp +SOURCE shwevent.cpp +SOURCEPATH ../../coresrc +SOURCE shwthumbnailloader.cpp +SOURCE shwthumbnailcontext.cpp +SOURCE shwtimer.cpp + +USERINCLUDE ../t_cshweffectcontrol +USERINCLUDE ../stubs +USERINCLUDE ../../../../viewframework/medialists/tsrc/inc + +// User include folders required by the tested code +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../controlsrc +SYSTEMINCLUDE ../../coresrc +SYSTEMINCLUDE ../../effectsrc +SYSTEMINCLUDE ../../../utils +SYSTEMINCLUDE ../../../../commonui/inc +SYSTEMINCLUDE ../../../../inc +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../viewframework/uiutilities/inc // for attribute retriever + + +// System include folders required by the tested code +APP_LAYER_SYSTEMINCLUDE + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY mpxcommon.lib +// glx dependencies +LIBRARY glxlayouts.lib + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshweffects.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshweffects.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshweffects.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +SOURCEPATH ../t_cshweffects +SOURCE t_cshweffects.cpp +SOURCE t_cshweffects_dllmain.cpp + +// Sources required by the test suite +SOURCEPATH ../../effectsrc +SOURCE shwcrossfadeeffect.cpp +SOURCE shwcrossfadelayout.cpp +SOURCE shwzoomandpaneffect.cpp +SOURCE shwzoomandpanlayout.cpp +SOURCE shwcurvefactory.cpp + +SOURCEPATH ../../coresrc +SOURCE shwtimer.cpp + +USERINCLUDE ../t_cshweffects + +// User include folders required by the tested code +USERINCLUDE ../../inc +USERINCLUDE ../../effectsrc +USERINCLUDE ../../../utils +USERINCLUDE ../../coresrc + + + +// System include folders required by the tested code +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib + +// Libraries required by the tested code +LIBRARY glxmedialists.lib +LIBRARY glxlayouts.lib + +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY hitchcock.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY commonengine.lib +LIBRARY avkon.lib + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshwmusiccontrol.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshwmusiccontrol.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshwmusiccontrol.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +SOURCEPATH ../t_cshwmusiccontrol +SOURCE t_cshwmusiccontrol.cpp +SOURCE t_cshwmusiccontrol_dllmain.cpp + +// Sources required by the test suite +SOURCEPATH ../../controlsrc +SOURCE shwevent.cpp +SOURCE shwmusiccontrol.cpp +SOURCE shweventpublisherbase.cpp + +USERINCLUDE ../t_cshwmusiccontrol + +// User include folders required by the tested code +USERINCLUDE ../../inc +USERINCLUDE ../../coresrc +USERINCLUDE ../../../utils +USERINCLUDE ../../controlsrc +USERINCLUDE ../../effectsrc + + + +// System include folders required by the tested code +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE ../../../../viewframework/views/fullscreenview/inc + +// for mgallery drm +SYSTEMINCLUDE ../../../../viewframework/drmutility/inc + + +LIBRARY eunit.lib +LIBRARY eunitutil.lib +LIBRARY efsrv.lib +LIBRARY euser.lib + +LIBRARY mpxplaybackutility.lib + +// Libraries required by the tested code + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshwplaybackfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshwplaybackfactory.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshwplaybackfactory.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +// test code +SOURCEPATH ../t_cshwplaybackfactory +SOURCE t_cshwplaybackfactory.cpp +SOURCE t_cshwplaybackfactory_dllmain.cpp + +// stubs for code under test +SOURCEPATH ../stubs +SOURCE tmglxvisuallist_adapter.cpp +SOURCE stub_glxfetchcontexts.cpp + +// code under test +SOURCEPATH ../../controlsrc +SOURCE shwevent.cpp +SOURCE shweffectcontrol.cpp +SOURCE shwviewcontrol.cpp +SOURCE shwtimercontrol.cpp +SOURCE shweventrouter.cpp +SOURCE shwmusiccontrol.cpp +SOURCE shweventpublisherbase.cpp +SOURCEPATH ../../effectsrc +SOURCE shwdefaulteffectmanager.cpp +SOURCEPATH ../../coresrc +SOURCE shwplaybackfactory.cpp +SOURCE shwthumbnailloader.cpp +SOURCE shwsettingsmodel.cpp +SOURCE shwtimer.cpp +SOURCE shwthumbnailcontext.cpp + +// test code +USERINCLUDE ../t_cshwplaybackfactory +USERINCLUDE ../stubs +USERINCLUDE ../../../../viewframework/medialists/tsrc/inc + +// User include folders required by the code under test +USERINCLUDE ../../inc +USERINCLUDE ../../coresrc +USERINCLUDE ../../../utils +USERINCLUDE ../../controlsrc +USERINCLUDE ../../effectsrc + + + +// System include folders required by the code under test +SYSTEMINCLUDE ../../../../commonui/inc +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../viewframework/uiutilities/inc // for attribute retriever +SYSTEMINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib + +// Libraries required by the code under test +LIBRARY glxlayouts.lib +LIBRARY mpxplaybackutility.lib // for music playback +LIBRARY efsrv.lib +LIBRARY mpxcommon.lib + +// For central repository +LIBRARY centralrepository.lib + +// allow writeable statics +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshwsettingsmodel.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshwsettingsmodel.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshwsettingsmodel.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +// test code +SOURCEPATH ../t_cshwsettingsmodel +SOURCE t_cshwsettingsmodel.cpp +SOURCE t_cshwsettingsmodeldllmain.cpp +SOURCEPATH ../../coresrc +SOURCE shwsettingsmodel.cpp + + +// code under test +USERINCLUDE ../../inc +USERINCLUDE ../../../utils +USERINCLUDE ../../../group // for shwbuildvariant.hrh + +// test code +USERINCLUDE ../t_cshwsettingsmodel + + +// System include folders required by the tested code +SYSTEMINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY EUnit.lib +LIBRARY euser.lib +// For central repository +LIBRARY centralrepository.lib + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshwslideshowengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshwslideshowengine.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshwslideshowengine.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +// test code +SOURCEPATH ../t_cshwslideshowengine +SOURCE t_cshwslideshowengine.cpp +SOURCE t_cshwslideshowengine_dllmain.cpp + +// stubs for code under test +SOURCEPATH ../stubs +SOURCE tmglxvisuallist_adapter.cpp +SOURCE tmshweventobserver_adapter.cpp +SOURCE stub_tglxlayoutsplitter.cpp +SOURCE stub_glxfetchcontexts.cpp + +// code under test +SOURCEPATH ../../controlsrc +SOURCE shwevent.cpp +SOURCE shweffectcontrol.cpp +SOURCE shwviewcontrol.cpp +SOURCE shwtimercontrol.cpp +SOURCE shwmusiccontrol.cpp +SOURCE shweventrouter.cpp +SOURCE shweventpublisherbase.cpp +SOURCEPATH ../../coresrc +SOURCE shwslideshowengine.cpp +SOURCE shwslideshowengineimpl.cpp +SOURCE shwthumbnailloader.cpp +SOURCE shwtimer.cpp +SOURCE shwthumbnailcontext.cpp + +// test code +USERINCLUDE ../t_cshwslideshowengine +USERINCLUDE ../stubs +USERINCLUDE ../../../../viewframework/medialists/tsrc/inc + +// code under test +USERINCLUDE ../../inc +USERINCLUDE ../../coresrc +USERINCLUDE ../../controlsrc +USERINCLUDE ../../effectsrc +USERINCLUDE ../../../utils + + +// System include folders required by the tested code +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../../../commonui/inc +SYSTEMINCLUDE ../../../../inc +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../viewframework/uiutilities/inc // for attribute retriever + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib + +// cshwmusiccontrol libraries +LIBRARY efsrv.lib +LIBRARY mpxplaybackutility.lib +LIBRARY mpxcommon.lib + +// Libraries required by the tested code +LIBRARY glxlayouts.lib + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/group/t_cshwzoomandpaneffect.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/group/t_cshwzoomandpaneffect.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2007-2007 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: Slideshow engine build file for test + * +*/ + + + +#include +#include "../../../../group/glxbuildcommon.mmh" + +TARGET t_cshwzoomandpaneffect.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB + +SOURCEPATH ../t_cshwzoomandpaneffect +SOURCE t_cshwzoomandpaneffect.cpp +SOURCE t_cshwzoomandpaneffect_dllmain.cpp + +// Sources required by the test suite +SOURCEPATH ../../effectsrc +SOURCE shwzoomandpaneffect.cpp +SOURCE shwresourceutility.cpp +SOURCE shwzoomandpanlayout.cpp +SOURCE shwcurvefactory.cpp +SOURCE shwcrossfadelayout.cpp + +SOURCEPATH ../../coresrc +SOURCE shwtimer.cpp + +USERINCLUDE ../t_cshwzoomandpaneffect + +// User include folders required by the tested code +USERINCLUDE ../../inc +USERINCLUDE ../../coresrc +USERINCLUDE ../../controlsrc +USERINCLUDE ../../effectsrc +USERINCLUDE ../../../utils + + +// System include folders required by the tested code +SYSTEMINCLUDE ../../../../viewframework/medialists/inc +SYSTEMINCLUDE ../../../../viewframework/layouts/inc +SYSTEMINCLUDE ../../../../viewframework/visuallistmanager/inc +SYSTEMINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../../../../common/inc // for CGlxResourceUtilities + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib + +// Libraries required by the tested code +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY glxlayouts.lib +LIBRARY glxcommon.lib // for CResourceUtilities +LIBRARY estor.lib +LIBRARY avkon.lib +LIBRARY cone.lib +LIBRARY hitchcock.lib + +// allow static data +#ifndef WINSCW +EPOCALLOWDLLDATA +#endif + +// no need to export test DLLs +EXPORTUNFROZEN + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/stub_tglxlayoutsplitter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/stub_tglxlayoutsplitter.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for image transaction in slideshow + * +*/ + + + + +#include "stub_tglxlayoutsplitter.h" + +extern TBool gSplitterAddLayoutLCalled = EFalse; +extern TBool gSplitterRemoveLayoutLCalled = EFalse; + +// ----------------------------------------------------------------------------- +// Stub for TGlxLayout --> +// ----------------------------------------------------------------------------- +TGlxLayout::TGlxLayout() + { + } +TGlxLayout::~TGlxLayout() + { + } +void TGlxLayout::SetNext( MGlxLayout* /*aLayout*/ ) + { + } +MGlxLayout* TGlxLayout::Next() const + { + return NULL; + } +void TGlxLayout::Insert(MGlxLayout* /*aLayout*/) + { + } +void TGlxLayout::Remove(MGlxLayout* /*aLayout*/) + { + } +void TGlxLayout::SetLayoutValues( TGlxLayoutInfo& /*aInfo*/ ) + { + } +TBool TGlxLayout::Changed() const + { + return ETrue; + } +void TGlxLayout::ClearChanged() + { + } +void TGlxLayout::DoSetLayoutValues( TGlxLayoutInfo& /*aInfo*/ ) + { + } +TBool TGlxLayout::DoChanged() const + { + return ETrue; + } +void TGlxLayout::DoClearChanged() + { + } +// ----------------------------------------------------------------------------- +// <-- Stub for TGlxLayout +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// Stub for layout splitter --> +// ----------------------------------------------------------------------------- +TGlxLayoutSplitter::TGlxLayoutSplitter() + { + gSplitterAddLayoutLCalled = EFalse; + gSplitterRemoveLayoutLCalled = EFalse; + } +TGlxLayoutSplitter::~TGlxLayoutSplitter() + { + } +void TGlxLayoutSplitter::SetVisualListL(MGlxVisualList* /*aVisualList*/) + { + } + +void TGlxLayoutSplitter::AddLayoutL(MGlxLayout* /*aLayout*/, const CHuiVisual* /*aVisual*/) + { + gSplitterAddLayoutLCalled = ETrue; + } + +void TGlxLayoutSplitter::RemoveLayout(const CHuiVisual* /*aVisual*/) + { + gSplitterRemoveLayoutLCalled = ETrue; + } +void TGlxLayoutSplitter::SetDefaultLayout(MGlxLayout* /*aLayout*/) + { + } + +void TGlxLayoutSplitter::HandleFocusChangedL( + TInt /*aFocusIndex*/, TReal32 /*aItemsPerSecond*/, MGlxVisualList* /*aList*/, + NGlxListDefs::TFocusChangeType /*aType*/ ) + { + + } +void TGlxLayoutSplitter::HandleSizeChanged( const TSize& /*aSize*/, MGlxVisualList* /*aList*/ ) + { + + } +void TGlxLayoutSplitter::HandleVisualRemoved( + const CHuiVisual* /*aVisual*/, MGlxVisualList* /*aList*/ ) + { + + } +void TGlxLayoutSplitter::HandleVisualAddedL( + CHuiVisual* /*aVisual*/, TInt /*aIndex*/, MGlxVisualList* /*aList*/ ) + { + + } +void TGlxLayoutSplitter::DoSetLayoutValues( TGlxLayoutInfo& /*aInfo*/ ) + { + + } +TBool TGlxLayoutSplitter::DoChanged() const + { + return ETrue; + } +void TGlxLayoutSplitter::DoClearChanged() + { + + } +// ----------------------------------------------------------------------------- +// <-- Stub for layout splitter +// ----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/stub_tglxlayoutsplitter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/stub_tglxlayoutsplitter.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for image transaction in slideshow + * +*/ + + + +#ifndef __STUB_TGLXLAYOUTSPLITTER_H__ +#define __STUB_TGLXLAYOUTSPLITTER_H__ + +#include + +extern TBool gSplitterAddLayoutLCalled; +extern TBool gSplitterRemoveLayoutLCalled; + +#endif // __STUB_TGLXLAYOUTSPLITTER_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/tmglxvisuallist_adapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/tmglxvisuallist_adapter.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,272 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for visual list adapter + * +*/ + + + + +// CLASS HEADER +#include "TMGlxVisualList_Adapter.h" + +// EXTERNAL INCLUDES +#include +#include + +// declate the enum to be printed as TInt +EUNIT_DECLARE_PRINTABLE_AS_TINT( MGlxVisualList_Observer::TMGlxVisualListMethodId ) + +// INTERNAL INCLUDES + +// CONSTRUCTION + +TMGlxVisualList_Adapter::TMGlxVisualList_Adapter( MGlxVisualList_Observer* aObserver ) + : iSize( TMGlxVisualList_Adapter_Config::KDefaultSize ), + iFocus( TMGlxVisualList_Adapter_Config::KDefaultFocus ), + iMGlxVisualList_Observer( aObserver ), + iMGlxVisualList( NULL ) + { + } + +TMGlxVisualList_Adapter::~TMGlxVisualList_Adapter() + { + // release the array + iObservers.Close(); + } + +void TMGlxVisualList_Adapter::SetAdaptee( MGlxVisualList* aAdaptee ) + { + iMGlxVisualList = aAdaptee; + } + +// METHODS +TGlxVisualListId TMGlxVisualList_Adapter::Id() const + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_TGlxVisualListId_Id_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->Id(); + } + return TGlxVisualListId( reinterpret_cast< unsigned int >( (void*)this ) ); + } + +CHuiVisual* TMGlxVisualList_Adapter::Visual( TInt aListIndex ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_CHuiVisual_p_Visual_TInt_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->Visual( aListIndex ); + } + // return the index as visual + return (CHuiVisual*)aListIndex; + } + +CGlxVisualObject* TMGlxVisualList_Adapter::Item( TInt aListIndex ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_CGlxVisualObject_p_Item_TInt_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->Item( aListIndex ); + } + // return the index as item + return (CGlxVisualObject*)aListIndex; + } + +TInt TMGlxVisualList_Adapter::ItemCount() const + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_TInt_ItemCount_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->ItemCount(); + } + return iSize; + } + +TInt TMGlxVisualList_Adapter::FocusIndex() const + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_TInt_FocusIndex_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->FocusIndex(); + } + return iFocus; + } + +CHuiControlGroup* TMGlxVisualList_Adapter::ControlGroup() const + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_CHuiControlGroup_p_ControlGroup_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->ControlGroup(); + } + return NULL; + } + +void TMGlxVisualList_Adapter::AddObserverL( MGlxVisualListObserver* aObserver ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_AddObserverL_MGlxVisualListObserver_p_ ); + + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->AddObserverL( aObserver ); + } + + // add the observer to array + iObservers.AppendL( aObserver ); + } + +void TMGlxVisualList_Adapter::RemoveObserver( MGlxVisualListObserver* aObserver ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_RemoveObserver_MGlxVisualListObserver_p_ ); + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->RemoveObserver( aObserver ); + } + } + +void TMGlxVisualList_Adapter::AddLayoutL( MGlxLayout* aLayout ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_AddLayoutL_MGlxLayout_p_ ); + + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->AddLayoutL( aLayout ); + } + } + +void TMGlxVisualList_Adapter::RemoveLayout( const MGlxLayout* aLayout ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_RemoveLayout_const_MGlxLayout_p_ ); + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->RemoveLayout( aLayout ); + } + } + +TGlxViewContextId TMGlxVisualList_Adapter::AddContextL( TInt aFrontVisibleRangeOffset, TInt aRearVisibleRangeOffset ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_TGlxViewContextId_AddContextL_TInt_TInt_ ); + + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->AddContextL( aFrontVisibleRangeOffset, aRearVisibleRangeOffset ); + } + return TGlxViewContextId( reinterpret_cast< unsigned int >( (void*)this) ); + } + +void TMGlxVisualList_Adapter::RemoveContext( const TGlxViewContextId& aContextId ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_RemoveContext_const_TGlxViewContextId_r_ ); + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->RemoveContext( aContextId ); + } + } + +void TMGlxVisualList_Adapter::NavigateL( TInt aIndexCount ) + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_NavigateL_TInt_ ); + + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->NavigateL( aIndexCount ); + } + + // change the focus + iFocus = (iFocus + aIndexCount)% iSize; + // if navigated backwards, loop the index + if( iFocus < 0 ) + { + iFocus = iSize - 1; + } + + EUNIT_PRINT( _L("Visual list focus %d"), iFocus ); + + for( TInt i=0; iHandleFocusChangedL( iFocus, 0, this, NGlxListDefs::EUnknown ); + } + } + +TSize TMGlxVisualList_Adapter::Size() const + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_TSize_Size_ ); + // call the actual method + if ( iMGlxVisualList ) + { + return iMGlxVisualList->Size(); + } + return TSize( 0, 0 ); + } + +void TMGlxVisualList_Adapter::BringVisualsToFront() + { + // inform the test case + iMGlxVisualList_Observer->MGlxVisualList_MethodCalled( MGlxVisualList_Observer::E_void_BringVisualsToFront_ ); + // call the actual method + if ( iMGlxVisualList ) + { + iMGlxVisualList->BringVisualsToFront(); + } + } + +void TMGlxVisualList_Adapter::EnableAnimationL(TBool /*aAnimate*/, TInt /*aIndex*/) + { + } + +// ----------------------------------------------------------------------------- +// SetDefaultIconBehaviourL +// ----------------------------------------------------------------------------- +void TMGlxVisualList_Adapter::SetDefaultIconBehaviourL( TBool /*aEnable*/ ) + { + } + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/tmglxvisuallist_adapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/tmglxvisuallist_adapter.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for visual list adapter + * +*/ + + + + +#ifndef __TMGLXVISUALLIST_ADAPTER_H__ +#define __TMGLXVISUALLIST_ADAPTER_H__ + +// EXTERNAL INCLUDES + +// INTERNAL INCLUDES +#include "MGlxVisualList_Observer.h" +#include + +// FORWARD DECLARATIONS + +namespace TMGlxVisualList_Adapter_Config + { + const TInt KDefaultSize = 3; + const TInt KDefaultFocus = 1; + } + +// CLASS DEFINITION +/** + * Stub version of visual list + * for testing purposes + */ +class TMGlxVisualList_Adapter + : public MGlxVisualList + { + public: // Constructors and destructors + + /** + * Construction + */ + TMGlxVisualList_Adapter( MGlxVisualList_Observer* aObserver ); + ~TMGlxVisualList_Adapter(); + void SetAdaptee( MGlxVisualList* aAdaptee ); + + public: // from MGlxVisualList + + TGlxVisualListId Id() const; + CHuiVisual* Visual(TInt aListIndex); + CGlxVisualObject* Item(TInt aListIndex); + TInt ItemCount() const; + TInt FocusIndex() const; + CHuiControlGroup* ControlGroup() const; + void AddObserverL(MGlxVisualListObserver* aObserver); + void RemoveObserver(MGlxVisualListObserver* aObserver); + void AddLayoutL(MGlxLayout* aLayout); + void RemoveLayout(const MGlxLayout* aLayout); + TGlxViewContextId AddContextL(TInt aFrontVisibleRangeOffset, TInt aRearVisibleRangeOffset); + void RemoveContext(const TGlxViewContextId& aContextId); + void NavigateL(TInt aIndexCount); + TSize Size() const; + void BringVisualsToFront(); + void EnableAnimationL(TBool aAnimate, TInt aIndex); + /// @ref MGlxVisualList::SetDefaultIconBehaviourL + void SetDefaultIconBehaviourL( TBool aEnable ); + + void AddIconL( TInt , const CHuiTexture& , + NGlxIconMgrDefs::TGlxIconPosition , + TBool , TBool , TInt, TReal32, TReal32 ) { } + + TBool RemoveIcon( TInt , const CHuiTexture& ) { return ETrue;} + + void SetIconVisibility( TInt , const CHuiTexture&, TBool ) { } + + public: // Data + + TInt iSize; + TInt iFocus; + + private: // Data + + RArray iObservers; + MGlxVisualList_Observer* iMGlxVisualList_Observer; + MGlxVisualList* iMGlxVisualList; + + }; + +#endif // __TMGLXVISUALLIST_ADAPTER_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/tmshweffectmanager_adapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/tmshweffectmanager_adapter.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,246 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for managing effect in slideshow + * +*/ + + + + +// CLASS HEADER +#include "tmshweffectmanager_adapter.h" + +// EXTERNAL INCLUDES +// INTERNAL INCLUDES +#include + +// declare the enums to be printable as TInts +EUNIT_DECLARE_PRINTABLE_AS_TINT( MShwEffectManager_Observer::TMShwEffectManagerMethodId ) + +// CONSTRUCTION + +TMShwEffectManager_Adapter::TMShwEffectManager_Adapter( + MShwEffectManager_Observer* aObserver ) + : iViewDuration( 0 ), + iTransitionDuration( 0 ), + iPrepareVisual( NULL ), + iViewVisual( NULL ), + iTransitionVisual( NULL ), + iMShwEffectManager_Observer( aObserver ), + iMShwEffectManager( NULL ) + { + } + +void TMShwEffectManager_Adapter::SetAdaptee( MShwEffectManager* aAdaptee ) + { + iMShwEffectManager = aAdaptee; + } + +// METHODS +void TMShwEffectManager_Adapter::AddEffectL( MShwEffect* aEffect ) + { + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_void_AdoptEffectsL_TArrayMShwEffect_p ); + + // allocate to cause an alloc leave + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + // call the actual method + if ( iMShwEffectManager ) + { + iMShwEffectManager->AddEffectL( aEffect ); + } + } + +MShwEffect* TMShwEffectManager_Adapter::CurrentEffect() + { + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MShwEffect_p_CurrentEffect ); + // call the actual method + if ( iMShwEffectManager ) + { + return iMShwEffectManager->CurrentEffect(); + } + return this; + } + +MShwEffect* TMShwEffectManager_Adapter::Effect( TInt aDirection ) + { + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MShwEffect_p_NextEffect ); + // call the actual method + if ( iMShwEffectManager ) + { + return iMShwEffectManager->Effect( aDirection ); + } + return this; + } + +void TMShwEffectManager_Adapter::ProceedToEffect( TInt aDirection ) + { + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_void_ProceedToNextEffect ); + // call the actual method + if ( iMShwEffectManager ) + { + iMShwEffectManager->ProceedToEffect( aDirection ); + } + } + +void TMShwEffectManager_Adapter::SetEffectOrder( + MShwEffectManager::TShwEffectOrder /*aOrder*/ ) + { + } + +MShwEffectManager::TShwEffectOrder TMShwEffectManager_Adapter::EffectOrder() + { + return EEffectOrderProgrammed; + } + +void TMShwEffectManager_Adapter::SetProgrammedEffects( + RArray< TShwEffectInfo >& /*aEffects*/ ) + { + } + +TInt TMShwEffectManager_Adapter::ProgrammedEffects( + RArray< MShwEffect* >& /*aEffects*/ ) + { + return KErrNone; + } + +void TMShwEffectManager_Adapter::SetDefaultEffectL( TShwEffectInfo /*aInfo*/ ) + { + } + +void TMShwEffectManager_Adapter::GetActiveEffectsL( RPointerArray< MShwEffect >& /*aEffects*/ ) + { + } + +/// MShwEffect part +MShwEffect* TMShwEffectManager_Adapter::CloneLC() + { + return NULL; + } + +void TMShwEffectManager_Adapter::InitializeL( + CHuiEnv* /*aHuiEnv*/, + MGlxVisualList* /*aVisualList*/, + MGlxMediaList* /*aMediaList*/, + TSize /*aScreenSize*/ ) + { + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MGlxLayout_InitializeL ); + + // allocate to cause an alloc leave in OOM tests + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + } + +TSize TMShwEffectManager_Adapter::PrepareViewL( CHuiVisual* aVisual, TSize /*aSize*/ ) + { + // store the visual + iPrepareVisual = aVisual; + + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MGlxLayout_PrepareViewL ); + + // allocate to cause an alloc leave in OOM tests + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + return TSize( 0, 0 ); + } + +MGlxLayout* TMShwEffectManager_Adapter::EnterViewL( + CHuiVisual* aVisual, TInt aDuration, TInt /*aDuration2*/ ) + { + iViewDuration = aDuration; + // store the visual + iViewVisual = aVisual; + + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MGlxLayout_EnterViewL_TInt ); + + // allocate to cause an alloc leave + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + return NULL; + } + +void TMShwEffectManager_Adapter::ExitView( CHuiVisual* aVisual ) + { + // store the visual + iViewVisual = aVisual; + + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_void_ExitView ); + } + +MGlxLayout* TMShwEffectManager_Adapter::EnterTransitionL( + CHuiVisual* aVisual, TInt aDuration ) + { + iTransitionDuration = aDuration; + // store the visual + iTransitionVisual = aVisual; + + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_MGlxLayout_EnterTransitionL_TInt ); + + // allocate to cause an alloc leave + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + + return NULL; + } + +void TMShwEffectManager_Adapter::ExitTransition( CHuiVisual* aVisual ) + { + // store the visual + iTransitionVisual = aVisual; + + // inform the observer + iMShwEffectManager_Observer->MShwEffectManager_MethodCalled( + MShwEffectManager_Observer::E_void_ExitTransition ); + } + +void TMShwEffectManager_Adapter::PauseL() + { + // allocate to cause an alloc leave + TInt* memAlloc = new (ELeave) TInt; + delete memAlloc; + } + +void TMShwEffectManager_Adapter::Resume() + { + } + +TShwEffectInfo TMShwEffectManager_Adapter::EffectInfo() + { + TShwEffectInfo info; + info.iName = KNullDesC; + return info; + } + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/stubs/tmshweffectmanager_adapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/stubs/tmshweffectmanager_adapter.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2006-2007 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: Stub file for managing effect in slideshow + * +*/ + + + + +#ifndef __TMSHWEFFECTMANAGER_ADAPTER_H__ +#define __TMSHWEFFECTMANAGER_ADAPTER_H__ + +// EXTERNAL INCLUDES + + +// INTERNAL INCLUDES +#include "mshweffectmanager_observer.h" +#include "shweffectmanager.h" +#include "shweffect.h" + +// FORWARD DECLARATIONS + +// CLASS DEFINITION +/** + * Stub implementation of effect manager and effect. + */ +class TMShwEffectManager_Adapter + : public MShwEffectManager, public MShwEffect + { + public: // Constructors and destructors + + /** + * Construction + */ + TMShwEffectManager_Adapter( MShwEffectManager_Observer* aObserver ); + void SetAdaptee( MShwEffectManager* aAdaptee ); + + public: // From MShwEffectManager + + void AddEffectL( MShwEffect* aEffect ); + MShwEffect* CurrentEffect(); + MShwEffect* Effect( TInt aDirection ); + void ProceedToEffect( TInt aDirection ); + void SetEffectOrder( TShwEffectOrder aOrder ); + TShwEffectOrder EffectOrder(); + void SetProgrammedEffects( RArray< TShwEffectInfo >& aEffects ); + TInt ProgrammedEffects( RArray< MShwEffect* >& aEffects ); + void SetDefaultEffectL(TShwEffectInfo aInfo); + void GetActiveEffectsL( RPointerArray< MShwEffect >& aEffects ); + + public: // From MShwEffect + + MShwEffect* CloneLC(); + void InitializeL( + CHuiEnv* aHuiEnv, + MGlxVisualList* aVisualList, + MGlxMediaList* aMediaList, + TSize aScreenSize ); + TSize PrepareViewL( CHuiVisual* aVisual, TSize aSize ); + MGlxLayout* EnterViewL( CHuiVisual* aVisual, TInt aDuration, TInt aDuration2 ); + void ExitView( CHuiVisual* aVisual ); + MGlxLayout* EnterTransitionL( CHuiVisual* aVisual, TInt aDuration ); + void ExitTransition( CHuiVisual* aVisual ); + void PauseL(); + void Resume(); + TShwEffectInfo EffectInfo(); + + public: // Data (for verification) + + TInt iViewDuration; + TInt iTransitionDuration; + CHuiVisual* iPrepareVisual; + CHuiVisual* iViewVisual; + CHuiVisual* iTransitionVisual; + + private: // Data + + MShwEffectManager_Observer* iMShwEffectManager_Observer; + MShwEffectManager* iMShwEffectManager; + + }; + +#endif // __TMSHWEFFECTMANAGER_ADAPTER_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,932 @@ +/* +* Copyright (c) 2006-2007 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: Test for effect control for the slideshow + * +*/ + + + + +// CLASS HEADER +#include "t_cshweffectcontrol.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "shwslideshowenginepanic.h" +#include "shweffectcontrol.h" +#include "shwevent.h" +#include "shwthumbnailcontext.h" +#include "shwautoptr.h" + +#include "stub_tglxlayoutsplitter.h" +#include "stub_glxfetchcontexts.h" + +// ----------------------------------------------------------------------------- +// Stub for NShwEngine::Panic --> +// ----------------------------------------------------------------------------- +TBool gNShwEnginePanicCalled = EFalse; +namespace NShwEngine + { + extern void Panic( TShwEnginePanic aPanic ) + { + gNShwEnginePanicCalled = ETrue; + // in test situation just do a leave + User::Leave( aPanic ); + } + } + +// ----------------------------------------------------------------------------- +// <-- Stub for NShwEngine::Panic +// ----------------------------------------------------------------------------- + +// CONSTRUCTION +T_CShwEffectControl* T_CShwEffectControl::NewL() + { + T_CShwEffectControl* self = T_CShwEffectControl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +T_CShwEffectControl* T_CShwEffectControl::NewLC() + { + T_CShwEffectControl* self = new( ELeave ) T_CShwEffectControl(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_CShwEffectControl::~T_CShwEffectControl() + { + } + +// Default constructor +T_CShwEffectControl::T_CShwEffectControl() : + iStubEffectManager( this ) + { + } + +// Second phase construct +void T_CShwEffectControl::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS +void T_CShwEffectControl::MGlxMediaList_MethodCalled( TMGlxMediaListMethodId aMethodId ) + { + // append the methodid in the array + TInt error = iMediaListCalls.Append( aMethodId ); + // check that append succeeded + if( error != KErrNone ) + { + // critical error, not enough space to append messages + User::Panic( _L("T_CShwEffectControl::MGlxMediaList_MethodCalled"), __LINE__ ); + } + } + +void T_CShwEffectControl::MGlxVisualList_MethodCalled( TMGlxVisualListMethodId aMethodId ) + { + // append the methodid in the array + TInt error = iVisualListCalls.Append( aMethodId ); + // check that append succeeded + if( error != KErrNone ) + { + // critical error, not enough space to append messages + User::Panic( _L("TestError:AppendFail"), -1 ); + } + } + +void T_CShwEffectControl::MShwEffectManager_MethodCalled( TMShwEffectManagerMethodId aMethodId ) + { + // append the methodid in the array + TInt error = iEffectCalls.Append( aMethodId ); + // check that append succeeded + if( error != KErrNone ) + { + // critical error, not enough space to append messages + User::Panic( _L("TestError:AppendFail"), -2 ); + } + } + +TInt gSendEventLeaveCode = KErrNone; +void T_CShwEffectControl::SendEventL( MShwEvent* aEvent ) + { + // need to clone the event since the caller goes out of scope + TInt error = iEvents.Append( aEvent->CloneLC() ); + CleanupStack::Pop(); // aEvent->CloneLC() + + // check that append succeeded + if( error != KErrNone ) + { + // critical error, not enough space to append events + User::Panic( _L("T_CShwEffectControl::NotifyL"), __LINE__ ); + } + User::LeaveIfError( gSendEventLeaveCode ); + + // stop the scheduler loop if its started + if( iWait.IsStarted() ) + { + iWait.AsyncStop(); + } + } + +void T_CShwEffectControl::EmptySetupL() + { + gNShwEnginePanicCalled = EFalse; // by default no panic was called + gSendEventLeaveCode = KErrNone; // by default no leaves in SendEventL + // make room for 20 entries on each array + iVisualListCalls.ReserveL( 20 ); + iMediaListCalls.ReserveL( 20 ); + iEffectCalls.ReserveL( 20 ); + iEvents.ReserveL( 20 ); + + iStubVisualList = new( ELeave ) TMGlxVisualList_Adapter( this ); + iStubMediaList = new( ELeave ) TMGlxMediaList_Stub( this ); + + // set the size and focus of the list + iStubVisualList->iSize = 3; + iStubVisualList->iFocus = 1; + iStubMediaList->iCount = 3; + iStubMediaList->iFocus = 1; + + iStubEffectManager.iViewDuration = 0; + iStubEffectManager.iTransitionDuration = 0; + + // reset the visuals of effect stub + iStubEffectManager.iPrepareVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iViewVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iTransitionVisual = reinterpret_cast( KErrNotFound ); + + // tell the thumbnail stub to add attributes + // this tells the thumbnailcontext stub to add entries to the + // array which then tell the thumbnail loader that the + // thumbnail was not yet loaded + gThumbnailContextRequestCount = 1; + // by default size is available + gTGlxMediaGetDimensions = ETrue; + // by default we dont want alloc behavior + gFetchContextAllocTest = EFalse; + } + +void T_CShwEffectControl::SetupL() + { + // reuse the empty version to create the stubs + EmptySetupL(); + // create the effect control + iCShwEffectControl = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // set the event queue + iCShwEffectControl->SetEventQueue( this ); + + // perform the second phase of construction + TShwEventInitialize initEvent; + iCShwEffectControl->NotifyL( &initEvent ); + } + +void T_CShwEffectControl::Teardown() + { + // delete effect control + delete iCShwEffectControl; + iCShwEffectControl = NULL; + // close the arrays + iEffectCalls.Close(); + iVisualListCalls.Close(); + iMediaListCalls.Close(); + // release events + for( TInt i=0; iiSize = 11; + iStubVisualList->iFocus = 10; + // reset the state as setup uses splitter + gSplitterAddLayoutLCalled = EFalse; + gSplitterRemoveLayoutLCalled = EFalse; + // create an effect control + CShwEffectControl* tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to put to cleanupstack in case NotifyL leaves + CleanupStack::PushL( tmp ); + + EUNIT_ASSERT_DESC( tmp, "Construction successfull"); + + EUNIT_ASSERT_EQUALS_DESC( 0, iEffectCalls.Count(), "Effect manager was not called" ); + + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + + // check that the calls made by CShwEffectControl were correct ones + EUNIT_ASSERT_EQUALS_DESC( 2, iEffectCalls.Count(), "Effect manager was called 2 times" ); + EUNIT_ASSERT_EQUALS_DESC( E_MShwEffect_p_CurrentEffect, iEffectCalls[ 0 ], "current effect was called" ); + EUNIT_ASSERT_EQUALS_DESC( E_MGlxLayout_PrepareViewL, iEffectCalls[ 1 ], "current effect was called" ); + + // test notify again with size not available + gTGlxMediaGetDimensions = EFalse; + // call notify again + tmp->NotifyL( &initEvent ); + // check that the calls made by CShwEffectControl were correct ones + EUNIT_ASSERT_EQUALS_DESC( 4, iEffectCalls.Count(), "Effect manager was called 4 times" ); + EUNIT_ASSERT_EQUALS_DESC( E_MShwEffect_p_CurrentEffect, iEffectCalls[ 2 ], "current effect was called" ); + EUNIT_ASSERT_EQUALS_DESC( E_MGlxLayout_PrepareViewL, iEffectCalls[ 3 ], "current effect was called" ); + + // check splitter usage + EUNIT_ASSERT_DESC( !gSplitterAddLayoutLCalled, "layout was not set" ); + EUNIT_ASSERT_DESC( !gSplitterRemoveLayoutLCalled, "layout was not removed" ); + + CleanupStack::PopAndDestroy( tmp ); + } + +void T_CShwEffectControl::TransitionCompletedL() + { + // reset the state as setup uses splitter + gSplitterAddLayoutLCalled = EFalse; + gSplitterRemoveLayoutLCalled = EFalse; + + // call transition completed + iCShwEffectControl->SendTransitionReadyL(); + + // check that we got the correct event + EUNIT_ASSERT_DESC( iEvents.Count() > 0, "we got an event"); + EUNIT_ASSERT_DESC( + dynamic_cast( iEvents[ 0 ] ), + "event was correct class" ); + + // check splitter usage + EUNIT_ASSERT_DESC( !gSplitterAddLayoutLCalled, "layout was not set" ); + EUNIT_ASSERT_DESC( !gSplitterRemoveLayoutLCalled, "layout was not removed" ); + } + +void T_CShwEffectControl::TransitionCompleted2L() + { + // tell the thumbnail context that the thumbnail is already loaded + // so that the thumbnail loader will immediately make the callback + gThumbnailContextRequestCount = 0; + // tell the medialist stub to notify that we have the first thumbnail loaded + iStubMediaList->NotifyAttributesAvailableL( iStubMediaList->iFocus ); + + // check that we dont have event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "event received"); + // check that we got the correct event + EUNIT_ASSERT_DESC( + dynamic_cast( iEvents[ 0 ] ), + "event was correct class" ); + + // send the event + TShwEventStartTransition trans( 123 ); + iCShwEffectControl->NotifyL( &trans ); + + // start the wait loop + iWait.Start(); + // check that we got event + EUNIT_ASSERT_EQUALS_DESC( 3, iEvents.Count(), "we got an event"); + // check that we got the correct events + EUNIT_ASSERT_DESC( + dynamic_cast( iEvents[ 1 ] ), + "event was correct class" ); + EUNIT_ASSERT_DESC( + dynamic_cast( iEvents[ 2 ] ), + "event was correct class" ); + } + +void T_CShwEffectControl::NotifyLL() + { + TInt initialEffectCalls = iEffectCalls.Count(); + TInt initialVisualCalls = iVisualListCalls.Count(); + + // reset the state as setup uses splitter + gSplitterAddLayoutLCalled = EFalse; + gSplitterRemoveLayoutLCalled = EFalse; + // reset the visuals + iStubEffectManager.iPrepareVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iViewVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iTransitionVisual = reinterpret_cast( KErrNotFound ); + + // test not supported event path + iCShwEffectControl->NotifyL( NULL ); + + // check that there was no new calls made by CShwEffectControl to visual list or effect manager + EUNIT_ASSERT_EQUALS_DESC( initialEffectCalls, iEffectCalls.Count(), "Effect manager was not called" ); + EUNIT_ASSERT_EQUALS_DESC( initialVisualCalls, iVisualListCalls.Count(), "Visual list was not called" ); + + // test if( viewEvent ) + + // tell the stub context that a request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail in focus is loaded + iStubMediaList->NotifyAttributesAvailableL( iStubMediaList->iFocus ); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + + // tell the stub context that its request is complete, at this point there is no + // context so we only test that thumbnail context works without one + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that next thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 1 )%iStubMediaList->iCount ); + + // if( view_event ) : true + // if( iLoopStarted ) : false + TShwEventStartView start( 999 ); + iCShwEffectControl->NotifyL( &start ); + + // thumbnail notify is always asynchronous so first check we did not yet get the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got only previous event"); + // start async wait + iWait.Start(); + + // check that we got view ready event + EUNIT_ASSERT_EQUALS_DESC( 2, iEvents.Count(), "we got an event"); + EUNIT_ASSERT_DESC( dynamic_cast( iEvents[ 1 ] ), "TShwEventReadyToAdvance received" ); + + // check the visual given to effect + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iPrepareVisual, 2, "prepare was given visual 2 (focus is on 1)" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iViewVisual, 1, "view was given visual 1 (focus is on 1)" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iTransitionVisual, KErrNotFound, "transition was not given visual" ); + // check splitter usage + EUNIT_ASSERT_DESC( gSplitterAddLayoutLCalled, "layout was set (view layout)" ); + EUNIT_ASSERT_DESC( gSplitterRemoveLayoutLCalled, "layout was removed (old view layout)" ); + + // test path: + EUNIT_PRINT( _L("if( view_event ) : false") ); + EUNIT_PRINT( _L("else if( trans_event ) : true") ); + // if( view_event ) : false + // else if( trans_event ) : true + TInt effectCalls = iEffectCalls.Count(); + TInt visualCalls = iVisualListCalls.Count(); + // reset the visuals + iStubEffectManager.iPrepareVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iViewVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iTransitionVisual = reinterpret_cast( KErrNotFound ); + // send the event + TShwEventStartTransition trans( 666 ); + iCShwEffectControl->NotifyL( &trans ); + // check that view duration was stored from view event + EUNIT_ASSERT_EQUALS_DESC( 999, iStubEffectManager.iViewDuration, "view duration is set correctly" ); + // check that transition duration was given as parameter + EUNIT_ASSERT_EQUALS_DESC( 666, iStubEffectManager.iTransitionDuration, "transition duration is set correctly" ); + // check the visual given to effect + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iPrepareVisual, KErrNotFound, "prepare was not given visual" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iViewVisual, 2, "view was given visual 2 (focus is on 2)" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iTransitionVisual, 1, "transition was given visual 1 (focus is on 1)" ); + // check splitter usage + EUNIT_ASSERT_DESC( gSplitterAddLayoutLCalled, "layout was set" ); + EUNIT_ASSERT_DESC( gSplitterRemoveLayoutLCalled, "layout was removed" ); + + // test path: + EUNIT_PRINT( _L("if( view_event ) : true") ); + EUNIT_PRINT( _L("if( iLoopStarted ) : true") ); + EUNIT_PRINT( _L("else if( trans_event ) : false") ); + // if( view_event ) : true + // if( iLoopStarted ) : true + // reset the state of splitter stub + gSplitterAddLayoutLCalled = EFalse; + gSplitterRemoveLayoutLCalled = EFalse; + effectCalls = iEffectCalls.Count(); + visualCalls = iVisualListCalls.Count(); + // reset the visuals + iStubEffectManager.iPrepareVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iViewVisual = reinterpret_cast( KErrNotFound ); + iStubEffectManager.iTransitionVisual = reinterpret_cast( KErrNotFound ); + // move focus to 2 + iStubVisualList->iFocus = 2; + iStubMediaList->iFocus = 2; + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 1 )%iStubMediaList->iCount ); + + // send the event + TShwEventStartView start2( 123 ); + iCShwEffectControl->NotifyL( &start2 ); + + // check we got the ready to view event + EUNIT_ASSERT_EQUALS_DESC( 3, iEvents.Count(), "we got ready to view"); + EUNIT_ASSERT_DESC( dynamic_cast( iEvents[ 2 ] ), "TShwEventReadyToView received" ); + // start async wait + iWait.Start(); + + // check that view duration was not set + EUNIT_ASSERT_EQUALS_DESC( 999, iStubEffectManager.iViewDuration, "view duration is same as last, see above" ); + // check the visual given to effect + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iPrepareVisual, 0, "prepare view was given visual 0 (focus is on 2, size is 3)" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iViewVisual, KErrNotFound, "view was not given visual" ); + EUNIT_ASSERT_EQUALS_DESC( (TInt)iStubEffectManager.iTransitionVisual, 1, "exit transition was given visual 1 (focus is on 2)" ); + // check that we got view ready event + EUNIT_ASSERT_EQUALS_DESC( 4, iEvents.Count(), "event received" ); + EUNIT_ASSERT_DESC( dynamic_cast( iEvents[ 3 ] ), "TShwEventReadyToAdvance received" ); + + // check splitter usage + EUNIT_ASSERT_DESC( !gSplitterAddLayoutLCalled, "layout was not set" ); + EUNIT_ASSERT_DESC( gSplitterRemoveLayoutLCalled, "layout was removed" ); + } + +void T_CShwEffectControl::SlowImageLoadL() + { + // test path: + EUNIT_PRINT( _L("if( view_event ) : true") ); + EUNIT_PRINT( _L("if( iLoopStarted ) : false") ); + EUNIT_PRINT( _L("else if( trans_event ) : false") ); + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail in focus is loaded + iStubMediaList->NotifyAttributesAvailableL( iStubMediaList->iFocus ); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + + // tell the stub context that its request is not complete + gThumbnailContextRequestCount = 1; + + // if( view_event ) : true + // if( iLoopStarted ) : false + TShwEventStartView start( 999 ); + iCShwEffectControl->NotifyL( &start ); + // variable iLoopStarted is initialized as false so we dont go through the loop + // check that we got view ready event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "new event not received" ); + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 1 )%iStubMediaList->iCount ); + + EUNIT_ASSERT_EQUALS_DESC( 2, iEvents.Count(), "we got an event"); + EUNIT_ASSERT_DESC( dynamic_cast( iEvents[ 1 ] ), "TShwEventReadyToAdvance received" ); + } + +void T_CShwEffectControl::SlowImageLoad2L() + { + // set the size and focus of the list + iStubVisualList->iSize = 10; + iStubVisualList->iFocus = 1; + iStubMediaList->iCount = 10; + iStubMediaList->iFocus = 1; + // test path: + EUNIT_PRINT( _L("if( view_event ) : true") ); + EUNIT_PRINT( _L("if( iLoopStarted ) : false") ); + EUNIT_PRINT( _L("else if( trans_event ) : false") ); + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail in focus is loaded + iStubMediaList->NotifyAttributesAvailableL( iStubMediaList->iFocus ); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + + // tell the stub context that its request is not complete + gThumbnailContextRequestCount = 1; + + // if( view_event ) : true + // if( iLoopStarted ) : false + TShwEventStartView start( 999 ); + iCShwEffectControl->NotifyL( &start ); + // variable iLoopStarted is initialized as false so we dont go through the loop + // check that we got view ready event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "new event not received" ); + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + // tell the media list stub to notify that thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 3 )%iStubMediaList->iCount ); + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "new event not received" ); + + // tell the media list stub to notify that thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 2 )%iStubMediaList->iCount ); + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "new event not received" ); + + // tell the stub context that its request is not complete + gThumbnailContextRequestCount = 1; + // tell the media list stub to notify that thumbnail is loaded + // remember the modulo + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 1 )%iStubMediaList->iCount ); + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "new event not received" ); + + // tell the stub context that its request is complete + gThumbnailContextRequestCount = KErrNone; + iStubMediaList->NotifyAttributesAvailableL( + ( iStubMediaList->iFocus + 1 )%iStubMediaList->iCount ); + EUNIT_ASSERT_EQUALS_DESC( 2, iEvents.Count(), "event received" ); + // this was second time the event was received so we get view complete event + EUNIT_ASSERT_DESC( + dynamic_cast( iEvents[ 1 ] ), + "TShwEventViewReady received" ); + } + +void T_CShwEffectControl::HandleFocusChangedL() + { + TInt initialVisualListCalls = iVisualListCalls.Count(); + iCShwEffectControl->HandleFocusChangedL( 0, 0, NULL, NGlxListDefs::EUnknown ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + initialVisualListCalls, iVisualListCalls.Count(), "Visual list was called" ); + } + +void T_CShwEffectControl::TestThumbnailLoadingL() + { + // create shw thumbnail context for index 1 and size 100,100 + const TInt thumbIndex = 1; + CShwThumbnailContext* context = CShwThumbnailContext::NewLC(thumbIndex, + TSize(100, 100), iStubMediaList); + + // test that the index is returned + // set iterator to first + context->SetToFirst(iStubMediaList); + // then iterate once + TInt index = (*context)++; + EUNIT_ASSERT_EQUALS_DESC(thumbIndex, index, "check first iterated index"); + + index = (*context)++; + EUNIT_ASSERT_EQUALS_DESC( KErrNotFound, index, "next index is KErrNotFound" ); + + // check range + EUNIT_ASSERT_DESC( !context->InRange( thumbIndex-1 ), "thumbIndex-1 is not in range" ); + EUNIT_ASSERT_DESC( !context->InRange( thumbIndex+1 ), "thumbIndex+1 is not in range" ); + EUNIT_ASSERT_DESC( context->InRange( thumbIndex ), "thumbIndex is in range" ); + + CleanupStack::PopAndDestroy(context); + } + +void T_CShwEffectControl::TestErrorsInThumbnailLoadingL() + { + // set the size and focus of the list + iStubVisualList->iSize = 10; + iStubVisualList->iFocus = 1; + iStubMediaList->iCount = 10; + iStubMediaList->iFocus = 1; +// first test that first thumbnail does not load + // tell the stub context that its request has error + gThumbnailContextRequestCount = KErrCorrupt; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + + // check that we did not get an event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we did not yet get an event"); + + // start async wait loop + iWait.Start(); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + // tmp gets deleted here, EUnit checks for memory + } + +// test that second thumbnail does not load + // tell the stub context that its request is not yet completed + gThumbnailContextRequestCount = 1; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + // check that we did not get an event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we did not yet get new event"); + + // tell the stub context that the request has error + gThumbnailContextRequestCount = KErrCorrupt; + // tell the media list stub to notify that first thumbnail is loaded + iStubMediaList->NotifyAttributesAvailableL( iStubMediaList->iFocus ); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + // tmp gets deleted here, EUnit checks for memory + } + +// test HandleError call before first thumbnail + // tell the stub context that its request is not yet completed + gThumbnailContextRequestCount = 1; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + // check that we did not get an event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we did not yet get new event"); + + // tell the stub context that the request has error + gThumbnailContextRequestCount = KErrCorrupt; + // tell the media list stub to notify that there was an error + iStubMediaList->NotifyError( KErrNoMemory ); + + // start async wait loop + iWait.Start(); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + // tmp gets deleted here, EUnit checks for memory + } + +// test HandleError call after first thumbnail + // tell the stub context that its request is completed + gThumbnailContextRequestCount = KErrNone; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + // check that we did not get an event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we did not yet get new event"); + + // start async wait loop + iWait.Start(); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + + // tell the stub context that its request is not yet completed + gThumbnailContextRequestCount = 1; + // send start view + TShwEventStartView startView( 123 ); + tmp->NotifyL( &startView ); + + // tell the stub context that the request has error + gThumbnailContextRequestCount = KErrCorrupt; + // tell the media list stub to notify that there was an error + iStubMediaList->NotifyError( KErrNoMemory ); + + // start async wait loop + iWait.Start(); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToAdvance* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + // tmp gets deleted here, EUnit checks for memory + } + +// test HandleItemRemovedL call + // tell the stub context that its request is not completed + gThumbnailContextRequestCount = KErrNone; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + // check that we did not get an event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we did not yet get new event"); + + // start async wait loop + iWait.Start(); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventReadyToView* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + + // tell medialist stub to call HandleItemRemovedL + iStubMediaList->NotifyItemRemoved( 0, 1 ); + // this time the list was not empty so nothing done + // check that we got no event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we got no event"); + // remove items from stub medialist + iStubMediaList->iCount = 0; + // tell medialist stub to call HandleItemRemovedL + iStubMediaList->NotifyItemRemoved( 0, 1 ); + + // check that we got the event + EUNIT_ASSERT_EQUALS_DESC( 1, iEvents.Count(), "we got an event"); + // this was the first time the event was received so we get init complete event + EUNIT_ASSERT_DESC( + dynamic_cast< TShwEventFatalError* >( iEvents[ 0 ] ), + "TShwEventReadyToView received" ); + // delete and remove the event + delete iEvents[ 0 ]; + iEvents.Remove( 0 ); + + // tell medialist stub to call HandleItemRemovedL again + iStubMediaList->NotifyItemRemoved( 0, 1 ); + // this does nothing as the thumbnail loader was deleted and all contexts removed + // check that we got no event + EUNIT_ASSERT_EQUALS_DESC( 0, iEvents.Count(), "we got an event"); + // tmp gets deleted here, EUnit checks for memory + } + + // test also leave on SendEventL + // tell the stub context that its request is not completed + gThumbnailContextRequestCount = KErrNone; + { + // create an effect control, no need to delete or cleanupstack + TShwAutoPtr< CShwEffectControl > tmp = + CShwEffectControl::NewL( + iStubEffectManager, *iStubVisualList, *iStubMediaList, TSize( 320, 240 ) ); + // need to set the event queue + tmp->SetEventQueue( this ); + // perform the second phase of construction + TShwEventInitialize initEvent; + tmp->NotifyL( &initEvent ); + // start async wait loop + iWait.Start(); + // remove items from stub medialist + iStubMediaList->iCount = 0; + // tell SendEventL to leave + gSendEventLeaveCode = KErrNoMemory; + // tell medialist stub to call HandleItemRemovedL + TRAPD( error, iStubMediaList->NotifyItemRemoved( 0, 1 ) ); + // check that engine did panic + EUNIT_ASSERT_DESC( gNShwEnginePanicCalled, "Engine panic was called" ); + EUNIT_ASSERT_EQUALS_DESC( + NShwEngine::EEngineFatalError, error, "panic code was fatal error"); + } + + } + + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CShwEffectControl, + "Test suite for CShwEffectControl", + "UNIT" ) + +EUNIT_ALLOC_TEST( + "Construct-destruct test", + "CShwEffectControl", + "CShwEffectControl", + "FUNCTIONALITY", + EmptySetupL, TestConstructionL, Teardown ) // needs to have teardown as alloc test + +EUNIT_ALLOC_TEST( + "test TransitionCompleted", + "CShwEffectControl", + "TransitionCompleted", + "FUNCTIONALITY", + SetupL, TransitionCompletedL, Teardown ) + +EUNIT_NOT_DECORATED_TEST( // cant be decorated as active objects + "test TransitionCompleted", + "CShwEffectControl", + "TransitionCompleted", + "FUNCTIONALITY", + SetupL, TransitionCompleted2L, Teardown ) + +EUNIT_NOT_DECORATED_TEST( // cant be decorated as active objects + "test NotifyL", + "CShwEffectControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, NotifyLL, Teardown ) + +EUNIT_NOT_DECORATED_TEST( // cant be decorated as active objects + "slow image load", + "CShwEffectControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, SlowImageLoadL, Teardown ) + +EUNIT_NOT_DECORATED_TEST( // cant be decorated as active objects + "slow image load", + "CShwEffectControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, SlowImageLoad2L, Teardown ) + +EUNIT_TEST( + "HandleFocusChangedL", + "CShwEffectControl", + "HandleFocusChangedL", + "FUNCTIONALITY", + SetupL, HandleFocusChangedL, Teardown ) + +EUNIT_TEST( + "Thumbnail loading", + "CShwThumbnailContext", + "multiple", + "FUNCTIONALITY", + SetupL, TestThumbnailLoadingL, Teardown ) + +EUNIT_TEST( + "Thumbnail errors", + "CShwThumbnailLoader", + "multiple", + "FUNCTIONALITY", + EmptySetupL, TestErrorsInThumbnailLoadingL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2006-2007 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: Test for effect control for the slideshow + * +*/ + + + + +#ifndef __T_CSHWEFFECTCONTROL_H__ +#define __T_CSHWEFFECTCONTROL_H__ + +// EXTERNAL INCLUDES +#include +#include + + +// INTERNAL INCLUDES +#include "tmglxvisuallist_adapter.h" +#include "tmglxmedialist_stub.h" +#include "tmshweffectmanager_adapter.h" +#include "shweventqueue.h" + +// FORWARD DECLARATIONS +class CShwEffectControl; + +// CLASS DEFINITION +/** + * EUnit test suite for CShwEffectControl + * + */ +NONSHARABLE_CLASS( T_CShwEffectControl ) + : public CEUnitTestSuiteClass, + public MGlxMediaList_Stub_Observer, + public MGlxVisualList_Observer, + public MShwEffectManager_Observer, + public MShwEventQueue + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwEffectControl* NewL(); + static T_CShwEffectControl* NewLC(); + /** + * Destructor + */ + ~T_CShwEffectControl(); + + private: // Constructors and destructors + + T_CShwEffectControl(); + void ConstructL(); + + public: // from MGlxMediaList_Stub_Observer, MGlxVisualList_Observer, MShwEffectManager_Observer, MShwEventQueue + + void MGlxMediaList_MethodCalled( TMGlxMediaListMethodId aMethodId ); + void MGlxVisualList_MethodCalled( TMGlxVisualListMethodId aMethodId ); + void MShwEffectManager_MethodCalled( TMShwEffectManagerMethodId aMethodId ); + void SendEventL( MShwEvent* aEvent ); + + private: // New methods + + void EmptySetupL(); + void SetupL(); + void Teardown(); + + void TestConstructionL(); + void TransitionCompletedL(); + void TransitionCompleted2L(); + void NotifyLL(); + void SlowImageLoadL(); + void SlowImageLoad2L(); + void HandleFocusChangedL(); + void TestThumbnailLoadingL(); + void TestErrorsInThumbnailLoadingL(); + + private: // Data + + CShwEffectControl* iCShwEffectControl; + + TMGlxVisualList_Adapter* iStubVisualList; + TMGlxMediaList_Stub* iStubMediaList; + + TMShwEffectManager_Adapter iStubEffectManager; + + CActiveSchedulerWait iWait; + + RArray iVisualListCalls; + RArray iMediaListCalls; + RArray iEffectCalls; + RArray iEvents; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWEFFECTCONTROL_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffectcontrol/t_cshweffectcontrol_dllmain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2006-2007 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: Test for effect control for the slideshow + * +*/ + + + + +// CLASS HEADER +#include "T_CShwEffectControl.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CShwEffectControl::NewL(); + } + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2007-2007 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: Test for effect for the slideshow + * +*/ + + + +// CLASS HEADER +#include "t_cshweffects.h" + +// EXTERNAL INCLUDES +#include +#include + +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "shweffect.h" +#include "shwresourceutility.h" +#include "shwslideshowenginepanic.h" + +// ----------------------------------------------------------------------------- +// Stub for NShwEngine::Panic --> +// ----------------------------------------------------------------------------- +TBool gNShwEnginePanicCalled = EFalse; +namespace NShwEngine + { + extern void Panic( TShwEnginePanic aPanic ) + { + gNShwEnginePanicCalled = ETrue; + // in test situation just do a leave + User::Leave( aPanic ); + } + } +// ----------------------------------------------------------------------------- +// <-- Stub for NShwEngine::Panic +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// Stub for LocalisedNameL >>> +// ----------------------------------------------------------------------------- +TPtrC gNameForEffect( 0, 0 ); +_LIT( T_KZoomPanName, "ZoomAndPan" ); +_LIT( T_KCrossfadeName, "Crossfade" ); +HBufC* ShwResourceUtility::LocalisedNameL( TInt aResourceId ) + { + if( aResourceId == R_SHW_EFFECT_ZOOM_AND_PAN ) + { + gNameForEffect.Set( T_KZoomPanName() ); + return T_KZoomPanName().AllocL(); + } + else if( aResourceId == R_SHW_EFFECT_CROSS_FADE ) + { + gNameForEffect.Set( T_KCrossfadeName() ); + return T_KCrossfadeName().AllocL(); + } + gNameForEffect.Set( KNullDesC ); + return NULL; + } +// ----------------------------------------------------------------------------- +// <<< Stub for LocalisedNameL +// ----------------------------------------------------------------------------- + +class CTestControl : public CHuiControl + { + public: + static CTestControl* NewL( CHuiEnv& aEnv ) + { + return new (ELeave) CTestControl( aEnv ); + } + CTestControl( CHuiEnv& aEnv ) + : CHuiControl( aEnv ) + { + } + }; + +// CONSTRUCTION +T_CShwEffects* T_CShwEffects::NewLC( T_ShwEffectFactoryL* aEffectFactory ) + { + T_CShwEffects* self = new( ELeave ) T_CShwEffects; + CleanupStack::PushL( self ); + + self->iEffectFactory = aEffectFactory; + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_CShwEffects::~T_CShwEffects() + { + } + +// Default constructor +T_CShwEffects::T_CShwEffects() + { + } + +// Second phase construct +void T_CShwEffects::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void T_CShwEffects::EmptyL() + { + } + +void T_CShwEffects::SetupL() + { + // set name for the effect verification + gNameForEffect.Set( KNullDesC ); + + // create HUI env + iEnv = CHuiEnv::NewL(); + // create Display + iCoeDisplay = CHuiDisplayCoeControl::NewL( *iEnv, TRect( 0, 0, 100, 100 ) ); + + // create control + iControl = CTestControl::NewL( *iEnv ); + + // create the visual, ownership goes to iCoeDisplay + iVisual = CHuiImageVisual::AddNewL( *iControl ); + + // call the factory method to construct the effect + iEffect = (*iEffectFactory)(); + } + +void T_CShwEffects::Teardown() + { + // delete effect + delete iEffect; + iEffect = NULL; + + // delete control, it deletes the visual + delete iControl; + iControl = NULL; + + // delete display + delete iCoeDisplay; + iCoeDisplay = NULL; + + // delete env last + delete iEnv; + iEnv = NULL; + } + +void T_CShwEffects::T_ConstructorL() + { + // call the factory method to construct the effect + iEffect = (*iEffectFactory)(); + + EUNIT_ASSERT_DESC( iEffect, "Effect is constructed"); + // EUnit checks that memory is in balance + // teardown deletes the object + } + +void T_CShwEffects::T_PrepareViewLL() + { + // initialize with null lists but proper screen + iEffect->InitializeL( + NULL, + NULL, + NULL, + TSize( 320, 240 ) ); + // call prepare view with proper size + TSize size = iEffect->PrepareViewL( iVisual, TSize( 320, 240 ) ); + // verify that the thumbnail size is not 0,0 + EUNIT_ASSERT_GREATER_DESC( + size.iWidth, 0, "thumbnail size is set"); + EUNIT_ASSERT_GREATER_DESC( + size.iHeight, 0, "thumbnail size is set"); + + // call prepare view with unknown size + size = iEffect->PrepareViewL( iVisual, TSize( KErrNotFound, KErrNotFound ) ); + // verify that the thumbnail size is not 0,0 + EUNIT_ASSERT_GREATER_DESC( + size.iWidth, 0, "thumbnail size is set"); + EUNIT_ASSERT_GREATER_DESC( + size.iHeight, 0, "thumbnail size is set"); + } + +void T_CShwEffects::T_EnterViewLL() + { + MGlxLayout* layout = iEffect->EnterViewL( iVisual, 123, 345 ); + EUNIT_ASSERT_DESC( layout, "Layout is not NULL"); + } + +void T_CShwEffects::T_ExitViewL() + { + iEffect->ExitView( iVisual ); + // nothing to really verify what the effect is supposed to do + EUNIT_ASSERT_DESC( iEffect, "Effect is constructed"); + } + +void T_CShwEffects::T_EnterTransitionLL() + { + MGlxLayout* layout = iEffect->EnterTransitionL( iVisual, 321 ); + EUNIT_ASSERT_DESC( layout, "Layout is not NULL"); + } + +void T_CShwEffects::T_ExitTransitionL() + { + iEffect->ExitTransition( iVisual ); + // nothing to really verify what the effect is supposed to do + EUNIT_ASSERT_DESC( iEffect, "Effect is constructed"); + } + +void T_CShwEffects::T_PauseLL() + { + iEffect->PauseL(); + // nothing to really verify what the effect is supposed to do + EUNIT_ASSERT_DESC( iEffect, "Effect is constructed"); + } + +void T_CShwEffects::T_ResumeL() + { + iEffect->Resume(); + // nothing to really verify what the effect is supposed to do + EUNIT_ASSERT_DESC( iEffect, "Effect is constructed"); + } + +void T_CShwEffects::T_EffectInfoL() + { + // get effect info + TShwEffectInfo info = iEffect->EffectInfo(); + // assert that the info contains some values + EUNIT_ASSERT_EQUALS_DESC( info.iName, gNameForEffect, "Info has correct name"); + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CShwEffects, + "Test suite for MShwEffect", + "UNIT" ) + +EUNIT_ALLOC_TEST( + "Constructor test", + "MShwEffect", + "Constructor test", + "FUNCTIONALITY", + EmptyL, T_ConstructorL, Teardown ) // need teardown since alloc test + +EUNIT_TEST( + "PrepareViewL", + "CShwCrossFadeEffect", + "PrepareViewL", + "FUNCTIONALITY", + SetupL, T_PrepareViewLL, Teardown) + +EUNIT_TEST( + "EnterViewL", + "CShwCrossFadeEffect", + "EnterViewL", + "FUNCTIONALITY", + SetupL, T_EnterViewLL, Teardown) + +EUNIT_TEST( + "ExitView", + "CShwCrossFadeEffect", + "ExitView", + "FUNCTIONALITY", + SetupL, T_ExitViewL, Teardown) + +EUNIT_TEST( + "EnterTransitionL", + "CShwCrossFadeEffect", + "EnterTransitionL", + "FUNCTIONALITY", + SetupL, T_EnterTransitionLL, Teardown) + +EUNIT_TEST( + "ExitTransition", + "CShwCrossFadeEffect", + "ExitTransition", + "FUNCTIONALITY", + SetupL, T_ExitTransitionL, Teardown) + +EUNIT_TEST( + "PauseL", + "CShwCrossFadeEffect", + "PauseL", + "FUNCTIONALITY", + SetupL, T_PauseLL, Teardown) + +EUNIT_TEST( + "Resume", + "CShwCrossFadeEffect", + "Resume", + "FUNCTIONALITY", + SetupL, T_ResumeL, Teardown) + +EUNIT_TEST( + "EffectInfo", + "CShwCrossFadeEffect", + "EffectInfo", + "FUNCTIONALITY", + SetupL, T_EffectInfoL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007-2007 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: Test for control for the slideshow + * +*/ + + + + +#ifndef __T_CSHWEFFECT_H__ +#define __T_CSHWEFFECT_H__ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS +class MShwEffect; +class CHuiEnv; +class CHuiDisplayCoeControl; +class CHuiControl; +class CHuiImageVisual; + +// TYPE DEFINITIONS +typedef MShwEffect* (T_ShwEffectFactoryL)(); + +// CLASS DEFINITION +/** + * EUnit test suite for slideshow effects + */ +NONSHARABLE_CLASS( T_CShwEffects ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwEffects* NewLC( T_ShwEffectFactoryL* aEffectFactory ); + + /** + * Destructor + */ + ~T_CShwEffects(); + + private: // Constructors and destructors + + T_CShwEffects(); + void ConstructL(); + + private: // New methods + + void EmptyL(); + void SetupL(); + void Teardown(); + + void T_ConstructorL(); + void T_PrepareViewLL(); + void T_EnterViewLL(); + void T_ExitViewL(); + void T_EnterTransitionLL(); + void T_ExitTransitionL(); + void T_PauseLL(); + void T_ResumeL(); + void T_EffectInfoL(); + + private: // Data + + T_ShwEffectFactoryL* iEffectFactory; + MShwEffect* iEffect; + + CHuiEnv* iEnv; + CHuiDisplayCoeControl* iCoeDisplay; + CHuiControl* iControl; + CHuiImageVisual* iVisual; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWEFFECT_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshweffects/t_cshweffects_dllmain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007-2007 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: Test for control for the slideshow + * +*/ + + + + +// CLASS HEADER +#include "t_cshweffects.h" + +// EXTERNAL INCLUDES +#include + +// CLASS UNDER TEST +#include "shwcrossfadeeffect.h" +#include "shwzoomandpaneffect.h" + +MShwEffect* CreateCrossfadeL() + { + // create the normal zoom and pan + MShwEffect* eff = CShwCrossFadeEffect::NewLC(); + CleanupStack::Pop( eff ); + return eff; + } + +MShwEffect* CreateZoomAndPanL() + { + MShwEffect* eff = CShwZoomAndPanEffect::NewLC(); + CleanupStack::Pop( eff ); + return eff; + } + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + // Create a root suite to contain tests for both the effects + CEUnitTestSuite* rootSuite = + CEUnitTestSuite::NewLC( _L("ShwEffect Unit Tests") ); + + // Note that NewLC leaves the object in the cleanupstack. + rootSuite->AddL( T_CShwEffects::NewLC( &CreateCrossfadeL ) ); + CleanupStack::Pop(); // T_CShwEffects instance + + rootSuite->AddL( T_CShwEffects::NewLC( &CreateZoomAndPanL ) ); + CleanupStack::Pop(); // T_CShwEffects instance + + CleanupStack::Pop( rootSuite ); // rootSuite instance + + return rootSuite; + } + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,527 @@ +/* +* Copyright (c) 2007-2007 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: Test for music control for the slideshow + * +*/ + + + +// CLASS HEADER +#include "t_cshwmusiccontrol.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "shwevent.h" + +namespace + { + _LIT(KFileName, "c:\\knightrider.mp3"); + } + +// CONSTRUCTION +T_CShwMusicControl* T_CShwMusicControl::NewL() + { + T_CShwMusicControl* self = T_CShwMusicControl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +T_CShwMusicControl* T_CShwMusicControl::NewLC() + { + T_CShwMusicControl* self = new( ELeave ) T_CShwMusicControl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + + +// Destructor (virtual by CBase) +T_CShwMusicControl::~T_CShwMusicControl() + { + } + + + +// Default constructor +T_CShwMusicControl::T_CShwMusicControl() + :iMusicOn(EFalse), + iCurrentVolume(KErrNotFound), + iMaxVolume(KErrNotFound), + iPrevVolume(KErrNotFound) + { + } + +// Second phase construct +void T_CShwMusicControl::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +void T_CShwMusicControl::SendEventL(MShwEvent* aEvent) + { + iEvent = aEvent->CloneLC(); + CleanupStack::Pop( iEvent ); + } + +TBool gMusicOnCalled = EFalse; +void T_CShwMusicControl::MusicOnL() + { + EUNIT_PRINT(_L("Music is ON")); + iMusicOn = ETrue; + gMusicOnCalled = ETrue; + // leave if error code set + User::LeaveIfError( iLeaveInObserver ); + } + +TBool gMusicOffCalled = EFalse; +void T_CShwMusicControl::MusicOff() + { + EUNIT_PRINT(_L("Music is OFF")); + iMusicOn = EFalse; + gMusicOffCalled = ETrue; + } + + +void T_CShwMusicControl::MusicVolume(TInt aCurrentVolume, TInt aMaxVolume) + { + iPrevVolume = iCurrentVolume; + iCurrentVolume = aCurrentVolume; + iMaxVolume = aMaxVolume; + EUNIT_PRINT(_L("current volume %d"),aCurrentVolume); + if(iWait.IsStarted()) + { + iWait.AsyncStop(); + } + } + +void T_CShwMusicControl::ErrorWithTrackL( TInt aErrorCode ) + { + iErrorCode = aErrorCode; + } + +void T_CShwMusicControl::Empty() + { + } + +void T_CShwMusicControl::SetupL() + { + // reset current and max volume + iCurrentVolume = KErrNotFound; + iMaxVolume = KErrNotFound; + // reset error code + iErrorCode = KErrNone; + // reset leave flag + iLeaveInObserver = KErrNone; + // reset state flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + iCShwMusicControl = CShwMusicControl::NewL( *this, KFileName ); + // set the event queue - inherited from parent CShwEventPublisherBase + iCShwMusicControl->SetEventQueue(this); + } + + +void T_CShwMusicControl::Teardown() + { + delete iCShwMusicControl; + iCShwMusicControl = NULL; + + delete iEvent; + iEvent = NULL; + } + +void T_CShwMusicControl::TestConstructL() + { + EUNIT_PRINT(_L("CShwMusicControl::NewL")); + // create + iCShwMusicControl = CShwMusicControl::NewL(*this, KFileName); + // set the event queue + iCShwMusicControl->SetEventQueue(this); + // test that object exists + EUNIT_ASSERT_DESC(iCShwMusicControl, "object created"); + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // delete music control + delete iCShwMusicControl; + iCShwMusicControl = NULL; + // EUnit checks for memory leaks + } + +void T_CShwMusicControl::T_NotifyLL() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL(&start); + // Need to let the scheduler loop to get first volume callback + iWait.Start(); // Wait for notification of volume + EUNIT_ASSERT(iMusicOn == ETrue); + EUNIT_ASSERT(iCurrentVolume != KErrNotFound && iMaxVolume != KErrNotFound); + } + +void T_CShwMusicControl::T_NotifyL1L() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // if should evaluate false: if (event) + MShwEvent* iParam1 = NULL; + iCShwMusicControl->NotifyL(iParam1); + + EUNIT_ASSERT_DESC( !iEvent, "event was not received" ); + + // test also HandlePropertyL with unsupported property + iCShwMusicControl->HandlePropertyL( EPbPropertyMute, 0, 0 ); + // test that volume was not send + EUNIT_ASSERT( iCurrentVolume == KErrNotFound && iMaxVolume == KErrNotFound ); + } + +void T_CShwMusicControl::T_NotifyL2L() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL( &start ); + // Need to let the scheduler loop to get first volume callback + iWait.Start(); + // check that we got the volume + EUNIT_ASSERT(iCurrentVolume != KErrNotFound && iMaxVolume != KErrNotFound); + + // send pause + TShwEventPause pause; + iCShwMusicControl->NotifyL( &pause ); + EUNIT_ASSERT( iMusicOn == EFalse ); + + // send resume + TShwEventResume resume; + iCShwMusicControl->NotifyL( &resume ); + + EUNIT_ASSERT(iMusicOn != EFalse ); + } + +void T_CShwMusicControl::T_NotifyL3L() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // send resume before start + TShwEventResume resume; + iCShwMusicControl->NotifyL( &resume ); + EUNIT_ASSERT_DESC( iMusicOn == ETrue, "music is on" ); + + // Send pause before start, does not pause + TShwEventPause pause; + iCShwMusicControl->NotifyL( &pause ); + EUNIT_ASSERT_DESC( iMusicOn == EFalse, "music is off" ); + + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL( &start ); + // Need to let the scheduler loop to get first volume callback + iWait.Start(); + + // Second subsequent pause request + iCShwMusicControl->NotifyL( &pause ); + EUNIT_ASSERT_DESC( iMusicOn == EFalse, "music is now paused" ); + } + +void T_CShwMusicControl::T_NotifyL4L() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL(&start); + // Need to let the scheduler loop to get first volume callback + iWait.Start(); + + // if should evaluate false: if (event) + TShwEventVolumeDown vol; + iCShwMusicControl->NotifyL(&vol); + + // Need to let the scheduler loop to get another volume callback + iWait.Start(); + EUNIT_ASSERT_GREATER_DESC( iPrevVolume, iCurrentVolume, "volume should decrease" ); + EUNIT_ASSERT_NOT_EQUALS( KErrNotFound, iMaxVolume ); + + iMaxVolume = KErrNotFound; + } + +void T_CShwMusicControl::T_NotifyL5L() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL(&start); + // Need to let the scheduler loop to get first volume callback + iWait.Start(); + + // if should evaluate false: if (event) + TShwEventVolumeUp vol; + iCShwMusicControl->NotifyL(&vol); + + // Need to let the scheduler loop to get another volume callback + iWait.Start(); + EUNIT_ASSERT_GREATER_DESC( iCurrentVolume, iPrevVolume, "volume should increase" ); + EUNIT_ASSERT_NOT_EQUALS( KErrNotFound, iMaxVolume ); + iMaxVolume = KErrNotFound; + } + +void T_CShwMusicControl::T_ExtendedPlayL() + { + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNone, iErrorCode, "if there was error, make sure track file exists"); + + TShwEventStart start; + iCShwMusicControl->NotifyL( &start ); + + if (!iTimer) + { + iTimer = CPeriodic::NewL(EPriorityNormal); + } + + // play for 10 seconds + const TInt KPlayPeriod = 10 * 1000000; // Microseconds + TCallBack callBack(StopPlaying, this); + iTimer->Start(KPlayPeriod, KPlayPeriod, callBack); + + iPlayWait.Start(); + + delete iTimer; + iTimer = NULL; + + TShwEventPause pause; + iCShwMusicControl->NotifyL(&pause); + EUNIT_ASSERT(iMusicOn == EFalse); + + } + +TInt T_CShwMusicControl::StopPlaying(TAny* aMusicControl) + { + T_CShwMusicControl* self = reinterpret_cast(aMusicControl); + + if(self->iPlayWait.IsStarted()) + { + self->iPlayWait.AsyncStop(); + } + + return KErrNone; + } + +void T_CShwMusicControl::T_ErrorInFileL() + { + // need to reset state as the setup is empty + gMusicOnCalled = EFalse; + // file that does not exist + _LIT( KErrorFileName, "C:\\juubaduuba.mp123" ); + // create + iCShwMusicControl = CShwMusicControl::NewL( *this, KErrorFileName ); + // set the event queue + iCShwMusicControl->SetEventQueue( this ); + // test that object exists + EUNIT_ASSERT_DESC(iCShwMusicControl, "object created"); + + // test that error was called + // test that no error + EUNIT_ASSERT_EQUALS_DESC( + KErrNotFound, iErrorCode, "track should not exist"); + + // test that start is a no-op + TShwEventStart start; + iCShwMusicControl->NotifyL( &start ); + + // test that music is off + EUNIT_ASSERT_DESC( gMusicOnCalled == EFalse, "music on was not called" ); + + // delete music control + delete iCShwMusicControl; + iCShwMusicControl = NULL; + // EUnit checks for memory leaks + } + +void T_CShwMusicControl::T_LeaveInObserverL() + { + // make observer leave + iLeaveInObserver = KErrCorrupt; + + // send start event + TShwEventStart start; + iCShwMusicControl->NotifyL( &start ); + + // test that music is off + EUNIT_ASSERT_DESC( iMusicOn == EFalse, "music is off"); + EUNIT_ASSERT_DESC( gMusicOnCalled == ETrue, "music on was called (and it did leave)" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == ETrue, "music off was called" ); + // reset flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + // make observer not leave + iLeaveInObserver = KErrNone; + + // resend start event + iCShwMusicControl->NotifyL( &start ); + // test that music is on + EUNIT_ASSERT_DESC( iMusicOn == ETrue, "music is on"); + EUNIT_ASSERT_DESC( gMusicOnCalled == ETrue, "music on was called" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == EFalse, "music off was not called" ); + // reset flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + // send pause + TShwEventPause pause; + iCShwMusicControl->NotifyL( &pause ); + EUNIT_ASSERT_DESC( iMusicOn == EFalse, "music is off" ); + EUNIT_ASSERT_DESC( gMusicOnCalled == EFalse, "music on was not called" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == ETrue, "music off was called" ); + // reset flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + // make observer leave + iLeaveInObserver = KErrCorrupt; + + // send resume + TShwEventResume resume; + iCShwMusicControl->NotifyL( &resume ); + EUNIT_ASSERT_DESC( iMusicOn == EFalse, "music is off" ); + EUNIT_ASSERT_DESC( gMusicOnCalled == ETrue, "music on was called (and it did leave)" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == ETrue, "music off was called" ); + // reset flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + // send volume up + TShwEventVolumeUp vol; + iCShwMusicControl->NotifyL( &vol ); + EUNIT_ASSERT_DESC( gMusicOnCalled == EFalse, "music on was not called" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == EFalse, "music off was not called" ); + // reset flags + gMusicOnCalled = EFalse; + gMusicOffCalled = EFalse; + + // make observer not leave + iLeaveInObserver = KErrNone; + + // send resume + iCShwMusicControl->NotifyL( &resume ); + EUNIT_ASSERT_DESC( iMusicOn == ETrue, "music is on" ); + EUNIT_ASSERT_DESC( gMusicOnCalled == ETrue, "music on was called" ); + EUNIT_ASSERT_DESC( gMusicOffCalled == EFalse, "music off was not called" ); + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CShwMusicControl, + "Test suite for CShwMusicControl", + "UNIT" ) + +/* + Commented out as MPX crashes with Kern-exec 0 +EUNIT_ALLOC_TEST( + "Constructor test", + "CShwMusicControl", + "NewL", + "FUNCTIONALITY", + Empty, TestConstructL, Teardown ) +*/ +// these cant be decorated as the EUnit +// scheduler does not implement Error method +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 0", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyLL, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 1", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyL1L, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 2", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyL2L, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 3", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyL3L, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 4", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyL4L, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "NotifyL - test 5", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_NotifyL5L, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "Test error in file", + "CShwMusicControl", + "ConstructL, NotifyL", + "FUNCTIONALITY", + Empty, T_ErrorInFileL, Teardown) + +EUNIT_NOT_DECORATED_TEST( + "Test leave in observer", + "CShwMusicControl", + "NotifyL", + "FUNCTIONALITY", + SetupL, T_LeaveInObserverL, Teardown ) + +/* +commented out as no added value for the time beeing +EUNIT_NOT_DECORATED_TEST( + "Play for multitple seconds", + "CShwMusicControl", + "NotifyL - test 6", + "FUNCTIONALITY", + SetupL, T_ExtendedPlayL, Teardown) +*/ + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2007-2007 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: Test for music control for the slideshow + * +*/ + + + + +#ifndef __T_CSHWMUSICCONTROL_H__ +#define __T_CSHWMUSICCONTROL_H__ + +// EXTERNAL INCLUDES +#include +#include + + +// INTERNAL INCLUDES +#include "shweventqueue.h" +#include "shwmusiccontrol.h" +#include "shwmusicobserver.h" + +// FORWARD DECLARATIONS + + +const TInt KMaxFileLen = 256; + +// CLASS DEFINITION +/** + * EUnit test suite for CShwMusicControl + */ +NONSHARABLE_CLASS( T_CShwMusicControl ) + : public CEUnitTestSuiteClass, + public MShwMusicObserver, + public MShwEventQueue + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwMusicControl* NewL(); + static T_CShwMusicControl* NewLC(); + /** + * Destructor + */ + ~T_CShwMusicControl(); + + private: // Constructors and destructors + + T_CShwMusicControl(); + void ConstructL(); + + public: + static TInt StopPlaying(TAny* aMusicControl); + + public: // From MShwEventQueue + + void SendEventL( MShwEvent* aEvent ); + + + public: // From MShwMusicObserver + + void MusicOnL(); + void MusicOff(); + void MusicVolume(TInt aCurrentVolume, TInt aMaxVolume); + void ErrorWithTrackL(TInt aErrorCode); + + private: // New methods + + void SetupL(); + void Teardown(); + void Empty(); + + void TestConstructL(); + void T_NotifyLL(); + void T_NotifyL1L(); + void T_NotifyL2L(); + void T_NotifyL3L(); + void T_NotifyL4L(); + void T_NotifyL5L(); + void T_ExtendedPlayL(); + void T_ErrorInFileL(); + void T_LeaveInObserverL(); + + private: // Data + // The music state + TBool iMusicOn; + + // The music volume + TInt iCurrentVolume; + + // The maximum music volume + TInt iMaxVolume; + + // The previous music volume setting + // - used to test volume up and down. + TInt iPrevVolume; + + // Own: the class under test + CShwMusicControl* iCShwMusicControl; + + // Own: the event received from SendEventL + MShwEvent* iEvent; + + // Own: scheduler wait object + CActiveSchedulerWait iWait; + + // Own: scheduler wait object + CActiveSchedulerWait iPlayWait; + + // Own: a timer callback + CPeriodic* iTimer; + + /// Own: the error code from ErrorWithTrackL + TInt iErrorCode; + + /// Own: error code to cause a leave in observer + TInt iLeaveInObserver; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWMUSICCONTROL_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwmusiccontrol/t_cshwmusiccontrol_dllmain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007-2007 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: Test for music control for the slideshow + * +*/ + + + + +// CLASS HEADER +#include "t_cshwmusiccontrol.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CShwMusicControl::NewL(); + } + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,332 @@ +/* +* Copyright (c) 2007-2007 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: Test suite for CShwPlaybackFactory + * +*/ + + + +// CLASS HEADER +#include "t_cshwplaybackfactory.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "shwplaybackfactory.h" +#include "shwslideshowenginepanic.h" +#include "shwcrossfadeeffect.h" +#include "shwzoomandpaneffect.h" +#include "shwconstants.h" + +// ----------------------------------------------------------------------------- +// Stub for NShwEngine::Panic --> +// ----------------------------------------------------------------------------- +TBool gNShwEnginePanicCalled = EFalse; +namespace NShwEngine + { + extern void Panic( TShwEnginePanic aPanic ) + { + gNShwEnginePanicCalled = ETrue; + // in test situation just do a leave + User::Leave( aPanic ); + } + } +// ----------------------------------------------------------------------------- +// <-- Stub for NShwEngine::Panic +// ----------------------------------------------------------------------------- + +TGlxSetValueLayout gStubLayout( TGlxLayoutInfo::EPosition ); + +// ----------------------------------------------------------------------------- +// Stub for CShwCrossFadeEffect --> +// ----------------------------------------------------------------------------- +inline CShwCrossFadeEffect::CShwCrossFadeEffect() + { + } +CShwCrossFadeEffect* CShwCrossFadeEffect::NewLC() + { + CShwCrossFadeEffect* self = new (ELeave) CShwCrossFadeEffect; + CleanupStack::PushL( self ); + return self; + } +CShwCrossFadeEffect::~CShwCrossFadeEffect() + { + } +MShwEffect* CShwCrossFadeEffect::CloneLC() + { + return NewLC(); + } +void CShwCrossFadeEffect::InitializeL( + CHuiEnv* /*aHuiEnv*/, MGlxVisualList* /*aVisualList*/, + MGlxMediaList* /*aMediaList*/, TSize /*aScreenSize*/ ) + { + } +TSize CShwCrossFadeEffect::PrepareViewL( CHuiVisual* /*aVisual*/, TSize /*aSize*/ ) + { + return TSize( 0, 0 ); + } +MGlxLayout* CShwCrossFadeEffect::EnterViewL( + CHuiVisual* /*aVisual*/, TInt /*aDuration*/, TInt /*aDuration2*/ ) + { + return &gStubLayout; + } +void CShwCrossFadeEffect::ExitView( CHuiVisual* /*aVisual*/ ) + { + } +MGlxLayout* CShwCrossFadeEffect::EnterTransitionL( + CHuiVisual* /*aVisual*/, TInt /*aDuration*/ ) + { + return &gStubLayout; + } +void CShwCrossFadeEffect::ExitTransition( CHuiVisual* /*aVisual*/ ) + { + } +void CShwCrossFadeEffect::PauseL() + { + } +void CShwCrossFadeEffect::Resume() + { + } +// the effect info for zoom and pan +TShwEffectInfo gCrossFadeEffectInfo; +TShwEffectInfo CShwCrossFadeEffect::EffectInfo() + { + return gCrossFadeEffectInfo; + } + +// ----------------------------------------------------------------------------- +// <-- Stub for CShwCrossFadeEffect +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// Stub for CShwZoomAndPanEffect --> +// ----------------------------------------------------------------------------- +inline CShwZoomAndPanEffect::CShwZoomAndPanEffect() + { + } +CShwZoomAndPanEffect* CShwZoomAndPanEffect::NewLC() + { + CShwZoomAndPanEffect* self = new (ELeave) CShwZoomAndPanEffect; + CleanupStack::PushL( self ); + return self; + } +CShwZoomAndPanEffect::~CShwZoomAndPanEffect() + { + } +MShwEffect* CShwZoomAndPanEffect::CloneLC() + { + return NewLC(); + } +void CShwZoomAndPanEffect::InitializeL( + CHuiEnv* /*aHuiEnv*/, MGlxVisualList* /*aVisualList*/, + MGlxMediaList* /*aMediaList*/, TSize /*aScreenSize*/ ) + { + } +TSize CShwZoomAndPanEffect::PrepareViewL( CHuiVisual* /*aVisual*/, TSize /*aSize*/ ) + { + return TSize( 0, 0 ); + } +MGlxLayout* CShwZoomAndPanEffect::EnterViewL( + CHuiVisual* /*aVisual*/, TInt /*aDuration*/, TInt /*aDuration2*/ ) + { + return &gStubLayout; + } +void CShwZoomAndPanEffect::ExitView( CHuiVisual* /*aVisual*/ ) + { + } +MGlxLayout* CShwZoomAndPanEffect::EnterTransitionL( + CHuiVisual* /*aVisual*/, TInt /*aDuration*/ ) + { + return &gStubLayout; + } +void CShwZoomAndPanEffect::ExitTransition( CHuiVisual* /*aVisual*/ ) + { + } +void CShwZoomAndPanEffect::PauseL() + { + } +void CShwZoomAndPanEffect::Resume() + { + } +// the effect info for zoom and pan +TShwEffectInfo gZoomAndPanEffectInfo; +TShwEffectInfo CShwZoomAndPanEffect::EffectInfo() + { + return gZoomAndPanEffectInfo; + } + +// ----------------------------------------------------------------------------- +// <-- Stub for CShwZoomAndPanEffect +// ----------------------------------------------------------------------------- + +// CONSTRUCTION +T_CShwPlaybackFactory* T_CShwPlaybackFactory::NewL() + { + T_CShwPlaybackFactory* self = T_CShwPlaybackFactory::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +T_CShwPlaybackFactory* T_CShwPlaybackFactory::NewLC() + { + T_CShwPlaybackFactory* self = new( ELeave ) T_CShwPlaybackFactory(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_CShwPlaybackFactory::~T_CShwPlaybackFactory() + { + } + +// Default constructor +T_CShwPlaybackFactory::T_CShwPlaybackFactory() + { + } + +// Second phase construct +void T_CShwPlaybackFactory::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void T_CShwPlaybackFactory::Empty() + { + } + +void T_CShwPlaybackFactory::SetupL() + { + // create the stubs + iStubVisuallist = new( ELeave ) TMGlxVisualList_Adapter( this ); + iStubMedialist = new( ELeave ) TMGlxMediaList_Stub( this ); + + // fix the effect infos + gCrossFadeEffectInfo.iId.iPluginUid = NShwSlideshow::KDefaultEffectPluginUid; + gCrossFadeEffectInfo.iId.iIndex = NShwSlideshow::KEffectUidXFadeNormal; + gZoomAndPanEffectInfo.iId.iPluginUid = NShwSlideshow::KDefaultEffectPluginUid; + gZoomAndPanEffectInfo.iId.iIndex = NShwSlideshow::KEffectUidZoomAndPan; + + /// @todo add an own test case where the music observer is also given + /// so that the music control is constructed + iCShwPlaybackFactory = + CShwPlaybackFactory::NewL( + iHuiEnv, iStubVisuallist, iStubMedialist, *this, TSize( 100, 100 ) ); + } + +void T_CShwPlaybackFactory::Teardown() + { + delete iCShwPlaybackFactory; + iCShwPlaybackFactory = NULL; + delete iStubVisuallist; + iStubVisuallist = NULL; + delete iStubMedialist; + iStubMedialist = NULL; + } + +TInt gCounter = 0; + +void T_CShwPlaybackFactory::T_ContructL() + { + // trap the call as it will leave, dont trap oom as this is alloc test + EUNIT_TRAP_EXCEPT_ALLOC_D( err, + { + iCShwPlaybackFactory = + CShwPlaybackFactory::NewL( + iHuiEnv, iStubVisuallist, iStubMedialist, *this, TSize( 100, 100 ) ); + } ); + EUNIT_ASSERT_EQUALS_DESC( KErrArgument, err, "wrong effect tried to set" ); + EUNIT_ASSERT_DESC( !iCShwPlaybackFactory, "playback factory not created" ); + } + +void T_CShwPlaybackFactory::T_ContructValidEffectL() + { + EUNIT_PRINT( _L("T_ContructValidEffectL") ); + // call setup to test the succesfull case + SetupL(); + + EUNIT_ASSERT_DESC( iCShwPlaybackFactory, "Test that object created" ); + } + +void T_CShwPlaybackFactory::T_EventObserversL() + { + // get observers + RPointerArray< MShwEventObserver > obs = + iCShwPlaybackFactory->EventObservers(); + // check the amount + EUNIT_ASSERT_EQUALS_DESC( + obs.Count(), + 3, + "3 observers returned, music is off by default"); + } + +void T_CShwPlaybackFactory::T_EventPublishersL( ) + { + // get publishers + RPointerArray< MShwEventPublisher > obs = + iCShwPlaybackFactory->EventPublishers(); + // check the amount + EUNIT_ASSERT_EQUALS_DESC( + obs.Count(), + 3, + "3 publishers returned, music is off by default"); + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CShwPlaybackFactory, + "CShwPlaybackFactory test suite", + "UNIT" ) + +EUNIT_ALLOC_TEST( + "Constructor invalid effects", + "CShwPlaybackFactory", + "Constructor test", + "FUNCTIONALITY", + Empty, T_ContructL, Teardown ) + +EUNIT_ALLOC_TEST( + "Constructor valid effects", + "CShwPlaybackFactory", + "Constructor test", + "FUNCTIONALITY", + Empty, T_ContructValidEffectL, Teardown ) + +EUNIT_ALLOC_TEST( + "EventObservers", + "CShwPlaybackFactory", + "EventObservers", + "FUNCTIONALITY", + SetupL, T_EventObserversL, Teardown) + +EUNIT_ALLOC_TEST( + "EventPublishers", + "CShwPlaybackFactory", + "EventPublishers", + "FUNCTIONALITY", + SetupL, T_EventPublishersL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007-2007 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: Test suite for CShwPlaybackFactory + * +*/ + + + + +#ifndef __T_CSHWPLAYBACKFACTORY_H__ +#define __T_CSHWPLAYBACKFACTORY_H__ + +// EXTERNAL INCLUDES +#include +#include + + +// INTERNAL INCLUDES +#include "shwplaybackfactory.h" +#include "shwmusicobserver.h" + +#include "tmglxmedialist_stub.h" +#include "tmglxvisuallist_adapter.h" + +// FORWARD DECLARATIONS +class CHuiEnv; + +// CLASS DEFINITION +/** + * EUnit test suite for CShwPlaybackFactory + */ +NONSHARABLE_CLASS( T_CShwPlaybackFactory ) + : public CEUnitTestSuiteClass, + public MGlxMediaList_Stub_Observer, + public MGlxVisualList_Observer, + public MShwMusicObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwPlaybackFactory* NewL(); + static T_CShwPlaybackFactory* NewLC(); + /** + * Destructor + */ + ~T_CShwPlaybackFactory(); + + private: // Constructors and destructors + + T_CShwPlaybackFactory(); + void ConstructL(); + + public: // from MGlxMediaList_Stub_Observer and MGlxVisualList_Observer + + void MGlxMediaList_MethodCalled( TMGlxMediaListMethodId /*aMethodId*/ ) + { // not interested on the events + } + void MGlxVisualList_MethodCalled( TMGlxVisualListMethodId /*aMethodId*/ ) + { // not interested on the events + } + + public: // From MShwMusicObserver + + void MusicOnL() + { // not interested on the events + } + void MusicOff() + { // not interested on the events + } + void MusicVolume( TInt /*aCurrentVolume*/, TInt /*aMaxVolume*/ ) + { // not interested on the events + } + void ErrorWithTrackL( TInt /*aErrorCode*/ ) + { // not interested on the events + } + + private: // New methods + + void Empty(); + void SetupL(); + void Teardown(); + void T_ContructL(); + void T_ContructValidEffectL(); + void T_EventObserversL(); + void T_EventPublishersL(); + + private: // Data + + CHuiEnv* iHuiEnv; + TMGlxMediaList_Stub* iStubMedialist; + TMGlxVisualList_Adapter* iStubVisuallist; + + // class under test + CShwPlaybackFactory* iCShwPlaybackFactory; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWPLAYBACKFACTORY_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwplaybackfactory/t_cshwplaybackfactory_dllmain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007-2007 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: Test suite for CShwPlaybackFactory + * +*/ + + + + +// CLASS HEADER +#include "t_cshwplaybackfactory.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CShwPlaybackFactory::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodel.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2004 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: Test for settings model for the slideshow +* +*/ + + + + +// CLASS HEADER +#include "t_cshwsettingsmodel.h" + +// CLASS UNDER TEST +#include "shwsettingsmodel.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES + + +// CONSTRUCTION +T_CShwSettingsModel* T_CShwSettingsModel::NewL() + { + T_CShwSettingsModel* self = T_CShwSettingsModel::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +T_CShwSettingsModel* T_CShwSettingsModel::NewLC() + { + T_CShwSettingsModel* self = new (ELeave) T_CShwSettingsModel(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + + +// Destructor (virtual by CBase) +T_CShwSettingsModel::~T_CShwSettingsModel() + { + } + + +// Default constructor +T_CShwSettingsModel::T_CShwSettingsModel() + { + } + + +// Second phase construct +void T_CShwSettingsModel::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + +void T_CShwSettingsModel::SetupL() + { + iShwSettingsModel = CShwSettingsModel::NewL(); + } + +void T_CShwSettingsModel::Teardown() + { + delete iShwSettingsModel; + iShwSettingsModel = NULL; + + const TInt KEngineId = 0x200071D3; + const TUid KEngineUid = TUid::Uid(KEngineId); + TRAP_IGNORE( + { + CRepository* repository = CRepository::NewL(KEngineUid); + TInt err = repository->Reset(); + User::LeaveIfError(err); + delete repository; + } ); + } + + + +void T_CShwSettingsModel::TestGetDefaultValues() + { + TBuf fileNamePath; + iShwSettingsModel->MusicNamePathL(fileNamePath); + _LIT(KDefaultFileName, "None"); + EUNIT_ASSERT(fileNamePath == KDefaultFileName); + + const TUint KDefaultUid = 0x200071D6; + TUid defaultUId; + defaultUId.iUid = KDefaultUid; + + TUid uId; + TUint index = 0; + iShwSettingsModel->TransitionTypeL(uId, index); + EUNIT_ASSERT(defaultUId.iUid == uId.iUid); + EUNIT_ASSERT_EQUALS_DESC( 1, index, "default index is 0"); + } + +void T_CShwSettingsModel::TestSetAndGetMusicPathL() + { + // Set music name and path field. + _LIT(KTestFileName, "c:\\test\\knightrider.mp3"); + iShwSettingsModel->SaveMusicNamePathL( KTestFileName() ); + + // Compare returned values to those set. + TFileName fileNamePath; + iShwSettingsModel->MusicNamePathL(fileNamePath); + EUNIT_ASSERT(fileNamePath == KTestFileName); + + // try setting an empty music name + iShwSettingsModel->SaveMusicNamePathL( KNullDesC() ); + // test that it was not set + iShwSettingsModel->MusicNamePathL(fileNamePath); + EUNIT_ASSERT(fileNamePath == KTestFileName); + } + + +void T_CShwSettingsModel::TestSetAndGetMusicOnOffL() + { + iShwSettingsModel->SaveMusicStateL(ETrue); + EUNIT_ASSERT(iShwSettingsModel->MusicOnL() == ETrue); + } + + +void T_CShwSettingsModel::TestSetAndGetTransDelayL() + { + const TUint KTimeDelay = 5; + iShwSettingsModel->SaveTransDelayL(KTimeDelay); + EUNIT_ASSERT(iShwSettingsModel->TransDelayL() == KTimeDelay); + } + + +void T_CShwSettingsModel::TestSetAndGetTransitionTypeL() + { + const TUint KUid = 0x01234567; + TUid uId1; + uId1.iUid = KUid; + iShwSettingsModel->SaveTransitionTypeL(uId1, 1); + + TUid uId2; + TUint index = 0; + iShwSettingsModel->TransitionTypeL(uId2, index); + EUNIT_ASSERT(uId1.iUid == uId2.iUid); + EUNIT_ASSERT(index == 1); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + T_CShwSettingsModel, + "Test suite for CShwSettingsModel", + "MODULE" ) + +EUNIT_TEST( + "Test Get Default Values", + "TestGetDefaultValues", + "Central Repositoy getter - default values", + "FUNCTIONALITY", + SetupL, TestGetDefaultValues, Teardown) + + +EUNIT_TEST( + "Test Set And Get Music Path", + "TestSetAndGetMusicPath", + "Music name and path Central Repositoy setter and getter", + "FUNCTIONALITY", + SetupL, TestSetAndGetMusicPathL, Teardown) + + +EUNIT_TEST( + "Test Set And Get Music On/Off", + "TestSetAndGetMusicOnOffL", + "Music On/Off Central Repositoy setter and getter", + "FUNCTIONALITY", + SetupL, TestSetAndGetMusicOnOffL, Teardown) + + +EUNIT_TEST( + "Test Set And Get Transition Delay", + "TestSetAndGetTransDelayL", + "Transition Delay Central Repositoy setter and getter", + "FUNCTIONALITY", + SetupL, TestSetAndGetTransDelayL, Teardown) + + +EUNIT_TEST( + "Test Set And Get Transition Type", + "TestSetAndGetTransitionTypeL", + "Transition Type Central Repositoy setter and getter", + "FUNCTIONALITY", + SetupL, TestSetAndGetTransitionTypeL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodel.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2007-2007 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: Test for settings model for the slideshow + * +*/ + + + + + +#ifndef __T_CSHWSETTINGSMODEL_H__ +#define __T_CSHWSETTINGSMODEL_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class CShwSettingsModel; + +// CLASS DEFINITION +/** + * + * Test class for CShwSettingsModel + * + */ +NONSHARABLE_CLASS( T_CShwSettingsModel ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwSettingsModel* NewL(); + static T_CShwSettingsModel* NewLC(); + /** + * Destructor + */ + ~T_CShwSettingsModel(); + + private: // Constructors and destructors + + T_CShwSettingsModel(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestGetDefaultValues(); + + void TestSetAndGetMusicPathL(); + + void TestSetAndGetMusicOnOffL(); + + void TestSetAndGetTransDelayL(); + + void TestSetAndGetTransitionTypeL(); + + + private: // Data + + CShwSettingsModel* iShwSettingsModel; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWSETTINGSMODEL_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodelDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwsettingsmodel/t_cshwsettingsmodelDllMain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2004 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: Test for settings model for the slideshow +* +*/ + + + + +// CLASS HEADER +#include "T_CShwSettingsModel.h" + +// EXTERNAL INCLUDES +#include + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CShwSettingsModel::NewL(); + } + +// END OF FILE + + + + + + diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,1069 @@ +/* +* Copyright (c) 2007-2007 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: Test for zoom and pan effect in slideshow + * +*/ + + + +// CLASS HEADER +#include "t_cshwzoomandpaneffect.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "shwzoomandpaneffect.h" +#include "shwzoomandpanlayout.h" +#include "shwcrossfadelayout.h" +#include "shwcurvefactory.h" +#include "shwconstants.h" +#include "shwautoptr.h" +#include "shwcallback.h" +#include "shwslideshowenginepanic.h" +#include "shwgeometryutilities.h" + +using namespace NShwSlideshow; + +// ----------------------------------------------------------------------------- +// Stub for NShwEngine::Panic --> +// ----------------------------------------------------------------------------- +TBool gNShwEnginePanicCalled = EFalse; +namespace NShwEngine + { + extern void Panic( TShwEnginePanic aPanic ) + { + gNShwEnginePanicCalled = ETrue; + // in test situation just do a leave + User::Leave( aPanic ); + } + } +// ----------------------------------------------------------------------------- +// <-- Stub for NShwEngine::Panic +// ----------------------------------------------------------------------------- + +// LOCAL HELPERs +namespace + { + /** + * @param aSource the TReal32 to round + * @return a rounded TInt + */ + inline TInt TReal2TInt( TReal32 aSource ) + { + if( aSource < 0 ) + { + // just subst 0.5 and cast, -0.4 becomes -0.9 and typecast + // truncates it to 0, -0.6 becomes -1.1 and its truncated to -1 + return TInt( aSource - TReal32( 0.5 ) ); + } + else + { + // just add 0.5 and cast, 0.4 becomes 0.9 and typecast + // truncates it to 0, 0.6 becomes 1.1 and its truncated to 1 + return TInt( aSource + TReal32( 0.5 ) ); + } + } + } + +class CTestControl : public CHuiControl + { + public: + static CTestControl* NewL( CHuiEnv& aEnv ) + { + return new (ELeave) CTestControl( aEnv ); + } + CTestControl( CHuiEnv& aEnv ) + : CHuiControl( aEnv ) + { + } + }; + +// CONSTRUCTION +T_CShwZoomAndPanEffect* T_CShwZoomAndPanEffect::NewL() + { + T_CShwZoomAndPanEffect* self = T_CShwZoomAndPanEffect::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +T_CShwZoomAndPanEffect* T_CShwZoomAndPanEffect::NewLC() + { + T_CShwZoomAndPanEffect* self = new( ELeave ) T_CShwZoomAndPanEffect(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +T_CShwZoomAndPanEffect::~T_CShwZoomAndPanEffect() + { + } + +// Default constructor +T_CShwZoomAndPanEffect::T_CShwZoomAndPanEffect() + { + } + +// Second phase construct +void T_CShwZoomAndPanEffect::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS +// global constant for screensize +const TInt gScreenWidth = 100; +const TInt gScreenHeight = 100; +const TRect gScreenRect( 0, 0, gScreenWidth, gScreenHeight ); +void T_CShwZoomAndPanEffect::Empty() + { + } + +void T_CShwZoomAndPanEffect::SetupL() + { + // create env + iEnv = CHuiEnv::NewL(); + + // create Display + iCoeDisplay = CHuiDisplayCoeControl::NewL( *iEnv, gScreenRect ); + + // create control + iControl = CTestControl::NewL( *iEnv ); + + // create the visual, ownership goes to iControl + iVisual = CHuiImageVisual::AddNewL( *iControl ); + + // create class under test + CShwZoomAndPanEffect* tmp = CShwZoomAndPanEffect::NewLC(); + // take ownership + iCShwZoomAndPanEffect = tmp; + // remove the pointer from cleanup stack + CleanupStack::Pop( tmp ); + } + +void T_CShwZoomAndPanEffect::Teardown() + { + // delete class under test + delete iCShwZoomAndPanEffect; + iCShwZoomAndPanEffect = NULL; + + // delete control, it also deletes the visual + delete iControl; + iControl = NULL; + + // delete display + delete iCoeDisplay; + iCoeDisplay = NULL; + + // delete environment + delete iEnv; + iEnv = NULL; + } + +void T_CShwZoomAndPanEffect::T_TestGeometryAlgorithmsL() + { + // use the namespace for coord utilities + using namespace NShwGeometryUtilities; + + // test FitDimension + // fit width with same values + { + TInt width = 10; + TInt height = 10; + FitDimension( width, height, 10 ); + EUNIT_ASSERT_EQUALS_DESC( 10, width, "width is same" ); + EUNIT_ASSERT_EQUALS_DESC( 10, height, "height is same" ); + } + // fit width with width greater + { + TInt width = 20; + TInt height = 10; + FitDimension( width, height, 10 ); + EUNIT_ASSERT_EQUALS_DESC( 20, width, "width is same" ); + EUNIT_ASSERT_EQUALS_DESC( 10, height, "height is same" ); + } + // fit width with new height greater + { + TInt width = 20; + TInt height = 10; + FitDimension( width, height, 20 ); + EUNIT_ASSERT_EQUALS_DESC( 40, width, "width increased" ); + EUNIT_ASSERT_EQUALS_DESC( 20, height, "height increased" ); + } + // fit width with new height smaller + { + TInt width = 22; + TInt height = 11; + FitDimension( width, height, 5 ); + EUNIT_ASSERT_EQUALS_DESC( 10, width, "width decreased" ); + EUNIT_ASSERT_EQUALS_DESC( 5, height, "height decreased" ); + } + + // fit height with same values + { + TInt width = 99; + TInt height = 88; + FitDimension( height, width, 99 ); + EUNIT_ASSERT_EQUALS_DESC( 99, width, "width is same" ); + EUNIT_ASSERT_EQUALS_DESC( 88, height, "height is same" ); + } + // fit height with width greater + { + TInt width = 22; + TInt height = 11; + FitDimension( height, width, 22 ); + EUNIT_ASSERT_EQUALS_DESC( 22, width, "width is same" ); + EUNIT_ASSERT_EQUALS_DESC( 11, height, "height is same" ); + } + // fit height with new width greater + { + TInt width = 22; + TInt height = 11; + FitDimension( height, width, 33 ); + EUNIT_ASSERT_EQUALS_DESC( 33, width, "width increased" ); + EUNIT_ASSERT_EQUALS_DESC( 16, height, "height increased" ); + } + // fit height with new width smaller + { + TInt width = 99; + TInt height = 88; + FitDimension( height, width, 88 ); + EUNIT_ASSERT_EQUALS_DESC( 88, width, "width increased" ); + EUNIT_ASSERT_EQUALS_DESC( 78, height, "height increased" ); + } + + // test FitInsideBox + // fit with same width and height + { + TInt width = 99; + TInt height = 99; + FitInsideBox( width, height, 99, 99 ); + EUNIT_ASSERT_EQUALS_DESC( 99, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 99, height, "height is same as box" ); + } + // fit with smaller width and height + { + TInt width = 99; + TInt height = 99; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 99, width, "width did not change" ); + EUNIT_ASSERT_EQUALS_DESC( 99, height, "height did not change" ); + } + // fit with greater width and height + { + TInt width = 111; + TInt height = 111; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with greater and width closer to box + { + TInt width = 150; + TInt height = 200; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 75, width, "width is smaller" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with greater and height closer to box + { + TInt width = 150; + TInt height = 100; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 66, height, "height is smaller" ); + } + // fit with smaller and width closer to box + { + TInt width = 75; + TInt height = 40; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 75, width, "width did not change" ); + EUNIT_ASSERT_EQUALS_DESC( 40, height, "height did not change" ); + } + // fit with smaller and height closer to box + { + TInt width = 60; + TInt height = 90; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 60, width, "width did not change" ); + EUNIT_ASSERT_EQUALS_DESC( 90, height, "height did not change" ); + } + // fit with width greater and height smaller to box + { + TInt width = 110; + TInt height = 90; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 81, height, "height is smaller" ); + } + // fit with height greater and width smaller to box + { + TInt width = 90; + TInt height = 120; + FitInsideBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 90*100/120, width, "width is smaller" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + + // test FitToCoverBox + // fit with same width and height + { + TInt width = 99; + TInt height = 99; + FitToCoverBox( width, height, 99, 99 ); + EUNIT_ASSERT_EQUALS_DESC( 99, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 99, height, "height is same as box" ); + } + // fit with smaller width and height + { + TInt width = 99; + TInt height = 99; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with greater width and height + { + TInt width = 111; + TInt height = 111; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with greater and width closer to box + { + TInt width = 150; + TInt height = 200; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 133, height, "height is greater" ); + } + // fit with greater and height closer to box + { + TInt width = 150; + TInt height = 100; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 150, width, "width is greater than box" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with greater and height closer to box + { + TInt width = 300; + TInt height = 200; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 150, width, "width is greater than box" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with smaller and width closer to box + { + TInt width = 75; + TInt height = 40; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 187, width, "width is greater" ); + EUNIT_ASSERT_EQUALS_DESC( 100, height, "height is same as box" ); + } + // fit with smaller and height closer to box + { + TInt width = 60; + TInt height = 90; + FitToCoverBox( width, height, 100, 100 ); + EUNIT_ASSERT_EQUALS_DESC( 100, width, "width is same as box" ); + EUNIT_ASSERT_EQUALS_DESC( 150, height, "height is greater" ); + } + } + +void T_CShwZoomAndPanEffect::T_LayoutTestL() + { +// test zoom and pan + // create the layout + TEUnitFillMem< TShwZoomAndPanLayout > layout; + + // check that layout has correct init values + // need to upcast to get access to public functions + MGlxLayout& base = static_cast< MGlxLayout& >( layout ); + TGlxLayoutInfoResetter info; + info.iPosition.iX = -1; + info.iPosition.iY = -1; + info.iSize.iX = -1; + info.iSize.iY = -1; + + base.SetLayoutValues( info ); + // verify that the position was not set + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iX,"x position not changed" ); + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iY,"y position not changed" ); + // check size + EUNIT_ASSERT_NOT_EQUALS_DESC( + -1, (TInt)info.iSize.iX,"x size changed" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + -1, (TInt)info.iSize.iY,"y size changed" ); + + // set custom screen size and image size; image smaller than screen + layout.SetSizes( TSize( 99, 88 ), TSize( 44, 55 ), TSize( 500, 500 ) ); + // redo layout + base.SetLayoutValues( info ); + // verify that the position was not set + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iX,"x position not changed" ); + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iY,"y position not changed" ); + // check size + EUNIT_ASSERT_EQUALS_DESC( 99, TReal2TInt( info.iSize.iX ),"x size changed" ); + EUNIT_ASSERT_EQUALS_DESC( 124, TReal2TInt( info.iSize.iY ),"y size changed" ); + + // set custom screen size and image size; image larger than screen + layout.SetSizes( TSize( 99, 88 ), TSize( 144, 155 ), TSize( 500, 500 ) ); + // redo layout + base.SetLayoutValues( info ); + // verify that the position was not set + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iX,"x position not changed" ); + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iY,"y position not changed" ); + // check size + EUNIT_ASSERT_EQUALS_DESC( 99, TReal2TInt( info.iSize.iX ),"x size changed" ); + EUNIT_ASSERT_EQUALS_DESC( 107, TReal2TInt( info.iSize.iY ),"y size changed" ); + + // set custom screen size and image size; image partially larger than screen + layout.SetSizes( TSize( 99, 88 ), TSize( 100, 15 ), TSize( 500, 500 ) ); + // redo layout + base.SetLayoutValues( info ); + // verify that the position was not set + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iX,"x position not changed" ); + EUNIT_ASSERT_EQUALS_DESC( -1, (TInt)info.iPosition.iY,"y position not changed" ); + // check size + EUNIT_ASSERT_EQUALS_DESC( 587, TReal2TInt( info.iSize.iX ),"x size changed" ); + EUNIT_ASSERT_EQUALS_DESC( 88, TReal2TInt( info.iSize.iY ),"y size changed" ); + + // set big enough image so that it zooms + layout.SetSizes( TSize( 100, 100 ), TSize( 200, 150 ), TSize( 500, 500 ) ); + layout.StartZoom( TShwZoomAndPanLayout::EZoomIn, 0 ); + // redo layout + base.SetLayoutValues( info ); + // check that layout is changed + EUNIT_ASSERT_DESC( layout.Changed(), "layout is changed" ); + // clear changeflag + layout.ClearChanged(); + EUNIT_ASSERT_DESC( !layout.Changed(), "layout is not changed" ); + +// test crossfade + // create the crossfade layout + TEUnitFillMem< TShwCrossFadeLayout > cflayout; + // get base class pointer + MGlxLayout& base2 = static_cast< MGlxLayout& >( cflayout ); + // reset info opacity + info.iOpacity = -1; + // run the layout + base2.SetLayoutValues( info ); + // verify that opacity was set to minimum + EUNIT_ASSERT_EQUALS_DESC( + TInt( KMinOpacity ), TReal2TInt( info.iOpacity ),"opacity is minimum" ); + // check that layout is not changed + EUNIT_ASSERT_DESC( !cflayout.Changed(), "layout is not changed" ); + // set new value + cflayout.Set( 2.0, 0 ); + // reset info opacity + info.iOpacity = -1; + // run the layout + base2.SetLayoutValues( info ); + // check that layout is changed + EUNIT_ASSERT_DESC( cflayout.Changed(), "layout is changed" ); + // verify that opacity was set to maximum + EUNIT_ASSERT_EQUALS_DESC( + TInt( KMaxOpacity ), TReal2TInt( info.iOpacity ),"opacity is maximum" ); + // clear change flag + cflayout.ClearChanged(); + EUNIT_ASSERT_DESC( !cflayout.Changed(), "layout is not changed" ); + } + +void T_CShwZoomAndPanEffect::T_CurveTestL() + { + // create env, no need to delete or cleanupstack + TShwAutoPtr< CHuiEnv > env = CHuiEnv::NewL(); + + // create curve path with 200 length + TShwAutoPtr< CHuiCurvePath > ellipsis = + NShwCurveFactory::CreateEllipsisL( TSize( 100, 200 ), 200 ); + + // the ellipsis is clockwise around the box + // check ellipsis values, point 0 + TReal32 x_value = ellipsis->MapValue( 0, 0 ); + TReal32 y_value = ellipsis->MapValue( 0, 1 ); + EUNIT_ASSERT_EQUALS_DESC( 50, TReal2TInt( x_value ), "x coordinate"); + EUNIT_ASSERT_EQUALS_DESC( 0, TReal2TInt( y_value ), "y coordinate"); + + // point 50 + x_value = ellipsis->MapValue( 50, 0 ); + y_value = ellipsis->MapValue( 50, 1 ); + EUNIT_ASSERT_EQUALS_DESC( 0, TReal2TInt( x_value ), "x coordinate"); + EUNIT_ASSERT_EQUALS_DESC( 100, TReal2TInt( y_value ), "y coordinate"); + + // point 100 + x_value = ellipsis->MapValue( 100, 0 ); + y_value = ellipsis->MapValue( 100, 1 ); + EUNIT_ASSERT_EQUALS_DESC( -50, TReal2TInt( x_value ), "x coordinate"); + EUNIT_ASSERT_EQUALS_DESC( 0, TReal2TInt( y_value ), "y coordinate"); + + // point 150 + x_value = ellipsis->MapValue( 150, 0 ); + y_value = ellipsis->MapValue( 150, 1 ); + EUNIT_ASSERT_EQUALS_DESC( 0, TReal2TInt( x_value ), "x coordinate"); + EUNIT_ASSERT_EQUALS_DESC( -100, TReal2TInt( y_value ), "y coordinate"); + + // point 200 + x_value = ellipsis->MapValue( 200, 0 ); + y_value = ellipsis->MapValue( 200, 1 ); + EUNIT_ASSERT_EQUALS_DESC( 50, TReal2TInt( x_value ), "x coordinate"); + EUNIT_ASSERT_EQUALS_DESC( 0, TReal2TInt( y_value ), "y coordinate"); + } + +void T_CShwZoomAndPanEffect::T_ZoomAndPanTestL() + { + // create env, no need to delete or cleanupstack + TShwAutoPtr< CHuiEnv > env = CHuiEnv::NewL(); + + // size of screen + const TInt screenX = 320; + const TInt screenY = 200; + TSize screen( screenX, screenY ); + // size of image, smaller than screen x KMaxZoomAndPanFactor + // but larger than screen + const TInt originalImageX = ( screenX + screenX * KMaxZoomAndPanFactor ) / 2; + const TInt originalImageY = ( screenY + screenY * KMaxZoomAndPanFactor ) / 2; + TSize image( originalImageX, originalImageY ); + // create curve path with 100 length + TShwAutoPtr< CHuiCurvePath > ellipsis = + NShwCurveFactory::CreateEllipsisL( screen, 100 ); + + // create the layout + TEUnitFillMem< TShwZoomAndPanLayout > layout; + // set screen and image size and maximum size + layout.SetSizes( screen, image, + TSize( screenX * KMaxZoomAndPanFactor, screenY * KMaxZoomAndPanFactor ) ); + // set the panning curve + layout.SetPanningCurve( &ellipsis ); + + // check that layout has correct init values + // need to upcast to get access to public functions + MGlxLayout& base = static_cast< MGlxLayout& >( layout ); + TGlxLayoutInfoResetter info; + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + // run the layout + base.SetLayoutValues( info ); + // verify that the position was set properly, the initial size is minimum + // so pan gets scaled to 0 + TInt initialXonCurve = 160; + TInt initialYonCurve = 0; + EUNIT_ASSERT_EQUALS_DESC( + 0, TReal2TInt( info.iPosition.iX ),"x position set" ); + EUNIT_ASSERT_EQUALS_DESC( + 0, TReal2TInt( info.iPosition.iY ),"y position set" ); + // verify size + EUNIT_ASSERT_EQUALS_DESC( + screenX, TReal2TInt( info.iSize.iX ),"default x size is screen size" ); + EUNIT_ASSERT_EQUALS_DESC( + screenY, TReal2TInt( info.iSize.iY ),"default y size is screen size" ); + + // do zoom in in 1 second + layout.StartZoom( TShwZoomAndPanLayout::EZoomIn, 1 ); + + // create timer to give us callback + TShwAutoPtr< CPeriodic > timer = CPeriodic::NewL( CActive::EPriorityStandard ); + // wait for 1.5 seconds (to be sure the zoom completes) + timer->Start(1.5 * 1000000, 1.5 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + // run the layout + base.SetLayoutValues( info ); + // verify that the position was set; zoom in does one half of the curve + EUNIT_ASSERT_EQUALS_DESC( + -initialXonCurve, TReal2TInt( info.iPosition.iX ),"x position looped on the opposite side" ); + EUNIT_ASSERT_EQUALS_DESC( + initialYonCurve, TReal2TInt( info.iPosition.iY ),"y position looped back" ); + // verify size, after zoom in we are in 4x screen size + EUNIT_ASSERT_GREATER_DESC( + TReal2TInt( info.iSize.iX ), originalImageX,"x size is greater than original size" ); + EUNIT_ASSERT_GREATER_DESC( + TReal2TInt( info.iSize.iY ), originalImageY,"y size is greater than original size" ); + + // perform zoom out in one second + layout.StartZoom( TShwZoomAndPanLayout::EZoomOut, 1 ); + // cancel old timer + timer->Cancel(); + // wait for 1.5 seconds (to be sure the zoom completes) + timer->Start(1.5 * 1000000, 1.5 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + // run the layout + base.SetLayoutValues( info ); + // verify that the position was set to zero again as in minimum size the pan is 0 + EUNIT_ASSERT_EQUALS_DESC( + 0, TReal2TInt( info.iPosition.iX ), "x position looped " ); + EUNIT_ASSERT_EQUALS_DESC( + 0, TReal2TInt( info.iPosition.iY ), "y position looped back" ); + // verify size, after zoom in we are in 100% size + EUNIT_ASSERT_EQUALS_DESC( + screenX, TReal2TInt( info.iSize.iX ),"x size is back to minimum" ); + EUNIT_ASSERT_EQUALS_DESC( + screenY, TReal2TInt( info.iSize.iY ),"y size is back to minimum" ); + } + +void T_CShwZoomAndPanEffect::T_PauseTestL() + { + // display size is define by gScreenRect + // give the HUI env to the effect and the size + TSize screenSize = gScreenRect.Size(); + iCShwZoomAndPanEffect->InitializeL( + iEnv, + NULL, + NULL, + screenSize ); + + // prepare view with a max size image + TSize imageSize( screenSize.iWidth * KMaxThumbnailSize, screenSize.iHeight * KMaxThumbnailSize ); + TSize thumbSize = iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // check thumbnail size + EUNIT_ASSERT_EQUALS_DESC( + imageSize.iHeight, thumbSize.iHeight, "thumbnail is image size" ); + EUNIT_ASSERT_EQUALS_DESC( + imageSize.iWidth, thumbSize.iWidth, "thumbnail is image size" ); + + // then enter view, fade in should last 250 millliseconds and view 500 + // get the layout chain + MGlxLayout* layout = + iCShwZoomAndPanEffect->EnterViewL( iVisual, 500, 250 ); + // get the initial layout values + TGlxLayoutInfoResetter info; + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + + // next pause the effect + iCShwZoomAndPanEffect->PauseL(); + // create timer to give us callback + TShwAutoPtr< CPeriodic > timer = CPeriodic::NewL( CActive::EPriorityStandard ); + // start asynch wait for 1.5 second + timer->Start(1.5 * 1000000, 1.5 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + // cancel the timer + timer->Cancel(); + + // now verify that the layout chain is in same situation + // get new layout values + TGlxLayoutInfoResetter info2; + // reset info2 + info2.iPosition.iX = -1;info2.iPosition.iY = -1; + info2.iSize.iX = -1; info2.iSize.iY = -1; + info2.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info2 ); + // check that no changes + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info.iOpacity ), TReal2TInt( info2.iOpacity ), "opacity" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info.iPosition.iX ), TReal2TInt( info2.iPosition.iX ), "position x" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info.iPosition.iY ), TReal2TInt( info2.iPosition.iY ), "position y" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info.iSize.iX ), TReal2TInt( info2.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info.iSize.iY ), TReal2TInt( info2.iSize.iY ), "size y" ); + + // resume the effect + iCShwZoomAndPanEffect->Resume(); + + // start timer for 1.5 seconds + timer->Start(1.5 * 1000000, 1.5 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + // cancel the timer + timer->Cancel(); + + // now verify that the layout chain did change + // reset info2 + info2.iPosition.iX = -1;info2.iPosition.iY = -1; + info2.iSize.iX = -1; info2.iSize.iY = -1; + info2.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info2 ); + // check that values did not change + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iOpacity ), TReal2TInt( info2.iOpacity ), "opacity" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iSize.iX ), TReal2TInt( info2.iSize.iX ), "size x" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iSize.iY ), TReal2TInt( info2.iSize.iY ), "size y" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iPosition.iX ), TReal2TInt( info2.iPosition.iX ), "position x" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iPosition.iY ), TReal2TInt( info2.iPosition.iY ), "position y" ); + + // enter view again, fade in should last 250 millliseconds and view 500 + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 500, 250 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // start timer for .1 seconds, to make sure opacity does not run too fast + timer->Start(0.1 * 1000000, 0.1 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + // cancel the timer + timer->Cancel(); + + // reset info2 + info2.iPosition.iX = -1;info2.iPosition.iY = -1; + info2.iSize.iX = -1; info2.iSize.iY = -1; + info2.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info2 ); + // check that size and opacity changed, multiply with 10 to remove rounding errors + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iOpacity * 10 ), TReal2TInt( info2.iOpacity * 10 ), "opacity" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iSize.iX ), TReal2TInt( info2.iSize.iX ), "size x" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info.iSize.iY ), TReal2TInt( info2.iSize.iY ), "size y" ); + + // pause the effect + iCShwZoomAndPanEffect->PauseL(); + // run the layout to get values + layout->SetLayoutValues( info2 ); + // start timer for 1.0 seconds + timer->Start(1.0 * 1000000, 1.0 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + // cancel the timer + timer->Cancel(); + TGlxLayoutInfoResetter info3; + // reset info3 + info3.iPosition.iX = -1;info3.iPosition.iY = -1; + info3.iSize.iX = -1; info3.iSize.iY = -1; + info3.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info3 ); + // check that no changes between info2 and info3, multiply opacity to remove rounding error + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info2.iOpacity * 10 ), TReal2TInt( info3.iOpacity * 10 ), "opacity" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info2.iSize.iX ), TReal2TInt( info3.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info2.iSize.iY ), TReal2TInt( info3.iSize.iY ), "size y" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info2.iPosition.iX ), TReal2TInt( info3.iPosition.iX ), "position x" ); + EUNIT_ASSERT_EQUALS_DESC( + TReal2TInt( info2.iPosition.iY ), TReal2TInt( info3.iPosition.iY ), "position y" ); + + // now do the resume + iCShwZoomAndPanEffect->Resume(); + // start timer for 1.0 seconds + timer->Start(1.0 * 1000000, 1.0 * 1000000, TShwCallBack< + T_CShwZoomAndPanEffect, &T_CShwZoomAndPanEffect::CancelAsyncL> ( + this)); + // start async wait + iAsyncWait.Start(); + // cancel the timer + timer->Cancel(); + + // reset info3 + info3.iPosition.iX = -1;info3.iPosition.iY = -1; + info3.iSize.iX = -1; info3.iSize.iY = -1; + info3.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info3 ); + // check that values did change between info2 and info3, multiply opacity to remove rounding error + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info2.iOpacity * 10 ), TReal2TInt( info3.iOpacity * 10 ), "opacity" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info2.iSize.iX ), TReal2TInt( info3.iSize.iX ), "size x" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info2.iSize.iY ), TReal2TInt( info3.iSize.iY ), "size y" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info2.iPosition.iX ), TReal2TInt( info3.iPosition.iX ), "position x" ); + EUNIT_ASSERT_NOT_EQUALS_DESC( + TReal2TInt( info2.iPosition.iY ), TReal2TInt( info3.iPosition.iY ), "position y" ); + } + +void T_CShwZoomAndPanEffect::T_TestBoundariesL() + { + // get the screen size + TSize screenSize = gScreenRect.Size(); + // calculate the maximum width and height + TInt maximumImageWidth = screenSize.iWidth * KMaxThumbnailSize; + TInt maximumImageHeight = screenSize.iHeight * KMaxThumbnailSize; + + // display size is define by gScreenRect + // give the HUI env to the effect and the size + iCShwZoomAndPanEffect->InitializeL( + iEnv, + NULL, + NULL, + screenSize ); + + // prepare view with image twice as wide but half the height of maximum + TSize imageSize( + maximumImageWidth * 2, + maximumImageHeight / 2 ); + TSize thumbSize = iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // check the thumbnail size + // note that the thumbnail may be wider than higher than the maximage but the area + // is the same + EUNIT_ASSERT_EQUALS_DESC( + maximumImageWidth * 2, thumbSize.iWidth, "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + maximumImageHeight / 2, thumbSize.iHeight, "size y" ); + + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + MGlxLayout* layout = + iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + TGlxLayoutInfoResetter info; + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image width is maximum screen width times two and height is + // original by two (as original was twice as wide as fitted) + // note that the thumbnail may be wider than higher than the maximage but the area + // is the same + EUNIT_ASSERT_EQUALS_DESC( + maximumImageWidth * 2, TReal2TInt( info.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + maximumImageHeight / 2, TReal2TInt( info.iSize.iY ), "size y" ); + + // prepare view with image max wide but twice the height of maximum + imageSize.SetSize( maximumImageWidth, maximumImageHeight * 2 ); + iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image area is same as maximum image area + // note that the thumbnail may be wider than higher than the maximage but the area + // is the same + EUNIT_ASSERT_EQUALS_DESC( + maximumImageWidth * maximumImageHeight, + TReal2TInt( info.iSize.iX * info.iSize.iY ), "size x" ); + + // test image partially smaller than screen, should not zoom + // prepare view with image quarter of the screen wide but four times the height of screen + imageSize.SetSize( gScreenWidth / 4, gScreenHeight * 4 ); + iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image size is the maximum screen width and height multiplied by 16 + EUNIT_ASSERT_EQUALS_DESC( + gScreenWidth, TReal2TInt( info.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + gScreenHeight * 4 * 4, TReal2TInt( info.iSize.iY ), "size y" ); + + // test image partially smaller than screen, should zoom + // prepare view with image half of the screen wide but three times the height of screen + imageSize.SetSize( gScreenWidth - 10, gScreenHeight * 2 ); + iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check image area, should be same as max size + EUNIT_ASSERT_EQUALS_DESC( + maximumImageWidth * maximumImageHeight, + TReal2TInt( info.iSize.iX * info.iSize.iY ), "size x" ); + + // test image that is screen size, should not zoom + // prepare view with image + imageSize.SetSize( gScreenWidth, gScreenHeight ); + iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image size is screen size + EUNIT_ASSERT_EQUALS_DESC( + gScreenWidth, TReal2TInt( info.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + gScreenHeight, TReal2TInt( info.iSize.iY ), "size y" ); + + // test image partially larger than screen, should zoom + // prepare view + imageSize.SetSize( gScreenWidth * 1.5, gScreenHeight * 1.5 ); + iCShwZoomAndPanEffect->PrepareViewL( iVisual, imageSize ); + // then enter view, fade in should last 0 millliseconds and view 0 so that the new values + // are immediate + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // get the initial layout values + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image size is the screen multiplied by max zoom + EUNIT_ASSERT_EQUALS_DESC( + TInt(gScreenWidth * KMaxZoomAndPanFactor), TReal2TInt( info.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + TInt(gScreenHeight * KMaxZoomAndPanFactor), TReal2TInt( info.iSize.iY ), "size y" ); + + // enter transition to increase the counter, duration zero + // ignore layout chain + iCShwZoomAndPanEffect->EnterTransitionL( iVisual, 0 ); + // enter the same effect again, this time we do zoom out (max to min size) + // get the layout chain + layout = iCShwZoomAndPanEffect->EnterViewL( iVisual, 0, 0 ); + // reset info + info.iPosition.iX = -1;info.iPosition.iY = -1; + info.iSize.iX = -1; info.iSize.iY = -1; + info.iOpacity = -1; + // run the layout to get values + layout->SetLayoutValues( info ); + // check that image size is the screen multiplied by max zoom + EUNIT_ASSERT_EQUALS_DESC( + gScreenWidth, TReal2TInt( info.iSize.iX ), "size x" ); + EUNIT_ASSERT_EQUALS_DESC( + gScreenHeight, TReal2TInt( info.iSize.iY ), "size y" ); + } + +TInt T_CShwZoomAndPanEffect::CancelAsyncL() + { + // stop async wait + iAsyncWait.AsyncStop(); + // return KErrNone to stop the timer + return KErrNone; + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CShwZoomAndPanEffect, + "Test suite for CShwZoomAndPanEffect and Layout", + "UNIT" ) + +EUNIT_TEST( + "Geometry utilities test", + "NShwGeometryUtilities", + "FitDimension,FitInsideBox,FitToCoverBox", + "FUNCTIONALITY", + Empty, T_TestGeometryAlgorithmsL, Empty ) + +EUNIT_TEST( + "Layout test", + "TShwZoomAndPanLayout", + "TShwZoomAndPanLayout", + "FUNCTIONALITY", + Empty, T_LayoutTestL, Empty ) + +EUNIT_TEST( + "Curve test", + "ShwCurveFactory", + "CreateEllipsisL", + "FUNCTIONALITY", + Empty, T_CurveTestL, Empty ) + +EUNIT_TEST( + "Zoom and pan test", + "TShwZoomAndPanLayout", + "DoSetLayoutValues", + "FUNCTIONALITY", + Empty, T_ZoomAndPanTestL, Empty ) + +EUNIT_TEST( + "Pause Zoom and pan", + "CShwZoomAndPanEffect", + "PauseL, Resume", + "FUNCTIONALITY", + SetupL, T_PauseTestL, Teardown ) + +EUNIT_TEST( + "Test boundaries", + "CShwZoomAndPanEffect", + "PrepareViewL", + "FUNCTIONALITY", + SetupL, T_TestBoundariesL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007-2007 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: Test for zoom and pan effect in slideshow + * +*/ + + + + +#ifndef __T_CSHWZOOMANDPANEFFECT_H__ +#define __T_CSHWZOOMANDPANEFFECT_H__ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS +class CHuiEnv; +class CHuiDisplayCoeControl; +class CHuiControl; +class CHuiImageVisual; +class CShwZoomAndPanEffect; + +// CLASS DEFINITION +/** + * EUnit test suite for Zoom and pan related classes + */ +NONSHARABLE_CLASS( T_CShwZoomAndPanEffect ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CShwZoomAndPanEffect* NewL(); + static T_CShwZoomAndPanEffect* NewLC(); + /** + * Destructor + */ + ~T_CShwZoomAndPanEffect(); + + // helper + TInt CancelAsyncL(); + + private: // Constructors and destructors + + T_CShwZoomAndPanEffect(); + void ConstructL(); + + private: // New methods + + void Empty(); + void SetupL(); + void Teardown(); + void T_LayoutTestL(); + void T_CurveTestL(); + void T_ZoomAndPanTestL(); + void T_PauseTestL(); + void T_TestGeometryAlgorithmsL(); + void T_TestBoundariesL(); + + private: // Data + + /// Own: HUI environment + CHuiEnv* iEnv; + + /// Own: HUI display + CHuiDisplayCoeControl* iCoeDisplay; + + /// Own: HUI control + CHuiControl* iControl; + + /// Own: HUI visual + CHuiImageVisual* iVisual; + + /// Own: asynch wait + CActiveSchedulerWait iAsyncWait; + + /// Own: class under test + CShwZoomAndPanEffect* iCShwZoomAndPanEffect; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CSHWZOOMANDPANEFFECT_H__ + +// End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/slideshow/engine/tsrc/t_cshwzoomandpaneffect/t_cshwzoomandpaneffect_dllmain.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007-2007 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: Test for zoom and pan effect in slideshow + * +*/ + + + + +// CLASS HEADER +#include "t_cshwzoomandpaneffect.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CShwZoomAndPanEffect::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/settingsdialog/data/shwsettingsdialog.rss --- a/photosgallery/slideshow/settingsdialog/data/shwsettingsdialog.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/settingsdialog/data/shwsettingsdialog.rss Wed Oct 13 14:32:09 2010 +0300 @@ -264,7 +264,6 @@ } // ----------------------------------------------------------------------------- // Slideshow settings play direction popup setting texts resource -// Direction of slideshow play (0->Older to newer, 1->newer to older) // ----------------------------------------------------------------------------- RESOURCE ARRAY r_shw_settingslist_play_direction_texts { @@ -272,12 +271,12 @@ { AVKON_ENUMERATED_TEXT { - value = 0; + value = 1; text = qtn_lgal_slideshow_settings_older_to_newer; }, AVKON_ENUMERATED_TEXT { - value = 1; + value = 0; text = qtn_lgal_slideshow_settings_newer_to_older; } }; @@ -354,16 +353,15 @@ // --------------------------------------------------------------------------- // Delay transition slider. // --------------------------------------------------------------------------- -RESOURCE SLIDER_WITH_FEEDBACK_STYLE r_shw_settingslist_delay_slider +RESOURCE SLIDER r_shw_settingslist_delay_slider { - feedbackstyle = EAknSliderFbDynamic; - layout = EAknSettingsItemSliderLayout; - minvalue = KMinTransDelay; - maxvalue = KMaxTransDelay; - step = KTransDelayStep; + layout = EAknSettingsItemSliderLayout; + minvalue = KMinTransDelay; + maxvalue = KMaxTransDelay; + step = KTransDelayStep; valuetype = EAknSliderValueNone; - minlabel = qtn_lgal_slideshow_settings_delay_slow; - maxlabel = qtn_lgal_slideshow_settings_delay_fast; + minlabel = qtn_lgal_slideshow_settings_delay_slow; + maxlabel = qtn_lgal_slideshow_settings_delay_fast; } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/settingsdialog/src/shwslideshowsettingslist.cpp --- a/photosgallery/slideshow/settingsdialog/src/shwslideshowsettingslist.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/settingsdialog/src/shwslideshowsettingslist.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -1203,26 +1203,25 @@ //----------------------------------------------------------------------------- void CShwSlideShowSettingsList::SetPlayDirectionL(TBool aNewPlayDirection) { - TRACER("CShwSlideShowSettingsList::SetPlayDirectionL"); - GLX_LOG_INFO1("CShwSlideShowSettingsList::SetPlayDirectionL(%d)", - aNewPlayDirection); - - // retrieve play direction setting - (*SettingItemArray())[EPlayDirectionItem]->EditItemL(EFalse); - - // updates play direction - iPlayDirection = aNewPlayDirection; - - // internalise new state to settings item - (*(SettingItemArray()))[EPlayDirectionItem]->StoreL(); - - // persist direction - iShwSettings.SavePlayOrderL(iPlayDirection); - - // redraw music on/off control - ListBox()->DrawItem(EPlayDirectionItem); - } - + TRACER("CShwSlideShowSettingsList::SetPlayDirectionL"); + GLX_LOG_INFO("CShwSlideShowSettingsList::SetMusicStateL"); + if (aNewPlayDirection != iPlayDirection) + { + // retrieve play direction setting + (*SettingItemArray())[EPlayDirectionItem]->EditItemL(EFalse); + // updates play direction + iPlayDirection = aNewPlayDirection; + // internalise new state to settings item + (*(SettingItemArray()))[EPlayDirectionItem]->StoreL(); + + // persist direction + iShwSettings.SavePlayOrderL(iPlayDirection); + //@TODO cenrep update + + // redraw music on/off control + ListBox()->DrawItem(EPlayDirectionItem); + } + } //----------------------------------------------------------------------------- // CShwSlideShowSettingsList::ConfirmationQueryL //----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/view/group/shwslideshowviewplugin.mmp --- a/photosgallery/slideshow/view/group/shwslideshowviewplugin.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/view/group/shwslideshowviewplugin.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -75,7 +75,6 @@ SYSTEMINCLUDE ../../../viewframework/visuallistmanager/inc SYSTEMINCLUDE ../../../viewframework/uiutilities/inc SYSTEMINCLUDE ../../../viewframework/texturemanager/inc -SYSTEMINCLUDE ../../../viewframework/commandhandlers/inc SYSTEMINCLUDE ../../../viewframework/commandhandlers/commoncommandhandlers/inc SYSTEMINCLUDE ../../../viewframework/commandhandlers/commandhandlerbase/inc SYSTEMINCLUDE ../../engine/inc // slideshow engine @@ -106,6 +105,8 @@ LIBRARY mpxcommon.lib LIBRARY ecom.lib +LIBRARY hitchcock.lib // HUI + LIBRARY glxviewbase.lib LIBRARY glxmedialists.lib LIBRARY glxvisuallistmanager.lib @@ -122,7 +123,7 @@ LIBRARY aknicon.lib // AknIconUtils LIBRARY etel3rdparty.lib // for CTelephony -LIBRARY alfclient.lib +LIBRARY alfclient.lib LIBRARY gesturehelper.lib LIBRARY remconcoreapi.lib @@ -130,5 +131,4 @@ //LIBRARY hgcontextutility.lib // For Teleport LIBRARY glxtvout.lib LIBRARY fbscli.lib -LIBRARY ws32.lib // RWindowGroup // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/view/inc/shwslideshowview.h --- a/photosgallery/slideshow/view/inc/shwslideshowview.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/view/inc/shwslideshowview.h Wed Oct 13 14:32:09 2010 +0300 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include "shwengineobserver.h" @@ -74,8 +73,7 @@ public MShwGestureObserver, public MStorageNotifierObserver, public MGlxTvObserver, - public MGlxHDMIDecoderObserver, - public MAknWsEventObserver + public MGlxHDMIDecoderObserver { public: @@ -141,9 +139,6 @@ */ void HandleForegroundEventL(TBool aForeground); - public: // From MAknWsEventObserver - void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination); - public: // From CGlxViewBase /** @@ -346,11 +341,6 @@ * for which HDMI advance decoding will be done */ TInt GetNextIndex(); - /** - * Returns the application foreground status. - * Foreground status is found using WindowsGroupID - */ - TBool IsAppInForegroundL(); public: //to keep in track which of the command set is active/on top enum TShwState @@ -435,6 +425,7 @@ TShwState iShwState; TShwFurniture iShwFurniture; + TInt iCurrentActiveCommandSet; CShwGestureControl* iShwGestureControl; GestureHelper::CGestureControl* iGestureControl; CAlfControlGroup* iGestureControlGroup; @@ -453,7 +444,6 @@ TInt iHdmiWidth; TInt iHdmiHeight; - CAknWsEventMonitor* iAknEventMonitor;// not owned }; #endif // C_SHWSLIDESHOWVIEW_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/view/src/shwslideshowview.cpp --- a/photosgallery/slideshow/view/src/shwslideshowview.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/view/src/shwslideshowview.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -40,7 +40,6 @@ #include // for CGlxResolutionUtility #include // view's resource #include // for resource directory path -#include // for EGlxCmdResetView #include #include #include // for CAknKeySoundSystem @@ -71,8 +70,8 @@ #include #include #include +#include #include -#include namespace { @@ -245,23 +244,11 @@ { iWaitDialog->ProcessFinishedL(); } - HBufC* popupText = NULL; - //Load the "No Images to Play Slideshow" string from the resource file - popupText = StringLoader::LoadLC(R_GLX_NO_IMAGES_TO_PLAY_SLIDESHOW); - // Show the Info Note. - GlxGeneralUiUtilities::ShowInfoNoteL(popupText->Des(), EFalse); - // LoadLC will push text on to cleanupstack, - // hence it should be poped and destroyed - CleanupStack::PopAndDestroy(popupText); } else { // The list should now be populated, so set the focus SetListFocusL(); - - // Initialize control textures - iVolumeControl->InitControlTextureL(); - // Need to take latest screen size as layout has changed TRect currentScreen; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, @@ -391,8 +378,6 @@ &CShwSlideshowView::PopulateListL> (this)); iMSKPressed = EFalse; iLSKPressed = EFalse; - iAknEventMonitor - = static_cast (CCoeEnv::Static()->AppUi())->EventMonitor(); } // --------------------------------------------------------------------------- @@ -409,16 +394,15 @@ // --------------------------------------------------------------------------- // From CAknView -// Background event handling in HandleWsEventL. -// Foreground event handling this function. +// Foreground event handling function. // --------------------------------------------------------------------------- // void CShwSlideshowView::HandleForegroundEventL(TBool aForeground) { - TRACER("CShwSlideshowView::HandleForegroundEventL"); - GLX_LOG_INFO1("CShwSlideshowView::HandleForegroundEventL(%d)", aForeground); + TRACER("CShwSlideshowView::HandleForegroundEventL"); + GLX_LOG_INFO( "CShwSlideshowView::HandleForegroundEventL()" ); iIsForegrnd = aForeground; - if (aForeground) + if( aForeground ) { if (iHdmiController && iHdmiActive) { @@ -435,6 +419,16 @@ iEngine->GetMusicVolumeL(); } } + else + { + if (iHdmiController && iHdmiActive) + { + iHdmiController->ShiftToCloningMode(); + } + // Something else has gained the foreground + iPauseHandler->SwitchToBackgroundL(); + } + CAknView::HandleForegroundEventL(aForeground); } @@ -516,8 +510,6 @@ // We will require to act on events ONLY when the view is active. // So listen to them only when the view is active. iShwGestureControl->AddObserverL(this); - iAknEventMonitor->Enable(ETrue); - iAknEventMonitor->AddObserverL(this); } // ----------------------------------------------------------------------------- @@ -558,8 +550,6 @@ //are always valid so no need to test for != NULL iDisplay->Roster().Hide( *iVolumeControlGroup ); - iAknEventMonitor->Enable(EFalse); - iAknEventMonitor->RemoveObserver(this); //Ensure we revert to a proper background TRAP_IGNORE( @@ -773,23 +763,23 @@ // --------------------------------------------------------------------------- // void CShwSlideshowView::EngineStartedL() - { - TRACER("CShwSlideshowView::EngineStartedL"); - GLX_LOG_INFO( "CShwSlideshowView::EngineStartedL()" ); - if (iWaitDialog) - { - // cancel the progress bar - iWaitDialog->ProcessFinishedL(); - } - if (iHdmiController) - { - iHdmiController->ShiftToPostingMode(); - } - // Here, iShwState value is either 0(first instance) - // or EShwExiting(remembered from previous instance) - iShwState = EShwPlay; - ShowShwFurnitureL(); - } + { + TRACER("CShwSlideshowView::EngineStartedL"); + GLX_LOG_INFO( "CShwSlideshowView::EngineStartedL()" ); + + if (iWaitDialog) + { + // cancel the progress bar + iWaitDialog->ProcessFinishedL(); + } + if (iHdmiController) + { + iHdmiController->ShiftToPostingMode(); + } + iShwState = EShwPlay; + ReplaceCommandSetL(R_SHW_SOFTKEYS_END_PAUSE, R_SHW_SOFTKEYS_END_PAUSE); + ShowShwFurnitureL(); + } // --------------------------------------------------------------------------- // From MShwEngineObserver @@ -799,19 +789,20 @@ void CShwSlideshowView::EnginePausedL() { TRACER("CShwSlideshowView::EnginePausedL"); - GLX_LOG_INFO( "CShwSlideshowView::EnginePausedL()" ); + GLX_LOG_INFO( "CShwSlideshowView::EnginePausedL()" ); + // Cancel the backlight if it's on - if (iBackLightTimer->IsRunning()) + if ( iBackLightTimer->IsRunning() ) { iBackLightTimer->Cancel(); } - if (!iUiUtility->IsExitingState() && (iShwState != EShwExiting)) - { - iShwState = EShwPause; - ReplaceCommandSetL(R_SHW_SOFTKEYS_END_CONTINUE, - R_SHW_SOFTKEYS_END_PAUSE); - ShowShwFurnitureL(); - } + + if(!iUiUtility->IsExitingState()) + { + iShwState = EShwPause; + ReplaceCommandSetL(R_SHW_SOFTKEYS_END_CONTINUE,R_SHW_SOFTKEYS_END_PAUSE); + ShowShwFurnitureL(); + } } // --------------------------------------------------------------------------- @@ -819,24 +810,20 @@ // Engine resumed callback. // --------------------------------------------------------------------------- // -void CShwSlideshowView::EngineResumedL() - { - TRACER("CShwSlideshowView::EngineResumedL"); - GLX_LOG_INFO( "CShwSlideshowView::EngineResumedL" ); - iEngine->GetMusicVolumeL(); +void CShwSlideshowView::EngineResumedL() + { + TRACER("CShwSlideshowView::EngineResumedL"); + GLX_LOG_INFO( "CShwSlideshowView::EngineResumedL" ); + iEngine->GetMusicVolumeL(); // Re-enable the backlight if it's off - if (!iBackLightTimer->IsRunning()) + if ( !iBackLightTimer->IsRunning() ) { iBackLightTimer->StartL(); } - if (iShwState != EShwExiting) - { - iShwState = EShwPlay; - ReplaceCommandSetL(R_SHW_SOFTKEYS_END_PAUSE, - R_SHW_SOFTKEYS_END_CONTINUE); - ShowShwFurnitureL(); - } - } + iShwState = EShwPlay; + ReplaceCommandSetL(R_SHW_SOFTKEYS_END_PAUSE,R_SHW_SOFTKEYS_END_CONTINUE); + ShowShwFurnitureL(); + } // --------------------------------------------------------------------------- // From MShwEngineObserver // Engine LSK Pressed @@ -1024,13 +1011,17 @@ CleanupClosePushL( stream ); stream.ReadInt32L(); + //Get the play direction. + CShwSettingsModel* shwSettingsMdl = CShwSettingsModel::NewL(); - CleanupStack::PushL(shwSettingsMdl); - iPlayDirection - = static_cast (shwSettingsMdl->PlayOrderL()); + CleanupStack::PushL( shwSettingsMdl ); + iPlayDirection = static_cast< NShwSlideshow:: + TPlayDirection>(shwSettingsMdl->PlayOrderL()); CleanupStack::PopAndDestroy( shwSettingsMdl ); + + // Retrieve the path iCollectionPath = CMPXCollectionPath::NewL(); iCollectionPath->InternalizeL( stream ); @@ -1061,31 +1052,28 @@ void CShwSlideshowView::SetListFocusL() { TRACER("CShwSlideshowView::SetListFocusL"); - GLX_LOG_INFO("CShwSlideshowView::SetListFocusL"); + GLX_LOG_INFO( "CShwSlideshowView::SetListFocusL" ); // Ensure that we start the slideshow from the correct image index: // if there are any selected images we always start from the first one, // otherwise we try to use the item with focus from the unfiltered list // so long as it hasn't been filtered out, in which case we use the first image. TInt selectionCount = iCollectionPath->Selection().Count(); TInt focusIndex = 0; - if (selectionCount == 0) + if ( selectionCount == 0 ) { - // nothing selected, so determine which item has focus in the original list focusIndex = iMediaList->FocusIndex(); - GLX_LOG_INFO1("SlideshowView::SetListFocusL focusIndex(%d)", focusIndex); - - const TGlxMedia& mediaItem = iMediaList->Item(focusIndex); + const TGlxMedia& mediaItem = iMediaList->Item( focusIndex ); // Check if this item is in the filtered list - TGlxIdSpaceId spaceId = iMediaList->IdSpaceId(focusIndex); - focusIndex = iFilteredList->Index(spaceId, mediaItem.Id()); - if (focusIndex == KErrNotFound) + TGlxIdSpaceId spaceId = iMediaList->IdSpaceId( focusIndex ); + focusIndex = iFilteredList->Index( spaceId, mediaItem.Id() ); + if ( focusIndex == KErrNotFound ) { - focusIndex = ((iPlayDirection == NShwSlideshow::EPlayBackwards) - ? 0 : iFilteredList->Count() - 1); + // it's been filtered out so just use the first item + focusIndex = 0; } } - iFilteredList->SetFocusL(NGlxListDefs::EAbsolute, focusIndex); + iFilteredList->SetFocusL( NGlxListDefs::EAbsolute, focusIndex ); } @@ -1198,6 +1186,8 @@ CEikButtonGroupContainer::EVertical, this, R_SHW_SOFTKEYS_END_PAUSE ); iShwCba->MakeVisible(EFalse); + //set the current active command set + ReplaceCommandSetL(R_SHW_SOFTKEYS_END_PAUSE,R_SHW_SOFTKEYS_END_PAUSE); } // ----------------------------------------------------------------------------- @@ -1217,6 +1207,8 @@ } // set the new command set iShwCba->SetCommandSetL( aNewComandId ); + // keep the current active command set + iCurrentActiveCommandSet = aNewComandId; } @@ -1237,6 +1229,7 @@ iVolumeControl->Hide(); } iShwFurniture = EFurnitureHidden; + } // ----------------------------------------------------------------------------- @@ -1269,19 +1262,13 @@ { TRACER("CShwSlideshowView::ProcessCommandL"); GLX_LOG_INFO( "CShwSlideshowView::ProcessCommandL" ); - switch (aCommandId) + switch(aCommandId) { case EShwSlideshowCmdEnd: - case EAknSoftkeyBack: - case EGlxCmdResetView: { iShwState = EShwExiting; - iDisplay->Roster().Hide(*iGestureControlGroup); - HideShwFurniture(); - if (aCommandId == EShwSlideshowCmdEnd) - { - aCommandId = EAknSoftkeyBack; - } + aCommandId = EAknSoftkeyBack; + iDisplay->Roster().Hide( *iGestureControlGroup ); break; } //When user presses MSK or LSK this cmd will Generated @@ -1289,11 +1276,11 @@ case EShwSlideshowCmdContinue: { // If MSK preesed to toggle visibility of softekey - if (iMSKPressed) + if(iMSKPressed) { iMSKPressed = EFalse; - } - else if (iLSKPressed) + } + else if(iLSKPressed) { iLSKPressed = EFalse;// Already Handlled } @@ -1301,8 +1288,9 @@ { iPauseHandler->UserToggledPauseL(); } - break; + break; } + default: { break; @@ -1553,50 +1541,3 @@ TRACER("CShwSlideshowView::HandleHDMIDecodingEventL()"); iEngine->HandleHDMIDecodingEventL(aStatus); } -// ------------------------------------------------------------------------------------------------- -// CShwSlideshowView::IsAppInForegroundL() -// ------------------------------------------------------------------------------------------------- -// -TBool CShwSlideshowView::IsAppInForegroundL() - { - TRACER("CShwSlideshowView::IsAppInForegroundL()"); - TBool ret = EFalse; - CArrayFixFlat* wgList = new (ELeave) CArrayFixFlat ( - iEikonEnv->WsSession().NumWindowGroups()); - CleanupStack::PushL(wgList); - if (iEikonEnv->WsSession().WindowGroupList(0, wgList) == KErrNone) - { - // Check if Photos App window group is in foreground - ret = (iCoeEnv->RootWin().Identifier() == wgList->At(0)); - GLX_LOG_INFO2("SlideshowView::IsAppInForegroundL() ret=%d, wgId=%u", - ret, wgList->At(0)); - } - - CleanupStack::PopAndDestroy(wgList); - return ret; - } - -// ------------------------------------------------------------------------------------------------- -// CShwSlideshowView::HandleWsEventL() -// WS Events handling function -// ------------------------------------------------------------------------------------------------- -// -void CShwSlideshowView::HandleWsEventL(const TWsEvent& aEvent, - CCoeControl* /*aDestination*/) - { - TRACER("CShwSlideshowView::HandleWsEventL()"); - TInt event = aEvent.Type(); - GLX_LOG_INFO1("CShwSlideshowView::HandleWsEventL() event=%d", event); - - // If we are sent to full background, shift to cloning mode - if ((event == KAknFullOrPartialForegroundLost) && !IsAppInForegroundL()) - { - GLX_LOG_INFO("SlideshowView::HandleWsEventL() App is in background!"); - if (iHdmiController && iHdmiActive) - { - iHdmiController->ShiftToCloningMode(); - } - // Something else has gained the foreground - iPauseHandler->SwitchToBackgroundL(); - } - } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/view/src/shwslideshowvolumecontrol.cpp --- a/photosgallery/slideshow/view/src/shwslideshowvolumecontrol.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/view/src/shwslideshowvolumecontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -163,6 +163,35 @@ // BackGround Visual iBackgroundImageVisual->EnableBrushesL(); iBackgroundImageVisual->SetOpacity( KHalfOpacityOpaque ); + + // Get the icon file + TFileName mifFile( KDC_APP_BITMAP_DIR ); + mifFile.Append( KIconsFilename ); + User::LeaveIfError( CompleteWithAppPath( mifFile ) ); + // Get the texture manager + CGlxTextureManager& textureMgr = iUtility.GlxTextureManager(); + // Load the background texture + + // Below given icon ID is to be changed once the Capped_element Icon + // is available in the build + CAlfTexture& backgroundTexture = textureMgr.CreateIconTextureL + ( EMbmGlxiconsQgn_graf_adapt_search_bg, mifFile ); + + // apply an image brush to the visual + iBrush = CAlfImageBrush::NewL(iAlfEnv, TAlfImage( backgroundTexture ) ); + iBackgroundImageVisual->Brushes()->AppendL( iBrush, EAlfHasOwnership ); + iBackgroundImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); + // Muted visual + CAlfTexture& textureMuted = iUtility.GlxTextureManager().CreateIconTextureL + ( EMbmGlxiconsQgn_indi_mup_speaker_muted, mifFile ); + iMuteImageVisual->SetImage( textureMuted ); + iMuteImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); + + // Speaker visual + CAlfTexture& textureSpkr = iUtility.GlxTextureManager().CreateIconTextureL + ( EMbmGlxiconsQgn_indi_mup_speaker, mifFile ); + iSpeakerImageVisual->SetImage( textureSpkr ); + iSpeakerImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); //hide the volume level visualation by default iMainVisual->SetOpacity(KOpacityTransperent); @@ -225,43 +254,6 @@ roster.Hide( *group ); } } - -// --------------------------------------------------------------------------- -// InitControlTextureL -// --------------------------------------------------------------------------- -void CShwSlideshowVolumeControl::InitControlTextureL() - { - TRACER("CShwSlideshowVolumeControl::InitControlTextureL"); - // Get the icon file - TFileName mifFile( KDC_APP_BITMAP_DIR ); - mifFile.Append( KIconsFilename ); - User::LeaveIfError( CompleteWithAppPath( mifFile ) ); - // Get the texture manager - CGlxTextureManager& textureMgr = iUtility.GlxTextureManager(); - // Load the background texture - - // Below given icon ID is to be changed once the Capped_element Icon - // is available in the build - CAlfTexture& backgroundTexture = textureMgr.CreateIconTextureL - ( EMbmGlxiconsQgn_graf_adapt_search_bg, mifFile ); - - // apply an image brush to the visual - iBrush = CAlfImageBrush::NewL(iAlfEnv, TAlfImage( backgroundTexture ) ); - iBackgroundImageVisual->Brushes()->AppendL( iBrush, EAlfHasOwnership ); - iBackgroundImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); - // Muted visual - CAlfTexture& textureMuted = iUtility.GlxTextureManager().CreateIconTextureL - ( EMbmGlxiconsQgn_indi_mup_speaker_muted, mifFile ); - iMuteImageVisual->SetImage( textureMuted ); - iMuteImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); - - // Speaker visual - CAlfTexture& textureSpkr = iUtility.GlxTextureManager().CreateIconTextureL - ( EMbmGlxiconsQgn_indi_mup_speaker, mifFile ); - iSpeakerImageVisual->SetImage( textureSpkr ); - iSpeakerImageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); - } - // --------------------------------------------------------------------------- // ShowControlL // --------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/slideshow/view/src/shwslideshowvolumecontrol.h --- a/photosgallery/slideshow/view/src/shwslideshowvolumecontrol.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/slideshow/view/src/shwslideshowvolumecontrol.h Wed Oct 13 14:32:09 2010 +0300 @@ -103,13 +103,6 @@ void Hide(); /** - * Initilize the control textures - * e.g. When slideshow engine started or - * textures are removed due to foreground lost event - */ - void InitControlTextureL(); - - /** * Called when the control should be shown. * e.g. Key press and tap event */ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commandhandlerbase/group/glxcommandhandlerbase.mmp --- a/photosgallery/viewframework/commandhandlers/commandhandlerbase/group/glxcommandhandlerbase.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commandhandlerbase/group/glxcommandhandlerbase.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -47,7 +47,7 @@ SYSTEMINCLUDE ../../../medialists/inc SYSTEMINCLUDE ../../../uiutilities/inc SYSTEMINCLUDE ../../../../common/inc // for CGlxResourceUtilities -SYSTEMINCLUDE ../../../../commonui/inc + LIBRARY aknicon.lib LIBRARY aknlayout2.lib @@ -73,8 +73,7 @@ LIBRARY glxuiutilities.lib LIBRARY glxvisuallistmanager.lib LIBRARY glxcommon.lib // for CResourceUtilities -LIBRARY glxcommonui.lib -LIBRARY glximageviewermanager.lib + LIBRARY hlplch.lib LIBRARY hitchcock.lib // HUI framework @@ -84,8 +83,7 @@ LIBRARY mpxviewutility.lib LIBRARY ws32.lib LIBRARY commonengine.lib -LIBRARY caf.lib -LIBRARY libpthread.lib -LIBRARY eikdlg.lib + +LIBRARY libpthread.lib // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commandhandlerbase/inc/glxmpxcommandcommandhandler.h --- a/photosgallery/viewframework/commandhandlers/commandhandlerbase/inc/glxmpxcommandcommandhandler.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commandhandlerbase/inc/glxmpxcommandcommandhandler.h Wed Oct 13 14:32:09 2010 +0300 @@ -30,8 +30,7 @@ class MGlxMediaList; class MGlxMediaListProvider; class CAknAppUi; -class CGlxImageViewerManager; - + /** * @class CGlxMpxCommandCommandHandler * @@ -231,16 +230,6 @@ * Remove medialist observer */ void RemoveMediaListObserver(); - - /** - * Creates the image viewer instance, if not created already. - */ - void CreateImageViewerInstanceL(); - - /** - * Deletes the image viewer instance, if created already. - */ - void DeleteImageViewerInstance(); protected: // From MGlxMediaListObserver /// See @ref MGlxMediaListObserver::HandleItemAddedL @@ -292,9 +281,6 @@ /// The AppUI. Not owned CAknAppUi* iAppUi; - - // For image viewer, not own - CGlxImageViewerManager* iImageViewerInstance; }; #endif // __C_GLXMPXCOMMANDCOMMANDHANDLER_H__ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp --- a/photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commandhandlerbase/src/glxmpxcommandcommandhandler.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -43,12 +43,9 @@ #include #include #include // for CGlxResourceUtilities -#include -#include -#include -#include -#include +/// @todo Move elsewhere +const TInt KGlxMaxNoteLength = 256; // ----------------------------------------------------------------------------- // ConstructL @@ -123,85 +120,40 @@ if ( consume ) { - CGlxNavigationalState* navState = CGlxNavigationalState::InstanceL(); - CleanupClosePushL(*navState); - CMPXCollectionPath* path = navState->StateLC(); - CreateImageViewerInstanceL(); - TBool privatePath = iImageViewerInstance->IsPrivate(); - TBool viewerPathId = (path->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) ? ETrue : EFalse; - iImageViewerInstance->CloseImageDecoder(); - DeleteImageViewerInstance(); - CleanupStack::PopAndDestroy(path); - CleanupStack::PopAndDestroy(navState); - - if (viewerPathId && !privatePath) + // get a command object from the deriving class. + // Allow deriving class modify the consume value, even without + // creating a commmand (in case it wants to filter out a command) + CMPXCommand* command = CreateCommandL(aCommandId, aList, consume); + + if (command) { - RFs fs; - CleanupClosePushL(fs); - User::LeaveIfError(fs.Connect()); - ContentAccess::CManager *manager = ContentAccess::CManager::NewL(); - CleanupStack::PushL(manager); - fs.SetAtt(focusedMedia.Uri(), 0, KEntryAttReadOnly); - TInt ret = manager->DeleteFile(focusedMedia.Uri()); - if(ret != KErrNone) + CleanupStack::PushL(command); + + if ( CommandInfo(aCommandId).iStopAnimationForExecution ) { - CreateImageViewerInstanceL(); - iImageViewerInstance->CreateImageDecoderL(); - DeleteImageViewerInstance(); - HBufC* noteText = StringLoader::LoadL(R_GLX_DELETION_FAILURE_NOTE); - CleanupStack::PushL(noteText); - const TDesC& itemName = focusedMedia.Uri(); - TParsePtrC parse(focusedMedia.Uri()); - TBuf text; - StringLoader::Format(text, *noteText, -1, parse.Name()); - GlxGeneralUiUtilities::ShowErrorNoteL(text, ETrue); - CleanupStack::PopAndDestroy(noteText); - } - CleanupStack::PopAndDestroy(manager); - CleanupStack::PopAndDestroy(&fs); - if(ret == KErrNone) - { - iAppUi->ProcessCommandL(EAknSoftkeyExit); + // Stop GIF animation + iAppUi->ProcessCommandL(EGlxCmdDisableAnimations); + iAnimationStopped = ETrue; } - } - else - { - // get a command object from the deriving class. - // Allow deriving class modify the consume value, even without - // creating a commmand (in case it wants to filter out a command) - CMPXCommand* command = CreateCommandL(aCommandId, aList, consume); - - if (command) - { - CleanupStack::PushL(command); - - if (CommandInfo(aCommandId).iStopAnimationForExecution) - { - // Stop GIF animation - iAppUi->ProcessCommandL(EGlxCmdDisableAnimations); - iAnimationStopped = ETrue; - } + + // Add the pointer of this command handler as session id into the message + // This can be used to ensure that this object is the intended recipient + // of a message + command->SetTObjectValueL(KMPXCommandGeneralSessionId, + static_cast(this)); - // Add the pointer of this command handler as session id into the message - // This can be used to ensure that this object is the intended recipient - // of a message - command->SetTObjectValueL ( - KMPXCommandGeneralSessionId, - static_cast (this)); - - aList.AddMediaListObserverL(this); - - aList.CommandL(*command); - - // raise progress note. Note will be closed when complete message received - // For EGlxCmdAddMedia we dont need to show dialog as EGlxCmdAddToAlbum or - // EGlxCmdAddTag will show processing dialog. - if (aCommandId != EGlxCmdAddMedia) - { - ProgressNoteL(aCommandId); - } - CleanupStack::PopAndDestroy(command); + aList.AddMediaListObserverL(this); + + aList.CommandL(*command); + + // raise progress note. Note will be closed when complete message received + // For EGlxCmdAddMedia we dont need to show dialog as EGlxCmdAddToAlbum or + // EGlxCmdAddTag will show processing dialog. + if (aCommandId != EGlxCmdAddMedia) + { + ProgressNoteL(aCommandId); } + CleanupStack::PopAndDestroy(command); } } @@ -429,7 +381,7 @@ // noteText has a place for a title string in it const TDesC& itemName = media->ValueText(KMPXMediaGeneralTitle); - TBuf text; + TBuf text; StringLoader::Format(text, *noteText, -1, itemName); // show popup @@ -464,7 +416,7 @@ // item count TInt count = aMediaList.SelectionCount(); - TBuf text; + TBuf text; GlxGeneralUiUtilities::FormatString(text, *noteText, -1, count, ETrue); // show popup @@ -531,26 +483,21 @@ // get progress note HBufC* progressText = ProgressTextL(aCommandId); __ASSERT_DEBUG(progressText, Panic(EGlxPanicNullDescriptor)); - CleanupStack::PushL(progressText); + CleanupStack::PushL(progressText); // construct progress dialog - iProgressDialog = new (ELeave) CAknProgressDialog( - (REINTERPRET_CAST(CEikDialog**,&iProgressDialog))); - iProgressDialog->PrepareLC(R_GLX_PROGRESS_NOTE); - if (aCommandId == EGlxCmdRename) - { - iProgressDialog->ButtonGroupContainer().SetCommandSetL( - R_AVKON_SOFTKEYS_EMPTY); - } - iProgressDialog->SetTextL(*progressText); - iProgressDialog->SetCallback(this); - + iProgressDialog = new(ELeave)CAknProgressDialog( + (REINTERPRET_CAST(CEikDialog**,&iProgressDialog))); + iProgressDialog->PrepareLC(R_GLX_PROGRESS_NOTE); + iProgressDialog->SetTextL(*progressText); + iProgressDialog->SetCallback(this); + // pick up progress info so that progress notification can be later updated - iProgressInfo = iProgressDialog->GetProgressInfoL(); - + iProgressInfo = iProgressDialog->GetProgressInfoL(); + // launch the note - iProgressDialog->RunLD(); - CleanupStack::PopAndDestroy(progressText); - } + iProgressDialog->RunLD(); + CleanupStack::PopAndDestroy(progressText); + } // ----------------------------------------------------------------------------- // DismissProgressNoteL @@ -752,27 +699,3 @@ TRAP_IGNORE(DismissProgressNoteL()); } } - -// ----------------------------------------------------------------------------- -// CreateImageViewerInstanceL -// ----------------------------------------------------------------------------- -// -void CGlxMpxCommandCommandHandler::CreateImageViewerInstanceL() - { - TRACER("CGlxMpxCommandCommandHandler::CreateImageViewerInstanceL"); - iImageViewerInstance = CGlxImageViewerManager::InstanceL(); - __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); - } - -// ----------------------------------------------------------------------------- -// DeleteImageViewerInstance -// ----------------------------------------------------------------------------- -// -void CGlxMpxCommandCommandHandler::DeleteImageViewerInstance() - { - TRACER("CGlxMpxCommandCommandHandler::DeleteImageViewerInstance"); - if ( iImageViewerInstance ) - { - iImageViewerInstance->DeleteInstance(); - } - } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerslideshow.h --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerslideshow.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerslideshow.h Wed Oct 13 14:32:09 2010 +0300 @@ -70,9 +70,6 @@ TBool DoIsDisabled(TInt aCommandId, MGlxMediaList& aList) const; /// @ref CGlxMediaListCommandHandler::BypassFiltersForExecute TBool BypassFiltersForExecute() const; - /// @ref CGlxMediaListCommandHandler::DynInitMenuPaneL - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane, - TBool aIsBrowseMode); /// @ref CGlxCommandHandler::PopulateToolbar void PopulateToolbarL(); private: // From MGlxMediaListObserver diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -39,8 +39,6 @@ #include #include #include "glxcommandfactory.h" -#include - // --------------------------------------------------------------------------- // Two-phased constructor. @@ -216,31 +214,35 @@ MGlxMediaList& aList) const { TRACER( "CGlxCommandHandlerDelete::DoIsDisabled" ); - TBool disable = EFalse; - - CGlxNavigationalState* navState = CGlxNavigationalState::InstanceL(); - CleanupClosePushL(*navState); - CMPXCollectionPath* path = navState->StateLC(); + TBool fullscreenViewingMode = EFalse; + CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL(); + CMPXCollectionPath* naviState = aNavigationalState->StateLC(); - if ( path->Levels() >= 1) + if ( naviState->Levels() >= 1) { - CGlxImageViewerManager* viewerInstance = CGlxImageViewerManager::InstanceL(); - if (path->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid) - && viewerInstance->IsPrivate()) + if (aNavigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) { - //it means we are in image viewer private path. - disable = ETrue; - } - viewerInstance->DeleteInstance(); + // For image viewer collection, goto view mode + if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) + { + //it means we are in img viewer. + fullscreenViewingMode = ETrue; + } + } + else + { + //it means we are in Fullscreen. + fullscreenViewingMode = ETrue; + } } - CleanupStack::PopAndDestroy(path); - CleanupStack::PopAndDestroy(navState); - - if (EGlxCmdDelete==aCommandId && 0 == aList.Count()) + CleanupStack::PopAndDestroy( naviState ); + aNavigationalState->Close(); + if (EGlxCmdDelete==aCommandId && 0 == aList.Count() && + !fullscreenViewingMode) { - disable = ETrue; + return ETrue; } - return disable; + return EFalse; } //end of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -11,13 +11,17 @@ * * Contributors: * -* Description: New media command handler +* Description: Delete command handler * */ +/** + * @internal reviewed 06/06/2007 by Dave Schofield + */ + #include "glxcommandhandlernewmedia.h" #include @@ -41,11 +45,12 @@ #include #include #include -#include // for KMaxMediaPopupTextLength + #include #include -#include //For TDigitType +const TInt KMaxMediaPopupTitleLength = 0x28; // Accepts only 40 characters +const TInt KMaxNewMediaItemTitleLength = 0x28; // Accepts only 40 characters const TInt KMaxNumberLength = 10; _LIT(KOpenBracket, "("); @@ -187,7 +192,7 @@ CMPXCollectionPath* path = aMediaList.PathLC( NGlxListDefs::EPathParent ); CMPXCommand* command = NULL; - TBuf defaultNewMediaItemTitle; + TBuf defaultNewMediaItemTitle; TRAPD(error, TitlesL(TGlxMediaId(path->Id(0)), defaultNewMediaItemTitle)); if(error != KErrNone) @@ -211,6 +216,8 @@ TPtr newMediaItemTitleDes = iNewMediaItemTitle->Des(); CGlxTextEntryPopup* dialog = CGlxTextEntryPopup::NewL(*mediaPopupTitle, newMediaItemTitleDes); + + if(dialog->ExecuteLD() == EEikBidOk) { command = TGlxCommandFactory::AddContainerCommandLC(*iNewMediaItemTitle, path->Id(0)); @@ -293,18 +300,14 @@ KGlxMediaCollectionPluginSpecificDefaultMediaTitle); rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); - // Media list must not have been deleted when the destructor of - // TGlxContextRemover is called while going out-of-scope. - { - TGlxFetchContextRemover contextRemover(attributeContext, *rootList); - // put to cleanupstack as cleanupstack is emptied before stack objects - // are deleted - CleanupClosePushL(contextRemover); - User::LeaveIfError(GlxAttributeRetriever::RetrieveL( - *attributeContext, *rootList, ETrue)); - // context off the list - CleanupStack::PopAndDestroy(&contextRemover); - } // Limiting scope of contextRemover + TGlxFetchContextRemover contextRemover(attributeContext, *rootList); + // put to cleanupstack as cleanupstack is emptied before stack objects + // are deleted + CleanupClosePushL(contextRemover); + User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, + *rootList, ETrue)); + // context off the list + CleanupStack::PopAndDestroy(&contextRemover); TInt index = rootList->Index(KGlxIdSpaceIdRoot, aCollectionId); @@ -317,7 +320,7 @@ { aDefaultNewMediaItemTitle.Copy(media->ValueText( KGlxMediaCollectionPluginSpecificDefaultMediaTitle).Left( - KMaxMediaPopupTextLength)); + KMaxMediaPopupTitleLength)); } CleanupStack::PopAndDestroy(attributeContext); @@ -384,17 +387,12 @@ - KCloseBracket().Length(); if (length > 0) { - HBufC* num = title.Mid(pos, length).AllocLC(); - TPtr numPtr = num->Des(); - //Change to Western numeric for determining next numeral - AknTextUtils::ConvertDigitsTo(numPtr,EDigitTypeWestern); - TLex lex(numPtr); + TLex lex = title.Mid(pos, length); TInt val = 0; if (lex.Val(val) == KErrNone) { numbers.InsertInOrderL(val); } - CleanupStack::PopAndDestroy(num); } } } @@ -422,21 +420,18 @@ TInt defaultTitleLength = aDefaultNewMediaItemTitle.Length() + KFileNameFormatString().Length() + KCloseBracket().Length() + KMaxNumberLength; - // If the default title length is bigger than KMaxMediaPopupTextLength, + // If the default title length is bigger than KMaxMediaPopupTitleLength, // make sure we allocate enough space for it. - TInt titleLength = defaultTitleLength > KMaxMediaPopupTextLength ? + TInt titleLength = defaultTitleLength > KMaxMediaPopupTitleLength ? defaultTitleLength - : KMaxMediaPopupTextLength; + : KMaxMediaPopupTitleLength; HBufC* newMediaItemTitle = HBufC::NewL(titleLength); TPtr newMediaItemTitleDes = newMediaItemTitle->Des(); newMediaItemTitleDes.Append(aDefaultNewMediaItemTitle); if (nextNumber > 0) { - newMediaItemTitleDes.AppendFormat(KFileNameFormatString, nextNumber); - //Change numeric according to current input language here - AknTextUtils::ConvertDigitsTo(newMediaItemTitleDes, - AknTextUtils::TextEditorDigitType()); + newMediaItemTitleDes.AppendFormat(KFileNameFormatString, nextNumber); } else { diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -38,10 +38,13 @@ #include #include #include -#include // for KMaxMediaPopupTextLength #include "glxcommandfactory.h" +namespace + { + const TInt KNameMaxLength = 128; + } // --------------------------------------------------------------------------- // Two-phased constructor. @@ -78,7 +81,7 @@ // void CGlxCommandHandlerRename::ConstructL(const TDesC& aFileName) { - iRenameText = HBufC::NewL(KMaxMediaPopupTextLength); + iRenameText = HBufC::NewL(KNameMaxLength); iResourceOffset = CCoeEnv::Static()->AddResourceFileL(aFileName); @@ -134,13 +137,16 @@ TPtr textPtr = iRenameText->Des(); GetTitleL( textPtr, aMediaList ); // store the current name. - TBuf currentName; + TBuf currentName; currentName.Copy(textPtr); // Load the title for the popup HBufC* title = StringLoader::LoadLC( R_GLX_POPUP_RENAME_TITLE ); CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL( *title, textPtr ); + + + if ( popup->ExecuteLD() == EEikBidOk && currentName != *iRenameText) { // Text entry was successful diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -138,7 +138,6 @@ if (aCommandId == EGlxCmdSend) { - iAvkonAppUi->ProcessCommandL(EGlxCmdDialogLaunched); SendSelectedItemsL(); return ETrue; } @@ -365,7 +364,6 @@ CleanupStack::PopAndDestroy(filterOutPlugins); CleanupStack::PopAndDestroy(title); CleanupStack::PopAndDestroy(msgData); - iAvkonAppUi->ProcessCommandL(EGlxCmdDialogDismissed); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -46,8 +46,6 @@ #include #include // get UPnP state #include -#include - namespace { const TInt KShwDefaultBufferSize = 128; @@ -555,95 +553,4 @@ CAknButton::EPositionLeft); } -// ----------------------------------------------------------------------------- -// DynInitMenuPaneL -// ----------------------------------------------------------------------------- -// -void CGlxCommandHandlerSlideshow::DynInitMenuPaneL(TInt /*aResourceId*/, - CEikMenuPane* aMenuPane, TBool aIsBrowseMode) - { - TRACER("CGlxCommandHandlerSlideshow::DynInitMenuPaneL"); - MGlxMediaList& mediaList = MediaList(); - if (aMenuPane) - { - TInt pos = 0; - if (mediaList.Count()) - { - TInt focusIndex = mediaList.FocusIndex(); - if (!aIsBrowseMode && focusIndex > KErrNotFound && focusIndex - < mediaList.Count()) - { - if (aMenuPane->MenuItemExists(EGlxCmdSlideshowPlay, pos)) - { - const TGlxMedia& media = mediaList.Item(focusIndex); - if (EMPXVideo == media.Category()) - { - aMenuPane->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue); - } - else - { - CEikMenuPaneItem::SData& item = - aMenuPane->ItemDataByIndexL(pos); - if (item.iFlags & EEikMenuItemSpecific) - { - TSize tnSize = iUiUtility->GetGridIconSize(); - TMPXAttribute thumbnailAttribute( - KGlxMediaIdThumbnail, - GlxFullThumbnailAttributeId(ETrue, - tnSize.iWidth, tnSize.iHeight)); - - const CGlxThumbnailAttribute* value = - media.ThumbnailAttribute( - thumbnailAttribute); - - // No thumbnail available, hence there might be - // no vaild items to play slideshow - if (!value) - { - aMenuPane->SetItemDimmed( - EGlxCmdSlideshowPlay, ETrue); - } - } - } - } - } - - if (aIsBrowseMode) - { - if (aMenuPane->MenuItemExists(EGlxCmdSlideshow, pos) - && mediaList.SelectionCount()) - { - aMenuPane->SetItemDimmed(EGlxCmdSlideshow, ETrue); - } - - if (aMenuPane->MenuItemExists(EGlxCmdSlideshowPlay, pos) - && mediaList.SelectionCount() == 0) - { - CEikMenuPaneItem::SData& item = - aMenuPane->ItemDataByIndexL(pos); - if (item.iFlags & EEikMenuItemSpecific - && EMPXVideo == mediaList.Item( - mediaList.FocusIndex()).Category()) - { - aMenuPane->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue); - } - } - } - } - else - { - if (aMenuPane->MenuItemExists(EGlxCmdSlideshowPlay, pos)) - { - aMenuPane->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue); - } - - if (aMenuPane->MenuItemExists(EGlxCmdSlideshow, pos)) - { - aMenuPane->SetItemDimmed(EGlxCmdSlideshow, ETrue); - } - } - } - } - - // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp --- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -15,6 +15,11 @@ * */ + +/** + * @internal reviewed 06/06/2007 by Dave Schofield + * @internal reviewed 13/07/2007 by Aki Vanhatalo + */ // INCLUDE FILES #include "glxmediaselectionpopup.h" @@ -243,14 +248,8 @@ { cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL); } - //LSK / SK1’s visibility is determined by the screen context, if single click support enabled. - //As suggested by Avkon, disable the CEikCba’s item specific softkey default behavior. - CEikCba* eikCba = static_cast( cbaContainer->ButtonGroup() ); - if( eikCba ) - { - eikCba->EnableItemSpecificSoftkey( EFalse ); - } cbaContainer->DrawDeferred(); + } listBox->DrawDeferred(); @@ -335,9 +334,7 @@ const TKeyEvent& aKeyEvent, TEventCode aType) { TRACER("CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL"); - //Note: To add custom implementation to OfferKeyEventL(), change - //CAknSingleGraphicPopupMenuStyleListBox to CGlxSingleGraphicPopupMenuStyleListBox. - + //Based on the selected item index, disable the MultipleSelection flag //to stop the flickering of 'marked box', when Highlighted 'New Tag' is selected. CGlxMediaListAdaptor* mediaListAdaptor = @@ -488,9 +485,11 @@ iMediaList->RemoveMediaListObserver(this); // We no longer require any callbacks from the media list + CMPXCollectionPath* path = NULL; if (aAccepted) { + //Check if a static item is selected if (iMediaListAdaptor->IsStaticItemSelected()) { @@ -520,6 +519,7 @@ // The error is neither KErrNone or KErrCancel, leave. User::Leave(error); } + } else { @@ -885,18 +885,14 @@ KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle); rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); - // Media list must not have been deleted when the destructor of - // TGlxContextRemover is called while going out-of-scope. - { - // 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); - } // Limiting scope of contextRemover + // 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); TInt index = rootList->Index(KGlxIdSpaceIdRoot, iCollectionId); diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/commandhandlers/inc/glxcommandhandlers.hrh --- a/photosgallery/viewframework/commandhandlers/inc/glxcommandhandlers.hrh Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/commandhandlers/inc/glxcommandhandlers.hrh Wed Oct 13 14:32:09 2010 +0300 @@ -93,7 +93,6 @@ EGlxCmdSave, EGlxCmdRenameCompleted, EGlxCmdDialogLaunched, - EGlxCmdDialogDismissed, //For sendui dialog dismiss.Handled in FS and Grid EGlxCmdAiwBase = 0x6000 }; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/dataprovider/inc/glxdetailsboundcommand.hrh --- a/photosgallery/viewframework/dataprovider/inc/glxdetailsboundcommand.hrh Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/inc/glxdetailsboundcommand.hrh Wed Oct 13 14:32:09 2010 +0300 @@ -52,7 +52,7 @@ enum TImageVwrDetailsFields { EImgVwrNameItem, - EImgVwrMimeTypeItem, + EImgVwrDescriptionItem, EImgVwrDateAndTimeItem, EImgVwrSizeItem, EImgVwrResolutionItem, diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/dataprovider/inc/glxdrmgiftexturecreator.h --- a/photosgallery/viewframework/dataprovider/inc/glxdrmgiftexturecreator.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/inc/glxdrmgiftexturecreator.h Wed Oct 13 14:32:09 2010 +0300 @@ -28,6 +28,8 @@ class CGlxBinding; class TGlxMedia; // Reference to a media item in the item pool class CAlfEnv; +class CGlxDRMUtility; +class CGlxImageViewerManager; namespace Alf { @@ -113,6 +115,19 @@ void ProcessImageL(); void SetTexture(TInt aTextureId=KErrNotFound); + + /* + * Check whether the drm rights are expired or not + * for animated gifs. + */ + TBool IsDRMRightsExpiredL(); + + /** + * Sets the default or FS texture as initial texture. + * Then creates Image decoder & starts image decoding + * if DRM Rights are not expired. + */ + void SetInitialTextureAndStartDecodingL(); private: @@ -146,5 +161,10 @@ TFrameInfo iFrameInfo; TBool iFrameShift; MGlxMediaList& iMediaList; + + /** Poniter to instance of DRM utility (owned) */ + CGlxDRMUtility* iDrmUtility; + /** For image viewer, not own */ + CGlxImageViewerManager* iImageViewerInstance; }; #endif /* GLXDRMGIFTEXTURECREATOR_H_ */ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/dataprovider/src/glxdetailsboundcommand.cpp --- a/photosgallery/viewframework/dataprovider/src/glxdetailsboundcommand.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/src/glxdetailsboundcommand.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -17,14 +17,11 @@ -#include "glxdetailsboundcommand.hrh" -#include "glxdetailsboundcommand.h" // Handles user commands -#include "glxuiutility.h" -/** Error Id EMPY-7MKDHP **/ -#include "mglxmetadatadialogobserver.h" //for call back to dailog #include // Base class for all classes to be instantiated on the heap #include //For CExifModify +#include "glxdetailsboundcommand.hrh" +#include "glxdetailsboundcommand.h" // Handles user commands #include #include #include @@ -40,11 +37,16 @@ #include // Logging #include #include -#include -#include // for CGlxResourceUtilities -#include // for KMaxMediaPopupTextLength +#include "glxuiutility.h" +#include +#include // for CGlxResourceUtilities +/** Error Id EMPY-7MKDHP **/ +#include "mglxmetadatadialogobserver.h" //for call back to dailog +//CONSTANTS +const TInt KMaxMediaPopupTitleLength = 0x100; + // ---------------------------------------------------------------------------- // CGlxTitleBoundCommand::NewL // ---------------------------------------------------------------------------- @@ -89,11 +91,11 @@ { ///@todo - remove popup when editable template is avaliable //Popup for testing - HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTextLength ); + HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); (textBuf->Des()).Copy((media->ValueText(KMPXMediaGeneralTitle))); TPtr textPtr = textBuf->Des(); /// bug fix - EMPY-7MCKD6 - TBuf titleText(*textBuf); + TBuf titleText(*textBuf); /// bug fix - EMPY-7MCKD6 ///@todo - remove literal for popup title when resource string is avaliable HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES); @@ -384,11 +386,11 @@ { ///@todo - remove popup when editable template is avaliable //Popup for testing - HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTextLength ); + HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); (textBuf->Des()).Copy((media->ValueText(KMPXMediaGeneralComment))); TPtr textPtr = textBuf->Des(); /// bug fix - EMPY-7MCKD6 - TBuf descText(*textBuf); + TBuf descText(*textBuf); /// bug fix - EMPY-7MCKD6 ///@todo - remove literal for popup title when resource string is avaliable @@ -1020,6 +1022,7 @@ void CGlxUsageRightsBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const { TRACER("CGlxUsageRightsBoundCommand::InitMenuL"); + aMenu.SetItemTextL( KGlxViewBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_VIEW ); aMenu.SetItemDimmed( KGlxViewBoundMenuCommandId, EFalse ); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/dataprovider/src/glxdrmgiftexturecreator.cpp --- a/photosgallery/viewframework/dataprovider/src/glxdrmgiftexturecreator.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/src/glxdrmgiftexturecreator.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -29,6 +29,8 @@ #include "glxuiutility.h" #include "glxdrmgiftexturecreator.h" #include "glxdrmgifactivedecoder.h" +#include +#include // Default frame interval for animation, in microseconds const TInt KDefaultFrameInterval = 100000; @@ -65,9 +67,11 @@ } iUiUtility->Close(); - + if (iDrmUtility) + { + iDrmUtility->Close(); + } delete iGlxDecoderAO; - iFsSession.Close(); } @@ -83,6 +87,12 @@ iTransparencyPossible = EFalse; iFrameShift = EFalse; + //delete image viewer instance, if present. + if ( iImageViewerInstance ) + { + iImageViewerInstance->DeleteInstance(); + } + if (iGlxDecoderAO) { iGlxDecoderAO->Cancel(); @@ -135,21 +145,14 @@ TRACER("CGlxDrmGifTextureCreator::ConstructL()"); iUiUtility = CGlxUiUtility::UtilityL(); User::LeaveIfError(iFsSession.Connect()); - iBitmapReady = EFalse; - iAnimCount = 0; - iAnimateFlag = EFalse; - iTransparencyPossible = EFalse; - iFrameShift = EFalse; - - //Set the initial texture, it could be default or the FS texture - SetTexture(); + + //Create DRM Utility to check DRM rights validity + iDrmUtility = CGlxDRMUtility::InstanceL(); // Create the active object iGlxDecoderAO = CGlxDRMgifDecoderAO::NewL(this); -#ifdef _DEBUG - iStartTime.HomeTime(); -#endif - CreateImageDecoderL(iMedia->Uri()); - CreateBitmapAndStartDecodingL(); + + //Set the initial texture.And create and starts the Image Decoder + SetInitialTextureAndStartDecodingL(); } // ----------------------------------------------------------------------------- @@ -160,8 +163,17 @@ { TRACER("CGlxDrmGifTextureCreator::UpdateNewImageL()"); GLX_LOG_INFO1("DrmGif: UpdateNewImageL() aItemIndex=%d", aItemIndex); + + //Start Decoding only if the aItemIndex refers to new Item index if (aItemIndex == iItemIndex) { + //All textures were flushed when in background. + //so, when app. comes to foreground again and DRM Rights have expired for + //current item, then create default Texture. + if(iUiUtility->GetForegroundStatus() && IsDRMRightsExpiredL()) + { + SetTexture(); + } return; } @@ -171,19 +183,38 @@ iItemIndex = aItemIndex; iMedia = &aMedia; + //Set the initial texture.And create and starts the Image Decoder + SetInitialTextureAndStartDecodingL(); + } + +// ----------------------------------------------------------------------------- +// SetInitialTextureAndStartDecodingL +// ----------------------------------------------------------------------------- +void CGlxDrmGifTextureCreator::SetInitialTextureAndStartDecodingL() + { + TRACER("CGlxDrmGifTextureCreator::SetInitialTextureAndStartDecodingL()"); + iBitmapReady = EFalse; iAnimCount = 0; iAnimateFlag = EFalse; iTransparencyPossible = EFalse; iFrameShift = EFalse; + //Creates the image viewer instance, if not created already. + iImageViewerInstance = CGlxImageViewerManager::InstanceL(); + __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); + //Set the initial texture, it could be default or the FS texture SetTexture(); #ifdef _DEBUG iStartTime.HomeTime(); #endif - CreateImageDecoderL(iMedia->Uri()); - CreateBitmapAndStartDecodingL(); + //Check if DRM Rights are not expired before starting image decoding + if (!IsDRMRightsExpiredL()) + { + CreateImageDecoderL(iMedia->Uri()); + CreateBitmapAndStartDecodingL(); + } } // ----------------------------------------------------------------------------- @@ -507,3 +538,27 @@ iModel->SetData(iItemIndex, item); } } + +// ----------------------------------------------------------------------------- +// IsDRMRightsExpiredL +// ----------------------------------------------------------------------------- +// +TBool CGlxDrmGifTextureCreator::IsDRMRightsExpiredL() + { + TRACER("CGlxDrmGifTextureCreator::IsDRMRightsExpiredL"); + //To check if DRM rights are expired + TBool expired = EFalse; + TMPXGeneralCategory cat = iMedia->Category(); + + if (iImageViewerInstance->IsPrivate()) + { + expired = !iDrmUtility->DisplayItemRightsCheckL + (iImageViewerInstance->ImageFileHandle(),(cat == EMPXImage)); + } + else + { + expired = !iDrmUtility->DisplayItemRightsCheckL(iMedia->Uri(), (cat == EMPXImage)); + } + return expired; + } + diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp --- a/photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -20,16 +20,19 @@ #include "glxmulmodelproviderbase.h" +#include #include #include #include #include +//#include #include #include #include -#include // An interface for Multimedia coverflow Widget #include //Logging #include +#include "glxbinding.h" +#include "glxcommandbindingutility.h" #include #include @@ -39,9 +42,8 @@ #include #include #include +#include // An interface for Multimedia coverflow Widget #include "glxdrmgiftexturecreator.h" -#include "glxbinding.h" -#include "glxcommandbindingutility.h" using namespace Alf; @@ -49,6 +51,9 @@ static const char* const KGridWidget = "GridWidget"; static const char* const KCoverFlowWidget = "CoverflowWidget"; +//@todo to be uncommented when using command binding +//#include "glxboundcommand.h" + // ---------------------------------------------------------------------------- // BaseConstructL // ---------------------------------------------------------------------------- @@ -184,7 +189,6 @@ AlfEventStatus response = EEventNotHandled; if ( aEvent.IsCustomEvent() ) { - GLX_LOG_INFO1("CGlxMulModelProviderBase::offerEvent() aEvent.CustomParameter(%d)", aEvent.CustomParameter()); switch ( aEvent.CustomParameter() ) { case KAlfActionIdDeviceLayoutChanged: @@ -202,29 +206,9 @@ response = EEventHandled; } break; - case Alf::ETypeItemRemoved: - { - GLX_LOG_INFO("CGlxMulModelProviderBase::offerEvent - ETypeItemRemoved!"); - CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); - CleanupClosePushL(*uiUtility); - if (iModel->Count() == 0 && UString(KCoverFlowWidget) - == UString(iWidget.widgetName()) - && iNavigationalState->ViewingMode() - == NGlxNavigationalState::EView - && uiUtility->GetForegroundStatus()) - { - uiUtility->SetViewNavigationDirection( - EGlxNavigationBackwards); - - iNavigationalState->ActivatePreviousViewL(); - response = EEventHandled; - } - CleanupStack::PopAndDestroy(uiUtility); - } - break; - default: - break; - } + default: + break; + } } return response; } @@ -460,7 +444,6 @@ { TRACER("CGlxMulModelProviderBase::RemoveItems"); // RemoveItems does not throw according to model documentation - GLX_LOG_INFO2("CGlxMulModelProviderBase::RemoveItems() aIndex(%d), aCount(%d)", aIndex, aCount); iModel->Remove( aIndex, aCount ); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/drmutility/group/glxdrmutility.mmp --- a/photosgallery/viewframework/drmutility/group/glxdrmutility.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/drmutility/group/glxdrmutility.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -44,6 +44,5 @@ LIBRARY drmhelper.lib LIBRARY caf.lib LIBRARY cafutils.lib -LIBRARY drmuihandling.lib -LIBRARY efsrv.lib + // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/drmutility/src/glxdrmutility.cpp --- a/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -32,9 +32,6 @@ #include "glxtracer.h" #include "glxlog.h" -#include -using namespace DRM; - const TInt KGlxDRMThumbnailHeight = 120; const TInt KGlxDRMThumbnailWidth = 90; @@ -171,16 +168,7 @@ #ifdef _DEBUG TTime startTime; startTime.HomeTime(); -#endif - TFileName fileName(KNullDesC); - fileName.Append(aFileHandle.FullName(fileName)); - if (iLastConsumedItemUri->Length() > 0) - { - if (fileName.CompareF(*iLastConsumedItemUri) == 0) - { - return ETrue; - } - } +#endif TBool rightsValid = EFalse; ContentAccess::TAttribute attrib = aCheckViewRights ? ContentAccess::ECanView : ContentAccess::ECanPlay; @@ -231,20 +219,6 @@ TBool aCheckViewRights) { TRACER("CGlxDRMUtility::DisplayItemRightsCheckL(RFile)"); - TFileName fileName(KNullDesC); - fileName.Append(aFileHandle.FullName(fileName)); - // Allow to display if rights for a URI was just consumed (i.e. same as stored URI) - if (iLastConsumedItemUri->Length() > 0) - { - if (fileName.CompareF(*iLastConsumedItemUri) == 0) - { - return ETrue; - } - } - - //Clear the stored uri - ClearLastConsumedItemUriL(); - // Otherwise, check current rights for the URI of newly focused item return ItemRightsValidityCheckL(aFileHandle, aCheckViewRights); } @@ -288,22 +262,7 @@ { TRACER("CGlxDRMUtility::ConsumeRightsL(RFile)"); CData* data = CData::NewLC(aFileHandle, KDefaultContentObject(), EPeek); - - //When consuming rights for a URI, clear stored URI - ClearLastConsumedItemUriL(); - TInt err = data->ExecuteIntent(ContentAccess::EView); - TFileName fileName(KNullDesC); - fileName.Append(aFileHandle.FullName(fileName)); - - if (err == KErrNone) - { - //Update stored URI - iLastConsumedItemUri = iLastConsumedItemUri->ReAllocL(fileName.Length()); - TPtr newPtr = iLastConsumedItemUri->Des(); - newPtr.Copy(fileName); - } - CleanupStack::PopAndDestroy(data); return (err == KErrNone); } @@ -407,22 +366,15 @@ EXPORT_C void CGlxDRMUtility::ShowDRMDetailsPaneL(const TDesC& aUri) { TRACER("CGlxDRMUtility::ShowDRMDetailsPaneL(URI)"); - GLX_LOG_URI("CGlxDRMUtility::ShowDRMDetailsPaneL(%S)", &aUri); - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); + TRAPD( err, iDrmHelper->LaunchDetailsViewEmbeddedL( aUri ) ); + // if no rights ask user to re-activate + if (err == KErrCANoRights) + { + HBufC* buf = aUri.AllocLC(); + iDrmHelper->ActivateContentL(*buf); + CleanupStack::PopAndDestroy(buf); + } - RFile64 drmFile; - User::LeaveIfError(drmFile.Open(fs, aUri, EFileRead - | EFileShareReadersOrWriters)); - CleanupClosePushL(drmFile); - - CDrmUiHandling* drmUiHandler = CDrmUiHandling::NewLC(); - TRAP_IGNORE(drmUiHandler->ShowDetailsViewL(drmFile)); - CleanupStack::PopAndDestroy(drmUiHandler); - - CleanupStack::PopAndDestroy(&drmFile); - CleanupStack::PopAndDestroy(&fs); } //============================================================================ @@ -431,9 +383,12 @@ EXPORT_C void CGlxDRMUtility::ShowDRMDetailsPaneL(RFile& aFileHandle) { TRACER("CGlxDRMUtility::ShowDRMDetailsPaneL(RFile)"); - CDrmUiHandling* drmUiHandler = CDrmUiHandling::NewLC(); - TRAP_IGNORE(drmUiHandler->ShowDetailsViewL(aFileHandle)); - CleanupStack::PopAndDestroy(drmUiHandler); + TRAPD( err, iDrmHelper->LaunchDetailsViewEmbeddedL( aFileHandle ) ); + // if no rights ask user to re-activate + if (err == KErrCANoRights) + { + //need to check if we need to handle. + } } //============================================================================ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/medialists/src/glxattributecontext.cpp --- a/photosgallery/viewframework/medialists/src/glxattributecontext.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/medialists/src/glxattributecontext.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -172,19 +172,20 @@ } } + // If the attribute request is for Thumbnail, Check if there is a match found. // And set the size and thumbnail quality TIdentityRelation matchContent(&TMPXAttribute::MatchContentId); TMPXAttribute tnAttr(KGlxMediaIdThumbnail, 0); - if (aAttributes.Find(tnAttr, matchContent) != KErrNotFound) + if (iAttributes.Find(tnAttr, matchContent) != KErrNotFound) { // Allocate CMPXAttributeSpecs CMPXAttributeSpecs* attributeSpecs = CMPXAttributeSpecs::NewL(); CleanupStack::PushL(attributeSpecs); - attributeSpecs->SetTObjectValueL( - TMPXAttribute( KGlxMediaIdThumbnail, + attributeSpecs->SetTObjectValueL( + TMPXAttribute( KGlxMediaIdThumbnail, KGlxAttribSpecThumbnailSize ), TSize(iDefaultSpecSize.iWidth,iDefaultSpecSize.iHeight) ); @@ -192,16 +193,11 @@ TMPXAttribute( KGlxMediaIdThumbnail, KGlxAttribSpecThumbnailQualityOverSpeed ), ETrue ); - // Memory leak guard check - if (aDetailedSpecs) - { - delete aDetailedSpecs; - aDetailedSpecs = NULL; - } aDetailedSpecs = attributeSpecs; // Pop from stack CleanupStack::Pop(attributeSpecs); + } // If an error was found, return KErrGeneral diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/medialists/src/glxcachemanager.cpp --- a/photosgallery/viewframework/medialists/src/glxcachemanager.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/medialists/src/glxcachemanager.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -1007,8 +1007,6 @@ TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); HandleCollectionMediaL(spaceId, *iMPXMedia, KErrNone); DeleteImageViewerInstance(); - delete iReader; - iReader = NULL; return; } else diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss --- a/photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/data/glxfullscreenviewdata.rss Wed Oct 13 14:32:09 2010 +0300 @@ -251,8 +251,6 @@ txt = qtn_options_send_via; }, MENU_ITEM { command = EGlxCmdAiwShareOnOvi; /* txt comes from ShareOnline 4.3 */}, - MENU_ITEM { command = EGlxCmdDelete; - txt = qtn_lgal_options_delete; }, MENU_ITEM { command = EGlxCmdAiwEdit; txt = qtn_lgal_options_edit; }, MENU_ITEM { command = EGlxCmdDetails; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss --- a/photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/plugins/gridviewplugin/data/glxgridviewdata.rss Wed Oct 13 14:32:09 2010 +0300 @@ -1,22 +1,25 @@ /* - * 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: Resource definitions for Grid View plugin - * - */ +* 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: Resource definitions for Grid View plugin +* +*/ + + + // RESOURCE IDENTIFIER -NAME MPXC +NAME MPXC // INCLUDES @@ -35,11 +38,9 @@ // RESOURCE DEFINITIONS -RESOURCE RSS_SIGNATURE - {} +RESOURCE RSS_SIGNATURE { } -RESOURCE TBUF - {buf="GLTV";} +RESOURCE TBUF { buf="GLTV"; } // ----------------------------------------------------------------------------------- // Resource Definitions @@ -47,10 +48,10 @@ // Downloads Grid View RESOURCE AVKON_VIEW r_grid_view - { - menubar = r_grid_menubar; - cba = r_grid_softkeys; - } + { + menubar = r_grid_menubar; + cba = r_grid_softkeys; + } // Captured Grid View RESOURCE AVKON_VIEW r_glx_captured_grid_view @@ -80,27 +81,26 @@ cba = r_grid_softkeys; } + // ------------------------------------------------------------------------------------ // Menu Bar Resources // ------------------------------------------------------------------------------------ // Basic Grid Views RESOURCE MENU_BAR r_grid_menubar - { - titles= - { - MENU_TITLE - {menu_pane=r_glx_grid_menu; txt="";} - }; - } + { + titles= + { + MENU_TITLE { menu_pane=r_glx_grid_menu; txt=""; } + }; + } // Albums Grid View RESOURCE MENU_BAR r_glx_album_grid_menubar { titles= { - MENU_TITLE - {menu_pane=r_glx_album_grid_menu; txt="";} + MENU_TITLE { menu_pane=r_glx_album_grid_menu; txt=""; } }; } @@ -109,10 +109,10 @@ { titles= { - MENU_TITLE - {menu_pane=r_taggrid_menu; txt="";} + MENU_TITLE { menu_pane=r_taggrid_menu; txt=""; } }; - } + } + // ------------------------------------------------------------------------------------ // Menu Contents for Grid views @@ -121,180 +121,144 @@ // Basic grid views RESOURCE MENU_PANE r_glx_grid_menu { - items= - { - MENU_ITEM - {command = EGlxCmdPlay; - txt = qtn_lgal_options_play;}, - MENU_ITEM - {command = EGlxCmdSend; - txt = qtn_options_send_via; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdAiwShareOnOvi; - /* txt comes from ShareOnline 4.3 */}, - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshowPlay; - txt = qtn_lgal_options_slideshow; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshow; - txt = qtn_lgal_options_slideshow; - cascade = r_grid_shw_menu;}, - MENU_ITEM - {command = EGlxCmdAiwEdit; - txt = qtn_lgal_options_edit; - flags = EEikMenuItemSpecificListQuery;}, - MENU_ITEM - {command = EGlxCmdDetails; - txt = qtn_lgal_options_details;}, - MENU_ITEM - {command = EAknMarkAll; - txt = qtn_options_list_mark_all;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EAknCmdHelp; - txt = qtn_options_help;}, - MENU_ITEM - {command = EAknCmdExit; - txt = qtn_options_exit;} - }; + items= + { + MENU_ITEM { command = EGlxCmdPlay; + txt = qtn_lgal_options_play; }, + MENU_ITEM { command = EGlxCmdSend; + txt = qtn_options_send_via; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAiwShareOnOvi; + /* txt comes from ShareOnline 4.3 */ + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdSlideshowPlay; + txt = qtn_lgal_options_slideshow; + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command = EGlxCmdSlideshow; + txt = qtn_lgal_options_slideshow; + cascade = r_grid_shw_menu; }, + MENU_ITEM { command = EGlxCmdAiwEdit; + txt = qtn_lgal_options_edit; + flags = EEikMenuItemSpecificListQuery;}, + MENU_ITEM { command = EGlxCmdDetails; + txt = qtn_lgal_options_details; }, + MENU_ITEM { command = EAknMarkAll; + txt = qtn_options_list_mark_all;}, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all;}, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EAknCmdHelp; + txt = qtn_options_help; }, + MENU_ITEM { command = EAknCmdExit; + txt = qtn_options_exit; } + }; } // Albums Grid RESOURCE MENU_PANE r_glx_album_grid_menu { - items= - { - MENU_ITEM - {command = EGlxCmdPlay; - txt = qtn_lgal_options_play;}, - MENU_ITEM - {command = EGlxCmdSend; - txt = qtn_options_send_via; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdAiwShareOnOvi; - /* txt comes from ShareOnline 4.3 */}, - MENU_ITEM - {command = EGlxCmdRemoveFrom; - txt = qtn_lgal_options_remove_from_album; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshowPlay; - txt = qtn_lgal_options_slideshow; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshow; - txt = qtn_lgal_options_slideshow; - cascade = r_grid_shw_menu;}, - MENU_ITEM - {command = EGlxCmdAiwEdit; - txt = qtn_lgal_options_edit; - flags = EEikMenuItemSpecificListQuery;}, - MENU_ITEM - {command = EGlxCmdDetails; - txt = qtn_lgal_options_details;}, - MENU_ITEM - {command = EAknMarkAll; - txt = qtn_options_list_mark_all;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EAknCmdHelp; - txt = qtn_options_help;}, - MENU_ITEM - {command = EAknCmdExit; - txt = qtn_options_exit;} - }; - } + items= + { + MENU_ITEM { command = EGlxCmdPlay; + txt = qtn_lgal_options_play; }, + MENU_ITEM { command = EGlxCmdSend; + txt = qtn_options_send_via; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAiwShareOnOvi; + /* txt comes from ShareOnline 4.3 */ + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command = EGlxCmdRemoveFrom; + txt = qtn_lgal_options_remove_from_album; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdSlideshowPlay; + txt = qtn_lgal_options_slideshow; + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command = EGlxCmdSlideshow; + txt = qtn_lgal_options_slideshow; + cascade = r_grid_shw_menu; }, + MENU_ITEM { command = EGlxCmdAiwEdit; + txt = qtn_lgal_options_edit; + flags = EEikMenuItemSpecificListQuery;}, + MENU_ITEM { command = EGlxCmdDetails; + txt = qtn_lgal_options_details; }, + MENU_ITEM { command = EAknMarkAll; + txt = qtn_options_list_mark_all;}, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all;}, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EAknCmdHelp; + txt = qtn_options_help; }, + MENU_ITEM { command = EAknCmdExit; + txt = qtn_options_exit; } + }; + } // Tags Grid RESOURCE MENU_PANE r_taggrid_menu - { - items= - { - MENU_ITEM - {command = EGlxCmdPlay; - txt = qtn_lgal_options_play;}, - MENU_ITEM - {command = EGlxCmdSend; - txt = qtn_options_send_via; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdAiwShareOnOvi; - /* txt comes from ShareOnline 4.3 */}, - MENU_ITEM - {command=EGlxCmdRemoveFrom; - txt = qtn_lgal_options_remove_from_tag; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshowPlay; - txt = qtn_lgal_options_slideshow; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdSlideshow; - txt = qtn_lgal_options_slideshow; - cascade = r_grid_shw_menu;}, - MENU_ITEM - {command = EGlxCmdAiwEdit; - txt = qtn_lgal_options_edit; - flags = EEikMenuItemSpecificListQuery;}, - MENU_ITEM - {command = EGlxCmdDetails; - txt = qtn_lgal_options_details;}, - MENU_ITEM - {command = EAknMarkAll; - txt = qtn_options_list_mark_all;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album; - flags = EEikMenuItemSpecific;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag;}, - MENU_ITEM - {command = EAknCmdHelp; - txt = qtn_options_help;}, - MENU_ITEM - {command = EAknCmdExit; - txt = qtn_options_exit;} - }; + { + items= + { + MENU_ITEM { command = EGlxCmdPlay; + txt = qtn_lgal_options_play; }, + MENU_ITEM { command = EGlxCmdSend; + txt = qtn_options_send_via; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAiwShareOnOvi; + /* txt comes from ShareOnline 4.3 */ + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command=EGlxCmdRemoveFrom; + txt = qtn_lgal_options_remove_from_tag; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdSlideshowPlay; + txt = qtn_lgal_options_slideshow; + flags = EEikMenuItemSpecific;}, + MENU_ITEM { command = EGlxCmdSlideshow; + txt = qtn_lgal_options_slideshow; + cascade = r_grid_shw_menu; }, + MENU_ITEM { command = EGlxCmdAiwEdit; + txt = qtn_lgal_options_edit; + flags = EEikMenuItemSpecificListQuery;}, + MENU_ITEM { command = EGlxCmdDetails; + txt = qtn_lgal_options_details; }, + MENU_ITEM { command = EAknMarkAll; + txt = qtn_options_list_mark_all;}, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all;}, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; + flags = EEikMenuItemSpecific; }, + MENU_ITEM { command = EAknCmdHelp; + txt = qtn_options_help; }, + MENU_ITEM { command = EAknCmdExit; + txt = qtn_options_exit; } + }; } + + + // ------------------------------------------------------------------------------------ // Submenu contents // ------------------------------------------------------------------------------------ @@ -304,153 +268,146 @@ { items= { - MENU_ITEM - {command=EGlxCmdSlideshowPlay; - txt=qtn_lgal_options_slideshow_play;}, - MENU_ITEM - {command=EGlxCmdSlideshowSettings; - txt=qtn_lgal_options_slideshow_settings_general;} + MENU_ITEM { command=EGlxCmdSlideshowPlay; txt=qtn_lgal_options_slideshow_play; }, + MENU_ITEM { command=EGlxCmdSlideshowSettings; txt=qtn_lgal_options_slideshow_settings_general; } }; } + // EditList sub menu for Marking RESOURCE MENU_PANE r_viu_editlist_menu { items = { /*MENU_ITEM - { - command = EAknCmdMark; - txt = qtn_options_list_mark_one; - },*/ + { + command = EAknCmdMark; + txt = qtn_options_list_mark_one; + },*/ MENU_ITEM { command = EAknMarkAll; txt = qtn_options_list_mark_all; }, /*MENU_ITEM - { - command = EAknCmdUnmark; - txt = qtn_options_list_unmark_one; - },*/ + { + command = EAknCmdUnmark; + txt = qtn_options_list_unmark_one; + },*/ MENU_ITEM { command = EAknUnmarkAll; txt = qtn_options_list_unmark_all; - } + } }; } +// Rotate Sub menu +//RESOURCE MENU_PANE r_rotate_sub_menu +// { +// items = +// { +// MENU_ITEM +// { +// command = EGlxCmdRotateLeft; +// txt = qtn_lgal_options_rotate_left; +// }, +// MENU_ITEM +// { +// command = EGlxCmdRotateRight; +// txt = qtn_lgal_options_rotate_right; +// } +// }; +// } + // Home Network sub menu RESOURCE MENU_PANE r_home_network_menu { items= { - MENU_ITEM - {command=EGlxShowViaUpnpSubmenuVersion; - txt=qtn_lgal_options_sub_show_ext;}, - MENU_ITEM - {command=EGlxStopShowingSubmenuVersion; - txt=qtn_lgal_options_sub_stop_show;}, - MENU_ITEM - {command=EGlxCopyToHomeNetwork; - txt=qtn_lgal_options_copy_to_home_net;} + MENU_ITEM { command=EGlxShowViaUpnpSubmenuVersion; txt=qtn_lgal_options_sub_show_ext; }, + MENU_ITEM { command=EGlxStopShowingSubmenuVersion; txt=qtn_lgal_options_sub_stop_show; }, + MENU_ITEM { command=EGlxCopyToHomeNetwork; txt=qtn_lgal_options_copy_to_home_net; } }; } + // ------------------------------------------------------------------------------------ // Other Menubars // ------------------------------------------------------------------------------------ RESOURCE MENU_BAR r_grid_ok_menubar - { - titles= - { - MENU_TITLE - {menu_pane=r_grid_ok_menu; txt="";} - }; - } - + { + titles= + { + MENU_TITLE { menu_pane=r_grid_ok_menu; txt=""; } + }; + } + RESOURCE MENU_BAR r_grid_ok_menubar_album_gridview - { - titles= - { - MENU_TITLE - {menu_pane=r_grid_ok_menu_album_gridview; txt="";} - }; - } + { + titles= + { + MENU_TITLE { menu_pane=r_grid_ok_menu_album_gridview; txt=""; } + }; + } RESOURCE MENU_BAR r_grid_ok_menubar_tag_gridview { titles= { - MENU_TITLE - {menu_pane=r_grid_ok_menu_tag_gridview; txt="";} + MENU_TITLE { menu_pane=r_grid_ok_menu_tag_gridview; txt=""; } }; } RESOURCE MENU_PANE r_grid_ok_menu - { - items= - { - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag;} - }; - } + { + items= + { + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; }, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all; }, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; } + }; + } RESOURCE MENU_PANE r_grid_ok_menu_album_gridview - { - items= - { - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag;}, - MENU_ITEM - {command = EGlxCmdRemoveFrom; - txt = qtn_lgal_options_remove_from_album;} - }; - } + { + items= + { + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; }, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all; }, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; }, + MENU_ITEM { command = EGlxCmdRemoveFrom; + txt = qtn_lgal_options_remove_from_album; } + }; + } RESOURCE MENU_PANE r_grid_ok_menu_tag_gridview - { - items= - { - MENU_ITEM - {command = EGlxCmdDelete; - txt = qtn_lgal_options_delete;}, - MENU_ITEM - {command = EAknUnmarkAll; - txt = qtn_options_list_unmark_all;}, - MENU_ITEM - {command = EGlxCmdAddToAlbum; - txt = qtn_lgal_options_add_to_album;}, - MENU_ITEM - {command = EGlxCmdAddTag; - txt = qtn_lgal_options_properties_add_tag;}, - MENU_ITEM - {command=EGlxCmdRemoveFrom; - txt=qtn_lgal_options_remove_from_tag;} - }; - } + { + items= + { + MENU_ITEM { command = EGlxCmdDelete; + txt = qtn_lgal_options_delete; }, + MENU_ITEM { command = EAknUnmarkAll; + txt = qtn_options_list_unmark_all; }, + MENU_ITEM { command = EGlxCmdAddToAlbum; + txt = qtn_lgal_options_add_to_album; }, + MENU_ITEM { command = EGlxCmdAddTag; + txt = qtn_lgal_options_properties_add_tag; }, + MENU_ITEM { command=EGlxCmdRemoveFrom; + txt=qtn_lgal_options_remove_from_tag; } + }; + } // ------------------------------------------------------------------------------------ // Softkey resources @@ -478,6 +435,7 @@ }; } + RESOURCE CBA r_grid_softkeys_fullscreen { buttons = @@ -505,7 +463,7 @@ // ------------------------------------------------------------------------------------ RESOURCE TBUF r_grid_empty_view_text { - buf = qtn_lgal_empty_grid_no_items; + buf = qtn_lgal_empty_grid_no_items; } RESOURCE TBUF r_grid_empty_view_text_image @@ -537,57 +495,57 @@ items = { TBAR_CTRL - { - type = EAknCtButton; - id = EGlxCmdSlideshowPlay; - control = AVKON_BUTTON - { - flags = 0; - states = - { - AVKON_BUTTON_STATE - { - bmpfile = "z:\\Resource\\apps\\glxicons.mif"; - bmpid = EMbmGlxiconsQgn_indi_tb_slideshow; - bmpmask = EMbmGlxiconsQgn_indi_tb_slideshow_mask; - press_bmpid = EMbmGlxiconsQgn_indi_tb_slideshow; - press_bmpmask = EMbmGlxiconsQgn_indi_tb_slideshow_mask; - helptxt = qtn_lgal_tooltip_slideshow; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EGlxCmdStartMultipleMarking; - control = AVKON_BUTTON - { - flags = 0; - states = - { - AVKON_BUTTON_STATE - { - bmpfile = "z:\\Resource\\apps\\glxicons.mif"; - bmpid = EMbmGlxiconsQgn_indi_cam4_tb_mark; - bmpmask = EMbmGlxiconsQgn_indi_cam4_tb_mark_mask; - press_bmpid = EMbmGlxiconsQgn_indi_cam4_tb_mark; - press_bmpmask = EMbmGlxiconsQgn_indi_cam4_tb_mark_mask; - helptxt = qtn_lgal_tooltip_mark_items; - }, - AVKON_BUTTON_STATE - { - flags = KAknButtonStateHasLatchedFrame; - bmpfile = "z:\\Resource\\apps\\glxicons.mif"; - bmpid = EMbmGlxiconsQgn_indi_tb_unmark; - bmpmask = EMbmGlxiconsQgn_indi_tb_unmark_mask; - press_bmpid = EMbmGlxiconsQgn_indi_tb_unmark; - press_bmpmask = EMbmGlxiconsQgn_indi_tb_unmark_mask; - helptxt = qtn_lgal_tooltip_unmark_all; - } - }; - }; - }, + { + type = EAknCtButton; + id = EGlxCmdSlideshowPlay; + control = AVKON_BUTTON + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "z:\\Resource\\apps\\glxicons.mif"; + bmpid = EMbmGlxiconsQgn_indi_tb_slideshow; + bmpmask = EMbmGlxiconsQgn_indi_tb_slideshow_mask; + press_bmpid = EMbmGlxiconsQgn_indi_tb_slideshow; + press_bmpmask = EMbmGlxiconsQgn_indi_tb_slideshow_mask; + helptxt = qtn_lgal_tooltip_slideshow; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = EGlxCmdStartMultipleMarking; + control = AVKON_BUTTON + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = "z:\\Resource\\apps\\glxicons.mif"; + bmpid = EMbmGlxiconsQgn_indi_cam4_tb_mark; + bmpmask = EMbmGlxiconsQgn_indi_cam4_tb_mark_mask; + press_bmpid = EMbmGlxiconsQgn_indi_cam4_tb_mark; + press_bmpmask = EMbmGlxiconsQgn_indi_cam4_tb_mark_mask; + helptxt = qtn_lgal_tooltip_mark_items; + }, + AVKON_BUTTON_STATE + { + flags = KAknButtonStateHasLatchedFrame; + bmpfile = "z:\\Resource\\apps\\glxicons.mif"; + bmpid = EMbmGlxiconsQgn_indi_tb_unmark; + bmpmask = EMbmGlxiconsQgn_indi_tb_unmark_mask; + press_bmpid = EMbmGlxiconsQgn_indi_tb_unmark; + press_bmpmask = EMbmGlxiconsQgn_indi_tb_unmark_mask; + helptxt = qtn_lgal_tooltip_unmark_all; + } + }; + }; + }, TBAR_CTRL { type = EAknCtButton; @@ -624,7 +582,7 @@ bmpid = EMbmGlxicons1click_default_icon_active; bmpmask = EMbmGlxicons1click_default_icon_active_mask; press_bmpid = EMbmGlxicons1click_default_icon_active; - press_bmpmask = EMbmGlxicons1click_default_icon_active_mask; + press_bmpmask = EMbmGlxicons1click_default_icon_active_mask; } }; }; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp --- a/photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -72,4 +72,5 @@ LIBRARY glximageviewermanager.lib LIBRARY apgrfx.lib LIBRARY apmime.lib +LIBRARY thumbnailmanager.lib // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/texturemanager/inc/glxbitmapdecoderwrapper.h --- a/photosgallery/viewframework/texturemanager/inc/glxbitmapdecoderwrapper.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/texturemanager/inc/glxbitmapdecoderwrapper.h Wed Oct 13 14:32:09 2010 +0300 @@ -24,6 +24,12 @@ // INCLUDE FILES #include #include // For CExtJpegDecoder +// For decoding via TNM +#include +#include +#include +#include +#include /** * Observer interface used to be notified when texture bitmap is completed. @@ -42,7 +48,9 @@ * this is a wrapper class, doesn't actually decode the images. */ -class CGlxBitmapDecoderWrapper: public CActive +class CGlxBitmapDecoderWrapper: public CBase + ,public MThumbnailManagerObserver + { public: /*This Enums specifies the state of the Decoding*/ @@ -72,7 +80,7 @@ * @param aSourceFileName :contains the file name * @param aindex:contains the index value */ - void DoDecodeImageL(const TDesC & aSourceFileName,TInt aIndex); + void DoDecodeImageL(const TGlxMedia& aMedia,TInt aIndex); /** * starts the decoding and updates the state of the decoding @@ -83,14 +91,12 @@ * @param aBytesRequested : Request for free memory in Bytes */ TInt OOMRequestFreeMemoryL( TInt aBytesRequested); + /** + * Cancels all the pending requests and release resources + */ + void CancelRequest(); -public: - /** - * Standard Active object functions - */ - virtual void RunL(); - virtual void DoCancel(); - + private: /** * Constructor @@ -101,33 +107,32 @@ * Second-phase constuction */ void ConstructL(MGlxBitmapDecoderObserver* aObserver); - /** - * If the image format is non jpeg, then we need to calculate as per - * reduction factor and reduced size as what the decoder is going to return us - * This function returns if that needs to be done. + * Gets Thumbnails from TNM. */ - TBool DoesMimeTypeNeedsRecalculateL(); - + void GetThumbnailL( HBufC* aImagePath ); /** - * Recalculate the size for png/bmp as decoder fails to - * decode for desired size - */ - TSize ReCalculateSizeL(); + * From MThumbnailManagerObserver, not used + */ + virtual void ThumbnailPreviewReady( MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); + + /** + * From MThumbnailManagerObserver + */ + virtual void ThumbnailReady( TInt aError, + MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); private: /* Contains the TextureManagerImpl object,calls the HandleBitmapDecoded*/ MGlxBitmapDecoderObserver* iObserver; - /*Specifies the Decoder */ - CImageDecoder* iImageDecoder; // decoder from ICL API /*Contains the Thumbnail Index*/ TInt iThumbnailIndex; /*Contains the Bitmap generated*/ CFbsBitmap* iBitmap; /*contains the original size of the image*/ TAlfRealSize iOriginalSize; - /*A handle to a file server session.*/ - RFs iFs; /*To store the target image size*/ TSize iTargetBitmapSize; /*To store the image uri path*/ @@ -136,6 +141,9 @@ TTime iStartTime; TTime iStopTime; #endif + + CThumbnailManager* iTnManager; + TThumbnailRequestId iTnReqId; }; #endif //C_GLXBITMAPDECODERWRAPPER_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp --- a/photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -41,8 +41,6 @@ const TInt KGlxCriticalRAMForPhotos = 9056550; const TInt KGlxDecodeBitmapFactor = 3; - _LIT(KMimeJpeg,"image/jpeg"); - _LIT(KMimeJpg,"image/jpg"); } // --------------------------------------------------------------------------- @@ -64,8 +62,7 @@ // Constructor // --------------------------------------------------------------------------- // -CGlxBitmapDecoderWrapper::CGlxBitmapDecoderWrapper() : - CActive(EPriorityLow) +CGlxBitmapDecoderWrapper::CGlxBitmapDecoderWrapper() { TRACER("CGlxBitmapDecoderWrapper::CGlxBitmapDecoderWrapper()"); } @@ -77,12 +74,16 @@ CGlxBitmapDecoderWrapper::~CGlxBitmapDecoderWrapper() { TRACER("CGlxBitmapDecoderWrapper::~CGlxBitmapDecoderWrapper()"); - iFs.Close(); - Cancel(); - if (iImageDecoder) + if (iTnManager) { - delete iImageDecoder; - iImageDecoder = NULL; + iTnManager->CancelRequest(iTnReqId); + delete iTnManager; + iTnManager = NULL; + } + if(iBitmap) + { + delete iBitmap; + iBitmap = NULL; } if (iImagePath) { @@ -98,80 +99,31 @@ { TRACER("CGlxBitmapDecoderWrapper::ConstructL "); iObserver = aObserver; - User::LeaveIfError(iFs.Connect()); - CActiveScheduler::Add( this ); } // --------------------------------------------------------------------------- // DoDecodeImageL // --------------------------------------------------------------------------- -void CGlxBitmapDecoderWrapper::DoDecodeImageL(const TDesC& aSourceFileName, +void CGlxBitmapDecoderWrapper::DoDecodeImageL(const TGlxMedia& aMedia, TInt aIndex) { TRACER("CGlxBitmapDecoderWrapper::DoDecodeImageL()"); - GLX_LOG_URI("CGlxBitmapDecoderWrapper::DoDecodeImageL(%S)", - &aSourceFileName); iThumbnailIndex = aIndex; - -#ifdef _DEBUG - iStartTime.HomeTime(); -#endif - - if (iImageDecoder) - { - delete iImageDecoder; - iImageDecoder = NULL; - } - - CImageDecoder::TOptions options = - (CImageDecoder::TOptions) (CImageDecoder::EOptionNoDither - | CImageDecoder::EOptionAlwaysThread); + TSize originalDim; + aMedia.GetDimensions(originalDim); + iOriginalSize.iWidth = originalDim.iWidth; + iOriginalSize.iHeight = originalDim.iHeight; - // Use extended JPEG decoder - GLX_DEBUG1("DoDecodeImageL:: EHwImplementation" ); - TRAPD( err, iImageDecoder = CExtJpegDecoder::FileNewL( - CExtJpegDecoder::EHwImplementation, iFs, - aSourceFileName, options ) ); - GLX_DEBUG2("DoDecodeImageL:: EHwImplementation (%d)", err); - if (KErrNone != err) - { - TRAP(err,iImageDecoder = CExtJpegDecoder::FileNewL( - CExtJpegDecoder::ESwImplementation, iFs, - aSourceFileName, options ) ); - GLX_DEBUG2("DoDecodeImageL:: ESwImplementation (%d)", err); - if (KErrNone != err) - { - GLX_DEBUG1("DoDecodeImageL::CImageDecoder"); - // Not a JPEG - use standard decoder - iImageDecoder = CImageDecoder::FileNewL(iFs, aSourceFileName, - options); - } - } -#ifdef _DEBUG - iStopTime.HomeTime(); - GLX_DEBUG2("*** Decoder Creation took <%d> us ***", - (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); -#endif - - TSize imageSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; - GLX_DEBUG3("GlxDecoderWrapper::DecodeImageL() - OverallSize: w=%d, h=%d", - imageSize.iWidth, imageSize.iHeight); - iOriginalSize.iWidth = imageSize.iWidth; - iOriginalSize.iHeight = imageSize.iHeight; - - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iImagePath) { delete iImagePath; iImagePath = NULL; } - iImagePath = aSourceFileName.Alloc(); + + const TDesC& uri = aMedia.Uri(); + GLX_LOG_URI("CGlxBitmapDecoderWrapper::DoDecodeImageL(%S)", &uri); + iImagePath = uri.Alloc(); DecodeImageL(); } @@ -229,13 +181,8 @@ if (minmemorytodecode < (freeMemory - KGlxCriticalRAMForPhotos)) { GLX_DEBUG1("DecodeImageL:RAM available decoding image"); - iBitmap = new (ELeave) CFbsBitmap(); - iBitmap->Create(ReCalculateSizeL(), - iImageDecoder->FrameInfo().iFrameDisplayMode); -#ifdef _DEBUG - iStartTime.HomeTime(); // Get home time -#endif - iImageDecoder->Convert(&iStatus, *iBitmap); + + GetThumbnailL(iImagePath); } else { @@ -257,77 +204,18 @@ if (err != KErrNoMemory) { GLX_DEBUG1("DecodeImageL:Sufficient RAM available"); - iBitmap = new (ELeave) CFbsBitmap(); - iBitmap->Create(ReCalculateSizeL(), - iImageDecoder->FrameInfo().iFrameDisplayMode); -#ifdef _DEBUG - iStartTime.HomeTime(); // Get home time -#endif - iImageDecoder->Convert(&iStatus, *iBitmap); + GetThumbnailL(iImagePath); } else { GLX_DEBUG1("NOT ENOUGH MEMORY - " "Using the Fullscreen Thumbnail For Zoom"); - //release the file held by decoder immediately. - iImageDecoder->Cancel(); - delete iImageDecoder; - iImageDecoder = NULL; //Inform the client that there is no decode happened and there we take care //of showing the fullscreen thumbnail. iObserver->HandleBitmapDecodedL(iThumbnailIndex, NULL); return; } } - - SetActive(); - } - } - -// --------------------------------------------------------------------------- -// RunL -// --------------------------------------------------------------------------- -// -void CGlxBitmapDecoderWrapper::RunL() - { - TRACER("CGlxBitmapDecoderWrapper::RunL()"); - if( iStatus == KErrNone ) - { - iObserver->HandleBitmapDecodedL(iThumbnailIndex,iBitmap); - iBitmap = NULL; - - //release the file held by decoder immediately. - GLX_DEBUG1("CGlxBitmapDecoderWrapper::RunL:Decoding Finished"); - iImageDecoder->Cancel(); - delete iImageDecoder; - iImageDecoder = NULL; -#ifdef _DEBUG - iStopTime.HomeTime(); - GLX_DEBUG2("*** Image Decode took <%d> us ***", - (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); -#endif - - } - } - -// --------------------------------------------------------------------------- -// DoCancel -// --------------------------------------------------------------------------- -// -void CGlxBitmapDecoderWrapper::DoCancel() - { - TRACER("CGlxBitmapDecoderWrapper::DoCancel "); - if(iImageDecoder) - { - GLX_DEBUG1("CGlxBitmapDecoderWrapper::DoCancel iImageDecoder delete"); - iImageDecoder->Cancel(); - delete iImageDecoder; - iImageDecoder = NULL; - } - if(iBitmap) - { - delete iBitmap; - iBitmap = NULL; } } @@ -359,57 +247,89 @@ } // ----------------------------------------------------------------------------- -// DoesMimeTypeNeedsRecalculateL() +// CGlxBitmapDecoderWrapper::GetThumbnailL() // ----------------------------------------------------------------------------- // -TBool CGlxBitmapDecoderWrapper::DoesMimeTypeNeedsRecalculateL() +void CGlxBitmapDecoderWrapper::GetThumbnailL( HBufC* aImagePath ) { - TRACER("CGlxBitmapDecoderWrapper::DoesMimeTypeNeedsRecalculateL"); - RApaLsSession session; - TDataType mimeType; - TUid uid; + TRACER("CGlxBitmapDecoderWrapper::GetThumbnailL"); + if (!iTnManager) + { + iTnManager = CThumbnailManager::NewL(*this); + iTnManager->SetDisplayModeL(EColor16M); + } - User::LeaveIfError(session.Connect()); - CleanupClosePushL(session); - User::LeaveIfError(session.AppForDocument(iImagePath->Des(), uid, - mimeType)); - CleanupStack::PopAndDestroy(&session); + iTnManager->SetFlagsL(CThumbnailManager::EDefaultFlags); + iTnManager->SetThumbnailSizeL(iTargetBitmapSize); + iTnManager->SetQualityPreferenceL(CThumbnailManager::EOptimizeForQuality); + const TDesC& uri = aImagePath->Des(); + GLX_LOG_URI("CGlxBitmapDecoderWrapper::GetThumbnailL: (%S)", aImagePath ); + CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(uri, 0); +#ifdef _DEBUG + iStartTime.HomeTime(); // Get home time +#endif + iTnReqId = iTnManager->GetThumbnailL(*source); + CleanupStack::PopAndDestroy(source); + } - if (mimeType.Des().Compare(KMimeJpeg) == 0 || mimeType.Des().Compare( - KMimeJpg) == 0) - { - GLX_LOG_INFO("CGlxBitmapDecoderWrapper::DoesMimeTypeNeedsRecalculateL - jpeg"); - return EFalse; - } - else - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DoesMimeTypeNeedsRecalculateL - non jpeg"); - return ETrue; - } +// ----------------------------------------------------------------------------- +// CGlxBitmapDecoderWrapper::ThumbnailPreviewReady +// From MThumbnailManagerObserver +// ----------------------------------------------------------------------------- +// +void CGlxBitmapDecoderWrapper::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, + TThumbnailRequestId /*aId*/ ) + { + TRACER("CGlxBitmapDecoderWrapper::ThumbnailPreviewReady"); } // ----------------------------------------------------------------------------- -// ReCalculateSize +// CGlxBitmapDecoderWrapper::ThumbnailReady +// From MThumbnailManagerObserver // ----------------------------------------------------------------------------- -TSize CGlxBitmapDecoderWrapper::ReCalculateSizeL() +// +void CGlxBitmapDecoderWrapper::ThumbnailReady( TInt aError, + MThumbnailData& aThumbnail, + TThumbnailRequestId /*aId*/ ) { - TRACER("CGlxBitmapDecoderWrapper::ReCalculateSizeL()"); - if (DoesMimeTypeNeedsRecalculateL()) + TRACER("CGlxBitmapDecoderWrapper::ThumbnailReady"); +#ifdef _DEBUG + iStopTime.HomeTime(); + GLX_DEBUG2("*** CGlxBitmapDecoderWrapper::ThumbnailReady() TNM took <%d> us to decode***", + (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); +#endif + + if (aError == KErrNone) { - TSize fullFrameSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; - // calculate the reduction factor on what size we need - TInt reductionFactor = iImageDecoder->ReductionFactor(fullFrameSize, - iTargetBitmapSize); - // get the reduced size onto destination size - TSize destSize; - User::LeaveIfError(iImageDecoder->ReducedSize(fullFrameSize, - reductionFactor, destSize)); - GLX_LOG_INFO2("CGlxBitmapDecoderWrapper::ReCalculateSizeL() " - "destSize=%d, %d",destSize.iWidth,destSize.iHeight); - return destSize; + if (iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + iBitmap = aThumbnail.DetachBitmap(); + iObserver->HandleBitmapDecodedL(iThumbnailIndex, iBitmap); + iBitmap = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CGlxBitmapDecoderWrapper::CancelRequest() +// Cancels all the pending requests and release resources +// ----------------------------------------------------------------------------- +// +void CGlxBitmapDecoderWrapper::CancelRequest() + { + TRACER("CGlxBitmapDecoderWrapper::CancelRequest"); + if (iTnManager) + { + iTnManager->CancelRequest(iTnReqId); + delete iTnManager; + iTnManager = NULL; } - else + + if (iBitmap) { - return iTargetBitmapSize; + delete iBitmap; + iBitmap = NULL; } } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp --- a/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -518,7 +518,7 @@ GLX_LOG_INFO1("CGlxTextureManagerImpl RemoveZoomList Count()=%d",count); if(iZoomDecoder) { - iZoomDecoder->Cancel(); + iZoomDecoder->CancelRequest(); } for(TInt i = count - 1; i >= 0; i--) { @@ -859,7 +859,7 @@ iZoomedList[index].iBitmap=NULL; iZoomedList[index].iObserver = aObserver ; - iZoomDecoder->DoDecodeImageL(aMedia.Uri(), iZoomedList.Count()-1); + iZoomDecoder->DoDecodeImageL(aMedia,iZoomedList.Count()-1); return *(iZoomedList[index].iTexture); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp --- a/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -161,7 +161,7 @@ { TRACER("CGlxHdmiController::ShiftToPostingMode()"); iIsPhotosInForeground = ETrue; - if (iGlxTvOut->IsHDMIConnected() && iIsImageSupported) + if (iGlxTvOut->IsHDMIConnected()) { if (!iSurfaceUpdater) { diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp --- a/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -71,9 +71,6 @@ TRAP_IGNORE(iDecoderObserver.HandleHDMIDecodingEventL(EHdmiDisconnected)); ReleaseContent(); - - delete iNextImagePath; - if (iWindow) { iWindow->RemoveBackgroundSurface(ETrue); @@ -83,8 +80,11 @@ iTimer->Cancel(); } delete iTimer; - delete iGlxDecoderAO; - delete iSurfBufferAO; + if (iGlxDecoderAO) + { + delete iGlxDecoderAO; + } + iGlxDecoderAO = NULL; iFsSession.Close(); if (iSurfManager) { @@ -99,6 +99,7 @@ iSurfChunk->Close(); } delete iSurfChunk; + iSurfChunk = NULL; GLX_LOG_INFO( "CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->CloseSurface()"); iSurfManager->CloseSurface(iSurfId); @@ -106,6 +107,7 @@ "CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->Close()"); iSurfManager->Close(); delete iSurfManager; + iSurfManager = NULL; } } @@ -236,9 +238,6 @@ const TDesC& aNextImageFile, CFbsBitmap* aFsBitmap) { TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); - delete iNextImagePath; - iNextImagePath = NULL; - if (!aImageFile.CompareC(*iImagePath) && !iDecodingCurrent && !iDecodingNext) { @@ -269,6 +268,11 @@ else { ReleaseContent(); + if (iNextImagePath) + { + delete iNextImagePath; + iNextImagePath = NULL; + } // Ongoing decoding is cancelled if any,reset the decoding flags. iDecodingNext = EFalse; iDecodingCurrent = EFalse; @@ -1000,8 +1004,11 @@ TRACER("CGlxHdmiSurfaceUpdater::DecodeNextImageL()"); ReleaseContent(); iImagePath = iNextImagePath->Alloc(); - delete iNextImagePath; - iNextImagePath = NULL; + if (iNextImagePath) + { + delete iNextImagePath; + iNextImagePath = NULL; + } iIsNonJpeg = EFalse; GLX_LOG_INFO("Before - iWindow->Size()"); iTvScreenSize = iWindow->Size(); diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/data/glxuiutilities.rss --- a/photosgallery/viewframework/uiutilities/data/glxuiutilities.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/data/glxuiutilities.rss Wed Oct 13 14:32:09 2010 +0300 @@ -297,15 +297,17 @@ DLG_LINE { type = EAknCtQuery; - id = EGeneralQuery; + id = EAknCtQuery; control = AVKON_DATA_QUERY { - layout = EDataLayout; - control=EDWIN - { - maxlength = 40; // KMaxMediaPopupTextLength - lines = 1; - }; + layout = EDataLayout; + control=EDWIN + { + flags = EEikEdwinAutoSelection | KSingleLineHorizontalScrollingEditorFlags; + maxlength = 128; // KMGXMaxFileName + lines = 1; + avkon_flags = EAknEditorFlagNoT9; + }; }; } }; @@ -854,15 +856,3 @@ } }; } - -//resource for image viewer deletion failure note -RESOURCE TBUF r_glx_deletion_failure_note - { - buf = qtn_fldr_cant_delete_item; - } - -//resource for illegal characters in file name note -RESOURCE TBUF r_glx_qtn_fldr_illegal_characters - { - buf = qtn_fldr_illegal_characters; - } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/group/glxuiutilities.mmp --- a/photosgallery/viewframework/uiutilities/group/glxuiutilities.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/group/glxuiutilities.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -118,8 +118,7 @@ LIBRARY libstdcpp.lib LIBRARY flogger.lib //LIBRARY hgcontextutility.lib // For Teleport -LIBRARY akntransitionutils.lib -LIBRARY goommonitor.lib //For GOOM -LIBRARY platformenv.lib //For DriveInfo +LIBRARY akntransitionutils.lib +LIBRARY goommonitor.lib //For GOOM // End of File diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/inc/glxmmcnotifier.h --- a/photosgallery/viewframework/uiutilities/inc/glxmmcnotifier.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/inc/glxmmcnotifier.h Wed Oct 13 14:32:09 2010 +0300 @@ -90,11 +90,6 @@ * MMC state */ TGlxMMCState istate; - - /** - * Default Memory Card drive identifier specified by TDriveNumber - */ - TInt iDefaultMemoryCardDrive; }; #endif /* GLXMMCNOTIFIER_H_ */ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/inc/glxvisualutilities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/viewframework/uiutilities/inc/glxvisualutilities.h Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,49 @@ +/* +* 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: Alf visual utilities +* +*/ + + + + +#ifndef __GLXVISUALUTILITIES_H__ +#define __GLXVISUALUTILITIES_H__ + +// EXTERNAL HEADERS +#include + +// FORWARD DECLARES +class CHuiVisual; +class CHuiControl; + +/** + * Namespace to hold the CHuiVisual related algorithms. + * + * @author Kimmo Hoikka + * @lib glxhuiutils.lib + */ +namespace NGlxVisualUtilities + { + /** + * Method to transfer the ownership of CHuiVisuals to a new CHuiControl. + * In case of a Leave the ownership is held in the old owner so the ownership transfer + * succeeds either completely or not at all. + * @param aVisual reference to the topmost visual in the hierarchy + * @param aNewParent the new parent to be applied to all visuals in the hierarchy + */ + IMPORT_C void TransferVisualsL( CHuiVisual& aVisual, CHuiControl& aNewParent ); + } + +#endif // __GLXVISUALUTILITIES_H__ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/src/glxmmcnotifier.cpp --- a/photosgallery/viewframework/uiutilities/src/glxmmcnotifier.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/src/glxmmcnotifier.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -18,7 +18,7 @@ #include #include -#include + #include "glxmmcnotifier.h" // --------------------------------------------------------- @@ -92,11 +92,6 @@ TRACER("CGlxMMCNotifier::ConstructL()"); TInt err = iFs.Connect(); GLX_LOG_INFO1("CGlxMMCNotifier::ConstructL iFs.Connect err %d",err ); - - User::LeaveIfError(DriveInfo::GetDefaultDrive( - DriveInfo::EDefaultRemovableMassStorage, iDefaultMemoryCardDrive)); - GLX_LOG_INFO1("CGlxMMCNotifier::ConstructL iFs.Connect iDrive %d", - iDefaultMemoryCardDrive ); IssueRequest(); } @@ -119,13 +114,11 @@ TRACER("CGlxMMCNotifier::RunL()"); TDriveInfo driveInfo; // Get the drive info for memory card - TInt err = iFs.Drive(driveInfo, iDefaultMemoryCardDrive); - GLX_LOG_INFO1("CGlxMMCNotifier::RunL driveInfo err=%d", err); - if (err == KErrNone && (driveInfo.iDriveAtt & KDriveAttRemovable)) - { - GLX_LOG_INFO1("CGlxMMCNotifier::RunL driveInfo.iDriveAtt=%d", - driveInfo.iDriveAtt); - switch (driveInfo.iType) + TInt err = iFs.Drive( driveInfo, EDriveF ); + GLX_LOG_INFO1("CGlxMMCNotifier::RunL err %d",err ); + if( err == KErrNone ) + { + switch( driveInfo.iType ) { case EMediaNotPresent: { diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp --- a/photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -179,6 +179,7 @@ else { iProgressDialog->ProcessFinishedL(); + iGlxGridViewNotifyObserver.HandleDialogDismissedL(); if (iProgressDialog) { iProgressDialog = NULL; @@ -222,7 +223,6 @@ } iProgressDialog = NULL; iProgressInfo = NULL; - iGlxGridViewNotifyObserver.HandleDialogDismissedL(); } // ----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/src/glxtextentrypopup.cpp --- a/photosgallery/viewframework/uiutilities/src/glxtextentrypopup.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/uiutilities/src/glxtextentrypopup.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -122,9 +122,8 @@ else { uiUtility->SetAppOrientationL( EGlxOrientationTextEntry ); - } - // Enable predictiveTextInput option in the query dialog! - SetPredictiveTextInputPermitted( ETrue ); + } + TInt retVal = CAknTextQueryDialog::ExecuteLD(R_GLX_TEXT_ENTRY_QUERY); CleanupStack::PopAndDestroy( &rollbackState ); // cleanupItem diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/uiutilities/src/glxvisualutilities.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/viewframework/uiutilities/src/glxvisualutilities.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -0,0 +1,167 @@ +/* +* 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: ALF visual utilities +* +*/ + + + + +// CLASS HEADER +#include "glxvisualutilities.h" + +// EXTERNAL HEADERS +#include +#include + +namespace NGlxVisualUtilities + { + /** + * TGlxVisualTransferCleanup + * This class handles the awkward situation in visual ownership transfer + * that some of the visuals are transferred to new parent and a leave occurs. + * In leave case we need to undo the ownership transfer completely. + * This class also removes the ownership from the old control in case + * there was no leave. + * @usage: + * \code + * RArray allvisuals; + * TGlxVisualTransferCleanup cleanup( allvisuals ); + * // set the parent to remove from to be the new one + * cleanup.iParentToRemoveFrom = aNewParent; + * CleanupClosePushL( cleanup ); + * // start to append the visuals to the new parent + * // in case of leave they are removed from new parent + * RecurseAndTransferVisualsL( visualcleanup, aVisual, aNewParent ); + * // set the parent to remove to be the old one + * cleanup.iParentToRemoveFrom = oldParent; + * // remove the item from cleanupstack, + * // this removes the visuals from their old parent + * CleanupStack::PopAndDestroy( &cleanup ); + * \endcode + */ + NONSHARABLE_CLASS( TGlxVisualTransferCleanup ) + { + public: + + /** + * Constructor. + * @param aArray, the array of Visuals + * @param aOldParent, the old parent of visuals + * @param aNewParent, the new parent for visuals + */ + inline TGlxVisualTransferCleanup( + RArray& aArray ) + : iArray( aArray ) + { + } + + /** + * Close. Put this class to Cleanupstack with + * CleanupClosePushL so that this gets called in case of a leave + */ + inline void Close() + { + // need to remove all visuals from the given parent + // loop through all the CHuiVisuals + for( TInt i = 0; i < iArray.Count(); ++i ) + { + // remove from the given parent + iParentToRemoveFrom->Remove( iArray[ i ] ); + } + // reset the array + iArray.Reset(); + } + + /// Ref: the parent where to remove + MHuiVisualOwner* iParentToRemoveFrom; + + private: // Implementation + + /// Ref: the array containing all the visuals + RArray& iArray; + + }; + + /** + * Recursive helper method to transfer the ownership of visuals + * @param aVisualCleanup an array containing all visuals in the hierarchy + * @param aVisual the visual to move to new control + * @param aNewParent the new parent for the visual + */ + void RecurseAndTransferVisualsL( + RArray& aVisualCleanup, + CHuiVisual& aVisual, CHuiControl& aNewParent ) + { + // make room to the pointer so that we always succeed in appending + // Note that we need to make room for one new item, thus count + 1 + aVisualCleanup.ReserveL( aVisualCleanup.Count() + 1 ); + // append us to the new parent, Note that for a while we are + // owner by two controls but thats not a problem as the other parent + // is removed by either TGlxVisualTransferCleanup.Close() by CleanupStack + // or destructor of TGlxVisualTransferCleanup and there is no other way + // of getting out from this method (of course panic is ;) + aNewParent.AppendL( &aVisual ); + // add us in the cleanuparray so that we can be removed from the + // new parent in case some of the following AppendLs leave + // this does not fail as reserve was called so no AppendL needed + aVisualCleanup.Append( &aVisual ); + // check if the visual has childs + TInt childCount = aVisual.Count(); + // transfer all the childs + while( childCount-- > 0 ) + { + // get the child + CHuiVisual& childVisual = aVisual.Visual( childCount ); + // call transfer recursively on the child + RecurseAndTransferVisualsL( + aVisualCleanup, childVisual, aNewParent ); + } + } + + // ------------------------------------------------------------------------- + // TransferVisualsL + // ------------------------------------------------------------------------- + EXPORT_C void TransferVisualsL( + CHuiVisual& aVisual, CHuiControl& aNewParent ) + { + // check if parent is already correct + if( &( aVisual.Owner() ) == + static_cast< MHuiVisualOwner* >( &aNewParent ) ) + { + // nothing else to be done + return; + } + // create an array for visual pointers on the stack + RArray< CHuiVisual* > visualcleanup; + // create the cleanup item from stack as well + TGlxVisualTransferCleanup removeParent( visualcleanup ); + // set the parent to remove from to be the new one + removeParent.iParentToRemoveFrom = &aNewParent; + // need to remember the old parent + MHuiVisualOwner* oldParent = &( aVisual.Owner() ); + // put it to cleanupstack so that close gets called in case of leave + CleanupClosePushL( removeParent ); + // run the recursive loop, if it leaves the visuals are removed from + // new parent by the Close method of cleanParents + RecurseAndTransferVisualsL( visualcleanup, aVisual, aNewParent ); + // set the parent to remove to be the old one + removeParent.iParentToRemoveFrom = oldParent; + // remove the item from cleanupstack, + // this removes the visuals from the old parent + CleanupStack::PopAndDestroy( &removeParent ); + // close the array + visualcleanup.Close(); + } + } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp --- a/photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/group/glxcloudview.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -84,6 +84,4 @@ LIBRARY charconv.lib // For UtfConverter LIBRARY commonengine.lib LIBRARY gfxtrans.lib -LIBRARY alfdecoderserverclient.lib //For CAlfEffectObserver -LIBRARY akntransitionutils.lib //For CAknTransitionUtils // End of File \ No newline at end of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h --- a/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h Wed Oct 13 14:32:09 2010 +0300 @@ -365,17 +365,17 @@ **/ void SetFocusColor(); - /** - * Resets focused item color - **/ - void ResetFocusColor(); - /** - * Set the focus to first visible item - * in the current view position - */ - void SetFocusToFirstVisibleItemL(); - + /** + * Set the middle point of the infobuble + **/ + void SetBubleMidPoint(TPoint& aMidPoint); + + /** + * Create the infobublecontainer + **/ + void CreateBubleContainer(); + /** * Move the viewport up depending on the condition * @@ -387,6 +387,11 @@ **/ void MoveDownIfRequired(); + /** + * calculate the mid point of the bubble + **/ + void CalculateBubleMidPoint(); + public: void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, @@ -555,6 +560,9 @@ // FocusIndex keeps track of the focussed row TInt iFocusRowIndex; + // EndRowindex keeps track of the end row + TInt iEndRowIndex; + //keeps track of the end row TInt iLayoutIndex; @@ -645,9 +653,6 @@ /**flag to identify the next down event */ TBool iDownEventReceived; - - // Flag to show Alf visual focus - TBool iShowFocus; }; #endif // C_GLXCLOUDVIEWCONTROL_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h --- a/photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/inc/glxcloudviewimp.h Wed Oct 13 14:32:09 2010 +0300 @@ -32,7 +32,6 @@ #include "glxtagscontextmenucontrol.h" // MGlxItemMenuObserver #include "glxmmcnotifier.h" -#include // MAlfEffectObserver // FORWARD DECLARATIONS class CGlxCloudViewControl; @@ -55,8 +54,7 @@ public MGlxEnterKeyEventObserver, public MGlxCloudViewLayoutObserver, public MGlxItemMenuObserver, - public MStorageNotifierObserver, - public CAlfEffectObserver::MAlfEffectObserver + public MStorageNotifierObserver { public: @@ -122,9 +120,6 @@ * @param aCommand command to be handled */ void HandleGridMenuListL(TInt aCommand); -public://From MAlfEffectObserver - void HandleEffectCallback(TInt aType, TInt aHandle, TInt aStatus); - public: void HandleForegroundEventL(TBool aForeground); @@ -263,11 +258,6 @@ CGlxMMCNotifier* iMMCNotifier; TBool iMMCState; - - //For Alf Effects - CAlfEffectObserver* iAlfEffectObs; - TInt iEffectHandle; - }; } #endif // C_GLXTESTTILEVIEWIMP_H diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h --- a/photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h Wed Oct 13 14:32:09 2010 +0300 @@ -37,7 +37,7 @@ * To Handle menu items in Grid layout * @param aCommand command to be handled */ - virtual void HandleGridMenuListL(TInt aCommand = 0) = 0; + virtual void HandleGridMenuListL(TInt aCommand) = 0; }; class CGlxTagsContextMenuControl : public CAlfControl, diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp --- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -44,6 +44,7 @@ #include //attribute context #include //for medialist +#include "glxcontainerinfobubble.h" //intelligent class for data of infobubble #include "glxcloudview.hrh" #include "mglxcloudviewmskobserver.h" // For Msk Observer #include "mglxenterkeyeventobserver.h" // For enterkey observer @@ -61,7 +62,7 @@ const TInt KRowHeight = 72; const TInt KLeftMargin = 10; const TInt KNumMinRowSpace = 2; -const TInt KColSpace = 30; +const TInt KColSpace = 20; const TInt KRightmargin = 10;//Aligning Right margin const TInt KMinTagSize = 77; const TInt KTagScreenHeight = 460; @@ -198,6 +199,8 @@ if ( iLabels.Count ()==listCount && iAttributeContext->RequestCountL (&iMediaList)==0) { + //if we navigate in forward direction, first item should be highlighted.if we are navigating in + // backwards direction, index is not necessarily zero, it will be restored. if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ()) { iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0); @@ -209,7 +212,6 @@ iTouchFeedback = MTouchFeedback::Instance(); iPhysics = CAknPhysics::NewL(*this, NULL); InitPhysicsL(); - iShowFocus = EFalse; } @@ -240,6 +242,7 @@ // --------------------------------------------------------------------------- // CGlxCloudViewControl::~CGlxCloudViewControl() + { TRACER("GLX_CLOUD::CGlxCloudViewControl::~CGlxCloudViewControl"); iCloudInfo.Close (); @@ -269,23 +272,20 @@ TInt CGlxCloudViewControl::LayoutVisibleRows(TPoint aStartPoint,TInt aRowStartIndex , TInt aRowEndIndex) { - TRACER("CGlxCloudViewControl::LayoutVisibleRows"); + TRACER("GLX_CLOUD::CGlxCloudViewControl::DrawRow"); TSize vsize; TPoint tl, br; tl = aStartPoint; - br.iX = 0; br.iY = tl.iY + KRowHeight; - const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW; //drawing in reverse for arabic hebrew support if ( GlxGeneralUiUtilities::LayoutIsMirrored ()) { - GLX_LOG_INFO("Mirrorred Layout"); - //In Mirrored layout, 'BottomRight' considers scrollpane width for each row - br.iX = aStartPoint.iX - iScrollPaneHandle.iW; + br.iX = aStartPoint.iX; + const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW; //Set the positions of tags in a row. for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++) { - vsize = iLabels[j]->TextExtents(); + vsize = iLabels[j]->TextExtents (); if ( vsize.iWidth < KMinTagSize ) { vsize.iWidth = KMinTagSize; @@ -295,15 +295,15 @@ { TAlfRealSize tagSize( KMaxScreenWidth, br.iY ); iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); + vsize = iLabels[j]->TextExtents (); tl.iX -= aStartPoint.iX; tl.iY = aStartPoint.iY; br.iX = tagSize.iWidth; } else { - tl.iX = br.iX - vsize.iWidth; + tl.iX -= (vsize.iWidth + KColSpace); } - //Set the anchor points for the tags iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, @@ -313,17 +313,17 @@ EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint (br.iX, br.iY)); - //Bottom-Right corner for next tag in same row br.iX -= (vsize.iWidth + KColSpace); iLayoutIndex += 1; } + } else { - GLX_LOG_INFO("NOT Mirrorred Layout"); + const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW; for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++) { - vsize = iLabels[j]->TextExtents(); + vsize = iLabels[j]->TextExtents (); if( vsize.iWidth < KMinTagSize ) { vsize.iWidth = KMinTagSize; @@ -331,6 +331,7 @@ if (vsize.iWidth > KMaxScreenWidth) { TAlfRealSize tagSize( KMaxScreenWidth, br.iY ); + TAlfRealPoint startPos( aStartPoint.iX, 0 ); iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); tl.iX = aStartPoint.iX; tl.iY = aStartPoint.iY; @@ -338,9 +339,8 @@ } else { - br.iX = tl.iX + vsize.iWidth; + br.iX += vsize.iWidth + KColSpace; } - iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, @@ -349,21 +349,22 @@ EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint (br.iX, br.iY)); - //Top-Left Corner for next tag in same row - tl.iX += (vsize.iWidth + KColSpace); + tl.iX = br.iX; iLayoutIndex += 1; } } return 0; } + + + // --------------------------------------------------------------------------- // LayoutVisibleArea() // // --------------------------------------------------------------------------- void CGlxCloudViewControl::LayoutVisibleArea() { - TRACER("CGlxCloudViewControl::LayoutVisibleArea"); //screen height for boundary check:how many rows fit in. //find out how many rows can fit in. //add upper and lower margin spacing 5 pixels @@ -376,13 +377,13 @@ { startpoint.iX = iTagScreenWidth - KRightmargin; } - //else start from beginning + + //else start from biginning else { startpoint.iX = KLeftMargin; } startpoint.iY = KNumMinRowSpace; - //associate the active visuals with anchor layout GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Layout reset"); GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count after reset %d ", iLayout->Count ()); @@ -393,6 +394,7 @@ { GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::FindEndRowIndex Entering layout append"); + TAlfTimedValue opacity; opacity.SetValueNow(1.0); // immediate change iLabels[j]->SetOpacity(opacity); @@ -401,14 +403,16 @@ GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Exiting layout append"); iLayoutIndex = 0; GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count realloc %d ", iLayout->Count ()); - TInt totalHeight = 0; - for (TInt j = 0; j <= iCloudInfo.Count() - 1; j++) + for (TInt j = 0; j <= iEndRowIndex; j++) { GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Drawing row started %d ", j); LayoutVisibleRows (startpoint,iCloudInfo[j].iStartIndex, iCloudInfo[j].iEndIndex); startpoint.iY += KRowHeight + KNumMinRowSpace; - + } + TInt totalHeight = 0; + for (TInt j = 0; j <= iCloudInfo.Count()-1; j++) + { totalHeight+=KRowHeight; totalHeight+=KNumMinRowSpace; } @@ -443,7 +447,9 @@ iScrollEventData.mViewLength, 0); DisplayScrollBar(); - } + } + //constructing the bubblecontainer + CreateBubleContainer(); iLayout->UpdateChildrenLayout (); //update layout @@ -452,191 +458,156 @@ MoveDownIfRequired(); } + // --------------------------------------------------------------------------- // OfferEventL() // --------------------------------------------------------------------------- // TBool CGlxCloudViewControl::OfferEventL(const TAlfEvent &aEvent) - { - TRACER("GLX_CLOUD:: CGlxCloudViewControl::OfferEventL"); + { TRACER("GLX_CLOUD:: CGlxCloudViewControl::OfferEventL"); //check if key inputs needs handling TBool consumed = EFalse; - if (iLabels.Count() == 0) + if ( ( iLabels.Count () == 0 ) ) { GLX_LOG_INFO( "GLX_CLOUD ::CGlxCloudViewControl::offerkeyeventL no key press returning "); return EFalse; //return as no futher processing is required } - if (aEvent.IsKeyEvent() && iTagsContextMenuControl->ItemMenuVisibility()) - { - // Hide the context menu, if visible - ShowContextItemMenuL(EFalse); - } - if ( aEvent.IsKeyEvent ()&& aEvent.Code() == EEventKey ) { switch (aEvent.KeyEvent().iCode) { + //@ EABI-7R7FRU Fute failure: Tag views enter key has no functionality. case EKeyEnter : case EKeyDevice3: { - if (iShowFocus) - { - iShowFocus = EFalse; - iObserverEnterKeyEvent.HandleEnterKeyEventL( - (TInt) EAknCmdOpen); - } - else - { - SetFocusToFirstVisibleItemL(); - } - consumed = ETrue; + iObserverEnterKeyEvent.HandleEnterKeyEventL( (TInt)EAknCmdOpen ); + consumed= ETrue; } break; case EKeyUpArrow: - { - if (iShowFocus) + { + if(iCloudInfo.Count() >1 ) { - HandleKeyUpL(); - iFocusRowIndex = RowNumber(iMediaList.FocusIndex()); + HandleKeyUpL (); + consumed = ETrue; + iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); - MoveUpIfRequired(); + MoveUpIfRequired(); } - else - { - SetFocusToFirstVisibleItemL(); - } - consumed = ETrue; } break; case EKeyDownArrow: - { - if (iShowFocus) + { + if (iCloudInfo.Count() > 1) { - HandleKeyDownL(); - iFocusRowIndex = RowNumber(iMediaList.FocusIndex()); + HandleKeyDownL (); + consumed = ETrue; + iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); - MoveDownIfRequired(); - } - else - { - SetFocusToFirstVisibleItemL(); - } - consumed = ETrue; + MoveDownIfRequired(); + } } break; case EKeyLeftArrow: case EKeyPrevious: { - if (iShowFocus) + // arabic hebrew change + if ( GlxGeneralUiUtilities::LayoutIsMirrored () ) { - // arabic hebrew change - if (GlxGeneralUiUtilities::LayoutIsMirrored()) + if ( iMediaList.FocusIndex() == iMediaList.Count() - 1 ) { - if (iMediaList.FocusIndex() == iMediaList.Count() - 1) - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, 0); - } - else - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.FocusIndex() + 1); - } - iScrollDirection = 0; + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0); } else { - if (iMediaList.FocusIndex() == 0) - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.Count() - 1); - } - else - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.FocusIndex() - 1); - } - iScrollDirection = 1; + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.FocusIndex ()+ 1); } - TInt focusRowIndex = RowNumber(iMediaList.FocusIndex()); - if (iFocusRowIndex != focusRowIndex) - { - iFocusRowIndex = focusRowIndex; - if (iScrollDirection == 0) - { - MoveDownIfRequired(); - } - else - { - MoveUpIfRequired(); - } - } + iScrollDirection = 0; } else { - SetFocusToFirstVisibleItemL(); + if ( iMediaList.FocusIndex ()== 0 ) + { + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.Count() - 1 ); + } + else + { + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.FocusIndex ()- 1); + } + iScrollDirection = 1; } consumed = ETrue; + TInt focusRowIndex = RowNumber (iMediaList.FocusIndex ()); + if(iFocusRowIndex != focusRowIndex) + { + iFocusRowIndex = focusRowIndex; + if( iScrollDirection == 0 ) + { + MoveDownIfRequired(); + } + else + { + MoveUpIfRequired(); + } + } } + break; case EKeyRightArrow: case EKeyNext: - { - if (iShowFocus) + { + // arabic hebrew change + if ( GlxGeneralUiUtilities::LayoutIsMirrored () ) { - // arabic hebrew change - if (GlxGeneralUiUtilities::LayoutIsMirrored()) + if ( iMediaList.FocusIndex ()== 0 ) { - if (iMediaList.FocusIndex() == 0) - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.Count() - 1); - } - else - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.FocusIndex() - 1); - } - iScrollDirection = 1; + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.Count() - 1 ); } else { - if (iMediaList.FocusIndex() == iMediaList.Count() - 1) - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, 0); - } - else - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, - iMediaList.FocusIndex() + 1); - } - iScrollDirection = 0; + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.FocusIndex ()- 1); } - TInt focusRowIndex = RowNumber(iMediaList.FocusIndex()); - - if (iFocusRowIndex != focusRowIndex) - { - iFocusRowIndex = focusRowIndex; - if (iScrollDirection == 1) - { - MoveUpIfRequired(); - } - else - { - MoveDownIfRequired(); - } - } + iScrollDirection = 1; } else { - SetFocusToFirstVisibleItemL(); + if ( iMediaList.FocusIndex ()== iMediaList.Count() - 1 ) + { + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0); + } + else + { + iMediaList.SetFocusL (NGlxListDefs::EAbsolute, + iMediaList.FocusIndex ()+ 1); + } + iScrollDirection = 0; } + TInt focusRowIndex = RowNumber (iMediaList.FocusIndex ()); + + if( iFocusRowIndex != focusRowIndex ) + { + iFocusRowIndex = focusRowIndex; + if( iScrollDirection == 1 ) + { + MoveUpIfRequired(); + } + else + { + MoveDownIfRequired(); + } + } + } consumed = ETrue; - } break; default: @@ -678,6 +649,7 @@ iScrollDirection = 1; } + // --------------------------------------------------------------------------- // HandleKeyDown() // --------------------------------------------------------------------------- @@ -712,14 +684,14 @@ { TRACER("GLX_CLOUD::CGlxCloudViewControl::HandleLayoutFocusChange"); - if ((iShowFocus || !iUiUtility->IsPenSupported()) && (iLabels.Count() - 1 - >= iMediaList.FocusIndex())) + if ( iLabels.Count()-1 >= iMediaList.FocusIndex()) { //to highlight focused element SetFocusColor(); } } + // --------------------------------------------------------------------------- // FocusUpdate() // --------------------------------------------------------------------------- @@ -727,12 +699,14 @@ void CGlxCloudViewControl::FocusUpdate() { TRACER("GLX_CLOUD::CGlxCloudViewControl::FocusUpdate"); - iFocusRowIndex = RowNumber(iMediaList.FocusIndex()); - GLX_LOG_INFO1("GLX_CLOUD::FocusUpdate iFocusRowIndex=%d", - iFocusRowIndex); + GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::FocusUpdate HighLighted RowNum %d ",iFocusRowIndex); + GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::FocusUpdate End RowNumn %d ",iCloudInfo.Count()-1); + iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); + iEndRowIndex = iCloudInfo.Count()-1; LayoutVisibleArea(); } + // --------------------------------------------------------------------------- // ResetLayout() // --------------------------------------------------------------------------- @@ -749,23 +723,25 @@ iLabels.Reset(); } + // --------------------------------------------------------------------------- // GetRownum() // --------------------------------------------------------------------------- // TInt CGlxCloudViewControl::RowNumber(TInt aItemIndex) const - { - TRACER("GLX_CLOUD::CGlxCloudViewControl::GetRownum"); - //Get the rownumber of the given item index. - TInt i; - for (i = 0; i < iCloudInfo.Count(); i++) - { - if ((aItemIndex >= iCloudInfo[i].iStartIndex) && (aItemIndex - <= iCloudInfo[i].iEndIndex)) - break; - } - return i; - } +{ + +TRACER("GLX_CLOUD::CGlxCloudViewControl::GetRownum"); +//Get the rownumber of the given item index. +TInt i; +for (i = 0; i < iCloudInfo.Count (); i++) + { + if ( (aItemIndex >= iCloudInfo[i].iStartIndex) && (aItemIndex <=iCloudInfo[i].iEndIndex)) + break; + } +return i; + +} // --------------------------------------------------------------------------- // FetchAttributeFromCacheL() @@ -799,6 +775,7 @@ } } + //medialist Observers // --------------------------------------------------------------------------- @@ -828,11 +805,16 @@ //reset the layout and get the items from cache UpdateLayout(); //remove all the visuals from the layout.layout is empty now. iCloudInfo.Close (); //row information is reset + //get the new array contents from cache.no need to reset the array as the number + //of items in array will remain same. + FetchAttributeFromCacheL(); + UpdateRowDataL (); //updates the row data and reassigns font sizes and draw the layout on screen. } InitPhysicsL(); } + // --------------------------------------------------------------------------- // HandleMediaL(). // --------------------------------------------------------------------------- @@ -915,6 +897,8 @@ //of items in array will remain same. UpdateLayout(); //remove all the visuals from the layout.layout is empty now. FetchAttributeFromCacheL(); + //if we navigate in forward direction, first item should be highlighted.if we are navigating in + // backwards direction, index is not necessarily zero, it will be restored. if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ()) { iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0); @@ -985,6 +969,7 @@ // --------------------------------------------------------------------------- // void CGlxCloudViewControl::UpdateRowDataL() + { TRACER("GLX_CLOUD::CGlxCloudViewControl::UpdateRowData()"); @@ -1006,7 +991,7 @@ //Setting the Font Styles based on association counts //Finding the maximum value of image association //Determining the Font(Style) for each visual - TInt maxCount = MaxUsageCount (); //Maximum Association count + TInt maxCount= MaxUsageCount (); //Maximum Association count GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData mediaCount %d ", maxCount); GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData iLabels.Count() %d ",iLabels.Count()); if ( 0 == maxCount ) @@ -1045,7 +1030,7 @@ } // Current row width will be progressively incremented to fit as many tags as possible - rowWidth += currentTagSize.iWidth + KColSpace; + rowWidth += currentTagSize.iWidth + 10; GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData currentTagSize.iWidth %d ", currentTagSize.iWidth); GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData rowWidth %d ", rowWidth); @@ -1069,7 +1054,7 @@ // then we must fit the current visual into the next row. // Do that check now and adjust accordingly. // Fix for EAHN-7BZD78 is to exclude the gap value between the row's tags from the logic - else if ( rowWidth - KColSpace > KMaxScreenWidth ) + else if ( rowWidth - 10 > KMaxScreenWidth ) { GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::UpdateRowData Row added"); lastRowStartTagIndex = currentTagIndex - 1; @@ -1097,6 +1082,8 @@ GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData iCloudInfo.count loop exit %d ", iCloudInfo.Count()); FocusUpdate (); //Start screen drawing + + iEndRowIndex = iCloudInfo.Count()-1; } // --------------------------------------------------------------------------- @@ -1259,11 +1246,11 @@ } // --------------------------------------------------------------------------- -// AppendToCloudArrayL() +// SetFocusColor() // --------------------------------------------------------------------------- // -void CGlxCloudViewControl::AppendToCloudArrayL(TGlxCloudInfo& aCloudInfo, - const TInt& aStartIndex, const TInt& aEndIndex) +void CGlxCloudViewControl::AppendToCloudArrayL( + TGlxCloudInfo& aCloudInfo,const TInt& aStartIndex, const TInt& aEndIndex ) { TRACER("GLX_CLOUD::CGlxCloudViewControl::AppendToCloudArrayL"); aCloudInfo.iStartIndex = aStartIndex; @@ -1275,28 +1262,30 @@ // SetFocusColor() // --------------------------------------------------------------------------- // -void CGlxCloudViewControl::SetFocusColor() +void CGlxCloudViewControl::SetFocusColor() { - TRACER("GLX_CLOUD::CGlxCloudViewControl::SetFocusColor"); - if (iMediaList.Count()) - { - iLabels[iMediaList.FocusIndex()]->SetColor( - KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3); - } + iLabels[iMediaList.FocusIndex()]->SetColor (KAknsIIDQsnHighlightColors ,EAknsCIQsnHighlightColorsCG3); + } + + +// --------------------------------------------------------------------------- +// SetBubleMidPoint() +// --------------------------------------------------------------------------- +// +void CGlxCloudViewControl::SetBubleMidPoint(TPoint& aMidPoint) + { + TRACER("GLX_CLOUD::CGlxCloudViewControl::SetBubleMidPoint"); + //Substract the viewport position so as to set the buble at the right position on the screen + aMidPoint.iX-=iViewPortPosition.iX; + aMidPoint.iY-=iViewPortPosition.iY; } // --------------------------------------------------------------------------- -// ResetFocusColor() +// CreateBubleContainer() // --------------------------------------------------------------------------- -// -void CGlxCloudViewControl::ResetFocusColor() - { - TRACER("GLX_CLOUD::CGlxCloudViewControl::ResetFocusColor"); - if (iMediaList.Count()) - { - iLabels[iMediaList.FocusIndex()]->SetColor(KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6); - } +// +void CGlxCloudViewControl::CreateBubleContainer() + { } // --------------------------------------------------------------------------- @@ -1306,21 +1295,19 @@ void CGlxCloudViewControl::MoveUpIfRequired() { TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveUpIfRequired"); - TInt focusIndex = iMediaList.FocusIndex(); - //get the focused item's position TPoint point; - iLayout->ChildPos(focusIndex,point); + iLayout->ChildPos(iMediaList.FocusIndex(),point); TSize size; - iLayout->ChildSize(focusIndex,size); - - TInt rownumber = RowNumber(focusIndex); + iLayout->ChildSize(iMediaList.FocusIndex(),size); + TInt focus = iMediaList.FocusIndex(); + TInt rownumber = RowNumber(focus); //if the focused item is not visible then move the viewport if(point.iY < iViewPortPosition.iY) { //set the new position of viewport - TInt offset = iViewPortPosition.iY - point.iY; - iViewPortPosition.iY-=offset; + TInt offeset = iViewPortPosition.iY - point.iY; + iViewPortPosition.iY-=offeset; if( (iViewPortPosition.iY < 0) ) { iViewPortPosition.iY = 0; @@ -1336,57 +1323,89 @@ Scroll(); } + // --------------------------------------------------------------------------- // MoveDownIfRequired() // --------------------------------------------------------------------------- // void CGlxCloudViewControl::MoveDownIfRequired() { - TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveDownIfRequired"); - TInt focusIndex = iMediaList.FocusIndex(); - + TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveDownIfRequired"); //get the focused item's position TPoint point; - iLayout->ChildPos(focusIndex, point); + iLayout->ChildPos(iMediaList.FocusIndex(),point); TSize size; - iLayout->ChildSize(focusIndex, size); - - //Reset viewport position for cases: - //case 1)Focus index is first item - if (focusIndex == 0) - { - iViewPortPosition.iY = 0; - } - //case 2)Focused item is in last screen - else if( point.iY > (iViewPortVirtualSize.iHeight - iViewPortSize.iHeight)) + iLayout->ChildSize(iMediaList.FocusIndex(),size); + //if the focused visual is not visible then move the viewport + if(point.iY+size.iHeight > iViewPortPosition.iY+iViewPortSize.iHeight ) + { + //set the new position of viewport + TInt offeset = (point.iY+size.iHeight) - (iViewPortPosition.iY+iViewPortSize.iHeight); + iViewPortPosition.iY+=offeset; + if( (iViewPortPosition.iY > iViewPortVirtualSize.iHeight) ) + { + iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight; + } + } + //if its key event then it should be cyclic + else if (iMediaList.FocusIndex() == 0) { - iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight; - } - else - { - iViewPortPosition.iY = point.iY + KNumMinRowSpace; - } - - //Validate the viewport position - if ((iViewPortPosition.iY > iViewPortVirtualSize.iHeight)) - { - iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight; - } - - GLX_LOG_INFO1("GLX_CLOUD::MoveDownIfRequired() iViewPortPosition.iY:%d", - iViewPortPosition.iY); + iViewPortPosition.iY = 0; + } iViewPortLayout->SetViewportPos(iViewPortPosition, KSlowCloudMovement); iScrollEventData.mViewStartPos = iViewPortPosition.iY; if(iScrollBarWidget) { - Scroll(); + Scroll(); } - } + } + +// --------------------------------------------------------------------------- +// MoveDownIfRequired() +// --------------------------------------------------------------------------- +// +void CGlxCloudViewControl::CalculateBubleMidPoint() + { + TRACER("GLX_CLOUD::CGlxCloudViewControl::CalculateBubleMidPoint"); + TPoint midpoint; + TAlfRealRect focussedItemRect; + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, mainPaneRect); + + CAlfVisual& visual = iLayout->Visual( iMediaList.FocusIndex() ); + focussedItemRect = visual.DisplayRect(); + + if( GlxGeneralUiUtilities::LayoutIsMirrored () ) + { + midpoint.iX = focussedItemRect.iBr.iX + + ((focussedItemRect.iTl.iX - focussedItemRect.iBr.iX )/2); + } + + else + { + midpoint.iX=focussedItemRect.iTl.iX + + ((focussedItemRect.iBr.iX - focussedItemRect.iTl.iX )/2); + } + + midpoint.iY=focussedItemRect.iTl.iY+ + ((focussedItemRect.iBr.iY - focussedItemRect.iTl.iY )/2); + TPoint anchorRect; + + //Get the position of anchor layout + iViewPortLayout->ChildPos (0, anchorRect); + + //Add the differance to the midpoint + midpoint.iX+=anchorRect.iX; + midpoint.iY+=anchorRect.iY; + + //Substract from the viewport position the viewport position + SetBubleMidPoint(midpoint); + } // --------------------------------------------------------------------------- // HandlePointerEventL() // --------------------------------------------------------------------------- -// +// TBool CGlxCloudViewControl::HandlePointerEventL( const TAlfEvent &aEvent ) { TRACER("GLX_CLOUD::CGlxCloudViewControl::HandlePointerEventL"); @@ -1424,8 +1443,6 @@ { iTouchFeedback->InstantFeedback(ETouchFeedbackBasic); iMediaList.SetFocusL (NGlxListDefs::EAbsolute, index); - iShowFocus = ETrue; - HandleLayoutFocusChange(); //Start the timer to interpret longpress events iTimerComplete = EFalse; @@ -1448,12 +1465,6 @@ } else if (iDownEventReceived && aEvent.PointerUp()) { - if (!iTagsContextMenuControl->ItemMenuVisibility()) - { - iShowFocus = EFalse; - ResetFocusColor(); - } - iDownEventReceived = EFalse; Display()->Roster().SetPointerEventObservers(0, *this); consumed = ETrue; @@ -1487,8 +1498,10 @@ TInt focus = iMediaList.FocusIndex(); if (index != focus) { + iTouchFeedback->InstantFeedback( ETouchFeedbackBasic ); TInt focusrowindex = iFocusRowIndex; iMediaList.SetFocusL(NGlxListDefs::EAbsolute, index); + SetFocusColor(); iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); if( iFocusRowIndex > focusrowindex) @@ -1757,17 +1770,15 @@ } // --------------------------------------------------------------------------- -// InitializeScrollBar() +// attachScrollBar() // --------------------------------------------------------------------------- -// -void CGlxCloudViewControl::InitializeScrollBar( - IAlfScrollBarWidget* aScrollBarWidget) +// +void CGlxCloudViewControl::InitializeScrollBar(IAlfScrollBarWidget* aScrollBarWidget) { TRACER("GLX_CLOUD::CGlxCloudViewControl::InitializeScrollBar"); iScrollBarWidget = aScrollBarWidget; ((IAlfScrollBarModel *) (iScrollBarWidget->model()))->initializeData( iScrollEventData.mSpan, iScrollEventData.mViewLength, 0); - Scroll(); DisplayScrollBar(); } @@ -1824,30 +1835,19 @@ // DisplayScrollBar() // --------------------------------------------------------------------------- // -void CGlxCloudViewControl::DisplayScrollBar() +void CGlxCloudViewControl::DisplayScrollBar() { - TRACER("GLX_CLOUD::CGlxCloudViewControl::DisplayScrollBar()"); if (iScrollBarWidget) { IAlfElement* vertBaseElement =(iScrollBarWidget->control()->findElement ("BaseElement")); IAlfScrollBarDefaultBaseElement* scrollbarbaselement=static_cast ( vertBaseElement->makeInterface (IAlfScrollBarDefaultBaseElement::type() ) ); - TInt totalHeight = 0; - for (TInt index = 0; index <= iCloudInfo.Count() - 1; index++) - { - totalHeight += KRowHeight; - totalHeight += KNumMinRowSpace; - } - - // To set the scrollbar visibility, it's enough to set the opacity - // of baselayout. No need to set the opacity of thumb separately. - // Set the scrollbar visibility only - // when visuals height exceeds the screen height - if (iScrollEventData.mSpan && totalHeight > iTagScreenHeight) + // To set the scrollbar visibility, it's enough to set the opacity + // of baselayout. No need to set the opacity of thumb separately. + if (iScrollEventData.mSpan) { //make scroll bar visible - GLX_LOG_INFO("GLX_CLOUD: Make scrollbar visible!"); scrollbarbaselement->setOpacity(1.0); } else @@ -1868,31 +1868,30 @@ AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect); if ((rect.Width() != (iTagScreenWidth + KRightmargin)) || (rect.Height() != iScreenHeight)) { - //set the new screen dimensions - iScreenHeight = rect.Height(); - iTagScreenWidth = rect.Width() - KRightmargin; - if (IsLandscape()) - { - iTagScreenHeight = rect.Height(); - } - else - { - iTagScreenHeight = KTagScreenHeight; - } + //set the new screen dimensions + iScreenHeight=rect.Height(); + iTagScreenWidth = rect.Width()- KRightmargin; + if(IsLandscape()) + { + iTagScreenHeight = rect.Height(); + } + else + { + iTagScreenHeight = KTagScreenHeight; + } - iViewPortLayout->SetSize( - TAlfRealSize(iTagScreenWidth, iTagScreenHeight), 0); - //delete all layout associations - if (iCloudInfo.Count() != 0)//check for the empty cloud view - { - UpdateLayout(); - FetchAttributeFromCacheL(); - //generate row structures and draw rows on screen - UpdateRowDataL(); + iViewPortLayout->SetSize(TAlfRealSize(iTagScreenWidth,iTagScreenHeight), 0); + //delete all layout associations + if ( iCloudInfo.Count ()!= 0)//check for the empty cloud view + { + UpdateLayout(); + FetchAttributeFromCacheL(); + //generate row structures and draw rows on screen + UpdateRowDataL (); - InitPhysicsL(); - } - } + InitPhysicsL(); + } + } } // --------------------------------------------------------------------------- @@ -1964,7 +1963,6 @@ return EFalse; } } - // --------------------------------------------------------------------------- // TimerCompleteL() // --------------------------------------------------------------------------- @@ -1985,54 +1983,23 @@ TRect rect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect); - //only if not dragged and physics hasnt started - if (!iPhysicsStarted && !iViewDragged) + if(!iPhysicsStarted)//only if physics hasnt started { iTagsContextMenuControl->SetViewableRect(rect); iTagsContextMenuControl->ShowItemMenuL(ETrue); iTagsContextMenuControl->SetDisplay(midpoint); } } - // --------------------------------------------------------------------------- // ShowContextItemMenuL() // --------------------------------------------------------------------------- // void CGlxCloudViewControl::ShowContextItemMenuL(TBool aShow) { - TRACER("GLX_CLOUD::ShowContextItemMenuL"); - GLX_LOG_INFO1("GLX_CLOUD::ShowContextItemMenuL() aShow=%d", aShow); iTagsContextMenuControl->ShowItemMenuL(aShow); if(!aShow) { iViewPortLayout->UpdateChildrenLayout(0); - iShowFocus = EFalse; - ResetFocusColor(); - } - } - -// --------------------------------------------------------------------------- -// SetFocusToFirstVisibleItemL() -// --------------------------------------------------------------------------- -// -void CGlxCloudViewControl::SetFocusToFirstVisibleItemL() - { - TRACER("GLX_CLOUD::CGlxCloudViewControl::SetFocusToFirstVisibleItemL()"); - iShowFocus = ETrue; - - TInt visIndex = GetAbsoluteIndex(TPoint(KLeftMargin + KLeftMargin, - KColSpace)); - GLX_LOG_INFO1("GLX_CLOUD::SetFocusToFirstVisibleItemL() visIndex=%d", visIndex); - - if (visIndex != KErrNotFound) - { - iMediaList.SetFocusL(NGlxListDefs::EAbsolute, visIndex); - - MoveUpIfRequired(); - } - else - { - HandleLayoutFocusChange(); } } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp --- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -51,14 +51,9 @@ #include #include #include "glxgfxtranseffect.h" // For transition effects -#include //For CAknTransitionUtils - + const TInt KViewId = 0x200071B7; -//Transition animation used for Cloud view activation -_LIT( KTfxResourceActivate , "z:\\resource\\effects\\photos_gridview_appear.fxml"); -_LIT( KTfxResourceNoEffect, ""); - using namespace Alf; // ======== MEMBER FUNCTIONS ======== @@ -144,11 +139,7 @@ CGlxCloudViewImp::~CGlxCloudViewImp() { TRACER("GLX_CLOUD::CGlxCloudViewImp::~CGlxCloudViewImp"); - if(iAlfEffectObs) - { - delete iAlfEffectObs; - } - + CleanupVisuals (); delete iEmptyListText; if ( iResourceOffset ) @@ -221,33 +212,27 @@ { TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL"); + TUint transitionID = (iUiUtility->ViewNavigationDirection()== + EGlxNavigationForwards)?KActivateTransitionId:KDeActivateTransitionId; + + GfxTransEffect::BeginFullScreen( transitionID, TRect(), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( KPhotosUid, + AknTransEffect::TParameter::EEnableEffects) ); + + if(StatusPane()) { StatusPane()->MakeVisible(ETrue); } - ConstructCloudControlL(); GLX_LOG_INFO("CGlxCloudViewImp::DoMLViewActivateL Cloud View Control Created" ); + GfxTransEffect::EndFullScreen(); + // set app state to tag-browser view GlxSetAppState::SetState (EGlxInTagBrowserView); iMMCNotifier = CGlxMMCNotifier::NewL(*this); - - //Set the ALF animation effect to CAlfAnchorLayout since the animation - //does not work for both avkon and alf together. - //Check if the transitions are enabled from themes - if (CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EFullScreenTransitionsOff )) - { - if(!iAlfEffectObs) - { - iAlfEffectObs = CAlfEffectObserver::NewL(); - } - - iAnchorlayout->SetEffectL( KTfxResourceActivate ); - iEffectHandle = iAnchorlayout->Identifier(); - iAlfEffectObs->SubscribeCallbackL(this,iEffectHandle); - } - } // --------------------------------------------------------------------------- @@ -349,13 +334,13 @@ IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*(iUiUtility->Env ())); - iViewWidget = widgetFactory.createViewWidget("viewwidget", 0, 0, iDisplay); - iViewWidget->setRect(ClientRect()); - iViewWidget->show(true); - - IAlfLayoutManager* layoutmanager = IAlfInterfaceBase::makeInterface< - IAlfLayoutManager>(iViewWidget->control()); - iViewWidget->setRect(ClientRect()); + iViewWidget = widgetFactory.createViewWidget("viewwidget", 0,0,iDisplay); + + iViewWidget->setRect( ClientRect() ); + iViewWidget->show(true); + + IAlfLayoutManager* layoutmanager = IAlfInterfaceBase::makeInterface(iViewWidget->control()); + iViewWidget->setRect(ClientRect()); // parent layout handle for scrollbar iScrollPaneHandle = AknLayoutScalable_UiAccel::aa_scroll_pane(0).LayoutLine(); @@ -456,11 +441,7 @@ void CGlxCloudViewImp::HandleGridMenuListL(TInt aCommand) { TRACER("GLX_CLOUD::CGlxCloudViewImp::HandleGridMenuListL"); - iCloudControl->ShowContextItemMenuL(EFalse); - if (aCommand) - { - ProcessCommandL(aCommand); - } + ProcessCommandL(aCommand); } // ---------------------------------------------------------------------------- @@ -511,19 +492,3 @@ ProcessCommandL(EAknSoftkeyClose); } } - -// --------------------------------------------------------------------------- -// HandleEffectCallback -// -// --------------------------------------------------------------------------- -// -void CGlxCloudViewImp::HandleEffectCallback(TInt aType, TInt aHandle, TInt /*aStatus*/) - { - TRACER("CGlxCloudViewImp::HandleEffectCallback()"); - if (aHandle == iEffectHandle && aType == EAlfEffectComplete - && iAnchorlayout) - { - TRAP_IGNORE(iAnchorlayout->SetEffectL(KTfxResourceNoEffect)); - } - } - diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp --- a/photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -36,7 +36,6 @@ #include #include -#include // Photos Headers #include "glxtagscontextmenucontrol.h" @@ -275,21 +274,26 @@ } TInt upperYPos = aPoint.iY - KMinimalGap; - TInt xPos = aPoint.iX; + TInt XPos = aPoint.iX; + //Preferred is to display in upper area + TInt upperDisplayableHeight = upperYPos - iViewableRect.iTl.iY; + TInt rightDisplayableWidth = iViewableRect.iBr.iX - (XPos + KRightMargin + + KWidthPadding); + //always draw above - if ((iViewableRect.iBr.iX - (xPos + KRightMargin + KWidthPadding)) - < iMaxTextWidth) + if(rightDisplayableWidth < iMaxTextWidth) { - xPos = aPoint.iX - iMaxTextWidth; + XPos = aPoint.iX - iMaxTextWidth; } - - if (upperYPos + KGridHeight > iViewableRect.iBr.iY) + if(upperDisplayableHeight < KGridHeight) { - upperYPos = iViewableRect.iBr.iY - KGridHeight; + iMainVisual->SetPos(TAlfRealPoint(XPos , upperYPos )); } - - iMainVisual->SetPos(TAlfRealPoint(xPos, upperYPos)); + else + { + iMainVisual->SetPos(TAlfRealPoint(XPos , upperYPos - KGridHeight)); + } if ( iTimer) { @@ -341,7 +345,6 @@ if (aEvent.IsPointerEvent() && iItemMenuVisibility ) { - MTouchFeedback* feedback = MTouchFeedback::Instance(); if (aEvent.PointerDown()) { iCommandId = KErrNotFound; @@ -386,10 +389,6 @@ iCommandId = EGlxCmdRename; } consumed = ETrue; - if (feedback) - { - feedback->InstantFeedback(ETouchFeedbackBasic); - } CleanupStack::Pop(brush); }//End of iItemMenuVisibility check }//End of Pointer down event @@ -422,10 +421,6 @@ { HandleUpEventL(); } - else if (eventInsideControl && feedback) - { - feedback->InstantFeedback(ETouchFeedbackBasic); - } consumed = ETrue; } consumed = ETrue; @@ -441,7 +436,6 @@ { TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::TimerCompleteL"); ShowItemMenuL(EFalse); - iItemMenuObserver.HandleGridMenuListL(); } // --------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h --- a/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h Wed Oct 13 14:32:09 2010 +0300 @@ -52,7 +52,6 @@ class CGestureHelper; class TGlxMedia; class CGlxFullScreenBusyIcon; -class CGlxNavigationalState; namespace Alf { @@ -315,18 +314,6 @@ */ void UpdateItems(); - /** - * Handle coverflow item removed event / - * external file deletion while gaining foreground - */ - void HandleItemRemovedL(); - - /** - * Sets the title pane text - * @param aTitleText Title text - */ - void SetTitlePaneTextL(const TDesC& aTitleText); - private: /** Softkey resource id's */ TFullScreenViewResourceIds iResourceIds; @@ -370,8 +357,6 @@ CPeriodic* iPeriodic; CGlxFullScreenBusyIcon* iBusyIcon; - CGlxNavigationalState* iNaviState; - GestureHelper::CGestureHelper* iGestureHelper; TBool iMultiTouchGestureOngoing ; @@ -379,9 +364,6 @@ TInt iInitialZoomRatio ; //Previous focused index TInt iOldFocusIndex; - // Previous focused Uri - HBufC* iUri; - TBool iImgViewerMode; CGlxMMCNotifier* iMMCNotifier; TBool iMMCState; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp --- a/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -46,7 +46,6 @@ #include #include -#include using namespace GestureHelper; @@ -210,8 +209,6 @@ iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard); } iGlxTvOut = CGlxTv::NewL(*this); - - iNaviState = CGlxNavigationalState::InstanceL(); } // --------------------------------------------------------------------------- @@ -230,12 +227,6 @@ delete iMMCNotifier; iMMCNotifier = NULL; } - - if (iUri) - { - delete iUri; - } - if(iMediaListMulModelProvider) { delete iMediaListMulModelProvider; @@ -270,11 +261,6 @@ iPeriodic->Cancel(); delete iPeriodic; } - - if (iNaviState) - { - iNaviState->Close(); - } } // --------------------------------------------------------------------------- // From CGlxViewBase @@ -340,34 +326,33 @@ // hide the toolbar EnableFSToolbar(EFalse); - if (iMediaList->Count() == 0) - { - GLX_LOG_INFO("CGlxFullScreenViewImp::DoMLViewActivateL() - No items!"); - // While in slideshow from fullscreen view, - // 1) Connect USB in mass storage mode or - // 2) Delete items through file manager - // shall result in activating fullscreen view with no items; so, goto grid view. - iNaviState->ActivatePreviousViewL(); - } - else - { - //fix for ESLM-7YYDXC: When in FullScreen View, view mode must be 'EView' - //While coming back from SlideShow to FullScreen view, need to set view mode. - if (iMediaList->Count() && iNaviState->ViewingMode() - != NGlxNavigationalState::EView) - { - iNaviState->SetToViewMode(); - } - } - - CMPXCollectionPath* collPath = iNaviState->StateLC(); - if (collPath->Id() == TMPXItemId( - KGlxCollectionPluginImageViewerImplementationUid)) + CGlxNavigationalState* navigationalState = CGlxNavigationalState::InstanceL(); + CleanupClosePushL( *navigationalState ); + CMPXCollectionPath* naviState = navigationalState->StateLC(); + + if(!iMediaList->Count()) + { + //Fix For EPKA-7U5DT7-slideshow launched from FullScreen and connect USB in mass storage mode results in Photos crash + navigationalState->ActivatePreviousViewL(); + } + else + { + //fix for ESLM-7YYDXC: When in FullScreen View, view mode must be 'EView' + //While coming back from SlideShow to FullScreen view, need to set view mode. + if(navigationalState->ViewingMode() != NGlxNavigationalState::EView) + { + navigationalState->SetToViewMode(); + } + } + + if(naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) { iImgViewerMode = ETrue; CreateImageViewerInstanceL(); } - CleanupStack::PopAndDestroy(collPath); + //destroy and close navistate and navipath + CleanupStack::PopAndDestroy( naviState ); + CleanupStack::PopAndDestroy( navigationalState ); iScrnSize = iUiUtility->DisplaySize(); iGridIconSize = iUiUtility->GetGridIconSize(); @@ -432,7 +417,6 @@ CAknViewAppUi* appui = AppUi(); if ( appui ) { - SetTitlePaneTextL(KNullDesC); appui->StatusPane()->MakeVisible(EFalse); appui->Cba()->MakeVisible(EFalse); } @@ -511,7 +495,6 @@ iSliderModel = widgetFactory.createModel ("mulslidermodel"); iSliderModel->SetTemplate(ESliderTemplate3); iSliderWidget->setModel(iSliderModel); - iSliderWidget->control()->disableState(IAlfWidgetControl::Focusable); //adding the range and slider tick value if(iSliderModel) @@ -554,12 +537,6 @@ //Since the toolbar should not be present for ImageViewer. if(!iImgViewerMode) { - TInt focusIndex = iMediaList->FocusIndex(); - if (focusIndex >= 0 && focusIndex < iMediaList->Count()) - { - TBool dimmed = (EMPXVideo == iMediaList->Item(focusIndex).Category()); - Toolbar()->SetItemDimmed(EGlxCmdSlideshowPlay, dimmed, ETrue); - } //show the toolbar EnableFSToolbar(ETrue); } @@ -695,6 +672,7 @@ HideUi(iSliderWidget->IsHidden()); } } + iViewWidget->show(ETrue); } // --------------------------------------------------------------------------- @@ -714,6 +692,7 @@ { iSliderWidget->AddEventHandler(*this); } + iViewWidget->show(ETrue); iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize())); GlxSetAppState::SetState(EGlxInFullScreenView); } @@ -963,11 +942,6 @@ if(iZoomControl && iZoomControl->Activated()) { iZoomControl->HandleZoomForegroundEvent(aForeground); - if (aForeground && iUri && !ConeUtils::FileExists(iUri->Des())) - { - GLX_LOG_INFO("File does not exist, Exit zoom view!"); - HandleItemRemovedL(); - } } if (!aForeground) @@ -983,13 +957,15 @@ if (iMediaList) { /** if there is no image to show go back to the previous view */ - if (!iMediaList->Count() && iNaviState->ViewingMode() - == NGlxNavigationalState::EView) - { - iUiUtility->SetViewNavigationDirection( - EGlxNavigationBackwards); - iNaviState->ActivatePreviousViewL(); - } + if (!iMediaList->Count()) + { + iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); + CGlxNavigationalState* navigationalState = + CGlxNavigationalState::InstanceL(); + CleanupClosePushL(*navigationalState); + navigationalState ->ActivatePreviousViewL(); + CleanupStack::PopAndDestroy(navigationalState); + } else if (iMediaListMulModelProvider) { UpdateItems(); @@ -1037,7 +1013,6 @@ TRACER("CGlxFullScreenViewImp::offerEventL"); if ( aEvent.IsKeyEvent()) { - GLX_LOG_INFO1("CGlxFullScreenViewImp::OfferEventL aEvent.KeyEvent().iScanCode: %d",aEvent.KeyEvent().iScanCode); switch ( aEvent.KeyEvent().iScanCode ) { case EStdKeyNkpAsterisk : @@ -1050,19 +1025,12 @@ //EKeyApplicationC for which TStdScancode is EStdKeyApplicatoinC case EStdKeyApplicationC: { - TInt focusIndex = iMediaList->FocusIndex(); - if (focusIndex >= 0 && focusIndex < iMediaList->Count()) + if(EEventKeyDown == aEvent.Code()) { - if (EEventKey == aEvent.Code() && (EMPXImage - == iMediaList->Item(focusIndex).Category())) - { - HideUi(EFalse); - SetSliderToMin(); - TRAP_IGNORE(ActivateZoomControlL(EZoomStartKey)); - return EEventHandled; - } + HideUi(EFalse); + TRAP_IGNORE( ActivateZoomControlL(EZoomStartKey)); + return EEventConsumed; } - // Fall through to show the UI in case of EMPXVideo } case EStdKeyUpArrow: case EStdKeyDownArrow: @@ -1154,17 +1122,11 @@ case ETypeRemove: { - // If From photos, delete the img. - // If Image-Viewer collection and not in private Path - // handle the "C" or BackSpace key to delete the item - if (!iImgViewerMode || (iImageViewerInstance - && !iImageViewerInstance->IsPrivate())) - { - ProcessCommandL(EGlxCmdDelete); - return EEventConsumed; - } - return EEventNotHandled; + // Handle the "C" key or the BackSpace key to Delete an item. + ProcessCommandL(EGlxCmdDelete); + return EEventConsumed; } + case ETypeDoubleTap: { GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeDoubleTap"); @@ -1189,13 +1151,33 @@ } case ETypeItemRemoved: { - GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeItemRemoved"); - HandleItemRemovedL(); + SetItemToHDMIL(); + TInt focusIndex = iMediaList->FocusIndex(); + if (focusIndex != KErrNotFound && EUiOn == GetUiState()) + { + // show/hide the slider + if (iSliderWidget) + { + iSliderWidget->ShowWidget(CheckIfSliderToBeShownL()); + } + } + /** if this is the last image deleted when Photo is in foreground, go back to the previous view*/ + if (!iMediaList->Count() && IsForeground()) + { + iUiUtility->SetViewNavigationDirection( + EGlxNavigationBackwards); + CGlxNavigationalState* navigationalState = + CGlxNavigationalState::InstanceL(); + CleanupClosePushL(*navigationalState); + navigationalState ->ActivatePreviousViewL(); + CleanupStack::PopAndDestroy(navigationalState); + } return EEventConsumed; } case ETypeHighlight: { - GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeHighlight"); + //Clear the last consumed uri when swiping to next image + iDrmUtility->ClearLastConsumedItemUriL(); iMediaList->SetFocusL( NGlxListDefs::EAbsolute,(aEvent.CustomEventData())); if (AknLayoutUtils::PenEnabled()) { @@ -1219,7 +1201,6 @@ if(item.Category() == EMPXVideo) { ProcessCommandL(EGlxCmdPlay); - iViewWidget->show(false); } else { @@ -1302,22 +1283,9 @@ iIsDialogLaunched = ETrue; break; } - case EGlxCmdDialogDismissed: - { - if (iIsDialogLaunched && iIsMMCRemoved) - { - ProcessCommandL(EAknSoftkeyExit); - } - consumed = ETrue; - iIsDialogLaunched = EFalse; - break; - } case EAknSoftkeyBack: { HideUi(ETrue); - // Enable status pane and Set null text - StatusPane()->MakeVisible(ETrue); - SetTitlePaneTextL(KNullDesC); break; } } @@ -1855,11 +1823,7 @@ //(e.g. video, corrupted item, item with invalid DRM) iHdmiController->ItemNotSupported(); } - iOldFocusIndex = iMediaList->FocusIndex(); - delete iUri; - iUri = NULL; - iUri = item.Uri().AllocL(); } // --------------------------------------------------------------------------- @@ -2096,63 +2060,3 @@ } } } - -// --------------------------------------------------------------------------- -// Sets the title pane text -// --------------------------------------------------------------------------- -void CGlxFullScreenViewImp::SetTitlePaneTextL(const TDesC& aTitleText) - { - TRACER("CGlxFullScreenViewImp::SetTitlePaneTextL()"); - CAknViewAppUi* appui = AppUi(); - if (appui) - { - CAknTitlePane* titlePane = - (CAknTitlePane*) appui->StatusPane()->ControlL(TUid::Uid( - EEikStatusPaneUidTitle)); - titlePane->SetTextL(aTitleText); - titlePane->DrawNow(); - } - } - -// --------------------------------------------------------------------------- -// HandleItemRemovedL -// --------------------------------------------------------------------------- -void CGlxFullScreenViewImp::HandleItemRemovedL() - { - TRACER("CGlxFullScreenViewImp::HandleItemRemovedL()"); - TInt focusIndex = iMediaList->FocusIndex(); - TInt mlCount = iMediaList->Count(); - GLX_LOG_INFO2("CGlxFullScreenViewImp::HandleItemRemovedL focusIndex=%d, iOldFocusIndex=%d", - focusIndex, iOldFocusIndex); - // When photos is in background, the Following scenario could happen, - // 1) First item is deleted => iOldFocusIndex == focusIndex (or) - // 2) Last item is deleted => iOldFocusIndex == mlCount (or) - // 3) New item is added and focused item is deleted => iOldFocusIndex != focusIndex - if (mlCount && (iOldFocusIndex == focusIndex || iOldFocusIndex == mlCount - || iOldFocusIndex != focusIndex) && iZoomControl - && iZoomControl->Activated()) - { - GLX_LOG_INFO("Focused item is removed, Exit zoom view!"); - DeactivateZoomControlL(); - } - SetItemToHDMIL(); - if (focusIndex != KErrNotFound && focusIndex < iMediaList->Count() && EUiOn - == GetUiState()) - { - // show/hide the slider - if (iSliderWidget) - { - iSliderWidget->ShowWidget(CheckIfSliderToBeShownL()); - } - TBool dimmed = (EMPXVideo == iMediaList->Item(focusIndex).Category()); - Toolbar()->SetItemDimmed(EGlxCmdSlideshowPlay, dimmed, ETrue); - } - /** if this is the last image deleted when Photo is in foreground, go back to the previous view*/ - if (mlCount == 0 && IsForeground() && iNaviState->ViewingMode() - == NGlxNavigationalState::EView) - { - iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); - iNaviState->ActivatePreviousViewL(); - } - TRAP_IGNORE(ShowDrmExpiryNoteL()); - } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/bwins/glxgridviewu.def --- a/photosgallery/viewframework/views/gridview/bwins/glxgridviewu.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/bwins/glxgridviewu.def Wed Oct 13 14:32:09 2010 +0300 @@ -1,5 +1,5 @@ EXPORTS ?NewLC@CGlxGridView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTGridViewResourceIds@@HABVTDesC16@@@Z @ 1 NONAME ; class CGlxGridView * CGlxGridView::NewLC(class MGlxMediaListFactory *, class TGridViewResourceIds const &, int, class TDesC16 const &) ?NewL@CGlxGridView@@SAPAV1@PAVMGlxMediaListFactory@@ABVTGridViewResourceIds@@HABVTDesC16@@@Z @ 2 NONAME ; class CGlxGridView * CGlxGridView::NewL(class MGlxMediaListFactory *, class TGridViewResourceIds const &, int, class TDesC16 const &) - ?NewL@CGlxGridViewMLObserver@@SAPAV1@AAVMHgScrollBufferObserver@@AAVMGlxMediaList@@PAVCHgGrid@@W4TGlxFilterItemType@@@Z @ 3 NONAME ; class CGlxGridViewMLObserver * CGlxGridViewMLObserver::NewL(class MHgScrollBufferObserver &, class MGlxMediaList &, class CHgGrid *, enum TGlxFilterItemType) + ?NewL@CGlxGridViewMLObserver@@SAPAV1@AAVMGlxMediaList@@PAVCHgGrid@@W4TGlxFilterItemType@@@Z @ 3 NONAME ; class CGlxGridViewMLObserver * CGlxGridViewMLObserver::NewL(class MGlxMediaList &, class CHgGrid *, enum TGlxFilterItemType) diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/eabi/glxgridviewu.def --- a/photosgallery/viewframework/views/gridview/eabi/glxgridviewu.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/eabi/glxgridviewu.def Wed Oct 13 14:32:09 2010 +0300 @@ -1,7 +1,7 @@ EXPORTS _ZN12CGlxGridView4NewLEP20MGlxMediaListFactoryRK20TGridViewResourceIdsiRK7TDesC16 @ 1 NONAME _ZN12CGlxGridView5NewLCEP20MGlxMediaListFactoryRK20TGridViewResourceIdsiRK7TDesC16 @ 2 NONAME - _ZN22CGlxGridViewMLObserver4NewLER23MHgScrollBufferObserverR13MGlxMediaListP7CHgGrid18TGlxFilterItemType @ 3 NONAME + _ZN22CGlxGridViewMLObserver4NewLER13MGlxMediaListP7CHgGrid18TGlxFilterItemType @ 3 NONAME _ZTI21CGlxGridViewContainer @ 4 NONAME _ZTI22CGlxGridViewMLObserver @ 5 NONAME _ZTV21CGlxGridViewContainer @ 6 NONAME diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h --- a/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h Wed Oct 13 14:32:09 2010 +0300 @@ -23,15 +23,10 @@ #include #include -// CONSTANTS -const TInt KNoOfPages(3); -const TInt KBufferTresholdSize(3); // in rows - // FORWARD DECLARATIONS class CGlxMediaList; class CHgGrid; class CGlxDRMUtility; -class MHgScrollBufferObserver; //class CHgContextUtility; // CLASS DECLARATION @@ -46,10 +41,9 @@ * * @return Pointer to newly created object. */ - IMPORT_C static CGlxGridViewMLObserver* NewL( - MHgScrollBufferObserver& aHgScrollBufferObs, - MGlxMediaList& aMediaList, CHgGrid* aHgGrid, - TGlxFilterItemType aFilterType = EGlxFilterVideoAndImages); + IMPORT_C static CGlxGridViewMLObserver* NewL(MGlxMediaList& aMediaList, + CHgGrid* aHgGrid, TGlxFilterItemType aFilterType = + EGlxFilterVideoAndImages); /** * Destructor. @@ -77,8 +71,7 @@ /** * C++ default constructor. */ - CGlxGridViewMLObserver(MHgScrollBufferObserver& aHgScrollBufferObs, - MGlxMediaList& aMediaList, CHgGrid* aHgGrid, + CGlxGridViewMLObserver(MGlxMediaList& aMediaList, CHgGrid* aHgGrid, TGlxFilterItemType aFilterType); /** @@ -134,8 +127,6 @@ void SetIconL(TInt aItemIndex, TInt aBitmapId, TInt aMaskId, TInt aFlags); private: - // Hg Grid scroll buffer observer - MHgScrollBufferObserver& iHgScrollBufferObs; MGlxMediaList& iMediaList; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -44,6 +44,9 @@ #include "glxgridviewimp.h" #include "glxgridviewmlobserver.h" // medialist observer for Hg Grid +const TInt KNoOfPages(3); +const TInt KBufferTresholdSize(3); // in rows + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -340,7 +343,7 @@ { TRACER("CGlxGridViewContainer::HandleOpenL()"); // Make sure that the Selection Index is inside medialist count - if (!iIsDialogLaunched && aIndex Count() && aIndex >=0) + if (aIndex Count() && aIndex >=0) { if (!(iHgGrid->Flags() && CHgScroller::EHgScrollerSelectionMode)) { @@ -523,8 +526,7 @@ { TRACER("CGlxGridViewContainer::CreateGridMediaListObserverL()"); // Creating the Medialist observer for HG Grid - iGlxGridMLObserver = CGlxGridViewMLObserver::NewL(*this, *iMediaList, - iHgGrid); + iGlxGridMLObserver = CGlxGridViewMLObserver::NewL(*iMediaList, iHgGrid); } // --------------------------------------------------------------------------- @@ -960,17 +962,6 @@ iIsDialogLaunched = ETrue; break; } - case EGlxCmdDialogDismissed: - { - if (iIsDialogLaunched && iIsMMCRemoved) - { - iGlxGridViewObserver.HandleGridEventsL(EAknSoftkeyExit); - } - - iIsDialogLaunched = EFalse; - retVal = ETrue; - break; - } default: break; } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -127,6 +127,9 @@ { TRACER("CGlxGridViewImp::DoMLViewActivateL()"); + TUint transitionID = (iUiUtility->ViewNavigationDirection()== + EGlxNavigationForwards)?KActivateTransitionId:KFSDeActivateTransitionId; + HBufC8* activationParam = HBufC8::NewLC(KMaxUidName); activationParam->Des().AppendNum(KGlxActivationCmdShowAll); @@ -177,8 +180,8 @@ iToolbar = CAknToolbar::NewL(R_GLX_GRID_VIEW_TOOLBAR); SetGridToolBar(iToolbar); SetToolbarObserver(this); - iToolbar->SetDimmed(ETrue); - iToolbar->SetToolbarVisibility(ETrue); + //Make the toolbar visible only when the medialist is populated + iToolbar->SetToolbarVisibility(iMediaList->IsPopulated()); } //Create gridview container iGlxGridViewContainer = CGlxGridViewContainer::NewL(iMediaList, @@ -190,14 +193,11 @@ // except if launched from Camera App. if (aCustomMessage.Compare(activationParam->Des()) != 0) { - TUint transitionID = (iUiUtility->ViewNavigationDirection() - == EGlxNavigationForwards) ? KActivateTransitionId - : KFSDeActivateTransitionId; GfxTransEffect::BeginFullScreen( transitionID, TRect(), AknTransEffect::EParameterType, AknTransEffect::GfxTransParam( KPhotosUid, - AknTransEffect::TParameter::EEnableEffects) ); - iIsTransEffectStarted = ETrue; + AknTransEffect::TParameter::EEnableEffects) ); + GfxTransEffect::EndFullScreen(); } CleanupStack::PopAndDestroy(activationParam); } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp --- a/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -55,30 +55,25 @@ // --------------------------------------------------------------------------- // EXPORT_C CGlxGridViewMLObserver* CGlxGridViewMLObserver::NewL( - MHgScrollBufferObserver& aHgScrollBufferObs, MGlxMediaList& aMediaList, CHgGrid* aHgGrid, TGlxFilterItemType aFilterType) { TRACER("CGlxGridViewMLObserver::NewL()"); CGlxGridViewMLObserver* self = new (ELeave) CGlxGridViewMLObserver( - aHgScrollBufferObs, aMediaList, aHgGrid, aFilterType); + aMediaList, aHgGrid, aFilterType); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); return self; } - // --------------------------------------------------------------------------- // C++ default constructor can NOT contain any code, that // might leave. // --------------------------------------------------------------------------- // -CGlxGridViewMLObserver::CGlxGridViewMLObserver( - MHgScrollBufferObserver& aHgScrollBufferObs, - MGlxMediaList& aMediaList, CHgGrid* aHgGrid, - TGlxFilterItemType aFilterType) : - iHgScrollBufferObs(aHgScrollBufferObs), iMediaList(aMediaList), iHgGrid( - aHgGrid), iFilterType(aFilterType) +CGlxGridViewMLObserver::CGlxGridViewMLObserver(MGlxMediaList& aMediaList, + CHgGrid* aHgGrid, TGlxFilterItemType aFilterType) : + iMediaList(aMediaList), iHgGrid(aHgGrid), iFilterType(aFilterType) { TRACER("CGlxGridViewMLObserver::CGlxGridViewMLObserver()"); } @@ -86,7 +81,7 @@ // --------------------------------------------------------------------------- // Symbian 2nd phase constructor can leave. // --------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::ConstructL() { TRACER("CGlxGridViewMLObserver::ConstructL()"); @@ -99,19 +94,19 @@ iGridIconSize = uiUtility->GetGridIconSize(); iItemsPerPage = uiUtility->VisibleItemsInPageGranularityL(); CleanupStack::PopAndDestroy(uiUtility); - - iQualityTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, - GlxFullThumbnailAttributeId( ETrue, iGridIconSize.iWidth, + + iQualityTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, + GlxFullThumbnailAttributeId( ETrue, iGridIconSize.iWidth, iGridIconSize.iHeight ) ); - iSpeedTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, - GlxFullThumbnailAttributeId( EFalse, iGridIconSize.iWidth, + iSpeedTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, + GlxFullThumbnailAttributeId( EFalse, iGridIconSize.iWidth, iGridIconSize.iHeight ) ); - + iIconsFileName.Append(KDC_APP_BITMAP_DIR); iIconsFileName.Append(KGlxIconsFilename); iIsDefaultIconSet = EFalse; - + iDiskErrorIntimated = EFalse; } @@ -133,8 +128,8 @@ // ---------------------------------------------------------------------------- // HandleItemAddedL // ---------------------------------------------------------------------------- -// -void CGlxGridViewMLObserver::HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, +// +void CGlxGridViewMLObserver::HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ) { TRACER("CGlxGridViewMLObserver::HandleItemAddedL()"); @@ -152,14 +147,14 @@ TTime startTime; GLX_LOG_INFO("CGlxGridViewMLObserver::HandleItemAddedL - ResizeL(+)"); startTime.HomeTime(); -#endif +#endif iHgGrid->ResizeL(aList->Count()); #ifdef _DEBUG TTime stopTime; stopTime.HomeTime(); GLX_DEBUG2("CGlxGridViewMLObserver::HandleItemAddedL - ResizeL(-) took <%d> us", (TInt)stopTime.MicroSecondsFrom(startTime).Int64()); -#endif +#endif } else { @@ -173,65 +168,46 @@ // ---------------------------------------------------------------------------- // HandleItemRemoved // ---------------------------------------------------------------------------- -// -void CGlxGridViewMLObserver::HandleItemRemovedL( TInt aStartIndex, +// +void CGlxGridViewMLObserver::HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ) { TRACER("CGlxGridViewMLObserver::HandleItemRemovedL()"); - GLX_DEBUG3("CGlxGridViewMLObserver::HandleItemRemovedL() aStartIndex(%d), aEndIndex(%d)", - aStartIndex, aEndIndex); if (iHgGrid) { - TInt mediaCount = aList->Count(); - // If the last item is also deleted, refresh the view - if (mediaCount <= 0) + TInt mediaCount = aList->Count(); + + for (TInt i = aEndIndex; i>= aStartIndex; i--) { - if (iMediaList.VisibleWindowIndex() > iMediaList.Count()) - { - iMediaList.SetVisibleWindowIndexL(0); - } - //This is done since the Hg doesnot refresh the screen - //when we remove all the items from the grid - GLX_LOG_INFO("CGlxGridViewMLObserver::HandleItemRemovedL - Hg Reset"); - iHgGrid->DrawDeferred(); - iHgGrid->Reset(); - return; + iHgGrid->RemoveItem(i); } - if (aStartIndex == aEndIndex) - { - iHgGrid->RemoveItem(aStartIndex); - } - else - { - GLX_LOG_INFO("CGlxGridViewMLObserver::HandleItemRemovedL - Hg RemoveItems(+)"); - // Need to disable the buffering support until HgGrid data model - // is synced with Medialist; Otherwise, RequestL would result in - // requesting same index for the no of items removed. - iHgGrid->DisableScrollBuffer(); - for (TInt i = aEndIndex; i >= aStartIndex; i--) + // If the last item is also deleted, this refreshes the view + if (mediaCount <=0) + { + if(iMediaList.VisibleWindowIndex() > iMediaList.Count()) { - iHgGrid->RemoveItem(i); - } - // Enable Buffer support - iHgGrid->EnableScrollBufferL(iHgScrollBufferObs, (KNoOfPages - * iItemsPerPage), KBufferTresholdSize); - GLX_LOG_INFO("CGlxGridViewMLObserver::HandleItemRemovedL - Hg RemoveItems(-)"); + iMediaList.SetVisibleWindowIndexL(0); + } + //This is done since the Hg doesnot refresh the screen + //when we remove all the items from the grid + iHgGrid->DrawDeferred(); + iHgGrid->Reset(); + return; + } + else if (iMediaList.VisibleWindowIndex() > iMediaList.Count()) + { + iMediaList.SetVisibleWindowIndexL(iMediaList.Count()-1); } - - if (iMediaList.VisibleWindowIndex() > iMediaList.Count()) - { - iMediaList.SetVisibleWindowIndexL(iMediaList.Count() - 1); - } - iHgGrid->RefreshScreen(iHgGrid->FirstIndexOnScreen()); + iHgGrid->RefreshScreen(iHgGrid->FirstIndexOnScreen()); } } // ---------------------------------------------------------------------------- // HandleAttributesAvailableL // ---------------------------------------------------------------------------- -// -void CGlxGridViewMLObserver::HandleAttributesAvailableL( TInt aItemIndex, +// +void CGlxGridViewMLObserver::HandleAttributesAvailableL( TInt aItemIndex, const RArray& aAttributes, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleAttributesAvailableL()"); @@ -290,20 +266,20 @@ CHgItem::EHgItemFlagsNone); } } - - //Now Update the items with the DRM/video icon and date/time + + //Now Update the items with the DRM/video icon and date/time UpdateItemsL(aItemIndex,aAttributes); - + //Now refresh the screen based on the attributes available index RefreshScreenL(aItemIndex,aAttributes); } - + // ---------------------------------------------------------------------------- // HandleFocusChangedL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::HandleFocusChangedL( NGlxListDefs:: - TFocusChangeType /*aType*/, TInt aNewIndex, TInt aOldIndex, + TFocusChangeType /*aType*/, TInt aNewIndex, TInt aOldIndex, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleFocusChangedL()"); @@ -323,8 +299,8 @@ // ---------------------------------------------------------------------------- // HandleItemSelected // ---------------------------------------------------------------------------- -// -void CGlxGridViewMLObserver::HandleItemSelectedL(TInt /*aIndex*/, +// +void CGlxGridViewMLObserver::HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleItemSelectedL()"); @@ -333,18 +309,18 @@ // ---------------------------------------------------------------------------- // HandleMessageL // ---------------------------------------------------------------------------- -// - void CGlxGridViewMLObserver::HandleMessageL( const CMPXMessage& /*aMessage*/, +// + void CGlxGridViewMLObserver::HandleMessageL( const CMPXMessage& /*aMessage*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleMessageL()"); } - + // ---------------------------------------------------------------------------- // HandleError // ---------------------------------------------------------------------------- // -void CGlxGridViewMLObserver::HandleError( TInt /*aError*/ ) +void CGlxGridViewMLObserver::HandleError( TInt /*aError*/ ) { TRACER("CGlxGridViewMLObserver::HandleError()"); TRAP_IGNORE(HandleErrorL()); @@ -359,15 +335,15 @@ TRACER("CGlxGridViewMLObserver::HandleErrorL()"); TInt bitmapId = EMbmGlxiconsQgn_prop_image_corrupted; - TInt maskId = EMbmGlxiconsQgn_prop_image_corrupted_mask; + TInt maskId = EMbmGlxiconsQgn_prop_image_corrupted_mask; 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 (KErrNone != thumbnailError) { switch (thumbnailError) @@ -402,19 +378,19 @@ } } - break; + break; } - + SetIconL(i, bitmapId, maskId, flags); } } - iHgGrid->RefreshScreen(iHgGrid->FirstIndexOnScreen()); + iHgGrid->RefreshScreen(iHgGrid->FirstIndexOnScreen()); } // ---------------------------------------------------------------------------- // SetIconL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::SetIconL(TInt aItemIndex, TInt aBitmapId, TInt aMaskId, TInt aFlags) { @@ -440,17 +416,17 @@ // ---------------------------------------------------------------------------- // HandleCommandCompleteL // ---------------------------------------------------------------------------- -// -void CGlxGridViewMLObserver::HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, +// +void CGlxGridViewMLObserver::HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, TInt /*aError*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleCommandCompleteL()"); } - + // ---------------------------------------------------------------------------- // HandleMediaL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::HandleMediaL( TInt /*aListIndex*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxGridViewMLObserver::HandleMediaL()"); @@ -489,22 +465,22 @@ GLX_DEBUG2("GridMLObserver::HandlePopulatedL() iMediaList.Count()=%d", iMediaList.Count()); - + if (iMediaList.Count() <= 0) { GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetEmptyTextL()"); iHgGrid->DrawNow(); } - + GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetDefaultIconL()"); SetDefaultIconL(ETrue); } } - + // ---------------------------------------------------------------------------- // HandleItemModifiedL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::HandleItemModifiedL(const RArray& aItemIndexes, MGlxMediaList* /*aList*/) { @@ -513,9 +489,9 @@ { TInt modifiedIndex = aItemIndexes[index]; iModifiedIndexes.AppendL(modifiedIndex); - } + } } - + // ---------------------------------------------------------------------------- // HasRelevantThumbnailAttribute // ---------------------------------------------------------------------------- @@ -530,7 +506,7 @@ iSpeedTnAttrib ); if ( qualityTn || speedTn ) { - GLX_DEBUG1("GridMLObserver::HasRelevantThumbnail() - TN avail"); + GLX_DEBUG1("GridMLObserver::HasRelevantThumbnail() - TN avail"); return ETrue; } return EFalse; @@ -540,7 +516,7 @@ // ---------------------------------------------------------------------------- // RefreshScreenL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::RefreshScreenL(TInt aItemIndex, const RArray& aAttributes) { @@ -566,11 +542,11 @@ firstIndex)) { GLX_DEBUG2("GridMLObserver::HandleAttributesAvailableL()" - " RefreshScreen - aItemIndex(%d)", aItemIndex); + " RefreshScreen - aItemIndex(%d)", aItemIndex); iHgGrid->RefreshScreen(aItemIndex); } } - + if (!iIsDefaultIconSet) { GLX_DEBUG1("GridMLObserver::HandleAttributesAvailableL()" @@ -589,17 +565,17 @@ if ( HasRelevantThumbnail(lastOnScreen) ) { GLX_DEBUG2("GridMLObserver::HandleAttributesAvailableL()" - " RefreshScreen - aItemIndex(%d)", aItemIndex); + " RefreshScreen - aItemIndex(%d)", aItemIndex); iHgGrid->RefreshScreen(aItemIndex); } else if (aItemIndex == lastOnScreen) { GLX_DEBUG2("GridMLObserver::HandleAttributesAvailableL()" - " RefreshScreen - lastOnScreen(%d)", lastOnScreen); + " RefreshScreen - lastOnScreen(%d)", lastOnScreen); iHgGrid->RefreshScreen(lastOnScreen); } } - + if (!iIsDefaultIconSet) { GLX_DEBUG1("GridMLObserver::HandleAttributesAvailableL()" @@ -608,12 +584,12 @@ } } } - - if (iModifiedIndexes.Count() > 0) + + if (iModifiedIndexes.Count() > 0) { for(TInt index = 0;index& aAttributes) { TRACER("CGlxGridViewMLObserver::UpdateItemsL()"); TInt mediaCount = iMediaList.Count(); const TGlxMedia& item = iMediaList.Item( aItemIndex ); TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match ); - + if (aAttributes.Find(KMPXMediaDrmProtected, match) != KErrNotFound) { if (item.IsDrmProtected()) @@ -651,9 +627,9 @@ * fix for EABI-7RKHDG * to show the invalid DRM icon */ - TMPXGeneralCategory cat = item.Category(); + TMPXGeneralCategory cat = item.Category(); TBool checkViewRights = (cat==EMPXImage); - + if(iDRMUtility->ItemRightsValidityCheckL(uri, checkViewRights)) { iHgGrid->ItemL(aItemIndex).SetFlags( @@ -665,11 +641,11 @@ CHgItem::EHgItemFlagsDrmRightsExpired); } } - else + else { - TMPXGeneralCategory cat = item.Category(); + TMPXGeneralCategory cat = item.Category(); TBool checkViewRights = (cat==EMPXImage); - + if(iDRMUtility->ItemRightsValidityCheckL(uri, checkViewRights)) { iHgGrid->ItemL(aItemIndex).SetFlags( @@ -684,7 +660,7 @@ } } } - + if (aAttributes.Find(KMPXMediaGeneralDate, match) != KErrNotFound) { TTime time(0); @@ -693,20 +669,20 @@ iHgGrid->ItemL(aItemIndex).SetTime(time); } } - + if (aAttributes.Find(KMPXMediaGeneralCategory, match) != KErrNotFound) { if (item.Category() == EMPXVideo) { iHgGrid->ItemL(aItemIndex).SetFlags(CHgItem::EHgItemFlagsVideo); } - } + } } - + // ---------------------------------------------------------------------------- // DisplayErrorNoteL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::DisplayErrorNoteL(TInt aError) { TRACER("CGlxGridViewMLObserver::DisplayErrorNoteL()"); @@ -720,7 +696,7 @@ // ---------------------------------------------------------------------------- // SetDefaultIconL // ---------------------------------------------------------------------------- -// +// void CGlxGridViewMLObserver::SetDefaultIconL(TBool aTransparent) { TRACER("CGlxGridViewMLObserver::SetDefaultIconL()"); @@ -735,7 +711,7 @@ TSize bmpSize = CHgGrid::PreferredImageSize(); bitmap->Create(bmpSize, EColor16M); mask->Create(bmpSize, EGray256); // Gray mask - const TInt scanlineLength = bmpSize.iWidth; // 1 byte per pixel + const TInt scanlineLength = bmpSize.iWidth; // 1 byte per pixel RBuf8 maskData; maskData.Create(scanlineLength); maskData.FillZ(scanlineLength); // Init with zero @@ -750,7 +726,7 @@ mask->EndDataAccess(); iHgGrid->SetDefaultIconL(CGulIcon::NewL(bitmap, mask)); CleanupStack::Pop(mask); - CleanupStack::Pop(bitmap); + CleanupStack::Pop(bitmap); } else if (!iIsDefaultIconSet) { diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp --- a/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -182,6 +182,22 @@ { TRACER("CGlxListViewImp::DoMLViewActivateL"); + TUint transitionID = (iUiUtility->ViewNavigationDirection()== + EGlxNavigationForwards)?KActivateTransitionId:KDeActivateTransitionId; + + //Do the activate animation only for views other than mainlist view and + //on backward navigation from any other views to main list view, since + //for the app start the animation effect is by default provided. + if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot || + transitionID == KDeActivateTransitionId) + { + GfxTransEffect::BeginFullScreen( transitionID, TRect(), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( KPhotosUid, + AknTransEffect::TParameter::EEnableEffects) ); + GfxTransEffect::EndFullScreen(); + } + iNextViewActivationEnabled = ETrue; if(StatusPane()) { @@ -290,23 +306,6 @@ CreateListL(); iProgressIndicator = CGlxProgressIndicator::NewL(*this); iMMCNotifier = CGlxMMCNotifier::NewL(*this); - - TUint transitionID = (iUiUtility->ViewNavigationDirection()== - EGlxNavigationForwards)?KActivateTransitionId:KDeActivateTransitionId; - - //Do the activate animation only for views other than mainlist view and - //on backward navigation from any other views to main list view, since - //for the app start the animation effect is by default provided. - if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot || - transitionID == KDeActivateTransitionId) - { - GfxTransEffect::BeginFullScreen( transitionID, TRect(), - AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( KPhotosUid, - AknTransEffect::TParameter::EEnableEffects) ); - iIsTransEffectStarted = ETrue; - } - } // --------------------------------------------------------------------------- @@ -633,12 +632,6 @@ if (iMediaList->FocusIndex() != EGlxListItemAll || iMediaList->IdSpaceId( 0) != KGlxIdSpaceIdRoot) { - // Delete the bitmap; otherwise this memory will be leaked - if (aBitmap) - { - delete aBitmap; - aBitmap = NULL; - } GLX_LOG_INFO("CGlxListViewImp::PreviewTNReadyL()- Ignore!"); return; } @@ -722,6 +715,16 @@ HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); iList->SetEmptyTextL(*emptyText); CleanupStack::PopAndDestroy(emptyText); + + //While coming back to main listview + TGlxIdSpaceId id = iMediaList->IdSpaceId(0); + if((id == KGlxIdSpaceIdRoot) && (mediaCount > 0)) + { + for (TInt i = 0; i < mediaCount; i++) + { + SetDefaultThumbnailL(i); + } + } } //Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view @@ -739,18 +742,11 @@ if (mediaCount) { - TGlxIdSpaceId id = iMediaList->IdSpaceId(0); - for (TInt i=0; iItem(i); iList->ItemL(i).SetTitleL(item.Title()); iList->ItemL(i).SetTextL(item.SubTitle()); - // Set the default TNs for the main listview - if (id == KGlxIdSpaceIdRoot) - { - SetDefaultThumbnailL(i); - } } GLX_DEBUG3("CGlxListViewImp::CreateListL() Medialist Count = %d, " "iLastFocusIndex %d",mediaCount,iLastFocusedIndex); diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp --- a/photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -153,11 +153,9 @@ if (value) { CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; - CleanupStack::PushL(bitmap); ScaleBitmapToListSizeL(value->iBitmap, bitmap); GLX_LOG_INFO1("iObserver.PreviewTNReadyL() iTrialCount=%d", iTrialCount); iObserver.PreviewTNReadyL(bitmap, NULL); - CleanupStack::Pop(bitmap); } else { diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/data/glxmetadatadialog.rss --- a/photosgallery/viewframework/views/metadatadialog/data/glxmetadatadialog.rss Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/data/glxmetadatadialog.rss Wed Oct 13 14:32:09 2010 +0300 @@ -217,9 +217,11 @@ { items= { + MENU_ITEM { command = KGlxViewBoundMenuCommandId; txt = qtn_lgal_options_view; }, + MENU_ITEM { command = EGlxCmdAiwShowMap; txt = qtn_lgal_option_show_on_map;}, MENU_ITEM { command = KGlxDeleteBoundMenuCommandId; txt = qtn_lgal_options_delete;flags = EEikMenuItemSpecific; }, MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; } - }; + }; } // ----------------------------------------------------------------------------- @@ -435,9 +437,9 @@ }, AVKON_SETTING_ITEM { - identifier = EImgVwrMimeTypeItem; + identifier = EImgVwrDescriptionItem; setting_page_resource = r_metadata_name_settings_page; - name = qtn_lgal_details_type; + name = qtn_lgal_details_description; empty_item_text = " "; }, AVKON_SETTING_ITEM diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h --- a/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h Wed Oct 13 14:32:09 2010 +0300 @@ -11,9 +11,15 @@ * * Contributors: * -* Description: Image viewer metadata dialog container implementation +* Description: * */ +/* + * glximgvwrmetadatacontainer.h + * + * Created on: Oct 22, 2009 + * Author: sourbasu + */ #ifndef GLXIMGVWRMETADATACONTAINER_H_ #define GLXIMGVWRMETADATACONTAINER_H_ @@ -43,117 +49,120 @@ public MGlxMediaListObserver { -public: - // Constructors and destructor +public: // Constructors and destructor + void ViewDynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane); /** - * Symbian standard tow phase construction.Construct object of CGlxImgVwrMetadataContainer object. - * - * @param aRect rect for control - * @param aMediaList media list - * @return Metadata container object - */ - static CGlxImgVwrMetadataContainer* NewL(const TRect& aRect, - const TDesC& aUri); - + * Symbian standard tow phase construction.Construct object of CGlxImgVwrMetadataContainer object. + * + * @param aRect rect for control + * @param aMediaList media list + * @return Metadata container object + */ + static CGlxImgVwrMetadataContainer* NewL( const TRect& aRect,const TDesC& aUri); + /** - * Symbian standard tow phase construction.Construct object of CGlxImgVwrMetadataContainer object. - * - * @param aRect rect for control - * @param aMediaList media list - * @return Metadata container object - */ - static CGlxImgVwrMetadataContainer* NewLC(const TRect& aRect, - const TDesC& aUri); - + * Symbian standard tow phase construction.Construct object of CGlxImgVwrMetadataContainer object. + * + * @param aRect rect for control + * @param aMediaList media list + * @return Metadata container object + */ + static CGlxImgVwrMetadataContainer* NewLC( const TRect& aRect,const TDesC& aUri); + /** - * Destructor - */ + * Destructor + */ ~CGlxImgVwrMetadataContainer(); -public: - - // @ref CAknSettingItemList::CreateSettingItemL - CAknSettingItem* CreateSettingItemL(TInt aIdentifier); - - // @ref CAknSettingItemList::HandleListBoxEventL - void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); - void HandleListboxChangesL(); - - //Change MSK +public: + + // @ref CAknSettingItemList::CreateSettingItemL + CAknSettingItem* CreateSettingItemL(TInt aIdentifier); + + // @ref CAknSettingItemList::HandleListBoxEventL + void HandleListBoxEventL(CEikListBox* aListBox, + TListBoxEvent aEventType); + void HandleListboxChangesL(); + + //Enable disble the options based on the current selected item + TBool IsItemModifiable(); + //Change MSK void ChangeMskL(); - //Enable marquee support void EnableMarqueingL(); - + + + + public: - //MedialistObserver APIS - void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, - MGlxMediaList* aList); - void - HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, - MGlxMediaList*/* aList */); - void HandleAttributesAvailableL(TInt aItemIndex, const RArray< - TMPXAttribute>& aAttributes, MGlxMediaList* aList); - void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, - TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList); - void HandleItemSelectedL(TInt aIndex, TBool aSelected, - MGlxMediaList* aList); - void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); - void HandleError(TInt aError); - void HandleCommandCompleteL(CMPXCommand* aCommandResult, TInt aError, - MGlxMediaList* aList); - void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); - void HandleItemModifiedL(const RArray& aItemIndexes, - MGlxMediaList* aList); - MGlxMediaList& MediaList(); - void HandleCommandCompleteL(TAny* aSessionId, - CMPXCommand* /*aCommandResult*/, TInt aError, - MGlxMediaList* aList); + //MedialistObserver APIS + void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); + void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); + void HandleAttributesAvailableL( TInt aItemIndex, + const RArray& aAttributes, MGlxMediaList* aList ); + void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, + TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList ); + void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList ); + void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); + void HandleError( TInt aError ); + void HandleCommandCompleteL( CMPXCommand* aCommandResult, TInt aError, + MGlxMediaList* aList ); + void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); + void HandleItemModifiedL( const RArray& aItemIndexes, MGlxMediaList* aList ); + void HandleErrorL(); + MGlxMediaList& MediaList(); + void HandleCommandCompleteL(TAny* aSessionId, + CMPXCommand* /*aCommandResult*/, TInt aError, MGlxMediaList* aList); private: - /** - * C++ constructor. - * - * @param aMediaList media list - */ - CGlxImgVwrMetadataContainer(const TDesC& aUri); - - /** - * Symbian 2nd phase constructor - * @param aRect rect for this control - */ - void ConstructL(const TRect& aRect); - void CreateMediaListForSelectedItemL(); - void SetAttributesL(TMPXAttribute attribute); - void EditItemL(TInt aIndex, TBool aCalledFromMenu); - void SetLicenseItemVisibilityL(); + /** + * C++ constructor. + * + * @param aMediaList media list + */ + CGlxImgVwrMetadataContainer(const TDesC& aUri); + + /** + * Symbian 2nd phase constructor + * @param aRect rect for this control + */ + void ConstructL( const TRect& aRect); + void CreateMediaListForSelectedItemL(); + void SetAttributesL(TMPXAttribute attribute); + void EditItemL(TInt aIndex, TBool aCalledFromMenu); + void SetNameDescriptionL(TInt aItem); + void SetDurationLIicenseItemVisibilityL(); + TBool IsLicenseItem(); - /** - * Create Image Viewer manager Instance - */ - void CreateImageViewerInstanceL(); - - /** - * Delete Image Viewer manager Instance - */ - void DeleteImageViewerInstance(); + /** + * Create Image Viewer manager Instance + */ + void CreateImageViewerInstanceL(); + + /** + * Delete Image Viewer manager Instance + */ + void DeleteImageViewerInstance(); -private: - //data - //Flag to check if the item is a video. - TBool iVideo; - //To check if marquee is enabled. - TBool iMarquee; - //to set visible license items based on the Item. - TBool iSetVisible; - RBuf iTextSetter; - const TDesC& iUri; - MGlxMediaList* iItemMediaList; - CGlxAttributeContext* iMainListAttributecontext; - TGlxSelectionIterator iSelectionIterator; - // For image viewer, not own - CGlxImageViewerManager* iImageViewerInstance; + +private: //data + + //Flag to check if the item is a video. + TBool iVideo; + //To check if marquee is enabled. + TBool iMarquee; + //to set visible license items based on the Item. + TBool iSetVisible; + RBuf iTextSetter; + const TDesC& iUri ; + MGlxMediaList* iItemMediaList; + CGlxAttributeContext* iMainListAttributecontext; + TGlxSelectionIterator iSelectionIterator; + // For image viewer, not own + CGlxImageViewerManager* iImageViewerInstance; }; + + #endif /* GLXIMGVWRMETADATACONTAINER_H_ */ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatadialog.h --- a/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatadialog.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatadialog.h Wed Oct 13 14:32:09 2010 +0300 @@ -25,41 +25,41 @@ // SYSTEM INCLUDES #include +#include #include - +// FORWARD DECLARATIONS +class CGlxMetadataCommandHandler; +class CGlxCommandHandlerAddToContainer; +class CGlxUiUtility; // CLASS DECLARATION /** * CGlxImgVwrMetadataDialog * - * Image Viewer Metadata dialog implementation + * Metadata dialog implementation */ class CGlxImgVwrMetadataDialog : public CAknDialog + { -public: - // Constructors and destructor +public: // Constructors and destructor /** * Two-phased constructor. * * @param aURI uri or file name of item */ - IMPORT_C static CGlxImgVwrMetadataDialog* NewL(const TDesC& aUri); + IMPORT_C static CGlxImgVwrMetadataDialog* NewL( const TDesC& aUri ); /** * Destructor. */ virtual ~CGlxImgVwrMetadataDialog(); -private: - /** - * Constructor. - * @param aURI uri or file name of item - */ +private : CGlxImgVwrMetadataDialog(const TDesC& aUri); -public: - // Functions from base classes + +public: // Functions from base classes /** * Initializes the dialog and calls CAknDialog's @@ -71,64 +71,105 @@ */ IMPORT_C TInt ExecuteLD(); -protected: + +protected: // Functions from base classes + /** * From MEikCommandObserver Prosesses menucommands * * @param aCommandId Commant value defined in resources. */ - void ProcessCommandL(TInt aCommandId); + void ProcessCommandL( TInt aCommandId ); + + /** + * From MEikMenuObserver Initializes items on the menu + * + * @param aMenuId Current menu's resource Id + * @param aMenuPane Pointer to menupane + */ + void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane); + //hanldes orientation changes. + void HandleResourceChange( TInt aType ); + void SizeChanged(); -private: +private: + /** + * Initializes the dialog's controls before the dialog is sized and + * layed out. Empty by default. + */ + void PreLayoutDynInitL(); + + /** + * Initializes the dialog's controls after the dialog has been sized + * but before it has been activated. + */ + void PostLayoutDynInitL(); /** * Symbian 2nd phase constructor. + * + * @param aURI */ void ConstructL(); /** + * Constructs the Alf Environment and display + */ + void ConstructAlfEnvL(); + + /** * Initalise the resource + * */ - void InitResourceL(); + void InitResourceL(); + + /** + * To deal with any specific commands + * + * @param aCommand The command to respond to + * @return ETrue if the command has been handled. + * + */ + TBool HandleViewCommandL(TInt aCommand); + + private: + + void Draw( const TRect& /*aRect*/ ) const; + void HandlePointerEventL(const TPointerEvent& aPointerEvent); /** * SetTitleL * Sets title for view * @param aTitleText title of view to be set */ - void SetTitleL(const TDesC& aTitleText); + void SetTitleL(const TDesC& aTitleText); /** * SetPreviousTitleL * Sets title of previous view */ void SetPreviousTitleL(); - /** - * Sets the dialog toolbar visibility - * @param aVisible - ETrue for visible; EFalse otherwise. - */ void SetDetailsDlgToolbarVisibility(TBool aVisible); -public: - // from MEikDialogPageObserver +public: // from MEikDialogPageObserver /** * @ref MEikDialogPageObserver::CreateCustomControlL */ SEikControlInfo CreateCustomControlL(TInt aControlType); public: - /** - * Handles the toolbar visiblity to be in sync with the calling app - * @param aVisible - ETrue for visible; EFalse otherwise. - */ + /* + * + */ void HandleToolbarResetting(TBool aVisible); -private: - //data +private: //data + TInt iResourceOffset; TBool iStatusPaneAvailable; - HBufC* iPreviousTitle; - const TDesC& iUri; + CGlxUiUtility* iUiUtility; + HBufC* iPreviousTitle; + const TDesC& iUri; CGlxImgVwrMetadataContainer* iContainer; }; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/inc/glxmetadatacontainer.h --- a/photosgallery/viewframework/views/metadatadialog/inc/glxmetadatacontainer.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/inc/glxmetadatacontainer.h Wed Oct 13 14:32:09 2010 +0300 @@ -96,6 +96,7 @@ //Enable disble the options based on the current selected item TBool IsItemModifiable(); + TBool IsLicenseItem(); TBool IsLocationItem(); //Delete the location information @@ -217,8 +218,6 @@ //Flag to indicate rename command is started TBool iRenameStarted; - // Flag to indicate text entry popup display status - TBool iIsPopupShown; }; #endif //C_GLXMETADATACONTAINER_H__ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/inc/glxmetadatadialog.h --- a/photosgallery/viewframework/views/metadatadialog/inc/glxmetadatadialog.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/inc/glxmetadatadialog.h Wed Oct 13 14:32:09 2010 +0300 @@ -127,9 +127,18 @@ * @param aMenuPane Pointer to menupane */ void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane); + //hanldes orientation changes. + void HandleResourceChange( TInt aType ); + void SizeChanged(); private: /** + * Initializes the dialog's controls before the dialog is sized and + * layed out. Empty by default. + */ + void PreLayoutDynInitL(); + + /** * Initializes the dialog's controls after the dialog has been sized * but before it has been activated. */ @@ -142,6 +151,11 @@ void ConstructL(); /** + * Constructs the Alf Environment and display + */ + void ConstructAlfEnvL(); + + /** * Initalise the resource * */ @@ -163,6 +177,8 @@ MGlxMediaList& MediaList(); private: + + void Draw( const TRect& /*aRect*/ ) const; void HandlePointerEventL(const TPointerEvent& aPointerEvent); /** * SetTitleL @@ -175,23 +191,14 @@ * Sets title of previous view */ void SetPreviousTitleL(); - - /** - * Sets the dialog toolbar visibility - * @param aVisible - ETrue for visible; EFalse otherwise. + /** + * Find out the items nature to set the corresponding options */ + void OnLocationEditL(); + void AddTagL(); + void AddAlbumL(); void SetDetailsDlgToolbarVisibility(TBool aVisible); - -public: - // from MGlxMetadataDialogObserver - /** - * Find out the items nature to set the corresponding options - */ - void OnLocationEditL(); - void AddTagL(); - void AddAlbumL(); - void HandleItemRemovedL(); - + public: // from MEikDialogPageObserver /** * @ref MEikDialogPageObserver::CreateCustomControlL diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/inc/mglxmetadatadialogobserver.h --- a/photosgallery/viewframework/views/metadatadialog/inc/mglxmetadatadialogobserver.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/inc/mglxmetadatadialogobserver.h Wed Oct 13 14:32:09 2010 +0300 @@ -34,7 +34,6 @@ virtual void OnLocationEditL() = 0; virtual void AddTagL() = 0; virtual void AddAlbumL() = 0; - virtual void HandleItemRemovedL() = 0; }; #endif /*MGLXMETADATADIALOGOBSERVER_H_*/ diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -1,43 +1,68 @@ /* - * 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" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". +* 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" +* 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: +* +*/ +/* + * glximgvwrmetadatacontainer.cpp * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Image viewer metadata dialog implementation + * Created on: Oct 22, 2009 + * Author: sourbasu */ + #include "glximgvwrmetadatacontainer.h" #include "glxustringconverter.h" // converts the symbian types to UString type +#include #include #include +#include #include #include #include #include //Details data provider #include +#include // For CGlxCommandHandlerAddToContainer +#include // for command handler id +#include //for command factory #include // Content ID identifying general category of content provided + +#include +#include +#include +#include // tag collection plugin uid +#include // KGlxMediaIdThumbnail #include // CGlxAttributeReteiver +#include #include //For launching DRM details pane -#include +#include // General utilties class definition +#include +#include //For CExifModify #include #include -#include -#include // For marquee -#include // For marquee +#include + +//marquee -const TInt KMediaListId = 0x2000D248; -const TInt KMarqueeLoopCount = 3; -const TInt KMarqueeScrollAmount = 20; -const TInt KMarqueeScrollDelay = 1000000; -const TInt KMarqueeScrollInterval = 200000; +#include +#include +const TInt KMaxMediaPopupTitleLength = 0x100; +const TInt KMediaListId = 0x2000D248; +const TInt KMarqueeLoopCount = 3; +const TInt KMarqueeScrollAmount = 20; +const TInt KMarqueeScrollDelay = 1000000; +const TInt KMarqueeScrollInterval = 200000; // ============================ MEMBER FUNCTIONS =============================== @@ -45,12 +70,10 @@ // NewL // --------------------------------------------------------- // -CGlxImgVwrMetadataContainer* CGlxImgVwrMetadataContainer::NewL( - const TRect& aRect, const TDesC& item) +CGlxImgVwrMetadataContainer* CGlxImgVwrMetadataContainer::NewL( const TRect& aRect,const TDesC& item) { - TRACER("CGlxImgVwrMetadataContainer::NewL"); - CGlxImgVwrMetadataContainer* self = CGlxImgVwrMetadataContainer::NewLC( - aRect, item); + TRACER("CGlxImgVwrMetadataContainer::NewL"); + CGlxImgVwrMetadataContainer* self = CGlxImgVwrMetadataContainer::NewLC( aRect,item); CleanupStack::Pop(self); return self; } @@ -59,14 +82,12 @@ // NewLC // --------------------------------------------------------- // -CGlxImgVwrMetadataContainer* CGlxImgVwrMetadataContainer::NewLC( - const TRect& aRect, const TDesC& aUri) +CGlxImgVwrMetadataContainer* CGlxImgVwrMetadataContainer::NewLC( const TRect& aRect,const TDesC& aUri) { - TRACER("CGlxImgVwrMetadataContainer::NewLC"); - CGlxImgVwrMetadataContainer* self = - new (ELeave) CGlxImgVwrMetadataContainer(aUri); + TRACER("CGlxImgVwrMetadataContainer::NewLC"); + CGlxImgVwrMetadataContainer* self = new(ELeave) CGlxImgVwrMetadataContainer(aUri); CleanupStack::PushL(self); - self->ConstructL(aRect); + self->ConstructL( aRect); return self; } @@ -74,18 +95,18 @@ // CGlxImgVwrMetadataContainer // --------------------------------------------------------- // -CGlxImgVwrMetadataContainer::CGlxImgVwrMetadataContainer( - const TDesC& aUri) : iUri(aUri) - { - // No implementation - } +CGlxImgVwrMetadataContainer::CGlxImgVwrMetadataContainer(const TDesC& aUri) +:iUri(aUri) + { + // No implementation + } // --------------------------------------------------------- // CGlxImgVwrMetadataContainer::ConstructL // --------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::ConstructL(const TRect& /*aRect*/) - { +void CGlxImgVwrMetadataContainer::ConstructL( const TRect& /*aRect*/ ) + { TRACER("CGlxMetadataContainer::ConstructLL()"); //Creating the RBuf texts for all the items except tags & albums //which would be updated as whne the item is edited @@ -100,19 +121,19 @@ CGlxImgVwrMetadataContainer::~CGlxImgVwrMetadataContainer() { TRACER("CGlxImgVwrMetadataContainer::~CGlxImgVwrMetadataContainer"); - if (iItemMediaList) + if( iItemMediaList ) { iItemMediaList->RemoveContext(iMainListAttributecontext); iItemMediaList->RemoveMediaListObserver(this); iItemMediaList->Close(); - iItemMediaList = NULL; - } - if (iMainListAttributecontext) + iItemMediaList = NULL; + } + if( iMainListAttributecontext ) { delete iMainListAttributecontext; iMainListAttributecontext = NULL; } - if (IsVisible()) + if( IsVisible() ) { MakeVisible(EFalse); } @@ -126,38 +147,43 @@ { TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); //returns the active medialist. - return *iItemMediaList; + return *iItemMediaList; } //----------------------------------------------------------------------------- // CGlxImgVwrMetadataContainer::CreateSettingItemL //----------------------------------------------------------------------------- -CAknSettingItem* CGlxImgVwrMetadataContainer::CreateSettingItemL( - TInt aResourceId) +CAknSettingItem* CGlxImgVwrMetadataContainer::CreateSettingItemL(TInt aResourceId) { - TRACER("CGlxImgVwrMetadataContainer::CreateSettingItemL"); + TRACER("CGlxImgVwrMetadataContainer::CreateSettingItemL"); CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack - iTextSetter.Zero(); + iTextSetter.Zero(); //Creating a empty Settings list box which will be populated with metadata in handleattributeavailable - switch (aResourceId) + switch(aResourceId) { case EImgVwrNameItem: case EImgVwrDateAndTimeItem: - case EImgVwrMimeTypeItem: - case EImgVwrSizeItem: + case EImgVwrDescriptionItem: + { + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); + + break; + } + case EImgVwrSizeItem: case EImgVwrResolutionItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTextSetter); + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); - break; - } + break; + } case EImgVwrlicenseItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTextSetter); + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); //Hide the item until we get the attributes //where in we check for the usage rights. settingItem->SetHidden(ETrue); @@ -168,65 +194,57 @@ default: { - break; + break; } } return settingItem; } +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataContainer::IsItemModifiable +//----------------------------------------------------------------------------- +TBool CGlxImgVwrMetadataContainer::IsItemModifiable() + { + TRACER("CGlxMetadataContainer::IsItemModifiable()"); + //Only items like name , description, tag and albums are modifiable + //The check is for the items from ENameItem(0) tille ETagsItem(4) + if(ListBox()->CurrentItemIndex()<=ETagsItem) + { + return EFalse; + } + //return ETrue to dim the item + return ETrue; + + } //----------------------------------------------------------------------------- // CGlxImgVwrMetadataContainer::HandleListBoxEventL //----------------------------------------------------------------------------- -void CGlxImgVwrMetadataContainer::HandleListBoxEventL( - CEikListBox* /*aListBox*/, TListBoxEvent aEventType) +void CGlxImgVwrMetadataContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, + TListBoxEvent aEventType) { - TRACER("CGlxImgVwrMetadataContainer::HandleListBoxEventL()"); + TRACER("CGlxMetadataContainer::HandleListBoxEventL()"); + GLX_LOG_INFO("CGlxImgVwrMetadataContainer::HandleListBoxEventL"); if (aEventType == EEventItemSingleClicked) { - if (iItemMediaList->Count() == 0) + if(iItemMediaList->Count() == 0) { - GLX_LOG_INFO("CGlxImgVwrMetadataContainer:: NO Items"); + GLX_LOG_INFO("CGlxImgVwrMetadataContainer:: NO Items"); return; } - TInt index = ListBox()->CurrentItemIndex(); - if (EImgVwrlicenseItem == index) + TInt index = ListBox()->CurrentItemIndex() ; + if(EImgVwrlicenseItem == index) { - GLX_LOG_INFO("CGlxImgVwrMetadataContainer::Licence item"); + GLX_LOG_INFO("CGlxImgVwrMetadataContainer::Licence item"); CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); CleanupClosePushL(*drmUtility); CreateImageViewerInstanceL(); - if (iImageViewerInstance->IsPrivate()) + if(iImageViewerInstance->IsPrivate()) { - RFile64& fileHandle = iImageViewerInstance->ImageFileHandle(); - // check if rights have expired - TBool expired = EFalse; - expired = !drmUtility->ItemRightsValidityCheckL(fileHandle, - ETrue); - - if (expired) - { - drmUtility->ShowRightsInfoL(fileHandle); - } - else - { - drmUtility->ShowDRMDetailsPaneL(fileHandle); - } + drmUtility->ShowDRMDetailsPaneL(iImageViewerInstance->ImageFileHandle()); } else { - const TDesC& uri = iItemMediaList->Item(0).Uri(); - // check if rights have expired - TBool expired = EFalse; - expired = !drmUtility->ItemRightsValidityCheckL(uri, ETrue); - - if (expired) - { - drmUtility->ShowRightsInfoL(uri); - } - else - { - drmUtility->ShowDRMDetailsPaneL(uri); - } + drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri()); } CleanupStack::PopAndDestroy(drmUtility); DeleteImageViewerInstance(); @@ -234,128 +252,139 @@ } } +// ---------------------------------------------------------------------------- +// CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL +// ---------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane) + { + TRACER("CGlxMetadataContainer::ViewDynInitMenuPaneL()"); + if( aMenuId == R_METADATA_MENU ) + { + //Set dim the options based on the utem selected + //Viewdetails option will be availble only for the license item + aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem()); + } + } + //Medialist callbacks. // ---------------------------------------------------------------------------- // CGlxImgVwrMetadataContainer::HandleAttributesAvailableL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleAttributesAvailableL( - TInt /*aItemIndex*/, const RArray& aAttributes, - MGlxMediaList* aList) +void CGlxImgVwrMetadataContainer::HandleAttributesAvailableL( TInt /*aItemIndex*/, + const RArray& aAttributes, MGlxMediaList* aList ) { TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); //generic medialist for the item for all the attributes required other than tags and albums. TInt x = aAttributes.Count(); - if (aList == iItemMediaList) + if(aList == iItemMediaList) { // Loop untill it checks for all the avialable attributes - for (TInt i = aAttributes.Count() - 1; i >= 0; i--) + for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--) { //set attributes to the items in the container - SetAttributesL(aAttributes[i]); + SetAttributesL(aAttributes[i]); } } + } // ---------------------------------------------------------------------------- // HandleItemAddedL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleItemAddedL(TInt /*aStartIndex*/, - TInt /*aEndIndex*/, MGlxMediaList* aList) +void CGlxImgVwrMetadataContainer::HandleItemAddedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, + MGlxMediaList* aList ) { TRACER("CGlxMetadataContainer::HandleItemAddedL()"); - if (!iMarquee) + if(!iMarquee) { - EnableMarqueingL(); + EnableMarqueingL(); } - SetLicenseItemVisibilityL(); - if (aList == iItemMediaList) + SetDurationLIicenseItemVisibilityL(); + if(aList == iItemMediaList) { - if (iItemMediaList->Count()) + if(iItemMediaList->Count()) { TGlxMedia item = iItemMediaList->Item(0); - CGlxUStringConverter* stringConverter = - CGlxUStringConverter::NewL(); - CleanupStack::PushL(stringConverter); - for (TInt index = 0; index <= EImgVwrlicenseItem; index++) + CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); + CleanupStack::PushL(stringConverter ); + for(TInt index = 0; index <= EImgVwrlicenseItem; index++) { - HBufC* string = NULL; - iTextSetter.Zero(); + HBufC* string = NULL; + iTextSetter.Zero(); - if (index == EImgVwrSizeItem) + if(index == EImgVwrSizeItem) { - stringConverter->AsStringL(item, KMPXMediaGeneralSize, 0, - string); + stringConverter->AsStringL(item, + KMPXMediaGeneralSize,0, string ); } - else if (index == EImgVwrNameItem) - { - stringConverter->AsStringL(item, KMPXMediaGeneralTitle, - 0, string); - } - else if (index == EImgVwrDateAndTimeItem) + else if(index == EImgVwrNameItem) { stringConverter->AsStringL(item, - KGlxMediaGeneralLastModifiedDate, - R_QTN_DATE_USUAL_WITH_ZERO, string); + KMPXMediaGeneralTitle,0, string ); } - else if (index == EImgVwrMimeTypeItem) - { - stringConverter->AsStringL(item, - KMPXMediaGeneralMimeType, 0, string); + else if(index == EImgVwrDateAndTimeItem) + { + stringConverter->AsStringL( item, + KGlxMediaGeneralLastModifiedDate, + R_QTN_DATE_USUAL_WITH_ZERO,string ); } - else if (index == EImgVwrResolutionItem) + else if(index == EImgVwrDescriptionItem) { stringConverter->AsStringL(item, - KGlxMediaGeneralDimensions, 0, string); + KMPXMediaGeneralComment,0, string ); } - else if (index == EImgVwrlicenseItem) + else if(index == EImgVwrResolutionItem) { - // If an item is DRM protected, License field in details - // should display "View Details" - string = StringLoader::LoadL( - R_GLX_METADATA_VIEW_OPTIONS_VIEW); - } - else + stringConverter->AsStringL(item, + KGlxMediaGeneralDimensions,0, string ); + } + else if(index == EImgVwrlicenseItem) + { + // If an item is DRM protected, License field in details + // should display "View Details" + string = StringLoader::LoadL(R_GLX_METADATA_VIEW_OPTIONS_VIEW); + } + else { //no implementation - } - if (string) + } + if(string) { iTextSetter.Zero(); iTextSetter.Append(*string); } - CleanupStack::PushL(string); - EditItemL(index, EFalse); - CleanupStack::PopAndDestroy(string); + CleanupStack::PushL( string ); + EditItemL(index,EFalse); + CleanupStack::PopAndDestroy(string ); } - CleanupStack::PopAndDestroy(stringConverter); - } + CleanupStack::PopAndDestroy(stringConverter ); + } } + + } - // ---------------------------------------------------------------------------- // EnableMarqueingL // ---------------------------------------------------------------------------- // void CGlxImgVwrMetadataContainer::EnableMarqueingL() { - TRACER("CGlxImgVwrMetadataContainer::EnableMarqueingL()"); + TRACER("CGlxImgVwrMetadataContainer::EnableMarqueingL()"); iMarquee = ETrue; ListBox()->UseLogicalToVisualConversion(ETrue); - ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams( - KMarqueeLoopCount, KMarqueeScrollAmount, KMarqueeScrollDelay, - KMarqueeScrollInterval); + ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams (KMarqueeLoopCount, + KMarqueeScrollAmount, KMarqueeScrollDelay, KMarqueeScrollInterval); ListBox()->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue); - } - + } // ---------------------------------------------------------------------------- // HandleCommandCompleteL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleCommandCompleteL( - TAny* /*aSessionId*/, CMPXCommand* /*aCommandResult*/, - TInt /*aError*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleCommandCompleteL(TAny* /*aSessionId*/, + CMPXCommand* /*aCommandResult*/, TInt /*aError*/, MGlxMediaList* /*aList*/) { TRACER("CGlxImgVwrMetadataContainer::HandleCommandCompleteL()"); } @@ -364,58 +393,63 @@ // HandleItemRemoved // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleItemRemovedL(TInt /*aStartIndex*/, - TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleItemRemovedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, + MGlxMediaList* /*aList*/ ) { - TRACER("CGlxImgVwrMetadataContainer::HandleItemRemovedL()"); - } - + TRACER("CGlxImgVwrMetadataContainer::HandleItemRemovedL()"); + } // ---------------------------------------------------------------------------- // HandleFocusChangedL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleFocusChangedL( - NGlxListDefs::TFocusChangeType /*aType*/, TInt /*aNewIndex*/, - TInt /*aOldIndex*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleFocusChangedL( NGlxListDefs:: + TFocusChangeType /*aType*/, TInt /*aNewIndex*/, TInt /*aOldIndex*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleFocusChangedL()"); } - // ---------------------------------------------------------------------------- // HandleItemSelected // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleItemSelectedL(TInt /*aIndex*/, - TBool /*aSelected*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleItemSelectedL(TInt /*aIndex*/, + TBool /*aSelected*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleItemSelectedL"); } - // ---------------------------------------------------------------------------- // HandleMessageL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleMessageL( - const CMPXMessage& /*aMessage*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleMessageL( const CMPXMessage& /*aMessage*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleMessageL()"); } - // ---------------------------------------------------------------------------- // HandleError // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleError(TInt /*aError*/) +void CGlxImgVwrMetadataContainer::HandleError( TInt /*aError*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleError()"); + TRAP_IGNORE(HandleErrorL()); } // ---------------------------------------------------------------------------- +// HandleErrorL +// ---------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataContainer::HandleErrorL() + { + TRACER("CGlxImgVwrMetadataContainer::HandleErrorL()"); + } +// ---------------------------------------------------------------------------- // HandleCommandCompleteL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleCommandCompleteL( - CMPXCommand* /*aCommandResult*/, TInt /*aError*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, + TInt /*aError*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleCommandCompleteL()"); } @@ -424,8 +458,7 @@ // HandleMediaL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleMediaL(TInt /*aListIndex*/, - MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleMediaL( TInt /*aListIndex*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleMediaL()"); } @@ -434,40 +467,48 @@ // HandleItemModifiedL // ---------------------------------------------------------------------------- // -void CGlxImgVwrMetadataContainer::HandleItemModifiedL( - const RArray& /*aItemIndexes*/, MGlxMediaList* /*aList*/) +void CGlxImgVwrMetadataContainer::HandleItemModifiedL( const RArray& /*aItemIndexes*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxImgVwrMetadataContainer::HandleItemModifiedL()"); } - // ---------------------------------------------------------------------------- // ChangeMskL -// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// void CGlxImgVwrMetadataContainer::ChangeMskL() { - TRACER("CGlxImgVwrMetadataContainer::ChangeMskL()"); - CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); - CleanupClosePushL(*uiUtility); - switch (ListBox()->CurrentItemIndex()) + TRACER("CGlxImgVwrMetadataContainer::ChangeMsk()"); + TInt index = ListBox()->CurrentItemIndex(); + CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); + switch(index) { - case EImgVwrNameItem: - case EImgVwrMimeTypeItem: + case EImgVwrNameItem: + case EImgVwrDescriptionItem: + { + uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, + EAknSoftkeyEdit,R_GLX_METADATA_MSK_EDIT); + } + break; case EImgVwrDateAndTimeItem: case EImgVwrSizeItem: case EImgVwrResolutionItem: case EImgVwrlicenseItem: { - uiUtility->ScreenFurniture()->ModifySoftkeyIdL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - EAknSoftkeyEdit, R_GLX_METADATA_MSK_BLANK); - } + uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, + EAknSoftkeyEdit,R_GLX_METADATA_MSK_BLANK); + } break; default: { - break; + break; } } - CleanupStack::PopAndDestroy(uiUtility); + + if ( uiUtility ) + { + uiUtility->Close(); + } } //----------------------------------------------------------------------------- @@ -479,105 +520,103 @@ //create the collection path for the medialist to be created CMPXCollectionPath* path = CMPXCollectionPath::NewL(); - CleanupStack::PushL(path); - // Set the Image viewer collection path as the details dialog - // can be launched from private or user data path - path->AppendL(KGlxCollectionPluginImageViewerImplementationUid); + CleanupStack::PushL( path ); + //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI + path->AppendL(/*KGlxCollectionPluginAllImplementationUid*/KGlxCollectionPluginImageViewerImplementationUid); //create the filter with the URI - CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(iUri); - CleanupStack::PushL(filter); + CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(iUri); + CleanupStack::PushL( filter ); //create the medialist - iItemMediaList = MGlxMediaList::InstanceL(*path, TGlxHierarchyId( - KMediaListId), filter); + iItemMediaList = MGlxMediaList::InstanceL(*path,TGlxHierarchyId(KMediaListId),filter); //Add the attributes which are required to be displayed. - iMainListAttributecontext = new (ELeave) CGlxAttributeContext( - &iSelectionIterator); + iMainListAttributecontext = new (ELeave) CGlxAttributeContext(&iSelectionIterator); iMainListAttributecontext->AddAttributeL(KMPXMediaDrmProtected); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralSize); - iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralDimensions); + iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralDimensions); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralTitle); iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralLastModifiedDate); - iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralMimeType); + iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralComment); //Add Context so that we get the handleattributes call once the medialist is populated with above mentioned attributes. - iItemMediaList->AddContextL(iMainListAttributecontext, - KGlxFetchContextPriorityBlocking); + iItemMediaList->AddContextL( iMainListAttributecontext, + KGlxFetchContextPriorityBlocking ); //add to observer for callbacks. iItemMediaList->AddMediaListObserverL(this); - CleanupStack::PopAndDestroy(filter); - CleanupStack::PopAndDestroy(path); + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( path ); } - // ---------------------------------------------------------------------------- -// CGlxImgVwrMetadataContainer::SetAttributesL +// CGlxImgVwrMetadataContainer::SetAttributes // ---------------------------------------------------------------------------- // void CGlxImgVwrMetadataContainer::SetAttributesL(TMPXAttribute attribute) { - TRACER("CGlxImgVwrMetadataContainer::SetAttributesL"); + TRACER("CGlxImgVwrMetadataContainer::SetAttributesL"); - if (!iSetVisible) + if(!iSetVisible) { iSetVisible = ETrue; - SetLicenseItemVisibilityL(); + 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. CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); - CleanupStack::PushL(stringConverter); - HBufC* string = NULL; + CleanupStack::PushL(stringConverter ); + HBufC* string = NULL; //if attribute is date and time we need to pass the format it as R_QTN_DATE_USUAL_WITH_ZERO else null - if (attribute == KGlxMediaGeneralLastModifiedDate) + if(attribute == KGlxMediaGeneralLastModifiedDate) { - stringConverter->AsStringL(item, attribute, - R_QTN_DATE_USUAL_WITH_ZERO, string); - } + stringConverter->AsStringL(item, + attribute, + R_QTN_DATE_USUAL_WITH_ZERO, string ); + } else { - stringConverter->AsStringL(item, attribute, 0, string); + stringConverter->AsStringL(item, + attribute,0, string ); } //get the settings item based on the attribute and set the text. - if (string) + if ( string ) { iTextSetter.Zero(); iTextSetter.Append(*string); - if (attribute == KMPXMediaGeneralSize) + if(attribute == KMPXMediaGeneralSize) { - EditItemL(EImgVwrSizeItem, EFalse); - } - else if (attribute == KMPXMediaGeneralTitle) - { - EditItemL(EImgVwrNameItem, EFalse); - } - else if (attribute == KGlxMediaGeneralLastModifiedDate) + EditItemL(EImgVwrSizeItem,EFalse); + } + else if(attribute == KMPXMediaGeneralTitle) { - EditItemL(EImgVwrDateAndTimeItem, EFalse); + EditItemL(EImgVwrNameItem,EFalse); } - else if (attribute == KMPXMediaGeneralMimeType) + else if(attribute == KGlxMediaGeneralLastModifiedDate) + { + EditItemL(EImgVwrDateAndTimeItem,EFalse); + } + else if(attribute == KMPXMediaGeneralComment) { - EditItemL(EImgVwrMimeTypeItem, EFalse); + EditItemL(EImgVwrDescriptionItem,EFalse); } - else if (attribute == KGlxMediaGeneralDimensions) + else if(attribute == KGlxMediaGeneralDimensions) { - EditItemL(EImgVwrResolutionItem, EFalse); - } + EditItemL(EImgVwrResolutionItem,EFalse); + }/* else if(attribute == KMPXMediaDrmProtected) { - EditItemL(EImgVwrlicenseItem, EFalse); - } + EditItemL(EImgVwrlicenseItem,EFalse); + }*/ else { - //no implementation - } + + } delete string; string = NULL; } - CleanupStack::PopAndDestroy(stringConverter); + CleanupStack::PopAndDestroy(stringConverter ); } // ---------------------------------------------------------------------------- @@ -586,7 +625,7 @@ // void CGlxImgVwrMetadataContainer::EditItemL(TInt aIndex, TBool /*aCalledFromMenu*/) { - TRACER("CGlxImgVwrMetadataContainer::EditItemL"); + TRACER("CGlxImgVwrMetadataContainer::EditItemL"); CAknSettingItem* settingsitem = NULL; settingsitem = (*SettingItemArray())[aIndex]; settingsitem->LoadL(); @@ -595,30 +634,116 @@ ListBox()->DrawNow(); } + + // ---------------------------------------------------------------------------- -// CGlxImgVwrMetadataContainer::SetLicenseItemVisibilityL() +// CGlxMetadataContainer::SetAttributes // ---------------------------------------------------------------------------- -void CGlxImgVwrMetadataContainer::SetLicenseItemVisibilityL() +// +void CGlxImgVwrMetadataContainer::SetNameDescriptionL(TInt aItem) + { + TRACER("CGlxImgVwrMetadataContainer::SetNameDescriptionL"); + //This function is commn for updatng both name and description once modified + //get the item handle to be modified + CAknSettingItem* settingsitem = (*SettingItemArray())[aItem]; + HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); + (textBuf->Des()).Copy((settingsitem->SettingTextL())); + TPtr textPtr = textBuf->Des(); + TBuf titleText(*textBuf); + HBufC *buf = NULL; + if(aItem == ENameItem) + { + buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES); + } + else + { + buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_DESCRIPTION_NSERIES); + } + + //Launch the text entry editor. + CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL( *buf, textPtr ); + CleanupStack::PopAndDestroy(buf); + if(aItem == EImgVwrDescriptionItem) + { + popup->SetLeftSoftKeyL(ETrue); + } + + //action upon selecting ok from the editor + if ( popup->ExecuteLD() == EEikBidOk ) { - TRACER("CGlxMetadataContainer::SetLicenseItemVisibilityL()"); + if(0 != (titleText.Compare(*textBuf))) + { + //Modify the MDS and setting list only if the entry is different from previous Item value + iTextSetter.Zero(); + iTextSetter.Copy(*textBuf); + EditItemL(aItem,EFalse); + if( iItemMediaList->Count() > 0 ) + { + iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item + CMPXCollectionPath* path = iItemMediaList->PathLC(); + CMPXCommand* command = NULL; + //Create the glx command based on the item + if(aItem == ENameItem) + { + command = TGlxCommandFactory::RenameCommandLC(settingsitem->SettingTextL(), + *path); + } + else + { + command = TGlxCommandFactory::SetDescriptionCommandLC(settingsitem->SettingTextL(), + *path); + } + command->SetTObjectValueL(KMPXCommandGeneralSessionId, static_cast(this)); + //issue command to the medialist which further calls data source to update MDS + iItemMediaList->CommandL(*command); + CleanupStack::PopAndDestroy(command); + CleanupStack::PopAndDestroy(path); + } + } + } + CleanupStack::PopAndDestroy( textBuf ); + + } +// ---------------------------------------------------------------------------- +// CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() +// ---------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() + { + TRACER("CGlxMetadataContainer::SetDurationLIicenseItemVisibilityL()"); //get the media item. const TGlxMedia& item = iItemMediaList->Item(0); const CGlxMedia* media = item.Properties(); - // Check for DRM protection - if (media && media->IsSupported(KMPXMediaDrmProtected)) + //in order to check for video category and drm rights + + CAknSettingItem* hiddenItem = NULL; + + if( media && media->IsSupported(KMPXMediaDrmProtected)) { - if (item.IsDrmProtected()) - { - CAknSettingItem* hiddenItem = - (*SettingItemArray())[EImgVwrlicenseItem]; - //Set the License item visible - hiddenItem->SetHidden(EFalse); - //Refresh the listbox when any items visiblity is changed - this->HandleChangeInItemArrayOrVisibilityL(); - } + if(item.IsDrmProtected()) + { + hiddenItem = (*SettingItemArray())[EImgVwrlicenseItem]; + //Set the License item visible + hiddenItem->SetHidden(EFalse); + //Required to refresh the listbox when any items visiblity is changed + this->HandleChangeInItemArrayOrVisibilityL(); + } } } +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataContainer::IsLicenseItem +//----------------------------------------------------------------------------- +TBool CGlxImgVwrMetadataContainer::IsLicenseItem() + { + TRACER("CGlxMetadataContainer::IsLicenseItem()"); + //Checks the item for DRMProtection. + if((ListBox()->CurrentItemIndex()== EImgVwrlicenseItem)) + { + return EFalse; + } + return ETrue; + } // ----------------------------------------------------------------------------- // CreateImageViewerInstanceL @@ -627,7 +752,7 @@ void CGlxImgVwrMetadataContainer::CreateImageViewerInstanceL() { TRACER("CGlxImgVwrMetadataContainer::CreateImageViewerInstanceL"); - iImageViewerInstance = CGlxImageViewerManager::InstanceL(); + iImageViewerInstance = CGlxImageViewerManager::InstanceL(); __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); } @@ -638,10 +763,11 @@ void CGlxImgVwrMetadataContainer::DeleteImageViewerInstance() { TRACER("CGlxImgVwrMetadataContainer::DeleteImageViewerInstance"); - if (iImageViewerInstance) + if ( iImageViewerInstance ) { iImageViewerInstance->DeleteInstance(); } } + //End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatadialog.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatadialog.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatadialog.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -20,18 +20,31 @@ //system includes #include //for AknUtils +#include #include +#include #include // KDC_APP_RESOURCE_DIR +#include // for CEikMenuBar #include #include +#include // For CGlxCommandHandlerAddToContainer //User includes #include #include #include #include +#include +#include // for TGlxFilterFactory +#include #include +#include // for HlpLauncher +#include +#include #include +#include +#include +#include // For Panics #include "glxmetadatacommandhandler.h" // ============================ MEMBER FUNCTIONS =============================== @@ -51,14 +64,10 @@ return self; } -// ----------------------------------------------------------------------------- -// CGlxImgVwrMetadataDialog -// ----------------------------------------------------------------------------- -// CGlxImgVwrMetadataDialog::CGlxImgVwrMetadataDialog(const TDesC& aUri):iUri(aUri) { + } - // ----------------------------------------------------------------------------- // ConstructL // ----------------------------------------------------------------------------- @@ -84,11 +93,13 @@ iStatusPaneAvailable = ETrue; } + // make the toolbar disabled + SetDetailsDlgToolbarVisibility(EFalse); + // do we have status pane if( statusPane ) { - GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d", - statusPane->IsVisible()); + GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible()); // load the title text HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, iEikonEnv ); SetTitleL( *text ); @@ -98,6 +109,9 @@ } iAvkonAppUi->StatusPane()->MakeVisible(ETrue); } + + iUiUtility = CGlxUiUtility::UtilityL(); + } // ----------------------------------------------------------------------------- @@ -106,8 +120,10 @@ // CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog() { + TRACER("CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog"); + //To Disable the status pane if the dialog is launched from fullscreenview if (!iStatusPaneAvailable && iAvkonAppUi) { @@ -127,6 +143,11 @@ TRAP_IGNORE(iAvkonAppUi->ProcessCommandL(EGlxCmdResetView)); } + if( iUiUtility ) + { + iUiUtility->Close(); + } + if (iResourceOffset) { CCoeEnv::Static()->DeleteResourceFile(iResourceOffset); @@ -158,41 +179,56 @@ TRACER("CGlxImgVwrMetadataDialog::ExecuteLD"); return CAknDialog::ExecuteLD( R_IMG_VIEWER_METADATA_DIALOG ); } - // ----------------------------------------------------------------------------- // ProcessCommandL // ----------------------------------------------------------------------------- // -void CGlxImgVwrMetadataDialog::ProcessCommandL(TInt /*aCommandId*/) +void CGlxImgVwrMetadataDialog::ProcessCommandL( TInt aCommandId ) { TRACER("CGlxImgVwrMetadataDialog::ProcessCommandL"); // hide menu bar iMenuBar->StopDisplayingMenuBar(); } - //----------------------------------------------------------------------------- // CGlxImgVwrMetadataDialog::CreateCustomControlL //----------------------------------------------------------------------------- SEikControlInfo CGlxImgVwrMetadataDialog::CreateCustomControlL(TInt aControlType) { - GLX_LOG_INFO("CGlxImgVwrMetadataDialog::CreateCustomControlL"); + GLX_LOG_INFO("CShwSlideshowSettingsDialog::CreateCustomControlL"); // create control info, no flags or trailer text set SEikControlInfo controlInfo; - controlInfo.iControl = NULL; - controlInfo.iTrailerTextId = 0; - controlInfo.iFlags = 0; + controlInfo.iControl = NULL; + controlInfo.iTrailerTextId = 0; + controlInfo.iFlags = 0; if (aControlType == EMetaDataDialogListBox) { - iContainer = CGlxImgVwrMetadataContainer::NewL( - iAvkonAppUi->ClientRect(), iUri); + iContainer = CGlxImgVwrMetadataContainer::NewL(iAvkonAppUi->ClientRect(),iUri); controlInfo.iControl = iContainer; // giving ownership } return controlInfo; // returns ownership of ItemList } // ----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::DynInitMenuPaneL +// ----------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::DynInitMenuPaneL(TInt /*aMenuId*/, + CEikMenuPane* /*aMenuPane*/) + { + //no implementation + } + +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::SizeChanged +//----------------------------------------------------------------------------- +void CGlxImgVwrMetadataDialog::SizeChanged() + { + TRACER("CGlxImgVwrMetadataDialog::SizeChanged"); + CAknDialog::SizeChanged(); + } +// ----------------------------------------------------------------------------- // CGlxImgVwrMetadataDialog::InitResourceL // ----------------------------------------------------------------------------- // @@ -210,12 +246,65 @@ iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile); } + +// ----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::HandleViewCommandL +// ----------------------------------------------------------------------------- +// +TBool CGlxImgVwrMetadataDialog::HandleViewCommandL( TInt /*aCommand*/ ) + { + TRACER("CGlxImgVwrMetadataDialog::HandleViewCommandL"); + return EFalse; + } +// --------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::PreLayoutDynInitL +// --------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::PreLayoutDynInitL() + { + // No Implementation + } + +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::PostLayoutDynInitL +//----------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::PostLayoutDynInitL() + {} + +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::Draw +//----------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::Draw( const TRect& /*aRect*/ ) const +{ +TRACER("CGlxImgVwrMetadataDialog::Draw"); +TRect rect; +AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect); + +// Get the standard graphics context +CWindowGc& gc = SystemGc(); +gc.SetBrushColor(KRgbWhite); +gc.DrawRect(rect); +} + +//----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::HandlePointerEventL +//----------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + TRACER("CGlxImgVwrMetadataDialog::HandlePointerEventL"); + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + // --------------------------------------------------------------------------- // CGlxImgVwrMetadataDialog::SetTitleL() // --------------------------------------------------------------------------- void CGlxImgVwrMetadataDialog::SetTitleL(const TDesC& aTitleText) { - TRACER("CGlxImgVwrMetadataDialog::SetTitleL"); + TRACER("CGlxFetcherContainer::SetTitleL"); CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); CleanupStack::PushL(statusPane); // get pointer to the default title pane control @@ -239,7 +328,7 @@ // --------------------------------------------------------------------------- void CGlxImgVwrMetadataDialog::SetPreviousTitleL() { - TRACER("CGlxImgVwrMetadataDialog::SetPreviousTitleL"); + TRACER("CGlxFetcherContainer::SetPreviousTitleL"); CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); CleanupStack::PushL(prevStatusPane); CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL( @@ -253,7 +342,16 @@ CleanupStack::Pop(prevTitlePane); CleanupStack::Pop(prevStatusPane); } - +// ----------------------------------------------------------------------------- +// CGlxImgVwrMetadataDialog::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CGlxImgVwrMetadataDialog::HandleResourceChange( TInt aType ) + { + TRACER("CGlxImgVwrMetadataDialog::HandleResourceChange"); + //Handle global resource changes, such as scalable UI or skin events and orientation change (override) + CAknDialog::HandleResourceChange( aType ); + } // ----------------------------------------------------------------------------- // CGlxImgVwrMetadataDialog::HandleToolbarResetting // ----------------------------------------------------------------------------- diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -17,41 +17,47 @@ #include "glxmetadatacontainer.h" #include "glxustringconverter.h" // converts the symbian types to UString type -#include "mglxmetadatadialogobserver.h" - +#include #include -#include // For Filesystem -#include // For CExifModify -#include // Content ID identifying general category of content provided -#include -#include // For marquee -#include // For marquee - #include +#include +#include +#include #include +#include //Details data provider #include #include // For CGlxCommandHandlerAddToContainer #include // for command handler id -#include // for command factory +#include //for command factory +#include // Content ID identifying general category of content provided +#include "mglxmetadatadialogobserver.h" #include +#include #include #include // tag collection plugin uid +#include // KGlxMediaIdThumbnail #include // CGlxAttributeReteiver -#include // For launching DRM details pane +#include +#include //For launching DRM details pane #include // General utilties class definition -#include +#include +#include //For CExifModify +#include #include -#include -#include +#include //For Filesystem #include +//marquee +#include +#include +const TInt KMaxMediaPopupTitleLength = 0x100; const TInt KMediaListId = 0x2000D248; const TInt KOffsets = 50; const TInt KMarqueeLoopCount = 3; const TInt KMarqueeScrollAmount = 20; const TInt KMarqueeScrollDelay = 1000000; const TInt KMarqueeScrollInterval = 200000; - +_LIT( KGlxTextSetter, ""); _LIT( KGlxComma, ","); // ============================ MEMBER FUNCTIONS =============================== @@ -60,41 +66,39 @@ // NewL // --------------------------------------------------------- // -CGlxMetadataContainer* CGlxMetadataContainer::NewL(const TRect& aRect, - MGlxMetadataDialogObserver& aDialogObserver, const TDesC& item, - MToolbarResetObserver& aResetToolbarObs) - { - TRACER("CGlxMetadataContainer::NewL"); - CGlxMetadataContainer* self = CGlxMetadataContainer::NewLC(aRect, - aDialogObserver, item, aResetToolbarObs); - CleanupStack::Pop(self); - return self; - } +CGlxMetadataContainer* CGlxMetadataContainer::NewL( const TRect& aRect, + MGlxMetadataDialogObserver& aDialogObserver, + const TDesC& item,MToolbarResetObserver& aResetToolbarObs) + { + TRACER("CGlxMetadataContainer::NewL"); + CGlxMetadataContainer* self = CGlxMetadataContainer::NewLC( aRect, + aDialogObserver,item,aResetToolbarObs); + CleanupStack::Pop(self); + return self; + } // --------------------------------------------------------- // NewLC // --------------------------------------------------------- // -CGlxMetadataContainer* CGlxMetadataContainer::NewLC(const TRect& aRect, - MGlxMetadataDialogObserver& aDialogObserver, const TDesC& aUri, - MToolbarResetObserver& aResetToolbarObs) - { - TRACER("CGlxMetadataContainer::NewLC"); - CGlxMetadataContainer* self = new (ELeave) CGlxMetadataContainer( - aDialogObserver, aResetToolbarObs); - CleanupStack::PushL(self); - self->ConstructL(aRect, aUri); - return self; - } +CGlxMetadataContainer* CGlxMetadataContainer::NewLC( const TRect& aRect, + MGlxMetadataDialogObserver& aDialogObserver, + const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs) + { + TRACER("CGlxMetadataContainer::NewLC"); + CGlxMetadataContainer* self = new(ELeave) CGlxMetadataContainer(aDialogObserver, aResetToolbarObs); + CleanupStack::PushL(self); + self->ConstructL( aRect, aUri); + return self; + } // --------------------------------------------------------- // CGlxMetadataContainer // --------------------------------------------------------- // -CGlxMetadataContainer::CGlxMetadataContainer( - MGlxMetadataDialogObserver& aDialogObserver, - MToolbarResetObserver& aResetToolbarObs) : - iDialogObesrver(aDialogObserver), iResetToolbarObs(aResetToolbarObs) +CGlxMetadataContainer::CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver, + MToolbarResetObserver& aResetToolbarObs) + :iDialogObesrver ( aDialogObserver ),iResetToolbarObs(aResetToolbarObs) { // No implementation } @@ -105,40 +109,38 @@ // void CGlxMetadataContainer::ConstructL(const TRect& /*aRect*/, const TDesC& aUri) - { + { TRACER("CGlxMetadataContainer::ConstructL"); - //media's uri - iUri = aUri.AllocL(); + //media's uri + iUri = aUri.AllocL(); - //Creating the RBuf texts for all the items except tags & albums - //which would be updated as whne the item is edited - iTextSetter.CreateL(KMaxFileName); + //Creating the RBuf texts for all the items except tags & albums + //which would be updated as whne the item is edited + iTextSetter.CreateL(KMaxFileName); - //RBuf text which would be updated as when a tag is edited for the item. - iTagSetter.CreateL(KMaxFileName); + //RBuf text which would be updated as when a tag is edited for the item. + iTagSetter.CreateL(KMaxFileName); - //RBuf text which would be updated as when a album is edited for the item. - iAlbumSetter.CreateL(KMaxFileName); + //RBuf text which would be updated as when a album is edited for the item. + iAlbumSetter.CreateL(KMaxFileName); - //Create medialist filtered by uri - iUri - CreateMediaListForSelectedItemL(); + //Create medialist filtered by uri - iUri + CreateMediaListForSelectedItemL(); - //Setting the iVideo flag to EFalse initially - iVideo = EFalse; + //Setting the iVideo flag to EFalse initially + iVideo = EFalse; - //Setting the iMarquee flag to EFalse initially + //Setting the iMarquee flag to EFalse initially iMarquee = EFalse; //check when Remove location information is selected. iLocationinfo = EFalse; - //Flag to indicate rename command is started - iRenameStarted = EFalse; + //Flag to indicate rename command is started + iRenameStarted = EFalse; - // Flag to indicate text entry popup display status - iIsPopupShown = EFalse; - } + } // --------------------------------------------------------- // ~CGlxMetadataContainer @@ -214,63 +216,64 @@ { TRACER("CGlxMetadataContainer::CreateSettingItemL"); CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack - iTextSetter.Zero(); + iTextSetter.Zero(); - // Creating a empty Settings list box which will be populated - // with metadata in handleattributeavailable - switch (aResourceId) + //Creating a empty Settings list box which will be populated with metadata in handleattributeavailable + + switch(aResourceId) { case ENameItem: case EDateAndTimeItem: case EDescriptionItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTextSetter); + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); break; } case ETagsItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTagSetter); + iTagSetter.Copy(KGlxTextSetter); + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTagSetter ); break; } case EAlbumsItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iAlbumSetter); + iAlbumSetter.Copy(KGlxTextSetter); + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iAlbumSetter ); break; } case ELocationItem: case ESizeItem: case EResolutionItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTextSetter); - - break; - } + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); + + break; + } case EDurationItem: case ElicenseItem: { - settingItem = new (ELeave) CAknTextSettingItem(aResourceId, - iTextSetter); - //Hide the item until we get the attributes - //where in we check for the usage rights. - settingItem->SetHidden(ETrue); - //Required to refresh the listbox when any items visiblity is changed - this->HandleChangeInItemArrayOrVisibilityL(); - } + settingItem = new (ELeave) CAknTextSettingItem( + aResourceId, iTextSetter ); + //Hide the item until we get the attributes + //where in we check for the usage rights. + settingItem->SetHidden(ETrue); + //Required to refresh the listbox when any items visiblity is changed + this->HandleChangeInItemArrayOrVisibilityL(); + } break; - + default: { - break; + break; } } return settingItem; } - //----------------------------------------------------------------------------- // CGlxMetadataContainer::IsItemModifiable //----------------------------------------------------------------------------- @@ -285,8 +288,25 @@ } //return ETrue to dim the item return ETrue; + } - +//----------------------------------------------------------------------------- +// CGlxMetadataContainer::IsLicenseItem +//----------------------------------------------------------------------------- +TBool CGlxMetadataContainer::IsLicenseItem() + { + TRACER("CGlxMetadataContainer::IsLicenseItem"); + //Checks the item for DRMProtection. + //if item is a video item index should be ELicense else check for EDuration Item. + //because License Item index would become EDuration as the duration item is hidden in case of inage file. + if((!iVideo && ListBox()->CurrentItemIndex()== EDurationItem) + || (ListBox()->CurrentItemIndex()== ElicenseItem)) + { + return EFalse; + } + return ETrue; + } + //----------------------------------------------------------------------------- // CGlxMetadataContainer::IsLocationItem //----------------------------------------------------------------------------- @@ -315,7 +335,7 @@ void CGlxMetadataContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType) { - GLX_LOG_INFO("CGlxMetadataContainer::HandleListBoxEventL"); + TRACER("CGlxMetadataContainer::HandleListBoxEventL"); if ((aEventType == EEventEnterKeyPressed) || (aEventType == EEventEditingStarted) || (aEventType == EEventItemSingleClicked)) @@ -333,15 +353,15 @@ //dont Edit Item's details if medialist is empty //OR Rename command is in progress - if (iItemMediaList->Count() == 0 || iRenameStarted) - { - GLX_LOG_INFO("MediaList empty or Rename command started"); - return; - } + if(iItemMediaList->Count() == 0 || iRenameStarted) + { + GLX_LOG_INFO("MediaList empty or Rename command started"); + return; + } TInt index = ListBox()->CurrentItemIndex(); - switch (index) + switch(index) { case ENameItem: case EDescriptionItem: @@ -350,87 +370,60 @@ 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; - } - 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); - } - else + { + //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) ) { - CAknSettingItem* settingsitem = (*SettingItemArray())[index]; - GlxGeneralUiUtilities::ShowInfoNoteL(settingsitem->SettingTextL(),ETrue); + HBufC *noLocationBuf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION); + GlxGeneralUiUtilities::ShowInfoNoteL(*noLocationBuf,ETrue); + CleanupStack::PopAndDestroy(noLocationBuf); } - break; - } + break; + } case EDurationItem: - { - //This is condition is useful when the license item is selected for a image file - if (iVideo) - { - break; - } - } - case EResolutionItem: - { - //This is condition is useful when the license item is selected for a DRM Video file - if (!iVideo || !iItemMediaList->Item(0).IsDrmProtected()) + { + //This is condition is useful when the license item is selected for a image file + if(iVideo) { break; } } case ElicenseItem: - { - const TGlxMedia& item = iItemMediaList->Item(0); - if (item.IsDrmProtected()) - { + { + const TGlxMedia& item = iItemMediaList->Item(0); + if( item.IsDrmProtected()) + { //Create DRM utility CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); CleanupClosePushL(*drmUtility); - - // check if rights have expired - TBool expired = EFalse; - expired = !drmUtility->ItemRightsValidityCheckL(item.Uri(), - EMPXImage == item.Category()); - - if (expired) - { - drmUtility->ShowRightsInfoL(item.Uri()); - } - else - { - drmUtility->ShowDRMDetailsPaneL(item.Uri()); - } + drmUtility->ShowDRMDetailsPaneL(item.Uri()); CleanupStack::PopAndDestroy(drmUtility); - } - } - break; + } + } + break; default: - { - break; - } + { + break; + } } } //----------------------------------------------------------------------------- @@ -439,42 +432,40 @@ void CGlxMetadataContainer::CreateMediaListForSelectedItemL( ) { TRACER("CGlxMetadataContainer::CreateMediaListForSelectedItemL"); - + //create the collection path for the medialist to be created CMPXCollectionPath* path = CMPXCollectionPath::NewL(); - CleanupStack::PushL(path); + CleanupStack::PushL( path ); //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI path->AppendL(KGlxCollectionPluginAllImplementationUid); //create the filter with the URI CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(*iUri); - CleanupStack::PushL(filter); + CleanupStack::PushL( filter ); //create the medialist - iItemMediaList = MGlxMediaList::InstanceL(*path, TGlxHierarchyId( - KMediaListId), filter); + iItemMediaList = MGlxMediaList::InstanceL(*path,TGlxHierarchyId(KMediaListId),filter); //Add the attributes which are required to be displayed. - iMainListAttributecontext = new (ELeave) CGlxAttributeContext( - &iSelectionIterator); + iMainListAttributecontext = new (ELeave) CGlxAttributeContext(&iSelectionIterator); iMainListAttributecontext->AddAttributeL(KMPXMediaDrmProtected); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralCategory); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralSize); - iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralDimensions); + iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralDimensions); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralTitle); - iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralDate); - iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralComment); + iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralLastModifiedDate); + iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralComment); iMainListAttributecontext->AddAttributeL(KGlxMediaGeneralLocation); - iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralDuration); + iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralDuration); iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralUri); - + //Add Context so that we get the handleattributes call once the medialist is populated with above mentioned attributes. - iItemMediaList->AddContextL(iMainListAttributecontext, - KGlxFetchContextPriorityBlocking); - + iItemMediaList->AddContextL( iMainListAttributecontext, + KGlxFetchContextPriorityBlocking ); + //add to observer for callbacks. iItemMediaList->AddMediaListObserverL(this); - - CleanupStack::PopAndDestroy(filter); - CleanupStack::PopAndDestroy(path); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( path ); } //----------------------------------------------------------------------------- @@ -483,208 +474,209 @@ void CGlxMetadataContainer::CreateTagsMediaListL() { TRACER("CGlxMetadataContainer::CreateTagsMediaListL"); - //create the collection path for the medialist to be created - CMPXCollectionPath* path = CMPXCollectionPath::NewL(); - CleanupStack::PushL(path); - //Set the Tags collection for the particular item - path->AppendL(KGlxTagCollectionPluginImplementationUid); - //get the media item for which we require the tags collection - TGlxMedia item = iItemMediaList->Item(0); - //create the medialist filter with media ID - CMPXFilter* filter1 = - TGlxFilterFactory::CreateExcludeContainersWithoutItemFilterL( - item.Id()); - CleanupStack::PushL(filter1); - //set the array order as required, here its alphabetical - TGlxFilterProperties filterProperty; - filterProperty.iSortOrder = EGlxFilterSortOrderAlphabetical; - filterProperty.iSortDirection = EGlxFilterSortDirectionAscending; - //combine the filter with filterProperty - CMPXFilter* filter = TGlxFilterFactory::CreateCombinedFilterL( - filterProperty, filter1, EFalse); - CleanupStack::PushL(filter); - - //create the medialist to get the tags array. - iTagMediaList = MGlxMediaList::InstanceL(*path, TGlxHierarchyId( - KMediaListId), filter); - - //add the attribute KMPXMediaGeneralTitle to the context to get the tag name - iTagContext = CGlxDefaultAttributeContext::NewL(); - iTagContext->AddAttributeL(KMPXMediaGeneralTitle); - iTagContext->SetRangeOffsets(KOffsets, KOffsets); - - //Add Context so that we get the handleattributes call once the medialist is populated with tags. - iTagMediaList->AddContextL(iTagContext, - KGlxFetchContextPriorityUMPViewTagPane); - - //add to observer for callbacks. - iTagMediaList->AddMediaListObserverL(this); - - CleanupStack::PopAndDestroy(filter); - CleanupStack::PopAndDestroy(filter1); - CleanupStack::PopAndDestroy(path); + //create the collection path for the medialist to be created + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + //Set the Tags collection for the particular item + path->AppendL(KGlxTagCollectionPluginImplementationUid); + //get the media item for which we require the tags collection + TGlxMedia item = iItemMediaList->Item(0); + //create the medialist filter with media ID + CMPXFilter* filter1 = + TGlxFilterFactory::CreateExcludeContainersWithoutItemFilterL(item.Id()); + CleanupStack::PushL(filter1); + //set the array order as required, here its alphabetical + TGlxFilterProperties filterProperty; + filterProperty.iSortOrder = EGlxFilterSortOrderAlphabetical; + filterProperty.iSortDirection = EGlxFilterSortDirectionAscending; + //combine the filter with filterProperty + CMPXFilter* filter = TGlxFilterFactory::CreateCombinedFilterL( filterProperty, + filter1, + EFalse); + CleanupStack::PushL(filter); + + //create the medialist to get the tags array. + iTagMediaList = MGlxMediaList::InstanceL(*path,TGlxHierarchyId(KMediaListId),filter); + + //add the attribute KMPXMediaGeneralTitle to the context to get the tag name + iTagContext = CGlxDefaultAttributeContext::NewL(); + iTagContext->AddAttributeL(KMPXMediaGeneralTitle); + iTagContext->SetRangeOffsets(KOffsets,KOffsets); + + //Add Context so that we get the handleattributes call once the medialist is populated with tags. + iTagMediaList->AddContextL( iTagContext, + KGlxFetchContextPriorityUMPViewTagPane ); + + //add to observer for callbacks. + iTagMediaList->AddMediaListObserverL(this); + + CleanupStack::PopAndDestroy(filter); + CleanupStack::PopAndDestroy(filter1); + CleanupStack::PopAndDestroy(path); + } - //----------------------------------------------------------------------------- // CGlxMetadataContainer::CreateAlbumsMediaListL //----------------------------------------------------------------------------- void CGlxMetadataContainer::CreateAlbumsMediaListL() { TRACER("CGlxMetadataContainer::CreateAlbumsMediaListL"); - //create the collection path for the medialist to be created - CMPXCollectionPath* path = CMPXCollectionPath::NewL(); - CleanupStack::PushL(path); - //Set the albums collection for the particular item - path->AppendL(KGlxCollectionPluginAlbumsImplementationUid); - //get the media item for which we require the tags collection - TGlxMedia item = iItemMediaList->Item(0); - //create the medialist filter with media ID - CMPXFilter* filter = - TGlxFilterFactory::CreateExcludeContainersWithoutItemFilterL( - item.Id()); - CleanupStack::PushL(filter); - //create the albums medialist. - iAlbumMediaList = MGlxMediaList::InstanceL(*path, TGlxHierarchyId( - KMediaListId), filter); + //create the collection path for the medialist to be created + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + //Set the albums collection for the particular item + path->AppendL(KGlxCollectionPluginAlbumsImplementationUid); + //get the media item for which we require the tags collection + TGlxMedia item = iItemMediaList->Item(0); + //create the medialist filter with media ID + CMPXFilter* filter = + TGlxFilterFactory::CreateExcludeContainersWithoutItemFilterL(item.Id()); + CleanupStack::PushL(filter); + //create the albums medialist. + iAlbumMediaList = MGlxMediaList::InstanceL(*path, + TGlxHierarchyId(KMediaListId), + filter); + + //add the attribute KMPXMediaGeneralTitle to the context to get the album name + iAlbumContext = CGlxDefaultAttributeContext::NewL(); + iAlbumContext->AddAttributeL(KMPXMediaGeneralTitle); + iAlbumContext->SetRangeOffsets(KOffsets,KOffsets); + //Add Context to the medialist so that we get the handleattributes call once the medialist is populated with albums. + iAlbumMediaList->AddContextL( iAlbumContext, + KGlxFetchContextPriorityUMPViewAlbumPane ); + + //add to observer for callbacks. + iAlbumMediaList->AddMediaListObserverL(this); + + CleanupStack::PopAndDestroy(filter); + CleanupStack::PopAndDestroy(path); + + } - //add the attribute KMPXMediaGeneralTitle to the context to get the album name - iAlbumContext = CGlxDefaultAttributeContext::NewL(); - iAlbumContext->AddAttributeL(KMPXMediaGeneralTitle); - iAlbumContext->SetRangeOffsets(KOffsets, KOffsets); - //Add Context to the medialist so that we get the handleattributes call once the medialist is populated with albums. - iAlbumMediaList->AddContextL(iAlbumContext, - KGlxFetchContextPriorityUMPViewAlbumPane); - - //add to observer for callbacks. - iAlbumMediaList->AddMediaListObserverL(this); - - CleanupStack::PopAndDestroy(filter); - CleanupStack::PopAndDestroy(path); - } // ---------------------------------------------------------------------------- // CGlxMetadataContainer::ViewDynInitMenuPaneL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::ViewDynInitMenuPaneL(TInt aMenuId, - CEikMenuPane* aMenuPane) +void CGlxMetadataContainer::ViewDynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane) { - if (aMenuId == R_METADATA_MENU) + if( aMenuId == R_METADATA_MENU ) { - //Set dim the options based on the item selected + //Set dim the options based on the utem selected + //Viewdetails option will be availble only for the license item + //Delete option will be available only for the location item + aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem()); //location info will be enabled if the item has a location info - aMenuPane->SetItemDimmed(KGlxDeleteBoundMenuCommandId, - IsLocationItem()); + aMenuPane->SetItemDimmed(KGlxDeleteBoundMenuCommandId,IsLocationItem()); + // Show on Map is no longer part of requirements and should not be shown in the + // options menu. When show on map has to come back, replace the 'ETrue' below with + // the function IsLocationItem. + aMenuPane->SetItemDimmed(EGlxCmdAiwShowMap,ETrue); } + + } - // ---------------------------------------------------------------------------- // CGlxMetadataContainer::RemoveLocationL // ---------------------------------------------------------------------------- // void CGlxMetadataContainer::RemoveLocationL() { - TRACER("CGlxMetadataContainer::RemoveLocationL"); - + TRACER("CGlxMetadataContainer::RemoveLocationL"); + iLocationinfo = ETrue; // get the media item - const TGlxMedia& media = iItemMediaList->Item(0); + const TGlxMedia& media = iItemMediaList->Item(0); // Test to see if the coordinate is present TCoordinate coordinate; TBool isSupported = media.GetCoordinate(coordinate); - if (!isSupported) + if( !isSupported ) { - HBufC *buf = StringLoader::LoadLC( - R_GLX_METADATA_NOTE_INFO_NO_LOCATION); - GlxGeneralUiUtilities::ShowInfoNoteL(*buf, ETrue); + HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION); + GlxGeneralUiUtilities::ShowInfoNoteL(*buf,ETrue); CleanupStack::PopAndDestroy(buf); } else { - HBufC *buf = - StringLoader::LoadLC(R_GLX_METADATA_NOTE_DELETE_LOCATION); - TBool response = GlxGeneralUiUtilities::ConfirmQueryL( - R_GLX_QUERY_YES_NO, *buf); + HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_DELETE_LOCATION); + TBool response = GlxGeneralUiUtilities::ConfirmQueryL(R_GLX_QUERY_YES_NO,*buf); CleanupStack::PopAndDestroy(buf); - - if (response) + + if( response ) { //user selected yes, so delete location //send command for delete location after successfull removal of command remove this pane - if (iItemMediaList->Count() > 0) - { + if( iItemMediaList->Count() > 0 ) + { //set focus to first item - iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute, 0); - + iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0); + // Deleting location information from image file RFs rFs; - User::LeaveIfError(rFs.Connect()); - CleanupClosePushL(rFs); - RFile rFile; - User::LeaveIfError(rFile.Open(rFs, - iItemMediaList->Item(0).Uri(), EFileWrite)); - CleanupClosePushL(rFile); - + User::LeaveIfError( rFs.Connect() ); + CleanupClosePushL( rFs ); + RFile rFile; + User::LeaveIfError( rFile.Open(rFs, + iItemMediaList->Item(0).Uri() + ,EFileWrite )); + CleanupClosePushL( rFile ); + TInt imageFileSize = 0; // Image File Size - User::LeaveIfError(rFile.Size(imageFileSize)); - HBufC8* imageData = HBufC8::NewL(imageFileSize); //Actual Image Data - CleanupStack::PushL(imageData); - + User::LeaveIfError( rFile.Size( imageFileSize ) ); + HBufC8* imageData = HBufC8::NewL( imageFileSize ); //Actual Image Data + CleanupStack::PushL( imageData ); + TPtr8 myImagePtr = imageData->Des(); - TInt readError = rFile.Read(myImagePtr); - if (readError != KErrNone) + TInt readError = rFile.Read( myImagePtr ); + if ( readError != KErrNone ) { - User::Leave(KErrGeneral); + User::Leave( KErrGeneral ); } - + //CExifModify Interface class for modifying existing Exif v2.2 (or prior) //file format or creating Exif v2.2 file format using valid Jpeg image CExifModify* exifWriter = NULL; TRAPD(err,exifWriter = CExifModify::NewL( imageData->Des())); - CleanupStack::PushL(exifWriter); - if (err == KErrNone) + CleanupStack::PushL( exifWriter ); + if(err == KErrNone) { - //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); + //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 ); + + 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); - CleanupStack::PopAndDestroy(&rFile); - CleanupStack::PopAndDestroy(&rFs); + CleanupStack::PopAndDestroy( exifWriter); + CleanupStack::PopAndDestroy( imageData ); + CleanupStack::PopAndDestroy( &rFile ); + CleanupStack::PopAndDestroy( &rFs ); //Deleting location information from MDS database - CMPXCollectionPath* path = iItemMediaList->PathLC(); - CMPXCommand* command = - TGlxCommandFactory::DeleteLocationCommandLC(*path); - - command->SetTObjectValueL ( - KMPXCommandGeneralSessionId, - static_cast (this)); - - iItemMediaList->CommandL(*command); + CMPXCollectionPath* path = iItemMediaList->PathLC(); + CMPXCommand* command = TGlxCommandFactory::DeleteLocationCommandLC(*path); + + command->SetTObjectValueL(KMPXCommandGeneralSessionId, + static_cast(this)); + + iItemMediaList->CommandL(*command); CleanupStack::PopAndDestroy(command); CleanupStack::PopAndDestroy(path); } - } + } } } // ---------------------------------------------------------------------------- @@ -702,86 +694,89 @@ ListBox()->DrawNow(); } // ---------------------------------------------------------------------------- -// CGlxMetadataContainer::SetAttributesL +// CGlxMetadataContainer::SetAttributes // ---------------------------------------------------------------------------- // void CGlxMetadataContainer::SetAttributesL(TMPXAttribute attribute) { - TRACER("CGlxMetadataContainer::SetAttributesL"); - + 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(); - } - if (!iAlbumMediaList) - { - CreateAlbumsMediaListL(); - } - if (!iSetVisible) - { - iSetVisible = ETrue; - SetDurationLIicenseItemVisibilityL(); - } + if(!iTagMediaList) + { + CreateTagsMediaListL(); + } + if(!iAlbumMediaList) + { + CreateAlbumsMediaListL(); + } + if(!iSetVisible) + { + 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. CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); - CleanupStack::PushL(stringConverter); - HBufC* string = NULL; - + CleanupStack::PushL(stringConverter ); + HBufC* string = NULL; + //if attribute is date and time we need to pass the format it as R_QTN_DATE_USUAL_WITH_ZERO else null - if (attribute == KMPXMediaGeneralDate) + if(attribute == KGlxMediaGeneralLastModifiedDate) { - stringConverter->AsStringL(item, attribute, - R_QTN_DATE_USUAL_WITH_ZERO, string); - } + stringConverter->AsStringL(item, + attribute, + R_QTN_DATE_USUAL_WITH_ZERO, string ); + } else { - stringConverter->AsStringL(item, attribute, 0, string); + stringConverter->AsStringL(item, + attribute,0, string ); } //get the settings item based on the attribute and set the text. - if (string) - { + if ( string ) + { iTextSetter.Zero(); - 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; - } - CleanupStack::PopAndDestroy(stringConverter); - } + 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 == KGlxMediaGeneralLastModifiedDate) + { + 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; + } + CleanupStack::PopAndDestroy(stringConverter ); + } // ---------------------------------------------------------------------------- // CGlxMetadataContainer::SetNameDescriptionL @@ -789,18 +784,17 @@ // void CGlxMetadataContainer::SetNameDescriptionL(TInt aItem) { - TRACER("CGlxMetadataContainer::SetNameDescriptionL"); + TRACER("CGlxMetadataContainer::SetNameDescriptionL"); //This functions i commn for updatng both name and description once modified //get the item handcle to be modified - CAknSettingItem* settingsitem = (*SettingItemArray())[aItem]; - HBufC* textBuf = HBufC::NewLC(KMaxMediaPopupTextLength); - const TDesC& popupText = settingsitem->SettingTextL(); - (textBuf->Des()).Copy(popupText.Left(KMaxMediaPopupTextLength)); + CAknSettingItem* settingsitem = (*SettingItemArray())[aItem]; + HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); + (textBuf->Des()).Copy((settingsitem->SettingTextL())); TPtr textPtr = textBuf->Des(); //Remove preceeding & trailing spaces textPtr.Trim(); - HBufC* buf = NULL; - + TBuf titleText(*textBuf); + HBufC *buf = NULL; if(aItem == ENameItem) { buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES); @@ -809,129 +803,109 @@ { buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_DESCRIPTION_NSERIES); } - + //Launch the text entry editor. - CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL(*buf, textPtr); + CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL( *buf, textPtr ); CleanupStack::PopAndDestroy(buf); - if (aItem == EDescriptionItem) + if(aItem == EDescriptionItem) { popup->SetLeftSoftKeyL(ETrue); } - iIsPopupShown = ETrue; - + //action upon selecting ok from the editor - if (popup->ExecuteLD() == EEikBidOk) - { - iIsPopupShown = EFalse; - if (iItemMediaList->Count() && 0 != (popupText.Compare(*textBuf))) - { - TFileName fileName = ParseFileName(*textBuf); - //check If filename already exists - if ((aItem == ENameItem) && (BaflUtils::FileExists( - ControlEnv()->FsSession(), fileName))) - { - //if changed title is same as existing one then showing the already use popup to user - HBufC* info = StringLoader::LoadLC(R_GLX_NAME_ALREADY_USED, - *textBuf); - GlxGeneralUiUtilities::ShowInfoNoteL(*info, ETrue); - CleanupStack::PopAndDestroy(info); - } - // Check if the filename is valid - else if ((aItem == ENameItem) - && (!ControlEnv()->FsSession().IsValidName(*textBuf))) - { - //Show illegal characters error note - HBufC* info = StringLoader::LoadLC( - R_GLX_QTN_FLDR_ILLEGAL_CHARACTERS); - GlxGeneralUiUtilities::ShowInfoNoteL(*info, ETrue); - CleanupStack::PopAndDestroy(info); - } - else - { - //Modify the MDS and setting list only if the entry is different from previous Item value + if ( popup->ExecuteLD() == EEikBidOk ) + { + if(0 != (titleText.Compare(*textBuf))) + { + + TFileName fileName = ParseFileName(*textBuf); + //check If filename already exists + if ((aItem == ENameItem) && + (BaflUtils::FileExists(ControlEnv()->FsSession(), fileName))) + { + //if changed title is same as existing one then showing the already use popup to user + HBufC* info = StringLoader::LoadLC(R_GLX_NAME_ALREADY_USED, *textBuf); + GlxGeneralUiUtilities::ShowInfoNoteL(*info, ETrue); + CleanupStack::PopAndDestroy(info); + } + else + { + //Modify the MDS and setting list only if the entry is different from previous Item value iTextSetter.Zero(); - iTextSetter.Copy(*textBuf); - EditItemL(aItem, EFalse); - iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute, 0);//set focus to first item - - if (aItem == ENameItem) - { - //indicate Rename command is started - iRenameStarted = ETrue; - //set Setting List Box to Dimmed status - SetDimmed(iRenameStarted); - - const TGlxMedia& media = iItemMediaList->Item(0); - ContentAccess::CManager *manager = - ContentAccess::CManager::NewL(); - CleanupStack::PushL(manager); - HBufC* modifiedName = fileName.AllocLC(); - - //rename the media - TInt error = manager->RenameFile(media.Uri(), - *modifiedName); - if (KErrNone == error) - { - //Redundant call But needed in case FileSystem is too slow - //to notify MDS for updating title. - //Create the glx command for updating Title in MDS - CMPXCollectionPath* path = iItemMediaList->PathLC(); - CMPXCommand* command = - TGlxCommandFactory::RenameCommandLC( - settingsitem->SettingTextL(), *path); - command->SetTObjectValueL ( - KMPXCommandGeneralSessionId, - static_cast (this)); - //issue command to the medialist which further - //calls data source to update MDS - iItemMediaList->CommandL(*command); - CleanupStack::PopAndDestroy(command); - CleanupStack::PopAndDestroy(path); - } - else - { - //Renaming commmand failed - iRenameStarted = EFalse; - //reset Setting Items to undim status - SetDimmed(iRenameStarted); - //Reset the EName Settings field - iTextSetter.Zero(); - iTextSetter.Copy(media.Title()); - EditItemL(ENameItem, EFalse); + iTextSetter.Copy(*textBuf); + EditItemL(aItem,EFalse); + iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item + + if(aItem == ENameItem) + { + //indicate Rename command is started + iRenameStarted = ETrue; + //set Setting List Box to Dimmed status + SetDimmed(iRenameStarted); + + const TGlxMedia& media = iItemMediaList->Item(0); + ContentAccess::CManager *manager = ContentAccess::CManager::NewL(); + CleanupStack::PushL(manager); + HBufC* modifiedName = fileName.AllocLC(); + + //rename the media + TInt error = manager->RenameFile(media.Uri(), *modifiedName); + if(KErrNone == error) + { + //Redundant call But needed in case FileSystem is too slow + //to notify MDS for updating title. + //Create the glx command for updating Title in MDS + CMPXCollectionPath* path = iItemMediaList->PathLC(); + CMPXCommand* command = TGlxCommandFactory::RenameCommandLC( + settingsitem->SettingTextL(), *path); + command->SetTObjectValueL ( + KMPXCommandGeneralSessionId, + static_cast (this)); + //issue command to the medialist which further + //calls data source to update MDS + iItemMediaList->CommandL(*command); + CleanupStack::PopAndDestroy(command); + CleanupStack::PopAndDestroy(path); + } + else + { + //Renaming commmand failed + iRenameStarted = EFalse; + //reset Setting Items to undim status + SetDimmed(iRenameStarted); + //Reset the EName Settings field + iTextSetter.Zero(); + iTextSetter.Copy(media.Title()); + EditItemL(ENameItem,EFalse); GlxGeneralUiUtilities::ShowErrorNoteL(error); - } - CleanupStack::PopAndDestroy(modifiedName); - CleanupStack::PopAndDestroy(manager); - } - else - { - //Create the glx command for changing description - CMPXCollectionPath* path = iItemMediaList->PathLC(); - CMPXCommand* command = - TGlxCommandFactory::SetDescriptionCommandLC( - settingsitem->SettingTextL(), *path); - command->SetTObjectValueL ( - KMPXCommandGeneralSessionId, - static_cast (this)); - //issue command to the medialist which further - //calls data source to update MDS - iItemMediaList->CommandL(*command); - CleanupStack::PopAndDestroy(command); - CleanupStack::PopAndDestroy(path); - } - } - } - } - CleanupStack::PopAndDestroy(textBuf); - + } + CleanupStack::PopAndDestroy(modifiedName); + CleanupStack::PopAndDestroy(manager); + } + else + { + //Create the glx command for changing description + CMPXCollectionPath* path = iItemMediaList->PathLC(); + CMPXCommand* command = + TGlxCommandFactory::SetDescriptionCommandLC( + settingsitem->SettingTextL(), *path); + command->SetTObjectValueL ( + KMPXCommandGeneralSessionId, + static_cast (this)); + //issue command to the medialist which further + //calls data source to update MDS + iItemMediaList->CommandL(*command); + CleanupStack::PopAndDestroy(command); + CleanupStack::PopAndDestroy(path); + } + } + } + } + CleanupStack::PopAndDestroy( textBuf ); + //notify observer that some operation has happened. So refresh the toolbar area.. iResetToolbarObs.HandleToolbarResetting(EFalse); - if (!iItemMediaList->Count()) - { - iDialogObesrver.HandleItemRemovedL(); - } } - // ---------------------------------------------------------------------------- // CGlxMetadataContainer::UpdateTagsL() // ---------------------------------------------------------------------------- @@ -940,25 +914,23 @@ { TRACER("CGlxMetadataContainer::UpdateTagsL"); //Get the tag setting item handle to set the text - CAknSettingItem* settingsitem = (*SettingItemArray())[ETagsItem]; - - //Set the tag setter to empty string before filling in the data. - iTagSetter.Zero(); - - //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); - } - EditItemL(ETagsItem, EFalse); - } - + CAknSettingItem* settingsitem = + (*SettingItemArray())[ETagsItem]; + //Set the tag setter to empty string before filling in the data. + 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); + } + EditItemL(ETagsItem,EFalse); + } // ---------------------------------------------------------------------------- // CGlxMetadataContainer::UpdateAlbumsL() // ---------------------------------------------------------------------------- @@ -967,11 +939,10 @@ { TRACER("CGlxMetadataContainer::UpdateAlbumsL"); //Get the tag setting item handle to set the text - CAknSettingItem* settingsitem = (*SettingItemArray())[EAlbumsItem]; - + CAknSettingItem* settingsitem = + (*SettingItemArray())[EAlbumsItem]; //Set the tag setter to empty string before filling in the data. - iAlbumSetter.Zero(); - + iAlbumSetter.Copy(KGlxTextSetter); //Loop to appened all the tags to the iAlbumSetter. for( TInt index = 0 ; index < iAlbumMediaList->Count() ; index++ ) { @@ -985,7 +956,6 @@ } EditItemL(EAlbumsItem,EFalse); } - // ---------------------------------------------------------------------------- // CGlxMetadataContainer::SetDurationLIicenseItemVisibilityL() // ---------------------------------------------------------------------------- @@ -998,50 +968,43 @@ const CGlxMedia* media = item.Properties(); //in order to check for video category and drm rights - + CAknSettingItem* hiddenItem = NULL; - if (item.Category() == EMPXVideo) - { - if (!item.IsDrmProtected()) - { - hiddenItem = (*SettingItemArray())[EDurationItem]; - //Set the duration item visible - hiddenItem->SetHidden(EFalse); - } - else - { - hiddenItem = (*SettingItemArray())[EResolutionItem]; - //Set the Resolution item in-visible for DRM protected Video - hiddenItem->SetHidden(ETrue); - } + if( item.Category() == EMPXVideo) + { + if(!item.IsDrmProtected()) + { + hiddenItem = (*SettingItemArray())[EDurationItem]; + //Set the duration item visible + hiddenItem->SetHidden(EFalse); + } //set the video flag which would be used to enable/disable the view details option. this->HandleChangeInItemArrayOrVisibilityL(); iVideo = ETrue; - } - if (media && media->IsSupported(KMPXMediaDrmProtected)) + } + 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. // ---------------------------------------------------------------------------- // CGlxMetadataContainer::HandleAttributesAvailableL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleAttributesAvailableL(TInt /*aItemIndex*/, - const RArray& aAttributes, MGlxMediaList* aList) +void CGlxMetadataContainer::HandleAttributesAvailableL( TInt /*aItemIndex*/, + const RArray& aAttributes, MGlxMediaList* aList ) { TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); //generic medialist for the item for all the attributes required other than tags and albums. - if (aList == iItemMediaList) + if(aList == iItemMediaList) { // Loop untill it checks for all the avialable attributes for (TInt i = aAttributes.Count() - 1; i >= 0; i--) @@ -1059,38 +1022,36 @@ //Check if media's uri(i.e 'aModifiedUri') is different from 'iUri' //i.e media is Renamed then Refesh Media list. TMPXAttribute uriAttrib(KMPXMediaGeneralUri); - TIdentityRelation match(&TMPXAttribute::Match); + TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match ); TInt index = aAttributes.Find(uriAttrib, match); if (KErrNotFound != index) - { - HBufC* modifiedUri = NULL; - TGlxMedia item = iItemMediaList->Item(0); - //Create the string convertor instance - CGlxUStringConverter* stringConverter = - CGlxUStringConverter::NewL(); - CleanupStack::PushL(stringConverter); + { + HBufC* modifiedUri = NULL; + TGlxMedia item = iItemMediaList->Item(0); + //Create the string convertor instance + CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); + CleanupStack::PushL(stringConverter); + //fetch media uri - stringConverter->AsStringL(item, aAttributes[index], 0, modifiedUri); - if (modifiedUri) + stringConverter->AsStringL(item,aAttributes[index],0, modifiedUri ); + CleanupStack::PopAndDestroy(stringConverter); + + //Check if media item was renamed + if (modifiedUri && modifiedUri->Compare(*iUri) != 0) { + //Set rename command as started since + //Rename is also possible from File Manager + iRenameStarted = ETrue; CleanupStack::PushL(modifiedUri); - //Check if media item was renamed - if (modifiedUri->CompareF(*iUri) != 0) - { - //Set rename command as started since - //Rename is also possible from File Manager - iRenameStarted = ETrue; - RefreshMediaListL(*modifiedUri); - } + RefreshMediaListL(*modifiedUri); CleanupStack::PopAndDestroy(modifiedUri); } - CleanupStack::PopAndDestroy(stringConverter); } } - + TMPXAttribute titleAttrib(KMPXMediaGeneralTitle); - TIdentityRelation match(&TMPXAttribute::Match); + TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match ); if (KErrNotFound != aAttributes.Find(titleAttrib, match)) { @@ -1103,117 +1064,118 @@ UpdateAlbumsL(); } } + } // ---------------------------------------------------------------------------- // HandleItemAddedL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleItemAddedL(TInt /*aStartIndex*/, - TInt /*aEndIndex*/, MGlxMediaList* aList) +void CGlxMetadataContainer::HandleItemAddedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, + MGlxMediaList* aList ) { TRACER("CGlxMetadataContainer::HandleItemAddedL()"); - - if (!iTagMediaList) - { + + if(!iTagMediaList) + { CreateTagsMediaListL(); - } - if (!iAlbumMediaList) - { - CreateAlbumsMediaListL(); - } - if (!iMarquee) - { + } + if(!iAlbumMediaList) + { + CreateAlbumsMediaListL(); + } + if(!iMarquee) + { EnableMarqueingL(); - } + } SetDurationLIicenseItemVisibilityL(); - if (aList == iTagMediaList) + if(aList == iTagMediaList) + { + UpdateTagsL(); + } + else if(aList == iAlbumMediaList) + { + UpdateAlbumsL(); + } + if(aList == iItemMediaList) { - 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 <= EDurationItem; index++) - { - HBufC* string = NULL; - iTextSetter.Zero(); + if(iItemMediaList->Count()) + { + TGlxMedia item = iItemMediaList->Item(0); + CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); + CleanupStack::PushL(stringConverter ); + for(TInt index = 0; index <= EDurationItem ; index++) + { + HBufC* string = NULL; + iTextSetter.Zero(); + + 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, + KGlxMediaGeneralLastModifiedDate, + 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 if(index == ElicenseItem) + { + // If an item is DRM protected, License field in details + // should display "View Details" + string = StringLoader::LoadL(R_GLX_METADATA_VIEW_OPTIONS_VIEW); + } + else + { + //no implementation + } + if(string) + { + iTextSetter.Copy(KGlxTextSetter); + iTextSetter.Append(*string); + } + CleanupStack::PushL( string ); + EditItemL(index,EFalse); + CleanupStack::PopAndDestroy(string ); + } + 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 if (index == ElicenseItem) - { - // If an item is DRM protected, License field in details - // should display "View Details" - string = StringLoader::LoadL( - R_GLX_METADATA_VIEW_OPTIONS_VIEW); - } - else - { - //no implementation - } - if (string) - { - iTextSetter.Append(*string); - } - CleanupStack::PushL(string); - EditItemL(index, EFalse); - CleanupStack::PopAndDestroy(string); - } - CleanupStack::PopAndDestroy(stringConverter); - - //Reopening Media list is completed - //& Rename Command is also completed - if (iRenameStarted) - { - iRenameStarted = EFalse; - //reset Setting Items to undimmed status - SetDimmed(iRenameStarted); - iAvkonAppUi->ProcessCommandL(EGlxCmdRenameCompleted); - } - } + //Reopening Media list is completed + //& Rename Command is also completed + if(iRenameStarted) + { + iRenameStarted = EFalse; + //reset Setting Items to undimmed status + SetDimmed(iRenameStarted); + iAvkonAppUi->ProcessCommandL(EGlxCmdRenameCompleted); + } + } } } // ---------------------------------------------------------------------------- @@ -1222,114 +1184,102 @@ // void CGlxMetadataContainer::EnableMarqueingL() { - TRACER("CGlxMetadataContainer::EnableMarqueingL()"); + TRACER("CGlxMetadataContainer::EnableMarqueingL()"); iMarquee = ETrue; ListBox()->UseLogicalToVisualConversion(ETrue); - ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams( - KMarqueeLoopCount, KMarqueeScrollAmount, KMarqueeScrollDelay, - KMarqueeScrollInterval); + 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 // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleCommandCompleteL(TAny* aSessionId, +void CGlxMetadataContainer::HandleCommandCompleteL(TAny* aSessionId, CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList) { TRACER("CGlxMetadataContainer::HandleCommandCompleteL()"); - + //Callback from MDS when rename the Title - if (aError == KErrNone) - { - if (aList == iItemMediaList && aCommandResult->IsSupported( - KMPXMediaGeneralTitle)) - { - GLX_LOG_INFO("RenameCMD to MDS completed"); - //Since RenameCommand to MDS is redundant and FileSystem has - //already renamed the file, so there is no need to do anything here - } - } - + if(aError == KErrNone) + { + if(aList == iItemMediaList && aCommandResult->IsSupported(KMPXMediaGeneralTitle)) + { + GLX_LOG_INFO("RenameCMD to MDS completed"); + //Since RenameCommand to MDS is redundant and FileSystem has + //already renamed the file, so there is no need to do anything here + } + } + //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) - { + if(aList == iItemMediaList && iLocationinfo + && static_cast( this ) == aSessionId) + { + TGlxMedia media = iItemMediaList->Item(0) ; + media.DeleteLocationAttribute(); + iLocationinfo = EFalse; + if ( aError == KErrNone ) + { iTextSetter.Zero(); - EditItemL(ELocationItem, EFalse); - } - } - } - + EditItemL(ELocationItem,EFalse); + } + } + } + // ---------------------------------------------------------------------------- -// HandleItemRemovedL +// HandleItemRemoved // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleItemRemovedL(TInt /*aStartIndex*/, - TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleItemRemovedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, + MGlxMediaList* /*aList*/ ) { - TRACER("CGlxMetadataContainer::HandleItemRemovedL()"); - //Ignore if this callback corresponds to a rename operation. - if (!iItemMediaList->Count() && !iIsPopupShown && !iRenameStarted) - { - iDialogObesrver.HandleItemRemovedL(); - } - } - + TRACER("CGlxMetadataContainer::HandleItemRemovedL()"); + } // ---------------------------------------------------------------------------- // HandleFocusChangedL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleFocusChangedL( - NGlxListDefs::TFocusChangeType /*aType*/, TInt /*aNewIndex*/, - TInt /*aOldIndex*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleFocusChangedL( NGlxListDefs:: + TFocusChangeType /*aType*/, TInt /*aNewIndex*/, TInt /*aOldIndex*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleFocusChangedL()"); } - // ---------------------------------------------------------------------------- -// HandleItemSelectedL +// HandleItemSelected // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleItemSelectedL(TInt /*aIndex*/, - TBool /*aSelected*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleItemSelectedL(TInt /*aIndex*/, + TBool /*aSelected*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleItemSelectedL"); } - // ---------------------------------------------------------------------------- // HandleMessageL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleMessageL(const CMPXMessage& /*aMessage*/, - MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleMessageL( const CMPXMessage& /*aMessage*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleMessageL()"); } - // ---------------------------------------------------------------------------- // HandleError // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleError(TInt /*aError*/) +void CGlxMetadataContainer::HandleError( TInt /*aError*/ ) { TRACER("CGlxMetadataContainer::HandleError()"); TRAP_IGNORE(HandleErrorL()); @@ -1343,117 +1293,114 @@ { TRACER("CGlxMetadataContainer::HandleErrorL()"); } - // ---------------------------------------------------------------------------- // HandleCommandCompleteL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleCommandCompleteL( - CMPXCommand* /*aCommandResult*/, TInt /*aError*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, + TInt /*aError*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleCommandCompleteL()"); } - + // ---------------------------------------------------------------------------- // HandleMediaL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleMediaL(TInt /*aListIndex*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleMediaL( TInt /*aListIndex*/, MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleMediaL()"); } - + // ---------------------------------------------------------------------------- // HandleItemModifiedL // ---------------------------------------------------------------------------- // -void CGlxMetadataContainer::HandleItemModifiedL( - const RArray& /*aItemIndexes*/, MGlxMediaList* /*aList*/) +void CGlxMetadataContainer::HandleItemModifiedL( const RArray& /*aItemIndexes*/, + MGlxMediaList* /*aList*/ ) { TRACER("CGlxMetadataContainer::HandleItemModifiedL()"); } - // ---------------------------------------------------------------------------- // ChangeMskL // ---------------------------------------------------------------------------- // void CGlxMetadataContainer::ChangeMskL() - { + { TRACER("CGlxMetadataContainer::ChangeMskL()"); CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); CleanupClosePushL(*uiUtility); switch (ListBox()->CurrentItemIndex()) { - case ENameItem: + case ENameItem: case EDescriptionItem: - case ETagsItem: - case EAlbumsItem: + case ETagsItem: + case EAlbumsItem: { - uiUtility->ScreenFurniture()->ModifySoftkeyIdL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - EAknSoftkeyEdit, R_GLX_METADATA_MSK_EDIT); - } - break; + uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, + EAknSoftkeyEdit,R_GLX_METADATA_MSK_EDIT); + } + break; case EDateAndTimeItem: case ELocationItem: case ESizeItem: case EDurationItem: case ElicenseItem: case EResolutionItem: - { - uiUtility->ScreenFurniture()->ModifySoftkeyIdL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - EAknSoftkeyEdit, R_GLX_METADATA_MSK_BLANK); - } - break; + { + uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, + EAknSoftkeyEdit,R_GLX_METADATA_MSK_BLANK); + } + break; default: - { - break; - } + { + break; + } } + CleanupStack::PopAndDestroy(uiUtility); - } - + } + // --------------------------------------------------------------------------- // Parse the drive, path & extension from the old uri, // And return the modified uri by appending the new title // --------------------------------------------------------------------------- TFileName CGlxMetadataContainer::ParseFileName(const TDesC& aTitleText) - { - TRACER("CGlxMetadataContainer::ParseFileName()"); - const TGlxMedia& media = iItemMediaList->Item(0); - TParsePtrC parsePtr(media.Uri()); + { + TRACER("CGlxMetadataContainer::ParseFileName()"); + const TGlxMedia& media = iItemMediaList->Item(0); + TParsePtrC parsePtr(media.Uri()); - TFileName destinationFileName; - destinationFileName.Append(parsePtr.DriveAndPath()); - destinationFileName.Append(aTitleText); - destinationFileName.Append(parsePtr.Ext()); + TFileName destinationFileName; + destinationFileName.Append(parsePtr.DriveAndPath()); + destinationFileName.Append(aTitleText); + destinationFileName.Append(parsePtr.Ext()); - return destinationFileName; - } + return destinationFileName; + } // --------------------------------------------------------------------------- // Refresh MediaList with modified FileName. // --------------------------------------------------------------------------- void CGlxMetadataContainer::RefreshMediaListL(const TDesC& aModifiedUri) - { - //Refresh media list since media is renamed + { + //Refresh media list since media is renamed TRACER("CGlxMetadataContainer::RefreshMediaListL()"); GLX_LOG_URI("CGlxMetadataContainer::RefreshMediaListL(%S)", &aModifiedUri); if (iUri) - { - delete iUri; - iUri = NULL; - } - //always points to current media name - iUri = aModifiedUri.AllocL(); - CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(*iUri); - CleanupStack::PushL(filter); + { + delete iUri; + iUri = NULL; + } + //always points to current media name + iUri = aModifiedUri.AllocL(); + CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(*iUri); + CleanupStack::PushL(filter); - //Update media list's filter - iItemMediaList->SetFilterL(filter); - CleanupStack::PopAndDestroy(filter); + //Update media list's filter + iItemMediaList->SetFilterL(filter); + CleanupStack::PopAndDestroy(filter); } //End of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp --- a/photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -28,7 +28,6 @@ #include #include // For CGlxCommandHandlerAddToContainer #include // For Kinetic Scrolling -#include //User includes #include @@ -55,85 +54,83 @@ // NewL // ----------------------------------------------------------------------------- // -EXPORT_C CGlxMetadataDialog* CGlxMetadataDialog::NewL(const TDesC& aUri) - { - TRACER("CGlxMetadataDialog::NewL"); +EXPORT_C CGlxMetadataDialog* CGlxMetadataDialog::NewL( const TDesC& aUri ) + { + TRACER("CGlxMetadataDialog::NewL"); + + CGlxMetadataDialog* self = new(ELeave) CGlxMetadataDialog(aUri ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } - CGlxMetadataDialog* self = new (ELeave) CGlxMetadataDialog(aUri); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } +CGlxMetadataDialog::CGlxMetadataDialog(const TDesC& aUri):iUri(aUri) +{ -CGlxMetadataDialog::CGlxMetadataDialog(const TDesC& aUri) : - iUri(aUri) - { - } - +} // ----------------------------------------------------------------------------- // ConstructL // ----------------------------------------------------------------------------- // void CGlxMetadataDialog::ConstructL() { - TRACER("CGlxMetadataDialog::ConstructL"); + TRACER("CGlxMetadataDialog::ConstructL"); - // Load dialog's resource file - InitResourceL(); + // Load dialog's resource file + InitResourceL(); - iStatusPaneAvailable = EFalse; - // set the title to the dialog, Note that avkon dialogs do not support - // setting the title in the status pane so we need to do it the hard way - // get status pane - CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); + iStatusPaneAvailable = EFalse; + // set the title to the dialog, Note that avkon dialogs do not support + // setting the title in the status pane so we need to do it the hard way + // get status pane + CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); - if (statusPane && statusPane->IsVisible()) - { - iStatusPaneAvailable = ETrue; - } + if (statusPane && statusPane->IsVisible()) + { + iStatusPaneAvailable = ETrue; + } - // make the toolbar disabled - SetDetailsDlgToolbarVisibility(EFalse); + // make the toolbar disabled + SetDetailsDlgToolbarVisibility(EFalse); - // do we have status pane - if (statusPane) - { - GLX_LOG_INFO1("GLX_UMP::CGlxMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible()); - // load the title text - HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, - iEikonEnv); - SetTitleL(*text); - if (text) - { - delete text; - } - iAvkonAppUi->StatusPane()->MakeVisible(ETrue); - } + // do we have status pane + if (statusPane) + { + GLX_LOG_INFO1("GLX_UMP::CGlxMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible()); + // load the title text + HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, + iEikonEnv ); + SetTitleL(*text); + if (text) + { + delete text; + } + iAvkonAppUi->StatusPane()->MakeVisible(ETrue); + } + + iUiUtility = CGlxUiUtility::UtilityL(); + TFileName uiutilitiesrscfile; + uiutilitiesrscfile.Append(CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL()); - iUiUtility = CGlxUiUtility::UtilityL(); - TFileName uiutilitiesrscfile; - uiutilitiesrscfile.Append( - CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL()); + iAddToTag = CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddTag, + EFalse, uiutilitiesrscfile); + iAddToAlbum = CGlxCommandHandlerAddToContainer::NewL(this, + EGlxCmdAddToAlbum, EFalse, uiutilitiesrscfile); - iAddToTag = CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddTag, - EFalse, uiutilitiesrscfile); - iAddToAlbum = CGlxCommandHandlerAddToContainer::NewL(this, - EGlxCmdAddToAlbum, EFalse, uiutilitiesrscfile); + // Call the base class' two-phased constructor + CAknDialog::ConstructL(R_METADATA_MENUBAR); - // Call the base class' two-phased constructor - CAknDialog::ConstructL(R_METADATA_MENUBAR); - - // Instantiate the command handler - iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this); + // Instantiate the command handler + iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this); - //steps to find kinetic scroll threshold value - CAknPhysics* physics = CAknPhysics::NewL(*this, NULL); - CleanupStack::PushL(physics); - iKineticDragThreshold = physics->DragThreshold(); - CleanupStack::PopAndDestroy(physics); - physics = NULL; - } + //steps to find kinetic scroll threshold value + CAknPhysics* physics = CAknPhysics::NewL(*this, NULL); + CleanupStack::PushL(physics); + iKineticDragThreshold = physics->DragThreshold(); + CleanupStack::PopAndDestroy(physics); + physics = NULL; + } // ----------------------------------------------------------------------------- // ~CGlxMetadataDialog @@ -220,76 +217,74 @@ // return the refernce of media list return iContainer->MediaList(); } - // ----------------------------------------------------------------------------- // ProcessCommandL // ----------------------------------------------------------------------------- // void CGlxMetadataDialog::ProcessCommandL( TInt aCommandId ) { - TRACER("CGlxMetadataDialog::ProcessCommandL"); - - // hide menu bar - iMenuBar->StopDisplayingMenuBar(); + TRACER("CGlxMetadataDialog::ProcessCommandL"); + + // hide menu bar + iMenuBar->StopDisplayingMenuBar(); - switch (aCommandId) - { - case EAknSoftkeyEdit: - case EAknSoftkeyCancel: - case EAknSoftkeySelect: - case EAknSoftkeyOk: - { - TryExitL(aCommandId); - break; - } + switch( aCommandId ) + { + case EAknSoftkeyEdit: + case EAknSoftkeyCancel: + case EAknSoftkeySelect: + case EAknSoftkeyOk: + { + TryExitL( aCommandId ); + break; + } - case EAknCmdHelp: - { - TCoeHelpContext helpContext; - helpContext.iMajor = TUid::Uid(KGlxGalleryApplicationUid); - helpContext.iContext.Copy(LGAL_HLP_DETAILS_VIEW); - const TInt KListSz = 1; - CArrayFix* contextList = - new (ELeave) CArrayFixFlat (KListSz); - CleanupStack::PushL(contextList); - contextList->AppendL(helpContext); - HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), - contextList); - CleanupStack::Pop(contextList); - break; - } - case KGlxDeleteBoundMenuCommandId: - { - //Event passed on to container to handle - //Delete the location information of the data. - iContainer->RemoveLocationL(); - break; - } - case KGlxEditBoundMenuCommandId: - case KGlxViewBoundMenuCommandId: - { - //To edit the details - forward the event to container to edit - //Both edit and view details command are handled in the same function based on the item. - iContainer->HandleListboxChangesL(); - break; - } - case EGlxCmdAiwBase: - { - // pass aCommandId to command handler - iMetadataCmdHandler->DoExecuteL(aCommandId, MediaList()); - } - default: - break; - } - } - + case EAknCmdHelp: + { + TCoeHelpContext helpContext; + helpContext.iMajor = TUid::Uid( KGlxGalleryApplicationUid ); + helpContext.iContext.Copy( LGAL_HLP_DETAILS_VIEW ); + const TInt KListSz = 1; + CArrayFix* contextList = + new (ELeave) CArrayFixFlat( KListSz ); + CleanupStack::PushL(contextList); + contextList->AppendL(helpContext); + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), contextList ); + CleanupStack::Pop( contextList ); + break; + } + case KGlxDeleteBoundMenuCommandId: + { + //Event passed on to container to handle + //Delete the location information of the data. + iContainer->RemoveLocationL(); + break; + } + case KGlxEditBoundMenuCommandId: + case KGlxViewBoundMenuCommandId: + { + //To edit the details - forward the event to container to edit + //Both edit and view details command are handled in the same function based on the item. + iContainer->HandleListboxChangesL(); + break; + } + case EGlxCmdAiwBase: + { + // pass aCommandId to command handler + iMetadataCmdHandler->DoExecuteL( aCommandId, MediaList() ); + } + default: + break; + } + } //----------------------------------------------------------------------------- // CGlxMetadataDialog::CreateCustomControlL //----------------------------------------------------------------------------- SEikControlInfo CGlxMetadataDialog::CreateCustomControlL(TInt aControlType) { - TRACER("CGlxMetadataDialog::CreateCustomControlL"); + GLX_LOG_INFO("CShwSlideshowSettingsDialog::CreateCustomControlL"); // create control info, no flags or trailer text set SEikControlInfo controlInfo; @@ -305,6 +300,7 @@ return controlInfo; // returns ownership of ItemList } + // ----------------------------------------------------------------------------- // CGlxMetadataDialog::OfferKeyEventL // ----------------------------------------------------------------------------- @@ -312,34 +308,34 @@ TKeyResponse CGlxMetadataDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { - TRACER("CGlxMetadataDialog::OfferKeyEventL"); - TKeyResponse response = EKeyWasNotConsumed; - switch (aKeyEvent.iCode) - { - case EKeyUpArrow: - case EKeyDownArrow: - { - if (!iUiUtility->IsPenSupported()) - { - iContainer->ChangeMskL(); - } - iContainer->EnableMarqueingL(); - break; - } - default: - break; - } - if (response == EKeyWasNotConsumed) - { - // container didn't consume the key so try the base class - // this is crucial as platform uses a key event to dismiss dialog - // when a view changes to another. the base class also consumes all - // the keys we dont want to handle automatically as this is a - // blocking dialog - response = CAknDialog::OfferKeyEventL(aKeyEvent, aType); - } - return response; - } + TRACER("CGlxMetadataDialog::OfferKeyEventL"); + TKeyResponse response = EKeyWasNotConsumed; + switch(aKeyEvent.iCode) + { + case EKeyUpArrow: + case EKeyDownArrow: + { + if(!iUiUtility->IsPenSupported()) + { + iContainer->ChangeMskL(); + } + iContainer->EnableMarqueingL(); + break; + } + default: + break; + } + if ( response == EKeyWasNotConsumed ) + { + // container didn't consume the key so try the base class + // this is crucial as platform uses a key event to dismiss dialog + // when a view changes to another. the base class also consumes all + // the keys we dont want to handle automatically as this is a + // blocking dialog + response = CAknDialog::OfferKeyEventL( aKeyEvent, aType ); + } + return response; + } // ----------------------------------------------------------------------------- // CGlxMetadataDialog::DynInitMenuPaneL @@ -404,6 +400,14 @@ return retVal; } +//----------------------------------------------------------------------------- +// CGlxMetadataDialog::SizeChanged +//----------------------------------------------------------------------------- +void CGlxMetadataDialog::SizeChanged() + { + TRACER("CGlxMetadataDialog::SizeChanged"); + CAknDialog::SizeChanged(); + } // ----------------------------------------------------------------------------- // CGlxMetadataDialog::InitResourceL // ----------------------------------------------------------------------------- @@ -411,6 +415,7 @@ void CGlxMetadataDialog::InitResourceL() { TRACER("CGlxMetadataDialog::InitResourceL"); + _LIT(KGlxMetadataDialogResource,"glxmetadatadialog.rsc"); //add resource file TParse parse; @@ -421,6 +426,7 @@ iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile); } + // ----------------------------------------------------------------------------- // CGlxMetadataDialog::HandleViewCommandL // ----------------------------------------------------------------------------- @@ -430,21 +436,44 @@ TRACER("CGlxMetadataDialog::HandleViewCommandL"); return EFalse; } - +// --------------------------------------------------------------------------- +// CGlxMetadataDialog::PreLayoutDynInitL +// --------------------------------------------------------------------------- +// +void CGlxMetadataDialog::PreLayoutDynInitL() + { + // No Implementation + } + //----------------------------------------------------------------------------- // CGlxMetadataDialog::PostLayoutDynInitL //----------------------------------------------------------------------------- // void CGlxMetadataDialog::PostLayoutDynInitL() - { - TRACER("CGlxMetadataDialog::PostLayoutDynInitL"); - if (!iUiUtility->IsPenSupported()) - { - iUiUtility->ScreenFurniture()->ModifySoftkeyIdL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - EAknSoftkeyEdit, R_GLX_METADATA_MSK_EDIT); - } - } + { + TRACER("CGlxMetadataDialog::PostLayoutDynInitL"); + if(!iUiUtility->IsPenSupported()) + { + iUiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, + EAknSoftkeyEdit,R_GLX_METADATA_MSK_EDIT); + } + } + +//----------------------------------------------------------------------------- +// CGlxMetadataDialog::Draw +//----------------------------------------------------------------------------- +// +void CGlxMetadataDialog::Draw( const TRect& /*aRect*/ ) const + { + TRACER("CGlxMetadataDialog::Draw"); + TRect rect; + AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect); + + // Get the standard graphics context + CWindowGc& gc = SystemGc(); + gc.SetBrushColor(KRgbWhite); + gc.DrawRect(rect); + } //----------------------------------------------------------------------------- // CGlxMetadataDialog::HandlePointerEventL @@ -453,51 +482,50 @@ void CGlxMetadataDialog::HandlePointerEventL( 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); - + 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 + if(aPointerEvent.iType == TPointerEvent::EButton1Down || aPointerEvent.iType == TPointerEvent::EButton2Down || aPointerEvent.iType == TPointerEvent::EButton3Down || aPointerEvent.iType == TPointerEvent::EDrag) { - if (aPointerEvent.iType != TPointerEvent::EDrag) + if(aPointerEvent.iType != TPointerEvent::EDrag) { - iViewDragged = EFalse; + iViewDragged = EFalse; } - - if (aPointerEvent.iType == TPointerEvent::EDrag) + + if(aPointerEvent.iType == TPointerEvent::EDrag) { - TInt delta = iPrev.iY - aPointerEvent.iPosition.iY; - //Check for physics threshold, if not more than threshold, we can - //still continue marqueeing - TInt deltaAbs = delta < 0 ? -delta : delta; - if (!iViewDragged && deltaAbs >= iKineticDragThreshold) - { - iViewDragged = ETrue; - } + TInt delta = iPrev.iY - aPointerEvent.iPosition.iY; + //Check for physics threshold, if not more than threshold, we can + //still continue marqueeing + TInt deltaAbs = delta < 0 ? -delta : delta; + if(!iViewDragged && deltaAbs >= iKineticDragThreshold) + iViewDragged = ETrue; } - - //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. - if (!iViewDragged) + + //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. + if(!iViewDragged) { - iContainer->EnableMarqueingL(); + iContainer->EnableMarqueingL(); } } - + //record positions unless it is drag event - if (aPointerEvent.iType != TPointerEvent::EDrag) + if(aPointerEvent.iType != TPointerEvent::EDrag) { iPrev = aPointerEvent.iPosition; } - } + } // --------------------------------------------------------------------------- // CGlxMetadataDialog::OnLocationEditL @@ -510,43 +538,28 @@ } // --------------------------------------------------------------------------- -// CGlxMetadataDialog::AddTagL +// CGlxMetadataDialog::AddTag // --------------------------------------------------------------------------- // void CGlxMetadataDialog::AddTagL() - { - TRACER("CGlxMetadataDialog::AddTagL"); +{ iAddToTag->ExecuteL(EGlxCmdAddTag); - } - +} // --------------------------------------------------------------------------- -// CGlxMetadataDialog::AddAlbumL +// CGlxMetadataDialog::AddAlbum // --------------------------------------------------------------------------- // void CGlxMetadataDialog::AddAlbumL() - { - TRACER("CGlxMetadataDialog::AddAlbumL"); +{ iAddToAlbum->ExecuteL(EGlxCmdAddToAlbum); - } - -// --------------------------------------------------------------------------- -// CGlxMetadataDialog::HandleItemRemovedL -// --------------------------------------------------------------------------- -// -void CGlxMetadataDialog::HandleItemRemovedL() - { - TRACER("CGlxMetadataDialog::HandleItemRemovedL"); - Extension()->iPublicFlags.Set(CEikDialogExtension::EDelayedExit); - ProcessCommandL(EAknSoftkeyCancel); - Extension()->iPublicFlags.Clear(CEikDialogExtension::EDelayedExit); - } +} // --------------------------------------------------------------------------- // CGlxMetadataDialog::SetTitleL() // --------------------------------------------------------------------------- void CGlxMetadataDialog::SetTitleL(const TDesC& aTitleText) { - TRACER("CGlxMetadataDialog::SetTitleL"); + TRACER("CGlxFetcherContainer::SetTitleL"); CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); CleanupStack::PushL(statusPane); // get pointer to the default title pane control @@ -570,7 +583,7 @@ // --------------------------------------------------------------------------- void CGlxMetadataDialog::SetPreviousTitleL() { - TRACER("CGlxMetadataDialog::SetPreviousTitleL"); + TRACER("CGlxFetcherContainer::SetPreviousTitleL"); CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); CleanupStack::PushL(prevStatusPane); CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL( @@ -584,6 +597,16 @@ CleanupStack::Pop(prevTitlePane); CleanupStack::Pop(prevStatusPane); } +// ----------------------------------------------------------------------------- +// CGlxMetadataDialog::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CGlxMetadataDialog::HandleResourceChange( TInt aType ) + { + TRACER("CGlxMetadataDialog::HandleResourceChange"); + //Handle global resource changes, such as scalable UI or skin events and orientation change (override) + CAknDialog::HandleResourceChange( aType ); + } // ----------------------------------------------------------------------------- // CGlxMetadataDialog::HandleToolbarResetting @@ -592,6 +615,7 @@ void CGlxMetadataDialog::HandleToolbarResetting(TBool aVisible) { TRACER("CGlxMetadataDialog::HandleToolbarResetting"); + CAknToolbar* popupToolbar = iAvkonAppUi->PopupToolbar(); if(popupToolbar) { @@ -611,8 +635,7 @@ } } -void CGlxMetadataDialog::ViewPositionChanged(const TPoint& /*aNewPosition*/, - TBool /*aDrawNow*/, TUint /*aFlags*/) +void CGlxMetadataDialog::ViewPositionChanged( const TPoint& /*aNewPosition*/, TBool /*aDrawNow*/, TUint /*aFlags*/ ) { //Dummy implementation } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def --- a/photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/bwins/glxviewbaseu.def Wed Oct 13 14:32:09 2010 +0300 @@ -27,17 +27,17 @@ ?DoViewAnimationL@CGlxViewBase@@MAEXW4TGlxViewswitchAnimation@@W4TGlxNavigationDirection@@@Z @ 26 NONAME ; void CGlxViewBase::DoViewAnimationL(enum TGlxViewswitchAnimation, enum TGlxNavigationDirection) ??1CGlxViewBase@@UAE@XZ @ 27 NONAME ; CGlxViewBase::~CGlxViewBase(void) ?SetTitleL@CGlxViewBase@@QAEXABVTDesC16@@@Z @ 28 NONAME ; void CGlxViewBase::SetTitleL(class TDesC16 const &) - ?GetToolBar@CGlxViewBase@@QAEPAVCAknToolbar@@XZ @ 29 NONAME ; class CAknToolbar * CGlxViewBase::GetToolBar(void) - ??0CGlxMediaListViewBase@@QAE@XZ @ 30 NONAME ; CGlxMediaListViewBase::CGlxMediaListViewBase(void) - ?DisableTitle@CGlxViewBase@@QAEXXZ @ 31 NONAME ; void CGlxViewBase::DisableTitle(void) - ?SetGridToolBar@CGlxViewBase@@QAEXPAVCAknToolbar@@@Z @ 32 NONAME ; void CGlxViewBase::SetGridToolBar(class CAknToolbar *) - ?HandleCommandL@CGlxViewBase@@EAEXH@Z @ 33 NONAME ; void CGlxViewBase::HandleCommandL(int) - ?FetchAttributesForCommandL@CGlxViewBase@@MAEXH@Z @ 34 NONAME ; void CGlxViewBase::FetchAttributesForCommandL(int) - ??1CGlxTitleFetcher@@UAE@XZ @ 35 NONAME ; CGlxTitleFetcher::~CGlxTitleFetcher(void) - ?OfferToolbarEventL@CGlxViewBase@@MAEXH@Z @ 36 NONAME ; void CGlxViewBase::OfferToolbarEventL(int) - ?ViewDeactivated@CGlxViewBase@@MAEXXZ @ 37 NONAME ; void CGlxViewBase::ViewDeactivated(void) - ?FetchAttributesL@CGlxViewBase@@MAEXXZ @ 38 NONAME ; void CGlxViewBase::FetchAttributesL(void) - ?DoPrepareCommandHandlerL@CGlxMediaListViewBase@@MAEXPAVCGlxCommandHandler@@@Z @ 39 NONAME ; void CGlxMediaListViewBase::DoPrepareCommandHandlerL(class CGlxCommandHandler *) - ?FetchAttributesForCommandL@CGlxMediaListViewBase@@EAEXH@Z @ 40 NONAME ; void CGlxMediaListViewBase::FetchAttributesForCommandL(int) - ?SetToolbarStateL@CGlxViewBase@@MAEXXZ @ 41 NONAME ; void CGlxViewBase::SetToolbarStateL(void) + ??0CGlxMediaListViewBase@@QAE@XZ @ 29 NONAME ; CGlxMediaListViewBase::CGlxMediaListViewBase(void) + ?DisableTitle@CGlxViewBase@@QAEXXZ @ 30 NONAME ; void CGlxViewBase::DisableTitle(void) + ?HandleCommandL@CGlxViewBase@@EAEXH@Z @ 31 NONAME ; void CGlxViewBase::HandleCommandL(int) + ?FetchAttributesForCommandL@CGlxViewBase@@MAEXH@Z @ 32 NONAME ; void CGlxViewBase::FetchAttributesForCommandL(int) + ??1CGlxTitleFetcher@@UAE@XZ @ 33 NONAME ; CGlxTitleFetcher::~CGlxTitleFetcher(void) + ?OfferToolbarEventL@CGlxViewBase@@MAEXH@Z @ 34 NONAME ; void CGlxViewBase::OfferToolbarEventL(int) + ?ViewDeactivated@CGlxViewBase@@MAEXXZ @ 35 NONAME ; void CGlxViewBase::ViewDeactivated(void) + ?FetchAttributesL@CGlxViewBase@@MAEXXZ @ 36 NONAME ; void CGlxViewBase::FetchAttributesL(void) + ?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 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def --- a/photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/eabi/glxviewbaseu.def Wed Oct 13 14:32:09 2010 +0300 @@ -52,8 +52,8 @@ _ZTV20MGlxMediaListFactory @ 51 NONAME _ZTV21CGlxMediaListViewBase @ 52 NONAME _ZThn12_N12CGlxViewBase16DynInitMenuPaneLEiP12CEikMenuPane @ 53 NONAME - _ZThn172_N21CGlxMediaListViewBase9MediaListEv @ 54 NONAME - _ZThn176_N21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 55 NONAME + _ZThn168_N21CGlxMediaListViewBase9MediaListEv @ 54 NONAME + _ZThn172_N21CGlxMediaListViewBase21HandleTitleAvailableLERK7TDesC16 @ 55 NONAME _ZThn4_N12CGlxViewBase14ViewActivatedLERK10TVwsViewId4TUidRK6TDesC8 @ 56 NONAME _ZThn4_N12CGlxViewBase15ViewDeactivatedEv @ 57 NONAME _ZThn80_N12CGlxViewBase17AnimationCompleteEP13MGlxAnimation @ 58 NONAME diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/group/glxviewbase.mmp --- a/photosgallery/viewframework/views/viewbase/group/glxviewbase.mmp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/group/glxviewbase.mmp Wed Oct 13 14:32:09 2010 +0300 @@ -109,8 +109,7 @@ LIBRARY libc.lib LIBRARY libglib.lib LIBRARY glxcommandhandlerbase.lib -LIBRARY glxcommonui.lib //added as per single clk chngs -LIBRARY gfxtrans.lib //For GfxTransEffect +LIBRARY glxcommonui.lib //added as per single clk chngs // End of File SOURCEPATH ../src \ No newline at end of file diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/inc/glxviewbase.h --- a/photosgallery/viewframework/views/viewbase/inc/glxviewbase.h Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/inc/glxviewbase.h Wed Oct 13 14:32:09 2010 +0300 @@ -253,9 +253,6 @@ /// The view animation time TInt iViewAnimationTime; - - /// Status of FullScreen Transition is started - TBool iIsTransEffectStarted; private: /** * Functions to handle view activate asynchronously diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp --- a/photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -169,11 +169,8 @@ if ((navigationalState->Id() != TMPXItemId( KGlxCollectionPluginAlbumsImplementationUid))) { - if (!iPreloadContextForCommandHandlers) - { - iPreloadContextForCommandHandlers - = new (ELeave) CGlxAttributeContext(&iSelectionIterator); - } + iPreloadContextForCommandHandlers + = new (ELeave) CGlxAttributeContext(&iSelectionIterator); TInt commandHandlerCount = iCommandHandlerList.Count(); for (TInt i = 0; i < commandHandlerCount; i++) { @@ -393,8 +390,6 @@ if (iPreloadContextForCommandHandlers) { iMediaList->RemoveContext(iPreloadContextForCommandHandlers); - delete iPreloadContextForCommandHandlers; - iPreloadContextForCommandHandlers = NULL; } iMediaList->Close(); iMediaList = NULL; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/src/glxtoolbarcontroller.cpp --- a/photosgallery/viewframework/views/viewbase/src/glxtoolbarcontroller.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/src/glxtoolbarcontroller.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -225,10 +225,7 @@ TRAPD(err, CheckShareonlineVersionL()); GLX_LOG_INFO2("CGlxToolbarController::SetStatusOnViewActivationL(%d)," " err(%d)", aList->Count(), err); - if (iToolbar->IsDimmed()) - { - iToolbar->SetDimmed(EFalse); - } + CGlxNavigationalState* navigationalState = CGlxNavigationalState::InstanceL(); CleanupClosePushL(*navigationalState); @@ -322,21 +319,13 @@ if (navigationalState->ViewingMode() == NGlxNavigationalState::EView) { SetToolbarItemsDimmed(EFalse); - TInt focusIndex = aList->FocusIndex(); - if (focusIndex >= 0 && focusIndex < aList->Count()) - { - TBool dimmed = (EMPXVideo - == aList->Item(focusIndex).Category()); - iToolbar->SetItemDimmed(EGlxCmdSlideshowPlay, dimmed, ETrue); - } - } + } else if (navigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) { TBool dimmed = aList->SelectionCount() ? EFalse : ETrue; iToolbar->SetItemDimmed(EGlxCmdSend, dimmed, ETrue); iToolbar->SetItemDimmed(EGlxCmdUpload, dimmed, ETrue); - iToolbar->SetItemDimmed(EGlxCmdSlideshowPlay, EFalse, ETrue); } CleanupStack::PopAndDestroy(navigationalState); } @@ -393,7 +382,6 @@ iToolbar->SetItemDimmed(EGlxCmdStartMultipleMarking, aDimmed, ETrue); iToolbar->SetItemDimmed(EGlxCmdSend, aDimmed, ETrue); iToolbar->SetItemDimmed(EGlxCmdUpload, aDimmed, ETrue); - iToolbar->SetItemDimmed(EGlxCmdDelete, aDimmed, ETrue); } } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp --- a/photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -43,9 +43,6 @@ #include // for getting the button state -// For transition effects -#include - _LIT(KGlxViewBaseResource, "glxviewbase.rsc"); /// Length of time a view-switch animation should take @@ -57,7 +54,6 @@ // EXPORT_C CGlxViewBase::CGlxViewBase(TBool aSyncActivation) : iViewAnimationTime(KGlxViewSwitchAnimationDuration), - iIsTransEffectStarted(EFalse), iViewAnimationInProgress(EGlxViewAnimationNone), iSyncActivation(aSyncActivation) { @@ -551,6 +547,10 @@ CAknToolbar* toolbar = GetToolBar(); if(toolbar) { + CAknButton* slideshowButton = + static_cast (toolbar->ControlOrNull(EGlxCmdSlideshow)); + TBool slideshowdimmed = EFalse; + //Here after the toolbar cmd is processed it is enabled //back. For share the toolbar state should be same as it was //earlier, so we take the current state and reset back after @@ -562,35 +562,28 @@ CAknButton* markButton = static_cast (toolbar->ControlOrNull(EGlxCmdStartMultipleMarking)); TBool markButtondimmed = EFalse; - - CAknButton* deleteButton = - static_cast (toolbar->ControlOrNull(EGlxCmdDelete)); - TBool deleteButtondimmed = EFalse; - - CAknButton* sendButton = - static_cast (toolbar->ControlOrNull(EGlxCmdSend)); - TBool sendButtondimmed = EFalse; + + if(slideshowButton) + { + // Get current button state + CAknButtonState* currentState = slideshowButton->State(); + slideshowdimmed = slideshowButton->IsDimmed(); + } if(markButton) { + // Get current button state + CAknButtonState* currentState = markButton->State(); markButtondimmed = markButton->IsDimmed(); } if(uploadButton) { + // Get current button state + CAknButtonState* currentState = uploadButton->State(); uploaddimmed = uploadButton->IsDimmed(); - } - - if(deleteButton) - { - deleteButtondimmed = deleteButton->IsDimmed(); } - - if(sendButton) - { - sendButtondimmed = sendButton->IsDimmed(); - } - + // Deactivate the toolbar. Don't accept the toolbar input when the command // execution is already in progress. SetToolbarItemsDimmed(ETrue); @@ -602,28 +595,20 @@ // after command execution. SetToolbarStateL(); - // Note: Slideshow toolbar item update is done - // at CGlxToolbarController::SetStatusL() - if(!markButtondimmed) { toolbar->SetItemDimmed(EGlxCmdStartMultipleMarking, EFalse, ETrue); } + if(!slideshowdimmed) + { + toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, EFalse, ETrue); + } + if(uploaddimmed || (aCommand == EGlxCmdStartMultipleMarking)) { toolbar->SetItemDimmed(EGlxCmdUpload, ETrue, ETrue); } - - if(!deleteButtondimmed) - { - toolbar->SetItemDimmed(EGlxCmdDelete, EFalse, ETrue); - } - - if(!sendButtondimmed) - { - toolbar->SetItemDimmed(EGlxCmdSend, EFalse, ETrue); - } } } @@ -725,14 +710,6 @@ iCommandHandlerList[i]->ActivateL(Id().iUid); i++; } - - //Check if transition effect is already started. - //Calling the 'EndFullScreen()' actually starts the FS transition effect. - if(iIsTransEffectStarted) - { - GfxTransEffect::EndFullScreen(); - iIsTransEffectStarted = EFalse; - } InitAnimationL(EGlxViewAnimationEntry); } @@ -750,8 +727,6 @@ toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, aDimmed, ETrue); toolbar->SetItemDimmed(EGlxCmdStartMultipleMarking, aDimmed, ETrue); toolbar->SetItemDimmed(EGlxCmdUpload, aDimmed, ETrue); - toolbar->SetItemDimmed(EGlxCmdDelete, aDimmed, ETrue); - toolbar->SetItemDimmed(EGlxCmdSend, aDimmed, ETrue); } } diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp --- a/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -490,6 +490,19 @@ } else { + TInt focus = iMediaList.FocusIndex(); + const TGlxMedia item = iMediaList.Item(focus); + TGlxIdSpaceId spaceId = iMediaList.IdSpaceId(focus); + GLX_LOG_INFO("CGlxZoomControl::HandleZoomForegroundEvent - Get the FS texture"); + // Get the texture created in fullscreen view. + TRAPD(err, iImageTexture = &(iTextureMgr->CreateNewTextureForMediaL( + ScreenSize(), item, spaceId, this))); + + if (iImageTexture && iImageTexture->HasContent() && KErrNone == err) + { + GLX_LOG_INFO("CGlxZoomControl::HandleZoomForegroundEvent - Show the FS texture"); + iImageVisual->SetImage(*iImageTexture); + } iGPUMemMonitor->RequestMemory(); } } @@ -552,9 +565,11 @@ // TextureContentChangedL // ----------------------------------------------------------------------------- // -void CGlxZoomControl::TextureContentChangedL( TBool /*aHasContent*/ , CAlfTexture* aNewTexture) +void CGlxZoomControl::TextureContentChangedL(TBool aHasContent, + CAlfTexture* aNewTexture) { TRACER("CGlxZoomControl::TextureContentChangedL "); + GLX_LOG_INFO2("CGlxZoomControl::TextureContentChangedL() aNewTexture=%x, aHasContent=%d", aNewTexture, aHasContent); //if both the textures are null that means we do not have memory to //decode and show anything. So try and check if the fullscreen texture //is created by now if not then go to fullscreen view. @@ -563,40 +578,43 @@ { if(NULL == iImageTexture) { - TSize TextureSize = ScreenSize(); + TSize textureSize = ScreenSize(); TInt focus = iMediaList.FocusIndex(); TGlxMedia item = iMediaList.Item( focus ); TGlxIdSpaceId idspace = iMediaList.IdSpaceId( focus ); CAlfTexture* newTexture = NULL; - //Get the texture Created in fullscreen View. - TRAPD(errtexture, newTexture = &(iTextureMgr->CreateNewTextureForMediaL( - TextureSize,item, idspace, this ))); + // Get the texture created in fullscreen view. + TRAPD(err, newTexture = &(iTextureMgr->CreateNewTextureForMediaL( + textureSize,item, idspace, this))); - if(errtexture != KErrNone) + GLX_LOG_INFO2("CGlxZoomControl::TextureContentChangedL(1) newTexture=%x, err=%d", newTexture, err); + if(newTexture && newTexture->HasContent() && err == KErrNone) { - GLX_LOG_INFO( "CGlxTextureManagerImpl::HandleBitmapDecodedL::CreateNewTextureForMediaL Failed"); - //Exit zoom and goto fullscreen - HandleZoomOutL(KGlxZoomOutCommand); + GLX_LOG_INFO("CGlxZoomControl::TextureContentChangedL:Show FS texture"); + // Show the fullscreen texture. + iImageTexture = newTexture; + iImageVisual->SetImage(*iImageTexture); } else { - //show the fullscreen texture. - iImageTexture = newTexture; - iImageVisual->SetImage( *iImageTexture ); + GLX_LOG_INFO("CGlxZoomControl::TextureContentChangedL:CreateNewTextureForMediaL Failed"); + // Exit zoom and goto fullscreen + HandleZoomOutL(KGlxZoomOutCommand); } } - else + else if (iImageTexture->HasContent()) { - //show the existing first level decoded image texture in case second level - //decoding fails - iImageVisual->SetImage( *iImageTexture ); + // Show the existing decoded image texture + GLX_LOG_INFO("CGlxZoomControl::TextureContentChangedL - Show the existing texture"); + iImageVisual->SetImage(*iImageTexture); } } - else + else if (aHasContent && aNewTexture->HasContent()) { + GLX_LOG_INFO("CGlxZoomControl::TextureContentChangedL - Show the NEW texture"); iImageTexture = aNewTexture; - iImageVisual->SetImage( *iImageTexture ); + iImageVisual->SetImage(*iImageTexture); } } @@ -960,7 +978,6 @@ { //Refeed the textures if we are coming back to foreground from background //To Retrive the image details - TMPXAttribute thumbNailAttribute(0, 0); TInt focusIndex = iMediaList.FocusIndex(); TGlxIdSpaceId idspace = iMediaList.IdSpaceId(focusIndex); //Get the texture Created in fullscreen View. @@ -968,16 +985,17 @@ // if we already have the decoded zoomed image bitmap use the texture corresponding to that. // Else make do with the fullscreen texture till that happens. - TRAP_IGNORE(iImageTexture = - iTextureMgr->CreateZoomedTextureL()); + TRAPD(err, iImageTexture = iTextureMgr->CreateZoomedTextureL()); - if (NULL == iImageTexture) + GLX_LOG_INFO2("CGlxZoomControl::HandleGoomMemoryReleased(1) iImageTexture=%x err=%d", iImageTexture, err); + if (!iImageTexture || KErrNone != err) { - TRAP_IGNORE(iImageTexture = &(iTextureMgr->CreateNewTextureForMediaL( + TRAP(err, iImageTexture = &(iTextureMgr->CreateNewTextureForMediaL( ScreenSize(), item, idspace, this))) } - if (NULL != iImageTexture) + GLX_LOG_INFO2("CGlxZoomControl::HandleGoomMemoryReleased(2) iImageTexture=%x err=%d", iImageTexture, err); + if (iImageTexture && iImageTexture->HasContent() && KErrNone == err) { iImageVisual->SetImage(*iImageTexture); return; diff -r 5b238bc8ffb6 -r 01504893d9cb photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp --- a/photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp Wed Sep 15 12:13:06 2010 +0300 +++ b/photosgallery/viewframework/visuallistmanager/src/glxvisuallistwindow.cpp Wed Oct 13 14:32:09 2010 +0300 @@ -146,9 +146,9 @@ object.SetScaleMode(CAlfImageVisual::EScaleNormal); } - // Keep the visual invisible to avoid showing wrong visual in the starting, - // Effect control will make it visisble - object.SetVisible( EFalse ); + // show the object. do this before notifying control, to show + // at the image if control leaves + object.SetVisible( ETrue ); // notify observer iControl->HandleVisualAddedL( object.Visual(), aIndex );