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 // -----------------------------------------------------------------------------